minor: these constants make more sense in grid_file.py
This commit is contained in:
parent
143e649aca
commit
a1c00f2b43
@ -24,9 +24,6 @@ try:
|
||||
except:
|
||||
from StringIO import StringIO
|
||||
|
||||
from pymongo import _SEEK_SET
|
||||
from pymongo import _SEEK_CUR
|
||||
from pymongo import _SEEK_END
|
||||
from pymongo.son import SON
|
||||
from pymongo.database import Database
|
||||
from pymongo.objectid import ObjectId
|
||||
@ -35,6 +32,15 @@ from pymongo.binary import Binary
|
||||
from errors import CorruptGridFile
|
||||
from pymongo import ASCENDING
|
||||
|
||||
try:
|
||||
_SEEK_SET = os.SEEK_SET
|
||||
_SEEK_CUR = os.SEEK_CUR
|
||||
_SEEK_END = os.SEEK_END
|
||||
except AttributeError: # before 2.5
|
||||
_SEEK_SET = 0
|
||||
_SEEK_CUR = 1
|
||||
_SEEK_END = 2
|
||||
|
||||
# TODO we should use per-file reader-writer locks here instead,
|
||||
# for performance. Unfortunately they aren't in the Python standard library.
|
||||
_files_lock = Condition()
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
|
||||
import types
|
||||
import sys
|
||||
import os
|
||||
|
||||
from pymongo.connection import Connection as PyMongo_Connection
|
||||
from pymongo.son import SON
|
||||
@ -39,15 +38,6 @@ version = "1.1.2+"
|
||||
Connection = PyMongo_Connection
|
||||
"""Alias for :class:`pymongo.connection.Connection`."""
|
||||
|
||||
try:
|
||||
_SEEK_SET = os.SEEK_SET
|
||||
_SEEK_CUR = os.SEEK_CUR
|
||||
_SEEK_END = os.SEEK_END
|
||||
except AttributeError: # before 2.5
|
||||
_SEEK_SET = 0
|
||||
_SEEK_CUR = 1
|
||||
_SEEK_END = 2
|
||||
|
||||
def _index_list(key_or_list, direction=None):
|
||||
"""Helper to generate a list of (key, direction) pairs.
|
||||
|
||||
|
||||
@ -23,8 +23,7 @@ sys.path[0:0] = [""]
|
||||
|
||||
import qcheck
|
||||
from test_connection import get_connection
|
||||
from gridfs.grid_file import GridFile
|
||||
from pymongo import _SEEK_END, _SEEK_CUR
|
||||
from gridfs.grid_file import GridFile, _SEEK_END, _SEEK_CUR
|
||||
|
||||
|
||||
class TestGridFile(unittest.TestCase):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user