mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-07-08 01:06:12 +02:00
Updated docs from master
This commit is contained in:
parent
1fb5cca898
commit
e7e9383702
40 changed files with 85 additions and 89 deletions
BIN
jrnl/Entry.pyc
BIN
jrnl/Entry.pyc
Binary file not shown.
|
@ -1,10 +1,9 @@
|
|||
#!/usr/bin/env python
|
||||
# encoding: utf-8
|
||||
|
||||
try: from . import Entry
|
||||
except (SystemError, ValueError): import Entry
|
||||
try: from . import util
|
||||
except (SystemError, ValueError): import util
|
||||
from __future__ import absolute_import
|
||||
from . import Entry
|
||||
from . import util
|
||||
import codecs
|
||||
import os
|
||||
try: import parsedatetime.parsedatetime_consts as pdt
|
||||
|
|
BIN
jrnl/Journal.pyc
BIN
jrnl/Journal.pyc
Binary file not shown.
|
@ -5,9 +5,10 @@
|
|||
"""
|
||||
jrnl is a simple journal application for your command line.
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
__title__ = 'jrnl'
|
||||
__version__ = '1.7.6'
|
||||
__version__ = '1.7.7'
|
||||
__author__ = 'Manuel Ebert'
|
||||
__license__ = 'MIT License'
|
||||
__copyright__ = 'Copyright 2013 - 2014 Manuel Ebert'
|
||||
|
|
Binary file not shown.
28
jrnl/cli.py
28
jrnl/cli.py
|
@ -7,17 +7,12 @@
|
|||
license: MIT, see LICENSE for more details.
|
||||
"""
|
||||
|
||||
try:
|
||||
from . import Journal
|
||||
from . import util
|
||||
from . import exporters
|
||||
from . import install
|
||||
from . import __version__
|
||||
except (SystemError, ValueError):
|
||||
import Journal
|
||||
import util
|
||||
import exporters
|
||||
import install
|
||||
from __future__ import absolute_import
|
||||
from . import Journal
|
||||
from . import util
|
||||
from . import exporters
|
||||
from . import install
|
||||
from . import __version__
|
||||
import jrnl
|
||||
import os
|
||||
import argparse
|
||||
|
@ -120,7 +115,8 @@ def run(manual_args=None):
|
|||
args = parse_args(manual_args)
|
||||
|
||||
if args.version:
|
||||
print("{0} version {1}".format(jrnl.__title__, jrnl.__version__))
|
||||
version_str = "{0} version {1}".format(jrnl.__title__, jrnl.__version__)
|
||||
print(util.py2encode(version_str))
|
||||
sys.exit(0)
|
||||
|
||||
# If the first textual argument points to a journal file,
|
||||
|
@ -186,17 +182,17 @@ def run(manual_args=None):
|
|||
|
||||
# Reading mode
|
||||
if not mode_compose and not mode_export:
|
||||
print(journal.pprint())
|
||||
print(util.py2encode(journal.pprint()))
|
||||
|
||||
# Various export modes
|
||||
elif args.short:
|
||||
print(journal.pprint(short=True))
|
||||
print(util.py2encode(journal.pprint(short=True)))
|
||||
|
||||
elif args.tags:
|
||||
print(exporters.to_tag_list(journal))
|
||||
print(util.py2encode(exporters.to_tag_list(journal)))
|
||||
|
||||
elif args.export is not False:
|
||||
print(exporters.export(journal, args.export, args.output))
|
||||
print(util.py2encode(exporters.export(journal, args.export, args.output)))
|
||||
|
||||
elif (args.encrypt is not False or args.decrypt is not False) and not PYCRYPTO:
|
||||
util.prompt("PyCrypto not found. To encrypt or decrypt your journal, install the PyCrypto package from http://www.pycrypto.org.")
|
||||
|
|
BIN
jrnl/cli.pyc
BIN
jrnl/cli.pyc
Binary file not shown.
|
@ -1,12 +1,10 @@
|
|||
#!/usr/bin/env python
|
||||
# encoding: utf-8
|
||||
|
||||
from __future__ import absolute_import
|
||||
import os
|
||||
import string
|
||||
try: import simplejson as json
|
||||
except ImportError: import json
|
||||
try: from .util import u, slugify
|
||||
except (SystemError, ValueError): from util import u, slugify
|
||||
import json
|
||||
from .util import u, slugify
|
||||
|
||||
|
||||
def get_tags_count(journal):
|
||||
|
|
Binary file not shown.
|
@ -1,14 +1,13 @@
|
|||
#!/usr/bin/env python
|
||||
# encoding: utf-8
|
||||
|
||||
from __future__ import absolute_import
|
||||
import readline
|
||||
import glob
|
||||
import getpass
|
||||
try: import simplejson as json
|
||||
except ImportError: import json
|
||||
import json
|
||||
import os
|
||||
try: from . import util
|
||||
except (SystemError, ValueError): import util
|
||||
from . import util
|
||||
|
||||
|
||||
def module_exists(module_name):
|
||||
|
|
BIN
jrnl/install.pyc
BIN
jrnl/install.pyc
Binary file not shown.
|
@ -6,8 +6,7 @@ from tzlocal import get_localzone
|
|||
import getpass as gp
|
||||
import keyring
|
||||
import pytz
|
||||
try: import simplejson as json
|
||||
except ImportError: import json
|
||||
import json
|
||||
if "win32" in sys.platform:
|
||||
import colorama
|
||||
colorama.init()
|
||||
|
@ -66,6 +65,10 @@ def u(s):
|
|||
"""Mock unicode function for python 2 and 3 compatibility."""
|
||||
return s if PY3 or type(s) is unicode else unicode(s.encode('string-escape'), "unicode_escape")
|
||||
|
||||
def py2encode(s):
|
||||
"""Encode in Python 2, but not in python 3."""
|
||||
return s.encode("utf-8") if PY2 and type(s) is unicode else s
|
||||
|
||||
def prompt(msg):
|
||||
"""Prints a message to the std err stream defined in util."""
|
||||
if not msg.endswith("\n"):
|
||||
|
|
BIN
jrnl/util.pyc
BIN
jrnl/util.pyc
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue