Jump to content

CarlosNZ

Member
  • Posts

    392
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by CarlosNZ

  1. Sorry, I must be an idiot. Replaced line 94 with that chunk, and now I get this: File "help.py", line 95 commands += "\r\n* `" + item['config']['keyword'] + "`" ^ IndentationError: expected an indented block I'm probably doing something really stupid, but I don't really know python.
  2. Thanks Shawn. Here is the output from help.py: Traceback (most recent call last): File "help.py", line 94, in <module> commands += "\r\n* `" + item['config']['keyword'] + "`" KeyError: 'keyword' Hope that helps. [Does that mean it's failing because of a missing keyword? Quite possible, as I have a few workflows (works-in-progress, etc.) that have empty fields for the keyword currently.]
  3. Hey, cool idea. However, it's not working for me. I get the "Help file is being generated" notification, but then nothing — I never see the output file. (Also, might I suggest outputting the markdown file to the Desktop as well, since it'd be nice to have a handy workflow reference without regenerating the list via this workflow every time you wanna quickly look it up.)
  4. You wanna add in support for the Alleyoop auto-updater? (Makes sense since you seem to have a superfast release cycle! )
  5. Great stuff, seems to be working nicely now with those UTF-8 filenames. Well done! Couple of comments (growing to four with edits): I can't remember who mentioned it earlier, but I can confirm that the updates work fine via a bit.ly shortlink. Just remember to link it to the direct download URL, not just the download page. I notice that the update process doesn't delete extraneous files. So if I release an update that does away with a number of files, or if I just rename them, the old versions will be left in the workflow folder. Maybe do a "delete all" from the workflow folder before extracting the zip? And just for safety, send it to the trash rather than completely deleting it. (Even better, maybe zip the existing workflow into a .alfredworkflow file, then send that to the trash - that way a version rollback (as I mentioned earlier) would be really simple for the user) Because checking every workflow against its online update file takes a good few seconds (at least on my crummy connection), it's a bit of a pain to have to wait with Alfred in front and you can't do anything else. Might I suggest a "oop check" keyword that runs an update check in the background, and then posts a notification if there is (or isn't) any updates. Then, we can do the actual update ("oop") knowing that it'll actually be worthwhile. And, oh, I gotta ask - where does the name "Alleyoop" come from? But well done, everything seems to be working nicely now. Cheers.
  6. D'oh! Traceback (most recent call last): File "act.py", line 61, in <module> act() File "act.py", line 50, in act do_download(remote, target_path) File "act.py", line 27, in do_download z.extractall(target) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/zipfile.py", line 962, in extractall self.extract(zipinfo, path, pwd) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/zipfile.py", line 950, in extract return self._extract_member(member, path, pwd) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/zipfile.py", line 979, in _extract_member targetpath = os.path.join(targetpath, member.filename) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py", line 71, in join path += '/' + b UnicodeDecodeError: 'ascii' codec can't decode byte 0xcc in position 9: ordinal not in range(128) Now I really must go to sleep now. FWIW, it shouldn't be a huge deal to make my filenames ASCII compliant. I've figured what I'd need to do. So if this is causing you too much grief at the moment, I'm happy to go down that road. But then again, I'm sure there'll be others down the road who have this issue too. I'll check back here in the morn and see what you reckon is the best option for now. Cheers.
  7. Getting closer. I ran it normal, got "All updates completed". Pretty good, but I checked and the workflow wasn't actually updated. Ran it again with error logging, and this: checkdir: cannot create extraction directory: "/Users/Carl/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.C9701075-D8DD-4A86-BDAC-35D6CA0EABE5" All updates complete. So, if that's the output from the "unzip" command, then it's probably just a matter of finding the right flags. Maybe "-o" (overwrite), but not sure if that's just for files.
  8. Odd. Basically the same in the latest: Traceback (most recent call last): File "act.py", line 59, in <module> act() File "act.py", line 35, in act do_download(remote, target_path) File "act.py", line 24, in do_download z.extractall(target) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/zipfile.py", line 962, in extractall self.extract(zipinfo, path, pwd) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/zipfile.py", line 950, in extract return self._extract_member(member, path, pwd) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/zipfile.py", line 979, in _extract_member targetpath = os.path.join(targetpath, member.filename) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py", line 71, in join path += '/' + b UnicodeDecodeError: 'ascii' codec can't decode byte 0xcc in position 9: ordinal not in range(128)
  9. Pretty much the same thing, I'm afraid: Traceback (most recent call last): File "act.py", line 60, in <module> act() File "act.py", line 36, in act do_download(remote, target_path) File "act.py", line 20, in do_download g.write(r.request.content) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/codecs.py", line 691, in write return self.writer.write(data) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/codecs.py", line 351, in write data, consumed = self.encode(object, self.errors) UnicodeDecodeError: 'ascii' codec can't decode byte 0xa9 in position 14: ordinal not in range(128)
  10. That latest download still has "v1.6" in the json file. Not sure if it's the same version, or if you just forgot to update the internal json file in 1.7. If it's the latter, then it's still not working (same error log too).
  11. Nah, still no go. Here's the output now: Traceback (most recent call last): File "act.py", line 60, in <module> act() File "act.py", line 36, in act do_download(remote, target_path) File "act.py", line 20, in do_download g.write(r.request.content) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/codecs.py", line 691, in write return self.writer.write(data) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/codecs.py", line 351, in write data, consumed = self.encode(object, self.errors) UnicodeDecodeError: 'ascii' codec can't decode byte 0xa9 in position 14: ordinal not in range(128) Yeah, it would be bit of a pain to have to rename the files, since they're named so that they match the country names that Google returns exactly. I guess I could run the Google country names through some kind of ASCII-fier (I think iconv will do it), but that's not an ideal solution. Just a thought (and forgive me if it's a stupid one — I don't know much about Python ) — you seem to be using a python zip module; would it be possible/convenient/helpful to just call OS X's built-in zip utility (command line: zip)?
  12. A few of the pngs in the flags folder have non-ASCII characters in the filename.
  13. Nope, not locally. The download filename has a space in it though, which puts a '%20' in the uri. Could that be a problem? Specifically, the whole remote json file is: { "version": 1.6, "download_uri": "http://cl.ly/NwuW/download/TimeZones%20v1.6.alfredworkflow", "description": "Now supports one-off custom lookups. See changelog for full details." } and is located at: http://alfred.philosophicalzombie.net/workflow_updates/timezones.json if that helps. Let me know if you'd like me to PM you a link to the (unreleased) workflow version I'm trying to use to test the update. Cheers.
  14. Hey, I'm just trying this out with one of my workflows, and the update process is silently failing. Here is the output from the 'act.py' script: Traceback (most recent call last): File "act.py", line 55, in <module> act() File "act.py", line 31, in act do_download(remote, target_path) File "act.py", line 20, in do_download z.extractall(target) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/zipfile.py", line 962, in extractall self.extract(zipinfo, path, pwd) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/zipfile.py", line 950, in extract return self._extract_member(member, path, pwd) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/zipfile.py", line 979, in _extract_member targetpath = os.path.join(targetpath, member.filename) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py", line 71, in join path += '/' + b UnicodeDecodeError: 'ascii' codec can't decode byte 0xcc in position 9: ordinal not in range(128) Any thoughts?
  15. v1.6 released. One main new feature: custom lookups — just keep typing after the tz to look up the time in a place without saving it to your list: Also, I've added experimental support for autocomplete for adding place names. You'll need to add a keyword yourself to the script filter if you want to try it out. The reason I haven't enabled it by default is that I've found it kind of slow and I'm not sure it's actually an improvement over the current method. I'd be keen to know what people think. Full deets and download link in initial post (now supports Alleyoop auto-updates too ).
  16. I'd like to suggest that this topic be "pinned" to the top of this forum, so more workflow creators can be aware of it. The more people that use it, the better it becomes, right?
  17. Not a huge deal, but a slight visual unpleasantness. When displaying output with Large Text, if the text ends close to the end of a line, there is an extra new line that is added unnecessarily. Here is a normal output: And then, if I add one more character (X), the text still fits on that second line, yet there is an extra line break added: Maybe Alfred is adding a space or two of padding somehow? Just thought I'd point it out.
  18. One suggestion - definitely not a priority, but if you find yourself wondering what else to add to make it even more awesome than it is — Add a "revert" feature, to quickly rollback to the previous version of the workflow in case the updated workflow is too buggy or faulty in some way. I guess you'd just zip up the existing workflow folder and save it in a cache somewhere before performing the update so it could be called back easily. Just a thought.
  19. I think you'll have to manually edit the timezones.txt file to put them in the order you want (as well as the $RANDOM id thing). Or just delete the cities one by one using the workflow and re-add them in the order you want. Sorry I can't make it easier than that, but sort order is a whole extra level of complexity that I haven't even thought about yet.
  20. Hmm, pretty sure I hadn't actually created an "update.json" file yet. But whatever, it works now. Cheers. One question regarding setup for workflows: I like to put the version number in the filename (makes it way easier to keep track of IMHO), so I'm assuming this will still be okay, as long as the static "remote.json" is updated with the new filename at the same time as I update the version no.? { "version": 1.5, "download_uri": "http://webhost.com/Workflows/MyWorkflowv1.5.alfredworkflow", "description": "Points to a new file now. Okay?" }
  21. Righto. Here you go: Traceback (most recent call last): File "feedback.py", line 96, in <module> do_feedback() File "feedback.py", line 33, in do_feedback remote_uri = local["remote_json"] KeyError: 'remote_json' Hope that helps.
  22. Hey, when trying to run the workflow, it's getting stuck here, with nothing further happening: Interestingly, it seems to be exactly the same problem as I had earlier today with this workflow, which was also Python-based, and it also traversed the Alfred workflow folder, so it's quite possibly same issue. Maybe take a look at how he fixed it? (Or is just because it's not finding any workflow with update info? In which case, it should probably show "No updates found" or something, right?)
×
×
  • Create New...