#12048 closed defect (fixed)
Add support for Trac 1.1.3dev to the VotePlugin
Reported by: | Christian Boos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Component: | VotePlugin |
Severity: | normal | Keywords: | |
Cc: | Steffen Hoffmann | Trac Release: |
Description
While upgrading t.e.o to 1.1.3dev, I hit a few incompatibilities due to the removal of backward compatibility code (#T11494).
Here's a refresh of the plugin code (trunk).
Attachments (1)
Change History (12)
Changed 10 years ago by
Attachment: | voteplugin-trunk-r13209.diff added |
---|
comment:2 follow-up: 4 Changed 10 years ago by
comment:3 follow-up: 5 Changed 10 years ago by
-
tracvote/__init__.py
676 658 """Return a tuple of (body_text, title_text) describing the votes on a 677 659 resource. 678 660 """ 679 negative, total, positive = resource and\680 self.get_vote_counts(resource) or(0,0,0)661 negative, total, positive = self.get_vote_counts(resource) if resource \ 662 else (0,0,0) 681 663 count_detail = ['%+i' % i for i in (positive, negative) if i] 682 664 if count_detail: 683 665 count_detail = ' (%s)' % ', '.join(count_detail) 684 666 else: 685 667 count_detail = '' 686 return ('%+i' % total, 'V otecount%s' % count_detail)668 return ('%+i' % total, 'VOTE2 count%s' % count_detail) 687 669 688 670 def _get_tables(self, dburi, cursor): 689 671 """Code from TracMigratePlugin by Jun Omae (see tracmigrate.admin)."""
Please explain the second change in this last chunk for __init__.py
. Anything else looks clear to me so far.
comment:4 Changed 10 years ago by
Replying to cboos:
Thanks for the pointer... looks like I completely overlooked that. However my patch is in the trunk style only while Jun's is probably more compatible across Trac versions (0.12.x -> 1.1.x?). I'd suggest branching a 1.0 version for #11948 and have mine on trunk.
But it's up to @hasienda...
Jun really made elaborated attempts on maintaining 0.11 backwards-compatibility based on the 0.12 Trac db API, and not only for this plugin.
I did favor this notion for a long time myself. But I do not feel, that
- I'm up for the task of maintaining 0.11 backwards-compatibility any longer
- its still worth to keep 0.11, effectively reducing pressure to upgrade
- its sensible in terms of maintenance effort to do an intermediate step instead of moving forwards to current (1.0) Trac db API right-away
So while I do highly appreciate that contribution, I'll only apply changes from #11948 for a last, tagged plugin release dedicated to 0.11. That strategy fits with recent conclusions for Trac core development, that declared 0.11
dead maintenance-wise.
An immediate move of trunk
right up to 1.0 for tracvotes-0.3
using your contribution should follow. Neither is 0.12
worth adopting that late - while we're already heading for Trac 1.2, nor do I have skills and time to maintain that intermediate db API version, that is, now depreciated as well. So IMHO this is the only way of keeping maintenance effort at a reasonable level for the future.
comment:5 follow-up: 6 Changed 10 years ago by
Replying to hasienda:
- return ('%+i' % total, 'Vote count%s' % count_detail) + return ('%+i' % total, 'VOTE2 count%s' % count_detail)Please explain the second change in this last chunk for
__init__.py
. Anything else looks clear to me so far.
Oops, "debugging" changes I forgot to remove...
comment:6 Changed 10 years ago by
Replying to cboos:
Replying to hasienda:
Please explain the second change in this last chunk for
__init__.py
. Anything else looks clear to me so far.Oops, "debugging" changes I forgot to remove...
I see, so will clear that before applying.
Just another thought: Do you see a reason to prefer the threefold query on votes
table (total, positive and negative count) over calculating vote count total as sum of the other two? If that calculation would be sufficient, removing the corresponding db query would be one of the next improvements on trunk
for tracvote-0.3dev
.
comment:7 Changed 10 years ago by
The patch looks good to me. As for supporting Trac 0.11, I really don't feel it is worth our collective valuable and limited time. The final maintenance release was almost 5 years ago, and it was declared dead maintenance-wise around that time. I vote for just applying this patch so that we can get VotePlugin reinstalled on t-h.o.
comment:9 Changed 10 years ago by
I branched the trunk to voteplugin/branches/0.11 so we could release a version compatible with Trac 0.11 without holding up progress on the version compatible with Trac 1.0 and later. I'm eager to move forward with a Trac 1.0+ compatible version since we are moving towards the release of Trac 1.2, likely within the next 6 months.
removal of get_db_cnx mainly