Exemplo n.º 1
0
 def md_name (cls, message = None) :
     t = int (time.time ())
     p = sos.getpid ()
     n = cls._deliveries.setdefault (t, 0)
     h = TFL.Environment.hostname
     cls._deliveries [t] += 1
     return cls._md_name (t, p, n, h)
Exemplo n.º 2
0
 def md_name (cls, message = None) :
     t = int (time.time ())
     p = sos.getpid ()
     n = cls._deliveries.setdefault (t, 0)
     h = TFL.Environment.hostname
     cls._deliveries [t] += 1
     return cls._md_name (t, p, n, h)
Exemplo n.º 3
0
 def _new_edit_session (self, response, ttl = None) :
     dbmd = self.top.scope.db_meta_data
     user = response.user
     if user is None :
         u_hash = response.username = uuid.uuid1 ().hex
     else :
         u_hash = user.password
     return response.session.new_edit_session \
         ((u_hash, dbmd.dbv_hash, dbmd.dbid, sos.getpid ()), ttl)
Exemplo n.º 4
0
 def _new_edit_session (self, response, ttl = None) :
     dbmd = self.top.scope.db_meta_data
     user = response.user
     if user is None :
         u_hash = response.username = uuid.uuid1 ().hex
     else :
         u_hash = user.password
     return response.session.new_edit_session \
         ((u_hash, dbmd.dbv_hash, dbmd.dbid, sos.getpid ()), ttl)
Exemplo n.º 5
0
 def md_name (cls, message = None) :
     if message is None :
         return super (Maildir, cls).md_name ()
     else :
         r = cls.name_split (message.name)
         try :
             t = int (r.time)
         except (TypeError, ValueError) :
             t = int (time.time ())
         try :
             p = int (r.proc)
         except (TypeError, ValueError) :
             p = sos.getpid ()
         try :
             n = int (r.deli)
         except (TypeError, ValueError) :
             n = cls._deliveries.setdefault (t, 0)
             cls._deliveries [t] += 1
         return cls._md_name (t, p, n, r.host or TFL.Environment.hostname)
Exemplo n.º 6
0
 def md_name (cls, message = None) :
     if message is None :
         return super (Maildir, cls).md_name ()
     else :
         r = cls.name_split (message.name)
         try :
             t = int (r.time)
         except (TypeError, ValueError) :
             t = int (time.time ())
         try :
             p = int (r.proc)
         except (TypeError, ValueError) :
             p = sos.getpid ()
         try :
             n = int (r.deli)
         except (TypeError, ValueError) :
             n = cls._deliveries.setdefault (t, 0)
             cls._deliveries [t] += 1
         return cls._md_name (t, p, n, r.host or TFL.Environment.hostname)