Various classes and functions that are used by GUI and command line
versions of BitPim
string
|
datatohexstring(data)
Returns a pretty printed hexdump of the data |
source code
|
|
|
hexify(data)
Turns binary data into a hex string (like the output of MD5/SHA
hexdigest) |
source code
|
|
string
|
|
|
unicode_execfile(filename,
dict1=0,
dict2=0) |
source code
|
|
|
readversionedindexfile(filename,
dict,
versionhandlerfunc,
currentversion) |
source code
|
|
|
writeversionindexfile(filename,
dict,
currentversion) |
source code
|
|
|
|
|
|
|
gettempfilename(extension=None)
Returns a filename to be used for a temporary file |
source code
|
|
|
|
|
|
|
getkv(dict,
key,
updates=None)
Gets a key and value from a dict, returning as a dict potentially
applying updates |
source code
|
|
|
|
|
|
|
opentextfile(name)
This function detects unicode byte order markers and if present uses
the codecs module instead to open the file instead with appropriate
unicode decoding, else returns the file using standard open function |
source code
|
|
|
|
|
|
|
|
|
crc(data,
initial=65535)
CRC calculation - returns 16 bit integer |
source code
|
|
|
crcs(data,
initial=65535)
CRC calculation - returns 2 byte string LSB |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
decodecharacterbits(bytes,
bitsperchar,
charconv=<built-in function chr>,
terminator=None)
Decodes the characters out of a string of bytes where each character
takes a fixed number of bits (eg 7) |
source code
|
|
|
encode_with_degrade(uni_string,
codec=' ascii ' ,
error_handling=' strict ' ) |
source code
|
|
|
get_ascii_string(uni_string,
error_handling=' strict ' )
converts any type into an ascii byte string, for unicode string it
will degrade if possible |
source code
|
|
|
statinfo(filename)
Returns a simplified version of os.stat results that can be used to
tell if a file has changed. |
source code
|
|
|
|
|
main_is_frozen()
Return T if running from an exe, F otherwise |
source code
|
|
|
get_main_dir()
Return the absoluate path of the main BitPim dir |
source code
|
|
|
get_version_number(filename)
Return the version of a Windows DLL or EXE file |
source code
|
|
|
_magic = [ 73, 97, 109, 65, 104, 97, 80, 112, 49, 50, 38, 115, 93]
|
|
_boms = [ ( ' \xff\xfe ' , ' utf_16 ' ) , ( ' \xfe\xff ' , ' utf_16_be ' ) , ( ' ...
|
|
_maxbomlen = 22
|
|
pppterminator = ' ~ '
|
|
_crctable = ( 0, 4489, 8978, 12955, 17956, 22445, 25910, 29887, ...
|
|
nibbles = ( ' 0000 ' , ' 0001 ' , ' 0010 ' , ' 0011 ' , ' 0100 ' , ' 0101 ' , ' 01 ...
|
|
bom = ' B\x00E\x00G\x00I\x00N\x00:\x00V\x00C\x00A\x00R\x00D\x00 '
|
|
codec = ' utf_16_le '
|
|
x = ' ] '
|