Cope 2.5.0
My personal "standard library" of all the generally useful code I've written for various projects over the years
Loading...
Searching...
No Matches
Functions
Cope.experimental.misc Namespace Reference

Functions

def replace_line (line, offset=0, keepTabs=True, convertTabs=True, calls=0)
 
def comment (comment='', line_limit=80, char='=', start='', end='#', capitalize=False)
 
def runCmd (args)
 
def center (string)
 
str insert_newlines (str string, int max_line_length)
 
def assertValue (param, *values, blocking=True)
 

Function Documentation

◆ assertValue()

def Cope.experimental.misc.assertValue (   param,
values,
  blocking = True 
)

◆ center()

def Cope.experimental.misc.center (   string)
 Centers a string for printing in the terminal 

◆ comment()

def Cope.experimental.misc.comment (   comment = '',
  line_limit = 80,
  char = '=',
  start = '',
  end = '#',
  capitalize = False 
)
 Replaces the call with a nicely formatted comment line next time the line is run
    NOTE: This is a terrible, terrible function that you should NOT use.
            I'm pretty confident it won't overwrite your source code.
            And it's surprisingly useful.
            But still, use at your own risk.

◆ insert_newlines()

str Cope.experimental.misc.insert_newlines ( str  string,
int  max_line_length 
)
 Inserts newline characters into `string` in order to keep `string` under `max_line_length`
    characters long, while not inserting a newline in the middle of a word

◆ replace_line()

def Cope.experimental.misc.replace_line (   line,
  offset = 0,
  keepTabs = True,
  convertTabs = True,
  calls = 0 
)
 Replaces the line of code this is called from with the give line parameter.
    This is a very bad idea and you should not use it
    Automatically adds a newline to the end, but does not automatically add tabs.

◆ runCmd()

def Cope.experimental.misc.runCmd (   args)
 Run a command and terminate if it fails.