Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Sourcery refactored master branch#1

Open
sourcery-ai wants to merge1 commit intomaster
base:master
Choose a base branch
Loading
fromsourcery/master
Open
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletionsYiriAir/driver.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -27,16 +27,11 @@ def _analyze_message_type(chat_item_content_layout):
# 文本消息(或不支持的消息)
if layout_type == 'android.widget.TextView':
txt = chat_item_content_layout.get_text().strip()
if txt[4:] == '请使用最新版手机QQ查看。':
return '', 'Unknown'
else:
return txt, 'Text'
# 回复消息
return ('', 'Unknown') if txt[4:] == '请使用最新版手机QQ查看。' else (txt, 'Text')
elif layout_type == 'android.widget.LinearLayout':
txt = chat_item_content_layout.child(
'com.tencent.qqlite:id/chat_item_content_text').get_text().strip()
return txt, 'Text'
# 图片、语音或多媒体信息
Comment on lines -30 to -39
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Function_analyze_message_type refactored with the following changes:

This removes the following comments (why? ):

# 回复消息# 图片、语音或多媒体信息

elif layout_type == 'android.widget.RelativeLayout':
# 图片
if chat_item_content_layout.child("com.tencent.qqlite:id/pic").exists():
Expand DownExpand Up@@ -82,11 +77,10 @@ def __init__(self, driver, hot=False):
self._hot = hot

def init_latest_message(self):
message_list = self.get_message_list()
if message_list:
if message_list := self.get_message_list():
self.latest_message = message_list[-1]
self.title = self.get_title()
logger_yiri.info('Session set up. Title: {}'.format(self.title))
logger_yiri.info(f'Session set up. Title: {self.title}')
Comment on lines -85 to +83
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

FunctionSession.init_latest_message refactored with the following changes:


def normalize_qqlite(self):
self.poco.normalize_qqlite()
Expand Down
4 changes: 2 additions & 2 deletionsdemo.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,8 +6,8 @@

@yiri.on_message()
def on_message(msg, title, sender):
print('>>>' +msg)
print(f'>>>{msg}')
if msg[:4] == '####':
yiri.send_message('msg={}, title={}, sender={}'.format(msg, title, sender))
yiri.send_message(f'msg={msg}, title={title}, sender={sender}')
Comment on lines -9 to +11
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Functionon_message refactored with the following changes:


yiri.run()

[8]ページ先頭

©2009-2025 Movatter.jp