def __init__(self, args, **kwargs):
QtCore.QObject.__init__(self)<EOL>self.NAME = kwargs.get('<STR_LIT:name>', __main__.__name__)<EOL>self.FTYPE = kwargs.get('<STR_LIT>', '<STR_LIT>')<EOL>self.ICON = kwargs.get('<STR_LIT>', None)<EOL>self.dir = PathStr.home().mkdir('<STR_LIT>' % self.NAME)<EOL>self.APP_CONFIG_FILE = self.dir.join('<STR_LIT>')<EOL>self._tmp_dir_session = None<EOL>self.current_session = None<EOL>self.opts = _Opts({<EOL>'<STR_LIT>':         <NUM_LIT:3>,<EOL>'<STR_LIT>':      True,<EOL>'<STR_LIT>':        True,<EOL>'<STR_LIT>':           False,<EOL>'<STR_LIT>':           False,<EOL>'<STR_LIT>':            False,<EOL>'<STR_LIT>': <NUM_LIT:15>,<EOL>'<STR_LIT>':              False,<EOL>'<STR_LIT>': True,<EOL>'<STR_LIT>': []<EOL>}, self)<EOL><INDENT>self.app_opts = {'<STR_LIT>': True, '<STR_LIT>': []}<EOL><DEDENT>if not self.APP_CONFIG_FILE.exists():<EOL><INDENT>dialog = kwargs.get('<STR_LIT>', FirstStart)<EOL>f = dialog(self)<EOL>f.exec_()<EOL>if not f.result():<EOL><INDENT>sys.exit()<EOL><DEDENT>with open(self.APP_CONFIG_FILE, '<STR_LIT:w>') as f:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>else:<EOL><INDENT>with open(self.APP_CONFIG_FILE, '<STR_LIT:r>') as f:<EOL><INDENT>r = f.read()<EOL>if r:<EOL><INDENT>self.opts.update(eval(r))<EOL><DEDENT><DEDENT><DEDENT>self._icons_enabled = False<EOL>self.log_file = None<EOL>dirname = self.opts['<STR_LIT>']<EOL>if dirname:<EOL><INDENT>dirname = PathStr(dirname[-<NUM_LIT:1>]).dirname()<EOL><DEDENT>self.dialogs = Dialogs(dirname)<EOL>self.saveThread = _SaveThread()<EOL>self._createdAutosaveFile = None<EOL>self.tmp_dir_save_session = None<EOL><INDENT>self.tmp_dir_work = PathStr(tempfile.mkdtemp('<STR_LIT>' % self.NAME))<EOL><DEDENT>pathName = self._inspectArguments(args)<EOL>self.setSessionPath(pathName)<EOL>if self.opts['<STR_LIT>']:<EOL><INDENT>self._setupLogFile()<EOL><DEDENT>self.streamOut = StreamSignal('<STR_LIT>')<EOL>self.streamErr = StreamSignal('<STR_LIT>')<EOL>self._enableGuiIcons()<EOL>self.timerAutosave = QtCore.QTimer()<EOL>self.timerAutosave.timeout.connect(self._autoSave)<EOL>self.opts.activate()<EOL>QtCore.QTimer.singleShot(<NUM_LIT:0>, self.restoreCurrentState)<EOL>
Args:
    first_start_dialog (Optional[bool]):
        Show a different dialog for the first start.
    name (Optional[str]): The applications name.
    type (Optional[str]): The file type to be used for saving sessions.
    icon (Optional[str]): Path to the application icon.