Skip to content

Commit

Permalink
Release cleanups.
Browse files Browse the repository at this point in the history
  • Loading branch information
DeForce committed Oct 9, 2016
1 parent 05fe1ff commit 96bd6ca
Show file tree
Hide file tree
Showing 77 changed files with 195 additions and 385 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
*.pyc
.idea/*
/logs
/conf/levels.db*
levels.db*
/build
/dist
/libs
/conf
*.spec
*.log
26 changes: 0 additions & 26 deletions conf/blacklist.cfg

This file was deleted.

15 changes: 0 additions & 15 deletions conf/c2b.cfg

This file was deleted.

15 changes: 0 additions & 15 deletions conf/chat_modules.cfg

This file was deleted.

18 changes: 0 additions & 18 deletions conf/config.cfg

This file was deleted.

32 changes: 0 additions & 32 deletions conf/df.cfg

This file was deleted.

11 changes: 0 additions & 11 deletions conf/goodgame.cfg

This file was deleted.

10 changes: 0 additions & 10 deletions conf/levels.cfg

This file was deleted.

10 changes: 0 additions & 10 deletions conf/logger.cfg

This file was deleted.

12 changes: 0 additions & 12 deletions conf/mentions.cfg

This file was deleted.

19 changes: 0 additions & 19 deletions conf/messaging.cfg

This file was deleted.

11 changes: 0 additions & 11 deletions conf/sc2tv.cfg

This file was deleted.

13 changes: 0 additions & 13 deletions conf/twitch.cfg

This file was deleted.

17 changes: 0 additions & 17 deletions conf/webchat.cfg

This file was deleted.

File renamed without changes
File renamed without changes
Binary file added http/czt/img/levels/10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added http/czt/img/levels/11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added http/czt/img/levels/12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added http/czt/img/levels/13.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added http/czt/img/levels/14.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added http/czt/img/levels/15.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added http/czt/img/levels/16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added http/czt/img/levels/17.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added http/czt/img/levels/18.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added http/czt/img/levels/19.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added http/czt/img/levels/20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added http/czt/img/levels/21.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added http/czt/img/levels/22.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added http/czt/img/levels/23.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added http/czt/img/levels/24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added http/czt/img/levels/25.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added http/czt/img/levels/26.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added http/czt/img/levels/27.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added http/czt/img/levels/28.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added http/czt/img/levels/29.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added http/czt/img/levels/30.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added http/czt/img/levels/31.png
Binary file added http/czt/img/levels/32.png
Binary file added http/czt/img/levels/33.png
Binary file added http/czt/img/levels/34.png
Binary file added http/czt/img/levels/35.png
Binary file added http/czt/img/levels/36.png
Binary file added http/czt/img/levels/37.png
Binary file added http/czt/img/levels/38.png
Binary file added http/czt/img/levels/39.png
File renamed without changes
Binary file added http/czt/img/levels/40.png
Binary file added http/czt/img/levels/41.png
Binary file added http/czt/img/levels/42.png
Binary file added http/czt/img/levels/43.png
Binary file added http/czt/img/levels/5.png
Binary file added http/czt/img/levels/6.png
Binary file added http/czt/img/levels/7.png
Binary file added http/czt/img/levels/8.png
Binary file added http/czt/img/levels/9.png
Binary file added http/czt/img/levels/cube.png
File renamed without changes.
67 changes: 43 additions & 24 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,17 @@


if hasattr(sys, 'frozen'):
python_folder = os.path.dirname(sys.executable)
PYTHON_FOLDER = os.path.dirname(sys.executable)
else:
python_folder = os.path.dirname(os.path.abspath('__file__'))
TRANSLATION_FOLDER = os.path.join(python_folder, "translations")
CONF_FOLDER = os.path.join(python_folder, "conf")
MODULE_FOLDER = os.path.join(python_folder, "modules")
PYTHON_FOLDER = os.path.dirname(os.path.abspath('__file__'))
TRANSLATION_FOLDER = os.path.join(PYTHON_FOLDER, "translations")
CONF_FOLDER = os.path.join(PYTHON_FOLDER, "conf")
MODULE_FOLDER = os.path.join(PYTHON_FOLDER, "modules")
MAIN_CONF_FILE = os.path.join(CONF_FOLDER, "config.cfg")
HTTP_FOLDER = os.path.join(PYTHON_FOLDER, "http")
GUI_TAG = 'gui'

LOG_FOLDER = os.path.join(python_folder, "logs")
LOG_FOLDER = os.path.join(PYTHON_FOLDER, "logs")
LOG_FILE = os.path.join(LOG_FOLDER, 'chat_log.log')
LOG_FORMAT = logging.Formatter("%(asctime)s [%(name)s] [%(levelname)s] %(message)s")

Expand All @@ -46,7 +47,7 @@ def init():
gui_settings = {}

# Creating dict with folder settings
main_config = {'root_folder': python_folder,
main_config = {'root_folder': PYTHON_FOLDER,
'conf_folder': CONF_FOLDER,
'main_conf_file': MAIN_CONF_FILE,
'main_conf_file_loc': MAIN_CONF_FILE,
Expand All @@ -68,21 +69,27 @@ def init():

logger.info("Loading basic configuration")
main_config_dict = [
{'gui_information': {
'category': 'main'}},
{'language__gui': {
'for': 'language',
'view': 'choose_single',
'check_type': 'dir',
'check': 'translations'
}},
{'gui': {
'show_hidden': True,
'gui': True,
'on_top': True,
'reload': None
}},
{'language': 'english'}
{'gui_information': {
'category': 'main'}},
{'language__gui': {
'for': 'language',
'view': 'choose_single',
'check_type': 'dir',
'check': 'translations'
}},
{'gui': {
'show_hidden': True,
'gui': True,
'on_top': True,
'reload': None
}},
{'style__gui': {
'check': 'http',
'check_type': 'dir',
'for': 'style',
'view': 'choose_single'}},
{'style': 'czt'},
{'language': 'en'}
]
config = self_heal(MAIN_CONF_FILE, main_config_dict)
# Adding config for main module
Expand All @@ -97,6 +104,18 @@ def init():
gui_settings['on_top'] = config.get(GUI_TAG, 'gui')
gui_settings['language'], null_element = config.items('language')[0]
gui_settings['show_hidden'] = config.get(GUI_TAG, 'show_hidden')
# Fallback if style folder not found
fallback_style = 'czt'
if len(config.items('style')) > 0:
style, null_element = config.items('style')[0]
path = os.path.abspath(os.path.join(HTTP_FOLDER, style))
if os.path.exists(path):
gui_settings['style'] = style
else:
gui_settings['style'] = fallback_style
else:
gui_settings['style'] = fallback_style
loaded_modules['config']['http_folder'] = os.path.join(HTTP_FOLDER, gui_settings['style'])

logger.info("Loading Messaging Handler")
logger.info("Loading Queue for message handling")
Expand All @@ -105,7 +124,7 @@ def init():
queue = Queue.Queue()
# Loading module for message processing...
msg = messaging.Message(queue)
loaded_modules.update(msg.load_modules(main_config))
loaded_modules.update(msg.load_modules(main_config, loaded_modules['config']))
msg.start()

logger.info("Loading Chats")
Expand Down Expand Up @@ -142,7 +161,7 @@ def init():

tmp = imp.load_source(module, module_location)
chat_init = getattr(tmp, module)
class_module = chat_init(queue, python_folder)
class_module = chat_init(queue, PYTHON_FOLDER)
loaded_modules[module] = class_module.conf_params
loaded_modules[module]['class'] = class_module
else:
Expand Down
Loading

0 comments on commit 96bd6ca

Please sign in to comment.