Skip to content

Commit

Permalink
Migrate tentacle manager to external repository
Browse files Browse the repository at this point in the history
  • Loading branch information
Herklos committed Feb 7, 2019
1 parent 16b7979 commit 99f6b7e
Show file tree
Hide file tree
Showing 22 changed files with 13 additions and 1,681 deletions.
62 changes: 2 additions & 60 deletions config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,62 +233,10 @@
TENTACLES_PATH = "tentacles"
TENTACLES_EVALUATOR_PATH = "Evaluator"
TENTACLES_TRADING_PATH = "Trading"
TENTACLES_TEST_PATH = "tests"
TENTACLES_EVALUATOR_REALTIME_PATH = "RealTime"
TENTACLES_EVALUATOR_TA_PATH = "TA"
TENTACLES_EVALUATOR_SOCIAL_PATH = "Social"
TENTACLES_EVALUATOR_STRATEGIES_PATH = "Strategies"
TENTACLES_EVALUATOR_UTIL_PATH = "Util"
TENTACLES_TRADING_MODE_PATH = "Mode"
TENTACLES_PYTHON_INIT_CONTENT = "from .Default import *\nfrom .Advanced import *\n"
TENTACLES_PUBLIC_REPOSITORY = f"{GITHUB_ORGANISATION}/{PROJECT_NAME}-Tentacles"
TENTACLES_PUBLIC_LIST = "tentacles_list.json"
TENTACLES_DEFAULT_BRANCH = "master"
EVALUATOR_DEFAULT_FOLDER = "Default"
EVALUATOR_ADVANCED_FOLDER = "Advanced"
TENTACLES_INSTALL_FOLDERS = [EVALUATOR_DEFAULT_FOLDER, EVALUATOR_ADVANCED_FOLDER]
EVALUATOR_CONFIG_FOLDER = "config"
EVALUATOR_RESOURCE_FOLDER = "resources"
CONFIG_TENTACLES_KEY = "tentacles-packages"
TENTACLE_PACKAGE_DESCRIPTION = "package_description"
TENTACLE_PACKAGE_DESCRIPTION_LOCALISATION = "localisation"
TENTACLE_PACKAGE_NAME = "name"
TENTACLE_DESCRIPTION_IS_URL = "is_url"
TENTACLE_MODULE_TESTS = "tests"
TENTACLE_MODULE_DESCRIPTION = "$tentacle_description"
TENTACLE_MODULE_REQUIREMENTS = "requirements"
TENTACLE_MODULE_REQUIREMENT_WITH_VERSION = "requirement_with_version"
TENTACLE_MODULE_LIST_SEPARATOR = ","
TENTACLE_MODULE_REQUIREMENT_VERSION_SEPARATOR = "=="
TENTACLE_MODULE_NAME = "name"
TENTACLE_MODULE_TYPE = "type"
TENTACLE_MODULE_SUBTYPE = "subtype"
TENTACLE_MODULE_VERSION = "version"
TENTACLE_MODULE_DEV = "developing"
TENTACLE_PACKAGE = "package_name"
TENTACLE_MODULE_CONFIG_FILES = "config_files"
TENTACLE_MODULE_RESOURCE_FILES = "resource_files"
TENTACLE_CREATOR_PATH = "tentacle_creator"
TENTACLE_TEMPLATE_DESCRIPTION = "description"
TENTACLE_TEMPLATE_PATH = "templates"
TENTACLE_TEMPLATE_PRE_EXT = "_tentacle"
TENTACLE_CONFIG_TEMPLATE_PRE_EXT = "_config"
TENTACLE_TEMPLATE_EXT = ".template"
TENTACLE_CURRENT_MINIMUM_DEFAULT_TENTACLES_VERSION = "1.1.0"

TENTACLE_SONS = {"Social": TENTACLES_EVALUATOR_SOCIAL_PATH,
"RealTime": TENTACLES_EVALUATOR_REALTIME_PATH,
"Util": TENTACLES_EVALUATOR_UTIL_PATH,
"TA": TENTACLES_EVALUATOR_TA_PATH,
"Strategies": TENTACLES_EVALUATOR_STRATEGIES_PATH,
"Mode": TENTACLES_TRADING_MODE_PATH}

TENTACLE_PARENTS = {
"Evaluator": TENTACLES_EVALUATOR_PATH,
"Trading": TENTACLES_TRADING_PATH
}

TENTACLE_TYPES = {**TENTACLE_PARENTS, **TENTACLE_SONS}
EVALUATOR_CONFIG_FOLDER = "config"
TENTACLES_TRADING_MODE_PATH = "Mode"

# Files
CONFIG_FILE = "config.json"
Expand Down Expand Up @@ -318,12 +266,6 @@
CONFIG_DICT_TYPE = NewType('ConfigDictType', Dict[str, Any])


class TentacleManagerActions(Enum):
INSTALL = 1
UNINSTALL = 2
UPDATE = 3


class EvaluatorMatrixTypes(Enum):
TA = "TA"
SOCIAL = "SOCIAL"
Expand Down
9 changes: 4 additions & 5 deletions interfaces/web/models/tentacles.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,16 @@
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library.
from tentacles_manager.tentacle_manager import TentacleManager
from tentacles_manager.tentacle_package_manager import TentaclePackageManager
from tentacles_manager.tentacle_package_util import get_octobot_tentacle_public_repo, get_is_url, get_package_name, \
get_package_description_with_adaptation

from tools.logging.logging_util import get_logger


from config import CONFIG_TENTACLES_KEY, TENTACLE_PACKAGE_DESCRIPTION
from interfaces import get_bot
from tools.tentacle_manager.tentacle_package_manager import TentaclePackageManager
from tools.tentacle_manager.tentacle_package_util import get_is_url, get_package_name, \
get_octobot_tentacle_public_repo, get_package_description_with_adaptation
from tools.tentacle_manager.tentacle_manager import TentacleManager


logger = get_logger("TentaclesModel")

Expand Down
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Drakkar-Software requirements
OctoBot-Tentacles-Manager

# Cryptocurrency trading
python-binance
ccxt
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ def find_package_data(path):
PACKAGES = find_packages(exclude=["docs.*", "tests.*", "tentacles.*", "logs"])
PACKAGES_DATA = [find_package_data("interfaces"),
find_package_data("config"),
find_package_data("tools/tentacle_creator/templates"),
('pre_requirements.txt', ['pre_requirements.txt']),
('requirements.txt', ['requirements.txt'])]

Expand Down
2 changes: 1 addition & 1 deletion start.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
from tools.config_manager import ConfigManager
from tools.errors import ConfigError, ConfigEvaluatorError, ConfigTradingError
from tools.external_resources_manager import get_external_resource
from tools.tentacle_manager.tentacle_util import tentacles_arch_exists
from tentacles_manager.tentacle_util import tentacles_arch_exists


# Keep string '+' operator to ensure backward compatibility in this file
Expand Down
5 changes: 3 additions & 2 deletions tools/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@
from threading import Thread
from concurrent.futures import CancelledError

from tentacles_manager.tentacle_creator.tentacle_creator import TentacleCreator

from backtesting.collector.data_collector import DataCollector
from config.config import encrypt
from interfaces import get_bot
from tools.logging.logging_util import get_logger
from tools.tentacle_creator.tentacle_creator import TentacleCreator
from tools.tentacle_manager.tentacle_manager import TentacleManager
from tentacles_manager.tentacle_manager import TentacleManager


class Commands:
Expand Down
15 changes: 0 additions & 15 deletions tools/tentacle_creator/__init__.py

This file was deleted.

3 changes: 0 additions & 3 deletions tools/tentacle_creator/templates/Mode_config.template

This file was deleted.

40 changes: 0 additions & 40 deletions tools/tentacle_creator/templates/Mode_tentacle.template

This file was deleted.

21 changes: 0 additions & 21 deletions tools/tentacle_creator/templates/RealTime_tentacle.template

This file was deleted.

24 changes: 0 additions & 24 deletions tools/tentacle_creator/templates/Social_tentacle.template

This file was deleted.

4 changes: 0 additions & 4 deletions tools/tentacle_creator/templates/Strategies_config.template

This file was deleted.

20 changes: 0 additions & 20 deletions tools/tentacle_creator/templates/Strategies_tentacle.template

This file was deleted.

11 changes: 0 additions & 11 deletions tools/tentacle_creator/templates/TA_tentacle.template

This file was deleted.

6 changes: 0 additions & 6 deletions tools/tentacle_creator/templates/Util_tentacle.template

This file was deleted.

13 changes: 0 additions & 13 deletions tools/tentacle_creator/templates/description_tentacle.template

This file was deleted.

Loading

0 comments on commit 99f6b7e

Please sign in to comment.