Skip to content

Commit

Permalink
Merge pull request #10 from allanlei/release-1.1.2
Browse files Browse the repository at this point in the history
Release 1.1.2
  • Loading branch information
allanlei committed Sep 29, 2015
2 parents e9dc2f1 + 4bfb670 commit 8f307f8
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ python:
- "3.2"
- "3.3"
- "3.4"
- "3.5"
- "pypy"
install:
- "pip install ."
script: nosetests
script: nosetests
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

setup(
name='zipstream',
version='1.1.1',
version='1.1.2',
description='Zipfile generator',
author='Allan Lei',
author_email='allanlei@helveticode.com',
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
envlist = py26, py27, py32, py33, py34, pypy
envlist = py26, py27, py32, py33, py34, py35, pypy

[testenv]
deps=nose
commands = nosetests {posargs}
commands = nosetests {posargs}
17 changes: 13 additions & 4 deletions zipstream/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"""
from __future__ import unicode_literals, print_function, with_statement

__version__ = '1.1.1'
__version__ = '1.1.2'

import os
import sys
Expand All @@ -19,7 +19,8 @@
str, bytes,
ZIP64_VERSION,
ZIP_BZIP2, BZIP2_VERSION,
ZIP_LZMA, LZMA_VERSION)
ZIP_LZMA, LZMA_VERSION,
SEEK_SET, SEEK_CUR, SEEK_END)

from zipfile import (
ZIP_STORED, ZIP64_LIMIT, ZIP_FILECOUNT_LIMIT, ZIP_MAX_COMMENT,
Expand Down Expand Up @@ -70,8 +71,16 @@ def flush(self):
def next(self):
raise NotImplementedError()

def seek(self, offset, whence):
raise NotImplementedError()
# def seek(self, offset, whence=None):
# if whence == SEEK_SET:
# if offset < 0:
# raise ValueError('negative seek value -1')
# self.data_pointer = offset
# elif whence == SEEK_CUR:
# self.data_pointer = max(0, self.data_pointer + offset)
# elif whence == SEEK_END:
# self.data_pointer = max(0, offset)
# return self.data_pointer

def tell(self):
return self.data_pointer
Expand Down
8 changes: 7 additions & 1 deletion zipstream/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,10 @@
try:
from zipfile import ZIP_MAX_COMMENT
except ImportError:
ZIP_MAX_COMMENT = (1 << 16) - 1
ZIP_MAX_COMMENT = (1 << 16) - 1


# Copy from io
SEEK_SET = 0 # start of the stream (the default); offset should be zero or positive
SEEK_CUR = 1 # current stream position; offset may be negative
SEEK_END = 2 # end of the stream; offset is usually negative

0 comments on commit 8f307f8

Please sign in to comment.