/mandos/trunk

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

« back to all changes in this revision

Viewing changes to mandos

  • Committer: Teddy Hogeborn
  • Date: 2014-07-25 23:00:45 UTC
  • mto: This revision was merged to the branch mainline in revision 724.
  • 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:
707
707
        # Start a new checker if needed
708
708
        if self.checker is None:
709
709
            # Escape attributes for the shell
710
 
            escaped_attrs = dict(
711
 
                (attr, re.escape(unicode(getattr(self, attr))))
712
 
                for attr in
713
 
                self.runtime_expansions)
 
710
            escaped_attrs = { attr:
 
711
                                  re.escape(unicode(getattr(self,
 
712
                                                            attr)))
 
713
                              for attr in self.runtime_expansions }
714
714
            try:
715
715
                command = self.checker_command % escaped_attrs
716
716
            except TypeError as error: