Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
ffe62ed4
Kaydet (Commit)
ffe62ed4
authored
Haz 02, 2008
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Patch #2125: Add GetInteger and GetString methods for
msilib.Record objects.
üst
137d8241
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
0 deletions
+63
-0
msilib.rst
Doc/library/msilib.rst
+13
-0
NEWS
Misc/NEWS
+3
-0
_msi.c
PC/_msi.c
+47
-0
No files found.
Doc/library/msilib.rst
Dosyayı görüntüle @
ffe62ed4
...
@@ -264,6 +264,18 @@ Record Objects
...
@@ -264,6 +264,18 @@ Record Objects
:
cfunc
:`
MsiRecordGetFieldCount
`.
:
cfunc
:`
MsiRecordGetFieldCount
`.
..
method
::
Record
.
GetInteger
(
field
)
Return
the
value
of
*
field
*
as
an
integer
where
possible
.
*
field
*
must
be
an
integer
.
..
method
::
Record
.
GetString
(
field
)
Return
the
value
of
*
field
*
as
a
string
where
possible
.
*
field
*
must
be
an
integer
.
..
method
::
Record
.
SetString
(
field
,
value
)
..
method
::
Record
.
SetString
(
field
,
value
)
Set
*
field
*
to
*
value
*
through
:
cfunc
:`
MsiRecordSetString
`.
*
field
*
must
be
an
Set
*
field
*
to
*
value
*
through
:
cfunc
:`
MsiRecordSetString
`.
*
field
*
must
be
an
...
@@ -543,3 +555,4 @@ definitions. Currently, these definitions are based on MSI version 2.0.
...
@@ -543,3 +555,4 @@ definitions. Currently, these definitions are based on MSI version 2.0.
This
module
contains
definitions
for
the
UIText
and
ActionText
tables
,
for
the
This
module
contains
definitions
for
the
UIText
and
ActionText
tables
,
for
the
standard
installer
actions
.
standard
installer
actions
.
Misc/NEWS
Dosyayı görüntüle @
ffe62ed4
...
@@ -72,6 +72,9 @@ Extension Modules
...
@@ -72,6 +72,9 @@ Extension Modules
Library
Library
-------
-------
- Patch #2125: Add GetInteger and GetString methods for
msilib.Record objects.
- Issue #2782: The datetime module's strftime methods now accept
- Issue #2782: The datetime module's strftime methods now accept
unicode format strings just as time.strftime always has.
unicode format strings just as time.strftime always has.
...
...
PC/_msi.c
Dosyayı görüntüle @
ffe62ed4
...
@@ -338,6 +338,49 @@ record_getfieldcount(msiobj* record, PyObject* args)
...
@@ -338,6 +338,49 @@ record_getfieldcount(msiobj* record, PyObject* args)
return
PyInt_FromLong
(
MsiRecordGetFieldCount
(
record
->
h
));
return
PyInt_FromLong
(
MsiRecordGetFieldCount
(
record
->
h
));
}
}
static
PyObject
*
record_getinteger
(
msiobj
*
record
,
PyObject
*
args
)
{
unsigned
int
field
;
int
status
;
if
(
!
PyArg_ParseTuple
(
args
,
"I:GetInteger"
,
&
field
))
return
NULL
;
status
=
MsiRecordGetInteger
(
record
->
h
,
field
);
if
(
status
==
MSI_NULL_INTEGER
){
PyErr_SetString
(
MSIError
,
"could not convert record field to integer"
);
return
NULL
;
}
return
PyInt_FromLong
((
long
)
status
);
}
static
PyObject
*
record_getstring
(
msiobj
*
record
,
PyObject
*
args
)
{
unsigned
int
field
;
unsigned
int
status
;
char
buf
[
2000
];
char
*
res
=
buf
;
DWORD
size
=
sizeof
(
buf
);
PyObject
*
string
;
if
(
!
PyArg_ParseTuple
(
args
,
"I:GetString"
,
&
field
))
return
NULL
;
status
=
MsiRecordGetString
(
record
->
h
,
field
,
res
,
&
size
);
if
(
status
==
ERROR_MORE_DATA
)
{
res
=
(
char
*
)
malloc
(
size
+
1
);
if
(
res
==
NULL
)
return
PyErr_NoMemory
();
status
=
MsiRecordGetString
(
record
->
h
,
field
,
res
,
&
size
);
}
if
(
status
!=
ERROR_SUCCESS
)
return
msierror
((
int
)
status
);
string
=
PyString_FromString
(
res
);
if
(
buf
!=
res
)
free
(
res
);
return
string
;
}
static
PyObject
*
static
PyObject
*
record_cleardata
(
msiobj
*
record
,
PyObject
*
args
)
record_cleardata
(
msiobj
*
record
,
PyObject
*
args
)
{
{
...
@@ -405,6 +448,10 @@ record_setinteger(msiobj* record, PyObject *args)
...
@@ -405,6 +448,10 @@ record_setinteger(msiobj* record, PyObject *args)
static
PyMethodDef
record_methods
[]
=
{
static
PyMethodDef
record_methods
[]
=
{
{
"GetFieldCount"
,
(
PyCFunction
)
record_getfieldcount
,
METH_NOARGS
,
{
"GetFieldCount"
,
(
PyCFunction
)
record_getfieldcount
,
METH_NOARGS
,
PyDoc_STR
(
"GetFieldCount() -> int
\n
Wraps MsiRecordGetFieldCount"
)},
PyDoc_STR
(
"GetFieldCount() -> int
\n
Wraps MsiRecordGetFieldCount"
)},
{
"GetInteger"
,
(
PyCFunction
)
record_getinteger
,
METH_VARARGS
,
PyDoc_STR
(
"GetInteger(field) -> int
\n
Wraps MsiRecordGetInteger"
)},
{
"GetString"
,
(
PyCFunction
)
record_getstring
,
METH_VARARGS
,
PyDoc_STR
(
"GetString(field) -> string
\n
Wraps MsiRecordGetString"
)},
{
"SetString"
,
(
PyCFunction
)
record_setstring
,
METH_VARARGS
,
{
"SetString"
,
(
PyCFunction
)
record_setstring
,
METH_VARARGS
,
PyDoc_STR
(
"SetString(field,str) -> None
\n
Wraps MsiRecordSetString"
)},
PyDoc_STR
(
"SetString(field,str) -> None
\n
Wraps MsiRecordSetString"
)},
{
"SetStream"
,
(
PyCFunction
)
record_setstream
,
METH_VARARGS
,
{
"SetStream"
,
(
PyCFunction
)
record_setstream
,
METH_VARARGS
,
...
...
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