Permalink
Browse files

Rename "review" package to "reviewing"

The name "review" is unfortunate since that's a very natural name for
a local variable referencing "the review," which means the package in
the global scope is shadowed locally.  This has lead to the package's
modules almost always being imported as

  import review.FOO as review_FOO

as a work-around.  This workaround is kept in this commit, thus
reducing its immediate impact to just modifying import statements.
  • Loading branch information...
jensl committed Nov 28, 2012
1 parent 761f52e commit 3623e1beffb52a8b6b68f1ad5eaa98d1ccee7558
View
@@ -26,7 +26,7 @@
import dbaccess
import extensions
-import review.mail
+import reviewing.mail
POLLING_INTERVAL = 5
@@ -59,8 +59,8 @@ def processLoop():
output = cStringIO.StringIO()
if extensions.executeProcessChanges(db, user_id, batch_id, output):
- pending_mails = review.mail.sendExtensionOutput(db, user_id, batch_id, output.getvalue())
- review.mail.sendPendingMails(pending_mails)
+ pending_mails = reviewing.mail.sendExtensionOutput(db, user_id, batch_id, output.getvalue())
+ reviewing.mail.sendPendingMails(pending_mails)
# Main loop.
while True:
View
@@ -23,7 +23,7 @@
import diff
import diff.context
import changeset.utils as changeset_utils
-import review.comment as review_comment
+import reviewing.comment as review_comment
import htmlutils
import itertools
import configuration
View
2 cli.py
@@ -20,7 +20,7 @@
except: from cjson import encode as json_encode, decode as json_decode
import dbutils
-import review.utils as review_utils
+import reviewing.utils as review_utils
db = None
View
@@ -27,8 +27,8 @@
import request
import dbutils
-import review.utils as review_utils
-import review.filters as review_filters
+import reviewing.utils as review_utils
+import reviewing.filters as review_filters
import log.commitset as log_commitset
import diff
import mailutils
View
@@ -858,7 +858,7 @@ def getFilteredTails(self):
def getRelevantFiles(self, db, user):
if not self.filters:
- from review.filters import Filters
+ from reviewing.filters import Filters
self.filters = Filters()
self.filters.load(db, review=self)
View
@@ -16,7 +16,6 @@
import diff
import diff.html
-import review.comment
import sys
import traceback
View
@@ -26,8 +26,8 @@
from log.commitset import CommitSet
import dbutils
-import review.utils as review_utils
-import review.mail as review_mail
+import reviewing.utils as review_utils
+import reviewing.mail as review_mail
import configuration
import log.commitset
import textutils
@@ -17,7 +17,7 @@
import dbutils
from operation import Operation, OperationResult, Optional
-from review.comment import CommentChain, validateCommentChain, createCommentChain, createComment
+from reviewing.comment import CommentChain, validateCommentChain, createCommentChain, createComment
class ValidateCommentChain(Operation):
def __init__(self):
@@ -24,7 +24,7 @@
import configuration
from operation import Operation, OperationResult, OperationError, Optional, OperationFailure
-from review.utils import parseReviewFilters, parseRecipientFilters, createReview, getReviewersAndWatchers
+from reviewing.utils import parseReviewFilters, parseRecipientFilters, createReview, getReviewersAndWatchers
from page.createreview import generateReviewersAndWatchersTable
from log.commitset import CommitSet
@@ -18,9 +18,9 @@
import profiling
from operation import Operation, OperationResult, Optional
-from review.comment import CommentChain, createCommentChain, createComment
-from review.mail import sendPendingMails
-from review.utils import generateMailsForBatch
+from reviewing.comment import CommentChain, createCommentChain, createComment
+from reviewing.mail import sendPendingMails
+from reviewing.utils import generateMailsForBatch
class ReviewStateChange(Operation):
def __init__(self):
@@ -18,7 +18,7 @@
import dbutils
import mailutils
-import review.utils
+import reviewing.utils
from operation import Operation, OperationResult
@@ -108,7 +108,7 @@ def process(self, db, user, review_id, user_name, files):
if delete_file_ids or new_file_ids:
cursor.execute("UPDATE reviews SET serial=serial+1 WHERE id=%s", (review_id,))
- pending_mails = review.utils.generateMailsForAssignmentsTransaction(db, transaction_id)
+ pending_mails = reviewing.utils.generateMailsForAssignmentsTransaction(db, transaction_id)
db.commit()
@@ -17,7 +17,7 @@
import dbutils
from operation import Operation, OperationResult, OperationError, Optional
-from review.comment import Comment, CommentChain
+from reviewing.comment import Comment, CommentChain
class SetCommentChainState(Operation):
def __init__(self, parameters):
@@ -18,7 +18,7 @@
import gitutils
import mailutils
-import review.utils as review_utils
+import reviewing.utils as review_utils
from operation import Operation, OperationResult, OperationError, Optional
@@ -17,7 +17,7 @@
import dbutils
import gitutils
-import review.mail as review_mail
+import reviewing.mail as review_mail
import mailutils
from operation import Operation, OperationResult, OperationError, Optional
View
@@ -19,7 +19,7 @@
import gitutils
import page.utils
-import review.utils as review_utils
+import reviewing.utils as review_utils
import log.html
import log.commitset
View
@@ -19,7 +19,7 @@
import dbutils
import gitutils
-import review.utils
+import reviewing.utils
import log.html
import htmlutils
import page.utils
@@ -31,7 +31,7 @@
def generateReviewersAndWatchersTable(db, repository, target, all_reviewers, all_watchers, applyfilters=True, applyparentfilters=False):
cursor = db.cursor()
- teams = review.utils.collectReviewTeams(all_reviewers)
+ teams = reviewing.utils.collectReviewTeams(all_reviewers)
reviewers = set()
watchers = set()
@@ -288,7 +288,7 @@ def renderCreateReview(req, db, user):
invalid_branch_name = "false"
default_branch_name = htmlutils.htmlify(match.group(1))
- all_reviewers, all_watchers = review.utils.getReviewersAndWatchers(db, repository, commits, applyparentfilters=applyparentfilters)
+ all_reviewers, all_watchers = reviewing.utils.getReviewersAndWatchers(db, repository, commits, applyparentfilters=applyparentfilters)
document = htmlutils.Document(req)
html = document.html()
View
@@ -19,7 +19,7 @@
import gitutils
import page.utils
-import review.utils as review_utils
+import reviewing.utils as review_utils
import log.commitset
def renderFilterChanges(req, db, user):
View
@@ -18,7 +18,7 @@
import htmlutils
import page.utils
-import review.utils as review_utils
+import reviewing.utils as review_utils
def renderManageReviewers(req, db, user):
review_id = req.getParameter("review", filter=int)
View
@@ -16,8 +16,8 @@
import page.utils
import dbutils
-import review.comment as review_comment
-import review.utils as review_utils
+import reviewing.comment as review_comment
+import reviewing.utils as review_utils
import htmlutils
import diff
View
@@ -20,9 +20,9 @@
import profiling
import linkify
-import review.comment as review_comment
-import review.utils as review_utils
-import review.html as review_html
+import reviewing.comment as review_comment
+import reviewing.utils as review_utils
+import reviewing.html as review_html
import changeset.utils as changeset_utils
import operation.blame
View
@@ -23,9 +23,9 @@
import changeset.load as changeset_load
import changeset.utils as changeset_utils
import changeset.detectmoves as changeset_detectmoves
-import review.utils as review_utils
-import review.comment as review_comment
-import review.filters as review_filters
+import reviewing.utils as review_utils
+import reviewing.comment as review_comment
+import reviewing.filters as review_filters
import log.html as log_html
from log.commitset import CommitSet
import configuration
View
@@ -20,8 +20,8 @@
import os.path
import htmlutils
import diff
-import review.utils as review_utils
-import review.comment as review_comment
+import reviewing.utils as review_utils
+import reviewing.comment as review_comment
from syntaxhighlight.request import requestHighlights
View
@@ -25,9 +25,9 @@
import htmlutils
import page.utils
import log.html
-import review.utils as review_utils
-import review.html as review_html
-import review.comment as review_comment
+import reviewing.utils as review_utils
+import reviewing.html as review_html
+import reviewing.comment as review_comment
import configuration
import diff
import profiling
View
@@ -18,9 +18,9 @@
import htmlutils
import page.utils
import log.html
-import review.utils as review_utils
-import review.html as review_html
-import review.comment as review_comment
+import reviewing.utils as review_utils
+import reviewing.html as review_html
+import reviewing.comment as review_comment
import time
import re
import diff
View
@@ -236,7 +236,7 @@ def displayMessage(db, req, user, title, review=None, message=None, page_title=N
body = html.body()
if review:
- import review.utils as review_utils
+ import reviewing.utils as review_utils
def generateRight(target):
review_utils.renderDraftItems(db, user, review, target)
File renamed without changes.
@@ -27,7 +27,7 @@
from htmlutils import jsify
from time import strftime
-from review.filters import Filters
+from reviewing.filters import Filters
from operation import OperationFailure
class Comment:
File renamed without changes.
File renamed without changes.
@@ -26,7 +26,7 @@
import changeset.load as changeset_load
import log.commitset as log_commitset
-import review.comment as review_comment
+import reviewing.comment as review_comment
import utils as review_utils
import time
File renamed without changes.
@@ -15,13 +15,14 @@
# the License.
import dbutils
+import gitutils
from dbutils import *
from itertools import izip, repeat, chain
import htmlutils
import mail
import changeset.utils as changeset_utils
-import review.comment as review_comment
+import reviewing.comment as review_comment
import log.commitset as log_commitset
from operation import OperationError, OperationFailure

0 comments on commit 3623e1b

Please sign in to comment.