def printUsage():
 format = 'Usage: %s <opts1> [<opts2>] <root> [<resources>]'
 print (format % basename(sys.argv[0]))
 print
 print '       with arguments:'
 print '           (mandatory) root:         the package root folder'
 print '           (optional)  resources:    the package resources folder'
 print
 print '       and options:'
 print '           (mandatory) opts1:'
 mandatoryKeys = string.split('Title Version Description', ' ')
 for k in mandatoryKeys:
  print ('               --%s' % k)
 print '           (optional) opts2: (with default values)'
 pmDefaults = PackageMaker.packageInfoDefaults
 optionalKeys = pmDefaults.keys()
 for k in mandatoryKeys:
  optionalKeys.remove(k)
 optionalKeys.sort()
 maxKeyLen = max(map(len, optionalKeys))
 for k in optionalKeys:
  format = '               --%%s:%s %%s'
  format = (format % (' ' * (maxKeyLen - len(k))))
  print (format % (k, repr(pmDefaults[k])))

def printUsage ( ) : format = 'Usage: %s <opts1> [<opts2>] <root> [<resources>]' print ( format % basename ( sys . argv [ 0 ] ) ) print print '       with arguments:' print '           (mandatory) root:         the package root folder' print '           (optional)  resources:    the package resources folder' print print '       and options:' print '           (mandatory) opts1:' mandatoryKeys = string . split ( 'Title Version Description' , ' ' ) for k in mandatoryKeys : print ( '               --%s' % k ) print '           (optional) opts2: (with default values)' pmDefaults = PackageMaker . packageInfoDefaults optionalKeys = pmDefaults . keys ( ) for k in mandatoryKeys : optionalKeys . remove ( k ) optionalKeys . sort ( ) maxKeyLen = max ( map ( len , optionalKeys ) ) for k in optionalKeys : format = '               --%%s:%s %%s' format = ( format % ( ' ' * ( maxKeyLen - len ( k ) ) ) ) print ( format % ( k , repr ( pmDefaults [ k ] ) ) )
print usage message .