mirror of
https://github.com/progval/irctest.git
synced 2025-04-04 22:39:50 +00:00
sopel: Create ~/.sopel/ if it does not exist
This commit is contained in:
@ -39,7 +39,9 @@ class SopelController(BaseClientController):
|
||||
pass
|
||||
|
||||
def open_file(self, filename, mode="a"):
|
||||
return open(os.path.join(os.path.expanduser("~/.sopel/"), filename), mode)
|
||||
dir_path = os.path.expanduser("~/.sopel/")
|
||||
os.makedirs(dir_path, exist_ok=True)
|
||||
return open(os.path.join(dir_path, filename), mode)
|
||||
|
||||
def create_config(self):
|
||||
with self.open_file(self.filename):
|
||||
|
Reference in New Issue
Block a user