1
1
# ubuntuone.platform.windows - windows platform imports
3
# Author: Lucio Torre <lucio.torre@canonical.com>
4
# Manuel de la Pena <manuel@canonical.com>
6
# Copyright 2010-11 Canonical Ltd.
3
# Copyright 2010-2011 Canonical Ltd.
8
5
# This program is free software: you can redistribute it and/or modify it
9
6
# under the terms of the GNU General Public License version 3, as published
58
66
from ubuntuone.platform.windows import event_logging
59
67
from ubuntuone.platform.windows.logger import (
60
68
setup_filesystem_logging,
61
get_filesystem_logger)
69
get_filesystem_logger,
62
71
from ubuntuone.platform.windows.filesystem_notifications import (
64
from ubuntuone.platform.windows.notification import Notification
67
def is_already_running():
68
"""An ugly workaround for circular imports, see bug #817559."""
69
from ubuntuone.platform.windows.ipc import is_already_running
70
return is_already_running()
73
class ExternalInterface(object):
74
"""An ExternalInterface implemented with a IPC interface."""
76
def __init__(self, main, glib_loop=False, broadcast_events=False,
78
"""Create an instance using the same params as in Linux."""
80
if dbus_iface is None:
81
from ubuntuone.platform.windows import ipc
82
self.dbus_iface = ipc.IPCInterface(main,
83
send_events=broadcast_events)
86
self.dbus_iface = dbus_iface
89
def _get_credentials(self):
90
return self.dbus_iface.oauth_credentials
92
def _set_credentials(self, credentials):
93
self.dbus_iface.oauth_credentials = credentials
95
oauth_credentials = property(fget=_get_credentials, fset=_set_credentials)
97
def shutdown(self, with_restart):
98
self.dbus_iface.shutdown(with_restart)
100
def connect(self, *args, **kwargs):
101
self.dbus_iface.connect(*args, **kwargs)
73
NotifyProcessor as _GeneralINotifyProcessor,
75
from ubuntuone.platform.windows import notification
76
from ubuntuone.platform.windows.ipc import (
77
IPCInterface as ExternalInterface,