-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
77d463f
commit e027271
Showing
12 changed files
with
10 additions
and
52 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 |
---|---|---|
|
@@ -11,45 +11,38 @@ | |
package_root_directory = file.parents[1] | ||
sys.path.append(str(package_root_directory)) | ||
|
||
|
||
@click.group() | ||
def cli(): | ||
"""Main Click group for the command line interface.""" | ||
pass | ||
|
||
|
||
@cli.group() | ||
def list_items(): | ||
"""Click group for list items related commands.""" | ||
pass | ||
|
||
|
||
@cli.group() | ||
def item(): | ||
"""Click group for item related commands.""" | ||
pass | ||
|
||
|
||
@cli.group() | ||
def web_browser(): | ||
"""Click group for web browser related commands.""" | ||
pass | ||
|
||
|
||
@click.command() | ||
@click.option('--day', 'transformation', flag_value='day') | ||
@click.option('--all', 'transformation', flag_value='all') | ||
def list(transformation): | ||
""" | ||
Lists items based on the selected transformation flag. | ||
:param transformation: The selected transformation flag (week, day, or all). | ||
""" | ||
if transformation == "day": | ||
today = ListBuilder.list_today() | ||
if today is not None: | ||
print("today - " + str(today) + "\n") | ||
|
||
elif transformation == "all": | ||
all_list = ListBuilder.list_all() | ||
if all_list is not None: | ||
|
@@ -62,7 +55,6 @@ def list(transformation): | |
def new(transformation): | ||
""" | ||
Adds a new entry to the list. | ||
:param transformation: The entry text to add. | ||
""" | ||
if transformation == "entry": | ||
|
@@ -77,12 +69,10 @@ def new(transformation): | |
def delete(uid): | ||
""" | ||
Deletes an item with the specified ID. | ||
:param uid: The ID of the item to delete. | ||
""" | ||
ListBuilder.delete(uid) | ||
|
||
|
||
@click.command() | ||
@click.option("--url", default="http://127.0.0.1:5000", help="URL to open in the web browser") | ||
def launch(url): | ||
|
@@ -93,20 +83,16 @@ def launch(url): | |
click.launch(url) | ||
app.run() | ||
|
||
|
||
@click.command() | ||
def mail(): | ||
""" | ||
Sends an email with the week's work items. | ||
""" | ||
recipient = "[email protected]" | ||
subject = "work for week" | ||
|
||
body = "" | ||
|
||
webbrowser.open('mailto:?to=' + recipient + '&subject=' + subject + '&body=' + body, new=1) | ||
|
||
|
||
list_items.add_command(list) | ||
item.add_command(new) | ||
item.add_command(delete) | ||
|
@@ -116,4 +102,4 @@ def mail(): | |
cli = click.CommandCollection(sources=[list_items, item, web_browser]) | ||
|
||
if __name__ == '__main__': | ||
cli() | ||
cli() |
This file was deleted.
Oops, something went wrong.
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
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
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