eric-tools 1.3.3.1__py3-none-any.whl → 1.3.4__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.
eric_tools/__init__.py CHANGED
@@ -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.3.1"
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 = Config.get(key) # ✅ 取值
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)
eric_tools/logMixin.py CHANGED
@@ -34,8 +34,6 @@ class StrategyMeta(type):
34
34
 
35
35
  return super().__new__(meta, name, bases, dct)
36
36
 
37
- # 假设SecurityMixin, CacheMixin, CacheControlMixin已定义
38
-
39
37
 
40
38
  class MySecureClass(metaclass=StrategyMeta):
41
39
  security_required = True
eric_tools/pgsql.py CHANGED
@@ -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 '%s'% PostgreSQL.__dict__
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 e.message
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 e.message
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 e.message
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
-
eric_tools/remove.py CHANGED
@@ -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 'remove file: %s' % filename
27
+ print('remove file: %s' % filename)
29
28
  else:
30
- print 'no such file: %s' % filename
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 'current file: %s' % (names)
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.1
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
@@ -18,10 +18,11 @@ Requires-Dist: requests
18
18
  Requires-Dist: paramiko
19
19
  Requires-Dist: Pillow
20
20
  Requires-Dist: xlsxwriter
21
+ Requires-Dist: ImageHash
21
22
 
22
23
  # Tools
23
24
  [![License](https://img.shields.io/:license-apache-blue.svg)](https://opensource.org/licenses/Apache-2.0)
24
- ![latest 1.3.3.1](https://img.shields.io/badge/latest-1.3.3.1-green.svg?style=flat)
25
+ ![latest 1.3.4](https://img.shields.io/badge/latest-1.3.4-green.svg?style=flat)
25
26
  ![GitHub commits since latest release](https://img.shields.io/github/commits-since/eric-jxl/Tools/latest)
26
27
  [![Publish Python Package](https://github.com/eric-jxl/Tools/actions/workflows/publish-pypi.yml/badge.svg)](https://github.com/eric-jxl/Tools/actions/workflows/publish-pypi.yml)
27
28
 
@@ -1,27 +1,26 @@
1
1
  eric_tools/Abstract.py,sha256=8HpTno0VnviyYaRvc2whTUfUJefg2tZhgR94RU9f-FQ,1619
2
- eric_tools/__init__.py,sha256=AzdqdRGGJQONw9Wm-92xghu7pbW5dDJCs_w4JM2fhig,388
2
+ eric_tools/__init__.py,sha256=G4_vDPbMbHzI9mJzrTSxvoFguhxsTpseOUyE7MwIM0s,386
3
3
  eric_tools/async_queue.py,sha256=-wiImRYCWcNBbCAMLXFTjKkPrK94mFL836-f_wvUewA,1122
4
4
  eric_tools/convert_json.py,sha256=Qcs8VQGB7cBkwAiqH1Xd9vbagw19sA2bE9s4EJFA33E,638
5
5
  eric_tools/decorator.py,sha256=DEN_-TSvtAo0TWvs_7-HbeMQCqdgVAkxz2K5fekYFbM,1887
6
6
  eric_tools/delete_duplicate.py,sha256=X3mXW2rjD4TnhmJPYFl6H06lu4rsUkoltL2C3btpkL4,1919
7
7
  eric_tools/downloader.py,sha256=iSs6fpcxzlZX5VRjeahPOtf5G_HclY7aPNGXL5XyOwg,1758
8
- eric_tools/dynamic_settings.py,sha256=WGsjU1YYdXkoXB3J_8Tm6TUvNqc7qjQ2NmVzt0CnH1U,5717
8
+ eric_tools/dynamic_settings.py,sha256=a5t4m1QXRrrnljRWEyH99WZnE8KHo2W1svGFmiTxRCc,5717
9
9
  eric_tools/encryption_classmethod.py,sha256=JaR0rBnaxOEWxOtoOZ6qN1x31Zm1boh5kw264juHLWg,1662
10
10
  eric_tools/excel_generator.py,sha256=8pfd4yfDfd63f6XzFUuMKdpgLiSAnrEfyRcYXKAh8XM,1430
11
11
  eric_tools/exception_class.py,sha256=4ntO2ynm3D9tGoeJ538OGKKsudqhoDRw-fpFd4X6Hy0,741
12
12
  eric_tools/ip.py,sha256=TqeWnJe2M5HhoI8WGNFwyYrsI7kYDQ4PBDBDIDjLSkc,915
13
13
  eric_tools/jwt_encrypt.py,sha256=_FxRezFnfEwCviFzx3K0s1yN872VqxqaAwMsU-GI3EI,1358
14
- eric_tools/logMixin.py,sha256=D7S8FmjO_5ON6vIQXrOQFblDNmeoTHb3TV2eisJOFAQ,2298
14
+ eric_tools/logMixin.py,sha256=1-atM_plpGaZ2KxxDZ9-c38buhPfahrQJ2sRrRo-meI,2235
15
15
  eric_tools/logger.py,sha256=zvpDv0YpeXZld2w2yPIuosfLWdbdvOqSQsJS2PtstXQ,3058
16
16
  eric_tools/nginx_log.py,sha256=zEhfYBtXNJam9tfRbOY5TjezvZspFQzcV5fgrcXv_PM,1260
17
- eric_tools/pgsql.py,sha256=hYt9GwdpobHOoQ6SAemlyN0zlo0X0niYiTcG-2yWEeQ,2320
18
- eric_tools/readconfig.py,sha256=Wosz96C1RFITBN2pgfw-TlX7C-wnOiLcDowb7mITysk,737
19
- eric_tools/remove.py,sha256=RtnNFZzvRc-YNKdDb0h9zVZAPXyDSM1nVcUHTFEjQGk,1163
17
+ eric_tools/pgsql.py,sha256=6rBZillrJF2zOptpnPUiczhKf8-HYosFcoshKrrFGpI,2286
18
+ eric_tools/remove.py,sha256=M1BOj1Np-YMduDfOqfSqnday-Yy68kJdMT352gtF0PA,1106
20
19
  eric_tools/resize_image.py,sha256=A2OBCF7XfnQesWIYTs2W1jmZDslftagPxcc-Fijmyoo,2855
21
20
  eric_tools/send_email.py,sha256=z1SMVpRaJZQIpA-zUHxxd3WKnUGMaAl9ZG-GirO9fTQ,1177
22
21
  eric_tools/sftp.py,sha256=UUBmy4R-7Pezo9haA8JufDyJRcxZg2pKquX0KJIDZIw,423
23
- eric_tools-1.3.3.1.dist-info/LICENSE,sha256=wURoCIWynkcZ4qUfCqtUOaHgLZgGkrWq8IbK4Scn8os,10849
24
- eric_tools-1.3.3.1.dist-info/METADATA,sha256=iiQhVWg7FoqVUmWUXePM7GX8zy_tZkZKv_yvG6iOvxo,5152
25
- eric_tools-1.3.3.1.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
26
- eric_tools-1.3.3.1.dist-info/top_level.txt,sha256=mtO1Tce6qLPcuy4F8bXHByXuIb2LSAEkQEqeQ3UZpzU,11
27
- eric_tools-1.3.3.1.dist-info/RECORD,,
22
+ eric_tools-1.3.4.dist-info/LICENSE,sha256=wURoCIWynkcZ4qUfCqtUOaHgLZgGkrWq8IbK4Scn8os,10849
23
+ eric_tools-1.3.4.dist-info/METADATA,sha256=OtGmfKqJB2wtikjYuaI5YX6d09rGnv3cQp6uD8PmAWo,5171
24
+ eric_tools-1.3.4.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
25
+ eric_tools-1.3.4.dist-info/top_level.txt,sha256=mtO1Tce6qLPcuy4F8bXHByXuIb2LSAEkQEqeQ3UZpzU,11
26
+ eric_tools-1.3.4.dist-info/RECORD,,
eric_tools/readconfig.py DELETED
@@ -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
-