Commit graph

146 commits

Author SHA1 Message Date
sunoru
8985c34809 Fix some typos in docs and examples and make the code look nicer. 2016-12-31 23:06:56 +08:00
William S Fulton
2a42031b08 Custom Python module importing code
Add optional moduleimport attribute to %module so that the
default module import code can be overridden. See the
"Searching for the wrapper module" documentation in Python.html.
Example:

  %module(moduleimport="import _foo") foo

$module also expands to the low-level C/C++ module name, so
the following is the same as above

  %module(moduleimport="import $module") foo

Issue https://github.com/swig/swig/issues/769
2016-12-01 18:59:33 +00:00
William S Fulton
96015de0dd Update documentation for using SWIG_ConvertPtr example usage
Add a test case to test the example documentation typemaps
2016-10-23 20:16:35 +01:00
William S Fulton
268b942865 Consistent formatting of example code in the docs 2016-10-23 20:16:35 +01:00
William S Fulton
129ef8ea8f Correct docs and examples to call SWIG_fail after setting a Python error
Although 'return NULL' works, it may miss out on some cleanup and NULL
is the wrong value to return in generated code for overloaded functions.
2016-10-23 20:16:35 +01:00
William S Fulton
4f681f751d Update Python docs on builtin slots 2016-08-18 07:11:00 +01:00
William S Fulton
64f5d23b13 Python docs on static linking section edits 2016-06-12 00:13:07 +01:00
Mike Romberg
2bb732008a Add more documentation about statically linked python modules. 2016-06-11 16:08:24 -06:00
William S Fulton
d18b6e2c8d Python module loading documentation tweaks 2016-06-11 00:59:00 +01:00
Mike Romberg
7b1b2e177f Add documentation about how foo.py finds/loads _foo for python. 2016-06-07 15:28:40 -06:00
William S Fulton
81adedd7dd Python: Do not import all of sys when using -relativeimport 2016-06-06 22:20:07 +01:00
Mike Romberg
ac7157dfc6 Update -relative import documentation to reflect runtime check. 2016-06-06 13:43:58 -06:00
William S Fulton
d01efd82e1 Merge branch 'mromberg-implpkg'
* mromberg-implpkg:
  Minor edits to Python implicit namespace package docs
  use %inline for test
  use relative import for -builtin and python2
  Python3 removes support for relative imports
  Document implicit namespace packages for python
  disable namespace package build
  Attempt to calm the testing gods...
  use whatever name winders uses for .so files.
  Examples (and tests) for python namespace packages
  disable namespace package build
  spelling
  Attempt to calm the testing gods...
  use whatever name winders uses for .so files.
  Don't run example for old pythons
  Examples (and tests) for python namespace packages
  use importlib to load C extension modules for python 2.7 and newer
2016-05-24 22:48:37 +01:00
William S Fulton
4253740d40 Minor edits to Python implicit namespace package docs 2016-05-24 22:46:46 +01:00
William S Fulton
bf24c11645 Correct default arg link in Python docs
[skip ci]
2016-05-06 07:36:53 +01:00
William S Fulton
a8110e3761 Correct Python docs example
Fix PyTuple_SetItem in argout typemap
Fix from Bob Hood on swig-user mailing list
[skip ci]
2016-04-30 12:58:22 +01:00
Mike Romberg
cd2c7b9245 Document implicit namespace packages for python 2016-04-05 11:10:04 -06:00
William S Fulton
80e3ebf0d1 html doc fixes 2016-04-02 13:47:23 +01:00
William S Fulton
355f2623c7 Improve documentation for multi-argument typemaps and overloading 2016-04-02 13:44:44 +01:00
Olly Betts
4e9203acc3 Eliminate doc reference to Python 1.4 2016-02-17 14:18:21 +13:00
Alec Cooper
ba40c4a256 Documentation on Python Bytes/Unicode distinction 2016-02-04 21:07:40 -05:00
Olly Betts
72691e5a49 Clean up Python embed.i
Remove duplicate (aside from comment formatting) embed15.i.

Remove references to Python 1.5.

Tested and remarkably still works with Python 2.7, so update
documentation and comments to reflect that.
2016-01-27 19:01:49 +13:00
William S Fulton
3763beb489 Replace tabs with spaces in html docs
wkhtmltopdf is not expanding tabs within <pre> elements to 8 spaces as it
should. Workaround the problem by converting all tabs to an appropriate
number of spaces.
2015-12-30 22:22:33 +00:00
William S Fulton
925b2a336f HTML fixes for documentation - add meta tag and loose.dtd 2015-12-30 22:22:32 +00:00
William S Fulton
8288ac15a0 Correct links in html documentation using new version of makechap.py
Corrects position of heading text within A and H1, H2, ... elements.
2015-12-30 22:22:32 +00:00
William S Fulton
01611702ec Python 2 Unicode strings can be used as inputs to char * or std::string types
Requires SWIG_PYTHON_2_UNICODE to be defined when compiling generated code.
2015-12-19 03:55:26 +00:00
William S Fulton
0ae5bfa6e2 html links updates 2015-12-18 21:14:44 +00:00
William S Fulton
51ee23b580 Link to distutils fix 2015-12-05 19:25:18 +00:00
William S Fulton
803ba97a83 Update docs for shared_ptr 2015-10-01 22:36:01 +01:00
xantares
92328a2016 pep257 & numpydoc conforming docstrings 2015-08-07 22:15:13 +01:00
William S Fulton
3b859ab539 Html doc fixes 2015-07-05 17:16:37 +01:00
Olly Betts
8208d12aa5 Document use of %pythoncode "file.py"
As discussed in github issue #379.
2015-06-29 22:24:59 +12:00
William S Fulton
b8e1a66a38 Add new feature "python:cdefaultargs"
Controls default argument code generation to obtain the default
arguments from the C++ layer instead of the Python layer.
2015-05-28 20:11:57 +01:00
Olly Betts
af113fa6f0 Add missing ; after C++ class definitions 2015-03-20 13:46:28 +13:00
William S Fulton
7c2ed7eae5 Python html doc cosmetic tweaks
[skip ci]
2015-02-02 20:00:07 +00:00
William S Fulton
76d813f321 Python director documentation correction
Fixes #https://github.com/swig/www/issues/2
[skip ci]
2015-02-02 19:52:07 +00:00
Olly Betts
4b5ed45d50 Add note about delimiting blocks of Python code
Using { and } to delimit means Python comments will cause errors with
SWIG 3.0.3 and later.  With older SWIG it usually just meant such
comments failed to appear in the generated output.  See issue #221.
2015-01-09 14:52:46 +13:00
Olly Betts
f541e604e8 Consistently put whitespace outside of <tt>...</tt> and not inside 2014-11-18 12:44:37 +13:00
William S Fulton
eeb1133606 Javascript html links and typo fixes 2014-05-27 23:39:46 +01:00
Harvey Falcic
20ddfb7fcd Python 3 'surrogateescape' docs: fix div class for Python code 2014-05-24 13:30:03 -04:00
Harvey Falcic
5fc851a1e0 Add Python 3 'surrogateescape' documentation 2014-05-23 15:45:47 -04:00
William S Fulton
4a680e5545 html doc chapter numbering update since adding Javascript 2014-05-09 23:39:03 +01:00
Paweł Tomulik
426dd3312f minor corrections to python documentation 2014-05-07 17:23:03 +02:00
William S Fulton
785d93d9fb html fixes and section updates 2014-03-15 22:45:43 +00:00
Olly Betts
48476af609 Remove semicolons after function definitions 2014-02-24 10:13:11 +13:00
Paweł Tomulik
0ed98c0606 added example with %pythonbegin
This was requested in PR #7 but overlooked. Contains an example where
one does: from __future__ import absolute_import using %pythonbegin
directive.
2014-02-21 19:12:59 +00:00
William S Fulton
91120c84f2 Python imports documentation edits 2013-12-24 17:22:42 +00:00
Paweł Tomulik
f53bd5a1e1 Documentation for improved python import option
Docs for SFbug1297 patch (PR #7)

closes #111
2013-12-24 17:22:42 +00:00
William S Fulton
d0af4f50d3 Add %pythonbegin directive.
For adding code at the beginning of the generated .py file.
2013-07-05 06:30:16 +01:00
William S Fulton
7f95c7bb3e Use a less confusing macro name, SWIG_PYTHON_NO_DEBUG => SWIG_PYTHON_INTERPRETER_NO_DEBUG 2013-06-11 19:15:57 +01:00