Ejemplo n.º 1
0
 def update_comments(self, key=None, new_value=None):
     if key is not None:
         self.comment_options[key] = new_value
     text = Comment.gen_comment(self._ui.lineEdit_pretty_comment.text(), self.language,
                                self.comment_options)
     self._ui.textEdit.setText(text)
Ejemplo n.º 2
0
from comments import Comment
from language import Python, CPP

options = {
    'filling': '=',
    'filling2': '-',
    'right-char': True,
    'capitalize': True,
    'length': 30
}

lang = Python()
print(Comment.gen_comment('header', lang, options))

data = """dummy text
# ===================================== 
# ================= d ================= 
# ===================================== 
other dummy text"""
print()
print(Comment.parse_options(data))

data = """# ============= #
# --- DUMMY --- #
# ============= #"""
print()
print(Comment.parse_options(data))