Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 457726 | Differences between
and this patch

Collapse All | Expand All

(-)/usr/lib64/python2.7/site-packages/layman/cli.py (-10 / +26 lines)
Lines 145-154 Link Here
145
                        ('list_local', 'ListLocal'),]
145
                        ('list_local', 'ListLocal'),]
146
146
147
    def __call__(self):
147
    def __call__(self):
148
        quietness = self.config.get_option("quiet")
148
        self.output.debug("CLI.__call__(): self.config.keys()"
149
        self.output.debug("CLI.__call__(): self.config.keys()"
149
            " %s" % str(self.config.keys()), 6)
150
            " %s" % str(self.config.keys()), 6)
150
        # blank newline  -- no " *"
151
        # blank newline  -- no " *"
151
        self.output.notice('')
152
        if not quietness:
153
	  self.output.notice('')
152
        # Make fetching the overlay list a default action
154
        # Make fetching the overlay list a default action
153
        if not 'nofetch' in self.config.keys():
155
        if not 'nofetch' in self.config.keys():
154
            # Actions that implicitely call the fetch operation before
156
            # Actions that implicitely call the fetch operation before
Lines 199-205 Link Here
199
                    " %s" % action)
201
                    " %s" % action)
200
                for _error in _errors:
202
                for _error in _errors:
201
                    self.output.error(_error)
203
                    self.output.error(_error)
202
                self.output.notice("")
204
                if not quietness:
205
		  self.output.notice("")
203
206
204
        # Reset umask
207
        # Reset umask
205
        os.umask(old_umask)
208
        os.umask(old_umask)
Lines 213-230 Link Here
213
    def Fetch(self):
216
    def Fetch(self):
214
        ''' Fetches the overlay listing.
217
        ''' Fetches the overlay listing.
215
        '''
218
        '''
219
        quietness = self.config.get_option("quiet")
216
        self.output.info("Fetching remote list,...", 2)
220
        self.output.info("Fetching remote list,...", 2)
217
        result = self.api.fetch_remote_list()
221
        result = self.api.fetch_remote_list()
218
        if result:
222
        if result:
219
            self.output.info('Fetch Ok', 2)
223
            self.output.info('Fetch Ok', 2)
220
        # blank newline  -- no " *"
224
        # blank newline  -- no " *"
221
        self.output.notice('')
225
        if not quietness:
226
	  self.output.notice('')
222
        return result
227
        return result
223
228
224
229
225
    def Add(self):
230
    def Add(self):
226
        ''' Adds the selected overlays.
231
        ''' Adds the selected overlays.
227
        '''
232
        '''
233
        quietness = self.config.get_option("quiet")
228
        self.output.info("Adding overlay,...", 2)
234
        self.output.info("Adding overlay,...", 2)
229
        selection = decode_selection(self.config['add'])
235
        selection = decode_selection(self.config['add'])
230
        if 'ALL' in selection:
236
        if 'ALL' in selection:
Lines 235-241 Link Here
235
            self.output.info('Successfully added overlay(s) '+\
241
            self.output.info('Successfully added overlay(s) '+\
236
                ', '.join(selection) +'.', 2)
242
                ', '.join(selection) +'.', 2)
237
        # blank newline  -- no " *"
243
        # blank newline  -- no " *"
238
        self.output.notice('')
244
        if not quietness:
245
	  self.output.notice('')
239
        return result
246
        return result
240
247
241
248
Lines 243-248 Link Here
243
    def Sync(self):
250
    def Sync(self):
244
        ''' Syncs the selected overlays.
251
        ''' Syncs the selected overlays.
245
        '''
252
        '''
253
        quietness = self.config.get_option("quiet")
246
        self.output.info("Syncing selected overlays,...", 2)
254
        self.output.info("Syncing selected overlays,...", 2)
247
        # Note api.sync() defaults to printing results
255
        # Note api.sync() defaults to printing results
248
        selection = decode_selection(self.config['sync'])
256
        selection = decode_selection(self.config['sync'])
Lines 251-263 Link Here
251
        self.output.debug('Updating selected overlays', 6)
259
        self.output.debug('Updating selected overlays', 6)
252
        result = self.api.sync(selection, update_news=True)
260
        result = self.api.sync(selection, update_news=True)
253
        # blank newline  -- no " *"
261
        # blank newline  -- no " *"
254
        self.output.notice('')
262
        if not quietness:
263
	  self.output.notice('')
255
        return result
264
        return result
256
265
257
266
258
    def Delete(self):
267
    def Delete(self):
259
        ''' Deletes the selected overlays.
268
        ''' Deletes the selected overlays.
260
        '''
269
        '''
270
        quietness = self.config.get_option("quiet")
261
        self.output.info('Deleting selected overlays,...', 2)
271
        self.output.info('Deleting selected overlays,...', 2)
262
        selection = decode_selection(self.config['delete'])
272
        selection = decode_selection(self.config['delete'])
263
        if 'ALL' in selection:
273
        if 'ALL' in selection:
Lines 267-279 Link Here
267
            self.output.info('Successfully deleted overlay(s) ' +\
277
            self.output.info('Successfully deleted overlay(s) ' +\
268
                ', '.join(selection) + '.', 2)
278
                ', '.join(selection) + '.', 2)
269
        # blank newline  -- no " *"
279
        # blank newline  -- no " *"
270
        self.output.notice('')
280
        if not quietness:
281
	  self.output.notice('')
271
        return result
282
        return result
272
283
273
284
274
    def Info(self):
285
    def Info(self):
275
        ''' Print information about the specified overlays.
286
        ''' Print information about the specified overlays.
276
        '''
287
        '''
288
        quietness = self.config.get_option("quiet")
277
        selection = decode_selection(self.config['info'])
289
        selection = decode_selection(self.config['info'])
278
        if 'ALL' in selection:
290
        if 'ALL' in selection:
279
            selection = self.api.get_available()
291
            selection = self.api.get_available()
Lines 285-298 Link Here
285
            verbose=True, width=list_printer.width)
297
            verbose=True, width=list_printer.width)
286
        list_printer.print_shortdict(info, complain=_complain)
298
        list_printer.print_shortdict(info, complain=_complain)
287
        # blank newline  -- no " *"
299
        # blank newline  -- no " *"
288
        self.output.notice('')
300
        if not quietness:
301
	  self.output.notice('')
289
        return info != {}
302
        return info != {}
290
303
291
304
292
    def ListRemote(self):
305
    def ListRemote(self):
293
        ''' Lists the available overlays.
306
        ''' Lists the available overlays.
294
        '''
307
        '''
295
308
        quietness = self.config.get_option("quiet")
296
        self.output.debug('Printing remote overlays.', 6)
309
        self.output.debug('Printing remote overlays.', 6)
297
        list_printer = ListPrinter(self.config)
310
        list_printer = ListPrinter(self.config)
298
311
Lines 301-307 Link Here
301
            verbose=self.config['verbose'], width=list_printer.width)
314
            verbose=self.config['verbose'], width=list_printer.width)
302
        list_printer.print_shortlist(info, complain=_complain)
315
        list_printer.print_shortlist(info, complain=_complain)
303
        # blank newline  -- no " *"
316
        # blank newline  -- no " *"
304
        self.output.notice('')
317
        if not quietness:
318
	  self.output.notice('')
305
319
306
        return info != {}
320
        return info != {}
307
321
Lines 310-315 Link Here
310
        ''' Lists the local overlays.
324
        ''' Lists the local overlays.
311
        '''
325
        '''
312
        #print "ListLocal()"
326
        #print "ListLocal()"
327
        quietness = self.config.get_option("quiet")
313
        self.output.debug('Printing installed overlays.', 6)
328
        self.output.debug('Printing installed overlays.', 6)
314
        list_printer = ListPrinter(self.config)
329
        list_printer = ListPrinter(self.config)
315
330
Lines 326-332 Link Here
326
        #list_printer.print_fulldict(info, complain=_complain)
341
        #list_printer.print_fulldict(info, complain=_complain)
327
342
328
        # blank newline  -- no " *"
343
        # blank newline  -- no " *"
329
        self.output.notice('')
344
        if not quietness:
345
	  self.output.notice('')
330
        return info != {}
346
        return info != {}
331
347
332
348

Return to bug 457726