python script fails in hazel, works in terminal

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Hi there. I use Hazel (among many other things) to copy the public URL for files I add to my Dropbox public folder. It watches that folder and just runs a simple python script. Been using the same script forever. In the last few days it seems to have stopped working. Using 3.0.5.

Here's the error being logged:
Code: Select all
5/1/12 1:31:30.225 PM [0x0-0x16d16d].com.noodlesoft.HazelHelper: Python error: <stdin> is a directory, cannot continue


And here's the script (saved as it's own file—not embedded (although I tried that too to same effect)):
Code: Select all
#!/usr/bin/python

import sys
import urllib
import syslog
import os

syslog.openlog("system")
file = sys.argv[1]
encFile = urllib.quote(file)
encFile = os.path.basename(encFile)
url = "http://dl.dropbox.com/u/obscured/" + encFile
cmd = "echo %s | pbcopy" % url
os.system(cmd)

cmd = '/usr/local/bin/growlnotify -n "script" -a "Terminal.app" -m "Dropbox URL copied for\n%s"' % os.path.basename(file)
syslog.syslog(syslog.LOG_INFO, cmd)
os.system(cmd)

syslog.closelog()




Any ideas?
cliffw
 
Posts: 1
Joined: Tue May 01, 2012 4:34 pm

There seems to be a oddly random thing that I've been noticing on and off. Can you try reinstalling Hazel? Use the following procedure:

- Quit System Preferences.
- Go to your Library/PreferencePanes folder and throw away Hazel.prefPane
- Download the latest version from the site.
- Move the new Hazel.prefPane to Library/PreferencePanes
- Launch System Preferences and load up Hazel.

If that doesn't work, email me as I may need you to try some test builds.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Any update on this? Did reinstalling Hazel work? Do we know the culprit yet?
mpacer
 
Posts: 1
Joined: Sun Sep 09, 2012 6:59 pm

I don't recall what the outcome was here but if you are having problems, I suggest posting specific details.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support