Ejemplo n.º 1
0
 def pickle(self, p):
     '''Pickle val and return the hexlified result.'''
     try:
         ua = p.v.u
         s = pickle.dumps(ua, protocol=1)
         s2 = binascii.hexlify(s)
         s3 = g.ue(s2, 'utf-8')
         return s3
     except pickle.PicklingError:
         g.warning("ignoring non-pickleable value", ua, "in", p.h)
         return ''
     except Exception:
         g.error("pd.pickle: unexpected exception in", p.h)
         g.es_exception()
         return ''
Ejemplo n.º 2
0
 def pickle(self, p):
     '''Pickle val and return the hexlified result.'''
     try:
         ua = p.v.u
         s = pickle.dumps(ua, protocol=1)
         s2 = binascii.hexlify(s)
         s3 = g.ue(s2, 'utf-8')
         return s3
     except pickle.PicklingError:
         g.warning("ignoring non-pickleable value", ua, "in", p.h)
         return ''
     except Exception:
         g.error("pd.pickle: unexpected exception in", p.h)
         g.es_exception()
         return ''
Ejemplo n.º 3
0
 def pickle(self, p):
     '''Pickle val and return the hexlified result.'''
     trace = False and g.unitTesting
     try:
         ua = p.v.u
         s = pickle.dumps(ua, protocol=1)
         s2 = binascii.hexlify(s)
         s3 = g.ue(s2, 'utf-8')
         if trace:
             g.trace('\n', type(ua), ua, '\n', type(s), repr(s), '\n',
                     type(s2), s2, '\n', type(s3), s3)
         return s3
     except pickle.PicklingError:
         g.warning("ignoring non-pickleable value", ua, "in", p.h)
         return ''
     except Exception:
         g.error("pd.pickle: unexpected exception in", p.h)
         g.es_exception()
         return ''
Ejemplo n.º 4
0
 def pickle (self,p):
     '''Pickle val and return the hexlified result.'''
     trace = False and g.unitTesting
     try:
         ua = p.v.u
         s = pickle.dumps(ua,protocol=1)
         s2 = binascii.hexlify(s)
         s3 = g.ue(s2,'utf-8')
         if trace: g.trace('\n',
             type(ua),ua,'\n',type(s),repr(s),'\n',
             type(s2),s2,'\n',type(s3),s3)
         return s3
     except pickle.PicklingError:
         g.warning("ignoring non-pickleable value",ua,"in",p.h)
         return ''
     except Exception:
         g.error("pd.pickle: unexpected exception in",p.h)
         g.es_exception()
         return ''
Ejemplo n.º 5
0
    def run(self):
        
        '''Called automatically when the thread is created.'''

        global Encoding

        if not self.File:
            return

        s=self.File.readline()
        while s:
            if s != "\n":
                self.TextLock.acquire()
                try:
                    self.Text = self.Text + g.ue(s,Encoding)
                except IOError as ioerr:
                    self.Text = self.Text +"\n"+ "[@run] ioerror :"+str(ioerr)
                self.TextLock.release()
            s=self.File.readline()
            time.sleep(0.01)
Ejemplo n.º 6
0
    def run(self):
        '''Called automatically when the thread is created.'''

        global Encoding

        if not self.File:
            return

        s = self.File.readline()
        while s:
            if s != "\n":
                self.TextLock.acquire()
                try:
                    self.Text = self.Text + g.ue(s, Encoding)
                except IOError as ioerr:
                    self.Text = self.Text + "\n" + "[@run] ioerror :" + str(
                        ioerr)
                self.TextLock.release()
            s = self.File.readline()
            time.sleep(0.01)