mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-10-08 18:31:07 +03:00
Make pre-commit hook pass after python3 switch
This commit is contained in:
parent
49ac25270e
commit
ee9a296b64
7 changed files with 18 additions and 17 deletions
|
@ -102,8 +102,8 @@ def main():
|
||||||
default_sdk_path = '/opt/android-sdk'
|
default_sdk_path = '/opt/android-sdk'
|
||||||
while not options.no_prompt:
|
while not options.no_prompt:
|
||||||
try:
|
try:
|
||||||
s = raw_input('Enter the path to the Android SDK ('
|
s = input('Enter the path to the Android SDK ('
|
||||||
+ default_sdk_path + ') here:\n> ')
|
+ default_sdk_path + ') here:\n> ')
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print('')
|
print('')
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
|
@ -295,12 +295,12 @@ def main():
|
||||||
sftp = ssh.open_sftp()
|
sftp = ssh.open_sftp()
|
||||||
if os.path.basename(remotepath) \
|
if os.path.basename(remotepath) \
|
||||||
not in sftp.listdir(os.path.dirname(remotepath)):
|
not in sftp.listdir(os.path.dirname(remotepath)):
|
||||||
sftp.mkdir(remotepath, mode=0755)
|
sftp.mkdir(remotepath, mode=0o755)
|
||||||
for repo_section in repo_sections:
|
for repo_section in repo_sections:
|
||||||
repo_path = os.path.join(remotepath, repo_section)
|
repo_path = os.path.join(remotepath, repo_section)
|
||||||
if os.path.basename(repo_path) \
|
if os.path.basename(repo_path) \
|
||||||
not in sftp.listdir(remotepath):
|
not in sftp.listdir(remotepath):
|
||||||
sftp.mkdir(repo_path, mode=0755)
|
sftp.mkdir(repo_path, mode=0o755)
|
||||||
sftp.close()
|
sftp.close()
|
||||||
ssh.close()
|
ssh.close()
|
||||||
elif options.command == 'update':
|
elif options.command == 'update':
|
||||||
|
|
|
@ -1337,14 +1337,15 @@ def main():
|
||||||
# Generate latest apps data for widget
|
# Generate latest apps data for widget
|
||||||
if os.path.exists(os.path.join('stats', 'latestapps.txt')):
|
if os.path.exists(os.path.join('stats', 'latestapps.txt')):
|
||||||
data = ''
|
data = ''
|
||||||
for line in file(os.path.join('stats', 'latestapps.txt')):
|
with open(os.path.join('stats', 'latestapps.txt'), 'r') as f:
|
||||||
appid = line.rstrip()
|
for line in f:
|
||||||
data += appid + "\t"
|
appid = line.rstrip()
|
||||||
app = apps[appid]
|
data += appid + "\t"
|
||||||
data += app.Name + "\t"
|
app = apps[appid]
|
||||||
if app.icon is not None:
|
data += app.Name + "\t"
|
||||||
data += app.icon + "\t"
|
if app.icon is not None:
|
||||||
data += app.License + "\n"
|
data += app.icon + "\t"
|
||||||
|
data += app.License + "\n"
|
||||||
with open(os.path.join(repodirs[0], 'latestapps.dat'), 'w') as f:
|
with open(os.path.join(repodirs[0], 'latestapps.dat'), 'w') as f:
|
||||||
f.write(data)
|
f.write(data)
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ class BuildTest(unittest.TestCase):
|
||||||
break
|
break
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
print 'no build-tools found: ' + build_tools
|
print('no build-tools found: ' + build_tools)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def _find_all(self):
|
def _find_all(self):
|
||||||
|
|
|
@ -37,7 +37,7 @@ class CommonTest(unittest.TestCase):
|
||||||
break
|
break
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
print 'no build-tools found: ' + build_tools
|
print('no build-tools found: ' + build_tools)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def _find_all(self):
|
def _find_all(self):
|
||||||
|
@ -61,7 +61,7 @@ class CommonTest(unittest.TestCase):
|
||||||
if self._set_build_tools():
|
if self._set_build_tools():
|
||||||
self._find_all()
|
self._find_all()
|
||||||
else:
|
else:
|
||||||
print 'no build-tools found: ' + build_tools
|
print('no build-tools found: ' + build_tools)
|
||||||
|
|
||||||
def testIsApkDebuggable(self):
|
def testIsApkDebuggable(self):
|
||||||
config = dict()
|
config = dict()
|
||||||
|
|
|
@ -32,7 +32,7 @@ class InstallTest(unittest.TestCase):
|
||||||
devices = fdroidserver.install.devices()
|
devices = fdroidserver.install.devices()
|
||||||
self.assertIsInstance(devices, list, 'install.devices() did not return a list!')
|
self.assertIsInstance(devices, list, 'install.devices() did not return a list!')
|
||||||
for device in devices:
|
for device in devices:
|
||||||
self.assertIsInstance(device, basestring)
|
self.assertIsInstance(device, str)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
|
@ -59,7 +59,7 @@ class UpdateTest(unittest.TestCase):
|
||||||
self.assertEquals(sig.decode('hex'), pysig.decode('hex'),
|
self.assertEquals(sig.decode('hex'), pysig.decode('hex'),
|
||||||
"the length of the two sigs are different!")
|
"the length of the two sigs are different!")
|
||||||
except TypeError as e:
|
except TypeError as e:
|
||||||
print e
|
print(e)
|
||||||
self.assertTrue(False, 'TypeError!')
|
self.assertTrue(False, 'TypeError!')
|
||||||
|
|
||||||
def testBadGetsig(self):
|
def testBadGetsig(self):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue