appier 1.34.0__py2.py3-none-any.whl → 1.34.2__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.
appier/asgi.py CHANGED
@@ -135,11 +135,13 @@ class ASGIApp(object):
135
135
  event = await receive()
136
136
 
137
137
  if event["type"] == "lifespan.startup":
138
- self.start()
138
+ if not self.is_started():
139
+ self.start()
139
140
  await send(dict(type="lifespan.startup.complete"))
140
141
 
141
142
  elif event["type"] == "lifespan.shutdown":
142
- self.stop()
143
+ if not self.is_stopped():
144
+ self.stop()
143
145
  await send(dict(type="lifespan.shutdown.complete"))
144
146
  running = False
145
147
 
appier/base.py CHANGED
@@ -94,7 +94,7 @@ NAME = "appier"
94
94
  """ The name to be used to describe the framework while working
95
95
  on its own environment, this is just a descriptive value """
96
96
 
97
- VERSION = "1.34.0"
97
+ VERSION = "1.34.2"
98
98
  """ The version of the framework that is currently installed
99
99
  this value may be used for debugging/diagnostic purposes """
100
100
 
@@ -945,6 +945,7 @@ class App(
945
945
  self.host = host
946
946
  self.port = port
947
947
  self.ssl = ssl
948
+
948
949
  self.start()
949
950
 
950
951
  method = getattr(self, "serve_" + server)
@@ -3649,6 +3650,15 @@ class App(
3649
3650
  return False
3650
3651
  return self.level < logging.INFO
3651
3652
 
3653
+ def is_running(self):
3654
+ return self.status == RUNNING
3655
+
3656
+ def is_started(self):
3657
+ return self.is_running()
3658
+
3659
+ def is_stopped(self):
3660
+ return self.status == STOPPED
3661
+
3652
3662
  def serialize(self, value):
3653
3663
  if value in legacy.STRINGS:
3654
3664
  return value
appier/base.pyi CHANGED
@@ -59,6 +59,14 @@ class App:
59
59
  **kwargs
60
60
  ) -> str: ...
61
61
  def cron(self, job: JobFunction, cron: Cron) -> SchedulerTask: ...
62
+ def is_loaded(self) -> bool: ...
63
+ def is_parent(self) -> bool: ...
64
+ def is_child(self) -> bool: ...
65
+ def is_main(self) -> bool: ...
66
+ def is_devel(self) -> bool: ...
67
+ def is_running(self) -> bool: ...
68
+ def is_started(self) -> bool: ...
69
+ def is_stopped(self) -> bool: ...
62
70
  def url_for(
63
71
  self,
64
72
  type: str,
appier/scheduler.py CHANGED
@@ -30,7 +30,6 @@ __license__ = "Apache License, Version 2.0"
30
30
 
31
31
  import time
32
32
  import heapq
33
- import calendar
34
33
  import datetime
35
34
  import logging
36
35
  import threading
@@ -187,6 +186,12 @@ class SchedulerTask(object):
187
186
  self.date = SchedulerDate.from_cron(cron)
188
187
  self._enabled = True
189
188
 
189
+ def __repr__(self):
190
+ return "<SchedulerTask: %s, %s>" % (self.job, self.date)
191
+
192
+ def __str__(self):
193
+ return "<SchedulerTask: %s, %s>" % (self.job, self.date)
194
+
190
195
  def __eq__(self, other):
191
196
  if isinstance(other, self.__class__):
192
197
  return True
@@ -223,6 +228,12 @@ class SchedulerDate(object):
223
228
  self.months = self._parse_field(months, 1, 12)
224
229
  self.days_of_week = self._parse_field(days_of_week, 0, 6)
225
230
 
231
+ def __repr__(self):
232
+ return "<SchedulerDate: %s>" % self.next_run()
233
+
234
+ def __str__(self):
235
+ return "<SchedulerDate: %s>" % self.next_run()
236
+
226
237
  @classmethod
227
238
  def from_cron(cls, cron):
228
239
  if isinstance(cron, cls):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: appier
3
- Version: 1.34.0
3
+ Version: 1.34.2
4
4
  Summary: Appier Framework
5
5
  Home-page: http://appier.hive.pt
6
6
  Author: Hive Solutions Lda.
@@ -1,13 +1,13 @@
1
1
  appier/__init__.py,sha256=-Xd1j5egjwXV6yoKAkcPVWIZEnpPK_SJTTmQjDrW93E,9413
2
2
  appier/amqp.py,sha256=etYxUlfaK27Og_9FJ6qCgNLSYhnz9XgVhIhSmD2ITW4,3852
3
3
  appier/api.py,sha256=s5ZJs0tgR3wktAhLZ7Vuhbd_4lWPsGJSEx0ptkqLxvM,14369
4
- appier/asgi.py,sha256=sKQH9K_QEDPbBSk3AWcvHo7Lfl5yawIo6NcM0z1qQCw,12100
4
+ appier/asgi.py,sha256=XqlXJ5QEyWyZBqFU9ubEx-jNehicihKcACR4Hy2A2nE,12194
5
5
  appier/async_neo.py,sha256=gQpyT1-nZE6Uynh5FEmFl5kfXkxChdUsgiKgwlaNw5E,5446
6
6
  appier/async_old.py,sha256=m3BFqHVPCRuIZ9L2sGYhCQPEwuCNKBO2y7SKM0dbtj8,9194
7
7
  appier/asynchronous.py,sha256=a1LQa3wbGMaXELhF7W71dRr1klPOj6x-ST9EInvPhtU,1757
8
8
  appier/asynchronous.pyi,sha256=5CpLkpKcUq09woMOVYwpl24Pli0A8Xu6nXoT20xDQ-o,104
9
- appier/base.py,sha256=3acfd3DK2alileixYuQuM3YkgVbroyBYlXHJdEz5Flg,270121
10
- appier/base.pyi,sha256=Vx8idYnMvP3nLwGdd2LJKGc0RFpT6iav77YMcBpcr4o,2515
9
+ appier/base.py,sha256=ikeBH6C_rE-13iP4yUysgVrMLs3wnvtgenotUk8hotY,270322
10
+ appier/base.pyi,sha256=Uk9nLTDpI5Z51AatN1AtBuGJ7w5CtZpJHXywg1z_Rv4,2818
11
11
  appier/bus.py,sha256=AMC2UXlaf6rzhzlIyTHkzbfb6tdfPBiOii4lpl9AAwg,7670
12
12
  appier/bus.pyi,sha256=W6_MIBpvDq468wfT5XM2WpPuR3O49QiZMOSCdMsJWos,182
13
13
  appier/cache.py,sha256=V1nhf4aHJpUlcFtxVsd-2tGCt1BarkxvHWwVwuhc4Ao,10689
@@ -48,7 +48,7 @@ appier/preferences.pyi,sha256=uYVgvDq2f4KWlLRY-C8bi6xry_utFKDeToGHH5aptxc,197
48
48
  appier/queuing.py,sha256=6AJlRVdd5JunzChu8Q1U-9Biq4vQUHTuJFC8qs2wzCs,8097
49
49
  appier/redisdb.py,sha256=5inJMQqHVkfsGoqoRGYzewlgooDZD2uwOtlPXHX17V0,3504
50
50
  appier/request.py,sha256=vNiRdBZXgboMx_d3xkGHlJf3f7ifejgKyhYZ4Pr9GlE,31450
51
- appier/scheduler.py,sha256=GMy2izW5I9WdX7N_-WWyl7YLfJnuznxe0GZiTJROnA0,9408
51
+ appier/scheduler.py,sha256=8PcdJQqgbUOrkRfy-2-3N987lGpIUPO9fNYm9QtSjE0,9741
52
52
  appier/scheduler.pyi,sha256=JHqH-DSKFZL1uXJTpWFTVHykRT8QRGrVdYCi0nyhjrQ,2132
53
53
  appier/serialize.py,sha256=LiR1ZbAiC_I3lhlQToPK_u2DC2r04Gl9OEQTayW4Rlg,6669
54
54
  appier/session.py,sha256=6rcwFdsu--7gFLr6mJJh3EFSZ_A3Oe8u7olAvTw2sUk,20380
@@ -92,8 +92,8 @@ appier/test/structures.py,sha256=MRjUFRlnJi-i7YGWW5y792JbJwicNvOIzVAS220tgeQ,836
92
92
  appier/test/typesf.py,sha256=KHumQFzx7wPZSCb8_mpIwobhIy2Fh_0XYviwPjXMbKI,9680
93
93
  appier/test/util.py,sha256=SSHuBAZQ0TcXLDYI0xUvmwId5nndDZb88s_5Y-Hqibw,46884
94
94
  appier/test/validation.py,sha256=riOCsGKob1P5jnbcB5qGZ45ApimNAVS0byg9v_uUdrk,4952
95
- appier-1.34.0.dist-info/LICENSE,sha256=Pd-b5cKP4n2tFDpdx27qJSIq0d1ok0oEcGTlbtL6QMU,11560
96
- appier-1.34.0.dist-info/METADATA,sha256=DYxSVNTiozLHgTC4dR7-UFrJzV9Lq6XrsTUdvyAmZ_s,1920
97
- appier-1.34.0.dist-info/WHEEL,sha256=kGT74LWyRUZrL4VgLh6_g12IeVl_9u9ZVhadrgXZUEY,110
98
- appier-1.34.0.dist-info/top_level.txt,sha256=Z2e_Y1ya06a554WwQZkfNRiaaQxqsdaPtBzrck384Lo,7
99
- appier-1.34.0.dist-info/RECORD,,
95
+ appier-1.34.2.dist-info/LICENSE,sha256=Pd-b5cKP4n2tFDpdx27qJSIq0d1ok0oEcGTlbtL6QMU,11560
96
+ appier-1.34.2.dist-info/METADATA,sha256=guRP0PiFO_o0wJ9zrw11k4D1LSE5XS12T_Ad6tI-0tY,1920
97
+ appier-1.34.2.dist-info/WHEEL,sha256=kGT74LWyRUZrL4VgLh6_g12IeVl_9u9ZVhadrgXZUEY,110
98
+ appier-1.34.2.dist-info/top_level.txt,sha256=Z2e_Y1ya06a554WwQZkfNRiaaQxqsdaPtBzrck384Lo,7
99
+ appier-1.34.2.dist-info/RECORD,,