Am Samstag, 29. Juni 2013 00:32:13 UTC+2 schrieb Steffen Hoffmann:
>
> -----BEGIN PGP SIGNED MESSAGE----- 
> Hash: SHA1 
>
> On 28.06.2013 11:20, ini wrote: 
> > Am Dienstag, 25. Juni 2013 22:42:34 UTC+2 schrieb Steffen Hoffmann: 
> > ...
>
> On 25.06.2013 08:45, ini wrote: 
> > Am Montag, 24. Juni 2013 20:51:45 UTC+2 schrieb Steffen Hoffmann: 
> >> If you mention different files here, ITemplateProvider might not be 
> >> implemented in the same class as the request handler, but exactly this 
> >> must be done, you see? 
> > 
> > I implement the ITemplateProvider only in the first (main.py) file, in 
> > the tracdeveloperplugin it is also implemented only in the main.py. Now 
> > i implement it also in the second (designflow.py) file but it is still 
> > not working. 
>
> Hm, you'll have to learn about the difference of classes vs. modules. 
> What I wanted to tell is, that ITemplateProvider must be implemented by 
> the same class, that wants to serve static content, like an 
> IRequestHandler [1]. 
>

Thanks a lot for your reply and attempt to help me. 
But I think exectly this i've done, i implement the ITemplateProvider in 
both classes/files (each file have only one class until now).
And the first step (push the button in the mainnav) is working, then from 
this site i can choose between the two links 
 * <li><a href="${href.support('designflow')}">Design Flow Support</a></li>*and 
this is not working!
Here the designflow.py file which should handle this request:
class DesignFlowModule(Component):
    implements(IRequestHandler, ITemplateProvider)

    # IRequestHandler methods
    def match_request(self, req):
        return re.match(r'/support/designpppppflow/?$', req.path_info) # 
not even "no handler match request to /designflow" is appearing in trac (i 
tried with r'/support/designpppppflow/?$ and r'/support/designflow/?$ to 
test it)

    def process_request(self, req):
        data = {}
        add_stylesheet(req, 'ht/css/designflow.css')
        return 'designflow.html', data, None
 
    # ITemplateProvider methods
    def get_templates_dirs(self):
        from pkg_resources import resource_filename
        return [resource_filename(__name__, 'templates')]
    
    def get_htdocs_dirs(self):
        from pkg_resources import resource_filename
        return [('ht', resource_filename(__name__, 'htdocs'))]

Do you have an another idea why its not working like intend?


> I'm a beginner in python and trac as well. The next days i will try to 
> > figure out how to implement this statements, then hopefully i can say 
> > more about my problem or maybe solve it finally. 
> > Can you recommend me an another plugin which i can refer to as a help? 
>
> Sure, there are a lot, as the PluginDevelopment wiki page [1] mentioned 
> before points out. Well, for a not too complicated example you could 
> look at CcSelectorPlugin [2]. Cautiously reading existing code not 
> taking everything for perfect at first sight you'll be able to learn a 
> lot. 
>

Thank you for the hint. But i'm looking for an example similar to this one:
http://trac-hacks.org/browser/tracdeveloperplugin/trunk/tracdeveloper



> Steffen Hoffmann 
>
>
> [1] 
>
> http://trac.edgewall.org/wiki/TracDev/PluginDevelopment/ExtensionPoints/trac.web.api.IRequestHandler
>  
> [2] 
>
> https://trac-hacks.org/browser/ccselectorplugin/trunk/cc_selector/cc_selector.py
>  
> -----BEGIN PGP SIGNATURE----- 
> Version: GnuPG v1.4.10 (GNU/Linux) 
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ 
>
> iEYEARECAAYFAlHODukACgkQ31DJeiZFuHfkLwCgoQhP39CPNLstftD4qpoTvSO3 
> zPkAnRKIuX06OuPdh0p9YYq/fdW7eoDa 
> =yTYf 
> -----END PGP SIGNATURE----- 
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/trac-dev.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to