Skip to content

txbm/mrpython

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mr. Python

Build Status Coverage Status Downloads Downloads

A collection of functions, decorators and data that don't seem to fit into any of my (or anybody else's) libraries.

Functions

  • autolog(message, level=logging.DEBUG)
  • enum(**enums)
  • ip2long(ip)
  • long2ip(long)
  • to_dict(o, limit=None)
  • walker(node, limit=None)

Data

  • STATES (dict)
  • ORDERED_STATES (OrderedDict)

Interfaces

  • TInterface (only for use with walker)

Instructions for using walker

  1. Inherit your walkable nodes from mrpython.TInterface
  2. Set the ``` _dict_attrs attribute on all of your nodes to limit the extent to which they walk
  3. Pass one of the nodes to walker(node)
  4. Store the resulting dictionary.

If you want to override the _dict_attrs default limiting, call the to_dict method on your starting node and supply the limit parameter and then pass the resulting dictionary to the walker(node) function.

About

A collection of functions, decorators and mini-modules that don't seem to fit into any of my (or anybody's libraries).

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages