Module util :: Class Util
[hide private]
[frames] | no frames]

Class Util

source code


General utility functions shared between client and server.

Instance Methods [hide private]

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

Static Methods [hide private]
 
flushedOutput(aStr)
Writes the string aStr to the standart output and flushes standart output
source code
str
tempFileName()
Returns a temporary file name.
source code
 
dumps(obj)
Given object obj, first pickles than compresses.
source code
 
loads(asciiStr)
Expands the given string then unpickles.
source code
 
uniq()
Returns a uniq string of hexadecimal characters.
source code
 
iglobRecursively(root='.', pattern='*')
Locate all files matching supplied filename pattern in and below supplied root directory.
source code
 
globRecursively(root='.', pattern='*')
Locate all files matching supplied filename pattern in and below supplied root directory.
source code
 
logToFile(msg, fileName='/home/dia/log.txt') source code
 
deferredSleep(seconds, deferer=None)
Non-blocking sleep
source code
 
escapeString(aStr)
Escapes the given string.
source code
 
isPrintable(aChr)
Returns True if the given character is printable, False otherwise Escapes the given string.
source code
Class Variables [hide private]
  FUNC_TESTER_TYPE_LOG = 'log'
  FUNC_TESTER_TYPE_STDOUT = 'stdout'
  FUNC_TESTER_TYPE_STDERR = 'stderr'
  FUNC_TESTER_LOG_PREFIX = '-=|'
  FUNC_TESTER_ASSERT_ERROR = '[FUNC.TEST] ASSERT ERROR:'
  FUNC_TESTER_OTHER_ERROR = '[FUNC.TEST] OTHER ERROR:'
  FUNC_TESTER_ASSERT_SUCCESS = '[FUNC.TEST] ASSERT SUCCESS:'
  FUNC_TESTER_RESULT_FAILED = '[FUNC.TEST] FAILED:'
  FUNC_TESTER_RESULT_PASSED = '[FUNC.TEST] PASSED:'
  FUNC_TESTER_NORMAL_LOG = '[FUNC.TEST] LOG:'
  WIN_DELETE_CHR = u''
  WIN_BACKSPACE_SCANCODE = 14
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

tempFileName()
Static Method

source code 

Returns a temporary file name. Does not create the file, just returns a unique file name in the system temporary directory.

Returns: str
A unique temporary file name

dumps(obj)
Static Method

source code 

Given object obj, first pickles than compresses.

Parameters:
  • obj - Any object that can be pickled.

loads(asciiStr)
Static Method

source code 

Expands the given string then unpickles. Returns the object unpickled.

Parameters:
  • asciiStr - String that was created by a call to dumps

iglobRecursively(root='.', pattern='*')
Static Method

source code 

Locate all files matching supplied filename pattern in and below supplied root directory. Returns a generator.

globRecursively(root='.', pattern='*')
Static Method

source code 

Locate all files matching supplied filename pattern in and below supplied root directory. Returns result as a list.

escapeString(aStr)
Static Method

source code 

Escapes the given string. Suitable for producing script files.

isPrintable(aChr)
Static Method

source code 

Returns True if the given character is printable, False otherwise Escapes the given string. Suitable for producing script files.