2 |
pygtk.require('2.0') |
pygtk.require('2.0') |
3 |
import gtk |
import gtk |
4 |
import ascpy |
import ascpy |
5 |
|
import os.path |
6 |
|
|
7 |
class BlockType: |
class BlockType: |
8 |
""" |
""" |
36 |
elif t[0:min(len(t),4)]=="out:": |
elif t[0:min(len(t),4)]=="out:": |
37 |
self.outputs += [n] |
self.outputs += [n] |
38 |
|
|
39 |
|
self.iconfile = None |
40 |
|
nn = notesdb.getTypeRefinedNotesLang(self.type,ascpy.SymChar("icon")) |
41 |
|
if nn: |
42 |
|
n = nn[0].getText() |
43 |
|
if os.path.exists(n): |
44 |
|
self.iconfile = n |
45 |
|
|
46 |
def get_icon(self, width, height): |
def get_icon(self, width, height): |
47 |
return gtk.gdk.pixbuf_new_from_file_at_size("defaultblock.svg",width,height) |
f = self.iconfile |
48 |
|
if self.iconfile is None: |
49 |
|
f = "defaultblock.svg" |
50 |
|
return gtk.gdk.pixbuf_new_from_file_at_size(f,width,height) |
51 |
|
|
52 |
def __getstate__(self): |
def __getstate__(self): |
53 |
print "GET STATE ON BLOCKTYPE %s" % self.type.getName() |
print "GET STATE ON BLOCKTYPE %s" % self.type.getName() |