Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6006989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:37:04+00:00 2026-05-23T01:37:04+00:00

I’ve been given the task to write a plugin for Trac. It should provide

  • 0

I’ve been given the task to write a plugin for Trac.
It should provide burndown data for the ticketcount and estimations filed in the issue tracking system.
The user writes his request as a wikimacro and is provided a link/ button for downloading the burndown as a csv-file, output as a chart is also planned, but has lower priority.

I’ve got a working solution for processing the data but I’m left with the following problem.

My Question

How can I provide a downloadlink/- button on the Wikipage for a file which is dynamically created by the users request?

I’ve seen some attempts to send files in the trac source itself and other plugins, but since I’m new to web programming that doesn’t really help.

Update1
I’ve been trying to solve the problem the way Felix suggested, which opened up a new problem for me.
This (stupid) example should demonstrate my problem.
My Macro generates the following URL and adds it as a link to the wikipage.

//http://servername.com/projectname/wiki/page_name?teddy=bear    

But the RequestHandler doesn’t react, even if the condition returns true.
Edit: This piece of code now shows the working version for the example.

New URL:

#example url
#http://127.0.0.1:8000/prove/files/new

class CustomRequestHandlerModule(Component):
    implements(IRequestHandler)

    def match_request(self,req):
        #old, not working
        #return "teddy=bear"== str(req.path_info).split('?')[1]
        #new
        accept="/files/new"== str(req.path_info)
        return accept

    def process_request(self,req):
        csvfile = self.create_csv()
        req.send_response(200)
        req.send_header('Content-Type', 'text/csv')
        req.send_header('Content-length', len(csvfile))
        req.send_header('Content-Disposition','filename=lala.csv')
        req.end_headers()
        req.write(csvfile)
        raise RequestDone     

Update2
Inserting loggingstatements shows match_request never gets called.

What am I doing wrong? (Yes, the create_csv() exists already)

Update 3 Thx, for helping =)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T01:37:05+00:00Added an answer on May 23, 2026 at 1:37 am

    If match_request isn’t getting called, then process_request never has a chance to execute. Assuming that there’s nothing wrong with your plugin that’s preventing Trac from loading it correctly, what’s probably happening is that another handler is matching the URL before your version of match_request gets called. Try increasing your log level to “Debug” and see if it provides enough information to tell who is processing that request.

    Another option is to create a custom “namespace” for your auto-generated files. Try replacing ‘wiki’ in the generated URLs with something like ‘files’. This should prevent any of the built-in handlers from handling the request before your plugin’s match_request method gets called.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have some data like this: 1 2 3 4 5 9 2 6
I'm looking for suggestions for debugging... If you view this site in Firefox or
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
That's pretty much it. I'm using Nokogiri to scrape a web page what has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.