Is there any update on this. I'm trying to make a sub class of
BaseWindowController to run a method if the window is already open. Still
I'm using a browser inside RF for testing fonts inside the app without any need to launch another program. So far the idea is working very well. But for some reason I need to launch a http server inside the RF which seems to be impossible. Running a simple http server outside RF is very simple. I just need to run this in shell:
> cd cwd > python -m SimpleHTTPServer 8080
I've realized that every python command should be terminated in the Robofont and if the command is still running the app halts and launching the
HTTPServer makes the app hang. If it was possible to run the server on another thread it would be great too but when the server is launched on another thread with the following method the server terminates after the interpreter reaches the last line.
import threading import SimpleHTTPServer import SocketServer class RunHttpdServer(): ''' Runs a httpd server on another thread so you can do other things while the server is running. ''' def __init__(self): self.Handler = SimpleHTTPServer.SimpleHTTPRequestHandler self.port = 8000 self.address = '' while True: try: self.httpd = SocketServer.TCPServer(('', self.port), self.Handler) self.address = 'http://localhost:%s/' % self.port print 'Serving on address:\n%s' % self.address self.thread = threading.Thread(target=self.httpd.serve_forever) self.thread.daemon = True self.thread.start() except SocketServer.socket.error as exc: if exc.args != 48: raise print 'Port', self.port, 'already in use' self.port += 1 else: break def stop(self): self.httpd.shutdown() print 'Server terminated on the address:\n%s' % self.address r = RunHttpdServer()
I can use the
time.sleep(10) to make the server alive but it will also make the app hang. Do you think is there anyway to launch the server within RF and making it run forever (or a limited time) without making the RF hang? For example like launching another process in the background.
Thanks in advance
I don't know if this sounds odd or it has been covered before but I want to make some interface modes for the certain production pipeline I have. Right now to switch to a certain view mode I need to toggle some display options in the glyph editor by using couple of shortcuts on Keyboard. I was wondering is there a method to toggle these options on and off inside the API so I could make a script that toggles couple of them only using one shortcut attached to the script?
Thanks in advance
I've written a script which is for archiving and every time I hit cmd+S out of habit I want that script to run and make a duplicate of my file in another folder. The only thing I don't know is how to map the script to the save shortcut. Is there anyway to make this work?
Looks like your connection to RoboFont ● Forum was lost, please wait while we try to reconnect.