Make modules freestanding

Remove __init__.py from tipbot/modules, allowing loading them
without having to declare them first
This commit is contained in:
moneromooo 2014-12-30 13:12:13 +00:00
parent 449ef1e594
commit 34d73d6460
2 changed files with 3 additions and 2 deletions

View File

@ -11,6 +11,7 @@
#
import sys
import os
import socket
import select
import random
@ -68,10 +69,11 @@ if not selected_coin:
log_error('Coin setup needs to be specified with -c. See --help')
exit(1)
sys.path.append(os.path.join('tipbot','modules'))
for modulename in modulenames:
log_info('Importing %s module' % modulename)
try:
__import__("tipbot.modules.%s" % modulename)
__import__(modulename)
except Exception,e:
log_error('Failed to load module "%s": %s' % (modulename, str(e)))
exit(1)

View File

@ -1 +0,0 @@
__all__ = ['tipping', 'withdraw', 'payment']