IRC Logs for #circuits Friday, 2015-05-01

spaceoneprologic: was there a issue for the third-party thing?00:29
prologicthird-party componnets? what you were pasting earlier?00:37
spaceoneno00:38
spaceonewell yes, but i mean is there an issue for00:38
spaceonei just searched for the commits00:38
spaceonebut found them00:38
spaceonehttps://github.com/spaceone/circuits/commit/d05954596f8567201125a07486c1494a6738e48f00:38
prologichmm00:39
prologiclemem see00:39
spaceonei got everything i searched for00:40
prologicahh yeah00:40
prologicnamespaces dn't really work all that well00:40
spaceoneyou don't need to invest time00:40
spaceonewith my patch they are 'fine'00:40
prologicyeah00:41
prologicI feel like that patch is a bit of a hack though tbh00:41
prologicnot really fully understanding what we're trying to achieve with it (yet)00:42
spaceonewell, yes that patch was a hack... i am using this functionality00:43
prologiccan you described how it's being used00:44
prologicand how it works?00:45
spaceonethe problem you had in the past was that some installations don't have the module pkg_resources. So the fallback extend_path() was used. but this does not include the __init__ (imports from there were missing then)00:47
spaceonei am using it in this way:00:47
spaceonehaving ~/git/circuits/circuits (the original github circuits) plus ~/git/circuits.foo/circuits/foo00:48
prologicto what end?00:48
prologicto override components in circuits (original)?00:49
prologicor extend (hacky?) the circuits import namespace00:49
prologicwithout using namespaceSs?00:49
spaceoneto extend circuits00:49
spaceonejust to add subpackages to circuits00:50
spaceonewhich are in a different directory00:50
prologicahh I see00:51
prologicI still feel like this is an awful hack though00:51
prologiclet's see if we can improve it00:51
prologicor find a better way?00:51
prologicif our overall goal is to "extend" the circuits import namespace00:52
prologicwithout using namespaces (which apparently don't really work al that well and aren't really well supported?)00:52
prologicotherwise00:52
prologicthe alternative is to simply not extend or use namespace at all00:52
prologicand just do things like00:52
prologicfrom circuits_foo import Foo00:52
prologicand publish circuits-foo to PyPi00:52
prologicfor example00:52
prologichttps://pypi.python.org/pypi?%3Aaction=search&term=circuits-&submit=search00:53
prologicwe already have such packages too from the community00:53
spaceonehm00:53
prologicso maybe we should just go with the flow00:53
prologicand go with what works well already :)00:53
prologicothers certainly do this00:53
spaceonewill your reverted code break something?00:54
spaceoneor does it just not work 'very well'00:54
spaceonein my tests it works well00:54
spaceone(with a little adition)00:54
prologicumm00:56
prologicin my testing it doesn't work very well at all00:56
prologicthe whole namespaces thing00:56
prologicbut I could be wrong00:56
prologicmaybe we should investigate it again00:56
prologicand properly document it with an Issue?00:56
prologicand feature branch00:56
spaceonejeah01:01
prologicso if you want to try go ahead01:02
prologicwrite up an issue01:02
prologictry the whole namespaces idea again in a feature branch01:02
prologicand we'll go from there01:02
prologicotherwise if it doesn't wor kout01:02
prologicI think we should jsut go with the flow that's already been establisehd by community members in the past01:03
prologicwith01:03
prologiccircuits-my_fancy_package01:03
prologicas a PyPi publication01:03
prologicand circuits_my_fancy_package as teh package name for importing01:03
prologiceither way we should document this and discuss it on GH and sort this out :)01:03
spaceonethis is the code which works for me in any combination → https://github.com/spaceone/circuits.http/blob/master/circuits/__init__.py01:06
prologicahh okay01:07
prologicalright01:07
prologiclet's try this again then01:08
prologicwrite up a new issue01:08
prologiccreate a new feature branch with this01:08
prologicrebase on top of master01:08
prologicand let's try it out again :)01:08
spaceonehttps://github.com/circuits/circuits/issues/2001:10
spaceoneprologic: can i just create a branch and make a pull request with it?01:11
prologicawesome :)01:24
prologicyes yes the way you've done it is great01:24
prologicthanks :)01:24
spaceone;)01:25
spaceonei hope this does not have side effects in py3 or py2.601:25
prologicyeah01:28
prologicsadly we can't drop Python 2.x yet01:28
prologichave to support 2.6/2.7 for a while :)01:28
prologicwe'll probably skip supporting a few 3.x versions though01:28
spaceonei was amazed myself, because the pkg_resources thing works OOTB and even keeps the __init__.py contents (the documentation says the opposite)01:29
spaceonepython2.7 rocks!!! i won't switch to python3 in the next 3 years01:29
spaceonepython2.6 is also okay01:30
prologicyeah I kind of agree tbqh01:31
prologicI'm not ready for Python 3 yet01:31
prologicAlso yield from will change how circuits does coroutines01:31
prologicbut nothing else will change most likely01:31
prologicahh01:33
prologicyeah please improve what we've got there01:33
prologicalso a multiplexed client socket would be good too01:33
prologicI think we'd have to do it as another component name tbh01:33
prologicand deprecate the old TCPClient later on01:34
prologicright now you have to have one TCPClient component instance per connection01:34
prologicthis is silly IHMO01:34
prologicbecause it should be able to handle many connections quite easily if it was reworked a bit01:34
prologicjust like TCPServer does01:34
prologiceach event handler would just get an extra argument01:34
prologicthe client socket for *that* connection01:35
spaceonejeah, i would like to implement things like these01:36
prologicgreat :)01:36
spaceonei hope my current job allows me in the future to have more time for circuits01:36
prologicyeah yeah01:36
spaceonethis is the first night since month that i can programm things01:36
spaceonei think i did not really programm private stuff for a year01:37
prologicyeah it's been a bit like that for me the past year or so as well01:39
prologicI've done a few interesting things but not a lot on circuits per se01:39
prologicit's kind of quite stable where it is; but ther eare still things to do and improve :)01:39
spaceoneyep01:40
prologicit takes use-cases to drive it though -- I was able to do a lot for circuits in my previous job at Griffith University where I used it as the primary backend for a set of RESTful web services01:40
prologiclike proper ReST01:40
pdurbinwow, proper rest01:43
pdurbinI should add it to https://trygvis.io/rest-wiki01:44
pdurbinprologic: pull requests welcome! :)01:45
spaceonepdurbin: what's that?01:46
prologicpdurbin: please do :)01:50
prologichttps://bitbucket.org/ccaih/ccav01:50
prologichttp://ccav.terranova.org.au/01:50
prologicReST as in HATEOS01:51
spaceonenice!01:51
prologicbasically ccav provides a self documenting api with discoverability, content negotiation, a query interface01:51
prologicand copes with changes in the API without breaking older clients01:51
prologicI wish I could have worked on it more01:52
prologicbut I will one day bring a lot of the idea I did there to circuits.web in some way01:52
prologicmaybe as a new separate apcakge01:52
prologiccircuits.rest? :)01:52
spaceonei don't like circuits.rest02:21
spaceonei would not explicitly do 'REST' into a name02:21
spaceonecircuits.http is nice, as it describes what happens02:21
spaceoneif the 'HTTP' is used for REST that's good... if not REST would be the wrong terme02:22
spaceones/e$//02:22
spaceoneprologic: how can i define a handler for a event of instance X? (without subclassing the Component)02:48
prologichandler("foo", channel="X")03:34
prologicwhere instance of X's channel is "X"03:34
prologic@handler("foo", channel="X")03:35
prologicdef _on_foo_X(...):03:35
prologic...03:35
spaceoneah, i can simply define this?03:39
spaceonenice03:39
spaceoneand what is the default priority?03:41
spaceonei have one handler defined and want the second to be executed after the first one03:41
spaceonecan i say priority=1.1 then?03:41
spaceoneprologic: does not work → https://bpaste.net/show/ed915cdf4c9403:54
spaceoneit only works if i put that into a class :/04:03
prologic0 I believe04:22
prologicyes you can :)04:23
prologicoh you don't have to put it in a class04:23
prologicyou can call .addHandler() on the manager04:23
prologicor top-level component04:23
prologicbut you have to still wrap your function with @handler04:23
spaceoneokay, jeah now i remember addHandler04:24
spaceonewell class is faster+cleaner than04:24
prologichttps://github.com/circuits/circuits/blob/ce4e696445739cf3757a75b7ea8a75ce54aaf74a/examples/portforward.py04:24
prologicthe portforward example does this04:24
prologicit might be the most elegant API04:24
prologicbut it's been there since day dot04:24
prologicwell a class based component is more structured - yes04:25
prologicand more reusable04:25
prologic:)04:25
*** FSX has quit IRC09:33
*** FSX has joined #circuits09:33
pdurbinspaceone: it's a new wiki we cooked up: http://irclog.greptilian.com/rest/2015-04-1810:21
spaceonepdurbin: aight10:39
spaceonepdurbin: you know restcookbook?10:39
pdurbinnope10:45
spaceonepdurbin: http://restcookbook.com/10:50
spaceone(i don't really like it but maybe it can be enhanced, i already contributed to it)10:51
*** koobs has quit IRC19:09
*** koobs has joined #circuits19:34
*** koobs has quit IRC20:07
*** koobs has joined #circuits20:34
*** koobs has quit IRC21:33
*** koobs has joined #circuits22:01
*** koobs has quit IRC23:20
*** koobs has joined #circuits23:46
*** koobs has quit IRC23:55

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