IRC Logs for #circuits Friday, 2013-03-22

prologicspaceone, ping?00:46
prologicjgiorgi, yeah I don't like that approach either :)00:47
prologicjgiorgi, I'll make these changes to circuits probably tonight in my experimental branch and get you to try them out soon00:47
*** Osso has joined #circuits01:00
*** ronny_ has joined #circuits05:50
*** ronny has quit IRC05:53
spaceoneprologic: pong07:44
prologichey spaceone07:46
prologicIHMO (and that of ronny_ ) unicode support is still horribly broken somehow07:46
prologicyou any good at this?07:46
prologicit doesn't help when my primary development machine does not support unicode07:47
spaceonethere exists machines without unicode support?07:47
ronny_prologic made it of madness :P07:47
spaceoneprologic: ronny_: ok, maybe we have to forbid non-ascii in headers?07:48
prologicyes mine!07:48
prologicor at least my very old desktop07:48
prologicforbid non-ascii in headers?07:48
prologicumm no07:48
prologicthat will break anyone running on a non-ascii server]07:49
spaceonein the header key i meant07:49
prologicas reported by some users07:49
prologicwhat does the spec say?07:49
spaceonei did not read07:49
ronny_headers are latin107:49
spaceoneso the test is invalid07:50
prologicronny_, for keys?07:51
ronny_prologic, i'd have to read the spec again07:52
spaceoneThe  field-name must be composed of printable ASCII characters08:02
spaceone        (i.e., characters that  have  values  between  33.  and  126.,08:02
spaceone        decimal, except colon).08:02
prologicand values?08:02
ronny_spaceone, wait, isnt that mime messages?08:03
spaceonefield-body-contents =08:04
spaceone                   <the ASCII characters making up the field-body, as08:04
spaceone                    defined in the following sections, and consisting08:04
spaceone                    of combinations of atom, quoted-string, and08:04
spaceone                    specials tokens, or else consisting of texts>08:04
prologicyeah isn't rfs822 mime messages?08:04
spaceoneronny_: Standard for ARPA Internet Text Messages08:04
spaceoneas you can see: refers to it08:05
ronny_spaceone, i vaugely remember that http was slightly different with some of the stuff08:06
spaceoneronny_:  HTTP header fields, which include general-header (section 4.5),08:06
spaceone   request-header (section 5.3), response-header (section 6.2), and08:06
spaceone   entity-header (section 7.1) fields, follow the same generic format as08:07
spaceone   that given in Section 3.1 of RFC 822 [9].08:07
prologicif I'm reading this correctly08:09
prologicheader keys are ascii08:09
prologicwhilst values can be almost anything08:10
prologicso in our parser we probably should raise an exception InvalidRequest for any invalid header keys in the request08:10
prologicnot in the range 33-12608:11
spaceoneprologic: but not in the parser08:11
prologicbut still I think there is still something broken in how we treat http header values wrt unicode08:11
spaceonewe must do this in the header class08:11
prologicbut it confused me greatly ;/08:11
spaceonemy problem is python208:12
prologicsure ok08:12
prologicI'll leave in your capable hands to fix up the parser/headers unicode mess? :)08:12
prologicI'm going to bed!08:12
prologicSat Mar 23 02:10:56 EST 201308:12
spaceonehmm, if it is ok to wait until 8th march08:12
prologicI'll mark a chore to review unicode support in the parser/headers code08:13
spaceonelighttpd disallows also '08:51
spaceoneapache allows them08:51
ronny_lighttpd is a mess :)08:53
jgiorgithat's an understatement08:55
jgiorgii love lightttpd but configuration as too much of a headache08:55
jgiorgiwhat conditions would cause Controller to not have a request attribute09:49
jgiorgifigured it out, when the method is a generator the request attribute doesnt get set09:52
spaceonenet/ is a really nice API now09:58
jgiorgiwell with a couple workarounds the first frankencircuits.web powered website is up, just transitioned over and it's literally nothing more than a config file and some templates10:13
spaceonetransfer closed with 3382 bytes remaining to read10:16
spaceonejgiorgi: you are dispatching to apache?10:18
jgiorgiapache is acting as a proxy10:18
spaceoneah ok10:18
*** Osso has quit IRC10:22
spaceonejgiorgi: your site is down!?10:25
jgiorgihrmm not from this end10:26
spaceonehmm, it blocks me10:26
jgiorgihrmm did you fall in the bottrap?10:27
spaceonebottrap ?10:27
jgiorgia 1x1px image designed to ban bots that dont follow robots.txt10:27
jgiorgibut i have no IPs in the ban list10:27
spaceoneit works already10:27
jgiorgibut me and w3 can see the site, so can my phone10:28
jgiorgiok cool10:28
spaceoneyes i can see it10:28
jgiorgimobile version too, all from the same files just a UAgent module to change it around a bit10:29
spaceoneif 'facebook' in request.headers.get('User-Agent'): socket.write('HTTP/2.0 600 FUCK-YOU'); socket.close()10:30
spaceonejgiorgi: it is only reachable going through apache?10:36
*** Osso has joined #circuits10:36
jgiorgijgiorgi: yeah apache proxies from port 80 to a localhost port10:43
jgiorgiand you're not far off10:43
spaceoneoff ?10:43
spaceonewhat do you mean10:44
jgiorgire.compile(".*?facebook, IGNORECASE|DOTALL)10:44
spaceoneah ok10:44
jgiorgipass that in to UAgent in order and agents, assign it to a variable set with forbidden=True10:44
jgiorgiatm you have to handle forbidden but i10:44
jgiorgii'm writting a module to filter it automatically10:44
*** Osso has quit IRC10:52
*** Osso has joined #circuits11:12
*** Osso has quit IRC11:41
*** Osso has joined #circuits11:44
spaceonejgiorgi: where is the client's IP? (i don't want to look at the code now)12:49
spaceonerequest.remote.ip or something like this?12:49
prologicspaceone, yes14:23
prologicjgiorgi, yeah Controllers and coroutines don't work too well the self.request and self.response disappear ;/14:23
spaceoneprologic: good morning14:23
prologicjgiorgi, not sure if that's solveable at all14:24
prologicjgiorgi, but you can get them from the event object14:24
prologicclass Foo(Controller):14:24
prologic   def index(self, event, *args, **kwargs):14:24
prologic      request, response = event.args14:24
prologic      ...14:24
prologicspaceone, you made some improvements to the net.sockets api?14:26
spaceoneprologic: no14:26
spaceoneprologic: since you did14:26
prologicthanks :)14:26
prologicspaceone, create yourself a .hgrc config14:27
spaceonethe circuits.core is really a nice thing14:27
prologicand enable fetch14:27
prologicI'll paste mine14:27
spaceonei have?14:27
prologicuse mine as-is (just change user and emails) if you like14:28
prologicinstead of doing hg pull -u14:28
prologicand hg merge ...14:28
prologicjust do hg fetch <path>14:28
prologicdoes pull, update and merge automatically for you14:28
spaceoneprologic: flake is python syntax parser?14:29
prologicI use flake8 in vim14:30
prologicand as a commit hook14:30
*** Osso has quit IRC14:38
spaceoneok, i will do this too14:42
prologicI find it quite useful :)14:43
prologicmakes for better code, less mistakes14:43
prologicand good coding style14:43
*** mehere has joined #circuits14:53
spaceoneprologic: btw. must we note the copyright when we 'borrowed' MIT code?15:15
spaceonewhy not?15:16
prologicMIT permits modification of the code15:16
prologicin any form whatsoever15:16
spaceonebut we must include copyright?!15:16
prologicoh wait15:17
prologichang on15:17
prologicyeah the copyright must stay15:17
prologicand the license15:17
prologicbut no other restrictions15:17
prologicwhy do you ask?15:17
spaceoneso, is the copyright required at the code15:17
spaceoneprologic: because we are doing this15:17
spaceonebut we did not note this15:17
prologicMIT doesn't really specify15:18
prologicit's more about the LICENSE file itself15:18
prologicthe copyright in the license file15:18
prologicand the contents of the license text15:18
prologicmentions nothing about code15:18
prologicbut hey I'm not a lawyer :)15:19
spaceonei dont think that nayone mind15:19
spaceonebecause we are also MIT15:19
prologicI've asked every author of the respective parts we borrowed15:19
prologicexcept pyquerystring parser15:20
prologicand they're okay with it15:20
prologicI'm gonig to try and push back our small improvements to the http parser later15:20
prologicbbl - going out for breakfast15:21
spaceoneokay, have a nive meal!15:21
*** ronny_ has quit IRC15:26
*** ronny has joined #circuits15:28
*** ronny has quit IRC16:11
spaceoneprologic: what is Request.handlet ?17:30
prologicjust an internal flag that's set18:34
prologicso we can tell when the request has been handled18:34
prologicand completed18:34
spaceoneprologic: ok, thanks18:35
prologicsame with Response.done18:35
prologicjust internal flags18:35
spaceonewhat is the difference?18:35
prologicI'm not really 100% sure :)18:36
prologicWe could in theory do away with both flags18:36
prologicby utilizing .call/.wait more in circuits.web18:36
prologicbut that involves much rewrite of the event flows18:36
prologicjust leave it for now ihmo18:36
prologicI need to add tests for18:39
prologicnon-ssl client -> ssl server18:39
prologicand ssl-client -> non-ssl server18:39
prologicwere there are tests I forgot to add?18:39
spaceonei will inform you if i remember18:39
spaceonemaybe i will write some tests18:40
spaceonefor malformed requests ;) :D18:40
prologicplease do18:40
prologicadd them to tests.web/test_bad_request.py18:41
spaceoneprologic: you need to explain me one thing18:45
spaceonei am doing @handler('request') ...18:45
spaceonei am returning the response.body there18:46
prologicyeah ok18:46
spaceonewhere is the Response() event fired?18:46
prologicin the request_success handler in HTTP18:46
spaceoneand this will automatically be fired?18:47
prologicprobably L388 of circuits.web.http18:47
spaceone(WebEvent has an success property)18:47
spaceoneand where/when is it fired? after the request handler is executed?18:48
prologicyes after a successful event handler has completed all it's handlers18:48
prologicL574 of circuits.core.managers18:49
prologicif error is None and event.success:18:49
prologic   ...18:49
spaceoneah ok18:49
spaceonenice thing :D18:49
prologicyes it is18:49
prologicwe have 3 general properties that control "Event Feedback" (as we call it in circuits)18:50
prologicsuccess, failure and complete18:50
spaceoneprologic: is success set to false if the handler raised an exception?18:51
prologicbut the FooSuccess event is never fired18:51
prologicbecause error will not be None18:51
prologicif error is None and event.success:18:52
prologicif error is not None and event.failure:18:52
prologicsame thing for FooFailure18:52
prologicFooComplete however will and should fire regardless18:52
prologicif event.complete:18:52
prologichowever FooComplete only fires18:53
prologiciif (if and only if) all subsequent events caused by Foo have also completed18:53
prologicso it's recursive18:53
prologicand keeps track of who fired what when18:53
spaceoneprologic: all events are case insensitive?18:53
prologiccause and effect18:53
prologicno they are very much case sensitive18:53
prologicthey are all hashed in dicts and cached18:54
prologicbut there are 3 kinds of events18:54
prologicI normally personally only use the one18:54
prologicThere is Event18:54
spaceonebut Foo.__class__.__name__.lower() ?18:54
prologicand LiteralEvent18:54
prologicyes so for display purposes18:54
prologicit's all CamelCase18:54
prologicfor actual key hashing/caching18:55
prologicFooComplete -> foo_complete18:55
prologicFooBar -> foo_bar18:55
prologicmake sense?18:55
prologic<Response_Success[web.response_success] (<Response[web.response] (<Response 200 OK text/plain (0)> )>, None )>18:56
prologicI'm a liar18:56
prologicI guess that changed somehow18:56
prologicI expected it to be:18:56
prologic<ResponseSuccess[web.response_success] (<Response[web.response] (<Response 200 OK text/plain (0)> )>, None )>18:56
prologicbut it only affects display18:57
prologicmight look into that18:57
prologicmust be something to do with the Success/Failure/Complete events18:58
prologicbut what I said is actually true-ish18:58
prologicahh easily fixed18:59
prologicsomeone made DerivedEvents name attribute with a _ in the middle of the two names19:00
prologichmm no that behavior is right :)19:13
prologic*phew* :)19:13
spaceoneprologic: do you have something similar to cherrypys reprconfig?21:20
prologicI do in sahriswiki21:34
prologicbut not in circuits no21:34
prologicI figure any project can pip install foo21:34
prologicand use something21:34
spaceonei might rip it off21:35
spaceonei removed most of cherrypy21:35
prologicI think there are similar libs on pypi21:42
prologicthat do this kind of config stuff21:42
spaceoneah ok21:43
prologiclemme know if you find a good one :()21:45
spaceonei am thinking about going to sleep21:46
spaceonebut it is morning21:46
spaceonethe birds are singing21:46
spaceonethe sun is shining21:46
spaceonei am not really tired21:47
prologicyou stayed up all night?22:00
prologicI was up till 3am last night :(22:00
*** ronny has joined #circuits23:39

Generated by 2.11.0 by Marius Gedminas - find it at!