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.path import isfile, join
|
||||
from inspect import isfunction
|
||||
from xdg import BaseDirectory
|
||||
import pygame
|
||||
import random
|
||||
import speechd
|
||||
import time
|
||||
|
||||
def __init__():
|
||||
random.seed()
|
||||
|
||||
spd = speechd.Client()
|
||||
def speak(text, interupt = True):
|
||||
if interupt == True: spd.cancel()
|
||||
@ -25,6 +23,12 @@ def exit_game():
|
||||
exit()
|
||||
|
||||
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
|
||||
global gameName
|
||||
gameName = gameTitle
|
||||
|
Loading…
Reference in New Issue
Block a user