You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(4) |
Nov
(14) |
Dec
(9) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(5) |
Feb
(42) |
Mar
(47) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <svn...@mu...> - 2007-03-20 16:33:29
|
Author: daelstorm Date: 2007-03-20 17:33:17 +0100 (Tue, 20 Mar 2007) New Revision: 505 Modified: branches/newnet/museeq/museeq.pro Log: Don't include trayicon headers/source if it's not wanted Modified: branches/newnet/museeq/museeq.pro =================================================================== --- branches/newnet/museeq/museeq.pro 2007-03-20 16:04:37 UTC (rev 504) +++ branches/newnet/museeq/museeq.pro 2007-03-20 16:33:17 UTC (rev 505) @@ -28,9 +28,10 @@ INSTALLS += ICONS_mikelabo_triangles ICONS_mikelabo_silk ICONS_bluebox ICONS_default ICONS_birdies INSTALLS += translations INSTALLS += museeq -# HELP +# Comment the next two lines out, if they cause problems UNAME = $$system(uname -s) message( You appear to be running $$UNAME $$system(uname -r) ) +# HELP message('qmake build options are: "CONFIG+=QSA BINRELOC TRAYICON" PREFIX="/path"') message('Read the INSTALL file more more information.') ############################################################################### @@ -54,6 +55,8 @@ } TRAYICON { DEFINES += HAVE_TRAYICON=1 + SOURCES += trayicon.cpp + HEADERS += trayicon.h } ############################################################################### @@ -109,7 +112,6 @@ transferlistitem.h \ transferlistview.h \ transfers.h \ - trayicon.h \ trustlist.h \ userinfo.h \ userinfodialog.h \ @@ -168,7 +170,6 @@ transferlistitem.cpp \ transferlistview.cpp \ transfers.cpp \ - trayicon.cpp \ trustlist.cpp \ userinfo.cpp \ userinfodialog.cpp \ |
From: <svn...@mu...> - 2007-03-20 16:04:48
|
Author: daelstorm Date: 2007-03-20 17:04:37 +0100 (Tue, 20 Mar 2007) New Revision: 504 Added: branches/newnet/museeq/system.h Log: Museeq: add system.h Added: branches/newnet/museeq/system.h =================================================================== --- branches/newnet/museeq/system.h (rev 0) +++ branches/newnet/museeq/system.h 2007-03-20 16:04:37 UTC (rev 504) @@ -0,0 +1,9 @@ +/* Auto-generated by build script, do not edit */ + +#ifndef SYSTEM_H +#define SYSTEM_H + +#include <errno.h> +typedef unsigned int uint32; + +#endif |
From: <svn...@mu...> - 2007-03-20 09:53:06
|
Author: daelstorm Date: 2007-03-20 10:52:55 +0100 (Tue, 20 Mar 2007) New Revision: 503 Modified: branches/newnet/museeq/ branches/newnet/museeq/museeq.pro Log: Mucipher is now an external Property changes on: branches/newnet/museeq ___________________________________________________________________ Name: svn:externals + Mucipher http://museek-plus.org/svn/branches/newnet/Mucipher Modified: branches/newnet/museeq/museeq.pro =================================================================== --- branches/newnet/museeq/museeq.pro 2007-03-20 09:32:00 UTC (rev 502) +++ branches/newnet/museeq/museeq.pro 2007-03-20 09:52:55 UTC (rev 503) @@ -5,8 +5,8 @@ TARGET = museeq QMAKE_COPY = cp -pf TEMPLATE = app -DEPENDPATH += ../Mucipher -INCLUDEPATH += ../Mucipher +DEPENDPATH += Mucipher +INCLUDEPATH += Mucipher MUSEEQDATA = /share/museek/museeq OBJECTS_DIR = workdir DESTDIR = workdir |
From: <svn...@mu...> - 2007-03-20 09:32:11
|
Author: daelstorm Date: 2007-03-20 10:32:00 +0100 (Tue, 20 Mar 2007) New Revision: 502 Modified: branches/newnet/museeq/INSTALL branches/newnet/museeq/images.cpp branches/newnet/museeq/mainwin.cpp branches/newnet/museeq/museeq.pro branches/newnet/museeq/updatetranslations.py Log: Museeq: qmake now installs translations, icons, scripts and has several commandline options you can pass; read the INSTALL Modified: branches/newnet/museeq/INSTALL =================================================================== --- branches/newnet/museeq/INSTALL 2007-03-20 07:42:27 UTC (rev 501) +++ branches/newnet/museeq/INSTALL 2007-03-20 09:32:00 UTC (rev 502) @@ -9,11 +9,35 @@ * make * g++ ( GCC for C++ ) +Qmake Options: + + CONFIG OPTIONS + * QSA: Scripting Support + * BINRELOC: Binary Relocation + * TRAYICON: Compile Trayicon + + OTHER OPTIONS + * PREFIX: If you do not use BINRELOC, you should set PREFIX to whatever + path museeq will be installed into. (Same path as make's INSTALL_ROOT) + PREFIX defaults to /usr + +Example Qmake commands: + * qmake "CONFIG += QSA BINRELOC TRAYICON" + * qmake "CONFIG += QSA BINRELOC" + * qmake "CONFIG += QSA" "PREFIX+=/usr" + * qmake "PREFIX=/usr/local" + * qmake + +Make Options: + * INSTALL_ROOT: the prefix of the path where museeq will be installed + INSTALL_ROOT must be set, or it'll be installed in /bin and /share + # If you want translations, run updatetranslations.py -1) Example: ./updatetranslations.py $QTDIR fr de + 1) Example: ./updatetranslations.py $QTDIR fr de # Generate Makefile -2) qmake + 2) qmake # Compile -3) make + 3) make # Installation -4) su -c "make install INSTALL_ROOT=/usr" \ No newline at end of file + 4) su -c "make install INSTALL_ROOT=/usr" + or sudo make install INSTALL_ROOT=/usr Modified: branches/newnet/museeq/images.cpp =================================================================== --- branches/newnet/museeq/images.cpp 2007-03-20 07:42:27 UTC (rev 501) +++ branches/newnet/museeq/images.cpp 2007-03-20 09:32:00 UTC (rev 502) @@ -40,7 +40,7 @@ } } // Try the DATADIR path - QString file (QString(DATADIR) + "/museek/museeq/default/" + icon + ".png"); + QString file (QString(DATADIR) + "/museek/museeq/icons/default/" + icon + ".png"); if (QFile::exists(file)) { QPixmap p = QPixmap(file); @@ -48,7 +48,7 @@ return (*iconcache)[icon]; } else { // Try /usr/share/ - file = ("/usr/share/museek/museeq/default/" + icon + ".png"); + file = ("/usr/share/museek/museeq/icons/default/" + icon + ".png"); if (QFile::exists(file)) { QPixmap p = QPixmap(file); Modified: branches/newnet/museeq/mainwin.cpp =================================================================== --- branches/newnet/museeq/mainwin.cpp 2007-03-20 07:42:27 UTC (rev 501) +++ branches/newnet/museeq/mainwin.cpp 2007-03-20 09:32:00 UTC (rev 502) @@ -730,7 +730,7 @@ void MainWindow::changeTheme() { QSettings settings; - QString _path = QString(DATADIR) + "/museek/museeq"; + QString _path = QString(DATADIR) + "/museek/museeq/icons"; QDir dir (_path); QFileDialog * fd = new QFileDialog(dir.path(), "", this); fd->setCaption(tr("Enter a Museeq Icon Theme Directory")); Modified: branches/newnet/museeq/museeq.pro =================================================================== --- branches/newnet/museeq/museeq.pro 2007-03-20 07:42:27 UTC (rev 501) +++ branches/newnet/museeq/museeq.pro 2007-03-20 09:32:00 UTC (rev 502) @@ -1,27 +1,64 @@ -###################################################################### -# Automatically generated by qmake (1.07a) Tue Mar 20 06:37:28 2007 -###################################################################### -CONFIG += qt +# daelstorm was here +# Created 2007, March, 20th + +CONFIG += qt TARGET = museeq QMAKE_COPY = cp -pf TEMPLATE = app DEPENDPATH += ../Mucipher INCLUDEPATH += ../Mucipher -unix:LIBS += -lqsa -DEFINES += ENABLE_BINRELOC=1 HAVE_QSA=1 HAVE_QSA_DIALOG=1 HAVE_QSA_UTIL=1 -unix:DEFINES += HAVE_TRAYICON=1 +MUSEEQDATA = /share/museek/museeq OBJECTS_DIR = workdir -DESTDIR = workdir - -MUSEEQDATA = /share/museek/museeq +DESTDIR = workdir translations.path = $${MUSEEQDATA}/translations -translations.files = translations/museeq_*.qm +translations.files = workdir/translations/museeq_*.qm museeq.path = /bin museeq.files = workdir/museeq - +# Icons +ICONS_birdies.path = $${MUSEEQDATA}/icons/birdies +ICONS_birdies.files = birdies/*.png +ICONS_default.path = $${MUSEEQDATA}/icons/default +ICONS_default.files = default/*.png +ICONS_bluebox.path = $${MUSEEQDATA}/icons/bluebox +ICONS_bluebox.files = bluebox/*.png +ICONS_mikelabo_silk.path = $${MUSEEQDATA}/icons/mikelabo-silk +ICONS_mikelabo_silk.files = mikelabo-silk/*.png +ICONS_mikelabo_triangles.path = $${MUSEEQDATA}/icons/mikelabo-tri +ICONS_mikelabo_triangles.files = mikelabo-tri/*.png +INSTALLS += ICONS_mikelabo_triangles ICONS_mikelabo_silk ICONS_bluebox ICONS_default ICONS_birdies INSTALLS += translations INSTALLS += museeq +# HELP +UNAME = $$system(uname -s) +message( You appear to be running $$UNAME $$system(uname -r) ) +message('qmake build options are: "CONFIG+=QSA BINRELOC TRAYICON" PREFIX="/path"') +message('Read the INSTALL file more more information.') +############################################################################### +# DEFINES # +############################################################################### +isEmpty(PREFIX) { + PREFIX = /usr +} +BINRELOC { + DEFINES += ENABLE_BINRELOC=1 +} +!BINRELOC { DEFINES += DATADIR=\"$${PREFIX}$${MUSEEQDATA}\" +} +QSA { + DEFINES += HAVE_QSA=1 HAVE_QSA_DIALOG=1 HAVE_QSA_UTIL=1 + LIBS += -lqsa + scripts.path = $${MUSEEQDATA} + scripts.files = *.qs + INSTALLS += scripts +} +TRAYICON { + DEFINES += HAVE_TRAYICON=1 +} +############################################################################### + + + # Input HEADERS += aclineedit.h \ banlist.h \ Modified: branches/newnet/museeq/updatetranslations.py =================================================================== --- branches/newnet/museeq/updatetranslations.py 2007-03-20 07:42:27 UTC (rev 501) +++ branches/newnet/museeq/updatetranslations.py 2007-03-20 09:32:00 UTC (rev 502) @@ -38,7 +38,7 @@ continue else: print mess - translation_build(tr_dir+"museeq_"+lang+".qm", lsources ) + translation_build("workdir/translations/"+"museeq_"+lang+".qm", lsources ) def make_qm(ts_templates): @@ -71,7 +71,9 @@ lrelease = "" tr_dir = "translations/" - + destdir = "workdir/translations/" + if not os.path.exists(destdir): + os.mkdir(destdir) if len(trs) == 0: trs = ['fr','de','es','it','pl','ru','pt_BR','ja','zh','sk','he', 'ar', 'cs' ] |
From: <svn...@mu...> - 2007-03-20 07:42:36
|
Author: daelstorm Date: 2007-03-20 08:42:27 +0100 (Tue, 20 Mar 2007) New Revision: 501 Added: branches/newnet/museeq/INSTALL Modified: branches/newnet/museeq/museeq.pro Log: Add INSTALL file; museeq gets installed to /bin Added: branches/newnet/museeq/INSTALL =================================================================== --- branches/newnet/museeq/INSTALL (rev 0) +++ branches/newnet/museeq/INSTALL 2007-03-20 07:42:27 UTC (rev 501) @@ -0,0 +1,19 @@ +Museeq's Qmake compilation instructions + +Requirements: + * The Mucipher source should be in the parent directory ( ../Mucipher ) + If it is not, place it there or modify the museeq.pro to point at it. + * Install QT 3.x Development packages, if needed, which should include: + * qmake, lrelease, lupdate, moc, uic + * Other required utilities include: + * make + * g++ ( GCC for C++ ) + +# If you want translations, run updatetranslations.py +1) Example: ./updatetranslations.py $QTDIR fr de +# Generate Makefile +2) qmake +# Compile +3) make +# Installation +4) su -c "make install INSTALL_ROOT=/usr" \ No newline at end of file Modified: branches/newnet/museeq/museeq.pro =================================================================== --- branches/newnet/museeq/museeq.pro 2007-03-20 07:28:45 UTC (rev 500) +++ branches/newnet/museeq/museeq.pro 2007-03-20 07:42:27 UTC (rev 501) @@ -5,7 +5,7 @@ TARGET = museeq QMAKE_COPY = cp -pf TEMPLATE = app -DEPENDPATH += ../Mucipher translations +DEPENDPATH += ../Mucipher INCLUDEPATH += ../Mucipher unix:LIBS += -lqsa DEFINES += ENABLE_BINRELOC=1 HAVE_QSA=1 HAVE_QSA_DIALOG=1 HAVE_QSA_UTIL=1 @@ -17,6 +17,7 @@ translations.path = $${MUSEEQDATA}/translations translations.files = translations/museeq_*.qm museeq.path = /bin +museeq.files = workdir/museeq INSTALLS += translations INSTALLS += museeq |
From: <svn...@mu...> - 2007-03-18 06:30:43
|
Author: daelstorm Date: 2007-03-18 07:30:32 +0100 (Sun, 18 Mar 2007) New Revision: 499 Added: branches/newnet/python-bindings/messages.py Log: Newnet: Add message.py Added: branches/newnet/python-bindings/messages.py =================================================================== --- branches/newnet/python-bindings/messages.py (rev 0) +++ branches/newnet/python-bindings/messages.py 2007-03-18 06:30:32 UTC (rev 499) @@ -0,0 +1,1045 @@ +# pymuseekd - Python tools for museekd +# +# Copyright (C) 2003-2004 Hyriand <hy...@th...> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +import struct + +# Event mask +EM_CHAT = 1 << 0 +EM_PRIVATE = 1 << 1 +EM_TRANSFERS = 1 << 2 +EM_USERINFO = 1 << 3 +EM_USERSHARES = 1 << 4 +EM_INTERESTS = 1 << 5 +EM_CONFIG = 1 << 6 +EM_DEBUG = 1 << 7 + +# Transfer state +TS_Finished = 0 +TS_Transferring = 1 +TS_Negotiating = 2 +TS_Waiting = 3 +TS_Establishing = 4 +TS_Initiating = 5 +TS_Connecting = 6 +TS_Queued = 7 +TS_Address = 8 +TS_Status = 9 +TS_Offline = 10 +TS_ConnectionClosed = 11 +TS_CannotConnect = 12 +TS_Aborted = 13 +TS_Error = 14 + +class BaseMessage: + cipher = None + def __init__(self): + pass + + def make(self): + print "make called on unsupported message type" + sys.stdout.flush() + return "" + + def parse(self, msg): + print "parse called on unsupported message type" + sys.stdout.flush() + return None + + def pack_int(self, i): + return struct.pack("<i", i) + + def pack_uint(self, i): + return struct.pack("<I", i) + + def pack_off(self, i): + return struct.pack("<Q", i) + + def pack_string(self, s): + return self.pack_int(len(s)) + s + + def unpack_int(self, d): + return struct.unpack("<i", d[:4])[0], d[4:] + + def unpack_uint(self, d): + return struct.unpack("<I", d[:4])[0], d[4:] + + def unpack_off(self, d): + return struct.unpack("<Q", d[:8])[0], d[8:] + + def unpack_string(self, d): + l, d = self.unpack_uint(d) + return d[0:l], d[l:] + + def unpack_pos_off(self, d, pos): + return struct.unpack("<Q", d[pos:pos+8])[0], pos+8 + + def unpack_pos_uint(self, d, pos): + return struct.unpack("<I", d[pos:pos+4])[0], pos+4 + + def unpack_pos_string(self, data, position): + lenstring, position = self.unpack_pos_uint(data, position) + string = data[position:position+lenstring] + return string, position+lenstring + + def unpack_cipher(self, d): + l, d = self.unpack_uint(d); + if(l % 16) != 0: + l_c = ((l / 16) + 1) * 16 + else: + l_c = l + return self.cipher.decipher(d[0:l_c])[:l], d[l_c:] + + def pack_cipher(self, s): + return self.pack_uint(len(s)) + self.cipher.cipher(s) + +class Ping(BaseMessage): + code = 0x0000 + def __init__(self, id = None): + self.id = id + + def make(self): + return self.pack_uint(self.code) + self.pack_uint(self.id) + + def parse(self, data): + self.id, data = self.unpack_uint(data) + return self + +class Challenge(BaseMessage): + code = 0x0001 + + def __init__(self): + self.version = None + self.challenge = None + + def parse(self, data): + self.version, data = self.unpack_uint(data) + self.challenge, data = self.unpack_string(data) + return self + +class Login(BaseMessage): + code = 0x0002 + + def __init__(self, algorithm = None, chresponse = None, mask = None): + self.algorithm = algorithm + self.chresponse = chresponse + self.mask = mask + self.result = None + self.msg = None + self.challenge = None + + def make(self): + return self.pack_uint(self.code) + \ + self.pack_string(self.algorithm) + \ + self.pack_string(self.chresponse) + \ + self.pack_uint(self.mask) + + def parse(self, data): + self.result, data = ord(data[0]), data[1:] + self.msg, data = self.unpack_string(data) + self.challenge, data = self.unpack_string(data) + return self + +class ServerState(BaseMessage): + code = 0x0003 + + def __init__(self): + self.state = None + self.username = None + + def parse(self, data): + self.state, data = ord(data[0]), data[1:] + self.username, data = self.unpack_string(data) + return self + +class CheckPrivileges(BaseMessage): + code = 0x0004 + + def __init__(self): + self.time_left = None + + def make(self): + return self.pack_uint(self.code) + + def parse(self, data): + self.time_left, data = self.unpack_uint(data) + return self + +class SetStatus(BaseMessage): + code = 0x0005 + + def __init__(self, status = None): + self.status = status + + def make(self): + return self.pack_uint(self.code) + \ + self.pack_uint(self.status) + + def parse(self, data): + self.status, data = self.unpack_uint(data) + return self + +class StatusMessage(BaseMessage): + code = 0x0010 + + def __init__(self): + self.type = None + self.message = None + + def parse(self, data): + self.type, data = ord(data[0]), data[1:] + self.message, data = self.unpack_string(data) + return self + +class DebugMessage(BaseMessage): + code = 0x0011 + + def __init__(self): + self.domain = None + self.message = None + + def parse(self, data): + self.domain, data = self.unpack_string(data) + self.message, data = self.unpack_string(data) + return self + +class PeerExists(BaseMessage): + code = 0x0201 + + def __init__(self, user = None): + self.user = user + self.exists = None + + def make(self): + return self.pack_uint(self.code) + \ + self.pack_string(self.user) + + def parse(self, data): + self.user, data = self.unpack_string(data) + self.exists = ord(data[0]) + return self + +class PeerAddress(BaseMessage): + code = 0x0206 + + def __init__(self, user = None): + self.user = user + self.ip = None + self.port = None + + def make(self): + return self.pack_uint(self.code) + \ + self.pack_string(self.user) + + def parse(self, data): + self.user, data = self.unpack_string(data) + self.ip, data = self.unpack_string(data) + self.port, data = self.unpack_uint(data) + return self + +class PeerStatus(BaseMessage): + code = 0x0202 + + def __init__(self, user = None): + self.user = user + self.status = None + + def make(self): + return self.pack_uint(self.code) + \ + self.pack_string(self.user) + + def parse(self, data): + self.user, data = self.unpack_string(data) + self.status, data = self.unpack_uint(data) + return self + +class PeerStats(BaseMessage): + code = 0x0203 + + def __init__(self, user = None): + self.user = user + self.avgspeed = None + self.numdownloads = None + self.numfiles = None + self.numdirs = None + + def make(self): + return self.pack_uint(self.code) + \ + self.pack_string(self.user) + + def parse(self, data): + self.user, data = self.unpack_string(data) + self.avgspeed, data = self.unpack_uint(data) + self.numdownloads, data = self.unpack_uint(data) + self.numfiles, data = self.unpack_uint(data) + self.numdirs, data = self.unpack_uint(data) + return self + +class Search(BaseMessage): + code = 0x0401 + + def __init__(self, type = None, query = None): + self.type = type + self.query = query + self.ticket = None + + def make(self): + return self.pack_uint(self.code) + \ + self.pack_uint(self.type) + \ + self.pack_string(self.query) + + def parse(self, data): + self.query, data = self.unpack_string(data) + self.ticket, data = self.unpack_uint(data) + return self + +class SearchReply(BaseMessage): + code = 0x0402 + + def __init__(self): + self.ticket = None + self.user = None + self.free = None + self.speed = None + self.queue = None + self.results = None + + def parse(self, data): + self.ticket, data = self.unpack_uint(data) + self.user, data = self.unpack_string(data) + self.free, data = ord(data[0]), data[1:] + self.speed, data = self.unpack_uint(data) + self.queue, data = self.unpack_uint(data) + n, data = self.unpack_uint(data) + self.results = [] + for i in range(n): + fn, data = self.unpack_string(data) + sz, data = self.unpack_off(data) + ex, data = self.unpack_string(data) + an, data = self.unpack_uint(data) + at = [] + for j in range(an): + a, data = self.unpack_uint(data) + at.append(a) + self.results.append((fn, sz, ex, at)) + return self + +class UserSearch(BaseMessage): + code = 0x0403 + + def __init__(self, user = None, query = None): + self.user = user + self.query = query + self.ticket = None + + def make(self): + return self.pack_uint(self.code) + \ + self.pack_string(self.user) + \ + self.pack_string(self.query) + + +class WishListSearch(BaseMessage): + code = 0x0405 + + def __init__(self, query = None): + self.query = query + self.ticket = None + + def make(self): + return self.pack_uint(self.code) + \ + self.pack_string(self.query) + + +class RoomState(BaseMessage): + code = 0x0300 + + def __init__(self): + self.roomlist = None + self.joined_rooms = None + self.tickers = None + + def parse(self, data): + self.roomlist = {} + pos = 0 + + nr, pos = self.unpack_pos_uint(data, pos) + for i in range(nr): + room, pos = self.unpack_pos_string(data, pos) + users, pos = self.unpack_pos_uint(data, pos) + self.roomlist[room] = users + + self.joined_rooms = {} + self.tickers = {} + n, pos = self.unpack_pos_uint(data, pos) + for i in range(n): + room, pos = self.unpack_pos_string(data, pos) + self.joined_rooms[room] = {} + n2, pos = self.unpack_pos_uint(data, pos) + for j in range(n2): + user, pos = self.unpack_pos_string(data, pos) + status, pos = self.unpack_pos_uint(data, pos) + avgspeed, pos = self.unpack_pos_uint(data, pos) + downloadnum, pos = self.unpack_pos_uint(data, pos) + files, pos = self.unpack_pos_uint(data, pos) + dirs, pos = self.unpack_pos_uint(data, pos) + + slotsfull = ord(data[pos]); pos += 1 + self.joined_rooms[room][user] = [status, avgspeed, downloadnum, files, dirs, slotsfull] + + n3, pos = self.unpack_pos_uint(data, pos) + self.tickers[room] = {} + for j in range(n3): + user, pos = self.unpack_pos_string(data, pos) + message, pos = self.unpack_pos_string(data, pos) + self.tickers[room][user] = message + return self + +class RoomList(BaseMessage): + code = 0x0301 + + def __init__(self): + self.roomlist = None + + def make(self): + return self.pack_uint(self.code) + + def parse(self, data): + self.roomlist = {} + n, data = self.unpack_uint(data); + for i in range (n): + r, data = self.unpack_string(data) + u, data = self.unpack_uint(data) + self.roomlist[r] = u + return self + +class SayRoom(BaseMessage): + code = 0x0307 + + def __init__(self, room = None, line = None): + self.room = room + self.user = None + self.line = line + + def make(self): + return self.pack_uint(self.code) + \ + self.pack_string(self.room) + \ + self.pack_string(self.line) + + def parse(self, data): + self.room, data = self.unpack_string(data) + self.user, data = self.unpack_string(data) + self.line, data = self.unpack_string(data) + return self + +class JoinRoom(BaseMessage): + code = 0x0303 + + def __init__(self, room = None): + self.room = room + self.users = None + + def make(self): + return self.pack_uint(self.code) + \ + self.pack_string(self.room) + + def parse(self, data): + self.users = {} + pos = 0 + self.room, pos = self.unpack_pos_string(data, pos) + n, pos = self.unpack_pos_uint(data, pos) + for i in range(n): + user, pos = self.unpack_pos_string(data, pos) + status, pos = self.unpack_pos_uint(data, pos) + avgspeed, pos = self.unpack_pos_uint(data, pos) + downloadnum, pos = self.unpack_pos_uint(data, pos) + files, pos = self.unpack_pos_uint(data, pos) + dirs, pos = self.unpack_pos_uint(data, pos) + + free = ord(data[pos]); pos += 1 + self.users[user] = [status, avgspeed, downloadnum, files, dirs, free] + return self + +class LeaveRoom(BaseMessage): + code = 0x0304 + + def __init__(self, room = None): + self.room = room + + def make(self): + return self.pack_uint(self.code) + \ + self.pack_string(self.room) + + def parse(self, data): + self.room, data = self.unpack_string(data) + return self + +class UserJoinedRoom(BaseMessage): + code = 0x0305 + + def __init__(self): + self.room = None + self.user = None + self.userdata = None + + def parse(self, data): + self.room, data = self.unpack_string(data) + self.user, data = self.unpack_string(data) + status, data = self.unpack_uint(data) + avgspeed, data = self.unpack_uint(data) + downloadnum, data = self.unpack_uint(data) + files, data = self.unpack_uint(data) + dirs, data = self.unpack_uint(data) + free, data = ord(data[0]), data[1:] + self.userdata = [status, avgspeed, downloadnum, files, dirs, free] + return self + +class UserLeftRoom(BaseMessage): + code = 0x0306 + + def __init__(self): + self.room = None + self.user = None + + def parse(self, data): + self.room, data = self.unpack_string(data) + self.user, data = self.unpack_string(data) + return self + +class RoomTickers(BaseMessage): + code = 0x0308 + + def __init__(self, room = None, tickers = None): + self.room = room + self.tickers = None + def make(self): + return self.pack_uint(self.code) + + def parse(self, data): + self.room, data = self.unpack_string(data) + self.tickers = {} + numtickers, data = self.unpack_uint(data) + for i in range(numtickers): + message, data = self.unpack_string(data) + user, data = self.unpack_string(data) + self.tickers[user] = message + return self + +class RoomTickerSet(BaseMessage): + code = 0x0309 + + def __init__(self, room = None, message = None): + self.room = room + self.message = message + self.user = None + + def make(self): + return self.pack_uint(self.code) + \ + self.pack_string(self.room) + \ + self.pack_string(self.message) + + def parse(self, data): + self.room, data = self.unpack_string(data) + self.user, data = self.unpack_string(data) + self.message, data = self.unpack_string(data) + return self + +class PrivateMessage(BaseMessage): + code = 0x0302 + + def __init__(self, direction = None, user = None, message = None): + self.direction = direction + self.timestamp = None + self.user = user + self.message = message + + def make(self): + return self.pack_uint(self.code) + \ + self.pack_string(self.user) + \ + self.pack_string(self.message) + + def parse(self, data): + self.direction, data = self.unpack_uint(data) + self.timestamp, data = self.unpack_uint(data) + self.user, data = self.unpack_string(data) + self.message, data = self.unpack_string(data) + return self + +class UserInfo(BaseMessage): + code = 0x0204 + + def __init__(self, user = None): + self.user = user + self.info = None + self.picture = None + self.uploads = None + self.queue = None + self.slotsfree = None + + def make(self): + return self.pack_uint(self.code) + \ + self.pack_string(self.user) + + def parse(self, data): + self.user, data = self.unpack_string(data) + self.info, data = self.unpack_string(data) + self.picture, data = self.unpack_string(data) + self.uploads, data = self.unpack_uint(data) + self.queue, data = self.unpack_uint(data) + self.slotsfree, data = ord(data[0]), data[1:] + return self + +class UserShares(BaseMessage): + code = 0x0205 + + def __init__(self, user = None): + self.user = user + self.shares = None + + def make(self): + return self.pack_uint(self.code) + \ + self.pack_string(self.user) + + def parse(self, data): + self.shares = {} + pos = 0 + + self.user, pos = self.unpack_pos_string(data, pos) + dirs, pos = self.unpack_pos_uint(data, pos) + for i in range(dirs): + dir, pos = self.unpack_pos_string(data, pos) + + self.shares[dir] = {} + + files, pos = self.unpack_pos_uint(data, pos) + + for j in range(files): + filename, pos = self.unpack_pos_string(data, pos) + size, pos = self.unpack_pos_off(data, pos) + extension, pos = self.unpack_pos_string(data, pos) + attrs, pos = self.unpack_pos_uint(data, pos) + attributes = [] + for k in range(attrs): + a, pos = self.unpack_pos_uint(data, pos) + attributes.append(a) + + self.shares[dir][filename] = [size, extension, attributes] + return self + + +class GivePrivileges(BaseMessage): + code = 0x0207 + + def __init__(self, user = None, days=None): + self.user = user + self.days = days + + def make(self): + return self.pack_uint(self.code) + \ + self.pack_string(self.user) + \ + self.pack_uint(self.days) + +class Transfer: + def __init__(self, is_upload, user, path, state, error, filepos, filesize, rate, place): + self.is_upload = is_upload + self.user = user + self.path = path + self.state = state + self.error = error + self.filepos = filepos + self.filesize = filesize + self.rate = rate + self.place = place + +class TransferState(BaseMessage): + code = 0x0500 + + def __init__(self): + self.downloads = None + self.uploads = None + + def unpack_transfer(self, data): + is_upload, data = ord(data[0]), data[1:] + user, data = self.unpack_string(data) + path, data = self.unpack_string(data) + place, data = self.unpack_uint(data) + state, data = self.unpack_uint(data) + error, data = self.unpack_string(data) + filepos, data = self.unpack_off(data) + filesize, data = self.unpack_off(data) + rate, data = self.unpack_uint(data) + return Transfer(is_upload, user, path, state, error, filepos, filesize, rate, place), data + + def parse(self, data): + self.uploads = [] + self.downloads = [] + n, data = self.unpack_uint(data) + for i in range(n): + tf, data = self.unpack_transfer(data) + if tf.is_upload: + self.uploads.append(tf) + else: + self.downloads.append(tf) + return self + +class TransferUpdate(TransferState): + code = 0x0501 + + def __init__(self, user = None, path = None): + self.user = user + self.path = path + self.transfer = None + + def make(self): + return self.pack_uint(self.code) + \ + self.pack_string(self.user) + \ + self.pack_string(self.path) + + def parse(self, data): + self.transfer, data = self.unpack_transfer(data) + return self + +class TransferRemove(BaseMessage): + code = 0x0502 + + def __init__(self, upload = None, user = None, path = None): + self.upload = upload + self.user = user + self.path = path + + def make(self): + if self.upload: + upload = chr(1) + else: + upload = chr(0) + return self.pack_uint(self.code) + \ + upload + \ + self.pack_string(self.user) + \ + self.pack_string(self.path) + + def parse(self, data): + self.upload, data = ord(data[0]), data[1:] + self.user, data = self.unpack_string(data) + self.path, data = self.unpack_string(data) + self.transfer = self.upload, self.user, self.path + return self + +class TransferAbort(BaseMessage): + code = 0x0505 + + def __init__(self, upload = None, user = None, path = None): + self.upload = upload + self.user = user + self.path = path + + def make(self): + if self.upload: + upload = chr(1) + else: + upload = chr(0) + return self.pack_uint(self.code) + \ + upload + \ + self.pack_string(self.user) + \ + self.pack_string(self.path) + + def parse(self, data): + self.upload, data = ord(data[0]), data[1:] + self.user, data = self.unpack_string(data) + self.path, data = self.unpack_string(data) + self.transfer = self.upload, self.user, self.path + return self + +class DownloadFile(BaseMessage): + code = 0x0503 + + def __init__(self, user = None, path = None): + self.user = user + self.path = path + + def make(self): + return self.pack_uint(self.code) + \ + self.pack_string(self.user) + \ + self.pack_string(self.path) + +class DownloadFileTo(BaseMessage): + code = 0x0507 + + def __init__(self, user = None, path = None, dpath = None): + self.user = user + self.path = path + self.dpath = dpath + + def make(self): + return self.pack_uint(self.code) + \ + self.pack_string(self.user) + \ + self.pack_string(self.path) + self.pack_string(self.dpath) + +class GetFolderContents(BaseMessage): + code = 0x0504 + + def __init__(self, user = None, folder = None): + self.user = user + self.folder = folder + + def make(self): + return self.pack_uint(self.code) + \ + self.pack_string(self.user) + \ + self.pack_string(self.folder) + +class UploadFile(BaseMessage): + code = 0x0506 + + def __init__(self, user = None, path = None): + self.user = user + self.path = path + + def make(self): + return self.pack_uint(self.code) + \ + self.pack_string(self.user) + \ + self.pack_string(self.path) + +class ConfigState(BaseMessage): + code = 0x0100 + + def __init__(self): + self.config = None + + def parse(self, data): + self.config = {} + domains, data = self.unpack_uint(data) + for i in range(domains): + domain, data = self.unpack_cipher(data) + values = {} + keys, data = self.unpack_uint(data) + for j in range(keys): + key, data = self.unpack_cipher(data) + value, data = self.unpack_cipher(data) + values[key] = value + self.config[domain] = values + return self + +class ConfigSet(BaseMessage): + code = 0x0101 + + def __init__(self, domain = None, key = None, value = None): + self.domain = domain + self.key = key + self.value = value + + def make(self): + return self.pack_uint(self.code) + \ + self.pack_cipher(self.domain) + \ + self.pack_cipher(self.key) + \ + self.pack_cipher(self.value) + + def parse(self, data): + self.domain, data = self.unpack_cipher(data) + self.key, data = self.unpack_cipher(data) + self.value, data = self.unpack_cipher(data) + return self + +class ConfigRemove(BaseMessage): + code = 0x0102 + + def __init__(self, domain = None, key = None): + self.domain = domain + self.key = key + + def make(self): + return self.pack_uint(self.code) + \ + self.pack_cipher(self.domain) + \ + self.pack_cipher(self.key) + + def parse(self, data): + self.domain, data = self.unpack_cipher(data) + self.key, data = self.unpack_cipher(data) + return self + +class GetRecommendations(BaseMessage): + code = 0x0600 + + def __init__(self): + self.recommendations = None + + def make(self): + return self.pack_uint(self.code) + + def parse(self, data): + self.recommendations = {} + n, data = self.unpack_uint(data); + for i in range (n): + r, data = self.unpack_string(data) + u, data = self.unpack_uint(data) + self.recommendations[r] = u + return self + + +class GetGlobalRecommendations(BaseMessage): + code = 0x0601 + + def __init__(self): + self.recommendations = None + + def make(self): + return self.pack_uint(self.code) + + def parse(self, data): + self.recommendations = {} + n, data = self.unpack_uint(data); + for i in range (n): + r, data = self.unpack_string(data) + u, data = self.unpack_uint(data) + self.recommendations[r] = u + return self + +class GetSimilarUsers(BaseMessage): + code = 0x0602 + + def __init__(self): + self.users = None + + def make(self): + return self.pack_uint(self.code) + + def parse(self, data): + self.users = {} + n, data = self.unpack_uint(data); + for i in range (n): + r, data = self.unpack_string(data) + u, data = self.unpack_uint(data) + self.users[r] = u + return self + +class GetItemRecommendations(BaseMessage): + code = 0x0603 + + def __init__(self, item = None): + self.item = item + self.recommendations = None + + def make(self): + return self.pack_uint(self.code) + \ + self.pack_string(self.item) + + def parse(self, data): + self.recommendations = {} + self.item, data = self.unpack_string(data) + n, data = self.unpack_uint(data); + for i in range (n): + r, data = self.unpack_string(data) + u, data = self.unpack_uint(data) + self.recommendations[r] = u + return self + + +class GetItemSimilarUsers(BaseMessage): + code = 0x0604 + + def __init__(self, item = None): + self.item = item + self.users = None + + def make(self): + return self.pack_uint(self.code) + \ + self.pack_string(self.item) + + def parse(self, data): + self.users = {} + self.item, data = self.unpack_string(data) + n, data = self.unpack_uint(data); + for i in range (n): + r, data = self.unpack_string(data) + u, data = self.unpack_uint(data) + self.users[r] = u + return self + + +class AddInterest(BaseMessage): + code = 0x0610 + + def __init__(self, interest = None): + self.interest = interest + + def make(self): + return self.pack_uint(self.code) + \ + self.pack_string(self.interest) + + def parse(self, data): + self.interest, data = self.unpack_string(data) + return self + +class RemoveInterest(BaseMessage): + code = 0x0611 + + def __init__(self, interest = None): + self.interest = interest + + def make(self): + return self.pack_uint(self.code) + \ + self.pack_string(self.interest) + + def parse(self, data): + self.interest, data = self.unpack_string(data) + return self + +class AddHatedInterest(BaseMessage): + code = 0x0612 + + def __init__(self, interest = None): + self.interest = interest + + def make(self): + return self.pack_uint(self.code) + \ + self.pack_string(self.interest) + + def parse(self, data): + self.interest, data = self.unpack_string(data) + return self + +class RemoveHatedInterest(BaseMessage): + code = 0x0613 + + def __init__(self, interest = None): + self.interest = interest + + def make(self): + return self.pack_uint(self.code) + \ + self.pack_string(self.interest) + + def parse(self, data): + self.interest, data = self.unpack_string(data) + return self + + +class ConnectServer(BaseMessage): + code = 0x0700 + + def make(self): + return self.pack_uint(self.code) + +class DisconnectServer(BaseMessage): + code = 0x0701 + + def make(self): + return self.pack_uint(self.code) + +class ReloadShares(BaseMessage): + code = 0x0703 + + def make(self): + return self.pack_uint(self.code) + + |
From: <svn...@mu...> - 2007-03-18 06:19:51
|
Author: daelstorm Date: 2007-03-18 07:19:38 +0100 (Sun, 18 Mar 2007) New Revision: 497 Modified: branches/newnet/murmur/murmur Log: Murmur: remove a debugging message; useless cruft Modified: branches/newnet/murmur/murmur =================================================================== --- branches/newnet/murmur/murmur 2007-03-18 00:54:05 UTC (rev 496) +++ branches/newnet/murmur/murmur 2007-03-18 06:19:38 UTC (rev 497) @@ -2508,9 +2508,7 @@ self.changecolour(self.tag_username, color) def OnClose(self, widget): - #if self.logfile is not None: - #self.logfile.close() - #self.logfile = None + self.chats.remove_page(self.Main) del self.chats.users[self.user] self.Main.destroy() @@ -2525,7 +2523,7 @@ else: if self.user in self.frame.Config["logging"]["private"]: self.frame.Config["logging"]["private"].remove(self.user) - print self.frame.Config["logging"]["private"] + def OnEncodingChanged(self, widget): pass |
From: <svn...@mu...> - 2007-03-17 07:45:36
|
Author: daelstorm Date: 2007-03-17 08:45:28 +0100 (Sat, 17 Mar 2007) New Revision: 495 Modified: branches/newnet/murmur/murmur branches/newnet/murmur/pymurmur/settings.py Log: Murmur: Fix rescanning/adding shares; partially fix autojoin in settings Modified: branches/newnet/murmur/murmur =================================================================== --- branches/newnet/murmur/murmur 2007-03-17 07:00:25 UTC (rev 494) +++ branches/newnet/murmur/murmur 2007-03-17 07:45:28 UTC (rev 495) @@ -2469,8 +2469,8 @@ #else: #self.z = 1 #self.tag_username.set_property("foreground", "#FF0000") - #if self.Log.get_active(): - #self.logfile = WriteLog(self.logfile, self.frame.np.config.sections["logging"]["logsdir"], self.user, line) + if self.Log.get_active(): + self.logfile = WriteLog(self.logfile, self.frame.Config["logging"]["logsdir"], self.user, line) #autoreply = self.frame.np.config.sections["server"]["autoreply"] #if self.frame.away and not self.autoreplied and autoreply: @@ -3305,7 +3305,7 @@ autojoin_check.set_active(False) else: autojoin_check.set_active(False) - autojoin_check.connect("toggled", self.autojoin_check, "check button 1") + autojoin_check.connect("toggled", self.autojoin_check) autojoin_check.show() self.Leave = self.frame.CreateIconButton(gtk.STOCK_CLOSE, "stock", self.OnLeave, _("Leave Room")) @@ -3340,7 +3340,7 @@ self.UpdateColours() - def autojoin_check(self, widget, string): + def autojoin_check(self, widget): if not self.frame.Networking.config.has_key("autojoin"): return @@ -5591,7 +5591,7 @@ "now-playing-prefix": None, "browse_display_mode": "filesystem"}, \ "colors": { "chatme":"FOREST GREEN", "chatremote":"", "useronline":"BLACK", "useraway":"ORANGE","useroffline":"#aa0000", "chatlocal":"BLUE", \ "chathilite":"red", "search":"","searchq":"GREY", "chatfont": "" },\ - "logging": { "logcollapsed": "no", "log_dir": "~/.murmur/logs/", "logrooms": + "logging": { "logcollapsed": "no", "log_dir": os.path.expanduser("~/.murmur/logs/"), "logrooms": "yes", "rooms":[]}, \ "urls":{"urlcatching":1,"protocols":{"http":"firefox %s", "https":"firefox %s"}, "humanizeurls":1},\ \ Modified: branches/newnet/murmur/pymurmur/settings.py =================================================================== --- branches/newnet/murmur/pymurmur/settings.py 2007-03-17 07:00:25 UTC (rev 494) +++ branches/newnet/murmur/pymurmur/settings.py 2007-03-17 07:45:28 UTC (rev 495) @@ -120,7 +120,7 @@ # DIALOGS self.dialogs() - self.vbox.pack_start(self.notebook1) + self.vbox.pack_start(self.MainNotebook) OkButton = self.app.CreateIconButton(gtk.STOCK_OK, "stock", self.click, _("OK")) self.action_area.pack_start(OkButton) @@ -568,15 +568,17 @@ self.selected_items = [] treeview.get_selection().selected_foreach(self.TreeViewSelection3) if self.selected_items != []: - key = self.selected_items - self.RemoveItemFromList(node, key, None, treeview) + for key in self.selected_items: + self.RemoveItemFromList(node, key, None, treeview) def OpenFile(self, widget, title, filters): dialog = gtk.FileChooserDialog(title=title, parent=None, action=gtk.FILE_CHOOSER_ACTION_OPEN, buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT, gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT)) dialog.set_select_multiple(False) - dialog.set_current_folder_uri("file://"+gtk.getcwd().getpwuid(os.getuid())[5]+"/.museekd") + if os.environ.has_key(["HOME"]) and os.path.exists(os.environ["HOME"]+"/.museekd"): + dialog.set_current_folder_uri("file://"+os.environ["HOME"]+"/.museekd") + ff = gtk.FileFilter() for ffilter in filters: ff.add_pattern(ffilter) @@ -657,7 +659,7 @@ def OpenImage(self, widget, title, filters): dialog = gtk.FileChooserDialog(title=title, parent=None, action=gtk.FILE_CHOOSER_ACTION_OPEN, buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT, gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT)) dialog.set_select_multiple(False) - dialog.set_current_folder_uri("file://"+gtk.getcwd().getpwuid(os.getuid())[5]) + dialog.set_current_folder_uri("file://"+os.getcwd()) ff = gtk.FileFilter() for ffilter in filters: ff.add_pattern(ffilter) @@ -789,7 +791,7 @@ def OpenDirectory(self, widget, title): dialog = gtk.FileChooserDialog(title=title, parent=None, action=gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER, buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT, gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT)) dialog.set_select_multiple(False) - dialog.set_current_folder_uri("file://"+gtk.getcwd().getpwuid(os.getuid())[5]) + dialog.set_current_folder_uri("file://"+os.getcwd()) response = dialog.run() @@ -807,7 +809,8 @@ def OpenConfig(self, widget): dialog = gtk.FileChooserDialog(title=_("Select the Museek Daemon Config"), parent=None, action=gtk.FILE_CHOOSER_ACTION_OPEN, buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT, gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT)) dialog.set_select_multiple(False) - dialog.set_current_folder_uri("file://"+gtk.getcwd().getpwuid(os.getuid())[5]+"/.museekd") + if os.environ.has_key(["HOME"]) and os.path.exists(os.environ["HOME"]+"/.museekd"): + dialog.set_current_folder_uri("file://"+os.environ["HOME"]+"/.museekd") ff = gtk.FileFilter() ff.add_pattern("*.xml") dialog.set_property("filter", ff) @@ -2222,6 +2225,10 @@ self.labelMurmur = gtk.Label(_("Murmur")) self.labelMurmur.set_padding(0, 0) self.labelMurmur.show() + + self.labelMurmurLogin = gtk.Label(_("Login")) + self.labelMurmurLogin.set_padding(0, 0) + self.labelMurmurLogin.show() hboxMurmur = gtk.VBox(False, spacing=5) hboxMurmur.set_border_width(5) @@ -2346,34 +2353,51 @@ def dialogs(self): self.encodings= ["UTF-8", "UTF-7", "UTF-16", "UTF-32", "KOI8-R", "ISO8859-1", "ISO8859-2", "ISO8859-3", "ISO8859-4", "ISO8859-5", "ISO8859-6", "ISO8859-7", "ISO8859-8", "ISO8859-9", "ISO8859-10", "ISO8859-11", "ISO8859-13", "ISO8859-14", "ISO8859-15", "ISO8859-16", "CP1250", "CP1251", "CP1252", "CP1253", "CP1254", "CP1255", "CP1256", "CP1257", "CP1258", "CP874"] - self.notebook1 = gtk.Notebook() - self.notebook1.set_tab_pos(gtk.POS_LEFT) - self.notebook1.set_scrollable(False) - self.notebook1.show() + self.MainNotebook = gtk.Notebook() + self.MainNotebook.set_tab_pos(gtk.POS_TOP) + self.MainNotebook.set_scrollable(False) + self.MainNotebook.show() + self.MurmurNotebook = gtk.Notebook() + self.MurmurNotebook.set_tab_pos(gtk.POS_LEFT) + self.MurmurNotebook.set_scrollable(True) + self.MurmurNotebook.show() self.TabMurmur() - self.notebook1.append_page(self.MurmurSW, self.labelMurmur) + self.MurmurNotebook.append_page(self.MurmurSW, self.labelMurmurLogin) + + self.MainNotebook.append_page(self.MurmurNotebook, self.labelMurmur) + + self.MuseekdNotebook = gtk.Notebook() + self.MuseekdNotebook.set_tab_pos(gtk.POS_LEFT) + self.MuseekdNotebook.set_scrollable(True) + self.MuseekdNotebook.show() + + self.labelMuseekd = gtk.Label(_("Museek Daemon")) + self.labelMuseekd.set_padding(0, 0) + self.labelMuseekd.show() + + self.MainNotebook.append_page(self.MuseekdNotebook, self.labelMuseekd) self.TabServer() - self.notebook1.append_page(self.ServerSW, self.label1) + self.MuseekdNotebook.append_page(self.ServerSW, self.label1) self.TabMuseekClients() - self.notebook1.append_page(self.MuseekClientsSW, self.label3) + self.MuseekdNotebook.append_page(self.MuseekClientsSW, self.label3) self.TabTransfers() - self.notebook1.append_page(self.TransfersScrollWindow, self.TransfersLabel) + self.MuseekdNotebook.append_page(self.TransfersScrollWindow, self.TransfersLabel) self.TabChatRoom() - self.notebook1.append_page(self.hboxchat, self.ChatRooms_Label) + self.MuseekdNotebook.append_page(self.hboxchat, self.ChatRooms_Label) self.TabUsers() - self.notebook1.append_page(self.hboxusers, self.users_Label) + self.MuseekdNotebook.append_page(self.hboxusers, self.users_Label) self.TabUserInfo() - self.notebook1.append_page(self.UserInfoSW, self.UserinfoLabel) + self.MuseekdNotebook.append_page(self.UserInfoSW, self.UserinfoLabel) self.TabShares() - self.notebook1.append_page(self.SharesSW, self.sharesDBLabel) + self.MuseekdNotebook.append_page(self.SharesSW, self.sharesDBLabel) def createTreeFor(self, store, treeview, name): |
From: <svn...@mu...> - 2007-03-17 07:00:37
|
Author: daelstorm Date: 2007-03-17 08:00:25 +0100 (Sat, 17 Mar 2007) New Revision: 494 Modified: branches/newnet/murmur/murmur Log: Add URL handling (no GUI config and default is firefox) Modified: branches/newnet/murmur/murmur =================================================================== --- branches/newnet/murmur/murmur 2007-03-17 04:23:01 UTC (rev 493) +++ branches/newnet/murmur/murmur 2007-03-17 07:00:25 UTC (rev 494) @@ -305,7 +305,24 @@ self.config = {} self.invalidpass = 0 self.socket = None + + def CheckNick(self): + try: + if self.frame.username != None: + # We have a username, so we probably logged in successfully + return + message = "Connection is taking a while to start, maybe you are trying to connect to something besides a museek daemon, or you museek daemon is not started? Closing socket to %s.." % self.frame.Config["connection"]["interface"] + if DEBUG == True: + + print message + gobject.idle_add(self.frame.AppendToLogWindow, message) + driver.Driver.close(self) + + except Exception,e: + if DEBUG == True: print "CheckNick ERROR", e + + ## Ping def cb_ping(self): if DEBUG == True: print " **** cb_ping" @@ -980,8 +997,8 @@ try: if self.invalidpass == 0: if self.frame.Config["connection"]["passw"] != None: - #self.timer = threading.Timer(10.0, self.CheckNick) - #self.timer.start() + self.timer = threading.Timer(10.0, self.CheckNick) + self.timer.start() driver.Driver.connect(self, self.frame.Config["connection"]["interface"], self.frame.Config["connection"]["passw"], messages.EM_CHAT | messages.EM_USERINFO| messages.EM_PRIVATE | messages.EM_TRANSFERS | messages.EM_USERSHARES | messages.EM_CONFIG | messages.EM_INTERESTS| messages.EM_DEBUG) if DEBUG == True: @@ -2662,7 +2679,14 @@ self.frame.Muscan.ListNormal() elif cmd == "/listbuddy": self.frame.Muscan.ListBuddy() - + elif cmd in("/join", "/j"): + if not args: + return + self.frame.JoinARoom(args) + elif cmd in ("/c", "/close", "/leave", "/l"): + if not args: + return + self.frame.RoomLeave(args) elif cmd and cmd[:1] == "/" and cmd != "/me" and cmd[:2] != "//": self.frame.AppendToLogWindow(_("Command %s is not recognized") % text) @@ -3468,25 +3492,28 @@ self.frame.Muscan.RescanBuddy() elif cmd == "/addnormaldir": - if args: - self.frame.Muscan.AddNormalDirectory(args) - else: + if not args: return + self.frame.Muscan.AddNormalDirectory(args) + elif cmd == "/removenormaldir": - if args: - self.frame.Muscan.RemoveNormalDirectory(args) - else: + if not args: return + self.frame.Muscan.RemoveNormalDirectory(args) + elif cmd == "/addbuddydir": - if args: - self.frame.Muscan.AddBuddyDirectory(args) - else: + if not args: return + self.frame.Muscan.AddBuddyDirectory(args) + elif cmd == "/removebuddydir": - if args: - self.frame.Muscan.RemoveBuddyDirectory(args) - else: + if not args: return + self.frame.Muscan.RemoveBuddyDirectory(args) + elif cmd in ( "/tick", "/t"): + # TODO + pass + elif cmd == "/listshares": self.frame.Muscan.ListNormal() self.frame.Muscan.ListBuddy() @@ -3494,7 +3521,14 @@ self.frame.Muscan.ListNormal() elif cmd == "/listbuddy": self.frame.Muscan.ListBuddy() - + elif cmd in("/join", "/j"): + if not args: + return + self.frame.JoinARoom(args) + elif cmd in ("/c", "/close", "/leave", "/l"): + if not args: + self.OnLeave("") + self.frame.RoomLeave(args) elif cmd and cmd[:1] == "/" and cmd != "/me" and cmd[:2] != "//": self.frame.AppendToLogWindow(_("Command %s is not recognized") % text) return @@ -3507,7 +3541,7 @@ - COMMANDS = ["/alias ", "/unalias ", "/whois ", "/browse ", "/ip ", "/pm ", "/msg ", "/search ", "/usearch ", "/rsearch ", "/bsearch ", "/join ", "/leave", "/add ", "/buddy ", "/unbuddy ", "/ban ", "/ignore ", "/unban ", "/unignore ", "/clear", "/part ", "/quit", "/rescan", "/tick", "/nsa", "/info", "/ctcpversion", "/rem ", "/cl", "/t", "/a", "/q", "/l", "/p", "/bs", "/rs", "/us", "/s", "/m", "/w", "/al", "/un", "/w", "/updatenormal", "/updatebuddy", "/rescannormal", "/rescanbuddy", "/addnormaldir", "/addbuddydir", "/removenormaldir", "/removebuddydir", "/listshares", "/listnormal", "/listbuddy" ] + COMMANDS = ["/alias ", "/unalias ", "/whois ", "/browse ", "/ip ", "/pm ", "/msg ", "/search ", "/usearch ", "/rsearch ", "/bsearch ", "/join ", "/leave", "/add ", "/buddy ", "/unbuddy ", "/ban ", "/ignore ", "/unban ", "/unignore ", "/clear", "/part ", "/quit", "/rescan", "/tick", "/nsa", "/info", "/ctcpversion", "/rem ", "/cl", "/t", "/a", "/q", "/l", "/p", "/bs", "/rs", "/us", "/s", "/m", "/w", "/al", "/un", "/w", "/updatenormal", "/updatebuddy", "/rescannormal", "/rescanbuddy", "/addnormaldir", "/addbuddydir", "/removenormaldir", "/removebuddydir", "/listshares", "/listnormal", "/listbuddy", "/close", "/leave", "/join" ] def SayInChatRoom(self, user, line): if len(self.lines) >= 400: @@ -3535,6 +3569,7 @@ message = "\n-- ".join(message.split("\n")) self.lines.append(AppendLine(self.chatview, message, None, username=user, usertag=self.tag_users[user])) + if self.frame.username is not None: if user != self.frame.username and self.frame.username in message: self.chatrooms.request_hilite(self.Main) @@ -3563,7 +3598,7 @@ text = widget.get_text()[:ix].split(" ")[-1] list = self.users.keys() + [i for i in self.frame.Networking.config["buddies"] ] + ["murmur"] if ix == len(text) and text[:1] == "/": - list += self.COMMANDS + list += self.COMMANDS #["/"+k for k in self.frame.np.config.aliases.keys()] + completion, single = self.frame.GetCompletion(text, list) if completion: @@ -3574,6 +3609,7 @@ widget.set_position(ix + len(completion)) widget.emit_stop_by_name("key_press_event") return True + def UserJoinedRoom(self, username): if self.users.has_key(username): return @@ -5552,19 +5588,21 @@ "museekd": {"configfile": os.path.expanduser("~/.museekd/config.xml")}, \ "murmur":{"trayapp": "yes", "tooltips": "no", "autobuddy": "no", "roomlistminsize": 5, \ "rooms_sort": "size", "roombox": "big", "now-playing": "default", \ - "now-playing-prefix": None, "browse_display_mode": "filesystem", \ - "url reader": "firefox", "url custom prefix": ""}, \ + "now-playing-prefix": None, "browse_display_mode": "filesystem"}, \ "colors": { "chatme":"FOREST GREEN", "chatremote":"", "useronline":"BLACK", "useraway":"ORANGE","useroffline":"#aa0000", "chatlocal":"BLUE", \ "chathilite":"red", "search":"","searchq":"GREY", "chatfont": "" },\ "logging": { "logcollapsed": "no", "log_dir": "~/.murmur/logs/", "logrooms": - "yes", "rooms":[]} \ + "yes", "rooms":[]}, \ + "urls":{"urlcatching":1,"protocols":{"http":"firefox %s", "https":"firefox %s"}, "humanizeurls":1},\ + \ + "players": {"default": "xmms -e $", "npothercommand": "", "npplayer": "infopipe", "npformatlist": [], "npformat": "" } } ## @var config_manager # ConfigManager (Class) self.config_manager = ConfigManager(self) self.config_manager.check_path() - + utils.PROTOCOL_HANDLERS = self.Config["urls"]["protocols"].copy() self.username = None self.Config["connection"]["passw"] self.pid = pid @@ -5951,20 +5989,7 @@ if DEBUG == True: print "away_toggle ERROR", e - def CheckNick(self): - try: - if self.username == None: - if DEBUG == True: - #print "Joined room: %s" % room - print "Connection is taking a while to start, maybe you are trying to connect to a FTP daemon?" - print "Killing connection.." - print "Try using /interface to connect to a different port." - driver.Driver.close(self) - except Exception,e: - if DEBUG == True: print "CheckNick ERROR", e - - def ToggleLogWindow(self, widget, buf): active = widget.get_active() |
From: <svn...@mu...> - 2007-03-17 04:23:13
|
Author: daelstorm Date: 2007-03-17 05:23:01 +0100 (Sat, 17 Mar 2007) New Revision: 493 Modified: murmur/trunk/sources/CHANGELOG murmur/trunk/sources/murmur murmur/trunk/sources/pymurmur/settings.py Log: Murmur in trunk: fix settings Modified: murmur/trunk/sources/CHANGELOG =================================================================== --- murmur/trunk/sources/CHANGELOG 2007-03-17 03:26:08 UTC (rev 492) +++ murmur/trunk/sources/CHANGELOG 2007-03-17 04:23:01 UTC (rev 493) @@ -1,3 +1,9 @@ +Version 0.3.0svn + * Lots of minor changes + * Use PyGTK 2.10 trayicon, if available + * Runs on win32 with the newnet branch of driver.py + * Settings looks much nicer, and all options should work + Updated 21 October 2006 Version: 0.2.5 * Minor UI Changes Modified: murmur/trunk/sources/murmur =================================================================== --- murmur/trunk/sources/murmur 2007-03-17 03:26:08 UTC (rev 492) +++ murmur/trunk/sources/murmur 2007-03-17 04:23:01 UTC (rev 493) @@ -3535,10 +3535,11 @@ message = "\n-- ".join(message.split("\n")) self.lines.append(AppendLine(self.chatview, message, None, username=user, usertag=self.tag_users[user])) - if user != self.frame.username and self.frame.username in message: - self.chatrooms.request_hilite(self.Main) - else: - self.chatrooms.request_changed(self.Main) + if self.frame.username is not None: + if user != self.frame.username and self.frame.username in message: + self.chatrooms.request_hilite(self.Main) + else: + self.chatrooms.request_changed(self.Main) #if self.Log.get_active(): #self.logfile = WriteLog(self.logfile, self.frame.np.config.sections["logging"]["logsdir"], self.room, line) def OnKeyPress(self, widget, event): Modified: murmur/trunk/sources/pymurmur/settings.py =================================================================== --- murmur/trunk/sources/pymurmur/settings.py 2007-03-17 03:26:08 UTC (rev 492) +++ murmur/trunk/sources/pymurmur/settings.py 2007-03-17 04:23:01 UTC (rev 493) @@ -2409,11 +2409,21 @@ def refreshConfigDisplay(self): self.populate_dialogs() + def MuseekSettingsSensitive(self, sensitive): + + self.ServerSW.set_sensitive( sensitive) + self.MuseekClientsSW.set_sensitive( sensitive) + self.TransfersScrollWindow.set_sensitive( sensitive) + self.hboxchat.set_sensitive( sensitive) + self.hboxusers.set_sensitive( sensitive) + self.UserInfoSW.set_sensitive( sensitive) + self.SharesSW.set_sensitive( sensitive) + def populate_dialogs(self): self.parents= {} # Server if self.config == {}: - self.notebook1.set_sensitive( False) + self.MuseekSettingsSensitive(False) self.EntryServerHost.set_text("") self.ServerPort.set_value(0) self.EntryServerPassword.set_text("") @@ -2477,10 +2487,10 @@ self.NormalDirTreestore.clear() self.BuddyDirTreestore.clear() #self.OnRefreshBuddyDirs(None) - self.notebook1.set_sensitive( False) + return try: - self.notebook1.set_sensitive(True) + self.MuseekSettingsSensitive(True) self.app.Muscan.GetConfig() self.CONFIG_PATH = self.app.Muscan.configfile |
From: <svn...@mu...> - 2007-03-17 03:26:16
|
Author: daelstorm Date: 2007-03-17 04:26:08 +0100 (Sat, 17 Mar 2007) New Revision: 492 Added: branches/newnet/murmur/clean_python branches/newnet/packagescripts/ branches/newnet/packagescripts/murmurmaketarball.sh Modified: branches/newnet/murmur/CHANGELOG branches/newnet/murmur/murmur branches/newnet/murmur/pymurmur/settings.py Log: Fix murmur-settings-disabled bug; updated murmur changelog; add murmur tarball creation script Modified: branches/newnet/murmur/CHANGELOG =================================================================== --- branches/newnet/murmur/CHANGELOG 2007-03-16 23:17:28 UTC (rev 491) +++ branches/newnet/murmur/CHANGELOG 2007-03-17 03:26:08 UTC (rev 492) @@ -1,3 +1,9 @@ +Version 0.3.0svn + * Lots of minor changes + * Use PyGTK 2.10 trayicon, if available + * Runs on win32 with the newnet branch of driver.py + * Settings looks much nicer, and all options should work + Updated 21 October 2006 Version: 0.2.5 * Minor UI Changes Added: branches/newnet/murmur/clean_python =================================================================== --- branches/newnet/murmur/clean_python (rev 0) +++ branches/newnet/murmur/clean_python 2007-03-17 03:26:08 UTC (rev 492) @@ -0,0 +1,5 @@ +#!/bin/sh +find ./ -iname "*.pyc" -exec rm {} \; +find ./ -iname "*~" -exec rm {} \; +find ./ -iname "*.bak" -exec rm {} \; + Property changes on: branches/newnet/murmur/clean_python ___________________________________________________________________ Name: svn:executable + * Modified: branches/newnet/murmur/murmur =================================================================== --- branches/newnet/murmur/murmur 2007-03-16 23:17:28 UTC (rev 491) +++ branches/newnet/murmur/murmur 2007-03-17 03:26:08 UTC (rev 492) @@ -3535,10 +3535,11 @@ message = "\n-- ".join(message.split("\n")) self.lines.append(AppendLine(self.chatview, message, None, username=user, usertag=self.tag_users[user])) - if user != self.frame.username and self.frame.username in message: - self.chatrooms.request_hilite(self.Main) - else: - self.chatrooms.request_changed(self.Main) + if self.frame.username is not None: + if user != self.frame.username and self.frame.username in message: + self.chatrooms.request_hilite(self.Main) + else: + self.chatrooms.request_changed(self.Main) #if self.Log.get_active(): #self.logfile = WriteLog(self.logfile, self.frame.np.config.sections["logging"]["logsdir"], self.room, line) def OnKeyPress(self, widget, event): Modified: branches/newnet/murmur/pymurmur/settings.py =================================================================== --- branches/newnet/murmur/pymurmur/settings.py 2007-03-16 23:17:28 UTC (rev 491) +++ branches/newnet/murmur/pymurmur/settings.py 2007-03-17 03:26:08 UTC (rev 492) @@ -2409,11 +2409,21 @@ def refreshConfigDisplay(self): self.populate_dialogs() + def MuseekSettingsSensitive(self, sensitive): + + self.ServerSW.set_sensitive( sensitive) + self.MuseekClientsSW.set_sensitive( sensitive) + self.TransfersScrollWindow.set_sensitive( sensitive) + self.hboxchat.set_sensitive( sensitive) + self.hboxusers.set_sensitive( sensitive) + self.UserInfoSW.set_sensitive( sensitive) + self.SharesSW.set_sensitive( sensitive) + def populate_dialogs(self): self.parents= {} # Server if self.config == {}: - self.notebook1.set_sensitive( False) + self.MuseekSettingsSensitive(False) self.EntryServerHost.set_text("") self.ServerPort.set_value(0) self.EntryServerPassword.set_text("") @@ -2477,10 +2487,10 @@ self.NormalDirTreestore.clear() self.BuddyDirTreestore.clear() #self.OnRefreshBuddyDirs(None) - self.notebook1.set_sensitive( False) + return try: - self.notebook1.set_sensitive(True) + self.MuseekSettingsSensitive(True) self.app.Muscan.GetConfig() self.CONFIG_PATH = self.app.Muscan.configfile Added: branches/newnet/packagescripts/murmurmaketarball.sh =================================================================== --- branches/newnet/packagescripts/murmurmaketarball.sh (rev 0) +++ branches/newnet/packagescripts/murmurmaketarball.sh 2007-03-17 03:26:08 UTC (rev 492) @@ -0,0 +1,11 @@ +#!/usr/bin/sh +cd .. +mkdir -p murmur/museek +cp python-bindings/driver.py python-bindings/messages.py murmur/museek/ +cd murmur +./clean_python +cd trayicon +make distclean +cd ../../ +tar jcvf murmur-svn.tar.bz2 murmur/ --exclude=.svn +rm -rf murmur/museek Property changes on: branches/newnet/packagescripts/murmurmaketarball.sh ___________________________________________________________________ Name: svn:executable + * |
From: <svn...@mu...> - 2007-03-16 23:17:39
|
Author: daelstorm Date: 2007-03-17 00:17:28 +0100 (Sat, 17 Mar 2007) New Revision: 491 Modified: branches/newnet/murmur/murmur murmur/trunk/sources/murmur murmur/trunk/sources/pymurmur/settings.py Log: Murmur: add latest idle_add changes to trunk Modified: branches/newnet/murmur/murmur =================================================================== --- branches/newnet/murmur/murmur 2007-03-16 23:03:07 UTC (rev 490) +++ branches/newnet/murmur/murmur 2007-03-16 23:17:28 UTC (rev 491) @@ -65,11 +65,11 @@ import mucipher except ImportError: print "WARNING: The Mucipher Module for Python wasn't found and neither was PyCrypto. One of these encryption modules is necessary to allow Murmur to connect to the Museek Daemon.\nDownload mucipher here: http://thegraveyard.org/files/pymucipher-0.0.1.tar.gz\nExtract the tarball, and as Root or sudo, run:\npython setup.py install\nYou'll need GCC, Python and SWIG.\nOr download PyCrypto from here: http://www.amk.ca/python/code/crypto.html" - + sys.exit() try: import messages, driver except ImportError, error: - print error + try: from museek import messages, driver except ImportError, error: @@ -2733,7 +2733,7 @@ self.users[user].SendMessage(text) def ShowMessage(self, direction, user, text): - if self.frame.Networking.config.has_key("ignored") and self.frame.Networking.config["ignored"].hsa_key(user): + if self.frame.Networking.config.has_key("ignored") and self.frame.Networking.config["ignored"].has_key(user): return ctcpversion = 0 Modified: murmur/trunk/sources/murmur =================================================================== --- murmur/trunk/sources/murmur 2007-03-16 23:03:07 UTC (rev 490) +++ murmur/trunk/sources/murmur 2007-03-16 23:17:28 UTC (rev 491) @@ -68,20 +68,25 @@ sys.exit() try: import messages, driver -except ImportError: +except ImportError, error: + try: from museek import messages, driver - except ImportError: - print "WARNING: The Museek Message-Parsing modules, messages.py and/or driver.py were not found. Please install them into your '/usr/lib/python2.X/site-packages/museek' directory, or place them in a 'museek' subdirectory of the directory that contains the murmur python scipt." + except ImportError, error: + print "WARNING: The Museek Message-Parsing modules, messages.py and/or driver.py were not found. Please install them into your '/usr/lib/python2.X/site-packages/museek' directory, or place them in a 'museek' subdirectory of the directory that contains the murmur python scipt.", error sys.exit() trayicon_load = 1 + +if gtk.pygtk_version[0] >= 2 and gtk.pygtk_version[1] >= 10: + pass +else: + try: + from pymurmur import trayicon + except: + print "Optional TrayIcon module not found. Please build it if you want the TrayIcon to work." + trayicon_load = 0 try: - from pymurmur import trayicon -except: - print "Optional TrayIcon module not found. Please build it if you want the TrayIcon to work." - trayicon_load = 0 -try: from pymurmur import imagedata from pymurmur.settings import Settings except ImportError, e: @@ -101,10 +106,7 @@ from time import sleep import select, string, re, ConfigParser, getopt, shutil, commands -try: - import pwd -except ImportError: - print "Python module 'pwd' could not be loaded." + import threading, time import signal import tempfile @@ -118,7 +120,7 @@ import GeoIP gi = GeoIP.new(GeoIP.GEOIP_MEMORY_CACHE) except ImportError: - print "Python module 'pwd' could not be loaded." + print "Python module geoip could not be loaded." geoip_fail=1 config_dir = str(os.path.expanduser("~/.murmur/")) @@ -247,7 +249,7 @@ else: os.mkdir(config_dir, 0700) - create_config() + self.create_config() @@ -307,7 +309,8 @@ ## Ping def cb_ping(self): if DEBUG == True: print " **** cb_ping" - + pass + def cb_server_privileges(self, time_left): if DEBUG == True: print " **** cb_server_privileges: %i" % time_left @@ -486,12 +489,9 @@ # @param recommendations list of recommendations [item, number of recommends] def cb_get_global_recommendations(self, recommendations): try: - #self.frame.Recommendations.data["recommendations"] = self.frame.SortedDict() - self.frame.Recommendations.UpdateRecommendations(recommendations) - #for rec, num in recommendations.items(): - #self.frame.Recommendations.data["recommendations"] [rec] = num - #if self.frame.mode == "lists" and self.frame.UsersLists.current == "interests": - #self.frame.Recommendations.DrawInterests() + + gobject.idle_add(self.frame.Recommendations.UpdateRecommendations, recommendations) + except Exception, e: print "CB Get Global Recommendations" + str(e) @@ -501,12 +501,9 @@ def cb_get_similar_users(self, users): try: - #self.frame.Recommendations.data["similar_users"] = self.frame.SortedDict() - self.frame.Recommendations.UpdateSimilarUsers(users) - #for rec, num in users.items(): - #self.frame.Recommendations.data["similar_users"][rec] = num - ##if self.frame.mode == "lists" and self.frame.UsersLists.current == "interests": - #self.frame.Recommendations.DrawInterests() + + gobject.idle_add(self.frame.Recommendations.UpdateSimilarUsers, users) + except Exception, e: print "CB Similar Users" + str(e) self.frame.PrintTraceBack() @@ -516,12 +513,9 @@ # @param recommendations list of recommendations [item, number of recommends] def cb_get_recommendations(self, recommendations): try: - #self.frame.Recommendations.data["recommendations"] = self.frame.SortedDict() - self.frame.Recommendations.UpdateRecommendations(recommendations) - #for rec, num in recommendations.items(): - #self.frame.Recommendations.data["recommendations"] [rec] = num - #if self.frame.mode == "lists" and self.frame.UsersLists.current == "interests": - #self.frame.Recommendations.DrawInterests() + + gobject.idle_add(self.frame.Recommendations.UpdateRecommendations, recommendations) + except Exception, e: print "CB Get Recommendations" + str(e) @@ -531,12 +525,9 @@ # @param users List of format [username, status=(0,1,2)] def cb_get_item_similar_users(self, item, users): try: - #self.frame.Recommendations.data["similar_users"] = self.frame.SortedDict() - self.frame.Recommendations.UpdateSimilarUsers(users) - #for rec, num in users.items(): - #self.frame.Recommendations.data["similar_users"][rec] = num - #if self.frame.mode == "lists" and self.frame.UsersLists.current == "interests": - #self.frame.Recommendations.DrawInterests() + + gobject.idle_add(self.frame.Recommendations.UpdateSimilarUsers, users) + except Exception, e: print "CB Item Similar Users" + str(e) @@ -546,12 +537,8 @@ # @param recommendations list of recommendations [item, number of recommends] def cb_get_item_recommendations(self, item, recommendations): try: - self.frame.Recommendations.UpdateRecommendations(recommendations) - #self.frame.Recommendations.data["recommendations"] = self.frame.SortedDict() - #for rec, num in recommendations.items(): - #self.frame.Recommendations.data["recommendations"] [rec] = num - #if self.frame.mode == "lists" and self.frame.UsersLists.current == "interests": - #self.frame.Recommendations.DrawInterests() + gobject.idle_add(self.frame.Recommendations.UpdateRecommendations, recommendations) + except Exception, e: print "CB Get Item Recommendations" + str(e) @@ -559,12 +546,8 @@ gtk.gdk.threads_enter() if DEBUG == True: print " **** cb_room_list", len(roomlist) - #self.frame.room_lists = {} - #for x, y in roomlist.items(): - #self.chatrooms.rooms[x] = y - ##print x, y - - self.frame.ChatRooms.UpdateRoomList(roomlist) + + gobject.idle_add(self.frame.ChatRooms.UpdateRoomList, roomlist) gtk.gdk.threads_leave() def cb_room_tickers(self, room, tickers): @@ -581,7 +564,7 @@ gtk.gdk.threads_enter() if DEBUG == True: print " **** cb_search_ticket", query, ticket - self.frame.Searches.NewSearch( query, ticket) + gobject.idle_add(self.frame.Searches.NewSearch, query, ticket) gtk.gdk.threads_leave() @@ -590,7 +573,7 @@ gtk.gdk.threads_enter() if DEBUG == True: print " **** cb_search_results" - self.frame.Searches.NewResults(ticket, user, free, speed, queue, results) + gobject.idle_add(self.frame.Searches.NewResults,ticket, user, free, speed, queue, results) gtk.gdk.threads_leave() @@ -598,11 +581,13 @@ def cb_transfer_state(self, downloads, uploads): gtk.gdk.threads_enter() if DEBUG == True: print " **** cb_transfer_state" - for transfer in uploads: - self.frame.uploads.append(user=transfer.user, filename=None, rate=transfer.rate, state=transfer.state, filepos=transfer.filepos, filesize=transfer.filesize, path=transfer.path, error=transfer.error, place=transfer.place) - for transfer in downloads: - self.frame.downloads.append(user=transfer.user, filename=None, rate=transfer.rate, state=transfer.state, filepos=transfer.filepos, filesize=transfer.filesize, path=transfer.path, error=transfer.error, place=transfer.place) - + try: + for transfer in uploads: + gobject.idle_add(self.frame.uploads.append, transfer.user, None, transfer.rate, transfer.state, transfer.filepos, transfer.filesize, transfer.path, transfer.error, transfer.place) + for transfer in downloads: + gobject.idle_add(self.frame.downloads.append, transfer.user, None, transfer.rate, transfer.state, transfer.filepos, transfer.filesize, transfer.path, transfer.error, transfer.place) + except Exception, e: + print e gtk.gdk.threads_leave() @@ -611,9 +596,9 @@ try: if DEBUG == True: print " **** cb_transfer_update" if transfer.is_upload: - self.frame.uploads.update(user=transfer.user, filename=None, rate=transfer.rate, state=transfer.state, filepos=transfer.filepos, filesize=transfer.filesize, path=transfer.path, error=transfer.error, place=transfer.place) + gobject.idle_add(self.frame.uploads.update , transfer.user, None, transfer.rate, transfer.state, transfer.filepos, transfer.filesize, transfer.path, transfer.error, transfer.place) else: - self.frame.downloads.update(user=transfer.user, filename=None, rate=transfer.rate, state=transfer.state, filepos=transfer.filepos, filesize=transfer.filesize, path=transfer.path, error=transfer.error, place=transfer.place) + gobject.idle_add(self.frame.downloads.update, transfer.user, None, transfer.rate, transfer.state, transfer.filepos, transfer.filesize, transfer.path, transfer.error, transfer.place) except Exception,e: if DEBUG == True: print " **** cb_transfer_update ERROR", e gtk.gdk.threads_leave() @@ -624,9 +609,9 @@ if DEBUG == True: print " **** cb_transfer_remove" user_path = transfer[1], transfer[2] if transfer[0]: - self.frame.uploads.remove(transfer) + gobject.idle_add(self.frame.uploads.remove, transfer) else: - self.frame.downloads.remove(transfer) + gobject.idle_add(self.frame.downloads.remove, transfer) gtk.gdk.threads_leave() def cb_user_shares(self, user, shares): @@ -634,7 +619,7 @@ if DEBUG == True: print " **** cb_user_shares" #self.frame.get_shares(user, shares) try: - self.frame.userbrowses.GotUserBrowse(user, shares) + gobject.idle_add(self.frame.userbrowses.GotUserBrowse, user, shares) except Exception,e: if DEBUG == True: print " **** cb_user_shares ERROR", e gtk.gdk.threads_leave() @@ -645,7 +630,7 @@ if DEBUG == True: print "got %s's userinfo" % user - self.frame.userinfos.GotUserInfo(user, info, picture, uploads, queue, slotsfree) + gobject.idle_add(self.frame.userinfos.GotUserInfo, user, info, picture, uploads, queue, slotsfree) except Exception,e: if DEBUG == True: print " **** cb_user_info ERROR", e @@ -654,8 +639,8 @@ def cb_room_said(self, room, user, text): gtk.gdk.threads_enter() try: - self.frame.ChatRooms.SayChatRoom(room, user, text) - self.frame.Logging.ChatRoomLog(room, user, text) + gobject.idle_add(self.frame.ChatRooms.SayChatRoom, room, user, text) + gobject.idle_add(self.frame.Logging.ChatRoomLog, room, user, text) except Exception,e: if DEBUG == True: print " **** cb_room_said ERROR", e gtk.gdk.threads_leave() @@ -665,13 +650,14 @@ if DEBUG == True: print "Logged in, getting Rooms" try: - self.frame.ChatRooms.UpdateRoomList(roomlist) + gobject.idle_add(self.frame.ChatRooms.UpdateRoomList, roomlist) joined_rooms = joined.keys() joined_rooms.sort(key=str.lower) for room in joined_rooms: - for users, stats in joined[room].items(): - self.frame.user_stats[users] = [stats[0], stats[1], stats[2], stats[3], stats[4], 1] - self.frame.ChatRooms.JoinRoom(str(room), joined[room]) +# for users, stats in joined[room].items(): + #print stats +# self.frame.user_stats[users] = [stats[0], stats[1], stats[2], stats[3], stats[4]] + gobject.idle_add(self.frame.ChatRooms.JoinRoom, str(room), joined[room]) except Exception, e: if DEBUG == True: print "Room State bug", e @@ -686,7 +672,7 @@ try: - self.frame.ChatRooms.JoinRoom(room, list_of_users) + gobject.idle_add(self.frame.ChatRooms.JoinRoom, room, list_of_users) except Exception, e: @@ -694,24 +680,26 @@ gtk.gdk.threads_leave() def cb_room_left(self, room): + if DEBUG == True: print "Leave room", room gtk.gdk.threads_enter() if DEBUG == True: print " **** cb_room_left %s"% room try: - self.frame.ChatRooms.LeaveRoom(room) + gobject.idle_add(self.frame.ChatRooms.LeaveRoom, room) except Exception, e: if DEBUG == True: print "Leave room bug", e gtk.gdk.threads_leave() def cb_room_user_joined(self, room, user, stats): + if DEBUG == True: print "User Joined room",user gtk.gdk.threads_enter() try: if DEBUG == True: print "%s joined room \'%s\' " %( user, room) #self.frame.rooms[room][user] = stats - self.frame.user_stats[user] = [stats[0], stats[1], stats[2 ], stats[3], stats[4], 1] + self.frame.user_stats[user] = [stats[0], stats[1],stats[2],stats[3],stats[4]] - self.frame.ChatRooms.UserJoinedRoom(room, user) + gobject.idle_add(self.frame.ChatRooms.UserJoinedRoom, room, user) except Exception, e: if DEBUG == True: print "User Joined room bug", e @@ -719,12 +707,13 @@ def cb_room_user_left(self, room, user): + if DEBUG == True: print "User Left room",user gtk.gdk.threads_enter() try: if DEBUG == True: print "%s left room %s" % (user, room) - self.frame.ChatRooms.UserLeftRoom(room, user) + gobject.idle_add(self.frame.ChatRooms.UserLeftRoom, room, user) except Exception, e: @@ -732,22 +721,24 @@ gtk.gdk.threads_leave() def cb_private_message(self, direction, timestamp, user, message): + + if DEBUG == True: print " **** cb_private_message", user gtk.gdk.threads_enter() - if DEBUG == True: print " **** cb_private_message" if DEBUG == True: print direction, timestamp, user, message try: if DEBUG == True: print "%s PM'd to you: %s" % (user, message) - self.frame.PrivateChats.ShowMessage(direction, user, message) + gobject.idle_add(self.frame.PrivateChats.ShowMessage, direction, user, message) except Exception,e: if DEBUG == True: print " **** cb_private_message ERROR", e gtk.gdk.threads_leave() def cb_peer_address(self, user, ip, port): + + if DEBUG == True: print " **** cb_peer_address" gtk.gdk.threads_enter() - if DEBUG == True: print " **** cb_peer_address" try: if user in self.frame.ip_requested: self.frame.ip_requested.remove(user) @@ -755,12 +746,12 @@ country = gi.country_name_by_addr( str(ip) ) message="%s's IP: %s Port: %s Country: %s" % (user, str(ip), str(port), country) #s= self.frame.display_box(title="IP Address", message = message ) - self.frame.AppendToLogWindow(message) + if DEBUG == True: print message else: if DEBUG == True: print "No Geoip" message="%s's IP: %s Port: %s" % (user, str(ip), str(port) ) - self.frame.AppendToLogWindow(message) + gobject.idle_add(self.frame.AppendToLogWindow, message) except Exception,e: if DEBUG == True: print " **** cb_peer_address ERROR", e gtk.gdk.threads_leave() @@ -773,8 +764,8 @@ if DEBUG == True: print "Invalid Password" - self.frame.TrayApp.SetToolTip( "Couldn't connect to Museek: %s" % "Invalid Password") - self.frame.update_statusbar( "Invalid Password") + gobject.idle_add(self.frame.TrayApp.SetToolTip, "Couldn't connect to Museek: %s" % "Invalid Password") + gobject.idle_add(self.frame.update_statusbar, "Invalid Password") else: @@ -782,9 +773,9 @@ if DEBUG == True: print "couldn't log in: " + reason - self.frame.update_statusbar( "Couldn't Login") + gobject.idle_add(self.frame.update_statusbar,"Couldn't Login") - self.frame.TrayApp.SetImage("red") + gobject.idle_add(self.frame.TrayApp.SetImage,"red") except Exception,e: if DEBUG == True: print " **** cb_login_error ERROR", e self.connected = False @@ -800,7 +791,7 @@ if DEBUG == True: print " **** cb_login_ok ERROR", e self.connected = True - def disconnect(self, string): + def disconnect(self, string=""): try: if self.frame.username != None: @@ -822,11 +813,11 @@ if DEBUG == True: print " **** cb_disconnected" try: - self.frame.TrayApp.SetImage("red") + gobject.idle_add(self.frame.TrayApp.SetImage,"red") - self.frame.TrayApp.SetToolTip( "Disconnected from Museek") + gobject.idle_add(self.frame.TrayApp.SetToolTip, "Disconnected from Museek") - self.frame.update_statusbar( "Disconnected from Museek") + gobject.idle_add(self.frame.update_statusbar, "Disconnected from Museek") self.frame.username = None self.frame.status = 2 @@ -851,19 +842,19 @@ if self.frame.status: message = "Connected to Museek: %s Status: Away" % username - self.frame.TrayApp.SetToolTip( message) - self.frame.update_statusbar( message) - self.frame.TrayApp.SetImage("yellow") + gobject.idle_add(self.frame.TrayApp.SetToolTip, message) + gobject.idle_add(self.frame.update_statusbar, message) + gobject.idle_add(self.frame.TrayApp.SetImage, "yellow") elif self.frame.status == 2: message = "Connected to Museek: %s Status: Online" % username - self.frame.TrayApp.SetToolTip( message ) - self.frame.update_statusbar( message ) - self.frame.TrayApp.SetImage("green") + gobject.idle_add(self.frame.TrayApp.SetToolTip, message ) + gobject.idle_add(self.frame.update_statusbar, message ) + gobject.idle_add(self.frame.TrayApp.SetImage, "green") else: - self.frame.TrayApp.SetImage("red") + gobject.idle_add(self.frame.TrayApp.SetImage, "red") self.frame.username = username @@ -880,14 +871,14 @@ self.frame.status = status if self.frame.status: message = "Connected to Museek: %s Status: Away" % self.frame.username - self.frame.TrayApp.SetToolTip( message) - self.frame.update_statusbar( message) - self.frame.TrayApp.SetImage("yellow") + + gobject.idle_add(self.frame.TrayApp.SetImage,"yellow") else: message = "Connected to Museek: %s Status: Online" % self.frame.username - self.frame.TrayApp.SetToolTip( message ) - self.frame.update_statusbar( message ) - self.frame.TrayApp.SetImage("green") + + gobject.idle_add(self.frame.TrayApp.SetImage, "green") + gobject.idle_add(self.frame.TrayApp.SetToolTip, message ) + gobject.idle_add(self.frame.update_statusbar, message ) except Exception,e: if DEBUG == True: print " **** cb_server_status_set ERROR", e @@ -900,11 +891,11 @@ self.frame.user_exists[user] = exists if self.frame.user_stats.has_key(user): + status = self.frame.user_stats[user][0] + gobject.idle_add(self.frame.ChatRooms.GetUserStatus, user, status) + gobject.idle_add(self.frame.userlists.updateListIcon, user) + gobject.idle_add(self.frame.PrivateChats.updateStatus, user, status) - self.frame.ChatRooms.GetUserStatus( user, status) - self.frame.userlists.updateListIcon(user, status) - self.frame.PrivateChats.updateStatus(user, status) - except Exception,e: if DEBUG == True: print " **** cb_peer_exists ERROR", e gtk.gdk.threads_leave() @@ -926,8 +917,8 @@ if DEBUG == True: print " **** cb_peer_stats ERROR", e gtk.gdk.threads_enter() - self.frame.ChatRooms.GetUserStats( user, speed, files) - self.frame.userlists.updateStats(user, self.frame.user_stats[user]) + gobject.idle_add(self.frame.ChatRooms.GetUserStats, user, speed, files) + gobject.idle_add(self.frame.userlists.updateStats, user, self.frame.user_stats[user]) gtk.gdk.threads_leave() @@ -940,12 +931,12 @@ else: - self.frame.user_stats[user] = [status, 0, 0, 0, 0, 1] + self.frame.user_stats[user] = [status, 0, 0, 0, 0] ## Update Lists with new status information - self.frame.ChatRooms.GetUserStatus( user, status) - self.frame.userlists.updateStatus(user, status) - self.frame.PrivateChats.updateStatus(user, status) + gobject.idle_add(self.frame.ChatRooms.GetUserStatus, user, status) + gobject.idle_add(self.frame.userlists.updateStatus, user, status) + gobject.idle_add(self.frame.PrivateChats.updateStatus, user, status) except Exception,e: if DEBUG == True: print " **** cb_peer_status ERROR1", e @@ -963,12 +954,25 @@ elif type == 0: stype = "Server" - self.frame.AppendToLogWindow( "%s Message: %s" % (stype, message)) + gobject.idle_add(self.frame.AppendToLogWindow, "%s Message: %s" % (stype, message)) except Exception,e: print "cb_status_message: " +str( e) gtk.gdk.threads_leave() - + ## Museekd sent us a debug message + # @param self Networking (Driver Class) + # @param domain is a string the value of which is a debug type + # @param message is the message string + def cb_debug_message(self, domain, message): + + gtk.gdk.threads_enter() + try: + if domain in ["museek.note", "museek.warn"] : + gobject.idle_add(self.frame.AppendToLogWindow, "%s Message: %s" % (domain, message)) + except Exception,e: + print "cb_debug_message: " +str( e) + gtk.gdk.threads_leave() + def connect_to_museekd(self, string): if self.frame.username != None: @@ -978,7 +982,7 @@ if self.frame.Config["connection"]["passw"] != None: #self.timer = threading.Timer(10.0, self.CheckNick) #self.timer.start() - driver.Driver.connect(self, self.frame.Config["connection"]["interface"], self.frame.Config["connection"]["passw"], messages.EM_CHAT | messages.EM_USERINFO| messages.EM_PRIVATE | messages.EM_TRANSFERS | messages.EM_USERSHARES | messages.EM_CONFIG | messages.EM_INTERESTS) + driver.Driver.connect(self, self.frame.Config["connection"]["interface"], self.frame.Config["connection"]["passw"], messages.EM_CHAT | messages.EM_USERINFO| messages.EM_PRIVATE | messages.EM_TRANSFERS | messages.EM_USERSHARES | messages.EM_CONFIG | messages.EM_INTERESTS| messages.EM_DEBUG) if DEBUG == True: print "connect attempt" @@ -1016,7 +1020,7 @@ #sleep(0.1) if self.socket != None: - r, w, x = select.select([self.socket, sys.stdin], [], [self.socket], d) + r, w, x = select.select([self.socket,], [], [self.socket], d) if self.socket in r: #try: @@ -1047,6 +1051,8 @@ try: self.send(message) except Exception, e: + if e.args[0] == 10054: + self.cb_disconnected() print "SendMessage: " + str(e) + " " + str(message) ## Abort transfer (remains in transfer list) @@ -2490,9 +2496,9 @@ user = self.user num = 5 self.popup_menu.ready = False - items[num].set_active(self.frame.Networking.config["buddies"].has_key(user)) - items[num+1].set_active(self.frame.Networking.config["banned"].has_key(user)) - items[num+2].set_active(self.frame.Networking.config["ignored"].has_key(user)) + items[num].set_active(self.frame.Networking.config.has_key("buddies") and self.frame.Networking.config["buddies"].has_key(user)) + items[num+1].set_active(self.frame.Networking.config.has_key("banned") and self.frame.Networking.config["banned"].has_key(user)) + items[num+2].set_active(self.frame.Networking.config.has_key("ignored") and self.frame.Networking.config["ignored"].has_key(user)) items[num+3].set_active(self.frame.Networking.config["trusted"].has_key(user)) self.popup_menu.popup(None, None, None, event.button, event.time) self.popup_menu.ready = True @@ -2727,7 +2733,7 @@ self.users[user].SendMessage(text) def ShowMessage(self, direction, user, text): - if user in self.frame.Networking.config["ignored"]: + if self.frame.Networking.config.has_key("ignored") and self.frame.Networking.config["ignored"].has_key(user): return ctcpversion = 0 @@ -2976,9 +2982,9 @@ #if string is not "search": self.popup_menu.ready = False if self.frame.Networking.config != {}: - items[num].set_active(self.frame.Networking.config["buddies"].has_key(user)) - items[num+1].set_active(self.frame.Networking.config["banned"].has_key(user)) - items[num+2].set_active(self.frame.Networking.config["ignored"].has_key(user)) + items[num].set_active(self.frame.Networking.config.has_key("buddies") and self.frame.Networking.config["buddies"].has_key(user)) + items[num+1].set_active(self.frame.Networking.config.has_key("banned") and self.frame.Networking.config["banned"].has_key(user)) + items[num+2].set_active(self.frame.Networking.config.has_key("ignored") and self.frame.Networking.config["ignored"].has_key(user)) items[num+3].set_active(self.frame.Networking.config["trusted"].has_key(user)) self.popup_menu.popup(None, None, None, event.button, event.time) self.popup_menu.ready = True @@ -2991,44 +2997,69 @@ self.frame = frame self.is_mapped = 1 self.current_image = None - + self.pygtkicon = False + if gtk.pygtk_version[0] >= 2 and gtk.pygtk_version[1] >= 10: + self.pygtkicon = True + def trayapp(self, string): if trayicon_load == 0: return self.is_mapped = 1 if self.t == None: - self.t = trayicon.TrayIcon("Murmur") - self.eventbox = gtk.EventBox() self.TrayMenu() - if DEBUG == True: print "Status:", self.frame.status - if self.frame.status: - message = _("Connected to Museek: %s Status: Away" % self.frame.username) - self.SetToolTip( message) - self.frame.update_statusbar( message) - - self.SetImage("yellow") - elif self.frame.status == 0: - message = _("Connected to Museek: %s Status: Online" % self.frame.username) - self.SetToolTip( message ) - self.frame.update_statusbar( message ) - self.SetImage("green") + if self.pygtkicon: + self.t = gtk.StatusIcon() + self.t.set_visible(True) + self.t.connect("popup-menu", self.OnStatusIconPopup) + self.t.connect("activate", self.OnStatusIconClicked) else: - self.SetImage("red") - self.eventbox_closed = "no" - self.t.add(self.eventbox) - self.t.show_all() + self.t = trayicon.TrayIcon("Murmur") + self.eventbox = gtk.EventBox() + self.t.add(self.eventbox) + self.eventbox.connect_object("button_press_event", self.OnTrayiconClicked, popup) + self.eventbox_closed = False + self.TrayIconStatus() + + if not self.pygtkicon: + + + self.t.show_all() + else: self.t.hide() - self.eventbox.hide() + if not self.pygtkicon: + self.eventbox.hide() + self.eventbox = None + self.eventbox_closed = True self.t = None - self.eventbox = None - self.eventbox_closed = "yes" self.tooltips = gtk.Tooltips() #self.tooltips.set_delay(1500) - + + def OnStatusIconClicked(self, status_icon): + self.HideUnhideWindow(None) + def OnStatusIconPopup(self, status_icon, button, activate_time): + if button == 3: + self.tray_popup_menu.popup(None, None, None, button, activate_time) + + def TrayIconStatus(self): + if DEBUG == True: print "Status:", self.frame.status + if self.frame.status: + message = _("Connected to Museek: %s Status: Away" % self.frame.username) + self.SetToolTip( message) + self.frame.update_statusbar( message) + + self.SetImage("yellow") + elif self.frame.status == 0: + message = _("Connected to Museek: %s Status: Online" % self.frame.username) + self.SetToolTip( message ) + self.frame.update_statusbar( message ) + self.SetImage("green") + else: + self.SetImage("red") + def OnTrayiconServer(self, widget): items = self.tray_popup_menu_server.get_children() @@ -3069,7 +3100,7 @@ ("#" + _("Quit"), self.frame.quit, gtk.STOCK_QUIT), ) - self.eventbox.connect_object("button_press_event", self.OnTrayiconClicked, popup) + except Exception, e: @@ -3108,20 +3139,22 @@ try: if self.t == None: return - - self.eventbox.hide() + if not self.pygtkicon: + self.eventbox.hide() - if self.current_image != None and self.eventbox_closed == "no": - self.eventbox.remove(self.current_image) + if self.current_image != None and self.eventbox_closed == False: + self.eventbox.remove(self.current_image) self.current_image_name = image image1 = gtk.Image() image1.set_from_pixbuf(self.frame.images[image]) image1.show() self.current_image = image1 - - self.eventbox.add(self.current_image) - self.eventbox.show() + if self.pygtkicon: + self.t.set_from_pixbuf(self.frame.images[image]) + if not self.pygtkicon: + self.eventbox.add(self.current_image) + self.eventbox.show() except Exception,e: if DEBUG == True: print "Error in SetImage", e @@ -3543,7 +3576,8 @@ def UserJoinedRoom(self, username): if self.users.has_key(username): return - status, speed, downloads, files, dirs, exists = self.frame.user_stats[username] + + status, speed, downloads, files, dirs = self.frame.user_stats[username] AppendLine(self.RoomLog, _("%s joined the room") % username, None) img = self.frame.GetStatusImage(username, status) hspeed = self.frame.HSpeed(speed) @@ -3618,9 +3652,9 @@ # Chat, Userlists use the normal popup system num = 5 self.popup_menu.ready = True - items[num].set_active(self.frame.Networking.config["buddies"].has_key(user)) - items[num+1].set_active(self.frame.Networking.config["banned"].has_key(user)) - items[num+2].set_active(self.frame.Networking.config["ignored"].has_key(user)) + items[num].set_active(self.frame.Networking.config.has_key("buddies") and self.frame.Networking.config["buddies"].has_key(user)) + items[num+1].set_active(self.frame.Networking.config.has_key("banned") and self.frame.Networking.config["banned"].has_key(user)) + items[num+2].set_active(self.frame.Networking.config.has_key("ignored") and self.frame.Networking.config["ignored"].has_key(user)) items[num+3].set_active(self.frame.Networking.config["trusted"].has_key(user)) self.popup_menu.popup(None, None, None, event.button, event.time) self.popup_menu.ready = False @@ -3918,7 +3952,7 @@ self.frame.Networking.RoomList() def SayChatRoom(self, room, user, text): - if user in self.frame.Networking.config["ignored"].keys(): + if self.frame.Networking.config.has_key("ignored") and user in self.frame.Networking.config["ignored"].keys(): return self.joinedrooms[room].SayInChatRoom(user, text) @@ -3930,7 +3964,7 @@ for user, stats in users.items(): #print stats - self.frame.user_stats[user] = [stats[0], stats[1], stats[2 ], stats[3], stats[4], 1] + self.frame.user_stats[user] = [stats[0], stats[1], stats[2], stats[3], stats[4]] # online status, avgspeed, numdownloads, numfiles, numdirs if self.frame.Config["logging"]["logrooms"] == "yes" and room not in self.frame.Config["logging"]["rooms"]: self.frame.Config["logging"]["rooms"].append(room) @@ -4680,7 +4714,7 @@ if user in self.users: return if user in self.frame.user_stats: - status, speed, downloads, files, dirs, exists = self.frame.user_stats[user] + status, speed, downloads, files, dirs = self.frame.user_stats[user] else: status = speed = downloads = files = dirs = 0 self.users[user] = self.store.append([ self.frame.GetStatusImage(user, status), user, Humanize(files), self.frame.HSpeed(speed), comments, status ]) @@ -4825,7 +4859,7 @@ if user in self.users: return if user in self.frame.user_stats: - status, speed, downloads, files, dirs, exists = self.frame.user_stats[user] + status, speed, downloads, files, dirs = self.frame.user_stats[user] else: status = speed = downloads = files = dirs = 0 @@ -4975,7 +5009,7 @@ if user in self.users: return if user in self.frame.user_stats: - status, speed, downloads, files, dirs, exists = self.frame.user_stats[user] + status, speed, downloads, files, dirs = self.frame.user_stats[user] else: status = speed = downloads = files = dirs = 0 @@ -5124,7 +5158,7 @@ if user in self.users: return if user in self.frame.user_stats: - status, speed, downloads, files, dirs, exists = self.frame.user_stats[user] + status, speed, downloads, files, dirs = self.frame.user_stats[user] else: status = speed = downloads = files = dirs = 0 @@ -5494,10 +5528,10 @@ for username, status in ListOfSimilarUsers.items(): if self.frame.user_stats.has_key(username): if DEBUG: print username - status2, speed, downloads, files, dirs, exists = self.frame.user_stats[username] + status2, speed, downloads, files, dirs = self.frame.user_stats[username] else: speed = downloads = files = dirs = 0 - self.frame.user_stats[username] = status, speed, downloads, files, dirs, 1 + self.frame.user_stats[username] = status, speed, downloads, files, dirs img = self.frame.GetStatusImage(username, status) hspeed = self.frame.HSpeed(speed) hfiles = Humanize(files) @@ -5642,13 +5676,12 @@ #if not ban and not ign and not tru and not bud: image = "noexist" - print user, image return self.images[image] def OpenImage(self, widget, title, filters): dialog = gtk.FileChooserDialog(title=title, parent=None, action=gtk.FILE_CHOOSER_ACTION_OPEN, buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT, gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT)) dialog.set_select_multiple(False) - dialog.set_current_folder_uri("file://"+pwd.getpwuid(os.getuid())[5]) + dialog.set_current_folder_uri("file://"+gtk.getcwd().getpwuid(os.getuid())[5]) ff = gtk.FileFilter() for ffilter in filters: ff.add_pattern(ffilter) Modified: murmur/trunk/sources/pymurmur/settings.py =================================================================== --- murmur/trunk/sources/pymurmur/settings.py 2007-03-16 23:03:07 UTC (rev 490) +++ murmur/trunk/sources/pymurmur/settings.py 2007-03-16 23:17:28 UTC (rev 491) @@ -5,7 +5,7 @@ import pygtk, gtk import gobject import time, stat, string, shutil -import pwd + from time import sleep from utils import _ try: @@ -576,7 +576,7 @@ def OpenFile(self, widget, title, filters): dialog = gtk.FileChooserDialog(title=title, parent=None, action=gtk.FILE_CHOOSER_ACTION_OPEN, buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT, gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT)) dialog.set_select_multiple(False) - dialog.set_current_folder_uri("file://"+pwd.getpwuid(os.getuid())[5]+"/.museekd") + dialog.set_current_folder_uri("file://"+gtk.getcwd().getpwuid(os.getuid())[5]+"/.museekd") ff = gtk.FileFilter() for ffilter in filters: ff.add_pattern(ffilter) @@ -657,7 +657,7 @@ def OpenImage(self, widget, title, filters): dialog = gtk.FileChooserDialog(title=title, parent=None, action=gtk.FILE_CHOOSER_ACTION_OPEN, buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT, gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT)) dialog.set_select_multiple(False) - dialog.set_current_folder_uri("file://"+pwd.getpwuid(os.getuid())[5]) + dialog.set_current_folder_uri("file://"+gtk.getcwd().getpwuid(os.getuid())[5]) ff = gtk.FileFilter() for ffilter in filters: ff.add_pattern(ffilter) @@ -789,7 +789,7 @@ def OpenDirectory(self, widget, title): dialog = gtk.FileChooserDialog(title=title, parent=None, action=gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER, buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT, gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT)) dialog.set_select_multiple(False) - dialog.set_current_folder_uri("file://"+pwd.getpwuid(os.getuid())[5]) + dialog.set_current_folder_uri("file://"+gtk.getcwd().getpwuid(os.getuid())[5]) response = dialog.run() @@ -807,7 +807,7 @@ def OpenConfig(self, widget): dialog = gtk.FileChooserDialog(title=_("Select the Museek Daemon Config"), parent=None, action=gtk.FILE_CHOOSER_ACTION_OPEN, buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT, gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT)) dialog.set_select_multiple(False) - dialog.set_current_folder_uri("file://"+pwd.getpwuid(os.getuid())[5]+"/.museekd") + dialog.set_current_folder_uri("file://"+gtk.getcwd().getpwuid(os.getuid())[5]+"/.museekd") ff = gtk.FileFilter() ff.add_pattern("*.xml") dialog.set_property("filter", ff) |
From: <svn...@mu...> - 2007-03-16 23:03:16
|
Author: daelstorm Date: 2007-03-17 00:03:07 +0100 (Sat, 17 Mar 2007) New Revision: 490 Modified: branches/newnet/mucous/mucous museek+/trunk/sources/mucous/mucous museek+/trunk/sources/mucous/pymucous/MucousInput.py Log: Mucous: fix create_config function call Modified: branches/newnet/mucous/mucous =================================================================== --- branches/newnet/mucous/mucous 2007-03-16 08:58:04 UTC (rev 489) +++ branches/newnet/mucous/mucous 2007-03-16 23:03:07 UTC (rev 490) @@ -255,7 +255,7 @@ else: os.mkdir(config_dir, 0700) - create_config() + self.create_config() Modified: museek+/trunk/sources/mucous/mucous =================================================================== --- museek+/trunk/sources/mucous/mucous 2007-03-16 08:58:04 UTC (rev 489) +++ museek+/trunk/sources/mucous/mucous 2007-03-16 23:03:07 UTC (rev 490) @@ -38,11 +38,12 @@ sys.exit() try: import messages, driver -except: +except Exception, error: try: from museek import messages, driver - except: - print "WARNING: The Museek Message-Parsing modules, messages.py and/or driver.py were not found. Please install them into your '/usr/lib/python2.X/site-packages/museek' directory, or place them in a 'museek' subdirectory of the directory that contains the mucous python script." + except Exception, error: + print "WARNING: The Museek Message-Parsing modules, messages.py and/or driver.py were not found. Please install them into your '/usr/lib/python2.X/site-packages/museek' directory, or place them in a 'museek' subdirectory of the directory that contains the mucous python script.", error + sys.exit() import signal, time, os, commands, getopt, threading, select, string, re, ConfigParser @@ -254,7 +255,7 @@ else: os.mkdir(config_dir, 0700) - create_config() + self.create_config() Modified: museek+/trunk/sources/mucous/pymucous/MucousInput.py =================================================================== --- museek+/trunk/sources/mucous/pymucous/MucousInput.py 2007-03-16 08:58:04 UTC (rev 489) +++ museek+/trunk/sources/mucous/pymucous/MucousInput.py 2007-03-16 23:03:07 UTC (rev 490) @@ -1577,9 +1577,10 @@ for rooms12 in self.mucous.ChatRooms.tickers: alpha_list[rooms12] = self.mucous.ChatRooms.tickers[rooms12] #if self.mucous.Config["tickers"]["tickers_enabled"] == 'yes': + for rooms13, ticks in alpha_list.items(): if rooms13 == woom: - ttickers =[] + ttickers = ticks.keys() if ttickers != []: self.mucous.Help.Log("status", "Tickers in room: "+str(rooms13)) |
From: <svn...@mu...> - 2007-03-16 08:58:16
|
Author: daelstorm Date: 2007-03-16 09:58:04 +0100 (Fri, 16 Mar 2007) New Revision: 489 Modified: branches/newnet/mucous/pymucous/MucousInput.py branches/newnet/murmur/murmur Log: Murmur: Fix transfer arguments in gobjects.idle_add(); mucous: remove needless variable initialization Modified: branches/newnet/mucous/pymucous/MucousInput.py =================================================================== --- branches/newnet/mucous/pymucous/MucousInput.py 2007-03-16 02:20:32 UTC (rev 488) +++ branches/newnet/mucous/pymucous/MucousInput.py 2007-03-16 08:58:04 UTC (rev 489) @@ -1577,9 +1577,10 @@ for rooms12 in self.mucous.ChatRooms.tickers: alpha_list[rooms12] = self.mucous.ChatRooms.tickers[rooms12] #if self.mucous.Config["tickers"]["tickers_enabled"] == 'yes': + for rooms13, ticks in alpha_list.items(): if rooms13 == woom: - ttickers =[] + ttickers = ticks.keys() if ttickers != []: self.mucous.Help.Log("status", "Tickers in room: "+str(rooms13)) Modified: branches/newnet/murmur/murmur =================================================================== --- branches/newnet/murmur/murmur 2007-03-16 02:20:32 UTC (rev 488) +++ branches/newnet/murmur/murmur 2007-03-16 08:58:04 UTC (rev 489) @@ -581,11 +581,13 @@ def cb_transfer_state(self, downloads, uploads): gtk.gdk.threads_enter() if DEBUG == True: print " **** cb_transfer_state" - for transfer in uploads: - gobject.idle_add(self.frame.uploads.append, user=transfer.user, filename=None, rate=transfer.rate, state=transfer.state, filepos=transfer.filepos, filesize=transfer.filesize, path=transfer.path, error=transfer.error, place=transfer.place) - for transfer in downloads: - gobject.idle_add(self.frame.downloads.append, user=transfer.user, filename=None, rate=transfer.rate, state=transfer.state, filepos=transfer.filepos, filesize=transfer.filesize, path=transfer.path, error=transfer.error, place=transfer.place) - + try: + for transfer in uploads: + gobject.idle_add(self.frame.uploads.append, transfer.user, None, transfer.rate, transfer.state, transfer.filepos, transfer.filesize, transfer.path, transfer.error, transfer.place) + for transfer in downloads: + gobject.idle_add(self.frame.downloads.append, transfer.user, None, transfer.rate, transfer.state, transfer.filepos, transfer.filesize, transfer.path, transfer.error, transfer.place) + except Exception, e: + print e gtk.gdk.threads_leave() @@ -594,9 +596,9 @@ try: if DEBUG == True: print " **** cb_transfer_update" if transfer.is_upload: - gobject.idle_add(self.frame.uploads.update ,user=transfer.user, filename=None, rate=transfer.rate, state=transfer.state, filepos=transfer.filepos, filesize=transfer.filesize, path=transfer.path, error=transfer.error, place=transfer.place) + gobject.idle_add(self.frame.uploads.update , transfer.user, None, transfer.rate, transfer.state, transfer.filepos, transfer.filesize, transfer.path, transfer.error, transfer.place) else: - gobject.idle_add(self.frame.downloads.update, user=transfer.user, filename=None, rate=transfer.rate, state=transfer.state, filepos=transfer.filepos, filesize=transfer.filesize, path=transfer.path, error=transfer.error, place=transfer.place) + gobject.idle_add(self.frame.downloads.update, transfer.user, None, transfer.rate, transfer.state, transfer.filepos, transfer.filesize, transfer.path, transfer.error, transfer.place) except Exception,e: if DEBUG == True: print " **** cb_transfer_update ERROR", e gtk.gdk.threads_leave() @@ -842,7 +844,7 @@ gobject.idle_add(self.frame.TrayApp.SetToolTip, message) gobject.idle_add(self.frame.update_statusbar, message) - gobject.idle_add(self.frame.TrayApp.SetImage,"yellow") + gobject.idle_add(self.frame.TrayApp.SetImage, "yellow") elif self.frame.status == 2: message = "Connected to Museek: %s Status: Online" % username |
From: <svn...@mu...> - 2007-03-16 02:20:59
|
Author: daelstorm Date: 2007-03-16 03:20:32 +0100 (Fri, 16 Mar 2007) New Revision: 488 Modified: branches/newnet/mucous/mucous Log: mucous-newnet: more verbose error when messages or driver cannot be found Modified: branches/newnet/mucous/mucous =================================================================== --- branches/newnet/mucous/mucous 2007-03-16 02:19:20 UTC (rev 487) +++ branches/newnet/mucous/mucous 2007-03-16 02:20:32 UTC (rev 488) @@ -38,11 +38,12 @@ sys.exit() try: import messages, driver -except: +except Exception, error: try: from museek import messages, driver - except: - print "WARNING: The Museek Message-Parsing modules, messages.py and/or driver.py were not found. Please install them into your '/usr/lib/python2.X/site-packages/museek' directory, or place them in a 'museek' subdirectory of the directory that contains the mucous python script." + except Exception, error: + print "WARNING: The Museek Message-Parsing modules, messages.py and/or driver.py were not found. Please install them into your '/usr/lib/python2.X/site-packages/museek' directory, or place them in a 'museek' subdirectory of the directory that contains the mucous python script.", error + sys.exit() import signal, time, os, commands, getopt, threading, select, string, re, ConfigParser |
From: <svn...@mu...> - 2007-03-16 02:19:33
|
Author: daelstorm Date: 2007-03-16 03:19:20 +0100 (Fri, 16 Mar 2007) New Revision: 487 Modified: branches/newnet/murmur/murmur Log: disconnect if while sending we recieve winsock error 10054 Modified: branches/newnet/murmur/murmur =================================================================== --- branches/newnet/murmur/murmur 2007-03-16 00:55:46 UTC (rev 486) +++ branches/newnet/murmur/murmur 2007-03-16 02:19:20 UTC (rev 487) @@ -309,7 +309,8 @@ ## Ping def cb_ping(self): if DEBUG == True: print " **** cb_ping" - + pass + def cb_server_privileges(self, time_left): if DEBUG == True: print " **** cb_server_privileges: %i" % time_left @@ -788,7 +789,7 @@ if DEBUG == True: print " **** cb_login_ok ERROR", e self.connected = True - def disconnect(self, string): + def disconnect(self, string=""): try: if self.frame.username != None: @@ -1048,6 +1049,8 @@ try: self.send(message) except Exception, e: + if e.args[0] == 10054: + self.cb_disconnected() print "SendMessage: " + str(e) + " " + str(message) ## Abort transfer (remains in transfer list) |
From: <svn...@mu...> - 2007-03-16 00:55:56
|
Author: daelstorm Date: 2007-03-16 01:55:46 +0100 (Fri, 16 Mar 2007) New Revision: 486 Modified: branches/newnet/murmur/murmur Log: Add lots of gobject.idle_add() to driver callbacks; fix user_stats dict to not try to unpack the removed 'exists' status Modified: branches/newnet/murmur/murmur =================================================================== --- branches/newnet/murmur/murmur 2007-03-16 00:39:23 UTC (rev 485) +++ branches/newnet/murmur/murmur 2007-03-16 00:55:46 UTC (rev 486) @@ -488,12 +488,9 @@ # @param recommendations list of recommendations [item, number of recommends] def cb_get_global_recommendations(self, recommendations): try: - #self.frame.Recommendations.data["recommendations"] = self.frame.SortedDict() - self.frame.Recommendations.UpdateRecommendations(recommendations) - #for rec, num in recommendations.items(): - #self.frame.Recommendations.data["recommendations"] [rec] = num - #if self.frame.mode == "lists" and self.frame.UsersLists.current == "interests": - #self.frame.Recommendations.DrawInterests() + + gobject.idle_add(self.frame.Recommendations.UpdateRecommendations, recommendations) + except Exception, e: print "CB Get Global Recommendations" + str(e) @@ -503,12 +500,9 @@ def cb_get_similar_users(self, users): try: - #self.frame.Recommendations.data["similar_users"] = self.frame.SortedDict() - self.frame.Recommendations.UpdateSimilarUsers(users) - #for rec, num in users.items(): - #self.frame.Recommendations.data["similar_users"][rec] = num - ##if self.frame.mode == "lists" and self.frame.UsersLists.current == "interests": - #self.frame.Recommendations.DrawInterests() + + gobject.idle_add(self.frame.Recommendations.UpdateSimilarUsers, users) + except Exception, e: print "CB Similar Users" + str(e) self.frame.PrintTraceBack() @@ -518,12 +512,9 @@ # @param recommendations list of recommendations [item, number of recommends] def cb_get_recommendations(self, recommendations): try: - #self.frame.Recommendations.data["recommendations"] = self.frame.SortedDict() - self.frame.Recommendations.UpdateRecommendations(recommendations) - #for rec, num in recommendations.items(): - #self.frame.Recommendations.data["recommendations"] [rec] = num - #if self.frame.mode == "lists" and self.frame.UsersLists.current == "interests": - #self.frame.Recommendations.DrawInterests() + + gobject.idle_add(self.frame.Recommendations.UpdateRecommendations, recommendations) + except Exception, e: print "CB Get Recommendations" + str(e) @@ -533,12 +524,9 @@ # @param users List of format [username, status=(0,1,2)] def cb_get_item_similar_users(self, item, users): try: - #self.frame.Recommendations.data["similar_users"] = self.frame.SortedDict() - self.frame.Recommendations.UpdateSimilarUsers(users) - #for rec, num in users.items(): - #self.frame.Recommendations.data["similar_users"][rec] = num - #if self.frame.mode == "lists" and self.frame.UsersLists.current == "interests": - #self.frame.Recommendations.DrawInterests() + + gobject.idle_add(self.frame.Recommendations.UpdateSimilarUsers, users) + except Exception, e: print "CB Item Similar Users" + str(e) @@ -548,12 +536,8 @@ # @param recommendations list of recommendations [item, number of recommends] def cb_get_item_recommendations(self, item, recommendations): try: - self.frame.Recommendations.UpdateRecommendations(recommendations) - #self.frame.Recommendations.data["recommendations"] = self.frame.SortedDict() - #for rec, num in recommendations.items(): - #self.frame.Recommendations.data["recommendations"] [rec] = num - #if self.frame.mode == "lists" and self.frame.UsersLists.current == "interests": - #self.frame.Recommendations.DrawInterests() + gobject.idle_add(self.frame.Recommendations.UpdateRecommendations, recommendations) + except Exception, e: print "CB Get Item Recommendations" + str(e) @@ -561,12 +545,8 @@ gtk.gdk.threads_enter() if DEBUG == True: print " **** cb_room_list", len(roomlist) - #self.frame.room_lists = {} - #for x, y in roomlist.items(): - #self.chatrooms.rooms[x] = y - ##print x, y - - self.frame.ChatRooms.UpdateRoomList(roomlist) + + gobject.idle_add(self.frame.ChatRooms.UpdateRoomList, roomlist) gtk.gdk.threads_leave() def cb_room_tickers(self, room, tickers): @@ -583,7 +563,7 @@ gtk.gdk.threads_enter() if DEBUG == True: print " **** cb_search_ticket", query, ticket - self.frame.Searches.NewSearch( query, ticket) + gobject.idle_add(self.frame.Searches.NewSearch, query, ticket) gtk.gdk.threads_leave() @@ -592,7 +572,7 @@ gtk.gdk.threads_enter() if DEBUG == True: print " **** cb_search_results" - self.frame.Searches.NewResults(ticket, user, free, speed, queue, results) + gobject.idle_add(self.frame.Searches.NewResults,ticket, user, free, speed, queue, results) gtk.gdk.threads_leave() @@ -601,9 +581,9 @@ gtk.gdk.threads_enter() if DEBUG == True: print " **** cb_transfer_state" for transfer in uploads: - self.frame.uploads.append(user=transfer.user, filename=None, rate=transfer.rate, state=transfer.state, filepos=transfer.filepos, filesize=transfer.filesize, path=transfer.path, error=transfer.error, place=transfer.place) + gobject.idle_add(self.frame.uploads.append, user=transfer.user, filename=None, rate=transfer.rate, state=transfer.state, filepos=transfer.filepos, filesize=transfer.filesize, path=transfer.path, error=transfer.error, place=transfer.place) for transfer in downloads: - self.frame.downloads.append(user=transfer.user, filename=None, rate=transfer.rate, state=transfer.state, filepos=transfer.filepos, filesize=transfer.filesize, path=transfer.path, error=transfer.error, place=transfer.place) + gobject.idle_add(self.frame.downloads.append, user=transfer.user, filename=None, rate=transfer.rate, state=transfer.state, filepos=transfer.filepos, filesize=transfer.filesize, path=transfer.path, error=transfer.error, place=transfer.place) gtk.gdk.threads_leave() @@ -613,9 +593,9 @@ try: if DEBUG == True: print " **** cb_transfer_update" if transfer.is_upload: - self.frame.uploads.update(user=transfer.user, filename=None, rate=transfer.rate, state=transfer.state, filepos=transfer.filepos, filesize=transfer.filesize, path=transfer.path, error=transfer.error, place=transfer.place) + gobject.idle_add(self.frame.uploads.update ,user=transfer.user, filename=None, rate=transfer.rate, state=transfer.state, filepos=transfer.filepos, filesize=transfer.filesize, path=transfer.path, error=transfer.error, place=transfer.place) else: - self.frame.downloads.update(user=transfer.user, filename=None, rate=transfer.rate, state=transfer.state, filepos=transfer.filepos, filesize=transfer.filesize, path=transfer.path, error=transfer.error, place=transfer.place) + gobject.idle_add(self.frame.downloads.update, user=transfer.user, filename=None, rate=transfer.rate, state=transfer.state, filepos=transfer.filepos, filesize=transfer.filesize, path=transfer.path, error=transfer.error, place=transfer.place) except Exception,e: if DEBUG == True: print " **** cb_transfer_update ERROR", e gtk.gdk.threads_leave() @@ -626,9 +606,9 @@ if DEBUG == True: print " **** cb_transfer_remove" user_path = transfer[1], transfer[2] if transfer[0]: - self.frame.uploads.remove(transfer) + gobject.idle_add(self.frame.uploads.remove, transfer) else: - self.frame.downloads.remove(transfer) + gobject.idle_add(self.frame.downloads.remove, transfer) gtk.gdk.threads_leave() def cb_user_shares(self, user, shares): @@ -636,7 +616,7 @@ if DEBUG == True: print " **** cb_user_shares" #self.frame.get_shares(user, shares) try: - self.frame.userbrowses.GotUserBrowse(user, shares) + gobject.idle_add(self.frame.userbrowses.GotUserBrowse, user, shares) except Exception,e: if DEBUG == True: print " **** cb_user_shares ERROR", e gtk.gdk.threads_leave() @@ -647,7 +627,7 @@ if DEBUG == True: print "got %s's userinfo" % user - self.frame.userinfos.GotUserInfo(user, info, picture, uploads, queue, slotsfree) + gobject.idle_add(self.frame.userinfos.GotUserInfo, user, info, picture, uploads, queue, slotsfree) except Exception,e: if DEBUG == True: print " **** cb_user_info ERROR", e @@ -656,8 +636,8 @@ def cb_room_said(self, room, user, text): gtk.gdk.threads_enter() try: - self.frame.ChatRooms.SayChatRoom(room, user, text) - self.frame.Logging.ChatRoomLog(room, user, text) + gobject.idle_add(self.frame.ChatRooms.SayChatRoom, room, user, text) + gobject.idle_add(self.frame.Logging.ChatRoomLog, room, user, text) except Exception,e: if DEBUG == True: print " **** cb_room_said ERROR", e gtk.gdk.threads_leave() @@ -666,13 +646,14 @@ gtk.gdk.threads_enter() if DEBUG == True: print "Logged in, getting Rooms" try: - pass - self.frame.ChatRooms.UpdateRoomList(roomlist) + + gobject.idle_add(self.frame.ChatRooms.UpdateRoomList, roomlist) joined_rooms = joined.keys() joined_rooms.sort(key=str.lower) for room in joined_rooms: - for users, stats in joined[room].items(): - self.frame.user_stats[users] = [stats[0], stats[1], stats[2], stats[3], stats[4], 1] +# for users, stats in joined[room].items(): + #print stats +# self.frame.user_stats[users] = [stats[0], stats[1], stats[2], stats[3], stats[4]] gobject.idle_add(self.frame.ChatRooms.JoinRoom, str(room), joined[room]) except Exception, e: @@ -688,7 +669,7 @@ try: - self.frame.ChatRooms.JoinRoom(room, list_of_users) + gobject.idle_add(self.frame.ChatRooms.JoinRoom, room, list_of_users) except Exception, e: @@ -700,7 +681,7 @@ gtk.gdk.threads_enter() if DEBUG == True: print " **** cb_room_left %s"% room try: - self.frame.ChatRooms.LeaveRoom(room) + gobject.idle_add(self.frame.ChatRooms.LeaveRoom, room) except Exception, e: if DEBUG == True: print "Leave room bug", e gtk.gdk.threads_leave() @@ -713,7 +694,7 @@ print "%s joined room \'%s\' " %( user, room) #self.frame.rooms[room][user] = stats - self.frame.user_stats[user] = [stats[0], stats[1], stats[2 ], stats[3], stats[4], 1] + self.frame.user_stats[user] = [stats[0], stats[1],stats[2],stats[3],stats[4]] gobject.idle_add(self.frame.ChatRooms.UserJoinedRoom, room, user) @@ -762,12 +743,12 @@ country = gi.country_name_by_addr( str(ip) ) message="%s's IP: %s Port: %s Country: %s" % (user, str(ip), str(port), country) #s= self.frame.display_box(title="IP Address", message = message ) - self.frame.AppendToLogWindow(message) + if DEBUG == True: print message else: if DEBUG == True: print "No Geoip" message="%s's IP: %s Port: %s" % (user, str(ip), str(port) ) - self.frame.AppendToLogWindow(message) + gobject.idle_add(self.frame.AppendToLogWindow, message) except Exception,e: if DEBUG == True: print " **** cb_peer_address ERROR", e gtk.gdk.threads_leave() @@ -780,8 +761,8 @@ if DEBUG == True: print "Invalid Password" - self.frame.TrayApp.SetToolTip( "Couldn't connect to Museek: %s" % "Invalid Password") - self.frame.update_statusbar( "Invalid Password") + gobject.idle_add(self.frame.TrayApp.SetToolTip, "Couldn't connect to Museek: %s" % "Invalid Password") + gobject.idle_add(self.frame.update_statusbar, "Invalid Password") else: @@ -789,9 +770,9 @@ if DEBUG == True: print "couldn't log in: " + reason - self.frame.update_statusbar( "Couldn't Login") + gobject.idle_add(self.frame.update_statusbar,"Couldn't Login") - self.frame.TrayApp.SetImage("red") + gobject.idle_add(self.frame.TrayApp.SetImage,"red") except Exception,e: if DEBUG == True: print " **** cb_login_error ERROR", e self.connected = False @@ -829,11 +810,11 @@ if DEBUG == True: print " **** cb_disconnected" try: - self.frame.TrayApp.SetImage("red") + gobject.idle_add(self.frame.TrayApp.SetImage,"red") - self.frame.TrayApp.SetToolTip( "Disconnected from Museek") + gobject.idle_add(self.frame.TrayApp.SetToolTip, "Disconnected from Museek") - self.frame.update_statusbar( "Disconnected from Museek") + gobject.idle_add(self.frame.update_statusbar, "Disconnected from Museek") self.frame.username = None self.frame.status = 2 @@ -858,19 +839,19 @@ if self.frame.status: message = "Connected to Museek: %s Status: Away" % username - self.frame.TrayApp.SetToolTip( message) - self.frame.update_statusbar( message) - self.frame.TrayApp.SetImage("yellow") + gobject.idle_add(self.frame.TrayApp.SetToolTip, message) + gobject.idle_add(self.frame.update_statusbar, message) + gobject.idle_add(self.frame.TrayApp.SetImage,"yellow") elif self.frame.status == 2: message = "Connected to Museek: %s Status: Online" % username - self.frame.TrayApp.SetToolTip( message ) - self.frame.update_statusbar( message ) - self.frame.TrayApp.SetImage("green") + gobject.idle_add(self.frame.TrayApp.SetToolTip, message ) + gobject.idle_add(self.frame.update_statusbar, message ) + gobject.idle_add(self.frame.TrayApp.SetImage, "green") else: - self.frame.TrayApp.SetImage("red") + gobject.idle_add(self.frame.TrayApp.SetImage, "red") self.frame.username = username @@ -887,14 +868,14 @@ self.frame.status = status if self.frame.status: message = "Connected to Museek: %s Status: Away" % self.frame.username - self.frame.TrayApp.SetToolTip( message) - self.frame.update_statusbar( message) - self.frame.TrayApp.SetImage("yellow") + + gobject.idle_add(self.frame.TrayApp.SetImage,"yellow") else: message = "Connected to Museek: %s Status: Online" % self.frame.username - self.frame.TrayApp.SetToolTip( message ) - self.frame.update_statusbar( message ) - self.frame.TrayApp.SetImage("green") + + gobject.idle_add(self.frame.TrayApp.SetImage, "green") + gobject.idle_add(self.frame.TrayApp.SetToolTip, message ) + gobject.idle_add(self.frame.update_statusbar, message ) except Exception,e: if DEBUG == True: print " **** cb_server_status_set ERROR", e @@ -908,9 +889,9 @@ self.frame.user_exists[user] = exists if self.frame.user_stats.has_key(user): status = self.frame.user_stats[user][0] - self.frame.ChatRooms.GetUserStatus( user, status) - self.frame.userlists.updateListIcon(user) - self.frame.PrivateChats.updateStatus(user, status) + gobject.idle_add(self.frame.ChatRooms.GetUserStatus, user, status) + gobject.idle_add(self.frame.userlists.updateListIcon, user) + gobject.idle_add(self.frame.PrivateChats.updateStatus, user, status) except Exception,e: if DEBUG == True: print " **** cb_peer_exists ERROR", e @@ -933,8 +914,8 @@ if DEBUG == True: print " **** cb_peer_stats ERROR", e gtk.gdk.threads_enter() - self.frame.ChatRooms.GetUserStats( user, speed, files) - self.frame.userlists.updateStats(user, self.frame.user_stats[user]) + gobject.idle_add(self.frame.ChatRooms.GetUserStats, user, speed, files) + gobject.idle_add(self.frame.userlists.updateStats, user, self.frame.user_stats[user]) gtk.gdk.threads_leave() @@ -947,12 +928,12 @@ else: - self.frame.user_stats[user] = [status, 0, 0, 0, 0, 1] + self.frame.user_stats[user] = [status, 0, 0, 0, 0] ## Update Lists with new status information - self.frame.ChatRooms.GetUserStatus( user, status) - self.frame.userlists.updateStatus(user, status) - self.frame.PrivateChats.updateStatus(user, status) + gobject.idle_add(self.frame.ChatRooms.GetUserStatus, user, status) + gobject.idle_add(self.frame.userlists.updateStatus, user, status) + gobject.idle_add(self.frame.PrivateChats.updateStatus, user, status) except Exception,e: if DEBUG == True: print " **** cb_peer_status ERROR1", e @@ -970,7 +951,7 @@ elif type == 0: stype = "Server" - self.frame.AppendToLogWindow( "%s Message: %s" % (stype, message)) + gobject.idle_add(self.frame.AppendToLogWindow, "%s Message: %s" % (stype, message)) except Exception,e: print "cb_status_message: " +str( e) @@ -984,7 +965,7 @@ gtk.gdk.threads_enter() try: if domain in ["museek.note", "museek.warn"] : - self.frame.AppendToLogWindow("%s Message: %s" % (domain, message)) + gobject.idle_add(self.frame.AppendToLogWindow, "%s Message: %s" % (domain, message)) except Exception,e: print "cb_debug_message: " +str( e) gtk.gdk.threads_leave() @@ -3590,7 +3571,8 @@ def UserJoinedRoom(self, username): if self.users.has_key(username): return - status, speed, downloads, files, dirs, exists = self.frame.user_stats[username] + + status, speed, downloads, files, dirs = self.frame.user_stats[username] AppendLine(self.RoomLog, _("%s joined the room") % username, None) img = self.frame.GetStatusImage(username, status) hspeed = self.frame.HSpeed(speed) @@ -3977,7 +3959,7 @@ for user, stats in users.items(): #print stats - self.frame.user_stats[user] = [stats[0], stats[1], stats[2 ], stats[3], stats[4], 1] + self.frame.user_stats[user] = [stats[0], stats[1], stats[2], stats[3], stats[4]] # online status, avgspeed, numdownloads, numfiles, numdirs if self.frame.Config["logging"]["logrooms"] == "yes" and room not in self.frame.Config["logging"]["rooms"]: self.frame.Config["logging"]["rooms"].append(room) @@ -4727,7 +4709,7 @@ if user in self.users: return if user in self.frame.user_stats: - status, speed, downloads, files, dirs, exists = self.frame.user_stats[user] + status, speed, downloads, files, dirs = self.frame.user_stats[user] else: status = speed = downloads = files = dirs = 0 self.users[user] = self.store.append([ self.frame.GetStatusImage(user, status), user, Humanize(files), self.frame.HSpeed(speed), comments, status ]) @@ -4872,7 +4854,7 @@ if user in self.users: return if user in self.frame.user_stats: - status, speed, downloads, files, dirs, exists = self.frame.user_stats[user] + status, speed, downloads, files, dirs = self.frame.user_stats[user] else: status = speed = downloads = files = dirs = 0 @@ -5022,7 +5004,7 @@ if user in self.users: return if user in self.frame.user_stats: - status, speed, downloads, files, dirs, exists = self.frame.user_stats[user] + status, speed, downloads, files, dirs = self.frame.user_stats[user] else: status = speed = downloads = files = dirs = 0 @@ -5171,7 +5153,7 @@ if user in self.users: return if user in self.frame.user_stats: - status, speed, downloads, files, dirs, exists = self.frame.user_stats[user] + status, speed, downloads, files, dirs = self.frame.user_stats[user] else: status = speed = downloads = files = dirs = 0 @@ -5541,10 +5523,10 @@ for username, status in ListOfSimilarUsers.items(): if self.frame.user_stats.has_key(username): if DEBUG: print username - status2, speed, downloads, files, dirs, exists = self.frame.user_stats[username] + status2, speed, downloads, files, dirs = self.frame.user_stats[username] else: speed = downloads = files = dirs = 0 - self.frame.user_stats[username] = status, speed, downloads, files, dirs, 1 + self.frame.user_stats[username] = status, speed, downloads, files, dirs img = self.frame.GetStatusImage(username, status) hspeed = self.frame.HSpeed(speed) hfiles = Humanize(files) |
From: <svn...@mu...> - 2007-03-16 00:39:32
|
Author: daelstorm Date: 2007-03-16 01:39:23 +0100 (Fri, 16 Mar 2007) New Revision: 485 Modified: branches/newnet/python-bindings/driver.py Log: fixed recv loops as per hyriand's instructions Modified: branches/newnet/python-bindings/driver.py =================================================================== --- branches/newnet/python-bindings/driver.py 2007-03-16 00:08:33 UTC (rev 484) +++ branches/newnet/python-bindings/driver.py 2007-03-16 00:39:23 UTC (rev 485) @@ -118,9 +118,13 @@ if length > 4: length -= 4 while len(data) < length: - recv = self.socket.recv(length ) - if recv: - data += recv + recv = self.socket.recv(length - len(data)) + if not recv: + self.cb_disconnected() + self.socket = None + return + + data += recv ## If message doesn't match known messages, raise an error if not code in MSGTAB: |
From: <svn...@mu...> - 2007-03-16 00:08:40
|
Author: daelstorm Date: 2007-03-16 01:08:33 +0100 (Fri, 16 Mar 2007) New Revision: 484 Modified: branches/newnet/python-bindings/driver.py Log: replace the WAIT_ALL with recv loops Modified: branches/newnet/python-bindings/driver.py =================================================================== --- branches/newnet/python-bindings/driver.py 2007-03-16 00:05:24 UTC (rev 483) +++ branches/newnet/python-bindings/driver.py 2007-03-16 00:08:33 UTC (rev 484) @@ -95,11 +95,16 @@ # Fetch and parse a message from museekd, blocks until an entire message is read def fetch(self): ## Unpack the first 8 bytes of the message - data = self.socket.recv(8, socket.MSG_WAITALL) - if not data: - self.cb_disconnected() - self.socket = None - return + data = "" + while len(data) < 8: + buf = self.socket.recv(8 - len(data)) + if not buf: + print "not" + self.cb_disconnected() + self.socket = None + return + data += buf + ## First 4 bytes are the length length = struct.unpack("<i", data[:4])[0] @@ -108,8 +113,15 @@ ## Second 4 bytes are the message code code = struct.unpack("<I", data[4:])[0] ## If message is longer than it's code, unpack all data + + data = '' if length > 4: - data = self.socket.recv(length - 4, socket.MSG_WAITALL) + length -= 4 + while len(data) < length: + recv = self.socket.recv(length ) + if recv: + data += recv + ## If message doesn't match known messages, raise an error if not code in MSGTAB: raise UnknownMessageException, 'received unknown message tyoe 0x%04X' % code |
From: <svn...@mu...> - 2007-03-16 00:05:33
|
Author: daelstorm Date: 2007-03-16 01:05:24 +0100 (Fri, 16 Mar 2007) New Revision: 483 Modified: branches/newnet/murmur/murmur Log: fix a few issues with user lists and and some gobject.idle_add()s where neccessary Modified: branches/newnet/murmur/murmur =================================================================== --- branches/newnet/murmur/murmur 2007-03-15 14:16:31 UTC (rev 482) +++ branches/newnet/murmur/murmur 2007-03-16 00:05:24 UTC (rev 483) @@ -666,14 +666,14 @@ gtk.gdk.threads_enter() if DEBUG == True: print "Logged in, getting Rooms" try: - + pass self.frame.ChatRooms.UpdateRoomList(roomlist) joined_rooms = joined.keys() joined_rooms.sort(key=str.lower) for room in joined_rooms: for users, stats in joined[room].items(): self.frame.user_stats[users] = [stats[0], stats[1], stats[2], stats[3], stats[4], 1] - self.frame.ChatRooms.JoinRoom(str(room), joined[room]) + gobject.idle_add(self.frame.ChatRooms.JoinRoom, str(room), joined[room]) except Exception, e: if DEBUG == True: print "Room State bug", e @@ -696,6 +696,7 @@ gtk.gdk.threads_leave() def cb_room_left(self, room): + if DEBUG == True: print "Leave room", room gtk.gdk.threads_enter() if DEBUG == True: print " **** cb_room_left %s"% room try: @@ -705,6 +706,7 @@ gtk.gdk.threads_leave() def cb_room_user_joined(self, room, user, stats): + if DEBUG == True: print "User Joined room",user gtk.gdk.threads_enter() try: if DEBUG == True: @@ -713,7 +715,7 @@ #self.frame.rooms[room][user] = stats self.frame.user_stats[user] = [stats[0], stats[1], stats[2 ], stats[3], stats[4], 1] - self.frame.ChatRooms.UserJoinedRoom(room, user) + gobject.idle_add(self.frame.ChatRooms.UserJoinedRoom, room, user) except Exception, e: if DEBUG == True: print "User Joined room bug", e @@ -721,12 +723,13 @@ def cb_room_user_left(self, room, user): + if DEBUG == True: print "User Left room",user gtk.gdk.threads_enter() try: if DEBUG == True: print "%s left room %s" % (user, room) - self.frame.ChatRooms.UserLeftRoom(room, user) + gobject.idle_add(self.frame.ChatRooms.UserLeftRoom, room, user) except Exception, e: @@ -734,22 +737,24 @@ gtk.gdk.threads_leave() def cb_private_message(self, direction, timestamp, user, message): + + if DEBUG == True: print " **** cb_private_message", user gtk.gdk.threads_enter() - if DEBUG == True: print " **** cb_private_message" if DEBUG == True: print direction, timestamp, user, message try: if DEBUG == True: print "%s PM'd to you: %s" % (user, message) - self.frame.PrivateChats.ShowMessage(direction, user, message) + gobject.idle_add(self.frame.PrivateChats.ShowMessage, direction, user, message) except Exception,e: if DEBUG == True: print " **** cb_private_message ERROR", e gtk.gdk.threads_leave() def cb_peer_address(self, user, ip, port): + + if DEBUG == True: print " **** cb_peer_address" gtk.gdk.threads_enter() - if DEBUG == True: print " **** cb_peer_address" try: if user in self.frame.ip_requested: self.frame.ip_requested.remove(user) @@ -1031,7 +1036,7 @@ #sleep(0.1) if self.socket != None: - r, w, x = select.select([self.socket, sys.stdin], [], [self.socket], d) + r, w, x = select.select([self.socket,], [], [self.socket], d) if self.socket in r: #try: @@ -2505,9 +2510,9 @@ user = self.user num = 5 self.popup_menu.ready = False - items[num].set_active(self.frame.Networking.config["buddies"].has_key(user)) - items[num+1].set_active(self.frame.Networking.config["banned"].has_key(user)) - items[num+2].set_active(self.frame.Networking.config["ignored"].has_key(user)) + items[num].set_active(self.frame.Networking.config.has_key("buddies") and self.frame.Networking.config["buddies"].has_key(user)) + items[num+1].set_active(self.frame.Networking.config.has_key("banned") and self.frame.Networking.config["banned"].has_key(user)) + items[num+2].set_active(self.frame.Networking.config.has_key("ignored") and self.frame.Networking.config["ignored"].has_key(user)) items[num+3].set_active(self.frame.Networking.config["trusted"].has_key(user)) self.popup_menu.popup(None, None, None, event.button, event.time) self.popup_menu.ready = True @@ -2742,7 +2747,7 @@ self.users[user].SendMessage(text) def ShowMessage(self, direction, user, text): - if user in self.frame.Networking.config["ignored"]: + if self.frame.Networking.config.has_key("ignored") and self.frame.Networking.config["ignored"].hsa_key(user): return ctcpversion = 0 @@ -2991,9 +2996,9 @@ #if string is not "search": self.popup_menu.ready = False if self.frame.Networking.config != {}: - items[num].set_active(self.frame.Networking.config["buddies"].has_key(user)) - items[num+1].set_active(self.frame.Networking.config["banned"].has_key(user)) - items[num+2].set_active(self.frame.Networking.config["ignored"].has_key(user)) + items[num].set_active(self.frame.Networking.config.has_key("buddies") and self.frame.Networking.config["buddies"].has_key(user)) + items[num+1].set_active(self.frame.Networking.config.has_key("banned") and self.frame.Networking.config["banned"].has_key(user)) + items[num+2].set_active(self.frame.Networking.config.has_key("ignored") and self.frame.Networking.config["ignored"].has_key(user)) items[num+3].set_active(self.frame.Networking.config["trusted"].has_key(user)) self.popup_menu.popup(None, None, None, event.button, event.time) self.popup_menu.ready = True @@ -3660,9 +3665,9 @@ # Chat, Userlists use the normal popup system num = 5 self.popup_menu.ready = True - items[num].set_active(self.frame.Networking.config["buddies"].has_key(user)) - items[num+1].set_active(self.frame.Networking.config["banned"].has_key(user)) - items[num+2].set_active(self.frame.Networking.config["ignored"].has_key(user)) + items[num].set_active(self.frame.Networking.config.has_key("buddies") and self.frame.Networking.config["buddies"].has_key(user)) + items[num+1].set_active(self.frame.Networking.config.has_key("banned") and self.frame.Networking.config["banned"].has_key(user)) + items[num+2].set_active(self.frame.Networking.config.has_key("ignored") and self.frame.Networking.config["ignored"].has_key(user)) items[num+3].set_active(self.frame.Networking.config["trusted"].has_key(user)) self.popup_menu.popup(None, None, None, event.button, event.time) self.popup_menu.ready = False @@ -3960,7 +3965,7 @@ self.frame.Networking.RoomList() def SayChatRoom(self, room, user, text): - if user in self.frame.Networking.config["ignored"].keys(): + if self.frame.Networking.config.has_key("ignored") and user in self.frame.Networking.config["ignored"].keys(): return self.joinedrooms[room].SayInChatRoom(user, text) |
From: <svn...@mu...> - 2007-03-15 14:16:43
|
Author: daelstorm Date: 2007-03-15 15:16:31 +0100 (Thu, 15 Mar 2007) New Revision: 482 Modified: branches/newnet/murmur/pymurmur/settings.py Log: more anti-pwd and anti-muci[her removals Modified: branches/newnet/murmur/pymurmur/settings.py =================================================================== --- branches/newnet/murmur/pymurmur/settings.py 2007-03-15 14:15:17 UTC (rev 481) +++ branches/newnet/murmur/pymurmur/settings.py 2007-03-15 14:16:31 UTC (rev 482) @@ -5,7 +5,7 @@ import pygtk, gtk import gobject import time, stat, string, shutil -import pwd + from time import sleep from utils import _ try: @@ -576,7 +576,7 @@ def OpenFile(self, widget, title, filters): dialog = gtk.FileChooserDialog(title=title, parent=None, action=gtk.FILE_CHOOSER_ACTION_OPEN, buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT, gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT)) dialog.set_select_multiple(False) - dialog.set_current_folder_uri("file://"+pwd.getpwuid(os.getuid())[5]+"/.museekd") + dialog.set_current_folder_uri("file://"+gtk.getcwd().getpwuid(os.getuid())[5]+"/.museekd") ff = gtk.FileFilter() for ffilter in filters: ff.add_pattern(ffilter) @@ -657,7 +657,7 @@ def OpenImage(self, widget, title, filters): dialog = gtk.FileChooserDialog(title=title, parent=None, action=gtk.FILE_CHOOSER_ACTION_OPEN, buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT, gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT)) dialog.set_select_multiple(False) - dialog.set_current_folder_uri("file://"+pwd.getpwuid(os.getuid())[5]) + dialog.set_current_folder_uri("file://"+gtk.getcwd().getpwuid(os.getuid())[5]) ff = gtk.FileFilter() for ffilter in filters: ff.add_pattern(ffilter) @@ -789,7 +789,7 @@ def OpenDirectory(self, widget, title): dialog = gtk.FileChooserDialog(title=title, parent=None, action=gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER, buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT, gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT)) dialog.set_select_multiple(False) - dialog.set_current_folder_uri("file://"+pwd.getpwuid(os.getuid())[5]) + dialog.set_current_folder_uri("file://"+gtk.getcwd().getpwuid(os.getuid())[5]) response = dialog.run() @@ -807,7 +807,7 @@ def OpenConfig(self, widget): dialog = gtk.FileChooserDialog(title=_("Select the Museek Daemon Config"), parent=None, action=gtk.FILE_CHOOSER_ACTION_OPEN, buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT, gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT)) dialog.set_select_multiple(False) - dialog.set_current_folder_uri("file://"+pwd.getpwuid(os.getuid())[5]+"/.museekd") + dialog.set_current_folder_uri("file://"+gtk.getcwd().getpwuid(os.getuid())[5]+"/.museekd") ff = gtk.FileFilter() ff.add_pattern("*.xml") dialog.set_property("filter", ff) |
From: <svn...@mu...> - 2007-03-15 14:15:31
|
Author: daelstorm Date: 2007-03-15 15:15:17 +0100 (Thu, 15 Mar 2007) New Revision: 481 Modified: branches/newnet/murmur/murmur Log: remove some mucipher and pwd requirements Modified: branches/newnet/murmur/murmur =================================================================== --- branches/newnet/murmur/murmur 2007-03-15 09:47:14 UTC (rev 480) +++ branches/newnet/murmur/murmur 2007-03-15 14:15:17 UTC (rev 481) @@ -65,14 +65,15 @@ import mucipher except ImportError: print "WARNING: The Mucipher Module for Python wasn't found and neither was PyCrypto. One of these encryption modules is necessary to allow Murmur to connect to the Museek Daemon.\nDownload mucipher here: http://thegraveyard.org/files/pymucipher-0.0.1.tar.gz\nExtract the tarball, and as Root or sudo, run:\npython setup.py install\nYou'll need GCC, Python and SWIG.\nOr download PyCrypto from here: http://www.amk.ca/python/code/crypto.html" - sys.exit() + try: import messages, driver -except ImportError: +except ImportError, error: + print error try: from museek import messages, driver - except ImportError: - print "WARNING: The Museek Message-Parsing modules, messages.py and/or driver.py were not found. Please install them into your '/usr/lib/python2.X/site-packages/museek' directory, or place them in a 'museek' subdirectory of the directory that contains the murmur python scipt." + except ImportError, error: + print "WARNING: The Museek Message-Parsing modules, messages.py and/or driver.py were not found. Please install them into your '/usr/lib/python2.X/site-packages/museek' directory, or place them in a 'museek' subdirectory of the directory that contains the murmur python scipt.", error sys.exit() trayicon_load = 1 @@ -105,10 +106,7 @@ from time import sleep import select, string, re, ConfigParser, getopt, shutil, commands -try: - import pwd -except ImportError: - print "Python module 'pwd' could not be loaded." + import threading, time import signal import tempfile @@ -122,7 +120,7 @@ import GeoIP gi = GeoIP.new(GeoIP.GEOIP_MEMORY_CACHE) except ImportError: - print "Python module 'pwd' could not be loaded." + print "Python module geoip could not be loaded." geoip_fail=1 config_dir = str(os.path.expanduser("~/.murmur/")) @@ -251,7 +249,7 @@ else: os.mkdir(config_dir, 0700) - create_config() + self.create_config() @@ -5691,7 +5689,7 @@ def OpenImage(self, widget, title, filters): dialog = gtk.FileChooserDialog(title=title, parent=None, action=gtk.FILE_CHOOSER_ACTION_OPEN, buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT, gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT)) dialog.set_select_multiple(False) - dialog.set_current_folder_uri("file://"+pwd.getpwuid(os.getuid())[5]) + dialog.set_current_folder_uri("file://"+gtk.getcwd().getpwuid(os.getuid())[5]) ff = gtk.FileFilter() for ffilter in filters: ff.add_pattern(ffilter) |
From: <svn...@mu...> - 2007-03-15 09:47:23
|
Author: daelstorm Date: 2007-03-15 10:47:14 +0100 (Thu, 15 Mar 2007) New Revision: 480 Modified: museek+/trunk/sources/Museek/PeerConnection.cc Log: add \r to userinfo newlines Modified: museek+/trunk/sources/Museek/PeerConnection.cc =================================================================== --- museek+/trunk/sources/Museek/PeerConnection.cc 2007-03-15 07:10:11 UTC (rev 479) +++ museek+/trunk/sources/Museek/PeerConnection.cc 2007-03-15 09:47:14 UTC (rev 480) @@ -124,8 +124,16 @@ } DEBUG("sending user info to %s", mUser.c_str()); lock(); + string newline = "\n"; - PInfoReply r(mMuseek->recoder()->encode_network(mMuseek->userinfo()), + string descr = mMuseek->recoder()->encode_network(mMuseek->userinfo()); + + std::string::size_type match = 0; + while ((match = descr.find("\n", match)) != string::npos){ + descr.insert(match, "\r"); + match += 2; + } + PInfoReply r(descr, mMuseek->userpic(), mMuseek->upload_slots(), mMuseek->transfer_manager()->queue_length(mUser), @@ -475,7 +483,14 @@ void PeerConnection::local_userinfo_request() { CT("local_userinfo_request %s", mUser.c_str()); - PInfoReply r(mMuseek->recoder()->encode_network(mMuseek->userinfo()), + string descr = mMuseek->recoder()->encode_network(mMuseek->userinfo()); + std::string::size_type match = 0; + while ((match = descr.find("\n", match)) != string::npos){ + descr.insert(match, "\r"); + match += 2; + } + + PInfoReply r(descr, mMuseek->userpic(), mMuseek->upload_slots(), mMuseek->transfer_manager()->queue_length(mUser), |
From: <svn...@mu...> - 2007-03-15 07:10:19
|
Author: daelstorm Date: 2007-03-15 08:10:11 +0100 (Thu, 15 Mar 2007) New Revision: 479 Modified: branches/newnet/mucous/pymucous/MucousChatRooms.py museek+/trunk/sources/mucous/pymucous/MucousChatRooms.py Log: Remove color from chat brackets Modified: branches/newnet/mucous/pymucous/MucousChatRooms.py =================================================================== --- branches/newnet/mucous/pymucous/MucousChatRooms.py 2007-03-15 06:43:39 UTC (rev 478) +++ branches/newnet/mucous/pymucous/MucousChatRooms.py 2007-03-15 07:10:11 UTC (rev 479) @@ -1168,7 +1168,7 @@ tw.addstr(timestamp) # Normal user chat pre = " [" - tw.addstr(pre, curses.A_BOLD | self.mucous.colors["black"]) + tw.addstr(pre) length += len(timestamp) + len(pre) name = self.mucous.dlang(username) @@ -1187,7 +1187,7 @@ suf = "] " length += len(suf) - tw.addstr(suf, curses.A_BOLD | self.mucous.colors["black"]) + tw.addstr(suf) if mtype == "Mentioned": x = message.split(" ") for e in x: Modified: museek+/trunk/sources/mucous/pymucous/MucousChatRooms.py =================================================================== --- museek+/trunk/sources/mucous/pymucous/MucousChatRooms.py 2007-03-15 06:43:39 UTC (rev 478) +++ museek+/trunk/sources/mucous/pymucous/MucousChatRooms.py 2007-03-15 07:10:11 UTC (rev 479) @@ -1168,7 +1168,7 @@ tw.addstr(timestamp) # Normal user chat pre = " [" - tw.addstr(pre, curses.A_BOLD | self.mucous.colors["black"]) + tw.addstr(pre) length += len(timestamp) + len(pre) name = self.mucous.dlang(username) @@ -1187,7 +1187,7 @@ suf = "] " length += len(suf) - tw.addstr(suf, curses.A_BOLD | self.mucous.colors["black"]) + tw.addstr(suf) if mtype == "Mentioned": x = message.split(" ") for e in x: |
From: <svn...@mu...> - 2007-03-15 06:43:52
|
Author: daelstorm Date: 2007-03-15 07:43:39 +0100 (Thu, 15 Mar 2007) New Revision: 478 Modified: branches/newnet/mucous/pymucous/MucousChatRooms.py branches/newnet/mucous/pymucous/MucousInput.py branches/newnet/mucous/pymucous/MucousNetworking.py museek+/trunk/sources/mucous/mucous museek+/trunk/sources/mucous/pymucous/MucousChatRooms.py museek+/trunk/sources/mucous/pymucous/MucousInput.py museek+/trunk/sources/mucous/pymucous/MucousNetworking.py Log: add /roomwin command to chatrooms Modified: branches/newnet/mucous/pymucous/MucousChatRooms.py =================================================================== --- branches/newnet/mucous/pymucous/MucousChatRooms.py 2007-03-15 05:39:47 UTC (rev 477) +++ branches/newnet/mucous/pymucous/MucousChatRooms.py 2007-03-15 06:43:39 UTC (rev 478) @@ -1279,6 +1279,21 @@ except: pass + def WindowCycle(self): + _list = None + if self.shape == "chat-only": + self.selected = "chatroom" + return + elif self.shape == "nostatuslog": + _list = ["chatroom", "roombox"] + elif self.shape == "noroombox": + _list = ["chatroom", "roomstatus"] + else: + _list = ["chatroom", "roomstatus", "roombox"] + if _list != None: + self.selected = self.mucous.FormatData.RotateList("right", _list, self.selected, "no") + self.Mode() + ## Switch to another Chat Window Layout # @param self is ChatRooms (class) def ChatLayout(self): Modified: branches/newnet/mucous/pymucous/MucousInput.py =================================================================== --- branches/newnet/mucous/pymucous/MucousInput.py 2007-03-15 05:39:47 UTC (rev 477) +++ branches/newnet/mucous/pymucous/MucousInput.py 2007-03-15 06:43:39 UTC (rev 478) @@ -538,19 +538,7 @@ elif key == "switch": if self.mucous.mode == "chat": - _list = None - if self.mucous.ChatRooms.shape == "chat-only": - self.mucous.ChatRooms.selected = "chatroom" - return - elif self.mucous.ChatRooms.shape == "nostatuslog": - _list = ["chatroom", "roombox"] - elif self.mucous.ChatRooms.shape == "noroombox": - _list = ["chatroom", "roomstatus"] - else: - _list = ["chatroom", "roomstatus", "roombox"] - if _list != None: - self.mucous.ChatRooms.selected = self.mucous.FormatData.RotateList("right", _list, self.mucous.ChatRooms.selected, "no") - self.mucous.ChatRooms.Mode() + self.mucous.ChatRooms.WindowCycle() elif self.mucous.mode == "browse": _list = [ "files", "directories" ] @@ -1688,7 +1676,8 @@ elif command == "/roombox": self.mucous.ChatRooms.ChatLayout() - + elif command == "/roomwin": + self.mucous.ChatRooms.WindowCycle() elif command == "/login": self.mucous.D.ConnectServer() Modified: branches/newnet/mucous/pymucous/MucousNetworking.py =================================================================== --- branches/newnet/mucous/pymucous/MucousNetworking.py 2007-03-15 05:39:47 UTC (rev 477) +++ branches/newnet/mucous/pymucous/MucousNetworking.py 2007-03-15 06:43:39 UTC (rev 478) @@ -40,6 +40,7 @@ self.mucous.NickTimer.cancel() self.mucous.NickTimer = threading.Timer(10.0, self.mucous.ThreadNickCheck) self.mucous.NickTimer.start() + driver.Driver.connect(self, self.mucous.Config["connection"]["interface"], self.mucous.Config["connection"]["passw"], messages.EM_CHAT | messages.EM_USERINFO| messages.EM_PRIVATE| messages.EM_TRANSFERS | messages.EM_USERSHARES | messages.EM_CONFIG | messages.EM_INTERESTS | messages.EM_DEBUG) #break Modified: museek+/trunk/sources/mucous/mucous =================================================================== --- museek+/trunk/sources/mucous/mucous 2007-03-15 05:39:47 UTC (rev 477) +++ museek+/trunk/sources/mucous/mucous 2007-03-15 06:43:39 UTC (rev 478) @@ -86,7 +86,7 @@ config_dir = str(os.path.expanduser("~/.mucous/")) log_dir = None #str(os.path.expanduser("~/.mucous/logs/")) config_file = config_dir+"config" -Version = "0.9.1" +Version = "0.9.2" ## Command Options def usage(): Modified: museek+/trunk/sources/mucous/pymucous/MucousChatRooms.py =================================================================== --- museek+/trunk/sources/mucous/pymucous/MucousChatRooms.py 2007-03-15 05:39:47 UTC (rev 477) +++ museek+/trunk/sources/mucous/pymucous/MucousChatRooms.py 2007-03-15 06:43:39 UTC (rev 478) @@ -1279,6 +1279,21 @@ except: pass + def WindowCycle(self): + _list = None + if self.shape == "chat-only": + self.selected = "chatroom" + return + elif self.shape == "nostatuslog": + _list = ["chatroom", "roombox"] + elif self.shape == "noroombox": + _list = ["chatroom", "roomstatus"] + else: + _list = ["chatroom", "roomstatus", "roombox"] + if _list != None: + self.selected = self.mucous.FormatData.RotateList("right", _list, self.selected, "no") + self.Mode() + ## Switch to another Chat Window Layout # @param self is ChatRooms (class) def ChatLayout(self): Modified: museek+/trunk/sources/mucous/pymucous/MucousInput.py =================================================================== --- museek+/trunk/sources/mucous/pymucous/MucousInput.py 2007-03-15 05:39:47 UTC (rev 477) +++ museek+/trunk/sources/mucous/pymucous/MucousInput.py 2007-03-15 06:43:39 UTC (rev 478) @@ -538,19 +538,7 @@ elif key == "switch": if self.mucous.mode == "chat": - _list = None - if self.mucous.ChatRooms.shape == "chat-only": - self.mucous.ChatRooms.selected = "chatroom" - return - elif self.mucous.ChatRooms.shape == "nostatuslog": - _list = ["chatroom", "roombox"] - elif self.mucous.ChatRooms.shape == "noroombox": - _list = ["chatroom", "roomstatus"] - else: - _list = ["chatroom", "roomstatus", "roombox"] - if _list != None: - self.mucous.ChatRooms.selected = self.mucous.FormatData.RotateList("right", _list, self.mucous.ChatRooms.selected, "no") - self.mucous.ChatRooms.Mode() + self.mucous.ChatRooms.WindowCycle() elif self.mucous.mode == "browse": _list = [ "files", "directories" ] @@ -1688,7 +1676,8 @@ elif command == "/roombox": self.mucous.ChatRooms.ChatLayout() - + elif command == "/roomwin": + self.mucous.ChatRooms.WindowCycle() elif command == "/login": self.mucous.D.ConnectServer() Modified: museek+/trunk/sources/mucous/pymucous/MucousNetworking.py =================================================================== --- museek+/trunk/sources/mucous/pymucous/MucousNetworking.py 2007-03-15 05:39:47 UTC (rev 477) +++ museek+/trunk/sources/mucous/pymucous/MucousNetworking.py 2007-03-15 06:43:39 UTC (rev 478) @@ -40,6 +40,7 @@ self.mucous.NickTimer.cancel() self.mucous.NickTimer = threading.Timer(10.0, self.mucous.ThreadNickCheck) self.mucous.NickTimer.start() + driver.Driver.connect(self, self.mucous.Config["connection"]["interface"], self.mucous.Config["connection"]["passw"], messages.EM_CHAT | messages.EM_USERINFO| messages.EM_PRIVATE| messages.EM_TRANSFERS | messages.EM_USERSHARES | messages.EM_CONFIG | messages.EM_INTERESTS | messages.EM_DEBUG) #break @@ -249,7 +250,18 @@ self.mucous.Help.Log("status", "%s Message: %s" % (stype, message)) except Exception,e: self.mucous.Help.Log("debug", "cb_status_message: " +str( e) ) - + + ## Museekd sent us a debug message + # @param self Networking (Driver Class) + # @param domain is a string the value of which is a debug type + # @param message is the message string + def cb_debug_message(self, domain, message): + try: + if domain in ["museek.note", "museek.warn"] : + self.mucous.Help.Log("status", "%s Message: %s" % (domain, message)) + except Exception,e: + self.mucous.Help.Log("debug", "cb_debug_message: " +str( e) ) + ## Museekd sent us the server state and our username # @param self Networking (Driver Class) # @param state is a bool; False if disconnected from the server / True if connected |