Lines Matching full:path

37     def __init__(self, path, factory=None, create=True):
39 self._path = os.path.abspath(os.path.expanduser(path))
276 'tmp': os.path.join(self._path, 'tmp'),
277 'new': os.path.join(self._path, 'new'),
278 'cur': os.path.join(self._path, 'cur'),
280 if not os.path.exists(self._path):
283 for path in self._paths.values():
284 os.mkdir(path, 0o700)
310 uniq = os.path.basename(tmp_file.name).split(self.colon)[0]
311 dest = os.path.join(self._path, subdir, uniq + suffix)
314 (os.path.getatime(tmp_file.name), message.get_date()))
336 os.remove(os.path.join(self._path, self._lookup(key)))
357 subdir = os.path.dirname(dominant_subpath)
363 tmp_path = os.path.join(self._path, temp_subpath)
364 new_path = os.path.join(self._path, subdir, key + suffix)
367 (os.path.getatime(tmp_path), message.get_date()))
376 with open(os.path.join(self._path, subpath), 'rb') as f:
381 subdir, name = os.path.split(subpath)
385 msg.set_date(os.path.getmtime(os.path.join(self._path, subpath)))
390 with open(os.path.join(self._path, self._lookup(key)), 'rb') as f:
395 f = open(os.path.join(self._path, self._lookup(key)), 'rb')
441 os.path.isdir(os.path.join(self._path, entry)):
447 return Maildir(os.path.join(self._path, '.' + folder),
453 path = os.path.join(self._path, '.' + folder)
454 result = Maildir(path, factory=self._factory)
455 maildirfolder_path = os.path.join(path, 'maildirfolder')
456 if not os.path.exists(maildirfolder_path):
463 path = os.path.join(self._path, '.' + folder)
464 for entry in os.listdir(os.path.join(path, 'new')) + \
465 os.listdir(os.path.join(path, 'cur')):
468 for entry in os.listdir(path):
470 os.path.isdir(os.path.join(path, entry)):
473 for root, dirs, files in os.walk(path, topdown=False):
475 os.remove(os.path.join(root, entry))
477 os.rmdir(os.path.join(root, entry))
478 os.rmdir(path)
483 for entry in os.listdir(os.path.join(self._path, 'tmp')):
484 path = os.path.join(self._path, 'tmp', entry)
485 if now - os.path.getatime(path) > 129600: # 60 * 60 * 36
486 os.remove(path)
500 path = os.path.join(self._path, 'tmp', uniq)
502 os.stat(path)
506 return _create_carefully(path)
512 path)
518 # been modified, because os.path.mtime() has a 2 sec resolution in the
532 mtime = os.path.getmtime(self._paths[subdir])
541 path = self._paths[subdir]
542 for entry in os.listdir(path):
543 p = os.path.join(path, entry)
544 if os.path.isdir(p):
547 self._toc[uniq] = os.path.join(subdir, entry)
553 if os.path.exists(os.path.join(self._path, self._toc[key])):
580 def __init__(self, path, factory=None, create=True):
582 Mailbox.__init__(self, path, factory, create)
847 def __init__(self, path, factory=None, create=True):
850 _mboxMMDF.__init__(self, path, factory, create)
893 def __init__(self, path, factory=None, create=True):
896 _mboxMMDF.__init__(self, path, factory, create)
938 def __init__(self, path, factory=None, create=True):
940 Mailbox.__init__(self, path, factory, create)
941 if not os.path.exists(self._path):
944 os.close(os.open(os.path.join(self._path, '.mh_sequences'),
957 new_path = os.path.join(self._path, str(new_key))
986 path = os.path.join(self._path, str(key))
988 f = open(path, 'rb+')
996 os.remove(path)
1000 path = os.path.join(self._path, str(key))
1002 f = open(path, 'rb+')
1012 os.close(os.open(path, os.O_WRONLY | os.O_TRUNC))
1026 f = open(os.path.join(self._path, str(key)), 'rb+')
1028 f = open(os.path.join(self._path, str(key)), 'rb')
1051 f = open(os.path.join(self._path, str(key)), 'rb+')
1053 f = open(os.path.join(self._path, str(key)), 'rb')
1071 f = open(os.path.join(self._path, str(key)), 'rb')
1086 return os.path.exists(os.path.join(self._path, str(key)))
1095 self._file = open(os.path.join(self._path, '.mh_sequences'), 'rb+')
1120 if os.path.isdir(os.path.join(self._path, entry)):
1126 return MH(os.path.join(self._path, folder),
1131 return MH(os.path.join(self._path, folder),
1136 path = os.path.join(self._path, folder)
1137 entries = os.listdir(path)
1139 os.remove(os.path.join(path, '.mh_sequences'))
1144 os.rmdir(path)
1149 with open(os.path.join(self._path, '.mh_sequences'), 'r', encoding='ASCII') as f:
1172 f = open(os.path.join(self._path, '.mh_sequences'), 'r+', encoding='ASCII')
1208 os.link(os.path.join(self._path, str(key)),
1209 os.path.join(self._path, str(prev + 1)))
1211 os.rename(os.path.join(self._path, str(key)),
1212 os.path.join(self._path, str(prev + 1)))
1214 os.unlink(os.path.join(self._path, str(key)))
1246 def __init__(self, path, factory=None, create=True):
1248 _singlefileMailbox.__init__(self, path, factory, create)
2109 if os.path.exists(f.name + '.lock'):
2112 def _create_carefully(path):
2114 fd = os.open(path, os.O_CREAT | os.O_EXCL | os.O_RDWR, 0o666)
2116 return open(path, 'rb+')
2120 def _create_temporary(path):
2121 """Create a temp file based on path and open for reading and writing."""
2122 return _create_carefully('%s.%s.%s.%s' % (path, int(time.time()),