Modify

Opened 14 years ago

Closed 7 years ago

#8653 closed defect (fixed)

Backlog Plugin stop trac from functioning

Reported by: anonymous Owned by: Ryan J Ollos
Priority: normal Component: BacklogPlugin
Severity: normal Keywords:
Cc: Anna Nachesa Trac Release: 0.12

Description (last modified by Ryan J Ollos)

Hello Bart,

First ty for making this plugin I really look forward to getting it working.

Please note this is trac 0.12

I initially downloaded this zipped plugin extracted and attempted to install.

this yielded:

easy_install 0.11         
Processing 0.11
Running setup.py -q bdist_egg --dist-dir /root/backlogplugin/0.11/egg-dist-tmp-1Co9jy
  File "build/bdist.linux-x86_64/egg/backlog/model.py", line 158
    (ordered_tickets if ticket['tkt_order'] is not None else unordered_tickets).append(ticket)
                      ^
SyntaxError: invalid syntax
Adding BacklogPlugin 0.1.33 to easy-install.pth file

Installed /usr/lib/python2.4/site-packages/BacklogPlugin-0.1.33-py2.4.egg
Processing dependencies for BacklogPlugin==0.1.33
Finished processing dependencies for BacklogPlugin==0.1.33

So I broke out the compound if statement via:

            if ticket['tkt_order'] is not None:
                ordered_tickets.append(ticket)
            else:
                unordered_tickets.append(ticket)

This allowed it to build:

easy_install 0.11
Processing 0.11
Running setup.py -q bdist_egg --dist-dir /root/backlogplugin/0.11/egg-dist-tmp-j1xkIT
BacklogPlugin 0.1.33 is already the active version in easy-install.pth

Installed /usr/lib/python2.4/site-packages/BacklogPlugin-0.1.33-py2.4.egg
Processing dependencies for BacklogPlugin==0.1.33
Finished processing dependencies for BacklogPlugin==0.1.33

Upon enabling the plugin though trac is not happy with the stack trace below:

Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 511, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 237, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/lib/python2.4/site-packages/trac/admin/web_ui.py", line 80, in process_request
    panels, providers = self._get_panels(req)
  File "/usr/lib/python2.4/site-packages/trac/admin/web_ui.py", line 163, in _get_panels
    p = list(provider.get_admin_panels(req) or [])
  File "/usr/lib/python2.4/site-packages/trac/ticket/admin.py", line 45, in get_admin_panels
    if 'TICKET_ADMIN' in req.perm:
  File "/usr/lib/python2.4/site-packages/trac/perm.py", line 553, in has_permission
    return self._has_permission(action, resource)
  File "/usr/lib/python2.4/site-packages/trac/perm.py", line 566, in _has_permission
    decision = PermissionSystem(self.env). \
  File "/usr/lib/python2.4/site-packages/trac/perm.py", line 454, in check_permission
    perm)
  File "/usr/lib/python2.4/site-packages/trac/perm.py", line 285, in check_permission
    permissions = PermissionSystem(self.env). \
  File "/usr/lib/python2.4/site-packages/trac/perm.py", line 359, in get_user_permissions
    actions += list(requestor.get_permission_actions() or [])
  File "/usr/lib/python2.4/site-packages/trac/perm.py", line 476, in get_permission_actions
    for action in requestor.get_permission_actions() or []:
  File "build/bdist.linux-x86_64/egg/backlog/web_ui.py", line 258, in get_permission_actions
  File "build/bdist.linux-x86_64/egg/backlog/model.py", line 278, in __init__
AttributeError: 'BacklogList' object has no attribute 'env'

Please advise as I would totally love to try this out and provide feedback.

Thanks again,

Jesse

Attachments (0)

Change History (14)

comment:1 Changed 14 years ago by anonymous

I'm seeing the same thing. Did the same thing you did to get past the compile error and now have the env error. I assume this works elsewhere and it doesn't appear to be a python or trac version error since the env appears to be an attribute of self (BacklogList object) in this case. So, does anyone know if everything is zipped up that is supposed to be. I would really like to use this module for burn down. BTW, I'm running with Python 2.4.3 and Trac 0.12.2 right now on a CentOS5 machine.

Thank-you, Respectfully, Wes Brown/SCCM/SQA.

comment:2 Changed 14 years ago by anonymous

OK. So I fixed the self.env problem by adding self.env = env to the BackLogError class __init__ method. Now, I get the following error:

TimeoutError: Unable to get database connection within 0 seconds. (<trac.core.TracError instance at 0x8fb9d8c>)

This only appears when I try to open the BackLog tab. The Management Tab works OK now as do the other tabs. Will keep working this until I get this working or someone beats me to it. :)

Wes Brown.

comment:3 Changed 13 years ago by anonymous

OK, so everyone doesn't have to go through what I went through, here's the deal if you're using 0.12.2. I had to add the divide by 1000000 to the backlog.html page where the statement using the date from the ticket. This is because of the higher resolution time stamps given to tickets in 0.12.2. So, be aware. Here is the line of code I changed:

<td style="width: 60px;">${str(datetime.now() - datetime.fromtimestamp(ticket.time/1000000)).split(',')[0].split('.')[0]}</td>

This line occurs twice in the html template file so make sure you change it in both places. Also, make sure you change the permissions back to apache:apache if your using apache to run your Trac server. Otherwise, you'll get the error regarding the database access denied problem. I've also hacked quite a few of the other plugins and macros so they'd work with 0.12.2 as well as meet our specific needs where I'm working.

comment:4 Changed 13 years ago by Ryan J Ollos

Description: modified (diff)

comment:5 Changed 12 years ago by Ryan J Ollos

Cc: Anna Nachesa added; anonymous removed

comment:6 Changed 12 years ago by Ryan J Ollos

(In [11996]) Refs #8653, #10326 (0.1.34) Numerous fixes for compatibility with Trac 0.12 and 1.0:

  • Fix for possible cannot operate on closed cursor error. The db object could be cleaned up before the cursor is used in the try/catch. This does not seem to happen if the db object is passed as a parameter though, so the _create_ordering_table function was changed from a private member function of the BacklogModule class, to a private function of the web_ui module.
  • Assignments were made to the following variables for no apparent reason, as they were not being used: data['req'] and data['args']. The assignment data['req'] was causing problems as it was overwriting the req object in the template space, leading to a traceback, but only under Trac 1.0 (/ticket/10326#comment:2).
  • The unique attribute of a Column was removed in Trac 0.12, and a traceback was resulting from its use (/ticket/10326#comment:1). The attribute actually had no effect in Trac 0.11 anyway ([t 9406/trunk/trac/db/schema.py]).
  • The env member variable of the BacklogListclass was being used, but was never assigned, resulting in a traceback (/ticket/8653#comment:2).

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

Replying to anonymous:

I've also hacked quite a few of the other plugins and macros so they'd work with 0.12.2 as well as meet our specific needs where I'm working.

If you open tickets for those other plugins, I will make sure the changes get pushed to the repository. Thanks.

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

Replying to anonymous:

Also, make sure you change the permissions back to apache:apache if your using apache to run your Trac server. Otherwise, you'll get the error regarding the database access denied problem.

Was the issue described in comment:2 due to this permissions problem?

comment:9 Changed 12 years ago by Ryan J Ollos

Assuming no feedback is received that leads to other action items in this ticket, just two issues remain to be dealt with:

  • Second Timestamp (< 0.12) vs Microsecond Timestamp (0.12+) differences.
  • Python 2.4 compatibility changes.

comment:10 Changed 12 years ago by Ryan J Ollos

Owner: changed from Bart Ogryczak to Ryan J Ollos
Status: newassigned

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

Replying to anonymous:

OK, so everyone doesn't have to go through what I went through, here's the deal if you're using 0.12.2. I had to add the divide by 1000000 to the backlog.html page where the statement using the date from the ticket. This is because of the higher resolution time stamps given to tickets in 0.12.2.

The dedicated ticket for this issue is #10330.

comment:12 Changed 12 years ago by Ryan J Ollos

(In [12039]) Refs #8653: Restored Python 2.4 compatibility by reverting use of the conditional expression syntax, as defined in PEP 308 and added in Python 2.5.

comment:13 Changed 12 years ago by Ryan J Ollos

Status: assignednew

comment:14 Changed 7 years ago by Ryan J Ollos

Resolution: fixed
Status: newclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.