def _find_AutoLaTeX_dir(self): adir = None doc = self.window.get_active_document() if doc: doc = Gedit.Document.get_location(doc) if doc: return autolatex_utils.find_AutoLaTeX_directory(doc.get_path()) return adir
if fid: fid.close() else: sys.stderr.write(_T("Unable to create the configuration file: %s\n") % config_file) exit(255) else: sys.stderr.write(_T("Unable to find a document, file not found: %s\n") % config_file) exit(255) cli_config.open_configuration_dialog(None, False, path) else: path = args.directory if not path or not os.path.isdir(path): path = os.getcwd() directory = utils.find_AutoLaTeX_directory(path) if not directory: config_file = utils.get_autolatex_document_config_file(path) if (args.create): fid = open(config_file, "a") if fid: fid.close() else: sys.stderr.write(_T("Unable to create the configuration file: %s\n") % config_file) exit(255) else: sys.stderr.write(_T("Unable to find a document, file not found: %s\n") % config_file) exit(255) cli_config.open_configuration_dialog(None, True, directory) exit(0)
_T("Unable to create the configuration file: %s\n") % config_file) exit(255) else: sys.stderr.write( _T("Unable to find a document, file not found: %s\n") % config_file) exit(255) cli_config.open_configuration_dialog(None, False, path) else: path = args.directory if not path or not os.path.isdir(path): path = os.getcwd() directory = utils.find_AutoLaTeX_directory(path) if not directory: config_file = utils.get_autolatex_document_config_file(path) if (args.create): fid = open(config_file, "a") if fid: fid.close() else: sys.stderr.write( _T("Unable to create the configuration file: %s\n") % config_file) exit(255) else: sys.stderr.write( _T("Unable to find a document, file not found: %s\n") % config_file)