1 2012-01-02T01:13:03 *** Dragooon
2 2012-01-02T01:13:11 <Dragooon> Hello
3 2012-01-02T01:14:06 <ThomasWaldmann> hi
4 2012-01-02T01:15:07 <Dragooon> I'd like to do some moin tasks but don't have python experience, what would you suggest.
5 2012-01-02T01:15:39 <ThomasWaldmann> maybe primarily the ones without "python" tag
6 2012-01-02T01:15:49 <Dragooon> I'd like python tasks.
7 2012-01-02T01:16:04 <Dragooon> I've done a lot of programming, but not in python.
8 2012-01-02T01:16:05 <ThomasWaldmann> ah, so you know python
9 2012-01-02T01:16:21 <ThomasWaldmann> let me see...
10 2012-01-02T01:16:53 <Dragooon> I don't mind hard tasks, as long as one can guide me a but.
11 2012-01-02T01:16:57 <Dragooon> bit*
12 2012-01-02T01:19:01 <Dragooon> And, I don't know python if that helps.
13 2012-01-02T01:20:12 <ThomasWaldmann> well, there are quite some "find a bug, fix a bug" tasks.
14 2012-01-02T01:21:10 <ThomasWaldmann> but I'ld suggest you start with something considered easy to medium, not hard
15 2012-01-02T01:21:41 <ThomasWaldmann> do you use rss/atom feeds regularly?
16 2012-01-02T01:21:46 <Dragooon> Are all bug tasks hard?
17 2012-01-02T01:22:03 <Dragooon> No but I know how they work and have codes interfaces for them.
18 2012-01-02T01:23:02 <ThomasWaldmann> there is a task about atom feeds, but it is needing someone who is a long term user of such stuff also
19 2012-01-02T01:23:18 <ThomasWaldmann> no, there are easy/medium/hard bug tasks
20 2012-01-02T01:23:45 <ThomasWaldmann> they are generic though, so you have to first find something that falls into that class
21 2012-01-02T01:23:46 <Dragooon> How is the difficulty decided?
22 2012-01-02T01:24:05 <ThomasWaldmann> you just ask after locating some bug you'ld like to fix
23 2012-01-02T01:24:14 <Dragooon> And in can figure things out, what does the task require? Atom one.
24 2012-01-02T01:24:19 <Dragooon> I*
25 2012-01-02T01:24:23 <ThomasWaldmann> there are lots of bugs, we could not create tasks for all
26 2012-01-02T01:24:44 <ThomasWaldmann> http://www.google-melange.com/gci/task/view/google/gci2011/7141270 just read it
27 2012-01-02T01:24:52 <Dragooon> Can I fix one from the hug tracker?
28 2012-01-02T01:24:58 <Dragooon> bug tracker*
29 2012-01-02T01:25:44 <Dragooon> I can do that.
30 2012-01-02T01:25:49 <ThomasWaldmann> http://moinmo.in/MoinMoin2.0
31 2012-01-02T01:28:22 <Dragooon> Let me log into my desktop.
32 2012-01-02T01:31:02 *** Dragooon
33 2012-01-02T01:32:26 *** Dragooon
34 2012-01-02T01:32:29 <Dragooon> Back
35 2012-01-02T01:32:45 <Dragooon> Okay so I'll try the atom feed task, any tips before I start?
36 2012-01-02T01:32:55 <ThomasWaldmann> http://www.google-melange.com/gci/task/view/google/gci2011/7167202 that is something rather specific also
37 2012-01-02T01:33:36 <ThomasWaldmann> it needs some familiarity with what moin2 does though
38 2012-01-02T01:34:51 <Dragooon> I see
39 2012-01-02T01:35:12 <ThomasWaldmann> do you know reST and/or sphinx?
40 2012-01-02T01:35:36 <Dragooon> I know ReST
41 2012-01-02T01:35:58 <ThomasWaldmann> ok, then you could get some familiarity with what moin2 does by improving docstrings
42 2012-01-02T01:36:12 <ThomasWaldmann> there is a task for that
43 2012-01-02T01:36:42 <ThomasWaldmann> that's not coding, but you can do some useful work while reading what you need for coding :D
44 2012-01-02T01:37:33 <Dragooon> I see
45 2012-01-02T01:37:37 <Dragooon> Lots of stuff to do
46 2012-01-02T01:38:51 <ThomasWaldmann> also, the issue tracker has quite some known issues. if you find something there that looks like doable, just give url and ask for difficulty.
47 2012-01-02T01:40:54 <Dragooon> Okay
48 2012-01-02T01:46:25 <Dragooon> At the risk of sounding stupid, where is the wikiserver.py file in Moin2?
49 2012-01-02T01:47:08 <ThomasWaldmann> there is none :)
50 2012-01-02T01:47:23 <Dragooon> Ah, that would explain it
51 2012-01-02T01:47:26 <ThomasWaldmann> but you can just follow the docs, we have some now :D
52 2012-01-02T01:47:48 <Dragooon> Docs is one of the rare things I follow :P
53 2012-01-02T01:48:08 <ThomasWaldmann> lots of useful links on that MoinMoin2.0 wiki page i gave you
54 2012-01-02T01:48:53 <Dragooon> Should've read that
55 2012-01-02T01:50:37 <Dragooon> One thing, is Moin2 compiled or interpreted?
56 2012-01-02T01:51:05 <ThomasWaldmann> well one usually says Python is an interpreter
57 2012-01-02T01:51:09 <Dragooon> I've seen a few python projects that were compiled
58 2012-01-02T01:51:13 <Dragooon> I got confused there
59 2012-01-02T01:51:32 <ThomasWaldmann> but, it is partly a compiler (compiles py source to py bytecode) - for cpython
60 2012-01-02T01:51:48 <ThomasWaldmann> or even has a JIT - for pypy
61 2012-01-02T01:52:34 <Dragooon> Ah okay
62 2012-01-02T01:52:46 <Dragooon> I'm mostly familiar with PHP, so i'm hoping getting into Python won't take too long
63 2012-01-02T01:53:52 <ThomasWaldmann> you maybe better ignore most of what you know about php :D
64 2012-01-02T01:54:13 <Dragooon> Like?
65 2012-01-02T01:56:11 <ThomasWaldmann> well, it is a different language and quite some (python) people consider php as mostly evil :D
66 2012-01-02T01:56:43 <Dragooon> I'd say that's because of lack of type strictness and the fact that PHP's OOP sucked(It doesn't now)
67 2012-01-02T01:56:56 <Dragooon> Yeah I get that a lot
68 2012-01-02T01:58:00 <Dragooon> The best part is I need to do python since I'm out of all kinds of other tasks I could do
69 2012-01-02T01:58:01 <Dragooon> :P
70 2012-01-02T02:11:11 <Dragooon> Hm I get requested path ot found after starting the built-in web server
71 2012-01-02T02:11:12 <Dragooon> not*
72 2012-01-02T02:12:40 <Dragooon> Nevermind
73 2012-01-02T02:12:42 <Dragooon> Stupid mistake
74 2012-01-02T02:13:58 *** qxcv
75 2012-01-02T02:19:48 <Dragooon> Uh
76 2012-01-02T02:19:51 <Dragooon> "MoinMoin feels unhappy." <- What?
77 2012-01-02T02:24:26 <ThomasWaldmann> something severely went wrong inside moin
78 2012-01-02T02:24:38 <ThomasWaldmann> but we didn't want to crash completely
79 2012-01-02T02:24:50 <ThomasWaldmann> just search for that string in teh source
80 2012-01-02T02:25:28 <Dragooon> Apparently data is not defined in the 2 revision text MoinMoin is passing to the diff generator
81 2012-01-02T02:25:36 <Dragooon> Fixing atom feeds count as improving them, right?
82 2012-01-02T02:27:12 <ThomasWaldmann> well, if you found a bug, claim another task - a bug fix task
83 2012-01-02T02:27:35 <Dragooon> Oh okay
84 2012-01-02T02:27:38 <ThomasWaldmann> the atom feed task is rather about user visible improvements
85 2012-01-02T02:27:47 <Dragooon> Ah yeah, I thought so
86 2012-01-02T02:36:08 <Dragooon> Ah, so diff atom feeds are just placeholders at the moment, and they actually don't work
87 2012-01-02T02:36:26 * ThomasWaldmann goes through all closed tasks, looking for unmerged stuff
88 2012-01-02T02:36:51 <Dragooon> Because _render_data_diff is just returning The items have different data, without any sort of diff
89 2012-01-02T02:36:57 <ThomasWaldmann> well, they somehow worked some time ago i think
90 2012-01-02T02:37:03 <Dragooon> Magic!
91 2012-01-02T02:37:09 <ThomasWaldmann> return value depends on type of involved items
92 2012-01-02T02:37:18 <ThomasWaldmann> text/* items should have text diff
93 2012-01-02T02:37:36 <Dragooon> HTML items?
94 2012-01-02T02:37:46 <Dragooon> Oh wait, html is text
95 2012-01-02T02:38:02 <ThomasWaldmann> of course if you compare application/foo with application/bar type, it will just tell whether the items are same or different
96 2012-01-02T02:38:27 <Dragooon> def _render_data_diff(self, oldrev, newrev):
97 2012-01-02T02:38:28 <Dragooon> hash_name = HASH_ALGORITHM
98 2012-01-02T02:38:29 <Dragooon> if oldrev.meta[hash_name] == newrev.meta[hash_name]:
99 2012-01-02T02:38:30 <Dragooon> return _("The items have the same data hash code (that means they very likely have the same data).")
100 2012-01-02T02:38:31 <Dragooon> else:
101 2012-01-02T02:38:32 <Dragooon> return _("The items have different data.")
102 2012-01-02T02:38:33 <Dragooon> Sorry for the block message
103 2012-01-02T02:38:49 <Dragooon> But that will tell anything that the data is different
104 2012-01-02T02:42:08 <ThomasWaldmann> that is just the fallback impl in the base class
105 2012-01-02T02:42:35 <ThomasWaldmann> in the class for text items, you'll see the impl for text type
106 2012-01-02T02:58:52 <Dragooon> Ah, so instead of providing raw diff file, one can provide HTML highlighted diffs?
107 2012-01-02T02:59:03 <Dragooon> That would be a fairly good improvement, as reading raw diffs is fairly hard
108 2012-01-02T03:04:51 <ThomasWaldmann> finding out how to do such stuff best IS part of the task :)
109 2012-01-02T03:05:20 <Dragooon> Yes I know, but was just discussing it
110 2012-01-02T03:08:30 <Dragooon> https://bitbucket.org/thomaswaldmann/moin-2.0/issue/142/atom-feed-crashes-for-more-than-one
111 2012-01-02T03:08:39 <Dragooon> ThomasWaldmann: ^, what would be the difficulty of that bug?
112 2012-01-02T03:09:42 <ThomasWaldmann> a crash report usually should include a traceback.txt
113 2012-01-02T03:10:06 <Dragooon> Sorry, didn't know that
114 2012-01-02T03:10:09 <ThomasWaldmann> you don't get it on the screen in that case, but it might be in the log
115 2012-01-02T03:10:25 <Dragooon> Yeah I got it
116 2012-01-02T03:12:05 <Dragooon> Attached
117 2012-01-02T03:15:37 <ThomasWaldmann> hmm, i suspect it is easy to fix
118 2012-01-02T03:15:48 <Dragooon> Your suspicion is corect
119 2012-01-02T03:15:59 <ThomasWaldmann> there was some api change and this was likely forgotten
120 2012-01-02T03:16:15 <ThomasWaldmann> maybe you can just leave away the .data and it'll work
121 2012-01-02T03:16:22 <Dragooon> Yeah, that fixed it
122 2012-01-02T03:17:09 <ThomasWaldmann> ok, produce a reasonable changeset for that and you've done your first task :D
123 2012-01-02T03:17:25 <ThomasWaldmann> and claim an easy bugfix task
124 2012-01-02T03:17:39 <Dragooon> Can I claim later?
125 2012-01-02T03:17:48 <Dragooon> I already got 2 pending tasks with videolan that I'd like to get approved first
126 2012-01-02T03:19:35 <ThomasWaldmann> sure.
127 2012-01-02T03:23:09 <Dragooon> What is the default execute permission for MoinMoin?
128 2012-01-02T03:29:23 <Dragooon> Nevermind
129 2012-01-02T03:57:19 <Dragooon> Can you tell me where HTML object's class is defined?
130 2012-01-02T03:58:30 <ThomasWaldmann> if you see it used somewhere, just look at the import lines in that module
131 2012-01-02T04:00:36 *** MattMaker
132 2012-01-02T04:11:31 <Dragooon> Okay got it, this seems fairly doable
133 2012-01-02T04:13:34 <Dragooon> BTW, I've uploaded a diff file containing the fixes
134 2012-01-02T04:15:43 <ThomasWaldmann> ehrm, you maybe shouldn't do that :)
135 2012-01-02T04:16:10 <Dragooon> Why?
136 2012-01-02T04:16:12 <ThomasWaldmann> (because of gci, otherwise of course this is fine)
137 2012-01-02T04:16:20 <Dragooon> Oh, gci leechers?
138 2012-01-02T04:17:08 <ThomasWaldmann> yeah. or work being done outside having a claim on it might be invalid. not sure, see the rules.
139 2012-01-02T04:17:35 <Dragooon> It's valid, that's how VideoLan gets their work done
140 2012-01-02T04:19:37 <ThomasWaldmann> ok, but there are still risks. just imagine someone of us closing the bug now. then you don't have some open bug to claim any more. :D
141 2012-01-02T04:19:49 * ThomasWaldmann won't do, of course.
142 2012-01-02T04:20:25 <Dragooon> I'm okay, even if I loose a few points I don't mind
143 2012-01-02T04:20:43 <Dragooon> ^ Not because I'm a saint type learner or something :P
144 2012-01-02T04:38:48 <Dragooon> Wiki page's names are case sensitive right?
145 2012-01-02T04:41:41 <ThomasWaldmann> yes
146 2012-01-02T04:43:31 <CIA-59> Thomas Waldmann <tw AT waldmann-edv DOT de> default * 1185:492fd5a8080d 2.0/quickinstall: quickinstall: use DIR environment variable for the virtualenv directory, default to DIR=env
147 2012-01-02T04:43:32 <CIA-59> Bilal Akhtar <bilalakhtar@ubuntu.com> default * 1186:ca53b9687f94 2.0/MoinMoin/apps/frontend/views.py: Catch AccessDenied exceptions while delete()ing or destroy()ing, and show an HTTP 403 error page instead of a traceback
148 2012-01-02T04:43:32 <CIA-59> Bilal Akhtar <bilalakhtar@ubuntu.com> default * 1187:82a7411e0653 2.0/MoinMoin/apps/frontend/views.py: Fix PEP8 issue, remove spacing between abort and parentheses
149 2012-01-02T04:43:33 <CIA-59> Thomas Waldmann <tw AT waldmann-edv DOT de> default * 1188:7fcca568fed1 2.0/MoinMoin/apps/frontend/views.py: merged
150 2012-01-02T04:56:15 <Dragooon> This is fun LD
151 2012-01-02T04:56:16 <Dragooon> :D
152 2012-01-02T05:19:22 <Dragooon> What is the function to convert html characters into entities?
153 2012-01-02T05:21:45 <CIA-59> Sam Toyer <samATqxcvDOTnet> default * 1189:8e85da9cfb7b 2.0/docs/ (6 files in 3 dirs): Fix all the SPHINXTODOs in docs/
154 2012-01-02T05:21:46 <CIA-59> Sam Toyer <samATqxcvDOTnet> default * 1190:3b97bf57f6af 2.0/docs/_static/custom.css: Remove unused styles from custom Sphinx CSS
155 2012-01-02T05:21:47 <CIA-59> Sam Toyer <samATqxcvDOTnet> default * 1191:fac79f21eb1b 2.0/docs/user/moinwiki.rst: Fix definition list example
156 2012-01-02T05:21:47 <CIA-59> Sam Toyer <samATqxcvDOTnet> default * 1192:984c2ec8a520 2.0/docs/user/moinwiki.rst: Add a big warning about indentation and moin wiki list markup
157 2012-01-02T05:21:49 <CIA-59> Sam Toyer <samATqxcvDOTnet> default * 1193:e55b96d76cc9 2.0/docs/user/moinwiki.rst: Remove comment about blank lines in docs/user/moinwiki.rst
158 2012-01-02T05:21:49 <CIA-59> Sam Toyer <samATqxcvDOTnet> default * 1194:5543dd64b1ee 2.0/docs/user/ (moinwiki.rst rest.rst): Fix RST enumerated list docs, add RSTTODO in moinwiki docs
159 2012-01-02T05:21:50 <CIA-59> Thomas Waldmann <tw AT waldmann-edv DOT de> default * 1195:a52b5aa085da 2.0/docs/ (6 files in 3 dirs): merged
160 2012-01-02T05:24:44 <Dragooon> Question
161 2012-01-02T05:24:45 <Dragooon> Why does
162 2012-01-02T05:24:57 <Dragooon> content = escape(content) not work but content = "{0}".format(escape(content)) work?
163 2012-01-02T05:31:19 <ThomasWaldmann> no idea
164 2012-01-02T05:31:36 <ThomasWaldmann> but the latter version looks unnecessary complicated
165 2012-01-02T05:34:09 <Dragooon> The former doesn't work :P
166 2012-01-02T05:43:28 <Dragooon> Okay, so far I've formatted it a bit more nicely using modified version of diff_html used in the diff viewer
167 2012-01-02T05:44:15 <Dragooon> I've stripped quite a bit of un-important information/instructions, and am working on formatting it better using CSS
168 2012-01-02T05:46:50 <ThomasWaldmann> btw, for the diff stuff also think about border cases. like first revision.
169 2012-01-02T05:47:26 <Dragooon> Yeah I'm thinking about how to go about it
170 2012-01-02T05:47:31 <Dragooon> Currently it sends the full thing
171 2012-01-02T05:50:37 <Dragooon> I'll also add a basicish xslt stylesheet
172 2012-01-02T05:51:43 <ThomasWaldmann> ehrm, xslt?
173 2012-01-02T05:52:36 <Dragooon> XML Transformations
174 2012-01-02T05:52:51 <Dragooon> If somebody accesses an atom feed via a web browser, it'll show them something nicer rather than raw XML
175 2012-01-02T05:59:44 <ThomasWaldmann> so xslt processing is done client side then?
176 2012-01-02T05:59:57 <Dragooon> YEs
177 2012-01-02T05:59:58 <Dragooon> Yes*
178 2012-01-02T06:00:05 <Dragooon> It's like CSS for XML
179 2012-01-02T06:00:37 <ThomasWaldmann> ok
180 2012-01-02T06:02:22 <Dragooon> Py Q, how can I test of a string is empty?
181 2012-01-02T06:02:26 <Dragooon> if string is None
182 2012-01-02T06:02:27 <Dragooon> ?
183 2012-01-02T06:04:18 <ThomasWaldmann> if not s:
184 2012-01-02T06:05:14 <ThomasWaldmann> btw, use codereview if you have some code
185 2012-01-02T06:06:03 <Dragooon> Codereview?
186 2012-01-02T06:06:30 <ThomasWaldmann> codereview.appspot.com - it is like pastebin on steroids.
187 2012-01-02T06:07:18 <ThomasWaldmann> if you have the code in a local hg repo, it is just a matter of calling upload.py (with some uncommitted changes)
188 2012-01-02T06:07:59 <Dragooon> Nice
189 2012-01-02T06:09:36 <Dragooon> Okay this is making no sense
190 2012-01-02T06:10:43 <Dragooon> rev_title = rev.meta.get(COMMENT, '')
191 2012-01-02T06:11:01 <Dragooon> Then I pass this into the feed.add method in title arguement
192 2012-01-02T06:11:14 <Dragooon> But then I get an exception saying title is required
193 2012-01-02T06:11:16 <Dragooon> If I pass
194 2012-01-02T06:11:27 <Dragooon> "{0}".format(rev_title) it works
195 2012-01-02T06:29:45 <ThomasWaldmann> maybe check the type you get and you need
196 2012-01-02T06:29:50 <ThomasWaldmann> str vs. unicode maybe
197 2012-01-02T06:29:55 <ThomasWaldmann> Dragooon: ^^
198 2012-01-02T06:30:27 <Dragooon> So unicode is a different type in Py?
199 2012-01-02T06:30:53 <ThomasWaldmann> unicode is somehow like 32bit strings, while str is a 8bit string
200 2012-01-02T06:31:31 <Dragooon> Ohh that might explain things
201 2012-01-02T06:33:17 <Dragooon> Thanks
202 2012-01-02T06:33:28 <Dragooon> What timezone are you in?
203 2012-01-02T06:33:33 <Dragooon> ThomasWaldmann: ^
204 2012-01-02T06:45:49 <ThomasWaldmann> currently in the post-28c3 tz :P
205 2012-01-02T06:46:05 <ThomasWaldmann> but usually in utc+1
206 2012-01-02T06:46:21 <Dragooon> Ah okay
207 2012-01-02T07:24:04 <Dragooon> Oh I terribly broke something
208 2012-01-02T07:30:32 *** Dragooon
209 2012-01-02T07:34:45 *** Dragooon
210 2012-01-02T08:28:31 <dreimark> moin
211 2012-01-02T08:37:40 <dreimark> Dragooon: please use for indenting of one level 4 blanks, don't use tabs.
212 2012-01-02T08:38:04 <Dragooon> Did I use tabs?
213 2012-01-02T08:38:07 <Dragooon> God damn xcode
214 2012-01-02T08:38:39 <dreimark> i don't know, well php has not indenting rules
215 2012-01-02T08:38:41 <Dragooon> No wait
216 2012-01-02T08:38:46 <Dragooon> I use spaces
217 2012-01-02T08:38:50 <Dragooon> Yeah, I'm god
218 2012-01-02T08:38:55 <Dragooon> s/god/good
219 2012-01-02T08:42:02 <Dragooon> dreimark: Are you a GCI mentor?
220 2012-01-02T08:44:00 <dreimark> yes, i am in the office at work now.
221 2012-01-02T08:44:11 <Dragooon> Oh okay
222 2012-01-02T08:44:30 <Dragooon> Any other mentor here?
223 2012-01-02T08:44:41 <dreimark> but if you have questions just ask and be patient.
224 2012-01-02T08:45:25 <Dragooon> Well, how would I get URL to a file in static folder via a view?
225 2012-01-02T08:49:17 <dreimark> e.g. http://hg.moinmo.in/moin/2.0/file/a52b5aa085da/MoinMoin/templates/base.html#l33
226 2012-01-02T08:49:35 <Dragooon> Not from a template, I'm inside a python view file
227 2012-01-02T08:50:06 <Dragooon> Nevermind
228 2012-01-02T08:52:04 <dreimark> url_for, or grep for static in the py source
229 2012-01-02T08:52:38 <Dragooon> I basically spent last 2 hours debugging a stupid mistake in which I directly used "1" without 0 in string.format
230 2012-01-02T08:59:55 <dreimark> e.g. http://hg.moinmo.in/moin/2.0/file/a52b5aa085da/MoinMoin/user.py#l271
231 2012-01-02T09:00:47 <dreimark> Dragooon: ^
232 2012-01-02T09:01:03 <Dragooon> dreimark: Thanks, I figured it out
233 2012-01-02T09:03:32 <dreimark> try to use the same blank logic as you see in the existing code. e.g. a = arg() not a = arg () that is a PEP8 rule. we have a pep8 source code test.
234 2012-01-02T09:04:02 <Dragooon> Okay
235 2012-01-02T09:06:32 <dreimark> and if you have something to review use codereview ThomasWaldmann has shown. This is extremly good e.g. http://codereview.appspot.com/5504083
236 2012-01-02T09:25:24 <Dragooon> Sure, that looks interesting
237 2012-01-02T09:32:19 <Dragooon> Is there any problem with using open sourced stylesheets instead of creating one own's?
238 2012-01-02T10:14:14 <dreimark> Dragooon: depends on the license, which one do you have in mind?
239 2012-01-02T10:14:28 <Dragooon> General curiousity
240 2012-01-02T10:33:42 <Dragooon> The net has decided to make everything not work for me
241 2012-01-02T10:38:47 <TheSheep> they had to be compatible with moin's license
242 2012-01-02T12:02:40 <Dragooon> TheSheep: Are you a mentor?
243 2012-01-02T12:06:37 <Dragooon> Anybody who's a mentor here?
244 2012-01-02T12:47:00 *** greg_f
245 2012-01-02T12:56:26 <dreimark> sure
246 2012-01-02T12:58:45 <Dragooon> I'm mostly familiar with git and this is the first time I'm using hg
247 2012-01-02T12:59:14 <Dragooon> Generally I do a task, commit it in my local repository, create a new branch and work on another task
248 2012-01-02T12:59:18 <Dragooon> Is that possible with hg?
249 2012-01-02T12:59:23 <dreimark> yes
250 2012-01-02T12:59:39 <dreimark> you don't need a new branch
251 2012-01-02T13:00:07 <Dragooon> So...how?
252 2012-01-02T13:01:03 <dreimark> you can fork on bitbucket https://bitbucket.org/thomaswaldmann/moin-2.0
253 2012-01-02T13:01:29 <dreimark> before you commit please use coderview
254 2012-01-02T13:02:04 <Dragooon> Once I submit my patch to coderview, can I commit and work on my next task?
255 2012-01-02T13:02:29 <dreimark> you can have a local different clone of your repo
256 2012-01-02T13:02:37 <dreimark> and work there
257 2012-01-02T13:02:45 <Dragooon> So multiple clones?
258 2012-01-02T13:02:50 <dreimark> for example
259 2012-01-02T13:03:02 <dreimark> we want a clean solution
260 2012-01-02T13:03:15 <dreimark> of one issue not half done many
261 2012-01-02T13:03:24 <Dragooon> Yes, that's why I'm asking
262 2012-01-02T13:04:41 <dreimark> http://code.google.com/p/rietveld/wiki/UploadPyUsage
263 2012-01-02T13:05:36 <dreimark> mercurial supports branches but we don't want after a merge of yours not multiple heads
264 2012-01-02T13:09:47 <Dragooon> Still not completely clear
265 2012-01-02T13:10:02 <Dragooon> I do a task then I upload the patch to codereview
266 2012-01-02T13:10:32 <Dragooon> Now, if I want to do another task without waiting for review, how should I go about that?
267 2012-01-02T13:13:42 <Dragooon> Also, where is tag method defined? I checked the imports and it's not there
268 2012-01-02T13:14:22 <dreimark> the task is done after it is commit ready
269 2012-01-02T13:14:42 <dreimark> meanwhile you can work on an other task but you should not commit all in one shot
270 2012-01-02T13:15:07 <Dragooon> Do I commit the task or does a mentor do that?
271 2012-01-02T13:15:16 <dreimark> you commit in your repository
272 2012-01-02T13:15:21 <dreimark> we pull in ours
273 2012-01-02T13:15:33 <Dragooon> Oh I see
274 2012-01-02T13:15:42 <dreimark> after the first review you get I guess how we want it
275 2012-01-02T13:16:17 <dreimark> the review is also for not having typos, small issues, wrong comments etc, in lots of commits
276 2012-01-02T13:16:31 <Dragooon> Can you review atm/
277 2012-01-02T13:16:33 <Dragooon> ?
278 2012-01-02T13:16:39 <dreimark> if you send me the url?
279 2012-01-02T13:16:47 <Dragooon> http://codereview.appspot.com/5489133/
280 2012-01-02T13:16:48 <Dragooon> :)
281 2012-01-02T13:17:05 <dreimark> and melange url?
282 2012-01-02T13:17:05 <Dragooon> First time I did Python, so I'm sorry if I did an obvious mistake
283 2012-01-02T13:17:14 <Dragooon> http://www.google-melange.com/gci/task/view/google/gci2011/7141270
284 2012-01-02T13:18:30 <dreimark> you tried it?
285 2012-01-02T13:18:44 <Dragooon> Yes
286 2012-01-02T13:18:58 <Dragooon> Its certainly a lot more usable than before
287 2012-01-02T13:19:20 <dreimark> have you looked if the result is valid html5?
288 2012-01-02T13:20:36 <Dragooon> Yes
289 2012-01-02T13:20:58 <Dragooon> (That is the atom content)
290 2012-01-02T13:46:22 <dreimark> Dragooon: i have assigned the task to you
291 2012-01-02T13:46:31 <Dragooon> What do you mean by tree organisation?
292 2012-01-02T13:46:41 <dreimark> we have items and subitems
293 2012-01-02T13:46:55 <dreimark> on first level it is a item
294 2012-01-02T13:47:03 <dreimark> if it is on a further one it is a subitem
295 2012-01-02T13:47:17 <Dragooon> So the comment would reflect that?
296 2012-01-02T13:47:17 <dreimark> the items can be organized like in a filebrowser
297 2012-01-02T13:47:49 <dreimark> isn't title the name?
298 2012-01-02T13:48:13 <dreimark> title = _(u'{0} - History').format(item_name);
299 2012-01-02T13:48:15 <Dragooon> It's the reason for changing comment
300 2012-01-02T13:48:24 <Dragooon> I'm not stripping that
301 2012-01-02T13:48:57 <dreimark> ah ok, then name it correctly
302 2012-01-02T13:49:06 <Dragooon> rev_comment?
303 2012-01-02T13:49:06 <dreimark> don't obfuscate it
304 2012-01-02T13:49:09 <dreimark> yes
305 2012-01-02T13:49:12 <Dragooon> Ah sorry
306 2012-01-02T13:49:19 <Dragooon> Also
307 2012-01-02T13:49:36 <Dragooon> "can this <?xml ... be moved into a template?" <- Not really since it links to a xslt file which is same for every template
308 2012-01-02T13:49:39 <Dragooon> which should be*
309 2012-01-02T13:50:28 <dreimark> a template can do that too
310 2012-01-02T13:50:39 <Dragooon> Yeah…I should move it to a templeate
311 2012-01-02T13:50:42 <Dragooon> template*
312 2012-01-02T13:51:11 <dreimark> brb
313 2012-01-02T13:51:21 <Dragooon> You have no blanks on every line?
314 2012-01-02T13:53:18 <Dragooon> "is it necessary to impirt diff at that location, why not at usual plyce?" <- I just copied the below method and changed the HTML view to better suite atom feeds
315 2012-01-02T14:12:36 <ThomasWaldmann> Dragooon: i also posted a review
316 2012-01-02T14:12:49 <Dragooon> Oh no
317 2012-01-02T14:12:56 <ThomasWaldmann> :P
318 2012-01-02T14:14:10 <ThomasWaldmann> btw, when you update codereview with new state of your code, make sure to use same id
319 2012-01-02T14:15:14 <Dragooon> I was about to ask that
320 2012-01-02T14:15:29 <Dragooon> "look at how the title for normal wiki page views looks at test.moinmo.in." I would if it would open
321 2012-01-02T14:15:30 <Dragooon> :P
322 2012-01-02T14:16:27 <ThomasWaldmann> http://test.moinmo.in/pagename
323 2012-01-02T14:16:28 <Dragooon> "don't copy nonsense from other places. (i mean using .format() for not formatting anything)" <- I can't get it to work without doing this stupid formatting
324 2012-01-02T14:16:55 <ThomasWaldmann> i told you what to look at
325 2012-01-02T14:17:53 <Dragooon> What?
326 2012-01-02T14:18:09 <ThomasWaldmann> str vs. unicode
327 2012-01-02T14:18:39 <Dragooon> Oh
328 2012-01-02T14:19:00 <Dragooon> "how much of this is copied from another diff template?" <- It's quite different to be merged into one template
329 2012-01-02T14:19:35 <Dragooon> The second template has much different HTML(different layout + less amount of content)
330 2012-01-02T14:19:54 <ThomasWaldmann> comment/reply on CR rather
331 2012-01-02T14:19:59 <Dragooon> Ah 'kay
332 2012-01-02T14:28:17 <Dragooon> Replied
333 2012-01-02T14:32:23 <Dragooon> Also, I have 2 small pieces of HTMl in there. So would I need to create 2 new template files?
334 2012-01-02T14:47:59 <Dragooon> ThomasWaldmann: ^
335 2012-01-02T14:51:45 *** RogerHaase
336 2012-01-02T15:20:30 <izibi> Dragooon: do you know any good resources on learning how to use XSLT?
337 2012-01-02T15:20:41 <Dragooon> Google
338 2012-01-02T15:20:41 <Dragooon> :P
339 2012-01-02T15:20:44 <Dragooon> That's how I do mine
340 2012-01-02T15:21:55 <izibi> so you just search for something and hope that you find something that somehow works? :D
341 2012-01-02T15:23:01 <Dragooon> Yes
342 2012-01-02T15:23:02 <Dragooon> :P
343 2012-01-02T15:24:48 <izibi> okay :D but that's actually not what i'm looking for :D
344 2012-01-02T15:25:01 <Dragooon> I'd just search for xslt tutorials
345 2012-01-02T15:27:16 *** qxcv
346 2012-01-02T16:15:38 <Dragooon> Can anyone tell me how unit testing works?
347 2012-01-02T16:19:40 <izibi> Dragooon: what exactly do you want to know? how you can run the tests, how you can write your own ones or what goes on in the background?
348 2012-01-02T16:19:54 <Dragooon> How can I run them?
349 2012-01-02T16:24:14 <izibi> enable the virtualenv and then just run "py.test"
350 2012-01-02T16:24:29 <Dragooon> Okay, thanks
351 2012-01-02T16:24:36 <RogerHaase> Dragoon: http://moinmo.in/MoinDev/UnitTests#Running_the_tests
352 2012-01-02T16:24:48 <Dragooon> Are you a mentor?
353 2012-01-02T16:24:57 <RogerHaase> no
354 2012-01-02T16:25:01 <Dragooon> Okay
355 2012-01-02T16:25:59 <izibi> me neiter ;)
356 2012-01-02T16:27:26 * izibi thinks about pretending to be a mentor and then submitting the work of others :D
357 2012-01-02T16:37:49 <TheSheep> we have logs
358 2012-01-02T16:39:45 <Dragooon> Are you a mentor? :P
359 2012-01-02T16:43:26 <izibi> TheSheep: you can't log queries :D
360 2012-01-02T16:43:36 <dreimark> izibi: why notẞ
361 2012-01-02T16:43:38 <dreimark> ?
362 2012-01-02T16:44:59 <izibi> well. do you control freenode? ;)
363 2012-01-02T16:45:18 <dreimark> no but my client
364 2012-01-02T16:46:49 <izibi> i hope freenode won't send a query between for example Dragooon and me to your client :P
365 2012-01-02T16:47:19 <dreimark> no, that not ;)
366 2012-01-02T16:47:35 <dreimark> but the other party than you has always the logs
367 2012-01-02T16:49:06 <Dragooon> dreimark: Uploaded another patch
368 2012-01-02T16:50:25 <Dragooon> ThomasWaldmann: ^
369 2012-01-02T16:51:37 <dreimark> have you tried non ascii chars?
370 2012-01-02T16:53:19 <Dragooon> No I need to do that
371 2012-01-02T16:53:22 <Dragooon> Just realised
372 2012-01-02T16:53:29 <dreimark> does it work with firefox
373 2012-01-02T16:55:02 <Dragooon> Should
374 2012-01-02T16:55:10 <Dragooon> Let me check
375 2012-01-02T16:59:04 <Dragooon> Okay, korean character make it crash in every history view
376 2012-01-02T16:59:08 <Dragooon> makes*
377 2012-01-02T16:59:27 <Dragooon> So, that's a bug
378 2012-01-02T16:59:48 <dreimark> yeah there are some unicode bugs
379 2012-01-02T17:00:02 <dreimark> but how is it with the feed
380 2012-01-02T17:00:09 <Dragooon> Same
381 2012-01-02T17:00:28 <Dragooon> Problem's with diff_html used both by feed and history diff view
382 2012-01-02T17:04:10 <Dragooon> I think I found a fix
383 2012-01-02T17:04:49 <Dragooon> Treat the whole thing as unicode
384 2012-01-02T17:07:40 <ThomasWaldmann> Dragooon: see my latest review
385 2012-01-02T17:07:51 <Dragooon> Yeah, fixing unicode then will respond
386 2012-01-02T17:08:07 <ThomasWaldmann> you can also go over all review comments on cr again to see whether you have dealt with them
387 2012-01-02T17:08:46 <Dragooon> Oka
388 2012-01-02T17:10:07 <Dragooon> This is odd
389 2012-01-02T17:10:20 <Dragooon> escaping content returns content as is, if I encode it to ascii I get escaped content
390 2012-01-02T17:20:35 <Dragooon> content = unicode(content)
391 2012-01-02T17:20:47 <Dragooon> Why does that convert html characters into entities?
392 2012-01-02T17:21:03 <ThomasWaldmann> maybe you should read some python unicode howto
393 2012-01-02T17:21:15 <ThomasWaldmann> just to make sure you precisely understand it
394 2012-01-02T17:22:06 <ThomasWaldmann> that doesn't convert to entities usually
395 2012-01-02T17:23:49 <ThomasWaldmann> a basic thing about doing it right is to always know what you have (str or unicode) and what you need (str or unicode)
396 2012-01-02T17:24:55 <ThomasWaldmann> usually moin has content or other user defined text as unicode (in memory)
397 2012-01-02T17:25:30 <ThomasWaldmann> but when text enters or leaves moin, it often is a utf-8 encoded str
398 2012-01-02T17:34:17 <Dragooon> BTW, I also found a bug in which history diff viewer would crash if there's an UTF_8 char present
399 2012-01-02T17:35:42 <ThomasWaldmann> we usually do not have utf8 encoded chars in memory
400 2012-01-02T17:36:26 <ThomasWaldmann> but show me the changeset for more precise comments
401 2012-01-02T17:37:37 <Dragooon> I'll do so
402 2012-01-02T17:48:15 <Dragooon> Uploaded patch with unicode fix
403 2012-01-02T17:48:33 <dreimark> and have you checked the other comments?
404 2012-01-02T17:49:09 <Dragooon> Just one left
405 2012-01-02T17:49:28 <Dragooon> ThomasWaldmann: " look at how the title for normal wiki page views l" <- you mean just the page's name?
406 2012-01-02T17:50:50 <ThomasWaldmann> it has wikiname and itemname
407 2012-01-02T17:51:41 <Dragooon> What would be better?
408 2012-01-02T17:51:49 <Dragooon> Wikiname - History of pagename
409 2012-01-02T17:51:54 <Dragooon> Or Wikiname - Pagename
410 2012-01-02T17:52:54 <ThomasWaldmann> for the 2nd, you do not need translation :D
411 2012-01-02T17:53:12 <Dragooon> True
412 2012-01-02T17:59:42 <Dragooon> Okay done
413 2012-01-02T18:01:55 <Dragooon> Can anyone review?
414 2012-01-02T18:07:37 <ThomasWaldmann> just a sec...
415 2012-01-02T18:16:03 *** greg_f
416 2012-01-02T18:19:38 <ThomasWaldmann> Dragooon: btw, there is a bug about wrong format usage, the format strings usually must be unicode
417 2012-01-02T18:19:50 <ThomasWaldmann> this needs a global review
418 2012-01-02T18:19:54 <Dragooon> Where?
419 2012-01-02T18:20:01 <Dragooon> global review?
420 2012-01-02T18:20:08 <ThomasWaldmann> should be on bb issue tracker
421 2012-01-02T18:20:48 <Dragooon> Oh, so you mean fix everything that is not unicode to unicode?
422 2012-01-02T18:20:49 <ThomasWaldmann> we recently transformed formatstr % (x, y) to formatstr.format(x, y)
423 2012-01-02T18:21:25 <ThomasWaldmann> and the one who did that (and we also) were not aware that it behaves different
424 2012-01-02T18:21:46 <Dragooon> Yeah, it's slightly odd. Took me a few runs to figure out what was going wrong
425 2012-01-02T18:21:50 <ThomasWaldmann> the left happily upgrades the result to unicode if x or y is unicode
426 2012-01-02T18:22:08 <ThomasWaldmann> the right crashes in that case if the formatstr itself is not unicode
427 2012-01-02T18:22:15 <Dragooon> Yeah
428 2012-01-02T18:22:34 <Dragooon> That was the bug I was talking about in history diff view
429 2012-01-02T18:22:51 <Dragooon> The format strings were being treated as ascii, pass an unicode and it crashes
430 2012-01-02T18:22:58 <ThomasWaldmann> if possible, such a change (fix) should be in a separate cs
431 2012-01-02T18:22:58 <Dragooon> I changed that(See diff_html.py)
432 2012-01-02T18:23:09 <Dragooon> I included it since it also broke mine code
433 2012-01-02T18:23:49 <ThomasWaldmann> i had a look at the atom feed code in werkzeug
434 2012-01-02T18:24:12 <ThomasWaldmann> but it doesn't look very extendable from the outside
435 2012-01-02T18:24:12 <Dragooon> And?
436 2012-01-02T18:24:32 <Dragooon> It's fairly complete from an Atom feed point of view
437 2012-01-02T18:24:36 <ThomasWaldmann> btw, i finished the codereview
438 2012-01-02T18:25:32 <ThomasWaldmann> except that xslt stuff
439 2012-01-02T18:25:58 <ThomasWaldmann> i am currently not sure whether it is that useful btw
440 2012-01-02T18:26:16 <ThomasWaldmann> because the atom feed is primarily for feed readers and similar sw
441 2012-01-02T18:26:39 <ThomasWaldmann> if somebody uses a browser he can just look at the normal history views of moin
442 2012-01-02T18:26:53 <Dragooon> Yeah, but it is there just for fun.
443 2012-01-02T18:26:59 <Dragooon> I wanted to play with XSLT anyway
444 2012-01-02T18:27:24 <ThomasWaldmann> but you have to make changes that are maybe problematic for that
445 2012-01-02T18:27:37 <Dragooon> I don't think the changes can be problematic
446 2012-01-02T18:27:38 <ThomasWaldmann> like that contenttype change to make chrome work
447 2012-01-02T18:27:40 <Dragooon> Ugly, maybe.
448 2012-01-02T18:27:44 <Dragooon> Oh yeah
449 2012-01-02T18:28:14 <ThomasWaldmann> so, could there be some atom feed reader falling over that if it does not get atom+xml?
450 2012-01-02T18:28:57 <Dragooon> Not sure
451 2012-01-02T18:29:03 <Dragooon> That might cause some troubles
452 2012-01-02T18:29:34 <Dragooon> BTW I'm using the wrapper because the third parameter is only for Text content type
453 2012-01-02T18:29:37 <ThomasWaldmann> then maybe use the less funny version :)
454 2012-01-02T18:29:41 <Dragooon> Any other content type will crash it
455 2012-01-02T18:30:29 <ThomasWaldmann> if it is an optional param with default value, one does not need to give it
456 2012-01-02T18:30:50 <ThomasWaldmann> ah, i see, but you give it in any case
457 2012-01-02T18:31:04 <ThomasWaldmann> ok, keep that as is
458 2012-01-02T18:31:08 <Dragooon> ok
459 2012-01-02T18:34:19 <ThomasWaldmann> btw, rather than overwriting content[0] for that hack, one would rather insert a new list element after 0
460 2012-01-02T18:34:49 <ThomasWaldmann> that gives same result but makes more clear what's happening
461 2012-01-02T18:34:53 <Dragooon> How do you d that in Python?
462 2012-01-02T18:35:21 <ThomasWaldmann> l.insert(1, newelem)
463 2012-01-02T18:35:32 <Dragooon> Oh fantastic
464 2012-01-02T18:36:16 <ThomasWaldmann> but if we drop the xsl stuff, we don't need that hack anyway
465 2012-01-02T18:37:22 <dreimark> btw. if it is a new item in case of text i want to have the first lines in the feed.
466 2012-01-02T18:37:25 <ThomasWaldmann> btw, look at the methods of AtomFeed, there is one that gives a complete response object, check if we can use that to simplify
467 2012-01-02T18:37:54 <dreimark> and not only the comment or if no comment just the name repeated
468 2012-01-02T18:37:58 <Dragooon> So, drop XSL or improve the hack?
469 2012-01-02T18:38:13 <ThomasWaldmann> I'ld drop it.
470 2012-01-02T18:38:29 <ThomasWaldmann> it was a nice idea, but as we have browser views of that stuff, we don't need it
471 2012-01-02T18:39:08 <Dragooon> What does Markup do/
472 2012-01-02T18:39:39 <ThomasWaldmann> and it would be a pity if the required other changes would confuse/crash atom feed readers or other software
473 2012-01-02T18:39:58 <ThomasWaldmann> you mean the Markup() class?
474 2012-01-02T18:40:29 <Dragooon> Yes
475 2012-01-02T18:40:41 <ThomasWaldmann> it is from jinja2 and has docs :)
476 2012-01-02T18:41:05 <ThomasWaldmann> but in short, it tells "this is markup and we assure it is safe"
477 2012-01-02T18:41:09 <Dragooon> So you are saying that I should encode the response from render_diff
478 2012-01-02T18:41:42 <ThomasWaldmann> no, i am saying you must find out first what you have and what you need
479 2012-01-02T18:41:52 <ThomasWaldmann> don't do random changes regarding encoding
480 2012-01-02T18:42:29 <ThomasWaldmann> usually there is 1 correct way and usually this is also the most simple way
481 2012-01-02T18:43:24 <ThomasWaldmann> the motto usually is "decode early (when data enters moin), deal with unicode objects in moin, encode late (when data leaves moin)"
482 2012-01-02T18:45:42 <ThomasWaldmann> in case of the atom feed, encoding is likely not your business, AtomFeed or even flask/werkzeug should do that
483 2012-01-02T18:46:23 <Dragooon> It seems to be failing miserably if I pass un-escaped data
484 2012-01-02T18:47:29 <ThomasWaldmann> example? traceback?
485 2012-01-02T18:47:45 <ThomasWaldmann> and escaping != encoding
486 2012-01-02T18:48:50 <Dragooon> No, it doesn't crash
487 2012-01-02T18:48:55 <Dragooon> But the reader doesn't like unescaped HTML
488 2012-01-02T18:49:03 <Dragooon> And I can't get it to escape without making it unicode
489 2012-01-02T18:49:48 <ThomasWaldmann> hmm, no, we can't use get_response() because we need the content for caching
490 2012-01-02T18:50:09 <Dragooon> Huh?
491 2012-01-02T18:50:25 <Dragooon> You mean AtomFeed's get_response?
492 2012-01-02T18:50:26 <ThomasWaldmann> see the last lines of the feed generation
493 2012-01-02T18:50:33 <ThomasWaldmann> yes
494 2012-01-02T18:50:48 <ThomasWaldmann> so forget that idea :)
495 2012-01-02T18:51:00 <Dragooon> Don't think I had that ide
496 2012-01-02T18:51:01 <Dragooon> idea
497 2012-01-02T18:51:02 <Dragooon> :P
498 2012-01-02T18:51:19 <ThomasWaldmann> and as I said, if you need to "make something unicode", there is maybe a bug at another place, because most internal stuff should be unicode
499 2012-01-02T18:51:37 <ThomasWaldmann> no, I had it :)
500 2012-01-02T18:51:53 <Dragooon> rev.data.read() would return unicode, correct?
501 2012-01-02T18:52:08 <ThomasWaldmann> no, that is binary data
502 2012-01-02T18:52:36 <ThomasWaldmann> revision data can be anything, not just text
503 2012-01-02T18:53:32 * ThomasWaldmann must go for a while, will be back in 20mins
504 2012-01-02T18:53:32 <Dragooon> If it's in text
505 2012-01-02T19:13:59 <ThomasWaldmann> re
506 2012-01-02T19:14:26 <Dragooon> Figured it out
507 2012-01-02T19:15:50 <Dragooon> if cid is not None:
508 2012-01-02T19:15:51 <Dragooon> app.cache.set(cid, content)
509 2012-01-02T19:15:58 <Dragooon> I think that logic is flawed?
510 2012-01-02T19:16:05 <Dragooon> Wouldn't cid be None?
511 2012-01-02T19:32:00 <ThomasWaldmann> "is not None" checks for it not being None
512 2012-01-02T19:33:06 <ThomasWaldmann> btw. "x is not y" is equivalent to "not (x is y)" but nicer to read
513 2012-01-02T19:34:20 <ThomasWaldmann> but that caching thing might be flawed in other respect
514 2012-01-02T19:41:42 <Dragooon> That is odd, Markup.unescape is turning double encoding into single
515 2012-01-02T19:48:46 <Dragooon> ThomasWaldmann: Yeah okay, I'm unable to figure this out
516 2012-01-02T19:49:04 <Dragooon> _render_diff_text_atom returns Markup, which is an extension of unicode
517 2012-01-02T19:49:27 <Dragooon> Markup.unescape returns unicode version of the markup, but it turns all double encoding to since encoding
518 2012-01-02T19:49:40 <Dragooon> Which makes the code inside diffs execute
519 2012-01-02T19:49:51 <Dragooon> single*
520 2012-01-02T19:50:11 <Dragooon> If I to unicode(..Marker…) I get value I need
521 2012-01-02T19:53:48 <Dragooon> On a different note, ultimately markup returns an unescaped version of unicode(self)
522 2012-01-02T19:53:56 <Dragooon> So it's basically what I was doing previously
523 2012-01-02T20:00:34 <Dragooon> ThomasWaldmann: There?
524 2012-01-02T20:00:42 <Dragooon> dreimark: You there?
525 2012-01-02T20:12:20 <ThomasWaldmann> Dragooon: maybe it would be easier if you put some comments into your current code and upload it to cr
526 2012-01-02T20:13:24 <ThomasWaldmann> and Markup is expected to not escape, that's why it is called Markup
527 2012-01-02T20:13:55 <Dragooon> Markup.unescape does some weird thing with entity
528 2012-01-02T20:14:13 <ThomasWaldmann> i never needed that yet
529 2012-01-02T20:14:57 <Dragooon> It probably won't mess up single encodings
530 2012-01-02T20:14:59 <ThomasWaldmann> one either has unicode objects to put into a template - these are often data / user input and will get escaped automatically to prevent xss
531 2012-01-02T20:15:39 <Dragooon> I know, that's why I didn't disable auto escape on the full project
532 2012-01-02T20:15:53 <ThomasWaldmann> or you have a piece of html generated by the code that is known-safe and NOT made by a user, then encapsulating it in Markup() will tell jinja2 to NOT escape it
533 2012-01-02T20:16:17 <Dragooon> Hm
534 2012-01-02T20:17:14 <ThomasWaldmann> the effect of doing it that way is it being safe-by-default and not XSS-prone by default
535 2012-01-02T20:18:06 <Dragooon> Fixed it
536 2012-01-02T20:19:38 <ThomasWaldmann> we didn't have autoescape in moin 1.9 btw and xss was likely the most frequent security issue we had
537 2012-01-02T20:20:13 <ThomasWaldmann> not very frequent, but more frequent than everything else
538 2012-01-02T20:20:57 *** MattMaker
539 2012-01-02T20:21:43 <Dragooon> Okay uploaded patch to CR, should fix a small XSS hole
540 2012-01-02T20:21:51 <Dragooon> Also added a couple of comments
541 2012-01-02T20:26:29 <Dragooon> ThomasWaldmann: ^
542 2012-01-02T20:29:06 <ThomasWaldmann> review done
543 2012-01-02T20:35:13 <ThomasWaldmann> eSyr: xorAxAx: dreimark: what do you think about the sphinx/moin task? is it done?
544 2012-01-02T20:35:27 <ThomasWaldmann> http://www.google-melange.com/gci/task/view/google/gci2011/7196360
545 2012-01-02T20:35:39 <Dragooon> ThomasWaldmann: https://github.com/mitsuhiko/jinja2/blob/master/jinja2/_markupsafe/__init__.py#L122
546 2012-01-02T20:35:51 <Dragooon> That's the desired behavior that I need in order for the string to behave correctly
547 2012-01-02T20:36:01 <Dragooon> But the entity code is simply messing up the escaping
548 2012-01-02T20:37:58 <ThomasWaldmann> i am missing context here, can you just answer there?
549 2012-01-02T20:45:55 <Dragooon> ThomasWaldmann: Replied
550 2012-01-02T20:56:26 <Dragooon> I'll be going in a couple of minutes :)
551 2012-01-02T20:56:42 * ThomasWaldmann looks there
552 2012-01-02T21:04:39 <ThomasWaldmann> Dragooon: hmm, do you need Markup() at the places where you did unescape()?
553 2012-01-02T21:04:56 <Dragooon> Need?
554 2012-01-02T21:05:18 <Dragooon> Oh
555 2012-01-02T21:05:27 <Dragooon> I'm not sure, it worked fine there.
556 2012-01-02T21:05:42 <Dragooon> Mostly because I'm not escaping but unescaping
557 2012-01-02T21:05:50 <Dragooon> I got no idea why it's not escaping for Markup
558 2012-01-02T21:08:17 <ThomasWaldmann> because that is the purpose of Markup, see above :)
559 2012-01-02T21:08:35 <ThomasWaldmann> what you currently seem to do is:
560 2012-01-02T21:08:54 <ThomasWaldmann> render with escape, unescape, escape again = total 1x escaping
561 2012-01-02T21:09:20 <Dragooon> But then why is Markup giving unescaped html?
562 2012-01-02T21:09:39 <ThomasWaldmann> you could also do: render with escape, tell that that is Markup, so it won't escape again = total 1x escaping
563 2012-01-02T21:10:42 <Dragooon> So basically, Markup.escape(content)
564 2012-01-02T21:11:16 <ThomasWaldmann> Markup(whatyoualreadyhaveashtml)
565 2012-01-02T21:12:18 <ThomasWaldmann> maybe have a look at it when you are not under time pressure :)
566 2012-01-02T21:12:52 <Dragooon> Doesn't work?
567 2012-01-02T21:13:01 <Dragooon> Markup(content) returns me unescaped content
568 2012-01-02T21:14:56 <ThomasWaldmann> if you used render_template() to generate the content used there, it should be escaped as needed already
569 2012-01-02T21:15:18 <Dragooon> content is not passed to render_template
570 2012-01-02T21:15:23 <Dragooon> But to atomfeed
571 2012-01-02T21:19:16 <ThomasWaldmann> atomfeed should escape for text mode, and not for html mode, iirc
572 2012-01-02T21:20:02 * ThomasWaldmann will get some food now
573 2012-01-02T21:20:14 <Dragooon> Okay, I'll see if I can figure out something
574 2012-01-02T21:20:24 <Dragooon> But atom feed doesn't work with unescaped html
575 2012-01-02T21:21:15 <Dragooon> What if I treat it as str?
576 2012-01-02T21:21:31 <Dragooon> …hm that would be same
577 2012-01-02T21:30:19 <Dragooon> Anybody else willing to give me a hand?
578 2012-01-02T21:43:24 <Dragooon> Yeah okay, apparently Markup cannot be escaped?
579 2012-01-02T21:48:39 <Dragooon> I'll leave now, but I'm fairly sure there is a issue with markup not being able to escape.
580 2012-01-02T21:50:18 *** Dragooon
581 2012-01-02T21:53:06 *** MattMaker
582 2012-01-02T21:54:17 *** MattMaker
583 2012-01-02T21:58:27 *** MattMaker
584 2012-01-02T22:57:53 *** RogerHaase
585