diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite index d2f54bb..7ad7a99 100644 Binary files a/.vs/slnx.sqlite and b/.vs/slnx.sqlite differ diff --git a/ChatRoom v4.4 cn/bin/uid.json b/ChatRoom v4.4 cn/bin/uid.json deleted file mode 100644 index 0ecab40..0000000 --- a/ChatRoom v4.4 cn/bin/uid.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "admin": 0 -} \ No newline at end of file diff --git a/ChatRoom v4.4 cn/bin/users.json b/ChatRoom v4.4 cn/bin/users.json deleted file mode 100644 index 4971846..0000000 --- a/ChatRoom v4.4 cn/bin/users.json +++ /dev/null @@ -1,6 +0,0 @@ -[ - [ - "admin", - "admin" - ] -] \ No newline at end of file diff --git a/ChatRoom v4.4 cn/cloud/file_data.json b/ChatRoom v4.4 cn/cloud/file_data.json deleted file mode 100644 index 0832086..0000000 --- a/ChatRoom v4.4 cn/cloud/file_data.json +++ /dev/null @@ -1,9 +0,0 @@ -[ - [ - "示例.txt", - "11/26 17:47", - "admin", - 0, - "示例.txt" - ] -] \ No newline at end of file diff --git "a/ChatRoom v4.4 cn/cloud/files/\347\244\272\344\276\213.txt" "b/ChatRoom v4.4 cn/cloud/files/\347\244\272\344\276\213.txt" deleted file mode 100644 index d3f2eda..0000000 --- "a/ChatRoom v4.4 cn/cloud/files/\347\244\272\344\276\213.txt" +++ /dev/null @@ -1,4 +0,0 @@ -HappyPeter -Aunt Petunia found a few mouldy blankets in the second room and made up a bed for Dudley on the moth-eaten sofa. She and Uncle Vernon went off to the lumpy bed next door and Harry was left to find the softest bit of floor he could and to curl up under the thinnest, most ragged blanket. - -此开卷第一回也.作者自云:因曾历过一番梦幻之后,故将真事隐去,而借\"通灵\"之说,撰此《石头记》一书也.故曰\"甄士隐\"云云.但书中所记何事何人?自又云:“今风尘碌碌,一事无成,忽念及当日所有之女子,一一细考较去,觉其行止见识,皆出于我之上.何我堂堂须眉,诚不若彼裙钗哉?实愧则有余,悔又无益之大无可如何之日也!当此,则自欲将已往所赖天恩祖德,锦衣纨绔之时,饫甘餍肥之日,背父兄教育之恩,负师友规谈之德,以至今日一技无成,半生潦倒之罪,编述一集,以告天下人:我之罪固不免,然闺阁中本自历历有人,万不可因我之不肖,自护己短,一并使其泯灭也.虽今日之茅椽蓬牖,瓦灶绳床,其晨夕风露,阶柳庭花,亦未有妨我之襟怀笔墨者.虽我未学,下笔无文,又何妨用假语村言,敷演出一段故事来,亦可使闺阁昭传,复可悦世之目,破人愁闷,不亦宜乎?\"故曰\"贾雨村\"云云. diff --git a/ChatRoom v4.4 cn/init.py b/ChatRoom v4.4 cn/init.py deleted file mode 100644 index d1d26f3..0000000 --- a/ChatRoom v4.4 cn/init.py +++ /dev/null @@ -1,116 +0,0 @@ -'''工具函数和初始化''' - -import datetime as dt -import json as js -import os - -# 获取工作路径 -def init_path(): - global PATH - path = os.path.abspath(__file__) - PATH = os.path.dirname(path) - print(f"[INIT] PATH: {PATH}") - return PATH - -# 当天日志文件和用户文件初始化 -def init_file(): - print("[INIT] READ DATA_FILE&USERS") - PATH = init_path() - DATA_LST = []; - DATE_STR = dt.datetime.now().strftime("%y-%m-%d") - logfiles = os.path.join(PATH,"logfiles") - LOGFILE = os.path.join(logfiles,f"{DATE_STR}.json") - bin_ = os.path.join(PATH,"bin") - USERFILE = os.path.join(bin_,"users.json") - UIDFILE = os.path.join(bin_,"uid.json") - UIDB = read_file(UIDFILE) - USERDB = read_file(USERFILE) - # 如果当天已存在日志文件,则接着盖楼,否则新建 - if os.path.isfile(LOGFILE): - DATA_LST = read_file(LOGFILE) - floor = DATA_LST[-1][1] - print(f"[INIT] 读取日志:{LOGFILE}") - else: - floor = 1 - print("[INIT] 无已存在日志") - return [DATA_LST, LOGFILE, UIDB, UIDFILE, USERDB, USERFILE, floor] - -# 前7天(最多)历史记录初始化 -def init_backlog(): - print("[INIT] GRAB LOG") - latest_date = dt.datetime.now() - former_date = latest_date - dt.timedelta(days=1) - former_date_str = former_date.strftime("%y-%m-%d") - logfiles = os.path.join(PATH,"logfiles") - LOGFILE_p = os.path.join(logfiles,f"{former_date_str}.json") - BACK_LOG_LST = [] - cnt = 1 - # 循环读日志,条件为日志文件存在且为七天内 - while cnt <=7: - if os.path.isfile(LOGFILE_p): - TEMP_LST = read_file(LOGFILE_p) - TEMP_LST.append(former_date_str) - BACK_LOG_LST.append(TEMP_LST) - former_date = former_date - dt.timedelta(days=1) - former_date_str = former_date.strftime("%y-%m-%d") - logfiles = os.path.join(PATH,"logfiles") - LOGFILE_p = os.path.join(logfiles,f"{former_date_str}.json") - cnt += 1 - BACK_LOG_LEN = len(BACK_LOG_LST) - print(f"[INIT] {BACK_LOG_LEN} LOGS IN TOTAL") - return [BACK_LOG_LST, BACK_LOG_LEN] - -#初始化文件传输 -def init_file_sending(): - print("[INIT] READ FILE_LIST") - path = os.path.join(PATH, "cloud") - PATH_FILES = os.path.join(path, "files") - PATH_FILE_JS = os.path.join(path, "file_data.json") - - FILE_LIST = [] - if os.path.exists(PATH_FILE_JS): - FILE_LIST = read_file(PATH_FILE_JS)#读上传的文件列表[[filename,user,time]] - file_list = os.listdir(PATH_FILES) - p = 0; l = len(FILE_LIST); flag = False#检查文件是否都存在: - while p < l: - if not FILE_LIST[p][0] in file_list: - drop_one = FILE_LIST.pop(p) - print(f"[FILE_LIST] REMOVE: {drop_one}") - flag = True - else: p += 1 - l = len(FILE_LIST) - l = len(file_list)#检查是否有文件夹中存在但不在列表中的文件: - for p in range(l): - files_in_list = list(map(lambda x:x[0],FILE_LIST))#把文件日志中文件名(index=0)取出 - if not file_list[p] in files_in_list: - FILE_LIST.append([file_list[p],"--/-- --:--","-.-.-","server"]) - print(f"[FILE_LIST] ADD: {file_list[p]}") - flag = True - if flag: write_file(PATH_FILE_JS, FILE_LIST)#若有文件变动,修正该问题 - - return [PATH_FILE_JS, PATH_FILES, FILE_LIST] - -#处理文件名防止重名 -def check_filename(path,original_name): - exist_names = os.listdir(path) - first_name, last_name = os.path.splitext(original_name) - name = [first_name, last_name, 0]#文件名各部分和序号(若为0则实际不加) - make_name = lambda x:x[0]+(f"({str(x[2])})"if x[2]!=0 else "")+x[1]#拼接文件名函数 - while True: - if not make_name(name) in exist_names:#该文件名独一无二 - break - name[2]+=1#该文件名已存在,序号增加 - name = make_name(name) - return os.path.join(path,name), name - -# 通用读文件管道 -def read_file(F): - with open(F, 'r', encoding='utf-8') as f: - data = f.read().encode(encoding='utf-8') - result = js.loads(data) - return result - -# 通用写文件管道 -def write_file(F, data): - with open(F,"w",encoding="utf-8") as f: - js.dump(data, f, ensure_ascii=False, indent=True) diff --git a/ChatRoom v4.4 cn/server.py b/ChatRoom v4.4 cn/server.py deleted file mode 100644 index 15ae567..0000000 --- a/ChatRoom v4.4 cn/server.py +++ /dev/null @@ -1,323 +0,0 @@ -''' 服务器主程序 ''' -''' v 4.3 - support more online-view filetype & improving code ''' - -from flask import Flask, render_template, request, redirect, send_file, flash, session, make_response -import datetime as dt -import os -from urllib.parse import quote -from init import * - -IP = "0.0.0.0" -PORT = 80 - -FILE_MAXSIZE = 500 * 1024 * 1024 # 云盘文件大小限制:500MB - -app = Flask("chat_room") -app.config['JSON_AS_ASCII'] = False -app.secret_key = "hard" - - -# 主页 -@app.route("/") -def index(): - addr = request.remote_addr - uid = session.get("account") - if uid is None: # 用户未注册,重定向至注册页面 - return redirect('/login') - else: - userid = USERDB[uid][0] - HOUR_NOW = dt.datetime.now().hour - if HOUR_NOW in range(5,12): - return render_template("index.html", HOUR_NOW=HOUR_NOW, greetings="🌅 上午好", userid=userid, addr=addr) - elif HOUR_NOW in range(12,18): - return render_template("index.html", HOUR_NOW=HOUR_NOW, greetings="🌞 下午好", userid=userid, addr=addr) - elif HOUR_NOW in range(18,22): - return render_template("index.html", HOUR_NOW=HOUR_NOW, greetings="🌇 晚上好", userid=userid, addr=addr) - else: - return render_template("index.html", HOUR_NOW=HOUR_NOW, greetings="🌙 晚上好", userid=userid, addr=addr) - -# 聊天主页面 -@app.route("/chatroom/") -def main(): - addr = request.remote_addr - uid = session.get("account") - if uid is None: # 用户未注册,重定向至注册页面 - return redirect('/login') - else: - userid = USERDB[uid][0] - if len(DATA_LST) == 0: - return render_template("chatroom.html", - DATA_LST=DATA_LST, addr=addr, userid=userid, python_message="- 还没有消息记录 快来抢沙发吧 -") - else: - return render_template("chatroom.html", - DATA_LST=DATA_LST, addr=addr, userid=userid, python_message="- 你看到我的底线了 -") - -# 发送窗口 -@app.route("/chatroom/send", methods=["GET","POST"]) -def send(): - global floor - uid = session.get("account") - if uid is None: # 用户未注册,重定向至注册页面 - return redirect('/login') - else: - if request.method == 'GET': - return render_template('send.html') - if request.method == 'POST': - addr = request.remote_addr - userid = USERDB[uid][0] - name = request.form.get("name") - text = request.form.get("text") - if not all([name,text]): - return render_template('send.html', python_alert="用户名/内容不能为空!") - TIME_NOW = dt.datetime.now().strftime("%m/%d %H:%M:%S") - if len(DATA_LST) != 0: - floor = DATA_LST[-1][1]+1 - - DATA_LST.append([TIME_NOW, floor, name, addr, userid, text]) - write_file(LOGFILE,DATA_LST) - return render_template('send.html', python_hint="发送成功!",last=name) - -# 登录 -@app.route("/login", methods=["GET","POST"]) -def login(): - if request.method == 'GET': - if session.get("account") is not None: - return redirect('/') - else: - return render_template("login.html") - if request.method == 'POST': - username = request.form.get("userid") - pwd = request.form.get("pwd") - if username in UIDB: - uid = UIDB[username] - if pwd == USERDB[uid][1]: - session['account'] = uid - return redirect('/') - else: return render_template("login.html", python_alert="用户名或密码不正确!") - else: return render_template("login.html", python_alert="用户不存在!") - -# 登出 -@app.route("/logout") -def logout(): - session.pop("account") - return redirect("/login") - -# 新用户注册 -@app.route("/register", methods=["GET","POST"]) -def register(): - if request.method == 'GET': - if session.get("account") is not None: - return redirect('/') - else: - return render_template("register1.html") - if request.method == 'POST': - username = request.form.get("userid") - pwd = request.form.get("pwd") - pwd2 = request.form.get("pwd2") - # 用户名密码是否符合要求 - if username is None or pwd is None or pwd2 is None: - return render_template("register1.html", python_alert="错误:请完成所有必填项。") - if not(len(username) in range(3,17)) or not (len(pwd) in range(8,31)): - print(pwd,pwd2,username) - return render_template("register1.html", python_alert="错误:长度不符。") - if username in UIDB: - return render_template("register1.html", python_alert="错误:用户已存在!") - for char in username: - if char not in "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ _1234567890": - return render_template("register1.html", python_alert="错误:使用了非法字符。") - if pwd != pwd2: - return render_template("register1.html", python_alert="两次输入的密码不一致!") - - uid = max(UIDB.values())+1 - UIDB[username] = uid - write_file(UIDFILE,UIDB) - USERDB.append([username, pwd]) - write_file(USERFILE,USERDB) - return redirect("/login") - -# 用户管理 -@app.route("/account",methods=["GET","POST"]) -def account(): - if request.method == 'GET': - uid = session.get("account") - if uid is None: - return redirect('/login') - else: - userid = USERDB[uid][0] - pwd = USERDB[uid][1] - return render_template("account.html",userid=userid, uid=uid) - if request.method == 'POST': - uid = session.get("account") - userid = USERDB[uid][0] - - username = request.form.get("userid") - pwd = request.form.get("pwd") - pwd2 = request.form.get("pwd2") - # 用户名密码是否符合要求 - if username is None or pwd is None or pwd2 is None: - return render_template("account.html",userid=userid, uid=uid, python_alert="错误:请完成所有必填项。") - if not(len(username) in range(3,17)) or not (len(pwd) in range(8,31)): - print(pwd,pwd2,username) - return render_template("account.html",userid=userid, uid=uid, python_alert="错误:长度不符。") - for char in username: - if char not in "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ _1234567890": - return render_template("account.html",userid=userid, uid=uid, python_alert="错误:使用了非法字符。") - if pwd != pwd2: - return render_template("account.html",userid=userid, uid=uid, python_alert="两次输入的密码不一致!") - - UIDB.pop(userid) - UIDB[username] = uid - write_file(UIDFILE,UIDB) - USERDB[uid]=[username, pwd] - write_file(USERFILE,USERDB) - return redirect("/logout") - -# 消息历史记录 -@app.route("/chatroom/backlog") -def backlog(): - addr = request.remote_addr - userid = session.get("account") - return render_template("backlog.html", userid=userid, addr=addr, lst=BACK_LOG_LST, n=BACK_LOG_LEN) - -# 云盘 -@app.route("/cloud") -def filesending(): - uid = session.get("account") - if uid is None: # 用户未注册,重定向至注册页面 - return redirect('/login') - else: - username = USERDB[uid][0] - file = request.args.get("file") - if file is not None:#下载 - path = os.path.join(PATH_FILES, file) - if os.path.isfile(path):#文件存在、是文件 - file_name = quote(file)#把文件名转码 - file_response = send_file(path, as_attachment=True, download_name=file_name) - file_response.headers["Content-Disposition"] += ";filename*=utf-8''{}".format(file_name)#把文件名转回UTF-8 - return file_response - else:#查看 - flash("文件已不存在。请询问网络管理员") - init_file_sending() #文件被删除,选择重新加载 - return redirect('/cloud') - else:#未传值 - return render_template("cloud.html", file_list=FILE_LIST[::-1], userid=username) - -# 传文件到云盘 -@app.route("/upload", methods=["POST"]) -def upload(): - uid = session.get("account") - if uid is None: # 用户未注册,重定向至注册页面 - return redirect('/login') - - file = request.files["file"] - if not file: # 没选择文件就进行了请求 - flash("请选择一个文件") - return redirect("/cloud") - - if file.content_length > FILE_MAXSIZE: # 限制文件大小 - flash(f"文件大于{FILE_MAXSIZE // 1024 // 1024}MB,上传失败") - return redirect("/cloud") - - username = USERDB[uid][0] - file_path, file_name = check_filename(PATH_FILES, file.filename) # 防止重名 - file.save(file_path) - - time = dt.datetime.now().strftime("%m/%d %H:%M") - - file_alias = file_name # 存入文件别名(治标不治本的防文本框溢出) - for j in range(len(file_name.split('.')[:-1])): - if j % 18==0: - if file_name[j] != '.': # 防吞扩展名 - file_alias = file_alias[:j] + ' ' + file_alias[j:] - j += 1 - else: - j -= 1 - file_alias = file_alias[:j] + ' ' + file_alias[j:] - - FILE_LIST.append([file_name, time, username, uid, file_alias]) - write_file(PATH_FILE_JS, FILE_LIST) - flash(f"文件上传为: {file_alias}") - return redirect('/cloud') - -# 在线文件预览源 -@app.route('/file/') -def serve_file(file): - # 获取文件扩展名来确定文件类型 - file = os.path.join(PATH_FILES, file) - extension = os.path.splitext(file)[1].lower() - - # 根据文件类型返回适当的响应 - if extension in ['.jpg', '.jpeg', '.png', '.gif']: - # 处理图片文件 - with open(file, 'rb') as f: - response = make_response(f.read()) - response.headers['Content-Type'] = 'image/jpeg' # 根据实际文件类型设置正确的 Content-Type - return response - - elif extension in ['.mp4', '.avi', '.mov', '.mp3']: - # 处理视频文件 - with open(file, 'rb') as f: - response = make_response(f.read()) - response.headers['Content-Type'] = 'video/mp4' - return response - - else: - # 处理其他文件,视为文本 - try: - with open(file, 'r', encoding="utf-8") as f: - response = make_response(f.read()) - response.headers['Content-Type'] = 'text/plain; charset=utf-8' - return response - except: - # 处理其他情况 - return "Unsupported file type", 400 - -# 视频在线预览 -@app.route("/play") -def play(): - uid = session.get("account") - if uid is None: # 用户未注册,重定向至注册页面 - return redirect('/login') - else: - file = request.args.get("file") - if file is not None: - path = os.path.join(PATH_FILES, file) - if os.path.isfile(path): - return render_template("play.html", fileurl=f"/file/{file}", pyfilename = file) - else: - init_file_sending() - return render_template("play.html", fileurl="", pyfilename = "未选择文件.") - else: - return render_template("play.html", fileurl="", pyfilename = "未选择文件.") - -#检视模板文件用(trap_door) -@app.route("/query", methods=["GET"]) -def query(): - query = request.args.get("file") - return render_template(query) - -#刷新数据用(trap_door) -@app.route("/chatroom/refresh") -def refresh(): - global USER_LST - mode = request.args.get("mode") - if mode == "users": - USER_LST = read_file(USERFILE) - return f"刷新用户列表成功

{USER_LST}" - elif mode == "files": - init_file_sending() - return f"刷新文件列表成功

{'

'.join(list(map(str,FILE_LIST)))}" - return redirect('/chatroom/') - -@app.errorhandler(404) # 传入错误码作为参数状态 -def error404(error): # 接受错误作为参数 - return render_template("404.html"), 404 - -######################################## -if __name__ =="__main__": - PATH = init_path() - DATA_LST, LOGFILE, UIDB, UIDFILE, USERDB, USERFILE, floor = init_file() - BACK_LOG_LST, BACK_LOG_LEN = init_backlog() - PATH_FILE_JS, PATH_FILES, FILE_LIST = init_file_sending() - app.run(host=IP, port=PORT, debug=True) - #app.run(host=IP, port=PORT, debug=True, ssl_context = ('ssl/littlecorner.space_bundle.crt', 'ssl/littlecorner.space.key')) diff --git a/ChatRoom v4.4 cn/static/cloud/images/sidebar.gif b/ChatRoom v4.4 cn/static/cloud/images/sidebar.gif deleted file mode 100644 index 6987c7d..0000000 Binary files a/ChatRoom v4.4 cn/static/cloud/images/sidebar.gif and /dev/null differ diff --git a/ChatRoom v4.4 cn/static/cloud/styles/style.css b/ChatRoom v4.4 cn/static/cloud/styles/style.css deleted file mode 100644 index 070a508..0000000 --- a/ChatRoom v4.4 cn/static/cloud/styles/style.css +++ /dev/null @@ -1,344 +0,0 @@ -@charset "UTF-8"; -#mainwrapper header { - /*Header */ - background-color: #6972C6; - overflow: auto; - font-family: Constantia, "Lucida Bright", "DejaVu Serif", Georgia, STSong, SimSun, "serif"; - font-style: normal; - font-weight: 400; -} -#mainwrapper header #logo { - /* Company Logo text */ - width: 28%; - float: left; - padding-left: 2%; - padding-top: 12px; - padding-bottom: 12px; - color: white; -} -#mainwrapper header nav { - /*Nav bar containing links in header */ - text-align: right; - padding-top: 12px; - padding-bottom: 12px; - padding-right: 2%; - width: 68%; - float: left; - color: white; -} -header nav a { - /* Links in header */ - padding-right: 2%; - color: white; -} -#content #mainContent h1, #content #mainContent h2 { - /* Styling for main headings */ - font-family: Constantia, "Lucida Bright", "DejaVu Serif", Georgia, STSong, SimSun, "serif"; - font-size: 36px; - color: #474d87; -} -#content #mainContent h3 { - /*Captions ot Taglines */ - font-family: Constantia, "Lucida Bright", "DejaVu Serif", Georgia, STSong, SimSun, "serif"; - font-style: normal; - font-weight: 200; - color: #444765; -} -#content #mainContent #bannerImage { - /*Container for main banner image */ - width: 100%; - background-color: rgba(208,207,207,1.00); -} -#content #mainContent p { - /* All paragraphs under maincontent */ - color: #444765; - font-family: "Lucida Bright", "DejaVu Serif", Georgia, STSong, SimSun, "serif"; - font-style: normal; - font-weight: 200; - text-align: justify; -} -#content #mainContent #authorInfo { - /* Author info section */ - font-family: "Lucida Bright", "DejaVu Serif", Georgia, STSong, SimSun, "serif"; - background-color: aliceblue; - border: 1px solid #6972C6; -} - -#content #mainContent #authorInfo h2 { - font-size: 24px; - padding-left: 2%; - padding-top: 5px; -} - -#content #mainContent #authorInfo p { - color: #444765; - padding-left: 2%; - padding-top: 0px; - padding-bottom: 11px; - padding-right: 2%; -} - -#content #mainContent #authorInfo td { - font-family: Courier New, Courier, STSong, sans-serif; -} - -#content #mainContent #authorInfo a { - color: darkslateblue; - text-decoration-line: none; -} - - -#content #mainContent #authorInfo .time { - font-family: Cambria, "Hoefler Text", "Liberation Serif", Times, "Times New Roman", STSong, SimSun, "serif"; - font-size: 10pt; - padding-right: 1pc; - color: gray; -} - -#content #mainContent #authorInfo .address { - font-family: Cambria, "Hoefler Text", "Liberation Serif", Times, "Times New Roman", STSong, SimSun, "serif"; - font-size: 10pt; - padding-right: 1pc; - color: gray; -} - -#content #mainContent #authorInfo a { - font-family: Cambria, "Hoefler Text", "Liberation Serif", Times, "Times New Roman", STSong, SimSun, "serif"; - font-size: 14pt; - padding-right: 1pc; - color: darkslateblue; -} - -#content #mainContent #authorInfo video { - margin-left: 5%; - width: 90%; -} - -#content #mainContent #authorInfo textarea { - font-family: Courier New, Courier, monospace; -} - -footer article { - /* Footer articles */ - width: 46%; - float: left; - padding-left: 2%; - padding-right: 2%; - text-align: justify; - font-family: source-sans-pro, sans-serif; - font-style: normal; - font-weight: 200; - color: rgba(146,146,146,1.00); -} -footer article h3 { - /* Footer article titles */ - text-align: center; - font-family: montserrat, sans-serif; - font-style: normal; - font-weight: 400; -} -#mainContent { - /* Container for the blog post in individal blog view */ - padding-left: 2%; - width: 71%; - float: left; - padding-right: 2%; - padding-top: 41px; -} -#mainwrapper #content #sidebar { - /* Sidebar*/ - width: 19%; - padding-left: 2%; - padding-right: 2%; - float: left; - background-color: rgba(246,246,246,1.00); - margin-top: 150px; - padding-top: 32px; -} -#mainwrapper { - /* Container of all content */ - width: 94%; - overflow: auto; - margin-left: 3%; -} -#content #sidebar h2 { - /* Text box in sidebar */ - width: 98%; - font-family: Constantia, "Lucida Bright", "DejaVu Serif", Georgia, STSong, SimSun, "serif"; - font-size: 24px; - color: #444765; -} -#content #sidebar #adimage { - /* Container for Image in sidebar */ - width: 100%; - background-color: rgba(208,207,207,1.00); - margin-top: 46px; - float: none; - overflow: auto; -} -nav ul li { - list-style-type: none; - padding-top: 8px; - padding-bottom: 8px; -} -nav ul { - padding-left: 0%; -} -nav ul li a { - font-family: "Lucida Bright", "DejaVu Serif", Georgia, STSong, SimSun, "serif"; - font-size: 18px; - color: #444765; - text-decoration: none; -} -#footerbar { - /* Footer bar at the bottom of the page */ - margin-top: 20px; - height: 18px; - clear: both; - background-color: rgba(208,207,207,1.00); - width: 100%; -} -footer { - /* Container for footer artices */ - width: 71%; - padding-left: 2%; - padding-right: 2%; -} -.notOnDesktop { - /*element to be displayed only in mobile view and tabet view */ - display: none; -} -#mainContent #bannerImage img { - /* Actual banner image */ - width: 100%; -} -#sidebar #adimage img { - /* Image in sidebar */ - width: 100%; - float: left; -} -#mainwrapper header nav a { - /* Links in header */ - color: rgba(146,146,146,1.00); - text-decoration: none; -} - -/* Tablet view */ -@media screen and (max-width:769px) { -.notOnDesktop { - /* Search box shown only in mobile view and Tablet view */ - display: block; - text-align: right; - padding-right: 8px; - padding-top: 8px; - padding-bottom: 8px; - width: 96%; -} -#content .notOnDesktop p { - height: 18px; - font-family: Constantia, "Lucida Bright", "DejaVu Serif", Georgia, STSong, SimSun, "serif"; - text-align: center; -} -#mainContent { - /* Container for the blog post */ - padding-top: 0px; - float: none; - width: 96%; -} -#sidebar input { - /* Search box in sidebar */ - display: none; -} -#mainwrapper #content #sidebar { - /* Sidebar*/ - float: none; - width: 92%; - padding-top: 13px; - overflow: auto; - margin-top: 3px; - margin-left: 2%; - padding-bottom: 13px; -} -#content #sidebar #adimage { - /* Image in sidebar */ - width: 60%; - margin-top: 0px; - float: left; -} -#content #sidebar nav { - /* Navigation links in sidebar */ - width: 36%; - float: left; - padding-left: 4%; -} -#sidebar nav ul { - margin-top: 0px; -} -footer { - /* Footer region */ - width: 96%; - padding-left: 2%; - padding-right: 2%; -} -#content footer article { - /*Each footer article */ - width: 46%; -} -#mainwrapper header { - /* Header */ - width: 100%; -} -} - -/* Mobile view */ -@media screen and (max-width:480px) { -#mainwrapper header #logo { - /* Company Logo text in header */ - width: 96%; - margin-left: 2%; -} -#mainwrapper header nav { - /*navigation links in header */ - text-align: center; - background-color: rgba(255,255,255,1.00); - width: 98%; -} -#content #sidebar #adimage { - /* Container for image in sidebar */ - width: 100%; -} -#content #sidebar nav { - /* Navigation bar for links in sidebar */ - width: 96%; - padding-top: 7px; -} -#sidebar nav ul li { - display: inline-block; - width: 32%; - text-align: center; -} -#mainwrapper #content #sidebar { - /* sidebar */ - padding-bottom: 0px; -} -#content .notOnDesktop { - /* Search box shown only in mobile and tablet view */ - width: 100%; - text-align: center; - padding-left: 0px; - padding-right: 0px; -} -#content .notOnDesktop p { - width: 80%; - font-family: Constantia, "Lucida Bright", "DejaVu Serif", Georgia, STSong, SimSun, "serif"; - text-align: center; -} -#content #mainContent h3 { - /* Title under maincontent, if any */ - font-size: 14px; -} -#content footer article { - /* Each foter article */ - width: 96%; -} -} diff --git a/ChatRoom v4.4 cn/static/error/images/404.png b/ChatRoom v4.4 cn/static/error/images/404.png deleted file mode 100644 index 6dc78b2..0000000 Binary files a/ChatRoom v4.4 cn/static/error/images/404.png and /dev/null differ diff --git a/ChatRoom v4.4 cn/static/error/images/ji.gif b/ChatRoom v4.4 cn/static/error/images/ji.gif deleted file mode 100644 index 2741c15..0000000 Binary files a/ChatRoom v4.4 cn/static/error/images/ji.gif and /dev/null differ diff --git a/ChatRoom v4.4 cn/static/error/images/noji.gif b/ChatRoom v4.4 cn/static/error/images/noji.gif deleted file mode 100644 index 2d3c84b..0000000 Binary files a/ChatRoom v4.4 cn/static/error/images/noji.gif and /dev/null differ diff --git a/ChatRoom v4.4 cn/static/index/images/HomePageSideImage.gif b/ChatRoom v4.4 cn/static/index/images/HomePageSideImage.gif deleted file mode 100644 index 6987c7d..0000000 Binary files a/ChatRoom v4.4 cn/static/index/images/HomePageSideImage.gif and /dev/null differ diff --git a/ChatRoom v4.4 cn/static/index/images/banner_afternoon.png b/ChatRoom v4.4 cn/static/index/images/banner_afternoon.png deleted file mode 100644 index 7b519ac..0000000 Binary files a/ChatRoom v4.4 cn/static/index/images/banner_afternoon.png and /dev/null differ diff --git a/ChatRoom v4.4 cn/static/index/images/banner_evening.png b/ChatRoom v4.4 cn/static/index/images/banner_evening.png deleted file mode 100644 index 046d964..0000000 Binary files a/ChatRoom v4.4 cn/static/index/images/banner_evening.png and /dev/null differ diff --git a/ChatRoom v4.4 cn/static/index/images/banner_morning.png b/ChatRoom v4.4 cn/static/index/images/banner_morning.png deleted file mode 100644 index 111a48b..0000000 Binary files a/ChatRoom v4.4 cn/static/index/images/banner_morning.png and /dev/null differ diff --git a/ChatRoom v4.4 cn/static/index/images/banner_night.png b/ChatRoom v4.4 cn/static/index/images/banner_night.png deleted file mode 100644 index 292f839..0000000 Binary files a/ChatRoom v4.4 cn/static/index/images/banner_night.png and /dev/null differ diff --git a/ChatRoom v4.4 cn/static/index/images/sidebar.gif b/ChatRoom v4.4 cn/static/index/images/sidebar.gif deleted file mode 100644 index 6987c7d..0000000 Binary files a/ChatRoom v4.4 cn/static/index/images/sidebar.gif and /dev/null differ diff --git a/ChatRoom v4.4 cn/static/index/styles/style.css b/ChatRoom v4.4 cn/static/index/styles/style.css deleted file mode 100644 index 78a51b0..0000000 --- a/ChatRoom v4.4 cn/static/index/styles/style.css +++ /dev/null @@ -1,310 +0,0 @@ -@charset "UTF-8"; -#mainwrapper header { - /*Header */ - background-color: #6972C6; - overflow: auto; - font-family: Constantia, "Lucida Bright", "DejaVu Serif", Georgia, STSong, STSong, SimSun, "serif"; - font-style: normal; - font-weight: 400; -} -#mainwrapper header #logo { - /* Company Logo text */ - width: 28%; - float: left; - padding-left: 2%; - padding-top: 12px; - padding-bottom: 12px; - color: white; -} -#mainwrapper header nav { - /*Nav bar containing links in header */ - text-align: right; - padding-top: 12px; - padding-bottom: 12px; - padding-right: 2%; - width: 68%; - float: left; - color: white; -} -header nav a { - /* Links in header */ - padding-right: 2%; - color: white; -} -#content #mainContent h1, #content #mainContent h2 { - /* Styling for main headings */ - font-family: Constantia, "Lucida Bright", "DejaVu Serif", Georgia, STSong, SimSun, "serif"; - font-size: 36px; - color: #474d87; -} -#content #mainContent h3 { - /*Captions ot Taglines */ - font-family: Constantia, "Lucida Bright", "DejaVu Serif", Georgia, STSong, SimSun, "serif"; - font-style: normal; - font-weight: 200; - color: #444765; -} -#content #mainContent #bannerImage { - /*Container for main banner image */ - width: 100%; - background-color: rgba(208,207,207,1.00); -} -#content #mainContent p { - /* All paragraphs under maincontent */ - color: #444765; - font-family: "Lucida Bright", "DejaVu Serif", Georgia, STFangsong, SimSun, "serif"; - font-size: 18px; - font-style: normal; - font-weight: 200; - text-align: justify; -} -#content #mainContent #authorInfo { - /* Author info section */ - font-family: "Lucida Bright", "DejaVu Serif", Georgia, STSong, SimSun, "serif"; - background-color: aliceblue; - border: 1px solid #6972C6; -} - -#content #mainContent #authorInfo h2 { - font-size: 24px; - padding-left: 2%; - padding-top: 5px; -} - -#content #mainContent #authorInfo p { - color: #444765; - padding-left: 2%; - padding-top: 0px; - padding-bottom: 11px; - padding-right: 2%; -} -footer article { - /* Footer articles */ - width: 46%; - float: left; - padding-left: 2%; - padding-right: 2%; - text-align: justify; - font-family: source-sans-pro, sans-serif; - font-style: normal; - font-weight: 200; - color: rgba(146,146,146,1.00); -} -footer article h3 { - /* Footer article titles */ - text-align: center; - font-family: montserrat, sans-serif; - font-style: normal; - font-weight: 400; -} -#mainContent { - /* Container for the blog post in individal blog view */ - padding-left: 2%; - width: 71%; - float: left; - padding-right: 2%; - padding-top: 41px; -} -#mainwrapper #content #sidebar { - /* Sidebar*/ - width: 19%; - padding-left: 2%; - padding-right: 2%; - float: left; - background-color: rgba(246,246,246,1.00); - margin-top: 150px; - padding-top: 32px; -} -#mainwrapper { - /* Container of all content */ - width: 94%; - overflow: auto; - margin-left: 3%; -} -#content #sidebar h2 { - /* Text box in sidebar */ - width: 98%; - font-family: Constantia, "Lucida Bright", "DejaVu Serif", Georgia, STSong, SimSun, "serif"; - font-size: 24px; - color: #444765; -} -#content #sidebar #adimage { - /* Container for Image in sidebar */ - width: 100%; - background-color: rgba(208,207,207,1.00); - margin-top: 46px; - float: none; - overflow: auto; -} -nav ul li { - list-style-type: none; - padding-top: 8px; - padding-bottom: 8px; -} -nav ul { - padding-left: 0%; -} -nav ul li a { - font-family: "Lucida Bright", "DejaVu Serif", Georgia, STSong, SimSun, "serif"; - font-size: 18px; - color: #444765; - text-decoration: none; -} -#footerbar { - /* Footer bar at the bottom of the page */ - height: 18px; - clear: both; - background-color: rgba(208,207,207,1.00); - width: 100%; -} -footer { - /* Container for footer artices */ - width: 71%; - padding-left: 2%; - padding-right: 2%; -} -footer a { - font-family: "Lucida Bright", "DejaVu Serif", Georgia, STSong, SimSun, "serif"; - font-size: 16px; - color: darkslateblue; - text-decoration: none; -} - -.notOnDesktop { - /*element to be displayed only in mobile view and tabet view */ - display: none; -} -#mainContent #bannerImage img { - /* Actual banner image */ - width: 100%; -} -#sidebar #adimage img { - /* Image in sidebar */ - width: 100%; - float: left; -} -#mainwrapper header nav a { - /* Links in header */ - color: rgba(146,146,146,1.00); - text-decoration: none; -} - -/* Tablet view */ -@media screen and (max-width:769px) { -.notOnDesktop { - /* Search box shown only in mobile view and Tablet view */ - display: block; - text-align: right; - padding-right: 8px; - padding-top: 8px; - padding-bottom: 8px; - width: 96%; -} -#content .notOnDesktop p { - height: 18px; - font-family: Constantia, "Lucida Bright", "DejaVu Serif", Georgia, STSong, SimSun, "serif"; - text-align: center; -} -#mainContent { - /* Container for the blog post */ - padding-top: 0px; - float: none; - width: 96%; -} -#sidebar input { - /* Search box in sidebar */ - display: none; -} -#mainwrapper #content #sidebar { - /* Sidebar*/ - float: none; - width: 92%; - padding-top: 13px; - overflow: auto; - margin-top: 3px; - margin-left: 2%; - padding-bottom: 13px; -} -#content #sidebar #adimage { - /* Image in sidebar */ - width: 60%; - margin-top: 0px; - float: left; -} -#content #sidebar nav { - /* Navigation links in sidebar */ - width: 36%; - float: left; - padding-left: 4%; -} -#sidebar nav ul { - margin-top: 0px; -} -footer { - /* Footer region */ - width: 96%; - padding-left: 2%; - padding-right: 2%; -} -#content footer article { - /*Each footer article */ - width: 46%; -} -#mainwrapper header { - /* Header */ - width: 100%; -} -} - -/* Mobile view */ -@media screen and (max-width:480px) { -#mainwrapper header #logo { - /* Company Logo text in header */ - width: 96%; - margin-left: 2%; -} -#mainwrapper header nav { - /*navigation links in header */ - text-align: center; - background-color: rgba(255,255,255,1.00); - width: 98%; -} -#content #sidebar #adimage { - /* Container for image in sidebar */ - width: 100%; -} -#content #sidebar nav { - /* Navigation bar for links in sidebar */ - width: 96%; - padding-top: 7px; -} -#sidebar nav ul li { - display: inline-block; - width: 32%; - text-align: center; -} -#mainwrapper #content #sidebar { - /* sidebar */ - padding-bottom: 0px; -} -#content .notOnDesktop { - /* Search box shown only in mobile and tablet view */ - width: 100%; - text-align: center; - padding-left: 0px; - padding-right: 0px; -} -#content .notOnDesktop p { - width: 80%; - font-family: Constantia, "Lucida Bright", "DejaVu Serif", Georgia, STSong, SimSun, "serif"; - text-align: center; -} -#content #mainContent h3 { - /* Title under maincontent, if any */ - font-size: 14px; -} -#content footer article { - /* Each foter article */ - width: 96%; -} -} diff --git a/ChatRoom v4.4 cn/static/register/images/sidebar.gif b/ChatRoom v4.4 cn/static/register/images/sidebar.gif deleted file mode 100644 index 6987c7d..0000000 Binary files a/ChatRoom v4.4 cn/static/register/images/sidebar.gif and /dev/null differ diff --git a/ChatRoom v4.4 cn/static/register/styles/style.css b/ChatRoom v4.4 cn/static/register/styles/style.css deleted file mode 100644 index db98b57..0000000 --- a/ChatRoom v4.4 cn/static/register/styles/style.css +++ /dev/null @@ -1,340 +0,0 @@ -@charset "UTF-8"; -#mainwrapper header { - /*Header */ - background-color: #6972C6; - overflow: auto; - font-family: Constantia, "Lucida Bright", "DejaVu Serif", Georgia, STSong, SimSun, "serif"; - font-style: normal; - font-weight: 400; -} -#mainwrapper header #logo { - /* Company Logo text */ - width: 28%; - float: left; - padding-left: 2%; - padding-top: 12px; - padding-bottom: 12px; - color: white; -} -#mainwrapper header nav { - /*Nav bar containing links in header */ - text-align: right; - padding-top: 12px; - padding-bottom: 12px; - padding-right: 2%; - width: 68%; - float: left; - color: white; -} -header nav a { - /* Links in header */ - padding-right: 2%; - color: white; -} -#content #mainContent h1, #content #mainContent h2 { - /* Styling for main headings */ - font-family: Constantia, "Lucida Bright", "DejaVu Serif", Georgia, STSong, SimSun, "serif"; - font-size: 36px; - color: #474d87; -} -#content #mainContent h3 { - /*Captions ot Taglines */ - font-family: Constantia, "Lucida Bright", "DejaVu Serif", Georgia, STSong, SimSun, "serif"; - font-style: normal; - font-weight: 200; - color: #444765; -} -#content #mainContent #bannerImage { - /*Container for main banner image */ - width: 100%; - background-color: rgba(208,207,207,1.00); -} -#content #mainContent p { - /* All paragraphs under maincontent */ - color: #444765; - font-family: "Lucida Bright", "DejaVu Serif", Georgia, STSong, SimSun, "serif"; - font-style: normal; - font-weight: 200; - text-align: justify; -} -#content #mainContent #authorInfo { - /* Author info section */ - font-family: "Lucida Bright", "DejaVu Serif", Georgia, STSong, SimSun, "serif"; - background-color: aliceblue; - border: 1px solid #6972C6; -} - -#content #mainContent #authorInfo h2 { - font-size: 24px; - padding-left: 2%; - padding-top: 5px; -} - -#content #mainContent #authorInfo p { - color: #444765; - padding-left: 2%; - padding-top: 0px; - padding-bottom: 11px; - padding-right: 2%; -} - -#content #mainContent #authorInfo a { - color: darkslateblue; - text-decoration-line: none; - -} - -#content #mainContent #authorInfo .time { - font-family: Cambria, "Hoefler Text", "Liberation Serif", Times, "Times New Roman", STSong, SimSun, "serif"; - font-size: 10pt; - padding-right: 1pc; - color: gray; -} - -#content #mainContent #authorInfo .address { - font-family: Cambria, "Hoefler Text", "Liberation Serif", Times, "Times New Roman", STSong, SimSun, "serif"; - font-size: 10pt; - padding-right: 1pc; - color: gray; -} - -#content #mainContent #authorInfo a { - font-family: Cambria, "Hoefler Text", "Liberation Serif", Times, "Times New Roman", STSong, SimSun, "serif"; - font-size: 14pt; - padding-right: 1pc; - color: darkslateblue; -} - -#content #mainContent #authorInfo video { - margin-left: 5%; - width: 90%; -} - -#content #mainContent #authorInfo textarea { - font-family: Courier New, Courier, monospace; -} - -footer article { - /* Footer articles */ - width: 46%; - float: left; - padding-left: 2%; - padding-right: 2%; - text-align: justify; - font-family: source-sans-pro, sans-serif; - font-style: normal; - font-weight: 200; - color: rgba(146,146,146,1.00); -} -footer article h3 { - /* Footer article titles */ - text-align: center; - font-family: montserrat, sans-serif; - font-style: normal; - font-weight: 400; -} -#mainContent { - /* Container for the blog post in individal blog view */ - padding-left: 2%; - width: 71%; - float: left; - padding-right: 2%; - padding-top: 41px; -} -#mainwrapper #content #sidebar { - /* Sidebar*/ - width: 19%; - padding-left: 2%; - padding-right: 2%; - float: left; - background-color: rgba(246,246,246,1.00); - margin-top: 150px; - padding-top: 32px; -} -#mainwrapper { - /* Container of all content */ - width: 94%; - overflow: auto; - margin-left: 3%; -} -#content #sidebar h2 { - /* Text box in sidebar */ - width: 98%; - font-family: Constantia, "Lucida Bright", "DejaVu Serif", Georgia, STSong, SimSun, "serif"; - font-size: 24px; - color: #444765; -} -#content #sidebar #adimage { - /* Container for Image in sidebar */ - width: 100%; - background-color: rgba(208,207,207,1.00); - margin-top: 46px; - float: none; - overflow: auto; -} -nav ul li { - list-style-type: none; - padding-top: 8px; - padding-bottom: 8px; -} -nav ul { - padding-left: 0%; -} -nav ul li a { - font-family: "Lucida Bright", "DejaVu Serif", Georgia, STSong, SimSun, "serif"; - font-size: 18px; - color: #444765; - text-decoration: none; -} -#footerbar { - /* Footer bar at the bottom of the page */ - margin-top: 20px; - height: 18px; - clear: both; - background-color: rgba(208,207,207,1.00); - width: 100%; -} -footer { - /* Container for footer artices */ - width: 71%; - padding-left: 2%; - padding-right: 2%; -} -.notOnDesktop { - /*element to be displayed only in mobile view and tabet view */ - display: none; -} -#mainContent #bannerImage img { - /* Actual banner image */ - width: 100%; -} -#sidebar #adimage img { - /* Image in sidebar */ - width: 100%; - float: left; -} -#mainwrapper header nav a { - /* Links in header */ - color: rgba(146,146,146,1.00); - text-decoration: none; -} - -/* Tablet view */ -@media screen and (max-width:769px) { -.notOnDesktop { - /* Search box shown only in mobile view and Tablet view */ - display: block; - text-align: right; - padding-right: 8px; - padding-top: 8px; - padding-bottom: 8px; - width: 96%; -} -#content .notOnDesktop p { - height: 18px; - font-family: Constantia, "Lucida Bright", "DejaVu Serif", Georgia, STSong, SimSun, "serif"; - text-align: center; -} -#mainContent { - /* Container for the blog post */ - padding-top: 0px; - float: none; - width: 96%; -} -#sidebar input { - /* Search box in sidebar */ - display: none; -} -#mainwrapper #content #sidebar { - /* Sidebar*/ - float: none; - width: 92%; - padding-top: 13px; - overflow: auto; - margin-top: 3px; - margin-left: 2%; - padding-bottom: 13px; -} -#content #sidebar #adimage { - /* Image in sidebar */ - width: 60%; - margin-top: 0px; - float: left; -} -#content #sidebar nav { - /* Navigation links in sidebar */ - width: 36%; - float: left; - padding-left: 4%; -} -#sidebar nav ul { - margin-top: 0px; -} -footer { - /* Footer region */ - width: 96%; - padding-left: 2%; - padding-right: 2%; -} -#content footer article { - /*Each footer article */ - width: 46%; -} -#mainwrapper header { - /* Header */ - width: 100%; -} -} - -/* Mobile view */ -@media screen and (max-width:480px) { -#mainwrapper header #logo { - /* Company Logo text in header */ - width: 96%; - margin-left: 2%; -} -#mainwrapper header nav { - /*navigation links in header */ - text-align: center; - background-color: rgba(255,255,255,1.00); - width: 98%; -} -#content #sidebar #adimage { - /* Container for image in sidebar */ - width: 100%; -} -#content #sidebar nav { - /* Navigation bar for links in sidebar */ - width: 96%; - padding-top: 7px; -} -#sidebar nav ul li { - display: inline-block; - width: 32%; - text-align: center; -} -#mainwrapper #content #sidebar { - /* sidebar */ - padding-bottom: 0px; -} -#content .notOnDesktop { - /* Search box shown only in mobile and tablet view */ - width: 100%; - text-align: center; - padding-left: 0px; - padding-right: 0px; -} -#content .notOnDesktop p { - width: 80%; - font-family: Constantia, "Lucida Bright", "DejaVu Serif", Georgia, STSong, SimSun, "serif"; - text-align: center; -} -#content #mainContent h3 { - /* Title under maincontent, if any */ - font-size: 14px; -} -#content footer article { - /* Each foter article */ - width: 96%; -} -} diff --git a/ChatRoom v4.4 cn/templates/404.html b/ChatRoom v4.4 cn/templates/404.html deleted file mode 100644 index 75e8074..0000000 --- a/ChatRoom v4.4 cn/templates/404.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - -[404] Little Corner - - - - - -

-
- - - -
-
-
- -

您正在使用移动设备浏览,
某些内容可能显示不正确.

-
-
- -

啊哦,发生了一点问题 T T

- -
-

- - 404:真不巧,页面走丢了~

-

-

-
- - -
- - -
-
- - diff --git a/ChatRoom v4.4 cn/templates/account.html b/ChatRoom v4.4 cn/templates/account.html deleted file mode 100644 index 25ca17a..0000000 --- a/ChatRoom v4.4 cn/templates/account.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - - -[Account] Little Corner - - - - - -
-
- - - -
-
-
- -

您正在使用移动设备浏览,
某些内容可能显示不正确.

-
-
- -

嘿,{{userid}}! 想换副新面孔吗?

-

- - Changes are always welcomed.

- -
- -
-

a bar?

-
-
- - diff --git a/ChatRoom v4.4 cn/templates/backlog.html b/ChatRoom v4.4 cn/templates/backlog.html deleted file mode 100644 index 7bb17c6..0000000 --- a/ChatRoom v4.4 cn/templates/backlog.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - -ChatRoom Backlog - - - - -
- - - - - - - -
← Home Chatroom Backlog
-
- - - -
- {%for i in range(0,n)%} -

{{lst[i][-1]}}

- {%for j in lst[i][:-1]%} - - - - - - - - - - - - - -
#{{j[1]}}{{j[2]}}{{j[5]}}
{{j[0][6:]}}@{{j[4]}}
- - {%endfor%} - {%endfor%} -
- - diff --git a/ChatRoom v4.4 cn/templates/chatroom.html b/ChatRoom v4.4 cn/templates/chatroom.html deleted file mode 100644 index a14fbaa..0000000 --- a/ChatRoom v4.4 cn/templates/chatroom.html +++ /dev/null @@ -1,269 +0,0 @@ - - - CHAT ROOM - - - - - - - - - - - - - -
+
提示:在新窗口中打开发送界面来获取更好体验
- - -
- - - - - - - -
← Home Chatroom
-
- -
-
- {%for i in DATA_LST[::-1]%} - - - - - - - - - - - - - - -
{{i[2]}}#{{i[1]}}
UID: {{i[4]}}{{i[3]}}{{i[0]}}
{{i[5]}}
-
- {%endfor%} -

{{python_message}}

-
- \ No newline at end of file diff --git a/ChatRoom v4.4 cn/templates/cloud.html b/ChatRoom v4.4 cn/templates/cloud.html deleted file mode 100644 index 1c17af7..0000000 --- a/ChatRoom v4.4 cn/templates/cloud.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - -[Cloud] Little Corner - - - - - -
-
- - - -
-
-
- -

您正在使用移动设备浏览,
某些内容可能显示不正确.

-
-
- -

- - Little Corner 云

-
-

- - -

{{python_hint}}

-

{{python_alert}}

-

- {% with messages = get_flashed_messages(with_categories=true) %} - {% if messages %} - {{messages[0][-1]}} - {% endif %} - {% endwith %} -

-

-
- -
- -
-

 

-
-
- - diff --git a/ChatRoom v4.4 cn/templates/index.html b/ChatRoom v4.4 cn/templates/index.html deleted file mode 100644 index f26935c..0000000 --- a/ChatRoom v4.4 cn/templates/index.html +++ /dev/null @@ -1,90 +0,0 @@ - - - - - -Little Corner - 互联网一隅 - - - - - -
-
- - - -
-
-
- -

您正在使用移动设备浏览,
某些内容可能显示不正确.

-
-
- -

{{greetings}},{{userid}}

-

- - 使用{{addr}},你在互联网的小角落找到了我们!

-
- {%if HOUR_NOW in range(5,12)%} - - {%elif HOUR_NOW in range(12,18)%} - - {%elif HOUR_NOW in range(18,22)%} - - {%else%} - - {%endif%} -
-

littlecorner.space 【互联网一隅】, 一群青年追寻梦想的小空间

-

这个网站是为了延续几个青少年的作品而设立的。
- 我们的项目最初是为在学校使用局域网聊天而启动。
- 这个网站将见证我们的项目到目前为止是如何发展的,以及它的未来。

- -
- - -
-
-
- - diff --git a/ChatRoom v4.4 cn/templates/login.html b/ChatRoom v4.4 cn/templates/login.html deleted file mode 100644 index e3844a1..0000000 --- a/ChatRoom v4.4 cn/templates/login.html +++ /dev/null @@ -1,86 +0,0 @@ - - - - - -【登录】 Little Corner - 互联网一隅 - - - - - -
-
- - -
-
-
- -

您正在使用移动设备浏览,
某些内容可能显示不正确.

-
-
- -

嘿,你在互联网的小角落找到了我们!

- - -
- -
-

a bar?

- -
- - diff --git a/ChatRoom v4.4 cn/templates/play.html b/ChatRoom v4.4 cn/templates/play.html deleted file mode 100644 index 799213c..0000000 --- a/ChatRoom v4.4 cn/templates/play.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - -[云] Little Corner - - - - - -
-
- - - -
-
-
- -

您正在使用移动设备浏览,
某些内容可能显示不正确.

-
-
- -

- - Little Corner 云

-
- -
- -
- -
-

a bar?

-
-
- - diff --git a/ChatRoom v4.4 cn/templates/register1.html b/ChatRoom v4.4 cn/templates/register1.html deleted file mode 100644 index 9b00bda..0000000 --- a/ChatRoom v4.4 cn/templates/register1.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - - -[注册] Little Corner - - - - - -
-
- - -
-
-
- -

您正在使用移动设备浏览,
某些内容可能显示不正确.

-
-
- -

嘿,你在互联网的小角落找到了我们!

-

- - 终于等到你了,完成这些步骤,成为我们的一员!

- -
- -
-

a bar?

-
-
- - diff --git a/ChatRoom v4.4 cn/templates/send.html b/ChatRoom v4.4 cn/templates/send.html deleted file mode 100644 index 0730015..0000000 --- a/ChatRoom v4.4 cn/templates/send.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - -ChatRoom - 发送窗口 - - - - -
- - - - - - -
Send Message
-
-
-

{{python_hint}}

-

{{python_alert}}

- -
- - - - - - - - - - -
用户名:
内容: -
-
-
- - diff --git a/ChatRoom v4.3/bin/uid.json b/ChatRoom/bin/uid.json similarity index 100% rename from ChatRoom v4.3/bin/uid.json rename to ChatRoom/bin/uid.json diff --git a/ChatRoom v4.3/bin/users.json b/ChatRoom/bin/users.json similarity index 100% rename from ChatRoom v4.3/bin/users.json rename to ChatRoom/bin/users.json diff --git a/ChatRoom v4.3/cloud/file_data.json b/ChatRoom/cloud/file_data.json similarity index 100% rename from ChatRoom v4.3/cloud/file_data.json rename to ChatRoom/cloud/file_data.json diff --git "a/ChatRoom v4.3/cloud/files/\347\233\256\345\212\233\345\244\251\347\261\201.mp3" "b/ChatRoom/cloud/files/\347\233\256\345\212\233\345\244\251\347\261\201.mp3" similarity index 100% rename from "ChatRoom v4.3/cloud/files/\347\233\256\345\212\233\345\244\251\347\261\201.mp3" rename to "ChatRoom/cloud/files/\347\233\256\345\212\233\345\244\251\347\261\201.mp3" diff --git "a/ChatRoom v4.3/cloud/files/\347\255\224\346\241\210.txt" "b/ChatRoom/cloud/files/\347\255\224\346\241\210.txt" similarity index 100% rename from "ChatRoom v4.3/cloud/files/\347\255\224\346\241\210.txt" rename to "ChatRoom/cloud/files/\347\255\224\346\241\210.txt" diff --git a/ChatRoom v4.3/init.py b/ChatRoom/init.py similarity index 91% rename from ChatRoom v4.3/init.py rename to ChatRoom/init.py index 81578a9..eaa6827 100644 --- a/ChatRoom v4.3/init.py +++ b/ChatRoom/init.py @@ -3,6 +3,7 @@ import datetime as dt import json as js import os +import socket # 获取工作路径 def init_path(): @@ -89,6 +90,23 @@ def init_file_sending(): if flag: write_file(PATH_FILE_JS, FILE_LIST)#若有文件变动,修正该问题 return [PATH_FILE_JS, PATH_FILES, FILE_LIST] + +def getip(): + try: + s=socket.socket(socket.AF_INET,socket.SOCK_DGRAM) + s.connect(('8.8.8.8',80)) + ip=s.getsockname()[0] + except Exception as err: + print('error:network error') + print('任意键退出',end='');input() + exit(1) + finally: + s.close() + return ip + +def self_ipRefresh(obj): + return obj.refresh(getip()) + #处理文件名防止重名 def check_filename(path,original_name): exist_names = os.listdir(path) diff --git a/ChatRoom v4.3/logfiles/23-06-11.json b/ChatRoom/logfiles/23-06-11.json similarity index 100% rename from ChatRoom v4.3/logfiles/23-06-11.json rename to ChatRoom/logfiles/23-06-11.json diff --git a/ChatRoom v4.3/server.py b/ChatRoom/server.py similarity index 94% rename from ChatRoom v4.3/server.py rename to ChatRoom/server.py index 57daeba..a703ad7 100644 --- a/ChatRoom v4.3/server.py +++ b/ChatRoom/server.py @@ -5,10 +5,14 @@ import datetime as dt import os from urllib.parse import quote + +import time as tm + from init import * +import timeView IP = "0.0.0.0" -PORT = 80 +PORT = 1145 FILE_MAXSIZE = 500 * 1024 * 1024 # 云盘文件大小限制:500MB @@ -26,15 +30,17 @@ def index(): return redirect('/login') else: userid = USERDB[uid][0] - HOUR_NOW = dt.datetime.now().hour - if HOUR_NOW in range(5,12): - return render_template("index.html", greetings="🌅 Good Morning", userid=userid, addr=addr) - elif HOUR_NOW in range(12,18): - return render_template("index.html", greetings="🌞 Good Afternoon", userid=userid, addr=addr) - elif HOUR_NOW in range(18,22): - return render_template("index.html", greetings="🌇 Good Evening", userid=userid, addr=addr) - else: - return render_template("index.html", greetings="🌙 Good Night", userid=userid, addr=addr) + + t1 = tm.time() + if addr not in IP_LIST: # 新ip + IP_LIST[addr] = timeView.IP_VIEW() # 建立新的运算对象 + view_banner = IP_LIST[addr].refresh(addr, CHINA_SEASON) # 进行计算 + if view_banner == None: # 计算失败 + print(f"[Warning] Faild to get view cover: {addr}. Use default view cover instead") + view_banner = "Main_noon_bg_summer.png" # 使用默认情况 + + print("time cost:",tm.time() - t1) + return render_template("index.html", greetings="Welcome! ", viewBanner=view_banner, userid=userid, addr=addr) # 聊天主页面 @app.route("/chatroom/") @@ -308,4 +314,7 @@ def error404(error): # 接受错误作为参数 DATA_LST, LOGFILE, UIDB, UIDFILE, USERDB, USERFILE, floor = init_file() BACK_LOG_LST, BACK_LOG_LEN = init_backlog() PATH_FILE_JS, PATH_FILES, FILE_LIST = init_file_sending() + timeView.init() + CHINA_SEASON = timeView.get_ChinaSeason() + IP_LIST = {} app.run(host=IP, port=PORT, debug=True) diff --git a/ChatRoom v4.3/static/error/images/404.png b/ChatRoom/static/error/images/404.png similarity index 100% rename from ChatRoom v4.3/static/error/images/404.png rename to ChatRoom/static/error/images/404.png diff --git a/ChatRoom v4.3/static/error/images/ji.gif b/ChatRoom/static/error/images/ji.gif similarity index 100% rename from ChatRoom v4.3/static/error/images/ji.gif rename to ChatRoom/static/error/images/ji.gif diff --git a/ChatRoom v4.3/static/error/images/noji.gif b/ChatRoom/static/error/images/noji.gif similarity index 100% rename from ChatRoom v4.3/static/error/images/noji.gif rename to ChatRoom/static/error/images/noji.gif diff --git a/ChatRoom v4.3/static/index/images/HomePageSideImage.gif b/ChatRoom/static/index/images/HomePageSideImage.gif similarity index 100% rename from ChatRoom v4.3/static/index/images/HomePageSideImage.gif rename to ChatRoom/static/index/images/HomePageSideImage.gif diff --git a/ChatRoom v4.3/static/index/images/banner.png b/ChatRoom/static/index/images/banner.png similarity index 100% rename from ChatRoom v4.3/static/index/images/banner.png rename to ChatRoom/static/index/images/banner.png diff --git a/ChatRoom v4.3/static/index/images/sidebar.gif b/ChatRoom/static/index/images/sidebar.gif similarity index 100% rename from ChatRoom v4.3/static/index/images/sidebar.gif rename to ChatRoom/static/index/images/sidebar.gif diff --git a/ChatRoom v4.3/static/index/styles/style.css b/ChatRoom/static/index/styles/style.css similarity index 100% rename from ChatRoom v4.3/static/index/styles/style.css rename to ChatRoom/static/index/styles/style.css diff --git a/ChatRoom v4.3/static/register/images/sidebar.gif b/ChatRoom/static/register/images/sidebar.gif similarity index 100% rename from ChatRoom v4.3/static/register/images/sidebar.gif rename to ChatRoom/static/register/images/sidebar.gif diff --git a/ChatRoom v4.3/static/register/styles/style.css b/ChatRoom/static/register/styles/style.css similarity index 100% rename from ChatRoom v4.3/static/register/styles/style.css rename to ChatRoom/static/register/styles/style.css diff --git a/ChatRoom/static/view/Main_dawn_bg_autumn.png b/ChatRoom/static/view/Main_dawn_bg_autumn.png new file mode 100644 index 0000000..566b757 Binary files /dev/null and b/ChatRoom/static/view/Main_dawn_bg_autumn.png differ diff --git a/ChatRoom/static/view/Main_dawn_bg_spring.png b/ChatRoom/static/view/Main_dawn_bg_spring.png new file mode 100644 index 0000000..e460033 Binary files /dev/null and b/ChatRoom/static/view/Main_dawn_bg_spring.png differ diff --git a/ChatRoom/static/view/Main_dawn_bg_summer.png b/ChatRoom/static/view/Main_dawn_bg_summer.png new file mode 100644 index 0000000..df0a6a2 Binary files /dev/null and b/ChatRoom/static/view/Main_dawn_bg_summer.png differ diff --git a/ChatRoom/static/view/Main_dawn_bg_winter.png b/ChatRoom/static/view/Main_dawn_bg_winter.png new file mode 100644 index 0000000..cba6bcd Binary files /dev/null and b/ChatRoom/static/view/Main_dawn_bg_winter.png differ diff --git a/ChatRoom/static/view/Main_dusk_bg_autumn.png b/ChatRoom/static/view/Main_dusk_bg_autumn.png new file mode 100644 index 0000000..e6162a0 Binary files /dev/null and b/ChatRoom/static/view/Main_dusk_bg_autumn.png differ diff --git a/ChatRoom/static/view/Main_dusk_bg_spring.png b/ChatRoom/static/view/Main_dusk_bg_spring.png new file mode 100644 index 0000000..3290791 Binary files /dev/null and b/ChatRoom/static/view/Main_dusk_bg_spring.png differ diff --git a/ChatRoom/static/view/Main_dusk_bg_summer.png b/ChatRoom/static/view/Main_dusk_bg_summer.png new file mode 100644 index 0000000..6693c13 Binary files /dev/null and b/ChatRoom/static/view/Main_dusk_bg_summer.png differ diff --git a/ChatRoom/static/view/Main_dusk_bg_winter.png b/ChatRoom/static/view/Main_dusk_bg_winter.png new file mode 100644 index 0000000..5ac8084 Binary files /dev/null and b/ChatRoom/static/view/Main_dusk_bg_winter.png differ diff --git a/ChatRoom/static/view/Main_night_bg_autumn.png b/ChatRoom/static/view/Main_night_bg_autumn.png new file mode 100644 index 0000000..bc9defb Binary files /dev/null and b/ChatRoom/static/view/Main_night_bg_autumn.png differ diff --git a/ChatRoom/static/view/Main_night_bg_spring.png b/ChatRoom/static/view/Main_night_bg_spring.png new file mode 100644 index 0000000..3b377ae Binary files /dev/null and b/ChatRoom/static/view/Main_night_bg_spring.png differ diff --git a/ChatRoom/static/view/Main_night_bg_summer.png b/ChatRoom/static/view/Main_night_bg_summer.png new file mode 100644 index 0000000..fc68bdb Binary files /dev/null and b/ChatRoom/static/view/Main_night_bg_summer.png differ diff --git a/ChatRoom/static/view/Main_night_bg_winter.png b/ChatRoom/static/view/Main_night_bg_winter.png new file mode 100644 index 0000000..1ccabb7 Binary files /dev/null and b/ChatRoom/static/view/Main_night_bg_winter.png differ diff --git a/ChatRoom/static/view/Main_noon_bg_autumn.png b/ChatRoom/static/view/Main_noon_bg_autumn.png new file mode 100644 index 0000000..0d44504 Binary files /dev/null and b/ChatRoom/static/view/Main_noon_bg_autumn.png differ diff --git a/ChatRoom/static/view/Main_noon_bg_spring.png b/ChatRoom/static/view/Main_noon_bg_spring.png new file mode 100644 index 0000000..336e86e Binary files /dev/null and b/ChatRoom/static/view/Main_noon_bg_spring.png differ diff --git a/ChatRoom/static/view/Main_noon_bg_summer.png b/ChatRoom/static/view/Main_noon_bg_summer.png new file mode 100644 index 0000000..e869bf4 Binary files /dev/null and b/ChatRoom/static/view/Main_noon_bg_summer.png differ diff --git a/ChatRoom/static/view/Main_noon_bg_winter.png b/ChatRoom/static/view/Main_noon_bg_winter.png new file mode 100644 index 0000000..8626c0a Binary files /dev/null and b/ChatRoom/static/view/Main_noon_bg_winter.png differ diff --git a/ChatRoom v4.3/templates/404.html b/ChatRoom/templates/404.html similarity index 100% rename from ChatRoom v4.3/templates/404.html rename to ChatRoom/templates/404.html diff --git a/ChatRoom v4.3/templates/account.html b/ChatRoom/templates/account.html similarity index 100% rename from ChatRoom v4.3/templates/account.html rename to ChatRoom/templates/account.html diff --git a/ChatRoom v4.3/templates/backlog.html b/ChatRoom/templates/backlog.html similarity index 100% rename from ChatRoom v4.3/templates/backlog.html rename to ChatRoom/templates/backlog.html diff --git a/ChatRoom v4.3/templates/chatroom.html b/ChatRoom/templates/chatroom.html similarity index 100% rename from ChatRoom v4.3/templates/chatroom.html rename to ChatRoom/templates/chatroom.html diff --git a/ChatRoom v4.3/templates/cloud.html b/ChatRoom/templates/cloud.html similarity index 100% rename from ChatRoom v4.3/templates/cloud.html rename to ChatRoom/templates/cloud.html diff --git a/ChatRoom v4.3/templates/index.html b/ChatRoom/templates/index.html similarity index 97% rename from ChatRoom v4.3/templates/index.html rename to ChatRoom/templates/index.html index bd870b3..4440861 100644 --- a/ChatRoom v4.3/templates/index.html +++ b/ChatRoom/templates/index.html @@ -33,6 +33,7 @@

Using IP: {{addr}}, Welcome to visit us at a little corner of the Web!

+

littlecorner.space, A Space for a Group of Teens Pursuing Dreams

This site is set up to be a continuation of works done by a couple of teens.
The project was initially launched for chat using LAN in school.
diff --git a/ChatRoom v4.3/templates/login.html b/ChatRoom/templates/login.html similarity index 100% rename from ChatRoom v4.3/templates/login.html rename to ChatRoom/templates/login.html diff --git a/ChatRoom v4.3/templates/play.html b/ChatRoom/templates/play.html similarity index 100% rename from ChatRoom v4.3/templates/play.html rename to ChatRoom/templates/play.html diff --git a/ChatRoom v4.3/templates/register.html b/ChatRoom/templates/register.html similarity index 100% rename from ChatRoom v4.3/templates/register.html rename to ChatRoom/templates/register.html diff --git a/ChatRoom v4.3/templates/register1.html b/ChatRoom/templates/register1.html similarity index 100% rename from ChatRoom v4.3/templates/register1.html rename to ChatRoom/templates/register1.html diff --git a/ChatRoom v4.3/templates/send.html b/ChatRoom/templates/send.html similarity index 100% rename from ChatRoom v4.3/templates/send.html rename to ChatRoom/templates/send.html diff --git a/ChatRoom/timeView.py b/ChatRoom/timeView.py new file mode 100644 index 0000000..ef69dc7 --- /dev/null +++ b/ChatRoom/timeView.py @@ -0,0 +1,153 @@ +import os +import cnlunar as cl +import datetime as dt +import json as js +from astral import LocationInfo, sun +import time as tm +import requests as rq +import pytz + +SEASON_DIC = {"春":"spring", "夏":"summer", "秋":"autumn", "冬":"winter"} +OPPO_SEASON_DIC = {"autumn":"spring", "winter":"summer", "spring":"autumn", "summer":"winter"} +TIME_DIC = ["night", "dawn", "noon", "dusk", "night"] + +IPINFO_URL = "http://ip-api.com/json/" +# IPINFO_URL = "http://freeapi.ipip.net/" + +def init(): # 初始化路径数据 + global PATH, IMG_PATH, IMG_LST + PATH = os.getcwd() + static_PATH = os.path.join(PATH, "static") + IMG_PATH = os.path.join(static_PATH, "view") + IMG_LST = os.listdir(IMG_PATH) + +def get_ChinaSeason() -> str: # 获取中国的季节 + time = dt.datetime.utcnow() + dt.timedelta(hours=8)# not dt.datetime.now(), beacuse we need UTC+8(China) to calculate cnlunar season + today_lunar = cl.Lunar(time, godType=f'8char') #创建农历日期对象 + today_season = today_lunar.lunarSeason #获取季节 + return SEASON_DIC[today_season[-1]] #转为所需格式 + +class IP_VIEW: + def __init__(self): + self.ipInfo = None # dict:"timezone":str->dt.timezone, "latitude":float, "longitude":float 存档获取结果 + self.season = None # str 存档计算结果:季节 + self.periods = None # list 存档计算结果:时间区间列表 + self.date = None # dt.datetime 存档计算结果的调用时间 + + def _get_ipInfo(self, ip: str)->None: # 获取ip信息 + rq_url = f"{IPINFO_URL}{ip}" + try: + res = rq.get(rq_url).text + except rq.RequestException: + print("[ERROR] Failed to request :(") + return + if res: + res = js.loads(res) + if res['status'] == 'success': + self.ipInfo =\ + {"timezone": res["timezone"],\ + "latitude": res["lat"],\ + "longitude": res["lon"],\ + } + return + + print("[ERROR] Succeeded in request. However, the response is not valid :(") + print(res);print() + + def _get_timezone(self)->None: # 改写时区(str->dt.timezone) + timezone_str = self.ipInfo["timezone"] + try: + timezone = pytz.timezone(timezone_str) + except pytz.UnknownTimeZoneError: + return None # 如果时区无效,返回None + utc_offset = timezone.utcoffset(dt.datetime.now()) + self.ipInfo["timezone"] = dt.timezone(utc_offset) + + def _get_season(self, China_season:str)->None: #计算季节 + if self.ipInfo["latitude"] < 0: + self.season = OPPO_SEASON_DIC[China_season] + else: + self.season = China_season + + def _get_periods(self)->None: # 计算当天时间区间列表 + time = self.date + current_timezone = self.ipInfo["timezone"] + ipInfo = self.ipInfo + location = LocationInfo('User', 'China', ipInfo["timezone"], ipInfo["latitude"], ipInfo["longitude"]) #创建地点对象 + s = sun.sun(location.observer, date = time, tzinfo = ipInfo["timezone"]) #计算太阳时段 + + tz_off = lambda x:x.replace(tzinfo = self.ipInfo["timezone"]) + self.periods = list(map(tz_off, [s["dawn"], s["sunrise"], s["sunset"], s["dusk"]])) + + def _loc_period(self)->int: # 定位时间段 + time = self.date + periods = self.periods + loc = 0 + + while loc < len(periods) and time > periods[loc]: #定位 + loc += 1 + return loc + + def _get_img(self, period_now:int)->str: # 确定图片 + season = self.season + period_now_ = TIME_DIC[period_now] + file = None + for i in IMG_LST: #寻找所需壁纸文件 + if season in i: + if period_now_ in i: + file = i + break + if file is None: # 未知原因导致了未匹配 + print( "[warning: failed to get resource image due to a unknow problem. Use default image instead.]") + file = "Main_noon_bg_summer.png" + return file + + def _is_same_day(self)->bool: # 判断记录的时间是不是和当前同一天 + date1 = self._convert_timezone() + date2 = self.date + year1, month1, day1 = date1.year, date1.month, date1.day + year2, month2, day2 = date2.year, date2.month, date2.day + if year1 == year2 and month1 == month2 and day1 == day2: + return True + else: + return False + + def _convert_timezone(self)->dt.datetime: # 获取ip所在地时间 + # 获取当前时区、时间 + time = dt.datetime.utcnow() + current_timezone = pytz.timezone('UTC') + # 将时间转换为UTC + utc_time = time.replace(tzinfo=current_timezone) + # 将UTC时间转换为目标时区 + target_timezone = self.ipInfo["timezone"] + target_time = utc_time.astimezone(target_timezone) + return target_time + + def refresh(self, ip:str, China_season:str)->str: + if None in (self.ipInfo, self.date, self.periods, self.season): # 存在缺失信息 + try: + self._get_ipInfo(ip) + self._get_timezone() + self.date = self._convert_timezone() + # 获取基础信息 + except: + return None # 获取过程中报错 + if None in (self.ipInfo, self.date): # 存在基础信息缺失 + return None + if self._is_same_day(): # 不同一天,需要重新计算数据 + self._get_periods() + self._get_season(China_season) + + period_now = self._loc_period() + return self._get_img(period_now) + +if __name__ == "__main__": + init() + China_season = get_ChinaSeason() + obj = IP_VIEW() + obj_ = IP_VIEW() + print(obj.refresh("101.133.136.70", China_season)) + print(obj.refresh("101.133.136.70", China_season)) + print(obj.refresh("101.133.136.70", China_season)) + print("US", obj_.refresh("216.158.237.251", China_season)) + diff --git a/requirements(for all version).txt b/requirements(for all version).txt index 2c238a9..360c888 100644 --- a/requirements(for all version).txt +++ b/requirements(for all version).txt @@ -17,4 +17,8 @@ PyScreeze==0.1.28 pytweening==1.0.4 urllib3==1.26.14 pyperclip==1.8.2 -PyRect==0.2.0 \ No newline at end of file +PyRect==0.2.0 +cnlunar +astral +requests +pytz