Esempio n. 1
0
 def load_entry(self, line):
     line = line.strip()
     # path
     pos = line.find(':')
     if pos == -1:
         raise IOError("Invalid xdfmeta file! (no colon in line)")
     path = line[:pos].decode("UTF-8")
     # prot
     line = line[pos + 1:]
     pos = line.find(',')
     if pos == -1:
         raise IOError("Invalid xdfmeta file! (no first comma)")
     prot_str = line[:pos]
     prot = ProtectFlags()
     prot.parse(prot_str)
     # time
     line = line[pos + 1:]
     pos = line.find(',')
     if pos == -1:
         raise IOError("Invalid xdfmeta file! (no second comma)")
     time_str = line[:pos]
     time = TimeStamp()
     time.parse(time_str)
     # comment
     comment = FSString(line[pos + 1:].decode("UTF-8"))
     # meta info
     mi = MetaInfo(protect_flags=prot, mod_ts=time, comment=comment)
     self.set_meta_info(path, mi)
Esempio n. 2
0
 def load_entry(self, line):
   line = line.strip()
   # path
   pos = line.find(':')
   if pos == -1:
     raise IOError("Invalid xdfmeta file! (no colon in line)")
   path = line[:pos]
   # prot
   line = line[pos+1:]
   pos = line.find(',')
   if pos == -1:
     raise IOError("Invalid xdfmeta file! (no first comma)")
   prot_str = line[:pos]
   prot = ProtectFlags()
   prot.parse(prot_str)
   # time
   line = line[pos+1:]
   pos = line.find(',')
   if pos == -1:
     raise IOError("Invalid xdfmeta file! (no second comma)")
   time_str = line[:pos]
   time = TimeStamp()
   time.parse(time_str)
   # comment
   comment = line[pos+1:]
   # meta info
   mi = MetaInfo(protect_flags=prot, mod_ts=time, comment=comment)
   self.set_meta_info(path, mi)
Esempio n. 3
0
 def change_protect_by_string(self, pr_str):
     p = ProtectFlags()
     p.parse(pr_str)
     self.change_protect(p.mask)
Esempio n. 4
0
 def change_protect_by_string(self, pr_str):
   p = ProtectFlags()
   p.parse(pr_str)
   self.change_protect(p.mask)