ui is no more passed in the command args.
Corresponding changes have been applied in commands files.
This commit is contained in:
parent
4e17a2201b
commit
da6d2d21d5
@ -2,6 +2,7 @@ from .. import repo
|
||||
from .. import files
|
||||
from ..paper import Paper, NoDocumentFile, get_bibentry_from_string
|
||||
from ..configs import config
|
||||
from ..uis import get_ui
|
||||
from .helpers import add_paper_with_docfile, extract_doc_path_from_bibdata
|
||||
|
||||
|
||||
@ -25,7 +26,7 @@ def command(args):
|
||||
:param docfile: path (no url yet) to a pdf or ps file
|
||||
"""
|
||||
|
||||
ui = args.ui
|
||||
ui = get_ui()
|
||||
bibfile = args.bibfile
|
||||
docfile = args.docfile
|
||||
tags = args.tags
|
||||
|
@ -1,5 +1,6 @@
|
||||
from .. import repo
|
||||
from ..configs import config
|
||||
from ..uis import get_ui
|
||||
from .helpers import (add_references_argument, parse_reference,
|
||||
add_docfile_to_paper)
|
||||
|
||||
@ -22,7 +23,7 @@ def command(args):
|
||||
:param docfile: path (no url yet) to a pdf or ps file
|
||||
"""
|
||||
|
||||
ui = args.ui
|
||||
ui = get_ui()
|
||||
copy = args.copy
|
||||
reference = args.reference
|
||||
document = args.document
|
||||
|
@ -3,6 +3,7 @@ from .. import repo
|
||||
from ..paper import get_bibentry_from_string, get_safe_metadata_from_content
|
||||
from .helpers import add_references_argument, parse_reference
|
||||
from ..configs import config
|
||||
from ..uis import get_ui
|
||||
|
||||
|
||||
def parser(subparsers):
|
||||
@ -16,7 +17,7 @@ def parser(subparsers):
|
||||
|
||||
def command(args):
|
||||
|
||||
ui = args.ui
|
||||
ui = get_ui()
|
||||
meta = args.meta
|
||||
reference = args.reference
|
||||
|
||||
|
@ -6,6 +6,7 @@ from .. import repo
|
||||
from .. import files
|
||||
from .helpers import parse_references, add_references_argument
|
||||
from ..configs import config
|
||||
from ..uis import get_ui
|
||||
|
||||
def parser(subparsers):
|
||||
parser = subparsers.add_parser('export',
|
||||
@ -21,7 +22,7 @@ def command(args):
|
||||
:param bib_format (in 'bibtex', 'yaml')
|
||||
"""
|
||||
|
||||
ui = args.ui
|
||||
ui = get_ui()
|
||||
bib_format = args.bib_format
|
||||
references = args.references
|
||||
|
||||
|
@ -2,6 +2,7 @@ from .. import repo
|
||||
from ..paper import Paper
|
||||
from .helpers import add_paper_with_docfile, extract_doc_path_from_bibdata
|
||||
from ..configs import config
|
||||
from ..uis import get_ui
|
||||
|
||||
def parser(subparsers):
|
||||
parser = subparsers.add_parser('import',
|
||||
@ -20,7 +21,7 @@ def command(args):
|
||||
:param bibpath: path (no url yet) to a bibliography file
|
||||
"""
|
||||
|
||||
ui = args.ui
|
||||
ui = get_ui()
|
||||
bibpath = args.bibpath
|
||||
copy = args.copy
|
||||
|
||||
|
@ -4,6 +4,7 @@ import os
|
||||
|
||||
from ..repo import Repository
|
||||
from ..configs import config
|
||||
from ..uis import get_ui
|
||||
from .. import color
|
||||
from .. import files
|
||||
|
||||
@ -21,7 +22,7 @@ def parser(subparsers):
|
||||
def command(args):
|
||||
"""Create a .papers directory"""
|
||||
|
||||
ui = args.ui
|
||||
ui = get_ui()
|
||||
path = args.path
|
||||
doc_dir = args.doc_dir
|
||||
|
||||
|
@ -3,6 +3,7 @@ from .. import repo
|
||||
from .. import color
|
||||
from . import helpers
|
||||
from ..configs import config
|
||||
from ..uis import get_ui
|
||||
|
||||
|
||||
def parser(subparsers):
|
||||
@ -17,7 +18,7 @@ def parser(subparsers):
|
||||
|
||||
def command(args):
|
||||
|
||||
ui = args.ui
|
||||
ui = get_ui()
|
||||
citekeys = args.citekeys
|
||||
query = args.query
|
||||
|
||||
|
@ -3,6 +3,7 @@ import subprocess
|
||||
from .. import repo
|
||||
from ..paper import NoDocumentFile
|
||||
from ..configs import config
|
||||
from ..uis import get_ui
|
||||
from .. import color
|
||||
from .helpers import add_references_argument, parse_reference
|
||||
|
||||
@ -18,7 +19,7 @@ def parser(subparsers):
|
||||
|
||||
def command(args):
|
||||
|
||||
ui = args.ui
|
||||
ui = get_ui()
|
||||
with_command = args.with_command
|
||||
reference = args.reference
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
from .. import repo
|
||||
from .. import color
|
||||
from ..configs import config
|
||||
from ..uis import get_ui
|
||||
from .helpers import add_references_argument, parse_references
|
||||
|
||||
|
||||
@ -14,7 +15,7 @@ def parser(subparsers):
|
||||
|
||||
def command(args):
|
||||
|
||||
ui = args.ui
|
||||
ui = get_ui()
|
||||
force = args.force
|
||||
references = args.references
|
||||
|
||||
|
@ -20,6 +20,7 @@ The different use cases are :
|
||||
from ..repo import Repository, InvalidReference
|
||||
from . import helpers
|
||||
from ..configs import config
|
||||
from ..uis import get_ui
|
||||
|
||||
def parser(subparsers):
|
||||
parser = subparsers.add_parser('tag', help="add, remove and show tags")
|
||||
@ -67,7 +68,7 @@ def _tag_groups(tags):
|
||||
def command(args):
|
||||
"""Add, remove and show tags"""
|
||||
|
||||
ui = args.ui
|
||||
ui = get_ui()
|
||||
referenceOrTag = args.referenceOrTag
|
||||
tags = args.tags
|
||||
|
||||
|
@ -3,6 +3,7 @@ import sys
|
||||
from .. import repo
|
||||
from .. import color
|
||||
from ..configs import config
|
||||
from ..uis import get_ui
|
||||
from ..__init__ import __version__
|
||||
|
||||
def parser(subparsers):
|
||||
@ -12,7 +13,7 @@ def parser(subparsers):
|
||||
|
||||
def command(args):
|
||||
|
||||
ui = args.ui
|
||||
ui = get_ui()
|
||||
|
||||
code_version = __version__
|
||||
repo_version = int(config().version)
|
||||
|
@ -1,6 +1,7 @@
|
||||
import webbrowser
|
||||
import urllib
|
||||
|
||||
from ..uis import get_ui
|
||||
|
||||
def parser(subparsers):
|
||||
parser = subparsers.add_parser('websearch',
|
||||
@ -12,7 +13,7 @@ def parser(subparsers):
|
||||
|
||||
def command(args):
|
||||
|
||||
ui = args.ui
|
||||
ui = get_ui()
|
||||
search_string = args.search_string
|
||||
|
||||
url = ("https://scholar.google.fr/scholar?q=%s&lr="
|
||||
|
@ -12,7 +12,6 @@ from io import StringIO
|
||||
|
||||
import yaml
|
||||
|
||||
from . import ui
|
||||
from . import color
|
||||
|
||||
try:
|
||||
|
@ -71,8 +71,6 @@ def execute(raw_args = sys.argv):
|
||||
subparser = cmd_mod.parser(subparsers) # why do we return the subparser ?
|
||||
|
||||
args = parser.parse_args(raw_args[1:])
|
||||
|
||||
args.ui = ui
|
||||
cmd = args.command
|
||||
del args.command
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user