mirror of
				https://github.com/f-droid/fdroidserver.git
				synced 2025-11-04 06:30:27 +03:00 
			
		
		
		
	all: make newer pycodestyle happy
Apparently the "two empty lines" rule is now stricter.
This commit is contained in:
		
							parent
							
								
									8ee13a47e4
								
							
						
					
					
						commit
						82b1d7ad14
					
				
					 18 changed files with 29 additions and 0 deletions
				
			
		
							
								
								
									
										1
									
								
								fdroid
									
										
									
									
									
								
							
							
						
						
									
										1
									
								
								fdroid
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -143,5 +143,6 @@ def main():
 | 
			
		|||
        raise
 | 
			
		||||
    sys.exit(0)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
if __name__ == "__main__":
 | 
			
		||||
    main()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -995,6 +995,7 @@ def parse_commandline():
 | 
			
		|||
 | 
			
		||||
    return options, parser
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
options = None
 | 
			
		||||
config = None
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1191,5 +1192,6 @@ def main():
 | 
			
		|||
 | 
			
		||||
    sys.exit(0)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
if __name__ == "__main__":
 | 
			
		||||
    main()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -574,5 +574,6 @@ def main():
 | 
			
		|||
 | 
			
		||||
    logging.info("Finished.")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
if __name__ == "__main__":
 | 
			
		||||
    main()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1273,6 +1273,7 @@ def getsrclib(spec, srclib_dir, subdir=None, basepath=False,
 | 
			
		|||
 | 
			
		||||
    return (name, number, libdir)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
gradle_version_regex = re.compile(r"[^/]*'com\.android\.tools\.build:gradle:([^\.]+\.[^\.]+).*'.*")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1879,6 +1880,7 @@ def place_srclib(root_dir, number, libpath):
 | 
			
		|||
        if not placed:
 | 
			
		||||
            o.write('android.library.reference.%d=%s\n' % (number, relpath))
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
apk_sigfile = re.compile(r'META-INF/[0-9A-Za-z]+\.(SF|RSA|DSA|EC)')
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1913,6 +1915,7 @@ def verify_apks(signed_apk, unsigned_apk, tmp_dir):
 | 
			
		|||
    logging.info("...successfully verified")
 | 
			
		||||
    return None
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
apk_badchars = re.compile('''[/ :;'"]''')
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -67,6 +67,7 @@ def getrepofrompage(url):
 | 
			
		|||
 | 
			
		||||
    return (None, "No information found." + page)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
config = None
 | 
			
		||||
options = None
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -114,5 +114,6 @@ def main():
 | 
			
		|||
 | 
			
		||||
    logging.info("\nFinished")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
if __name__ == "__main__":
 | 
			
		||||
    main()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -33,6 +33,7 @@ def enforce_https(domain):
 | 
			
		|||
    return (re.compile(r'.*[^sS]://[^/]*' + re.escape(domain) + r'(/.*)?'),
 | 
			
		||||
            domain + " URLs should always use https://")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
https_enforcings = [
 | 
			
		||||
    enforce_https('github.com'),
 | 
			
		||||
    enforce_https('gitlab.com'),
 | 
			
		||||
| 
						 | 
				
			
			@ -47,6 +48,7 @@ def forbid_shortener(domain):
 | 
			
		|||
    return (re.compile(r'https?://[^/]*' + re.escape(domain) + r'/.*'),
 | 
			
		||||
            "URL shorteners should not be used")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
http_url_shorteners = [
 | 
			
		||||
    forbid_shortener('goo.gl'),
 | 
			
		||||
    forbid_shortener('t.co'),
 | 
			
		||||
| 
						 | 
				
			
			@ -191,6 +193,7 @@ def check_useless_fields(app):
 | 
			
		|||
    if app.UpdateCheckName == app.id:
 | 
			
		||||
        yield "Update Check Name is set to the known app id - it can be removed"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
filling_ucms = re.compile(r'^(Tags.*|RepoManifest.*)')
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -204,6 +207,7 @@ def check_empty_fields(app):
 | 
			
		|||
    if not app.Categories:
 | 
			
		||||
        yield "Categories are not set"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
all_categories = set([
 | 
			
		||||
    "Connectivity",
 | 
			
		||||
    "Development",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -218,6 +218,7 @@ class App():
 | 
			
		|||
            else:
 | 
			
		||||
                self.set_field(f, v)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
TYPE_UNKNOWN = 0
 | 
			
		||||
TYPE_OBSOLETE = 1
 | 
			
		||||
TYPE_STRING = 2
 | 
			
		||||
| 
						 | 
				
			
			@ -370,6 +371,7 @@ class Build():
 | 
			
		|||
        for f, v in d.items():
 | 
			
		||||
            self.set_flag(f, v)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
flagtypes = {
 | 
			
		||||
    'extlibs': TYPE_LIST,
 | 
			
		||||
    'srclibs': TYPE_LIST,
 | 
			
		||||
| 
						 | 
				
			
			@ -429,6 +431,7 @@ class FieldValidator():
 | 
			
		|||
                warn_or_exception("'%s' is not a valid %s in %s. Regex pattern: %s"
 | 
			
		||||
                                  % (v, self.name, appid, self.matching))
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Generic value types
 | 
			
		||||
valuetypes = {
 | 
			
		||||
    FieldValidator("Integer",
 | 
			
		||||
| 
						 | 
				
			
			@ -819,6 +822,7 @@ def read_metadata(xref=True):
 | 
			
		|||
 | 
			
		||||
    return apps
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Port legacy ';' separators
 | 
			
		||||
list_sep = re.compile(r'[,;]')
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -34,5 +34,6 @@ def main():
 | 
			
		|||
 | 
			
		||||
    metadata.read_metadata(xref=True)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
if __name__ == "__main__":
 | 
			
		||||
    main()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -93,5 +93,6 @@ def main():
 | 
			
		|||
 | 
			
		||||
    logging.debug("Finished.")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
if __name__ == "__main__":
 | 
			
		||||
    main()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -325,5 +325,6 @@ def main():
 | 
			
		|||
    logging.info("Finished:")
 | 
			
		||||
    print("%d problems found" % probcount)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
if __name__ == "__main__":
 | 
			
		||||
    main()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -318,5 +318,6 @@ def main():
 | 
			
		|||
 | 
			
		||||
    sys.exit(0)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
if __name__ == "__main__":
 | 
			
		||||
    main()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -75,5 +75,6 @@ def main():
 | 
			
		|||
    if signed == 0:
 | 
			
		||||
        logging.info("Nothing to do")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
if __name__ == "__main__":
 | 
			
		||||
    main()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -41,6 +41,7 @@ def carbon_send(key, value):
 | 
			
		|||
    s.sendall(msg)
 | 
			
		||||
    s.close()
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
options = None
 | 
			
		||||
config = None
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -299,5 +300,6 @@ def main():
 | 
			
		|||
 | 
			
		||||
    logging.info("Finished.")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
if __name__ == "__main__":
 | 
			
		||||
    main()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1626,5 +1626,6 @@ def main():
 | 
			
		|||
 | 
			
		||||
    logging.info("Finished.")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
if __name__ == "__main__":
 | 
			
		||||
    main()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -96,5 +96,6 @@ def main():
 | 
			
		|||
    logging.info("{0} successfully verified".format(verified))
 | 
			
		||||
    logging.info("{0} NOT verified".format(notverified))
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
if __name__ == "__main__":
 | 
			
		||||
    main()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -44,6 +44,7 @@ def vagrant(params, cwd=None, printout=False):
 | 
			
		|||
        out = p.communicate()[0]
 | 
			
		||||
    return (p.returncode, out)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
boxfile = 'buildserver.box'
 | 
			
		||||
serverdir = 'buildserver'
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -303,6 +304,7 @@ def sha256_for_file(path):
 | 
			
		|||
            s.update(data)
 | 
			
		||||
        return s.hexdigest()
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
for srcurl, shasum in cachefiles:
 | 
			
		||||
    filename = os.path.basename(srcurl)
 | 
			
		||||
    local_filename = os.path.join(cachedir, filename)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -157,6 +157,7 @@ class CommonTest(unittest.TestCase):
 | 
			
		|||
        p = fdroidserver.common.FDroidPopen(commands, stderr_to_stdout=False)
 | 
			
		||||
        self.assertEqual(p.output, 'stdout message\n')
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
if __name__ == "__main__":
 | 
			
		||||
    parser = optparse.OptionParser()
 | 
			
		||||
    parser.add_option("-v", "--verbose", action="store_true", default=False,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue