branch : pmacs2
This commit is contained in:
moculus 2007-07-20 00:22:45 +00:00
parent ccc9bea508
commit 7055ca0873
2 changed files with 9 additions and 6 deletions

View File

@ -806,6 +806,8 @@ if __name__ == "__main__":
buffers = []
names = sets.Set()
paths = sets.Set()
if not args:
args = ['.']
for path in args:
path = os.path.abspath(os.path.realpath(util.expand_tilde(path)))
if path in paths:

View File

@ -417,7 +417,7 @@ class FileBuffer(Buffer):
self.store_checksum(data)
else:
data = ''
for i in range(0, 8):
for i in range(0, min(len(data), 8)):
if ord(data[i]) > 127:
raise Exception, "editing binary files is not supported"
data = self.read_filter(data)
@ -491,14 +491,15 @@ class DirBuffer(Buffer):
def __init__(self, path, nl='\n', name=None):
Buffer.__init__(self, nl)
self.path = os.path.realpath(path)
if name is None:
self._name = os.path.basename(self.path)
else:
self._name = name
#if name is None:
# self._name = os.path.basename(self.path)
#else:
# self._name = name
def readonly(self):
return True
def name(self):
return self._name
#return self._name
return self.path
def path_exists(self):
return os.path.exists(self.path)