changeset 1763:347d11826f95

Clean up imports in items/{__init__,content}.py
author Cheer Xiao <xiaqqaix@gmail.com>
date Sat, 01 Sep 2012 20:47:50 +0800
parents 3de98439f49c
children 19b19d4d9291
files MoinMoin/items/__init__.py MoinMoin/items/content.py
diffstat 2 files changed, 27 insertions(+), 42 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/items/__init__.py	Thu Aug 30 15:25:28 2012 -0700
+++ b/MoinMoin/items/__init__.py	Sat Sep 01 20:47:50 2012 +0800
@@ -17,51 +17,43 @@
     Each class in this module corresponds to an itemtype.
 """
 
-import re, time
+import time
 import itertools
 import json
 from StringIO import StringIO
 from collections import namedtuple
-from functools import partial
+
+from flask import current_app as app
+from flask import g as flaskg
+from flask import request, Response, redirect, abort, escape
 
 from flatland import Form
-from flatland.validation import Validator
 
 from jinja2 import Markup
 
 from whoosh.query import Term, And, Prefix
 
-from MoinMoin.forms import RequiredText, OptionalText, JSON, Tags, Submit
-
-from MoinMoin.security.textcha import TextCha, TextChaizedForm
-from MoinMoin.signalling import item_modified
-from MoinMoin.util.mime import Type
-from MoinMoin.storage.middleware.protecting import AccessDenied
-
 from MoinMoin import log
 logging = log.getLogger(__name__)
 
-from flask import current_app as app
-from flask import g as flaskg
-
-from flask import request, Response, redirect, abort, escape
-
-from werkzeug import is_resource_modified
-
+from MoinMoin.security.textcha import TextCha, TextChaizedForm
+from MoinMoin.signalling import item_modified
+from MoinMoin.storage.middleware.protecting import AccessDenied
+from MoinMoin.storage.error import NoSuchItemError, NoSuchRevisionError, StorageError
 from MoinMoin.i18n import L_
 from MoinMoin.themes import render_template
 from MoinMoin.util.interwiki import url_for_item
-from MoinMoin.storage.error import NoSuchItemError, NoSuchRevisionError, StorageError
 from MoinMoin.util.registry import RegistryBase
+from MoinMoin.forms import RequiredText, OptionalText, JSON, Tags, Submit
 from MoinMoin.constants.keys import (
     NAME, NAME_OLD, NAME_EXACT, WIKINAME, MTIME, SYSITEM_VERSION, ITEMTYPE,
-    CONTENTTYPE, SIZE, TAGS, ACTION, ADDRESS, HOSTNAME, USERID, COMMENT,
+    CONTENTTYPE, SIZE, ACTION, ADDRESS, HOSTNAME, USERID, COMMENT,
     HASH_ALGORITHM, ITEMID, REVID, DATAID, CURRENT, PARENTID
     )
 from MoinMoin.constants.contenttypes import charset, CONTENTTYPE_GROUPS
 from MoinMoin.constants.itemtypes import ITEMTYPES
 
-from .content import Content, NonExistentContent, Draw, content_registry
+from .content import Content, NonExistentContent, Draw
 
 
 COLS = 80
--- a/MoinMoin/items/content.py	Thu Aug 30 15:25:28 2012 -0700
+++ b/MoinMoin/items/content.py	Sat Sep 01 20:47:50 2012 +0800
@@ -24,23 +24,18 @@
 from StringIO import StringIO
 from array import array
 from collections import namedtuple
-from functools import partial
-from types import TypeType
 
-from werkzeug import is_resource_modified
+from flask import current_app as app
+from flask import g as flaskg
+from flask import request, url_for, Response, abort, escape
 
 from flatland import Form, String
 
-from whoosh.query import Term, And
-
-from MoinMoin.forms import File
+from jinja2 import Markup
 
-from MoinMoin.util.mimetype import MimeType
-from MoinMoin.util.mime import Type, type_moin_document
-from MoinMoin.util.tree import moin_page, html, xlink, docbook
-from MoinMoin.util.iri import Iri
-from MoinMoin.util.crypto import cache_key
-from MoinMoin.storage.middleware.protecting import AccessDenied
+from werkzeug import is_resource_modified
+
+from whoosh.query import Term, And
 
 try:
     import PIL
@@ -52,20 +47,18 @@
 from MoinMoin import log
 logging = log.getLogger(__name__)
 
-from flask import current_app as app
-from flask import g as flaskg
-
-from flask import request, url_for, Response, abort, escape
-
-from jinja2 import Markup
-
+from MoinMoin import wikiutil, config
 from MoinMoin.i18n import _, L_
 from MoinMoin.themes import render_template
-from MoinMoin import wikiutil, config
+from MoinMoin.storage.error import StorageError
 from MoinMoin.util.send_file import send_file
-from MoinMoin.util.interwiki import url_for_item
-from MoinMoin.storage.error import StorageError
 from MoinMoin.util.registry import RegistryBase
+from MoinMoin.util.mimetype import MimeType
+from MoinMoin.util.mime import Type, type_moin_document
+from MoinMoin.util.tree import moin_page, html, xlink, docbook
+from MoinMoin.util.iri import Iri
+from MoinMoin.util.crypto import cache_key
+from MoinMoin.forms import File
 from MoinMoin.constants.keys import (
     NAME, NAME_EXACT, WIKINAME, CONTENTTYPE, SIZE, TAGS, HASH_ALGORITHM
     )