]> git.pld-linux.org Git - packages/vim.git/blob - 7.3.422
- up to 7.3.600
[packages/vim.git] / 7.3.422
1 To: vim_dev@googlegroups.com
2 Subject: Patch 7.3.422
3 Fcc: outbox
4 From: Bram Moolenaar <Bram@moolenaar.net>
5 Mime-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8 ------------
9
10 Patch 7.3.422
11 Problem:    Python 3 does not have __members__.
12 Solution:   Add "name" and "number" in another way. (lilydjwg)
13 Files:      src/if_py_both.h, src/if_python3.c
14
15
16 *** ../vim-7.3.421/src/if_py_both.h     2011-09-07 19:30:17.000000000 +0200
17 --- src/if_py_both.h    2012-02-04 19:59:43.000000000 +0100
18 ***************
19 *** 1479,1484 ****
20 --- 1479,1487 ----
21       {"append",            BufferAppend,       1,          "Append data to Vim buffer" },
22       {"mark",      BufferMark,         1,          "Return (row,col) representing position of named mark" },
23       {"range",     BufferRange,        1,          "Return a range object which represents the part of the given buffer between line numbers s and e" },
24 + #if PY_VERSION_HEX >= 0x03000000
25 +     {"__dir__",           BufferDir,          4,          "List its attributes" },
26 + #endif
27       { NULL,       NULL,               0,          NULL }
28   };
29   
30 *** ../vim-7.3.421/src/if_python3.c     2011-09-14 18:59:35.000000000 +0200
31 --- src/if_python3.c    2012-02-04 20:13:00.000000000 +0100
32 ***************
33 *** 468,473 ****
34 --- 468,474 ----
35   static PyObject *BufferNew (buf_T *);
36   static PyObject *WindowNew(win_T *);
37   static PyObject *LineToString(const char *);
38 + static PyObject *BufferDir(PyObject *, PyObject *);
39   
40   static PyTypeObject RangeType;
41   
42 ***************
43 *** 961,973 ****
44         return Py_BuildValue("s", this->buf->b_ffname);
45       else if (strcmp(name, "number") == 0)
46         return Py_BuildValue("n", this->buf->b_fnum);
47 -     else if (strcmp(name,"__members__") == 0)
48 -       return Py_BuildValue("[ss]", "name", "number");
49       else
50         return PyObject_GenericGetAttr(self, nameobj);
51   }
52   
53       static PyObject *
54   BufferRepr(PyObject *self)
55   {
56       static char repr[100];
57 --- 962,979 ----
58         return Py_BuildValue("s", this->buf->b_ffname);
59       else if (strcmp(name, "number") == 0)
60         return Py_BuildValue("n", this->buf->b_fnum);
61       else
62         return PyObject_GenericGetAttr(self, nameobj);
63   }
64   
65       static PyObject *
66 + BufferDir(PyObject *self UNUSED, PyObject *args UNUSED)
67 + {
68 +     return Py_BuildValue("[sssss]", "name", "number",
69 +                                                  "append", "mark", "range");
70 + }
71
72 +     static PyObject *
73   BufferRepr(PyObject *self)
74   {
75       static char repr[100];
76 *** ../vim-7.3.421/src/version.c        2012-01-28 18:03:30.000000000 +0100
77 --- src/version.c       2012-02-04 20:14:58.000000000 +0100
78 ***************
79 *** 716,717 ****
80 --- 716,719 ----
81   {   /* Add new patch number below this line */
82 + /**/
83 +     422,
84   /**/
85
86 -- 
87 How To Keep A Healthy Level Of Insanity:
88 15. Five days in advance, tell your friends you can't attend their
89     party because you're not in the mood.
90
91  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
92 ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
93 \\\  an exciting new programming language -- http://www.Zimbu.org        ///
94  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
This page took 0.031697 seconds and 3 git commands to generate.