Skip to content

Commit

Permalink
Fix bug where config dir isn't created if it doesn't exist.
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomi Richards committed Jun 16, 2015
1 parent c9527cf commit 28337bf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions gmailfilter/_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def run():
else:
run_new_filter()


def run_old_filter():
"""Run the old, pre v1 filter agent. This will get deleted soon."""
rules_path = get_filter_file_or_raise()
Expand Down
3 changes: 3 additions & 0 deletions gmailfilter/_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,9 @@ def read_config_file(cls, path=None):
def write_template_config_file(cls, path=None):
"""Write a template config file to disk."""
path = path or default_credentials_file_location()
directory = os.path.dirname(path)
if not os.path.exists(directory):
os.makedirs(directory)
with open(path, 'w') as template_file:
template_file.write(textwrap.dedent('''
# Credentials config file.
Expand Down
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env python3

import sys

assert sys.version >= '3'
from setuptools.command.test import test as TestCommand
from setuptools import find_packages, setup

Expand Down

0 comments on commit 28337bf

Please sign in to comment.