diff --git a/pydxcluster/pyDxCluster_v2_21.py b/pydxcluster/pyDxCluster_v2_21.py index 8907ca8..1997ff8 100644 --- a/pydxcluster/pyDxCluster_v2_21.py +++ b/pydxcluster/pyDxCluster_v2_21.py @@ -7,15 +7,26 @@ ################################################################################### from Tkinter import * import telnetlib, string, sys, os, subprocess, re +import shutil import requests import pygame from tkColorChooser import askcolor from math import pi, sin, cos, atan2, sqrt, radians, log, tan, degrees +# If $HOME/pydxcluster is not exist, create it and copy config files +cwd = os.environ['HOME']+"/.config/pydxcluster" +if not os.path.exists(cwd): + os.makedirs(cwd) +os.chdir(cwd) +if not os.path.exists("pydxcluster.cfg"): + shutil.copy2("/usr/share/pydxcluster/pydxcluster.cfg", "pydxcluster.cfg") +if not os.path.exists("default.col"): + shutil.copy2("/usr/share/pydxcluster/default.col", "default.col") + version="v2.21" pygame.mixer.init() -pygame.mixer.music.load("bell.wav") +pygame.mixer.music.load("/usr/share/pydxcluster/bell.wav") pygame.mixer.music.play() try: