Skip to content

Commit

Permalink
Fix lint (#38)
Browse files Browse the repository at this point in the history
* Fix lint
* bump version
  • Loading branch information
algrs authored Apr 17, 2017
1 parent 5c73b39 commit cfc5273
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 8 deletions.
4 changes: 4 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ task :test do
raise unless system "nose2"
end

task :unittest do
raise unless system "nose2"
end

task :lint => :require_style_config do
raise unless system "bodylabs-python-style/bin/pylint_test baiji --min_rating 10.0"
end
Expand Down
3 changes: 1 addition & 2 deletions baiji/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ def etag_matches(self, key_or_file, other_etag):
# print " - possible_part_sizes:", possible_part_sizes
possible_part_sizes = set([part_size for part_size in possible_part_sizes if part_size <= max_part_size and part_size >= 1024*1024*5])
# print " - possible_part_sizes:", possible_part_sizes
if len(possible_part_sizes) == 0:
if not possible_part_sizes:
return False
for part_size in possible_part_sizes:
# print " -", part_size, self._build_etag(k.path, n_parts, part_size)
Expand Down Expand Up @@ -720,4 +720,3 @@ def enable_versioning(self, bucket):

def disable_versioning(self, bucket):
self._bucket(bucket).configure_versioning(False)

2 changes: 1 addition & 1 deletion baiji/copy.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def __init__(self, src, dst, connection):
raise ValueError("{} is a directory (not copied; use recursive mode to copy directories".format(self.src.raw))

if self.dst.isdir:
self.dst.path = os.path.join(self.dst.path, os.path.basename(self.src.path))
self.dst.path = path.join(self.dst.path, path.basename(self.src.path))

# DEFAULTS:
self.progress = False
Expand Down
2 changes: 1 addition & 1 deletion baiji/package_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
#
# See https://www.python.org/dev/peps/pep-0420/#namespace-packages-today

__version__ = '2.7.1'
__version__ = '2.7.2'
3 changes: 2 additions & 1 deletion baiji/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ def gettmpdir(prefix='tmp/', suffix='', bucket='bodylabs-temp', uuid_generator=N
done = False
while not done:
tmppath = "%s%s%s" % (prefix, uuid_generator(), suffix)
if len([x for x in b.list(prefix=tmppath)]) == 0:
existin_files_at_tmppath = [x for x in b.list(prefix=tmppath)]
if not existin_files_at_tmppath:
k = Key(b)
k.key = "%s/.tempdir" % (tmppath)
k.set_contents_from_string('')
Expand Down
2 changes: 1 addition & 1 deletion baiji/util/lookup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ def get_versioned_key_remote(bucket, key_name, version_id=None):
if e.status == 400:
raise InvalidVersionID("Invalid versionID %s" % version_id)
else:
raise e
raise
return key
5 changes: 3 additions & 2 deletions baiji/util/shutillib.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ def mkdir_p(path):
'''
import errno
import os
if len(path) > 0:
if path:
try:
os.makedirs(path)
except OSError as ex:
if ex.errno == errno.EEXIST:
pass
else: raise
else:
raise

0 comments on commit cfc5273

Please sign in to comment.