Modify

Opened 5 years ago

Last modified 17 months ago

#13732 accepted enhancement

Enable TimingAndEstimationPlugin on Trac 1.4 - actually not a question

Reported by: a.gm@… Owned by: Ryan J Ollos
Priority: normal Component: TimingAndEstimationPlugin
Severity: normal Keywords: patch
Cc: Trac Release: 1.4

Description

I have tried to install almost all of the plugins for time tracking... but I am only interested on TimingAnEstimationPlugin, so i would like to make it run. Luckily I could.

Latest updates on trac-hacks seem this plugin not to be maintaned so far.

I could make it run too simple, as I am not fluent on Python.

Errors if you follow current installation steps:

  • Trac[loader] ERROR: Skipping "timingandestimationplugin = timingandestimationplugin": ImportError: No module named genshi.core
  • OperationalError: table wiki has no column named ipnr

Steps to have it running (for as an ignorant as me):

First error can be fixed installing genshi

  • >pip install genshi

Second error can be fixed modifying lines 196 and 197 of ./timingandestimationplugin/api.py

  • 196 remove 'ipnr,'
  • 197 remove '127.0.0.1,'
  1. install genshi pip install genshi
  2. download Zipped source for plugin for Trac 1.0 (it is the same link as on plugin's wiki)
  3. unzip on a folder an move to that folder
  4. Modify ./timingandestimationplugin/api.py
  5. build the source python setup.py build
  6. install the source python setup.py install
  7. upgrade track trac-admin YOUR_TRAC_PROJECT upgrade
  8. upgrade wiki trac-admin YOUR_TRAC_PROJECT wiki upgrade

Please, note that this is a quick&dirty turnaround, not THE solution.

Attachments (5)

timingandestimationplugin_branch10_patch_for_trac_142.patch (13.6 KB) - added by anonymous 4 years ago.
Patch for timingandestimationplugin (branch for trac 1.0) to fix runtime problems, plus remove filter_stream() and move filter operation to JavaScript, plus port billing template to Jinja. Seems to work; YMMV.
timingandestimationplugin_branch10_patch_for_trac_154.patch (25.0 KB) - added by anonymous 3 years ago.
Patches to run on 1.5.4
timingandestimationplugin_py3_trac154.patch (28.7 KB) - added by Dan 3 years ago.
Slightly updated patch with small differences from previous. Sorry, this patch is created from a lower level in the tree. This patch contains not just Trac version updates, but other updates I've been running my installation with. FYI it seems like it includes #13757 and #13321.
timingandestimationplugin_py3_trac162.patch (27.0 KB) - added by anonymous 7 months ago.
The patch mentioned in comment:11 (timingandestimationplugin_py3_trac154.patch) almost works for Trac 1.6.2, except that on the Management page when you attempt to "Set Billing Date" the following error is produced because of a missing CSRF token in the submitted form: "Missing or invalid form token. Do you have cookies enabled?" This can be fixed by adding the line ${jmacros.form_token_input()} to the trac1.0/timingandestimationplugin/templates/billing_jinja.html file. This is the resulting cumulative patch.
timingandestimationplugin_py3_trac162.2.patch (27.0 KB) - added by anonymous 7 months ago.
The patch mentioned in comment:11 (timingandestimationplugin_py3_trac154.patch) almost works for Trac 1.6.2, except that on the Management page when you attempt to "Set Billing Date" the following error is produced because of a missing CSRF token in the submitted form: "Missing or invalid form token. Do you have cookies enabled?" This can be fixed by adding the line ${jmacros.form_token_input()} to the trac1.0/timingandestimationplugin/templates/billing_jinja.html file. Another thing which needs to be fixed is the "Choose old billing date" select options under "Start date". This is the resulting cumulative patch.

Download all attachments as: .zip

Change History (19)

comment:1 Changed 5 years ago by a.gm@…

Oops, all reports related to TimingAndEstimationPlugin fail. This may be fixed modifying ./timingandestimationplugin/reports.py all rows containing description AS _description_ need to prepend t. so update rows:

  • 171
  • 259
  • 345
  • 432
  • 519
  • 605

to be seen as:

t.description AS _description_,                    -- ## Uses a full row

And again, please, note that this is a quick&dirty turnaround, not THE solution.

Last edited 4 years ago by Ryan J Ollos (previous) (diff)

Changed 4 years ago by anonymous

Patch for timingandestimationplugin (branch for trac 1.0) to fix runtime problems, plus remove filter_stream() and move filter operation to JavaScript, plus port billing template to Jinja. Seems to work; YMMV.

comment:2 Changed 4 years ago by Ryan J Ollos

Keywords: patch added

comment:3 Changed 4 years ago by anonymous

api.py needs quotes around the mysql 8.0.3 reserved word system in requests: `system`

comment:4 in reply to:  3 Changed 4 years ago by Ryan J Ollos

Replying to anonymous:

api.py needs quotes around the mysql 8.0.3 reserved word system in requests: `system`

If that's the case, for cross-db compatibility we can use db.quote('system'). Example: browser:tags/trac-1.4.2/trac/db/api.py@:432#L421.

comment:5 Changed 4 years ago by Cinc-th

@Russ Tyndall

If you are ok with it, I'll apply the attached patch and modify the plugin to work with recent Trac releases.

comment:6 Changed 3 years ago by anonymous

Hi Cinc-th, I for one would really appreciate if you apply the patch and help this plugin to work with recent Trac releases... esp py3 if possible.

Thanks for all your hard work on Trac and various plugins. It is appreciated!

Also, I suspect your @Russ Tyndall has to be @bobbysmith007 ?

Cheers!

comment:7 in reply to:  5 Changed 3 years ago by Ryan J Ollos

Replying to Cinc-th:

@Russ Tyndall

If you are ok with it, I'll apply the attached patch and modify the plugin to work with recent Trac releases.

If there is no reply from the plugin owner saying the plugin is still being maintained, we should go ahead and apply the patch. I'll wait a few more days to be sure.

comment:8 Changed 3 years ago by Ryan J Ollos

Owner: changed from Russ Tyndall to Ryan J Ollos
Status: newaccepted

comment:9 Changed 3 years ago by anonymous

Hi Cinc-th and Ryan J Ollos,

Do you know if the patch was ever applied?

Also, I would love to migrate to Trac 1.5. Do you think the only issue with the patched plugin working on 1.5 would be py3 issues? I am not familiar enough with the differences from 1.4 to 1.5 to know if other issues would be expected to crop up.

Thanks for all your hard work on trac!

Changed 3 years ago by anonymous

Patches to run on 1.5.4

comment:10 Changed 3 years ago by anonymous

I just updated this plugin recently. I suppose I should have checked the activity here first. I attached a patch of what I'm currently using.

I updated my installation to run on Python 3 with Trac 1.5.4. I also added a patch from a different ticket regarding the database handling.

I hope this helps. Maybe it's too late lol.

comment:11 Changed 3 years ago by figaro

Can you cross-reference the other ticket(s) you are referring to? That will help to do ticket triage.

Changed 3 years ago by Dan

Slightly updated patch with small differences from previous. Sorry, this patch is created from a lower level in the tree. This patch contains not just Trac version updates, but other updates I've been running my installation with. FYI it seems like it includes #13757 and #13321.

comment:12 Changed 3 years ago by Dan

I have updated my Trac plugins sporadically over the years. Sometimes when I start using a new plugin I apply all the patches that are still not applied that seem valid. That's why the patch is not just for compatibility, but includes the other patches as well. But it's probably been years since I applied them, so I don't even remember doing it.

comment:13 Changed 19 months ago by rosjat

Since i try to get this plugin working with 1.5.x i looked at the patch and implemented stuff i haven't done already and now i am at a point where the plugin gets loaded and seems to at least work partly.

Now I am at the point where I need7want to migrate the code from filter_stream into js but since I am not a javascript dude I have a hard time figuring where to put the code in the js files.

for example blackmagic.py has a few helper functions that should move to js according to the migration guide but do i make a seperate js file like blackmagic.js for it or do i put it in ticket.js since the code is related to the ticket part of the plugin ?

some pointers would be helpful here!

cheers

Markus

comment:14 Changed 17 months ago by anonymous

tried to get this running in a docker with Trac 1.4.2. It worked partially, but the administration interface reports a UTF-8 error, so it's not really usable. Is anyone still maintaining this plugin or is it dead?

Changed 7 months ago by anonymous

The patch mentioned in comment:11 (timingandestimationplugin_py3_trac154.patch) almost works for Trac 1.6.2, except that on the Management page when you attempt to "Set Billing Date" the following error is produced because of a missing CSRF token in the submitted form: "Missing or invalid form token. Do you have cookies enabled?" This can be fixed by adding the line ${jmacros.form_token_input()} to the trac1.0/timingandestimationplugin/templates/billing_jinja.html file. This is the resulting cumulative patch.

Changed 7 months ago by anonymous

The patch mentioned in comment:11 (timingandestimationplugin_py3_trac154.patch) almost works for Trac 1.6.2, except that on the Management page when you attempt to "Set Billing Date" the following error is produced because of a missing CSRF token in the submitted form: "Missing or invalid form token. Do you have cookies enabled?" This can be fixed by adding the line ${jmacros.form_token_input()} to the trac1.0/timingandestimationplugin/templates/billing_jinja.html file. Another thing which needs to be fixed is the "Choose old billing date" select options under "Start date". This is the resulting cumulative patch.

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.