Skip invalid name as version in build-tools directory.(ex: .DS_Store)

This commit is contained in:
attakei 2014-10-29 01:46:12 +09:00
parent 7a6034a75e
commit fdc2bb59ca

View file

@ -320,15 +320,19 @@ class TargetAndroid(Target):
return '{}-{}'.format(package_name, version_string)
def _read_version_subdir(self, *args):
versions = []
for v in os.listdir(join(*args)):
try:
versions = [self._process_version_string(v) for v in
os.listdir(join(*args))]
versions.sort()
return versions[-1]
print(os.listdir(join(*args)))
versions.append(self._process_version_string(v))
except:
pass
if not versions:
self.buildozer.error(
'Unable to find the latest version for {}'.format(join(*args)))
return [0]
versions.sort()
return versions[-1]
def _find_latest_package(self, packages, key):
package_versions = []