Make it possible to specify a mode for opening Sopel files.

This commit is contained in:
Valentin Lorentz 2015-12-19 19:03:31 +01:00
parent 83eaa42bb5
commit aa6ab3a77d

View File

@ -32,9 +32,9 @@ class SopelController(BaseClientController):
except OSError: # File does not exist
pass
def open_file(self, filename):
def open_file(self, filename, mode='a'):
return open(os.path.join(os.path.expanduser('~/.sopel/'), filename),
'a')
mode)
def create_config(self):
self.directory = tempfile.TemporaryDirectory()