Skip to content

Commit

Permalink
whitespace cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Sep 10, 2022
1 parent 21dca79 commit 939d805
Show file tree
Hide file tree
Showing 30 changed files with 54 additions and 56 deletions.
2 changes: 1 addition & 1 deletion docs/Build/Debian.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ apt-get install libx11-dev libxtst-dev libxcomposite-dev libxdamage-dev libxres-
```
GTK3 for the server and GUI client:
```shell
apt-get install libgtk-3-dev python3-dev python3-cairo-dev python-gi-dev cython3
apt-get install libgtk-3-dev python3-dev python3-cairo-dev python-gi-dev cython3
```
Also install some X11 utilities if not installed already:
```shell
Expand Down
2 changes: 1 addition & 1 deletion docs/Build/RPM.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ You may also refer to the more generic list of [dependencies](./Dependencies.md)
## Extra dependencies
<details>
<summary>Vfb command</summary>

To use [Xdummy](../Usage/Xdummy.md):
```shell
dnf install xorg-x11-server-Xorg xorg-x11-drv-dummy xorg-x11-xauth xorg-x11-xkb-utils
Expand Down
2 changes: 1 addition & 1 deletion docs/Network/AES.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ xpra attach "tcp://localhost:10000/?encryption=AES&keyfile=./key.txt"

## Modes
Starting with version 4.3, the client can specify the exact AES encryption mode to use: `encryption=AES-GCM`.

## Older syntax
Prior to version 4.1, the encryption is configured globally, for all TCP sockets, using the following syntax:
```
Expand Down
4 changes: 2 additions & 2 deletions docs/Usage/Authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Some of these modules require extra [dependencies](../Build/Dependencies.md).
Here is the full list:
<details>
<summary>list of modules</summary>

|Module|Result|Purpose|
|------|------|-------|
|[allow](../../xpra/server/auth/allow_auth.py)|always allows the user to login, the username used is the one supplied by the client|dangerous / only for testing|
Expand Down Expand Up @@ -100,7 +100,7 @@ The username can be specified:
* in the client connection string
<details>
<summary>tcp example</summary>

```shell
xpra attach tcp://username:password@host:port/
```
Expand Down
4 changes: 2 additions & 2 deletions docs/Usage/Client-OpenGL.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ For more details, run `xpra opengl`. On MS Windows, there is an `OpenGL_check.ex

Because it doesn't work very well.
See:
* [#1367 enable more opengl chipsets](https://github.com/Xpra-org/xpra/issues/1367)
* [#1367 enable more opengl chipsets](https://github.com/Xpra-org/xpra/issues/1367)
* [#1233 whitelist some more intel chipsets](https://github.com/Xpra-org/xpra/issues/1233)
* [#1364 painting random window as solid white upon connection](https://github.com/Xpra-org/xpra/issues/1364)
* window resizing problems: [#1469](https://github.com/Xpra-org/xpra/issues/1469) / [#1468](../issues/1468) -
* window resizing problems: [#1469](https://github.com/Xpra-org/xpra/issues/1469) / [#1468](../issues/1468)
* [#1050 fullscreen crash on win32](https://github.com/Xpra-org/xpra/issues/1050)
* [#1024 `glTexParameteri` error](https://github.com/Xpra-org/xpra/issues/1024)
* [#968 rendering dimensions](https://github.com/Xpra-org/xpra/issues/968)
Expand Down
2 changes: 1 addition & 1 deletion docs/Usage/Encodings.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ These modules are used for:
* converting the pixel data received by the xpra server into a pixel format that can be consumed by the video encoders
* converting the pixel data from the video decoders into a pixel format that can be used to paint the client's window (different windows may have different capabilities)
* up / down scaling the pixel data when needed

|Codename |Colorspaces supported|Notes|
|---------|---------------------|-----|
|`cython` |`r210`, `BGR48`, `GBRP10`, `YUV444P10`|slow but useful for some high bit depth modes|
Expand Down
2 changes: 1 addition & 1 deletion docs/Usage/NVENC.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ libdir=/usr/lib64/nvidia
Name: nvenc
Description: NVENC
Version: 10
Requires:
Requires:
Conflicts:
Libs: -L${libdir} -lnvidia-encode
Cflags: -I${includedir}
Expand Down
2 changes: 1 addition & 1 deletion docs/Usage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ xpra shadow --clipboard=yes --printing=no --windows=no --speaker=no ssh://SERVER

## [Printer](../Features/Printing.md) forwarder
```shell
xpra shadow --printing=yes --windows=no --speaker=no ssh://SERVERHOST/
xpra shadow --printing=yes --windows=no --speaker=no ssh://SERVERHOST/
```
The local printers should be virtualized on the server.

Expand Down
2 changes: 1 addition & 1 deletion docs/Usage/Security.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Debugging tools and diagnostics can sometimes be at odds with good security prac
The extensive [debug logging](./Logging.md) capabilities normally obfuscate sensitive information like passwords and keys,
but it may still be possible to glean enough data to be present a real risk. A good preventative measure is to disable remote logging and turn off the server's control channel (#3573).
The xpra shell is a very powerful debugging feature which allows full access to all the data structures held in the client and server. It is disabled by default.

### Malicious clients and servers
Servers should be using authentication, so tipically this means that malicious clients have had their authentication credentials compromised or perhaps the whole clients is compromised.
Clients should be using SSL certificates or SSH host keys to verify the identity of a server. A malicious server would be one that has been compromised or which is running a compromised application (ie: a browser).
Expand Down
2 changes: 1 addition & 1 deletion docs/Usage/WSL.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ You will need to adapt it to your hardware.
- Open Administrator CMD prompt
- `wsl --install -d Ubuntu-20.04`
- Restart Windows, WSL 2 setup continues automatically after restart.
- `sudo apt update; sudo apt upgrade`
- `sudo apt update; sudo apt upgrade`
- Shutdown WSL 2 with `wsl --shutdown`
- Start WSL 2 again with `bash`
- `sudo apt install gedit mesa-utils`
Expand Down
2 changes: 1 addition & 1 deletion docs/Usage/Xdummy.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The downside of using `Xdummy` is its incomplete `RandR` support: the resolution
## Usage
<details>
<summary>Xdummy standlone</summary>

You can start a new display using the dummy driver without needing any special privileges (no root, no suid), you should specify your own log and config files:
```shell
Xorg -noreset +extension GLX +extension RANDR +extension RENDER \
Expand Down
2 changes: 1 addition & 1 deletion fs/lib/pkgconfig/nvenc.pc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ libdir=/usr/lib64/nvidia
Name: nvenc
Description: NVENC
Version: 10
Requires:
Requires:
Conflicts:
Libs: -L${libdir} -lnvidia-encode
Cflags: -I${includedir}
2 changes: 1 addition & 1 deletion fs/lib/pkgconfig/nvfbc.pc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ libdir=/usr/lib64
Name: nvfbc
Description: NVFBC
Version: 6.0
Requires:
Requires:
Conflicts:
Libs: -L${libdir}
Cflags: -I${includedir} -lnvidia-fbc
2 changes: 1 addition & 1 deletion fs/share/xpra/cuda/BGRA_to_RGBAP.cu
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
extern "C" __global__ void BGRA_to_RGBAP(int src_w, int src_h,
int srcPitch, uint8_t *srcImage,
int dst_w, int dst_h,
int dstPitch,
int dstPitch,
uint8_t *R, uint8_t *G, uint8_t *B, uint8_t *A)
{
const uint32_t gx = blockIdx.x * blockDim.x + threadIdx.x;
Expand Down
2 changes: 1 addition & 1 deletion fs/share/xpra/cuda/RGBA_to_RGBAP.cu
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
extern "C" __global__ void RGBA_to_RGBAP(int src_w, int src_h,
int srcPitch, uint8_t *srcImage,
int dst_w, int dst_h,
int dstPitch,
int dstPitch,
uint8_t *R, uint8_t *G, uint8_t *B, uint8_t *A)
{
const uint32_t gx = blockIdx.x * blockDim.x + threadIdx.x;
Expand Down
4 changes: 2 additions & 2 deletions packaging/MSWindows/pkgconfig/nvfbc.pc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ sdk_path=E:/NVIDIA-Capture-SDK
Name: nvfbc
Description: NVFBC
Version: 6.0
Requires:
Requires:
Conflicts:
Libs.private:
Libs.private:
Cflags: -I${sdk_path}/inc/ -Wno-endif-labels -Wno-endif-labels -Wno-error=address
2 changes: 1 addition & 1 deletion packaging/MSWindows/xpra.iss
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Name: "{commonappdata}\SSH"; Permissions: users-readexec admins-full; Attribs: n

[Files]
Source: dist\*; Excludes: "etc\xpra"; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs;
Source: dist\etc\xpra\*; DestDir: "{commonappdata}\Xpra"; Flags: recursesubdirs createallsubdirs uninsneveruninstall;
Source: dist\etc\xpra\*; DestDir: "{commonappdata}\Xpra"; Flags: recursesubdirs createallsubdirs uninsneveruninstall;

[InstallDelete]
Type: filesandordirs; Name: "{app}\lib\*.py*"
Expand Down
2 changes: 1 addition & 1 deletion packaging/MacOS/make-app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if [ "${CLIENT_ONLY}" == "1" ]; then
DO_TESTS="0"
else
if [ ! -e "${JHBUILD_PREFIX}/share/xpra/www/" ]; then
echo "the xpra html5 client must be installed in ${JHBUILD_PREFIX}/share/xpra/www/"
echo "the xpra html5 client must be installed in ${JHBUILD_PREFIX}/share/xpra/www/"
exit 1
fi
fi
Expand Down
2 changes: 1 addition & 1 deletion tests/xpra/codecs/benchmark_picture_encoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def main(fmt="png", files=()):
encoding, enc.get_type(), w*h*N/(end-start)/1024/1024, size*N/1024, ratio))
#verify that the png data is valid using pillow:
if encoding not in ("rgb24", "rgb32", "avif"):
from io import BytesIO
from io import BytesIO
buf = BytesIO(cdata.data)
img = Image.open(buf)
#img.show()
Expand Down
2 changes: 1 addition & 1 deletion xpra/codecs/avif/decoder.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def decompress(data, options=None, yuv=False):
data_buf = <const uint8_t*> (<uintptr_t> int(bc))
r = avifDecoderSetIOMemory(decoder, data_buf, data_len)
check(r, "Cannot set IO on avifDecoder")

r = avifDecoderParse(decoder)
check(r, "Failed to decode image")

Expand Down
6 changes: 3 additions & 3 deletions xpra/codecs/avif/encoder.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def encode(coding, image, options=None):
r = avifImageRGBToYUV(avif_image, &rgb)
log("avifImageRGBToYUV()=%i for %s", r, AVIF_PIXEL_FORMAT.get(avif_image.yuvFormat))
check(r, "Failed to convert to YUV(A)")

encoder = avifEncoderCreate()
log("avifEncoderCreate()=%#x", <uintptr_t> encoder)
if encoder==NULL:
Expand All @@ -171,11 +171,11 @@ def encode(coding, image, options=None):
r = avifEncoderAddImage(encoder, avif_image, 1, AVIF_ADD_IMAGE_FLAG_SINGLE)
log("avifEncoderAddImage()=%i", r)
check(r, "Failed to add image to encoder")

r = avifEncoderFinish(encoder, &avifOutput)
log("avifEncoderFinish()=%i", r)
check(r, "Failed to finish encode")

cdata = avifOutput.data[:avifOutput.size]
log("avif: got %i bytes", avifOutput.size)
may_save_image("avif", cdata)
Expand Down
12 changes: 5 additions & 7 deletions xpra/codecs/evdi/capture.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -233,15 +233,15 @@ cdef class EvdiDevice:
self.dpms_mode = dpms_mode
self.unregister_buffers()
self.may_start()

def may_start(self):
if self.dpms_mode==DRM_MODE_DPMS_ON and self.mode.width>0 and self.mode.height>0:
buf_id = 1
if not self.buffers:
self.register_buffer(buf_id)
if self.request_update(buf_id):
self.update_ready_handler(buf_id)

cdef void mode_changed_handler(self, evdi_mode mode):
log.info("mode_changed_handler(%ix%i-%i@%i)", mode.width, mode.height, mode.bits_per_pixel, mode.refresh_rate)
memcpy(&self.mode, &mode, sizeof(evdi_mode))
Expand Down Expand Up @@ -273,20 +273,18 @@ cdef class EvdiDevice:
if w>0 and h>0:
sub = pil_image.crop((rects[i].x1, rects[i].y1, rects[i].x2, rects[i].y2))
sub.save("%s-%i.png" % (monotonic(), i), "PNG")


#TODO: save areas to test png files


cdef void crtc_state_handler(self, int state):
log.info("crtc_state_handler(%i)", state)

cdef void cursor_set_handler(self, evdi_cursor_set cursor_set):
log.info("cursor_set_handler(%ix%i)", cursor_set.width, cursor_set.height)

cdef void cursor_move_handler(self, evdi_cursor_move cursor_move):
log.info("cursor_move_handler(%ix%i)", cursor_move.x, cursor_move.y)

cdef void ddcci_data_handler(self, evdi_ddcci_data ddcci_data):
log.info("ddcci_data_handler(%#x)", ddcci_data.address)

Expand Down
2 changes: 1 addition & 1 deletion xpra/codecs/spng/decoder.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ log = Logger("decoder", "spng")

from xpra.codecs.spng.spng cimport (
SPNG_VERSION_MAJOR, SPNG_VERSION_MINOR, SPNG_VERSION_PATCH,
SPNG_CTX_ENCODER,
SPNG_CTX_ENCODER,
SPNG_DECODE_TRNS,
SPNG_FMT_RGBA8, SPNG_FMT_RGBA16, SPNG_FMT_RGB8,
SPNG_COLOR_TYPE_GRAYSCALE, SPNG_COLOR_TYPE_TRUECOLOR, SPNG_COLOR_TYPE_GRAYSCALE_ALPHA,
Expand Down
2 changes: 1 addition & 1 deletion xpra/codecs/spng/encoder.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ from xpra.net.compression import Compressed
from xpra.codecs.codec_debug import may_save_image
from xpra.codecs.spng.spng cimport (
SPNG_VERSION_MAJOR, SPNG_VERSION_MINOR, SPNG_VERSION_PATCH,
SPNG_CTX_ENCODER,
SPNG_CTX_ENCODER,
SPNG_INTERLACE_NONE,
SPNG_ENCODE_FINALIZE,
SPNG_FILTER_CHOICE, SPNG_FILTER_CHOICE_NONE, SPNG_FILTER_CHOICE_SUB,
Expand Down
2 changes: 1 addition & 1 deletion xpra/net/brotli/decompressor.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ cdef extern from "brotli/decode.h":

# Decompresses the input stream to the output stream
BrotliDecoderResult BrotliDecoderDecompressStream(BrotliDecoderState * state,
size_t * available_in, const uint8_t ** next_in,
size_t * available_in, const uint8_t ** next_in,
size_t * available_out, uint8_t ** next_out,
size_t * total_out) nogil

Expand Down
32 changes: 16 additions & 16 deletions xpra/net/libproxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
###############################################################################
# libproxy - A library for proxy configuration
# Copyright (C) 2006 Nathaniel McCallum <[email protected]>
#
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Expand Down Expand Up @@ -45,7 +45,7 @@ def _load(name, *versions):
class ProxyFactory(object):
"""A ProxyFactory object is used to provide potential proxies to use
in order to reach a given URL (via 'getProxies(url)').
This instance should be kept around as long as possible as it contains
cached data to increase performance. Memory usage should be minimal (cache
is small) and the cache lifespan is handled automatically.
Expand All @@ -61,9 +61,9 @@ class ProxyFactory(object):
# Fetch URL using an HTTP proxy
elif proxy.startswith("socks://"):
# Fetch URL using a SOCKS proxy
if fetchSucceeded:
break
break
"""

class ProxyResolutionError(RuntimeError):
Expand All @@ -73,31 +73,31 @@ class ProxyResolutionError(RuntimeError):

def __init__(self):
self._pf = _libproxy.px_proxy_factory_new()

def getProxies(self, url):
"""Given a URL, returns a list of proxies in priority order to be used
to reach that URL.
A list of proxy strings is returned. If the first proxy fails, the
A list of proxy strings is returned. If the first proxy fails, the
second should be tried, etc... In all cases, at least one entry in the
list will be returned. There are no error conditions.
Regarding performance: this method always blocks and may be called
in a separate thread (is thread-safe). In most cases, the time
required to complete this function call is simply the time required
to read the configuration (e.g from GConf, Kconfig, etc).
to read the configuration (e.g from GConf, Kconfig, etc).
In the case of PAC, if no valid PAC is found in the cache (i.e.
configuration has changed, cache is invalid, etc), the PAC file is
configuration has changed, cache is invalid, etc), the PAC file is
downloaded and inserted into the cache. This is the most expensive
operation as the PAC is retrieved over the network. Once a PAC exists
in the cache, it is merely a JavaScript invocation to evaluate the PAC.
One should note that DNS can be called from within a PAC during
One should note that DNS can be called from within a PAC during
JavaScript invocation.
In the case of WPAD, WPAD is used to automatically locate a PAC on the
network. Currently, we only use DNS for this, but other methods may
be implemented in the future. Once the PAC is located, normal PAC
be implemented in the future. Once the PAC is located, normal PAC
performance (described above) applies.
"""
Expand All @@ -119,7 +119,7 @@ def getProxies(self, url):

proxies = []
array = _libproxy.px_proxy_factory_get_proxies(self._pf, url_bytes)

if not bool(array):
raise ProxyFactory.ProxyResolutionError(
"Can't resolve proxy for '%s'" % url)
Expand All @@ -136,10 +136,10 @@ def getProxies(self, url):
i += 1

_libproxy.px_proxy_factory_free_proxies(array)

return proxies

def __del__(self):
if _libproxy:
_libproxy.px_proxy_factory_free(self._pf)

2 changes: 1 addition & 1 deletion xpra/net/lz4.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ cdef extern from "Python.h":
cdef extern from "lz4_compat.h":
int LZ4_versionNumber()
int LZ4_MAX_INPUT_SIZE

ctypedef struct LZ4_stream_t:
pass

Expand Down
Loading

0 comments on commit 939d805

Please sign in to comment.