-
Notifications
You must be signed in to change notification settings - Fork 1
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
Andrzej Skrodzki
authored and
Andrzej Skrodzki
committed
Aug 11, 2019
1 parent
6f2e27e
commit 19de39d
Showing
14 changed files
with
6,142 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# encoding: utf-8 | ||
|
||
import sys | ||
from workflow import Workflow, ICON_WEB, web | ||
from src import api, env | ||
|
||
|
||
def main(wf): | ||
print("asdasd") | ||
local_env = env.read_local_env() | ||
token = local_env["token"] | ||
workspaces = api.get_all_workspaces(token) | ||
|
||
# Loop through the returned posts and add an item for each to | ||
# the list of results for Alfred | ||
for workspace in workspaces: | ||
wf.add_item(title=workspace['name'], | ||
subtitle=workspace['id'], | ||
icon=ICON_WEB) | ||
|
||
# Send the results to Alfred as XML | ||
wf.send_feedback() | ||
|
||
|
||
if __name__ == u"__main__": | ||
wf = Workflow() | ||
sys.exit(wf.run(main)) |
Empty file.
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,15 @@ | ||
from datetime import datetime, timedelta | ||
|
||
def get_timeentry_range(date_str, hours_spent): | ||
parsed_date = None | ||
try: | ||
parsed_date = datetime.strptime(date_str, '%Y-%m-%d') | ||
except ValueError: | ||
raise AssertionError("Date is in wrong format") | ||
|
||
start_date = parsed_date + timedelta(hours=7) | ||
end_date = start_date + timedelta(hours=hours_spent) | ||
|
||
date_format = "%Y-%m-%dT%H:%M:%S.%fZ" | ||
|
||
return [start_date.strftime(date_format), end_date.strftime(date_format)] |
Binary file not shown.
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,108 @@ | ||
#!/usr/bin/env python | ||
# encoding: utf-8 | ||
# | ||
# Copyright (c) 2014 Dean Jackson <deanishe@deanishe.net> | ||
# | ||
# MIT Licence. See http://opensource.org/licenses/MIT | ||
# | ||
# Created on 2014-02-15 | ||
# | ||
|
||
"""A helper library for `Alfred <http://www.alfredapp.com/>`_ workflows.""" | ||
|
||
import os | ||
|
||
# Workflow objects | ||
from .workflow import Workflow, manager | ||
from .workflow3 import Variables, Workflow3 | ||
|
||
# Exceptions | ||
from .workflow import PasswordNotFound, KeychainError | ||
|
||
# Icons | ||
from .workflow import ( | ||
ICON_ACCOUNT, | ||
ICON_BURN, | ||
ICON_CLOCK, | ||
ICON_COLOR, | ||
ICON_COLOUR, | ||
ICON_EJECT, | ||
ICON_ERROR, | ||
ICON_FAVORITE, | ||
ICON_FAVOURITE, | ||
ICON_GROUP, | ||
ICON_HELP, | ||
ICON_HOME, | ||
ICON_INFO, | ||
ICON_NETWORK, | ||
ICON_NOTE, | ||
ICON_SETTINGS, | ||
ICON_SWIRL, | ||
ICON_SWITCH, | ||
ICON_SYNC, | ||
ICON_TRASH, | ||
ICON_USER, | ||
ICON_WARNING, | ||
ICON_WEB, | ||
) | ||
|
||
# Filter matching rules | ||
from .workflow import ( | ||
MATCH_ALL, | ||
MATCH_ALLCHARS, | ||
MATCH_ATOM, | ||
MATCH_CAPITALS, | ||
MATCH_INITIALS, | ||
MATCH_INITIALS_CONTAIN, | ||
MATCH_INITIALS_STARTSWITH, | ||
MATCH_STARTSWITH, | ||
MATCH_SUBSTRING, | ||
) | ||
|
||
|
||
__title__ = 'Alfred-Workflow' | ||
__version__ = open(os.path.join(os.path.dirname(__file__), 'version')).read() | ||
__author__ = 'Dean Jackson' | ||
__licence__ = 'MIT' | ||
__copyright__ = 'Copyright 2014-2019 Dean Jackson' | ||
|
||
__all__ = [ | ||
'Variables', | ||
'Workflow', | ||
'Workflow3', | ||
'manager', | ||
'PasswordNotFound', | ||
'KeychainError', | ||
'ICON_ACCOUNT', | ||
'ICON_BURN', | ||
'ICON_CLOCK', | ||
'ICON_COLOR', | ||
'ICON_COLOUR', | ||
'ICON_EJECT', | ||
'ICON_ERROR', | ||
'ICON_FAVORITE', | ||
'ICON_FAVOURITE', | ||
'ICON_GROUP', | ||
'ICON_HELP', | ||
'ICON_HOME', | ||
'ICON_INFO', | ||
'ICON_NETWORK', | ||
'ICON_NOTE', | ||
'ICON_SETTINGS', | ||
'ICON_SWIRL', | ||
'ICON_SWITCH', | ||
'ICON_SYNC', | ||
'ICON_TRASH', | ||
'ICON_USER', | ||
'ICON_WARNING', | ||
'ICON_WEB', | ||
'MATCH_ALL', | ||
'MATCH_ALLCHARS', | ||
'MATCH_ATOM', | ||
'MATCH_CAPITALS', | ||
'MATCH_INITIALS', | ||
'MATCH_INITIALS_CONTAIN', | ||
'MATCH_INITIALS_STARTSWITH', | ||
'MATCH_STARTSWITH', | ||
'MATCH_SUBSTRING', | ||
] |
Oops, something went wrong.