finally managed to compile aws functions + talib
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
import os
|
||||
import ctypes
|
||||
|
||||
for d, dirs, files in os.walk('lib'):
|
||||
for f in files:
|
||||
if f.endswith('.a'):
|
||||
continue
|
||||
ctypes.cdll.LoadLibrary(os.path.join(d, f))
|
||||
|
||||
#for d, dirs, files in os.walk('lib'):
|
||||
# for f in files:
|
||||
# if f.endswith('.a') or f.endswith('.la'):
|
||||
# continue
|
||||
# print("loading: {}".format(f))
|
||||
# ctypes.cdll.LoadLibrary(os.path.join(d, f))
|
||||
#
|
||||
|
||||
|
||||
|
||||
@@ -17,6 +18,11 @@ from jsonschema import validate
|
||||
from freqtrade.aws.schemas import __SUBMIT_STRATEGY_SCHEMA__
|
||||
from base64 import urlsafe_b64decode
|
||||
|
||||
__HTTP_HEADERS__ = {
|
||||
'Access-Control-Allow-Origin' : '*',
|
||||
'Access-Control-Allow-Credentials' : True
|
||||
}
|
||||
|
||||
def names(event, context):
|
||||
"""
|
||||
returns the names of all registered strategies, but public and private
|
||||
@@ -58,14 +64,27 @@ def submit(event, context):
|
||||
# get data
|
||||
data = json.loads(event['body'])
|
||||
|
||||
print("received data")
|
||||
print(data)
|
||||
|
||||
# validate against schema
|
||||
validate(data, __SUBMIT_STRATEGY_SCHEMA__)
|
||||
result = validate(data, __SUBMIT_STRATEGY_SCHEMA__)
|
||||
|
||||
print("data are validated");
|
||||
print(result)
|
||||
|
||||
strategy = urlsafe_b64decode(data['content']).decode('utf-8')
|
||||
|
||||
print("loaded strategy")
|
||||
print(strategy)
|
||||
# try to load the strategy
|
||||
StrategyResolver().compile(data['name'], strategy)
|
||||
|
||||
print("compiled strategy")
|
||||
# save to DB
|
||||
|
||||
pass
|
||||
return {
|
||||
"statusCode": 200,
|
||||
"headers": __HTTP_HEADERS__,
|
||||
"body": json.dumps({"success":True})
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@ class TestStrategy(IStrategy):
|
||||
"public": False
|
||||
}
|
||||
|
||||
print(json.dumps(request))
|
||||
|
||||
submit({
|
||||
"body": json.dumps(request)
|
||||
|
||||
Reference in New Issue
Block a user