From 0843729c8b873b1e79f7a4dcc3e2d406d69a6915 Mon Sep 17 00:00:00 2001 From: shenshuo <191715030@qq.com> Date: Mon, 15 Jul 2024 14:57:40 +0800 Subject: [PATCH] =?UTF-8?q?2024=E5=B9=B47=E6=9C=8815=E6=97=A5=20=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=97=B6=E9=97=B4=E5=AD=97=E7=AC=A6=E4=B8=B2?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=8C=85=E5=90=AB=E5=BE=AE=E5=A6=99=E9=83=A8?= =?UTF-8?q?=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup.py | 2 +- websdk2/utils/__init__.py | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index d4dfe8e..311fb5d 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ import sys from distutils.core import setup -VERSION = '1.0.3' +VERSION = '1.0.4' if sys.version_info < (2, 7) or (3, 0) <= sys.version_info < (3, 6): print('This program requires at least Python 2.7 or 3.6 to run.') diff --git a/websdk2/utils/__init__.py b/websdk2/utils/__init__.py index 3cdbd30..328eeb4 100644 --- a/websdk2/utils/__init__.py +++ b/websdk2/utils/__init__.py @@ -10,12 +10,13 @@ import os import time import json +import uuid import socket import smtplib +from datetime import datetime from ..consts import const from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart -import uuid class SendMail(object): @@ -92,7 +93,6 @@ def send_mail(self, to_list, subject, content, subtype='plain', att=None): return False - def mail_login(user, password, mail_server='smtp.exmail.qq.com'): ### 模拟登录来验证邮箱 try: @@ -165,6 +165,7 @@ def get_contain_dict(src_data: dict, dst_data: dict) -> bool: else: return True + def now_time_stamp() -> int: """ 秒时间戳 @@ -192,6 +193,11 @@ def get_node_topic(node=False): return f'{socket.gethostname()}--mac-{mac}' +@staticmethod +def echo_datetime_now_f(): + return datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f') + + ### 令牌桶限流 ''' 示例