Mercurial > libervia-backend
comparison frontends/quick_frontend/quick_app.py @ 132:a86607e5cf38
quick_app: self.occupants for group chat are now managed by quick_chat. self.options.profile now support unicode
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 16 Jul 2010 20:12:54 +0800 |
parents | 8d611eb9ae48 |
children | 80661755ea8d |
comparison
equal
deleted
inserted
replaced
131:6cad483a6d84 | 132:a86607e5cf38 |
---|---|
89 parser = OptionParser(usage=usage) | 89 parser = OptionParser(usage=usage) |
90 | 90 |
91 parser.add_option("-p", "--profile", help=_("Select the profile to use")) | 91 parser.add_option("-p", "--profile", help=_("Select the profile to use")) |
92 | 92 |
93 (self.options, args) = parser.parse_args() | 93 (self.options, args) = parser.parse_args() |
94 if self.options.profile: | |
95 self.options.profile = self.options.profile.decode('utf-8') | |
94 return args | 96 return args |
95 | 97 |
96 def plug_profile(self, profile_key='@DEFAULT@'): | 98 def plug_profile(self, profile_key='@DEFAULT@'): |
97 """Tell application which profile must be used""" | 99 """Tell application which profile must be used""" |
98 if self.single_profile and self.profiles: | 100 if self.single_profile and self.profiles: |
139 #The waiting subscription requests | 141 #The waiting subscription requests |
140 waitingSub = self.bridge.getWaitingSub(profile) | 142 waitingSub = self.bridge.getWaitingSub(profile) |
141 for sub in waitingSub: | 143 for sub in waitingSub: |
142 self.subscribe(waitingSub[sub], sub, profile) | 144 self.subscribe(waitingSub[sub], sub, profile) |
143 | 145 |
144 #Now we open the MUC window when we already are: | 146 #Now we open the MUC window where we already are: |
145 for room_args in self.bridge.getRoomJoined(profile): | 147 for room_args in self.bridge.getRoomJoined(profile): |
146 self.roomJoined(*room_args, profile=profile) | 148 self.roomJoined(*room_args, profile=profile) |
147 | 149 |
148 for subject_args in self.bridge.getRoomSubjects(profile): | 150 for subject_args in self.bridge.getRoomSubjects(profile): |
149 self.roomNewSubject(*subject_args, profile=profile) | 151 self.roomNewSubject(*subject_args, profile=profile) |
162 """called when the connection is made""" | 164 """called when the connection is made""" |
163 if not self.check_profile(profile): | 165 if not self.check_profile(profile): |
164 return | 166 return |
165 debug(_("Connected")) | 167 debug(_("Connected")) |
166 self.setStatusOnline(True) | 168 self.setStatusOnline(True) |
167 #self.bridge.joinMUC('conference.necton2.int', 'test', self.profiles[self.profile]['whoami'].node, self.profile) #gof: | 169 self.bridge.joinMUC('conference.necton2.int', 'test', self.profiles[self.profile]['whoami'].node, self.profile) #gof: |
168 | 170 |
169 | 171 |
170 def disconnected(self, profile): | 172 def disconnected(self, profile): |
171 """called when the connection is closed""" | 173 """called when the connection is closed""" |
172 if not self.check_profile(profile): | 174 if not self.check_profile(profile): |