lino 25.5.1__py3-none-any.whl → 25.5.2__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.
- lino/__init__.py +1 -1
- lino/core/site.py +6 -7
- lino/core/tables.py +6 -0
- lino/modlib/export_excel/models.py +7 -3
- lino/modlib/linod/mixins.py +10 -11
- lino/modlib/summaries/__init__.py +2 -2
- {lino-25.5.1.dist-info → lino-25.5.2.dist-info}/METADATA +1 -1
- {lino-25.5.1.dist-info → lino-25.5.2.dist-info}/RECORD +11 -11
- {lino-25.5.1.dist-info → lino-25.5.2.dist-info}/WHEEL +0 -0
- {lino-25.5.1.dist-info → lino-25.5.2.dist-info}/licenses/AUTHORS.rst +0 -0
- {lino-25.5.1.dist-info → lino-25.5.2.dist-info}/licenses/COPYING +0 -0
lino/__init__.py
CHANGED
@@ -31,7 +31,7 @@ from django import VERSION
|
|
31
31
|
from django.apps import AppConfig
|
32
32
|
from django.conf import settings
|
33
33
|
import warnings
|
34
|
-
__version__ = '25.5.
|
34
|
+
__version__ = '25.5.2'
|
35
35
|
|
36
36
|
# import setuptools # avoid UserWarning "Distutils was imported before Setuptools"?
|
37
37
|
|
lino/core/site.py
CHANGED
@@ -1369,17 +1369,16 @@ class Site(object):
|
|
1369
1369
|
|
1370
1370
|
def today(self, *args, **kwargs):
|
1371
1371
|
if self.site_config is None:
|
1372
|
-
base = self.the_demo_date
|
1372
|
+
base = self.the_demo_date
|
1373
1373
|
else:
|
1374
|
-
base =
|
1375
|
-
|
1376
|
-
|
1377
|
-
|
1378
|
-
)
|
1374
|
+
base = self.site_config.simulate_today or self.the_demo_date
|
1375
|
+
if base is None:
|
1376
|
+
# base = datetime.date.today()
|
1377
|
+
base = timezone.now().date()
|
1379
1378
|
return date_offset(base, *args, **kwargs)
|
1380
1379
|
|
1381
1380
|
def now(self, *args, **kwargs):
|
1382
|
-
t = self.today()
|
1381
|
+
t = self.today(*args, **kwargs)
|
1383
1382
|
now = timezone.now()
|
1384
1383
|
return now.replace(year=t.year, month=t.month, day=t.day)
|
1385
1384
|
|
lino/core/tables.py
CHANGED
@@ -312,6 +312,12 @@ class AbstractTable(actors.Actor):
|
|
312
312
|
Usually such a warning means that there is something wrong.
|
313
313
|
"""
|
314
314
|
|
315
|
+
table_as_calendar = False
|
316
|
+
"""Whether the primereact Datatable is used to display a calendar view.
|
317
|
+
|
318
|
+
Used only in :term:`React front end`.
|
319
|
+
"""
|
320
|
+
|
315
321
|
default_display_modes = {
|
316
322
|
70: constants.DISPLAY_MODE_SUMMARY,
|
317
323
|
None: constants.DISPLAY_MODE_GRID
|
@@ -2,12 +2,11 @@
|
|
2
2
|
# Copyright 2014-2025 Rumma & Ko Ltd
|
3
3
|
# License: GNU Affero General Public License v3 (see file COPYING for details)
|
4
4
|
|
5
|
-
import os
|
6
|
-
|
7
5
|
from django.conf import settings
|
8
6
|
from django.db.models import Model
|
9
7
|
from django.utils.functional import Promise
|
10
8
|
from django.utils.html import SafeString
|
9
|
+
from django.utils.timezone import make_naive, is_aware
|
11
10
|
from lino.utils.html import iselement, to_rst
|
12
11
|
|
13
12
|
from lino.core import actions
|
@@ -100,6 +99,11 @@ def ar2workbook(ar, column_names=None):
|
|
100
99
|
value = str(value)
|
101
100
|
elif isinstance(value, Model):
|
102
101
|
value = str(value)
|
102
|
+
elif isinstance(value, datetime.datetime):
|
103
|
+
# Excel does not support timezones in datetimes. The tzinfo in
|
104
|
+
# the datetime/time object must be set to None.
|
105
|
+
if is_aware(value):
|
106
|
+
value = make_naive()
|
103
107
|
elif isinstance(value, str):
|
104
108
|
# if it is a future.newstr, change it to a real string to avoid
|
105
109
|
# ValueError: Cannot convert 'Hans Altenberg' to Excel
|
@@ -109,7 +113,7 @@ def ar2workbook(ar, column_names=None):
|
|
109
113
|
if style is not None:
|
110
114
|
cell.style = style
|
111
115
|
cell.value = value
|
112
|
-
except ValueError
|
116
|
+
except ValueError:
|
113
117
|
raise Exception("20190222 {} {}".format(
|
114
118
|
value.__class__, value))
|
115
119
|
|
lino/modlib/linod/mixins.py
CHANGED
@@ -3,18 +3,14 @@
|
|
3
3
|
# License: GNU Affero General Public License v3 (see file COPYING for details)
|
4
4
|
# See https://dev.lino-framework.org/plugins/linod.html
|
5
5
|
|
6
|
-
import logging
|
7
6
|
import traceback
|
8
7
|
import asyncio
|
9
|
-
import pickle
|
10
8
|
from datetime import timedelta
|
11
|
-
from django.conf import settings
|
12
9
|
from django.db import models
|
13
10
|
from django.utils import timezone
|
14
11
|
# from django.core.exceptions import ValidationError
|
15
12
|
from asgiref.sync import sync_to_async, async_to_sync
|
16
13
|
|
17
|
-
from lino import logger
|
18
14
|
from lino.api import dd, _
|
19
15
|
from lino.mixins import Sequenced
|
20
16
|
from lino.modlib.system.mixins import RecurrenceSet
|
@@ -45,7 +41,8 @@ class RunNow(dd.Action):
|
|
45
41
|
|
46
42
|
def run_from_ui(self, ar, **kwargs):
|
47
43
|
# print("20231102 RunNow", ar.selected_rows)
|
48
|
-
now = dd.now()
|
44
|
+
# now = dd.now()
|
45
|
+
now = timezone.now()
|
49
46
|
for obj in ar.selected_rows:
|
50
47
|
assert issubclass(obj.__class__, Runnable)
|
51
48
|
if True: # dd.plugins.linod.use_channels:
|
@@ -155,7 +152,8 @@ class Runnable(Sequenced, RecurrenceSet):
|
|
155
152
|
await ar.adebug("Start %s with logging level %s", self, self.log_level)
|
156
153
|
# ar.info("Start %s with logging level %s", astr(self), self.log_level)
|
157
154
|
# forget about any previous run:
|
158
|
-
now = await sync_to_async(dd.now)()
|
155
|
+
# now = await sync_to_async(dd.now)()
|
156
|
+
now = timezone.now()
|
159
157
|
self.last_start_time = now
|
160
158
|
self.requested_at = None
|
161
159
|
self.last_end_time = None
|
@@ -186,8 +184,8 @@ class Runnable(Sequenced, RecurrenceSet):
|
|
186
184
|
self.disabled = True
|
187
185
|
await ar.awarning("Disabled %s after exception %s", self, e)
|
188
186
|
# ar.warning("Disabled %s after exception %s", astr(self), e)
|
189
|
-
now = await sync_to_async(dd.now)()
|
190
|
-
self.last_end_time = now
|
187
|
+
# now = await sync_to_async(dd.now)()
|
188
|
+
self.last_end_time = timezone.now()
|
191
189
|
self.message = "<pre>" + self.message + "</pre>"
|
192
190
|
await sync_to_async(self.full_clean)()
|
193
191
|
# self.full_clean()
|
@@ -222,8 +220,8 @@ async def start_task_runner(ar=None, max_count=None):
|
|
222
220
|
count = 0
|
223
221
|
while True:
|
224
222
|
await ar.adebug("Start next task runner loop.")
|
225
|
-
|
226
|
-
now =
|
223
|
+
# now = await sync_to_async(dd.now)()
|
224
|
+
now = timezone.now()
|
227
225
|
next_time = now + \
|
228
226
|
timedelta(seconds=dd.plugins.linod.background_sleep_time)
|
229
227
|
|
@@ -286,7 +284,8 @@ async def start_task_runner(ar=None, max_count=None):
|
|
286
284
|
if max_count is not None and count >= max_count:
|
287
285
|
await ar.ainfo("Stop after %s loops.", max_count)
|
288
286
|
return next_time
|
289
|
-
now = await sync_to_async(dd.now)()
|
287
|
+
# now = await sync_to_async(dd.now)()
|
288
|
+
now = timezone.now()
|
290
289
|
if (to_sleep := (next_time - now).total_seconds()) <= 0:
|
291
290
|
continue
|
292
291
|
await ar.adebug("Let task runner sleep for %s seconds.", to_sleep)
|
@@ -11,8 +11,8 @@ class Plugin(ad.Plugin):
|
|
11
11
|
end_year = None
|
12
12
|
duration_max_length = 6
|
13
13
|
|
14
|
-
def
|
14
|
+
def pre_site_startup(self, site):
|
15
15
|
if self.end_year is None:
|
16
|
-
self.end_year =
|
16
|
+
self.end_year = site.today().year
|
17
17
|
if self.start_year is None:
|
18
18
|
self.start_year = self.end_year - 2
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: lino
|
3
|
-
Version: 25.5.
|
3
|
+
Version: 25.5.2
|
4
4
|
Summary: A framework for writing desktop-like web applications using Django and ExtJS or React
|
5
5
|
Project-URL: Homepage, https://www.lino-framework.org
|
6
6
|
Project-URL: Repository, https://gitlab.com/lino-framework/lino
|
@@ -1,6 +1,6 @@
|
|
1
1
|
lino/.cvsignore,sha256=1vrrWoP-WD8hPfCszHHIiJEi8KUMRCt5WvoKB9TSB1k,28
|
2
2
|
lino/SciTEDirectory.properties,sha256=rCYi_e-6h8Yx5DwXhAa6MBPlVINcl6Vv9BQDYZV2_go,28
|
3
|
-
lino/__init__.py,sha256=
|
3
|
+
lino/__init__.py,sha256=gP0bRqYKaybUYMt4xK-UhLZAv5gMB85HvsKjWZM7g1M,6176
|
4
4
|
lino/ad.py,sha256=AQ-vJ4scac1mx3xegXezxnxyOQpV-a0q3VFMJSDbj2s,142
|
5
5
|
lino/apps.py,sha256=ECq-dPARDkuhngwNrcipse3b4Irj70HxJs44uWEZFc4,27
|
6
6
|
lino/hello.py,sha256=7-PJg7PnEiznyETqGjOwXcKh8rda0qLetpbS2gvRYy0,532
|
@@ -59,9 +59,9 @@ lino/core/renderer.py,sha256=C00J0L41hLv9b2sAzqSSrT0Lz5Fc78JnwHiq9LqF81c,47310
|
|
59
59
|
lino/core/requests.py,sha256=aIT8DsWVWwYQWHf7xX7SbbUf0s_8dWfayR3104VDrnQ,95833
|
60
60
|
lino/core/roles.py,sha256=PXwk436xUupxdbJcygRSYFu7ixfKjAJPQRUQ8sy0lB0,4425
|
61
61
|
lino/core/signals.py,sha256=0JT89mkjSbRm57QZcSI9DoThoKUGkyi-egNhuLUKEds,948
|
62
|
-
lino/core/site.py,sha256=
|
62
|
+
lino/core/site.py,sha256=tO7Ee47_IGQfm9oi87GRquTDPXKmHqFlrdggoMjXMCk,82723
|
63
63
|
lino/core/store.py,sha256=ibshCPBKd0zNSoAfMYx1MaqHXggE-O4zqiSUSlY-x68,51444
|
64
|
-
lino/core/tables.py,sha256=
|
64
|
+
lino/core/tables.py,sha256=Trn-Augg-5vENZT0Oa4NVTfivgmMls7dsO8YOvFEANQ,24638
|
65
65
|
lino/core/urls.py,sha256=06QlmN1vpxjmb5snO3SPpP6lX1pMdE60bTiBiC77_vQ,2677
|
66
66
|
lino/core/user_types.py,sha256=0iSYmzr2M9v2Mn2y6hzAZeqareUT-gD7l3MfIPyG9ZI,867
|
67
67
|
lino/core/userprefs.py,sha256=cmufIS9xJErKDrw05uoWtQTUR6WRWIGkU1KdAqzNr5M,2850
|
@@ -185,7 +185,7 @@ lino/modlib/dupable/__init__.py,sha256=fIQ8wj-T8ZbkjwQgW_-ankJsHLjPMepOTo32mJXNC
|
|
185
185
|
lino/modlib/dupable/mixins.py,sha256=SZ2Exe5q3ANYsP7gnEXQuQczwCDKdRfFvOavreu4mYI,6324
|
186
186
|
lino/modlib/dupable/models.py,sha256=0watviKwTiVwlArC54V3IxVVfcB1Yg5kO6ed2xCM9a0,4595
|
187
187
|
lino/modlib/export_excel/__init__.py,sha256=HrsrhXjIMvMHRGu8whH3A_WijZWrH35p2cQsFXK60DY,356
|
188
|
-
lino/modlib/export_excel/models.py,sha256=
|
188
|
+
lino/modlib/export_excel/models.py,sha256=u9COKVdVsPwGk5WjgVarjLSkxmS-KOdohXfH4CruF_c,5353
|
189
189
|
lino/modlib/extjs/__init__.py,sha256=6UBWAWSROwy3DfTXQmVUVJTF6eZ_e2k3BEfE4wtqVhU,10172
|
190
190
|
lino/modlib/extjs/ext_renderer.py,sha256=1qEQ32fNDz6cXWgKTUc2qpfAjwrLjSRcWYk94A2odAo,60632
|
191
191
|
lino/modlib/extjs/views.py,sha256=CrX_tPshJtSkHT7raDDqn4B_XYamujRs-CgLzY4CBxg,26299
|
@@ -3534,7 +3534,7 @@ lino/modlib/languages/fixtures/iso-639-3_20100707.tab,sha256=u8PwI2s8shy0_Val5-s
|
|
3534
3534
|
lino/modlib/linod/__init__.py,sha256=efmj_Kz3OO2zF1lvs7P459iufYGimH1-6Ge6Cbq85tQ,2665
|
3535
3535
|
lino/modlib/linod/choicelists.py,sha256=Cu82s1QpcGFmKUXJsg-7TSqpaESBCZKOEfxzFlJP06I,2626
|
3536
3536
|
lino/modlib/linod/consumers.py,sha256=XBjA1fflJ-e9yWRMKXyQAhrOklYzs5JRhEeGMOKWFqM,6730
|
3537
|
-
lino/modlib/linod/mixins.py,sha256=
|
3537
|
+
lino/modlib/linod/mixins.py,sha256=QgwmQsrBqq0cicESP71Zkn5l0NjNxU2JCNU7W4Me3Vo,11741
|
3538
3538
|
lino/modlib/linod/models.py,sha256=Jj9N84793qsx5QmBrJ8LV2hiuqnaAKwQuAGiMF-t104,2372
|
3539
3539
|
lino/modlib/linod/routing.py,sha256=3pYJT6FbaVMj6rKkDVv3E5VTFFc9nglIDeo6dgAKu8Q,2399
|
3540
3540
|
lino/modlib/linod/utils.py,sha256=dE973Xib6Be1DvNsZ0M5wzY_jpkk35R21WKs-jQPorM,339
|
@@ -3628,7 +3628,7 @@ lino/modlib/smtpd/signals.py,sha256=GQNOcL7V1qGvp3panAI3Bpy56WO1q0sTho4IlgsoKHQ,
|
|
3628
3628
|
lino/modlib/smtpd/management/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3629
3629
|
lino/modlib/smtpd/management/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3630
3630
|
lino/modlib/smtpd/management/commands/recmail.py,sha256=_0co9uNx3Cq0zudrho-630yupuSCRM-Ilc5cIug3exE,1980
|
3631
|
-
lino/modlib/summaries/__init__.py,sha256=
|
3631
|
+
lino/modlib/summaries/__init__.py,sha256=IPoKcanVyKdWx2M1uSekQbsDUcdpw8yHmGKhiWtJIr0,538
|
3632
3632
|
lino/modlib/summaries/mixins.py,sha256=PYD2ITpHbiIAUnMeaAWa1xBfZtSwCHjBQhSoNA7nXpg,5880
|
3633
3633
|
lino/modlib/summaries/models.py,sha256=vx28VP6ApD9D9tgoemw6x2VTZZNLbMCfnRo75f4jjTw,2039
|
3634
3634
|
lino/modlib/summaries/fixtures/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -4635,8 +4635,8 @@ lino/utils/xml.py,sha256=EGDnO1UaREst9fS7KTESdbHnrrVCwKbRQdvut6B6GmQ,1612
|
|
4635
4635
|
lino/utils/mldbc/__init__.py,sha256=QqWRlzeXaOmFfbCk-vTY3SZMn1-FCf67XnpZdd_Nim0,1134
|
4636
4636
|
lino/utils/mldbc/fields.py,sha256=tAX8G5UKigr9c6g0F3ARIjZZtg406mdaZ--PWSbiH9E,2873
|
4637
4637
|
lino/utils/mldbc/mixins.py,sha256=CkYe5jDa7xp9fJq_V8zcZf8ocxgIjUgHc9KZccvA_Yw,1945
|
4638
|
-
lino-25.5.
|
4639
|
-
lino-25.5.
|
4640
|
-
lino-25.5.
|
4641
|
-
lino-25.5.
|
4642
|
-
lino-25.5.
|
4638
|
+
lino-25.5.2.dist-info/METADATA,sha256=QCzuY_QBYXwOBwIyQdOAn7d0SBJ0qjdypwt6wFly-bQ,42534
|
4639
|
+
lino-25.5.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
4640
|
+
lino-25.5.2.dist-info/licenses/AUTHORS.rst,sha256=8VEm_G4HOmYEa4oi1nVoKKsdo4JanekEJCefWd2E8vk,981
|
4641
|
+
lino-25.5.2.dist-info/licenses/COPYING,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
|
4642
|
+
lino-25.5.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|