Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def create_window():
config = pyglet.gl.Config(double_buffer=True, depth_size=0,
stencil_size=0, aux_buffers=0,
samples=1)
try:
window = PynoWindow(config, filename='.auto-saved.pn')
except:
# if config is crashed run more default one
print('Runnig using default config...')
window = PynoWindow(pyglet.gl.Config(), filename='.auto-saved.pn')
return window
import pyglet
from pyno import window
# import profile
if __name__ == '__main__':
print('Loading...')
config = pyglet.gl.Config(double_buffer=True, depth_size=0,
stencil_size=0, aux_buffers=0,
samples=1)
try:
pwindow = window.PynoWindow(config, filename='.auto-saved.pn')
except:
# if config is crashed run more default one
pwindow = window.PynoWindow(pyglet.gl.Config(), filename='.auto-saved.pn')
pyglet.options['debug_gl'] = False # performance boost?
# profile.run('pyglet.app.run()', sort=1)
pyglet.app.run()
def new_code(self, code):
# New code, search for in/outputs
if self.code == code:
return
self.problem = False
self.code = code
self.name = code.strip()
self.label.text = self.name + ' →'
try:
pwin = window.PynoWindow(pyglet.gl.Config(),
caption='→ ' + self.name)
pwin.load_pyno(self.code)
if self.pwindow:
self.pwindow.close()
del self.pwindow
self.pwindow = pwin
except Exception as ex:
self.problem = ex # abusing since this resolves in most cases like "True"
self.er_label.text = repr(ex)
return
# window visibility handeled in window.py
self.pwindow.nodes_update()
inputs, outputs = [], []
import pyglet
from pyno import window
# import profile
if __name__ == '__main__':
print('Loading...')
config = pyglet.gl.Config(double_buffer=True, depth_size=0,
stencil_size=0, aux_buffers=0,
samples=1)
try:
pwindow = window.PynoWindow(config, filename='.auto-saved.pn')
except:
# if config is crashed run more default one
pwindow = window.PynoWindow(pyglet.gl.Config(), filename='.auto-saved.pn')
pyglet.options['debug_gl'] = False # performance boost?
# profile.run('pyglet.app.run()', sort=1)
pyglet.app.run()
def create_window():
config = pyglet.gl.Config(double_buffer=True, depth_size=0,
stencil_size=0, aux_buffers=0,
samples=1)
try:
window = PynoWindow(config, filename='.auto-saved.pn')
except:
# if config is crashed run more default one
print('Runnig using default config...')
window = PynoWindow(pyglet.gl.Config(), filename='.auto-saved.pn')
return window