- Timestamp:
- 12/09/07 21:29:40 (4 years ago)
- Location:
- mymrc/trunk/mymrc/src
- Files:
-
- 32 modified
-
controllers/__init__.py (modified) (1 diff)
-
controllers/audiocontroller.py (modified) (11 diffs)
-
db/__init__.py (modified) (1 diff)
-
db/audioqueries.py (modified) (18 diffs)
-
db/dbdriver.py (modified) (9 diffs)
-
db_utils.py (modified) (1 diff)
-
errors/__init__.py (modified) (1 diff)
-
errors/config.py (modified) (2 diffs)
-
errors/networking.py (modified) (1 diff)
-
errors/sqlite.py (modified) (1 diff)
-
mobileclient/__init__.py (modified) (1 diff)
-
mobileclient/appuifw.py (modified) (3 diffs)
-
mobileclient/audioview.py (modified) (13 diffs)
-
mobileclient/client.py (modified) (5 diffs)
-
mobileclient/clientengine.py (modified) (4 diffs)
-
mobileclient/dvdview.py (modified) (1 diff)
-
mobileclient/opcode.py (modified) (1 diff)
-
mobileclient/tvview.py (modified) (1 diff)
-
mobileclient/videoview.py (modified) (2 diffs)
-
mobileclient/viewengine.py (modified) (1 diff)
-
mymrc.conf (modified) (1 diff)
-
mymrcd.py (modified) (6 diffs)
-
networking/__init__.py (modified) (1 diff)
-
networking/btserver.py (modified) (11 diffs)
-
networking/inetserver.py (modified) (17 diffs)
-
networking/packet.py (modified) (5 diffs)
-
settings/__init__.py (modified) (1 diff)
-
settings/lang.py (modified) (5 diffs)
-
settings/players.py (modified) (5 diffs)
-
settings/settings.py (modified) (6 diffs)
-
utils/__init__.py (modified) (1 diff)
-
utils/applock.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
mymrc/trunk/mymrc/src/controllers/__init__.py
r14 r49 1 ## @package controllers 2 # @brief controllers Package 3 4 ## @file controllers/__init__.py 5 # @brief Package module and/or package loader. 6 7 ## @package controllers.__init__ 8 # @brief Package module and/or package loader -
mymrc/trunk/mymrc/src/controllers/audiocontroller.py
r14 r49 1 ## @file controllers/audiocontroller.py 2 # @brief Contains the audio controller class 3 4 ## @package controllers.audiocontroller 5 # @brief Contains the audio controller class 6 1 7 import sys, thread 2 8 from settings.players import Players … … 4 10 from popen2 import popen3 as popen 5 11 12 ## debuggin helper 6 13 def printd(aString): 7 14 print aString 8 15 16 17 ## Controller base class 9 18 class Controller( object ): 19 20 21 ## @brief The constructor 22 # 23 # @param self The object pointer 10 24 def __init__(self): 11 25 if sys.platform == 'win32': 12 self._shell, self._tail = ('cmd', '\r\n') 26 ## Command tail 27 self._tail = '\r\n' 13 28 else: 14 self._shell, self._tail = ('sh', '\n') 29 self._tail = '\n' 30 15 31 16 32 ## @brief Run the command given 33 # 34 # @param self The object pointer 35 # @param aCommand Command to be run 17 36 def cmd( self, aCommand ): 18 37 try: … … 25 44 return '0000', 'error' 26 45 46 47 ## @brief The destructor. 48 # 49 # @param self The object pointer 27 50 def __del__( self ): 28 51 # close I/O pipes … … 36 59 37 60 38 61 62 ## @brief Audio controller class. 63 # 39 64 class AudioController( Controller, Players ): 65 66 ## @brief The constructor 67 # 68 # @param self The object pointer 40 69 def __init__(self): 41 70 Controller.__init__(self) 42 71 Players.__init__(self) 72 73 ## Player name (command) 43 74 self._iPlayer = Settings().get("players", "audio") 44 75 printd("Audio player: " + self._iPlayer) 76 ## Non braking space 45 77 self._iNBSP = " " 46 78 79 80 ## @brief Play 81 # @param self The object pointer 82 # @param aFile Path of the file to play. 47 83 def play(self, aFile=None): 48 84 command = self.get(self._iPlayer, "start") + self._iNBSP + \ … … 53 89 return "Play" 54 90 55 def stop(self): 91 92 ## @brief Stop 93 # 94 # @param self The object pointer 95 def stop( self ): 56 96 command = self.get(self._iPlayer, "start")+ \ 57 97 self._iNBSP+self.get(self._iPlayer, "stop") 58 98 return self.cmd(command) 59 99 100 101 ## @brief Pause 102 # 103 # @param self The object pointer 60 104 def pause(self): 61 105 command = self.get(self._iPlayer, "start")+\ … … 63 107 return self.cmd(command) 64 108 109 110 ## @brief Next 111 # 112 # @param self The object pointer 65 113 def next(self): 66 114 command = self.get(self._iPlayer, "start")+\ … … 68 116 return self.cmd(command) 69 117 118 119 ## @brief Close 120 # 121 # @param self The object pointer 70 122 def close(self): 71 123 command = self.get(self._iPlayer, "start")+\ 72 124 self._iNBSP+self.get(self._iPlayer, "close") 73 125 return self.cmd(command) 74 126 127 128 ## @brief Previous 129 # 130 # @param self The object pointer 75 131 def previous(self): 76 132 command = self.get(self._iPlayer, "start")+\ 77 133 self._iNBSP+self.get(self._iPlayer, "previous") 78 134 return self.cmd(command) 79 135 136 137 ## @brief Forward 138 # 139 # @param self The object pointer 80 140 def forward(self): 81 141 command = self.get(self._iPlayer, "start")+\ 82 142 self._iNBSP+self.get(self._iPlayer, "forward") 83 143 return self.cmd(command) 84 144 145 146 ## @brief Backward 147 # 148 # @param self The object pointer 85 149 def backward(self): 86 150 command = self.get(self._iPlayer, "start")+\ … … 88 152 return self.cmd(command) 89 153 154 155 ## @brief Volume up 156 # 157 # @param self The object pointer 90 158 def volume_up(self): 91 159 command = self.get(self._iPlayer, "start")+\ … … 93 161 return self.cmd(command) 94 162 95 ## volume down. 96 # @callgraph 97 # @callergraph 163 164 ## @brief Volume down 165 # 166 # @param self The object pointer 98 167 def volume_down(self): 99 168 command = self.get(self._iPlayer, "start")+\ … … 101 170 return self.cmd(command) 102 171 172 173 ## @brief Full screen 174 # 175 # @param self The object pointer 103 176 def fullscreen(self): 104 177 command = self.get(self._iPlayer, "start")+\ … … 106 179 return self.cmd(command) 107 180 181 182 ## @brief Hide/show UI controls 183 # 184 # @param self The object pointer 108 185 def hide_show_controls(self): 109 186 command = self.get(self._iPlayer, "start")+\ -
mymrc/trunk/mymrc/src/db/__init__.py
r14 r49 1 ## @package db 2 # @brief db Package 3 4 ## @file db/__init__.py 5 # @brief Package module and/or package loader. 6 7 ## @package db.__init__ 8 # @brief Package module and/or package loader -
mymrc/trunk/mymrc/src/db/audioqueries.py
r41 r49 1 ## @file db/audioqueries.py 2 # @brief Contains the AudioQueries class 3 4 ## @package db.audioqueries 5 # @brief Contains the AudioQueries class 6 7 8 # Contains the SQL queries for the database interaction 1 9 from db.dbdriver import DBDriver 2 10 from settings.settings import Settings … … 4 12 5 13 14 ## @brief Audio queries class 15 # 6 16 class AudioQueries(object): 17 18 ## @brief The constructor 19 # 20 # @param self The object pointer 7 21 def __init__(self): 8 22 path = Settings().get('database', 'path') 23 ## Database instance 9 24 self._iDB = DBDriverClass(path) 10 25 26 27 ## @brief Get all songs from the database 28 # 29 # @param self The object pointer 30 # @return Song list 11 31 def allSongs(self): 12 32 query = """SELECT audio_song.id AS id, … … 25 45 return self._iDB.execute(query) 26 46 47 48 ## @brief Get album list 49 # 50 # @param self The object pointer 51 # @return Album list 27 52 def albums(self): 28 53 query = """SELECT title FROM audio_album ORDER BY title;""" 29 54 return self._iDB.execute(query) 30 55 31 ## Get all songs from an album 56 57 ## @brief Get album's songs list 58 # 59 # @param self The object pointer 60 # @param aAlbumTitle Album title 61 # @return Album songs list 32 62 def albumSongs(self, aAlbumTitle): 33 63 query = """SELECT audio_song.id AS id, … … 47 77 return self._iDB.execute(query, (aAlbumTitle,)) 48 78 79 80 ## @brief Get artist list 81 # 82 # @param self The object pointer 83 # @param raw True/False. If false returns name list. If True returns all artist fields in a list. 84 # @returns Artist list. 49 85 def artists(self, raw=False): 50 86 if raw: … … 54 90 return self._iDB.execute(query) 55 91 56 ## Get all songs from an artist 92 93 ## @brief Get all songs for an artist 94 # 95 # @param self The object pointer 96 # @param aArtistName Artist name 97 # @return Artist songs list. 57 98 def artistAllSongs(self, aArtistName): 58 99 query = """ SELECT audio_song.id AS id, … … 73 114 74 115 75 ## Get the list of all albums from a given artist. 116 ## @brief Get the list of all albums for a given artist. 117 # 118 # @param self The object pointer 119 # @param aArtistName Artist name 120 # @return Album list. 76 121 def artistAlbums(self, aArtistName): 77 122 query = """SELECT DISTINCT audio_album.title AS album … … 84 129 85 130 86 ## Get the list of all genres - those, that actually do have songs, would 87 # be quite senseless to give the whole genre list, when most of them won't 88 # have any songs anyway 131 ## @brief Get the list of genres 132 # 133 # @param self The object pointer 134 # @return Genres list 89 135 def genres(self): 90 136 query = """SELECT audio_genre.name AS genre … … 95 141 96 142 97 ## Get all songs from a genre 143 ## @brief Get all songs for a genre 144 # 145 # @param self The object pointer 146 # @param aGenre Genre 147 # return Song list. 98 148 def genreSongs(self, aGenre): 99 149 query = """ … … 116 166 117 167 118 ## Add artist if not exists. 119 # @param self The object pointer. 168 ## @brief Add artist if not exists. 169 # 170 # @param self The object pointer. 171 # @param aArtist Artist name 172 # @return Query result 120 173 def addArtist(self, aArtist): 121 174 query = """INSERT INTO audio_artist(name) … … 129 182 130 183 131 ## Add album if not exists. 184 ## @brief Add album if not exists. 185 # 132 186 # @param self The object pointer. 187 # @param aAlbum Album title 188 # @return Query result 133 189 def addAlbum(self, aAlbum): 134 190 query = """INSERT INTO audio_album(title) … … 142 198 143 199 144 ## Get all available playlists. 200 ## @brief Get all available playlists. 201 # 202 # @param self The object pointer 203 # @param raw 204 # @return Playlist list 145 205 def playlists(self, raw=False): 146 206 if raw: … … 150 210 return self._iDB.execute(query) 151 211 152 ## Get complete data from all songs from a playlist (taken from the playlist 153 # ID, determined after the playlist was selected). 154 # NOTE: this is not tested, just a guess. 212 213 ## @brief Get the playlist songs 214 # 215 # @param self The object pointer 216 # @param aPlaylist Playlist 217 # @return Playlist list 155 218 def playlistSongs(self, aPlaylist): 156 219 query="""SELECT audio_song.id AS id, … … 170 233 ORDER BY audio_playlist_data.id;""" 171 234 return self._iDB.execute(query, (aPlaylist,)) 172 235 236 237 ## @brief Get song path from a song ID 238 # 239 # @param self The object pointer 240 # @param aId Song ID 241 # @return Song path 173 242 def songById(self, aId): 174 243 query = """ SELECT path FROM audio_song WHERE id=?""" 175 244 return self._iDB.execute(query, (aId)) 176 245 246 247 ## @brief Get song field from a song title 248 # 249 # @param self The object pointer 250 # @param aTitle Song title 251 # @return Song fields in a list 177 252 def songByTitle(self, aTitle): 178 253 query = """ SELECT * FROM audio_song WHERE title=?""" 179 254 return self._iDB.execute(query,(aTitle,)) 180 255 256 257 ## @brief Add a song to playlist 258 # 259 # @param self The object pointer 260 # @param aPlaylistId Playlist ID 261 # @param aSongId Song ID 262 # @return Query result 181 263 def addSongToPlaylist(self, aPlaylistId, aSongId): 182 264 query = """ INSERT INTO audio_playlist_data(playlist_id, song_id) … … 185 267 186 268 187 ## Insert a whole artist into a playlist. 269 ## @brief Add all artist songs to playlist 270 # 271 # @param self The object pointer 272 # @param aArtist Artist name 273 # @param aPlaylist Playlist name 274 # @return Query result 188 275 def addArtistToPlaylist(self, aArtist, aPlaylist): 189 276 query = """INSERT INTO audio_playlist_data(playlist_id, song_id) … … 195 282 196 283 197 ## Insert a whole album into a playlist. 284 ## @brief Add album's song to playlist 285 # 286 # @param self The object pointer 287 # @param aAlbum Album name 288 # @param aPlaylist Playlist name 289 # @return Query result 198 290 def addAlbumToPlaylist(self, aAlbum, aPlaylist): 199 291 print "aAlbum: ", aAlbum … … 207 299 208 300 209 ## Insert a whole genre into a playlist 301 ## @brief Add genre's songs to playlist 302 # 303 # @param self The object pointer 304 # @param aGenre Gernre name 305 # @param aPlaylist Playlist name 306 # @return Query result 210 307 def addGenreToPlaylist(self, aGenre, aPlaylist): 211 308 query = """INSERT INTO audio_playlist_data(playlist_id, song_id) … … 217 314 218 315 219 ## Delete a playlist316 ## @brief Delete a playlist 220 317 # @note: since SQLite doesn't really deal with foreign keys, we can't just 221 318 # use an ON DELETE CASCADE in the table creation, so we have to delete 222 319 # all entries manually 320 # @param self The object pointer 321 # @param aPlaylist Play list id 322 # @return Query result 223 323 def deletePlaylist(self, aPlaylist): 224 324 query = """DELETE FROM audio_playlist_data WHERE audio_playlist_id = ?; … … 228 328 229 329 ## Add song to database 330 ## @brief Get all songs from the database 331 # 332 # @param self The object pointer 333 # @param aPath Path 334 # @param aTitle Title 335 # @param aArtist Artist 336 # @param aAlbum Album 337 # @param aGenre Genre 338 # @param aTrackNb Track number 339 # @param aTime Time 340 # @return Query result 230 341 def addSong(self, aPath, aTitle, aArtist, aAlbum, aGenre, aTrackNb=None, aTime=None): 231 342 query = """ INSERT INTO audio_artist(name) VALUES (?) WHERE NOT EXISTS((SELECT name FROM audio_artist WHERE name=?))""" -
mymrc/trunk/mymrc/src/db/dbdriver.py
r38 r49 1 ## @file db/dbdriver.py 2 # @brief Contains the DBDriver and DBDriverClass classes 3 4 ## @package db.dbdriver 5 # @brief Contains the DBDriver and DBDriverClass classes 6 1 7 import os.path 2 8 from symbol import arglist … … 200 206 201 207 202 ## Settingsclass.203 # Used to retrieve settings from the configuration file.208 ## @brief DBDriver singleton class. 209 # 204 210 class DBDriver( object ): 205 211 ## Stores the unique Singleton instance- 206 212 _iInstance = None 207 213 214 ## @brief Nested class for the DBDriver singleton. 215 # 208 216 class DBDriverClass( object ): 217 218 ## @brief The constructor 219 # 220 # @param self The object pointer 221 # @param aCwd Directory where the database "mymrc.db" is 222 # @param connect True/False if True the connection is made when 223 # create the class object if not connect needs to be called 209 224 def __init__( self, aCwd, connect=True ): 210 225 self._iDB = os.path.join(aCwd, "mymrc.db") … … 212 227 self.connect( ) 213 228 229 230 ## @brief Make a database connection 231 # 232 # @param self The object pointer 214 233 def connect( self ): 215 234 from pysqlite2 import dbapi2 as sqlite … … 223 242 self.executescript( template ) 224 243 244 245 ## @brief Execute a query 246 # @param self The object pointer 247 # @param aQuery Query to execute 248 # @param args Arguments for the query 225 249 def execute( self, aQuery, args=[] ): 226 250 resulset = self._iCur.execute( aQuery, args ) … … 228 252 return resulset 229 253 254 255 ## @brief Execute a SQL sript 256 # @param self The object pointer 257 # @param aScript SQL script to execute 230 258 def executescript( self, aScript ): 231 259 resulset = self._iCur.executescript( aScript ) … … 233 261 return resulset 234 262 263 264 ## @brief Get cursor instance 265 # 266 # @param self The object pointer 235 267 def getCursor( self ): 236 268 return self._iCur 237 269 270 271 ## @brief Get connection instance 272 # 273 # @param self The object pointer 238 274 def getConn( self ): 239 275 return self._iConn 240 276 277 278 ## @brief The destructor 279 # 280 # @param self The object pointer 241 281 def __del__( self ): 242 282 self._iCur.close( ) 243 283 self._iConn.close( ) 244 284 245 ## The constructor 246 # @param self The object pointer. 285 ## @brief The constructor 286 # @param self The object pointer 287 # @param aCwd Directory where the database "mymrc.db" is 288 # @param connect True/False if True the connection is made when 289 # create the class object if not connect needs to be called 247 290 def __init__( self, aCwd=None, connect=True ): 248 291 # Check whether we already have an instance … … 255 298 256 299 257 ## Delegate access to implementation.300 ## @brief Delegate access to implementation. 258 301 # @param self The object pointer. 259 # @param a ttr Attribute wanted.302 # @param aAttr Attribute wanted. 260 303 # @return Attribute 261 304 def __getattr__(self, aAttr): … … 263 306 264 307 265 ## Delegate access to implementation.308 ## @brief Delegate access to implementation. 266 309 # @param self The object pointer. 267 # @param a ttr Attribute wanted.268 # @param value Vaule to be set.310 # @param aAttr Attribute wanted. 311 # @param aValue Vaule to be set. 269 312 # @return Result of operation. 270 313 def __setattr__(self, aAttr, aValue): … … 274 317 275 318 276 319 ## @brief Database driver class. 320 # 277 321 class DBDriverClass( object ): 278 322 def __init__( self, aCwd, connect=True ): -
mymrc/trunk/mymrc/src/db_utils.py
r42 r49 1 ## @file db_utils.py 2 # @brief db utilities script 3 # 4 # Add song to database / Add directory to db / Add directory to db recursively 5 6 ## @package db_utils 7 # @brief db utilities script 8 # 9 # Add song to database / Add directory to db / Add directory to db recursively 10 11 ## @class socket 12 # @brief Default socket class 13 1 14 import os, os.path 2 15 from db.audioqueries import AudioQueries -
mymrc/trunk/mymrc/src/errors/__init__.py
r8 r49 1 ## @package errors 2 # @brief errors Package 3 4 ## @file errors/__init__.py 5 # @brief Package module and/or package loader. 6 7 ## @package errors.__init__ 8 # @brief Package module and/or package loader 9 10 ## @class Exception 11 # @brief Exception base class 12 13 ## @package Exception 14 # @brief Exception base class -
mymrc/trunk/mymrc/src/errors/config.py
r8 r49 1 ## @file errors/config.py 2 # @brief Contains the FileMissingError and DatabaseSectionError classes 1 3 2 ## Raised when the configuration file is missing 4 ## @package errors.config 5 # @brief Contains the FileMissingError and DatabaseSectionError classes 6 7 8 ## @brief Raised when the configuration file is missing 9 # 3 10 class FileMissingError(Exception): 4 11 # @param self The object pointer … … 7 14 8 15 9 ## Raised when the a section in the configuration file is disformed 16 ## @brief Raised when the a section in the configuration file is disformed 17 # 10 18 class DatabaseSectionError(Exception): 11 19 # @param self The object pointer. -
mymrc/trunk/mymrc/src/errors/networking.py
r8 r49 1 ## @file errors/networking.py 2 # @brief Contains the NoInterfaceError class 3 4 ## @package errors.networking 5 # @brief Contains the NoInterfaceError class 6 1 7 ## Raised when no network interface has been configured. 2 8 class NoInterfaceError( Exception ): -
mymrc/trunk/mymrc/src/errors/sqlite.py
r8 r49 1 ## @file errors/sqlite.py 2 # @brief Contains the ImportErrorPySQLite class 1 3 4 ## @package errors.sqlite 5 # @brief Contains the ImportErrorPySQLite class 2 6 3 7 ## Raised when pySQLite2 isn't installed on the system. -
mymrc/trunk/mymrc/src/mobileclient/__init__.py
r8 r49 1 ## @package mobileclient 2 # @brief mobileclient Package 3 4 ## @file mobileclient/__init__.py 5 # @brief Package module and/or package loader. 6 7 ## @package mobileclient.__init__ 8 # @brief Package module and/or package loader -
mymrc/trunk/mymrc/src/mobileclient/appuifw.py
r40 r49 1 ## @file mobileclient/appuifw.py 2 # @brief Contains the Listbox, Form and Canvas classes 1 3 4 ## @package mobileclient.appuifw 5 # @brief Contains the Listbox, Form and Canvas classes 6 7 ## @brief ListBox builder 8 # 2 9 class ListBox(object): 3 10 def __init__(self, aTitle): … … 14 21 return self._iForm + """</list>""" 15 22 16 23 24 25 ## @brief Form builder 26 # 17 27 class Form(object): 18 28 def __init__(self, aTitle): … … 52 62 return self._iForm + """</form>""" 53 63 54 64 65 66 ## @brief Canvas builder 67 # 55 68 class Canvas(object): 56 69 def __init__(self, aTitle, aLength=1234): -
mymrc/trunk/mymrc/src/mobileclient/audioview.py
r29 r49 1 ## @file mobileclient/audioview.py 2 # @brief Contains the AudioView class 3 4 ## @package mobileclient.audioview 5 # @brief Contains the AudioView class 6 1 7 from settings.lang import Lang 2 8 from mobileclient.appuifw import ListBox 3 9 from mobileclient.opcode import OPCode 4 10 from db.audioqueries import AudioQueries 5 11 12 13 ## @brief Audio view builder/manager 14 # 6 15 class AudioView(object): 16 17 ## @brief The constructor 18 # @param self The object pointer 19 # @param aViewStack View stack (Array) reference 20 # @param aActionStack Action stack (Array) reference 21 # @param aListStack List stack (Array) reference 7 22 def __init__(self, aViewStack, aActionStack, aListStack): 8 23 self._iViewStack = aViewStack … … 11 26 self._iDB = AudioQueries() 12 27 28 29 ## @brief Main view 30 # @param self The object pointer 13 31 def main(self): 14 32 print "Audio main" … … 47 65 self._iListStack.append(id_list) 48 66 67 68 ## @brief All songs view 69 # 70 # @param self The object pointer 49 71 def allSongs(self): 50 72 print "Audio all songs" … … 75 97 76 98 99 ## @brief Artists view 100 # 101 # @param self The object pointer 77 102 def artists(self): 78 103 print "Audio Artists" … … 103 128 104 129 130 ## @brief Artist albums view 131 # 132 # @param self The object pointer 133 # @param aArtistName Artist name 105 134 def artistAlbums(self, aArtistName): 106 135 print "Audio %s album" %(aArtistName) … … 137 166 138 167 168 ## @brief Album songs view 169 # 170 # @param self The object pointer 171 # @param aAlbum Album name 139 172 def artistAlbumSongs(self, aAlbum): 140 173 print "Audio artist album songs" … … 162 195 self._iListStack.append(id_list) 163 196 164 197 198 ## @brief Artist all songs view 199 # 200 # @param self The object pointer 201 # @param aArtistName Artist name 165 202 def artistAllSongs(self, aArtistName): 166 203 print "Audio artist all songs" … … 191 228 192 229 230 ## @brief Albums view 231 # 232 # @param self The object pointer 193 233 def albums(self): 194 234 print "Audio album" … … 219 259 220 260 261 ## @brief Album's songs view 262 # 263 # @param self The object pointer 264 # @param aAlbum Album name 221 265 def albumSongs(self, aAlbum): 222 266 print "Audio album songs" … … 246 290 self._iListStack.append(id_list) 247 291 248 292 293 ## @brief Genres view 294 # 295 # @param self The object pointer 249 296 def genres(self): 250 297 print "Audio genres" … … 277 324 278 325 326 ## @brief Genre songs view 327 # 328 # @param self The object pointer 329 # @param aGenre Genre name 279 330 def genreSongs(self, aGenre): 280 331 print "Audio genres songs" … … 305 356 306 357 358 ## @brief Playlists view 359 # 360 # @param self The object pointer 307 361 def playlists(self): 308 362 print "Audio playlists" … … 332 386 333 387 388 ## @brief Playlist songs view 389 # 390 # @param self The object pointer 391 # @param aPlaylist Playlist name 334 392 def playlistSongs(self, aPlaylist): 335 393 print "Audio playlist" -
mymrc/trunk/mymrc/src/mobileclient/client.py
r39 r49 1 ## @file mobileclient/client.py 2 # @brief Contains the Client class 3 4 ## @package mobileclient.client 5 # @brief Contains the Client class 6 7 1 8 from mobileclient.clientengine import ClientEngine 2 9 from settings.settings import Settings … … 8 15 print aString 9 16 17 ## @brief Client class 18 # 10 19 class Client: 20 21 ## @brief The constructor 22 # 23 # @param self The object pointer 24 # @param aConnection Connection instance (list) 11 25 def __init__(self, aConnection ): 12 26 self._iConn = aConnection[0] … … 19 33 printd( 'New connection with: ' + str(aConnection[1]) ) 20 34 35 36 ## @brief Client observer 37 # 38 # @param self The object pointer 21 39 def _observer(self): 22 40 # set PID to be able to kill the thread … … 39 57 printd("Connection closed: " + str( self._iConn ) ) 40 58 59 60 ## @brief Send a string to the remote client 61 # 62 # @param self The object pointer 63 # @param aString String to sned 41 64 def send(self, aString): 42 65 print "Send" … … 47 70 self._iConn.sendall(aString, 512) 48 71 72 73 ## @brief Receive 74 # 75 # @param self The object pointer 49 76 def receive(self): 50 77 pass 51 78 79 80 ## @brief Start observer 81 # 82 # @param self The object pointer 52 83 def start_observer(self): 53 84 print "start_observer(self):" 54 85 thread.start_new_thread(self._observer, () ) 55 86 87 88 ## @brief Stop observer 89 # 90 # @param self The object pointer 56 91 def stop_observer(self): 57 92 if self._iObserverPid: 58 93 os.popen("kill -9 "+str(self._iObserverPid)) 59 94 95 96 ## @brief The destructor 97 # 98 # @param self The object pointer 60 99 def __del__(self): 61 100 self._iEngine() -
mymrc/trunk/mymrc/src/mobileclient/clientengine.py
r28 r49 1 ## @file mobileclient/clientengine.py 2 # @brief Contains the ClientEngine class 3 4 ## @package mobileclient.clientengine 5 # @brief Contains the ClientEngine class 6 1 7 from networking.packet import PacketBuilder 2 8 from settings.settings import Settings … … 10 16 11 17 18 ## @brief Client engine 19 # 12 20 class ClientEngine( object ): 21 22 ## @brief The constructor 23 # 24 # @param self The object pointer 25 # @param aSendCb Send function callback 13 26 def __init__(self, aSendCb): 14 27 self._iViewEngine = ViewEngine() … … 17 30 self._iAddToPlaylist = {} 18 31 32 33 ## @brief Event handler 34 # 35 # @param self The object pointer 36 # @param opcode Operation code 19 37 def handle_event(self, opcode): 20 38 print "Event received: ", opcode … … 189 207 AudioController().hide_show_controls() 190 208 self.send(PacketBuilder().build(OPCode()['DUMMY'], '')) 191 192 if __name__ == '__main__': 193 Settings('/home/dlefevre/workspace/mymrc/src') 194 Lang('/home/dlefevre/workspace/mymrc/src') 195 DBDriver( '/home/dlefevre/workspace/mymrc/src' ) 196 197 query = """SELECT * FROM audio_playlist_data""" 198 rs = DBDriver().execute(query) 199 print rs.fetchall() 200 201 query = """SELECT * FROM audio_playlist""" 202 rs = DBDriver().execute(query) 203 print rs.fetchall() 204 205 query = """SELECT * FROM audio_song""" 206 rs = DBDriver().execute(query) 207 print rs.fetchall() 208 209 210 db = AudioQueries() 211 rs = db.playlists() 212 print rs.fetchall() 213 214 215 def send(aData): 216 print aData 217 218 engine = ClientEngine( send ) 219 220 while True: 221 entry = raw_input('>>>').strip() 222 if entry == 'h': 223 engine.handle_event(PacketBuilder().build(OPCode()['HELLO'],'')) 224 elif entry == 's': 225 entry = raw_input('Index >>>').strip() 226 engine.handle_event(PacketBuilder().build(OPCode()['SELECT'], entry) ) 227 elif entry == 'o': 228 entry = raw_input('Index >>>').strip() 229 engine.handle_event(PacketBuilder().build(OPCode()['NOWPLAYING'], '')) 230 elif entry == 'b': 231 engine.handle_event(OPCode()['BACK']) 232 233 234 235 236 elif entry == 'q': 237 break 238 239 print "Bye bye" 240 241 242 209 210 211 # 212 #if __name__ == '__main__': 213 # Settings('/home/dlefevre/workspace/mymrc/src') 214 # Lang('/home/dlefevre/workspace/mymrc/src') 215 # DBDriver( '/home/dlefevre/workspace/mymrc/src' ) 216 # 217 # query = """SELECT * FROM audio_playlist_data""" 218 # rs = DBDriver().execute(query) 219 # print rs.fetchall() 220 # 221 # query = """SELECT * FROM audio_playlist""" 222 # rs = DBDriver().execute(query) 223 # print rs.fetchall() 224 # 225 # query = """SELECT * FROM audio_song""" 226 # rs = DBDriver().execute(query) 227 # print rs.fetchall() 228 # 229 # 230 # db = AudioQueries() 231 # rs = db.playlists() 232 # print rs.fetchall() 233 # 234 # 235 # def send(aData): 236 # print aData 237 # 238 # engine = ClientEngine( send ) 239 # 240 # while True: 241 # entry = raw_input('>>>').strip() 242 # if entry == 'h': 243 # engine.handle_event(PacketBuilder().build(OPCode()['HELLO'],'')) 244 # elif entry == 's': 245 # entry = raw_input('Index >>>').strip() 246 # engine.handle_event(PacketBuilder().build(OPCode()['SELECT'], entry) ) 247 # elif entry == 'o': 248 # entry = raw_input('Index >>>').strip() 249 # engine.handle_event(PacketBuilder().build(OPCode()['NOWPLAYING'], '')) 250 # elif entry == 'b': 251 # engine.handle_event(OPCode()['BACK']) 252 # 253 # 254 # 255 # 256 # elif entry == 'q': 257 # break 258 # 259 # print "Bye bye" 260 261 262 -
mymrc/trunk/mymrc/src/mobileclient/dvdview.py
r29 r49 1 ## @file mobileclient/dvdview.py 2 # @brief Contains the DvdView class 3 4 ## @package mobileclient.dvdview 5 # @brief Contains the DvdView class 1 6 2 7 8 ## @brief DVD view class 9 # 3 10 class DvdView(object): 11 12 ## @brief The constructor 13 # 14 # @param self The object pointer 4 15 def __init__(self): 5 16 pass 6 17 18 19 ## @brief Main view 20 # 21 # @param self The object pointer 7 22 def main(self): 8 23 print "Dvd view" -
mymrc/trunk/mymrc/src/mobileclient/opcode.py
r26 r49 1 ## @file mobileclient/opcode.py 2 # @brief Contains the OPCode class 3 4 ## @package mobileclient.opcode 5 # @brief Contains the OPCode class 1 6 2 7 8 ## @brief Operation code dictionary 9 # 3 10 class OPCode( dict ): 11 12 ## @brief The constructor 13 # 14 # @param self The object pointer 4 15 def __init__(self): 5 16 dict.__init__(self) -
mymrc/trunk/mymrc/src/mobileclient/tvview.py
r29 r49 1 ## @file mobileclient/tvview.py 2 # @brief Contains the TvView class 3 4 ## @package mobileclient.tvview 5 # @brief Contains the TvView class 6 7 8 ## @brief Tv view class 9 # 1 10 class TvView(object): 11 12 ## @brief The constructor 13 # 14 # @param self The object pointer 2 15 def __init__(self): 3 16 pass 4 17 18 19 ## @brief Main view 20 # 21 # @param self The object pointer 5 22 def main(self): 6 23 print "Tv view" -
mymrc/trunk/mymrc/src/mobileclient/videoview.py
r29 r49 1 ## @file mobileclient/videoview.py 2 # @brief Contains the VideoView class 3 4 ## @package mobileclient.videoview 5 # @brief Contains the VideoView class 6 1 7 from settings.lang import Lang 2 8 from mobileclient.appuifw import ListBox 3 9 from mobileclient.opcode import OPCode 4 10 5 ## Video service view class. 11 ## @brief Video view class 12 # 6 13 class VideoView(object): 14 15 ## @brief The constructor 16 # 17 # @param self The object pointer 18 # @param aViewStack View stack pointer 19 # @param aActionStack Action stack pointer 20 # @param aListStack List stack pointer 7 21 def __init__(self, aViewStack, aActionStack, aListStack): 8 22 self._iViewStack = aViewStack … … 10 24 self._iListStack = aListStack 11 25 26 27 ## @brief Main view 28 # 29 # @param self The object pointer 12 30 def main(self): 13 31 lb = ListBox(Lang().label('Video')) -
mymrc/trunk/mymrc/src/mobileclient/viewengine.py
r29 r49 1 ## @file mobileclient/viewengine.py 2 # @brief Contains the ViewEngine class 3 4 ## @package mobileclient.viewengine 5 # @brief Contains the ViewEngine class 6 1 7 from mobileclient.audioview import AudioView 2 8 from mobileclient.videoview import VideoView -
mymrc/trunk/mymrc/src/mymrc.conf
r36 r49 12 12 [database] 13 13 dbname=mymrcdb 14 path = /home/ dlefevre/workspace/mymrc/src14 path = /home/mymrc/src 15 15 16 16 [players] -
mymrc/trunk/mymrc/src/mymrcd.py
r35 r49 1 ## @package mymrcd 2 # @brief myMRC daemon 3 4 ## @file mymrcd.py 5 # @brief myMRC daemon script 6 1 7 ## myMRC deamon 2 8 # @author LEFEVRE Damien 3 9 # @version 0.1 4 # @decription myMRC server daemon 10 # @brief myMRC server daemon 11 12 ## @package dict 13 # @brief dictionary type 14 15 ## @class dict 16 # @brief dictionary type 17 18 ## @package object 19 # @brief object type 20 21 ## @class object 22 # @brief object type 23 24 ## @mainpage Welcome to myMRC 0.1 25 # 26 #'myMRC' stands for @b my @b Mobile @b Remote @b Control 27 # 28 #With myMRC you can remote your multimedia player, DVD, TV... from your PDA or phone via a WiFi or Bluetooth connection. 29 # 30 #In its first beta version, we tested the application with MPlayer and totem on Linux environment. MPlayer appears to offer more flexibility and options than totem or other players. To be able to use it you will need to install our mplayerW (mplayer wrapper) which is a client server daemon. For Totem, there's nothing special to do. 31 # 32 # @n 33 # @section Configuration 34 # 35 #All relevant information are stored in the configuration files: 36 # 37 # @li mymrc.conf 38 # @li players.conf 39 # @li lang.conf 40 # 41 #It is mandatory to set the server IP and port, give the absolute directory path where the database will be stored and the database name. 42 # 43 # 44 # @n 45 # @section library_sec Multimedia Library 46 # On the distribution folder there is a Python script for adding songs to the 47 # multimedia library @b db_utils.py. Usage 48 # 49 # %\\>python db_utils.py 50 # 51 # Then choose if you want to: 52 # @li Add song to database 53 # @li Add directory to db 54 # @li Add directory to db recursively 55 # 56 # As soon as the project will evolve, the remove and edit commands will be added 57 # 58 # @n 59 # @section Server 60 # 61 #The server has been developed in python, since it was an easy and cross platform solution. Cross platform has its limits, so for now the server will only run on Linux OS. Some modifications will be done later to make it run on Windows. 62 # 63 #To start the server, run in its current folder: 64 # 65 #%\\>python mymrcd.py 66 # 67 # @n 68 # @section Client 69 # 70 #In the first beta version, we offer a Java (J2ME) client. In the future you will also have the choice to use a S60 C++ or S60 Python client. 71 # 72 #We tested successfully the Java client on: 73 # 74 # @li Nokia N91 75 # @li Nokia E61 76 # @li Nokia 6234 77 # 78 # @n 79 # @section Desktop GUI 80 # 81 #A desktop GUI is under development to offer an interface to manage the multimedia library. Written in PyGTK, it would also be a cross platform solution. 82 # 83 # @n 84 # @section Future improvement 85 # 86 #Some improvements are already programmed: 87 # 88 # @li PyS60 client 89 # @li S60 C++ client 90 # @li Desktop GUI 91 # @li Port on Windows 92 # 93 94 95 96 5 97 from settings.settings import Settings 6 98 from utils.applock import App_lock … … 22 114 class MyMRCd: 23 115 24 ## The constructor. 116 ## @brief The constructor. 117 # 25 118 # @param self The object pointer. 26 119 def __init__(self): … … 32 125 33 126 34 ## Run the server 127 ## @brief Run the server 128 # 35 129 # @param self The object pointer. 36 130 def run(self): … … 38 132 BtServer().start() 39 133 40 ## Destructor. Stops the networking servers 134 ## @brief Destructor. Stops the networking servers 135 # 41 136 # @param self The object pointer. 42 137 def __del__(self): … … 46 141 47 142 if __name__ == '__main__': 48 # APP_LOCK = App_lock()143 ## myMRC deamon instance 49 144 myMRC = MyMRCd() 50 145 myMRC.run() … … 55 150 del myMRC 56 151 print "Bye bye" 57 #APP_LOCK.wait( ) -
mymrc/trunk/mymrc/src/networking/__init__.py
r8 r49 1 ## @package networking 2 # @brief errors Package 3 4 ## @file networking/__init__.py 5 # @brief Package module and/or package loader. 6 7 ## @package networking.__init__ 8 # @brief Package module and/or package loader -
mymrc/trunk/mymrc/src/networking/btserver.py
r34 r49 1 ## @file networking/btserver.py 2 # @brief Contains the BtServer and BtServerSocket classes 3 4 ## @package networking.btserver 5 # @brief Contains the BtServer and BtServerSocket classes 6 7 ## @package bluetooth 8 # @brief bluetooth package from PyBuez http://org.csail.mit.edu/pybluez/ 9 # 10 # Project page: http://org.csail.mit.edu/pybluez/ 11 12 ## @class bluetooth 13 # @brief bluetooth package from PyBuez 14 # 15 # Project page: http://org.csail.mit.edu/pybluez/ 16 17 ## @package bluetooth.BluetoothSocket 18 # @brief BluetoothSocket class from PyBuez 19 # 20 # Project page: http://org.csail.mit.edu/pybluez/ 21 22 ## @class bluetooth::BluetoothSocket 23 # @brief BluetoothSocket class from PyBuez 24 # 25 # Project page: http://org.csail.mit.edu/pybluez/ 26 1 27 from settings.settings import Settings 2 28 import thread, threading, bluetooth … … 5 31 def printd( aString ): 6 32 print aString 33 34 35 ## @brief Bluetooth socket server class 36 # 37 class BtServerSocket( bluetooth.BluetoothSocket ): 7 38 8 class BtServerSocket( bluetooth.BluetoothSocket ): 39 ## @brief The constructor 40 # @param self The object pointer 41 # @param aMac Bluetooth adapter MAC address. By default empty string ("") 42 # and it will detect the default adapter MAC. 43 # @param aPort Port for the service. By detault any 9 44 def __init__(self, aMac="", aPort=bluetooth.PORT_ANY): 10 45 bluetooth.BluetoothSocket.__init__( self, bluetooth.RFCOMM ) … … 27 62 printd("Bt interface: %s"%(repr(self.getsockname()))) 28 63 29 ## Add instance to the array.30 # @param self :The object pointer.31 # @param aC hannel: Channel to had thethe array.64 ## @brief Add instance to the array. 65 # @param self The object pointer. 66 # @param aClient Client to had to the array. 32 67 def _addToStack( self, aClient ): 33 68 self._iLock.acquire( ) … … 36 71 printd( "Client added to stack") 37 72 38 ## Handle incomming connection request.39 # @param self :The object pointer.73 ## @brief Handle incomming connection request. 74 # @param self The object pointer. 40 75 def _connectionHandler( self ): 41 76 printd("Wait for incoming connection") … … 48 83 49 84 50 ## Listen interface for incomming connection.85 ## @brief Listen interface for incomming connection. 51 86 # @param self The object pointer. 52 87 def start( self ): 53 88 thread.start_new_thread(self._connectionHandler, () ) 54 89 90 91 ## @brief The destructor 92 # @param self The object pointer. 55 93 def __del__(self): 56 94 for client in self._iClientStack: … … 58 96 del client 59 97 60 ## Bluetooth server singleton. 98 ## @brief Bluetooth server singleton. 99 # 61 100 class BtServer( object ): 62 101 ## Stores the unique Singleton instance- 63 102 _iInstance = None 64 103 65 ## Bluetooth server class declaration 104 ## @brief Bluetooth server class declaration 105 # 66 106 class BtServerClass: 107 108 ## @brief The constructor 109 # @param self The object pointer 67 110 def __init__( self ): 68 111 self._iRunning = False 69 112 70 113 71 ## Start the server.114 ## @brief Start the server. 72 115 # @param self The object pointer. 73 116 def start(self): … … 79 122 printd("BtServer started") 80 123 81 ## Stop the server.124 ## @brief Stop the server. 82 125 # @param self The object pointer. 83 126 def stop(self): … … 86 129 printd("BtServer stopped") 87 130 88 ## Restart server.131 ## @brief Restart server. 89 132 # @param self The object pointer. 90 133 def restart(self): … … 96 139 return self._iRunning 97 140 98 ## The constructor141 ## @brief The constructor 99 142 # @param self The object pointer. 100 143 def __init__( self ): … … 108 151 109 152 110 ## Delegate access to implementation.153 ## @brief Delegate access to implementation. 111 154 # @param self The object pointer. 112 # @param a ttr Attribute wanted.155 # @param aAttr Attribute to get. 113 156 # @return Attribute 114 157 def __getattr__(self, aAttr): … … 116 159 117 160 118 ## Delegate access to implementation.161 ## @brief Delegate access to implementation. 119 162 # @param self The object pointer. 120 # @param a ttr Attribute wanted.121 # @param value Vaule to be set.163 # @param aAttr Attribute wanted. 164 # @param aValue Vaule to be set. 122 165 # @return Result of operation. 123 166 def __setattr__(self, aAttr, aValue): -
mymrc/trunk/mymrc/src/networking/inetserver.py
r14 r49 1 ## @file networking/inetserver.py 2 # @brief Contains the InetServer and InetServerSocket classes 3 4 ## @package networking.inetserver 5 # @brief Contains the InetServer and InetServerSocket classes 6 1 7 ################################################################################ 2 8 # Networking: … … 10 16 11 17 12 # Inet socket server 18 ## @brief Inet socket server 19 # 13 20 class InetServerSocket( socket.socket ): 14 21 15 ## The constructor.22 ## @brief The constructor. 16 23 # @param self: The object pointer. 17 24 # @param aHost: Host name to connect to. … … 22 29 self.bind ( ( str(aHost), int(aPort) ) ) 23 30 self.listen ( int(aMaxClient) ) 31 ## Lock 24 32 self._iLock = threading.Semaphore() 33 ## Client stack 25 34 self._iClientStack = [] 35 ## Maximum connection 26 36 self._iMaxClient = int(aMaxClient) 27 37 printd("Inet interface: (%s:%s) - concurrent connection: %s"%(aHost, … … 30 40 31 41 32 ## Add instance to the array.33 # @param self :The object pointer.34 # @param aC hannel: Channel to had thethe array.42 ## @brief Add instance to the array. 43 # @param self The object pointer. 44 # @param aClient Client to had to the array. 35 45 def _addToStack( self, aClient ): 36 46 self._iLock.acquire( ) … … 40 50 41 51 42 ## Remove instance from array52 ## @brief Remove instance from array 43 53 # @param self: The object pointer 44 # @param aC hannel: Channelto remove from the queue54 # @param aClient: Client to remove from the queue 45 55 def _removeFromStack( self, aClient ): 46 56 self._iLock.acquire( ) … … 50 60 51 61 52 ## Watch for channel incoming requests.62 ## @brief Watch for channel incoming requests. 53 63 # @param self: The object pointer. 54 64 # @param aChannel: Channel to remove from the queue. … … 68 78 69 79 70 ## Handle incomming connection request.80 ## @brief Handle incomming connection request. 71 81 # @param self: The object pointer. 72 82 def _connectionHandler( self ): … … 89 99 90 100 91 ## Listen interface for incomming connection.101 ## @brief Listen interface for incomming connection. 92 102 # @param self The object pointer. 93 103 def start( self ): … … 95 105 96 106 97 ## Send data107 ## @brief Send data 98 108 # @param self The object pointer. 99 109 # @param aFrame Frame. … … 101 111 pass 102 112 113 114 ## @brief The destructor 115 # @param self The object pointer 103 116 def __del__(self): 104 117 for client in self._iClientStack: … … 106 119 del client 107 120 108 ## Inet server singletong 121 ## @brief Inet server singletong 122 # 109 123 class InetServer( object ): 110 124 ## Stores the unique Singleton instance- 111 125 _iInstance = None 112 126 113 ## Inet server class declaration 127 ## @brief Inet server class declaration 128 # 114 129 class InetServerClass: 115 130 116 ## The constructor.131 ## @brief The constructor. 117 132 # @param self: The object pointer. 118 133 def __init__( self ): 119 134 self._iSocketServer = None 120 135 121 ## Start the server.136 ## @brief Start the server. 122 137 # @param self The object pointer. 123 138 def start(self): … … 129 144 printd("InetServer started") 130 145 131 ## Stop the server.146 ## @brief Stop the server. 132 147 # @param self The object pointer. 133 148 def stop(self): … … 137 152 printd("InetServer stopped") 138 153 139 ## Restart server.154 ## @brief Restart server. 140 155 # @param self The object pointer. 141 156 def restart(self): … … 145 160 146 161 147 ## The destructor148 # @param self: The object pointer162 ## @brief The destructor 163 # @param self: The object pointer 149 164 def __del__( self ): 150 165 self.stop() … … 154 169 ########################################################################### 155 170 156 ## The constructor171 ## @brief The constructor 157 172 # @param self The object pointer. 158 173 def __init__( self ): … … 166 181 167 182 168 ## Delegate access to implementation.183 ## @brief Delegate access to implementation. 169 184 # @param self The object pointer. 170 # @param a ttr Attribute wanted.185 # @param aAttr Attribute wanted. 171 186 # @return Attribute 172 187 def __getattr__(self, aAttr): … … 174 189 175 190 176 ## Delegate access to implementation.191 ## @brief Delegate access to implementation. 177 192 # @param self The object pointer. 178 # @param a ttr Attribute wanted.179 # @param value Vaule to be set.193 # @param aAttr Attribute wanted. 194 # @param aValue Vaule to be set. 180 195 # @return Result of operation. 181 196 def __setattr__(self, aAttr, aValue): -
mymrc/trunk/mymrc/src/networking/packet.py
r14 r49 1 ## @file networking/packet.py 2 # @brief Contains the Packet, PacketBuilder and PacketParser classes 3 4 ## @package networking.packet 5 # @brief Contains the Packet, PacketBuilder and PacketParser classes 6 1 7 """ 2 8 Packet format: … … 12 18 from settings.settings import Settings 13 19 14 ## Parse and build packets20 ## @brief Parse and build packets 15 21 # 16 22 class Packet( object ): … … 20 26 _iDataLength = 16 21 27 28 29 ## @brief The constructor 30 # @param self The object pointer 22 31 def __init__(self): 23 32 self._iBufferSize = int(Settings().get("protocol", "BufferSize")) 24 33 self._iDataLength = int(Settings().get("protocol", "DataLength")) 25 34 26 ## Get the data length with the proper formating (16 characters value).35 ## @brief Get the data length with the proper formating (16 characters value). 27 36 # @param self: The object pointer. 37 # @param aData: Data to get the length from 28 38 # @return: 16 characters formated length. 29 39 def _formatedLength( self, aData ): … … 37 47 38 48 39 ## Packet builder class. 49 ## @brief Packet builder class. 50 # 40 51 class PacketBuilder( Packet ): 41 ## Build a packet to be sent to the client.52 ## @brief Build a packet to be sent to the client. 42 53 # @param self: The obkect pointer 43 54 # @param aOpCode: Operation code … … 51 62 return packet 52 63 53 ## Packet parser class. 64 ## @brief Packet parser class. 65 # 54 66 class PacketParser(Packet): 55 ## Parse incoming buffer.67 ## @brief Parse incoming buffer. 56 68 # @param self: The object pointer. 57 69 # @param aBuffer: buffer coming from the server -
mymrc/trunk/mymrc/src/settings/__init__.py
r8 r49 1 ## @package settings 2 # @brief settings Package 3 4 ## @file settings/__init__.py 5 # @brief Package module and/or package loader. 6 7 ## @package settings.__init__ 8 # @brief Package module and/or package loader -
mymrc/trunk/mymrc/src/settings/lang.py
r14 r49 1 ## @file settings/lang.py 2 # @brief Contains the Lang class 3 4 ## @package settings.lang 5 # @brief Contains the Lang class 6 1 7 from ConfigParser import ConfigParser 2 8 from errors.config import FileMissingError … … 5 11 import sys 6 12 7 ## Settingsclass.8 # Used to retrieve settings from the configuration file.13 ## @brief Lang singleton class. 14 # 9 15 class Lang( object ): 10 16 ## Stores the unique Singleton instance- 11 17 _iInstance = None 12 18 13 ## Players class 19 ## @brief Nested class for the singleton 20 # 14 21 class LangClass( ConfigParser ): 15 # The constructor. 22 23 ## @brief The constructor. 16 24 # @param self: The object pointer 25 # @param aCwd Directory where the language file is located 17 26 def __init__( self, aCwd ): 18 27 ConfigParser.__init__( self ) … … 27 36 return self.get(Settings().get('settings', 'language'), aLabel) 28 37 29 ## The constructor38 ## @brief The constructor 30 39 # @param self The object pointer. 40 # @param aCwd Directory where the language file is located 31 41 def __init__( self, aCwd=None ): 32 42 # Check whether we already have an instance … … 39 49 40 50 41 ## Delegate access to implementation.51 ## @brief Delegate access to implementation. 42 52 # @param self The object pointer. 43 # @param a ttr Attribute wanted.53 # @param aAttr Attribute wanted. 44 54 # @return Attribute 45 55 def __getattr__(self, aAttr): … … 47 57 48 58 49 ## Delegate access to implementation.59 ## @brief Delegate access to implementation. 50 60 # @param self The object pointer. 51 # @param a ttr Attribute wanted.52 # @param value Vaule to be set.61 # @param aAttr Attribute wanted. 62 # @param aValue Vaule to be set. 53 63 # @return Result of operation. 54 64 def __setattr__(self, aAttr, aValue): -
mymrc/trunk/mymrc/src/settings/players.py
r8 r49 1 ## @file settings/players.py 2 # @brief Contains the Players class 3 4 ## @package settings.players 5 # @brief Contains the Players class 6 1 7 from ConfigParser import ConfigParser 2 8 from errors.config import FileMissingError … … 4 10 import sys 5 11 6 ## Settings class.7 # Used to retrieve settings from the configuration file.12 ## @brief Players singleton class 13 # 8 14 class Players( object ): 9 15 ## Stores the unique Singleton instance- 10 16 _iInstance = None 11 17 12 ## Players class 18 ## @brief Nested class for the Players singleton 19 # 13 20 class PlayersClass( ConfigParser ): 14 # The constructor. 21 22 ## @brief The constructor. 15 23 # @param self: The object pointer 24 # @param aCwd Directory where the player configuration file is located 16 25 def __init__( self, aCwd ): 17 26 ConfigParser.__init__( self ) … … 22 31 sys.exit(1) 23 32 24 ## The constructor33 ## @brief The constructor 25 34 # @param self The object pointer. 35 # @param aCwd Directory where the player configuration file is located 26 36 def __init__( self, aCwd=None ): 27 37 # Check whether we already have an instance … … 34 44 35 45 36 ## Delegate access to implementation.46 ## @brief Delegate access to implementation. 37 47 # @param self The object pointer. 38 # @param a ttr Attribute wanted.48 # @param aAttr Attribute wanted. 39 49 # @return Attribute 40 50 def __getattr__(self, aAttr): … … 42 52 43 53 44 ## Delegate access to implementation.54 ## @brief Delegate access to implementation. 45 55 # @param self The object pointer. 46 # @param a ttr Attribute wanted.47 # @param value Vaule to be set.56 # @param aAttr Attribute wanted. 57 # @param aValue Vaule to be set. 48 58 # @return Result of operation. 49 59 def __setattr__(self, aAttr, aValue): -
mymrc/trunk/mymrc/src/settings/settings.py
r8 r49 1 ## @file settings/settings.py 2 # @brief Contains the Settings Singleton class 3 4 ## @package settings.settings 5 # @brief Contains the Settings Singleton class 6 1 7 from ConfigParser import ConfigParser 2 8 from errors.config import FileMissingError, DatabaseSectionError … … 5 11 6 12 7 ## Settings class.13 ## @brief Settings class. 8 14 # Used to retrieve settings from the configuration file. 9 15 class Settings( object ): … … 11 17 _iInstance = None 12 18 19 20 ## @brief Nested class for the Settings singleton. 21 # 13 22 class SettingsClass( ConfigParser ): 14 23 # The constructor. 15 24 # @param self: The object pointer 25 # @param aCwd Directory where the settings configuration file is located 16 26 def __init__( self, aCwd ): 17 27 ConfigParser.__init__( self ) … … 30 40 ## The constructor 31 41 # @param self The object pointer. 42 # @param aCwd Directory where the settings configuration file is located 32 43 def __init__( self, aCwd=None ): 33 44 # Check whether we already have an instance … … 42 53 ## Delegate access to implementation. 43 54 # @param self The object pointer. 44 # @param a ttr Attribute wanted.55 # @param aAttr Attribute wanted. 45 56 # @return Attribute 46 57 def __getattr__(self, aAttr): … … 50 61 ## Delegate access to implementation. 51 62 # @param self The object pointer. 52 # @param a ttr Attribute wanted.53 # @param value Vaule to be set.63 # @param aAttr Attribute wanted. 64 # @param aValue Vaule to be set. 54 65 # @return Result of operation. 55 66 def __setattr__(self, aAttr, aValue): -
mymrc/trunk/mymrc/src/utils/__init__.py
r8 r49 1 ## @package utils 2 # @brief utils Package 3 4 ## @file utils/__init__.py 5 # @brief Package module and/or package loader. 6 7 ## @package utils.__init__ 8 # @brief Package module and/or package loader -
mymrc/trunk/mymrc/src/utils/applock.py
r8 r49 1 ## @file utils/applock.py 2 # @brief Contains the App Lock class 3 4 ## @package utils.applock 5 # @brief Contains the App Lock class 6 1 7 import threading 2 8 ## Application lock.
