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') + + ### 令牌桶限流 ''' 示例