Skip to content

Commit

Permalink
fix more pylint warnings
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@21689 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Feb 18, 2019
1 parent b674b1f commit 3724897
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 9 deletions.
34 changes: 26 additions & 8 deletions src/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,8 @@ def add_tokens(s, extra="extra_link_args", extra_map={"-W" : "extra_compile_args
eifd = ["-Werror"]
if is_Debian() or is_Ubuntu() or is_Raspbian():
#needed on Debian and Ubuntu to avoid this error:
#/usr/include/gtk-2.0/gtk/gtkitemfactory.h:47:1: error: function declaration isn't a prototype [-Werror=strict-prototypes]
#/usr/include/gtk-2.0/gtk/gtkitemfactory.h:47:1:
# error: function declaration isn't a prototype [-Werror=strict-prototypes]
eifd.append("-Wno-error=strict-prototypes")
#the cython version shipped with Xenial emits warnings:
if getUbuntuVersion()<=(16,4):
Expand Down Expand Up @@ -1512,7 +1513,11 @@ def add_service_exe(script, icon, base_name):
try:
shutil.copytree(
module_dir, os.path.join(install, "lib", module_name),
ignore = shutil.ignore_patterns("Tk", "AGL", "EGL", "GLX", "GLX.*", "_GLX.*", "GLE", "GLES1", "GLES2", "GLES3")
ignore = shutil.ignore_patterns(
"Tk", "AGL", "EGL",
"GLX", "GLX.*", "_GLX.*",
"GLE", "GLES1", "GLES2", "GLES3",
)
)
print("copied %s to %s/%s" % (module_dir, install, module_name))
except Exception as e:
Expand Down Expand Up @@ -1544,7 +1549,7 @@ def add_service_exe(script, icon, base_name):
if OPENBSD:
man_path = "man"
add_data_files("%s/man1" % man_path, ["man/xpra.1", "man/xpra_launcher.1"])
add_data_files("share/applications", ["xdg/xpra-shadow.desktop", "xdg/xpra-launcher.desktop", "xdg/xpra-browser.desktop", "xdg/xpra.desktop"])
add_data_files("share/applications", glob.glob("xdg/*.desktop"))
add_data_files("share/mime/packages", ["xdg/application-x-xpraconfig.xml"])
add_data_files("share/icons", ["xdg/xpra.png", "xdg/xpra-mdns.png", "xdg/xpra-shadow.png"])
add_data_files("share/appdata", ["xdg/xpra.appdata.xml"])
Expand Down Expand Up @@ -1675,7 +1680,8 @@ def copytodir(src, dst_dir, dst_name=None, chmod=0o644):

#gentoo does weird things, calls --no-compile with build *and* install
#then expects to find the cython modules!? ie:
#> python2.7 setup.py build -b build-2.7 install --no-compile --root=/var/tmp/portage/x11-wm/xpra-0.7.0/temp/images/2.7
#> python2.7 setup.py build -b build-2.7 install --no-compile \
# --root=/var/tmp/portage/x11-wm/xpra-0.7.0/temp/images/2.7
#otherwise we use the flags to skip pkgconfig
if ("--no-compile" in sys.argv or "--skip-build" in sys.argv) and not ("build" in sys.argv and "install" in sys.argv):
pkgconfig = no_pkgconfig
Expand All @@ -1695,7 +1701,7 @@ def cython_add(*args, **kwargs):

try:
from xpra.src_info import REVISION
except:
except ImportError:
REVISION = "unknown"
Plist = {
"CFBundleDocumentTypes" : {
Expand Down Expand Up @@ -1950,7 +1956,7 @@ def osx_pkgconfig(*pkgs_options, **ekw):
if bundle_tests_ENABLED:
#bundle the tests directly (not in library.zip):
for k,v in glob_recurse("unit").items():
if (k!=""):
if k!="":
k = os.sep+k
add_data_files("unit"+k, v)

Expand Down Expand Up @@ -2002,7 +2008,13 @@ def osx_pkgconfig(*pkgs_options, **ekw):
add_modules("xpra.codecs")
toggle_packages(keyboard_ENABLED, "xpra.keyboard")
if client_ENABLED or server_ENABLED:
add_modules("xpra.scripts.config", "xpra.scripts.parsing", "xpra.scripts.exec_util", "xpra.scripts.fdproxy", "xpra.scripts.version")
add_modules(
"xpra.scripts.config",
"xpra.scripts.parsing",
"xpra.scripts.exec_util",
"xpra.scripts.fdproxy",
"xpra.scripts.version",
)
if server_ENABLED or proxy_ENABLED:
add_modules("xpra.scripts.server")
if WIN32 and client_ENABLED and (gtk2_ENABLED or gtk3_ENABLED):
Expand Down Expand Up @@ -2081,7 +2093,13 @@ def osx_pkgconfig(*pkgs_options, **ekw):
if WIN32:
nvcc_exe = "nvcc.exe"
CUDA_DIR = os.environ.get("CUDA_DIR", "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA")
path_options = [os.path.join(CUDA_DIR, x, "bin") for x in ("v9.2", "v9.1", "v9.0", "v8.0", "v7.5")] + path_options
path_options = [os.path.join(CUDA_DIR, x, "bin") for x in (
"v9.2",
"v9.1",
"v9.0",
"v8.0",
"v7.5",
)] + path_options
#pycuda may link against curand, find it and ship it:
for p in path_options:
if os.path.exists(p):
Expand Down
2 changes: 1 addition & 1 deletion src/xpra/client/window_backing_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ def paint_mmap(self, img_data, x, y, width, height, rowstride, options, callback
#Note: BGR(A) is only handled by gl_window_backing
self.do_paint_rgb(rgb_format, data, x, y, width, height, rowstride, options, callbacks)

def paint_scroll(self, *args):
def paint_scroll(self, _img_data, _options, callbacks):
raise NotImplementedError("no paint scroll on %s" % type(self))


Expand Down
2 changes: 2 additions & 0 deletions src/xpra/os_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
WIN32 = sys.platform.startswith("win")
OSX = sys.platform.startswith("darwin")
LINUX = sys.platform.startswith("linux")
NETBSD = sys.platform.startswith("netbsd")
OPENBSD = sys.platform.startswith("openbsd")
FREEBSD = sys.platform.startswith("freebsd")

POSIX = os.name=="posix"
Expand Down

0 comments on commit 3724897

Please sign in to comment.