Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/Jam/Picker.py
diff options
context:
space:
mode:
Diffstat (limited to 'Jam/Picker.py')
-rw-r--r--Jam/Picker.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/Jam/Picker.py b/Jam/Picker.py
index 975919c..eb3103b 100644
--- a/Jam/Picker.py
+++ b/Jam/Picker.py
@@ -4,9 +4,12 @@ pygtk.require( '2.0' )
import gtk
import random #TEMP
+import sets
import Config
+import Util.ControlStream
+
import Jam.Block as Block
class Picker( gtk.HBox ):
@@ -142,6 +145,33 @@ class Loop( Picker ):
self.addBlock( {}, "Loop" )
+ def _loadFile( self, path ):
+ try:
+ oldPages = sets.Set( self.owner.noteDB.getTune() )
+
+ ifile = open( path, 'r' )
+ ttt = ControlStream.TamTamTable ( self.owner.noteDB )
+ ttt.parseFile( ifile )
+ ifile.close()
+
+ curPages = sets.Set( self.owner.noteDB.getTune() )
+ newPages = curPages.difference( oldPages )
+
+ if len(newPages) != 1:
+ print "ERROR: bad loop file, contains more than one page (or none)"
+ return -1
+
+ return newPages.pop() # new pageId
+
+ except OSError,e:
+ print 'ERROR: failed to open file %s for reading\n' % ofilename
+
+
+
+
+ def _scanDirectory( self, path ):
+ pass
+
def button_press( self, widget, event ):
walloc = widget.get_allocation()
salloc = self.scrolledWindow.get_allocation()