Minor changes and cleanup

This commit is contained in:
Lipu Fei 2018-04-04 11:55:46 +02:00
parent 1737267dfd
commit e36ef583b7
2 changed files with 7 additions and 3 deletions

View File

@ -534,7 +534,9 @@ class CuraApplication(QtApplication):
self._plugins_loaded = True
@classmethod
def addCommandLineOptions(self, parser, parsed_command_line = {}):
def addCommandLineOptions(cls, parser, parsed_command_line = None):
if parsed_command_line is None:
parsed_command_line = {}
super().addCommandLineOptions(parser, parsed_command_line = parsed_command_line)
parser.add_argument("file", nargs="*", help="Files to load after starting the application.")
parser.add_argument("--single-instance", action="store_true", default=False)
@ -591,7 +593,10 @@ class CuraApplication(QtApplication):
# This should be called directly before creating an instance of CuraApplication.
# \returns \type{bool} True if the whole Cura app should continue running.
@classmethod
def preStartUp(cls, parser = None, parsed_command_line = {}):
def preStartUp(cls, parser = None, parsed_command_line = None):
if parsed_command_line is None:
parsed_command_line = {}
# Peek the arguments and look for the 'single-instance' flag.
if not parser:
parser = argparse.ArgumentParser(prog = "cura", add_help = False) # pylint: disable=bad-whitespace

View File

@ -2,7 +2,6 @@
# Cura is released under the terms of the LGPLv3 or higher.
import os
import os.path
import re
import configparser