Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
3e61cc05
Commit
3e61cc05
authored
Feb 19, 1999
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug, deleting attributes was broken.
Added module to repr output.
parent
10d613f4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
10 deletions
+46
-10
lib/Components/ExtensionClass/ExtensionClass.c
lib/Components/ExtensionClass/ExtensionClass.c
+23
-5
lib/Components/ExtensionClass/src/ExtensionClass.c
lib/Components/ExtensionClass/src/ExtensionClass.c
+23
-5
No files found.
lib/Components/ExtensionClass/ExtensionClass.c
View file @
3e61cc05
...
...
@@ -33,7 +33,7 @@
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
$Id: ExtensionClass.c,v 1.3
1 1998/11/23 11:47:19
jim Exp $
$Id: ExtensionClass.c,v 1.3
2 1999/02/19 20:52:23
jim Exp $
If you have questions regarding this software,
contact:
...
...
@@ -54,7 +54,7 @@ static char ExtensionClass_module_documentation[] =
" - They provide access to unbound methods,
\n
"
" - They can be called to create instances.
\n
"
"
\n
"
"$Id: ExtensionClass.c,v 1.3
1 1998/11/23 11:47:19
jim Exp $
\n
"
"$Id: ExtensionClass.c,v 1.3
2 1999/02/19 20:52:23
jim Exp $
\n
"
;
#include <stdio.h>
...
...
@@ -1789,6 +1789,8 @@ CCL_getattro(PyExtensionClass *self, PyObject *name)
static
int
CCL_setattro
(
PyExtensionClass
*
self
,
PyObject
*
name
,
PyObject
*
v
)
{
if
(
!
v
)
return
PyObject_DelItem
(
self
->
class_dictionary
,
name
);
if
(
v
&&
UnboundCMethod_Check
(
v
)
&&
!
(
self
->
class_flags
&
EXTENSIONCLASS_METHODHOOK_FLAG
)
)
...
...
@@ -2004,10 +2006,26 @@ static PyObject *
CCL_repr
(
PyExtensionClass
*
self
)
{
char
p
[
128
];
PyObject
*
m
;
if
((
m
=
PyObject_GetAttr
(
OBJECT
(
self
),
py__module__
)))
{
if
(
!
PyObject_IsTrue
(
m
))
{
Py_DECREF
(
m
);
m
=
0
;
}
}
else
PyErr_Clear
();
sprintf
(
p
,
"%p"
,
self
);
return
JimString_Build
(
"<extension class %s at %s>"
,
"ss"
,
self
->
tp_name
,
p
);
if
(
m
)
ASSIGN
(
m
,
JimString_Build
(
"<extension class %s.%s at %s>"
,
"Oss"
,
m
,
self
->
tp_name
,
p
));
else
m
=
JimString_Build
(
"<extension class %s at %s>"
,
"ss"
,
self
->
tp_name
,
p
);
return
m
;
}
static
PyTypeObject
ECTypeType
=
{
...
...
@@ -3373,7 +3391,7 @@ void
initExtensionClass
()
{
PyObject
*
m
,
*
d
;
char
*
rev
=
"$Revision: 1.3
1
$"
;
char
*
rev
=
"$Revision: 1.3
2
$"
;
PURE_MIXIN_CLASS
(
Base
,
"Minimalbase class for Extension Classes"
,
NULL
);
PMethodType
.
ob_type
=&
PyType_Type
;
...
...
lib/Components/ExtensionClass/src/ExtensionClass.c
View file @
3e61cc05
...
...
@@ -33,7 +33,7 @@
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
$Id: ExtensionClass.c,v 1.3
1 1998/11/23 11:47:19
jim Exp $
$Id: ExtensionClass.c,v 1.3
2 1999/02/19 20:52:23
jim Exp $
If you have questions regarding this software,
contact:
...
...
@@ -54,7 +54,7 @@ static char ExtensionClass_module_documentation[] =
" - They provide access to unbound methods,
\n
"
" - They can be called to create instances.
\n
"
"
\n
"
"$Id: ExtensionClass.c,v 1.3
1 1998/11/23 11:47:19
jim Exp $
\n
"
"$Id: ExtensionClass.c,v 1.3
2 1999/02/19 20:52:23
jim Exp $
\n
"
;
#include <stdio.h>
...
...
@@ -1789,6 +1789,8 @@ CCL_getattro(PyExtensionClass *self, PyObject *name)
static
int
CCL_setattro
(
PyExtensionClass
*
self
,
PyObject
*
name
,
PyObject
*
v
)
{
if
(
!
v
)
return
PyObject_DelItem
(
self
->
class_dictionary
,
name
);
if
(
v
&&
UnboundCMethod_Check
(
v
)
&&
!
(
self
->
class_flags
&
EXTENSIONCLASS_METHODHOOK_FLAG
)
)
...
...
@@ -2004,10 +2006,26 @@ static PyObject *
CCL_repr
(
PyExtensionClass
*
self
)
{
char
p
[
128
];
PyObject
*
m
;
if
((
m
=
PyObject_GetAttr
(
OBJECT
(
self
),
py__module__
)))
{
if
(
!
PyObject_IsTrue
(
m
))
{
Py_DECREF
(
m
);
m
=
0
;
}
}
else
PyErr_Clear
();
sprintf
(
p
,
"%p"
,
self
);
return
JimString_Build
(
"<extension class %s at %s>"
,
"ss"
,
self
->
tp_name
,
p
);
if
(
m
)
ASSIGN
(
m
,
JimString_Build
(
"<extension class %s.%s at %s>"
,
"Oss"
,
m
,
self
->
tp_name
,
p
));
else
m
=
JimString_Build
(
"<extension class %s at %s>"
,
"ss"
,
self
->
tp_name
,
p
);
return
m
;
}
static
PyTypeObject
ECTypeType
=
{
...
...
@@ -3373,7 +3391,7 @@ void
initExtensionClass
()
{
PyObject
*
m
,
*
d
;
char
*
rev
=
"$Revision: 1.3
1
$"
;
char
*
rev
=
"$Revision: 1.3
2
$"
;
PURE_MIXIN_CLASS
(
Base
,
"Minimalbase class for Extension Classes"
,
NULL
);
PMethodType
.
ob_type
=&
PyType_Type
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment