Skip to content

Feature/pyflakes #101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 10, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ python:
install:
- "pip install coverage --use-mirrors"
- "pip install pep8 --use-mirrors"
- "pip install pyflakes --use-mirrors"
before_script:
- "pep8 --max-line-length=160 ."
- "pyflakes ."
- export QINIU_ACCESS_KEY="X0XpjFmLMTJpHB_ESHjeolCtipk-1U3Ok7LVTdoN"
- export QINIU_SECRET_KEY="wenlwkU1AYwNBf7Q9cCoG4VT_GYyrHE9AS_R2u81"
- export QINIU_TEST_BUCKET="pysdk"
Expand Down
1 change: 0 additions & 1 deletion qiniu/fop.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding:utf-8 -*-
import json


class Exif(object):
Expand Down
2 changes: 1 addition & 1 deletion qiniu/httplib_chunk.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import httplib
from httplib import _CS_REQ_STARTED, _CS_REQ_SENT, CannotSendHeader, NotConnected
import string
import os
from array import array


Expand Down Expand Up @@ -56,6 +55,7 @@ def _set_content_length(self, body):
# Don't send a length if this failed
if self.debuglevel > 0:
print "Cannot stat!!"
print te

if thelen is not None:
self.putheader('Content-Length', thelen)
Expand Down
5 changes: 3 additions & 2 deletions qiniu/io.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# -*- coding: utf-8 -*-
from base64 import urlsafe_b64encode
import rpc
import conf
import random
import string
try:
import zlib as binascii
import zlib
binascii = zlib
except ImportError:
zlib = None
import binascii


Expand Down
4 changes: 3 additions & 1 deletion qiniu/resumable_io.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# coding=utf-8
import os
try:
import zlib as binascii
import zlib
binascii = zlib
except ImportError:
zlib = None
import binascii
from base64 import urlsafe_b64encode

Expand Down
4 changes: 2 additions & 2 deletions qiniu/rs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"PutPolicy", "GetPolicy", "make_base_url",
]

from .rs import *
from .rs_token import *
from .rs import Client, EntryPath, EntryPathPair, uri_stat, uri_delete, uri_move, uri_copy
from .rs_token import PutPolicy, GetPolicy, make_base_url
1 change: 0 additions & 1 deletion qiniu/rs/test/rs_token_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import urllib

from qiniu import conf
from qiniu import rpc
from qiniu import rs

conf.ACCESS_KEY = os.getenv("QINIU_ACCESS_KEY")
Expand Down
1 change: 0 additions & 1 deletion qiniu/test/fop_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- coding:utf-8 -*-
import unittest
import os
from qiniu import fop

pic = "http://cheneya.qiniudn.com/hello_jpg"
Expand Down
6 changes: 4 additions & 2 deletions qiniu/test/io_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
import random
import urllib
try:
import zlib as binascii
import zlib
binascii = zlib
except ImportError:
zlib = None
import binascii
import cStringIO

Expand Down Expand Up @@ -34,7 +36,7 @@ class TestUp(unittest.TestCase):
def test(self):
def test_put():
key = "test_%s" % r(9)
params = "op=3"
# params = "op=3"
data = "hello bubby!"
extra.check_crc = 2
extra.crc32 = binascii.crc32(data) & 0xFFFFFFFF
Expand Down
9 changes: 5 additions & 4 deletions qiniu/test/resumable_io_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
import random
import platform
try:
import zlib as binascii
import zlib
binascii = zlib
except ImportError:
zlib = None
import binascii
import urllib
import tempfile
import shutil

from qiniu import conf
Expand All @@ -24,7 +25,7 @@

def r(length):
lib = string.ascii_uppercase
return ''.join([random.choice(lib) for i in range(0, length)])
return ''.join([random.choice(lib) for _ in range(0, length)])


class TestBlock(unittest.TestCase):
Expand All @@ -34,7 +35,7 @@ def test_block(self):
uptoken = policy.token()
client = up.Client(uptoken)

rets = [0, 0]
# rets = [0, 0]
data_slice_2 = "\nbye!"
ret, err = resumable_io.mkblock(
client, len(data_slice_2), data_slice_2)
Expand Down
8 changes: 5 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@
# -*- coding: utf-8 -*-

try:
from setuptools import setup
import setuptools
setup = setuptools.setup
except ImportError:
setuptools = None
from distutils.core import setup

PACKAGE = 'qiniu'
NAME = 'qiniu'
DESCRIPTION = 'Qiniu Resource Storage SDK for Python 2.X.'
LONG_DESCRIPTION = 'see:\nhttps://github.com/qiniu/python-sdk\n'
AUTHOR = 'Shanghai Qiniu Information Technologies Co., Ltd.'
AUTHOR_EMAIL = 'support@qiniu.com'
MAINTAINER_EMAIL = 'fengliyuan@qiniu.com'
AUTHOR_EMAIL = 'sdk@qiniu.com'
MAINTAINER_EMAIL = 'support@qiniu.com'
URL = 'https://github.com/qiniu/python-sdk'
VERSION = __import__(PACKAGE).__version__

Expand Down