diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2016-10-30 19:05:14 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2016-11-01 00:35:16 +0100 |
commit | 817dd7ccbb166b27c93706dffc5c0c0d59fd87f8 (patch) | |
tree | 3fddab3a6a9712c5eda14b262523ff186a90c9e9 /platform | |
parent | d4c17700aa2f36f69978beda04e42ff2749de270 (diff) |
style: Fix PEP8 blank lines issues in Python files
Done with `autopep8 --select=E3,W3`, fixes:
- E301 - Add missing blank line.
- E302 - Add missing 2 blank lines.
- E303 - Remove extra blank lines.
- E304 - Remove blank line following function decorator.
- E309 - Add missing blank line.
- W391 - Remove trailing blank lines.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/android/detect.py | 7 | ||||
-rw-r--r-- | platform/bb10/detect.py | 6 | ||||
-rw-r--r-- | platform/haiku/SCsub | 1 | ||||
-rw-r--r-- | platform/haiku/detect.py | 6 | ||||
-rw-r--r-- | platform/iphone/detect.py | 5 | ||||
-rw-r--r-- | platform/javascript/detect.py | 6 | ||||
-rw-r--r-- | platform/osx/detect.py | 10 | ||||
-rw-r--r-- | platform/server/detect.py | 7 | ||||
-rw-r--r-- | platform/windows/detect.py | 17 | ||||
-rw-r--r-- | platform/winrt/detect.py | 6 | ||||
-rw-r--r-- | platform/x11/detect.py | 10 |
11 files changed, 47 insertions, 34 deletions
diff --git a/platform/android/detect.py b/platform/android/detect.py index f1331d24d5..5de4f11445 100644 --- a/platform/android/detect.py +++ b/platform/android/detect.py @@ -3,12 +3,15 @@ import sys import string import platform + def is_active(): return True + def get_name(): return "Android" + def can_build(): import os @@ -17,6 +20,7 @@ def can_build(): return True + def get_opts(): return [ @@ -47,6 +51,7 @@ def create(env): env.Tool('gcc') return env.Clone(tools=tools); + def configure(env): # Workaround for MinGW. See: @@ -102,7 +107,6 @@ def configure(env): env.Tool('gcc') env['SHLIBSUFFIX'] = '.so' - neon_text = "" if env["android_arch"] == "armv7" and env['android_neon'] == 'yes': neon_text = " (with neon)" @@ -241,7 +245,6 @@ def configure(env): env.Append(LIBS=['gnustl_static']) env.Append(CCFLAGS=["-fno-exceptions", '-DNO_SAFE_CAST']) - import methods env.Append(BUILDERS={'GLSL120': env.Builder(action=methods.build_legacygl_headers, suffix='glsl.h', src_suffix='.glsl')}) env.Append(BUILDERS={'GLSL': env.Builder(action=methods.build_glsl_headers, suffix='glsl.h', src_suffix='.glsl')}) diff --git a/platform/bb10/detect.py b/platform/bb10/detect.py index ed320bebc1..95720794b2 100644 --- a/platform/bb10/detect.py +++ b/platform/bb10/detect.py @@ -7,9 +7,11 @@ import methods def is_active(): return True + def get_name(): return "BlackBerry 10" + def can_build(): import os @@ -17,6 +19,7 @@ def can_build(): return False return True + def get_opts(): return [ @@ -29,6 +32,7 @@ def get_opts(): ('bb10_exceptions', 'Use exceptions when compiling on bb10', 'no'), ] + def get_flags(): return [ @@ -37,6 +41,7 @@ def get_flags(): ('module_theora_enabled', 'no'), ] + def configure(env): if env['PLATFORM'] == 'win32': @@ -86,4 +91,3 @@ def configure(env): env.Append(LINKFLAGS=['-g']) env.Append(LIBS=['bps', 'pps', 'screen', 'socket', 'EGL', 'GLESv2', 'GLESv1_CM', 'm', 'asound']) - diff --git a/platform/haiku/SCsub b/platform/haiku/SCsub index 23e5e2e711..d0c244a194 100644 --- a/platform/haiku/SCsub +++ b/platform/haiku/SCsub @@ -20,6 +20,7 @@ target = env.Program( command = env.Command('#bin/godot.rsrc', '#platform/haiku/godot.rdef', ['rc -o $TARGET $SOURCE']) + def addResourcesAction(target=None, source=None, env=None): return env.Execute('xres -o ' + File(target)[0].path + ' bin/godot.rsrc') diff --git a/platform/haiku/detect.py b/platform/haiku/detect.py index e64be0a188..71202a9a49 100644 --- a/platform/haiku/detect.py +++ b/platform/haiku/detect.py @@ -1,12 +1,15 @@ import os import sys + def is_active(): return True + def get_name(): return "Haiku" + def can_build(): if (os.name != "posix"): return False @@ -16,15 +19,18 @@ def can_build(): return True + def get_opts(): return [ ('debug_release', 'Add debug symbols to release version', 'no') ] + def get_flags(): return [ ] + def configure(env): is64 = sys.maxsize > 2**32 diff --git a/platform/iphone/detect.py b/platform/iphone/detect.py index 541487d586..229038697c 100644 --- a/platform/iphone/detect.py +++ b/platform/iphone/detect.py @@ -5,9 +5,11 @@ import sys def is_active(): return True + def get_name(): return "iOS" + def can_build(): import sys @@ -17,6 +19,7 @@ def can_build(): return False + def get_opts(): return [ @@ -33,6 +36,7 @@ def get_opts(): ('ios_sim', 'Build simulator binary', 'no'), ] + def get_flags(): return [ @@ -43,7 +47,6 @@ def get_flags(): ] - def configure(env): env.Append(CPPPATH=['#platform/iphone']) diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py index 56b41a49ac..04a6bc9cc3 100644 --- a/platform/javascript/detect.py +++ b/platform/javascript/detect.py @@ -2,12 +2,15 @@ import os import sys import string + def is_active(): return True + def get_name(): return "JavaScript" + def can_build(): import os @@ -15,6 +18,7 @@ def can_build(): return False return True + def get_opts(): return [ @@ -22,6 +26,7 @@ def get_opts(): ['javascript_eval', 'Enable JavaScript eval interface', 'yes'], ] + def get_flags(): return [ @@ -33,7 +38,6 @@ def get_flags(): ] - def configure(env): env['ENV'] = os.environ; env.use_windows_spawn_fix('javascript') diff --git a/platform/osx/detect.py b/platform/osx/detect.py index ddb27742a0..9191f1aabc 100644 --- a/platform/osx/detect.py +++ b/platform/osx/detect.py @@ -6,17 +6,19 @@ import sys def is_active(): return True + def get_name(): return "OSX" + def can_build(): if (sys.platform == "darwin" or os.environ.has_key("OSXCROSS_ROOT")): return True - return False + def get_opts(): return [ @@ -25,13 +27,13 @@ def get_opts(): ] + def get_flags(): return [ ] - def configure(env): env.Append(CPPPATH=['#platform/osx']) @@ -51,8 +53,6 @@ def configure(env): env.Append(CCFLAGS=['-g3', '-Wall', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED']) - - if (not os.environ.has_key("OSXCROSS_ROOT")): # regular native build if (env["bits"] == "64"): @@ -72,14 +72,12 @@ def configure(env): else: basecmd = root + "/target/bin/i386-apple-" + env["osxcross_sdk"] + "-" - env['CC'] = basecmd + "cc" env['CXX'] = basecmd + "c++" env['AR'] = basecmd + "ar" env['RANLIB'] = basecmd + "ranlib" env['AS'] = basecmd + "as" - env.Append(CPPFLAGS=["-DAPPLE_STYLE_KEYS"]) env.Append(CPPFLAGS=['-DUNIX_ENABLED', '-DGLES2_ENABLED', '-DOSX_ENABLED']) env.Append(LIBS=['pthread']) diff --git a/platform/server/detect.py b/platform/server/detect.py index 9d23ceda70..b367e1f2c3 100644 --- a/platform/server/detect.py +++ b/platform/server/detect.py @@ -6,6 +6,7 @@ import sys def is_active(): return True + def get_name(): return "Server" @@ -17,6 +18,7 @@ def can_build(): return True # enabled + def get_opts(): return [ @@ -24,13 +26,13 @@ def get_opts(): ('force_32_bits', 'Force 32 bits binary', 'no') ] + def get_flags(): return [ ] - def configure(env): env.Append(CPPPATH=['#platform/server']) @@ -47,13 +49,11 @@ def configure(env): else: env["bits"] = "32" - # if (env["tools"]=="no"): # #no tools suffix # env['OBJSUFFIX'] = ".nt"+env['OBJSUFFIX'] # env['LIBSUFFIX'] = ".nt"+env['LIBSUFFIX'] - if (env["target"] == "release"): env.Append(CCFLAGS=['-O2', '-ffast-math', '-fomit-frame-pointer']) @@ -73,4 +73,3 @@ def configure(env): env.Append(CPPFLAGS=['-DTYPED_METHOD_BIND']) env["CC"] = "clang" env["LD"] = "clang++" - diff --git a/platform/windows/detect.py b/platform/windows/detect.py index 4bb6dc4a96..93d29a3606 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -99,12 +99,15 @@ import sys import methods + def is_active(): return True + def get_name(): return "Windows" + def can_build(): if (os.name == "nt"): @@ -148,6 +151,7 @@ def can_build(): return False + def get_opts(): mingw = "" @@ -167,12 +171,12 @@ def get_opts(): if (os.getenv("MINGW64_PREFIX")): mingw64 = os.getenv("MINGW64_PREFIX") - return [ ('mingw_prefix', 'Mingw Prefix', mingw32), ('mingw_prefix_64', 'Mingw Prefix 64 bits', mingw64), ] + def get_flags(): return [ @@ -180,6 +184,7 @@ def get_flags(): ('openssl', 'builtin'), # use builtin openssl ] + def build_res_file(target, source, env): cmdbase = "" @@ -200,6 +205,7 @@ def build_res_file(target, source, env): return 1 return 0 + def configure(env): env.Append(CPPPATH=['#platform/windows']) @@ -210,7 +216,6 @@ def configure(env): env.Append(CPPPATH=['#platform/windows/include']) env.Append(LIBPATH=['#platform/windows/lib']) - if (env["target"] == "release"): env.Append(CCFLAGS=['/O2']) @@ -234,7 +239,6 @@ def configure(env): env.Append(LINKFLAGS=['/SUBSYSTEM:CONSOLE']) env.Append(LINKFLAGS=['/DEBUG']) - env.Append(CCFLAGS=['/MT', '/Gd', '/GR', '/nologo']) env.Append(CXXFLAGS=['/TP']) env.Append(CPPFLAGS=['/DMSVC', '/GR', ]) @@ -331,8 +335,6 @@ def configure(env): else: nulstr = ">nul" - - # if os.system(mingw_prefix+"gcc --version"+nulstr)!=0: # #not really super consistent but.. # print("Can't find Windows compiler: "+mingw_prefix) @@ -357,8 +359,6 @@ def configure(env): env.Append(CCFLAGS=['-g', '-Wall', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED']) - - env["CC"] = mingw_prefix + "gcc" env['AS'] = mingw_prefix + "as" env['CXX'] = mingw_prefix + "g++" @@ -381,9 +381,6 @@ def configure(env): # env.Append(CPPFLAGS=['-march=i686']) # env.Append(LINKFLAGS=['-march=i686']) - - - #'d3dx9d' env.Append(CPPFLAGS=['-DMINGW_ENABLED']) # env.Append(LINKFLAGS=['-g']) diff --git a/platform/winrt/detect.py b/platform/winrt/detect.py index 19a6324e1e..15ac429687 100644 --- a/platform/winrt/detect.py +++ b/platform/winrt/detect.py @@ -8,9 +8,11 @@ import methods def is_active(): return True + def get_name(): return "WinRT" + def can_build(): if (os.name == "nt"): # building natively on windows! @@ -22,9 +24,11 @@ def can_build(): return True return False + def get_opts(): return [] + def get_flags(): return [ @@ -129,12 +133,10 @@ def configure(env): env.Append(LINKFLAGS=['/SUBSYSTEM:CONSOLE']) env.Append(LINKFLAGS=['/DEBUG']) - env.Append(CCFLAGS=string.split('/FS /MP /GS /wd"4453" /wd"28204" /wd"4291" /Zc:wchar_t /Gm- /fp:precise /D "_UNICODE" /D "UNICODE" /D "WINAPI_FAMILY=WINAPI_FAMILY_APP" /errorReport:prompt /WX- /Zc:forScope /Gd /EHsc /nologo')) env.Append(CXXFLAGS=string.split('/ZW /FS')) env.Append(CCFLAGS=['/AI', os.environ['VCINSTALLDIR'] + '\\vcpackages', '/AI', os.environ['WINDOWSSDKDIR'] + '\\References\\CommonConfiguration\\Neutral']) - env["PROGSUFFIX"] = "." + arch + env["PROGSUFFIX"] env["OBJSUFFIX"] = "." + arch + env["OBJSUFFIX"] env["LIBSUFFIX"] = "." + arch + env["LIBSUFFIX"] diff --git a/platform/x11/detect.py b/platform/x11/detect.py index 37c787179f..935a9fcc26 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -7,6 +7,7 @@ import platform def is_active(): return True + def get_name(): return "X11" @@ -50,9 +51,9 @@ def can_build(): print("xrandr not found.. x11 disabled.") return False - return True # X11 enabled + def get_opts(): return [ @@ -65,6 +66,7 @@ def get_opts(): ('debug_release', 'Add debug symbols to release version', 'no'), ] + def get_flags(): return [ @@ -74,7 +76,6 @@ def get_flags(): ] - def configure(env): is64 = sys.maxsize > 2**32 @@ -104,13 +105,11 @@ def configure(env): env.Append(LINKFLAGS=['-fsanitize=address']) env.extra_suffix += "s" - # if (env["tools"]=="no"): # #no tools suffix # env['OBJSUFFIX'] = ".nt"+env['OBJSUFFIX'] # env['LIBSUFFIX'] = ".nt"+env['LIBSUFFIX'] - if (env["target"] == "release"): if (env["debug_release"] == "yes"): @@ -174,7 +173,6 @@ def configure(env): if (env["libogg"] == "system"): env.ParseConfig('pkg-config ogg --cflags --libs') - env.Append(CPPFLAGS=['-DOPENGL_ENABLED']) if (env["glew"] == "system"): @@ -223,7 +221,6 @@ def configure(env): env.Append(CPPFLAGS=['-m64']) env.Append(LINKFLAGS=['-m64', '-L/usr/lib/i686-linux-gnu']) - import methods env.Append(BUILDERS={'GLSL120': env.Builder(action=methods.build_legacygl_headers, suffix='glsl.h', src_suffix='.glsl')}) @@ -237,4 +234,3 @@ def configure(env): list_of_x86 = ['x86_64', 'x86', 'i386', 'i586'] if any(platform.machine() in s for s in list_of_x86): env["x86_libtheora_opt_gcc"] = True - |