36 |
def clean_data(args=''): |
def clean_data(args=''): |
37 |
os.system('rm '+PPDIR+'b_*') |
os.system('rm '+PPDIR+'b_*') |
38 |
os.system('rm '+PPDIR+'d*') |
os.system('rm '+PPDIR+'d*') |
39 |
os.system('rm '+PPDIR+'ps_F*') |
#os.system('rm '+PPDIR+'ps_F*') |
|
|
|
40 |
if args=='full': |
if args=='full': |
41 |
os.system('rm '+PPDIR+'ps_*') |
os.system('rm '+PPDIR+'ps_*') |
42 |
os.system('rm '+PPDIR+'pp.gz') |
os.system('rm '+PPDIR+'pp.gz') |
43 |
|
if args=='exept_ptr': |
44 |
|
os.system('rm '+PPDIR+'pp.gz') |
45 |
|
if args=='exept_pkg': |
46 |
|
os.system('rm '+PPDIR+'ps_*') |
47 |
|
#os.system('ls -la '+PPDIR) |
48 |
|
|
49 |
def return_data(): |
def return_data(): |
50 |
clean_data() |
clean_data('exept_pkg') |
51 |
os.system('tar -xzvf ' +PPDIR+ 'pp.gz -C '+PPDIR) |
os.system('tar -xzvf ' +PPDIR+ 'pp.gz -C '+PPDIR) |
52 |
|
|
53 |
|
firstTime = 0 |
54 |
|
|
55 |
class PPView2Scene: |
class PPView2Scene: |
56 |
def __init__(self): |
def __init__(self): |
57 |
w.setLocation(0,0,1024,768) |
w.setLocation(0,0,1024,768) |
58 |
return_data() |
return_data() |
59 |
|
if firstTime: |
60 |
|
clean_data('full') |
61 |
|
os.system('mv '+ PPDIR +'ps_FOO '+ PPDIR+'ps_foo') |
62 |
|
|
63 |
# Next, the mediaserver we'll save to. |
# Next, the mediaserver we'll save to. |
64 |
self.ms = gzz.mediaserver.SimpleMediaserver( |
self.ms = gzz.mediaserver.SimpleMediaserver( |
73 |
self.filer = self.filers.getFiler("foo") |
self.filer = self.filers.getFiler("foo") |
74 |
self.avc = gzz.view.AbstractViewContext() |
self.avc = gzz.view.AbstractViewContext() |
75 |
|
|
76 |
if 1: |
if not firstTime: |
77 |
#load space from disk |
#load space from disk |
78 |
self.space = gzz.impl.ModularSpace(self.filer.load(), *tools.spaceArgList()) |
self.space = gzz.impl.ModularSpace(self.filer.load(), *tools.spaceArgList()) |
79 |
self.ppactions = gzz.modules.pp.PPActionsImpl(self.space) |
self.ppactions = gzz.modules.pp.PPActionsImpl(self.space) |
111 |
self.poly = ["FILL", "LINE"] |
self.poly = ["FILL", "LINE"] |
112 |
self.map = None |
self.map = None |
113 |
self.mode = 0 |
self.mode = 0 |
|
clean_data() |
|
114 |
|
|
115 |
|
|
116 |
def key(self, key): |
def key(self, key): |
117 |
if key == "Ctrl-R": |
if key == "Ctrl-R": |
118 |
loadScenes() |
loadScenes() |
|
if key == "Alt-X": |
|
|
print 'Full save!' |
|
|
clean_data('full') |
|
|
self.key('Ctrl-X') |
|
|
|
|
119 |
if key == "Ctrl-I": |
if key == "Ctrl-I": |
120 |
print "INTERPLIST" |
print "INTERPLIST" |
121 |
self.vs.dump() |
self.vs.dump() |
122 |
print self.vs.matcher.interpList(self.vs.matcher) |
print self.vs.matcher.interpList(self.vs.matcher) |
123 |
if key == "Ctrl-X": |
if key == "Ctrl-X": |
124 |
print 'Save...' |
print 'Save...' |
125 |
return_data() |
|
126 |
|
if firstTime: |
127 |
|
clean_data('exept_ptr') |
128 |
|
#else: |
129 |
|
# clean_data('exept_ptr') |
130 |
|
|
131 |
# Now, saving the space is a one-liner: |
# Now, saving the space is a one-liner: |
132 |
self.filers.saveAll(self.ppv.space.getSlicer().exportAll()) |
self.filers.saveAll(self.ppv.space.getSlicer().exportAll()) |
133 |
os.system('mv '+ PPDIR +'ps_FOO '+ PPDIR+'ps_foo') |
#os.system('mv '+ PPDIR +'ps_FOO '+ PPDIR+'ps_foo') |
134 |
os.system('cd '+PPDIR+' && tar -czvf pp.gz b_* d*') |
os.system('cd '+PPDIR+' && tar -czvf pp.gz b_* d* ps_* pro*') |
135 |
clean_data() |
clean_data() |
136 |
|
|
137 |
# Loading |
# Loading |