Module ts3client :: Class IconPack
[hide private]
[frames] | no frames]

Class IconPack

source code

object --+
         |
        IconPack

Offers an interface to the TeamSpeak 3 Client's iconpack. IconPack is also a context manager.

Instance Methods [hide private]
 
__init__(self, info=None, name=None)
Instantiates a new IconPack object referenced by its name or the internal info string (an Exception is raised if the iconpack could not be located).
source code
 
_loadEmoticonSettings(self, f) source code
 
open(self)
Reads the settings for the iconpack and if it's zip-based, opens the file for reading.
source code
 
close(self)
If the iconpack is zip-based, the file is closed.
source code
 
__enter__(self) source code
 
__exit__(self, type, value, traceback) source code
QPixmap
fallback(self, var)
Returns the fallback icon for a variable according to the iconpack's settings.
source code
list[str]
icons(self)
Returns the list of variables used in the iconpack (excluding fallback mechanisms).
source code
 
_findDefaultFilename(self, var) source code
QPixmap
icon(self, var)
Returns the icon representing a variable used in the iconpack.
source code
list[str]
emoticons(self)
Returns the list of emoticon replacements used in the iconpack.
source code
QPixmap
emoticon(self, text)
Returns the icon replacing the emoticon string.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]
IconPack
current()
Returns the current iconpack used (an Exception is raised if something failed).
source code
str
defaultName(var)
Returns the variable name used in the default iconpack.
source code
Class Variables [hide private]
  _prefixes = ["200x200_", "100x100_", "32x32_", "24x24_", "20x2...
  _varNames = ['3D_SOUND', '3D_SOUND_ME', 'ABOUT', 'ACTIVATE_MIC...
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

current()
Static Method

source code 

Returns the current iconpack used (an Exception is raised if something failed).

Returns: IconPack
the iconpack

__init__(self, info=None, name=None)
(Constructor)

source code 

Instantiates a new IconPack object referenced by its name or the internal info string (an Exception is raised if the iconpack could not be located).

Parameters:
  • info (str) - the info string used in the settings.db
  • name (str) - the name of the iconpack
Overrides: object.__init__

open(self)

source code 

Reads the settings for the iconpack and if it's zip-based, opens the file for reading. Must be called once before any icon can be accessed.

close(self)

source code 

If the iconpack is zip-based, the file is closed. After this is called, no icons can be accessed (till open is called again).

defaultName(var)
Static Method

source code 

Returns the variable name used in the default iconpack.

Parameters:
  • var (str) - the variable used in an iconpack
Returns: str
the variable name

fallback(self, var)

source code 

Returns the fallback icon for a variable according to the iconpack's settings.

Parameters:
  • var (str) - the variable name
Returns: QPixmap
the resulting pixmap

icons(self)

source code 

Returns the list of variables used in the iconpack (excluding fallback mechanisms).

Returns: list[str]
a list of variable names

icon(self, var)

source code 

Returns the icon representing a variable used in the iconpack. If the icon cannot be found, the iconpack's fallback mechanisms are used. If everything fails, an empty pixmap is returned.

Parameters:
  • var (str) - the variable name
Returns: QPixmap
the resulting pixmap

emoticons(self)

source code 

Returns the list of emoticon replacements used in the iconpack.

Returns: list[str]
a list of emoticon strings

emoticon(self, text)

source code 

Returns the icon replacing the emoticon string.

Parameters:
  • text (str) - the emoticon as string
Returns: QPixmap
the resulting pixmap

Class Variable Details [hide private]

_prefixes

Value:
["200x200_", "100x100_", "32x32_", "24x24_", "20x20_", "16x16_", "8x7_\
", "7x5_", ""]

_varNames

Value:
['3D_SOUND', '3D_SOUND_ME', 'ABOUT', 'ACTIVATE_MICROPHONE', 'ADD', 'AD\
D_FOE', 'ADD_FRIEND', 'ADDON', 'ADDON_COLLECTION', 'ADDON_BROWSER', 'A\
DDON_ICONPACK', 'ADDON_SOUNDPACK', 'ADDON_THEME', 'ADDON_TRANSLATION',\
 'ARROW_LEFT', 'ARROW_RIGHT', 'AWAY', 'BAN_CLIENT', 'BAN_LIST', 'BOOKM\
ARK_ADD', 'BOOKMARK_ADD_FOLDER', 'BOOKMARK_DUPLICATE', 'BOOKMARK_MANAG\
ER', 'BOOKMARK_REMOVE', 'BROKEN_IMAGE', 'CAPTURE', 'CHANGE_NICKNAME', \
'CHANGELOG', 'CHANNEL_CHAT', 'CHANNEL_COLLAPSE_ALL', 'CHANNEL_COMMANDE\
R', 'CHANNEL_CREATE', 'CHANNEL_CREATE_SUB', 'CHANNEL_DELETE', 'CHANNEL\
...