Ejemplo n.º 1
0
    def set_comment(self, text):
        if text is None:
            return
        text = text.strip()

        if text:
            self.data.comment = validator.clean_text(text)
Ejemplo n.º 2
0
    def change_text(self, text):
        """Change the comment of our wrapped object

        In:
            - ``text`` -- the new comment
        Return:
            - the new comment

        """
        if text is None:
            return
        text = text.strip()
        if text:
            text = validator.clean_text(text)
            self.text = text
            self.parent.set_comment(text)
            return text
Ejemplo n.º 3
0
    def add(self, v):
        """Add a new comment to the card

        In:
            - ``v`` -- the comment content
        """
        security.check_permissions('comment', self.card)
        if v is None:
            return
        v = v.strip()
        if v:
            v = validator.clean_text(v)
            user = security.get_user()
            comment = DataComment(comment=v, card_id=self.card.db_id,
                                  author=user.data, creation_date=datetime.datetime.utcnow())
            session.add(comment)
            session.flush()
            data = {'comment': v.strip(), 'card': self.card.get_title()}
            self.action_log.add_history(security.get_user(), u'card_add_comment', data)
            self.comments.insert(0, self._create_comment_component(comment))
Ejemplo n.º 4
0
    def set_title(self, comp, title):
        text = title() and title().strip()
        if text:
            text = validator.clean_text(text)

        comp.answer(text)
Ejemplo n.º 5
0
 def commit(self, comp):
     description = self.description().strip()
     if description:
         description = validator.clean_text(description)
     comp.answer(description)
Ejemplo n.º 6
0
Archivo: comp.py Proyecto: bcroq/kansha
def write_extension_data_CardDescription(self, sheet, row, col, style):
    text = validator.clean_text(self.text) if self.text else ''
    sheet.write(row, col, text, style)
Ejemplo n.º 7
0
Archivo: comp.py Proyecto: bcroq/kansha
 def update_document(self, document):
     desc = self.text
     document.description = clean_text(desc) if desc else u''
Ejemplo n.º 8
0
 def commit(self, comp):
     description = self.description().strip()
     if description:
         description = validator.clean_text(description)
     comp.answer(description)
Ejemplo n.º 9
0
def write_extension_data_CardDescription(self, sheet, row, col, style):
    text = validator.clean_text(self.text) if self.text else ''
    sheet.write(row, col, text, style)
Ejemplo n.º 10
0
 def update_document(self, document):
     desc = self.text
     document.description = clean_text(desc) if desc else u''