Skip to content

Commit a03c5fb

Browse files
committed
change build step for virtualenv and pip integration
1 parent 24096b5 commit a03c5fb

File tree

14 files changed

+93
-97
lines changed

14 files changed

+93
-97
lines changed

.travis.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,13 @@ python:
44
- 2.7
55

66
before_install:
7-
- sudo apt-get install python-qt4 python-sip-dev
7+
- sudo apt-get install python-qt4
88
- ln -s /usr/lib/python2.7/dist-packages/PyQt4/ $VIRTUAL_ENV/lib/python2.7/site-packages/
99
- ln -s /usr/lib/python2.7/dist-packages/sip.so $VIRTUAL_ENV/lib/python2.7/site-packages/
10-
- ln -s /usr/lib/python2.7/dist-packages/sipdistutils.py $VIRTUAL_ENV/lib/python2.7/site-packages/
11-
- ln -s /usr/lib/python2.7/dist-packages/sipconfig.py $VIRTUAL_ENV/lib/python2.7/site-packages/
12-
- ln -s /usr/lib/python2.7/dist-packages/sipconfig_nd.py $VIRTUAL_ENV/lib/python2.7/site-packages/
13-
- pip install twisted pyopenssl qt4reactor
10+
- pip install qt4reactor pyopenssl twisted
1411

1512
install:
16-
- scons -C rdpy/core install
13+
- python setup.py install
1714

1815
script:
1916
- python -m unittest discover -s test -v

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,30 @@ RDPY is a pure Python implementation ot the Microsoft RDP (Remote Desktop Protoc
88

99
## Build
1010

11-
RDPY is fully implemented in python, except the bitmap uncompression algorithm which is implemented in C and binded with SIP (originally conceived for the PyQt project) for performance purposes.
11+
RDPY is fully implemented in python, except the bitmap uncompression algorithm which is implemented in C for performance purposes.
1212

1313
### Depends
1414

1515
* python2.7
16-
* python-twisted
17-
* python-openssl
1816
* python-qt4
19-
* python-qt4reactor
20-
* python-sip-dev
21-
* scons
2217

2318
### Make
2419

2520
```
2621
$ git clone https://github.com/citronneur/rdpy.git rdpy
27-
$ scons -C rdpy/rdpy/core install
22+
$ pip install twisted pyopenssl qt4reactor
23+
$ python rdpy/setup.py install
24+
```
25+
26+
For virtualenv, tou need to link qt4 library to it:
27+
```
28+
ln -s /usr/lib/python2.7/dist-packages/PyQt4/ $VIRTUAL_ENV/lib/python2.7/site-packages/
29+
ln -s /usr/lib/python2.7/dist-packages/sip.so $VIRTUAL_ENV/lib/python2.7/site-packages/
2830
```
2931

3032
## RDPY Binaries
3133

32-
RDPY comes with some very useful binaries; These binaries are linux and windows compatible. Pre-built binaries will be delivered with the first release of the project.
34+
RDPY comes with some very useful binaries; These binaries are linux and windows compatible.
3335

3436
### rdpy-rdpclient
3537

bin/rdpy-rdpclient

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ example of use rdpy as rdp client
2424

2525
import sys, os, getopt
2626

27-
# Change path so we find rdpy
28-
sys.path.insert(1, os.path.join(sys.path[0], '..'))
29-
3027
from PyQt4 import QtGui
3128
from rdpy.ui.qt4 import RDPClientQt
3229
from rdpy.protocol.rdp import rdp

bin/rdpy-rdpproxy

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ Admin ----------------------|
3030
"""
3131

3232
import sys, os, getopt, json
33-
# Change path so we find rdpy
34-
sys.path.insert(1, os.path.join(sys.path[0], '..'))
3533

3634
from rdpy.base import log, error
3735
from rdpy.protocol.rdp import rdp

bin/rdpy-rdpscreenshot

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ take screenshot of login page
2525

2626
import sys, os, getopt
2727

28-
# Change path so we find rdpy
29-
sys.path.insert(1, os.path.join(sys.path[0], '..'))
30-
3128
from PyQt4 import QtCore, QtGui
3229
from rdpy.protocol.rdp import rdp
3330
from rdpy.ui.qt4 import RDPBitmapToQtImage

bin/rdpy-vncclient

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ example of use rdpy as VNC client
2323
"""
2424

2525
import sys, os, getopt
26-
27-
# Change path so we find rdpy
28-
sys.path.insert(1, os.path.join(sys.path[0], '..'))
29-
3026
from PyQt4 import QtGui
3127
from rdpy.ui.qt4 import RFBClientQt
3228
from rdpy.protocol.rfb import rfb

bin/rdpy-vncscreenshot

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ take screenshot of login page
2424
"""
2525

2626
import sys, os, getopt
27-
28-
# Change path so we find rdpy
29-
sys.path.insert(1, os.path.join(sys.path[0], '..'))
30-
3127
from PyQt4 import QtCore, QtGui
3228
from rdpy.protocol.rfb import rfb
3329
import rdpy.base.log as log

rdpy/core/src/rle/rle.c renamed to ext/rle.c

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,11 @@
2424
/* indent is confused by this file */
2525
/* *INDENT-OFF* */
2626

27-
#include "rle.h"
27+
#include <Python.h>
2828

2929
/* Specific rename for RDPY integration */
3030
#define uint8 unsigned char
3131
#define uint16 unsigned short
32-
#define NULL 0
3332
#define unimpl(str, code)
3433

3534
#define RD_BOOL int
@@ -891,8 +890,8 @@ bitmap_decompress4(uint8 * output, int width, int height, uint8 * input, int siz
891890
}
892891

893892
/* main decompress function */
894-
int
895-
bitmap_decompress(char * output, int width, int height, char * input, int size, int Bpp)
893+
static int
894+
bitmap_decompress(uint8 * output, int width, int height, uint8* input, int size, int Bpp)
896895
{
897896
RD_BOOL rv = False;
898897

@@ -918,3 +917,31 @@ bitmap_decompress(char * output, int width, int height, char * input, int size,
918917
}
919918

920919
/* *INDENT-ON* */
920+
921+
static PyObject*
922+
bitmap_decompress_wrapper(PyObject* self, PyObject* args)
923+
{
924+
Py_buffer output, input;
925+
int width = 0, height = 0, bpp = 0;
926+
927+
if (!PyArg_ParseTuple(args, "s*iis*i", &output, &width, &height, &input, &bpp))
928+
return NULL;
929+
930+
if(bitmap_decompress((uint8*)output.buf, width, height, (uint8*)input.buf, input.len, bpp) == False)
931+
return NULL;
932+
933+
Py_RETURN_NONE;
934+
}
935+
936+
static PyMethodDef rle_methods[] =
937+
{
938+
{"bitmap_decompress", bitmap_decompress_wrapper, METH_VARARGS, "decompress bitmap from microsoft rle algorithm."},
939+
{NULL, NULL, 0, NULL}
940+
};
941+
942+
PyMODINIT_FUNC
943+
initrle(void)
944+
{
945+
(void) Py_InitModule("rle", rle_methods);
946+
}
947+

rdpy/core/__init__.py

Whitespace-only changes.

rdpy/core/sconstruct

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)