appier 1.31.4__py2.py3-none-any.whl → 1.32.0__py2.py3-none-any.whl

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 (81) hide show
  1. appier/__init__.py +333 -52
  2. appier/amqp.py +29 -30
  3. appier/api.py +214 -212
  4. appier/asgi.py +54 -55
  5. appier/async_neo.py +46 -35
  6. appier/async_old.py +55 -42
  7. appier/asynchronous.py +7 -13
  8. appier/base.py +1762 -1429
  9. appier/bus.py +51 -52
  10. appier/cache.py +99 -84
  11. appier/common.py +9 -11
  12. appier/component.py +17 -19
  13. appier/compress.py +25 -28
  14. appier/config.py +96 -73
  15. appier/controller.py +9 -15
  16. appier/crypt.py +25 -21
  17. appier/data.py +73 -57
  18. appier/defines.py +191 -226
  19. appier/exceptions.py +103 -63
  20. appier/execution.py +94 -88
  21. appier/export.py +90 -88
  22. appier/extra.py +6 -13
  23. appier/extra_neo.py +8 -11
  24. appier/extra_old.py +18 -16
  25. appier/geo.py +57 -47
  26. appier/git.py +101 -90
  27. appier/graph.py +23 -24
  28. appier/http.py +520 -398
  29. appier/legacy.py +373 -180
  30. appier/log.py +90 -97
  31. appier/meta.py +42 -42
  32. appier/mock.py +32 -34
  33. appier/model.py +793 -681
  34. appier/model_a.py +208 -183
  35. appier/mongo.py +183 -107
  36. appier/observer.py +39 -31
  37. appier/part.py +23 -24
  38. appier/preferences.py +44 -47
  39. appier/queuing.py +78 -96
  40. appier/redisdb.py +40 -35
  41. appier/request.py +227 -175
  42. appier/scheduler.py +13 -18
  43. appier/serialize.py +37 -31
  44. appier/session.py +161 -147
  45. appier/settings.py +2 -11
  46. appier/smtp.py +53 -49
  47. appier/storage.py +39 -33
  48. appier/structures.py +50 -45
  49. appier/test/__init__.py +2 -11
  50. appier/test/base.py +111 -108
  51. appier/test/cache.py +28 -35
  52. appier/test/config.py +10 -19
  53. appier/test/crypt.py +3 -12
  54. appier/test/data.py +3 -12
  55. appier/test/exceptions.py +8 -17
  56. appier/test/export.py +16 -33
  57. appier/test/graph.py +27 -60
  58. appier/test/http.py +42 -54
  59. appier/test/legacy.py +20 -30
  60. appier/test/log.py +14 -35
  61. appier/test/mock.py +27 -123
  62. appier/test/model.py +79 -91
  63. appier/test/part.py +5 -14
  64. appier/test/preferences.py +5 -13
  65. appier/test/queuing.py +29 -37
  66. appier/test/request.py +61 -73
  67. appier/test/serialize.py +12 -23
  68. appier/test/session.py +10 -19
  69. appier/test/smtp.py +8 -14
  70. appier/test/structures.py +20 -24
  71. appier/test/typesf.py +14 -28
  72. appier/test/util.py +480 -438
  73. appier/typesf.py +251 -171
  74. appier/util.py +578 -407
  75. appier/validation.py +280 -143
  76. {appier-1.31.4.dist-info → appier-1.32.0.dist-info}/METADATA +6 -1
  77. appier-1.32.0.dist-info/RECORD +86 -0
  78. appier-1.31.4.dist-info/RECORD +0 -86
  79. {appier-1.31.4.dist-info → appier-1.32.0.dist-info}/LICENSE +0 -0
  80. {appier-1.31.4.dist-info → appier-1.32.0.dist-info}/WHEEL +0 -0
  81. {appier-1.31.4.dist-info → appier-1.32.0.dist-info}/top_level.txt +0 -0
appier/redisdb.py CHANGED
@@ -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"
@@ -43,8 +34,10 @@ from . import util
43
34
  from . import config
44
35
  from . import exceptions
45
36
 
46
- try: import redis
47
- except ImportError: redis = None
37
+ try:
38
+ import redis
39
+ except ImportError:
40
+ redis = None
48
41
 
49
42
  URL = "redis://localhost"
50
43
  """ The default URL to be used for the connection when
@@ -58,58 +51,70 @@ connection = None
58
51
  """ The global connection object that should persist
59
52
  the connection relation with the database service """
60
53
 
61
- class Redis(object):
62
54
 
63
- def __init__(self, url = None, pool = None):
55
+ class Redis(object):
56
+ def __init__(self, url=None, pool=None):
64
57
  self.url = url
65
58
  self.pool = pool
66
59
  self._connection = None
67
60
 
68
- def get_connection(self, url = None, pool = None):
69
- if self._connection: return self._connection
61
+ def get_connection(self, url=None, pool=None):
62
+ if self._connection:
63
+ return self._connection
70
64
 
71
65
  url_c = config.conf("REDISTOGO_URL", None)
72
66
  url_c = config.conf("REDIS_URL", url_c)
73
- pool_c = config.conf("REDIS_POOL", True, cast = bool)
67
+ pool_c = config.conf("REDIS_POOL", True, cast=bool)
74
68
 
75
69
  _url = URL
76
- if not url_c == None: _url = url_c
77
- if not self.url == None: _url = self.url
78
- if not url == None: _url = url
70
+ if not url_c == None:
71
+ _url = url_c
72
+ if not self.url == None:
73
+ _url = self.url
74
+ if not url == None:
75
+ _url = url
79
76
 
80
77
  _pool = POOL
81
- if not pool_c == None: _pool = pool_c
82
- if not self.pool == None: _pool = self.pool
83
- if not pool == None: _pool = pool
78
+ if not pool_c == None:
79
+ _pool = pool_c
80
+ if not self.pool == None:
81
+ _pool = self.pool
82
+ if not pool == None:
83
+ _pool = pool
84
84
 
85
85
  if _pool:
86
86
  connection_pool = _redis().BlockingConnectionPool.from_url(_url)
87
- self._connection = _redis().Redis(connection_pool = connection_pool)
87
+ self._connection = _redis().Redis(connection_pool=connection_pool)
88
88
  else:
89
89
  self._connection = _redis().from_url(_url)
90
90
 
91
91
  return self._connection
92
92
 
93
- def get_connection(url = URL):
93
+
94
+ def get_connection(url=URL):
94
95
  global connection
95
- if connection: return connection
96
+ if connection:
97
+ return connection
96
98
  url = config.conf("REDISTOGO_URL", url)
97
99
  url = config.conf("REDIS_URL", url)
98
- pool = config.conf("REDIS_POOL", True, cast = bool)
100
+ pool = config.conf("REDIS_POOL", True, cast=bool)
99
101
  if pool:
100
102
  connection_pool = _redis().BlockingConnectionPool.from_url(url)
101
- connection = _redis().Redis(connection_pool = connection_pool)
103
+ connection = _redis().Redis(connection_pool=connection_pool)
102
104
  else:
103
105
  connection = _redis().from_url(url)
104
106
  return connection
105
107
 
108
+
106
109
  def dumps(*args):
107
110
  return json.dumps(*args)
108
111
 
109
- def _redis(verify = True):
110
- if verify: util.verify(
111
- not redis == None,
112
- message = "RedisPy library not available",
113
- exception = exceptions.OperationalError
114
- )
112
+
113
+ def _redis(verify=True):
114
+ if verify:
115
+ util.verify(
116
+ not redis == None,
117
+ message="RedisPy library not available",
118
+ exception=exceptions.OperationalError,
119
+ )
115
120
  return redis