Ejemplo n.º 1
0
 def execute(self, instance):
     filename = self.evaluate_index(0)
     try:
         file = open_file(filename, 'wb')
     except IOError:
         return
     array = MMFArray()
     value = instance.objectPlayer.split()
     array.setup(len(value), 1, 1, 'Text')
     array.items[0] = {0 : dict(enumerate(value))}
     data = str(array.generate())
     file.write(data)
     file.close()
Ejemplo n.º 2
0
 def execute(self, instance):
     filename = self.evaluate_index(0)
     try:
         data = open_file(filename, 'rb').read()
     except IOError:
         return
     array = MMFArray()
     array.read(ByteReader(data))
     if array.size[1] != 1 or array.size[2] != 1 or not array.flags['Text']:
         return
     value = []
     valueDict = array.items[0][0]
     for i in xrange(len(valueDict)):
         value.append(valueDict[i])
     instance.objectPlayer.value = instance.objectPlayer.join(value)
Ejemplo n.º 3
0
 def execute(self, instance):
     filename = self.evaluate_index(0)
     try:
         data = open_file(filename, 'rb').read()
     except IOError:
         return
     array = MMFArray()
     array.read(ByteReader(data))
     if array.size[1] != 1 or array.size[2] != 1 or not array.flags['Text']:
         return
     value = []
     valueDict = array.items[0][0]
     for i in xrange(len(valueDict)):
         value.append(valueDict[i])
     instance.objectPlayer.value = instance.objectPlayer.join(value)
Ejemplo n.º 4
0
 def execute(self, instance):
     filename = self.evaluate_index(0)
     try:
         file = open_file(filename, 'wb')
     except IOError:
         return
     array = MMFArray()
     value = instance.objectPlayer.split()
     array.setup(len(value), 1, 1, 'Text')
     array.items[0] = {0: dict(enumerate(value))}
     data = str(array.generate())
     file.write(data)
     file.close()