I'm a student from Arlington and am spending full-time this week and next working on the IRC Activity. I'm trying to implement this feature: http://bugs.sugarlabs.org/ticket/581 - which is to have the IRC Activity recover some information from the Journal when a saved instance is resumed (namely, the server, nickname, channels, and scrollback history - so you're back in the place you last left your conversation).
I'm stuck, and haven't been able to find what to do next from either googling around the wiki or asking on IRC, or blogging about it ( https://sites.google.com/a/lv5.org/bvworks/home/working-with-sugarlabs/journalimplementationtoxoirc)<https://sites.google.com/a/lv5.org/bvworks/home/working-with-sugarlabs/journalimplementationtoxoirc%29>. Here's what I've done so far (also summarized on the ticket) and the questions I think I need answered - any help would be appreciated. To get started, I looked up on how the journal interacts with a Sugar Activity, which is through the write_file() and read_file() methods. The write_file() method of the activity will save the data given from it and will be used later from the journal using the read_file() method. Nicknames are stored in Network.nicks in irc.py. Channels are stored in Core.channels in core.py. The server is stored in Network.server in irc.py. I haven't found out where all the messages go at the moment. When making the write_file(), I was able to read in the current nickname, server, and channels. When I try putting them back in when opening the latest journal, I just get the default settings. Default nickname, default server, and default channels. The server makes sense, because irc.freenode.net was written in the code when opening up. The channels and nicknames were also written in the code as well, but I thought running add_channel() or run_command("/nick myname") would overwrite those settings. For channels, when I ran the command "/join," it did not actually add the channel into the the Core.channels list. It only works if I put the line "add_channel(#example)" into the code. so now I have some questions hoping to be answered: * How can I overwrite the settings wanted? * Where can I find the text for the history scrollback? * Do the commands /nick and /join actually store the information to their respected lists * What is the proper way to write the write_file() and read_file() methods for a sugar activity. I've seen two ways (using metadata and writing/reading into files), but I'm not sure what works best for this type of situation. Any help would be appreciated. I'm nhacbv in #sugar and am usually online during the US workday. --- Bao Vuong
_______________________________________________ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel