Mock stdin

This commit is contained in:
Manuel Ebert 2013-07-19 12:44:39 +02:00
parent e75c24c696
commit 13f8e668dc
5 changed files with 43 additions and 44 deletions

View file

@ -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)

View file

@ -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.