~ubuntu-branches/debian/sid/subversion/sid

« back to all changes in this revision

Viewing changes to subversion/bindings/swig/python/README

  • Committer: Package Import Robot
  • Author(s): James McCoy, Peter Samuelson, James McCoy
  • Date: 2014-01-12 19:48:33 UTC
  • mfrom: (0.2.10)
  • Revision ID: package-import@ubuntu.com-20140112194833-w3axfwksn296jn5x
Tags: 1.8.5-1
[ Peter Samuelson ]
* New upstream release.  (Closes: #725787) Rediff patches:
  - Remove apr-abi1 (applied upstream), rename apr-abi2 to apr-abi
  - Remove loosen-sqlite-version-check (shouldn't be needed)
  - Remove java-osgi-metadata (applied upstream)
  - svnmucc prompts for a changelog if none is provided. (Closes: #507430)
  - Remove fix-bdb-version-detection, upstream uses "apu-config --dbm-libs"
  - Remove ruby-test-wc (applied upstream)
  - Fix “svn diff -r N file” when file has svn:mime-type set.
    (Closes: #734163)
  - Support specifying an encoding for mod_dav_svn's environment in which
    hooks are run.  (Closes: #601544)
  - Fix ordering of “svnadmin dump” paths with certain APR versions.
    (Closes: #687291)
  - Provide a better error message when authentication fails with an
    svn+ssh:// URL.  (Closes: #273874)
  - Updated Polish translations.  (Closes: #690815)

[ James McCoy ]
* Remove all traces of libneon, replaced by libserf.
* patches/sqlite_3.8.x_workaround: Upstream fix for wc-queries-test test
  failurse.
* Run configure with --with-apache-libexecdir, which allows removing part of
  patches/rpath.
* Re-enable auth-test as upstream has fixed the problem of picking up
  libraries from the environment rather than the build tree.
  (Closes: #654172)
* Point LD_LIBRARY_PATH at the built auth libraries when running the svn
  command during the build.  (Closes: #678224)
* Add a NEWS entry describing how to configure mod_dav_svn to understand
  UTF-8.  (Closes: #566148)
* Remove ancient transitional package, libsvn-ruby.
* Enable compatibility with Sqlite3 versions back to Wheezy.
* Enable hardening flags.  (Closes: #734918)
* patches/build-fixes: Enable verbose build logs.
* Build against the default ruby version.  (Closes: #722393)

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
   The argument-reductions laws of the SWIG bindings something go like
6
6
   this:
7
7
   
 
8
     - The module prefix can be omitted.  o:
 
9
 
 
10
          void *some_C_function = svn_client_foo;
 
11
       
 
12
       becomes:
 
13
 
 
14
          import svn.client
 
15
          func = svn.client.foo
 
16
 
 
17
       However, the following two alternatives also work:
 
18
 
 
19
          # Fully-qualified C name
 
20
          import svn.client
 
21
          func = svn.client.svn_client_foo
 
22
 
 
23
          # Star-import imports just svn_* names, not bare 'foo' names.
 
24
          from svn.client import *
 
25
          func = svn_client_foo
 
26
 
8
27
     - Python functions don't return errors.  They throw exceptions.
9
28
       Which means that...
10
29
   
13
32
       pointers with new data (you know, values that are returned to
14
33
       the caller, but not as "return values") will return those
15
34
       values directly in Python.  So:
16
 
   
17
 
          error = foo (object **returned_obj, int blah);
18
 
   
 
35
 
 
36
          object_t *returned_obj;
 
37
          SVN_ERR(svn_client_foo(&returned_obj, blah));
 
38
 
 
39
       becomes:
 
40
 
 
41
          returned_obj = svn.client.foo(blah)
 
42
 
 
43
       and:
 
44
 
 
45
          err = svn_client_foo(&returned_obj, blah);
 
46
          if (err && err->apr_err == SVN_ERR_...)
 
47
            /* handle it */
 
48
 
19
49
       becomes:
20
50
   
21
51
          try:
22
 
              returned_obj = foo (blah)
 
52
              returned_obj = svn.client.foo(blah)
23
53
          except:
24
54
              # handle it
25
55
   
26
56
     - Callback function/baton pairs get reduced to just callback
27
57
       functions, and the benefit you get from batons is gotten
28
 
       instead through Python default arguments:
29
 
   
30
 
          error = foo (callback_t function, void *baton);
31
 
   
 
58
       instead through defining the callback function locally and
 
59
       passing the 'baton' data in through Python default arguments.  So:
 
60
 
 
61
          struct baton_t { userdata1, ... };
 
62
 
 
63
          svn_error_t *cb_func(cb_arg1, ..., void *baton)
 
64
          {
 
65
            baton_t *b = baton;
 
66
            /* do stuff here with b->userdata1... etc. */
 
67
          }
 
68
 
 
69
          /* Now use it: */
 
70
          {
 
71
            baton_t *b = { whatever, ... };
 
72
            error = svn_client_foo(cb_func, b);
 
73
          }
 
74
 
32
75
       becomes:
33
 
   
34
 
          try:
35
 
              def function(callback_arg1, ..., userdata1=whatever, ...):
36
 
                  # do stuff here
37
 
              foo(function)
38
 
          except:
39
 
              # handle it
 
76
 
 
77
          def cb_func(cb_arg1, ..., userdata1=whatever, ...):
 
78
              # do stuff here with userdata1 etc.
 
79
          svn.client.foo(cb_func)
40
80
 
41
81
 
42
82
RUNNING THE TESTS