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 = [] buffers = []
names = sets.Set() names = sets.Set()
paths = sets.Set() paths = sets.Set()
if not args:
args = ['.']
for path in args: for path in args:
path = os.path.abspath(os.path.realpath(util.expand_tilde(path))) path = os.path.abspath(os.path.realpath(util.expand_tilde(path)))
if path in paths: if path in paths:

View File

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