From 362f5c51d3cdf354b9fe69d01863d62b874e28f2 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Mon, 4 Feb 2019 16:16:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 181 ++++++++++++++++++++++++++++ README.md | 3 +- Chat.py => Struct/Chat.py | 4 +- Digg.py => Struct/Digg.py | 0 Gift.py => Struct/Gift.py | 2 +- Lottery.py => Struct/Lottery.py | 2 +- LuckyUser.py => Struct/LuckyUser.py | 2 +- MemberMsg.py => Struct/MemberMsg.py | 2 +- User.py => Struct/User.py | 0 WinMain.py | 10 +- api.py | 16 +-- 11 files changed, 202 insertions(+), 20 deletions(-) create mode 100644 .gitignore rename Chat.py => Struct/Chat.py (93%) rename Digg.py => Struct/Digg.py (100%) rename Gift.py => Struct/Gift.py (97%) rename Lottery.py => Struct/Lottery.py (98%) rename LuckyUser.py => Struct/LuckyUser.py (94%) rename MemberMsg.py => Struct/MemberMsg.py (95%) rename User.py => Struct/User.py (100%) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8d5e389 --- /dev/null +++ b/.gitignore @@ -0,0 +1,181 @@ +# Created by .ignore support plugin (hsz.mobi) +### Python template +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# pyenv +.python-version + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +### JetBrains template +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/modules.xml +# .idea/*.iml +# .idea/modules + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests +### VirtualEnv template +# Virtualenv +# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/ +.Python +[Bb]in +[Ii]nclude +[Ll]ib +[Ll]ib64 +[Ll]ocal +[Ss]cripts +pyvenv.cfg +.venv +pip-selfcheck.json + diff --git a/README.md b/README.md index ac8c851..d34c593 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ ### 计划更新: + Digg消息(点亮了喜欢)实例化 ++ 可以输入中文用户名进行查询 + √ ~~使用android app协议~~ 已使用 @@ -13,4 +14,4 @@ + √ ~~闲的无聊的时候看一看有没有好用的GUI轮子可以用用~~ 已完成 - 已基于BiliLive_dm制作出初代西瓜直播弹幕姬,api未跟进 + 已基于BiliLive_dm制作出初代西瓜直播弹幕姬,待处理效率问题 diff --git a/Chat.py b/Struct/Chat.py similarity index 93% rename from Chat.py rename to Struct/Chat.py index c208240..729ee78 100644 --- a/Chat.py +++ b/Struct/Chat.py @@ -1,5 +1,5 @@ -from User import User -from Lottery import Lottery +from .User import User +from .Lottery import Lottery class Chat: diff --git a/Digg.py b/Struct/Digg.py similarity index 100% rename from Digg.py rename to Struct/Digg.py diff --git a/Gift.py b/Struct/Gift.py similarity index 97% rename from Gift.py rename to Struct/Gift.py index 641c0ff..c856b28 100644 --- a/Gift.py +++ b/Struct/Gift.py @@ -1,5 +1,5 @@ import requests -from User import User +from .User import User class Gift: diff --git a/Lottery.py b/Struct/Lottery.py similarity index 98% rename from Lottery.py rename to Struct/Lottery.py index f71d247..a141098 100644 --- a/Lottery.py +++ b/Struct/Lottery.py @@ -1,6 +1,6 @@ import requests import time -from LuckyUser import LuckyUser +from .LuckyUser import LuckyUser class Lottery: diff --git a/LuckyUser.py b/Struct/LuckyUser.py similarity index 94% rename from LuckyUser.py rename to Struct/LuckyUser.py index d9a0cd2..2fb195e 100644 --- a/LuckyUser.py +++ b/Struct/LuckyUser.py @@ -1,4 +1,4 @@ -from User import User +from .User import User class LuckyUser: diff --git a/MemberMsg.py b/Struct/MemberMsg.py similarity index 95% rename from MemberMsg.py rename to Struct/MemberMsg.py index 04e60f8..404a522 100644 --- a/MemberMsg.py +++ b/Struct/MemberMsg.py @@ -1,4 +1,4 @@ -from User import User +from .User import User class MemberMsg: diff --git a/User.py b/Struct/User.py similarity index 100% rename from User.py rename to Struct/User.py diff --git a/WinMain.py b/WinMain.py index 72003a2..6c3c362 100644 --- a/WinMain.py +++ b/WinMain.py @@ -4,11 +4,11 @@ import time import requests -from Gift import Gift -from Lottery import Lottery -from MemberMsg import MemberMsg -from User import User -from Chat import Chat +from Struct.MemberMsg import MemberMsg +from Struct.User import User +from Struct.Gift import Gift +from Struct.Chat import Chat +from Struct.Lottery import Lottery from api import XiGuaLiveApi as Api import msvcrt import ctypes diff --git a/api.py b/api.py index 6a260f4..85bc3dc 100644 --- a/api.py +++ b/api.py @@ -1,10 +1,10 @@ import sys -from MemberMsg import MemberMsg -from User import User -from Gift import Gift -from Chat import Chat -from Lottery import Lottery +from Struct.MemberMsg import MemberMsg +from Struct.User import User +from Struct.Gift import Gift +from Struct.Chat import Chat +from Struct.Lottery import Lottery import requests import time @@ -194,9 +194,9 @@ class XiGuaLiveApi: self._updRoomCount += 1 if self.lottery is not None and self.lottery.ID != 0: self.lottery.update() - if self.lottery.isFinished: - self.onLottery(self.lottery) - self.lottery = None + if self.lottery.isFinished: + self.onLottery(self.lottery) + self.lottery = None if self._updRoomCount > 120 or len(d['data']) == 0: self.updRoomInfo() self._updRoomCount = 0