Beispiel #1
0
 def mutate(self,obj):
     s = '\n' # start on new line in XML file
     for arr in obj:
         for elem in arr:
             s += '%f ' %elem
         s += '\n'
         
     return XMLP_Mutated(s)
Beispiel #2
0
 def mutate(self,obj):
     # save as a dict --
     #  obj['YMD'] = "year/month/day"
     #  obj['HMS'] = hour/min/second 
     
     # (I avoid using strftime(), for portability reasons.)
     # Pickle seconds as a float to save full precision.
     d = {}
     d['YMD'] = "%d/%d/%d" % (obj.year,obj.month,obj.day)
     d['HMS'] = "%d:%d:%f" % (obj.hour,obj.minute,obj.second)
     return XMLP_Mutated(d)
Beispiel #3
0
 def mutate(self,obj):
     return XMLP_Mutated(obj.data,
                         "%s.%s"%(util._module(obj),util._klass(obj)))
Beispiel #4
0
 def mutate(self,obj):
     print "** mystring.mutate()"
     return XMLP_Mutated(obj)
Beispiel #5
0
 def mutate(self,obj):
     t = '%s'%obj[0]
     for i in obj[1:]:
         t = t + ',%s'%i
     return XMLP_Mutated(t)
 def mutate(self,obj):
     # a tricky self-ref
     obj.breakage = obj
     return XMLP_Mutated(obj)