/mandos/release

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/release

« back to all changes in this revision

Viewing changes to mandos-ctl

  • Committer: Teddy Hogeborn
  • Date: 2014-07-25 23:00:45 UTC
  • mto: (237.7.272 trunk)
  • mto: This revision was merged to the branch mainline in revision 321.
  • Revision ID: teddy@recompile.se-20140725230045-94y6ghmwqkb00ffw
Use dictionary comprehensions.

* mandos (Client.start_checker): Use a dictionary comprehension when
                                 creating the "escaped_attrs" mapping.
* mandos-ctl (print_clients): Use a dictionary comprehension when
                              creating keyword arguments to the
                              .format string method.
  (main): Use a dictionary comprehension when creating the "clients"
          mapping.

Show diffs side-by-side

added added

removed removed

Lines of Context:
249
249
    # Print header line
250
250
    print(format_string.format(**tablewords))
251
251
    for client in clients:
252
 
        print(format_string.format(**dict((key,
 
252
        print(format_string.format(**{ key:
253
253
                                           valuetostring(client[key],
254
 
                                                         key))
255
 
                                          for key in keywords)))
 
254
                                                         key)
 
255
                                       for key in keywords }))
256
256
 
257
257
def has_actions(options):
258
258
    return any((options.enable,
372
372
    clients={}
373
373
    
374
374
    if options.all or not options.client:
375
 
        clients = dict((bus.get_object(busname, path), properties)
376
 
                       for path, properties in
377
 
                       mandos_clients.items())
 
375
        clients = { bus.get_object(busname, path): properties
 
376
                    for path, properties in mandos_clients.items() }
378
377
    else:
379
378
        for name in options.client:
380
379
            for path, client in mandos_clients.iteritems():