Make sure ~/.ascii.io dir exists

This commit is contained in:
Marcin Kulik
2012-03-11 12:23:24 +01:00
parent 4d80b749ed
commit adaf4cf768

View File

@@ -21,10 +21,10 @@ import ConfigParser
import uuid
SCRIPT_NAME = os.path.basename(sys.argv[0])
BASE_DIR = os.path.expanduser("~/.ascii.io")
class AsciiCast(object):
BASE_DIR = os.path.expanduser("~/.ascii.io")
QUEUE_DIR = BASE_DIR + "/queue"
def __init__(self, api_url, user_token, command, title, record_input):
@@ -392,6 +392,9 @@ def main():
except ConfigParser.NoOptionError:
api_url = 'http://ascii.io'
if not os.path.isdir(BASE_DIR):
os.mkdir(BASE_DIR)
with open(cfg_file, 'wb') as configfile:
config.write(configfile)