@@ -128,7 +128,7 @@ def _execute(self, options, args):
128
128
list_installed )].count (True )
129
129
if command_count > 1 or command_count == 0 :
130
130
print (self .help ())
131
- return
131
+ return 2
132
132
133
133
if options .get ('output_dir' ) is not None :
134
134
self .output_dir = options .get ('output_dir' )
@@ -159,7 +159,7 @@ def list_available(self, url):
159
159
print ("------------------" )
160
160
for plugin in sorted (data .keys ()):
161
161
print (plugin )
162
- return True
162
+ return 0
163
163
164
164
def list_installed (self ):
165
165
plugins = []
@@ -174,7 +174,7 @@ def list_installed(self):
174
174
plugins .sort ()
175
175
for name , path in plugins :
176
176
print ('{0} at {1}' .format (name , path ))
177
- return True
177
+ return 0
178
178
179
179
def do_upgrade (self , url ):
180
180
LOGGER .warning ('This is not very smart, it just reinstalls some plugins and hopes for the best' )
@@ -199,11 +199,11 @@ def do_upgrade(self, url):
199
199
break
200
200
elif tail == '' :
201
201
LOGGER .error ("Can't find the plugins folder for path: {0}" .format (p ))
202
- return False
202
+ return 1
203
203
else :
204
204
path = tail
205
205
self .do_install (url , name )
206
- return True
206
+ return 0
207
207
208
208
def do_install (self , url , name , show_install_notes = True ):
209
209
data = self .get_json (url )
@@ -220,13 +220,13 @@ def do_install(self, url, name, show_install_notes=True):
220
220
plugin_path = utils .get_plugin_path (name )
221
221
except :
222
222
LOGGER .error ("Can't find plugin " + name )
223
- return False
223
+ return 1
224
224
225
225
utils .makedirs (self .output_dir )
226
226
dest_path = os .path .join (self .output_dir , name )
227
227
if os .path .exists (dest_path ):
228
228
LOGGER .error ("{0} is already installed" .format (name ))
229
- return False
229
+ return 1
230
230
231
231
LOGGER .info ('Copying {0} into plugins' .format (plugin_path ))
232
232
shutil .copytree (plugin_path , dest_path )
@@ -272,7 +272,7 @@ def do_install(self, url, name, show_install_notes=True):
272
272
4 * ' ' ))
273
273
else :
274
274
print (utils .indent (fh .read (), 4 * ' ' ))
275
- return True
275
+ return 0
276
276
277
277
def do_uninstall (self , name ):
278
278
for plugin in self .site .plugin_manager .getAllPlugins (): # FIXME: this is repeated thrice
@@ -289,9 +289,10 @@ def do_uninstall(self, name):
289
289
if sure .lower ().startswith ('y' ):
290
290
LOGGER .warning ('Removing {0}' .format (p ))
291
291
shutil .rmtree (p )
292
- return True
292
+ return 0
293
+ return 1
293
294
LOGGER .error ('Unknown plugin: {0}' .format (name ))
294
- return False
295
+ return 1
295
296
296
297
def get_json (self , url ):
297
298
if self .json is None :
0 commit comments