Added xdg path stuff to initialization.
This commit is contained in:
parent
c07beea0d8
commit
dccdfc988d
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
__pycache__/
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user