Include tools also on python 3.4
This result only in small limitation in qvm-start-gui tool, but allow to use the tools from Debian jessie based VM (python 3.4.2).
This commit is contained in:
parent
4ceff0f8c0
commit
f4d6ac2880
@ -30,9 +30,14 @@ import re
|
||||
|
||||
import daemon.pidfile
|
||||
import qubesadmin
|
||||
import qubesadmin.events
|
||||
import qubesadmin.tools
|
||||
import qubesadmin.vm
|
||||
have_events = False
|
||||
try:
|
||||
import qubesadmin.events
|
||||
have_events = True
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
GUI_DAEMON_PATH = '/usr/bin/qubes-guid'
|
||||
QUBES_ICON_DIR = '/usr/share/icons/hicolor/128x128/devices'
|
||||
@ -337,9 +342,13 @@ def main(args=None):
|
||||
parser.error('--watch cannot be used with --notify-monitor-layout')
|
||||
launcher = GUILauncher(args.app)
|
||||
if args.watch:
|
||||
if not have_events:
|
||||
parser.error('--watch option require Python >= 3.5')
|
||||
with daemon.pidfile.TimeoutPIDLockFile(args.pidfile):
|
||||
loop = asyncio.get_event_loop()
|
||||
# pylint: disable=no-member
|
||||
events = qubesadmin.events.EventsDispatcher(args.app)
|
||||
# pylint: enable=no-member
|
||||
launcher.register_events(events)
|
||||
|
||||
events_listener = asyncio.ensure_future(events.listen_for_events())
|
||||
|
4
setup.py
4
setup.py
@ -4,8 +4,10 @@ import setuptools
|
||||
import sys
|
||||
|
||||
exclude=[]
|
||||
if sys.version_info[0:2] < (3, 4):
|
||||
exclude += ['qubesadmin.tools', 'qubesadmin.tests.tools']
|
||||
if sys.version_info[0:2] < (3, 5):
|
||||
exclude = ['qubesadmin.events', 'qubesadmin.tools', 'qubesadmin.tests.tools']
|
||||
exclude += ['qubesadmin.events']
|
||||
|
||||
if __name__ == '__main__':
|
||||
setuptools.setup(
|
||||
|
Loading…
Reference in New Issue
Block a user