chore: fix python lint warnings (#14638)
* chore: fix lint warnings * chore: another try at python import errors Looks like the problem is that dbus_mock.py is running as a script but living in the `lib/` directory where it's part of a module. Moving it up into the `script/` directory seems to solve the issue.
This commit is contained in:
parent
6d01952e66
commit
a45ded5508
15 changed files with 111 additions and 74 deletions
31
script/dbus_mock.py
Normal file
31
script/dbus_mock.py
Normal file
|
@ -0,0 +1,31 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import atexit
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
from dbusmock import DBusTestCase
|
||||
|
||||
from lib.config import is_verbose_mode
|
||||
|
||||
def stop():
|
||||
DBusTestCase.stop_dbus(DBusTestCase.system_bus_pid)
|
||||
DBusTestCase.stop_dbus(DBusTestCase.session_bus_pid)
|
||||
|
||||
def start():
|
||||
log = sys.stdout if is_verbose_mode() else open(os.devnull, 'w')
|
||||
|
||||
DBusTestCase.start_system_bus()
|
||||
DBusTestCase.spawn_server_template('logind', None, log)
|
||||
|
||||
DBusTestCase.start_session_bus()
|
||||
DBusTestCase.spawn_server_template('notification_daemon', None, log)
|
||||
|
||||
if __name__ == '__main__':
|
||||
start()
|
||||
try:
|
||||
print(sys.argv)
|
||||
subprocess.check_call(sys.argv[1:])
|
||||
finally:
|
||||
stop()
|
Loading…
Add table
Add a link
Reference in a new issue