Ladybug
After finding this thread, I've now tried to only copy the ladybug *.ghuser
files. RhinoWIP loads, but Ladybug doesn't fly. Based on the traceback error, I can understand why
Runtime error (TypeErrorException): argument of type 'NoneType' is not iterable
Traceback:
line 123, in __init__, "<string>"
line 239, in script
Circa line 123:
#set up default pass
if not self.folderIsSetByUser:
if os.path.exists("c:\\ladybug\\") and os.access(os.path.dirname("c:\\ladybug\\"), os.F_OK):
# folder already exists so it is all fine
sc.sticky["Ladybug_DefaultFolder"] = "c:\\ladybug\\"
elif os.access(os.path.dirname("c:\\"), os.F_OK):
#the folder does not exists but write privileges are given so it is fine
sc.sticky["Ladybug_DefaultFolder"] = "c:\\ladybug\\"
else:
# let's use the user folder
appdata = os.getenv("APPDATA")
# make sure appdata doesn't have space
if (" " in appdata):
msg = "User name on this system: " + appdata + " has white space." + \
" Default fodelr cannot be set.\nUse defaultFolder_ to set the path to another folder and try again!" + \
"\nLadybug failed to fly! :("
print msg
ghenv.Component.AddRuntimeMessage(gh.GH_RuntimeMessageLevel.Warning, msg)
sc.sticky["Ladybug_DefaultFolder"] = ""
self.letItFly = False
return
sc.sticky["Ladybug_DefaultFolder"] = os.path.join(appdata, "Ladybug\\")
So, if I supplied a path (eg: /Users/julien/Documents/ladybug/) it skips that section. Moving on, it crashes on line 6452
if sc.sticky.has_key("ladybug_release") and sc.sticky["ladybug_release"]:
print "Hi " + os.getenv("USERNAME")+ "!\n" + \
"Ladybug is Flying! Vviiiiiiizzz...\n\n" + \
"Default path is set to: " + sc.sticky["Ladybug_DefaultFolder"]
Let's get ride of the os.getenv("USERNAME")
.
Ladybug is now flying!
But: I get a bunch of errors, for example when trying to use the "Download EPW" module:
Runtime error (ImportException): No module named fcntl
Traceback:
line 430, in <module>, "/Applications/RhinoWIP.app/Contents/Resources/ManagedPlugIns/RhinoDLR_Python.rhp/Lib/subprocess.py"
line 9, in <module>, "/Applications/RhinoWIP.app/Contents/Resources/ManagedPlugIns/RhinoDLR_Python.rhp/Lib/webbrowser.py"
line 45, in script
So, the problem is that subprocess.py
calls fcntl.py
which doesn't exist.
Using mono on mac, I ran the same IronPython version as Rhino (2.7.5) and found the same problem.
Then I used the latest stable version: 2.7.6.3. Import of subprocess works.
So I copied the Lib/subprocess.py rom the 2.7.6.3 over to overwrite the one located at /Applications/RhinoWIP.app/Contents/Resources/ManagedPlugIns/RhinoDLR_Python.rhp/Lib/
. The download EPW module now doesn't crash (even though it doesn't do jack squat either).