Skip to content

Commit

Permalink
Adding ability to specify the log file
Browse files Browse the repository at this point in the history
This address issue #101
  • Loading branch information
anufrievroman committed Feb 4, 2025
1 parent eaf2c1f commit 5a4d164
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions calcure/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

# Initialise config:
cf = Config()
error = Error(cf.config_folder / "info.log")
error = Error(cf.LOG_FILE)

# Language:
if cf.LANG == "fr":
Expand All @@ -49,7 +49,7 @@
from calcure.translations.en import *


__version__ = "3.1"
__version__ = "3.2"


def read_items_from_user_arguments(screen, user_tasks, user_events, task_saver_csv, event_saver_csv):
Expand Down
4 changes: 4 additions & 0 deletions calcure/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def __init__(self):
self.calcurse_events_file = self.home_path / ".local" / "share" / "calcurse" / "apts"
self.config_folder = self.home_path / ".config" / "calcure"
self.config_file = self.config_folder / "config.ini"
self.log_file = self.config_folder / "info2.log"
self.is_first_run= True

# Create config folder:
Expand Down Expand Up @@ -232,11 +233,14 @@ def read_config_file(self):
self.WEATHER_CITY = conf.get("Parameters", "weather_city", fallback="")
self.WEATHER_METRIC_UNITS = conf.getboolean("Parameters", "weather_metric_units", fallback=True)
self.DEFAULT_CALENDAR_VIEW = conf.get("Parameters", "default_calendar_view", fallback="monthly")
self.LOG_FILE = conf.get("Parameters", "log_file", fallback=self.log_file)
self.LOG_FILE = Path(self.LOG_FILE).expanduser()

# Journal settings:
self.CALCURSE_TODO_FILE = conf.get("Parameters", "calcurse_todo_file", fallback=self.calcurse_todo_file)
self.CALCURSE_TODO_FILE = Path(self.CALCURSE_TODO_FILE).expanduser()


self.CALCURSE_EVENTS_FILE = conf.get("Parameters", "calcurse_events_file", fallback=self.calcurse_events_file)
self.CALCURSE_EVENTS_FILE = Path(self.CALCURSE_EVENTS_FILE).expanduser()

Expand Down

0 comments on commit 5a4d164

Please sign in to comment.