Skip to content

Commit

Permalink
Merge 77a48a7 into 278ca58
Browse files Browse the repository at this point in the history
  • Loading branch information
StephaneMangin committed Oct 6, 2020
2 parents 278ca58 + 77a48a7 commit 6fdb273
Show file tree
Hide file tree
Showing 34 changed files with 2,598 additions and 2,545 deletions.
4 changes: 2 additions & 2 deletions benchmark.py
Expand Up @@ -9,8 +9,8 @@
pkgdir = os.path.join(os.path.dirname(__file__), 'src')
sys.path.insert(0, pkgdir)

from gtimelog.settings import Settings
from gtimelog.timelog import parse_datetime, TimeLog
from gtimelog.core.settings import Settings
from gtimelog.core.timelog import parse_datetime, TimeLog


fns = []
Expand Down
5 changes: 3 additions & 2 deletions gtimelog
@@ -1,13 +1,14 @@
#!/usr/bin/python3
#!/usr/bin/env python
"""
Script to run GTimeLog from the source checkout without installing
"""
import os
import sys

from gtimelog.main import main

basedir = os.path.dirname(os.path.realpath(__file__))
pkgdir = os.path.join(basedir, 'src')
sys.path.insert(0, pkgdir)

from gtimelog.main import main # noqa: E402
main()
10 changes: 9 additions & 1 deletion src/gtimelog/__init__.py
@@ -1,3 +1,11 @@
# The gtimelog package.
import logging
import sys

__version__ = '0.12.0.dev0'
DEBUG = '--debug' in sys.argv
root_logger = logging.getLogger()
root_logger.addHandler(logging.StreamHandler())
if DEBUG:
root_logger.setLevel(logging.DEBUG)
else:
root_logger.setLevel(logging.INFO)
Empty file added src/gtimelog/core/__init__.py
Empty file.
2 changes: 2 additions & 0 deletions src/gtimelog/core/exceptions.py
@@ -0,0 +1,2 @@
class EmailError(Exception):
pass
8 changes: 3 additions & 5 deletions src/gtimelog/settings.py → src/gtimelog/core/settings.py
Expand Up @@ -10,9 +10,7 @@

from configparser import RawConfigParser


from gtimelog.timelog import parse_time

from gtimelog.core.utils import parse_time

legacy_default_home = os.path.normpath('~/.gtimelog')
default_config_home = os.path.normpath('~/.config')
Expand Down Expand Up @@ -53,7 +51,8 @@ class Settings(object):

report_style = 'plain'

def check_legacy_config(self):
@staticmethod
def check_legacy_config():
envar_home = os.environ.get('GTIMELOG_HOME')
if envar_home is not None:
return os.path.expanduser(envar_home)
Expand Down Expand Up @@ -155,4 +154,3 @@ def save(self, filename):
config = self._config()
with open(filename, 'w') as f:
config.write(f)

0 comments on commit 6fdb273

Please sign in to comment.