Monday, 2010-02-08

*** TDJACR has quit IRC00:02
*** TDJACR has joined #cc00:05
*** TDJACR has quit IRC00:09
*** TDJACR has joined #cc00:12
*** Danny_B has quit IRC00:21
*** luisv has quit IRC00:21
*** luisv has joined #cc00:22
*** Danny_B has joined #cc00:23
*** Kaetemi__ has joined #cc00:47
*** Kaetemi__ has joined #cc00:47
*** Kaetemi has quit IRC00:50
*** shellac has quit IRC01:10
*** luis__ has joined #cc02:03
*** luis__ has quit IRC02:43
*** luis__ has joined #cc02:46
*** luis__ has quit IRC03:42
*** JoiIto has joined #cc03:43
*** JoiIto has quit IRC03:50
*** luisv has quit IRC03:58
*** JoiIto has joined #cc04:00
*** JoiIto1 has joined #cc04:07
*** JoiIto has quit IRC04:08
*** JoiIto has joined #cc04:08
*** JoiIto has quit IRC04:09
*** JoiIto1 has quit IRC04:11
*** JoiIto has joined #cc04:18
*** luisv has joined #cc04:31
*** luisv has quit IRC05:13
*** luisv has joined #cc05:18
*** JoiIto has quit IRC06:05
*** JoiIto has joined #cc06:11
*** sama has joined #cc06:21
*** Kaetemi__ has quit IRC07:10
*** sama has quit IRC07:23
*** Bovinity has quit IRC09:05
*** JoiIto has quit IRC09:15
*** wormsxulla has quit IRC09:40
*** wormsxulla has joined #cc09:59
*** Kaetemi has joined #cc10:05
*** Kaetemi has joined #cc10:05
*** thomg has joined #cc10:30
*** thomg has quit IRC10:45
*** Kaetemi has quit IRC11:39
*** Kaetemi has joined #cc11:45
*** augustinas has joined #cc12:58
augustinashello here :]12:58
*** JoiIto has joined #cc13:07
*** Kaetemi has quit IRC13:13
*** JoiIto has quit IRC13:26
*** JoiIto has joined #cc13:27
*** JoiIto has quit IRC13:31
*** nasenbaerchen has joined #cc13:43
*** nasenbaerchen has left #cc13:43
*** tvol has joined #cc13:52
*** luisv has quit IRC15:44
*** tvol has quit IRC16:17
*** tvol has joined #cc16:20
*** Kaetemi has joined #cc16:27
*** Kaetemi has joined #cc16:27
*** Kaetemi__ has joined #cc16:28
*** Kaetemi__ has joined #cc16:28
*** Kaetemi has quit IRC16:30
*** Kaetemi__ is now known as Kaetemi16:30
*** Bovinity has joined #cc16:50
*** Bovinity has quit IRC16:56
*** nathany has joined #cc17:09
*** jgay has joined #cc17:09
paroneayeanathany: pd_waiting_verification <- is this view in the old cc0 code deprecated?  It's written but the configure.zcml file doesn't point to it, and it seems to be using the more "generic" email view17:13
nathanyparoneayea, yeah, i think that's probably a copy and paste carry over from the old PDC code17:14
paroneayeaok cool, thx17:17
*** JED3 has joined #cc17:24
*** k9d-925 has joined #cc17:28
*** mralex has joined #cc17:42
*** michi__ has joined #cc17:52
*** luisv has joined #cc17:54
*** akozak has joined #cc18:04
*** nathany has quit IRC18:09
*** nathany has joined #cc18:10
paroneayeaJED3: so did you catch the email I sent you friday night?18:22
JED3paroneayea, yep, thanks a ton for that18:22
paroneayeaone more point against librdf :\18:23
*** michi__ has quit IRC18:23
paroneayeaand np18:24
JED3paroneayea, appears to be more of an issue with libxml218:24
paroneayeaJED3: you think so?  hm18:24
paroneayeanathany suggested it may have to do with both lxml and librdf accessing libxml2 at once18:25
JED3paroneayea, yeah i think thats exactly it18:25
JED3libxml2 has a global/thread-local state18:26
paroneayeaahhhh18:27
nathanyJED3, paroneayea, FWIW I don't have an answer for what to do, just identified the likely culprit :)18:27
paroneayeanathany: simple answer, we'll just rewrite libxml2! ;)18:28
paroneayeajk jk jk18:28
*** sama has joined #cc18:28
JED3haah, how troubling would it be to move to rdflib?18:28
JED3not giving up on a solution, just curious18:29
paroneayeawell, I've had other seriously irritating issues with the librdf bindings (some very simple queries that take 5 minutes to run, had to use list comprehensions in python to make up for it :( )18:31
paroneayeaso a move to rdflib would personally be something I'd be interested in investigating18:31
nathanyJED3, paroneayea: unfortunately its not 100% clear to me that rdflib has sufficient sparql support for everything we're doing18:32
nathanythat's my biggest caveat ATM18:32
paroneayeanathany: ah, hm :\18:32
paroneayeawell, yeah, a pretty big caveat18:32
nathanyso... yeah18:32
paroneayeahowever it doesn't really seem *possible* to get around that libxml2 issue, does it?18:34
paroneayeaor is it?18:34
paroneayeawhat's using lxml again?18:35
paroneayeain cc.license18:35
paroneayeaoh right18:35
JED3nathany, are the concerns with the sparql speed or features? if features which portions of the sparql spec aren't covered in rdflib (just for my own knowledge)18:35
paroneayeathe xslt stuff, duh18:35
paroneayeayes I am curious about this also18:36
JED3paroneayea, i think i may have a hack for it18:36
JED3... testing said hack now18:36
nathanyJED3, paroneayea: see http://www.w3.org/2001/sw/DataAccess/tests/implementations18:46
nathanyFWIW rasqal didn't have full support either18:46
nathanyso may not matter18:46
mralexis NK off?18:47
paroneayeahm18:47
mralexno wonder people can't use timemachine, the password for the backup server is wrong and/or the required user is missing.18:47
nathanyyes, until tomorrow18:47
JED3paroneayea, ping19:31
paroneayeaJED3: pong19:45
JED3hi, I am trying to use the licenseselector class for CC0 but am getting an IndexError19:47
paroneayeahm19:47
paroneayeacould you paste how you are trying to use it?19:48
JED3CC0HTMLFormatter().format(LicenseSelector("http://creativecommons.org/publicdomain/zero/"))19:48
JED3Traceback (most recent call last):19:48
JED3  File "<console>", line 1, in <module>19:48
JED3  File "/home/jed/p/cc/cc.license/cc/license/selectors/classes.py", line 28, in __init__19:48
JED3    if child.get('id') != self.id:19:48
JED3  File "/home/jed/p/cc/cc.license/cc/license/selectors/classes.py", line 45, in id19:48
JED3    self._id = rdf_helper.get_selector_id(self.uri)19:48
JED3  File "/home/jed/p/cc/cc.license/cc/license/_lib/rdf_helper.py", line 298, in get_selector_id19:48
JED3    return str(solns[0]['lcode'].literal_value['string'])19:48
JED3IndexError: list index out of range19:48
paroneayeaI think part of the answer might be that I haven't really been using the LicenseSelector19:49
paroneayeaI've just been doing cc.license.by_code('CC0')19:49
paroneayeaso I do19:49
paroneayeaCC0HTMLFormatter().format(cc.license.by_code('CC0'))19:49
JED3awesome, that'll work just as well, thx19:50
paroneayea:)19:50
*** sama has quit IRC20:06
*** JoiIto has joined #cc20:10
JED3paroneayea & nathany, my libxml2 bork fork: http://dpaste.com/156278/20:16
paroneayeabork fork20:16
JED3paroneayea, tehehe and it works just fine20:17
JED3albeit completely hackish20:17
paroneayeawait20:17
paroneayeawhat is happening?20:17
paroneayeaoh20:17
paroneayeaoh I see20:17
paroneayeaa subprocess :)20:17
paroneayeayes, hackish, but also works, and that is good20:18
JED3:) brb lunch20:18
paroneayeaif this were perl we would have been doing it from the beginning anyway20:18
paroneayeathis is unix, I know this20:18
paroneayeakk20:19
akozakawesome http://googlingwithkittens.com/20:57
*** JoiIto has quit IRC21:28
*** jgay has quit IRC21:43
JED3nathany, ping22:26
nathanyJED3, pong22:31
JED3nathany, nm i think i answered my own question22:31
nathanyawesome, glad i could help22:32
* paroneayea asks an annoying question to fill the void22:32
paroneayeanathany, JED3: how skilled are either or both of you at solving unicode decoding errors that appear to be somewhere deep in the zope i18n machinery?22:32
paroneayeathis little character is causing me hell: —22:33
nathanyparoneayea, can you be more specific about the error it's causing?22:33
paroneayeasure :)22:34
paroneayeaso in the .po files there's this entry:22:34
paroneayea#: c/engine/chooser_pages/gpl.pt:63 c/engine/chooser_pages/lgpl.pt:6622:34
paroneayeamsgid "license.fsf_how_it_works"22:34
paroneayeamsgstr ""22:34
paroneayea"Here's how the CC-GNU ${license_code} works: A user clicking on the "22:34
paroneayea"Creative Commons icon gets the CC-GNU ${license_code} \"<a "22:34
paroneayea"href=\"/licenses/${license_code}/${version_title}/\">Commons Deed</a>\" —"22:34
paroneayea" a human readable version of the license. From that she can link to \"<a "22:34
paroneayea"href=\"http://www.gnu.org/licenses/old-"22:34
paroneayea"licenses/${license_name_lower}.html\">Legal Code</a>\" — the full text of"22:35
paroneayeaoh shoot that was a big paste, sorry22:35
paroneayeawell anyway, I'm getting this error:22:35
nathanyparoneayea, ok22:35
paroneayeahttp://dpaste.com/156339/22:36
nathanyparoneayea, what does sys.getdefaultencoding()22:36
nathanyreturn for you?22:36
paroneayea'ascii'22:37
nathanyparoneayea, ah-ha!22:37
paroneayeaI'm aware you can change that to utf-8, but I thought that was considered a no-no?22:37
nathanyparoneayea, i'm not sure why it's considered a no-no, beyond that it means mucking with the deployment22:37
paroneayeahttp://farmdev.com/talks/unicode/ <- so says kumar's talk22:37
paroneayeahm22:37
nathanylet me look22:38
nathanyi reject his assertion that it's more trouble than it's worth; apparently he hasn't dealt with tracebacks like yours :)22:40
nathany(but let me look closer)22:40
nathanyparoneayea, at least he lists "default Python 2 encoding is 'ascii'" in the summary of problems22:41
nathanyparoneayea, does util.plain_template_view load the template from the package?22:41
paroneayeautil.plain_template view calls cc.license.formatters.pagetemplate.CCLPageTemplateFile22:43
paroneayeaby default plain ZPT doesn't provide any functionality for i18n at all, it leaves a method open for you to define it yourself22:43
paroneayea... which I had to dig and dig to figure that out ;p22:43
nathanyparoneayea, uh, ok; so are you reading the template from the file or is zope.* code doing that?22:44
nathanyit looks like if you do .decode() when you read it, that might fix things22:44
paroneayeait's not the template that's doing it though22:45
paroneayeaer, not the character in the template22:45
paroneayeait's what's being returned by translate()22:45
paroneayeazope.i18n.translate that is22:46
paroneayeatry this:22:46
paroneayea>>> from cc.i18npkg import ccorg_i18n_setup22:48
paroneayea>>> from zope.i18n import translate22:48
paroneayea>>> translate('license.fsf_how_it_works', 'cc_org', {u'version_title': u'2.0', u'license_url': u'http://creativecommons.org/licenses/GPL/2.0/', u'license_name_lower': u'gpl-2.0', u'license_code': u'GPL'}, default='stupid default here', target_language='en')22:48
paroneayeait dies once it tries doing the interpolation of values unfortunately :\22:49
nathanyi see22:50
nathanyi suppose the "right" solution would be to update our PO files and encode them as ASCII (if that'd even work with the em-dash)22:50
paroneayeais that right though?  Plenty of PO files won't fit into ascii22:51
nathanyhrm22:51
nathanytrue22:51
paroneayeathe weird thing is:22:51
paroneayeathis works in zope22:51
paroneayeatheoretically, zope is also calling translate()22:52
nathanywhat do you mean "in zope"22:52
paroneayeain the old cc.engine22:52
nathanysure22:52
nathanywe have the default encoding set to utf-8 :D22:52
paroneayea..... ahhh22:52
nathanywasn't that easy? ;)22:52
nathanyseriously, it seems like the issue is that you need to decode when you load the PO file22:52
nathanythere's no reliable way to do detection, so you can't just "fix" zope.i18n22:53
paroneayeado you mean load the PO file to convert to the MO file or load the MO file22:53
nathanyoh, right22:53
nathanyok, no idea22:53
nathany(forgot about the MOs)22:53
paroneayeaat any rate, I don't know *where* I'd do that, I've been looking at the cc.i18npkg.ccorg_i18n_setup hackery I wrote22:54
paroneayeastrange thing is though, most languages do not break22:54
paroneayeajust this stupid dash22:54
paroneayeachinese loads just fine, and so it must be able to load utf-8... I don't know why it's breaking like this22:55
nathanyparoneayea, does chinese actually interpolate?22:55
nathanyit seems like it's not the loading that's the issue, it's the interpolation22:55
paroneayearight that's true, but it should be dying on the deeds also then for the interpolation22:56
paroneayeahttp://127.0.0.1:6543/licenses/by/3.0/deed.ar22:56
paroneayealooking at arabic right now on my computer22:56
paroneayealoads all pretty22:56
paroneayeahm22:56
paroneayeamaybe  there *isn't* interpolation on the deeds22:57
nathanyparoneayea, there isn't22:57
paroneayeaI bet the formatters are breaking then as well22:57
paroneayeaokay, so there seem to be two solutions here:22:57
paroneayea - super easy theoretically gross solution: just set the default encoding to utf-822:58
paroneayea - don't use zope.i18n.translate, use something else22:58
paroneayeaI guess I'll just try the former for now22:58
nathanyparoneayea, well if you want to follow kumar's advice, i have a third suggestion22:58
paroneayeaoh22:58
paroneayeaI am all ears22:58
nathanyhe says to decode early, right?22:58
paroneayearight22:59
nathanyso cc.i18npkg is what loads the PO files from disk via GettextMessageCatalog22:59
nathanysee http://svn.zope.org/zope.i18n/trunk/src/zope/i18n/gettextmessagecatalog.py?rev=75140&view=auto22:59
nathanyobviously the reload method is where that should be decoding and it's not22:59
nathanyso why not subclass and support an optional encoding22:59
nathanyuse the codecs module in an overriden reload23:00
paroneayeahm, yeah I can do that23:00
* paroneayea wonders if he should also send a patch to zope so they DTRT to start with23:00
nathanyshould take 5 minutes to write + test23:00
nathanyparoneayea, what would that patch be?23:00
paroneayeaI don't know :)23:00
nathany:)23:00
paroneayeaokay23:01
paroneayeathat's a good idea23:01
paroneayeaI will take this route23:01
nathanythey're not going to try and guess the encoding; we might be able to add a different messagecatalog that supported decoding23:01
nathanyfwiw i have commit privileges @ zope23:01
paroneayeacool23:01
paroneayeathanks!  This saves me a lot of sanity23:01
paroneayeahar har har, pun intended23:01
nathanyanyway, see if that fixes the problem23:01
nathany:)23:01
paroneayeanathany: also good news23:02
paroneayeaafter I finish this, and pass the target_lang into a few areas where I was lazy23:02
paroneayeawe can stage cc.engine!23:02
nathanyawesome23:04
JED3nathany, sorry my question still remains...23:04
JED3http://api.creativecommons.org/docs/readme_dev.html#license-return-format23:05
JED3why is dc namespaced in the in rdf block of the result xml?23:05
nathanyJED3, if you pass in a title or author, it gets used in the resulting RDF23:06
nathany(as part of the work information)23:07
JED3paroneayea, is there a way to get RDF for a license with a work_dict using cc.license?23:19
JED3basically what cc.license.by_code('by').rdf but with RDF about a work as well23:20
paroneayeaJED3: RDFa you mean?23:23
JED3no, RDF23:23
paroneayeanot afaik23:24
JED3ahh okay, see the <rdf> block here: http://api.creativecommons.org/docs/readme_dev.html#license-return-format23:24
paroneayeaonly think that I've worked in that had work_dict/work_info shenanigans is the formatter23:24
paroneayeahtml formatter23:24
paroneayeayeah I don't know what the correct route for that is :)23:24
paroneayeaalso if you did it, you would have to create two separate setups for cc0 and everything else, right?  Because CC0 takes different values in for the work_dict, at least in the case of the htmlformatter23:25
JED3paroneayea, yeah, nathany just let me know that I don't have to worry about it because its being dprecated23:29
JED3less work for me, score!23:29
*** nathany has quit IRC23:30
*** wormsxulla has quit IRC23:46

Generated by irclog2html.py 2.6 by Marius Gedminas - find it at mg.pov.lt!