/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-ctl

  • Committer: Teddy Hogeborn
  • Date: 2014-10-05 19:39:25 UTC
  • Revision ID: teddy@recompile.se-20141005193925-jjqx2n2dt3icy28u
* mandos.service ([Unit]/Documentation): New.

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
 
43
43
import dbus
44
44
 
45
 
if sys.version_info[0] == 2:
 
45
if sys.version_info.major == 2:
46
46
    str = unicode
47
47
 
48
48
locale.setlocale(locale.LC_ALL, "")
72
72
server_path = "/"
73
73
server_interface = domain + ".Mandos"
74
74
client_interface = domain + ".Mandos.Client"
75
 
version = "1.6.7"
76
 
 
77
 
def timedelta_to_milliseconds(td):
78
 
    """Convert a datetime.timedelta object to milliseconds"""
79
 
    return ((td.days * 24 * 60 * 60 * 1000)
80
 
            + (td.seconds * 1000)
81
 
            + (td.microseconds // 1000))
 
75
version = "1.6.8"
82
76
 
83
77
def milliseconds_to_string(ms):
84
78
    td = datetime.timedelta(0, 0, 0, ms)
411
405
                """Set a Client D-Bus property, converted
412
406
                from a string to milliseconds."""
413
407
                set_client_prop(prop,
414
 
                                timedelta_to_milliseconds
415
 
                                (string_to_delta(value)))
 
408
                                string_to_delta(value).total_seconds()
 
409
                                * 1000)
416
410
            if options.remove:
417
411
                mandos_serv.RemoveClient(client.__dbus_object_path__)
418
412
            if options.enable: