Team Chat Logs

April 12, 2010

2010 3
Mo Tu We Th Fr Sa Su
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    

[02:58:36.027991]<pfote>is this a good place to ask trac/bitten questions? in #bitten are very few ppl
[03:00:18.525571]<osimons>pfote: if it is a bitten question, use bitten channel - at least the ones that are there are bitten users, unlike most here.
[03:06:02.495420]<pfote>k
[03:43:00.374991]<macmaN>hows everything osimons
[05:23:44.063476]<marcus_>hi all, I am trying to use a macro which requests ATTACHMENT_VIEW permissions but these does not seem to be available on our system.
[05:25:04.338515]<thijstriemstra>hi, my apache log is showing this error, any idea where it comes from?
[05:25:08.116619]<thijstriemstra>[Mon Apr 12 11:23:28 2010] [error] Exception AttributeError: "'SubversionRepository' object has no attribute 'pool'" in <bound method SubversionRepository.__del__ of <trac.versioncontrol.svn_fs.SubversionRepository object at 0x7f450d62be50>> ignored
[05:25:15.859314]<marcus_>trac-admin projects/myproject permission add myaccount ATTACHMENT_VIEW : Command failed: ATTACHMENT_VIEW is not a valid action.
[05:25:38.299938]<thijstriemstra>trac 0.11.7 with svn 1.6.9
[07:31:51.769283]<_dave_h_d_>hi guys, not so good with trac report but trying to create a nice one so far i am here:http://pastebin.com/ASvjUYah
[07:32:34.562212]<_dave_h_d_>no what i want is to to have the openned and closed tickets in groups for each release
[07:32:39.926146]<_dave_h_d_>can someone help please
[07:33:15.091080]<cmc>_dave_h_d_ is a "release" a milestone or a version?
[07:33:32.283012]<_dave_h_d_>version
[07:33:36.379370]<_dave_h_d_>sorry cmc
[07:33:47.598875]<kirean>_dave_h_d_: this might be helpful? http://trac.edgewall.org/wiki/TracReports#Customformattingcolumns
[07:34:28.468691]<_dave_h_d_>also i wish to have the version release date in the headers
[07:34:54.580948]<kirean>_dave_h_d_: doh, I didn't look the sql, never mind me
[07:35:57.606727]<_dave_h_d_>basically i need grouped by release and then each release grouped by openned and closed and then the ones not in a release at the bottom if possible
[07:36:06.901269]<cmc>_dave_h_d_: the version's release date is stored in the version table
[07:36:20.876602]<_dave_h_d_>cool
[07:36:27.493962]<cmc>so you can: "LEFT JOIN version ON (version.name = ticket.version)"
[07:37:12.578892]<cmc>I'm not sure if you can group by two things, though you could group by the string "$version - $status' if that makes sense?
[07:39:41.931482]<_dave_h_d_>cmc
[07:39:52.000336]<cmc>that's me
[07:40:04.393878]<_dave_h_d_>can you add an example to my pastebin?
[07:40:17.265496]<_dave_h_d_>http://pastebin.com/ASvjUYah?
[07:40:20.571720]<_dave_h_d_>http://pastebin.com/ASvjUYah
[07:40:25.676412]<cmc>yeah one moment
[07:40:30.768498]<_dave_h_d_>thanks
[07:45:02.690595]<cmc>http://pastebin.com/pVU9Prnj
[07:45:15.846521]<_dave_h_d_>anyone know where released column for version is?
[07:45:18.492963]<_dave_h_d_>in version?
[07:45:22.388366]<cmc>time
[07:46:53.541165]<_dave_h_d_>thanks cmc
[07:46:55.748002]<_dave_h_d_>i got Report execution failed: near "'epoch'": syntax erro
[07:47:07.975418]<cmc>you're not using postgres
[07:47:13.380241]<cmc>which db are you using
[07:47:36.479138]<_dave_h_d_>hmm
[07:47:55.684647]<cmc>sqlite?
[07:48:00.536076]<_dave_h_d_>yes
[07:48:09.363323]<_dave_h_d_>not sure which version though
[07:48:18.437958]<cmc>that's fine, one moment
[07:48:43.404811]<_dave_h_d_>cool
[07:49:18.582014]<cmc>anyone remember the sqlite method for converting unix time to dates?
[07:49:54.754183]<_dave_h_d_>date?
[07:50:07.782803]<cmc>ah, and datetime
[07:50:12.904338]<cmc>yes, use that
[07:50:26.923269]<_dave_h_d_>strftime('%Y-%m-%d', ...)
[07:51:00.451203]<_dave_h_d_>how do i use it?
[07:51:05.010026]<_dave_h_d_>or rather where
[07:51:35.824227]<cmc>try datetime(v.time, 'unixepoch') or datetime(v.time, 'unixepoch', 'localtime')
[07:51:53.336412]<cmc>on the line right after the -- comment
[07:58:22.038870]<_dave_h_d_>cool
[07:58:27.269892]<_dave_h_d_>i think it might be working :-)
[07:58:30.819063]<_dave_h_d_>thank you so much
[07:58:43.549563]<_dave_h_d_>but will probably ask you some more dumb questions meanwhile
[08:18:24.353011]<cmc>:) no problem, glad it's working
[08:28:09.944700]<_dave_h_d_>silly question, what makes a ticket new and what makes it assigned?
[08:28:48.682500]<_dave_h_d_>sorry i got it
[08:29:21.540552]<_dave_h_d_>or actually not
[08:29:38.930187]<kirean>_dave_h_d_: it depends on your workflow
[08:36:36.976772]<_dave_h_d_>kirean: please explain if you don't mind
[08:38:06.118891]<kirean>_dave_h_d_: look at http://trac.edgewall.org/wiki/TracWorkflow
[08:46:47.323054]<_dave_h_d_>kirean: they become assigned when someone accepts them
[08:47:05.621670]<_dave_h_d_>i suppose i can change that right
[08:47:15.660427]<_dave_h_d_>so when someone assigns them the are assigned
[09:19:03.875520]<_dave_h_d_>in trac how do i make sure there is no new status but only assigned
[09:19:11.558602]<_dave_h_d_>so the user does not have to accept it
[09:19:22.494230]<_dave_h_d_>ticket for it to be assigned
[09:19:25.172227]<_dave_h_d_>cheers
[09:36:58.392833]<cmc>use one of the plugin to make the user a required field
[09:37:17.178367]<cmc>then change the workflow so that the first step is "assigned" rather than new
[11:16:53.000091]<cboos>mitsuhiko: howdy, stupid question, what's the LodgeIt license? I'm about to steal a few things from your Makefile, wanted to check if that was OK ;-)
[11:17:26.653333]<mitsuhiko>cboos: three clause bsd
[11:18:05.879536]<cboos>modified BSD you mean?
[11:18:16.175289]<cboos>i.e. same as Trac?
[11:19:50.946425]<cboos>ah yes, same as trac, didn't even know there were 2 modified BSD licenses ...
[11:21:19.333604]<cboos>mitsuhiko: that easy question was actually a trap to get your attention ;-) I've played a bit with Jinja2 today, I like it.
[11:21:44.563862]<mitsuhiko>haha :D
[11:21:49.459590]<cboos>You have the Markup class, but you don't have anything like the genshi.builder it seems.
[11:21:58.085368]<mitsuhiko>to generate html?
[11:22:00.587068]<mitsuhiko>nope
[11:22:02.323981]<cboos>yes
[11:22:08.033813]<mitsuhiko>there is something in werkzeug you can steal
[11:22:23.790034]<cboos>Do you think it's worth implementing / stealing from Genshi, or we could do away with simply using string templates in the code?
[11:22:42.205515]<mitsuhiko>cboos: i love having tons of small templates around :)
[11:22:45.806778]<mitsuhiko>in actual separate files
[11:23:15.982978]<mitsuhiko>but it always depends on what you want to do
[11:23:45.866164]<cboos>things like content generation from macros, e.g.
[11:24:09.508667]<cboos>http://trac.edgewall.org/browser/trunk/trac/wiki/macros.py#L242
[11:24:28.622565]<cboos>(that file has plenty other examples)
[11:25:34.093604]<cboos>they could have been written as short genshi templates as well, but I didn't like the overhead and preferred to keep the template and the code close together
[11:27:19.063674]<cboos>hello Remy!
[11:27:29.266186]<rblank>cboos: Helloü
[11:27:36.763050]<rblank>s/ü/!/
[11:27:36.808517]<evil_twin>rblank meant: cboos: Hello!
[11:27:40.108661]<mitsuhiko>cboos: i personally would implement them as macros in separate templates
[11:27:55.563504]<rblank>Let me guess: talking Jinja2? :)
[11:28:01.810575]<cboos>yep ;-)
[11:28:01.878480]<mitsuhiko>and then add a method that imports the macro from the template and renders it to the macro
[11:28:20.521585]<mitsuhiko>it's a little bit more complex to implement but easier to extend
[11:28:27.229850]<mitsuhiko>because you can then use that macro also in other templates
[11:28:28.915806]<cboos>mitsuhiko: wait, those are /Wiki/ macros, not template macros!
[11:28:33.242453]<mitsuhiko>cboos: i know
[11:28:36.579685]<cboos>my examples
[11:29:00.200466]<mitsuhiko>cboos: and yet i would use jinja2 macros in an unrelated way to wiki macros to implement wiki macros :)
[11:29:03.655585]<mitsuhiko>let me create an example
[11:29:15.476425]<cboos>ah, I see, so one big wiki_macros.html file
[11:29:34.454064]<cboos>with lots of small Jinja macros, one for each Wiki macro, right?
[11:29:42.867733]<mitsuhiko>yes
[11:29:56.256044]<mitsuhiko>cboos: either one big wiki_macros.html file or multiple, that does not matter too much
[11:30:01.976876]<mitsuhiko>jinja caches them in memory for you
[11:30:08.665286]<mitsuhiko>similar to how sys.modules work
[11:30:43.134752]<cboos>but then what about the Environment.from_string("""...""") method? Is that inefficient? (no caching?)
[11:31:44.543085]<mitsuhiko>cboos: if you create the template in a global scope it will be compiled once
[11:31:51.058713]<mitsuhiko>but no other caching takes place in jinja terms
[11:32:27.734544]<cboos>that would be fine for me, then
[11:32:38.990360]<cboos>same approach as for compiling the regexps
[11:32:49.450890]<mitsuhiko>yes
[11:33:03.640048]<cboos>rblank: what about http://trac.edgewall.org/ticket/9217 ? Should it make it for the beta?
[11:33:21.239583]<mitsuhiko>cboos: i just personally don't like the idea of templates or html in my python files
[11:33:43.773941]<mitsuhiko>probably because i tend to have different indentation settings for python and html and heavily depend on syntax highlighting :)
[11:34:21.803341]<cboos>mitsuhiko: I see ;-) I have no strong opinion at this moment, I'll defer that to the point I'd start to see thing happen in my editor ;-)
[11:34:46.995413]<cboos>and I'm pleased to know I'll have then the choice
[11:35:12.077489]<cboos>(using macros Jinja2 is also fast, I presume?)
[11:35:52.179008]<mitsuhiko>imo macros are the best way to handle partial templates
[11:35:57.505056]<mitsuhiko>easier to maintain and faster than includes
[11:36:13.846248]<mitsuhiko>because you can pass parameters to them, they are easier to understand imo
[11:36:30.843249]<mitsuhiko>i hate the idea of having implicit variables appear in partial templates where nobody knows where they are coming from
[11:36:48.302835]<cboos>faster than includes! well, that will need a change of mindset again...
[11:36:59.322298]<mitsuhiko>in terms of performance macros are faster for small parts than global template code, but slower for really large contents
[11:37:14.739740]<mitsuhiko>reasoning: top level template code, includes etc are using generators, macros buffer into a list
[11:37:14.966171]<cboos>vs. variables: yeah, same feeling,
[11:37:30.823375]<rblank>cboos: Looks reasonably straightforward. However, I'm not sure if the default should be None or an empty string.
[11:38:29.184772]<cboos>... the good old specified as empty or not specified at all differentiation (not that it would matter here)
[11:39:43.221970]<cboos>vs. variables, I wonder if we shouldn't start to use "template data structures" (in lack of better term), that would help to clarify the code and better document what's expected by templates
[11:40:01.901225]<cboos>and nicer to fill on the python side than the big data dictionary
[11:40:18.727611]<cboos>The main point would be to have the ability to document the slots
[11:40:50.489822]<rblank>cboos: What I meant is I'm ok with making the arguments optional, but not sure if the default value should be None -> NULL or an empty string.
[11:40:53.180510]<mitsuhiko>cboos: ah yes, the good old problem of magical templates
[11:40:59.637281]<mitsuhiko>let me know if you figured something out :D
[11:42:13.312853]<cboos>rblank: that's what I understood, yes. If we use None, we can know the argument was not specified, vs. if we use '' as a default, no difference from being given an empty comment .. but as I said, it doesn't really matter it seems. So ='' would be fine for me.
[11:42:40.309724]<cboos>mitsuhiko: look for example at http://trac.edgewall.org/browser/trunk/trac/templates/diff_div.html
[11:43:22.261081]<cboos>in this template (reused by inclusion from different contexts), we expect quite a complex (hairy...) set of variables
[11:43:42.810748]<cboos>and it's not really easy to document things that way (better than to not document them)
[11:44:05.358999]<cboos>I always thought that we should better have classes with documented properties for such things,
[11:44:38.432300]<cboos>but I also had the impression that this would have been not along the Genshi style... would that also be against the Jinja2 style?
[11:45:47.806062]<cboos>Follow-up question, would it really be /that/ slower to use a few extra objects rather than dicts, in this situation?
[11:46:01.613273]<rblank>cboos: Ah, sorry, it's me who didn't understand :) If using None doesn't screw anything up when rendering afterward, let's keep None.
[11:47:07.360683]<cboos>ok
[11:49:02.821745]<cboos>mitsuhiko: and now the big question... I looked a bit at the way templates were parsed, the flexibility given by the block_start_string and friends, ... it looks like that with a little bit more flexibility, we would be able to specify xml style begin and end pairs!
[11:49:29.292671]<rblank>cboos: I'll be absent again for two days (continuation of my previous trip) so feel free to release 0.12beta whenever you like.
[11:49:59.411563]<cboos>rblank: ok, yes, this was the next question I was going to ask ;-)
[11:50:15.523600]<cboos>(if you would be ok for a beta, eventually this evening, more likely tomorrow)
[11:50:54.588194]<rblank>I won't be around for long tonight, must get up at 4:00 in the morning tomorrow :(
[11:51:11.200491]<cboos>good luck...
[11:51:15.213845]<rblank>Thanks
[11:51:25.439556]*cboos shivers
[11:52:28.932272]<cboos>mitsuhiko: regarding the xml friendly syntax, actually, I can already imagine the patch by looking at the code, and this is why I like so much Jinja2 over Genshi, it *seems* I could understand it ;-) (but haven't seen everything yet, of course)
[11:53:42.019860]<cboos>mitsuhiko: so the advantage of adopting this delimiters would be that we could do a check that the .html templates are themselves well formed (doing this off-line, as part of the development)
[11:56:06.979155]<cboos>I remember the ugly hacks that accumulated during the Clearsilver days (things like conditionally outputting only an end tag), I don't want to risk to see that happen again...
[16:36:54.213367]<Bananobot>I'm trying to write my first Trac plugin. How can I get the path of the current Trac environment?
[16:37:14.483173]<Bananobot>(This is a macro I'm making)
[16:38:43.420860]<osimons>Bananobot: self.env.path
[16:39:21.561128]<Bananobot>Cool, that works. Thanks.
[16:40:29.956359]<Bananobot>My first plugin is a success! It allows me to include one of a set of PHP files in the wiki page. This will allow us to more easily integrate our existing mostly-PHP infrastructure with the Trac wiki.
[16:57:10.361337]<Bananobot>I'm now trying to figure out how to send a string of wiki markup through the wiki processor..
[16:59:20.681909]<osimons>look at the format_to_html() function - search trac source to locate it and see usage examples
[17:02:48.027248]<Bananobot>from trac.wiki.formatter import format_to_html [...] return format_to_html(self.env, formatter.context, markup)
[17:02:50.744069]<Bananobot>That seems to do it
[17:02:53.942727]<Bananobot>Thanks
[17:09:55.764284]<Bananobot>Our webserver wiki page now automatically show an up-to-date list of our websites, generated by a PHP script that parses our Apache config. I'll add a caching mechanism tomorrow, and I'll be all set. :)