Added xdg path stuff to initialization.

This commit is contained in:
Storm 2016-03-25 09:59:45 -04:00
parent c07beea0d8
commit dccdfc988d
2 changed files with 8 additions and 3 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
__pycache__/

View File

@ -6,14 +6,12 @@ import os
from os import listdir from os import listdir
from os.path import isfile, join from os.path import isfile, join
from inspect import isfunction from inspect import isfunction
from xdg import BaseDirectory
import pygame import pygame
import random import random
import speechd import speechd
import time import time
def __init__():
random.seed()
spd = speechd.Client() spd = speechd.Client()
def speak(text, interupt = True): def speak(text, interupt = True):
if interupt == True: spd.cancel() if interupt == True: spd.cancel()
@ -25,6 +23,12 @@ def exit_game():
exit() exit()
def initialize_gui(gameTitle): def initialize_gui(gameTitle):
# Check for, and possibly create, storm-games path
global HOME
HOME = BaseDirectory.xdg_config_home + "/storm-games"
if not os.path.exists(HOME): os.makedirs(HOME)
# Seed the random generator to the clock
random.seed()
# Set game's name # Set game's name
global gameName global gameName
gameName = gameTitle gameName = gameTitle