parent
ccc9bea508
commit
7055ca0873
|
@ -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:
|
||||
|
|
13
buffer2.py
13
buffer2.py
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue