/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-02 19:59:16 UTC
  • mto: (237.7.594 trunk)
  • mto: This revision was merged to the branch mainline in revision 382.
  • Revision ID: teddy@recompile.se-20190302195916-mya36qr865qqujnz
mandos-ctl: White space changes only

* mandos-ctl: Fix some white space, wrapping, and indentation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
216
216
 
217
217
 
218
218
def string_to_delta(interval):
219
 
    """Parse a string and return a datetime.timedelta
220
 
    """
 
219
    """Parse a string and return a datetime.timedelta"""
221
220
 
222
221
    try:
223
222
        return rfc3339_duration_to_delta(interval)
228
227
 
229
228
 
230
229
def parse_pre_1_6_1_interval(interval):
231
 
    """Parse an interval string as documented by Mandos before 1.6.1, and
232
 
    return a datetime.timedelta
 
230
    """Parse an interval string as documented by Mandos before 1.6.1,
 
231
    and return a datetime.timedelta
 
232
 
233
233
    >>> parse_pre_1_6_1_interval('7d')
234
234
    datetime.timedelta(7)
235
235
    >>> parse_pre_1_6_1_interval('60s')
321
321
                      *(len(self.string_from_client(client, key))
322
322
                        for client in self.clients)),
323
323
            key=key)
324
 
                                 for key in self.keywords)
 
324
                        for key in self.keywords)
325
325
 
326
326
    def string_from_client(self, client, key):
327
327
        return self.valuetostring(client[key], key)