mySQLDBCtrlAPI 1.2510.23__py3-none-any.whl → 1.2510.26__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of mySQLDBCtrlAPI might be problematic. Click here for more details.
- mySQLDBCtrlAPI/mySQLDBCtrl.py +40 -8
- {mysqldbctrlapi-1.2510.23.dist-info → mysqldbctrlapi-1.2510.26.dist-info}/METADATA +1 -1
- mysqldbctrlapi-1.2510.26.dist-info/RECORD +7 -0
- mysqldbctrlapi-1.2510.23.dist-info/RECORD +0 -7
- {mysqldbctrlapi-1.2510.23.dist-info → mysqldbctrlapi-1.2510.26.dist-info}/WHEEL +0 -0
- {mysqldbctrlapi-1.2510.23.dist-info → mysqldbctrlapi-1.2510.26.dist-info}/licenses/LICENSE +0 -0
- {mysqldbctrlapi-1.2510.23.dist-info → mysqldbctrlapi-1.2510.26.dist-info}/top_level.txt +0 -0
mySQLDBCtrlAPI/mySQLDBCtrl.py
CHANGED
|
@@ -136,6 +136,8 @@ class CLASS_mySQLDBCtrl:
|
|
|
136
136
|
# 傳回: obj_Query
|
|
137
137
|
# ----------------------------------------------------------------------
|
|
138
138
|
def CUF_DB_OpenSQL(self, Pobj_Connection, Pms_SQL):
|
|
139
|
+
obj_DataSet: Any;
|
|
140
|
+
|
|
139
141
|
Pobj_Connection.commit();
|
|
140
142
|
# ------------------------------------------------------------
|
|
141
143
|
obj_Query = Pobj_Connection.cursor();
|
|
@@ -147,11 +149,13 @@ class CLASS_mySQLDBCtrl:
|
|
|
147
149
|
self.CVmi_qryRECCNT = self.CUF_DB_RecordCount(obj_Query);
|
|
148
150
|
# ------------------------------------------------------------
|
|
149
151
|
if(self.CVmi_qryRECCNT > 0):
|
|
150
|
-
self.CUF_DB_Next(obj_Query);
|
|
152
|
+
obj_DataSet = self.CUF_DB_Next(obj_Query);
|
|
151
153
|
# ------------------------------------------------------------
|
|
152
|
-
return(obj_Query);
|
|
154
|
+
return(obj_Query, obj_DataSet);
|
|
153
155
|
# ----------------------------------------------------------------------
|
|
154
156
|
def CUF_DB_OpenSQL_utf8(self, Pobj_Connection, Pms_SQL):
|
|
157
|
+
obj_DataSet: Any;
|
|
158
|
+
|
|
155
159
|
Pobj_Connection.commit();
|
|
156
160
|
# ------------------------------------------------------------
|
|
157
161
|
obj_Query = Pobj_Connection.cursor();
|
|
@@ -163,13 +167,13 @@ class CLASS_mySQLDBCtrl:
|
|
|
163
167
|
self.CVmi_qryRECCNT = self.CUF_DB_RecordCount(obj_Query);
|
|
164
168
|
# ------------------------------------------------------------
|
|
165
169
|
if(self.CVmi_qryRECCNT > 0):
|
|
166
|
-
self.CUF_DB_Next(obj_Query);
|
|
170
|
+
obj_DataSet = self.CUF_DB_Next(obj_Query);
|
|
167
171
|
# ------------------------------------------------------------
|
|
168
|
-
return(obj_Query);
|
|
172
|
+
return(obj_Query, obj_DataSet);
|
|
169
173
|
|
|
170
174
|
|
|
171
175
|
# ----------------------------------------------------------------------
|
|
172
|
-
# 功能: 擷取資料錄
|
|
176
|
+
# 功能: 擷取資料錄 (下一筆)
|
|
173
177
|
# 傳入:
|
|
174
178
|
# 傳回: obj_Field
|
|
175
179
|
# ----------------------------------------------------------------------
|
|
@@ -179,7 +183,10 @@ class CLASS_mySQLDBCtrl:
|
|
|
179
183
|
return(Pobj_Query.fetchone());
|
|
180
184
|
# ----------------------------------------------------------------------
|
|
181
185
|
def CUF_DB_Next(self, Pobj_Query):
|
|
182
|
-
self.CUF_DB_FETCH(Pobj_Query);
|
|
186
|
+
return(self.CUF_DB_FETCH(Pobj_Query));
|
|
187
|
+
# ----------------------------------------------------------------------
|
|
188
|
+
def CUF_Next(self, Pobj_Query):
|
|
189
|
+
return(self.CUF_DB_FETCH(Pobj_Query));
|
|
183
190
|
|
|
184
191
|
|
|
185
192
|
# ----------------------------------------------------------------------
|
|
@@ -250,6 +257,10 @@ class CLASS_mySQLDBCtrl:
|
|
|
250
257
|
# ----------------------------------------------------------------------
|
|
251
258
|
def CUF_str_utf8(self, Pobj_DataSet):
|
|
252
259
|
return(str(Pobj_DataSet).encode("latin1").decode("big5"));
|
|
260
|
+
# ----------------------------------------------------------------------
|
|
261
|
+
def CUF_utf8(self, Pobj_DataSet):
|
|
262
|
+
return(str(Pobj_DataSet).encode("latin1").decode("big5"));
|
|
263
|
+
|
|
253
264
|
|
|
254
265
|
# ----------------------------------------------------------------------
|
|
255
266
|
# 功能: 轉換字串編碼 (utf-8 -> big5)
|
|
@@ -259,6 +270,9 @@ class CLASS_mySQLDBCtrl:
|
|
|
259
270
|
# ----------------------------------------------------------------------
|
|
260
271
|
def CUF_str_big5(self, Pobj_DataSet):
|
|
261
272
|
return(str(Pobj_DataSet).encode("big5").decode("latin1"));
|
|
273
|
+
# ----------------------------------------------------------------------
|
|
274
|
+
def CUF_big5(self, Pobj_DataSet):
|
|
275
|
+
return(str(Pobj_DataSet).encode("big5").decode("latin1"));
|
|
262
276
|
|
|
263
277
|
|
|
264
278
|
# ----------------------------------------------------------------------
|
|
@@ -277,6 +291,9 @@ class CLASS_mySQLDBCtrl:
|
|
|
277
291
|
# --------------------------------------------------
|
|
278
292
|
with open(Pms_FileName, "wb") as obj_FP:
|
|
279
293
|
obj_FP.write(obj_FileData);
|
|
294
|
+
# ----------------------------------------------------------------------
|
|
295
|
+
def CUF_GET_Blob(self, Pobj_Query, Pms_BlobFieldName, Pms_FileName):
|
|
296
|
+
self.CUF_GetBlobField(Pobj_Query, Pms_BlobFieldName, Pms_FileName);
|
|
280
297
|
|
|
281
298
|
|
|
282
299
|
# ----------------------------------------------------------------------
|
|
@@ -301,7 +318,10 @@ class CLASS_mySQLDBCtrl:
|
|
|
301
318
|
Pobj_Query.execute(ms_SQL, (obj_FileData,));
|
|
302
319
|
# --------------------------------------------------
|
|
303
320
|
self.CUobj_Conn.commit();
|
|
304
|
-
|
|
321
|
+
# ----------------------------------------------------------------------
|
|
322
|
+
def CUF_SET_BLOB(self, Pobj_Query, Pms_TableName, Pms_QUERY, Pms_BlobFieldName, Pms_FileName):
|
|
323
|
+
self.CUF_SetBlobField(Pobj_Query, Pms_TableName, Pms_QUERY, Pms_BlobFieldName, Pms_FileName);
|
|
324
|
+
|
|
305
325
|
|
|
306
326
|
# --------------------------------------------------------------------------------
|
|
307
327
|
# FUNC: 取得伺服主機系統日期時間
|
|
@@ -444,4 +464,16 @@ if(__name__ == '__main__'):
|
|
|
444
464
|
ms_SQL = "SELECT * FROM _def_fileservicemedia_d "\
|
|
445
465
|
" WHERE FolderType=1 AND MEDIAID=1 AND BlockID=1 ";
|
|
446
466
|
obj_Query = Gobj_mySQLDBCtrl.CUF_DB_OpenSQL(Gobj_Conn, ms_SQL);
|
|
447
|
-
Gobj_mySQLDBCtrl.CUF_GetBlobField(obj_Query, "Media_Block", "C:\\temp\\PPPKKK.zip");
|
|
467
|
+
Gobj_mySQLDBCtrl.CUF_GetBlobField(obj_Query, "Media_Block", "C:\\temp\\PPPKKK.zip");
|
|
468
|
+
|
|
469
|
+
# ----------------------------------------------------------------------
|
|
470
|
+
ms_SQL = "SELECT * From sysuserinfo ORDER BY USERID ";
|
|
471
|
+
obj_ZQuery, obj_DataSet = obj_mySQLDBCtrl.CUF_DB_OpenSQL(obj_ZConn, ms_SQL);
|
|
472
|
+
|
|
473
|
+
while not obj_mySQLDBCtrl.CUF_DB_Eof(obj_ZQuery):
|
|
474
|
+
print("USERID="+ obj_mySQLDBCtrl.CUF_utf8(obj_DataSet["LOGIN"]));
|
|
475
|
+
print("PASSWD="+ obj_mySQLDBCtrl.CUF_utf8(obj_DataSet["PASSWD"]));
|
|
476
|
+
obj_DataSet = obj_mySQLDBCtrl.CUF_Next(obj_ZQuery);
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
mySQLDBCtrlAPI/__init__.py,sha256=WAATQWzZgzaGObOW3SapBNZgB6n6Kr9Px_uSXdxj1vY,101
|
|
2
|
+
mySQLDBCtrlAPI/mySQLDBCtrl.py,sha256=sCjQLBD26d6HRTZYZCEniJF-cZ2Zrl_pSFhrn2gH2lY,23942
|
|
3
|
+
mysqldbctrlapi-1.2510.26.dist-info/licenses/LICENSE,sha256=bTN6shImvjBn0VScA1LIqy7LH3B_O6XZieGPnoT4Gxk,1054
|
|
4
|
+
mysqldbctrlapi-1.2510.26.dist-info/METADATA,sha256=fnxorZnt53q4mBqdBxThQWnJL8p3MKScAnIy-w2_KbQ,1961
|
|
5
|
+
mysqldbctrlapi-1.2510.26.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
6
|
+
mysqldbctrlapi-1.2510.26.dist-info/top_level.txt,sha256=onworg8ic7UQRjmAT-NpGAJFJb4X9hU1rOlYUCD_gng,15
|
|
7
|
+
mysqldbctrlapi-1.2510.26.dist-info/RECORD,,
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
mySQLDBCtrlAPI/__init__.py,sha256=WAATQWzZgzaGObOW3SapBNZgB6n6Kr9Px_uSXdxj1vY,101
|
|
2
|
-
mySQLDBCtrlAPI/mySQLDBCtrl.py,sha256=eK9HYIVq22c5lYn8iQ-aGBGjop0d1Atg_ZcCo_MpffQ,22288
|
|
3
|
-
mysqldbctrlapi-1.2510.23.dist-info/licenses/LICENSE,sha256=bTN6shImvjBn0VScA1LIqy7LH3B_O6XZieGPnoT4Gxk,1054
|
|
4
|
-
mysqldbctrlapi-1.2510.23.dist-info/METADATA,sha256=RpS4a2xccvV378oBa-KJbKzs2Bngvw3ora_jMfv6X_Q,1961
|
|
5
|
-
mysqldbctrlapi-1.2510.23.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
6
|
-
mysqldbctrlapi-1.2510.23.dist-info/top_level.txt,sha256=onworg8ic7UQRjmAT-NpGAJFJb4X9hU1rOlYUCD_gng,15
|
|
7
|
-
mysqldbctrlapi-1.2510.23.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|