@@ -19,15 +19,15 @@ static PyObject* Application_new(PyTypeObject *type, PyObject *args, PyObject *k
1919
2020static int Application_init (Application *self, PyObject *args, PyObject *kwds)
2121{
22- wchar_t * appId = L "" ;
22+ char * appId = " " ;
2323 static char *kwlist[] = { " app_id" , NULL };
24- if (!PyArg_ParseTupleAndKeywords (args, kwds, " |u " , kwlist, &appId))
24+ if (!PyArg_ParseTupleAndKeywords (args, kwds, " |s " , kwlist, &appId))
2525 return -1 ;
2626
2727 try
2828 {
2929 AllowThreads (&self->cs , [&]() {
30- self->app = std::make_shared<MI::Application>(appId);
30+ self->app = std::make_shared<MI::Application>(ToWstring ( appId). c_str () );
3131 });
3232 return 0 ;
3333 }
@@ -40,12 +40,12 @@ static int Application_init(Application *self, PyObject *args, PyObject *kwds)
4040
4141static PyObject* Application_NewSession (Application *self, PyObject *args, PyObject *kwds)
4242{
43- wchar_t * protocol = L "" ;
44- wchar_t * computerName = L " ." ;
43+ char * protocol = " " ;
44+ char * computerName = " ." ;
4545 PyObject* destinationOptions = NULL ;
4646
4747 static char *kwlist[] = { " protocol" , " computer_name" , " destination_options" , NULL };
48- if (!PyArg_ParseTupleAndKeywords (args, kwds, " |uuO " , kwlist, &protocol, &computerName, &destinationOptions))
48+ if (!PyArg_ParseTupleAndKeywords (args, kwds, " |ssO " , kwlist, &protocol, &computerName, &destinationOptions))
4949 return NULL ;
5050
5151 try
@@ -57,7 +57,7 @@ static PyObject* Application_NewSession(Application *self, PyObject *args, PyObj
5757
5858 std::shared_ptr<MI::Session> session;
5959 AllowThreads (&self->cs , [&]() {
60- session = self->app ->NewSession (protocol, computerName,
60+ session = self->app ->NewSession (ToWstring ( protocol). c_str (), ToWstring ( computerName). c_str () ,
6161 !CheckPyNone (destinationOptions) ? ((DestinationOptions*)destinationOptions)->destinationOptions : NULL );
6262 });
6363 return (PyObject*)Session_New (session);
@@ -84,10 +84,10 @@ static void Application_dealloc(Application* self)
8484static PyObject* Application_NewMethodInboundParameters (Application *self, PyObject *args, PyObject *kwds)
8585{
8686 PyObject* pyClass = NULL ;
87- wchar_t * methodName = NULL ;
87+ char * methodName = NULL ;
8888
8989 static char *kwlist[] = { " mi_class" , " method_name" , NULL };
90- if (!PyArg_ParseTupleAndKeywords (args, kwds, " Ou " , kwlist, &pyClass, &methodName))
90+ if (!PyArg_ParseTupleAndKeywords (args, kwds, " Os " , kwlist, &pyClass, &methodName))
9191 return NULL ;
9292
9393 try
@@ -97,7 +97,7 @@ static PyObject* Application_NewMethodInboundParameters(Application *self, PyObj
9797
9898 std::shared_ptr<MI::Instance> instance;
9999 AllowThreads (&self->cs , [&]() {
100- instance = self->app ->NewMethodParamsInstance (*((Class*)pyClass)->miClass , methodName);
100+ instance = self->app ->NewMethodParamsInstance (*((Class*)pyClass)->miClass , ToWstring ( methodName). c_str () );
101101 });
102102 return (PyObject*)Instance_New (instance);
103103 }
@@ -110,16 +110,16 @@ static PyObject* Application_NewMethodInboundParameters(Application *self, PyObj
110110
111111static PyObject* Application_NewInstance (Application *self, PyObject *args, PyObject *kwds)
112112{
113- wchar_t * className = NULL ;
113+ char * className = NULL ;
114114 static char *kwlist[] = { " class_name" , NULL };
115- if (!PyArg_ParseTupleAndKeywords (args, kwds, " u " , kwlist, &className))
115+ if (!PyArg_ParseTupleAndKeywords (args, kwds, " s " , kwlist, &className))
116116 return NULL ;
117117
118118 try
119119 {
120120 std::shared_ptr<MI::Instance> instance;
121121 AllowThreads (&self->cs , [&]() {
122- instance = self->app ->NewInstance (className);
122+ instance = self->app ->NewInstance (ToWstring ( className). c_str () );
123123 });
124124 return (PyObject*)Instance_New (instance);
125125 }
@@ -132,10 +132,10 @@ static PyObject* Application_NewInstance(Application *self, PyObject *args, PyOb
132132
133133static PyObject* Application_NewInstanceFromClass (Application *self, PyObject *args, PyObject *kwds)
134134{
135- wchar_t * className = NULL ;
135+ char * className = NULL ;
136136 PyObject* miClass = NULL ;
137137 static char *kwlist[] = { " class_name" , " mi_class" , NULL };
138- if (!PyArg_ParseTupleAndKeywords (args, kwds, " uO " , kwlist, &className, &miClass))
138+ if (!PyArg_ParseTupleAndKeywords (args, kwds, " sO " , kwlist, &className, &miClass))
139139 return NULL ;
140140
141141 try
@@ -145,7 +145,7 @@ static PyObject* Application_NewInstanceFromClass(Application *self, PyObject *a
145145
146146 std::shared_ptr<MI::Instance> instance;
147147 AllowThreads (&self->cs , [&]() {
148- instance = self->app ->NewInstanceFromClass (className, *((Class*)miClass)->miClass );
148+ instance = self->app ->NewInstanceFromClass (ToWstring ( className). c_str () , *((Class*)miClass)->miClass );
149149 });
150150 return (PyObject*)Instance_New (instance);
151151 }
0 commit comments