Kaydet (Commit) 248f6f1f authored tarafından Jack Jansen's avatar Jack Jansen

Second-argument alias methods were generated with a variation on

MethodGenerator, this should be OSErrMethodGenerator.
üst 9a40c1c2
...@@ -320,7 +320,7 @@ static void Alias_dealloc(AliasObject *self) ...@@ -320,7 +320,7 @@ static void Alias_dealloc(AliasObject *self)
static PyObject *Alias_ResolveAlias(AliasObject *_self, PyObject *_args) static PyObject *Alias_ResolveAlias(AliasObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
OSErr _rv; OSErr _err;
FSSpec fromFile__buf__; FSSpec fromFile__buf__;
FSSpec *fromFile = &fromFile__buf__; FSSpec *fromFile = &fromFile__buf__;
FSSpec target; FSSpec target;
...@@ -328,12 +328,12 @@ static PyObject *Alias_ResolveAlias(AliasObject *_self, PyObject *_args) ...@@ -328,12 +328,12 @@ static PyObject *Alias_ResolveAlias(AliasObject *_self, PyObject *_args)
if (!PyArg_ParseTuple(_args, "O&", if (!PyArg_ParseTuple(_args, "O&",
myPyMac_GetOptFSSpecPtr, &fromFile)) myPyMac_GetOptFSSpecPtr, &fromFile))
return NULL; return NULL;
_rv = ResolveAlias(fromFile, _err = ResolveAlias(fromFile,
_self->ob_itself, _self->ob_itself,
&target, &target,
&wasChanged); &wasChanged);
_res = Py_BuildValue("hO&b", if (_err != noErr) return PyMac_Error(_err);
_rv, _res = Py_BuildValue("O&b",
FSSpec_New, &target, FSSpec_New, &target,
wasChanged); wasChanged);
return _res; return _res;
...@@ -360,7 +360,7 @@ static PyObject *Alias_GetAliasInfo(AliasObject *_self, PyObject *_args) ...@@ -360,7 +360,7 @@ static PyObject *Alias_GetAliasInfo(AliasObject *_self, PyObject *_args)
static PyObject *Alias_ResolveAliasWithMountFlags(AliasObject *_self, PyObject *_args) static PyObject *Alias_ResolveAliasWithMountFlags(AliasObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
OSErr _rv; OSErr _err;
FSSpec fromFile__buf__; FSSpec fromFile__buf__;
FSSpec *fromFile = &fromFile__buf__; FSSpec *fromFile = &fromFile__buf__;
FSSpec target; FSSpec target;
...@@ -370,13 +370,13 @@ static PyObject *Alias_ResolveAliasWithMountFlags(AliasObject *_self, PyObject * ...@@ -370,13 +370,13 @@ static PyObject *Alias_ResolveAliasWithMountFlags(AliasObject *_self, PyObject *
myPyMac_GetOptFSSpecPtr, &fromFile, myPyMac_GetOptFSSpecPtr, &fromFile,
&mountFlags)) &mountFlags))
return NULL; return NULL;
_rv = ResolveAliasWithMountFlags(fromFile, _err = ResolveAliasWithMountFlags(fromFile,
_self->ob_itself, _self->ob_itself,
&target, &target,
&wasChanged, &wasChanged,
mountFlags); mountFlags);
_res = Py_BuildValue("hO&b", if (_err != noErr) return PyMac_Error(_err);
_rv, _res = Py_BuildValue("O&b",
FSSpec_New, &target, FSSpec_New, &target,
wasChanged); wasChanged);
return _res; return _res;
...@@ -385,7 +385,7 @@ static PyObject *Alias_ResolveAliasWithMountFlags(AliasObject *_self, PyObject * ...@@ -385,7 +385,7 @@ static PyObject *Alias_ResolveAliasWithMountFlags(AliasObject *_self, PyObject *
static PyObject *Alias_FollowFinderAlias(AliasObject *_self, PyObject *_args) static PyObject *Alias_FollowFinderAlias(AliasObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
OSErr _rv; OSErr _err;
FSSpec fromFile__buf__; FSSpec fromFile__buf__;
FSSpec *fromFile = &fromFile__buf__; FSSpec *fromFile = &fromFile__buf__;
Boolean logon; Boolean logon;
...@@ -395,13 +395,13 @@ static PyObject *Alias_FollowFinderAlias(AliasObject *_self, PyObject *_args) ...@@ -395,13 +395,13 @@ static PyObject *Alias_FollowFinderAlias(AliasObject *_self, PyObject *_args)
myPyMac_GetOptFSSpecPtr, &fromFile, myPyMac_GetOptFSSpecPtr, &fromFile,
&logon)) &logon))
return NULL; return NULL;
_rv = FollowFinderAlias(fromFile, _err = FollowFinderAlias(fromFile,
_self->ob_itself, _self->ob_itself,
logon, logon,
&target, &target,
&wasChanged); &wasChanged);
_res = Py_BuildValue("hO&b", if (_err != noErr) return PyMac_Error(_err);
_rv, _res = Py_BuildValue("O&b",
FSSpec_New, &target, FSSpec_New, &target,
wasChanged); wasChanged);
return _res; return _res;
...@@ -410,7 +410,7 @@ static PyObject *Alias_FollowFinderAlias(AliasObject *_self, PyObject *_args) ...@@ -410,7 +410,7 @@ static PyObject *Alias_FollowFinderAlias(AliasObject *_self, PyObject *_args)
static PyObject *Alias_FSResolveAliasWithMountFlags(AliasObject *_self, PyObject *_args) static PyObject *Alias_FSResolveAliasWithMountFlags(AliasObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
OSErr _rv; OSErr _err;
FSRef fromFile__buf__; FSRef fromFile__buf__;
FSRef *fromFile = &fromFile__buf__; FSRef *fromFile = &fromFile__buf__;
FSRef target; FSRef target;
...@@ -420,13 +420,13 @@ static PyObject *Alias_FSResolveAliasWithMountFlags(AliasObject *_self, PyObject ...@@ -420,13 +420,13 @@ static PyObject *Alias_FSResolveAliasWithMountFlags(AliasObject *_self, PyObject
myPyMac_GetOptFSRefPtr, &fromFile, myPyMac_GetOptFSRefPtr, &fromFile,
&mountFlags)) &mountFlags))
return NULL; return NULL;
_rv = FSResolveAliasWithMountFlags(fromFile, _err = FSResolveAliasWithMountFlags(fromFile,
_self->ob_itself, _self->ob_itself,
&target, &target,
&wasChanged, &wasChanged,
mountFlags); mountFlags);
_res = Py_BuildValue("hO&b", if (_err != noErr) return PyMac_Error(_err);
_rv, _res = Py_BuildValue("O&b",
FSRef_New, &target, FSRef_New, &target,
wasChanged); wasChanged);
return _res; return _res;
...@@ -435,7 +435,7 @@ static PyObject *Alias_FSResolveAliasWithMountFlags(AliasObject *_self, PyObject ...@@ -435,7 +435,7 @@ static PyObject *Alias_FSResolveAliasWithMountFlags(AliasObject *_self, PyObject
static PyObject *Alias_FSResolveAlias(AliasObject *_self, PyObject *_args) static PyObject *Alias_FSResolveAlias(AliasObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
OSErr _rv; OSErr _err;
FSRef fromFile__buf__; FSRef fromFile__buf__;
FSRef *fromFile = &fromFile__buf__; FSRef *fromFile = &fromFile__buf__;
FSRef target; FSRef target;
...@@ -443,12 +443,12 @@ static PyObject *Alias_FSResolveAlias(AliasObject *_self, PyObject *_args) ...@@ -443,12 +443,12 @@ static PyObject *Alias_FSResolveAlias(AliasObject *_self, PyObject *_args)
if (!PyArg_ParseTuple(_args, "O&", if (!PyArg_ParseTuple(_args, "O&",
myPyMac_GetOptFSRefPtr, &fromFile)) myPyMac_GetOptFSRefPtr, &fromFile))
return NULL; return NULL;
_rv = FSResolveAlias(fromFile, _err = FSResolveAlias(fromFile,
_self->ob_itself, _self->ob_itself,
&target, &target,
&wasChanged); &wasChanged);
_res = Py_BuildValue("hO&b", if (_err != noErr) return PyMac_Error(_err);
_rv, _res = Py_BuildValue("O&b",
FSRef_New, &target, FSRef_New, &target,
wasChanged); wasChanged);
return _res; return _res;
...@@ -457,7 +457,7 @@ static PyObject *Alias_FSResolveAlias(AliasObject *_self, PyObject *_args) ...@@ -457,7 +457,7 @@ static PyObject *Alias_FSResolveAlias(AliasObject *_self, PyObject *_args)
static PyObject *Alias_FSFollowFinderAlias(AliasObject *_self, PyObject *_args) static PyObject *Alias_FSFollowFinderAlias(AliasObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
OSErr _rv; OSErr _err;
FSRef fromFile; FSRef fromFile;
Boolean logon; Boolean logon;
FSRef target; FSRef target;
...@@ -465,13 +465,13 @@ static PyObject *Alias_FSFollowFinderAlias(AliasObject *_self, PyObject *_args) ...@@ -465,13 +465,13 @@ static PyObject *Alias_FSFollowFinderAlias(AliasObject *_self, PyObject *_args)
if (!PyArg_ParseTuple(_args, "b", if (!PyArg_ParseTuple(_args, "b",
&logon)) &logon))
return NULL; return NULL;
_rv = FSFollowFinderAlias(&fromFile, _err = FSFollowFinderAlias(&fromFile,
_self->ob_itself, _self->ob_itself,
logon, logon,
&target, &target,
&wasChanged); &wasChanged);
_res = Py_BuildValue("hO&O&b", if (_err != noErr) return PyMac_Error(_err);
_rv, _res = Py_BuildValue("O&O&b",
FSRef_New, &fromFile, FSRef_New, &fromFile,
FSRef_New, &target, FSRef_New, &target,
wasChanged); wasChanged);
...@@ -480,19 +480,19 @@ static PyObject *Alias_FSFollowFinderAlias(AliasObject *_self, PyObject *_args) ...@@ -480,19 +480,19 @@ static PyObject *Alias_FSFollowFinderAlias(AliasObject *_self, PyObject *_args)
static PyMethodDef Alias_methods[] = { static PyMethodDef Alias_methods[] = {
{"ResolveAlias", (PyCFunction)Alias_ResolveAlias, 1, {"ResolveAlias", (PyCFunction)Alias_ResolveAlias, 1,
PyDoc_STR("(FSSpec fromFile) -> (OSErr _rv, FSSpec target, Boolean wasChanged)")}, PyDoc_STR("(FSSpec fromFile) -> (FSSpec target, Boolean wasChanged)")},
{"GetAliasInfo", (PyCFunction)Alias_GetAliasInfo, 1, {"GetAliasInfo", (PyCFunction)Alias_GetAliasInfo, 1,
PyDoc_STR("(AliasInfoType index) -> (Str63 theString)")}, PyDoc_STR("(AliasInfoType index) -> (Str63 theString)")},
{"ResolveAliasWithMountFlags", (PyCFunction)Alias_ResolveAliasWithMountFlags, 1, {"ResolveAliasWithMountFlags", (PyCFunction)Alias_ResolveAliasWithMountFlags, 1,
PyDoc_STR("(FSSpec fromFile, unsigned long mountFlags) -> (OSErr _rv, FSSpec target, Boolean wasChanged)")}, PyDoc_STR("(FSSpec fromFile, unsigned long mountFlags) -> (FSSpec target, Boolean wasChanged)")},
{"FollowFinderAlias", (PyCFunction)Alias_FollowFinderAlias, 1, {"FollowFinderAlias", (PyCFunction)Alias_FollowFinderAlias, 1,
PyDoc_STR("(FSSpec fromFile, Boolean logon) -> (OSErr _rv, FSSpec target, Boolean wasChanged)")}, PyDoc_STR("(FSSpec fromFile, Boolean logon) -> (FSSpec target, Boolean wasChanged)")},
{"FSResolveAliasWithMountFlags", (PyCFunction)Alias_FSResolveAliasWithMountFlags, 1, {"FSResolveAliasWithMountFlags", (PyCFunction)Alias_FSResolveAliasWithMountFlags, 1,
PyDoc_STR("(FSRef fromFile, unsigned long mountFlags) -> (OSErr _rv, FSRef target, Boolean wasChanged)")}, PyDoc_STR("(FSRef fromFile, unsigned long mountFlags) -> (FSRef target, Boolean wasChanged)")},
{"FSResolveAlias", (PyCFunction)Alias_FSResolveAlias, 1, {"FSResolveAlias", (PyCFunction)Alias_FSResolveAlias, 1,
PyDoc_STR("(FSRef fromFile) -> (OSErr _rv, FSRef target, Boolean wasChanged)")}, PyDoc_STR("(FSRef fromFile) -> (FSRef target, Boolean wasChanged)")},
{"FSFollowFinderAlias", (PyCFunction)Alias_FSFollowFinderAlias, 1, {"FSFollowFinderAlias", (PyCFunction)Alias_FSFollowFinderAlias, 1,
PyDoc_STR("(Boolean logon) -> (OSErr _rv, FSRef fromFile, FSRef target, Boolean wasChanged)")}, PyDoc_STR("(Boolean logon) -> (FSRef fromFile, FSRef target, Boolean wasChanged)")},
{NULL, NULL, 0} {NULL, NULL, 0}
}; };
......
...@@ -527,7 +527,7 @@ class AliasDefinition(PEP253Mixin, ObjectDefinition): ...@@ -527,7 +527,7 @@ class AliasDefinition(PEP253Mixin, ObjectDefinition):
# Alias methods come in two flavors: those with the alias as arg1 and # Alias methods come in two flavors: those with the alias as arg1 and
# those with the alias as arg 2. # those with the alias as arg 2.
class Arg2MethodGenerator(MethodGenerator): class Arg2MethodGenerator(OSErrMethodGenerator):
"""Similar to MethodGenerator, but has self as second argument""" """Similar to MethodGenerator, but has self as second argument"""
def parseArgumentList(self, args): def parseArgumentList(self, args):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment