Skip to content

Commit

Permalink
migrating to Python3
Browse files Browse the repository at this point in the history
updated workflow package, commands to launch scripts
  • Loading branch information
giovannicoppola committed Jun 16, 2022
1 parent 954d1da commit 40a33e1
Show file tree
Hide file tree
Showing 35 changed files with 2,085 additions and 1,597 deletions.
Empty file modified .gitignore
100644 → 100755
Empty file.
11 changes: 0 additions & 11 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
# alfred-outlook
**Features added/edited**

- hotkey to launch search

To DO

- add `to:`operator
- fix attachment icon
- replace filters with conditional utility
-

***Alfred outlook mail search***

<p style="color:red">
Expand Down
Binary file removed icon.png
Binary file not shown.
File renamed without changes
0 LICENSE → src/LICENSE
100644 → 100755
File renamed without changes.
File renamed without changes
0 conf.py → src/conf.py
100644 → 100755
File renamed without changes.
0 consts.py → src/consts.py
100644 → 100755
File renamed without changes.
0 contact.py → src/contact.py
100644 → 100755
File renamed without changes.
0 event.py → src/event.py
100644 → 100755
File renamed without changes.
Binary file added src/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 20 additions & 12 deletions info.plist → src/info.plist
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@
</array>
</dict>
<key>createdby</key>
<string>giovanni from Xeric Wei</string>
<string>giovanni (from Xeric Wei)</string>
<key>description</key>
<string>Outlook Mail Search</string>
<key>disabled</key>
Expand Down Expand Up @@ -697,10 +697,9 @@ end pad</string>
<key>runningsubtext</key>
<string>Searching...</string>
<key>script</key>
<string># encoding: utf-8
#query=$1
python main.py "$1"</string>
<string>export PATH=/opt/homebrew/bin:/usr/local/bin:$PATH
export PYTHONPATH="$PWD/lib"
python3 main.py "$1"</string>
<key>scriptargtype</key>
<integer>1</integer>
<key>scriptfile</key>
Expand Down Expand Up @@ -922,9 +921,12 @@ python setconf.py "$query"</string>
<key>runningsubtext</key>
<string>processing...</string>
<key>script</key>
<string>query=$1
<string>export PYTHONPATH="$PWD/lib"
export PATH=/opt/homebrew/bin:/usr/local/bin:$PWD/lib/bin:$PATH
query=$1
python conf.py "$query"</string>
python3 conf.py "$query"</string>
<key>scriptargtype</key>
<integer>1</integer>
<key>scriptfile</key>
Expand Down Expand Up @@ -1125,10 +1127,13 @@ python conf.py "$query"</string>
<key>runningsubtext</key>
<string>Searching...</string>
<key>script</key>
<string># encoding: utf-8
<string>export PYTHONPATH="$PWD/lib"
export PATH=/opt/homebrew/bin:/usr/local/bin:$PWD/lib/bin:$PATH
query=$1
python contact.py "$query"</string>
python3 contact.py "$query"</string>
<key>scriptargtype</key>
<integer>1</integer>
<key>scriptfile</key>
Expand Down Expand Up @@ -1294,10 +1299,13 @@ end alfred_script</string>
<key>runningsubtext</key>
<string></string>
<key>script</key>
<string># encoding: utf-8
<string>export PYTHONPATH="$PWD/lib"
export PATH=/opt/homebrew/bin:/usr/local/bin:$PWD/lib/bin:$PATH
# encoding: utf-8
query=$1
python newmail.py "$query"</string>
python3 newmail.py "$query"</string>
<key>scriptargtype</key>
<integer>1</integer>
<key>scriptfile</key>
Expand Down Expand Up @@ -1733,7 +1741,7 @@ https://github.com/xeric/alfred-outlook</string>
<string>~/Downloads/outlook_attachments/</string>
</dict>
<key>version</key>
<string>0.1.9</string>
<string>0.2</string>
<key>webaddress</key>
<string>https://github.com/giovannicoppola/alfred-outlook</string>
</dict>
Expand Down
0 mail.png → src/mail.png
100644 → 100755
File renamed without changes
14 changes: 6 additions & 8 deletions main.py → src/main.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ def main(wf):

handle(wf, query)

log.info('searching mail with keyword')


def handle(wf, query):
# log.info("The query " + query + " is " + str(ud.name(query[0])))
Expand All @@ -68,7 +66,7 @@ def handle(wf, query):
# set default profile to improve user experience
if storedProfle is None:
log.info("stored profile is empty, try to get new one!")
Util.configureDefaultProfile(wf)
# Util.configureDefaultProfile(wf)
else:
log.info("configured profile is" + storedProfle)

Expand Down Expand Up @@ -360,11 +358,11 @@ def queryAll(cur, keywords, offset, pageSize, folder, top = -1):
'frequency': UPDATE_FREQUENCY
})

if not Util.isAlfredV2(wf):
wf = Workflow3(update_settings={
'github_slug': GITHUB_SLUG,
'frequency': UPDATE_FREQUENCY
})

wf = Workflow3(update_settings={
'github_slug': GITHUB_SLUG,
'frequency': UPDATE_FREQUENCY
})

log = wf.logger

Expand Down
0 newmail.py → src/newmail.py
100644 → 100755
File renamed without changes.
0 setconf.py → src/setconf.py
100644 → 100755
File renamed without changes.
0 util.py → src/util.py
100644 → 100755
File renamed without changes.
File renamed without changes.
File renamed without changes.
104 changes: 104 additions & 0 deletions src/workflow/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
#!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2014 Dean Jackson <[email protected]>
#
# 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

# Filter matching rules
# Icons
# Exceptions
# Workflow objects
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,
MATCH_ALL,
MATCH_ALLCHARS,
MATCH_ATOM,
MATCH_CAPITALS,
MATCH_INITIALS,
MATCH_INITIALS_CONTAIN,
MATCH_INITIALS_STARTSWITH,
MATCH_STARTSWITH,
MATCH_SUBSTRING,
KeychainError,
PasswordNotFound,
Workflow,
manager,
)
from .workflow3 import Variables, Workflow3

__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",
]
Loading

0 comments on commit 40a33e1

Please sign in to comment.