Pep8 and pyflakes fixes to sugar-activity
This commit is contained in:
parent
987068959f
commit
43a4611d75
@ -33,9 +33,7 @@ from dbus.mainloop.glib import DBusGMainLoop
|
|||||||
DBusGMainLoop(set_as_default=True)
|
DBusGMainLoop(set_as_default=True)
|
||||||
|
|
||||||
from sugar3.activity import activityhandle
|
from sugar3.activity import activityhandle
|
||||||
from sugar3.activity import i18n
|
|
||||||
from sugar3 import config
|
from sugar3 import config
|
||||||
import sugar3
|
|
||||||
from sugar3.bundle.activitybundle import ActivityBundle
|
from sugar3.bundle.activitybundle import ActivityBundle
|
||||||
from sugar3 import logger
|
from sugar3 import logger
|
||||||
|
|
||||||
@ -69,6 +67,7 @@ class SingleProcess(dbus.service.Object):
|
|||||||
handle = activityhandle.create_from_dict(handle_dict)
|
handle = activityhandle.create_from_dict(handle_dict)
|
||||||
create_activity_instance(self.constructor, handle)
|
create_activity_instance(self.constructor, handle)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
parser = OptionParser()
|
parser = OptionParser()
|
||||||
parser.add_option('-b', '--bundle-id', dest='bundle_id',
|
parser.add_option('-b', '--bundle-id', dest='bundle_id',
|
||||||
@ -125,9 +124,9 @@ def main():
|
|||||||
|
|
||||||
activity_constructor = getattr(module, class_name)
|
activity_constructor = getattr(module, class_name)
|
||||||
activity_handle = activityhandle.ActivityHandle(
|
activity_handle = activityhandle.ActivityHandle(
|
||||||
activity_id=options.activity_id,
|
activity_id=options.activity_id,
|
||||||
object_id=options.object_id, uri=options.uri,
|
object_id=options.object_id, uri=options.uri,
|
||||||
invited=options.invited)
|
invited=options.invited)
|
||||||
|
|
||||||
if options.single_process is True:
|
if options.single_process is True:
|
||||||
sessionbus = dbus.SessionBus()
|
sessionbus = dbus.SessionBus()
|
||||||
@ -136,11 +135,11 @@ def main():
|
|||||||
service_path = get_single_process_path(options.bundle_id)
|
service_path = get_single_process_path(options.bundle_id)
|
||||||
|
|
||||||
bus_object = sessionbus.get_object(
|
bus_object = sessionbus.get_object(
|
||||||
'org.freedesktop.DBus', '/org/freedesktop/DBus')
|
'org.freedesktop.DBus', '/org/freedesktop/DBus')
|
||||||
try:
|
try:
|
||||||
name = bus_object.GetNameOwner(
|
name = bus_object.GetNameOwner(
|
||||||
service_name, dbus_interface='org.freedesktop.DBus')
|
service_name, dbus_interface='org.freedesktop.DBus')
|
||||||
except dbus.DBusException:
|
except dbus.DBusException:
|
||||||
name = None
|
name = None
|
||||||
|
|
||||||
if not name:
|
if not name:
|
||||||
|
Loading…
Reference in New Issue
Block a user