Skip to content

Commit

Permalink
Update abstra-lib
Browse files Browse the repository at this point in the history
  • Loading branch information
abstra-bot committed Aug 1, 2023
1 parent 5e3f7c1 commit 956591d
Show file tree
Hide file tree
Showing 101 changed files with 2,662 additions and 12 deletions.
1 change: 1 addition & 0 deletions abstra/connectors/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .legacy import * # deprecated
35 changes: 35 additions & 0 deletions abstra/connectors/legacy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import requests
from ..utils import get_headers

BASE_URL = "https://remote-actions.abstra.cloud"


class Connectors:
def __init__(self, api_key=None):
self.api_key = api_key

def method(self, id):
return Methods(id, self.api_key)

def run_method(self, id, params=None):
method = self.method(id)
return method.run(params)


class Methods:
def __init__(self, id, api_key=None):
self.id = id
self.api_key = api_key

def run(self, params=None):
if params is None:
params = {}
res = requests.post(
f"{BASE_URL}/execute/{self.id}",
json=params,
headers=get_headers(self.api_key),
)
if res.ok:
return res.json()
else:
raise Exception(res.text)
13 changes: 10 additions & 3 deletions abstra_cli/cli.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import fire, os
from abstra_server.apps import serve
import logging
import os
from pathlib import Path

import fire
from abstra_server.apps import serve

from . import messages
from .deploy import deploy
from .version import check_latest_version
from .utils.server import get_free_port
from .version import check_latest_version

PORT = os.getenv("PORT")

Expand All @@ -30,6 +34,9 @@ def serve(
default_port = int(PORT or port)
free_port = get_free_port(default_port=default_port)

log = logging.getLogger("werkzeug")
log.setLevel(logging.WARNING)

messages.serve_message(free_port)
check_latest_version()

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions abstra_statics/dist/assets/ApiKeys.a12f33b0.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions abstra_statics/dist/assets/BackButton.18c3f370.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions abstra_statics/dist/assets/BackButton.7b7aeab9.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions abstra_statics/dist/assets/Builds.780726fe.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions abstra_statics/dist/assets/CircularLoading.fd9aaeaa.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions abstra_statics/dist/assets/CrudView.42acda9a.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 956591d

Please sign in to comment.