summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Kreen2012-12-20 15:08:39 +0000
committerMarko Kreen2012-12-20 15:08:39 +0000
commit7e0f0f29a9421999d2ae02cc7fe8f2df4fe5fc78 (patch)
tree2d0d3e6e2fcf001419caab9213cf1400d72939b9
parent303b635f6753605a0d052537970468465feb897e (diff)
Clean hashtext.py imports
-rw-r--r--python/skytools/__init__.py9
-rw-r--r--python/skytools/hashtext.py10
2 files changed, 11 insertions, 8 deletions
diff --git a/python/skytools/__init__.py b/python/skytools/__init__.py
index dd9473b9..c49dcb65 100644
--- a/python/skytools/__init__.py
+++ b/python/skytools/__init__.py
@@ -34,6 +34,9 @@ _symbols = {
'write_atomic': 'skytools.fileutil:write_atomic',
# skytools.gzlog
'gzip_append': 'skytools.gzlog:gzip_append',
+ # skytools.hashtext
+ 'hashtext_old': 'skytools.hashtext:hashtext_old',
+ 'hashtext_new': 'skytools.hashtext:hashtext_new',
# skytools.natsort
'natsort': 'skytools.natsort:natsort',
'natsort_icase': 'skytools.natsort:natsort_icase',
@@ -133,9 +136,6 @@ _symbols = {
'parse_iso_timestamp': 'skytools.timeutil:parse_iso_timestamp',
# skytools.utf8
'safe_utf8_decode': 'skytools.utf8:safe_utf8_decode',
- # hashing
- 'hashtext_old': 'skytools.hashtext:hashtext_old',
- 'hashtext_new': 'skytools.hashtext:hashtext_new',
}
__all__ = _symbols.keys()
@@ -157,6 +157,7 @@ elif 1:
from skytools.dbstruct import *
from skytools.fileutil import *
from skytools.gzlog import *
+ from skytools.hashtext import *
from skytools.natsort import *
from skytools.parsing import *
from skytools.psycopgwrapper import *
@@ -178,6 +179,7 @@ else:
import skytools.dbstruct
import skytools.fileutil
import skytools.gzlog
+ import skytools.hashtext
import skytools.natsort
import skytools.parsing
import skytools.psycopgwrapper
@@ -195,6 +197,7 @@ else:
+ skytools.dbstruct.__all__
+ skytools.fileutil.__all__
+ skytools.gzlog.__all__
+ + skytools.hashtext.__all__
+ skytools.natsort.__all__
+ skytools.parsing.__all__
+ skytools.psycopgwrapper.__all__
diff --git a/python/skytools/hashtext.py b/python/skytools/hashtext.py
index 6a9cf11d..bc7ac024 100644
--- a/python/skytools/hashtext.py
+++ b/python/skytools/hashtext.py
@@ -1,5 +1,8 @@
"""
-Pure python implementation of Postgres hashes
+Implementation of Postgres hashing function.
+
+hashtext_old() - used up to PostgreSQL 8.3
+hashtext_new() - used since PostgreSQL 8.4
>>> import skytools._chashtext
>>> for i in range(3):
@@ -27,10 +30,7 @@ True
import sys, struct
-__all__ = [
- "hashtext_old_py", "hashtext_new_py",
- "hashtext_old", "hashtext_new"
-]
+__all__ = ["hashtext_old", "hashtext_new"]
# pad for last partial block
PADDING = '\0' * 12