Changeset 152
- Timestamp:
- 04/27/08 00:07:15 (7 months ago)
- Files:
-
- randomchat/AUTHORS (added)
- randomchat/COPYING (added)
- randomchat/README (added)
- randomchat/locale (added)
- randomchat/locale/fr_FR (added)
- randomchat/locale/fr_FR/LC_MESSAGES (added)
- randomchat/locale/fr_FR/LC_MESSAGES/randomchat.mo (added)
- randomchat/locale/fr_FR/LC_MESSAGES/randomchat.po (added)
- randomchat/locale/randomchat.pot (added)
- randomchat/logs (added)
- randomchat/src (added)
- randomchat/src/config-example.py (moved) (moved from randomchat/config-example.py) (2 diffs)
- randomchat/src/randomchat.py (moved) (moved from randomchat/randomchat.py) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
randomchat/src/config-example.py
r145 r152 1 # ######################################## 2 # Welcome to Random Chat configuration 3 # ######################################## 4 5 # The jabber identifiant of the component, 6 # the password, the server and the port. 1 7 JID = 'randomchat.example.com' 2 8 PASS = 'secret' … … 4 10 PORT = 5347 5 11 12 # Default nick 6 13 NICK_GUEST = 'inconnu(e)' 7 14 15 # Database configuration 8 16 DB_MODULE = 'sqlite' 9 SQLITE_DB = ' randomchat.db'17 SQLITE_DB = '../randomchat.db' 10 18 19 # Enable or disable log 11 20 LOG = True randomchat/src/randomchat.py
r146 r152 1 1 #!/usr/bin/env python 2 2 # -*- coding: utf-8 -*- 3 4 from gettext import (bindtextdomain, textdomain, bind_textdomain_codeset, \ 5 gettext as _) 6 bindtextdomain('randomchat', '../locale') 7 textdomain('randomchat') 8 bind_textdomain_codeset('randomchat', 'UTF-8') 3 9 4 10 from xmpp import (NS_DISCO_ITEMS, NS_DISCO_INFO, NS_REGISTER, NS_MUC, JID, \ … … 8 14 from time import time 9 15 from datetime import datetime 10 from os.path import join 11 from os import getcwd 16 from os.path import join, isdir 17 from os import getcwd, listdir 12 18 13 19 import config … … 118 124 # Log 119 125 if config.LOG: 120 file_ = open( join(getcwd(), 'logs', room), 'a')126 file_ = open('../logs/' + room, 'a') 121 127 122 128 date = datetime.now().strftime('%d/%m/%Y %H:%M:%S') … … 151 157 [ 152 158 Node('reason', 153 payload = [ 'Votre interlocuteur a quitté le salon'] )159 payload = [_('Your interlocutor just leave the room.')] ) 154 160 ]) 155 161 ]) … … 222 228 def invite(self, room, jid): 223 229 invite = Message(to=jid, frm=room + '@' + self.jid, 224 body = 'Vous avez été invité dans le salon ' + room + '@' + self.jid,230 body = _('You have been invited in the room %s.' % (room + '@' + self.jid) ), 225 231 payload = 226 232 [ … … 282 288 self.con.RegisterHandler('message', self.message_handler) 283 289 290 # Prepare informations for disco. 284 291 b = browser.Browser() 285 292 b.PlugIn(self.con) … … 349 356 if not self.init_chat(msg.getFrom()): 350 357 con.send(Message(to=msg.getFrom(), frm=msg.getTo(), 351 body= 'Pas de participant trouvé',358 body=_('No participant found.'), 352 359 typ=msg.getType())) 353 360
