eric-tools 1.3.3.1__tar.gz → 1.3.4__tar.gz
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.
- {eric_tools-1.3.3.1 → eric_tools-1.3.4}/PKG-INFO +2 -2
- {eric_tools-1.3.3.1 → eric_tools-1.3.4}/README.md +1 -1
- {eric_tools-1.3.3.1 → eric_tools-1.3.4}/eric_tools/__init__.py +1 -1
- {eric_tools-1.3.3.1 → eric_tools-1.3.4}/eric_tools/dynamic_settings.py +1 -1
- {eric_tools-1.3.3.1 → eric_tools-1.3.4}/eric_tools/logMixin.py +0 -2
- {eric_tools-1.3.3.1 → eric_tools-1.3.4}/eric_tools/pgsql.py +5 -12
- {eric_tools-1.3.3.1 → eric_tools-1.3.4}/eric_tools/remove.py +3 -6
- {eric_tools-1.3.3.1 → eric_tools-1.3.4}/eric_tools.egg-info/PKG-INFO +2 -2
- {eric_tools-1.3.3.1 → eric_tools-1.3.4}/eric_tools.egg-info/SOURCES.txt +0 -1
- {eric_tools-1.3.3.1 → eric_tools-1.3.4}/eric_tools.egg-info/requires.txt +1 -0
- {eric_tools-1.3.3.1 → eric_tools-1.3.4}/setup.py +3 -2
- eric_tools-1.3.3.1/eric_tools/readconfig.py +0 -30
- {eric_tools-1.3.3.1 → eric_tools-1.3.4}/LICENSE +0 -0
- {eric_tools-1.3.3.1 → eric_tools-1.3.4}/eric_tools/Abstract.py +0 -0
- {eric_tools-1.3.3.1 → eric_tools-1.3.4}/eric_tools/async_queue.py +0 -0
- {eric_tools-1.3.3.1 → eric_tools-1.3.4}/eric_tools/convert_json.py +0 -0
- {eric_tools-1.3.3.1 → eric_tools-1.3.4}/eric_tools/decorator.py +0 -0
- {eric_tools-1.3.3.1 → eric_tools-1.3.4}/eric_tools/delete_duplicate.py +0 -0
- {eric_tools-1.3.3.1 → eric_tools-1.3.4}/eric_tools/downloader.py +0 -0
- {eric_tools-1.3.3.1 → eric_tools-1.3.4}/eric_tools/encryption_classmethod.py +0 -0
- {eric_tools-1.3.3.1 → eric_tools-1.3.4}/eric_tools/excel_generator.py +0 -0
- {eric_tools-1.3.3.1 → eric_tools-1.3.4}/eric_tools/exception_class.py +0 -0
- {eric_tools-1.3.3.1 → eric_tools-1.3.4}/eric_tools/ip.py +0 -0
- {eric_tools-1.3.3.1 → eric_tools-1.3.4}/eric_tools/jwt_encrypt.py +0 -0
- {eric_tools-1.3.3.1 → eric_tools-1.3.4}/eric_tools/logger.py +0 -0
- {eric_tools-1.3.3.1 → eric_tools-1.3.4}/eric_tools/nginx_log.py +0 -0
- {eric_tools-1.3.3.1 → eric_tools-1.3.4}/eric_tools/resize_image.py +0 -0
- {eric_tools-1.3.3.1 → eric_tools-1.3.4}/eric_tools/send_email.py +0 -0
- {eric_tools-1.3.3.1 → eric_tools-1.3.4}/eric_tools/sftp.py +0 -0
- {eric_tools-1.3.3.1 → eric_tools-1.3.4}/eric_tools.egg-info/dependency_links.txt +0 -0
- {eric_tools-1.3.3.1 → eric_tools-1.3.4}/eric_tools.egg-info/top_level.txt +0 -0
- {eric_tools-1.3.3.1 → eric_tools-1.3.4}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: eric_tools
|
3
|
-
Version: 1.3.
|
3
|
+
Version: 1.3.4
|
4
4
|
Summary: Python Daily Development Tools
|
5
5
|
Home-page: https://github.com/Eric-jxl/Tools
|
6
6
|
Author: Eric
|
@@ -16,7 +16,7 @@ License-File: LICENSE
|
|
16
16
|
|
17
17
|
# Tools
|
18
18
|
[](https://opensource.org/licenses/Apache-2.0)
|
19
|
-

|
20
20
|

|
21
21
|
[](https://github.com/eric-jxl/Tools/actions/workflows/publish-pypi.yml)
|
22
22
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Tools
|
2
2
|
[](https://opensource.org/licenses/Apache-2.0)
|
3
|
-

|
4
4
|

|
5
5
|
[](https://github.com/eric-jxl/Tools/actions/workflows/publish-pypi.yml)
|
6
6
|
|
@@ -11,7 +11,7 @@ from .dynamic_settings import DynamicConfig
|
|
11
11
|
name = 'Eric-Tools'
|
12
12
|
__title__ = 'tools'
|
13
13
|
__description__ = 'Python HTTP for Humans.'
|
14
|
-
__version__ = "1.3.
|
14
|
+
__version__ = "1.3.4"
|
15
15
|
__author__ = 'Eric'
|
16
16
|
__doc__ = ["Python Daily Development Tools"]
|
17
17
|
__url__ = "https://github.com/Eric-jxl/Tools"
|
@@ -162,7 +162,7 @@ def get_config_key(key):
|
|
162
162
|
"""获取指定配置项的值,并支持自动重新加载"""
|
163
163
|
config = DynamicConfig("config.yml", debug=True, mode="production")
|
164
164
|
config.force_reload() # ✅ 先重新加载配置
|
165
|
-
value =
|
165
|
+
value = config.get(key) # ✅ 取值
|
166
166
|
if value is None:
|
167
167
|
return jsonify({"error": "Key not found"}), 404 # ✅ 404 + 友好错误信息
|
168
168
|
return jsonify(value)
|
@@ -25,17 +25,14 @@ class PostgreSQL(object):
|
|
25
25
|
self.__dict__[key] = value
|
26
26
|
|
27
27
|
def __getattr__(self, item):
|
28
|
-
print self.__dict__[item]
|
29
28
|
return self.__dict__[item]
|
30
29
|
|
31
30
|
def __call__(self, *args, **kwargs):
|
32
|
-
print
|
31
|
+
print('%s' % PostgreSQL.__dict__)
|
33
32
|
|
34
33
|
@property
|
35
34
|
def info(self):
|
36
|
-
return psycopg2.__version__,psycopg2.__doc__
|
37
|
-
|
38
|
-
|
35
|
+
return psycopg2.__version__, psycopg2.__doc__
|
39
36
|
|
40
37
|
def operate(self, sql, params):
|
41
38
|
count = 0
|
@@ -45,7 +42,7 @@ class PostgreSQL(object):
|
|
45
42
|
self.conn.commit()
|
46
43
|
self.close()
|
47
44
|
except Exception, e:
|
48
|
-
print
|
45
|
+
print(e.message)
|
49
46
|
return count
|
50
47
|
|
51
48
|
def connect(self):
|
@@ -66,7 +63,7 @@ class PostgreSQL(object):
|
|
66
63
|
result = self.cursor.fetchone()
|
67
64
|
self.close()
|
68
65
|
except Exception, e:
|
69
|
-
print
|
66
|
+
print(e.message)
|
70
67
|
return result
|
71
68
|
|
72
69
|
def get_all(self, sql, params=()):
|
@@ -77,7 +74,7 @@ class PostgreSQL(object):
|
|
77
74
|
tup = self.cursor.fetchall()
|
78
75
|
self.close()
|
79
76
|
except Exception, e:
|
80
|
-
print
|
77
|
+
print(e.message)
|
81
78
|
return tup
|
82
79
|
|
83
80
|
def insert(self, sql, params=()):
|
@@ -88,7 +85,3 @@ class PostgreSQL(object):
|
|
88
85
|
|
89
86
|
def delete(self, sql, params=()):
|
90
87
|
return self.operate(sql, params)
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
@@ -17,7 +17,6 @@ class RemoveFile(object):
|
|
17
17
|
|
18
18
|
@staticmethod
|
19
19
|
def fileremove(filename, timedifference):
|
20
|
-
'''remove file'''
|
21
20
|
|
22
21
|
date = datetime.datetime.fromtimestamp(os.path.getmtime(filename))
|
23
22
|
now = datetime.datetime.now()
|
@@ -25,17 +24,15 @@ class RemoveFile(object):
|
|
25
24
|
if (now - date).seconds > timedifference:
|
26
25
|
if os.path.exists(filename):
|
27
26
|
os.remove(filename)
|
28
|
-
print
|
27
|
+
print('remove file: %s' % filename)
|
29
28
|
else:
|
30
|
-
print
|
29
|
+
print('no such file: %s' % filename)
|
31
30
|
|
32
31
|
|
33
32
|
FILE_DIR = '/home'
|
34
33
|
|
35
34
|
if __name__ == '__main__':
|
36
35
|
|
37
|
-
print 'Script is running...'
|
38
|
-
|
39
36
|
while True:
|
40
37
|
ITEMS = os.listdir(FILE_DIR)
|
41
38
|
NEWLIST = []
|
@@ -44,7 +41,7 @@ if __name__ == '__main__':
|
|
44
41
|
NEWLIST.append(FILE_DIR + names)
|
45
42
|
|
46
43
|
for names in NEWLIST:
|
47
|
-
print
|
44
|
+
print('current file: %s' % (names))
|
48
45
|
RemoveFile.fileremove(names, 10)
|
49
46
|
|
50
47
|
time.sleep(2)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: eric-tools
|
3
|
-
Version: 1.3.
|
3
|
+
Version: 1.3.4
|
4
4
|
Summary: Python Daily Development Tools
|
5
5
|
Home-page: https://github.com/Eric-jxl/Tools
|
6
6
|
Author: Eric
|
@@ -16,7 +16,7 @@ License-File: LICENSE
|
|
16
16
|
|
17
17
|
# Tools
|
18
18
|
[](https://opensource.org/licenses/Apache-2.0)
|
19
|
-

|
20
20
|

|
21
21
|
[](https://github.com/eric-jxl/Tools/actions/workflows/publish-pypi.yml)
|
22
22
|
|
@@ -7,7 +7,7 @@ with open("README.md", "r") as fh:
|
|
7
7
|
|
8
8
|
setuptools.setup(
|
9
9
|
name="eric_tools",
|
10
|
-
version="1.3.
|
10
|
+
version="1.3.4",
|
11
11
|
author="Eric",
|
12
12
|
author_email="jxleric95@gmail.com",
|
13
13
|
description="Python Daily Development Tools",
|
@@ -27,6 +27,7 @@ setuptools.setup(
|
|
27
27
|
'requests',
|
28
28
|
'paramiko',
|
29
29
|
'Pillow',
|
30
|
-
'xlsxwriter'
|
30
|
+
'xlsxwriter',
|
31
|
+
"ImageHash",
|
31
32
|
]
|
32
33
|
)
|
@@ -1,30 +0,0 @@
|
|
1
|
-
# -*- coding:utf-8 -*-
|
2
|
-
'''
|
3
|
-
@Author : Eric
|
4
|
-
@Time : 2021-02-07 14:01
|
5
|
-
@IDE : PyCharm
|
6
|
-
'''
|
7
|
-
import sys
|
8
|
-
|
9
|
-
import configparser
|
10
|
-
|
11
|
-
# proDir = os.path.split(os.path.realpath(__file__))[0]
|
12
|
-
# configPath = os.path.join(proDir, "config.ini")
|
13
|
-
|
14
|
-
|
15
|
-
class ReadConfig(object):
|
16
|
-
def __init__(self, configPath,title, name):
|
17
|
-
self.conf = configparser.ConfigParser()
|
18
|
-
self.title = title
|
19
|
-
self.name = name
|
20
|
-
self.conf.read(configPath, encoding='utf-8')
|
21
|
-
self.conf.get(title, name)
|
22
|
-
print self.conf.get(title, name)
|
23
|
-
|
24
|
-
|
25
|
-
def __repr__(self):
|
26
|
-
if sys.version_info < 3:
|
27
|
-
print '%s' % self.conf.get(self.title, self.name)
|
28
|
-
else:
|
29
|
-
print('%s' % self.conf.get(self.title, self.name))
|
30
|
-
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|