Skip to content

Commit

Permalink
config manager
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonak-Adipta-Kalita committed Jul 15, 2024
1 parent 7a1b008 commit 2ac3a46
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
3 changes: 2 additions & 1 deletion flomo/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import flomo.tracker as tracker
import flomo.ui as ui
import flomo.errors as errors
import flomo.config as config


@click.group(cls=click_aliases.ClickAliasedGroup)
Expand All @@ -26,7 +27,7 @@ def init():
db.create_table()
db.conn.close()

# Initialize Config
config.Config().create_config()


@flomo.command(aliases=["s"])
Expand Down
9 changes: 9 additions & 0 deletions flomo/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import flomo.helpers as helpers


class Config:
def __init__(self):
self.path = helpers.get_path("config.json", in_data=True)

def create_config(self):
pass
5 changes: 5 additions & 0 deletions flomo/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@ def __init__(self):
class NoSessionError(Exception):
def __init__(self, session_id):
super().__init__(f"No session with ID {session_id} was found.")


class NoConfigError(Exception):
def __init__(self):
super().__init__("No config file found. Please run `flomo init`.")

0 comments on commit 2ac3a46

Please sign in to comment.