Skip to content

Commit

Permalink
Code cleanup, remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesls committed Jan 1, 2015
1 parent 1d4f19f commit 8d0d4b6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
5 changes: 2 additions & 3 deletions semidbm/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@
str_type = str


DATA_OPEN_FLAGS = os.O_RDWR|os.O_CREAT|os.O_APPEND
DATA_OPEN_FLAGS = os.O_RDWR | os.O_CREAT | os.O_APPEND
if sys.platform.startswith('win'):
# On windows we need to specify that we should be
# reading the file as a binary file so it doesn't
# change any line ending characters.
DATA_OPEN_FLAGS = DATA_OPEN_FLAGS|os.O_BINARY

DATA_OPEN_FLAGS = DATA_OPEN_FLAGS | os.O_BINARY
5 changes: 1 addition & 4 deletions semidbm/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@
import struct

from semidbm.exceptions import DBMLoadError, DBMChecksumError, DBMError
from semidbm.loaders import _DELETED
from semidbm.loaders import _DELETED, FILE_FORMAT_VERSION, FILE_IDENTIFIER
from semidbm import compat


# Major, Minor version.
FILE_FORMAT_VERSION = (1, 1)
FILE_IDENTIFIER = b'\x53\x45\x4d\x49'
_open = compat.file_open


Expand Down
2 changes: 1 addition & 1 deletion semidbm/loaders/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from semidbm.exceptions import DBMLoadError


# Major, Minor version.
FILE_FORMAT_VERSION = (1, 1)
FILE_IDENTIFIER = b'\x53\x45\x4d\x49'
_DELETED = -1
Expand Down Expand Up @@ -37,4 +38,3 @@ def _verify_header(self, header):
raise DBMLoadError(
'Incompatible file version (got: v%s, can handle: v%s)' % (
(major, FILE_FORMAT_VERSION[0])))

0 comments on commit 8d0d4b6

Please sign in to comment.