Example #1
0
 def add_code_example(self, filepath):
     description_lines = checker.get_description(file)
     with open(filepath, 'rb') as lines:
         code = [
             line.rstrip("\n") for line in lines
             if line.rstrip('\n') not in description_lines
             and not re.match("#\s[d|D]escription", line)
         ]
         self.code = "```python\n%s\n```" % "\n".join(code)
Example #2
0
 def add_code_example(self, filepath):
     description_lines = checker.get_description(file)
     with open(filepath, 'rb') as lines:
         code = [line.rstrip("\n") for line in lines if line.rstrip('\n') not in description_lines and not re.match("#\s[d|D]escription", line)]
         self.code = "```python\n%s\n```" % "\n".join(code)
Example #3
0
 def add_description(self, filepath):
     self.description = "\n".join([line.lstrip('# ') for line in checker.get_description(file)])
Example #4
0
 def add_description(self, filepath):
     self.description = "\n".join(
         [line.lstrip('# ') for line in checker.get_description(file)])