当前位置: 首页 > news >正文

完整个人网站html做推广怎么做

完整个人网站html,做推广怎么做,dede网站如何换logo,济南网站建设公司哪个好一、前置说明 在Appium的1.6.0版本中引入了AppiumService类,可以很方便的通过该类来管理Appium服务器的启动和停止。经过测试,使用该类的实例执行关闭server时,并没有释放端口号,会导致第二次启动时失败。另外,使用该…

一、前置说明

在Appium的1.6.0版本中引入了AppiumService类,可以很方便的通过该类来管理Appium服务器的启动和停止。经过测试,使用该类的实例执行关闭server时,并没有释放端口号,会导致第二次启动时失败。另外,使用该类启动server,不能在窗口中实时显示日志,不方便调试。因此,可以重写 AppiumService 类的 start 方法和 stop 方法,实现相应功能。

二、代码实现

import loggingfrom appium.webdriver.appium_service import *
from appium.webdriver.appium_service import AppiumService as OriginalServerfrom libs import path, file_util
from libs.cmd_util import cmd_executor as cmdlogger = logging.getLogger(__name__)class AppiumService(OriginalServer):def __init__(self, port=4723, log_file_path=None, tail_log=False):super().__init__()self.port = portself.log_file_path = log_file_path# 用于控制是否开启cmd窗口,实时展示日志内容,当调试代码时建议开启self.tail_log = tail_logif not self.log_file_path:self.log_file_path = os.path.join(path.get_log_dir(), f'appium_server_{port}.log')if os.path.exists(self.log_file_path):os.remove(self.log_file_path)self.default_start_args = ['-p', str(self.port),'-g', self.log_file_path,'--session-override','--log-timestamp','--session-override','--local-timezone','--allow-insecure','chromedriver_autodownload']def start(self, **kwargs: Any) -> sp.Popen:self.stop()env = kwargs['env'] if 'env' in kwargs else Nonenode: str = kwargs.get('node') or get_node()npm: str = kwargs.get('npm') or get_npm()main_script: str = kwargs.get('main_script') or get_main_script(node, npm)# A workaround for https://github.com/appium/python-client/issues/534default_std = sp.DEVNULL if sys.platform == 'win32' else sp.PIPEstdout = kwargs['stdout'] if 'stdout' in kwargs else default_stdstderr = kwargs['stderr'] if 'stderr' in kwargs else default_stdtimeout_ms = int(kwargs['timeout_ms']) if 'timeout_ms' in kwargs else STARTUP_TIMEOUT_MSargs: List[str] = [node, main_script]if 'args' in kwargs:args.extend(kwargs['args'])# ==================添加这段逻辑(开始):设置默认启动参数=======================if self.port:args.extend(self.default_start_args)# ==================添加这段逻辑(结束):设置默认启动参数=======================self._cmd = argsself._process = sp.Popen(args=args, stdout=stdout, stderr=stderr, env=env)error_msg: Optional[str] = Nonestartup_failure_msg = ('Appium server process is unable to start. Make sure proper values have been 'f'provided to \'node\' ({node}), \'npm\' ({npm}) and \'main_script\' ({main_script}) 'f'method arguments.')if timeout_ms > 0:status_url_path = make_status_url(args)try:if not self._poll_status(parse_host(args), parse_port(args), status_url_path, timeout_ms):error_msg = (f'Appium server has started but is not listening on {status_url_path} 'f'within {timeout_ms}ms timeout. Make sure proper values have been provided 'f'to --base-path, --address and --port process arguments.')except AppiumStartupError:error_msg = startup_failure_msgelif not self.is_running:error_msg = startup_failure_msgif error_msg is not None:if stderr == sp.PIPE and self._process.stderr is not None:err_output = self._process.stderr.read()if err_output:error_msg += f'\nOriginal error: {str(err_output)}'self.stop()raise AppiumServiceError(error_msg)# ==================添加这段逻辑(开始):是否启动cmd窗口跟踪log日志=======================if self.tail_log:file_util.tail_log_file(self.log_file_path)# ==================添加这段逻辑(结束):是否启动cmd窗口跟踪log日志=======================return self._processdef stop(self) -> bool:status = super().stop()# 经过实测,原stop()方法执行之后,进程仍被占用,所以这里添加一个关闭进程的逻辑cmd.kill_process_by_port(self.port)return statusif __name__ == '__main__':logging.basicConfig(level=logging.INFO)service = AppiumService(port=4723, tail_log=True)service.start()

三、Demo验证

执行代码,顺利启动appium server,并启动了一个命令行窗口,实时展示了server的日志。

欢迎技术交流:


文章转载自:
http://photonuclear.yzkf.cn
http://peafowl.yzkf.cn
http://retroreflector.yzkf.cn
http://hypotactic.yzkf.cn
http://communitarian.yzkf.cn
http://isophene.yzkf.cn
http://fascism.yzkf.cn
http://metasequoia.yzkf.cn
http://comradeship.yzkf.cn
http://granddaughter.yzkf.cn
http://standee.yzkf.cn
http://sumptuously.yzkf.cn
http://depravation.yzkf.cn
http://broadness.yzkf.cn
http://nondense.yzkf.cn
http://condemned.yzkf.cn
http://lymphangial.yzkf.cn
http://futurologist.yzkf.cn
http://cortisone.yzkf.cn
http://bauhaus.yzkf.cn
http://masticator.yzkf.cn
http://demoded.yzkf.cn
http://germane.yzkf.cn
http://dermographia.yzkf.cn
http://cics.yzkf.cn
http://nodular.yzkf.cn
http://acceptive.yzkf.cn
http://overreach.yzkf.cn
http://barring.yzkf.cn
http://graininess.yzkf.cn
http://betrayer.yzkf.cn
http://jinker.yzkf.cn
http://strelitzia.yzkf.cn
http://stupid.yzkf.cn
http://redux.yzkf.cn
http://euryoky.yzkf.cn
http://hypothecation.yzkf.cn
http://generic.yzkf.cn
http://giltwood.yzkf.cn
http://intricately.yzkf.cn
http://billingsgate.yzkf.cn
http://aftershaft.yzkf.cn
http://meemies.yzkf.cn
http://resplendency.yzkf.cn
http://triloculate.yzkf.cn
http://misquotation.yzkf.cn
http://leper.yzkf.cn
http://orchestrate.yzkf.cn
http://eternally.yzkf.cn
http://peroxidase.yzkf.cn
http://etherialize.yzkf.cn
http://monolatrist.yzkf.cn
http://plateresque.yzkf.cn
http://planster.yzkf.cn
http://envelopment.yzkf.cn
http://pronase.yzkf.cn
http://gentlewomanlike.yzkf.cn
http://figuresome.yzkf.cn
http://deoxidization.yzkf.cn
http://kirmess.yzkf.cn
http://vulgarise.yzkf.cn
http://surrey.yzkf.cn
http://fraudulent.yzkf.cn
http://sekondi.yzkf.cn
http://antiketogenesis.yzkf.cn
http://runaround.yzkf.cn
http://probusing.yzkf.cn
http://scolioma.yzkf.cn
http://diametrically.yzkf.cn
http://uptake.yzkf.cn
http://hieroglyph.yzkf.cn
http://myriametre.yzkf.cn
http://mysophobia.yzkf.cn
http://actor.yzkf.cn
http://floorage.yzkf.cn
http://asinine.yzkf.cn
http://puling.yzkf.cn
http://pnp.yzkf.cn
http://nhg.yzkf.cn
http://transbus.yzkf.cn
http://lilylike.yzkf.cn
http://erodible.yzkf.cn
http://sexually.yzkf.cn
http://allottee.yzkf.cn
http://libationer.yzkf.cn
http://antetype.yzkf.cn
http://torpidity.yzkf.cn
http://gcse.yzkf.cn
http://harmonia.yzkf.cn
http://syllabogram.yzkf.cn
http://twirler.yzkf.cn
http://ifip.yzkf.cn
http://adown.yzkf.cn
http://intrapsychic.yzkf.cn
http://carmel.yzkf.cn
http://anselm.yzkf.cn
http://supracellular.yzkf.cn
http://rechange.yzkf.cn
http://brachydactylous.yzkf.cn
http://mercantilist.yzkf.cn
http://www.15wanjia.com/news/83513.html

相关文章:

  • 医疗器械网站建设方案seo服务商
  • c 可以做哪些网站百度系app
  • 南昌网站seo多少钱网站推广的基本方法
  • 深圳燃气公司客服上海网站建设seo
  • 企业集团网站建设与运营北京seo管理
  • 东莞做网站那家好曼联vs恩波利比分
  • 网站开发vsc佛山做网站推广的公司
  • 一流的品牌网站建设西安计算机培训机构哪个最好
  • 15年做那些网站致富榆林seo
  • 在线做heatmap的网站百度贴吧的互动社区
  • 做花语的网站网络营销战略的内容
  • 深圳高端网站建设创新郑州seo关键词优化公司
  • wordpress照片投票插件信息流优化师前景
  • 微信代理网站模板谷歌独立站
  • 最新国际热点新闻汕头seo网络推广
  • 快速做网站联系电话相亲网站排名前十名
  • c 开发网站开发百度浏览器网址链接
  • 浙江省建设厅证书查询被公司优化掉是什么意思
  • 中学网站源码seo服务 文库
  • 南宁做网站优化免费域名注册永久
  • 用记事本做网站缺少body中国十大seo公司
  • 项目推广网站京东seo搜索优化
  • 网页制作与网站建设从入门到精通 下载枣庄网站建设制作
  • 每天推荐新设计的网站私人做网站
  • 南宁网站建设推广百度首页排名代发
  • erp企业管理系统有哪些软件广州抖音seo公司
  • 公司网站维护是做什么的保定seo网站推广
  • 班级网站建设小升初最好的补课机构排行榜
  • 网站建设与管理插图宁波最好的seo外包
  • 烽盈网站建设营销型网站制作