-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from Jonak-Adipta-Kalita/main
visualizing tracking data - 2
- Loading branch information
Showing
6 changed files
with
112 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import os | ||
|
||
import flomo.errors as errors | ||
import flomo.helpers as helpers | ||
|
||
|
||
class Config: | ||
def __init__(self, initializing: bool = False): | ||
self.path = helpers.get_path("config.json", in_data=True) | ||
|
||
if not initializing and not self._config_file_exists(): | ||
raise errors.NoConfigError() | ||
|
||
def _config_file_exists(self): | ||
return os.path.exists(self.path) # TODO: Check if file contents are proper. | ||
|
||
def create_config(self): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
class DBFileNotFoundError(Exception): | ||
def __init__(self): | ||
super().__init__("Database file does not exist. Please run `flomo init`.") | ||
|
||
|
||
class NoConfigError(Exception): | ||
def __init__(self): | ||
super().__init__("No config file found. Please run `flomo init`.") | ||
|
||
|
||
class NoSessionsError(Exception): | ||
def __init__(self): | ||
super().__init__("No sessions were found.") | ||
|
||
|
||
class NoSessionError(Exception): | ||
def __init__(self, session_id): | ||
super().__init__(f"No session with ID {session_id} was found.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters