| Trees | Indices | Help |
|
|---|
|
|
Miscellaneaous utilities that don't need their own module because they are reasonnably small.
| Functions | |||
| string |
|
||
| list of strings |
|
||
| string |
|
||
|
|||
|
|||
|
|||
list of int
|
|
||
str
|
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
| Variables | |
FUNCTIONAL_TESTS_STR = 'RUN_FUNCTIONAL_TESTS'
|
|
LINESEP = '\n'
|
|
Imports: platform, os, re, subprocess, SkipTest, pkg_resources
| Function Details |
Expand the given environment variable content. If it contains other references to environment variables, they are expanded too. Supported platforms are win32 and linux. Example of use:
>>> env_var_expand('$HOME')
>>> '/home/phil'
|
Explode a list of values stored in an environment variable as a single string. On win32 the item separator is ';' and on other platforms it is ':'. Example of use:
>>> env_var_explode_list('$PATH')
>>> ['/usr/bin','/bin']
|
Convert CamelCase styled strings to lower_cased style.
|
Get the Linux process id of the given program name. Because multiple processes can exist, we return a list of the pids.
|
Detect the Desktop environment used by the user. On windows this returns empty string. On other OSes we can currently detect gnome, kde and xfce.
|
Check whether functional tests should be run or not. This is done by
checking whether the FUNCTIONAL_TESTS_STR environment variable is set to
'True'. If it is not explictly set to True, this method raises a This method allows functional tests to have an easy way to check if they should be run. This simple example checks in the setup (but it could also be done inside the method itself):
from elisa.core.utils.misc import run_functional_tests_check
[...]
class MyFunctionalTestCase(TestCase):
def setUp(self):
run_functional_tests_check()
...
|
Unserialise mappings from a string text. Mappings are lists of 2-uplets. Example: key1 = value1 key2 = value2a key2 = value2b is deserialised into:
[("key1", "value1"), ("key2", "value2a"), ("key2", "value2b")]
|
Takes a Example:
[("key1", "value1"), ("key2", "value2a"), ("key2", "value2b")]
is serialised into: key1 = value1 key2 = value2a key2 = value2b |
| Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Tue Dec 1 10:54:20 2009 | http://epydoc.sourceforge.net |