Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
self.editor_size = size
if connects:
self.connected_to = connects
self.code = None
if not code:
sub_pass = pkg_resources.resource_filename('pyno', 'examples/sub_pass.pn')
code = sub_pass # identical to '''examples/blank.pn'''
self.name = ''
self.label = pyglet.text.Label(self.name, font_name=font,
bold=True, font_size=11,
anchor_x='center', anchor_y='center',
batch=batch, group=labelsGroup,
color=(255, 255, 255, 230))
self.pwindow = None
self.input_nodes = {}
self.output_nodes = {}
self.new_code(code)
if connects:
self.connected_to = connects
self.window = window
self.code = code
self.document = pyglet.text.document.FormattedDocument(self.code)
self.document.set_style(0, len(self.document.text),
dict(font_name=font,
font_size=11,
color=(0, 0, 0, 230)))
self.layout = pyglet.text.layout.IncrementalTextLayout(
self.document,
self.w - 30, self.h - 3,
multiline=True, batch=batch,
group=labelsGroup)
self.caret = pyglet.text.caret.Caret(self.layout)
self.caret.color = (0, 0, 0)
self.caret.visible = False
self.incr = False
self.resize = False
self.inputs = ('input',)
self.outputs = ('output',)
self.insert_inouts({'inputs': self.inputs, 'outputs': self.outputs})
self.pan_scale = [[0.0, 0.0], 1]
self.screen_size = (800, 600)
self.graphics['scroll'] = None
self.graphics['corner'] = None
Processor.init_processor(self, window.global_scope) # node has a processor for calculation
self.window = window
self.editor_size = size
self.code = code
if connects:
self.connected_to = connects
self.env = {}
self.name = ''
self.label = pyglet.text.Label(self.name, font_name=font,
bold=True, font_size=11,
anchor_x='center', anchor_y='center',
batch=batch, group=labelsGroup,
color=(255, 255, 255, 230))
self.reload()