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)
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)
def mutate(self,obj): return XMLP_Mutated(obj.data, "%s.%s"%(util._module(obj),util._klass(obj)))
def mutate(self,obj): print "** mystring.mutate()" return XMLP_Mutated(obj)
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)