appier 1.31.4__tar.gz → 1.32.0__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.
Files changed (95) hide show
  1. {appier-1.31.4/src/appier.egg-info → appier-1.32.0}/PKG-INFO +6 -1
  2. {appier-1.31.4 → appier-1.32.0}/setup.py +33 -37
  3. appier-1.32.0/src/appier/__init__.py +442 -0
  4. {appier-1.31.4 → appier-1.32.0}/src/appier/amqp.py +29 -30
  5. {appier-1.31.4 → appier-1.32.0}/src/appier/api.py +214 -212
  6. {appier-1.31.4 → appier-1.32.0}/src/appier/asgi.py +54 -55
  7. {appier-1.31.4 → appier-1.32.0}/src/appier/async_neo.py +46 -35
  8. {appier-1.31.4 → appier-1.32.0}/src/appier/async_old.py +55 -42
  9. {appier-1.31.4 → appier-1.32.0}/src/appier/asynchronous.py +7 -13
  10. {appier-1.31.4 → appier-1.32.0}/src/appier/base.py +1762 -1429
  11. {appier-1.31.4 → appier-1.32.0}/src/appier/bus.py +51 -52
  12. {appier-1.31.4 → appier-1.32.0}/src/appier/cache.py +99 -84
  13. {appier-1.31.4 → appier-1.32.0}/src/appier/common.py +9 -11
  14. {appier-1.31.4 → appier-1.32.0}/src/appier/component.py +17 -19
  15. {appier-1.31.4 → appier-1.32.0}/src/appier/compress.py +25 -28
  16. {appier-1.31.4 → appier-1.32.0}/src/appier/config.py +96 -73
  17. {appier-1.31.4 → appier-1.32.0}/src/appier/controller.py +9 -15
  18. {appier-1.31.4 → appier-1.32.0}/src/appier/crypt.py +25 -21
  19. {appier-1.31.4 → appier-1.32.0}/src/appier/data.py +73 -57
  20. appier-1.32.0/src/appier/defines.py +290 -0
  21. {appier-1.31.4 → appier-1.32.0}/src/appier/exceptions.py +103 -63
  22. {appier-1.31.4 → appier-1.32.0}/src/appier/execution.py +94 -88
  23. {appier-1.31.4 → appier-1.32.0}/src/appier/export.py +90 -88
  24. appier-1.31.4/src/appier/test/__init__.py → appier-1.32.0/src/appier/extra.py +9 -10
  25. {appier-1.31.4 → appier-1.32.0}/src/appier/extra_neo.py +8 -11
  26. {appier-1.31.4 → appier-1.32.0}/src/appier/extra_old.py +18 -16
  27. {appier-1.31.4 → appier-1.32.0}/src/appier/geo.py +57 -47
  28. {appier-1.31.4 → appier-1.32.0}/src/appier/git.py +101 -90
  29. {appier-1.31.4 → appier-1.32.0}/src/appier/graph.py +23 -24
  30. {appier-1.31.4 → appier-1.32.0}/src/appier/http.py +520 -398
  31. appier-1.32.0/src/appier/legacy.py +634 -0
  32. {appier-1.31.4 → appier-1.32.0}/src/appier/log.py +90 -97
  33. {appier-1.31.4 → appier-1.32.0}/src/appier/meta.py +42 -42
  34. {appier-1.31.4 → appier-1.32.0}/src/appier/mock.py +32 -34
  35. {appier-1.31.4 → appier-1.32.0}/src/appier/model.py +793 -681
  36. {appier-1.31.4 → appier-1.32.0}/src/appier/model_a.py +208 -183
  37. {appier-1.31.4 → appier-1.32.0}/src/appier/mongo.py +183 -107
  38. {appier-1.31.4 → appier-1.32.0}/src/appier/observer.py +39 -31
  39. {appier-1.31.4 → appier-1.32.0}/src/appier/part.py +23 -24
  40. {appier-1.31.4 → appier-1.32.0}/src/appier/preferences.py +44 -47
  41. {appier-1.31.4 → appier-1.32.0}/src/appier/queuing.py +78 -96
  42. {appier-1.31.4 → appier-1.32.0}/src/appier/redisdb.py +40 -35
  43. {appier-1.31.4 → appier-1.32.0}/src/appier/request.py +227 -175
  44. {appier-1.31.4 → appier-1.32.0}/src/appier/scheduler.py +13 -18
  45. {appier-1.31.4 → appier-1.32.0}/src/appier/serialize.py +37 -31
  46. {appier-1.31.4 → appier-1.32.0}/src/appier/session.py +161 -147
  47. {appier-1.31.4 → appier-1.32.0}/src/appier/settings.py +2 -11
  48. {appier-1.31.4 → appier-1.32.0}/src/appier/smtp.py +53 -49
  49. {appier-1.31.4 → appier-1.32.0}/src/appier/storage.py +39 -33
  50. {appier-1.31.4 → appier-1.32.0}/src/appier/structures.py +50 -45
  51. appier-1.31.4/src/appier/extra.py → appier-1.32.0/src/appier/test/__init__.py +2 -17
  52. {appier-1.31.4 → appier-1.32.0}/src/appier/test/base.py +111 -108
  53. {appier-1.31.4 → appier-1.32.0}/src/appier/test/cache.py +28 -35
  54. {appier-1.31.4 → appier-1.32.0}/src/appier/test/config.py +10 -19
  55. {appier-1.31.4 → appier-1.32.0}/src/appier/test/crypt.py +3 -12
  56. {appier-1.31.4 → appier-1.32.0}/src/appier/test/data.py +3 -12
  57. {appier-1.31.4 → appier-1.32.0}/src/appier/test/exceptions.py +8 -17
  58. {appier-1.31.4 → appier-1.32.0}/src/appier/test/export.py +16 -33
  59. {appier-1.31.4 → appier-1.32.0}/src/appier/test/graph.py +27 -60
  60. {appier-1.31.4 → appier-1.32.0}/src/appier/test/http.py +42 -54
  61. {appier-1.31.4 → appier-1.32.0}/src/appier/test/legacy.py +20 -30
  62. {appier-1.31.4 → appier-1.32.0}/src/appier/test/log.py +14 -35
  63. appier-1.32.0/src/appier/test/mock.py +107 -0
  64. {appier-1.31.4 → appier-1.32.0}/src/appier/test/model.py +79 -91
  65. {appier-1.31.4 → appier-1.32.0}/src/appier/test/part.py +5 -14
  66. {appier-1.31.4 → appier-1.32.0}/src/appier/test/preferences.py +5 -13
  67. {appier-1.31.4 → appier-1.32.0}/src/appier/test/queuing.py +29 -37
  68. {appier-1.31.4 → appier-1.32.0}/src/appier/test/request.py +61 -73
  69. {appier-1.31.4 → appier-1.32.0}/src/appier/test/serialize.py +12 -23
  70. {appier-1.31.4 → appier-1.32.0}/src/appier/test/session.py +10 -19
  71. {appier-1.31.4 → appier-1.32.0}/src/appier/test/smtp.py +8 -14
  72. {appier-1.31.4 → appier-1.32.0}/src/appier/test/structures.py +20 -24
  73. {appier-1.31.4 → appier-1.32.0}/src/appier/test/typesf.py +14 -28
  74. {appier-1.31.4 → appier-1.32.0}/src/appier/test/util.py +480 -438
  75. {appier-1.31.4 → appier-1.32.0}/src/appier/typesf.py +251 -171
  76. {appier-1.31.4 → appier-1.32.0}/src/appier/util.py +578 -407
  77. {appier-1.31.4 → appier-1.32.0}/src/appier/validation.py +280 -143
  78. {appier-1.31.4 → appier-1.32.0/src/appier.egg-info}/PKG-INFO +6 -1
  79. appier-1.31.4/src/appier/__init__.py +0 -161
  80. appier-1.31.4/src/appier/defines.py +0 -325
  81. appier-1.31.4/src/appier/legacy.py +0 -441
  82. appier-1.31.4/src/appier/test/mock.py +0 -203
  83. {appier-1.31.4 → appier-1.32.0}/MANIFEST.in +0 -0
  84. {appier-1.31.4 → appier-1.32.0}/README.rst +0 -0
  85. {appier-1.31.4 → appier-1.32.0}/setup.cfg +0 -0
  86. {appier-1.31.4 → appier-1.32.0}/src/appier/res/static/css/base.css +0 -0
  87. {appier-1.31.4 → appier-1.32.0}/src/appier/res/static/images/favicon.ico +0 -0
  88. {appier-1.31.4 → appier-1.32.0}/src/appier/res/static/js/base.js +0 -0
  89. {appier-1.31.4 → appier-1.32.0}/src/appier/res/templates/error.html.tpl +0 -0
  90. {appier-1.31.4 → appier-1.32.0}/src/appier/res/templates/holder.html.tpl +0 -0
  91. {appier-1.31.4 → appier-1.32.0}/src/appier/res/templates/layout.html.tpl +0 -0
  92. {appier-1.31.4 → appier-1.32.0}/src/appier.egg-info/SOURCES.txt +0 -0
  93. {appier-1.31.4 → appier-1.32.0}/src/appier.egg-info/dependency_links.txt +0 -0
  94. {appier-1.31.4 → appier-1.32.0}/src/appier.egg-info/not-zip-safe +0 -0
  95. {appier-1.31.4 → appier-1.32.0}/src/appier.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.1
2
2
  Name: appier
3
- Version: 1.31.4
3
+ Version: 1.32.0
4
4
  Summary: Appier Framework
5
5
  Home-page: http://appier.hive.pt
6
6
  Author: Hive Solutions Lda.
@@ -57,3 +57,8 @@ Classifier: Programming Language :: Python :: 3.4
57
57
  Classifier: Programming Language :: Python :: 3.5
58
58
  Classifier: Programming Language :: Python :: 3.6
59
59
  Classifier: Programming Language :: Python :: 3.7
60
+ Classifier: Programming Language :: Python :: 3.8
61
+ Classifier: Programming Language :: Python :: 3.9
62
+ Classifier: Programming Language :: Python :: 3.10
63
+ Classifier: Programming Language :: Python :: 3.11
64
+ Classifier: Programming Language :: Python :: 3.12
@@ -2,7 +2,7 @@
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
4
  # Hive Appier Framework
5
- # Copyright (c) 2008-2022 Hive Solutions Lda.
5
+ # Copyright (c) 2008-2024 Hive Solutions Lda.
6
6
  #
7
7
  # This file is part of Hive Appier Framework.
8
8
  #
@@ -22,16 +22,7 @@
22
22
  __author__ = "João Magalhães <joamag@hive.pt>"
23
23
  """ The author(s) of the module """
24
24
 
25
- __version__ = "1.0.0"
26
- """ The version of the module """
27
-
28
- __revision__ = "$LastChangedRevision$"
29
- """ The revision number of the module """
30
-
31
- __date__ = "$LastChangedDate$"
32
- """ The last change date of the module """
33
-
34
- __copyright__ = "Copyright (c) 2008-2022 Hive Solutions Lda."
25
+ __copyright__ = "Copyright (c) 2008-2024 Hive Solutions Lda."
35
26
  """ The copyright for the module """
36
27
 
37
28
  __license__ = "Apache License, Version 2.0"
@@ -40,39 +31,39 @@ __license__ = "Apache License, Version 2.0"
40
31
  import os
41
32
  import setuptools
42
33
 
34
+
43
35
  def read_file(path):
44
- if not os.path.exists(path): return None
36
+ if not os.path.exists(path):
37
+ return None
45
38
  file = open(path, "r")
46
- try: return file.read()
47
- finally: file.close()
39
+ try:
40
+ return file.read()
41
+ finally:
42
+ file.close()
43
+
48
44
 
49
45
  setuptools.setup(
50
- name = "appier",
51
- version = "1.31.4",
52
- author = "Hive Solutions Lda.",
53
- author_email = "development@hive.pt",
54
- description = "Appier Framework",
55
- license = "Apache License, Version 2.0",
56
- keywords = "appier framework web json wsgi",
57
- url = "http://appier.hive.pt",
58
- zip_safe = False,
59
- packages = [
60
- "appier",
61
- "appier.test"
62
- ],
63
- test_suite = "appier.test",
64
- package_dir = {
65
- "" : os.path.normpath("src")
66
- },
67
- package_data = {
68
- "appier" : [
46
+ name="appier",
47
+ version="1.32.0",
48
+ author="Hive Solutions Lda.",
49
+ author_email="development@hive.pt",
50
+ description="Appier Framework",
51
+ license="Apache License, Version 2.0",
52
+ keywords="appier framework web json wsgi",
53
+ url="http://appier.hive.pt",
54
+ zip_safe=False,
55
+ packages=["appier", "appier.test"],
56
+ test_suite="appier.test",
57
+ package_dir={"": os.path.normpath("src")},
58
+ package_data={
59
+ "appier": [
69
60
  "res/static/css/*",
70
61
  "res/static/images/*",
71
62
  "res/static/js/*",
72
- "res/templates/*"
63
+ "res/templates/*",
73
64
  ]
74
65
  },
75
- classifiers = [
66
+ classifiers=[
76
67
  "Development Status :: 5 - Production/Stable",
77
68
  "Topic :: Utilities",
78
69
  "License :: OSI Approved :: Apache Software License",
@@ -87,7 +78,12 @@ setuptools.setup(
87
78
  "Programming Language :: Python :: 3.4",
88
79
  "Programming Language :: Python :: 3.5",
89
80
  "Programming Language :: Python :: 3.6",
90
- "Programming Language :: Python :: 3.7"
81
+ "Programming Language :: Python :: 3.7",
82
+ "Programming Language :: Python :: 3.8",
83
+ "Programming Language :: Python :: 3.9",
84
+ "Programming Language :: Python :: 3.10",
85
+ "Programming Language :: Python :: 3.11",
86
+ "Programming Language :: Python :: 3.12",
91
87
  ],
92
- long_description = read_file("README.rst")
88
+ long_description=read_file("README.rst"),
93
89
  )
@@ -0,0 +1,442 @@
1
+ #!/usr/bin/python
2
+ # -*- coding: utf-8 -*-
3
+
4
+ # Hive Appier Framework
5
+ # Copyright (c) 2008-2024 Hive Solutions Lda.
6
+ #
7
+ # This file is part of Hive Appier Framework.
8
+ #
9
+ # Hive Appier Framework is free software: you can redistribute it and/or modify
10
+ # it under the terms of the Apache License as published by the Apache
11
+ # Foundation, either version 2.0 of the License, or (at your option) any
12
+ # later version.
13
+ #
14
+ # Hive Appier Framework is distributed in the hope that it will be useful,
15
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ # Apache License for more details.
18
+ #
19
+ # You should have received a copy of the Apache License along with
20
+ # Hive Appier Framework. If not, see <http://www.apache.org/licenses/>.
21
+
22
+ __copyright__ = "Copyright (c) 2008-2024 Hive Solutions Lda."
23
+ """ The copyright for the module """
24
+
25
+ __license__ = "Apache License, Version 2.0"
26
+ """ The license for the module """
27
+
28
+ from . import amqp
29
+ from . import api
30
+ from . import asynchronous
31
+ from . import base
32
+ from . import bus
33
+ from . import cache
34
+ from . import component
35
+ from . import compress
36
+ from . import config
37
+ from . import controller
38
+ from . import crypt
39
+ from . import data
40
+ from . import defines
41
+ from . import exceptions
42
+ from . import execution
43
+ from . import export
44
+ from . import extra
45
+ from . import geo
46
+ from . import git
47
+ from . import graph
48
+ from . import http
49
+ from . import legacy
50
+ from . import log
51
+ from . import meta
52
+ from . import mock
53
+ from . import model
54
+ from . import mongo
55
+ from . import observer
56
+ from . import part
57
+ from . import preferences
58
+ from . import queuing
59
+ from . import redisdb
60
+ from . import request
61
+ from . import scheduler
62
+ from . import serialize
63
+ from . import session
64
+ from . import settings
65
+ from . import smtp
66
+ from . import storage
67
+ from . import structures
68
+ from . import typesf
69
+ from . import util
70
+ from . import validation
71
+
72
+ from .amqp import AMQP
73
+ from .api import API, OAuthAPI, OAuth1API, OAuth2API
74
+ from .asynchronous import (
75
+ ASYNC_HEADER,
76
+ AsyncManager,
77
+ SimpleManager,
78
+ QueueManager,
79
+ AwaitWrapper,
80
+ CoroutineWrapper,
81
+ AyncgenWrapper,
82
+ await_wrap,
83
+ await_yield,
84
+ ensure_generator,
85
+ is_coroutine,
86
+ is_coroutine_object,
87
+ is_coroutine_native,
88
+ to_coroutine,
89
+ wrap_silent,
90
+ unavailable,
91
+ is_neo,
92
+ Future,
93
+ coroutine,
94
+ wakeup,
95
+ sleep,
96
+ wait,
97
+ notify,
98
+ build_future,
99
+ ensure_async,
100
+ header_a,
101
+ ensure_a,
102
+ )
103
+ from .base import (
104
+ APP,
105
+ LEVEL,
106
+ NAME,
107
+ VERSION,
108
+ PLATFORM,
109
+ IDENTIFIER_SHORT,
110
+ IDENTIFIER_LONG,
111
+ IDENTIFIER,
112
+ API_VERSION,
113
+ BUFFER_SIZE,
114
+ MAX_LOG_SIZE,
115
+ MAX_LOG_COUNT,
116
+ App,
117
+ APIApp,
118
+ WebApp,
119
+ Template,
120
+ get_app,
121
+ get_name,
122
+ get_base_path,
123
+ get_cache,
124
+ get_preferences,
125
+ get_bus,
126
+ get_request,
127
+ get_session,
128
+ get_model,
129
+ get_controller,
130
+ get_part,
131
+ get_adapter,
132
+ get_manager,
133
+ get_logger,
134
+ get_level,
135
+ is_loaded,
136
+ is_devel,
137
+ is_safe,
138
+ to_locale,
139
+ on_exit,
140
+ build_asgi,
141
+ build_asgi_i,
142
+ )
143
+ from .bus import Bus, MemoryBus, RedisBus
144
+ from .cache import Cache, MemoryCache, FileCache, RedisCache, SerializedCache
145
+ from .component import Component
146
+ from .compress import Compress
147
+ from .config import conf, conf_prefix, conf_suffix, conf_s, conf_r, conf_d, conf_ctx
148
+ from .controller import Controller
149
+ from .crypt import Cipher, RC4, Spritz
150
+ from .data import (
151
+ DataAdapter,
152
+ MongoAdapter,
153
+ TinyAdapter,
154
+ Collection,
155
+ MongoCollection,
156
+ TinyCollection,
157
+ )
158
+ from .defines import (
159
+ ITERABLES,
160
+ MOBILE_REGEX,
161
+ TABLET_REGEX,
162
+ MOBILE_PREFIX_REGEX,
163
+ BODY_REGEX,
164
+ TAG_REGEX,
165
+ EMAIL_REGEX,
166
+ BROWSER_INFO,
167
+ OS_INFO,
168
+ WINDOWS_LOCALE,
169
+ SLUG_PERMUTATIONS,
170
+ )
171
+ from .exceptions import (
172
+ AppierException,
173
+ OperationalError,
174
+ SecurityError,
175
+ AssertionError,
176
+ ValidationError,
177
+ NotFoundError,
178
+ NotImplementedError,
179
+ BaseInternalError,
180
+ ValidationInternalError,
181
+ ValidationMultipleError,
182
+ HTTPError,
183
+ APIError,
184
+ APIAccessError,
185
+ OAuthAccessError,
186
+ )
187
+ from .execution import (
188
+ ExecutionThread,
189
+ background,
190
+ insert_work,
191
+ interval_work,
192
+ seconds_work,
193
+ minutes_work,
194
+ hourly_work,
195
+ daily_work,
196
+ weekly_work,
197
+ monthly_work,
198
+ seconds_eval,
199
+ minutes_eval,
200
+ hourly_eval,
201
+ daily_eval,
202
+ weekly_eval,
203
+ monthly_eval,
204
+ )
205
+ from .export import ExportManager
206
+ from .extra import (
207
+ get_a,
208
+ post_a,
209
+ put_a,
210
+ delete_a,
211
+ patch_a,
212
+ get_w,
213
+ post_w,
214
+ put_w,
215
+ delete_w,
216
+ patch_w,
217
+ )
218
+ from .geo import GeoResolver
219
+ from .git import Git
220
+ from .graph import Graph
221
+ from .http import file_g, get_f, get, post, put, delete, patch, basic_auth, HTTPResponse
222
+ from .log import (
223
+ MemoryHandler,
224
+ BaseFormatter,
225
+ ThreadFormatter,
226
+ DummyLogger,
227
+ reload_format,
228
+ rotating_handler,
229
+ smtp_handler,
230
+ in_signature,
231
+ )
232
+ from .meta import Ordered, Indexed
233
+ from .mock import MockObject, MockResponse, MockApp
234
+ from .model import (
235
+ Model,
236
+ LocalModel,
237
+ Field,
238
+ link,
239
+ operation,
240
+ view,
241
+ field,
242
+ type_d,
243
+ is_unset,
244
+ )
245
+ from .mongo import (
246
+ Mongo,
247
+ MongoAsync,
248
+ MongoEncoder,
249
+ get_connection,
250
+ get_connection_a,
251
+ reset_connection,
252
+ reset_connection_a,
253
+ get_db,
254
+ get_db_a,
255
+ drop_db,
256
+ drop_db_a,
257
+ object_id,
258
+ dumps,
259
+ )
260
+ from .observer import Observable
261
+ from .part import Part
262
+ from .preferences import (
263
+ Preferences,
264
+ MemoryPreferences,
265
+ FilePreferences,
266
+ RedisPreferences,
267
+ )
268
+ from .queuing import Queue, MemoryQueue, MultiprocessQueue, AMQPQueue
269
+ from .redisdb import Redis
270
+ from .request import CODE_STRINGS, Request, MockRequest
271
+ from .scheduler import Scheduler
272
+ from .serialize import serialize_csv, serialize_ics, build_encoder
273
+ from .session import (
274
+ Session,
275
+ MockSession,
276
+ MemorySession,
277
+ FileSession,
278
+ RedisSession,
279
+ ClientSession,
280
+ )
281
+ from .settings import DEBUG, USERNAME, PASSWORD
282
+ from .smtp import (
283
+ message,
284
+ message_base,
285
+ message_netius,
286
+ smtp_engine,
287
+ multipart,
288
+ plain,
289
+ html,
290
+ application,
291
+ header,
292
+ )
293
+ from .storage import StorageEngine, BaseEngine, FsEngine
294
+ from .structures import OrderedDict, LazyDict, LazyValue, GeneratorFile, lazy_dict, lazy
295
+ from .typesf import (
296
+ AbstractType,
297
+ Type,
298
+ File,
299
+ Files,
300
+ ImageFile,
301
+ ImageFiles,
302
+ image,
303
+ images,
304
+ Reference,
305
+ reference,
306
+ References,
307
+ references,
308
+ Encrypted,
309
+ encrypted,
310
+ secure,
311
+ )
312
+ from .util import (
313
+ to_limit,
314
+ to_find,
315
+ to_sort,
316
+ is_iterable,
317
+ is_mobile,
318
+ is_tablet,
319
+ is_browser,
320
+ is_bot,
321
+ browser_info,
322
+ email_parts,
323
+ email_mime,
324
+ email_name,
325
+ email_base,
326
+ date_to_timestamp,
327
+ obfuscate,
328
+ import_pip,
329
+ ensure_pip,
330
+ install_pip,
331
+ install_pip_s,
332
+ request_json,
333
+ get_context,
334
+ get_object,
335
+ resolve_alias,
336
+ page_types,
337
+ find_types,
338
+ norm_object,
339
+ set_object,
340
+ leafs,
341
+ gather_errors,
342
+ gen_token,
343
+ html_to_text,
344
+ camel_to_underscore,
345
+ camel_to_readable,
346
+ underscore_to_camel,
347
+ underscore_to_readable,
348
+ quote,
349
+ unquote,
350
+ escape,
351
+ unescape,
352
+ count_unescape,
353
+ split_unescape,
354
+ call_safe,
355
+ base_name,
356
+ base_name_m,
357
+ is_content_type,
358
+ parse_content_type,
359
+ parse_cookie,
360
+ parse_multipart,
361
+ decode_params,
362
+ load_form,
363
+ check_login,
364
+ check_user,
365
+ check_token,
366
+ check_tokens,
367
+ ensure_login,
368
+ get_tokens_m,
369
+ to_tokens_m,
370
+ dict_merge,
371
+ deprecated,
372
+ cached,
373
+ private,
374
+ ensure,
375
+ delayed,
376
+ route,
377
+ error_handler,
378
+ exception_handler,
379
+ before_request,
380
+ after_request,
381
+ is_detached,
382
+ sanitize,
383
+ verify,
384
+ verify_equal,
385
+ verify_not_equal,
386
+ verify_type,
387
+ verify_many,
388
+ execute,
389
+ ctx_locale,
390
+ ctx_request,
391
+ FileTuple,
392
+ BaseThread,
393
+ JSONEncoder,
394
+ )
395
+ from .validation import (
396
+ validate,
397
+ validate_b,
398
+ validate_e,
399
+ safe,
400
+ eq,
401
+ gt,
402
+ gte,
403
+ lt,
404
+ lte,
405
+ not_null,
406
+ not_empty,
407
+ not_false,
408
+ is_in,
409
+ is_upper,
410
+ is_lower,
411
+ is_simple,
412
+ is_email,
413
+ is_url,
414
+ is_regex,
415
+ field_eq,
416
+ field_gt,
417
+ field_gte,
418
+ field_lt,
419
+ field_lte,
420
+ string_gt,
421
+ string_lt,
422
+ string_eq,
423
+ equals,
424
+ not_past,
425
+ not_duplicate,
426
+ all_different,
427
+ no_self,
428
+ )
429
+
430
+ from .amqp import get_connection as get_amqp
431
+ from .amqp import properties as properties_amqp
432
+ from .mongo import get_connection as get_mongo
433
+ from .mongo import get_db as get_mongo_db
434
+ from .mongo import drop_db as drop_mongo_db
435
+ from .mongo import object_id as object_id_mongo
436
+ from .mongo import dumps as dumps_mongo
437
+ from .mongo import serialize as serialize_mongo
438
+ from .mongo import directions as directions_mongo
439
+ from .redisdb import get_connection as get_redis
440
+ from .redisdb import dumps as dumps_redis
441
+
442
+ HTTPError = exceptions.HTTPError
@@ -2,7 +2,7 @@
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
4
  # Hive Appier Framework
5
- # Copyright (c) 2008-2022 Hive Solutions Lda.
5
+ # Copyright (c) 2008-2024 Hive Solutions Lda.
6
6
  #
7
7
  # This file is part of Hive Appier Framework.
8
8
  #
@@ -22,16 +22,7 @@
22
22
  __author__ = "João Magalhães <joamag@hive.pt>"
23
23
  """ The author(s) of the module """
24
24
 
25
- __version__ = "1.0.0"
26
- """ The version of the module """
27
-
28
- __revision__ = "$LastChangedRevision$"
29
- """ The revision number of the module """
30
-
31
- __date__ = "$LastChangedDate$"
32
- """ The last change date of the module """
33
-
34
- __copyright__ = "Copyright (c) 2008-2022 Hive Solutions Lda."
25
+ __copyright__ = "Copyright (c) 2008-2024 Hive Solutions Lda."
35
26
  """ The copyright for the module """
36
27
 
37
28
  __license__ = "Apache License, Version 2.0"
@@ -42,8 +33,10 @@ from . import config
42
33
  from . import legacy
43
34
  from . import exceptions
44
35
 
45
- try: import pika
46
- except ImportError: pika = None
36
+ try:
37
+ import pika
38
+ except ImportError:
39
+ pika = None
47
40
 
48
41
  URL = "amqp://guest:guest@localhost"
49
42
  """ The default URL to be used for the connection when
@@ -58,14 +51,15 @@ connection = None
58
51
  """ The global wide connection to the AMQP server
59
52
  that is meant to be used across sessions """
60
53
 
61
- class AMQP(object):
62
54
 
63
- def __init__(self, url = None):
55
+ class AMQP(object):
56
+ def __init__(self, url=None):
64
57
  self.url = url
65
58
  self._connection = None
66
59
 
67
- def get_connection(self, url = None, timeout = TIMEOUT):
68
- if self._connection: return self._connection
60
+ def get_connection(self, url=None, timeout=TIMEOUT):
61
+ if self._connection:
62
+ return self._connection
69
63
  url_c = config.conf("AMQP_URL", None)
70
64
  url_c = config.conf("CLOUDAMQP_URL", url_c)
71
65
  url_c = config.conf("RABBITMQ_URL", url_c)
@@ -74,34 +68,37 @@ class AMQP(object):
74
68
  username = "guest" if url_p.username == None else url_p.username
75
69
  password = "guest" if url_p.password == None else url_p.password
76
70
  parameters = _pika().ConnectionParameters(
77
- host = url_p.hostname,
78
- virtual_host = url_p.path or "/",
79
- credentials = _pika().PlainCredentials(username, password)
71
+ host=url_p.hostname,
72
+ virtual_host=url_p.path or "/",
73
+ credentials=_pika().PlainCredentials(username, password),
80
74
  )
81
75
  parameters.socket_timeout = timeout
82
76
  self._connection = _pika().BlockingConnection(parameters)
83
77
  self._connection = _set_fixes(self._connection)
84
78
  return self._connection
85
79
 
86
- def get_connection(url = URL, timeout = TIMEOUT):
80
+
81
+ def get_connection(url=URL, timeout=TIMEOUT):
87
82
  global connection
88
83
  url = config.conf("AMQP_URL", url)
89
84
  url = config.conf("CLOUDAMQP_URL", url)
90
85
  url = config.conf("RABBITMQ_URL", url)
91
86
  url_p = legacy.urlparse(url)
92
87
  parameters = _pika().ConnectionParameters(
93
- host = url_p.hostname,
94
- virtual_host = url_p.path or "/",
95
- credentials = _pika().PlainCredentials(url_p.username, url_p.password)
88
+ host=url_p.hostname,
89
+ virtual_host=url_p.path or "/",
90
+ credentials=_pika().PlainCredentials(url_p.username, url_p.password),
96
91
  )
97
92
  parameters.socket_timeout = timeout
98
93
  connection = _pika().BlockingConnection(parameters)
99
94
  connection = _set_fixes(connection)
100
95
  return connection
101
96
 
97
+
102
98
  def properties(*args, **kwargs):
103
99
  return _pika().BasicProperties(*args, **kwargs)
104
100
 
101
+
105
102
  def _set_fixes(connection):
106
103
  def disconnect():
107
104
  connection.socket.close()
@@ -110,10 +107,12 @@ def _set_fixes(connection):
110
107
  connection.disconnect = disconnect
111
108
  return connection
112
109
 
113
- def _pika(verify = True):
114
- if verify: util.verify(
115
- not pika == None,
116
- message = "Pika library not available",
117
- exception = exceptions.OperationalError
118
- )
110
+
111
+ def _pika(verify=True):
112
+ if verify:
113
+ util.verify(
114
+ not pika == None,
115
+ message="Pika library not available",
116
+ exception=exceptions.OperationalError,
117
+ )
119
118
  return pika