Skip to content

Commit

Permalink
0.0.12 release
Browse files Browse the repository at this point in the history
  • Loading branch information
s-m-e committed Feb 2, 2019
2 parents 2a690a6 + f23f50f commit acb50ed
Show file tree
Hide file tree
Showing 75 changed files with 345 additions and 94 deletions.
28 changes: 17 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
# Required to run on platform / side: [UNIX]
#
# Copyright (C) 2017 Sebastian M. Ernst <[email protected]>
# Copyright (C) 2017-2019 Sebastian M. Ernst <[email protected]>
#
# <LICENSE_BLOCK>
# The contents of this file are subject to the GNU Lesser General Public License
Expand All @@ -27,8 +27,21 @@
# A virtual machine is required to run wine - is it?
sudo: enabled

# Repository language
language: python

# A 'recent' version of Ubuntu for a recent version of Wine is required
dist: trusty
# Python 3.4 appears to not being offered for xenial at the moment
matrix:
include:
- dist: trusty
python: "3.4"
- dist: xenial
python: "3.5"
- dist: xenial
python: "3.6"
- dist: xenial
python: "3.7"

# Get wine and mingw cross compiler
# http://ubuntuhandbook.org/index.php/2017/01/install-wine-2-0-ubuntu-16-04-14-04-16-10/
Expand All @@ -38,6 +51,8 @@ before_install:
- sudo dpkg --add-architecture i386
- wget https://dl.winehq.org/wine-builds/Release.key
- sudo apt-key add Release.key
- wget https://dl.winehq.org/wine-builds/winehq.key
- sudo apt-key add winehq.key
- sudo apt-add-repository 'https://dl.winehq.org/wine-builds/ubuntu/'
- sudo apt-get -qq update
- sudo apt-get install -y wine-staging
Expand All @@ -50,15 +65,6 @@ before_install:
- uname -a
- lsb_release -a

# Repository language
language: python

# Python version
python:
- "3.4"
- "3.5"
- "3.6"

# command to install dependencies and module
install:
- make dll
Expand Down
10 changes: 10 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
Changes
=======

0.0.12 (2019-02-02)
-------------------

* FEATURE: Added official support for CPython 3.7.
* FEATURE: Added official support for Wine 4.
* FIX: Build folder was not automatically cleaned up before wheels were build, therefore they sometimes contained obsolete files & code.
* FIX: Travis configuration was missing new Wine repository key, which was breaking builds.
* Lots of fixes in documentation.
* New test script for easier development of new tests and features.

0.0.11 (2018-04-10)
-------------------

Expand Down
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ Prerequisites
=============

+--------------------+-------------------------------------------------------------------------------------------------------------+
| for usage + - `CPython`_ 3.x (tested with 3.{4,5,6}) - no additional Python packages required +
| + - `Wine`_ 2.x/3.x (tested with 2.{5 to 21} regular & `staging`_) - expected to be in the user's `PATH`_ +
| for usage + - `CPython`_ 3.x (tested with 3.{4,5,6,7}) - no additional Python packages required +
| + - `Wine`_ 2.x/3.x/4.x (tested with regular & `staging`_) - expected to be in the user's `PATH`_ +
+--------------------+-------------------------------------------------------------------------------------------------------------+
| for tests + - `pytest`_ +
| + - `mingw cross-compiler`_ - for building DLLs against which examples and tests can be run +
Expand Down Expand Up @@ -103,7 +103,7 @@ Installation
Examples
========

Start an interactive Python session under Unix and try the following:
Start an interactive Python session on your favorite Unix(-like) operating system and try the following:

.. code:: python
Expand Down
17 changes: 16 additions & 1 deletion demo_dll/demo_dll.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Calling routines in Windows DLLs from Python scripts running on unixlike systems
Required to run on platform / side: [WINE]
Copyright (C) 2017-2018 Sebastian M. Ernst <[email protected]>
Copyright (C) 2017-2019 Sebastian M. Ernst <[email protected]>
<LICENSE_BLOCK>
The contents of this file are subject to the GNU Lesser General Public License
Expand Down Expand Up @@ -449,6 +449,21 @@ void __stdcall DEMODLL replace_letter_in_null_terminated_string_unicode_b(
}


void __stdcall DEMODLL replace_letter_in_null_terminated_string_r(
char **in_string,
char old_letter,
char new_letter
)
{
int i;
for (i = 0; i < strlen((*in_string)); i++) {
if((*in_string)[i] == old_letter) {
(*in_string)[i] = new_letter;
}
}
}


void __stdcall DEMODLL tag_string_a(
char *in_string,
void *out_string
Expand Down
8 changes: 7 additions & 1 deletion demo_dll/demo_dll.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Calling routines in Windows DLLs from Python scripts running on unixlike systems
Required to run on platform / side: [WINE]
Copyright (C) 2017-2018 Sebastian M. Ernst <[email protected]>
Copyright (C) 2017-2019 Sebastian M. Ernst <[email protected]>
<LICENSE_BLOCK>
The contents of this file are subject to the GNU Lesser General Public License
Expand Down Expand Up @@ -204,6 +204,12 @@ void __stdcall DEMODLL replace_letter_in_null_terminated_string_b(
char new_letter
);

void __stdcall DEMODLL replace_letter_in_null_terminated_string_r(
char **in_string,
char old_letter,
char new_letter
);

void __stdcall DEMODLL replace_letter_in_null_terminated_string_unicode_a(
wchar_t *in_string,
wchar_t old_letter,
Expand Down
2 changes: 1 addition & 1 deletion demo_dll/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
# Required to run on platform / side: [UNIX]
#
# Copyright (C) 2017-2018 Sebastian M. Ernst <[email protected]>
# Copyright (C) 2017-2019 Sebastian M. Ernst <[email protected]>
#
# <LICENSE_BLOCK>
# The contents of this file are subject to the GNU Lesser General Public License
Expand Down
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
# Required to run on platform / side: [UNIX]
#
# Copyright (C) 2017-2018 Sebastian M. Ernst <[email protected]>
# Copyright (C) 2017-2019 Sebastian M. Ernst <[email protected]>
#
# <LICENSE_BLOCK>
# The contents of this file are subject to the GNU Lesser General Public License
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Required to run on platform / side: [UNIX]
Copyright (C) 2017-2018 Sebastian M. Ernst <[email protected]>
Copyright (C) 2017-2019 Sebastian M. Ernst <[email protected]>
<LICENSE_BLOCK>
The contents of this file are subject to the GNU Lesser General Public License
Expand Down
16 changes: 8 additions & 8 deletions docs/memsync.rst
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ definitions like the following:
);
The ``image_data`` parameter is a flattened 1D array representing a 2D image.
Its length is defined by its width and its height. So the length of array equals
Its length is defined by its width and its height. So the length of the array equals
``image_width * image_height``. For cases like this, ``memsync`` has the ability
to dynamically compute the length of the memory through custom functions.
Let's have a look at how the above function would be configured in *Python*:
Expand All @@ -196,7 +196,7 @@ specified lambda function.
Using string buffers, null-terminated strings and Unicode
---------------------------------------------------------

Let's assume you are confronted with a regular Python (3) string. With the help of a
Let's assume you are confronted with a regular *Python* (3) string. With the help of a
DLL function, you want to replace all occurrences of a letter with another letter.

.. code:: python
Expand All @@ -213,7 +213,7 @@ The DLL function's definition looks like this:
char new_letter
);
In Python, it can be configured as follows:
In *Python*, it can be configured as follows:

.. code:: python
Expand All @@ -232,8 +232,8 @@ In Python, it can be configured as follows:
The above configuration indicates that the first argument of the function is a
pointer to a NULL-terminated string.

While Python (3) strings are actually Unicode strings, the function accepts an
array of type ``char`` - a bytes array in Python terms. I.e. you have to encode the
While *Python* (3) strings are actually Unicode strings, the function accepts an
array of type ``char`` - a bytes array in *Python* terms. I.e. you have to encode the
string before it is copied into a string buffer. The following example illustrates
how the function ``replace_letter`` can be called on the string ``some_string``,
exchanging all letters ``a`` with ``e``. Subsequently, the result is printed.
Expand Down Expand Up @@ -323,7 +323,7 @@ to change the contents of the ``memsync`` attribute of the function prototype,
The above syntax also does not interfere with ``ctypes`` on *Windows*, i.e.
the code remains perfectly platform-independent. Once the function prototype
has been configured though ``memsync``, it can be applied to a *Python* function:
has been configured through ``memsync``, it can be applied to a *Python* function:

.. code:: python
Expand Down Expand Up @@ -401,7 +401,7 @@ of multiple (or even zero) path lists, if the optional ``f`` key (custom length
Key: ``n``, NULL-terminated string flag (optional)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Can be set to ``True`` is a NULL-terminated string is passed as an argument.
Can be set to ``True`` if a NULL-terminated string is passed as an argument.
``memsync`` will automatically determine the length of the string, so no
extra information on its length (through ``l`` is required).

Expand All @@ -419,7 +419,7 @@ Key: ``t``, data type of pointer (PyCSimpleType or PyCStructType) (optional)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This field expects a string representing the name of a ctypes datatype.
If you want to specify a custom structure type, you simple specify its class name as a string instead.
If you want to specify a custom structure type, you simply specify its class name as a string instead.

This parameter will be used by ``ctypes.sizeof`` for determining the datatype's size in bytes.
The result is then multiplied with the ``length`` to get an actual size of the
Expand Down
2 changes: 1 addition & 1 deletion examples/demo_call_win.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Required to run on platform / side: [WINE]
Copyright (C) 2017-2018 Sebastian M. Ernst <[email protected]>
Copyright (C) 2017-2019 Sebastian M. Ernst <[email protected]>
<LICENSE_BLOCK>
The contents of this file are subject to the GNU Lesser General Public License
Expand Down
2 changes: 1 addition & 1 deletion examples/test_callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Required to run on platform / side: [UNIX, WINE]
Copyright (C) 2017-2018 Sebastian M. Ernst <[email protected]>
Copyright (C) 2017-2019 Sebastian M. Ernst <[email protected]>
<LICENSE_BLOCK>
The contents of this file are subject to the GNU Lesser General Public License
Expand Down
2 changes: 1 addition & 1 deletion examples/test_cookbook.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Required to run on platform / side: [UNIX, WINE]
Copyright (C) 2017-2018 Sebastian M. Ernst <[email protected]>
Copyright (C) 2017-2019 Sebastian M. Ernst <[email protected]>
<LICENSE_BLOCK>
The contents of this file are subject to the GNU Lesser General Public License
Expand Down
2 changes: 1 addition & 1 deletion examples/test_zugbruecke.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Required to run on platform / side: [UNIX, WINE]
Copyright (C) 2017-2018 Sebastian M. Ernst <[email protected]>
Copyright (C) 2017-2019 Sebastian M. Ernst <[email protected]>
<LICENSE_BLOCK>
The contents of this file are subject to the GNU Lesser General Public License
Expand Down
2 changes: 1 addition & 1 deletion examples/test_zugbruecke_perf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Required to run on platform / side: [UNIX, WINE]
Copyright (C) 2017-2018 Sebastian M. Ernst <[email protected]>
Copyright (C) 2017-2019 Sebastian M. Ernst <[email protected]>
<LICENSE_BLOCK>
The contents of this file are subject to the GNU Lesser General Public License
Expand Down
3 changes: 2 additions & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
# Required to run on platform / side: [UNIX]
#
# Copyright (C) 2017-2018 Sebastian M. Ernst <[email protected]>
# Copyright (C) 2017-2019 Sebastian M. Ernst <[email protected]>
#
# <LICENSE_BLOCK>
# The contents of this file are subject to the GNU Lesser General Public License
Expand All @@ -28,6 +28,7 @@ docu:
@(cd docs; make clean; make html)

release:
-rm build/*
-rm dist/*
-rm -r src/*.egg-info
python setup.py sdist bdist_wheel
Expand Down
Loading

0 comments on commit acb50ed

Please sign in to comment.