l.utils : module documentation

Part of libcloud View Source

No module docstring
Function read_in_chunks Return a generator which yields data in chunks.
Function guess_file_mime_type Undocumented
Function deprecated_warning Undocumented
Function in_development_warning Undocumented
Function str2dicts Create a list of dictionaries from a whitespace and newline delimited text.
Function str2list Create a list of values from a whitespace and newline delimited text (keys are ignored).
Function dict2str Create a string with a whitespace and newline delimited text from a dictionary.
Function fixxpath Undocumented
Function findtext Undocumented
Function findattr Undocumented
Function findall Undocumented
Function reverse_dict Undocumented
Function get_driver Get a driver.
Function merge_valid_keys Merge valid keys from extra into params dictionary and return dictionary with keys which have been merged.
Function get_new_obj No summary
def read_in_chunks(iterator, chunk_size=None, fill_size=False): (source)
Return a generator which yields data in chunks.
ParametersresponseAn object which implements an iterator interface or a File like object with read method.
chunk_sizeOptional chunk size (defaults to CHUNK_SIZE) (type: int)
fill_sizeIf True, make sure chunks are chunk_size in length (except for last chunk). (type: bool)
def guess_file_mime_type(file_path): (source)
Undocumented
def deprecated_warning(module): (source)
Undocumented
def in_development_warning(module): (source)
Undocumented
def str2dicts(data): (source)
Create a list of dictionaries from a whitespace and newline delimited text.

For example, this: cpu 1100 ram 640

cpu 2200 ram 1024

becomes: [{'cpu': '1100', 'ram': '640'}, {'cpu': '2200', 'ram': '1024'}]

def str2list(data): (source)
Create a list of values from a whitespace and newline delimited text (keys are ignored).

For example, this: ip 1.2.3.4 ip 1.2.3.5 ip 1.2.3.6

becomes: ['1.2.3.4', '1.2.3.5', '1.2.3.6']

def dict2str(data): (source)
Create a string with a whitespace and newline delimited text from a dictionary.

For example, this: {'cpu': '1100', 'ram': '640', 'smp': 'auto'}

becomes: cpu 1100 ram 640 smp auto

cpu 2200 ram 1024

def fixxpath(xpath, namespace=None): (source)
Undocumented
def findtext(element, xpath, namespace=None): (source)
Undocumented
def findattr(element, xpath, namespace=None): (source)
Undocumented
def findall(element, xpath, namespace=None): (source)
Undocumented
def reverse_dict(dictionary): (source)
Undocumented
def get_driver(drivers, provider): (source)
Get a driver.
ParametersdriversDictionary containing valid providers.
providerId of provider to get driver (type: libcloud.types.Provider)
def merge_valid_keys(params, valid_keys, extra): (source)
Merge valid keys from extra into params dictionary and return dictionary with keys which have been merged.

Note: params is modified in place.

def get_new_obj(obj, klass, attributes): (source)
Pass attributes from the existing object 'obj' and attributes dictionary to a 'klass' constructor. Attributes from 'attributes' dictionary are only passed to the constructor if they are not None.
API Documentation for libcloud, generated by pydoctor at 2012-07-15 18:45:43.