From 1b5e21ab5cc064e013caf60d325e4e71cd0efa44 Mon Sep 17 00:00:00 2001 From: Olivier Mangin Date: Thu, 13 Jun 2013 14:42:53 +0200 Subject: [PATCH 1/2] Adds option to open document with another programm. --- papers/commands/open_cmd.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/papers/commands/open_cmd.py b/papers/commands/open_cmd.py index 559fd88..3ecb341 100644 --- a/papers/commands/open_cmd.py +++ b/papers/commands/open_cmd.py @@ -8,20 +8,26 @@ from .. import configs def parser(subparsers, config): parser = subparsers.add_parser('open', help='open the paper in a pdf viewer') + parser.add_argument('-w', '--with', dest='with_command', default=None, + help='command to use to open the document file') parser.add_argument('citekey', help='the paper associated citekey') return parser -def command(config, ui, citekey): +def command(config, ui, with_command, citekey): rp = repo.Repository.from_directory(config) paper = rp.paper_from_ref(citekey, fatal=True) + if with_command is None: + with_command = config.get(configs.MAIN_SECTION, 'open-cmd') try: filepath = paper.get_document_path() - subprocess.Popen([config.get(configs.MAIN_SECTION, 'open-cmd'), - filepath]) - print("%s opened." % ui.colored(filepath, 'filepath')) + subprocess.Popen([with_command, filepath]) + ui.print_("%s opened." % ui.colored(filepath, 'filepath')) except NoDocumentFile: ui.error("No document associated with the entry %s." % ui.colored(citekey, 'citekey')) ui.exit() + except OSError: + ui.error("Command does not exist: %s." % with_command) + ui.exit(127) From 3d4ad3cdae79e03847eb0bbc67f18f3790a5f97a Mon Sep 17 00:00:00 2001 From: Olivier Mangin Date: Thu, 13 Jun 2013 16:34:37 +0200 Subject: [PATCH 2/2] Adds README. --- .pit/pit-a3f35d0d7925baa9 | 3 ++- NOTES | 5 +++++ README | 4 ---- README.md | 34 ++++++++++++++++++++++++++++++++++ 4 files changed, 41 insertions(+), 5 deletions(-) delete mode 100644 README create mode 100644 README.md diff --git a/.pit/pit-a3f35d0d7925baa9 b/.pit/pit-a3f35d0d7925baa9 index 6dd9dc0..743e687 100644 --- a/.pit/pit-a3f35d0d7925baa9 +++ b/.pit/pit-a3f35d0d7925baa9 @@ -1,7 +1,7 @@ [header] title = adding bibdata by hand id = a3f35d0d7925baa938852ab89477ef26964edf18 -status = open +status = closed type = feature author = Fabien Benureau mail = fabien.benureau+git@gmail.com @@ -9,6 +9,7 @@ date = 2012-10-05 at 14:59 UCT [eventlog] opened[0] = opened the 2012-10-05 at 14:59 UCT by Fabien Benureau +closed[1] = closed the 2013-06-13 at 13:03(UCT) by Olivier Mangin [discussion] desc = # enter your description here diff --git a/NOTES b/NOTES index c52ecae..76dd465 100644 --- a/NOTES +++ b/NOTES @@ -1,3 +1,8 @@ +A paper correspond to 3 files : + name.pdf a pdf or ps file, the paper itself, whose location is arbitrary + bibdata/name.bibyaml a bibyaml file with all bibliographic data. + meta/name.meta a metadata file for internal use, notes, citekeys, status, etc. + + requires config file (default repo, open command, ...) - printing should include templating engine and several templates for bib types and output * chose existing engine diff --git a/README b/README deleted file mode 100644 index f4267b9..0000000 --- a/README +++ /dev/null @@ -1,4 +0,0 @@ -A paper correspond to 3 files : - name.pdf a pdf or ps file, the paper itself, whose location is arbitrary - bibdata/name.bibyaml a bibyaml file with all bibliographic data. - meta/name.meta a metadata file for internal use, notes, citekeys, status, etc. diff --git a/README.md b/README.md new file mode 100644 index 0000000..f10387b --- /dev/null +++ b/README.md @@ -0,0 +1,34 @@ +Papers brings your bibliography to the command line. + +Papers organizes your bibliographic documents together with the bibliographic data associated to them and provides command line access to basic and advanced manipulation of your library. + +Papers is built with the following principles in mind: + + - all papers are referenced using unique citation keys, + - bibliographic data (i.e. pure bibtex information) is kept separated from metadata (including links to pdf or tags), + - everything is stored in plain text so it can be manually edited or version controlled. + + +Notice: papers is still in early development and cannot be considered as stable + + +Getting started +--------------- +Create your library (by default, goes to '~/.papers/'). + + papers init + +Import existing data from bibtex (papers will try to automatically copy documents defined as 'file' in bibtex): + + papers import path/to/collection.bib +or for bibtex containing a single file: + + papers add --bibfile article.bib --docfile article.pdf + + +Authors +------- + + - Fabien Benureau + - Olivier Mangin + - Jonathan Grizou