« first day (1 day earlier)      last day (482 days later) » 

10:00 AM
ok, cya
 
@ProgramFOX @ArtOfCode cya
@ProgramFOX Oh, Command objects still need a ref to chatbot
I'm not sure how to make that happen
 
I know, doing that together with the builtin-split.
 
maybe a set_bot() function there afterall?
okay, cool
I look forward to seeing what it becomes
I did some small commits btw
merging should be easy
 
Yeah, I saw them.
 
Would you prefer if I waited longer with commits untill some changes have accumulated
It's basically a question of clutter vs not knowing what a commit actually did
 
10:03 AM
No, feel free to commit whenever you want.
Ah, this is annoying, importing a module from a subdirectory is easy but importing the Module file from the top directory is harder...
oh wait, it isn't
Working with Python packages is a bit of a pain, but just doing import Module from the subdirectory works fine.
 
10:22 AM
>>> __import__('builtins.utils')
<module 'builtins' from 'builtins\__init__.pyc'>
eh
for some reason it imports the init...
Adding this to the __init__.py file helps:
from utils import *
Aha! We should use importlib instead of __import__
That works \o/
 
Bot started.
 
>>alive
?
>>utc
>>listcommands
 
@ProgramFOX Commands: listcommands, random, randomchoice, randomint, shuffle, translate, xkcd, xkcdrandomnumber
 
>>alive
@FOX9000 That works but that isn't included in the separate module...
Ah, of course, I don't return the value. facepalm
 
Bot started.
 
10:28 AM
>>alive
...
>>utc
 
Wed Jul 1 10:29:07 2015
 
on the console it works...
perhaps a dead websocket or something
>>alive
As I thought! The bot auto-rejoins the room on a dead websocket.
>>alive
 
@ProgramFOX Yes, I'm alive.
 
YEESSSSSS!
2
@overactor ^ :D
now some more refactoring is needed to split up all commands and avoid superfluous code
 
user153821
Bot started.
 
10:36 AM
>>points star 22494023
>>alive
 
user153821
Bot started.
 
>>points star 22494023
 
Oh @ArtOfCode, just in case the bot does not respond and there are no errors, the cause is most likely a dead websocket. The bot will auto-recover from this.
 
Oooh fair enough
The stars work now
 
\o/
whoops the refactoring broke my unit tests
 
10:39 AM
well that sounds like fun
>>points get
 
user153821
@ArtOfCode 589
 
>>points admin ArtOfCode 411
 
user153821
@ArtOfCode Changed points for ArtOfCode by 411. New total: 1000
 
tests fixed
 
Good good
 
10:42 AM
there were very few anyway
 
@Zizouz212 When you're around, can you have a go at implementing a stars dictionary, with load and save?
Like "who starred this message"
so something like
 
Bot started.
 
>>listcommands
 
Points = {
    27364652: "ArtOfCode"
}
 
oh, screw you, websockets
>>alive
whatever I'll use the console then
ah, it just recovered
>>listcommands
pffft
 
10:45 AM
Commands: alive, help, listcommands, random, randomchoice, randomint, shuffle, translate, utc, xkcd, xkcdrandomnumber
 
>>xkcd 926
 
And... including module commands in listcommands is :D
 
>>xkcd 926
...
 
@ArtOfCode websockets are dead, I don't know whether it's just on my end or not
 
oh my bot's crashed
 
10:47 AM
bot manually killed
 
user153821
Bot started.
 
>>xkcd 926
 
user153821
 
Now there's one I haven't seen before
>>points get
 
user153821
@ArtOfCode 689
 
10:49 AM
>>listcommands
 
user153821
@ArtOfCode Commands: alive, help, listcommands, points, random, randomchoice, randomint, shuffle, translate, utc, xkcd, xkcdrandomnumber
 
Bot started.
 
>>listcommands
 
:22494264
 
user153821
@ProgramFOX Commands: alive, help, listcommands, points, random, randomchoice, randomint, shuffle, translate, utc, xkcd, xkcdrandomnumber
 
10:49 AM
uh oh two bots
 
this will be fun
 
... and mine is broken
 
:22494264... interesting
it's meant to be a reply
 
yeah
but the return value is empty somehow
ah, yup
 
I guess if we're stopping bots we should do so from the console, to avoid killiing both
 
user153821
10:50 AM
Bot terminating
 
I registered the command as "listcommand"...
 
...
yeah
 
Bot started.
 
user153821
Bot started.
 
@ArtOfCode shouldn't matter, we don't have privileges on the other bot anyway
 
10:51 AM
Ah that's true
 
>>listcommands
 
@ProgramFOX Commands: alive, help, listcommands, random, randomchoice, randomint, shuffle, translate, utc, xkcd, xkcdrandomnumber
 
stopped
 
there we go
>>somerandomtesting
 
:22494313
 
10:52 AM
um
it should say "Command not found."
 
not meant to happen...
 
ah, I found the cause
 
Bot started.
 
>>Randomtesting
 
@ProgramFOX Command not found.
 
10:54 AM
\o/
>>Stop
 
@ProgramFOX Bot terminated.
 
:)
 
Bot started.
 
>>hello
 
@ArtOfCode Command not found.
 
10:59 AM
>>xkcd 1000
 
>>xkcd 22
 
And that's another few commands put in a module :D
>>stop
 
@ProgramFOX Bot terminated.
 
10:59 AM
>>xkcd 233
 
user153821
Bot started.
 
>>xkcd 222
...
 
websockets, probably
 
>>xkcd 223
yeah
 
user153821
 
11:01 AM
I'm off for lunch.
 
hokey oke
about an hour before me, strangely
 
>>points star 22494022
Hi guys
@ProgramFOX Awesome
Hi @ArtOfCode
 
@overactor afternoon
 
@ArtOfCode barely
 
11:25 AM
I'm back.
 
@ProgramFOX Hi there awesome
work
I'm looking if I can get the path to the module be relative to where the current module file is
 
I'm going to continue on splitting up the modules. Then the biggest part of the refactoring is done. Thanks a lot for your help @overactor!
 
@ProgramFOX No problem, I'll work on the relative paths
 
@overactor The relative paths? Oh, that's fixed already.
You don't need to worry about them if you import the Module file in your module as import Module or from Module import Commands or similar.
 
@ProgramFOX I want to be the problem is that now for every module, you need the relative path from Module.py to the module
 
11:34 AM
@overactor yeah, that's stored in ModuleManifest.py, but what's the problem with having those paths there?
 
btw, passing the bot as an argument to the command execute function was pretty smart
@ProgramFOX Well, If i want to add a MetaModule from someone else, I have to change his MetaModule file
 
:)
@overactor Change his MetaModule file? You only have to change your Manifest file, not?
 
since it might not be in the same folder in my project
 
Oh, if you want to import stuff from another folder you'll get into trouble with the imports.
 
yup
 
11:37 AM
The modules have to be either in the same directory, or in a subdirectory, then it will work.
 
I just want to paste in the folder, add it to my Manifest and done
@ProgramFOX I tried, it didn't work
 
What didn't work? Same dir, or subdir?
 
subdir
wait
 
don't forget to put an __init__.py file in your subdir and to use dots instead of slashes in the manifest, see my code
 
do you always have to add a '.' ?
 
11:38 AM
I currently use a subdir.
 
if it's in the same dir
 
a question mark?
 
.
sorry
 
if it's in the same dir, you'll never have to put a dot at all
if it's in a subdir, use a dot to replace a slash
 
ah no wait, same dir didn't work
I put
meta.py
# The modules listed in this file can be read and loaded as a MetaModule into another MetaModule by the load_module() function

modules = [ # A list of all (Meta)Modules in this MetaModule.
    'utils',
    'xkcd',
    'nested.NestedModule'
    # ...
]
in the builtins dir
ModulesManifest.py
module_file_names = [
    'builtins.meta'
]
NestedModule.py is in builtins/nested
 
11:40 AM
You might need to add builtin. before the file names in your modules list.
 
It didn't find utils though
@ProgramFOX That's exactly what I don't want
 
Ah, now I see.
 
But I have an idea
when I import a module file. I'll see in what dir it is relative to me
and add that before the path
 
... unless it is already added before the path
 
@ProgramFOX you're not allowed to add it
only relative paths
 
11:42 AM
oh
well, that should work
 
(relative from the metamodule to the submodule)
 
Bot started.
 
>>random
 
@ProgramFOX 0.0935019037368
 
\o/
builtins.random -> modularized!
>>stop
 
11:50 AM
@ProgramFOX Bot terminated.
 
I might have it
 
Hey :D
 
@overactor nice!
@Zizouz212 hi!
 
hey
 
@Zizouz212 hey
 
11:59 AM
I saw my name pop up, what's up?
 
damn, didn't work
 
What are you trying to do?
 

« first day (1 day earlier)      last day (482 days later) »