I'd have to ask Jonas, but I personally don't see a problem in making
that public. If he agrees (as I believe the whole thing was his work),
I'll make a CookBook page out of that.
-- Christian
I think a lot of people (like me too) like the possibility to
set up a trac "like what I am used to see at t.e.o".
Anton
Any news on this?
Thanks for the reminder, I'll start this when time permits and follow-up
here when it's done (in 1-2 weeks from now).
-- Christian
-- Christian
--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-...@googlegroups.com.
To unsubscribe from this group, send email to trac-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en.
Hi All, I would like to understand the TRAC source code. But I found it is very difficult to understand source code structure. For instance, I could not find the main.py code. Does anyone can guide me how to find the main file, and read all source codes from there? Thanks, Luie |
(mattc@E2-06L) ~/workspace/code/trac (master)$ find . -name main.py
./trac/web/main.py
./trac/versioncontrol/web_ui/main.py
I'd expect that trac/web/main.py is the one you seek.
> and read all source codes from there?
In the main.py file, I see the following import directives related to trac:
from trac import __version__ as TRAC_VERSION
from trac.config import ExtensionOption, Option, OrderedExtensionsOption
from trac.core import *
from trac.env import open_environment
from trac.perm import PermissionCache, PermissionError, PermissionSystem
from trac.resource import ResourceNotFound
from trac.util import get_lines_from_file, get_last_traceback,
hex_entropy, \
arity
from trac.util.compat import partial, reversed
from trac.util.datefmt import format_datetime, http_date, localtz, timezone
from trac.util.text import exception_to_unicode, shorten_line, to_unicode
from trac.util.translation import _
from trac.web.api import *
from trac.web.chrome import Chrome
from trac.web.clearsilver import HDFWrapper
from trac.web.href import Href
from trac.web.session import Session
So, for example, trac.config.py is in trac/config.py.
--
Matthew Caron
Build Engineer
Sixnet | www.sixnet.com
O +1 518 877 5173 Ext. 138
F +1 518 602 9209
matt....@sixnet.com
What is it exactly that you wanna know ?
--
Regards,
Olemis.
Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/
Featured article:
I read this file and imported files. But I only see class and function define. Not seeing any place called functions. Don't know how the code works.
Thanks,
Steven
________________________________________
From: trac-...@googlegroups.com [trac-...@googlegroups.com] On Behalf Of Matthew Caron [Matt....@sixnet.com]
Sent: Friday, August 27, 2010 11:56 AM
To: trac-...@googlegroups.com
Cc: Luie Xia
Subject: Re: [Trac] How to find TRAC source code structure?
--
I would like to understand the source code flow, and possibly hack the code a bit when needed in my machine. I am new to Python.
Thanks,
Steven
________________________________________
From: trac-...@googlegroups.com [trac-...@googlegroups.com] On Behalf Of Olemis Lang [ole...@gmail.com]
Sent: Friday, August 27, 2010 12:13 PM
To: trac-...@googlegroups.com
Subject: Re: [Trac] How to find TRAC source code structure?
On Fri, Aug 27, 2010 at 1:06 PM, Lu, Steven (Steven)
--
Regards,
Olemis.
Featured article:
--
:o)
> I would like to understand the source code flow, and possibly hack the code a bit when needed in my machine.
My recommendation is to learn about how to write plugins . That's the
way you should start subverting the system . If you really wanna learn
Trac internals beware of the fact that there are a lot of things in
there beyond mere web (e.g. Version Control API, MIME subsystem,
Workflow web , templates, filters , ...) . I've been developing Trac
plugins since some years ago and I still don't know how everything
works , I just have a barely minimal understanding of the things I
care about ... Besides plugins add a whole new bunch of functionality
that eventually may be merged with Trac or you might want to try out .
That's why I'd suggest you to start trying to do something concrete
and research how to do it ... eventually you'll learn
;o)
BTW , everything starts with trac.web.main.RequestDispatcher.dispatch
(take a look at the deploy scripts `trac-admin /path/to/env deploy`
;o)
> I am new to Python.
Ok, ask specific questions about something you want to do and somebody
will answer . ;o)
Ha! Another important class is trac.web.api.Request. When I started,
it was tricky because of its lazy instantiation mechanism (e.g.
Request.callbacks) for instance , Request.chrome is not defined
anywhere in the source code. Inside
trac.web.main.RequestDispatcher.dispatch you'll be able to see that it
is really «bound» to trac.web.chrome.Chrome.prepare_chrome_data , and
so on ...
On Sat, Jul 24, 2010 at 11:59 AM, Christian Boos <cb...@neuf.fr> wrote:
Thanks for the reminder, I'll start this when time permits and follow-up here when it's done (in 1-2 weeks from now).On 7/24/2010 10:49 AM, Itamar O wrote:
On 6/26/10, Christian Boos<cb...@neuf.fr> wrote:
On 6/26/2010 12:16 PM, Itamar O wrote:Any news on this?
Hi all,I'd have to ask Jonas, but I personally don't see a problem in making
(snip)
that public. If he agrees (as I believe the whole thing was his work),
I'll make a CookBook page out of that.
-- Christian
-- Christian
I don't want to be a pain, and I'm sure you're busy with other stuff, but - any news? :-)