Combine selected points into one point
-
no, but you will have access to other python scripts and modules if they are on the same level or deeper
(this isn't a limitation of RoboFont, this is default python behavior if the module isn't added to the site packages orsys.path
)scripting Root - test.py # test can import testFolder and all sub py files - testFolder - __init__.py - otherFile.py # otherFile can not import test.py or otherTestFolder - otherTestFolder - __init__.py
hope this makes sense
-
Ah, I see what you mean.
Alternately, RoboFont could add the root folder of the extension to the python path when it invokes a script from that extension.
I'm not sure how you're invoking extension scripts in Robofont...
Anyhow, I've reorganized the extension per your suggestion.
Thanks
-
Alternately, RoboFont could add the root folder of the extension to the python path when it invokes a script from that extension.
I’m not sure how you’re invoking extension scripts in Robofont…mm, I think this will be a mess after a while.
It's already super easy to add a path to
sys.path
:)
-
Yes, you're right.
-
I moved this extension to http://charlesmchen.github.com/typefacet-robofont/
-
a progress bar example:
from defconAppKit.windows.progressWindow import ProgressWindow # CurrentFontWindow is only available only in RoboFont 1.3 from mojo.UI import CurrentFontWindow import time progress = ProgressWindow("my progress") time.sleep(2) progress.close() ## attach as sheet to a window progress = ProgressWindow("my progress", parentWindow=CurrentFontWindow().window()) time.sleep(2) progress.update("action....") time.sleep(2) progress.close() ## with tickcount count = 20 progress = ProgressWindow("my progress", tickCount=count) for i in range(count): time.sleep(.1) progress.update("action....%s" %i) progress.close()
-
cool, thanks.
-
Hmm, that can't be right.
for i in range(count): time.sleep(.1) progress.update("action....%s" %i)
You're formatting a string with an int but using the string format descriptor:
%s
Also, shouldn'tprogress.update()
take an int argument?Lastly,
from mojo.UI import CurrentFontWindow
Yields:
importError: cannot import name CurrentFontWindow
in RoboFont 1.2
-
oho, just saw this:
CurrentFontWindow is only available only in RoboFont 1.3
-
oh, I get it. You call
progress.update()
count times: that's why there's not int argument.
-
Hmm, the
help()
built-in function doesn't work in the RoboFont scripting window.from defconAppKit.windows.progressWindow import ProgressWindow print dir(ProgressWindow) help(ProgressWindow.update)
Yields:
NameError: name 'help' is not defined
-
yeah,
help
is great, didn't know it was available. This will be added in the next version.thanks
ps: a small workaround:
from defconAppKit.windows.progressWindow import ProgressWindow import pydoc ## this is actually happening in the built-in 'help' pydoc.help(ProgressWindow.update)