Rename ipc param to process_args to via_ipc.
This prevents shadowing of the module.
This commit is contained in:
parent
817259f4f5
commit
0e9177eb4f
@ -230,9 +230,9 @@ class Application(QApplication):
|
|||||||
self._open_startpage()
|
self._open_startpage()
|
||||||
self._open_quickstart()
|
self._open_quickstart()
|
||||||
|
|
||||||
def _get_window(self, ipc):
|
def _get_window(self, via_ipc):
|
||||||
"""Helper function for process_args to get a window id."""
|
"""Helper function for process_args to get a window id."""
|
||||||
if not ipc:
|
if not via_ipc:
|
||||||
return 0
|
return 0
|
||||||
open_target = config.get('general', 'ipc-open-target')
|
open_target = config.get('general', 'ipc-open-target')
|
||||||
if open_target in ('tab', 'tab-silent'):
|
if open_target in ('tab', 'tab-silent'):
|
||||||
@ -252,16 +252,16 @@ class Application(QApplication):
|
|||||||
else:
|
else:
|
||||||
return mainwindow.MainWindow.spawn()
|
return mainwindow.MainWindow.spawn()
|
||||||
|
|
||||||
def process_args(self, args, ipc=False):
|
def process_args(self, args, via_ipc=False):
|
||||||
"""Process commandline args.
|
"""Process commandline args.
|
||||||
|
|
||||||
URLs to open have no prefix, commands to execute begin with a colon.
|
URLs to open have no prefix, commands to execute begin with a colon.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
args: A list of arguments to process.
|
args: A list of arguments to process.
|
||||||
ipc: Whether the arguments were transmitted over IPC.
|
via_ipc: Whether the arguments were transmitted over IPC.
|
||||||
"""
|
"""
|
||||||
win_id = self._get_window(ipc)
|
win_id = self._get_window(via_ipc)
|
||||||
if win_id is None:
|
if win_id is None:
|
||||||
return
|
return
|
||||||
for cmd in args:
|
for cmd in args:
|
||||||
|
@ -145,7 +145,7 @@ class IPCServer(QObject):
|
|||||||
return
|
return
|
||||||
log.ipc.debug("Processing: {}".format(decoded))
|
log.ipc.debug("Processing: {}".format(decoded))
|
||||||
app = objreg.get('app')
|
app = objreg.get('app')
|
||||||
app.process_args(args, ipc=True)
|
app.process_args(args, via_ipc=True)
|
||||||
|
|
||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
def on_timeout(self):
|
def on_timeout(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user