Skip to content

Commit

Permalink
Remove erroneous call to Alfred 3
Browse files Browse the repository at this point in the history
  • Loading branch information
deanishe committed Jul 13, 2019
1 parent 35e06c9 commit 9f603ba
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 25 deletions.
Binary file not shown.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Alfred-Workflow==1.37.1
Alfred-Workflow==1.37.2
docopt==0.6.2
Faker==1.0.7
9 changes: 0 additions & 9 deletions src/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import os

from workflow import Variables
from workflow.util import run_applescript


log = logging.getLogger('workflow')
Expand Down Expand Up @@ -147,14 +146,6 @@ def intvar(name, default=0):
return default


def run_workflow(query=None):
"""Run workflow with query."""
query = KEYWORD + u' ' + (query or '')
script = SEARCH_AS.format(query=query)
log.debug(u'calling Alfred with query "%s" ...', query)
run_applescript(script)


def notify(title, text=''):
"""Show a notification."""
if not boolvar('SHOW_NOTIFICATIONS'):
Expand Down
10 changes: 4 additions & 6 deletions src/fakeum.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# Created on 2014-12-29
#

"""Alfred 3 workflow to generate test data."""
"""Alfred workflow to generate test data."""

from __future__ import print_function, absolute_import

Expand All @@ -19,14 +19,13 @@
import sys

from workflow import Workflow3, ICON_WARNING, MATCH_ALL, MATCH_ALLCHARS
from workflow.util import run_trigger, set_config
from workflow.util import run_trigger

from common import (
DEFAULT_SETTINGS,
ISSUE_URL,
UPDATE_SETTINGS,
intvar,
run_workflow,
)

# Query delimiter that separates faker name from quantity
Expand Down Expand Up @@ -200,7 +199,7 @@ def get_fake_data(names=None, count=1):
for name in names:

data = []
for i in range(count):
for _ in range(count):
data.append(get_fake_datum(name))

if name in ('Paragraph', 'Address'):
Expand Down Expand Up @@ -233,8 +232,7 @@ def main(wf):
if DELIMITER in query:
if query.endswith(DELIMITER):
# Back up to empty query
# run_trigger('fake')
run_workflow()
run_trigger('fake')
return

query, count = [s.strip() for s in query.split(DELIMITER)]
Expand Down
4 changes: 2 additions & 2 deletions src/info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ vars={allvars}
</dict>
</array>
<key>readme</key>
<string></string>
<string>Generate test data</string>
<key>uidata</key>
<dict>
<key>03F09777-FA2A-45F3-A8A8-49AA079FFC61</key>
Expand Down Expand Up @@ -1091,7 +1091,7 @@ vars={allvars}
<string>SHOW_NOTIFICATIONS</string>
</array>
<key>version</key>
<string>2.2.1</string>
<string>2.2.2</string>
<key>webaddress</key>
<string></string>
</dict>
Expand Down
10 changes: 4 additions & 6 deletions src/workflow/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ class Version(object):
"""

#: Match version and pre-release/build information in version strings
match_version = re.compile(r'([0-9\.]+)(.+)?').match
match_version = re.compile(r'([0-9][0-9\.]*)(.+)?').match

def __init__(self, vstr):
"""Create new `Version` object.
Expand All @@ -247,7 +247,7 @@ def _parse(self, vstr):
else:
m = self.match_version(vstr)
if not m:
raise ValueError('invalid version number: {!r}'.format(vstr))
raise ValueError('invalid version number: ' + vstr)

version, suffix = m.groups()
parts = self._parse_dotted_string(version)
Expand All @@ -257,7 +257,7 @@ def _parse(self, vstr):
if len(parts):
self.patch = parts.pop(0)
if not len(parts) == 0:
raise ValueError('version number too long: {!r}'.format(vstr))
raise ValueError('version number too long: ' + vstr)

if suffix:
# Build info
Expand All @@ -268,11 +268,9 @@ def _parse(self, vstr):
if suffix:
if not suffix.startswith('-'):
raise ValueError(
'suffix must start with - : {0}'.format(suffix))
'suffix must start with - : ' + suffix)
self.suffix = suffix[1:]

# wf().logger.debug('version str `{}` -> {}'.format(vstr, repr(self)))

def _parse_dotted_string(self, s):
"""Parse string ``s`` into list of ints and strings."""
parsed = []
Expand Down
2 changes: 1 addition & 1 deletion src/workflow/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.37.1
1.37.2

0 comments on commit 9f603ba

Please sign in to comment.