changeset 2479:7131fda5e82d

Merge main.
author Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
date Fri, 20 Jul 2007 22:56:13 +0200
parents 0242ded135e9 (current diff) ac7f57165c9a (diff)
children 8fb3dc91df77
files
diffstat 40 files changed, 104 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/_tests/test_Page.py	Fri Jul 20 22:05:38 2007 +0200
+++ b/MoinMoin/_tests/test_Page.py	Fri Jul 20 22:56:13 2007 +0200
@@ -61,3 +61,5 @@
         assert u'' not in pagelist
 
 
+coverage_modules = ['MoinMoin.Page']
+
--- a/MoinMoin/_tests/test_PageEditor.py	Fri Jul 20 22:05:38 2007 +0200
+++ b/MoinMoin/_tests/test_PageEditor.py	Fri Jul 20 22:56:13 2007 +0200
@@ -197,3 +197,7 @@
     print "PageEditor can't save a page if Abort is returned from PreSave event handlers"
     page = Page(request, pagename)
     assert page.body != testtext
+
+
+coverage_modules = ['MoinMoin.PageEditor']
+
--- a/MoinMoin/_tests/test_error.py	Fri Jul 20 22:05:38 2007 +0200
+++ b/MoinMoin/_tests/test_error.py	Fri Jul 20 22:56:13 2007 +0200
@@ -43,3 +43,5 @@
         err = error.Error(test)
         self.assertEqual('%(message)s' % err, test)
 
+coverage_modules = ['MoinMoin.error']
+
--- a/MoinMoin/_tests/test_packages.py	Fri Jul 20 22:05:38 2007 +0200
+++ b/MoinMoin/_tests/test_packages.py	Fri Jul 20 22:56:13 2007 +0200
@@ -78,3 +78,5 @@
         for line in ([':foo', 'is\\', 'ja|', u't|', u'baAz'], [], ['', '']):
             assert line == unpackLine(packLine(line))
 
+coverage_modules = ['MoinMoin.packages']
+
--- a/MoinMoin/_tests/test_sourcecode.py	Fri Jul 20 22:05:38 2007 +0200
+++ b/MoinMoin/_tests/test_sourcecode.py	Fri Jul 20 22:56:13 2007 +0200
@@ -30,7 +30,7 @@
 FIX_TS_RE = re.compile(r' +$', re.M) # 'fix' mode: everything matching the trailing space re will be removed
 
 RECENTLY = time.time() - 7 * 24*60*60 # we only check stuff touched recently.
-#RECENTLY = 0 # check everything!
+RECENTLY = 0 # check everything!
 # After doing a fresh clone, this procedure is recommended:
 # 1. Run the tests once to see if everything is OK (as cloning updates the mtime,
 #    it will test every file).
--- a/MoinMoin/_tests/test_user.py	Fri Jul 20 22:05:38 2007 +0200
+++ b/MoinMoin/_tests/test_user.py	Fri Jul 20 22:56:13 2007 +0200
@@ -263,3 +263,6 @@
             self.assertEqual(result, expected,
                              'Expected "%(expected)s" but got "%(result)s"' % locals())
 
+
+coverage_modules = ['MoinMoin.user']
+
--- a/MoinMoin/_tests/test_wikidicts.py	Fri Jul 20 22:05:38 2007 +0200
+++ b/MoinMoin/_tests/test_wikidicts.py	Fri Jul 20 22:56:13 2007 +0200
@@ -114,4 +114,5 @@
         assert 'RecentChanges' in members
         assert 'HelpContents' in members
 
+coverage_modules = ['MoinMoin.wikidicts']
 
--- a/MoinMoin/_tests/test_wikisync.py	Fri Jul 20 22:05:38 2007 +0200
+++ b/MoinMoin/_tests/test_wikisync.py	Fri Jul 20 22:56:13 2007 +0200
@@ -37,3 +37,5 @@
         tags = TagStore(self.page)
         tags.clear()
 
+coverage_modules = ['MoinMoin.wikisync']
+
--- a/MoinMoin/_tests/test_wikiutil.py	Fri Jul 20 22:05:38 2007 +0200
+++ b/MoinMoin/_tests/test_wikiutil.py	Fri Jul 20 22:56:13 2007 +0200
@@ -196,3 +196,5 @@
         self.assert_(result == expected,
                      'Expected "%(expected)s" but got "%(result)s"' % locals())
 
+coverage_modules = ['MoinMoin.wikiutil']
+
--- a/MoinMoin/action/rss_rc.py	Fri Jul 20 22:05:38 2007 +0200
+++ b/MoinMoin/action/rss_rc.py	Fri Jul 20 22:56:13 2007 +0200
@@ -200,7 +200,7 @@
                 for idx in range(rl):
                     rev = revisions[idx]
                     if rev <= item.rev:
-                        if idx+1 < rl:
+                        if idx + 1 < rl:
                             lines = wikiutil.pagediff(request, item.pagename, revisions[idx+1], item.pagename, 0, ignorews=1)
                             if len(lines) > 20:
                                 lines = lines[:20] + ['...\n']
--- a/MoinMoin/config/_tests/test_multiconfig.py	Fri Jul 20 22:05:38 2007 +0200
+++ b/MoinMoin/config/_tests/test_multiconfig.py	Fri Jul 20 22:56:13 2007 +0200
@@ -63,4 +63,5 @@
                     print "%r: %s" % (pw, pw_error)
                     assert result == (pw_error is None)
 
+coverage_modules = ['MoinMoin.config.multiconfig']
 
--- a/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py	Fri Jul 20 22:05:38 2007 +0200
+++ b/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py	Fri Jul 20 22:56:13 2007 +0200
@@ -1134,3 +1134,6 @@
 """
         self.do(test, output)
 
+
+coverage_modules = ['MoinMoin.converter.text_html_text_moin_wiki']
+
--- a/MoinMoin/filter/EXIF.py	Fri Jul 20 22:05:38 2007 +0200
+++ b/MoinMoin/filter/EXIF.py	Fri Jul 20 22:56:13 2007 +0200
@@ -738,8 +738,8 @@
     def reduce(self):
         div = gcd(self.num, self.den)
         if div > 1:
-            self.num = self.num/div
-            self.den = self.den/div
+            self.num = self.num / div
+            self.den = self.den / div
 
 # for ease of dealing with tags
 class IFD_Tag:
@@ -845,7 +845,7 @@
             typelen = FIELD_TYPES[field_type][0]
             count = self.s2n(entry+4, 4)
             offset = entry+8
-            if count*typelen > 4:
+            if count * typelen > 4:
                 # offset is not the value; it's a pointer to the value
                 # if relative we set things up so s2n will seek to the right
                 # place when it adds self.offset.  Note that this 'relative'
@@ -879,7 +879,7 @@
                     else:
                         value = self.s2n(offset, typelen, signed)
                     values.append(value)
-                    offset = offset+typelen
+                    offset = offset + typelen
             # now "values" is either a string or an array
             if count == 1 and field_type != 2:
                 printable = str(values[0])
@@ -924,24 +924,24 @@
 
         # fix up large value offset pointers into data area
         for i in range(entries):
-            entry = thumb_ifd+2+12*i
+            entry = thumb_ifd + 2 + 12 * i
             tag = self.s2n(entry, 2)
             field_type = self.s2n(entry+2, 2)
             typelen = FIELD_TYPES[field_type][0]
             count = self.s2n(entry+4, 4)
             oldoff = self.s2n(entry+8, 4)
             # start of the 4-byte pointer area in entry
-            ptr = i*12+18
+            ptr = i * 12 + 18
             # remember strip offsets location
             if tag == 0x0111:
                 strip_off = ptr
-                strip_len = count*typelen
+                strip_len = count * typelen
             # is it in the data area?
-            if count*typelen > 4:
+            if count * typelen > 4:
                 # update offset pointer (nasty "strings are immutable" crap)
                 # should be able to say "tiff[ptr:ptr+4]=newoff"
                 newoff = len(tiff)
-                tiff = tiff[:ptr]+self.n2s(newoff, 4)+tiff[ptr+4:]
+                tiff = tiff[:ptr] + self.n2s(newoff, 4) + tiff[ptr+4:]
                 # remember strip offsets location
                 if tag == 0x0111:
                     strip_off = newoff
--- a/MoinMoin/formatter/_tests/test_formatter.py	Fri Jul 20 22:05:38 2007 +0200
+++ b/MoinMoin/formatter/_tests/test_formatter.py	Fri Jul 20 22:56:13 2007 +0200
@@ -76,3 +76,15 @@
 
         return self.request.redirectedOutput(page.send_page, content_only=1)
 
+
+coverage_modules = ['MoinMoin.formatter',
+                    'MoinMoin.formatter.text_html',
+                    'MoinMoin.formatter.text_gedit',
+                    'MoinMoin.formatter.text_xml',
+                    #'MoinMoin.formatter.text_docbook',
+                    'MoinMoin.formatter.text_plain',
+                    #'MoinMoin.formatter.dom_xml',
+                    'MoinMoin.formatter.text_python',
+                    'MoinMoin.formatter.pagelinks',
+                   ]
+
--- a/MoinMoin/formatter/text_docbook.py	Fri Jul 20 22:05:38 2007 +0200
+++ b/MoinMoin/formatter/text_docbook.py	Fri Jul 20 22:56:13 2007 +0200
@@ -156,7 +156,7 @@
             # try to go to higher level if needed
             if depth <= self.curdepth:
                 # number of levels we want to go higher
-                numberOfLevels = self.curdepth-depth + 1
+                numberOfLevels = self.curdepth - depth + 1
                 for dummy in range(numberOfLevels):
                     #find first non section node
                     while (self.cur.nodeName != "section" and self.cur.nodeName != "article"):
--- a/MoinMoin/macro/_tests/test_Action.py	Fri Jul 20 22:05:38 2007 +0200
+++ b/MoinMoin/macro/_tests/test_Action.py	Fri Jul 20 22:56:13 2007 +0200
@@ -61,3 +61,6 @@
 
         assert result == expected
 
+
+coverage_modules = ['MoinMoin.macro.Action']
+
--- a/MoinMoin/macro/_tests/test_Hits.py	Fri Jul 20 22:05:38 2007 +0200
+++ b/MoinMoin/macro/_tests/test_Hits.py	Fri Jul 20 22:56:13 2007 +0200
@@ -105,3 +105,5 @@
         assert result == expected
 
 
+coverage_modules = ['MoinMoin.macro.Hits']
+
--- a/MoinMoin/macro/_tests/test_ImageLink.py	Fri Jul 20 22:05:38 2007 +0200
+++ b/MoinMoin/macro/_tests/test_ImageLink.py	Fri Jul 20 22:56:13 2007 +0200
@@ -80,4 +80,5 @@
         assert result == expected
 
 
+coverage_modules = ['MoinMoin.macro.ImageLink']
 
--- a/MoinMoin/macro/_tests/test_macro.py	Fri Jul 20 22:05:38 2007 +0200
+++ b/MoinMoin/macro/_tests/test_macro.py	Fri Jul 20 22:56:13 2007 +0200
@@ -32,3 +32,6 @@
         m = macro.Macro(p)
         return m
 
+
+coverage_modules = ['MoinMoin.macro']
+
--- a/MoinMoin/mail/_tests/test_sendmail.py	Fri Jul 20 22:05:38 2007 +0200
+++ b/MoinMoin/mail/_tests/test_sendmail.py	Fri Jul 20 22:56:13 2007 +0200
@@ -113,3 +113,6 @@
         self.failUnlessEqual(sendmail.encodeAddress(address, self.charset),
                              expected)
 
+
+coverage_modules = ['MoinMoin.mail.sendmail']
+
--- a/MoinMoin/mail/mailimport.py	Fri Jul 20 22:05:38 2007 +0200
+++ b/MoinMoin/mail/mailimport.py	Fri Jul 20 22:56:13 2007 +0200
@@ -43,7 +43,7 @@
 
 def log(text):
     if debug:
-        print >>sys.stderr, text
+        print >> sys.stderr, text
 
 def decode_2044(header):
     """ Decodes header field. See RFC 2044. """
@@ -322,5 +322,5 @@
     try:
         import_mail_from_file(request, infile)
     except ProcessingError, e:
-        print >>sys.stderr, "An error occured while processing the message:", e.args
+        print >> sys.stderr, "An error occured while processing the message:", e.args
 
--- a/MoinMoin/parser/_tests/test_text_moin_wiki.py	Fri Jul 20 22:05:38 2007 +0200
+++ b/MoinMoin/parser/_tests/test_text_moin_wiki.py	Fri Jul 20 22:56:13 2007 +0200
@@ -609,3 +609,7 @@
             html = self.parse(self.text % test)
             result = self.needle.search(html).group(1)
             assert result == expected
+
+
+coverage_modules = ['MoinMoin.parser.text_moin_wiki']
+
--- a/MoinMoin/request/_tests/test_request.py	Fri Jul 20 22:05:38 2007 +0200
+++ b/MoinMoin/request/_tests/test_request.py	Fri Jul 20 22:56:13 2007 +0200
@@ -120,3 +120,5 @@
                              'wrong date string')
 
 
+coverage_modules = ['MoinMoin.request']
+
--- a/MoinMoin/script/export/dump.py	Fri Jul 20 22:05:38 2007 +0200
+++ b/MoinMoin/script/export/dump.py	Fri Jul 20 22:56:13 2007 +0200
@@ -155,9 +155,9 @@
                     pagehtml = request.redirectedOutput(page.send_page, count_hit=0, content_only=1)
                 except:
                     errcnt = errcnt + 1
-                    print >>sys.stderr, "*** Caught exception while writing page!"
-                    print >>errlog, "~" * 78
-                    print >>errlog, file # page filename
+                    print >> sys.stderr, "*** Caught exception while writing page!"
+                    print >> errlog, "~" * 78
+                    print >> errlog, file # page filename
                     import traceback
                     traceback.print_exc(None, errlog)
             finally:
@@ -186,5 +186,5 @@
 
         errlog.close()
         if errcnt:
-            print >>sys.stderr, "*** %d error(s) occurred, see '%s'!" % (errcnt, errfile)
+            print >> sys.stderr, "*** %d error(s) occurred, see '%s'!" % (errcnt, errfile)
 
--- a/MoinMoin/script/xmlrpc/mailimport.py	Fri Jul 20 22:05:38 2007 +0200
+++ b/MoinMoin/script/xmlrpc/mailimport.py	Fri Jul 20 22:56:13 2007 +0200
@@ -35,5 +35,5 @@
         result = s.ProcessMail(secret, xmlrpclib.Binary(input.read()))
 
         if result != "OK":
-            print >>sys.stderr, result
+            print >> sys.stderr, result
 
--- a/MoinMoin/script/xmlrpc/remote.py	Fri Jul 20 22:05:38 2007 +0200
+++ b/MoinMoin/script/xmlrpc/remote.py	Fri Jul 20 22:56:13 2007 +0200
@@ -38,5 +38,5 @@
         # TODO handle stdout, stderr
 
         if result != "OK":
-            print >>sys.stderr, result
+            print >> sys.stderr, result
 
--- a/MoinMoin/search/_tests/test_search.py	Fri Jul 20 22:05:38 2007 +0200
+++ b/MoinMoin/search/_tests/test_search.py	Fri Jul 20 22:56:13 2007 +0200
@@ -34,3 +34,6 @@
         for case in tests:
             self.assertEqual(self.parser.isQuoted(case), False)
 
+
+coverage_modules = ['MoinMoin.search']
+
--- a/MoinMoin/search/results.py	Fri Jul 20 22:05:38 2007 +0200
+++ b/MoinMoin/search/results.py	Fri Jul 20 22:56:13 2007 +0200
@@ -396,7 +396,7 @@
             write(f.definition_list(1))
 
             if paging:
-                hitsTo = hitsFrom+request.cfg.search_results_per_page
+                hitsTo = hitsFrom + request.cfg.search_results_per_page
                 displayHits = self.hits[hitsFrom:hitsTo]
             else:
                 displayHits = self.hits
@@ -697,7 +697,7 @@
             ]) for i in page_range])
 
         # next page available
-        if cur_page < pages-1:
+        if cur_page < pages - 1:
             textlinks.append(''.join([
                 f.url(1, href=page_url(cur_page+1)),
                 f.text(_('Next')),
--- a/MoinMoin/security/_tests/test_security.py	Fri Jul 20 22:05:38 2007 +0200
+++ b/MoinMoin/security/_tests/test_security.py	Fri Jul 20 22:56:13 2007 +0200
@@ -275,3 +275,5 @@
                 import shutil
                 shutil.rmtree(path, True)
 
+coverage_modules = ['MoinMoin.security']
+
--- a/MoinMoin/server/server_twisted.py	Fri Jul 20 22:05:38 2007 +0200
+++ b/MoinMoin/server/server_twisted.py	Fri Jul 20 22:56:13 2007 +0200
@@ -206,7 +206,7 @@
     port = 8080
     interfaces = ['']
     threads = 10
-    timeout = 15*60 # 15 minutes
+    timeout = 15 * 60 # 15 minutes
     logPath = None # moin log file
     logPath_twisted = None # Twisted log file
     virtualHosts = None
--- a/MoinMoin/userprefs/suid.py	Fri Jul 20 22:05:38 2007 +0200
+++ b/MoinMoin/userprefs/suid.py	Fri Jul 20 22:56:13 2007 +0200
@@ -12,7 +12,9 @@
 from MoinMoin.widget import html
 from MoinMoin.userprefs import UserPrefBase
 
+
 class Settings(UserPrefBase):
+
     def __init__(self, request):
         """ Initialize setuid settings form. """
         UserPrefBase.__init__(self, request)
@@ -33,11 +35,11 @@
         _ = self._
         form = self.request.form
 
-        if form.has_key('cancel'):
+        if 'cancel' in form:
             return
 
-        if (wikiutil.checkTicket(self.request, self.request.form['ticket'][0]) and
-            self.request.request_method == 'POST'):
+        if (wikiutil.checkTicket(self.request, self.request.form['ticket'][0])
+            and self.request.request_method == 'POST'):
             uid = form.get('selected_user', [''])[0]
             if not uid:
                 return _("No user selected")
@@ -55,7 +57,6 @@
         else:
             return None
 
-
     def _user_select(self):
         options = []
         users = user.getUserList(self.request)
--- a/MoinMoin/util/_tests/test_diff3.py	Fri Jul 20 22:05:38 2007 +0200
+++ b/MoinMoin/util/_tests/test_diff3.py	Fri Jul 20 22:56:13 2007 +0200
@@ -82,3 +82,5 @@
         assert result == expected, ('Expected "%(expected)s" but got "%(result)s"') % locals()
 
 
+coverage_modules = ['MoinMoin.util.diff3']
+
--- a/MoinMoin/util/_tests/test_diff_text.py	Fri Jul 20 22:05:38 2007 +0200
+++ b/MoinMoin/util/_tests/test_diff_text.py	Fri Jul 20 22:56:13 2007 +0200
@@ -66,3 +66,5 @@
         assert result == expected, ('Expected "%(expected)s" but got "%(result)s"') % locals()
 
 
+coverage_modules = ['MoinMoin.util.diff_text']
+
--- a/MoinMoin/util/_tests/test_lock.py	Fri Jul 20 22:05:38 2007 +0200
+++ b/MoinMoin/util/_tests/test_lock.py	Fri Jul 20 22:56:13 2007 +0200
@@ -128,3 +128,5 @@
         time.sleep(delay)
         lock.release()
 
+coverage_modules = ['MoinMoin.util.lock']
+
--- a/MoinMoin/util/_tests/test_pysupport.py	Fri Jul 20 22:05:38 2007 +0200
+++ b/MoinMoin/util/_tests/test_pysupport.py	Fri Jul 20 22:56:13 2007 +0200
@@ -124,3 +124,4 @@
                 if err.errno != errno.ENOENT:
                     raise
 
+coverage_modules = ['MoinMoin.util.pysupport']
--- a/MoinMoin/util/_tests/test_util.py	Fri Jul 20 22:05:38 2007 +0200
+++ b/MoinMoin/util/_tests/test_util.py	Fri Jul 20 22:56:13 2007 +0200
@@ -51,3 +51,4 @@
         expected = length
         assert result == expected, ('Expected length "%(expected)s" but got "%(result)s"') % locals()
 
+coverage_modules = ['MoinMoin.util']
--- a/MoinMoin/util/_tests/test_web.py	Fri Jul 20 22:05:38 2007 +0200
+++ b/MoinMoin/util/_tests/test_web.py	Fri Jul 20 22:56:13 2007 +0200
@@ -93,3 +93,6 @@
         self.assertEqual(result, expected,
                          'Expected "%(expected)s" but got "%(result)s"' % locals())
 
+
+coverage_modules = ['MoinMoin.util.web']
+
--- a/MoinMoin/widget/_tests/test_html.py	Fri Jul 20 22:05:38 2007 +0200
+++ b/MoinMoin/widget/_tests/test_html.py	Fri Jul 20 22:56:13 2007 +0200
@@ -64,3 +64,5 @@
             self.assertEqual(result, expected,
                              'Expected "%(expected)s" but got "%(result)s"' % locals())
 
+coverage_modules = ['MoinMoin.widget.html']
+
--- a/MoinMoin/wikixml/_tests/test_marshal.py	Fri Jul 20 22:05:38 2007 +0200
+++ b/MoinMoin/wikixml/_tests/test_marshal.py	Fri Jul 20 22:56:13 2007 +0200
@@ -54,3 +54,6 @@
         self.assertEqual(objXML, expected,
             'Expected "%(expected)s" but got "%(objXML)s"' % locals())
 
+
+coverage_modules = ['MoinMoin.wikixml.marshal']
+
--- a/MoinMoin/xmlrpc/_tests/test_multicall.py	Fri Jul 20 22:05:38 2007 +0200
+++ b/MoinMoin/xmlrpc/_tests/test_multicall.py	Fri Jul 20 22:56:13 2007 +0200
@@ -25,3 +25,6 @@
     assert type(result[0]) == dict
     assert result[0].has_key("faultCode") and result[0].has_key("faultString")
 
+
+coverage_modules = ['MoinMoin.xmlrpc']
+