Exemple #1
0
    def getAsPlaintext(self, db_con):
        user = db_con.getUserNameById(self.user_id, full=True)
        if not user:
            return None

        return " -- %s, %s has removed \"%s\" from the metadictionary." % (
            pretty.printPrettyDate(self.T_notify), user, self.term_string)
Exemple #2
0
  def getAsPlaintext(self, db_con): 
    user = db_con.getUserNameById(self.user_id, full=True)
    if not user: 
      return None

    return " -- %s, %s has removed \"%s\" from the metadictionary." % (
              pretty.printPrettyDate(self.T_notify), user, self.term_string)
Exemple #3
0
  def getAsHTML(self, db_con): 
    term = db_con.getTerm(self.term_id)
    user = db_con.getUserNameById(self.user_id, full=True)
    if not term or not user:
      return None

    return '''<font color="#4D6C82">%s</font> commented on <a href="/term=%s">%s</a>. 
              <font color="#B8B8B8"><i>%s</i></font>''' % (
            user, term['concept_id'], term['term_string'], pretty.printPrettyDate(self.T_notify))
Exemple #4
0
  def getAsHTML(self, db_con): 
    user = db_con.getUserNameById(self.user_id, full=True)
    if not user: 
      return None

    return '''<font color="#4D6C82">%s</font> has removed 
              <font color="#0088CC"><strong>%s</strong></font> from the metadictionary. 
              <font color="#B8B8B8"><i>%s</i></font>''' % (
            user, self.term_string, pretty.printPrettyDate(self.T_notify))
Exemple #5
0
    def getAsHTML(self, db_con):
        user = db_con.getUserNameById(self.user_id, full=True)
        if not user:
            return None

        return '''<font color="#4D6C82">%s</font> has removed 
              <font color="#0088CC"><strong>%s</strong></font> from the metadictionary. 
              <font color="#B8B8B8"><i>%s</i></font>''' % (
            user, self.term_string, pretty.printPrettyDate(self.T_notify))
Exemple #6
0
 def getAsPlaintext(self, db_con): 
   term = db_con.getTerm(self.term_id)
   user = db_con.getUserNameById(self.user_id, full=True)
   if not term or not user:
     return None
   
   text = ' -- %s, %s modified "%s".\n' % (
             pretty.printPrettyDate(self.T_notify), user, term['term_string'])
   text += '\n' + pretty.getPrettyTerm(db_con, term) + '\n'
   return text
Exemple #7
0
    def getAsPlaintext(self, db_con):
        term = db_con.getTerm(self.term_id)
        user = db_con.getUserNameById(self.user_id, full=True)
        if not term or not user:
            return None

        text = ' -- %s, %s modified "%s".\n' % (pretty.printPrettyDate(
            self.T_notify), user, term['term_string'])
        text += '\n' + pretty.getPrettyTerm(db_con, term) + '\n'
        return text
Exemple #8
0
    def getAsHTML(self, db_con):
        term = db_con.getTerm(self.term_id)
        user = db_con.getUserNameById(self.user_id, full=True)
        if not term or not user:
            return None

        return '''<font color="#4D6C82">%s</font> modified <a href="/term=%s">%s</a>. 
              <font color="#B8B8B8"><i>%s</i></font>''' % (
            user, term['concept_id'], term['term_string'],
            pretty.printPrettyDate(self.T_notify))
Exemple #9
0
  def getAsPlaintext(self, db_con): 
    term = db_con.getTerm(self.term_id)
    user = db_con.getUserNameById(self.user_id, full=True)
    if not term or not user:
      return None

    text = " -- %s, %s commented on \"%s\".\n\n" % (
             pretty.printPrettyDate(self.T_notify), user, term['term_string'])
    text += '     TERM URI: %s\n' % term['persistent_id']
    text += pretty.getPrettyParagraph(db_con, "COMMENT: " + self.comment_string, 6)
    return text
Exemple #10
0
    def getAsPlaintext(self, db_con):
        term = db_con.getTerm(self.term_id)
        user = db_con.getUserNameById(self.user_id, full=True)
        if not term or not user:
            return None

        text = " -- %s, %s commented on \"%s\".\n\n" % (pretty.printPrettyDate(
            self.T_notify), user, term['term_string'])
        text += '     TERM URI: %s\n' % term['persistent_id']
        text += pretty.getPrettyParagraph(db_con,
                                          "COMMENT: " + self.comment_string, 6)
        return text
Exemple #11
0
  def getAsPlaintext(self, db_con): 
    """ Return a notification string. To avoid dereferencing
        something that has been deleted (term, comment, user, etc.), return 
        None if the database has no results. 

        :param db_con: Connection to database. 
        :type db_con: seaice.SeaIceConnector.SeaIceConnector
        :rtype: str or None
    """
    term = db_con.getTerm(self.term_id)
    if not term: 
      return None

    return ' -- %s, term "%s".' % (
               pretty.printPrettyDate(self.T_notify), term['term_string'])
Exemple #12
0
  def getAsHTML(self, db_con): 
    """ Return an HTML-formatted notification string. To avoid dereferencing
        something that has been deleted (term, comment, user, etc.), return 
        None if the database has no results. 

        :param db_con: Connection to database. 
        :type db_con: seaice.SeaIceConnector.SeaIceConnector
        :rtype: str or None
    """
    term = db_con.getTerm(self.term_id)
    if not term: 
      return None

    return 'Term <a href="/term=%s">%s</a> <font color="#8B8B8B"><i>%s</i></font>' % (
                        term['concept_id'], term['term_string'], pretty.printPrettyDate(self.T_notify))
Exemple #13
0
    def getAsPlaintext(self, db_con):
        """ Return a notification string. To avoid dereferencing
        something that has been deleted (term, comment, user, etc.), return 
        None if the database has no results. 

        :param db_con: Connection to database. 
        :type db_con: seaice.SeaIceConnector.SeaIceConnector
        :rtype: str or None
    """
        term = db_con.getTerm(self.term_id)
        if not term:
            return None

        return ' -- %s, term "%s".' % (pretty.printPrettyDate(
            self.T_notify), term['term_string'])
Exemple #14
0
    def getAsHTML(self, db_con):
        """ Return an HTML-formatted notification string. To avoid dereferencing
        something that has been deleted (term, comment, user, etc.), return 
        None if the database has no results. 

        :param db_con: Connection to database. 
        :type db_con: seaice.SeaIceConnector.SeaIceConnector
        :rtype: str or None
    """
        term = db_con.getTerm(self.term_id)
        if not term:
            return None

        return 'Term <a href="/term=%s">%s</a> <font color="#8B8B8B"><i>%s</i></font>' % (
            term['concept_id'], term['term_string'],
            pretty.printPrettyDate(self.T_notify))