Cope 2.5.0
My personal "standard library" of all the generally useful code I've written for various projects over the years
|
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) |
def Cope.experimental.misc.assertValue | ( | param, | |
* | values, | ||
blocking = True |
|||
) |
def Cope.experimental.misc.center | ( | string | ) |
Centers a string for printing in the terminal
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.
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
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.
def Cope.experimental.misc.runCmd | ( | args | ) |
Run a command and terminate if it fails.