/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: 2019-03-09 18:53:46 UTC
  • mto: This revision was merged to the branch mainline in revision 382.
  • Revision ID: teddy@recompile.se-20190309185346-9a1sjer0ao7p0qj2
mandos-ctl: Add abstract method and attribute

* mandos-ctl (PrintCmd.output): New abstract method.
  (PropertyCmd.propname): Add abstract property

Show diffs side-by-side

added added

removed removed

Lines of Context:
295
295
                    "Expires", "LastCheckerStatus")
296
296
    def run(self, mandos, clients):
297
297
        print(self.output(clients.values()))
 
298
    def output(self, clients):
 
299
        raise NotImplementedError()
298
300
 
299
301
class PropertyCmd(Command):
300
302
    """Abstract class for Actions for setting one client property"""
308
310
                  else bool(self.value_to_set))
309
311
        client.Set(client_interface, self.propname, self.value_to_set,
310
312
                   dbus_interface=dbus.PROPERTIES_IFACE)
 
313
    @property
 
314
    def propname(self):
 
315
        raise NotImplementedError()
311
316
 
312
317
class ValueArgumentMixIn(object):
313
318
    """Mixin class for commands taking a value as argument"""