mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-06-29 22:16:13 +02:00
Mock stdin
This commit is contained in:
parent
d4cbd4f944
commit
6abd7d5b68
5 changed files with 43 additions and 44 deletions
|
@ -149,8 +149,6 @@ def cli(manual_args=None):
|
|||
mode_compose, mode_export = guess_mode(args, config)
|
||||
|
||||
# open journal file or folder
|
||||
|
||||
|
||||
if os.path.isdir(config['journal']) and ( config['journal'].endswith(".dayone") or \
|
||||
config['journal'].endswith(".dayone/")):
|
||||
journal = Journal.DayOne(**config)
|
||||
|
|
10
jrnl/util.py
10
jrnl/util.py
|
@ -4,14 +4,14 @@ import sys
|
|||
import os
|
||||
from tzlocal import get_localzone
|
||||
|
||||
STDIN = sys.stdin
|
||||
STDOUT = sys.stdout
|
||||
|
||||
__cached_tz = None
|
||||
|
||||
def py23_input(msg):
|
||||
if sys.version_info[0] == 3:
|
||||
try: return input(msg)
|
||||
except SyntaxError: return ""
|
||||
else:
|
||||
return raw_input(msg)
|
||||
STDOUT.write(msg)
|
||||
return STDIN.readline().strip()
|
||||
|
||||
def get_local_timezone():
|
||||
"""Returns the Olson identifier of the local timezone.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue