2.1. Librería de utilidades

2.1.1. lib Package

2.1.2. functions Module

BytesString(bytes)

Covertir un numero en bytes a Kb, Mb ...

class Dictionary

Bases: dict

class DictionaryDefault(default=None)

Bases: dict

Walk(path)
binary(i)
filestamp(timer=None)
getcallargs(func, *args, **kwds)

Get the actual value bounded to each formal parameter when calling func(*args,**kwds).

It works for methods too (bounded, unbounded, staticmethods, classmethods).

@returns: (bindings, missing_args), where:
  • bindings is a mapping of every formal parameter (including *varargs

    and **kwargs if present) of the function to the respective bounded value.

  • missing_args is a tuple of the formal parameters whose value was not

    provided (i.e. using the respective default value)

Examples::
>>> def func(a, b='foo', c=None, *x, **y):
...     pass
>>> getcallargs(func, 5)
({'a': 5, 'y': {}, 'c': None, 'b': 'foo', 'x': ()}, ('b', 'c'))
>>> getcallargs(func, 5, 'foo')
({'a': 5, 'y': {}, 'c': None, 'b': 'foo', 'x': ()}, ('c',))
>>> getcallargs(func, 5, c=['a', 'b'])
({'a': 5, 'y': {}, 'c': ['a', 'b'], 'b': 'foo', 'x': ()}, ('b',))
>>> getcallargs(func, 5, 6, 7, 8)
({'a': 5, 'y': {}, 'c': 7, 'b': 6, 'x': (8,)}, ())
>>> getcallargs(func, 5, z=3, b=2)
({'a': 5, 'y': {'z': 3}, 'c': None, 'b': 2, 'x': ()}, ('c',))
internet_on()
itersubclasses(cls)

Generator over all subclasses of a given class, in depth first order.

>>> list(itersubclasses(int)) == [bool]
True
>>> class A(object): pass
>>> class B(A): pass
>>> class C(A): pass
>>> class D(B,C): pass
>>> class E(D): pass
>>> 
>>> for cls in itersubclasses(A):
...     print(cls.__name__)
B
D
E
C
>>> # get ALL (new-style) classes currently defined
>>> [cls.__name__ for cls in itersubclasses(object)] 
['type', ...'tuple', ...]
strtime(tt)
timestamp(timer=None)
xml_code(node, cmd=False)
zip_extract(path, dest)

2.1.3. mail Module

class SendMail(win, recipients, sender='sts@videotiro.com')

Bases: threading.Thread

start()

2.1.4. mic Module

class MicData(channels)

Bases: object

state(machine, state)
class MicPlot(win=None, key=None, *args, **kwargs)

Bases: nabla.wx.window.Window

Data(micdata)
OnInit()
size = (400, 500)
class MicPlotFrame(parent, micdata)

Bases: wx._windows.Frame

class MicPlotPanel(parent, *args, **kwargs)

Bases: wx._windows.Panel

Data(micdata, xrange=None)
class Microphone(bars, save=False)

Bases: threading.Thread

channels = 2
chunk = 128
exit()
nivel = 0
rate = 11025
run()
stop()
tiro = False
umbral = -500
update_value()
class TestSerial(parent, log)

Bases: wx._windows.Frame

OnCloseWindow(event)
OnTimer(evt)
onbuttonout(event)

2.1.5. sqlite Module

class DataBase(file=None)

Bases: object

Open a SQLite3 file Types: TEXT, INTEGER, FLOAT, BLOB, NULL

fields(table)
info()
query(command)
result(sql)
scheme()
size()

Cuantos Kb ocupa la base de datos

tables()
types(table)
class Record(database, table, key='')

Bases: object

delete()
insert(values=None, auto=False)
select()
update(values=None)
sql_get_table(sql)

2.1.6. threads Module

class QueueThread(queue_in, queue_out)

Bases: threading.Thread

A worker thread that takes directory names from a queue, finds all files in them recursively and reports the result.

Input is done by placing directory names (as strings) into the Queue passed in dir_q.

Output is done by placing tuples into the Queue passed in result_q. Each tuple is (thread name, dirname, [list of files]).

Ask the thread to stop by calling its join() method.

join(timeout=None)
run()
SuperThread(args)
class Watcher(function)

Bases: threading.Thread

loop()
run()
stop()

2.1.7. win32 Module

extension_to_bitmap(extension)

dot is mandatory in extension