--HG--
branch : pmacs2
This commit is contained in:
moculus 2007-07-20 14:51:36 +00:00
parent f4abeb6433
commit 03cbde8a74
1 changed files with 2 additions and 2 deletions

View File

@ -738,13 +738,13 @@ class Application(object):
self.win.addnstr(self.y-1, 0, util.pad('', l), l) self.win.addnstr(self.y-1, 0, util.pad('', l), l)
def open_aes_file(path, nl, name=None): def open_aes_file(path, nl, name=None):
if os.path.isfile(path): if os.path.isfile(path) or not os.path.exists(path):
p = getpass.getpass("Please enter the AES password: ") p = getpass.getpass("Please enter the AES password: ")
return buffer2.AesBuffer(path, p, nl, name) return buffer2.AesBuffer(path, p, nl, name)
else: else:
raise Exception, "can't open %r; unsupported file type" % path raise Exception, "can't open %r; unsupported file type" % path
def open_plain_file(path, nl, name=None): def open_plain_file(path, nl, name=None):
if os.path.isfile(path): if os.path.isfile(path) or not os.path.exists(path):
return buffer2.FileBuffer(path, nl, name) return buffer2.FileBuffer(path, nl, name)
elif os.path.isdir(path): elif os.path.isdir(path):
return buffer2.DirBuffer(path, nl, name) return buffer2.DirBuffer(path, nl, name)