Skip to content

Commit

Permalink
#171 prepare command line args
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Bouquet committed May 22, 2018
1 parent cc0f7f6 commit 69abeff
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 15 deletions.
6 changes: 3 additions & 3 deletions evaluator/Social/forum_evaluator.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from config.cst import *
# from evaluator.Social.social_evaluator import ForumSocialEvaluator
from evaluator.Social.social_evaluator import ForumSocialEvaluator
from evaluator.Util.advanced_manager import AdvancedManager
# from evaluator.Util.text_analysis import TextAnalysis
# from evaluator.Util.overall_state_analysis import OverallStateAnalyser
from evaluator.Util.text_analysis import TextAnalysis
from evaluator.Util.overall_state_analysis import OverallStateAnalyser
from evaluator.Dispatchers.reddit_dispatcher import RedditDispatcher
from evaluator.Dispatchers.abstract_dispatcher import DispatcherAbstractClient

Expand Down
10 changes: 5 additions & 5 deletions start.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from config.config import load_config
from config.cst import *
from cryptobot import CryptoBot
# from cryptobot import CryptoBot
from interfaces.telegram.bot import TelegramApp
from services import WebService
from tools.commands import Commands
Expand Down Expand Up @@ -34,8 +34,7 @@ def _log_uncaught_exceptions(ex_cls, ex, tb):
action='store_true')
parser.add_argument('-t', '--telegram', help='Start telegram command handler',
action='store_true')
parser.add_argument('-p', '--packager', help='Start CryptoBot package manager',
action='store_true')
parser.add_argument('-p', '--packager', help='Start CryptoBot package manager', nargs='+')

args = parser.parse_args()

Expand All @@ -59,7 +58,8 @@ def _log_uncaught_exceptions(ex_cls, ex, tb):

WebService.enable(config, args.web)

bot = CryptoBot(config)
# bot = CryptoBot(config)
bot = None

import interfaces
interfaces.__init__(bot, config)
Expand All @@ -71,7 +71,7 @@ def _log_uncaught_exceptions(ex_cls, ex, tb):
Commands.data_collector(config)

elif args.packager:
Commands.package_manager(config, None)
Commands.package_manager(config, args.packager)

# start crypto bot options
else:
Expand Down
4 changes: 2 additions & 2 deletions tools/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ def data_collector(config, catch=False):
raise e

@staticmethod
def package_manager(config, command, catch=False):
def package_manager(config, commands, catch=False):
try:
package_manager_inst = PackageManager(config)
package_manager_inst.parse_command(command)
package_manager_inst.parse_commands(commands)
except Exception as e:
if not catch:
raise e
Expand Down
9 changes: 4 additions & 5 deletions tools/package_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ class PackageManager:
def __init__(self, config):
self.config = config

def parse_command(self, command):
if command == "install":
pass

elif command == "":
def parse_commands(self, commands):
if len(commands) > 0:
if commands[0] == "install":
pass

0 comments on commit 69abeff

Please sign in to comment.