re-common 2.0.0__py3-none-any.whl → 2.0.1__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/v2/baselibrary/tools/search_hash_tools.py +33 -0
- re_common/v2/baselibrary/tools/text_matcher.py +223 -0
- re_common/v2/baselibrary/utils/BusinessStringUtil.py +2 -2
- re_common/v2/baselibrary/utils/author_smi.py +308 -0
- re_common/v2/baselibrary/utils/string_clear.py +15 -1
- re_common/v2/baselibrary/utils/stringutils.py +36 -1
- {re_common-2.0.0.dist-info → re_common-2.0.1.dist-info}/METADATA +1 -1
- re_common-2.0.1.dist-info/RECORD +25 -0
- re_common/baselibrary/__init__.py +0 -4
- re_common/baselibrary/baseabs/__init__.py +0 -7
- re_common/baselibrary/baseabs/baseabs.py +0 -26
- re_common/baselibrary/database/mbuilder.py +0 -132
- re_common/baselibrary/database/moudle.py +0 -93
- re_common/baselibrary/database/msqlite3.py +0 -194
- re_common/baselibrary/database/mysql.py +0 -169
- re_common/baselibrary/database/sql_factory.py +0 -26
- re_common/baselibrary/mthread/MThreadingRun.py +0 -486
- re_common/baselibrary/mthread/MThreadingRunEvent.py +0 -349
- re_common/baselibrary/mthread/__init__.py +0 -3
- re_common/baselibrary/mthread/mythreading.py +0 -695
- re_common/baselibrary/pakge_other/__init__.py +0 -0
- re_common/baselibrary/pakge_other/socks.py +0 -404
- re_common/baselibrary/readconfig/__init__.py +0 -0
- re_common/baselibrary/readconfig/config_factory.py +0 -18
- re_common/baselibrary/readconfig/ini_config.py +0 -317
- re_common/baselibrary/readconfig/toml_config.py +0 -49
- re_common/baselibrary/temporary/__init__.py +0 -0
- re_common/baselibrary/temporary/envdata.py +0 -36
- re_common/baselibrary/tools/__init__.py +0 -0
- re_common/baselibrary/tools/all_requests/__init__.py +0 -0
- re_common/baselibrary/tools/all_requests/aiohttp_request.py +0 -118
- re_common/baselibrary/tools/all_requests/httpx_requet.py +0 -102
- re_common/baselibrary/tools/all_requests/mrequest.py +0 -412
- re_common/baselibrary/tools/all_requests/requests_request.py +0 -81
- re_common/baselibrary/tools/batch_compre/__init__.py +0 -0
- re_common/baselibrary/tools/batch_compre/bijiao_batch.py +0 -31
- re_common/baselibrary/tools/contrast_db3.py +0 -123
- re_common/baselibrary/tools/copy_file.py +0 -39
- re_common/baselibrary/tools/db3_2_sizedb3.py +0 -102
- re_common/baselibrary/tools/foreachgz.py +0 -40
- re_common/baselibrary/tools/get_attr.py +0 -11
- re_common/baselibrary/tools/image_to_pdf.py +0 -62
- re_common/baselibrary/tools/java_code_deal.py +0 -139
- re_common/baselibrary/tools/javacode.py +0 -79
- re_common/baselibrary/tools/mdb_db3.py +0 -48
- re_common/baselibrary/tools/merge_file.py +0 -171
- re_common/baselibrary/tools/merge_gz_file.py +0 -165
- re_common/baselibrary/tools/mhdfstools/__init__.py +0 -0
- re_common/baselibrary/tools/mhdfstools/down_hdfs_files.py +0 -42
- re_common/baselibrary/tools/mhdfstools/hdfst.py +0 -42
- re_common/baselibrary/tools/mhdfstools/up_hdfs_files.py +0 -38
- re_common/baselibrary/tools/mongo_tools.py +0 -50
- re_common/baselibrary/tools/move_file.py +0 -170
- re_common/baselibrary/tools/move_mongo/__init__.py +0 -0
- re_common/baselibrary/tools/move_mongo/mongo_table_to_file.py +0 -63
- re_common/baselibrary/tools/move_mongo/move_mongo_table.py +0 -354
- re_common/baselibrary/tools/move_mongo/use_mttf.py +0 -18
- re_common/baselibrary/tools/move_mongo/use_mv.py +0 -93
- re_common/baselibrary/tools/mpandas/__init__.py +0 -0
- re_common/baselibrary/tools/mpandas/mpandasreadexcel.py +0 -125
- re_common/baselibrary/tools/mpandas/pandas_visualization.py +0 -8
- re_common/baselibrary/tools/myparsel.py +0 -104
- re_common/baselibrary/tools/rename_dir_file.py +0 -37
- re_common/baselibrary/tools/sequoiadb_utils.py +0 -398
- re_common/baselibrary/tools/split_line_to_many.py +0 -25
- re_common/baselibrary/tools/stringtodicts.py +0 -33
- re_common/baselibrary/tools/workwechant_bot.py +0 -84
- re_common/baselibrary/utils/__init__.py +0 -0
- re_common/baselibrary/utils/baseaiohttp.py +0 -296
- re_common/baselibrary/utils/baseaiomysql.py +0 -87
- re_common/baselibrary/utils/baseallstep.py +0 -191
- re_common/baselibrary/utils/baseavro.py +0 -19
- re_common/baselibrary/utils/baseboto3.py +0 -291
- re_common/baselibrary/utils/basecsv.py +0 -32
- re_common/baselibrary/utils/basedict.py +0 -133
- re_common/baselibrary/utils/basedir.py +0 -241
- re_common/baselibrary/utils/baseencode.py +0 -351
- re_common/baselibrary/utils/baseencoding.py +0 -29
- re_common/baselibrary/utils/baseesdsl.py +0 -86
- re_common/baselibrary/utils/baseexcel.py +0 -264
- re_common/baselibrary/utils/baseexcept.py +0 -109
- re_common/baselibrary/utils/basefile.py +0 -654
- re_common/baselibrary/utils/baseftp.py +0 -214
- re_common/baselibrary/utils/basegzip.py +0 -60
- re_common/baselibrary/utils/basehdfs.py +0 -135
- re_common/baselibrary/utils/basehttpx.py +0 -268
- re_common/baselibrary/utils/baseip.py +0 -87
- re_common/baselibrary/utils/basejson.py +0 -2
- re_common/baselibrary/utils/baselist.py +0 -32
- re_common/baselibrary/utils/basemotor.py +0 -190
- re_common/baselibrary/utils/basemssql.py +0 -98
- re_common/baselibrary/utils/baseodbc.py +0 -113
- re_common/baselibrary/utils/basepandas.py +0 -302
- re_common/baselibrary/utils/basepeewee.py +0 -11
- re_common/baselibrary/utils/basepika.py +0 -180
- re_common/baselibrary/utils/basepydash.py +0 -143
- re_common/baselibrary/utils/basepymongo.py +0 -230
- re_common/baselibrary/utils/basequeue.py +0 -22
- re_common/baselibrary/utils/baserar.py +0 -57
- re_common/baselibrary/utils/baserequest.py +0 -279
- re_common/baselibrary/utils/baseset.py +0 -8
- re_common/baselibrary/utils/basesmb.py +0 -403
- re_common/baselibrary/utils/basestring.py +0 -382
- re_common/baselibrary/utils/basetime.py +0 -320
- re_common/baselibrary/utils/basetuple.py +0 -0
- re_common/baselibrary/utils/baseurl.py +0 -121
- re_common/baselibrary/utils/basezip.py +0 -57
- re_common/baselibrary/utils/core/__init__.py +0 -8
- re_common/baselibrary/utils/core/bottomutils.py +0 -18
- re_common/baselibrary/utils/core/mdeprecated.py +0 -327
- re_common/baselibrary/utils/core/mlamada.py +0 -16
- re_common/baselibrary/utils/core/msginfo.py +0 -25
- re_common/baselibrary/utils/core/requests_core.py +0 -103
- re_common/baselibrary/utils/fateadm.py +0 -429
- re_common/baselibrary/utils/importfun.py +0 -123
- re_common/baselibrary/utils/mfaker.py +0 -57
- re_common/baselibrary/utils/my_abc/__init__.py +0 -3
- re_common/baselibrary/utils/my_abc/better_abc.py +0 -32
- re_common/baselibrary/utils/mylogger.py +0 -414
- re_common/baselibrary/utils/myredisclient.py +0 -861
- re_common/baselibrary/utils/pipupgrade.py +0 -21
- re_common/baselibrary/utils/ringlist.py +0 -85
- re_common/baselibrary/utils/version_compare.py +0 -36
- re_common/baselibrary/utils/ydmhttp.py +0 -126
- re_common/facade/__init__.py +0 -1
- re_common/facade/lazy_import.py +0 -11
- re_common/facade/loggerfacade.py +0 -25
- re_common/facade/mysqlfacade.py +0 -467
- re_common/facade/now.py +0 -31
- re_common/facade/sqlite3facade.py +0 -257
- re_common/facade/use/__init__.py +0 -0
- re_common/facade/use/mq_use_facade.py +0 -83
- re_common/facade/use/proxy_use_facade.py +0 -20
- re_common/libtest/__init__.py +0 -0
- re_common/libtest/base_dict_test.py +0 -19
- re_common/libtest/baseavro_test.py +0 -13
- re_common/libtest/basefile_test.py +0 -14
- re_common/libtest/basemssql_test.py +0 -77
- re_common/libtest/baseodbc_test.py +0 -8
- re_common/libtest/basepandas_test.py +0 -38
- re_common/libtest/get_attr_test/__init__.py +0 -0
- re_common/libtest/get_attr_test/get_attr_test_settings.py +0 -14
- re_common/libtest/get_attr_test/settings.py +0 -55
- re_common/libtest/idencode_test.py +0 -54
- re_common/libtest/iniconfig_test.py +0 -35
- re_common/libtest/ip_test.py +0 -35
- re_common/libtest/merge_file_test.py +0 -20
- re_common/libtest/mfaker_test.py +0 -9
- re_common/libtest/mm3_test.py +0 -32
- re_common/libtest/mylogger_test.py +0 -89
- re_common/libtest/myparsel_test.py +0 -28
- re_common/libtest/mysql_test.py +0 -151
- re_common/libtest/pymongo_test.py +0 -21
- re_common/libtest/split_test.py +0 -12
- re_common/libtest/sqlite3_merge_test.py +0 -6
- re_common/libtest/sqlite3_test.py +0 -34
- re_common/libtest/tomlconfig_test.py +0 -30
- re_common/libtest/use_tools_test/__init__.py +0 -3
- re_common/libtest/user/__init__.py +0 -5
- re_common/studio/__init__.py +0 -5
- re_common/studio/assignment_expressions.py +0 -37
- re_common/studio/mydash/__init__.py +0 -0
- re_common/studio/mydash/test1.py +0 -19
- re_common/studio/pydashstudio/__init__.py +0 -0
- re_common/studio/pydashstudio/first.py +0 -9
- re_common/studio/streamlitstudio/__init__.py +0 -0
- re_common/studio/streamlitstudio/first_app.py +0 -66
- re_common/studio/streamlitstudio/uber_pickups.py +0 -24
- re_common/studio/test.py +0 -19
- re_common/vip/__init__.py +0 -0
- re_common/vip/base_step_process.py +0 -11
- re_common/vip/baseencodeid.py +0 -91
- re_common/vip/changetaskname.py +0 -28
- re_common/vip/core_var.py +0 -24
- re_common/vip/mmh3Hash.py +0 -90
- re_common/vip/proxy/__init__.py +0 -0
- re_common/vip/proxy/allproxys.py +0 -127
- re_common/vip/proxy/allproxys_thread.py +0 -159
- re_common/vip/proxy/cnki_proxy.py +0 -153
- re_common/vip/proxy/kuaidaili.py +0 -87
- re_common/vip/proxy/proxy_all.py +0 -113
- re_common/vip/proxy/update_kuaidaili_0.py +0 -42
- re_common/vip/proxy/wanfang_proxy.py +0 -152
- re_common/vip/proxy/wp_proxy_all.py +0 -182
- re_common/vip/read_rawid_to_txt.py +0 -92
- re_common/vip/title/__init__.py +0 -5
- re_common/vip/title/transform/TransformBookTitleToZt.py +0 -125
- re_common/vip/title/transform/TransformConferenceTitleToZt.py +0 -139
- re_common/vip/title/transform/TransformCstadTitleToZt.py +0 -196
- re_common/vip/title/transform/TransformJournalTitleToZt.py +0 -203
- re_common/vip/title/transform/TransformPatentTitleToZt.py +0 -132
- re_common/vip/title/transform/TransformRegulationTitleToZt.py +0 -114
- re_common/vip/title/transform/TransformStandardTitleToZt.py +0 -135
- re_common/vip/title/transform/TransformThesisTitleToZt.py +0 -135
- re_common/vip/title/transform/__init__.py +0 -11
- re_common-2.0.0.dist-info/RECORD +0 -209
- /re_common/{baselibrary/database/__init__.py → v2/baselibrary/tools/list_tools.py} +0 -0
- {re_common-2.0.0.dist-info → re_common-2.0.1.dist-info}/LICENSE +0 -0
- {re_common-2.0.0.dist-info → re_common-2.0.1.dist-info}/WHEEL +0 -0
- {re_common-2.0.0.dist-info → re_common-2.0.1.dist-info}/top_level.txt +0 -0
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
# @Time : 2020/6/16 9:29
|
|
3
|
-
# @Author : suhong
|
|
4
|
-
# @File : db3_2_sizedb3.py
|
|
5
|
-
# @Software: PyCharm
|
|
6
|
-
"""
|
|
7
|
-
获取输入db3文件夹路径,获取db3表名、列名,创建一个db3
|
|
8
|
-
往新的db3写入select信息直到指定大小,切换
|
|
9
|
-
"""
|
|
10
|
-
import sqlite3
|
|
11
|
-
import sys
|
|
12
|
-
|
|
13
|
-
from re_common.baselibrary.utils.basedir import BaseDir
|
|
14
|
-
from re_common.baselibrary.utils.basefile import BaseFile
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
class UniformSizeDb3(object):
|
|
18
|
-
def __init__(self):
|
|
19
|
-
self.table_name = None
|
|
20
|
-
self.column_name = list()
|
|
21
|
-
self.info_list = list()
|
|
22
|
-
self.all_num = 0
|
|
23
|
-
|
|
24
|
-
def work(self, file_path=None, out_path=None,size=200 * 1024 * 1024):
|
|
25
|
-
if file_path is None and out_path is None:
|
|
26
|
-
print("path error")
|
|
27
|
-
sys.exit(-1)
|
|
28
|
-
for path in BaseDir.get_dir_all_files(file_path):
|
|
29
|
-
count = 1
|
|
30
|
-
print(path)
|
|
31
|
-
# print(BaseFile.get_file_size(path)/1024/1024)
|
|
32
|
-
conn = sqlite3.connect(path)
|
|
33
|
-
cur = conn.cursor()
|
|
34
|
-
# 获取表名和字段名称
|
|
35
|
-
cur.execute("SELECT name FROM sqlite_master where type='table'")
|
|
36
|
-
row1 = cur.fetchone()
|
|
37
|
-
self.table_name = row1[0]
|
|
38
|
-
cur.execute("PRAGMA table_info([{}])".format(self.table_name))
|
|
39
|
-
row2 = cur.fetchall()
|
|
40
|
-
for row in row2:
|
|
41
|
-
self.column_name.append(row[1])
|
|
42
|
-
column_name = tuple(self.column_name)
|
|
43
|
-
self.column_name.clear()
|
|
44
|
-
|
|
45
|
-
# 获取原始db3的创建table语句
|
|
46
|
-
cur.execute("SELECT sql FROM sqlite_master WHERE type='table' AND name = '{}'".format(self.table_name))
|
|
47
|
-
create_table_sql = cur.fetchone()[0]
|
|
48
|
-
insert_sql = "insert into {} {} values ({})".format(self.table_name, column_name, "?," * len(column_name))
|
|
49
|
-
insert_sql = insert_sql.replace("'", "").replace("?,)", "?)")
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
out_file = "{}/{}_{}.db3".format(out_path, BaseFile.get_filename_not_extsep(path), count)
|
|
54
|
-
conn_2 = sqlite3.connect(out_file)
|
|
55
|
-
cur_2 = conn_2.cursor()
|
|
56
|
-
cur_2.execute("SELECT name FROM sqlite_master where type='table'")
|
|
57
|
-
name_row = cur_2.fetchone()
|
|
58
|
-
if name_row is None:
|
|
59
|
-
cur_2.execute(create_table_sql)
|
|
60
|
-
conn_2.commit()
|
|
61
|
-
|
|
62
|
-
# 查询原表信息 并插入新表
|
|
63
|
-
cur.execute("select * from {}".format(self.table_name))
|
|
64
|
-
while True:
|
|
65
|
-
rows = cur.fetchone()
|
|
66
|
-
if rows:
|
|
67
|
-
self.info_list.append(rows)
|
|
68
|
-
|
|
69
|
-
if BaseFile.get_file_size(out_file) >= size:
|
|
70
|
-
count +=1
|
|
71
|
-
out_file = "{}/{}_{}.db3".format(out_path, BaseFile.get_filename_not_extsep(path), count)
|
|
72
|
-
conn_2 = sqlite3.connect(out_file)
|
|
73
|
-
cur_2 = conn_2.cursor()
|
|
74
|
-
cur_2.execute("SELECT name FROM sqlite_master where type='table'")
|
|
75
|
-
name_row = cur_2.fetchone()
|
|
76
|
-
if name_row is None:
|
|
77
|
-
cur_2.execute(create_table_sql)
|
|
78
|
-
conn_2.commit()
|
|
79
|
-
print("outfilepath:{}".format(out_file))
|
|
80
|
-
|
|
81
|
-
if len(self.info_list) >= 10000:
|
|
82
|
-
self.all_num += len(self.info_list)
|
|
83
|
-
cur_2.executemany(insert_sql, self.info_list)
|
|
84
|
-
conn_2.commit()
|
|
85
|
-
print("do all sql:{}".format(self.all_num))
|
|
86
|
-
self.info_list.clear()
|
|
87
|
-
else:
|
|
88
|
-
break
|
|
89
|
-
self.all_num += len(self.info_list)
|
|
90
|
-
cur_2.executemany(insert_sql, self.info_list)
|
|
91
|
-
conn_2.commit()
|
|
92
|
-
cur_2.close()
|
|
93
|
-
print("do all sql:{}".format(self.all_num))
|
|
94
|
-
self.info_list.clear()
|
|
95
|
-
self.all_num = 0
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
if __name__ == '__main__':
|
|
99
|
-
file_path = r'E:\更新数据\adb3'
|
|
100
|
-
out_path = r'E:\更新数据\test_db3'
|
|
101
|
-
u = UniformSizeDb3()
|
|
102
|
-
u.work(file_path, out_path)
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import gzip
|
|
2
|
-
import json
|
|
3
|
-
|
|
4
|
-
from re_common.baselibrary.utils.basedir import BaseDir
|
|
5
|
-
from re_common.baselibrary.utils.basefile import BaseFile
|
|
6
|
-
|
|
7
|
-
ref_outPathFile = r"F:\fun3\ref\cnkiref.big_json.gz"
|
|
8
|
-
f_ref = gzip.open(ref_outPathFile, "wb")
|
|
9
|
-
if BaseFile.get_file_size(ref_outPathFile) >= 100 * 1024 * 1024:
|
|
10
|
-
f_ref.close()
|
|
11
|
-
ref_outPathFile = BaseFile.change_file(ref_outPathFile, size=100 * 1024 * 1024)
|
|
12
|
-
ref_outPathFile = ref_outPathFile.replace(".big_json", '.big_json.gz')
|
|
13
|
-
f_ref = gzip.open(ref_outPathFile, "wb")
|
|
14
|
-
print("new dst_path: %s" % ref_outPathFile)
|
|
15
|
-
for file in BaseDir.get_dir_all_files(r"F:\fun2\ref"):
|
|
16
|
-
print(file)
|
|
17
|
-
with gzip.open(file, 'r') as f:
|
|
18
|
-
for lineb in f:
|
|
19
|
-
line = lineb.decode()
|
|
20
|
-
linedicts = json.loads(line)
|
|
21
|
-
print(linedicts)
|
|
22
|
-
if "stat" in linedicts:
|
|
23
|
-
for key in linedicts:
|
|
24
|
-
if key == "stat":
|
|
25
|
-
continue
|
|
26
|
-
else:
|
|
27
|
-
print(key)
|
|
28
|
-
tempdicts = linedicts[key]
|
|
29
|
-
print(tempdicts)
|
|
30
|
-
line_ref = json.dumps(tempdicts, ensure_ascii=False) + "\n"
|
|
31
|
-
line_refs = line_ref.encode()
|
|
32
|
-
f_ref.write(line_refs)
|
|
33
|
-
else:
|
|
34
|
-
f_ref.write(lineb)
|
|
35
|
-
if BaseFile.get_file_size(ref_outPathFile) >= 100 * 1024 * 1024:
|
|
36
|
-
f_ref.close()
|
|
37
|
-
ref_outPathFile = BaseFile.change_file(ref_outPathFile, size=100 * 1024 * 1024)
|
|
38
|
-
ref_outPathFile = ref_outPathFile.replace(".big_json", '.big_json.gz')
|
|
39
|
-
f_ref = gzip.open(ref_outPathFile, "wb")
|
|
40
|
-
print("new dst_path: %s" % ref_outPathFile)
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
# coding = UTF-8
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
# 导入Python标准库
|
|
5
|
-
import os
|
|
6
|
-
from io import BytesIO
|
|
7
|
-
|
|
8
|
-
# 导入第三方库
|
|
9
|
-
from PIL import Image
|
|
10
|
-
|
|
11
|
-
# 防止中文乱码
|
|
12
|
-
os.environ['NLS_LANG'] = 'SIMPLIFIED CHINESE_CHINA.UTF8'
|
|
13
|
-
|
|
14
|
-
# 支持的图片文件格式
|
|
15
|
-
SUPPORT_SUFFIX = ["jpg", "jpeg", "png"]
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
def pic_to_pdf(image_bytes: bytes) -> bytes:
|
|
19
|
-
"""将单个图片转换为单张PDF
|
|
20
|
-
|
|
21
|
-
:param image_bytes: 图片的bytes对象
|
|
22
|
-
:return: PDF的bytes对象
|
|
23
|
-
"""
|
|
24
|
-
# 将bytes对象转换为BytesIO对象
|
|
25
|
-
image_bytes_io = BytesIO(image_bytes)
|
|
26
|
-
# 从内存中读取图片
|
|
27
|
-
image_object = Image.open(image_bytes_io)
|
|
28
|
-
# 打开内存中的文件用于保存PDF
|
|
29
|
-
with BytesIO() as result_bytes_io:
|
|
30
|
-
# 将图片保存为单张PDF
|
|
31
|
-
image_object.save(result_bytes_io, "PDF", resolution=100.0)
|
|
32
|
-
# 获取内存中的文件
|
|
33
|
-
data = result_bytes_io.getvalue()
|
|
34
|
-
# 返回PDF的bytes对象
|
|
35
|
-
return data
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
def batch_convert(image_path: str, pdf_path: str) -> None:
|
|
39
|
-
"""批量将图片转换为单张PDF
|
|
40
|
-
|
|
41
|
-
:param image_path: 图片的文件夹
|
|
42
|
-
:param pdf_path: PDF文件保存的文件夹
|
|
43
|
-
"""
|
|
44
|
-
# 遍历文件夹下所有文件
|
|
45
|
-
for root, dirs, files in os.walk(image_path, topdown=False):
|
|
46
|
-
for name in files:
|
|
47
|
-
# 提取文件的后缀名
|
|
48
|
-
file_suffix = os.path.splitext(name)[-1].lstrip(".").lower()
|
|
49
|
-
# 检测该文件格式是否受到支持
|
|
50
|
-
if file_suffix not in SUPPORT_SUFFIX:
|
|
51
|
-
continue
|
|
52
|
-
# 拼接出图片文件的绝对路径
|
|
53
|
-
source_file_path = os.path.join(root, name)
|
|
54
|
-
# 拼接出PDF文件的绝对路径
|
|
55
|
-
target_file_path = os.path.join(pdf_path, f"{os.path.splitext(name)[0]}.pdf")
|
|
56
|
-
# 将图片文件转换为PDF文件
|
|
57
|
-
with open(source_file_path, "rb") as source:
|
|
58
|
-
with open(target_file_path, "wb") as target:
|
|
59
|
-
target.write(pic_to_pdf(source.read()))
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
batch_convert(r"C:\Users\Administrator\Desktop\上传\zhuanhuan\20230404\新建文件夹 (5)",r"C:\Users\Administrator\Desktop\上传\zhuanhuan\20230404\pdf")
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
from re_common.baselibrary.utils.baselist import BaseList
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class JavaCodeDeal(object):
|
|
5
|
-
|
|
6
|
-
def __init__(self):
|
|
7
|
-
self.strings = """
|
|
8
|
-
"""
|
|
9
|
-
self.lists = []
|
|
10
|
-
self.baselist = BaseList()
|
|
11
|
-
self.keylist = []
|
|
12
|
-
|
|
13
|
-
def set_strings(self, strings):
|
|
14
|
-
"""
|
|
15
|
-
设置源数据
|
|
16
|
-
:param strings:
|
|
17
|
-
:return:
|
|
18
|
-
"""
|
|
19
|
-
self.strings = strings
|
|
20
|
-
|
|
21
|
-
def strings_split(self, split="\n"):
|
|
22
|
-
"""
|
|
23
|
-
根据条件切割为单独的数据
|
|
24
|
-
:param split:
|
|
25
|
-
:return:
|
|
26
|
-
"""
|
|
27
|
-
self.lists = self.strings.split(split)
|
|
28
|
-
|
|
29
|
-
def list_deal(self):
|
|
30
|
-
"""
|
|
31
|
-
去除空字符串,空数据,以及字符串前后空格
|
|
32
|
-
:return:
|
|
33
|
-
"""
|
|
34
|
-
self.lists = self.baselist.remove_null(self.lists)
|
|
35
|
-
self.lists = self.baselist.remove_blank_space(self.lists)
|
|
36
|
-
self.lists = self.baselist.clean_space_first_end(self.lists)
|
|
37
|
-
|
|
38
|
-
def get_key(self):
|
|
39
|
-
"""
|
|
40
|
-
获取等号前的变量
|
|
41
|
-
:return:
|
|
42
|
-
"""
|
|
43
|
-
for item in self.lists:
|
|
44
|
-
key = item.split("=")[0].replace("String", "").strip()
|
|
45
|
-
self.keylist.append(key)
|
|
46
|
-
|
|
47
|
-
def set_outmap(self):
|
|
48
|
-
"""
|
|
49
|
-
生成outMap的put代码
|
|
50
|
-
:return:
|
|
51
|
-
"""
|
|
52
|
-
for item in self.lists:
|
|
53
|
-
key = item.split("=")[0].replace("String", "").strip()
|
|
54
|
-
print('outMap.put("{}", {});'.format(key, key))
|
|
55
|
-
|
|
56
|
-
def set_sql_deal(self):
|
|
57
|
-
"""
|
|
58
|
-
生成mysql处理代码
|
|
59
|
-
:return:
|
|
60
|
-
"""
|
|
61
|
-
for item in self.lists:
|
|
62
|
-
key = item.split("=")[0].replace("String", "").strip()
|
|
63
|
-
print("{} = {}.replace('\\0', ' ').replace(\"'\", \"''\").trim();".format(key, key))
|
|
64
|
-
|
|
65
|
-
def create_sql(self):
|
|
66
|
-
strinsgs = "String sql = \"INSERT INTO modify_title_info_zt("
|
|
67
|
-
for key in self.keylist:
|
|
68
|
-
strinsgs += "[{}],".format(key)
|
|
69
|
-
strinsgs = strinsgs[:-1]
|
|
70
|
-
strinsgs += ")\";"
|
|
71
|
-
print(strinsgs)
|
|
72
|
-
|
|
73
|
-
def create_s(self):
|
|
74
|
-
Strings = "sql += \" VALUES ("
|
|
75
|
-
for key in self.keylist:
|
|
76
|
-
Strings += "'%s', "
|
|
77
|
-
Strings = Strings[:-2]
|
|
78
|
-
Strings += ")\";"
|
|
79
|
-
print(Strings)
|
|
80
|
-
|
|
81
|
-
def create_value(self):
|
|
82
|
-
Strings = "sql = String.format(sql,"
|
|
83
|
-
for key in self.keylist:
|
|
84
|
-
Strings += key + ","
|
|
85
|
-
Strings = Strings[:-1]
|
|
86
|
-
Strings += ");"
|
|
87
|
-
print(Strings)
|
|
88
|
-
|
|
89
|
-
def create_java_sql(self):
|
|
90
|
-
self.create_sql()
|
|
91
|
-
self.create_s()
|
|
92
|
-
self.create_value()
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
if __name__ == "__main__":
|
|
96
|
-
strings = """
|
|
97
|
-
String rawid = outMap.getOrDefault("rawid", "");
|
|
98
|
-
String lngid = outMap.getOrDefault("lngid", "");
|
|
99
|
-
gch = gch;
|
|
100
|
-
String title = outMap.getOrDefault("rawid", "");
|
|
101
|
-
String title_alternative = outMap.getOrDefault("title_alt", "");
|
|
102
|
-
String identifier_issn = outMap.getOrDefault("issn", "");
|
|
103
|
-
String identifier_cnno = outMap.getOrDefault("cnno", "");
|
|
104
|
-
String creator = outMap.getOrDefault("author", "");
|
|
105
|
-
String creator_en = outMap.getOrDefault("author_raw", "");
|
|
106
|
-
String creator_institution = outMap.getOrDefault("organ", "");
|
|
107
|
-
String source = outMap.getOrDefault("journal_name", "");
|
|
108
|
-
String source_en = outMap.getOrDefault("journal_name_alt", "");
|
|
109
|
-
String date = StringHelper.getYear(pub_year);
|
|
110
|
-
String volume = outMap.getOrDefault("vol", "");
|
|
111
|
-
String issue = outMap.getOrDefault("num", "");
|
|
112
|
-
String description = outMap.getOrDefault("abstract", "");
|
|
113
|
-
String description_en = outMap.getOrDefault("abstract_alt", "");
|
|
114
|
-
String description_fund = outMap.getOrDefault("fund", "");
|
|
115
|
-
String description_core = "";
|
|
116
|
-
String subject = outMap.getOrDefault("keyword", "");
|
|
117
|
-
String subject_en = outMap.getOrDefault("keyword_alt", "");
|
|
118
|
-
String begin_page = outMap.getOrDefault("begin_page", "");
|
|
119
|
-
String end_page = outMap.getOrDefault("end_page", "");
|
|
120
|
-
String page = format_page(begin_page, end_page);
|
|
121
|
-
String subject_clc = clc_no.replace(" ", ";").replace(",", ";");//分类号,将空格,逗号替换为分号
|
|
122
|
-
String date_created = format_data_create(publishdate, pub_year);//日期,不是4位的解析出四位数字,如果是空和1900开头,改成data+0000
|
|
123
|
-
String identifier_doi = outMap.getOrDefault("doi", "");
|
|
124
|
-
String country = "CN";
|
|
125
|
-
String language = "ZH";
|
|
126
|
-
String provider = "cnkijournal";
|
|
127
|
-
String owner = "cqu";
|
|
128
|
-
String type = "3";
|
|
129
|
-
String medium = "2";
|
|
130
|
-
batch = batch;
|
|
131
|
-
String provider_url = "cnkijournal@http://kns.cnki.net/KCMS/detail/detail.aspx?dbcode=CJFD&filename=" + rawid;
|
|
132
|
-
String provider_id = "cnkijournal@" + rawid;
|
|
133
|
-
"""
|
|
134
|
-
j = JavaCodeDeal()
|
|
135
|
-
j.set_strings(strings)
|
|
136
|
-
j.strings_split()
|
|
137
|
-
j.list_deal()
|
|
138
|
-
j.get_key()
|
|
139
|
-
j.create_java_sql()
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
不想写循环代码 生成循环代码
|
|
3
|
-
"""
|
|
4
|
-
from re_common.baselibrary.utils.basedir import BaseDir
|
|
5
|
-
from re_common.baselibrary.utils.basefile import BaseFile
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class CreateCode():
|
|
9
|
-
|
|
10
|
-
def __init__(self):
|
|
11
|
-
self.inputobj1 = set()
|
|
12
|
-
|
|
13
|
-
def read_file(self, filepath):
|
|
14
|
-
for file in BaseDir.get_dir_all_files(filepath):
|
|
15
|
-
for line in BaseFile.read_file_r_mode_yield(file):
|
|
16
|
-
if line.find("String") > -1:
|
|
17
|
-
var = line.split("=")[0].replace("String", "").strip()
|
|
18
|
-
self.inputobj1.add(var)
|
|
19
|
-
yield file
|
|
20
|
-
|
|
21
|
-
def create_code(self, file):
|
|
22
|
-
with open(file, mode="w", encoding="utf-8") as f:
|
|
23
|
-
for var in self.inputobj1:
|
|
24
|
-
f.write("if (updateItem.getKey().equals(\"%s\")) {\n" % var)
|
|
25
|
-
f.write(" {} = updateItem.getValue().trim();\n".format(var))
|
|
26
|
-
f.write("}\n")
|
|
27
|
-
|
|
28
|
-
def create_put(self, file):
|
|
29
|
-
with open(file, mode="w", encoding="utf-8") as f:
|
|
30
|
-
for var in self.inputobj1:
|
|
31
|
-
f.write("xObj_a_table.data.put(\"%s\", %s);\n" % (var,var))
|
|
32
|
-
|
|
33
|
-
def create_replace(self, file):
|
|
34
|
-
with open(file, mode="w", encoding="utf-8") as f:
|
|
35
|
-
for var in self.inputobj1:
|
|
36
|
-
f.write("%s = %s.replace('\\0', ' ').replace(\"'\", \"''\").trim();\n" % (var, var))
|
|
37
|
-
|
|
38
|
-
def set_to_list(self):
|
|
39
|
-
self.inputs1 = list(self.inputobj1)
|
|
40
|
-
|
|
41
|
-
def create_sql(self,file):
|
|
42
|
-
with open(file, mode="w", encoding="utf-8") as f:
|
|
43
|
-
strinsgs = "String sql = \"INSERT INTO modify_title_info_zt("
|
|
44
|
-
for key in self.inputs1:
|
|
45
|
-
strinsgs += "[{}],".format(key)
|
|
46
|
-
strinsgs = strinsgs[:-1]
|
|
47
|
-
strinsgs += ")\";"
|
|
48
|
-
f.write(strinsgs)
|
|
49
|
-
|
|
50
|
-
def create_s(self):
|
|
51
|
-
Strings = "sql += \" VALUES ("
|
|
52
|
-
for key in self.inputs1:
|
|
53
|
-
Strings += "'%s', "
|
|
54
|
-
Strings = Strings[:-2]
|
|
55
|
-
Strings += ")\";"
|
|
56
|
-
print(Strings)
|
|
57
|
-
|
|
58
|
-
def create_value(self):
|
|
59
|
-
Strings = "sql = String.format(sql,"
|
|
60
|
-
for key in self.inputs1:
|
|
61
|
-
Strings += key+","
|
|
62
|
-
Strings = Strings[:-1]
|
|
63
|
-
Strings += ");"
|
|
64
|
-
print(Strings)
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
if __name__ == "__main__":
|
|
68
|
-
createcode = CreateCode()
|
|
69
|
-
for file in createcode.read_file(r"./inputs"):
|
|
70
|
-
createcode.set_to_list()
|
|
71
|
-
# createcode.create_replace(file.replace("input", "output"))
|
|
72
|
-
# createcode.create_code(file.replace("input", "output"))
|
|
73
|
-
createcode.create_put(file.replace("input", "output"))
|
|
74
|
-
# createcode.set_to_list()
|
|
75
|
-
# createcode.create_sql(file.replace("input", "output"))
|
|
76
|
-
# createcode.create_s()
|
|
77
|
-
# createcode.create_value()
|
|
78
|
-
|
|
79
|
-
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import pypyodbc
|
|
2
|
-
|
|
3
|
-
from re_common.baselibrary.utils.baseodbc import BaseODBC
|
|
4
|
-
from re_common.facade.sqlite3facade import Sqlite3Utiles
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class MdbDb3(object):
|
|
8
|
-
"""
|
|
9
|
-
mdb和db3的相互转换
|
|
10
|
-
"""
|
|
11
|
-
|
|
12
|
-
def __init__(self):
|
|
13
|
-
self.MdbFile = ''
|
|
14
|
-
self.db3file = ''
|
|
15
|
-
self.baseodbc = None
|
|
16
|
-
self.sqliteutils = None
|
|
17
|
-
|
|
18
|
-
def set_mdb(self, MdbFile):
|
|
19
|
-
self.MdbFile = MdbFile
|
|
20
|
-
self.baseodbc = BaseODBC(self.MdbFile)
|
|
21
|
-
return self
|
|
22
|
-
|
|
23
|
-
def set_db3(self, db3_file):
|
|
24
|
-
self.db3file = db3_file
|
|
25
|
-
self.sqliteutils = Sqlite3Utiles().Sqlite3DBConnectFromFilePath(self.db3file)
|
|
26
|
-
return self
|
|
27
|
-
|
|
28
|
-
def get_db3_table_name(self):
|
|
29
|
-
"""
|
|
30
|
-
获取db3的table表明
|
|
31
|
-
:return:
|
|
32
|
-
"""
|
|
33
|
-
lists_tablename = []
|
|
34
|
-
for tables in self.sqliteutils.sqllite3.get_table_name():
|
|
35
|
-
table = tables[0]
|
|
36
|
-
lists_tablename.append(table)
|
|
37
|
-
return lists_tablename
|
|
38
|
-
|
|
39
|
-
def get_db3_fields(self, tablename):
|
|
40
|
-
self.sqliteutils.sqllite3.set_result_dict()
|
|
41
|
-
result = self.sqliteutils.sqllite3.get_all_field_info(tablename)
|
|
42
|
-
print(result)
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
if __name__ == "__main__":
|
|
46
|
-
md3 = MdbDb3().set_db3(r'C:\Users\xuzhu\Desktop\cnkijournallist_1628228383.4636774.db3')
|
|
47
|
-
for tablename in md3.get_db3_table_name():
|
|
48
|
-
md3.get_db3_fields(tablename)
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
多文件合并到一个文件
|
|
3
|
-
方法一:按行读取写入
|
|
4
|
-
方法二: 按块读取写入
|
|
5
|
-
|
|
6
|
-
"""
|
|
7
|
-
|
|
8
|
-
###########################################
|
|
9
|
-
# 同项目调用基础包
|
|
10
|
-
import os
|
|
11
|
-
import sys
|
|
12
|
-
|
|
13
|
-
filepath = os.path.abspath(__file__)
|
|
14
|
-
pathlist = filepath.split(os.sep)
|
|
15
|
-
pathlist = pathlist[:-4]
|
|
16
|
-
TopPath = os.sep.join(pathlist)
|
|
17
|
-
sys.path.insert(0, TopPath)
|
|
18
|
-
############################################
|
|
19
|
-
|
|
20
|
-
import time
|
|
21
|
-
|
|
22
|
-
from re_common.baselibrary.utils.basedir import BaseDir
|
|
23
|
-
from re_common.baselibrary.utils.basefile import BaseFile
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
class MergeFile(object):
|
|
27
|
-
def __init__(self):
|
|
28
|
-
"""
|
|
29
|
-
:param src: 输入文件夹路径
|
|
30
|
-
:param dst: 输出文件夹路径
|
|
31
|
-
"""
|
|
32
|
-
self.outPathFile = None
|
|
33
|
-
self.a_num = 1000
|
|
34
|
-
self.b_num = 20000
|
|
35
|
-
|
|
36
|
-
self.a_size = 1024 * 1024 * 1024
|
|
37
|
-
self.block_size = 2 * 1024 * 1024 * 1024
|
|
38
|
-
|
|
39
|
-
def get_outpathfile(self, dst):
|
|
40
|
-
BaseDir.create_dir(dst)
|
|
41
|
-
now_time = time.strftime('%Y%m%d', time.localtime())
|
|
42
|
-
self.filename = "{}.big_json".format(now_time)
|
|
43
|
-
self.outPathFile = BaseFile.get_new_path(dst, self.filename)
|
|
44
|
-
return self.outPathFile
|
|
45
|
-
|
|
46
|
-
def line_all_2_one(self, src, dst, source_size=None, dst_size=None, a_num=None, b_num=None):
|
|
47
|
-
"""
|
|
48
|
-
:param src: 输入路径
|
|
49
|
-
:param dst: 输出路径
|
|
50
|
-
:param source_size: 输入文件大于source_size,就直接复制过去
|
|
51
|
-
:param dst_size: 指定输出文件的最大值
|
|
52
|
-
:param a_num: 打印条数的取值(默认1000条输出一次信息)
|
|
53
|
-
:param b_num: 打印路径的取值(默认20000条输出一次信息)
|
|
54
|
-
:return:
|
|
55
|
-
"""
|
|
56
|
-
# 程序开始时间
|
|
57
|
-
StartTime = time.time()
|
|
58
|
-
if a_num is None:
|
|
59
|
-
a_num = self.a_num
|
|
60
|
-
if b_num is None:
|
|
61
|
-
b_num = self.b_num
|
|
62
|
-
count_all = 0
|
|
63
|
-
dst_count = 0
|
|
64
|
-
src_file_num = 0
|
|
65
|
-
src_file_location = 0
|
|
66
|
-
if self.outPathFile is None:
|
|
67
|
-
self.get_outpathfile(dst)
|
|
68
|
-
for files in BaseDir.get_dir_all_files(src):
|
|
69
|
-
src_file_num += 1
|
|
70
|
-
for files in BaseDir.get_dir_all_files(src):
|
|
71
|
-
# 处理每个文件的开始时间
|
|
72
|
-
start_time = time.time()
|
|
73
|
-
src_file_location += 1
|
|
74
|
-
print("next source_path:" + files)
|
|
75
|
-
if source_size is not None:
|
|
76
|
-
if BaseFile.get_file_size(files) >= source_size:
|
|
77
|
-
out_path = BaseFile.get_new_path(dst, BaseFile.get_file_name(files))
|
|
78
|
-
BaseFile.copy_file_to_file(files, out_path)
|
|
79
|
-
print("process_src:%d/%d, Time total:%s, source_path: %s , dst_path:%s" % (
|
|
80
|
-
src_file_location, src_file_num, (repr(time.time() - start_time)), files, out_path))
|
|
81
|
-
continue
|
|
82
|
-
count = 0
|
|
83
|
-
for line in BaseFile.read_file_r_mode_yield(files):
|
|
84
|
-
count += 1
|
|
85
|
-
count_all += 1
|
|
86
|
-
dst_count += 1
|
|
87
|
-
line = line + '\n'
|
|
88
|
-
BaseFile.single_add_file(self.outPathFile, line)
|
|
89
|
-
if count % a_num == 1:
|
|
90
|
-
print("process_src:%d/%d, Time total:%s, source_count: %d, dst_count: %d, allcount: %d" % (
|
|
91
|
-
src_file_location, src_file_num, (repr(time.time() - start_time)), count, dst_count, count_all))
|
|
92
|
-
if count % b_num == 1:
|
|
93
|
-
print("source_path: %s , dst_path:%s" % (files, self.outPathFile))
|
|
94
|
-
if dst_size is not None:
|
|
95
|
-
if BaseFile.get_file_size(self.outPathFile) >= dst_size:
|
|
96
|
-
print("cut dst file, now:source_count: %d,dst_count: %d, allcount: %d" % (
|
|
97
|
-
count, dst_count, count_all))
|
|
98
|
-
dst_count = 0
|
|
99
|
-
self.outPathFile = BaseFile.change_file(self.outPathFile, size=dst_size)
|
|
100
|
-
print("new dst_path: %s" % self.outPathFile)
|
|
101
|
-
|
|
102
|
-
print("finish one file;Time total:%s, process_src:%d/%d, source_count: %d, dst_count: %d, allcount: %d" % (
|
|
103
|
-
repr(time.time() - start_time), src_file_location, src_file_num, count, dst_count, count_all))
|
|
104
|
-
# 程序结束花费时间时间
|
|
105
|
-
print('\nProce Over\nTime total:' + repr(time.time() - StartTime) + '\n')
|
|
106
|
-
|
|
107
|
-
def block_all_2_one(self, src, dst, source_size=None, dst_size=None, block_size=None, a_size=None):
|
|
108
|
-
"""
|
|
109
|
-
按块读取小文件,并写入文件
|
|
110
|
-
:param src: 输入路径
|
|
111
|
-
:param dst: 输出路径
|
|
112
|
-
:param source_size: 输入文件大于source_size,就直接复制过去
|
|
113
|
-
:param dst_size: 指定输出文件的最大值(但是需要操作完一个输入文件后判断大小)
|
|
114
|
-
:param block_size: 按块读取的值
|
|
115
|
-
:param a_size: 打印路径的取值(默认1G大小输出一次信息)
|
|
116
|
-
:return:
|
|
117
|
-
"""
|
|
118
|
-
# 程序开始时间
|
|
119
|
-
StartTime = time.time()
|
|
120
|
-
src_file_num = 0
|
|
121
|
-
src_all_size = 0
|
|
122
|
-
src_file_location = 0
|
|
123
|
-
if a_size is None:
|
|
124
|
-
a_size = self.a_size
|
|
125
|
-
if block_size is None:
|
|
126
|
-
block_size = self.block_size
|
|
127
|
-
|
|
128
|
-
if self.outPathFile is None:
|
|
129
|
-
self.get_outpathfile(dst)
|
|
130
|
-
for files in BaseDir.get_dir_all_files(src):
|
|
131
|
-
src_file_num += 1
|
|
132
|
-
for files in BaseDir.get_dir_all_files(src):
|
|
133
|
-
# 处理每个文件的开始时间
|
|
134
|
-
src_all_size += BaseFile.get_file_size(files)
|
|
135
|
-
dst_file_size = 0
|
|
136
|
-
start_time = time.time()
|
|
137
|
-
src_file_location += 1
|
|
138
|
-
print("next source_path:" + files)
|
|
139
|
-
if source_size is not None:
|
|
140
|
-
if BaseFile.get_file_size(files) >= source_size:
|
|
141
|
-
out_path = BaseFile.get_new_path(dst, BaseFile.get_file_name(files))
|
|
142
|
-
BaseFile.copy_file_to_file(files, out_path)
|
|
143
|
-
print("process_src:%d/%d, Time total:%.2f/%.2f, source_path: %s , dst_path:%s" % (
|
|
144
|
-
src_file_location, src_file_num, (time.time() - start_time), (time.time() - StartTime), files,
|
|
145
|
-
out_path))
|
|
146
|
-
continue
|
|
147
|
-
for block in BaseFile.read_file_rb_block(files, BLOCK_SIZE=block_size):
|
|
148
|
-
BaseFile.single_write_ab_file(block, self.outPathFile)
|
|
149
|
-
if BaseFile.get_file_size(self.outPathFile) % a_size == 1:
|
|
150
|
-
print("process_src:%d/%d, dst_size:%d, src_size:%d, src_all_size:%d, Time total:%.2f/%.2f" % (
|
|
151
|
-
src_file_location, src_file_num, dst_file_size, BaseFile.get_file_size(files), src_all_size,
|
|
152
|
-
(time.time() - start_time), (time.time() - StartTime)))
|
|
153
|
-
dst_file_size = BaseFile.get_file_size(self.outPathFile)
|
|
154
|
-
print(
|
|
155
|
-
"finish one file;process_src:%d/%d, dst_size:%d, src_size:%d, src_all_size:%d, Time total:%.2f/%.2f" % (
|
|
156
|
-
src_file_location, src_file_num, dst_file_size, BaseFile.get_file_size(files), src_all_size,
|
|
157
|
-
(time.time() - start_time), (time.time() - StartTime)))
|
|
158
|
-
if dst_size is not None:
|
|
159
|
-
if BaseFile.get_file_size(self.outPathFile) >= dst_size:
|
|
160
|
-
self.outPathFile = BaseFile.change_file(self.outPathFile, size=dst_size)
|
|
161
|
-
print("new dst_path: %s" % self.outPathFile)
|
|
162
|
-
dst_file_size = 0
|
|
163
|
-
# 程序结束花费时间时间
|
|
164
|
-
print('\nProce Over\nTime total:' + repr(time.time() - StartTime) + '\n')
|
|
165
|
-
|
|
166
|
-
# if __name__ == '__main__':
|
|
167
|
-
# old_path = r'E:\work\pnasjournal\big_json\20200116'
|
|
168
|
-
# new_path = r'E:\work\pnasjournal\big_json\new'
|
|
169
|
-
# a = MergeFile()
|
|
170
|
-
# # a.line_all_2_one(old_path,new_path)
|
|
171
|
-
# a.block_all_2_one(old_path,new_path,dst_size=1024*1024*10)
|