re-common 10.0.39__py3-none-any.whl → 10.0.40__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.
- re_common/baselibrary/__init__.py +4 -4
- re_common/baselibrary/baseabs/__init__.py +6 -6
- re_common/baselibrary/baseabs/baseabs.py +26 -26
- re_common/baselibrary/database/mbuilder.py +132 -132
- re_common/baselibrary/database/moudle.py +93 -93
- re_common/baselibrary/database/msqlite3.py +194 -194
- re_common/baselibrary/database/mysql.py +169 -169
- re_common/baselibrary/database/sql_factory.py +26 -26
- re_common/baselibrary/mthread/MThreadingRun.py +486 -486
- re_common/baselibrary/mthread/MThreadingRunEvent.py +349 -349
- re_common/baselibrary/mthread/__init__.py +2 -2
- re_common/baselibrary/mthread/mythreading.py +695 -695
- re_common/baselibrary/pakge_other/socks.py +404 -404
- re_common/baselibrary/readconfig/config_factory.py +18 -18
- re_common/baselibrary/readconfig/ini_config.py +317 -317
- re_common/baselibrary/readconfig/toml_config.py +49 -49
- re_common/baselibrary/temporary/envdata.py +36 -36
- re_common/baselibrary/tools/all_requests/aiohttp_request.py +118 -118
- re_common/baselibrary/tools/all_requests/httpx_requet.py +102 -102
- re_common/baselibrary/tools/all_requests/mrequest.py +412 -412
- re_common/baselibrary/tools/all_requests/requests_request.py +81 -81
- re_common/baselibrary/tools/batch_compre/bijiao_batch.py +31 -31
- re_common/baselibrary/tools/contrast_db3.py +123 -123
- re_common/baselibrary/tools/copy_file.py +39 -39
- re_common/baselibrary/tools/db3_2_sizedb3.py +102 -102
- re_common/baselibrary/tools/foreachgz.py +39 -39
- re_common/baselibrary/tools/get_attr.py +10 -10
- re_common/baselibrary/tools/image_to_pdf.py +61 -61
- re_common/baselibrary/tools/java_code_deal.py +139 -139
- re_common/baselibrary/tools/javacode.py +79 -79
- re_common/baselibrary/tools/mdb_db3.py +48 -48
- re_common/baselibrary/tools/merge_file.py +171 -171
- re_common/baselibrary/tools/merge_gz_file.py +165 -165
- re_common/baselibrary/tools/mhdfstools/down_hdfs_files.py +42 -42
- re_common/baselibrary/tools/mhdfstools/hdfst.py +42 -42
- re_common/baselibrary/tools/mhdfstools/up_hdfs_files.py +38 -38
- re_common/baselibrary/tools/mongo_tools.py +50 -50
- re_common/baselibrary/tools/move_file.py +170 -170
- re_common/baselibrary/tools/move_mongo/mongo_table_to_file.py +63 -63
- re_common/baselibrary/tools/move_mongo/move_mongo_table.py +354 -354
- re_common/baselibrary/tools/move_mongo/use_mttf.py +18 -18
- re_common/baselibrary/tools/move_mongo/use_mv.py +93 -93
- re_common/baselibrary/tools/mpandas/mpandasreadexcel.py +125 -125
- re_common/baselibrary/tools/mpandas/pandas_visualization.py +7 -7
- re_common/baselibrary/tools/myparsel.py +104 -104
- re_common/baselibrary/tools/rename_dir_file.py +37 -37
- re_common/baselibrary/tools/sequoiadb_utils.py +398 -398
- re_common/baselibrary/tools/split_line_to_many.py +25 -25
- re_common/baselibrary/tools/stringtodicts.py +33 -33
- re_common/baselibrary/tools/workwechant_bot.py +84 -84
- re_common/baselibrary/utils/baseaiohttp.py +296 -296
- re_common/baselibrary/utils/baseaiomysql.py +87 -87
- re_common/baselibrary/utils/baseallstep.py +191 -191
- re_common/baselibrary/utils/baseavro.py +19 -19
- re_common/baselibrary/utils/baseboto3.py +291 -291
- re_common/baselibrary/utils/basecsv.py +32 -32
- re_common/baselibrary/utils/basedict.py +133 -133
- re_common/baselibrary/utils/basedir.py +241 -241
- re_common/baselibrary/utils/baseencode.py +351 -351
- re_common/baselibrary/utils/baseencoding.py +28 -28
- re_common/baselibrary/utils/baseesdsl.py +86 -86
- re_common/baselibrary/utils/baseexcel.py +264 -264
- re_common/baselibrary/utils/baseexcept.py +109 -109
- re_common/baselibrary/utils/basefile.py +654 -654
- re_common/baselibrary/utils/baseftp.py +214 -214
- re_common/baselibrary/utils/basegzip.py +60 -60
- re_common/baselibrary/utils/basehdfs.py +135 -135
- re_common/baselibrary/utils/basehttpx.py +268 -268
- re_common/baselibrary/utils/baseip.py +87 -87
- re_common/baselibrary/utils/basejson.py +2 -2
- re_common/baselibrary/utils/baselist.py +32 -32
- re_common/baselibrary/utils/basemotor.py +190 -190
- re_common/baselibrary/utils/basemssql.py +98 -98
- re_common/baselibrary/utils/baseodbc.py +113 -113
- re_common/baselibrary/utils/basepandas.py +302 -302
- re_common/baselibrary/utils/basepeewee.py +11 -11
- re_common/baselibrary/utils/basepika.py +180 -180
- re_common/baselibrary/utils/basepydash.py +143 -143
- re_common/baselibrary/utils/basepymongo.py +230 -230
- re_common/baselibrary/utils/basequeue.py +22 -22
- re_common/baselibrary/utils/baserar.py +57 -57
- re_common/baselibrary/utils/baserequest.py +279 -279
- re_common/baselibrary/utils/baseset.py +8 -8
- re_common/baselibrary/utils/basesmb.py +403 -403
- re_common/baselibrary/utils/basestring.py +382 -382
- re_common/baselibrary/utils/basetime.py +320 -320
- re_common/baselibrary/utils/baseurl.py +121 -121
- re_common/baselibrary/utils/basezip.py +57 -57
- re_common/baselibrary/utils/core/__init__.py +7 -7
- re_common/baselibrary/utils/core/bottomutils.py +18 -18
- re_common/baselibrary/utils/core/mdeprecated.py +327 -327
- re_common/baselibrary/utils/core/mlamada.py +16 -16
- re_common/baselibrary/utils/core/msginfo.py +25 -25
- re_common/baselibrary/utils/core/requests_core.py +103 -103
- re_common/baselibrary/utils/fateadm.py +429 -429
- re_common/baselibrary/utils/importfun.py +123 -123
- re_common/baselibrary/utils/mfaker.py +57 -57
- re_common/baselibrary/utils/my_abc/__init__.py +3 -3
- re_common/baselibrary/utils/my_abc/better_abc.py +32 -32
- re_common/baselibrary/utils/mylogger.py +414 -414
- re_common/baselibrary/utils/myredisclient.py +861 -861
- re_common/baselibrary/utils/pipupgrade.py +21 -21
- re_common/baselibrary/utils/ringlist.py +85 -85
- re_common/baselibrary/utils/version_compare.py +36 -36
- re_common/baselibrary/utils/ydmhttp.py +126 -126
- re_common/facade/lazy_import.py +11 -11
- re_common/facade/loggerfacade.py +25 -25
- re_common/facade/mysqlfacade.py +467 -467
- re_common/facade/now.py +31 -31
- re_common/facade/sqlite3facade.py +257 -257
- re_common/facade/use/mq_use_facade.py +83 -83
- re_common/facade/use/proxy_use_facade.py +19 -19
- re_common/libtest/base_dict_test.py +19 -19
- re_common/libtest/baseavro_test.py +13 -13
- re_common/libtest/basefile_test.py +14 -14
- re_common/libtest/basemssql_test.py +77 -77
- re_common/libtest/baseodbc_test.py +7 -7
- re_common/libtest/basepandas_test.py +38 -38
- re_common/libtest/get_attr_test/get_attr_test_settings.py +14 -14
- re_common/libtest/get_attr_test/settings.py +54 -54
- re_common/libtest/idencode_test.py +53 -53
- re_common/libtest/iniconfig_test.py +35 -35
- re_common/libtest/ip_test.py +34 -34
- re_common/libtest/merge_file_test.py +20 -20
- re_common/libtest/mfaker_test.py +8 -8
- re_common/libtest/mm3_test.py +31 -31
- re_common/libtest/mylogger_test.py +88 -88
- re_common/libtest/myparsel_test.py +27 -27
- re_common/libtest/mysql_test.py +151 -151
- re_common/libtest/pymongo_test.py +21 -21
- re_common/libtest/split_test.py +11 -11
- re_common/libtest/sqlite3_merge_test.py +5 -5
- re_common/libtest/sqlite3_test.py +34 -34
- re_common/libtest/tomlconfig_test.py +30 -30
- re_common/libtest/use_tools_test/__init__.py +2 -2
- re_common/libtest/user/__init__.py +4 -4
- re_common/studio/__init__.py +4 -4
- re_common/studio/assignment_expressions.py +36 -36
- re_common/studio/mydash/test1.py +18 -18
- re_common/studio/pydashstudio/first.py +9 -9
- re_common/studio/streamlitstudio/first_app.py +65 -65
- re_common/studio/streamlitstudio/uber_pickups.py +23 -23
- re_common/studio/test.py +18 -18
- re_common/v2/baselibrary/business_utils/BusinessStringUtil.py +219 -219
- re_common/v2/baselibrary/business_utils/baseencodeid.py +100 -100
- re_common/v2/baselibrary/business_utils/full_doi_path.py +116 -116
- re_common/v2/baselibrary/business_utils/rel_tools.py +6 -6
- re_common/v2/baselibrary/decorators/utils.py +59 -59
- re_common/v2/baselibrary/helpers/search_packge/NearestNeighbors_test.py +105 -105
- re_common/v2/baselibrary/helpers/search_packge/fit_text_match.py +253 -253
- re_common/v2/baselibrary/helpers/search_packge/scikit_learn_text_matcher.py +260 -260
- re_common/v2/baselibrary/helpers/search_packge/test.py +1 -1
- re_common/v2/baselibrary/s3object/baseboto3.py +230 -230
- re_common/v2/baselibrary/tools/WeChatRobot.py +95 -95
- re_common/v2/baselibrary/tools/ac_ahocorasick.py +75 -75
- re_common/v2/baselibrary/tools/concurrency.py +35 -35
- re_common/v2/baselibrary/tools/data_processer/base.py +53 -53
- re_common/v2/baselibrary/tools/data_processer/data_processer.py +508 -508
- re_common/v2/baselibrary/tools/data_processer/data_reader.py +187 -187
- re_common/v2/baselibrary/tools/data_processer/data_writer.py +38 -38
- re_common/v2/baselibrary/tools/dict_tools.py +44 -44
- re_common/v2/baselibrary/tools/dolphinscheduler.py +187 -187
- re_common/v2/baselibrary/tools/hdfs_base_processor.py +204 -204
- re_common/v2/baselibrary/tools/hdfs_bulk_processor.py +67 -67
- re_common/v2/baselibrary/tools/hdfs_data_processer.py +338 -338
- re_common/v2/baselibrary/tools/hdfs_line_processor.py +74 -74
- re_common/v2/baselibrary/tools/list_tools.py +69 -69
- re_common/v2/baselibrary/tools/resume_tracker.py +94 -94
- re_common/v2/baselibrary/tools/search_hash_tools.py +54 -54
- re_common/v2/baselibrary/tools/text_matcher.py +326 -326
- re_common/v2/baselibrary/tools/unionfind_tools.py +60 -60
- re_common/v2/baselibrary/utils/BusinessStringUtil.py +196 -196
- re_common/v2/baselibrary/utils/api_net_utils.py +270 -270
- re_common/v2/baselibrary/utils/author_smi.py +361 -361
- re_common/v2/baselibrary/utils/base_string_similarity.py +158 -158
- re_common/v2/baselibrary/utils/basedict.py +37 -37
- re_common/v2/baselibrary/utils/basehdfs.py +163 -163
- re_common/v2/baselibrary/utils/basepika.py +180 -180
- re_common/v2/baselibrary/utils/basetime.py +77 -77
- re_common/v2/baselibrary/utils/db.py +156 -156
- re_common/v2/baselibrary/utils/elasticsearch.py +46 -0
- re_common/v2/baselibrary/utils/json_cls.py +16 -16
- re_common/v2/baselibrary/utils/mq.py +83 -83
- re_common/v2/baselibrary/utils/n_ary_expression_tree.py +243 -243
- re_common/v2/baselibrary/utils/string_bool.py +186 -186
- re_common/v2/baselibrary/utils/string_clear.py +246 -246
- re_common/v2/baselibrary/utils/string_smi.py +18 -18
- re_common/v2/baselibrary/utils/stringutils.py +271 -271
- re_common/vip/base_step_process.py +11 -11
- re_common/vip/baseencodeid.py +90 -90
- re_common/vip/changetaskname.py +28 -28
- re_common/vip/core_var.py +24 -24
- re_common/vip/mmh3Hash.py +89 -89
- re_common/vip/proxy/allproxys.py +127 -127
- re_common/vip/proxy/allproxys_thread.py +159 -159
- re_common/vip/proxy/cnki_proxy.py +153 -153
- re_common/vip/proxy/kuaidaili.py +87 -87
- re_common/vip/proxy/proxy_all.py +113 -113
- re_common/vip/proxy/update_kuaidaili_0.py +42 -42
- re_common/vip/proxy/wanfang_proxy.py +152 -152
- re_common/vip/proxy/wp_proxy_all.py +181 -181
- re_common/vip/read_rawid_to_txt.py +91 -91
- re_common/vip/title/__init__.py +5 -5
- re_common/vip/title/transform/TransformBookTitleToZt.py +125 -125
- re_common/vip/title/transform/TransformConferenceTitleToZt.py +139 -139
- re_common/vip/title/transform/TransformCstadTitleToZt.py +195 -195
- re_common/vip/title/transform/TransformJournalTitleToZt.py +203 -203
- re_common/vip/title/transform/TransformPatentTitleToZt.py +132 -132
- re_common/vip/title/transform/TransformRegulationTitleToZt.py +114 -114
- re_common/vip/title/transform/TransformStandardTitleToZt.py +135 -135
- re_common/vip/title/transform/TransformThesisTitleToZt.py +135 -135
- re_common/vip/title/transform/__init__.py +10 -10
- {re_common-10.0.39.dist-info → re_common-10.0.40.dist-info}/LICENSE +201 -201
- {re_common-10.0.39.dist-info → re_common-10.0.40.dist-info}/METADATA +24 -16
- re_common-10.0.40.dist-info/RECORD +249 -0
- {re_common-10.0.39.dist-info → re_common-10.0.40.dist-info}/WHEEL +1 -1
- re_common-10.0.39.dist-info/RECORD +0 -248
- {re_common-10.0.39.dist-info → re_common-10.0.40.dist-info}/top_level.txt +0 -0
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
"""
|
|
6
|
-
CREATE YOUR DEFAULT_CONFIG !
|
|
7
|
-
|
|
8
|
-
Some configuration:
|
|
9
|
-
CONCURRENT_REQUESTS 并发数量
|
|
10
|
-
RETRIES 重试次数
|
|
11
|
-
DOWNLOAD_DELAY 下载延时
|
|
12
|
-
RETRY_DELAY 重试延时
|
|
13
|
-
DOWNLOAD_TIMEOUT 超时限制
|
|
14
|
-
USER_AGENT 用户代理
|
|
15
|
-
LOG_FILE 日志路径
|
|
16
|
-
LOG_LEVEL 日志等级
|
|
17
|
-
"""
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
CONCURRENT_REQUESTS = 20
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
MIDDLEWARE = [
|
|
27
|
-
'middlewares.middleware',
|
|
28
|
-
]
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
# PIPELINES = []
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
DEFAULT_REQUEST_CONFIG = {
|
|
37
|
-
"RETRIES": 0,
|
|
38
|
-
"DOWNLOAD_DELAY": 0,
|
|
39
|
-
"RETRY_DELAY": 0,
|
|
40
|
-
"DOWNLOAD_TIMEOUT": 10,
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
# '''生成日志文件'''
|
|
45
|
-
# LOG_FILE = './asyncpy.log'
|
|
46
|
-
# LOG_LEVEL = 'DEBUG'
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
# CLOSESPIDER_TIMEOUT = 10
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
"""
|
|
6
|
+
CREATE YOUR DEFAULT_CONFIG !
|
|
7
|
+
|
|
8
|
+
Some configuration:
|
|
9
|
+
CONCURRENT_REQUESTS 并发数量
|
|
10
|
+
RETRIES 重试次数
|
|
11
|
+
DOWNLOAD_DELAY 下载延时
|
|
12
|
+
RETRY_DELAY 重试延时
|
|
13
|
+
DOWNLOAD_TIMEOUT 超时限制
|
|
14
|
+
USER_AGENT 用户代理
|
|
15
|
+
LOG_FILE 日志路径
|
|
16
|
+
LOG_LEVEL 日志等级
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
CONCURRENT_REQUESTS = 20
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
MIDDLEWARE = [
|
|
27
|
+
'middlewares.middleware',
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
# PIPELINES = []
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
DEFAULT_REQUEST_CONFIG = {
|
|
37
|
+
"RETRIES": 0,
|
|
38
|
+
"DOWNLOAD_DELAY": 0,
|
|
39
|
+
"RETRY_DELAY": 0,
|
|
40
|
+
"DOWNLOAD_TIMEOUT": 10,
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
# '''生成日志文件'''
|
|
45
|
+
# LOG_FILE = './asyncpy.log'
|
|
46
|
+
# LOG_LEVEL = 'DEBUG'
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
# CLOSESPIDER_TIMEOUT = 10
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
55
|
USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3100.0 Safari/537.36"
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
from re_common.vip.baseencodeid import BaseLngid
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
def encode_id():
|
|
7
|
-
""""
|
|
8
|
-
由 sub_db_id 和 rawid 得到 lngid。
|
|
9
|
-
case_insensitive: 标识源网站的 rawid 是否区分大小写
|
|
10
|
-
"""
|
|
11
|
-
|
|
12
|
-
sub_db_id = "1"
|
|
13
|
-
rawid = "A44cbe4375b431741"
|
|
14
|
-
b = BaseLngid()
|
|
15
|
-
print("********区分大小写************")
|
|
16
|
-
lngid = b.GetLngid(sub_db_id,
|
|
17
|
-
rawid,
|
|
18
|
-
case_insensitive=True)
|
|
19
|
-
print(lngid)
|
|
20
|
-
print("********不区分大小写************")
|
|
21
|
-
lngid = b.GetLngid(sub_db_id,
|
|
22
|
-
rawid,
|
|
23
|
-
case_insensitive=False)
|
|
24
|
-
print(lngid)
|
|
25
|
-
|
|
26
|
-
def decode_id():
|
|
27
|
-
"""
|
|
28
|
-
limited_id 是由 lngid去除sub_db_id后得到的字符串
|
|
29
|
-
limited_id超过20长度时,为不可逆的
|
|
30
|
-
:return:
|
|
31
|
-
"""
|
|
32
|
-
limited_id_big = "F65F41FFCF049A3A21516C5CDFE40A22"
|
|
33
|
-
limited_id_small = "HLXMH9XNH5XMJC04HHXMJDG2J919Y"
|
|
34
|
-
limited_id_err = "123456" * 20
|
|
35
|
-
b = BaseLngid()
|
|
36
|
-
print("********区分大小写************")
|
|
37
|
-
rawid = b.GetRawid(limited_id_big,
|
|
38
|
-
case_insensitive=True)
|
|
39
|
-
print(rawid)
|
|
40
|
-
print("********不区分大小写************")
|
|
41
|
-
rawid = b.GetRawid(limited_id_small,
|
|
42
|
-
case_insensitive=False)
|
|
43
|
-
print(rawid)
|
|
44
|
-
print("*******limited_id超过20长度时*******")
|
|
45
|
-
rawid = b.GetRawid(limited_id_err,
|
|
46
|
-
case_insensitive=False)
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
if __name__ == '__main__':
|
|
53
|
-
# encode_id()
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
from re_common.vip.baseencodeid import BaseLngid
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def encode_id():
|
|
7
|
+
""""
|
|
8
|
+
由 sub_db_id 和 rawid 得到 lngid。
|
|
9
|
+
case_insensitive: 标识源网站的 rawid 是否区分大小写
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
sub_db_id = "1"
|
|
13
|
+
rawid = "A44cbe4375b431741"
|
|
14
|
+
b = BaseLngid()
|
|
15
|
+
print("********区分大小写************")
|
|
16
|
+
lngid = b.GetLngid(sub_db_id,
|
|
17
|
+
rawid,
|
|
18
|
+
case_insensitive=True)
|
|
19
|
+
print(lngid)
|
|
20
|
+
print("********不区分大小写************")
|
|
21
|
+
lngid = b.GetLngid(sub_db_id,
|
|
22
|
+
rawid,
|
|
23
|
+
case_insensitive=False)
|
|
24
|
+
print(lngid)
|
|
25
|
+
|
|
26
|
+
def decode_id():
|
|
27
|
+
"""
|
|
28
|
+
limited_id 是由 lngid去除sub_db_id后得到的字符串
|
|
29
|
+
limited_id超过20长度时,为不可逆的
|
|
30
|
+
:return:
|
|
31
|
+
"""
|
|
32
|
+
limited_id_big = "F65F41FFCF049A3A21516C5CDFE40A22"
|
|
33
|
+
limited_id_small = "HLXMH9XNH5XMJC04HHXMJDG2J919Y"
|
|
34
|
+
limited_id_err = "123456" * 20
|
|
35
|
+
b = BaseLngid()
|
|
36
|
+
print("********区分大小写************")
|
|
37
|
+
rawid = b.GetRawid(limited_id_big,
|
|
38
|
+
case_insensitive=True)
|
|
39
|
+
print(rawid)
|
|
40
|
+
print("********不区分大小写************")
|
|
41
|
+
rawid = b.GetRawid(limited_id_small,
|
|
42
|
+
case_insensitive=False)
|
|
43
|
+
print(rawid)
|
|
44
|
+
print("*******limited_id超过20长度时*******")
|
|
45
|
+
rawid = b.GetRawid(limited_id_err,
|
|
46
|
+
case_insensitive=False)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
if __name__ == '__main__':
|
|
53
|
+
# encode_id()
|
|
54
54
|
decode_id()
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
def test_BaseAbs_config():
|
|
2
|
-
"""
|
|
3
|
-
命令行下 在当前目录使用该命令测试
|
|
4
|
-
pytest iniconfig_test.py::test_BaseAbs_config -s
|
|
5
|
-
:return:
|
|
6
|
-
"""
|
|
7
|
-
from re_common.baselibrary.baseabs import BaseAbs
|
|
8
|
-
# get_conf_dict 参数
|
|
9
|
-
# configfile 不传为前面配置好的路径 也可以给新的路径
|
|
10
|
-
# encoding 指定编码
|
|
11
|
-
# keep_keys_case 保持建大写,配置为Fasle会全部小写
|
|
12
|
-
orderdicts = BaseAbs.get_config_factory().get_config_factory().ini_factory().set_config_path(
|
|
13
|
-
"./config.ini").set_keep_keys_case(False).builder().get_config_dict()
|
|
14
|
-
|
|
15
|
-
print(orderdicts)
|
|
16
|
-
print(orderdicts["db"])
|
|
17
|
-
print(orderdicts["db"]["psw"])
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
def test_Iniconfig_config():
|
|
21
|
-
"""
|
|
22
|
-
第二种简便用法
|
|
23
|
-
命令行下 在当前目录使用该命令测试
|
|
24
|
-
pytest iniconfig_test.py::test_Iniconfig_config -s
|
|
25
|
-
:return:
|
|
26
|
-
"""
|
|
27
|
-
from re_common.baselibrary import IniConfig
|
|
28
|
-
orderdicts = IniConfig("./config.ini").set_keep_keys_case(False).builder().get_config_dict()
|
|
29
|
-
print(orderdicts)
|
|
30
|
-
print(orderdicts["db"])
|
|
31
|
-
print(orderdicts["Db2"]["psw"])
|
|
32
|
-
|
|
33
|
-
# 已经导如facade 可以通过 facade 直接导入
|
|
34
|
-
# from facade import IniConfig
|
|
35
|
-
# 建议外部使用导入时 全部通过facade 导入
|
|
1
|
+
def test_BaseAbs_config():
|
|
2
|
+
"""
|
|
3
|
+
命令行下 在当前目录使用该命令测试
|
|
4
|
+
pytest iniconfig_test.py::test_BaseAbs_config -s
|
|
5
|
+
:return:
|
|
6
|
+
"""
|
|
7
|
+
from re_common.baselibrary.baseabs import BaseAbs
|
|
8
|
+
# get_conf_dict 参数
|
|
9
|
+
# configfile 不传为前面配置好的路径 也可以给新的路径
|
|
10
|
+
# encoding 指定编码
|
|
11
|
+
# keep_keys_case 保持建大写,配置为Fasle会全部小写
|
|
12
|
+
orderdicts = BaseAbs.get_config_factory().get_config_factory().ini_factory().set_config_path(
|
|
13
|
+
"./config.ini").set_keep_keys_case(False).builder().get_config_dict()
|
|
14
|
+
|
|
15
|
+
print(orderdicts)
|
|
16
|
+
print(orderdicts["db"])
|
|
17
|
+
print(orderdicts["db"]["psw"])
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def test_Iniconfig_config():
|
|
21
|
+
"""
|
|
22
|
+
第二种简便用法
|
|
23
|
+
命令行下 在当前目录使用该命令测试
|
|
24
|
+
pytest iniconfig_test.py::test_Iniconfig_config -s
|
|
25
|
+
:return:
|
|
26
|
+
"""
|
|
27
|
+
from re_common.baselibrary import IniConfig
|
|
28
|
+
orderdicts = IniConfig("./config.ini").set_keep_keys_case(False).builder().get_config_dict()
|
|
29
|
+
print(orderdicts)
|
|
30
|
+
print(orderdicts["db"])
|
|
31
|
+
print(orderdicts["Db2"]["psw"])
|
|
32
|
+
|
|
33
|
+
# 已经导如facade 可以通过 facade 直接导入
|
|
34
|
+
# from facade import IniConfig
|
|
35
|
+
# 建议外部使用导入时 全部通过facade 导入
|
re_common/libtest/ip_test.py
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
from re_common.baselibrary.utils.basehttpx import BaseHttpx
|
|
2
|
-
from re_common.baselibrary.utils.baserequest import BaseRequest
|
|
3
|
-
import re
|
|
4
|
-
|
|
5
|
-
url = "https://www.ip.cn/"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
def basehttpx_test_ip(proxy):
|
|
9
|
-
patten = "<code>(.*?)</code>"
|
|
10
|
-
bshttpx = BaseHttpx()
|
|
11
|
-
BoolResult, errString, r = bshttpx.base_sn_httpx(url=url,
|
|
12
|
-
proxies=proxy,
|
|
13
|
-
headers="")
|
|
14
|
-
ip = re.findall(patten,r.text)
|
|
15
|
-
if len(ip) == 0:
|
|
16
|
-
print(r.text)
|
|
17
|
-
else:
|
|
18
|
-
print(ip)
|
|
19
|
-
|
|
20
|
-
def baserequest_test_ip(proxy):
|
|
21
|
-
patten = "Your IP</span>: (.*?)</span>"
|
|
22
|
-
bsrequests = BaseRequest()
|
|
23
|
-
bsrequests.is_use_proxy(True)
|
|
24
|
-
bsrequests.set_proxy(proxy)
|
|
25
|
-
BoolResult, errString, r = bsrequests.base_request(url=url)
|
|
26
|
-
ip = re.findall(patten, r.text)
|
|
27
|
-
if len(ip) == 0:
|
|
28
|
-
print(r.text)
|
|
29
|
-
else:
|
|
30
|
-
print(ip)
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
if __name__ == '__main__':
|
|
34
|
-
basehttpx_test_ip("192.168.31.176:8012")
|
|
1
|
+
from re_common.baselibrary.utils.basehttpx import BaseHttpx
|
|
2
|
+
from re_common.baselibrary.utils.baserequest import BaseRequest
|
|
3
|
+
import re
|
|
4
|
+
|
|
5
|
+
url = "https://www.ip.cn/"
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def basehttpx_test_ip(proxy):
|
|
9
|
+
patten = "<code>(.*?)</code>"
|
|
10
|
+
bshttpx = BaseHttpx()
|
|
11
|
+
BoolResult, errString, r = bshttpx.base_sn_httpx(url=url,
|
|
12
|
+
proxies=proxy,
|
|
13
|
+
headers="")
|
|
14
|
+
ip = re.findall(patten,r.text)
|
|
15
|
+
if len(ip) == 0:
|
|
16
|
+
print(r.text)
|
|
17
|
+
else:
|
|
18
|
+
print(ip)
|
|
19
|
+
|
|
20
|
+
def baserequest_test_ip(proxy):
|
|
21
|
+
patten = "Your IP</span>: (.*?)</span>"
|
|
22
|
+
bsrequests = BaseRequest()
|
|
23
|
+
bsrequests.is_use_proxy(True)
|
|
24
|
+
bsrequests.set_proxy(proxy)
|
|
25
|
+
BoolResult, errString, r = bsrequests.base_request(url=url)
|
|
26
|
+
ip = re.findall(patten, r.text)
|
|
27
|
+
if len(ip) == 0:
|
|
28
|
+
print(r.text)
|
|
29
|
+
else:
|
|
30
|
+
print(ip)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
if __name__ == '__main__':
|
|
34
|
+
basehttpx_test_ip("192.168.31.176:8012")
|
|
35
35
|
baserequest_test_ip("192.168.31.176:8012")
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
###########################################
|
|
2
|
-
# 同项目调用基础包
|
|
3
|
-
import os
|
|
4
|
-
import sys
|
|
5
|
-
|
|
6
|
-
filepath = os.path.abspath(__file__)
|
|
7
|
-
pathlist = filepath.split(os.sep)
|
|
8
|
-
pathlist = pathlist[:-3]
|
|
9
|
-
TopPath = os.sep.join(pathlist)
|
|
10
|
-
sys.path.insert(0, TopPath)
|
|
11
|
-
print(TopPath)
|
|
12
|
-
############################################
|
|
13
|
-
from re_common.baselibrary.tools.merge_file import MergeFile
|
|
14
|
-
|
|
15
|
-
if __name__ == '__main__':
|
|
16
|
-
old_path = r'E:\work\pnasjournal\big_json\20200116'
|
|
17
|
-
new_path = r'E:\work\pnasjournal\big_json\new'
|
|
18
|
-
a = MergeFile()
|
|
19
|
-
# a.line_all_2_one(old_path,new_path)
|
|
20
|
-
a.block_all_2_one(old_path, new_path, dst_size=1024 * 1024 * 200, block_size=200 * 1024 * 1024)
|
|
1
|
+
###########################################
|
|
2
|
+
# 同项目调用基础包
|
|
3
|
+
import os
|
|
4
|
+
import sys
|
|
5
|
+
|
|
6
|
+
filepath = os.path.abspath(__file__)
|
|
7
|
+
pathlist = filepath.split(os.sep)
|
|
8
|
+
pathlist = pathlist[:-3]
|
|
9
|
+
TopPath = os.sep.join(pathlist)
|
|
10
|
+
sys.path.insert(0, TopPath)
|
|
11
|
+
print(TopPath)
|
|
12
|
+
############################################
|
|
13
|
+
from re_common.baselibrary.tools.merge_file import MergeFile
|
|
14
|
+
|
|
15
|
+
if __name__ == '__main__':
|
|
16
|
+
old_path = r'E:\work\pnasjournal\big_json\20200116'
|
|
17
|
+
new_path = r'E:\work\pnasjournal\big_json\new'
|
|
18
|
+
a = MergeFile()
|
|
19
|
+
# a.line_all_2_one(old_path,new_path)
|
|
20
|
+
a.block_all_2_one(old_path, new_path, dst_size=1024 * 1024 * 200, block_size=200 * 1024 * 1024)
|
re_common/libtest/mfaker_test.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import time
|
|
2
|
-
|
|
3
|
-
from re_common.baselibrary.utils.basefile import BaseFile
|
|
4
|
-
|
|
5
|
-
with open(r"\\192.168.31.171\caiji\test.txt", 'w', encoding="utf-8") as f:
|
|
6
|
-
while True:
|
|
7
|
-
f.write("test\n")
|
|
8
|
-
time.sleep(10)
|
|
1
|
+
import time
|
|
2
|
+
|
|
3
|
+
from re_common.baselibrary.utils.basefile import BaseFile
|
|
4
|
+
|
|
5
|
+
with open(r"\\192.168.31.171\caiji\test.txt", 'w', encoding="utf-8") as f:
|
|
6
|
+
while True:
|
|
7
|
+
f.write("test\n")
|
|
8
|
+
time.sleep(10)
|
|
9
9
|
print("1")
|
re_common/libtest/mm3_test.py
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import platform
|
|
2
|
-
import traceback
|
|
3
|
-
|
|
4
|
-
import win32file
|
|
5
|
-
|
|
6
|
-
from re_common.baselibrary.utils.basefile import BaseFile
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
# aa = r"F:\cnipa_ftp\SIPO\CN-PA-IMGS-10-A 中国发明专利申请公布标准化全文图像数据\20211109\20211109-1-002.ZIP"
|
|
10
|
-
# aa = r"F:\cnipa_ftp\SIPO\CN-PA-IMGS-10-A 中国发明专利申请公布标准化全文图像数据\20211109\20211109-1-001.ZIP"
|
|
11
|
-
def is_used(file_name):
|
|
12
|
-
if "Windows" == platform.system():
|
|
13
|
-
import win32file
|
|
14
|
-
try:
|
|
15
|
-
vHandle = win32file.CreateFile(file_name, win32file.GENERIC_READ, 0, None, win32file.OPEN_EXISTING,
|
|
16
|
-
win32file.FILE_ATTRIBUTE_NORMAL, None)
|
|
17
|
-
return int(vHandle) == win32file.INVALID_HANDLE_VALUE
|
|
18
|
-
except:
|
|
19
|
-
if "另一个程序正在使用此文件,进程无法访问。" in traceback.format_exc():
|
|
20
|
-
return True
|
|
21
|
-
else:
|
|
22
|
-
return False
|
|
23
|
-
finally:
|
|
24
|
-
try:
|
|
25
|
-
win32file.CloseHandle(vHandle)
|
|
26
|
-
except:
|
|
27
|
-
pass
|
|
28
|
-
else:
|
|
29
|
-
raise Exception("不是windows系统,请不要调用该函数判断文件是否被打开")
|
|
30
|
-
|
|
31
|
-
aa = is_used(r"\\192.168.31.171\caiji\test.txt")
|
|
1
|
+
import platform
|
|
2
|
+
import traceback
|
|
3
|
+
|
|
4
|
+
import win32file
|
|
5
|
+
|
|
6
|
+
from re_common.baselibrary.utils.basefile import BaseFile
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
# aa = r"F:\cnipa_ftp\SIPO\CN-PA-IMGS-10-A 中国发明专利申请公布标准化全文图像数据\20211109\20211109-1-002.ZIP"
|
|
10
|
+
# aa = r"F:\cnipa_ftp\SIPO\CN-PA-IMGS-10-A 中国发明专利申请公布标准化全文图像数据\20211109\20211109-1-001.ZIP"
|
|
11
|
+
def is_used(file_name):
|
|
12
|
+
if "Windows" == platform.system():
|
|
13
|
+
import win32file
|
|
14
|
+
try:
|
|
15
|
+
vHandle = win32file.CreateFile(file_name, win32file.GENERIC_READ, 0, None, win32file.OPEN_EXISTING,
|
|
16
|
+
win32file.FILE_ATTRIBUTE_NORMAL, None)
|
|
17
|
+
return int(vHandle) == win32file.INVALID_HANDLE_VALUE
|
|
18
|
+
except:
|
|
19
|
+
if "另一个程序正在使用此文件,进程无法访问。" in traceback.format_exc():
|
|
20
|
+
return True
|
|
21
|
+
else:
|
|
22
|
+
return False
|
|
23
|
+
finally:
|
|
24
|
+
try:
|
|
25
|
+
win32file.CloseHandle(vHandle)
|
|
26
|
+
except:
|
|
27
|
+
pass
|
|
28
|
+
else:
|
|
29
|
+
raise Exception("不是windows系统,请不要调用该函数判断文件是否被打开")
|
|
30
|
+
|
|
31
|
+
aa = is_used(r"\\192.168.31.171\caiji\test.txt")
|
|
32
32
|
print(aa)
|
|
@@ -1,89 +1,89 @@
|
|
|
1
|
-
import logging
|
|
2
|
-
|
|
3
|
-
from re_common.baselibrary.utils.basedir import BaseDir
|
|
4
|
-
from re_common.baselibrary import MLogger
|
|
5
|
-
from re_common.baselibrary.utils.basefile import BaseFile
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
def test_mlogger_streamlogger():
|
|
9
|
-
"""
|
|
10
|
-
只打印数据不计入文件
|
|
11
|
-
pytest mylogger_test.py::test_mlogger_streamlogger -s
|
|
12
|
-
:return:
|
|
13
|
-
"""
|
|
14
|
-
streamlogger = MLogger().streamlogger
|
|
15
|
-
streamlogger.setLevel(logging.DEBUG)
|
|
16
|
-
streamlogger.info("mesg info")
|
|
17
|
-
streamlogger.warning("msg warning")
|
|
18
|
-
streamlogger.warn("msg warn")
|
|
19
|
-
streamlogger.error("msg error")
|
|
20
|
-
streamlogger.debug("msg debug")
|
|
21
|
-
streamlogger.critical("msg critical")
|
|
22
|
-
streamlogger.exception("msg exception")
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
def test_mlogger_filelogger():
|
|
26
|
-
"""
|
|
27
|
-
测试将日志写入文件中 文件名以日期自动生成 如20200211.log
|
|
28
|
-
pytest mylogger_test.py::test_mlogger_filelogger -s
|
|
29
|
-
文件流的logger
|
|
30
|
-
:param filedir:
|
|
31
|
-
:return:
|
|
32
|
-
"""
|
|
33
|
-
filedir = BaseDir.get_file_dir_absolute(__file__)
|
|
34
|
-
filelogger = MLogger(filedir).filelogger
|
|
35
|
-
filelogger.setLevel(logging.DEBUG)
|
|
36
|
-
filelogger.info("mesg info")
|
|
37
|
-
filelogger.warning("msg warning")
|
|
38
|
-
filelogger.warn("msg warn")
|
|
39
|
-
filelogger.error("msg error")
|
|
40
|
-
filelogger.debug("msg debug")
|
|
41
|
-
filelogger.critical("msg critical")
|
|
42
|
-
filelogger.exception("msg exception")
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
def test_mlogger_allloger():
|
|
46
|
-
"""
|
|
47
|
-
测试将日志写入文件中 有一个以日期的总文件 以及每个级别的分文件
|
|
48
|
-
pytest mylogger_test.py::test_mlogger_allloger -s
|
|
49
|
-
文件流的logger
|
|
50
|
-
:param filedir:
|
|
51
|
-
:return:
|
|
52
|
-
"""
|
|
53
|
-
filedir = BaseDir.get_file_dir_absolute(__file__)
|
|
54
|
-
filedir = BaseFile.get_new_path(filedir, "log")
|
|
55
|
-
BaseDir.create_dir(filedir)
|
|
56
|
-
filelogger = MLogger(filedir).alllogger
|
|
57
|
-
filelogger.setLevel(logging.DEBUG)
|
|
58
|
-
filelogger.info("mesg info")
|
|
59
|
-
filelogger.warning("msg warning")
|
|
60
|
-
filelogger.warn("msg warn")
|
|
61
|
-
filelogger.error("msg error")
|
|
62
|
-
filelogger.debug("msg debug")
|
|
63
|
-
filelogger.critical("msg critical")
|
|
64
|
-
filelogger.exception("msg exception")
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
def test_mlogger_rotatingfilelogger():
|
|
68
|
-
"""
|
|
69
|
-
测试将日志写入文件中 文件名以日期自动生成 如20200211.log
|
|
70
|
-
pytest mylogger_test.py::test_mlogger_rotatingfilelogger -s
|
|
71
|
-
文件流的logger
|
|
72
|
-
:param filedir:
|
|
73
|
-
:return:
|
|
74
|
-
"""
|
|
75
|
-
filedir = BaseDir.get_file_dir_absolute(__file__)
|
|
76
|
-
filelogger = MLogger(filedir).RotatingFileLogger(filedir, None, maxBytes=1*1024*1024,
|
|
77
|
-
backupCount=10)
|
|
78
|
-
filelogger.setLevel(logging.DEBUG)
|
|
79
|
-
while True:
|
|
80
|
-
print("**************")
|
|
81
|
-
filelogger.info("mesg info")
|
|
82
|
-
filelogger.warning("msg warning")
|
|
83
|
-
filelogger.warn("msg warn")
|
|
84
|
-
filelogger.error("msg error")
|
|
85
|
-
filelogger.debug("msg debug")
|
|
86
|
-
filelogger.critical("msg critical")
|
|
87
|
-
filelogger.exception("msg exception")
|
|
88
|
-
|
|
1
|
+
import logging
|
|
2
|
+
|
|
3
|
+
from re_common.baselibrary.utils.basedir import BaseDir
|
|
4
|
+
from re_common.baselibrary import MLogger
|
|
5
|
+
from re_common.baselibrary.utils.basefile import BaseFile
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def test_mlogger_streamlogger():
|
|
9
|
+
"""
|
|
10
|
+
只打印数据不计入文件
|
|
11
|
+
pytest mylogger_test.py::test_mlogger_streamlogger -s
|
|
12
|
+
:return:
|
|
13
|
+
"""
|
|
14
|
+
streamlogger = MLogger().streamlogger
|
|
15
|
+
streamlogger.setLevel(logging.DEBUG)
|
|
16
|
+
streamlogger.info("mesg info")
|
|
17
|
+
streamlogger.warning("msg warning")
|
|
18
|
+
streamlogger.warn("msg warn")
|
|
19
|
+
streamlogger.error("msg error")
|
|
20
|
+
streamlogger.debug("msg debug")
|
|
21
|
+
streamlogger.critical("msg critical")
|
|
22
|
+
streamlogger.exception("msg exception")
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def test_mlogger_filelogger():
|
|
26
|
+
"""
|
|
27
|
+
测试将日志写入文件中 文件名以日期自动生成 如20200211.log
|
|
28
|
+
pytest mylogger_test.py::test_mlogger_filelogger -s
|
|
29
|
+
文件流的logger
|
|
30
|
+
:param filedir:
|
|
31
|
+
:return:
|
|
32
|
+
"""
|
|
33
|
+
filedir = BaseDir.get_file_dir_absolute(__file__)
|
|
34
|
+
filelogger = MLogger(filedir).filelogger
|
|
35
|
+
filelogger.setLevel(logging.DEBUG)
|
|
36
|
+
filelogger.info("mesg info")
|
|
37
|
+
filelogger.warning("msg warning")
|
|
38
|
+
filelogger.warn("msg warn")
|
|
39
|
+
filelogger.error("msg error")
|
|
40
|
+
filelogger.debug("msg debug")
|
|
41
|
+
filelogger.critical("msg critical")
|
|
42
|
+
filelogger.exception("msg exception")
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def test_mlogger_allloger():
|
|
46
|
+
"""
|
|
47
|
+
测试将日志写入文件中 有一个以日期的总文件 以及每个级别的分文件
|
|
48
|
+
pytest mylogger_test.py::test_mlogger_allloger -s
|
|
49
|
+
文件流的logger
|
|
50
|
+
:param filedir:
|
|
51
|
+
:return:
|
|
52
|
+
"""
|
|
53
|
+
filedir = BaseDir.get_file_dir_absolute(__file__)
|
|
54
|
+
filedir = BaseFile.get_new_path(filedir, "log")
|
|
55
|
+
BaseDir.create_dir(filedir)
|
|
56
|
+
filelogger = MLogger(filedir).alllogger
|
|
57
|
+
filelogger.setLevel(logging.DEBUG)
|
|
58
|
+
filelogger.info("mesg info")
|
|
59
|
+
filelogger.warning("msg warning")
|
|
60
|
+
filelogger.warn("msg warn")
|
|
61
|
+
filelogger.error("msg error")
|
|
62
|
+
filelogger.debug("msg debug")
|
|
63
|
+
filelogger.critical("msg critical")
|
|
64
|
+
filelogger.exception("msg exception")
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def test_mlogger_rotatingfilelogger():
|
|
68
|
+
"""
|
|
69
|
+
测试将日志写入文件中 文件名以日期自动生成 如20200211.log
|
|
70
|
+
pytest mylogger_test.py::test_mlogger_rotatingfilelogger -s
|
|
71
|
+
文件流的logger
|
|
72
|
+
:param filedir:
|
|
73
|
+
:return:
|
|
74
|
+
"""
|
|
75
|
+
filedir = BaseDir.get_file_dir_absolute(__file__)
|
|
76
|
+
filelogger = MLogger(filedir).RotatingFileLogger(filedir, None, maxBytes=1*1024*1024,
|
|
77
|
+
backupCount=10)
|
|
78
|
+
filelogger.setLevel(logging.DEBUG)
|
|
79
|
+
while True:
|
|
80
|
+
print("**************")
|
|
81
|
+
filelogger.info("mesg info")
|
|
82
|
+
filelogger.warning("msg warning")
|
|
83
|
+
filelogger.warn("msg warn")
|
|
84
|
+
filelogger.error("msg error")
|
|
85
|
+
filelogger.debug("msg debug")
|
|
86
|
+
filelogger.critical("msg critical")
|
|
87
|
+
filelogger.exception("msg exception")
|
|
88
|
+
|
|
89
89
|
test_mlogger_rotatingfilelogger()
|