diff --git a/github.py b/github.py index 5222d8e..5099a83 100644 --- a/github.py +++ b/github.py @@ -38,7 +38,7 @@ def get_last(r): def get_all_urls(r): last = get_last(r) if not last: - return None + return [] inclusive_last = last + 1 return ['https://api.github.com/user/repos?page=%d' % page for page in range(2, inclusive_last)] @@ -78,7 +78,8 @@ def main(wf): if args and args[0] == '--auth': # TODO provide helper to take them to documentation to get api token # configured correctly - wf.store_data('token', args[1]) + token = args[1] + wf.store_data('token', token) load_repos(wf, token) return @@ -90,7 +91,7 @@ def main(wf): repos = get_repos(wf, token) if args: - repos = wf.filter(args[0], repos, key=lambda repo: repo['full_name']) + repos = wf.filter(args[0], repos, lambda repo: repo['full_name']) if not repos: wf.warn_empty('No repos found. Refresh repos or try a different query.') diff --git a/info.plist b/info.plist index 5973bca..b111890 100644 --- a/info.plist +++ b/info.plist @@ -6,6 +6,19 @@ com.matthewmcg.github connections + 089FEA1F-952B-4635-91C6-24861402B336 + + + destinationuid + 91271B1E-81B0-4250-B21C-43C1A91BAA4D + modifiers + 0 + modifiersubtext + + vitoclose + + + 14CD89E9-013C-4392-8D0B-0B104A5A94C8 @@ -72,7 +85,17 @@ destinationuid - 91271B1E-81B0-4250-B21C-43C1A91BAA4D + 089FEA1F-952B-4635-91C6-24861402B336 + modifiers + 0 + modifiersubtext + + vitoclose + + + + destinationuid + FC66336B-014C-4578-BD4D-CD40A8A021F7 modifiers 0 modifiersubtext @@ -306,6 +329,27 @@ version 1 + + config + + lastpathcomponent + + onlyshowifquerypopulated + + removeextension + + text + + title + Github repos have been refreshed + + type + alfred.workflow.output.notification + uid + 91271B1E-81B0-4250-B21C-43C1A91BAA4D + version + 1 + config @@ -350,24 +394,43 @@ version 2 + + config + + inputstring + {query} + matchcasesensitive + + matchmode + 0 + matchstring + + + type + alfred.workflow.utility.filter + uid + 089FEA1F-952B-4635-91C6-24861402B336 + version + 1 + config lastpathcomponent onlyshowifquerypopulated - + removeextension text - + Debug the workflow to see the error title - Github repos have been reloaded + An error happened while refreshing type alfred.workflow.output.notification uid - 91271B1E-81B0-4250-B21C-43C1A91BAA4D + FC66336B-014C-4578-BD4D-CD40A8A021F7 version 1 @@ -376,6 +439,13 @@ uidata + 089FEA1F-952B-4635-91C6-24861402B336 + + xpos + 670 + ypos + 390 + 14CD89E9-013C-4392-8D0B-0B104A5A94C8 xpos @@ -414,9 +484,9 @@ 91271B1E-81B0-4250-B21C-43C1A91BAA4D xpos - 620 + 810 ypos - 380 + 330 BA2EBD77-09E9-40ED-95CB-C516BB3FD1E7 @@ -453,8 +523,15 @@ ypos 170 + FC66336B-014C-4578-BD4D-CD40A8A021F7 + + xpos + 770 + ypos + 450 + webaddress - + https://github.com/matthewmcgarvey/alfred-github-workflow