~bjornt/editmoin/factor-out-edit-function

« back to all changes in this revision

Viewing changes to editmoin

  • Committer: niemeyer
  • Date: 2005-09-06 16:27:51 UTC
  • Revision ID: niemeyer-bd5c3d164cb2b9b7348c79cdcd2c8a508315f5e0
Fixing support for comments.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
                    re.M|re.DOTALL)
38
38
DATESTAMPRE = re.compile('<input.*?name="datestamp".*?value="(.*?)".*?>')
39
39
NOTIFYRE = re.compile('<input.*?name="notify".*?value="(.*?)".*?>')
 
40
COMMENTRE = re.compile('<input.*?name="comment".*>')
40
41
MESSAGERE1 = re.compile('^</table>(.*?)<a.*?>Clear message</a>', re.M|re.DOTALL)
41
42
MESSAGERE2 = re.compile('<div class="message">(.*?)</div>', re.M|re.DOTALL)
42
43
MESSAGERE3 = re.compile('<div id="message">\s*<p>(.*?)</p>', re.M|re.DOTALL)
67
68
            self.comment = "None"
68
69
        except Error:
69
70
            self.notify = None
70
 
            self.comment = None
 
71
            if COMMENTRE.search(self.data):
 
72
                self.comment = "None"
 
73
            else:
 
74
                self.comment = None
71
75
        try:
72
76
            self.categories = self._get_data_findall(CATEGORYRE, "category")
73
77
        except Error:
112
116
            file.write("@@ WARNING! You're NOT logged in!\n")
113
117
        else:
114
118
            file.write("@@ Using ID %s.\n" % self.id)
 
119
        if self.comment is not None:
 
120
            file.write("@@ Comment: %s\n" % self.comment)
115
121
        if self.notify is not None:
116
 
            file.write("@@ Comment: %s\n" % self.comment)
117
122
            yes, no = (self.notify and ("x", " ") or (" ", "x"))
118
123
            file.write("@@ Notify: (%s) Yes  (%s) No\n" % (yes, no))
119
124
        if self.categories: