IRC Logs for #circuits Friday, 2013-11-15

*** c45y has quit IRC00:20
*** realz has joined #circuits00:46
realzwell pdurbin, now I can stalk you00:47
realz(even more. apparently we already in a lot of channels together :P)00:47
pdurbinrealz: yeah... :)00:47
pdurbinthis is a great channel00:47
pdurbinprologic: you da man00:47
realzpdurbin: haha
pdurbinyeah, I'm totally not a woman. but I have two little girls. maybe they'll be ubuntu women some day :)00:49
prologicthanks guys00:50
prologiccircuits still has a long way to go and lots of improvements00:50
prologicit's by no means perfect :)00:50
prologicbut we've put a lot of work/effort into it over the last 9 years00:50
pdurbinyou can run some nice bots with circuits :)00:53
prologicwell there's quite a few of them already01:16
prologic (full featured, pluggable, but outdated atm)01:17
prologicand those are just mine :)01:17
pdurbinI'm sure circuits is good for other things too :)01:19
prologicwell yes :) web apps01:19
prologicsee the many examples/web/01:19
prologic (a full featured cms/wiki)01:19
prologicand all my websties run off it :)01:20
prologicJustin also uses circuits.web to build commercial web apps for his clients01:20
prologicand there's been quite a few projects running on it01:20
prologicat work I use it for
prologicand circuits has been used in a numb rod home automation systems as well by a few folk that have come and gone01:21
pdurbin is pretty nice01:21
prologicthose are the projects that I'm aware of01:21
prologicthere could/should be more :)01:21
prologicpdurbin:  yeah it's all built with python lots of libraries, fabric and circuits.web01:21
prologicas well as heavy client-side JS ofc01:21
prologicthe main project is actually
prologicwhat I've been working on for the last 12 months01:22
pdurbin"I understand the risks"01:22
prologicthere I updated the Community page01:26
prologicwith a few more examples01:26
prologicyou get a warning?01:27
prologicyou mustn't have our CA root cert01:27
prologicI think we use AusCert01:27
pdurbinnever heard of it ;)01:33
pdurbinprologic: good stuff. I'm just joshin' ya01:34
ircnotifier1 commit(s) pushed to circuits-dev04:26
ircnotifierdab34e5d2080 by prologic: ONly output a graph if the pygraphviz module is also available which requires graphviz by instaleld04:26
ircnotifier1 commit(s) pushed to circuits-dev04:29
ircnotifier2773e3e3d856 by prologic: Fixed specifying optional name for the graph04:29
*** c45y has joined #circuits04:29
prologichey c45y04:30
prologicspaceone:  ping?04:48
ircnotifier2 commit(s) pushed to circuits-dev04:52
ircnotifierb41607e668ae by prologic: Output the .dot file bsed on the given name if given or x.naem04:52
ircnotifier5585a495fe6e by prologic: Fixed erroneous comma04:52
*** Aeoxic has joined #circuits12:38
AeoxicSup prologic12:39
AeoxicI still need to poke about with that yield stuff.13:05
prologicI'm poking around with RPython13:09
prologicand some languag eimplemtnations :)13:09
Aeoxiclemme just grab some food then I'll hound you with question13:11
prologicI'll prolly go make a coffee13:12
prologicand have a shower13:12
prologicthen I'm all yours13:12
AeoxicLet me know.13:34
prologicstill here13:46
prologicask away :)13:46
Aeoxicprologic: Essentially need to fix / get working this "quit subprocess, then quit wrapper"13:50
AeoxicThe problem was that the wraooer was quitting out before I could get to the subprocess.13:51
Aeoxicwrapper, even.13:51
prologicwhat's causing it to quit?13:52
Aeoxicas in13:52
Aeoxicthe events were firing out of order13:52
Aeoxicso I need to force the wrapper quit to wait for the subprocess13:52
prologicshow me an entire Debugger trace of this13:55
AeoxicI can't on this machine, I don't have the setup. ;_;13:57
AeoxicI'll grab it later if you're still around.13:58
AeoxicActually hold on13:58
Aeoxicprologic: Can you explain how I'd use your `wait` functionality with no added classes?14:06
Aeoxic"class foo(Event):" et al is not something I particularly want to add to my code just to make one function call execute after another function call.14:06
prologicwait/call only work with events14:09
prologicand circuits componetns14:09
prologicjust like self.fire14:09
AeoxicSo what would be the best method to do what I'm attempting to?14:11
prologicif you just want to call one function after another14:11
prologicwhy do you need circuits for that? :)14:11
prologicsilly question I nkow14:11
prologicbut still14:11
prologicstill want to see that debugger trace :)14:11
prologicall in all14:12
prologicif you're events are out of sequence14:12
prologicit's up to you to fix that :)14:12
prologicmaybe you're firing something too soon or too late?14:12
prologicevery event fired is put into a queue14:12
prologicand executed in sequence14:12
prologicnow you can create event handlers with higher priotity14:12
prologicand you can even filter i.e: stop other handlers from handling a givne event14:13
prologicyou can even fire an event at a higher or lower priority into the queue14:13
prologicas it's actually a priority queue that's used14:13
Aeoxic[00:11] <prologic> if you just want to call one function after another14:14
Aeoxic[00:11] <prologic> why do you need circuits for that? :)14:14
AeoxicI don't14:14
Aeoxichold on14:14
AeoxicI might be being really idiotic here14:14
AeoxicYeah, prologic, my problem is that the wrapper quits out14:16
Aeoxicnot intentionally 'using' circuits for it14:16
prologicwell that's what I mean14:16
prologiccircuits is not a magic bullet14:17
prologicyou still have normal Python code that you interact with14:17
prologicit's good for a few things:14:17
prologic* Async I/O (has lots of Aynsc I/O components)14:17
prologic* Decoupling functionality into reuseable components14:17
Aeoxic[00:12] <prologic> if you're events are out of sequence14:17
Aeoxic[00:12] <prologic> it's up to you to fix that :)14:17
AeoxicBut they're not out of sequence14:17
prologic* Scaling large complex software14:17
AeoxicI'm calling, in pseudocode, "write 'stop' to subprocess; self.server.stop();"14:18
AeoxicThe function that executes those two is called quit(), so it shouldn't be messing with existing code.14:18
prologicso self.server is a circuits UNIXServer?14:20
prologicand your subprocess is a Minecraft server14:21
prologicwrapped in a circuits Processs component?14:21
AeoxicSure is.14:22
prologicdescribe the problem again exacly?14:25
prologicI'm still confused :(14:25
Aeoxicdef quit(self):14:26
Aeoxic    self.stop_subprocess()14:26
Aeoxic    self.server.stop()14:26
AeoxicThis function doesn't execute in the proper order.14:26
prologicwhich function?14:26
prologicbut you're "stop subprocess"14:27
prologicis:14:27"stop\n"), p._stdin)14:27
AeoxicEssentially, yes.14:27
prologicwhere p is an instance fo your Process/Minecraft wrapped proces14:27
Aeoxicit's actually this:14:27
prologicnow I'm starting to understand14:27
Aeoxicdef stop_subprocess(self):14:27
Aeoxic    self.process._stdin.write("stop\n")14:27
prologicand you want the subprocess to stop14:27
prologicthen the server to stop second14:27
AeoxicThe subprocess has to stop first because it does a bit of saving prior to exit.14:27
AeoxicI want to ensure that always occurs.14:27
prologiccan't you just wait for it to terminate?14:28
prologicI think you'll see a "stop" event no?14:28
prologicwhere's your repo again?14:28
AeoxicHold on14:29
AeoxicI should've just let you see it as opposed to having it public.14:30
prologicsee my commits14:35
prologicnow this should work14:35
prologicbut without the things on my machine that you have14:36
prologicI can't easily test it14:36
prologicunless I fake the minecraft serers somehow14:36
prologicbasically the idea here is to14:36
prologicfire a write event at the process14:36
prologicwith arguments: ("stop\n",)14:36
prologicwait until we see a stopped event come from the process14:36
prologicthen stop the server14:36
prologicit _should_ be that simple14:36
prologicgive or take14:37
AeoxicIf I connect a socket to it and fire "STOP"14:37
AeoxicI just get:14:37
Aeoxic<connect[server] (<socket.socket object, fd=9, family=1, type=2049, proto=0> )>14:37
Aeoxic<_read[server] (<socket.socket object, fd=9, family=1, type=2049, proto=0> )>14:37
Aeoxic<read[server] (<socket.socket object, fd=9, family=1, type=2049, proto=0>, b'STOP' )>14:37
AeoxicAnd then nothing. Server's still running14:37
prologichelp me run this up somehow14:38
prologicwithout having minecraft :)14:38
AeoxicI did just run it14:38
Aeoxicyou mean14:38
Aeoxicwithout the MC process?14:38
AeoxicNo idea off the top of my head tbh.14:38
prologicgive me shell access to wher eyou're running this14:38
AeoxicI'm running this locally.14:38
AeoxicHence the /home/elliot/14:38
prologicso you connect a unix socket client to the server14:39
prologicand write STOP14:39
AeoxicIt's the yield line causing the problem14:39
Aeoxiccommenting that out goes back to the "wrapper quits" issue.14:39
prologicyou're missing some code in that repo14:40
prologicplease commit it14:40 I think14:40
AeoxicSpectreServer is in spectre.py14:40
prologic$ python spectre.py14:41
prologicTraceback (most recent call last):14:41
prologic  File "", line 2, in <module>14:41
prologic    import socketserver14:41
prologicImportError: No module named socketserver14:41
AeoxicSocketServer in python 2.14:41
AeoxicIt's just the ss module from my old testing.14:41
AeoxicI haven't cleaned up the code yet.14:41
prologicumm hold on14:43
prologicshouldn't you be doing something like14:43
prologiccommand = command.strip().lower()14:43
prologicif command == "stop":14:43
prologic   ...14:43
Aeoxicbut for now it fires if I do sock.sendall("STOP".encode())14:44
AeoxicGotta run, way later than I thought.14:52
AeoxicI'll see if I can fix this on my own tomorrow and hop in somewhat earlier than 11pm if not. Cheers.14:52
*** Aeoxic has quit IRC14:52
prologicgimme a min or two14:52
prologicI'm fixing everything I'm finding14:53
prologicbut you'll have to re-add back in your bits14:53
prologicI've stripped it back a bit14:53
spaceoneprologic: pong15:32
prologicjust a quick question re circuits.web15:34
prologicis there any reason we don't or shoudln't15:35
prologicensure every url ends with a /?15:35
spaceoneprologic: uhm.. it's untidy15:42
spaceonewhy should every url end with an / ?15:42
spaceoneonly so called "collections" should end with an /15:43
prologicit makes constructing relative uris a lot easier15:43
prologicif a uri doesn't end with a /15:43
prologicit's impossible to cosntruct a relative uri15:43
prologicunless you add a / to the end15:43
spaceoneno problem15:43
prologiccherrypy for example had and still does have15:43
prologica plugin that internally redirects all /foo into /foo/15:43
spaceoneos.path.join also adds /15:43
spaceoneif not available15:44
spaceonei don't want uri's like /blog/my-great-article/15:44
spaceonebecause /blog/ is the collection15:44
spaceonebut the other one isn't15:44
prologicI'll think of some other solution to this15:45
prologicI've just run into it a few too many times15:45
prologicit's inconvenient to write:15:45
spaceoneos.path.join(URI('/foo'), URI('bar'))15:45
prologicif self.uri._path.endswith("/"):15:45
prologic   ...15:45
prologic    ...15:45
*** koobs has quit IRC19:35
*** koobs has joined #circuits19:37

Generated by 2.11.0 by Marius Gedminas - find it at!