Mercurial > hatta-flask
changeset 2354:842b3b30c07c
Cleaned up the imports
| author | Radomir Dopieralski <sheep-devel@sheep.art.pl> |
|---|---|
| date | Sun, 14 Oct 2012 16:59:44 +0200 |
| parents | c89f17502b23 |
| children | ced027b3a539 |
| files | hatta/__init__.py hatta/__main__.py hatta/hg_integration.py hatta/page.py hatta/parser.py hatta/search.py hatta/storage.py hatta/wiki.py |
| diffstat | 8 files changed, 47 insertions(+), 34 deletions(-) [+] |
line wrap: on
line diff
--- a/hatta/__init__.py Sun Oct 14 16:41:02 2012 +0200 +++ b/hatta/__init__.py Sun Oct 14 16:59:44 2012 +0200 @@ -18,13 +18,25 @@ """ # Exposed API -from wiki import Wiki, WikiResponse, WikiRequest -from config import WikiConfig, read_config -from __main__ import main -from parser import WikiParser, WikiWikiParser -from storage import WikiStorage, WikiSubdirectoryStorage -from page import WikiPage, WikiPageText, WikiPageWiki -from page import WikiPageColorText, WikiPageFile, WikiPageImage +from hatta.config import WikiConfig, read_config +from hatta.__main__ import main +from hatta.page import WikiPageColorText, WikiPageFile, WikiPageImage +from hatta.page import WikiPage, WikiPageText, WikiPageWiki +from hatta.parser import WikiParser, WikiWikiParser +from hatta.storage import WikiStorage, WikiSubdirectoryStorage +from hatta.wiki import Wiki, WikiResponse, WikiRequest + + +__all__ = [ + 'WikiConfig', 'read_config', + 'main', + 'WikiPageColorText', 'WikiPageFile', 'WikiPageImage', + 'WikiPage', 'WikiPageText', 'WikiPageWiki', + 'WikiParser', 'WikiWikiParser', + 'WikiStorage', 'WikiSubdirectoryStorage', + 'Wiki', 'WikiResponse', 'WikiRequest', + '__version__', 'project_name', 'project_url', 'project_description', +] # Project's metainformation __version__ = '1.5.0'
--- a/hatta/__main__.py Sun Oct 14 16:41:02 2012 +0200 +++ b/hatta/__main__.py Sun Oct 14 16:59:44 2012 +0200 @@ -4,8 +4,9 @@ import os import sys -from config import read_config -from wiki import Wiki +from hatta.config import read_config +from hatta.wiki import Wiki + # Avoid WSGI errors, see http://mercurial.selenic.com/bts/issue1095 sys.stdout = sys.__stdout__
--- a/hatta/hg_integration.py Sun Oct 14 16:41:02 2012 +0200 +++ b/hatta/hg_integration.py Sun Oct 14 16:59:44 2012 +0200 @@ -3,7 +3,7 @@ import os -from config import WikiConfig +from hatta.config import WikiConfig from __main__ import main
--- a/hatta/page.py Sun Oct 14 16:41:02 2012 +0200 +++ b/hatta/page.py Sun Oct 14 16:59:44 2012 +0200 @@ -3,8 +3,8 @@ import difflib import mimetypes +import os import re -import os import werkzeug import werkzeug.contrib.atom @@ -12,10 +12,10 @@ pygments = None try: import pygments - import pygments.util + import pygments.formatters import pygments.lexers - import pygments.formatters import pygments.styles + import pygments.util except ImportError: pass @@ -25,13 +25,13 @@ except ImportError: pass -import parser -import error +from hatta import error +from hatta import parser def page_mime(title): """ - Guess page's mime type ased on corresponding file name. + Guess page's mime type based on corresponding file name. Default ot text/x-wiki for files without an extension. >>> page_mime(u'something.txt')
--- a/hatta/parser.py Sun Oct 14 16:41:02 2012 +0200 +++ b/hatta/parser.py Sun Oct 14 16:59:44 2012 +0200 @@ -1,10 +1,10 @@ #!/usr/bin/python # -*- coding: utf-8 -*- +import itertools import re import sys import unicodedata -import itertools import werkzeug
--- a/hatta/search.py Sun Oct 14 16:41:02 2012 +0200 +++ b/hatta/search.py Sun Oct 14 16:59:44 2012 +0200 @@ -1,12 +1,12 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -import sqlite3 +import os import re -import os +import sqlite3 import thread -import error +from hatta import error class WikiSearch(object):
--- a/hatta/storage.py Sun Oct 14 16:41:02 2012 +0200 +++ b/hatta/storage.py Sun Oct 14 16:59:44 2012 +0200 @@ -1,28 +1,28 @@ #!/usr/bin/python # -*- coding: utf-8 -*- +import datetime +import errno import os +import re import tempfile import thread -import re import werkzeug -import datetime -import errno # Note: we have to set these before importing Mercurial os.environ['HGENCODING'] = 'utf-8' os.environ['HGMERGE'] = "internal:merge" +import mercurial.commands import mercurial.hg -import mercurial.ui -import mercurial.revlog -import mercurial.util import mercurial.hgweb -import mercurial.commands import mercurial.merge +import mercurial.revlog +import mercurial.ui +import mercurial.util -import error -import page +from hatta import error +from hatta import page class StorageError(Exception):
--- a/hatta/wiki.py Sun Oct 14 16:41:02 2012 +0200 +++ b/hatta/wiki.py Sun Oct 14 16:59:44 2012 +0200 @@ -20,11 +20,11 @@ pass import hatta -import error -import page -import parser -import search -import storage +from hatta import error +from hatta import page +from hatta import parser +from hatta import search +from hatta import storage import mercurial # import it after storage!
