This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# encoding: utf-8 | |
""" | |
@author: edsion | |
@file: demo.py | |
@time: 2019-05-22 14:50 | |
当前工程目录结构: | |
. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Device(Serial, Transport): | |
INSTALL_RESULT_PATTERN = r"(Success|Failure|Error)\s?(.*)" | |
UNINSTALL_RESULT_PATTERN = r"(Success|Failure.*|.*Unknown package:.*)" | |
def __new__(cls, *args, **kwargs): | |
# s = importlib.import_module('.__init__', ['plugins']) | |
p = Path(__file__).parent.joinpath('plugins/dumpsys.py') | |
# s = importlib.util.spec_from_file_location('plugins', submodule_search_locations=[p]) | |
s = importlib.util.find_spec('.dumpsys', 'src.tmd.common.adb.plugins') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# encoding: utf-8 | |
""" | |
@author: edsion | |
@file: 3.py | |
@time: 2019-03-26 19:42 | |
""" | |
import csv | |
import json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>demo</title> | |
<link rel="stylesheet" href="index.css"> | |
</head> | |
<body> | |
<img id="screenshot" src="" hidden> | |
<div class="shared"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import time | |
from urllib.parse import unquote | |
def index(request): | |
data = {'service': 'create_activate_member', 'version': '1.0', 'request_time': int(time.time()), 'partner_id': '200029043446', | |
'_input_charset': 'UTF-8', 'sign_type': 'RSA', 'sign_version': '1.0', 'encrypt_version': '1.0', | |
'identity_id': '0401113818', 'identity_type': 'UID', 'client_ip': '1.1.1.1'} | |
print(unquote(requests.post('https://gate.pay.sina.com.cn/mgs/gateway.do', data={'data':data}).text)) | |
return HttpResponse('index') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import logging | |
from logging.handlers import RotatingFileHandler | |
logger = logging.getLogger(__name__) | |
logger.setLevel(logging.DEBUG) | |
fmt = logging.Formatter("%(asctime)s %(levelname)-7s %(module)10s:%(lineno)-4s %(message)s", "%H:%M:%S") | |
sh = logging.StreamHandler() | |
sh.setFormatter(fmt) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
# Created by edsion on 2017/3/10 | |
import fcntl, sys, time, os | |
pidfile = 0 | |
def ApplicationInstance(): |