Modify

Opened 8 months ago

Last modified 8 months ago

#14132 accepted enhancement

Patch to allow WikiCalendarMacro to work with Trac 1.6, plus other stuff

Reported by: Dan Owned by: Ryan J Ollos
Priority: normal Component: WikiCalendarMacro
Severity: normal Keywords: patch
Cc: Trac Release:

Description

I'm attaching a patch to allow running with Trac 1.5.4

Beware that some changes are related to #13847, for which I never got back to Ryan. (sorry) Therefore, this patch includes the infamous daystr=('..').join, which didn't work for him.

I also noticed this year that the month when daylight savings time happened, the days were shifted on the calendar. For example, Tuesday items appeared under Wednesday. So I modified it to make some of the calculations use noon instead of midnight, which solved the problem. I'll admit it's not exactly pretty, but it worked.

I also incidentally used this plugin on a test system with Babel installed, which I don't usually use. That also caused a problem with shifting days on the calendar, and I noticed that the Babel weekday list was probably ordered differently than the code assumed. So there is one line in a conditional that seemed to fix that problem as well.

Now that I'm using WSL, I think I understand what you're asking for regarding the locale. I'm using Ubuntu 22.4LTS as my test for Python 3 and Trac 1.5.4.

LANG=C.UTF-8
LANGUAGE=
LC_CTYPE="C.UTF-8"
LC_NUMERIC="C.UTF-8"
LC_TIME="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8"
LC_PAPER="C.UTF-8"
LC_NAME="C.UTF-8"
LC_ADDRESS="C.UTF-8"
LC_TELEPHONE="C.UTF-8"
LC_MEASUREMENT="C.UTF-8"
LC_IDENTIFICATION="C.UTF-8"
LC_ALL=

I will also attach a Python 3 update to Blog.py that I use in conjunction with this macro.

Attachments (2)

wikicalendarmacro_py3_trac154_and_dst_and_babel_fixes.patch (3.5 KB) - added by Dan 8 months ago.
Patch with various updates, including Python 3.
Blog.py (6.0 KB) - added by Dan 8 months ago.
Blog macro that works in conjunction with the calendar macro.

Download all attachments as: .zip

Change History (3)

Changed 8 months ago by Dan

Patch with various updates, including Python 3.

Changed 8 months ago by Dan

Attachment: Blog.py added

Blog macro that works in conjunction with the calendar macro.

comment:1 Changed 8 months ago by Ryan J Ollos

Owner: set to Ryan J Ollos
Status: newaccepted

Modify Ticket

Change Properties
Set your email in Preferences
Action
as accepted The owner will remain Ryan J Ollos.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.