YAPF 0.26.0

This commit is contained in:
Ivan Kravets
2019-03-07 12:36:17 +02:00
parent 237d55208c
commit 3f52a6d5ba
5 changed files with 12 additions and 14 deletions

View File

@ -185,8 +185,8 @@ class LibBuilderBase(object):
@property
def build_dir(self):
lib_hash = hashlib.sha1(self.path if util.PY2 else self.path.
encode()).hexdigest()[:3]
lib_hash = hashlib.sha1(
self.path if util.PY2 else self.path.encode()).hexdigest()[:3]
return join("$BUILD_DIR", "lib%s" % lib_hash, basename(self.path))
@property

View File

@ -365,8 +365,8 @@ def platform_update(platforms, only_packages, only_check, json_output):
if not pkg_dir:
continue
latest = pm.outdated(pkg_dir, requirements)
if (not latest and not PlatformFactory.newPlatform(pkg_dir).
are_outdated_packages()):
if (not latest and not PlatformFactory.newPlatform(
pkg_dir).are_outdated_packages()):
continue
data = _get_installed_platform_data(
pkg_dir, with_boards=False, expose_packages=False)

View File

@ -432,5 +432,5 @@ def calculate_project_hash():
# Fix issue with useless project rebuilding for case insensitive FS.
# A case of disk drive can differ...
chunks_to_str = chunks_to_str.lower()
return sha1(chunks_to_str if util.PY2 else chunks_to_str.
encode()).hexdigest()
return sha1(
chunks_to_str if util.PY2 else chunks_to_str.encode()).hexdigest()

View File

@ -589,8 +589,8 @@ class PkgInstallerMixin(object):
target_dirname = "%s@src-%s" % (
pkg_dirname,
hashlib.md5(cur_manifest['__src_url'] if util.
PY2 else cur_manifest['__src_url'].
encode()).hexdigest())
PY2 else cur_manifest['__src_url'].encode(
)).hexdigest())
shutil.move(pkg_dir, join(self.package_dir, target_dirname))
# fix to a version
elif action == 2:
@ -600,8 +600,8 @@ class PkgInstallerMixin(object):
target_dirname = "%s@src-%s" % (
pkg_dirname,
hashlib.md5(tmp_manifest['__src_url'] if util.
PY2 else tmp_manifest['__src_url'].
encode()).hexdigest())
PY2 else tmp_manifest['__src_url'].encode(
)).hexdigest())
pkg_dir = join(self.package_dir, target_dirname)
# remove previous/not-satisfied package

View File

@ -642,10 +642,8 @@ class PlatformBase( # pylint: disable=too-many-public-methods
if not isdir(libcore_dir):
continue
storages.append({
"name":
"%s-core-%s" % (opts['package'], item),
"path":
libcore_dir
"name": "%s-core-%s" % (opts['package'], item),
"path": libcore_dir
})
return storages