PaferaPy Async 0.1
ASGI framework focused on simplicity and efficiency
Loading...
Searching...
No Matches
Functions | Variables
pafera.types Namespace Reference

Functions

def ArrayV (d, k, default=[])
 Utility function to get an array from a dict or object given its name. More...
 
def DictV (d, k, default={})
 Utility function to get a dict from a dict or object given its name. More...
 
def FloatV (d, k, min=None, max=None, default=0.0)
 Utility function to get a float from a dict or object given its name. More...
 
def IntV (d, k, min=None, max=None, default=0)
 Utility function to get an int from a dict or object given its name. More...
 
def Print (v, *args)
 Print a unicode string with arguments. More...
 
def PrintB (v, *args)
 Print a byte string with arguments. More...
 
def PrintBL (v, localdict=None)
 Print a byte string formatted with local variables. More...
 
def Printf (v, *args)
 Returns a formatted unicode string. More...
 
def PrintL (v, localdict=None)
 Print a string formatted with local variables. More...
 
def PrintLf (s, localdict=None)
 Returns a string formatted with local variables. More...
 
def RunCommand (cmdlist)
 Runs a command and returns unicode output. More...
 
def RunDaemon (cmdlist)
 Runs a command in the background. More...
 
def S (v)
 Converts the value into a byte string. More...
 
def StrV (d, k, default='')
 Utility function to get a string from a dict or object given its name. More...
 
def U (v)
 Converts the value into a unicode string. More...
 
def V (d, k, default=None)
 Utility function to get a value from a dict or object given its name. More...
 

Variables

int PY2 = 2
 
int PY3 = 3
 

Function Documentation

◆ ArrayV()

def pafera.types.ArrayV (   d,
  k,
  default = [] 
)

Utility function to get an array from a dict or object given its name.

Will return default if it can't be found.

The V functions are convenience functions designed to ensure that a value is the correct type before being used for any work.

Definition at line 241 of file types.py.

◆ DictV()

def pafera.types.DictV (   d,
  k,
  default = {} 
)

Utility function to get a dict from a dict or object given its name.

Will return default if it can't be found.

The V functions are convenience functions designed to ensure that a value is the correct type before being used for any work.

Definition at line 264 of file types.py.

◆ FloatV()

def pafera.types.FloatV (   d,
  k,
  min = None,
  max = None,
  default = 0.0 
)

Utility function to get a float from a dict or object given its name.

Will return default if it can't be found.

The V functions are convenience functions designed to ensure that a value is the correct type before being used for any work.

Definition at line 195 of file types.py.

◆ IntV()

def pafera.types.IntV (   d,
  k,
  min = None,
  max = None,
  default = 0 
)

Utility function to get an int from a dict or object given its name.

Will return default if it can't be found.

The V functions are convenience functions designed to ensure that a value is the correct type before being used for any work.

Definition at line 169 of file types.py.

◆ Print()

def pafera.types.Print (   v,
args 
)

Print a unicode string with arguments.

Prints the string with arguments.

Definition at line 32 of file types.py.

◆ PrintB()

def pafera.types.PrintB (   v,
args 
)

Print a byte string with arguments.

Definition at line 37 of file types.py.

◆ PrintBL()

def pafera.types.PrintBL (   v,
  localdict = None 
)

Print a byte string formatted with local variables.

Definition at line 63 of file types.py.

◆ Printf()

def pafera.types.Printf (   v,
args 
)

Returns a formatted unicode string.

Returns a string with converted arguments.

Definition at line 42 of file types.py.

◆ PrintL()

def pafera.types.PrintL (   v,
  localdict = None 
)

Print a string formatted with local variables.

Prints a string formatted with local variables.

Definition at line 54 of file types.py.

◆ PrintLf()

def pafera.types.PrintLf (   s,
  localdict = None 
)

Returns a string formatted with local variables.

Definition at line 72 of file types.py.

◆ RunCommand()

def pafera.types.RunCommand (   cmdlist)

Runs a command and returns unicode output.

Definition at line 138 of file types.py.

◆ RunDaemon()

def pafera.types.RunDaemon (   cmdlist)

Runs a command in the background.

Definition at line 144 of file types.py.

◆ S()

def pafera.types.S (   v)

Converts the value into a byte string.

Definition at line 16 of file types.py.

◆ StrV()

def pafera.types.StrV (   d,
  k,
  default = '' 
)

Utility function to get a string from a dict or object given its name.

Will return default if it can't be found.

The V functions are convenience functions designed to ensure that a value is the correct type before being used for any work.

Definition at line 221 of file types.py.

◆ U()

def pafera.types.U (   v)

Converts the value into a unicode string.

Definition at line 24 of file types.py.

◆ V()

def pafera.types.V (   d,
  k,
  default = None 
)

Utility function to get a value from a dict or object given its name.

Will return default if it can't be found.

The V functions are convenience functions designed to ensure that a value is the correct type before being used for any work.

Definition at line 151 of file types.py.

Variable Documentation

◆ PY2

int pafera.types.PY2 = 2

Definition at line 11 of file types.py.

◆ PY3

int pafera.types.PY3 = 3

Definition at line 12 of file types.py.