for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
"""
SDoc
Copyright 2016 Set Based IT Consultancy
Licence MIT
# ----------------------------------------------------------------------------------------------------------------------
import re
class SDoc:
Utility class with functions for generating SDoc code.
# ------------------------------------------------------------------------------------------------------------------
@staticmethod
def escape(text):
Returns an escaped string that is svae to use in SDoc.
:param text: The escaped string.
:rtype: str
def replace(matchobj):
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
class SomeClass: def some_method(self): """Do x and return foo."""
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.
return '\\' + matchobj.group(0)
return re.sub(r'[\\{}]', replace, text)
def unescape(text):
Returns an unescaped SDoc escaped string. I.e. removes back slashes.
:param text: The SDoc escaped string.
return matchobj.group(0)[1:]
return re.sub(r'\\.', replace, text)
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.