59
60
command_list = ['create', 'update', 'download', 'remove', \
60
61
'clean', 'showpkg', 'dump', 'unmet', 'search', \
61
62
'show', 'depends', 'pkgnames']
62
usage = 'usage: %prog project command [options]\n\n' + \
63
'Actions (if none is specified, Keryx will enter ' + \
63
usage = 'usage: %prog project command [options]\n\n' \
64
'Actions (if none is specified, Keryx will enter ' \
65
66
version = __version__
66
description = 'create - Create a new project ' + \
68
'update - Get updated package list from the ' + \
70
'download - Download selected packages for ' + \
72
'remove - Removes a package from the download ' + \
74
'clean - Removes all the packages from the ' + \
76
'showpkg - Display general information for a ' + \
78
'search - Display packages that match the ' + \
80
'show - Display information about a ' + \
81
'particular package ' + \
82
'depends - Display the dependencies for a ' + \
83
'particular package ' + \
67
description = 'create - Create a new project ' \
69
'update - Get updated package list from the ' \
71
'download - Download selected packages for ' \
73
'remove - Removes a package from the download ' \
75
'clean - Removes all the packages from the ' \
77
'showpkg - Display general information for a ' \
79
'search - Display packages that match the ' \
81
'show - Display information about a ' \
82
'particular package ' \
83
'depends - Display the dependencies for a ' \
84
'particular package ' \
84
85
'pkgnames - List the names of all the packages'
85
86
parser = OptionParser(usage, description=description, version=version)
103
104
# dest='force', \
104
105
# help='Attempt to continue if the integrity check fails')
106
parser.add_option('-v', '--verbose', action='store_const',
107
const=logging.INFO, dest='verbose',
108
default=logging.INFO,
109
help='display more information')
110
parser.add_option('-d', '--debug', action='store_const',
111
const=logging.DEBUG, dest='verbose',
112
help='display debugging information')
114
109
(options, arguments) = parser.parse_args(args)
110
options.verbose = logging.DEBUG
116
111
# Configure verbosity
117
112
#TODO: Fix it so basicConfig works
118
#logging.basicConfig(level=options.verbose, format=FORMAT, datefmt=DATE)
119
logging.root.level = options.verbose
113
logging.basicConfig(level=options.verbose, format=FORMAT, datefmt=DATE)
121
115
if len(arguments) == 1:
122
116
self.wx_gui = True
142
136
print 'call GUI version'
144
138
if self.command == 'create':
145
definition = libkeryx.get_definition(self.project)
139
definition = libkeryx.get_definition(self.project, db_filename)
146
140
definition.create()
147
141
if self.command == 'update':
148
definition = libkeryx.get_definition(self.project)
142
definition = libkeryx.get_definition(self.project, db_filename)
149
143
definition.UpdateInternet()
151
145
# keryx <project-name> <command(s)> <option(s)>