Ejemplo n.º 1
0
    if not os.path.isfile(config_file):
        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, 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(
  config_file = utils.get_autolatex_user_config_file()
  path = args.directory
  if not path or not os.path.isdir(path):
    path = os.path.expanduser("~")
  if not os.path.isfile(config_file):
    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, 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)
Ejemplo n.º 3
0
 def on_user_configuration_action_activate(self, action, data=None):
   directory = self._find_AutoLaTeX_dir()
   if directory:
     cli_config.open_configuration_dialog(self.window, False, directory)