예제 #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)
예제 #2
0
파일: Mailbox.py 프로젝트: Tapyr/tapyr
 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)
예제 #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)
예제 #4
0
파일: Base.py 프로젝트: JPilarr/tapyr
 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)
예제 #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)
예제 #6
0
파일: Mailbox.py 프로젝트: Tapyr/tapyr
 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)