velocity-python 0.0.22__tar.gz → 0.0.24__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of velocity-python might be problematic. Click here for more details.
- {velocity-python-0.0.22 → velocity-python-0.0.24}/PKG-INFO +1 -1
- {velocity-python-0.0.22 → velocity-python-0.0.24}/pyproject.toml +1 -1
- velocity-python-0.0.24/src/velocity/__init__.py +5 -0
- {velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity/aws/handlers/lambda_handler.py +4 -2
- {velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity/aws/handlers/sqs_handler.py +19 -11
- {velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity_python.egg-info/PKG-INFO +1 -1
- velocity-python-0.0.22/src/velocity/__init__.py +0 -6
- {velocity-python-0.0.22 → velocity-python-0.0.24}/LICENSE +0 -0
- {velocity-python-0.0.22 → velocity-python-0.0.24}/README.md +0 -0
- {velocity-python-0.0.22 → velocity-python-0.0.24}/setup.cfg +0 -0
- {velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity/aws/__init__.py +0 -0
- {velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity/aws/handlers/__init__.py +0 -0
- {velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity/aws/handlers/context.py +0 -0
- {velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity/aws/handlers/response.py +0 -0
- {velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity/db/__init__.py +0 -0
- {velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity/db/core/__init__.py +0 -0
- {velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity/db/core/column.py +0 -0
- {velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity/db/core/database.py +0 -0
- {velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity/db/core/decorators.py +0 -0
- {velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity/db/core/engine.py +0 -0
- {velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity/db/core/exceptions.py +0 -0
- {velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity/db/core/result.py +0 -0
- {velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity/db/core/row.py +0 -0
- {velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity/db/core/sequence.py +0 -0
- {velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity/db/core/table.py +0 -0
- {velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity/db/core/transaction.py +0 -0
- {velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity/db/servers/__init__.py +0 -0
- {velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity/db/servers/mysql.py +0 -0
- {velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity/db/servers/postgres.py +0 -0
- {velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity/db/servers/sql.py +0 -0
- {velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity/db/servers/sqlite.py +0 -0
- {velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity/db/servers/sqlserver.py +0 -0
- {velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity/misc/__init__.py +0 -0
- {velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity/misc/conv/__init__.py +0 -0
- {velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity/misc/conv/iconv.py +0 -0
- {velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity/misc/conv/oconv.py +0 -0
- {velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity/misc/db.py +0 -0
- {velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity/misc/export.py +0 -0
- {velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity/misc/format.py +0 -0
- {velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity/misc/mail.py +0 -0
- {velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity/misc/merge.py +0 -0
- {velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity/misc/timer.py +0 -0
- {velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity_python.egg-info/SOURCES.txt +0 -0
- {velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity_python.egg-info/dependency_links.txt +0 -0
- {velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity_python.egg-info/requires.txt +0 -0
- {velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity_python.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: velocity-python
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.24
|
|
4
4
|
Summary: A rapid application development library for interfacing with data storage
|
|
5
5
|
Author-email: Paul Perez <pperez@codeclubs.org>
|
|
6
6
|
Project-URL: Homepage, https://codeclubs.org/projects/velocity
|
{velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity/aws/handlers/lambda_handler.py
RENAMED
|
@@ -12,7 +12,7 @@ from . import context
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
class LambdaHandler:
|
|
15
|
-
def __init__(self, aws_event, aws_context):
|
|
15
|
+
def __init__(self, aws_event, aws_context, context_class=context.Context):
|
|
16
16
|
self.aws_event = aws_event
|
|
17
17
|
self.aws_context = aws_context
|
|
18
18
|
self.serve_action_default = True # Set to False to disable OnActionDefault
|
|
@@ -48,6 +48,8 @@ class LambdaHandler:
|
|
|
48
48
|
else:
|
|
49
49
|
self.session["device_type"] = "unknown"
|
|
50
50
|
|
|
51
|
+
self.ContextClass = context_class
|
|
52
|
+
|
|
51
53
|
def log(self, tx, message, function=None):
|
|
52
54
|
if not function:
|
|
53
55
|
function = "<Unknown>"
|
|
@@ -95,7 +97,7 @@ class LambdaHandler:
|
|
|
95
97
|
postdata = {"raw_body": body}
|
|
96
98
|
|
|
97
99
|
req_params = self.aws_event.get("queryStringParameters") or {}
|
|
98
|
-
local_context =
|
|
100
|
+
local_context = self.ContextClass(
|
|
99
101
|
aws_event=self.aws_event,
|
|
100
102
|
aws_context=self.aws_context,
|
|
101
103
|
args=req_params,
|
|
@@ -3,15 +3,17 @@ import json
|
|
|
3
3
|
import sys
|
|
4
4
|
import os
|
|
5
5
|
import traceback
|
|
6
|
-
from
|
|
6
|
+
from velocity.aws import DEBUG
|
|
7
|
+
from velocity.aws.handlers import context
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
class SqsHandler:
|
|
10
|
-
def __init__(self, aws_event, aws_context):
|
|
11
|
+
def __init__(self, aws_event, aws_context, context_class=context.Context):
|
|
11
12
|
self.aws_event = aws_event
|
|
12
13
|
self.aws_context = aws_context
|
|
13
14
|
self.serve_action_default = True
|
|
14
15
|
self.skip_action = False
|
|
16
|
+
self.ContextClass = context_class
|
|
15
17
|
|
|
16
18
|
def log(self, tx, message, function=None):
|
|
17
19
|
if not function:
|
|
@@ -47,10 +49,17 @@ class SqsHandler:
|
|
|
47
49
|
postdata = {}
|
|
48
50
|
if record.get("body"):
|
|
49
51
|
postdata = json.loads(record.get("body"))
|
|
52
|
+
|
|
53
|
+
local_context = self.ContextClass(
|
|
54
|
+
aws_event=self.aws_event,
|
|
55
|
+
aws_context=self.aws_context,
|
|
56
|
+
args=attrs,
|
|
57
|
+
postdata=postdata,
|
|
58
|
+
)
|
|
50
59
|
if hasattr(self, "beforeAction"):
|
|
51
|
-
self.beforeAction(
|
|
60
|
+
self.beforeAction(local_context)
|
|
52
61
|
actions = []
|
|
53
|
-
action =
|
|
62
|
+
action = local_context.action()
|
|
54
63
|
if action:
|
|
55
64
|
actions.append(
|
|
56
65
|
f"on action {action.replace('-', ' ').replace('_', ' ')}".title().replace(
|
|
@@ -63,24 +72,23 @@ class SqsHandler:
|
|
|
63
72
|
if self.skip_action:
|
|
64
73
|
return
|
|
65
74
|
if hasattr(self, action):
|
|
66
|
-
getattr(self, action)(
|
|
75
|
+
getattr(self, action)(local_context)
|
|
67
76
|
break
|
|
68
77
|
if hasattr(self, "afterAction"):
|
|
69
|
-
self.afterAction(
|
|
78
|
+
self.afterAction(local_context)
|
|
70
79
|
except Exception as e:
|
|
71
80
|
if hasattr(self, "onError"):
|
|
72
81
|
self.onError(
|
|
73
|
-
|
|
74
|
-
postdata=postdata,
|
|
82
|
+
local_context,
|
|
75
83
|
exc=e.__class__.__name__,
|
|
76
84
|
tb=traceback.format_exc(),
|
|
77
85
|
)
|
|
78
86
|
|
|
79
|
-
def OnActionDefault(self, tx,
|
|
87
|
+
def OnActionDefault(self, tx, context):
|
|
80
88
|
print(
|
|
81
89
|
f"""
|
|
82
90
|
[Warn] Action handler not found. Calling default action `SqsHandler.OnActionDefault` with the following parameters for attrs, and postdata:
|
|
83
|
-
attrs: {str(
|
|
84
|
-
postdata: {str(postdata)}
|
|
91
|
+
attrs: {str(context.args())}
|
|
92
|
+
postdata: {str(context.postdata())}
|
|
85
93
|
"""
|
|
86
94
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: velocity-python
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.24
|
|
4
4
|
Summary: A rapid application development library for interfacing with data storage
|
|
5
5
|
Author-email: Paul Perez <pperez@codeclubs.org>
|
|
6
6
|
Project-URL: Homepage, https://codeclubs.org/projects/velocity
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity_python.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
{velocity-python-0.0.22 → velocity-python-0.0.24}/src/velocity_python.egg-info/top_level.txt
RENAMED
|
File without changes
|