← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~jtv/launchpad/pre-export-cleanup into lp:launchpad/devel

 

Jeroen T. Vermeulen has proposed merging lp:~jtv/launchpad/pre-export-cleanup into lp:launchpad/devel.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers): code


Just cleaning up a bit of lint so it doesn't pollute a more serious branch I have in progress.  No tests affected etc.


Jeroen
-- 
https://code.launchpad.net/~jtv/launchpad/pre-export-cleanup/+merge/30445
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~jtv/launchpad/pre-export-cleanup into lp:launchpad/devel.
=== modified file 'lib/lp/translations/model/pofile.py'
--- lib/lp/translations/model/pofile.py	2010-04-23 14:46:43 +0000
+++ lib/lp/translations/model/pofile.py	2010-07-20 18:14:44 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009 Canonical Ltd.  This software is licensed under the
+# Copyright 2009-2010 Canonical Ltd.  This software is licensed under the
 # GNU Affero General Public License version 3 (see the file LICENSE).
 
 # pylint: disable-msg=E0611,W0212,W0231
@@ -17,8 +17,7 @@
 import datetime
 import pytz
 from sqlobject import (
-    ForeignKey, IntCol, StringCol, BoolCol, SQLMultipleJoin
-    )
+    ForeignKey, IntCol, StringCol, BoolCol, SQLMultipleJoin)
 from zope.interface import implements
 from zope.component import getAdapter, getUtility
 from zope.security.proxy import removeSecurityProxy
@@ -132,6 +131,7 @@
     else:
         return False
 
+
 def _can_edit_translations(pofile, person):
     """Say if a person is able to edit existing translations.
 
@@ -182,6 +182,7 @@
         translators,
         person) or person.inTeam(pofile.owner)
 
+
 def _can_add_suggestions(pofile, person):
     """Whether a person is able to add suggestions.
 
@@ -316,7 +317,6 @@
                                text=quote_like(text))
         return translation_match
 
-
     def _getTemplateSearchQuery(self, text):
         """Query for finding `text` in msgids of this POFile.
         """
@@ -570,7 +570,7 @@
             return u','.join(emails)
         elif credits_type == TranslationCreditsType.KDE_NAMES:
             names = []
-            
+
             if text is not None:
                 if text == u'':
                     text = SPACE
@@ -593,7 +593,7 @@
                         text = text[:header_index]
                     else:
                         text += u'\n\n'
-                
+
                 text += LP_CREDIT_HEADER
                 for contributor in self.contributors:
                     text += ("\n  %s %s" %
@@ -711,7 +711,6 @@
         clause_tables.insert(0, POTMsgSet)
         return self._getOrderedPOTMsgSets(clause_tables, query)
 
-
     def getPOTMsgSetUntranslated(self):
         """See `IPOFile`."""
         # We get all POTMsgSet.ids with translations, and later
@@ -747,12 +746,12 @@
     def getPOTMsgSetWithNewSuggestions(self):
         """See `IPOFile`."""
         clauses = self._getClausesForPOFileMessages()
-        msgstr_clause =  make_plurals_sql_fragment(
+        msgstr_clause = make_plurals_sql_fragment(
             "TranslationMessage.msgstr%(form)d IS NOT NULL", "OR")
         clauses.extend([
             'TranslationTemplateItem.potmsgset = POTMsgSet.id',
             'TranslationMessage.is_current IS NOT TRUE',
-            "(%s)" % msgstr_clause
+            "(%s)" % msgstr_clause,
             ])
 
         variant_clause = self._getLanguageVariantClause(table='diverged')
@@ -908,12 +907,12 @@
             conditions.
         """
         query.append('%(table_name)s.msgstr0 IS NOT NULL' % {
-            'table_name' : table_name})
+            'table_name': table_name})
         if self.language.pluralforms > 1:
             plurals_query = ' AND '.join(
                 '%(table_name)s.msgstr%(plural_form)d IS NOT NULL' % {
-                  'plural_form' : plural_form,
-                  'table_name' : table_name
+                  'plural_form': plural_form,
+                  'table_name': table_name,
                 } for plural_form in range(1, self.plural_forms))
             query.append(
                 '(POTMsgSet.msgid_plural IS NULL OR (%s))' % plurals_query)
@@ -1329,7 +1328,7 @@
         self.fuzzyheader = False
         self.lasttranslator = None
         UTC = pytz.timezone('UTC')
-        self.date_changed  = None
+        self.date_changed = None
         self.lastparsed = None
         self.owner = getUtility(ILaunchpadCelebrities).rosetta_experts
 
@@ -1663,7 +1662,7 @@
                     And(MatchingPOT.productseriesID is not None,
                         OtherPOT.productseriesID is not None,
                         (MatchingProductSeries.productID ==
-                         OtherProductSeries.productID)) )))
+                         OtherProductSeries.productID)))))
         results.config(distinct=True)
         return results
 

=== modified file 'lib/lp/translations/model/potemplate.py'
--- lib/lp/translations/model/potemplate.py	2010-07-20 12:33:43 +0000
+++ lib/lp/translations/model/potemplate.py	2010-07-20 18:14:44 +0000
@@ -461,8 +461,12 @@
                                "POFile.potemplate = %d AND "
                                "POFile.variant IS NULL" % self.id,
                                clauseTables=['POFile', 'Language'],
+<<<<<<< TREE
                                distinct=True,
                                )
+=======
+                               distinct=True)
+>>>>>>> MERGE-SOURCE
 
     def getPOFileByPath(self, path):
         """See `IPOTemplate`."""
@@ -573,7 +577,7 @@
                 product = self.productseries.product
                 clauses.extend([
                     'POTemplate.productseries=ProductSeries.id',
-                    'ProductSeries.product %s' % self._null_quote(product)
+                    'ProductSeries.product %s' % self._null_quote(product),
                     ])
                 clause_tables.append('ProductSeries')
             elif self.distroseries is not None: