diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c74bdc0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,18 @@ +.vscode/ +__pycache__ +.DS_Store +node_modules/ +dist/ +instance/ +_dist/ +_assets/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Editor directories and files +.idea +*.suo +*.ntvs* +*.njsproj +*.sln \ No newline at end of file diff --git a/README.md b/README.md index 6ce0a89..92e6ac9 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +Bfdhfdf + +B +B > "What I cannot create, I do not understand." > -- Richard Feynman @@ -72,4 +76,4 @@ some crawler demos ## reading - read some python books and some of my thoughts \ No newline at end of file + read some python books and some of my thoughts diff --git a/blog/app/__init__.py b/blog/app/__init__.py new file mode 100644 index 0000000..761e225 --- /dev/null +++ b/blog/app/__init__.py @@ -0,0 +1,18 @@ +# -*- coding:utf-8 -*- +from flask import Flask +from flask_sqlalchemy import SQLAlchemy +from .home import home +from .article import article +from .user import user + +app = Flask(__name__) +# db = SQLAlchemy(app) + +# 注册蓝图 +app.register_blueprint(home, url_prefix='/home') +app.register_blueprint(user, url_prefix='/user') +app.register_blueprint(article, url_prefix='/article') + + + + diff --git a/blog/app.py b/blog/app/app.py similarity index 67% rename from blog/app.py rename to blog/app/app.py index 95b87a0..37cc999 100644 --- a/blog/app.py +++ b/blog/app/app.py @@ -2,19 +2,45 @@ my blog ''' from flask import Flask, render_template, redirect, url_for, flash, request, session, g +from flask import current_app from flask_bootstrap import Bootstrap -import server.db as db +from flask_restful import Api, Resource +from db import get_mongo_connection import os from datetime import timedelta -app = Flask(__name__) +app = Flask(__name__, instance_relative_config=True) +app.config.from_object('config') +app.config.from_pyfile('config.py') +print(app.config['DEBUG']) +print(app.config['SECRET_KEY']) +print(app.config['MONGO_DBNAME']) + bootstrap = Bootstrap(app) +api = Api(app) +todos = {} + +mongo = get_mongo_connection() +db = mongo.myblog -app.config['SECRET_KEY'] = os.urandom(24) + +# app.config['SECRET_KEY'] = os.urandom(24) # app.config['SECRET_KEY'] = os.environ.get('SECRET_KEY') or 'hard to guess string' -app.config['PERMANENT_SESSION_LIFETIME'] = timedelta(days=1) +# app.config['PERMANENT_SESSION_LIFETIME'] = timedelta(days=1) # session.permanent = True +class TodoSimple(Resource): + def get(self, todo_id): + return {todo_id: todos[todo_id]} + + def put(self, todo_id): + if todo_id not in todos: + todos[todo_id] = request.form['data'] + return {todo_id: todos[todo_id]} + +api.add_resource(TodoSimple, '/', '/todo/') + + @app.errorhandler(404) def page_not_found(e): return render_template('404.html'), 404 @@ -23,15 +49,15 @@ def page_not_found(e): def internal_server_error(e): return render_template('500.html'), 500 -@app.before_request -def my_before_request(): - if not session.get('username') and request.endpoint not in ('login', 'register', 'static'): - return redirect(url_for('login')) +# @app.before_request +# def my_before_request(): +# if not session.get('username') and request.endpoint not in ('login', 'register', 'static'): +# return redirect(url_for('login')) @app.route('/') def index(): username = session.get('username') - return render_template('index.html', username=username) + return render_template(current_app.config['INDEX_TEMPLATE'], username=username) @app.route('/get') def get_user(): @@ -51,7 +77,7 @@ def register(): if request.method == 'POST': username = request.form.get('username') password = request.form.get('password') - user_isexist = db.user_db.find_one({'username': username}) + user_isexist = db.users.find_one({'username': username}) if user_isexist: flash('该用户名已被注册,请换一个用户名注册!') return render_template('login/register.html') @@ -62,7 +88,7 @@ def register(): 'isAdmin': False } session['username'] = username - db.user_db.insert(new_user) + db.users.insert(new_user) return redirect(url_for('login')) else: return render_template('login/register.html') @@ -75,7 +101,8 @@ def login(): password = request.form.get('password') remember_me = request.form.get('rememberme') == 'on' print(remember_me) - login_user = db.user_db.find_one({'username': username, 'password': password}) + print(list(db.users.find({}))) + login_user = db.users.find_one({'username': username, 'password': password}) print(login_user) if remember_me: session.permanent = True @@ -108,5 +135,4 @@ def article_detail(): return render_template('article/article_detail.html') if __name__ == "__main__": - # app.run(host='192.168.191.1') - app.run(debug=True) + app.run() diff --git a/blog/app/article/__init__.py b/blog/app/article/__init__.py new file mode 100644 index 0000000..a2358a2 --- /dev/null +++ b/blog/app/article/__init__.py @@ -0,0 +1,12 @@ +# -*- coding:utf-8 -*- + +from flask import Blueprint + +article = Blueprint( + 'article', + __name__, + template_folder='templates', + static_folder='static' +) + +from . import views \ No newline at end of file diff --git a/blog/app/article/views.py b/blog/app/article/views.py new file mode 100644 index 0000000..58a9944 --- /dev/null +++ b/blog/app/article/views.py @@ -0,0 +1,7 @@ +# -*- coding:utf-8 -*- + +from . import article + +@article.route('/') +def article(): + return 'article' \ No newline at end of file diff --git a/blog/app/config.py b/blog/app/config.py new file mode 100644 index 0000000..db1d417 --- /dev/null +++ b/blog/app/config.py @@ -0,0 +1,8 @@ +# -*- coding:utf-8 -*- +"""通用配置参数""" +DEBUG = True +SECRET_KEY = 'this is my secret key!' +SQLALCHEMY_DATABASE_URI = 'mysql+mysqlconnector://root:123456@localhost/emdp' +SQLALCHEMY_TRACK_MODIFICATIONS = False + +INDEX_TEMPLATE = 'index.html' \ No newline at end of file diff --git a/blog/app/db.py b/blog/app/db.py new file mode 100644 index 0000000..9dca25a --- /dev/null +++ b/blog/app/db.py @@ -0,0 +1,15 @@ +# -*- coding:utf-8 -*- +from pymongo import MongoClient +from pymysql import connect +from instance.config import MONGO_URI, MYSQL_URI + +def get_mongo_connection(): + """mongo数据库连接""" + return MongoClient(host=MONGO_URI) + +def get_mysql_connection(): + """Mysql数据库连接""" + return connect(host=MYSQL_URI) + +# client = pymongo.MongoClient('localhost', 27017) +# user_db = client['myblog']['users'] diff --git a/blog/app/home/__init__.py b/blog/app/home/__init__.py new file mode 100644 index 0000000..f857abb --- /dev/null +++ b/blog/app/home/__init__.py @@ -0,0 +1,12 @@ +# -*- coding:utf-8 -*- + +from flask import Blueprint + +home = Blueprint( + 'home', + __name__, + template_folder='templates', + static_folder='static' +) + +from . import views \ No newline at end of file diff --git a/blog/app/home/views.py b/blog/app/home/views.py new file mode 100644 index 0000000..e3674f6 --- /dev/null +++ b/blog/app/home/views.py @@ -0,0 +1,7 @@ +# -*- coding:utf-8 -*- + +from . import home + +@home.route('/') +def index(): + return 'home' \ No newline at end of file diff --git a/blog/app/models.py b/blog/app/models.py new file mode 100644 index 0000000..9e8d1ef --- /dev/null +++ b/blog/app/models.py @@ -0,0 +1,8 @@ +# -*- coding:utf-8 -*- + +from . import db + +class Engine(db.Model): + id = db.Column(db.Integer, primary_key=True, autoincrement=True) + title = db.Column(db.String(128)) + views = db.Column(db.Integer, default=0) \ No newline at end of file diff --git a/blog/static/css/about.css b/blog/app/static/css/about.css similarity index 100% rename from blog/static/css/about.css rename to blog/app/static/css/about.css diff --git a/blog/static/css/about.less b/blog/app/static/css/about.less similarity index 100% rename from blog/static/css/about.less rename to blog/app/static/css/about.less diff --git a/blog/static/css/animation.css b/blog/app/static/css/animation.css similarity index 100% rename from blog/static/css/animation.css rename to blog/app/static/css/animation.css diff --git a/blog/static/css/article.css b/blog/app/static/css/article.css similarity index 100% rename from blog/static/css/article.css rename to blog/app/static/css/article.css diff --git a/blog/static/css/article.less b/blog/app/static/css/article.less similarity index 100% rename from blog/static/css/article.less rename to blog/app/static/css/article.less diff --git a/blog/static/css/main.css b/blog/app/static/css/main.css similarity index 100% rename from blog/static/css/main.css rename to blog/app/static/css/main.css diff --git a/blog/static/css/main.less b/blog/app/static/css/main.less similarity index 100% rename from blog/static/css/main.less rename to blog/app/static/css/main.less diff --git a/blog/static/css/reset.css b/blog/app/static/css/reset.css similarity index 100% rename from blog/static/css/reset.css rename to blog/app/static/css/reset.css diff --git a/blog/static/favicon.1.ico b/blog/app/static/favicon.1.ico similarity index 100% rename from blog/static/favicon.1.ico rename to blog/app/static/favicon.1.ico diff --git a/blog/static/favicon.ico b/blog/app/static/favicon.ico similarity index 100% rename from blog/static/favicon.ico rename to blog/app/static/favicon.ico diff --git a/blog/static/font/iconfont/demo.css b/blog/app/static/font/iconfont/demo.css similarity index 100% rename from blog/static/font/iconfont/demo.css rename to blog/app/static/font/iconfont/demo.css diff --git a/blog/static/font/iconfont/demo_fontclass.html b/blog/app/static/font/iconfont/demo_fontclass.html similarity index 100% rename from blog/static/font/iconfont/demo_fontclass.html rename to blog/app/static/font/iconfont/demo_fontclass.html diff --git a/blog/static/font/iconfont/demo_symbol.html b/blog/app/static/font/iconfont/demo_symbol.html similarity index 100% rename from blog/static/font/iconfont/demo_symbol.html rename to blog/app/static/font/iconfont/demo_symbol.html diff --git a/blog/static/font/iconfont/demo_unicode.html b/blog/app/static/font/iconfont/demo_unicode.html similarity index 100% rename from blog/static/font/iconfont/demo_unicode.html rename to blog/app/static/font/iconfont/demo_unicode.html diff --git a/blog/static/font/iconfont/iconfont.css b/blog/app/static/font/iconfont/iconfont.css similarity index 100% rename from blog/static/font/iconfont/iconfont.css rename to blog/app/static/font/iconfont/iconfont.css diff --git a/blog/static/font/iconfont/iconfont.eot b/blog/app/static/font/iconfont/iconfont.eot similarity index 100% rename from blog/static/font/iconfont/iconfont.eot rename to blog/app/static/font/iconfont/iconfont.eot diff --git a/blog/static/font/iconfont/iconfont.js b/blog/app/static/font/iconfont/iconfont.js similarity index 100% rename from blog/static/font/iconfont/iconfont.js rename to blog/app/static/font/iconfont/iconfont.js diff --git a/blog/static/font/iconfont/iconfont.svg b/blog/app/static/font/iconfont/iconfont.svg similarity index 100% rename from blog/static/font/iconfont/iconfont.svg rename to blog/app/static/font/iconfont/iconfont.svg diff --git a/blog/static/font/iconfont/iconfont.ttf b/blog/app/static/font/iconfont/iconfont.ttf similarity index 100% rename from blog/static/font/iconfont/iconfont.ttf rename to blog/app/static/font/iconfont/iconfont.ttf diff --git a/blog/static/font/iconfont/iconfont.woff b/blog/app/static/font/iconfont/iconfont.woff similarity index 100% rename from blog/static/font/iconfont/iconfont.woff rename to blog/app/static/font/iconfont/iconfont.woff diff --git a/blog/static/images/2018.png b/blog/app/static/images/2018.png similarity index 100% rename from blog/static/images/2018.png rename to blog/app/static/images/2018.png diff --git a/blog/static/images/2018s.png b/blog/app/static/images/2018s.png similarity index 100% rename from blog/static/images/2018s.png rename to blog/app/static/images/2018s.png diff --git a/blog/static/images/art.png b/blog/app/static/images/art.png similarity index 100% rename from blog/static/images/art.png rename to blog/app/static/images/art.png diff --git a/blog/static/images/avatar.png b/blog/app/static/images/avatar.png similarity index 100% rename from blog/static/images/avatar.png rename to blog/app/static/images/avatar.png diff --git a/blog/static/images/banner-05.jpg b/blog/app/static/images/banner-05.jpg similarity index 100% rename from blog/static/images/banner-05.jpg rename to blog/app/static/images/banner-05.jpg diff --git a/blog/static/images/banner-06.jpg b/blog/app/static/images/banner-06.jpg similarity index 100% rename from blog/static/images/banner-06.jpg rename to blog/app/static/images/banner-06.jpg diff --git a/blog/static/images/brain.png b/blog/app/static/images/brain.png similarity index 100% rename from blog/static/images/brain.png rename to blog/app/static/images/brain.png diff --git a/blog/static/images/cat.png b/blog/app/static/images/cat.png similarity index 100% rename from blog/static/images/cat.png rename to blog/app/static/images/cat.png diff --git a/blog/static/images/fengling.png b/blog/app/static/images/fengling.png similarity index 100% rename from blog/static/images/fengling.png rename to blog/app/static/images/fengling.png diff --git a/blog/static/images/lovelytime.png b/blog/app/static/images/lovelytime.png similarity index 100% rename from blog/static/images/lovelytime.png rename to blog/app/static/images/lovelytime.png diff --git a/blog/static/images/shop.png b/blog/app/static/images/shop.png similarity index 100% rename from blog/static/images/shop.png rename to blog/app/static/images/shop.png diff --git a/blog/static/js/main.js b/blog/app/static/js/main.js similarity index 100% rename from blog/static/js/main.js rename to blog/app/static/js/main.js diff --git a/blog/templates/404.html b/blog/app/templates/404.html similarity index 100% rename from blog/templates/404.html rename to blog/app/templates/404.html diff --git a/blog/templates/500.html b/blog/app/templates/500.html similarity index 100% rename from blog/templates/500.html rename to blog/app/templates/500.html diff --git a/blog/templates/about.html b/blog/app/templates/about.html similarity index 100% rename from blog/templates/about.html rename to blog/app/templates/about.html diff --git a/blog/templates/article/article_detail.html b/blog/app/templates/article/article_detail.html similarity index 100% rename from blog/templates/article/article_detail.html rename to blog/app/templates/article/article_detail.html diff --git a/blog/templates/article/article_list.html b/blog/app/templates/article/article_list.html similarity index 100% rename from blog/templates/article/article_list.html rename to blog/app/templates/article/article_list.html diff --git a/blog/templates/base.html b/blog/app/templates/base.html similarity index 100% rename from blog/templates/base.html rename to blog/app/templates/base.html diff --git a/blog/templates/index.html b/blog/app/templates/index.html similarity index 100% rename from blog/templates/index.html rename to blog/app/templates/index.html diff --git a/blog/templates/login/login.html b/blog/app/templates/login/login.html similarity index 100% rename from blog/templates/login/login.html rename to blog/app/templates/login/login.html diff --git a/blog/templates/login/register.html b/blog/app/templates/login/register.html similarity index 100% rename from blog/templates/login/register.html rename to blog/app/templates/login/register.html diff --git a/blog/templates/user.html b/blog/app/templates/user.html similarity index 100% rename from blog/templates/user.html rename to blog/app/templates/user.html diff --git a/blog/app/user/__init__.py b/blog/app/user/__init__.py new file mode 100644 index 0000000..c6fa4f9 --- /dev/null +++ b/blog/app/user/__init__.py @@ -0,0 +1,12 @@ +# -*- coding:utf-8 -*- + +from flask import Blueprint + +user = Blueprint( + 'user', + __name__, + template_folder='templates', + static_folder='static' +) + +from . import views \ No newline at end of file diff --git a/blog/app/user/views.py b/blog/app/user/views.py new file mode 100644 index 0000000..e96c1c9 --- /dev/null +++ b/blog/app/user/views.py @@ -0,0 +1,7 @@ +# -*- coding:utf-8 -*- + +from . import user + +@user.route('/') +def user(): + return 'user' \ No newline at end of file diff --git a/blog/requirements.txt b/blog/requirements.txt new file mode 100644 index 0000000..8fc3e2d --- /dev/null +++ b/blog/requirements.txt @@ -0,0 +1,90 @@ +alembic==0.9.8 +amqp==1.4.9 +aniso8601==2.0.1 +anyjson==0.3.3 +asn1crypto==0.24.0 +astroid==1.6.0 +attrs==17.4.0 +Automat==0.6.0 +beautifulsoup4==4.6.0 +billiard==3.3.0.23 +bs4==0.0.1 +celery==3.1.26.post2 +celery-with-redis==3.0 +certifi==2018.1.18 +cffi==1.11.4 +chardet==3.0.4 +click==6.7 +colorama==0.3.9 +constantly==15.1.0 +cryptography==2.1.4 +cssselect==1.0.3 +Django==2.0.1 +docopt==0.6.2 +dominate==2.3.1 +eventlet==0.22.1 +feedparser==5.2.1 +Flask==0.12.2 +Flask-Bootstrap==3.3.7.1 +Flask-Cache==0.13.1 +Flask-Cors==3.0.3 +Flask-Login==0.4.1 +Flask-Migrate==2.1.1 +Flask-PyMongo==0.5.1 +Flask-RESTful==0.3.6 +flask-restful-swagger==0.19 +Flask-Script==2.0.6 +Flask-SocketIO==2.9.6 +Flask-SQLAlchemy==2.3.2 +Flask-WTF==0.14.2 +greenlet==0.4.13 +hyperlink==17.3.1 +idna==2.6 +image==1.5.17 +incremental==17.5.0 +isort==4.2.15 +itsdangerous==0.24 +Jinja2==2.10 +kombu==3.0.37 +lazy-object-proxy==1.3.1 +lxml==4.1.1 +Mako==1.0.7 +MarkupSafe==1.0 +mccabe==0.6.1 +mysql-connector-python==8.0.6 +params==0.3.0 +parsel==1.3.1 +Pillow==5.0.0 +pipreqs==0.4.9 +pyasn1==0.4.2 +pyasn1-modules==0.2.1 +pycparser==2.18 +PyDispatcher==2.0.5 +pylint==1.8.1 +pymongo==3.6.0 +PyMySQL==0.8.0 +pyOpenSSL==17.5.0 +python-dateutil==2.6.1 +python-editor==1.0.3 +python-engineio==2.0.4 +python-socketio==1.9.0 +pytz==2017.3 +queuelib==1.4.2 +redis==2.10.6 +requests==2.18.4 +selenium==3.8.1 +service-identity==17.0.0 +six==1.11.0 +SQLAlchemy==1.2.2 +urllib3==1.22 +vine==1.1.4 +virtualenv==15.1.0 +visitor==0.1.3 +w3lib==1.18.0 +Werkzeug==0.14.1 +wrapt==1.10.11 +WTForms==2.1 +xlrd==1.1.0 +xlwt==1.3.0 +yarg==0.1.9 +zope.interface==4.4.3 diff --git a/blog/run.py b/blog/run.py new file mode 100644 index 0000000..bfa3438 --- /dev/null +++ b/blog/run.py @@ -0,0 +1,10 @@ +# -*- coding:utf-8 -*- +from app import app +from test.demo import Foo + +print(Foo.age) + +# app.config.from_object('config') + +# if __name__ == '__main__': +# app.run() \ No newline at end of file diff --git a/blog/server/__init__.py b/blog/server/__init__.py deleted file mode 100644 index 2b79d14..0000000 --- a/blog/server/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from . import db \ No newline at end of file diff --git a/blog/server/__pycache__/__init__.cpython-35.pyc b/blog/server/__pycache__/__init__.cpython-35.pyc deleted file mode 100644 index 8b23577..0000000 Binary files a/blog/server/__pycache__/__init__.cpython-35.pyc and /dev/null differ diff --git a/blog/server/__pycache__/db.cpython-35.pyc b/blog/server/__pycache__/db.cpython-35.pyc deleted file mode 100644 index 3f733d7..0000000 Binary files a/blog/server/__pycache__/db.cpython-35.pyc and /dev/null differ diff --git a/blog/server/db.py b/blog/server/db.py deleted file mode 100644 index 89183ad..0000000 --- a/blog/server/db.py +++ /dev/null @@ -1,4 +0,0 @@ -import pymongo - -client = pymongo.MongoClient('localhost', 27017) -user_db = client['myblog']['users'] diff --git a/crawler/Hexo/hexo.py b/blog/test/__init__.py similarity index 100% rename from crawler/Hexo/hexo.py rename to blog/test/__init__.py diff --git a/blog/test/demo.py b/blog/test/demo.py new file mode 100644 index 0000000..5b9faa8 --- /dev/null +++ b/blog/test/demo.py @@ -0,0 +1,8 @@ +# -*- coding:utf-8 -*- + +from app.config import DEBUG + +print(DEBUG) + +class Foo: + age = 24 \ No newline at end of file diff --git a/books/hitpit.md b/books/caikeng.md similarity index 100% rename from books/hitpit.md rename to books/caikeng.md diff --git a/books/flask.py b/books/flask.py new file mode 100644 index 0000000..324b6fa --- /dev/null +++ b/books/flask.py @@ -0,0 +1,37 @@ +# Basic Use + +from flask import Flask, jsonify, request +from flask_jwt_extended import ( + JWTManager, jwt_required, create_access_token, get_jwt_identity +) + +app = Flask(__name__) + +app.config['JWT_SECRET_KEY'] = 'super-secret' +jwt = JWTManager(app) + +@app.route('/login', methods=['POST']) +def login(): + if not request.is_json: + return jsonify({'msg': 'Missing JSON in request'}), 400 + + username = request.json.get('username', None) + password = request.json.get('paddword', None) + if not username: + return jsonify({'msg': 'Missing username parameter'}), 400 + if not password: + return jsonify({'msg': 'Missing password parameter'}), 401 + + # Identity can be any data that is json serializable + access_token = create_access_token(identity=username) + return jsonify(access_token=access_token), 200 + +@app.route('/protected') +@jwt_required +def protected(): + # Access the identity of the current user with get_jwt_identity + current_user = get_jwt_identity() + return jsonify(logged_in_as=current_user), 200 + +if __name__ == '__main__': + app.run() \ No newline at end of file diff --git a/books/git.md b/books/git.md index daaf243..392af77 100644 --- a/books/git.md +++ b/books/git.md @@ -158,4 +158,18 @@ warning: Your console font probably doesn't support Unicode. If you experience s ## 如何检测 当前分支与远程分支存在追踪关系 如何查看当前分支如temp,track到的是远程代码库的哪个分支呀? - git config -l | grep 'branch\.temp' \ No newline at end of file + git config -l | grep 'branch\.temp' + +## git log + +### 1、git log + +### 2、git log -p -2 + +### 3、git log --stat + +```js +在做代码审查,或者要快速浏览其他协作者提交的更新都作了哪些改动时,就可以用这个选项。此外,还有许多摘要选项可以用,比如 --stat,仅显示简要的增改行数统计: +``` + +### 4、git log --pretty=oneline \ No newline at end of file diff --git a/books/orgnization.md b/books/orgnization.md new file mode 100644 index 0000000..22136af --- /dev/null +++ b/books/orgnization.md @@ -0,0 +1,333 @@ +# 项目结构组织 + + 项目中总结的一个基本组织结构 + +## 约定 + +版本库(Repository):你的应用的根目录。 +包(Package):包含了你的应用代码的一个包。以包的形式建立应用 +模块(Module):一个模块就是一个简单的,可以被其他`Python`文件引入的`Python`文件。一个包由多个模块组成 + +## 组织模式 + +### 单一模式 + +把所有的代码放在一个单一的文件中,通常是 `app.py` +单一模块的应用的版本库看起来就是这样 + +```py + +Repository +| +|__app.py +| +|__config.py +| +|__requirements.txt +| +|__static/ +| +|__templates/ +| +|__README.md + +``` + +### 包 + +当项目开始变得复杂,单一模块就会造成严重的问题 +此时需要把应用中不同的组件分开到单独的,高内聚的一组模块 -- 也就是包 -- 之中 + +看起来是这样的 + +```py + +Repository +| +|__config.py # 包含了你的应用需要的大多数配置变量 +| +|__requirements.txt +| +|__run.py +| +|__instance/ + |__config.py # 这个文件包含不应该出现在版本控制的配置变量。其中有类似调用密钥和数据库URI连接密码。同样也包括了你的应用中特有的不能放到阳光下的东西 +| +|__myapp/ + |__ __init__.py + | + |__ views.py + | + |__ models.py + | + |__ forms.py + | + |__ static/ + | + |__templates/ + + +``` + +## 项目结构 + +```css +myproject +| +|___app 项目主模块 + | + |___business 项目业务模块 + | + |___common 通用类模块 + | + |___instance 配置项模块(私有的,可以覆盖config.py里面的配置) + | + |___models 模型类模块(包括数据库模型等) + | + |___resources 资源类模块 + | + |___util 工具类模块 + | + |___db.py 数据库模块 + | + |___config.py 基本配置想模块 + | + |___ __init__.py Flask应用模块。也可以定义一个 main.py +| +|___ws 项目第二个模块。Socket模块 +| +|docs 项目文档 +| +|manage.py 程序入口,可以使用Flask-Script定义相关命令 +| +|.pylintrc 定义项目编写规范(基于Pep8) +| +|requirements.txt 项目所需的第三方模块 +| +|README.md +``` + +1. 项目的主文件(myProject)中是不需要建立一个 `__init__.py` 文件的。因为这个文件夹不需要形成一个额外的包(package)被外部文件引用 +2. 但是 app 和 ws 这两个文件夹中是必须要有 `__init__.py` 文件的。他们内部文件需要引用兄弟模块,同时 ws 中的文件也可能会引用 app 文件夹(此时称为包)里面的文件(模块) + +## 具体每个模块的组织关联 + +manage.py 作为程序的入口,一般都是先把 app 导入进来,再通过 flask_script 进行管理,添加一些指令,实现精细化的控制 + +```py manage.py +"""程序入口""" +from flask_script import Manager, Server, Command +from app import create_app + +app = create_app() # 返回一个 Flask 实例 +manager = Manager(app) # 得到一个拥有控制app的管理器 + +#自定义命令一: +manager.add_command('runapi', Server(host='0.0.0.0', post=5001, use_debugger=True)) + +#自定义命令二: +class Hello(Command): + """hello world""" + def run(self): + print('hello world') + +manager.add_command('init', init()) + +🏑🏑🏑🏑🏑🏑🏑🏑🏑🏑🏑🏑🏑🏑🏑🏑🏑🏑🏑 +# 另外的一种写法是这样的. +# 使用Command实例的@command修饰符 +@manager.command +def init(): + print('init app ...') + manager.run() + +# 如何调用 +python manger.py runapi # +python manager.py init # 输出 > init app ... + +``` + +```py __ini__.py main.py +# 主应用模块 + +from flask import Flask, BluePrint +from flask_restful import Api +from flask_restful_swagger import swagger +from flask_cors import CORS +from flask_jwt_extended import JWTManager +from app.db import MYSQL_DB as db, MONGO_DB as mongo +from app.util.response import ResponseHelper +from datetime import timedelta + +# 使用这种返回 app 的方式,可以实现项目组织更加灵活 +def create_app(): + """创建App""" + app = Flask(__name__) # 第一个参数一般是 `__name__`。但是如果项目中产生了两个 app 的初始化,可以考虑传入一个特定的项目名称 + app.config.from_object('config') # 这里默认就是从 app 文件中的 config.py 文件中导入相关的配置信息 + app.config.from_pyfile('config.py') # 这里加载定义在instance文件夹中的配置变量.在instance/config.py中定义的变量可以覆盖在config.py中设定的值 + + jwt = JWTManager(app) + db.init_app(app) # 初始化MYSQL数据库 + mongo.init_app(app) # 初始化MongoDB数据库 + CORS(app) # 跨域支持 + api_bp = BluePrint('api', __name__) # 蓝图支持 + api = swagger.docs(Api(api_bp), apiVersion='0.1', resourcePath='/', description='some_desc', api_spec_url='/swagger') + + bind_resources(api) # 绑定资源 + app.register_blueprint(api_bp, url_prefix='./api') + + return app + + +def bind_resources(api): + """绑定对应的资源。restful风格的实现""" + from app.resources.equipment import Equipments + from app.resources.equipmentmodule import EquipmentModules + api.add_resource(Equipment, './reqipments') + api.add_resource(EquipmentModules, '/equipment//modules') + + from app.resources.otherModule import someModules + api.add_resource() +``` + +```py db.py + +"""数据库数据""" +from flask_sqpalchemy import SQLAlchemy +from flask_pymongo import PyMongo + +MYSQL_DB = SQLAlchemy() +MONGO_DB = PyMongo() +``` + +| +|__resource/ # 这个文件夹里面主要存放 flask_restful 对应的资源文件 + +一般就是定义一些类,里面包含一些 get、post、put 或者 delete 相关的方法。 +这些方法需要在`主文件(main.py)`中被引入,并通过 `api.add_resource()` 这个方法注册 + + +```py resource.py +"""flask_restful 搭配 flask_restful_swagger""" + +from flask_restful import Resource +from flask_restful_swagger import swagger +from app.common.fields import EquipmentFields +from app.common.parsers import EQUIPMENT_PARSER +from app.business.equipment import EquipmentManager + +class Equipments(Resource): + """设备信息""" + + def __ini__(self): + self.equipment_manager = EquipmentManager() + + @swagger.operation( + notes='', + nickname='get', + summary='', + parameters=[ + {'name':'eqp_id', 'dateType':'string', 'paramType':'query'}, + {'name':'location', 'dateType':'string', 'paramType':'query'} + ] + ) + // TODO: + // FIXME: + def get(self): # get就是表示接口是通过 ‘GET’ 方法发起请求的 + args = EUIPMENT_PARSER.parse_args() # 通过flask——restful 自带的方法获取参数 + # 也可以通过 args = request.args; request.args.get('eqp_id') + result = self.equipment_manager.find_equipment(args) + return result +``` + +| +|__business/ # 这个文件夹里面就是存放和业务相关的具体的代码逻辑 + +简单来说,就是和数据库打交道的地方。 +restful中定义的 get,post之类的方法,调用通过引入过来相应的文件中方法,获取相对应的接口数据 +这里的数据库可以是 SQLAlchemy,也可以是MongoDB + +```py business.equipment.py + +from app.models.equip.equipment import Equipment +from app.db import MYSQL_DB as db + +class EquipmentManager(): + """设备处理业务类""" + + def __init__(self): + self.logger = create_logger('EDMP_API') + + def find_equipment(self, args=None): + """查询设备""" + try: + filters = [] + if args.eqp_id: + filters.append(Equipment.EQP_ID == args.eqp_id) + if args.location: + filters.append(Equipment.Location.like('%' + args.location + '%')) + items = db.session.query( + Equipment.Latitude, Equipment.Location, Equipment.Type + ).filter(and_(*filters)).order_by(Equipment.EQP_ID).all() + + eqps = [dict(EQP_ID=item.EQP_ID, Location=item.Location, Type=item.Type) for item in items] + data = marshal(eqps, EquipmentFields.resource_fileds) + return ResponseHelper.return_true_data(data) + except Exception as ex: + self.logger.error('服务器发生错误:%', str(ex)) + return ResponseHelper.return_false_data(msg='Server Error', status=500) +``` + +```py util/ response.py +"""输出类""" + +class ResponseHelper: + """输出帮助类""" + @staticmethod + def return_true_data(data, msg='success', **kwargs): + """返回正确结果""" + result = { + 'result': 100, + 'data': data, + 'msg': msg, + **kwargs + } + return result + + @staticmethod + def return_false_data(data=None, msg='error', status=None, **kwargs): + """返回错误结果""" + return { + 'result': status, + 'data': data, + 'msg': msg, + **kwargs + } + +``` + +```py util/ logger.py +"""日志模块""" + +import logging +import os + +def create_logger(name): + """创建logger""" + logger = logging.getLogger(name) + logger.setLevel(logging.INFO) + formatter = logger.Formatter( + + ) + if not logger.handlers: + chandler = logging.StreamHandler() + chandler.setFormatter(formatter) + chandler.setLevel(logging.INFO) + logger.addHandler(chandler) + + fhandler = logging.FileHandler(os.path.join('./', 'log.log'), encoding='utf-8', delay='true') + fhandler.setLever() + fhandler.setFormatter(formatter) + logger.addHnadler(fhandler) + return logger +``` \ No newline at end of file diff --git a/books/python_learn.md b/books/python_learn.md new file mode 100644 index 0000000..ca49f07 --- /dev/null +++ b/books/python_learn.md @@ -0,0 +1,11 @@ +# python 学习心得 + +> 主要是我在使用python的过程中,发现需要常用到的类库或者方法 + +## enumerate + +## dumps & load + +## random + +## re \ No newline at end of file diff --git "a/books/\347\274\226\345\206\231\351\253\230\350\264\250\351\207\217python\344\273\243\347\240\201\347\232\20459\344\270\252\346\234\211\346\225\210\346\226\271\346\263\225.md" "b/books/\347\274\226\345\206\231\351\253\230\350\264\250\351\207\217python\344\273\243\347\240\201\347\232\20459\344\270\252\346\234\211\346\225\210\346\226\271\346\263\225.md" new file mode 100644 index 0000000..a04f4fb --- /dev/null +++ "b/books/\347\274\226\345\206\231\351\253\230\350\264\250\351\207\217python\344\273\243\347\240\201\347\232\20459\344\270\252\346\234\211\346\225\210\346\226\271\346\263\225.md" @@ -0,0 +1,59 @@ +# 摘要 + +## 有数量可变的位置参数减少视觉杂讯 + +* 在def语句中使用 *args, 即可令函数接收数量可变的位置参数 +* 调用函数时,可采用 * 操作符,把序列中的元素当成位置参数,传给该函数 +* 对生成器使用 * 操作符,可能导致程序耗尽内存并崩溃 +* 在已经接受 *args 参数的函数砂锅面继续添加位置参数,可能会产生难以排查的bug + +## 用关键字参数来表达可选的行为 + +* 位置参数必须出现在关键字参数之前 +* 函数参数可以按位置活关键字来指定 +* 只是用位置参数来调用函数,可能会导致这些参数值的含义不够明确,而关键字参数则能够阐明每个参数的意图 +* 给函数添加新的行为时,可以使用带默认值的关键字参数,以便与原有的函数调用代码保持兼容 + +## 用只能以关键字形式指定的参数来确保代码清晰 + +* 关键字参数能够使函数调用的意图更加明确 + +## 尽量用辅助类来维护程序的状态,而不要使用字典和元组 + +* 可以使用 from collections import namedtuple. 有一点像类的功能 +* 不要使用包含其他字典的字典,也不要使用过长的元组 +* 如果容器中包含简单而又不可变的数据,那么可以先使用namedtuple来表示,待稍后有需要时,再修改为完整的类 +* 保存内部状态的字典如果变得比较复杂,那么就应该把这些代码拆解为多个辅助类 + +## 简单的接口应该接受函数,而不是类的实例 + +* 对于连接各种python组件的简单接口来说,通常应该给其直接传入函数,而不是先定义某个类,然后再传入该类的实例 + +## 以 @classmethod 形式的堕胎去通用地构建对象 + +类的多态:使得继承体系中的多个类都能以各自所独有的方式来实现某个方法 + +* 在python中,每个类只能有一个构造器,也就是__init__方法 +* 通过@classmethod机制,可以用一种与构造器相仿的方式类构造类的对象 + +## 只在使用 Mix-in 组件制作工作类时进行多重继承 + + +## 多用 public 属性,少用 private 属性 + +* python 编译器无法样额保证 private 字段的私密性 +* 不要盲目的将属性设置为 private,而是应该从一开始就做好规划,并允许子类更多的访问超类的内部api + +## 继承 collections.abc 以实现自定义的容器类型 + + +## 用纯属性取代 get 和 set 方法 + +* 对于python语言来说,基本上不需要手动实现setter 或 getter 方法,而是应该从简单的 public 属性开始写 +* @property 最大的缺点在于,和属性呢相关的方法,只能在子类里面共享。而与之无关的其他类,则无法服用同一份实现代码 +* @property 方法应该遵循最小惊讶原则,而不应该产生奇怪的副作用 + +## 考虑用 @property 来代替属性重构 + + +## \ No newline at end of file diff --git a/collection/selenium/boot.py b/collection/selenium/boot.py new file mode 100644 index 0000000..5c5307f --- /dev/null +++ b/collection/selenium/boot.py @@ -0,0 +1,97 @@ +#!/usr/bin/env python2 +# coding=utf-8 + +import time +from selenium import webdriver +from selenium.common.exceptions import NoSuchElementException +from selenium.webdriver.common.by import By +from selenium.webdriver.support import expected_conditions as EC +from selenium.webdriver.support.ui import WebDriverWait +import random + +driver = webdriver.Firefox() +wait = WebDriverWait(driver, 10) +driver.maximize_window() +print (driver.get_window_size()) +# driver.set_window_size(1024,768) +driver.get("http://pk.anjianba.cn") + +# 图像的数据 +img_data = {} + +name_box = driver.find_element_by_name("username") +name_box.clear() +name_box.send_keys(u"李星") +start_btn = driver.find_element_by_class_name("mint-button") +start_btn.click() +time.sleep(3) +mask_btn = driver.find_element_by_class_name("a_page_btn_fix") +mask_btn.click() +time.sleep(3) +start_pk_btn = driver.find_element_by_class_name("pk-btn") +start_pk_btn.click() + +match = 0 +while (match < 10000): + time.sleep(3) + has_start = False + while (not has_start): + try: + has_start = EC.visibility_of_element_located(driver.find_element_by_class_name("count-down")) + print(has_start) + time.sleep(2) + except NoSuchElementException: + print('还没有出现图片') + time.sleep(0.1) + i = 0 + clickable = False + while (not clickable): + if wait.until(EC.element_to_be_clickable((By.CLASS_NAME, "a_btn_safe"))): + clickable = True + print('可以点击啦?') + else: + print('*'*20) + time.sleep(0.2) + wait.until(EC.element_to_be_clickable((By.CLASS_NAME, "dr-image"))) + wait.until(EC.element_to_be_clickable((By.CLASS_NAME, "a_btn_safe"))) + wait.until(EC.element_to_be_clickable((By.CLASS_NAME, "a_btn_danger"))) + wait.until(EC.visibility_of_element_located((By.CLASS_NAME, "a_btn_danger"))) + safe_btn = driver.find_element_by_class_name("a_btn_safe") + danger_btn = driver.find_element_by_class_name("a_btn_danger") + for i in range(10): + found = False + while (not found): + try: + img_elem = driver.find_element_by_class_name("dr-image") + found = True + except NoSuchElementException: + time.sleep(1) + img_src_url = img_elem.get_attribute("src") + jianzhuang = False + while (not jianzhuang): + try: + if random.random() < 0.5: + safe_btn.click() + else: + danger_btn.click() + jianzhuang = True + except Exception: + print(Exception) + time.sleep(1) + time.sleep(2) + i += 1 + print('第 {} 题'.format(i)) + btn_again = wait.until(EC.element_to_be_clickable((By.ID, "btn-again"))) + btn_again.click() + # match_result_out = False + # while (not match_result_out): + # try: + # again_btn = driver.find_element_by_xpath("//*[@id='btn-again']") + # again_btn.click() + # match_result_out = True + # except NoSuchElementException: + # time.sleep(5) + match += 1 + print('玩了一局啦' + '*'*10) + +driver.close() \ No newline at end of file diff --git a/collection/selenium/boots.py b/collection/selenium/boots.py new file mode 100644 index 0000000..051d549 --- /dev/null +++ b/collection/selenium/boots.py @@ -0,0 +1,156 @@ +#!/usr/bin/env python2 +# coding=utf-8 + +import time +import re +import random +import pymongo +from selenium import webdriver +from selenium.common.exceptions import NoSuchElementException +from selenium.webdriver.common.by import By +from selenium.webdriver.support import expected_conditions as EC +from selenium.webdriver.support.ui import WebDriverWait + +client = pymongo.MongoClient('localhost', 27017) +PKDB = client['myblog']['pkimg'] +name_reg = re.compile(r'\d+\/(\w+)') + +def save_2_db(obj): + for item in obj: + img_name = name_reg.findall(item[0]) + img = PKDB.find_one({'imgName': img_name[0]}) + if not img: + obj = { + 'imgName': img_name[0], + 'isDanger': item[1] + } + PKDB.save(obj) + +driver = webdriver.Firefox() +wait = WebDriverWait(driver, 10) +driver.maximize_window() +print (driver.get_window_size()) +# driver.set_window_size(1024,768) +driver.get("http://pk.anjianba.cn") + +# 图像的数据 +img_data = {} + +name_box = driver.find_element_by_name("username") +name_box.clear() +name_box.send_keys(u"李星") +start_btn = driver.find_element_by_class_name("mint-button") +start_btn.click() +time.sleep(3) +mask_btn = driver.find_element_by_class_name("a_page_btn_fix") +mask_btn.click() +time.sleep(3) +start_pk_btn = driver.find_element_by_class_name("pk-btn") +start_pk_btn.click() + +match = 0 +while (match < 10000): + # time.sleep(3) + # 匹配对手 + wait_match = False + while (not wait_match): + try: + wait.until(EC.presence_of_element_located((By.CLASS_NAME, "count-down"))) + wait_match = True + print('{:#^20}'.format('')) + except Exception: + print('匹配时出现错误。。。') + time.sleep(0.2) + + i = 0 + # wait.until(EC.visibility_of_element_located((By.CLASS_NAME, "dr-image"))) + wait.until(EC.presence_of_element_located((By.CLASS_NAME, "dr-image"))) + wait.until(EC.presence_of_element_located((By.CLASS_NAME, "a_btn_safe"))) + wait.until(EC.presence_of_element_located((By.CLASS_NAME, "a_btn_danger"))) + my_choose = [] + ret_in_page = [] + time.sleep(3) + for i in range(10): + found = False + while (not found): + try: + img_elem = driver.find_element_by_class_name("dr-image") + found = True + except NoSuchElementException: + time.sleep(1) + img_src_url = img_elem.get_attribute("src") + + jianzhuang = False + my_choice = None + + while (not jianzhuang): + try: + if random.random() < 0.5: + # safe_btn = driver.find_element_by_class_name("a_btn_safe") + safe_btn = wait.until(EC.presence_of_element_located((By.CLASS_NAME, "a_btn_safe"))) + safe_btn.click() + my_choice = 'safe' + my_choose.append('safe') + else: + # danger_btn = driver.find_element_by_class_name("a_btn_danger") + danger_btn = wait.until(EC.presence_of_element_located((By.CLASS_NAME, "a_btn_danger"))) + danger_btn.click() + my_choice = 'danger' + my_choose.append('danger') + jianzhuang = True + except Exception: + print('正在配对中。。。。。。') + time.sleep(1) + + time.sleep(1.2) + print('第 {} 题'.format(i)) + # if i > 1: + # print(len(driver.find_elements_by_css_selector('.topic-result li'))) + # print(driver.find_elements_by_css_selector('.topic-result li')[i-1]) + className = driver.find_elements_by_css_selector('.topic-result li')[i].get_attribute('class') + # 记录页面上的正确答案 + ret_in_page.append(className) + if className == 'right': + result = my_choice + else: + result = 'safe' if my_choice == 'danger' else 'danger' + # img_data['imgName'] = img_src_url + # img_data['result'] = result + img_data[img_src_url] = result + # print(img_data) + i += 1 + + print('作答选择的答案:') + for item in my_choose: + print('++ {} ++ '.format(item), end='') + + print('页面反馈答案:') + for item in ret_in_page: + print('-- {} -- '.format(item), end='') + + print('统计的标准答案:') + this_time = list(img_data.items())[-10:] + for item in this_time: + print(item) + save_2_db(this_time) + + + # 答题结束 在记录一次 + # className = driver.find_elements_by_css_selector('.topic-result li')[i].get_attribute('class') + # img_data[img_src_url] = className + + waitResult = False + while (not waitResult): + try: + btn_again = wait.until(EC.element_to_be_clickable((By.ID, "btn-again"))) + waitResult = True + except Exception: + print(Exception) + time.sleep(1) + + btn_again = wait.until(EC.element_to_be_clickable((By.ID, "btn-again"))) + btn_again.click() + match += 1 + print('{:+^50}'.format(' 玩了第 {} 局啦 '.format(match))) + +driver.close() \ No newline at end of file diff --git a/collection/selenium/geckodriver.log b/collection/selenium/geckodriver.log new file mode 100644 index 0000000..265bed5 --- /dev/null +++ b/collection/selenium/geckodriver.log @@ -0,0 +1,1397 @@ +1518068135440 geckodriver INFO geckodriver 0.19.1 +1518068135447 geckodriver INFO Listening on 127.0.0.1:61553 +1518068138502 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.8VgJmYh9Lr4p" +1518068139804 Marionette INFO Enabled via --marionette +1518068142975 Marionette INFO Listening on port 61566 +1518068144319 Marionette WARN TLS certificate errors will be ignored for this session +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 1532, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 8920, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 18576, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 8920, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 16512, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +*** UTM:SVC TimerManager:registerTimer called after profile-before-change notification. Ignoring timer registration for id: telemetry_modules_ping +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[GPU 14244, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +1518068657325 geckodriver INFO geckodriver 0.19.1 +1518068657332 geckodriver INFO Listening on 127.0.0.1:62479 +1518068660430 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.hyWiRRATKEv6" +1518068661824 Marionette INFO Enabled via --marionette +1518068664411 Marionette INFO Listening on port 62491 +1518068664546 Marionette WARN TLS certificate errors will be ignored for this session +1518068691596 addons.productaddons WARN Failed downloading via XHR, status: 0, reason: error +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 17468, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 660, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 660, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 6372, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 6372, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 17764, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 17764, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[GPU 18192, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +1518068765430 geckodriver INFO geckodriver 0.19.1 +1518068765436 geckodriver INFO Listening on 127.0.0.1:62794 +1518068768511 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.qyuK9IR94mZ1" +1518068769764 Marionette INFO Enabled via --marionette +1518068772766 Marionette INFO Listening on port 62809 +1518068773737 Marionette WARN TLS certificate errors will be ignored for this session +1518068790326 addons.productaddons WARN Failed downloading via XHR, status: 0, reason: error +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 18604, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 18492, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 18492, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 18468, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 17500, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 17500, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +*** UTM:SVC TimerManager:registerTimer called after profile-before-change notification. Ignoring timer registration for id: telemetry_modules_ping +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[GPU 17528, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +1518068808246 geckodriver INFO geckodriver 0.19.1 +1518068808253 geckodriver INFO Listening on 127.0.0.1:62954 +1518068811322 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.1GwNpJLipNBO" +1518068812648 Marionette INFO Enabled via --marionette +1518068815364 Marionette INFO Listening on port 62968 +1518068815459 Marionette WARN TLS certificate errors will be ignored for this session +1518068854035 addons.productaddons WARN Failed downloading via XHR, status: 0, reason: error +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 12236, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 12236, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 14244, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 14244, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 7944, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 3584, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 3584, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[GPU 13072, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +1518069379224 geckodriver INFO geckodriver 0.19.1 +1518069379230 geckodriver INFO Listening on 127.0.0.1:64221 +1518069382290 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.s9t3ep0xY6Sa" +1518069383670 Marionette INFO Enabled via --marionette +1518069386522 Marionette INFO Listening on port 64236 +1518069387506 Marionette WARN TLS certificate errors will be ignored for this session +1518069413051 addons.productaddons WARN Failed downloading via XHR, status: 0, reason: error +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 17928, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 17928, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 9416, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 9416, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 100, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 1660, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 1660, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[GPU 18964, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +1518070357149 geckodriver INFO geckodriver 0.19.1 +1518070357156 geckodriver INFO Listening on 127.0.0.1:49737 +1518070360235 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.YBa5fcHIul8K" +1518070361603 Marionette INFO Enabled via --marionette +1518070364207 Marionette INFO Listening on port 49751 +1518070364352 Marionette WARN TLS certificate errors will be ignored for this session +1518070381911 addons.productaddons WARN Failed downloading via XHR, status: 0, reason: error +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 18876, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 18860, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 18860, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 6140, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 6140, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 7224, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 7224, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[GPU 10472, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +1518070462577 geckodriver INFO geckodriver 0.19.1 +1518070462583 geckodriver INFO Listening on 127.0.0.1:50008 +1518070465653 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.J75RtD9aDrYj" +1518070466962 Marionette INFO Enabled via --marionette +1518070469415 Marionette INFO Listening on port 50022 +1518070469771 Marionette WARN TLS certificate errors will be ignored for this session +1518070487792 addons.productaddons WARN Failed downloading via XHR, status: 0, reason: error +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 18948, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 17444, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 17444, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 12376, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 12376, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Parent 18948, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 12980, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 12980, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[GPU 10616, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +1518070566781 geckodriver INFO geckodriver 0.19.1 +1518070566788 geckodriver INFO Listening on 127.0.0.1:50295 +1518070569854 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.IH7X0j7BybNT" +1518070571232 Marionette INFO Enabled via --marionette +1518070574015 Marionette INFO Listening on port 50309 +1518070575071 Marionette WARN TLS certificate errors will be ignored for this session +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 11244, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 11244, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 17516, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 17516, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 12636, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 17444, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 17444, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +*** UTM:SVC TimerManager:registerTimer called after profile-before-change notification. Ignoring timer registration for id: telemetry_modules_ping + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +1518070852963 geckodriver INFO geckodriver 0.19.1 +1518070852969 geckodriver INFO Listening on 127.0.0.1:51023 +1518070856053 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.hhFCoJ9CGeSd" +1518070857335 Marionette INFO Enabled via --marionette +1518070860065 Marionette INFO Listening on port 51036 +1518070860188 Marionette WARN TLS certificate errors will be ignored for this session +1518070877617 addons.productaddons WARN Failed downloading via XHR, status: 0, reason: error +1518070886131 addons.productaddons WARN Failed downloading via XHR, status: 0, reason: error +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 3704, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 3704, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 9356, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 9356, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 5980, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 12380, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 12380, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +*** UTM:SVC TimerManager:registerTimer called after profile-before-change notification. Ignoring timer registration for id: telemetry_modules_ping +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[GPU 9424, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +1518070945309 geckodriver INFO geckodriver 0.19.1 +1518070945315 geckodriver INFO Listening on 127.0.0.1:51384 +1518070948397 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.vXKuiLVpJXVe" +1518070949690 Marionette INFO Enabled via --marionette +IPDL protocol error: Handler returned error code! + +###!!! [Parent][DispatchAsyncMessage] Error: PLayerTransaction::Msg_ReleaseLayer Processing error: message was deserialized, but the handler returned false (indicating failure) + +IPDL protocol error: Handler returned error code! + +###!!! [Parent][DispatchAsyncMessage] Error: PLayerTransaction::Msg_ReleaseLayer Processing error: message was deserialized, but the handler returned false (indicating failure) + +1518070952710 Marionette INFO Listening on port 51399 +1518070954055 Marionette WARN TLS certificate errors will be ignored for this session +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 4484, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 19344, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 19344, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 19340, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 19340, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Parent 4484, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 17732, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 17732, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +*** UTM:SVC TimerManager:registerTimer called after profile-before-change notification. Ignoring timer registration for id: telemetry_modules_ping + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +1518071834960 geckodriver INFO geckodriver 0.19.1 +1518071834967 geckodriver INFO Listening on 127.0.0.1:53465 +1518071838050 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.6EGz6pDgRyrt" +1518071839344 Marionette INFO Enabled via --marionette +1518071842112 Marionette INFO Listening on port 53478 +1518071842215 Marionette WARN TLS certificate errors will be ignored for this session +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 18400, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 18400, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 11372, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 11372, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 11672, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 16364, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 16364, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +*** UTM:SVC TimerManager:registerTimer called after profile-before-change notification. Ignoring timer registration for id: telemetry_modules_ping + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +1518071889084 geckodriver INFO geckodriver 0.19.1 +1518071889091 geckodriver INFO Listening on 127.0.0.1:53620 +1518071892155 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.GtX6gr7mzmgD" +1518071893602 Marionette INFO Enabled via --marionette +1518071896110 Marionette INFO Listening on port 53636 +1518071896270 Marionette WARN TLS certificate errors will be ignored for this session +1518071978336 addons.productaddons WARN Failed downloading via XHR, status: 0, reason: error +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 17416, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 17416, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_w1518072180889 Marionette INFO Listening on port 54272 +1518072181853 Marionette WARN TLS certificate errors will be ignored for this session +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 13224, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 18924, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 18924, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 16080, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 16080, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Parent 13224, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +*** UTM:SVC TimerManager:registerTimer called after profile-before-change notification. Ignoring timer registration for id: telemetry_modules_ping +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[GPU 7572, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +1518072311828 geckodriver INFO geckodriver 0.19.1 +1518072311834 geckodriver INFO Listening on 127.0.0.1:54694 +1518072314907 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.22Z3QJL5owiR" +1518072316405 Marionette INFO Enabled via --marionette +1518072318949 Marionette INFO Listening on port 54709 +1518072319079 Marionette WARN TLS certificate errors will be ignored for this session +1518072341184 addons.productaddons WARN Failed downloading via XHR, status: 0, reason: error +IPDL protocol error: Handler returned error code! + +###!!! [Parent][DispatchAsyncMessage] Error: PLayerTransaction::Msg_ReleaseLayer Processing error: message was deserialized, but the handler returned false (indicating failure) + +IPDL protocol error: Handler returned error code! + +###!!! [Parent][DispatchAsyncMessage] Error: PLayerTransaction::Msg_ReleaseLayer Processing error: message was deserialized, but the handler returned false (indicating failure) + +IPDL protocol error: Handler returned error code! + +###!!! [Parent][DispatchAsyncMessage] Error: PLayerTransaction::Msg_ReleaseLayer Processing error: message was deserialized, but the handler returned false (indicating failure) + +IPDL protocol error: Handler returned error code! + +###!!! [Parent][DispatchAsyncMessage] Error: PLayerTransaction::Msg_ReleaseLayer Processing error: message was deserialized, but the handler returned false (indicating failure) + +IPDL protocol error: Handler returned error code! + +###!!! [Parent][DispatchAsyncMessage] Error: PLayerTransaction::Msg_ReleaseLayer Processing error: message was deserialized, but the handler returned false (indicating failure) + +IPDL protocol error: Handler returned error code! + +###!!! [Parent][DispatchAsyncMessage] Error: PLayerTransaction::Msg_ReleaseLayer Processing error: message was deserialized, but the handler returned false (indicating failure) + +IPDL protocol error: Handler returned error code! + +###!!! [Parent][DispatchAsyncMessage] Error: PLayerTransaction::Msg_ReleaseLayer Processing error: message was deserialized, but the handler returned false (indicating failure) + +IPDL protocol error: Handler returned error code! + +###!!! [Parent][DispatchAsyncMessage] Error: PLayerTransaction::Msg_ReleaseLayer Processing error: message was deserialized, but the handler returned false (indicating failure) + +IPDL protocol error: Handler returned error code! + +###!!! [Parent][DispatchAsyncMessage] Error: PLayerTransaction::Msg_ReleaseLayer Processing error: message was deserialized, but the handler returned false (indicating failure) + +IPDL protocol error: Handler returned error code! + +###!!! [Parent][DispatchAsyncMessage] Error: PLayerTransaction::Msg_ReleaseLayer Processing error: message was deserialized, but the handler returned false (indicating failure) + +IPDL protocol error: Handler returned error code! + +###!!! [Parent][DispatchAsyncMessage] Error: PLayerTransaction::Msg_ReleaseLayer Processing error: message was deserialized, but the handler returned false (indicating failure) + +IPDL protocol error: Handler returned error code! + +###!!! [Parent][DispatchAsyncMessage] Error: PLayerTransaction::Msg_ReleaseLayer Processing error: message was deserialized, but the handler returned false (indicating failure) + +IPDL protocol error: Handler returned error code! + +###!!! [Parent][DispatchAsyncMessage] Error: PLayerTransaction::Msg_ReleaseLayer Processing error: message was deserialized, but the handler returned false (indicating failure) + +IPDL protocol error: Handler returned error code! + +###!!! [Parent][DispatchAsyncMessage] Error: PLayerTransaction::Msg_ReleaseLayer Processing error: message was deserialized, but the handler returned false (indicating failure) + +IPDL protocol error: Handler returned error code! + +###!!! [Parent][DispatchAsyncMessage] Error: PLayerTransaction::Msg_ReleaseLayer Processing error: message was deserialized, but the handler returned false (indicating failure) + +IPDL protocol error: Handler returned error code! + +###!!! [Parent][DispatchAsyncMessage] Error: PLayerTransaction::Msg_ReleaseLayer Processing error: message was deserialized, but the handler returned false (indicating failure) + +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 7544, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 7544, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 13720, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 13720, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 2124, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 2124, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[GPU 8580, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath + +1518072698362 Marionette INFO Listening on port 55711 +1518072698711 Marionette WARN TLS certificate errors will be ignored for this session +1518072719232 addons.productaddons WARN Failed downloading via XHR, status: 0, reason: error +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 17660, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 17660, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 18948, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 18948, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +*** UTM:SVC TimerManager:registerTimer called after profile-before-change notification. Ignoring timer registration for id: telemetry_modules_ping +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[GPU 14724, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +1518072793164 geckodriver INFO geckodriver 0.19.1 +1518072793170 geckodriver INFO Listening on 127.0.0.1:56000 +1518072796240 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.Z6KLlauL4tMe" +1518072797606 Marionette INFO Enabled via --marionette +1518072800049 Marionette INFO Listening on port 56014 +1518072800355 Marionette WARN TLS certificate errors will be ignored for this session +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 11592, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 11592, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 18016, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 18016, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 5460, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 5460, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +*** UTM:SVC TimerManager:registerTimer called after profile-before-change notification. Ignoring timer registration for id: telemetry_modules_ping +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[GPU 16796, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +1518072938809 geckodriver INFO geckodriver 0.19.1 +1518072938815 geckodriver INFO Listening on 127.0.0.1:56355 +1518072941866 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.mkAz65nVKnrU" +1518072943415 Marionette INFO Enabled via --marionette +1518072946305 Marionette INFO Listening on port 56367 +1518072947085 Marionette WARN TLS certificate errors will be ignored for this session +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 13068, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 13068, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 3616, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 3616, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 12564, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 5756, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 5756, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +*** UTM:SVC TimerManager:registerTimer called after profile-before-change notification. Ignoring timer registration for id: telemetry_modules_ping +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[GPU 6720, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +1518073000663 geckodriver INFO geckodriver 0.19.1 +1518073000669 geckodriver INFO Listening on 127.0.0.1:56576 +1518073003758 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.3UEvCmRZuzVf" +1518073005091 Marionette INFO Enabled via --marionette +1518073007585 Marionette INFO Listening on port 56589 +1518073007873 Marionette WARN TLS certificate errors will be ignored for this session +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 12172, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 16456, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 16456, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 19276, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 19276, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 2584, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 2584, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +*** UTM:SVC TimerManager:registerTimer called after profile-before-change notification. Ignoring timer registration for id: telemetry_modules_ping +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[GPU 13548, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +1518073137226 geckodriver INFO geckodriver 0.19.1 +1518073137233 geckodriver INFO Listening on 127.0.0.1:56888 +1518073140328 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.iRyHs3fHY8pO" +1518073141738 Marionette INFO Enabled via --marionette +1518073144348 Marionette INFO Listening on port 56901 +1518073144673 addons.xpi WARN Exception running bootstrap method shutdown on activity-stream@mozilla.org: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIObserverService.removeObserver]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: resource://activity-stream/lib/SnippetsFeed.jsm :: uninit :: line 125" data: no] Stack trace: uninit()@resource://activity-stream/lib/SnippetsFeed.jsm:125 < onAction()@resource://activity-stream/lib/SnippetsFeed.jsm:141 < _middleware/ jar:file:///C:/Program%20Files/Mozilla%20Firefox/browser/features/activity-stream@mozilla.org.xpi!/bootstrap.js:80 < shutdown()@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///C:/Program%20Files/Mozilla%20Firefox/browser/features/activity-stream@mozilla.org.xpi!/bootstrap.js:196 < callBootstrapMethod()@resource://gre/modules/addons/XPIProvider.jsm:4406 < observe()@resource://gre/modules/addons/XPIProvider.jsm:2270 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 18612, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 18612, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Promise rejected while context is inactive: Message manager disconnected +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 19364, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Parent 19364, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 4308, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 4308, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +*** UTM:SVC TimerManager:registerTimer called after profile-before-change notification. Ignoring timer registration for id: telemetry_modules_ping +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[GPU 10496, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +1518073306533 geckodriver INFO geckodriver 0.19.1 +1518073306539 geckodriver INFO Listening on 127.0.0.1:57261 +1518073309596 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.jF30omfU42ib" +1518073310969 Marionette INFO Enabled via --marionette +1518073313528 Marionette INFO Listening on port 57273 +1518073313712 Marionette WARN TLS certificate errors will be ignored for this session +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 17456, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 17456, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 19148, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 19148, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 18348, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 18348, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +*** UTM:SVC TimerManager:registerTimer called after profile-before-change notification. Ignoring timer registration for id: telemetry_modules_ping + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +1518073412327 geckodriver INFO geckodriver 0.19.1 +1518073412333 geckodriver INFO Listening on 127.0.0.1:57556 +1518073415409 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.t3UFSrYkvOLj" +1518073416706 Marionette INFO Enabled via --marionette +1518073419674 Marionette INFO Listening on port 57568 +1518073420623 Marionette WARN TLS certificate errors will be ignored for this session +1518073863283 addons.productaddons WARN Failed downloading via XHR, status: 0, reason: error +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 17780, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 17780, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 12808, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 12808, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +1518074041813 geckodriver INFO geckodriver 0.19.1 +1518074041820 geckodriver INFO Listening on 127.0.0.1:59105 +1518074044898 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.QKuSBYBQR4Gu" +1518074046315 Marionette INFO Enabled via --marionette +1518074048793 Marionette INFO Listening on port 59121 +1518074049029 Marionette WARN TLS certificate errors will be ignored for this session +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 17860, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 17860, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 19108, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 19108, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 1640, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 16132, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 16132, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +1518074171041 geckodriver INFO geckodriver 0.19.1 +1518074171047 geckodriver INFO Listening on 127.0.0.1:59500 +1518074174118 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.xiVvF1WUBXbb" +1518074175516 Marionette INFO Enabled via --marionette +1518074178013 Marionette INFO Listening on port 59518 +1518074178260 Marionette WARN TLS certificate errors will be ignored for this session +1518074750421 addons.productaddons WARN Failed downloading via XHR, status: 0, reason: error +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 18632, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 5756, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 5756, Chrome_ChildThread] WUnable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 12088, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 12088, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 18816, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 6692, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 6692, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 3152, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 3152, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[GPU 19076, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +ta\Local\openvr\openvrpaths.vrpath +[Child 18876, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 18876, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +1518075180490 geckodriver INFO geckodriver 0.19.1 +1518075180497 geckodriver INFO Listening on 127.0.0.1:62286 +1518075183565 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.EUocBVIWdu1U" +1518075185317 Marionette INFO Enabled via --marionette +1518075188265 Marionette INFO Listening on port 62299 +1518075188788 Marionette WARN TLS certificate errors will be ignored for this session +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 18512, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 18512, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 11836, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 11836, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 13676, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 13676, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +*** UTM:SVC TimerManager:registerTimer called after profile-before-change notification. Ignoring timer registration for id: telemetry_modules_ping +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[GPU 17444, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +1518075285131 geckodriver INFO geckodriver 0.19.1 +1518075285138 geckodriver INFO Listening on 127.0.0.1:62592 +1518075288207 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.Ov5eJUsPKgWD" +1518075289529 Marionette INFO Enabled via --marionette +1518075292186 Marionette INFO Listening on port 62606 +1518075292323 Marionette WARN TLS certificate errors will be ignored for this session +1518075309824 addons.productaddons WARN Failed downloading via XHR, status: 0, reason: error +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 19856, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 18968, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 18968, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 2680, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 2680, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Parent 19856, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 13100, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 13100, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[GPU 19832, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +1518075437743 geckodriver INFO geckodriver 0.19.1 +1518075437749 geckodriver INFO Listening on 127.0.0.1:62970 +1518075440839 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.jF4VrQPaFGe0" +1518075442186 Marionette INFO Enabled via --marionette +1518075444834 Marionette INFO Listening on port 62983 +1518075444963 Marionette WARN TLS certificate errors will be ignored for this session +1518075469427 addons.productaddons WARN Failed downloading via XHR, status: 0, reason: error +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 19524, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Parent 19524, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 12276, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 12276, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 11992, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 11992, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 18096, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 18096, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[GPU 13256, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +1518075559605 geckodriver INFO geckodriver 0.19.1 +1518075559611 geckodriver INFO Listening on 127.0.0.1:63327 +1518075562679 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.BPgY5ce2QoD2" +1518075563604 Marionette INFO Enabled via --marionette +1518075566429 Marionette INFO Listening on port 63343 +1518075566793 Marionette WARN TLS certificate errors will be ignored for this session +1518075584310 addons.productaddons WARN Failed downloading via XHR, status: 0, reason: error +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 19860, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 20248, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 20248, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][RunMessage] Error: Channel closing: too late to send/recv, messages will be lost + +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 19344, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[GPU 20084, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +1518075879307 geckodriver INFO geckodriver 0.19.1 +1518075879314 geckodriver INFO Listening on 127.0.0.1:64150 +1518075882372 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.FBI61BTnpeF5" +1518075883799 Marionette INFO Enabled via --marionette +1518075886390 Marionette INFO Listening on port 64163 +1518075886508 Marionette WARN TLS certificate errors will be ignored for this session +1518075913324 addons.productaddons WARN Failed downloading via XHR, status: 0, reason: error +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +JavaScript error: http://pk.anjianba.cn/static/js/vendor.af9545b5f9ad41b5263b.js, line 16: TypeError: can't redefine non-configurable property "translateX" +[Child 9732, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 9732, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 11312, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 11312, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Handler function NetworkEventActorProxy.addSecurityInfo threw an exception: [Exception... "Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIMessageSender.sendAsyncMessage]" nsresult: "0xc1f30001 (NS_ERROR_NOT_INITIALIZED)" location: "JS frame :: resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js :: NetworkEventActorProxy.methodFactory/< :: line 1859" data: no] +Stack: NetworkEventActorProxy.methodFactory/<@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:1859:5 +exports.makeInfallible/<@resource://devtools/shared/base-loader.js -> resource://devtools/shared/ThreadSafeDevToolsUtils.js:109:14 +NetworkResponseListener.prototype._getSecurityInfo<@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:516:5 +exports.makeInfallible/<@resource://devtools/shared/base-loader.js -> resource://devtools/shared/ThreadSafeDevToolsUtils.js:109:14 +onStartRequest@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:436:5 +Line: 1859, column: 0 +console.error: + Handler function NetworkEventActorProxy.addSecurityInfo threw an exception: [Exception... "Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIMessageSender.sendAsyncMessage]" nsresult: "0xc1f30001 (NS_ERROR_NOT_INITIALIZED)" location: "JS frame :: resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js :: NetworkEventActorProxy.methodFactory/< :: line 1859" data: no] +Stack: NetworkEventActorProxy.methodFactory/<@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:1859:5 +exports.makeInfallible/<@resource://devtools/shared/base-loader.js -> resource://devtools/shared/ThreadSafeDevToolsUtils.js:109:14 +NetworkResponseListener.prototype._getSecurityInfo<@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:516:5 +exports.makeInfallible/<@resource://devtools/shared/base-loader.js -> resource://devtools/shared/ThreadSafeDevToolsUtils.js:109:14 +onStartRequest@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:436:5 +Line: 1859, column: 0 +Handler function NetworkEventActorProxy.addSecurityInfo threw an exception: [Exception... "Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIMessageSender.sendAsyncMessage]" nsresult: "0xc1f30001 (NS_ERROR_NOT_INITIALIZED)" location: "JS frame :: resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js :: NetworkEventActorProxy.methodFactory/< :: line 1859" data: no] +Stack: NetworkEventActorProxy.methodFactory/<@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:1859:5 +exports.makeInfallible/<@resource://devtools/shared/base-loader.js -> resource://devtools/shared/ThreadSafeDevToolsUtils.js:109:14 +NetworkResponseListener.prototype._getSecurityInfo<@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:516:5 +exports.makeInfallible/<@resource://devtools/shared/base-loader.js -> resource://devtools/shared/ThreadSafeDevToolsUtils.js:109:14 +onStartRequest@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:436:5 +Line: 1859, column: 0 +console.error: + Handler function NetworkEventActorProxy.addSecurityInfo threw an exception: [Exception... "Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIMessageSender.sendAsyncMessage]" nsresult: "0xc1f30001 (NS_ERROR_NOT_INITIALIZED)" location: "JS frame :: resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js :: NetworkEventActorProxy.methodFactory/< :: line 1859" data: no] +Stack: NetworkEventActorProxy.methodFactory/<@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:1859:5 +exports.makeInfallible/<@resource://devtools/shared/base-loader.js -> resource://devtools/shared/ThreadSafeDevToolsUtils.js:109:14 +NetworkResponseListener.prototype._getSecurityInfo<@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:516:5 +exports.makeInfallible/<@resource://devtools/shared/base-loader.js -> resource://devtools/shared/ThreadSafeDevToolsUtils.js:109:14 +onStartRequest@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:436:5 +Line: 1859, column: 0 +Handler function NetworkEventActorProxy.addSecurityInfo threw an exception: [Exception... "Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIMessageSender.sendAsyncMessage]" nsresult: "0xc1f30001 (NS_ERROR_NOT_INITIALIZED)" location: "JS frame :: resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js :: NetworkEventActorProxy.methodFactory/< :: line 1859" data: no] +Stack: NetworkEventActorProxy.methodFactory/<@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:1859:5 +exports.makeInfallible/<@resource://devtools/shared/base-loader.js -> resource://devtools/shared/ThreadSafeDevToolsUtils.js:109:14 +NetworkResponseListener.prototype._getSecurityInfo<@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:516:5 +exports.makeInfallible/<@resource://devtools/shared/base-loader.js -> resource://devtools/shared/ThreadSafeDevToolsUtils.js:109:14 +onStartRequest@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:436:5 +Line: 1859, column: 0 +console.error: + Handler function NetworkEventActorProxy.addSecurityInfo threw an exception: [Exception... "Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIMessageSender.sendAsyncMessage]" nsresult: "0xc1f30001 (NS_ERROR_NOT_INITIALIZED)" location: "JS frame :: resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js :: NetworkEventActorProxy.methodFactory/< :: line 1859" data: no] +Stack: NetworkEventActorProxy.methodFactory/<@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:1859:5 +exports.makeInfallible/<@resource://devtools/shared/base-loader.js -> resource://devtools/shared/ThreadSafeDevToolsUtils.js:109:14 +NetworkResponseListener.prototype._getSecurityInfo<@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:516:5 +exports.makeInfallible/<@resource://devtools/shared/base-loader.js -> resource://devtools/shared/ThreadSafeDevToolsUtils.js:109:14 +onStartRequest@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:436:5 +Line: 1859, column: 0 +Handler function NetworkEventActorProxy.addResponseContent threw an exception: [Exception... "Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIMessageSender.sendAsyncMessage]" nsresult: "0xc1f30001 (NS_ERROR_NOT_INITIALIZED)" location: "JS frame :: resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js :: NetworkEventActorProxy.methodFactory/< :: line 1859" data: no] +Stack: NetworkEventActorProxy.methodFactory/<@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:1859:5 +exports.makeInfallible/<@resource://devtools/shared/base-loader.js -> resource://devtools/shared/ThreadSafeDevToolsUtils.js:109:14 +_onComplete@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:641:5 +onStreamClose@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:598:7 +onInputStreamReady@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:689:7 +Line: 1859, column: 0 +console.error: + Handler function NetworkEventActorProxy.addResponseContent threw an exception: [Exception... "Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIMessageSender.sendAsyncMessage]" nsresult: "0xc1f30001 (NS_ERROR_NOT_INITIALIZED)" location: "JS frame :: resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js :: NetworkEventActorProxy.methodFactory/< :: line 1859" data: no] +Stack: NetworkEventActorProxy.methodFactory/<@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:1859:5 +exports.makeInfallible/<@resource://devtools/shared/base-loader.js -> resource://devtools/shared/ThreadSafeDevToolsUtils.js:109:14 +_onComplete@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:641:5 +onStreamClose@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:598:7 +onInputStreamReady@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:689:7 +Line: 1859, column: 0 +Handler function NetworkEventActorProxy.addResponseContent threw an exception: [Exception... "Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIMessageSender.sendAsyncMessage]" nsresult: "0xc1f30001 (NS_ERROR_NOT_INITIALIZED)" location: "JS frame :: resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js :: NetworkEventActorProxy.methodFactory/< :: line 1859" data: no] +Stack: NetworkEventActorProxy.methodFactory/<@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:1859:5 +exports.makeInfallible/<@resource://devtools/shared/base-loader.js -> resource://devtools/shared/ThreadSafeDevToolsUtils.js:109:14 +_onComplete@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:641:5 +onStreamClose@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:598:7 +onInputStreamReady@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:689:7 +Line: 1859, column: 0 +console.error: + Handler function NetworkEventActorProxy.addResponseContent threw an exception: [Exception... "Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIMessageSender.sendAsyncMessage]" nsresult: "0xc1f30001 (NS_ERROR_NOT_INITIALIZED)" location: "JS frame :: resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js :: NetworkEventActorProxy.methodFactory/< :: line 1859" data: no] +Stack: NetworkEventActorProxy.methodFactory/<@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:1859:5 +exports.makeInfallible/<@resource://devtools/shared/base-loader.js -> resource://devtools/shared/ThreadSafeDevToolsUtils.js:109:14 +_onComplete@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:641:5 +onStreamClose@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:598:7 +onInputStreamReady@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:689:7 +Line: 1859, column: 0 +Handler function NetworkEventActorProxy.addResponseContent threw an exception: [Exception... "Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIMessageSender.sendAsyncMessage]" nsresult: "0xc1f30001 (NS_ERROR_NOT_INITIALIZED)" location: "JS frame :: resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js :: NetworkEventActorProxy.methodFactory/< :: line 1859" data: no] +Stack: NetworkEventActorProxy.methodFactory/<@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:1859:5 +exports.makeInfallible/<@resource://devtools/shared/base-loader.js -> resource://devtools/shared/ThreadSafeDevToolsUtils.js:109:14 +_onComplete@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:641:5 +onStreamClose@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:598:7 +onInputStreamReady@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:689:7 +Line: 1859, column: 0 +console.error: + Handler function NetworkEventActorProxy.addResponseContent threw an exception: [Exception... "Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIMessageSender.sendAsyncMessage]" nsresult: "0xc1f30001 (NS_ERROR_NOT_INITIALIZED)" location: "JS frame :: resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js :: NetworkEventActorProxy.methodFactory/< :: line 1859" data: no] +Stack: NetworkEventActorProxy.methodFactory/<@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:1859:5 +exports.makeInfallible/<@resource://devtools/shared/base-loader.js -> resource://devtools/shared/ThreadSafeDevToolsUtils.js:109:14 +_onComplete@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:641:5 +onStreamClose@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:598:7 +onInputStreamReady@resource://devtools/shared/base-loader.js -> resource://devtools/shared/webconsole/network-monitor.js:689:7 +Line: 1859, column: 0 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 18952, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 18952, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[GPU 19500, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +1518076055557 geckodriver INFO geckodriver 0.19.1 +1518076055564 geckodriver INFO Listening on 127.0.0.1:64631 +1518076058645 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.Vf6F5Quhqxl0" +1518076059977 Marionette INFO Enabled via --marionette +1518076062539 Marionette INFO Listening on port 64645 +1518076062758 Marionette WARN TLS certificate errors will be ignored for this session +1518076082928 addons.productaddons WARN Failed downloading via XHR, status: 0, reason: error +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 20284, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 5936, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 5936, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 12704, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 12704, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 9416, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 9416, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +*** UTM:SVC TimerManager:registerTimer called after profile-before-change notification. Ignoring timer registration for id: telemetry_modules_ping + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +1518076266139 geckodriver INFO geckodriver 0.19.1 +1518076266145 geckodriver INFO Listening on 127.0.0.1:65139 +1518076269228 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.4rqTipHkOL4h" +1518076270555 Marionette INFO Enabled via --marionette +1518076273111 Marionette INFO Listening on port 65151 +1518076273352 Marionette WARN TLS certificate errors will be ignored for this session +1518076292938 addons.productaddons WARN Failed downloading via XHR, status: 0, reason: error +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 3556, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 6768, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 6768, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 20132, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 20132, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Parent 3556, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 7608, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 7608, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[GPU 4484, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +1518076608861 geckodriver INFO geckodriver 0.19.1 +1518076608867 geckodriver INFO Listening on 127.0.0.1:49461 +1518076611951 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.Cr8YVPmpXemh" +1518076613277 Marionette INFO Enabled via --marionette +1518076616164 Marionette INFO Listening on port 49473 +1518076617174 Marionette WARN TLS certificate errors will be ignored for this session +1518076718492 addons.productaddons WARN Failed downloading via XHR, status: 0, reason: error +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 2120, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 12804, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 12804, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 18948, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 19512, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 19512, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[GPU 16700, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +1518077385430 geckodriver INFO geckodriver 0.19.1 +1518077385437 geckodriver INFO Listening on 127.0.0.1:51031 +1518077388510 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.0wLsD9Ycwr2l" +1518077389808 Marionette INFO Enabled via --marionette +IPDL protocol error: Handler returned error code! + +###!!! [Parent][DispatchAsyncMessage] Error: PLayerTransaction::Msg_ReleaseLayer Processing error: message was deserialized, but the handler returned false (indicating failure) + +IPDL protocol error: Handler returned error code! + +###!!! [Parent][DispatchAsyncMessage] Error: PLayerTransaction::Msg_ReleaseLayer Processing error: message was deserialized, but the handler returned false (indicating failure) + +1518077392454 Marionette INFO Listening on port 51046 +1518077392626 Marionette WARN TLS certificate errors will be ignored for this session +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 2040, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 2040, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 20392, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 20392, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 18056, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 5464, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 5464, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +*** UTM:SVC TimerManager:registerTimer called after profile-before-change notification. Ignoring timer registration for id: telemetry_modules_ping + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +1518077490332 geckodriver INFO geckodriver 0.19.1 +1518077490339 geckodriver INFO Listening on 127.0.0.1:51331 +1518077493407 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.Kg9ARgDLSsxm" +1518077494738 Marionette INFO Enabled via --marionette +1518077497330 Marionette INFO Listening on port 51344 +1518077497523 Marionette WARN TLS certificate errors will be ignored for this session +1518077535796 addons.productaddons WARN Failed downloading via XHR, status: 0, reason: error +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 16252, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 1380, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 1380, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 14004, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 14004, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 17376, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 17376, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[GPU 11500, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +-before-change notification. Ignoring timer registration for id: telemetry_modules_ping + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +1518077810856 geckodriver INFO geckodriver 0.19.1 +1518077810863 geckodriver INFO Listening on 127.0.0.1:52256 +1518077813946 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.gi4jhWypxq18" +1518077815257 Marionette INFO Enabled via --marionette +1518077817728 Marionette INFO Listening on port 52269 +1518077818067 Marionette WARN TLS certificate errors will be ignored for this session +1518077835637 addons.productaddons WARN Failed downloading via XHR, status: 0, reason: error +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 18384, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 11124, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 11124, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 17460, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 17460, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[GPU 5824, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +1518078086341 geckodriver INFO geckodriver 0.19.1 +1518078086347 geckodriver INFO Listening on 127.0.0.1:53036 +1518078089417 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.iXnhxnjsXzEe" +1518078090787 Marionette INFO Enabled via --marionette +1518078093252 Marionette INFO Listening on port 53051 +1518078093534 Marionette WARN TLS certificate errors will be ignored for this session +1518078120672 addons.productaddons WARN Failed downloading via XHR, status: 0, reason: error +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 12704, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 12704, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 19844, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 19844, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 6432, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 6432, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[GPU 18516, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +1518078245765 geckodriver INFO geckodriver 0.19.1 +1518078245772 geckodriver INFO Listening on 127.0.0.1:53519 +1518078248848 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.Icfhi2YaHWWf" +1518078250196 Marionette INFO Enabled via --marionette +1518078252826 Marionette INFO Listening on port 53532 +1518078252985 Marionette WARN TLS certificate errors will be ignored for this session +1518078273219 addons.productaddons WARN Failed downloading via XHR, status: 0, reason: error +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 18288, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 19268, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 19268, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 8004, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 8004, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Parent 18288, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 19932, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 19932, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[GPU 15148, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +1518080053551 geckodriver INFO geckodriver 0.19.1 +1518080053557 geckodriver INFO Listening on 127.0.0.1:59298 +1518080056637 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.zfpUZNB651gR" +1518080057998 Marionette INFO Enabled via --marionette +1518080060842 Marionette INFO Listening on port 59310 +1518080061853 Marionette WARN TLS certificate errors will be ignored for this session +1518080083600 addons.productaddons WARN Failed downloading via XHR, status: 0, reason: error +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 17644, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 18152, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][RunMessage] Error: Channel closing: too late to send/recv, messages will be lost + + +###!!! [Child][RunMessage] Error: Channel closing: too late to send/recv, messages will be lost + +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 18196, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 18196, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +*** UTM:SVC TimerManager:registerTimer called after profile-before-change notification. Ignoring timer registration for id: telemetry_modules_ping + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +1518080282916 geckodriver INFO geckodriver 0.19.1 +1518080282924 geckodriver INFO Listening on 127.0.0.1:59841 +1518080285998 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.xi1arbQZ5fYj" +1518080287390 Marionette INFO Enabled via --marionette +1518080289929 Marionette INFO Listening on port 59854 +1518080290116 Marionette WARN TLS certificate errors will be ignored for this session +1518080307864 addons.productaddons WARN Failed downloading via XHR, status: 0, reason: error +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 2528, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 11148, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 11148, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 19092, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 19092, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Parent 2528, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[GPU 9628, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +rent 8876, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 14272, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 14272, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +1518082979526 geckodriver INFO geckodriver 0.19.1 +1518082979532 geckodriver INFO Listening on 127.0.0.1:65379 +1518082982612 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.77gD87A3jWXL" +1518082984069 Marionette INFO Enabled via --marionette +1518082986648 Marionette INFO Listening on port 65392 +1518082986733 Marionette WARN TLS certificate errors will be ignored for this session +1518083035743 addons.productaddons WARN Failed downloading via XHR, status: 0, reason: error +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 19312, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 19488, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 3640, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 3640, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Parent 19312, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 11544, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 11544, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[GPU 20340, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +1518083560341 geckodriver INFO geckodriver 0.19.1 +1518083560347 geckodriver INFO Listening on 127.0.0.1:50504 +1518083563427 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.Ard0Jry58aor" +1518083564677 Marionette INFO Enabled via --marionette +1518083567290 Marionette INFO Listening on port 50516 +1518083567545 Marionette WARN TLS certificate errors will be ignored for this session +1518083642642 addons.productaddons WARN Failed downloading via XHR, status: 0, reason: error +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 20412, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 5372, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 20412, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 20360, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 20360, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[GPU 14736, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +1518084257350 geckodriver INFO geckodriver 0.19.1 +1518084257356 geckodriver INFO Listening on 127.0.0.1:52061 +1518084260442 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.ZdtuARRpYXpB" +1518084261809 Marionette INFO Enabled via --marionette +1518084264193 Marionette INFO Listening on port 52074 +1518084264564 Marionette WARN TLS certificate errors will be ignored for this session +1518084282807 addons.productaddons WARN Failed downloading via XHR, status: 0, reason: error +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 19628, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 1532, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 1532, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 16108, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 16108, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Parent 19628, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 13264, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 13264, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +1518084405744 geckodriver INFO geckodriver 0.19.1 +1518084405751 geckodriver INFO Listening on 127.0.0.1:52520 +1518084408825 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.T0GeOi08Ceuw" +1518084410130 Marionette INFO Enabled via --marionette +1518084412627 Marionette INFO Listening on port 52533 +1518084412980 Marionette WARN TLS certificate errors will be ignored for this session +1518084430326 addons.productaddons WARN Failed downloading via XHR, status: 0, reason: error +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 19188, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 2816, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 2816, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 20460, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 8708, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 8708, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +1518086432301 geckodriver INFO geckodriver 0.19.1 +1518086432307 geckodriver INFO Listening on 127.0.0.1:56431 +1518086435367 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.FcOttQ5tGBhF" +1518086436634 Marionette INFO Enabled via --marionette +1518086439283 Marionette INFO Listening on port 56445 +1518086439483 Marionette WARN TLS certificate errors will be ignored for this session +1518086457001 addons.productaddons WARN Failed downloading via XHR, status: 0, reason: error +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 20412, Chrome_ChildThread] WARNING: pipe error: 232: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 513 +[Child 20412, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][RunMessage] Error: Channel closing: too late to send/recv, messages will be lost + +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 19184, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 19184, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 18288, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 18288, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[GPU 5292, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +1518086774545 geckodriver INFO geckodriver 0.19.1 +1518086774552 geckodriver INFO Listening on 127.0.0.1:57957 +1518086777613 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.XJRlpWL6v6Gy" +1518086778945 Marionette INFO Enabled via --marionette +1518086781399 Marionette INFO Listening on port 57970 +1518086781740 Marionette WARN TLS certificate errors will be ignored for this session +1518086808235 addons.productaddons WARN Failed downloading via XHR, status: 0, reason: error +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 11804, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Parent 11804, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 11124, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 11124, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 5956, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 5956, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Parent 11804, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[GPU 14964, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +1518086919441 geckodriver INFO geckodriver 0.19.1 +1518086919448 geckodriver INFO Listening on 127.0.0.1:58500 +1518086922521 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.VYe5NrFP7RFe" +1518086923798 Marionette INFO Enabled via --marionette +1518086926504 Marionette INFO Listening on port 58515 +1518086926649 Marionette WARN TLS certificate errors will be ignored for this session +1518086947939 addons.productaddons WARN Failed downloading via XHR, status: 0, reason: error +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +[Child 20224, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 20224, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 18252, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 18252, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 17640, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 18696, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 18696, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[GPU 10496, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +1518136531772 geckodriver INFO geckodriver 0.19.1 +1518136531779 geckodriver INFO Listening on 127.0.0.1:63428 +1518136534807 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.5N1goF6QpyRZ" +1518136609577 geckodriver INFO geckodriver 0.19.1 +1518136609584 geckodriver INFO Listening on 127.0.0.1:63589 +1518136612632 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.yaV331fchmZl" +1518136613885 Marionette INFO Enabled via --marionette +1518136616763 Marionette INFO Listening on port 63606 +1518136617853 Marionette WARN TLS certificate errors will be ignored for this session +1518136634155 addons.productaddons WARN Failed downloading via XHR, status: 0, reason: error +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 3780, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 3780, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 15452, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 15452, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 20440, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 20440, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[GPU 19612, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +1518137113657 geckodriver INFO geckodriver 0.19.1 +1518137113663 geckodriver INFO Listening on 127.0.0.1:65052 +1518137116720 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.QpsWgN3rhKbR" +1518137118144 Marionette INFO Enabled via --marionette +1518137121094 Marionette INFO Listening on port 65069 +1518137121941 Marionette WARN TLS certificate errors will be ignored for this session +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 19860, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 19860, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 18828, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 18828, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[GPU 21700, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +1518137347237 geckodriver INFO geckodriver 0.19.1 +1518137347243 geckodriver INFO Listening on 127.0.0.1:49221 +1518137350288 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.FJb9N1obRSDv" +1518137351614 Marionette INFO Enabled via --marionette +1518137354582 Marionette INFO Listening on port 49234 +1518137355510 Marionette WARN TLS certificate errors will be ignored for this session +1518137377038 addons.productaddons WARN Failed downloading via XHR, status: 0, reason: error +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 8440, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Parent 8440, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 7284, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 7284, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 14420, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 14420, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Parent 8440, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 9316, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 9316, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[GPU 11824, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +1518139161064 geckodriver::marionette ERROR Failed to kill browser process +1518140035166 geckodriver INFO geckodriver 0.19.1 +1518140035173 geckodriver INFO Listening on 127.0.0.1:60086 +1518140038242 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.sThVBWzWC45R" +1518140039964 Marionette INFO Enabled via --marionette +1518140043145 Marionette INFO Listening on port 60101 +1518140043460 Marionette WARN TLS certificate errors will be ignored for this session +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 2132, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 10728, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 10728, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 17824, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 17824, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Parent 2132, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 20776, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 20776, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[GPU 1368, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +1518140174450 geckodriver INFO geckodriver 0.19.1 +1518140174457 geckodriver INFO Listening on 127.0.0.1:60541 +1518140177554 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.FYTopGUwyLvx" +1518140178453 Marionette INFO Enabled via --marionette +1518140181116 Marionette INFO Listening on port 60558 +1518140181212 Marionette WARN TLS certificate errors will be ignored for this session +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 3832, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Parent 3832, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][RunMessage] Error: Channel closing: too late to send/recv, messages will be lost + +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 12504, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][RunMessage] Error: Channel closing: too late to send/recv, messages will be lost + +[Child 12504, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 17728, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 17728, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 20440, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 20440, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[GPU 16132, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +1518140322794 geckodriver INFO geckodriver 0.19.1 +1518140322802 geckodriver INFO Listening on 127.0.0.1:61233 +1518140325863 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.hMVwKQKEKmOF" +1518140327350 Marionette INFO Enabled via --marionette +1518140330153 Marionette INFO Listening on port 61247 +1518140331084 Marionette WARN TLS certificate errors will be ignored for this session +1518140523610 addons.productaddons WARN Failed downloading via XHR, status: 0, reason: error +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: resource://devtools/shared/base-loader.js -> resource://devtools/server/actors/highlighters/auto-refresh.js, line 201: TypeError: this.win is null +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 6452, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Parent 6452, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 9024, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 9024, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 7156, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 7156, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Parent 6452, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 17908, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 17908, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +1518140981187 geckodriver INFO geckodriver 0.19.1 +1518140981193 geckodriver INFO Listening on 127.0.0.1:63234 +1518140984253 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.VonSzAmmSNw4" +1518140986021 Marionette INFO Enabled via --marionette +1518140988718 Marionette INFO Listening on port 63248 +1518140989493 Marionette WARN TLS certificate errors will be ignored for this session +1518141066162 addons.productaddons WARN Failed downloading via XHR, status: 0, reason: error +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 4484, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Parent 4484, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 18628, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 18628, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 4008, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 4008, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[GPU 20956, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 + +###!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv + +1518143733574 geckodriver::marionette ERROR Failed to kill browser process +1518146659537 geckodriver INFO geckodriver 0.19.1 +1518146659555 geckodriver INFO Listening on 127.0.0.1:63113 +1518146662549 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\lixing1\\AppData\\Local\\Temp\\rust_mozprofile.FZfnFcyCrcTb" +1518146665060 Marionette INFO Enabled via --marionette +1518146667487 Marionette INFO Listening on port 63129 +1518146667776 Marionette WARN TLS certificate errors will be ignored for this session +1518146930549 addons.productaddons WARN Failed downloading via XHR, status: 0, reason: error +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +JavaScript error: http://pk.anjianba.cn/static/js/vendor.d53afbf763bc8dfdd954.js, line 16: TypeError: can't redefine non-configurable property "translateX" +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Parent 17416, Gecko_IOThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 12120, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 12608, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 12608, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +Unable to read VR Path Registry from C:\Users\lixing1\AppData\Local\openvr\openvrpaths.vrpath +[Child 19308, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 +[Child 19308, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346 diff --git a/collection/sqlite/READsqlte.md b/collection/sqlite/READsqlte.md new file mode 100644 index 0000000..920897c --- /dev/null +++ b/collection/sqlite/READsqlte.md @@ -0,0 +1,17 @@ +# SQLite + +> SQLite是一个进程内的库,实现了自给自足的、无服务器的、零配置的、事务性的 SQL 数据库引擎。它是一个零配置的数据库,这意味着与其他数据库一样,您不需要在系统中配置。 + +## 为什么要用 SQLite? + +1. 不需要一个单独的服务器进程或操作的系统(无服务器的)。 +2. SQLite 不需要配置,这意味着不需要安装或管理。 +3. 一个完整的 SQLite 数据库是存储在一个单一的跨平台的磁盘文件。 +4. SQLite 是非常小的,是轻量级的,完全配置时小于 400KiB,省略可选功能配置时小于250KiB。 +5. SQLite 是自给自足的,这意味着不需要任何外部的依赖。 +6. SQLite 事务是完全兼容 ACID 的,允许从多个进程或线程安全访问。 +7. SQLite 支持 SQL92(SQL2)标准的大多数查询语言的功能。 + +与关系数据库进行交互的标准 SQLite 命令类似于 SQL。 +命令包括 CREATE、SELECT、INSERT、UPDATE、DELETE 和 DROP。 + diff --git a/collection/sqlite/demo.py b/collection/sqlite/demo.py new file mode 100644 index 0000000..2f5cc0f --- /dev/null +++ b/collection/sqlite/demo.py @@ -0,0 +1,58 @@ +''' +SQLite是一种嵌入式数据库,它的数据库就是一个文件。 +由于SQLite本身是C写的,而且体积很小,所以,经常被集成到各种应用程序中,甚至在iOS和Android的App中都可以集成 + +在使用SQLite前,我们先要搞清楚几个概念: +表是数据库中存放关系数据的集合,一个数据库里面通常都包含多个表,比如学生的表,班级的表,学校的表,等等。表和表之间通过外键关联。 +要操作关系数据库,首先需要连接到数据库,一个数据库连接称为Connection; +连接到数据库后,需要打开游标,称之为Cursor,通过Cursor执行SQL语句,然后,获得执行结果。 +''' +import sqlite3 + +# 连接到SQLite数据库 +# 数据库文件是leeing.db +# 如果文件不存在,会自动在当前目录创建: +conn = sqlite3.connect('leeing.db') +# 创建一个Cursor: +cursor = conn.cursor() + +def close_sqlite(): + cursor.close() + conn.close + +def create_db(): + # 执行一条SQL语句,创建user表: + cursor.execute('create table user(id varchar(20) primary key, name varchar(20))') + + # 继续执行一条SQL语句,插入一条记录: + cursor.execute('insert into user(id, name) values ("1", "leeing")') + + # 通过rowcount获得插入的行数: + rowNum = cursor.rowcount + print(rowNum) + + # 关闭Cursor: + cursor.close() + + # 提交事务: + conn.commit() + + # 关闭Connection: + conn.close() + +def get_db(): + cursor.execute('select * from user') + values = cursor.fetchall() + print(values) + close_sqlite() + +def insert_db(): + + cursor.execute('insert into') + +def main(): + # create_db() + get_db() + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/collection/sqlite/leeing.db b/collection/sqlite/leeing.db new file mode 100644 index 0000000..eebbfa7 Binary files /dev/null and b/collection/sqlite/leeing.db differ diff --git a/collection/sqlite/sqlite.py b/collection/sqlite/sqlite.py new file mode 100644 index 0000000..2a674b6 --- /dev/null +++ b/collection/sqlite/sqlite.py @@ -0,0 +1,136 @@ +''' +SQLite是一种嵌入式数据库,它的数据库就是一个文件。 +由于SQLite本身是C写的,而且体积很小,所以,经常被集成到各种应用程序中,甚至在iOS和Android的App中都可以集成 + +在使用SQLite前,我们先要搞清楚几个概念: +表是数据库中存放关系数据的集合,一个数据库里面通常都包含多个表,比如学生的表,班级的表,学校的表,等等。表和表之间通过外键关联。 +要操作关系数据库,首先需要连接到数据库,一个数据库连接称为Connection; +连接到数据库后,需要打开游标,称之为Cursor,通过Cursor执行SQL语句,然后,获得执行结果。 +''' +import random +import string +from sqlite_base import * + +Letters = string.ascii_letters +Num = '123456789' + +DB_FILE_PATH = r'E:\Leeing\DB\sqlite\leeing.db' + +def save_data(): + '''''' + create_sql = '''CREATE TABLE COMPANY + (ID INT PRIMARY KEY NOT NULL, + NAME TEXT NOT NULL, + GENDER VARCHAR(4) DEFAULT NULL, + AGE INT NOT NULL, + ADDRESS CHAR(50), + PHONE VARCHAR(20) DEFAULT NULL + );''' + # table_name = 'COMPANY' + conn = get_conn(DB_FILE_PATH) + create_table(conn, create_sql) + + save_sql = '''INSERT INTO COMPANY values (?, ?, ?, ?, ?, ?)''' + data = [(1, 'Hongten', '男', 20, '广东省广州市', '13423****62'), + (2, 'Tom', '男', 22, '美国旧金山', '15423****63'), + (3, 'Jake', '女', 18, '广东省广州市', '18823****87'), + (4, 'Cate', '女', 21, '广东省广州市', '14323****32')] + save(conn, save_sql, data) + +def get_data(from_table='COMPANY'): + '''获取全部数据''' + fetchall_sql = 'SELECT * FROM {}'.format(from_table) + conn = get_conn(DB_FILE_PATH) + fetchall(conn, fetchall_sql) + +def get_one_data(cond=1): + '''获取一条数据''' + fetchone_sql = 'select * from account where id=?' + conn = get_conn(DB_FILE_PATH) + fetchone(conn, fetchone_sql, cond) + +def update_data(): + '''更新数据''' + conn = get_conn(DB_FILE_PATH) + data = [] + for index in range(1,4): + s = list() + s.append(''.join(random.sample(Letters, 5))) + s.append(index) + data.append(tuple(s)) + print('{:=^30}'.format('更新前的数据')) + get_data('account') + updata_sql_account = 'update account set name = ? where id = ?' + update(conn, updata_sql_account, data) + print('{:+^30}'.format('更新后的数据')) + get_data('account') + +def delete_data(): + '''删除数据''' + conn = get_conn(DB_FILE_PATH) + print('{:=^30}'.format('删除数据前的数据')) + get_data('account') + delete_sql_account = 'delete from account where id = ?' + data = ['1', '2', '3'] + delete(conn, delete_sql_account, data) + print('{:+^30}'.format('删除数后的还有数据吗?')) + get_data('account') + + +def test(): + '''''' + create_sql = '''CREATE TABLE account + (ID INT PRIMARY KEY NOT NULL, + NAME TEXT NOT NULL, + AGE INT NOT NULL + )''' + conn = get_conn(DB_FILE_PATH) + create_table(conn, create_sql) + +def insert_data(): + '''''' + if not table_is_exist('account'): + test() + data = [] + for index in range(1,4): + s = list() + s.append(index) + s.append(''.join(random.sample(Letters, 5))) + s.append(random.randint(10, 50)) + data.append(tuple(s)) + conn = get_conn(DB_FILE_PATH) + save_sql = 'insert into account values (?, ?, ?)' + save(conn, save_sql, data) + + +def table_is_exist(table_name): + '''''' + is_exist = False + conn = get_conn(DB_FILE_PATH) + cu = get_cursor(conn) + sql = '''select count(*) from sqlite_master where type='table' and name= '{}' '''.format(table_name) + n = cu.execute(sql) + print(sql) + # print(list(n)) + if list(n)[0][0] > 0: + is_exist = True + return is_exist + +def leeing(): + '''demo''' + pass + +def main(): + # pass + # save_data() + # get_data('account') + # test() + # table_is_exist('account') + # insert_data() + # get_data() + # get_one_data(4) + # update_data() + delete_data() + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/collection/sqlite/sqlite_base.py b/collection/sqlite/sqlite_base.py new file mode 100644 index 0000000..a785fc9 --- /dev/null +++ b/collection/sqlite/sqlite_base.py @@ -0,0 +1,250 @@ +''' +sqlite 增删改查的封装 +在python中,使用sqlite3创建数据库的连接,当我们指定的数据库文件不存在的时候连接对象会自动创建数据库文件; +如果数据库文件已经存在,则连接对象不会再创建数据库文件,而是直接打开该数据库文件。 + +连接对象可以是硬盘上面的数据库文件,也可以是建立在内存中的,在内存中的数据库执行完任何操作后,都不需要提交事务的(commit) + + 创建在硬盘上面: conn = sqlite3.connect('c:\\test\\test.db') + 创建在内存上面: conn = sqlite3.connect('"memory:') + +其中conn对象是数据库链接对象,而对于数据库链接对象来说,具有以下操作: + + commit() --事务提交 --该方法提交当前的事务。如果您未调用该方法,那么自您上一次调用 commit() 以来所做的任何动作对其他数据库连接来说是不可见的。 + rollback() --事务回滚 --该方法回滚自上一次调用 commit() 以来对数据库所做的更改。 + close() --关闭一个数据库链接 --该方法关闭数据库连接。请注意,这不会自动调用 commit()。如果您之前未调用 commit() 方法,就直接关闭数据库连接,您所做的所有更改将全部丢失! + cursor() --创建一个游标 + +cu = conn.cursor() +这样我们就创建了一个游标对象:cu +在sqlite3中,所有sql语句的执行都要在游标对象的参与下完成 + +对于游标对象cu,具有以下具体操作: + + execute() --执行一条sql语句 -- cursor.execute(sql [, optional parameters]) | cursor.execute("insert into people values (?, ?)", (who, age)) 占位符:问号和命名占位符(命名样式) + executemany() --执行多条sql语句 + close() --游标关闭 + fetchone() --从结果中取出一条记录 --该方法获取查询结果集中的下一行,返回一个单一的序列,当没有更多可用的数据时,则返回 None。 + fetchmany() --从结果中取出多条记录 + fetchall() --从结果中取出所有记录 --该例程获取查询结果集中所有(剩余)的行,返回一个列表。当没有可用的行时,则返回一个空的列表。 + scroll() --游标滚动 + +使用体会: +crate table 只能创建一次,如果创建了在创建,程序会报错 +如果创建了表格,那就直接 insert 或者 update 数据即可 + +execute(sql, data) +这个 data 必须是 tuple 数据类型 +''' +import sqlite3 +import os + +# 数据库文件绝对路径 +DB_FILE_PATH= r'E:\Leeing\DB\sqlite' +# 表名称 +TABLE_NAME = '' +# 是否打印 sql +SHOW_SQL = True + +def get_conn(path): + conn = sqlite3.connect(path) + if os.path.exists(path) and os.path.isfile(path): + print('硬盘上面:【{}】'.format(path)) + return conn + else: + conn = None + print('内存上面:【memory:】') + return sqlite3.connect('memory:') + +def get_cursor(conn): + if conn is not None: + return conn.cursor() + else: + return get_conn('').cursor() + +########################################## +### 创建 | 删除表操作 START +########################################## + +def drop_table(conn, table): + if table is not None and table != '': + sql = 'DROP TABLE IF EXISTS ' + table + if SHOW_SQL: + print('执行sql:【{}】'.format(sql)) + cu = get_cursor(conn) + cu.execute(sql) + conn.commit() + print('删除数据表【{}】成功'.format(table)) + close_all(conn, cu) + else: + print('the {} is empty or equal None!'.format(sql)) + +def create_table(conn, sql): + if sql is not None and sql != '': + cu = get_cursor(conn) + if SHOW_SQL: + print('执行sql:【{}】'.format(sql)) + cu.execute(sql) + conn.commit() + print('创建数据表成功') + close_all(conn, cu) + else: + print('the [{}] is empty or equal None!'.format(sql)) + +def close_all(conn, cu): + try: + if cu is not None: + cu.close() + finally: + if cu is not None: + cu.close() + +########################################## +### 数据库操作 CRUD START +########################################## + +def save(conn, sql, data): + if sql is not None and sql != '': + if data is not None: + cu = get_cursor(conn) + for d in data: + if SHOW_SQL: + print('执行sql: 【{}】, 参数: 【{}】'.format(sql, d)) + cu.execute(sql, d) + conn.commit() + close_all(conn, cu) + else: + print('the [{}] is empty or equal None!'.format(sql)) + +def fetchall(conn, sql): + if sql is not None and sql != '': + cu = get_cursor(conn) + if SHOW_SQL: + print('执行sql:【{}】'.format(sql)) + cu.execute(sql) + result = cu.fetchall() + if len(result) > 0: + for index in range(len(result)): + print(result[index]) + else: + print('>>>> 哎呦~,一点数据都木有了 *_*') + return result + else: + print('the 【{}】 is empty or equal None!'.format(sql)) + +def fetchone(conn, sql, data): + if sql is not None and sql != '': + if data is not None: + d = (data, ) + cu = get_cursor(conn) + if SHOW_SQL: + print('执行sql: 【{}】, 参数: 【{}】'.format(sql, d)) + cu.execute(sql, d) + ret = cu.fetchall() + if len(ret) > 0: + for index in range(len(ret)): + print(ret[index]) + else: + print('>>>> 嘿嘿~,你要的数据没有 #_#') + else: + print('the [{}] equal None'.format(data)) + else: + print('the [{}] is empty or equal None!'.format(sql)) + +def update(conn, sql, data): + if sql is not None and sql != '': + if data is not None: + cu = get_cursor(conn) + for d in data: + if SHOW_SQL: + print('执行sql: 【{}】, 参数: 【{}】'.format(sql, d)) + cu.execute(sql, d) + conn.commit() + close_all(conn, cu) + else: + print('the [{}] is empty or equal None!'.format(sql)) + +def delete(conn, sql, data): + if sql is not None and sql != '': + if data is not None: + cu = get_cursor(conn) + for d in data: + if SHOW_SQL: + print('执行sql: 【{}】, 参数: 【{}】'.format(sql, d)) + cu.execute(sql, d) + conn.commit() + close_all(conn, cu) + else: + print('the [{}] is empty or equal None!'.format(sql)) + + +########################################## +### 测试操作 START +########################################## + +def drop_table_test(): + '''删除数据库表测试''' + print('删除数据库表测试...') + conn = get_conn(DB_FILE_PATH) + drop_table(conn, TABLE_NAME) + +def create_table_test(): + '''创建数据库表测试''' + print('创建数据库表测试...') + create_table_sql = '''CREATE TABLE `student` ( + `id` int(11) NOT NULL, + `name` varchar(20) NOT NULL, + `gender` varchar(4) DEFAULT NULL, + `age` int(11) DEFAULT NULL, + `address` varchar(200) DEFAULT NULL, + `phone` varchar(20) DEFAULT NULL, + PRIMARY KEY (`id`) + )''' + conn = get_conn(DB_FILE_PATH) + create_table(conn, create_table_sql) + +def save_test(): + '''保存数据测试...''' + print('保存数据测试...') + save_sql = '''INSERT INTO student values (?, ?, ?, ?, ?, ?)''' + data = [(1, 'Hongten', '男', 20, '广东省广州市', '13423****62'), + (2, 'Tom', '男', 22, '美国旧金山', '15423****63'), + (3, 'Jake', '女', 18, '广东省广州市', '18823****87'), + (4, 'Cate', '女', 21, '广东省广州市', '14323****32')] + conn = get_conn(DB_FILE_PATH) + save(conn, save_sql, data) + +def fetchall_test(): + '''查询所有数据...''' + print('查询所有数据...') + fetchall_sql = '''SELECT * FROM student''' + conn = get_conn(DB_FILE_PATH) + fetchall(conn, fetchall_sql) + +def fetchone_test(): + '''查询一条数据...''' + print('查询一条数据...') + fetchone_sql = 'SELECT * FROM student WHERE ID = ? ' + data = 1 + conn = get_conn(DB_FILE_PATH) + fetchone(conn, fetchone_sql, data) + +def update_test(): + '''更新数据...''' + print('更新数据...') + update_sql = 'UPDATE student SET name = ? WHERE ID = ? ' + data = [('HongtenAA', 1), + ('HongtenBB', 2), + ('HongtenCC', 3), + ('HongtenDD', 4)] + conn = get_conn(DB_FILE_PATH) + update(conn, update_sql, data) + +def delete_test(): + '''删除数据...''' + print('删除数据...') + delete_sql = 'DELETE FROM student WHERE NAME = ? AND ID = ? ' + data = [('HongtenAA', 1), + ('HongtenCC', 3)] + conn = get_conn(DB_FILE_PATH) + delete(conn, delete_sql, data) \ No newline at end of file diff --git a/crawler/crawler.md b/crawler/crawler.md new file mode 100644 index 0000000..a80c540 --- /dev/null +++ b/crawler/crawler.md @@ -0,0 +1,19 @@ +# crawler + +> 爬虫也不是那么简单啦 + +## 编码问题 + +1、一般情况下是不需要改动默认的编码格式的 + +```python +import io +import sys +# 改变默认的编码方式sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='gb18030') +sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='gb18030' +``` + +因为有些网页默认的编码方式就是 `utf-8`,使用了上面的代码修改默认的编码格式之后,反而会造成网页的部分汉字显示出现乱码的现象 +正确的做法就应该是 先不要一上来就使用修改默认的方式,先输出查看,如果是有乱码问题存在,再使用之 + +2、 \ No newline at end of file diff --git a/crawler/douban/demo.py b/crawler/douban/demo.py new file mode 100644 index 0000000..98ccbf4 --- /dev/null +++ b/crawler/douban/demo.py @@ -0,0 +1,10 @@ +import requests +import json + +def main(): + data = requests.get('http://v3.wufazhuce.com:8000/api/channel/reading/more/0').content + + print(json.loads(data)) + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/crawler/douban/music.py b/crawler/douban/music.py index c3ad20b..be1007d 100644 --- a/crawler/douban/music.py +++ b/crawler/douban/music.py @@ -1,14 +1,23 @@ +# encoding = 'utf-8 ''' 爬虫豆瓣音乐 ''' import re, requests, time from bs4 import BeautifulSoup -import io, sys +import json import pymongo # 修改默认编码方式 -sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='gb18030') -def get_music(url): +client = pymongo.MongoClient('localhost', 27017) +douban = client['myblog']['music'] + +nums = re.compile('\d+') + +music_categories = ['古典', '轻音乐','电子', '民谣', '爵士', '流行', '说唱'] + +music_arr = [] + +def get_music(url, category): ''' no ''' headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', @@ -19,13 +28,35 @@ def get_music(url): } content = requests.get(url, headers=headers).content soup = BeautifulSoup(content, 'lxml') + photoins = soup.select('.photoin') + for photo in photoins: + obj = { + 'type': category, + 'typeName': music_categories[category-1], + 'cover': photo.select('.artist-img .artist_photo img')[0].attrs['src'], + 'href': photo.select('.artist-img .artist_photo')[0].attrs['href'], + 'sides': json.loads(photo.select('.artist-img')[0].attrs['data-sids']), + 'name': photo.select('.ll a')[0].get_text(), + 'like': int(nums.findall(photo.select('.ll .pl')[0].get_text())[0]) + } + music_arr.append(obj) - +def save_music(item): + if douban.save(item): + pass + else: + print('保存失败') + def main(): - urls = ['https://music.douban.com/artists/genre_page/6/{}'.format(url) for url in range(1,6)] - for url in urls: - get_music(url) - time.sleep(1) + # urls = ['https://music.douban.com/artists/genre_page/{}/{}'.format(cate, indx) for cate in range(1, 2) for indx in range(1,2)] + for cate in range(1, 8): + for index in range(1, 6): + get_music('https://music.douban.com/artists/genre_page/{}/{}'.format(cate, index), cate) + time.sleep(1) + # print(music_arr) + for item in music_arr: + save_music(item) + if __name__ == "__main__": main() \ No newline at end of file diff --git a/crawler/wangyi/1.mp3 b/crawler/wangyi/1.mp3 new file mode 100644 index 0000000..31c4900 Binary files /dev/null and b/crawler/wangyi/1.mp3 differ diff --git a/crawler/wangyi/spider163.py b/crawler/wangyi/spider163.py new file mode 100644 index 0000000..1ddf3eb --- /dev/null +++ b/crawler/wangyi/spider163.py @@ -0,0 +1,40 @@ +# encoding = 'utf-8 +''' +爬虫豆瓣音乐 +''' +import re, requests, time +from bs4 import BeautifulSoup +import json +import pymongo +# 修改默认编码方式 + +client = pymongo.MongoClient('localhost', 27017) +douban = client['myblog']['music'] + +nums = re.compile('\d+') + +def get_music(url): + ''' no ''' + headers = { + 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36', + 'host': 'music.163.com', + 'Pragma': 'no-cache', + 'Referer': 'http://www.jianshu.com/p/410e0a3c28cd', + 'Upgrade-Insecure-Requests': '1' + } + content = requests.get(url, headers=headers).content + print(content.decode('utf-8')) + +def save_music(item): + if douban.save(item): + pass + else: + print('保存失败') + +def main(): + # url = 'http://music.163.com/' + url = 'http://music.163.com/api/playlist/detail?id=37880978&updateTime=-1' + get_music(url) + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/flask_restful/app/__init__.py b/flask_restful/app/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/flask_restful/app/__pycache__/api.cpython-36.pyc b/flask_restful/app/__pycache__/api.cpython-36.pyc new file mode 100644 index 0000000..e6da4a3 Binary files /dev/null and b/flask_restful/app/__pycache__/api.cpython-36.pyc differ diff --git a/flask_restful/app/__pycache__/main.cpython-36.pyc b/flask_restful/app/__pycache__/main.cpython-36.pyc new file mode 100644 index 0000000..f429a64 Binary files /dev/null and b/flask_restful/app/__pycache__/main.cpython-36.pyc differ diff --git a/flask_restful/app/apis/__init__.py b/flask_restful/app/apis/__init__.py new file mode 100644 index 0000000..54157b5 --- /dev/null +++ b/flask_restful/app/apis/__init__.py @@ -0,0 +1,10 @@ +from ._api import api +from .dog import api as dog_api +from .user_api import ns as user_api +from .order_api import ns as order_api +from .book_api import ns as book_api + +api.add_namespace(dog_api) +api.add_namespace(user_api) +api.add_namespace(book_api) +api.add_namespace(order_api) \ No newline at end of file diff --git a/flask_restful/app/apis/__pycache__/__init__.cpython-36.pyc b/flask_restful/app/apis/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000..39b3fb9 Binary files /dev/null and b/flask_restful/app/apis/__pycache__/__init__.cpython-36.pyc differ diff --git a/flask_restful/app/apis/__pycache__/user_api.cpython-36.pyc b/flask_restful/app/apis/__pycache__/user_api.cpython-36.pyc new file mode 100644 index 0000000..b57a090 Binary files /dev/null and b/flask_restful/app/apis/__pycache__/user_api.cpython-36.pyc differ diff --git a/flask_restful/app/apis/_api.py b/flask_restful/app/apis/_api.py new file mode 100644 index 0000000..04ffaeb --- /dev/null +++ b/flask_restful/app/apis/_api.py @@ -0,0 +1,7 @@ +from flask_restplus import Api + +api = Api( + title='Douban Music API', + version='1.0', + description='Douban Music API for react-flask', +) diff --git a/flask_restful/app/apis/book_api.py b/flask_restful/app/apis/book_api.py new file mode 100644 index 0000000..f693879 --- /dev/null +++ b/flask_restful/app/apis/book_api.py @@ -0,0 +1,38 @@ +from flask_restplus import fields, Namespace, Resource + +from app.models import Book +from ._api import api + +ns = Namespace('books', description='Books 增删改查 .') + +book_model = ns.model('BookModel', { + 'book_id': fields.String(readOnly=True, description='The book unique identifier'), + 'book_name': fields.String(required=True, description='The book nickname'), + 'price': fields.String(required=True, description='The book price'), +}) +book_list_model = ns.model('BookListModel', { + 'books': fields.List(fields.Nested(book_model)), + 'total': fields.Integer, +}) + + +@ns.route("") +class BookListApi(Resource): + # 初始化数据 + books = [Book("三体", '100'), Book("解忧杂货铺", '25')] + + @ns.doc('get_book_list') + @ns.marshal_with(book_list_model) + def get(self): + return { + "books": self.books, + "total": len(self.books), + } + + @ns.doc('create_book') + @ns.expect(book_model) + @ns.marshal_with(book_model, code=201) + def post(self): + print(api.payload['book_name'], '++++') + book = Book(api.payload['book_name'], api.payload['price']) + return book \ No newline at end of file diff --git a/flask_restful/app/apis/dog.py b/flask_restful/app/apis/dog.py new file mode 100644 index 0000000..ecaee1b --- /dev/null +++ b/flask_restful/app/apis/dog.py @@ -0,0 +1,35 @@ +from flask_restplus import Namespace, Resource, fields + +api = Namespace('dogs', description='Dogs related operations') + +dog = api.model('Dog', { + 'id': fields.String(required=True, description='The dog identifier'), + 'name': fields.String(required=True, description='The dog name'), +}) + +DOGS = [ + {'id': 'medor', 'name': 'Medor'}, +] + + +@api.route('/') +class DogList(Resource): + @api.doc('list_dogs') + @api.marshal_list_with(dog) + def get(self): + '''List all dogs''' + return DOGS + + +@api.route('/') +@api.param('id', 'The dog identifier') +@api.response(404, 'Dog not found') +class Dog(Resource): + @api.doc('get_dog') + @api.marshal_with(dog) + def get(self, id): + '''Fetch a dog given its identifier''' + for dog in DOGS: + if dog['id'] == id: + return dog + api.abort(404) diff --git a/flask_restful/app/apis/order_api.py b/flask_restful/app/apis/order_api.py new file mode 100644 index 0000000..df5e3bb --- /dev/null +++ b/flask_restful/app/apis/order_api.py @@ -0,0 +1,63 @@ +from flask_restplus import Resource, fields, Namespace + +from app.models import Order, Book, User +from .user_api import user_model +from .book_api import book_model + +ns = Namespace("order", description="Order 增删改查 api.") + +order_model = ns.model('OrderModel', { + "order_id": fields.String(readOnly=True, description='The order unique identifier'), + "user": fields.Nested(user_model, description='The order creator info'), + "book": fields.Nested(book_model, description='The book info.'), + "created_at": fields.Integer(readOnly=True, description='create time: unix timestamp.'), +}) +order_list = ns.model('OrderListModel', { + "orders": fields.List(fields.Nested(order_model)), + "total": fields.Integer(description='len of orders') +}) + +book = Book("Book1", 10.5) +user = User("LiLei") +order = Order(user.user_id, book.book_id) + + +@ns.route("") +class UserListApi(Resource): + + @ns.doc('get_order_list') + @ns.marshal_with(order_list) + def get(self): + return { + "orders": [{ + "order_id": order.order_id, + "created_at": order.created_at, + "user": { + "user_id": user.user_id, + "username": user.username, + }, + "book": { + "book_id": book.book_id, + "book_name": book.book_name, + "price": book.price, + } + }], + "total": 1} + + @ns.doc('create_order') + @ns.expect(order_model) + @ns.marshal_with(order_model, code=201) + def post(self): + return { + "order_id": order.order_id, + "created_at": order.created_at, + "user": { + "user_id": user.user_id, + "username": user.username, + }, + "book": { + "book_id": book.book_id, + "book_name": book.book_name, + "price": book.price, + } + } diff --git a/flask_restful/app/apis/user_api.py b/flask_restful/app/apis/user_api.py new file mode 100644 index 0000000..42b88e4 --- /dev/null +++ b/flask_restful/app/apis/user_api.py @@ -0,0 +1,66 @@ +from flask_restplus import Resource, fields, Namespace + +from app.models import User +from ._api import api + +ns = Namespace('users', description='Users .') + +user_model = ns.model('UserModel', { + 'user_id': fields.String(readOnly=True, description='The user unique identifier'), + 'username': fields.String(required=True, description='The user nickname'), +}) +user_list_model = ns.model('UserListModel', { + 'users': fields.List(fields.Nested(user_model)), + 'total': fields.Integer, +}) + + +@ns.route('/') +class UserListApi(Resource): + # 初始化数据 + users = [User("HanMeiMei"), User("LiLei")] + + @ns.doc('get_user_list') + @api.doc(responses={403: 'Not Authorized'}) + @ns.marshal_with(user_list_model) + def get(self): + return { + "users": self.users, + "total": len(self.users), + } + + @ns.doc('create_user') + @ns.expect(user_model) + @ns.marshal_with(user_model, code=201) + def post(self): + user = User(api.payload['username']) + return user + + +@ns.route("/") +@ns.response(404, 'User not found') +@ns.param('user_id', 'The user identifier') +class UserInfoApi(Resource): + users = [User("HanMeiMei"), User("LiLei")] + print([u.user_id for u in users], '++++') + + @ns.doc("get_user_by_id") + @ns.marshal_with(user_model) + def get(self, user_id): + for u in self.users: + if u.user_id == user_id: + return u + ns.abort(404, "User {} doesn't exist".format(user_id)) + + @ns.doc("update_user_info") + @ns.expect(user_model) + @ns.marshal_with(user_model) + def put(self, user_id): + user = None + for u in self.users: + if u.user_id == user_id: + user = u + if not user: + ns.abort(404, "User {} doesn't exist".format(user_id)) + user.username = api.payload['username'] + return user \ No newline at end of file diff --git a/flask_restful/app/main.py b/flask_restful/app/main.py new file mode 100644 index 0000000..fd190f0 --- /dev/null +++ b/flask_restful/app/main.py @@ -0,0 +1,8 @@ +from flask import Flask +from app.apis import api +# from app.api import api + +def create_app(): + app = Flask('DEMO') + api.init_app(app) + return app diff --git a/flask_restful/app/models/__init__.py b/flask_restful/app/models/__init__.py new file mode 100644 index 0000000..17355fd --- /dev/null +++ b/flask_restful/app/models/__init__.py @@ -0,0 +1,3 @@ +from .user import User +from .book import Book +from .order import Order \ No newline at end of file diff --git a/flask_restful/app/models/book.py b/flask_restful/app/models/book.py new file mode 100644 index 0000000..da60839 --- /dev/null +++ b/flask_restful/app/models/book.py @@ -0,0 +1,11 @@ +import uuid + +class Book(): + book_id = None + book_name = None + price = None + + def __init__(self, book_name, book_price): + self.book_id = str(uuid.uuid4()) + self.book_name = book_name + self.price = book_price \ No newline at end of file diff --git a/flask_restful/app/models/order.py b/flask_restful/app/models/order.py new file mode 100644 index 0000000..c8bdbfd --- /dev/null +++ b/flask_restful/app/models/order.py @@ -0,0 +1,14 @@ +import uuid +import time + +class Order(): + order_id = None + user_id = None + book_id = None + created_at = None + + def __init__(self, user_id, book_id): + self.order_id = str(uuid.uuid4()) + self.user_id = user_id + self.book_id = book_id + self.created_at = int(time.time()) \ No newline at end of file diff --git a/flask_restful/app/models/user.py b/flask_restful/app/models/user.py new file mode 100644 index 0000000..d6e832d --- /dev/null +++ b/flask_restful/app/models/user.py @@ -0,0 +1,9 @@ +import uuid + +class User(): + user_id = None + username = None + + def __init__(self, username: str): + self.user_id = str(uuid.uuid4()) + self.username = username \ No newline at end of file diff --git a/flask_restful/manage.py b/flask_restful/manage.py new file mode 100644 index 0000000..2d22f6b --- /dev/null +++ b/flask_restful/manage.py @@ -0,0 +1,10 @@ +from flask_script import Manager, Server +from app.main import create_app + +app = create_app() +manager = Manager(app) + +manager.add_command('runserver', Server(port=5001, use_debugger=True)) + +if __name__ == '__main__': + manager.run() \ No newline at end of file diff --git a/flask_restful/sample.py b/flask_restful/sample.py new file mode 100644 index 0000000..733bdb7 --- /dev/null +++ b/flask_restful/sample.py @@ -0,0 +1,34 @@ +from flask import Flask, request +from flask_restplus import Api, Resource, reqparse + +app = Flask(__name__) +api = Api(app, prefix='/v1', version='2.0', title='Test', description='Test restful api ...') +app.config['ERROR_404_HELP'] = False + +users = { + '1': 'leeing', + '2': 'nanam' +} + +parser = reqparse.RequestParser() +parser.add_argument('userName', type=str, required=True) + +@api.route('/hello/', endpoint='user') +class HelloWorld(Resource): + def get(self, user_id): + print('----', user_id) + return {'hello': 'world'} + + def put(self, user_id): + args = parser.parse_args(strict=True) + print(args, '++++') + return {'userName': 'leeing'} + + def delete(self): + return 'it has deleted !!!' + +def main(): + app.run(debug=True) + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/flask_restful/todo.py b/flask_restful/todo.py new file mode 100644 index 0000000..f9ae699 --- /dev/null +++ b/flask_restful/todo.py @@ -0,0 +1,91 @@ +from flask import Flask, Blueprint +from flask_restplus import Api, Resource, fields + +api_v1 = Blueprint('api', __name__, url_prefix='/api/1') + +api = Api(version='1.0', title='Todo API', + description='A simple TODO API', +) +# !这种写法好像不支持了!!!什么情况不知道 +# api = Api(api_v1, version='1.0', title='Todo API', +# description='A simple TODO API', +# ) + +ns = api.namespace('todos', description='TODO operations') + +TODOS = { + 'todo1': {'task': 'build an API'}, + 'todo2': {'task': '?????'}, + 'todo3': {'task': 'profit!'}, +} + +todo = api.model('Todo', { + 'task': fields.String(required=True, description='The task details') +}) + +listed_todo = api.model('ListedTodo', { + 'id': fields.String(required=True, description='The todo ID'), + 'todo': fields.Nested(todo, description='The Todo') +}) + + +def abort_if_todo_doesnt_exist(todo_id): + if todo_id not in TODOS: + api.abort(404, "Todo {} doesn't exist".format(todo_id)) + +parser = api.parser() +parser.add_argument('task', type=str, required=True, help='The task details', location='form') + + +@ns.route('/') +@api.doc(responses={404: 'Todo not found'}, params={'todo_id': 'The Todo ID'}) +class Todo(Resource): + '''Show a single todo item and lets you delete them''' + @api.doc(description='todo_id should be in {0}'.format(', '.join(TODOS.keys()))) + @api.marshal_with(todo) + def get(self, todo_id): + '''Fetch a given resource''' + abort_if_todo_doesnt_exist(todo_id) + return TODOS[todo_id] + + @api.doc(responses={204: 'Todo deleted'}) + def delete(self, todo_id): + '''Delete a given resource''' + abort_if_todo_doesnt_exist(todo_id) + del TODOS[todo_id] + return '', 204 + + @api.doc(parser=parser) + @api.marshal_with(todo) + def put(self, todo_id): + '''Update a given resource''' + args = parser.parse_args() + task = {'task': args['task']} + TODOS[todo_id] = task + return task + + +@ns.route('/') +class TodoList(Resource): + '''Shows a list of all todos, and lets you POST to add new tasks''' + @api.marshal_list_with(listed_todo) + def get(self): + '''List all todos''' + return [{'id': id, 'todo': todo} for id, todo in TODOS.items()] + + @api.doc(parser=parser) + @api.marshal_with(todo, code=201) + def post(self): + '''Create a todo''' + args = parser.parse_args() + todo_id = 'todo%d' % (len(TODOS) + 1) + TODOS[todo_id] = {'task': args['task']} + return TODOS[todo_id], 201 + + +if __name__ == '__main__': + app = Flask(__name__) + # api.add_namespace(ns) + # app.register_blueprint(api_v1) + api.init_app(app) + app.run(debug=True, port=5002) \ No newline at end of file diff --git a/show-me-code/show_me_the_code@1/code-0.py b/show-me-code/show_me_the_code@1/code-0.py new file mode 100644 index 0000000..3643c71 --- /dev/null +++ b/show-me-code/show_me_the_code@1/code-0.py @@ -0,0 +1,12 @@ +from PIL import Image, ImageFilter + +def main(): + img1 = Image.open('./_assets/images/weixin_avatar1.png') + # img2 = Image.open('./assets/images/weixin_avatar2.png') + # img = Image.blend(img1, img2, 0.5) + # img.show() + img2 = img1.filter(ImageFilter.BLUR) + img2.show() + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/show-me-code/show_me_the_code@1/code-00.py b/show-me-code/show_me_the_code@1/code-00.py new file mode 100644 index 0000000..caa274e --- /dev/null +++ b/show-me-code/show_me_the_code@1/code-00.py @@ -0,0 +1,68 @@ +#!/usr/bin/env python +# encoding: utf-8 +''' +## 第 0000 题: 将你的 QQ 头像(或者微博头像)右上角加上红色的数字,类似于微信未读信息数量那种提示效果。 类似于图中效果 +''' +from PIL import Image, ImageFont, ImageDraw, ImageFilter +import random + +def main(): + # text = '7' + text = str(random.randint(0, 100)) + img = Image.open('./_assets/images/weixin_avatar1.png') + img_w, img_h = img.size + print('Original image size:{} -- {}'.format(img_w, img_h)) + + # 缩放到50%. 函数内部需要是一个 元组 + img.thumbnail((img_w // 2, img_h // 2)) + + dr = ImageDraw.Draw(img) + font = ImageFont.truetype('./_assets/ttf/simhei.ttf', 34) + + dr.text((img.size[0]*0.5, img.size[1]*0.15), text, font=font, fill="#ff0000") + + img.rotate(45).show() + # img.rotate(45).save('./dest/avarta_01.jpg', 'PNG') + +def rand_char(): + return chr(random.randint(65, 90)) + +def rand_color(): + return (random.randint(64, 255), random.randint(64, 255), random.randint(64, 255)) + +def rand_color2(): + return (random.randint(32, 127), random.randint(32, 127), random.randint(32, 127)) + +def app(n): + '''随机生成验证码图片''' + width = 60 *4 + height = 80 + img = Image.new('RGB', (width, height), (255, 255, 255)) + font = ImageFont.truetype('./_assets/ttf/arialuni.ttf', 36) + draw = ImageDraw.Draw(img) + for x in range(width): + for y in range(height): + draw.point((x, y), fill = rand_color()) + arr = [] + for t in range(4): + rnd_chr = rand_char() + arr.append(rnd_chr) + draw.text((60*t + 10, 10), rnd_chr, font=font, fill=rand_color2()) + + image = img.filter(ImageFilter.BLUR) + print(arr) + # image.show() + image.save('./dist/QR-code/{}-{}.jpg'.format(''.join(arr), n), 'jpeg') + +def factory(num=5): + for i in range(num): + app(i) + + +if __name__ == '__main__': + # main() + # app() + factory(50) + + + diff --git a/show-me-code/show_me_the_code@1/code-001.py b/show-me-code/show_me_the_code@1/code-001.py new file mode 100644 index 0000000..a717187 --- /dev/null +++ b/show-me-code/show_me_the_code@1/code-001.py @@ -0,0 +1,27 @@ +# 第 0001 题:做为 Apple Store App 独立开发者,你要搞限时促销,为你的应用生成激活码(或者优惠券), +# 使用 Python 如何生成 200 个激活码(或者优惠券)? + +import string +import random + +KEY_LEN = 20 +KEY_ALL = 200 + +KEY_STRING = string.ascii_letters + string.digits + +def key_gen(): + keylists = [random.choice(KEY_STRING) for _ in range(KEY_LEN)] + return ''.join(keylists) + +def key_num(num, result=None): + if result is None: + result = [] + for _ in range(num): + result.append(key_gen()) + return result + +def main(): + print(key_num(10)) + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/show-me-code/show_me_the_code@1/code-01.py b/show-me-code/show_me_the_code@1/code-01.py new file mode 100644 index 0000000..c9749a4 --- /dev/null +++ b/show-me-code/show_me_the_code@1/code-01.py @@ -0,0 +1,48 @@ +''' +## 第 0001 题: 做为 Apple Store App 独立开发者,你要搞限时促销,为你的应用生成激活码(或者优惠券),使用 Python 如何生成 200 个激活码(或者优惠券)? +''' +import random, string +import pymongo + +client = pymongo.MongoClient('localhost', 27017) +python_QR_db = client['python']['QR_code'] + +def main(count=100, length=20): + # count = 100 + # length = 20 + forSelect = string.ascii_letters + '0123456789' + qr_data = [] + for x in range(count): + re = '' + for y in range(length): + re += random.choice(forSelect) + # print(re) + obj = { + 'type': 'discount' if x > 50 else 'activation', + 'qr_code': re + } + qr_data.append(obj) + # print(qr_data) + save_qr_to_db(qr_data) + +def save_qr_to_db(data): + '''将激活码保存到 mongodb 中''' + for item in data: + # python_QR_db.insert_one(item) + python_QR_db.save(item) + +if __name__ == '__main__': + main() + + + + + +# 学习 +# string.ascii_letters // 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' +# random.choice从序列中获取一个随机元素 +''' +random.choice从序列中获取一个随机元素。其函数原型为:random.choice(sequence)。 +参数sequence表示一个有序类型。这里要说明 一下:sequence在python不是一种特定的类型,而是泛指一系列的类型。list, tuple, 字符串都属于sequence +''' +# random.shuffle random.shuffle的函数原型为:random.shuffle(x[, random]),用于将一个列表中的元素打乱 \ No newline at end of file diff --git a/show-me-code/show_me_the_code@1/code-02.py b/show-me-code/show_me_the_code@1/code-02.py new file mode 100644 index 0000000..8d08ec2 --- /dev/null +++ b/show-me-code/show_me_the_code@1/code-02.py @@ -0,0 +1,55 @@ +''' +## 第 0001 题: 做为 Apple Store App 独立开发者,你要搞限时促销,为你的应用生成激活码(或者优惠券),使用 Python 如何生成 200 个激活码(或者优惠券)? +''' +import random, string +import pymongo + +client = pymongo.MongoClient('localhost', 27017) +python_QR_db = client['python']['QR_code'] + +def main(count=100, length=20): + # count = 100 + # length = 20 + forSelect = string.ascii_letters + '0123456789' + qr_data = [] + for x in range(count): + re = '' + for y in range(length): + re += random.choice(forSelect) + # print(re) + obj = { + 'type': 'discount' if x > 50 else 'activation', + 'qr_code': re + } + qr_data.append(obj) + # print(qr_data) + save_qr_to_db(qr_data) + +def save_qr_to_db(data): + '''将激活码保存到 mongodb 中''' + for item in data: + # python_QR_db.insert_one(item) + python_QR_db.save(item) + +if __name__ == '__main__': + main() + + + + + +# 学习 +# string.ascii_letters // 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' +# random.choice从序列中获取一个随机元素 +''' +random.choice从序列中获取一个随机元素。其函数原型为:random.choice(sequence)。 +参数sequence表示一个有序类型。这里要说明 一下:sequence在python不是一种特定的类型,而是泛指一系列的类型。list, tuple, 字符串都属于sequence + +random.choices 返回的是一个数组 +choices(population, weights=None, *, cum_weights=None, k=1) method of random.Random instance + Return a k sized list of population elements chosen with replacement. + + if the relative weights or cumulative weights are not specified, + the selections are made with equal probability. +''' +# random.shuffle random.shuffle的函数原型为:random.shuffle(x[, random]),用于将一个列表中的元素打乱 \ No newline at end of file diff --git a/show-me-code/show_me_the_code@1/code-03.py b/show-me-code/show_me_the_code@1/code-03.py new file mode 100644 index 0000000..6c91e26 --- /dev/null +++ b/show-me-code/show_me_the_code@1/code-03.py @@ -0,0 +1,68 @@ +''' +## 第 0003 题: 将 0001 题生成的 200 个激活码(或者优惠券)保存到 Redis 非关系型数据库中。 +''' +import redis +import string, random +r = redis.Redis(host='localhost', port=6379, db=0) + +forSelect = string.ascii_letters + '0123456789' +def main(count=100, length=23): + '''生成激活码''' + act_list = [] + for n in range(count): + activation = '' + for i in range(length): + activation += random.choice(forSelect) + # print(activation) + act_list.append(activation) + print(act_list) + save_to_redis(act_list) + +def save_to_redis(data): + for item in data: + r.sadd('activation:apple', item) + +def get_activation(): + arr = r.smembers('activation:apple') + print(arr) + +if __name__ == '__main__': + main(2) + # get_activation() + + +# redis连接实例是线程安全的,可以直接将redis连接实例设置为一个全局变量,直接使用。 +# 如果需要另一个Redis实例(or Redis数据库)时,就需要重新创建redis连接实例来获取一个新的连接。同理,python的redis没有实现select命令 + +''' +Redis 键命令的基本语法如下: COMMAND KEY_NAME + +SET runoobkey redis | DEL runoobkey + +1、Redis 字符串(String) :set keyName keyValue | get keyName + +2、Redis 哈希(Hash):HMSET keyName keyValues | HGETALL runoobkey + Redis hash 是一个string类型的field和value的映射表,hash特别适合用于存储对象。 + **这个就有点像 dict 数据类型了啊** + eg: + HMSET runoobkey name "redis tutorial" description "redis basic commands for caching" likes 20 visitors 23000 + HGETALL runoobkey + 1) "name" + 2) "redis tutorial" + 3) "description" + 4) "redis basic commands for caching" + 5) "likes" + 6) "20" + 7) "visitors" + 8) "23000" + +3、Redis 列表(List) :LPUSH runoobkey redis、LPUSH runoobkey mongodb | LRANGE runoobkey 0 10 + +4、Redis 集合(Set):SADD runoobkey redis、SADD runoobkey mongodb | SMEMBERS runoobkey // "mysql" "mongodb" + +5、Redis 有序集合(sorted set):ZADD runoobkey 1 redis、ZADD runoobkey 2 mongodb、ZADD runoobkey 3 mysql | ZRANGE runoobkey 0 10 WITHSCORES + // 1) "redis" 2) "1" 3) "mongodb" 4) "2" 5) "mysql" 6) "4" + +6、Redis HyperLogLog + Redis HyperLogLog 是用来做基数统计的算法,HyperLogLog 的优点是,在输入元素的数量或者体积非常非常大时,计算基数所需的空间总是固定 的、并且是很小的。 +''' \ No newline at end of file diff --git a/show-me-code/show_me_the_code@1/code-04.py b/show-me-code/show_me_the_code@1/code-04.py new file mode 100644 index 0000000..e702cec --- /dev/null +++ b/show-me-code/show_me_the_code@1/code-04.py @@ -0,0 +1,60 @@ +''' +## 第 0004 题: 任一个英文的纯文本文件,统计其中的单词出现的个数。 +''' +import re, collections + +words = re.compile('[a-zA-Z]+') +def main(): + with open('./_assets/doc/english.txt', 'r', encoding='utf-8') as f: + data = f.read() + obj = {} + # print(words.findall(data)) + for word in words.findall(data): + if word not in obj: + obj[word] = 1 + else: + obj[word] += 1 + # 统计 + method1(data) + method2(obj) + +def method1(data): + '''使用包''' + frequence_words = collections.Counter(words.findall(data)) + print(frequence_words) + +def method2(data): + '''对序列进行操作''' + obj_set = list(data.items()) + obj_sort = sorted(obj_set, key=lambda x: x[1], reverse=True) + print(obj_sort) + +def method3(): + pass + +if __name__ == '__main__': + main() + +# 学习 文件操作 +''' +.readline() 和 .readlines() 之间的差异是后者一次读取整个文件,象 .read() 一样。 +.readlines() 自动将文件内容分析成一个行的列表,该列表可以由 Python 的 for ... in ... 结构进行处理。 +另一方面,.readline() 每次只读取一行,通常比 .readlines() 慢得多。仅当没有足够内存可以一次读取整个文件时,才应该使用 .readline()。 +''' + +# 词频统计 +''' +collections + + + OrderedDict类:排序字典,是字典的子类。引入自2.7。 + namedtuple()函数:命名元组,是一个工厂函数。引入自2.6。 + Counter类:为hashable对象计数,是字典的子类。引入自2.7。 + deque:双向队列。引入自2.4。 + defaultdict:使用工厂函数创建字典,使不用考虑缺失的字典键。引入自2.5。 + + +Counter类 +Counter类的目的是用来跟踪值出现的次数。它是一个无序的容器类型,以字典的键值对形式存储,其中元素作为key,其计数作为value。计数值可以是任意的Interger(包括0和负数)。 +collections.Counter(words_box) +''' diff --git a/show-me-code/show_me_the_code@1/code-05.py b/show-me-code/show_me_the_code@1/code-05.py new file mode 100644 index 0000000..ac728d9 --- /dev/null +++ b/show-me-code/show_me_the_code@1/code-05.py @@ -0,0 +1,142 @@ +''' +## 第 0005 题: 你有一个目录,装了很多照片,把它们的尺寸变成都不大于 iPhone5 分辨率的大小。 +''' +from PIL import Image, ImageOps +import os +import os.path as path + +file_abs_path = r'./_assets/images' + +def main(): + l = os.listdir(file_abs_path) + lists = [item for item in l if path.isfile(path.join(file_abs_path,item)) and is_img(item)] + print(lists) + for filename in lists: + filter_img_size(filename) + +def filter_img_size(filename): + img = Image.open(path.join(file_abs_path, filename)) + width, height = img.size + print(width, height) + height = height * 500 // width + width = 500 + img = ImageOps.fit(img, (width, height)) + w, h = img.size + print(w, h) + img.save(path.join(r'./dist/05', filename)) + +def is_img(string): + string = string.lower() + return string.endswith('.jpg') or string.endswith('png') or string.endswith('.jpeg') + + +if __name__ == '__main__': + main() + + +# 学习 +# 注意: +# 当我使用os.path.isdir(目录的绝对路径)的时候,返回的才是true,也就是说,python的isdir()并不像php的is_dir()那样,可以使用当前工作目录的相对路径, +''' + l = os.listdir('./_assets/images') + lists = [item for item in l if os.path.isfile(item)] + print(lists) // [] +''' + +# 额外知识 + +''' +python os 命令 + +os.sep 可以取代操作系统特定的路径分割符。 +os.name字符串指示你正在使用的平台。比如对于Windows,它是'nt',而对于Linux/Unix用户,它是'posix'。 +os.getcwd()函数得到当前工作目录,即当前Python脚本工作的目录路径。 +os.getenv()和os.putenv()函数分别用来读取和设置环境变量。 +os.listdir()返回指定目录下的所有文件和目录名。 +os.remove()函数用来删除一个文件。 +os.system()函数用来运行shell命令。 + +os.linesep字符串给出当前平台使用的行终止符。例如,Windows使用'\r\n',Linux使用'\n'而Mac使用'\r'。 + +os.path.split()函数返回一个路径的目录名和文件名。 + +os.path.isfile()和os.path.isdir()函数分别检验给出的路径是一个文件还是目录。 + + os.path.splitext(path) 分离文件名与扩展名;默认返回(fname,fextension)元组,可做分片操作 + +os.path.existe()函数用来检验给出的路径是否真地存在 + +os和os.path模块 +os.listdir(dirname):列出dirname下的目录和文件 +os.getcwd():获得当前工作目录 +os.curdir:返回但前目录('.') +os.chdir(dirname):改变工作目录到dirname +''' + +# ImageOps模块的函数 + +''' +Image.new(mode,size,color)中,可以填“L”或者‘RGB’等,那么mode这个参数是什么意思呢? +new方法用于创建一幅给定模式(mode)和尺寸(size)的图片。'RGB'是指的RGB彩色图像,‘L’是指的灰度图像。 +mode 代表如何对图像矩阵进行解析(色彩空间) +“L”:灰度显示,8bit每像素(区别于1) +“RGB”:红绿蓝三通道 + + +''' + +''' +Autocontrast +定义:ImageOps.autocontrast(image, cutoff=0)? image +含义:最大图像对比度。这个函数计算一个输入图像的直方图,从这个直方图中去除最亮和最暗的百分之cutoff,然后重新映射图像,以便保留的最暗像素变为黑色,即0,最亮的变为白色,即255。 +>>> im02 = Image.open("D:\\Code\\Python\\test\\img\\test02.jpg") +>>> im = ImageOps.autocontrast(im02, 20) +在图像im02中,去掉了原来直方图中最暗和最亮的各20%,剩下的像素值然后再映射到[0,255]的颜色空间上。 + + +Colorize +ImageOps.colorize(image, black, white)? image +含义:使得灰色图像变成彩色图像。变量black和white应该是RGB元组或者颜色名称。这个函数会计算出一个颜色值,使得源图像中的所有黑色变成第一种颜色,所有白色变成第二种颜色。 +变量image的模式必须为“L”。 +eg: + im_r = ImageOps.colorize(r, "green", "blue") + +Crop +ImageOps.crop(image, border=0)? image +含义:从图像的四个边去掉变量border定义的四元组对应的行/列。这个函数对所有图像模式有效。 + +Fit +ImageOps.fit(image, size, method, bleed, centering)? image +含义:返回一个指定大小的裁剪过的图像。该图像被裁剪到指定的宽高比和尺寸。变量size是要求的输出尺寸,以像素为单位,是一个(宽,高)元组。 +变量method是用于重采样的方法。默认值为Image.NEAREST。 +变量bleed允许用户去掉图像的边界(图像四个边界)。这个值是一个百分比数(0.01表示百分之一)。默认值是0(没有边界)。 +变量centering用于控制裁剪位置。(0.5,0.5)是裁剪中心(例如,如果裁剪宽度,裁掉左侧50%(右侧50%),顶/底一样) + +Flip +定义:ImageOps.flip(image)? image +含义:输出图像为输入图像在垂直方向的镜像(顶部跟底部对调)。 +>>> im02= Image.open("D:\\Code\\Python\\test\\img\\test02.jpg") +>>> im= ImageOps.flip(im02) + +Grayscale +定义:ImageOps.grayscale(image)? image +含义:将输入图像转换为灰色图像。 +>>>im02 = Image.open("D:\\Code\\Python\\test\\img\\test02.jpg") +>>> im= ImageOps.grayscale(im02) +>>>im.mode +'L' + +Invert +定义:ImageOps.invert(image)? image +含义:将输入图像转换为反色图像。 +>>>im02 = Image.open("D:\\Code\\Python\\test\\img\\test02.jpg") +>>> im= ImageOps.invert(im02) + +Mirror +定义:ImageOps.mirror(image)? image +含义:输出图像为输入图像水平方向的镜像。 + +Posterize +定义:ImageOps.posterize(image,bits)? image +含义:将每个颜色通道上变量bits对应的低(8-bits)个bit置0。变量bits的取值范围为[0,8]。 +''' \ No newline at end of file diff --git a/show-me-code/show_me_the_code@1/code-06.py b/show-me-code/show_me_the_code@1/code-06.py new file mode 100644 index 0000000..2895ff8 --- /dev/null +++ b/show-me-code/show_me_the_code@1/code-06.py @@ -0,0 +1,23 @@ +''' +## 第 0006 题: 你有一个目录,放了你一个月的日记,都是 txt,为了避免分词的问题,假设内容都是英文,请统计出你认为每篇日记最重要的词。 +''' +import re, os, collections + +word = re.compile('\w+') +path_file = r'./_assets/doc' +def main(): + files = os.listdir(path_file) + print(files) + obj = {} + for filename in files: + with open(os.path.join(path_file, filename), encoding='utf-8') as f: + data = f.read() + words = word.findall(data) + words_freq = list(sorted(collections.Counter(words).items(), key = lambda x: x[1], reverse = True)) + # print(words_freq) + obj[filename] = words_freq[0] + print(obj) + + +if __name__ == '__main__': + main() diff --git a/show-me-code/show_me_the_code@1/code-07.py b/show-me-code/show_me_the_code@1/code-07.py new file mode 100644 index 0000000..12bc4da --- /dev/null +++ b/show-me-code/show_me_the_code@1/code-07.py @@ -0,0 +1,59 @@ +''' +## 第 0007 题: 有个目录,里面是你自己写过的程序,统计一下你写过多少行代码。包括空行和注释,但是要分别列出来。 +''' +import re +import os + +path_file = r'./_assets/code' +ret = {} + +def main(): + files_names = [] + files = [f for f in os.walk(path_file)] + for f in files: + path_head = f[0].replace('\\', '/') + files_f = [(path_head + '/' + item) for item in f[2]] + files_names.extend(files_f) + print(files_names) + counter_code(files_names[4:5]) + +def counter_code(filenames): + '''统计代码行数''' + docu_flag = False + for item in filenames: + ret[item] = 0 + with open(item, 'r', encoding='utf-8') as f: + lines = f.readlines() + for line in lines: + line = line.strip() + if line.startswith(r'//') or line.startswith(r'#'): + print(line) + continue + if line.startswith(r'/*') and line.endswith(r'*/'): + print(line) + continue + if line.startswith(r'/*') and not line.endswith(r'*/'): + print(line) + docu_flag = True + continue + if not line.startswith(r'/*') and line.endswith(r'*/'): + print(line) + docu_flag = False + continue + if line != '' and docu_flag: + print(line) + else: + ret[item] += 1 + # print(line, end='') + print('='*20) + print(ret) + +def get_files(pathname): + files = os.listdir(path_file) + return [x for x in files if is_file(x)] + +def is_file(path_name): + return os.path.isfile(os.path.join(path_file, path_name)) + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/show-me-code/show_me_the_code@1/code-08.py b/show-me-code/show_me_the_code@1/code-08.py new file mode 100644 index 0000000..998e259 --- /dev/null +++ b/show-me-code/show_me_the_code@1/code-08.py @@ -0,0 +1,27 @@ +''' +## 第 0008 题: 一个HTML文件,找出里面的正文。 +''' +import re, os +import requests +from bs4 import BeautifulSoup + +path_file = r'./_assets/code' +def main(): + names = [os.path.join(path_file, item) for item in os.listdir(path_file) if item.endswith('.html')] + print(names) + for item in names[1:2]: + with open(item, encoding='utf-8') as f: + data = f.read() + print(data) + +def app(): + url = 'http://www.leeeing.com/' + content = requests.get(url).content + # print(content.decode('utf-8')) + soup = BeautifulSoup(content, 'html.parser') + body = soup.select('body')[0] + print(body.get_text()) + +if __name__ == '__main__': + # main() + app() \ No newline at end of file diff --git a/show-me-code/show_me_the_code@1/code-09.py b/show-me-code/show_me_the_code@1/code-09.py new file mode 100644 index 0000000..ec74232 --- /dev/null +++ b/show-me-code/show_me_the_code@1/code-09.py @@ -0,0 +1,29 @@ +''' +## 第 0009 题: 一个HTML文件,找出里面的链接。 +''' +import re, os +import requests +from bs4 import BeautifulSoup + +path_file = r'./_assets/code' +def main(): + names = [os.path.join(path_file, item) for item in os.listdir(path_file) if item.endswith('.html')] + print(names) + for item in names[1:2]: + with open(item, encoding='utf-8') as f: + data = f.read() + print(data) + +def app(): + url = 'http://www.leeeing.com/' + content = requests.get(url).content + # print(content.decode('utf-8')) + soup = BeautifulSoup(content, 'html.parser') + links = soup.select('a') + for item in links: + print(item.get_text().strip()) + # print(link.get_text()) + +if __name__ == '__main__': + # main() + app() \ No newline at end of file diff --git a/show-me-code/show_me_the_code@1/code-10.py b/show-me-code/show_me_the_code@1/code-10.py new file mode 100644 index 0000000..4c74fa1 --- /dev/null +++ b/show-me-code/show_me_the_code@1/code-10.py @@ -0,0 +1,30 @@ +''' +## 第 0010 题: 使用 Python 生成类似于下图中的字母验证码图片 +''' +from PIL import Image, ImageFont, ImageOps, ImageDraw +import string +import random + +forSelect = string.ascii_letters + '0123456789' + +def main(): + width = 60 * 4 + height = 60 + img = Image.new('RGB', (width, height), (255, 255, 255)) + font = ImageFont.truetype('./_assets/ttf/arialuni.ttf', 50) + draw = ImageDraw.Draw(img) + for x in range(width): + for y in range(height): + draw.point((x,y), fill = rand_color()) + for t in range(4): + draw.text((60*t + 10, 0), random.choice(forSelect), font = font, fill = rand_color2()) + img.show() + +def rand_color(): + return (random.randint(64, 255), random.randint(64, 255), random.randint(64, 255)) + +def rand_color2(): + return (random.randint(32, 127), random.randint(32, 127), random.randint(32, 127)) + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/show-me-code/show_me_the_code@1/code-11.py b/show-me-code/show_me_the_code@1/code-11.py new file mode 100644 index 0000000..cfd7ae9 --- /dev/null +++ b/show-me-code/show_me_the_code@1/code-11.py @@ -0,0 +1,103 @@ +''' +## 第 0011 题: 敏感词文本文件 filtered_words.txt,里面的内容为以下内容,当用户输入敏感词语时,则打印出 Freedom,否则打印出 Human Rights。 + +北京 +程序员 +公务员 +领导 +牛比 +牛逼 +你娘 +你妈 +love +sex +jiangge +''' +import os + +path_file = r'./_assets/doc' + +word_filter = set() + +def main(): + global word_filter + with open(os.path.join(path_file, 'filter_words.txt'), 'r', encoding='utf-8') as f: + data = f.readlines() + for item in data: + if item.strip() != '': + word_filter |= {item.strip('\n')} + print(word_filter) + please_input() + + +def please_input(): + '''这是一个输入交互''' + while True: + s = input() + if s == 'exit': + break + elif s in word_filter: + print('Freedom') + else: + print('Human Rights') + +if __name__ == '__main__': + main() + +# 学习 +# set : 是一个无序不重复元素集。 +# **注意**:是无序的。顺序是无可预知!! +''' +集合支持一系列标准操作,包括并集、交集、差集和对称差集,例如: + +a = t | s # t 和 s的并集 # 相当于 s.update(t) + +b = t & s # t 和 s的交集 + +c = t – s # 求差集(项在t中,但不在s中) + +d = t ^ s # 对称差集(项在t或s中,但不会同时出现在二者中) + +基本操作: + +t.add('x') # 添加一项 + +s.update([10,37,42]) # 在s中添加多项 + +使用remove()可以删除一项: +t.remove('H') + +s.discard(x) +如果在 set “s”中存在元素 x, 则删除 + +s.pop() +删除并且返回 set “s”中的一个不确定的元素, 如果为空则引发 KeyError + +s.clear() +删除 set “s”中的所有元素 + +len(s) +set 的长度 + +x in s +测试 x 是否是 s 的成员 + +s.issubset(t) +s <= t +测试是否 s 中的每一个元素都在 t 中 + +s.issuperset(t) +s >= t +测试是否 t 中的每一个元素都在 s 中 + +s.union(t) +s | t +返回一个新的 set 包含 s 和 t 中的每一个元素 + +hash(s) +返回 s 的 hash 值 + +s.copy() +返回 set “s”的一个浅复制 + +''' \ No newline at end of file diff --git a/show-me-code/show_me_the_code@1/code-12.py b/show-me-code/show_me_the_code@1/code-12.py new file mode 100644 index 0000000..b1347f1 --- /dev/null +++ b/show-me-code/show_me_the_code@1/code-12.py @@ -0,0 +1,43 @@ +''' +## 第 0012 题: 敏感词文本文件 filtered_words.txt,里面的内容 和 0011题一样,当用户输入敏感词语,则用 星号 * 替换,例如当用户输入「北京是个好城市」,则变成「**是个好城市」。 +''' +import os + +path_file = './_assets/doc' + +sensitive_words = set() + +def main(): + global sensitive_words + with open(os.path.join(path_file, 'filter_words.txt'), encoding='utf-8') as f: + lines = f.readlines() + for line in lines: + line = line.strip() + if line != '': + sensitive_words.update({line}) + # sensitive_words |= {line} + print(sensitive_words) + civilization() + +def civilization(): + '''文明''' + while True: + word = input() + info = is_sensive_in_words(word) + print(info) + if word == 'exit': + break + elif info[0]: + print(word.replace(info[1], '*'*(len(info[1])))) + +def is_sensive_in_words(word): + '''是否包含敏感词''' + print(word) + for item in sensitive_words: + if item in word: + return True, item + continue + return False, 0 + +if __name__ == '__main__': + main() diff --git a/show-me-code/show_me_the_code@1/code-13.py b/show-me-code/show_me_the_code@1/code-13.py new file mode 100644 index 0000000..523552a --- /dev/null +++ b/show-me-code/show_me_the_code@1/code-13.py @@ -0,0 +1,57 @@ +''' +## 第 0013 题: 用 Python 写一个爬图片的程序,爬 这个链接里的日本妹子图片 :-) +http://tieba.baidu.com/p/2166231880 +''' +import requests +from bs4 import BeautifulSoup +from urllib.request import urlretrieve + +def get_image_srcs(url): + content = requests.get(url).content + # print(content.decode('utf-8')) + soup = BeautifulSoup(content, 'lxml') + images = soup.select('.p_content img') + print(len(images)) + img_srcs = [] + for img in images: + src = img.attrs['src'] + img_srcs.append(src) + return img_srcs + +def get_image(index, url): + bdwater = '杉本有美吧' + img_r = requests.get(url, stream = True) + if img_r.status_code == 200: + with open('./dist/013/{}-{}.jpg'.format(bdwater, index), 'wb') as f: + for chunk in img_r: + f.write(chunk) + +def get_img_by_uillib(index, url): + '''这个方法更加简单,一部就可以搞定''' + urlretrieve(url, './dist/013/杉本有美吧-{}.jpg'.format(index)) + +def main(): + url = 'http://tieba.baidu.com/p/2166231880' + img_srcs = get_image_srcs(url) + + # 方法一 + # for index, src in enumerate(img_srcs, 1): + # get_image(index, src) + + # 方法二 + for index, src in enumerate(img_srcs[0:5], 1): + get_img_by_uillib(index, src) + +if __name__ == '__main__': + main() + + +# 学习 + +# enumerate()使用 +''' +enumerate()是python的内置函数 +enumerate在字典上是枚举、列举的意思 +对于一个可迭代的(iterable)/可遍历的对象(如列表、字符串),enumerate将其组成一个索引序列,利用它可以同时获得 索引和值 -- 重点 +enumerate多用于在for循环中得到计数 +''' \ No newline at end of file diff --git a/show-me-code/show_me_the_code@1/code-14.py b/show-me-code/show_me_the_code@1/code-14.py new file mode 100644 index 0000000..29cba8c --- /dev/null +++ b/show-me-code/show_me_the_code@1/code-14.py @@ -0,0 +1,62 @@ +''' +## 第 0014 题: 纯文本文件 student.txt为学生信息, 里面的内容(包括花括号)如下所示: + +{ + "1":["张三",150,120,100], + "2":["李四",90,99,95], + "3":["王五",60,66,68] +} +请将上述内容写到 student.xls 文件中,如下图所示: + +student.xls + +阅读资料 腾讯游戏开发 XML 和 Excel 内容相互转换 +''' + +import xlwt +import re + +def main(): + fname = './dist/014/student.xls' + book = xlwt.Workbook(encoding='utf-8', style_compression=0) + sheet = book.add_sheet('student', cell_overwrite_ok = True) + info = re.compile(r'\"(\d+)\":\[\"(\w+)\",(\d+),(\d+),(\d+)\]') + + with open('./_assets/doc/student.txt', 'r', encoding='utf-8') as f: + txt = f.read() + print(txt) + print(info.findall(txt)) + data = info.findall(txt) + for row_ind, line in enumerate(data): + for col_ind, cell in enumerate(line): + sheet.write(row_ind, col_ind, cell) + + book.save(fname) + +if __name__ == '__main__': + main() + + +# 学习 + +# python操作Excel读写 + +''' +处理excel文件是在工作中经常用到的,python为我们考虑到了这一点,python中本身就自带csv模块。 + +创建工作簿(workbook)和工作表(sheet) +import xlwt +workbook = xlwt.Workbook() +sheet = workbook.add_sheet("Sheet Name") + +写单元格(cell) +sheet.write(0, 0, 'foobar') # row, column, value + +对单元格应用样式(加粗为例) +style = xlwt.easyxf('font: bold 1') +sheet.write(0, 0, 'foobar', style) + +设置列宽 +sheet.col(0).width = 256 * (len(key) + 1) +# set width.. 256 = 1 width of 0 character +''' \ No newline at end of file diff --git a/show-me-code/show_me_the_code@1/code-17.py b/show-me-code/show_me_the_code@1/code-17.py new file mode 100644 index 0000000..833b132 --- /dev/null +++ b/show-me-code/show_me_the_code@1/code-17.py @@ -0,0 +1,115 @@ +''' +## 第 0017 题: 将 第 0014 题中的 student.xls 文件中的内容写到 student.xml 文件中,如 + +下所示: + + + + + +{ + "1" : ["张三", 150, 120, 100], + "2" : ["李四", 90, 99, 95], + "3" : ["王五", 60, 66, 68] +} + + +''' + +import xlrd, codecs +from lxml import etree +from collections import OrderedDict + +def read_xls(filename): + data = xlrd.open_workbook(filename) + table = data.sheets()[0] + print(table.nrows) + c = OrderedDict() + for idx in range(table.nrows): + print(table.row_values(idx)) + print(table.cell(idx,0).value) + c[table.cell(idx, 0).value] = table.row_values(idx)[1:] + return c + +def save_xml(data): + output = codecs.open('student.xml', 'w', 'utf-8') + root = etree.Element('root') + student_xml = etree.ElementTree(root) + student = etree.SubElement(root, 'student') + student.text = str(data) + student.append(etree.Comment('学生信息表\n\"id\": [名字, 数学,语文, 英语]')) + output.write(etree.tounicode(student_xml.getroot())) + output.close() + +def main(): + fname = './dist/014/student.xls' + data = read_xls(fname) + print(data) + save_xml(data) + + +if __name__ == '__main__': + main() + +# 学习 + +# OrderedDict +# Python中的字典对象可以以“键:值”的方式存取数据。OrderedDict是它的一个子类,实现了对字典对象中元素的排序。 +# 使用OrderedDict会根据放入元素的先后顺序进行排序。由于进行了排序,所以OrderedDict对象的字典对象,如果其顺序不同那么Python也会把他们当做是两个不同的对象 +''' +一、首先明白创建 dict 的方式 + +1、传统的文字表达式: +>>> d={'name':'Allen','age':21,'gender':'male'} +>>> d +{'age': 21, 'name': 'Allen', 'gender': 'male'} + +2.动态分配键值: +>>> d={} +>>> d['name']='Allen' +>>> d['age']=21 +>>> d['gender']='male' +>>> d +{'age': 21, 'name': 'Allen', 'gender': 'male'} + +3.字典键值表: +>>> c = dict(name='Allen', age=14, gender='male') +>>> c +{'gender': 'male', 'name': 'Allen', 'age': 14} + +**注意** +因为这种形式语法简单,不易出错,所以非常流行。 +这种形式所需的代码比常量少,但是键必须都是字符串才行,所以下列代码会报错 +>>> c = dict(name='Allen', age=14, gender='male', 1='abcd') +SyntaxError: keyword can't be an expression + +4.字典键值元组表 +>>> obj = dict([('1', ['张三', '150', '120', '100']), ('name','Allen')]) +>>> obj +{'1': ['张三', '150', '120', '100']} + 如果你需要在程序运行时把键和值逐步建成序列,那么这种方式比较有用。 + +# 这种数据格式就是和 obj.items() 返回的数据格式相同 + +5.所有键的值都相同或者赋予初始值: +>>> f=dict.fromkeys(['height','weight'],'normal') +>>> f +{'weight': 'normal', 'height': 'normal'} + +二、collections.OrderedDict + +dd = {'banana': 3, 'apple':4, 'pear': 1, 'orange': 2} +#按key排序 +kd = collections.OrderedDict(sorted(dd.items(), key=lambda t: t[0])) +print kd +#按照value排序 +vd = collections.OrderedDict(sorted(dd.items(),key=lambda t:t[1])) +print vd + +#输出 +OrderedDict([('apple', 4), ('banana', 3), ('orange', 2), ('pear', 1)]) +OrderedDict([('pear', 1), ('orange', 2), ('banana', 3), ('apple', 4)]) +''' \ No newline at end of file diff --git a/show-me-code/show_me_the_code@1/code-18.py b/show-me-code/show_me_the_code@1/code-18.py new file mode 100644 index 0000000..5cfadf9 --- /dev/null +++ b/show-me-code/show_me_the_code@1/code-18.py @@ -0,0 +1,17 @@ +''' +## 第 0018 题: 将 ## 第 0015 题中的 city.xls 文件中的内容写到 city.xml 文件中,如下 所示: + + + + + + { + "1" : "上海", + "2" : "北京", + "3" : "成都" + } + + +''' \ No newline at end of file diff --git a/show-me-code/show_me_the_code@1/code-20.py b/show-me-code/show_me_the_code@1/code-20.py new file mode 100644 index 0000000..9c39c4b --- /dev/null +++ b/show-me-code/show_me_the_code@1/code-20.py @@ -0,0 +1,4 @@ +''' +## 第 0020 题: 登陆中国联通网上营业厅 后选择「自助服务」 --> 「详单查询」,然后选择你要查询的时间段, +# 点击「查询」按钮,查询结果页面的最下方,点击「导出」,就会生成类似于 2014年10月01日~2014年10月31日通话详单.xls 文件。写代码,对每月通话时间做个统计。 +''' \ No newline at end of file diff --git a/show-me-code/show_me_the_code@1/code-21.py b/show-me-code/show_me_the_code@1/code-21.py new file mode 100644 index 0000000..afdca64 --- /dev/null +++ b/show-me-code/show_me_the_code@1/code-21.py @@ -0,0 +1,68 @@ +''' +## 第 0021 题: 通常,登陆某个网站或者 APP,需要使用用户名和密码。密码是如何加密后存储起来的呢?请使用 Python 对密码加密。 +''' +import hashlib +from collections import defaultdict + +# db = {} +db = defaultdict(lambda: 'N/A') + +def get_md5(password): + a = hashlib.md5() + a.update(password.encode('utf-8')) + return (a.hexdigest()) + +def register(username, password): + db[username] = get_md5(password + username + 'the-Salt') + +def login(username, password): + b = get_md5(password + username + 'the-Salt') + print(b) + if b == db[username]: + return True + else: + return False + +def app(): + a = input('注册输入用户名:') + b = input('注册输入密码:') + register(a, b) + + while True: + c = input('登陆输入用户名:') + if c == 'exit': + break + d = input('登陆输入密码:') + if login(c, d): + print('{:+^20}'.format('登陆成功')) + else: + print('{:=^20}'.format('登陆失败')) + +def main(): + app() + +if __name__ == '__main__': + main() + +# 学习 + +# defaultdict + +''' +用dict时,如果引用的Key不存在,就会抛出KeyError。如果希望key不存在时,返回一个默认值,就可以用defaultdict + +>>> from collections import defaultdict +>>> dd = defaultdict(lambda: 'N/A') +>>> dd['key1'] = 'abc' +>>> dd['key1'] # key1存在 +'abc' +>>> dd['key2'] # key2不存在,返回默认值 +'N/A' + +注意默认值是调用函数返回的,而函数在创建defaultdict对象时传入。 + +除了在Key不存在时返回默认值,defaultdict的其他行为跟dict是完全一样的。 +''' + +# OrderedDict +# 使用dict时,Key是无序的。在对dict做迭代时,我们无法确定Key的顺序。 \ No newline at end of file diff --git a/show-me-code/show_me_the_code@1/code-22.py b/show-me-code/show_me_the_code@1/code-22.py new file mode 100644 index 0000000..d82fd02 --- /dev/null +++ b/show-me-code/show_me_the_code@1/code-22.py @@ -0,0 +1,33 @@ +''' +## 第 0022 题: iPhone 6、iPhone 6 Plus 早已上市开卖。请查看你写得 ## 第 0005 题的代码是否可以复用 +''' +from PIL import Image +import os + +path_file = './_assets/images' + +def self_adaption(files, width, height): + for fname in files: + img = Image.open(os.path.join(path_file, fname)) + print('{} 图像的原始宽:{} - 高:{} - 类型:{}'.format(fname, img.size[0], img.size[1], img.mode)) + img.thumbnail((width, height)) + print('{} 图像缩放后的宽高:{} - {} - {}'.format(fname, img.size[0], img.size[1], img.mode)) + print('='*20) + # img.show() + img.save(os.path.join('./dist/022', fname)) + +def main(): + files = [fs for fs in os.listdir(path_file) if os.path.isfile(os.path.join(path_file, fs)) and fs.endswith('.jpg')] + PHONE = { + 'iphone5': (1136, 640), + 'iphone6': (1134,750), + 'iphone6P': (2208, 1242) + } + width, height = PHONE['iphone6'] + print(files) + self_adaption(files, width, height) + +if __name__ == '__main__': + main() + +# 学习 \ No newline at end of file diff --git a/show-me-code/show_me_the_code@1/code-23.py b/show-me-code/show_me_the_code@1/code-23.py new file mode 100644 index 0000000..045fa97 --- /dev/null +++ b/show-me-code/show_me_the_code@1/code-23.py @@ -0,0 +1,63 @@ +''' +## 第 0023 题: 使用 Python 的 Web 框架,做一个 Web 版本 留言簿 应用。 + +阅读资料:Python 有哪些 Web 框架 + +留言簿参考 +''' +from flask import Flask +from sqlalchemy import String, DATETIME, Interger, Column + +app = Flask(__name__) + +class Post(base): + __tablename__ = 'todo' + + postID = Column(Interge, primary_key=True) + postName = Column(String(50)) + createdAt = Column(DATETIME) + content = Column(String(15000)) + +class DataBase(object): + def __init__(self): + self.info = { + 'uesr': '', + 'password': '', + 'ip': '', + 'port': '', + 'database': '' + } + self.session = self.make_connect() + + def __del__(self): + if self.session: + self.session.close() + + def make_connect(self): + connect_str = 'mysql + pymysql: //{user}:{password}@{ip}:{port}/{database}'.format(self.info) + engine = create_engine(connect_str) + DBSession = sessionmaker(engine) + session = DBSession() + return session + + def query_all_post(self): + items = self.session.query(Post).order_by(Post.postID).all() + if not isinstance(items, list): + return [items] + return items + + def add_post(self, item): + self.session.add(item) + self.session.commit() + + +@app.route('/', methods=['GET']) +def index(): + pass + +@app.route('/add', methods=['POST','GET']) +def add(): + pass + +if __name__ == '__main__': + app.run(debug=True) \ No newline at end of file diff --git a/show-me-code/show_me_the_code@1/generateImage.py b/show-me-code/show_me_the_code@1/generateImage.py new file mode 100644 index 0000000..91300b5 --- /dev/null +++ b/show-me-code/show_me_the_code@1/generateImage.py @@ -0,0 +1,11 @@ +#!/usr/bin/python +# -*- coding: UTF-8 -*- +from PIL import Image +import os + +os.chdir(r'C:\Users\lixing1\Desktop') + +img = Image.open(r'haha.jpg') +new_img = img.resize((144, 256), Image.BILINEAR) +new_img.save('link.png') +new_img.show() diff --git a/show-me-code/README.md b/show-me-code/show_me_the_code@1/show-me-the-code.md similarity index 98% rename from show-me-code/README.md rename to show-me-code/show_me_the_code@1/show-me-the-code.md index 72496ce..78dab44 100644 --- a/show-me-code/README.md +++ b/show-me-code/show_me_the_code@1/show-me-the-code.md @@ -1,3 +1,5 @@ +# [Show me the code](https://github.com/Yixiaohan/show-me-the-code) + ## 第 0000 题: 将你的 QQ 头像(或者微博头像)右上角加上红色的数字,类似于微信未读信息数量那种提示效果。 类似于图中效果 头像 diff --git a/show-me-code/show_me_the_code@1/student.xml b/show-me-code/show_me_the_code@1/student.xml new file mode 100644 index 0000000..971e106 --- /dev/null +++ b/show-me-code/show_me_the_code@1/student.xml @@ -0,0 +1,2 @@ +OrderedDict([('1', ['张三', '150', '120', '100']), ('2', ['李四', '90', '99', '95']), ('3', ['王五', '60', '66', '68'])]) \ No newline at end of file diff --git a/show-me-code/show_me_the_code@2/.qiniu_pythonsdk_hostscache.json b/show-me-code/show_me_the_code@2/.qiniu_pythonsdk_hostscache.json new file mode 100644 index 0000000..ce00d61 --- /dev/null +++ b/show-me-code/show_me_the_code@2/.qiniu_pythonsdk_hostscache.json @@ -0,0 +1 @@ +{"http:q6QLur7zYpyj9rUAeUwkKA3g2BxiGRugfevdqW7r:python": {"upHosts": ["http://up.qiniu.com", "http://upload.qiniu.com", "-H up.qiniu.com http://183.131.7.18"], "ioHosts": ["http://iovip.qbox.me"], "deadline": 1524206547}} \ No newline at end of file diff --git a/show-me-code/show_me_the_code@2/headlines/headlines.py b/show-me-code/show_me_the_code@2/headlines/headlines.py new file mode 100644 index 0000000..db301b6 --- /dev/null +++ b/show-me-code/show_me_the_code@2/headlines/headlines.py @@ -0,0 +1,92 @@ +#!/usr/bin/python +# -*- coding: UTF-8 -*- +""" +获取某个 RSS 的相关新闻 & 获取某地的天气;通过 index.html 展现出来gti +""" + +import datetime +import requests +import feedparser +from flask import Flask, render_template, request, make_response + +app = Flask(__name__) + +RSS_FEED = {"zhihu": "https://www.zhihu.com/rss", + "netease": "http://news.163.com/special/00011K6L/rss_newsattitude.xml", + "songshuhui": "http://songshuhui.net/feed"} + +DEFAULTS = { + 'city': '北京', + 'publication': 'songshuhui' +} + +WEATHERS = { + "北京": 101010100, + "上海": 101020100, + "广州": 101280101, + "深圳": 101280601 +} + +def get_value_with_fallback(key): + if request.args.get(key): + return request.args.get(key) + if request.cookies.get(key): + return request.cookies.get(key) + return DEFAULTS[key] + +@app.route('/') +def index(): + print('cookie信息 {}'.format(request.cookies()) + publication = get_value_with_fallback('publication') + city = get_value_with_fallback('city') + print('='*30) + print(city) + + weather = get_weather(city) + articles = get_news(publication) + + response = make_response(render_template('index.html', articles = articles, weather = weather)) + + expires = datetime.datetime.now() + datetime.timedelta(days = 365) + response.set_cookie('publication', publication, expires = expires) + response.set_cookie('city', city, expires = expires) + + return response + + +def get_news(publication): + feed = feedparser.parse(RSS_FEED[publication]) + # print(feed) + return feed['entries'] + +def get_weather(city): + code = WEATHERS.get(city, '101010100') + url = "http://www.weather.com.cn/data/sk/{0}.html".format(code) + + r = requests.get(url) + r.encoding = 'utf-8' + print('*'*20) + print(r.json()) + + data = r.json()['weatherinfo'] + return dict(city=data['city'], temperature=data['temp'], description=data['WD']) + + + +if __name__ == '__main__': + app.run(debug=True) + + + +"""" +Response.set_cookie( + key, //键 + value='', //值 + max_age=None, //秒为单位的cookie寿命,None表示http-only + expires=None, //失效时间,datetime对象或unix时间戳 + path='/', //cookie的有效路径 + domain=None, //cookie的有效域 + secure=None, + httponly=False) + +""" \ No newline at end of file diff --git a/show-me-code/show_me_the_code@2/headlines/templates/index.html b/show-me-code/show_me_the_code@2/headlines/templates/index.html new file mode 100644 index 0000000..29dc9dc --- /dev/null +++ b/show-me-code/show_me_the_code@2/headlines/templates/index.html @@ -0,0 +1,40 @@ + + + + + + Headlines + + + + + +
+

Current weather

+
+ + +
+ +

城市: {{weather.city}}

+

{{weather.description}} |{{weather.temperature}}℃

+ +
+ + +
+ + {% for article in articles %} + {{article.title}}
+ {{article.published}}
+

{{article.summary}}

+
+ {% endfor %} +
+ + + \ No newline at end of file diff --git a/show-me-code/show_me_the_code@2/image_storage.py b/show-me-code/show_me_the_code@2/image_storage.py new file mode 100644 index 0000000..cb1b7df --- /dev/null +++ b/show-me-code/show_me_the_code@2/image_storage.py @@ -0,0 +1,27 @@ +# -*- coding:utf-8 -*- +from qiniu import Auth, put_data, put_file, etag + +# 需要填写你的 Access Key 和 Secret Key +access_key = 'q6QLur7zYpyj9rUAeUwkKA3g2BxiGRugfevdqW7r' +secret_key = 'l8AfWuWW4DfK1TrZyPzUsXc8WKa_YojUgCUG040u' + +# #构建鉴权对象 +q = Auth(access_key, secret_key) + +#要上传的空间 +bucket_name = 'python' + +#上传到七牛后保存的文件名 +key = 'my-flask-logo.png'; + +#生成上传 Token,可以指定过期时间等 +token = q.upload_token(bucket_name, key, 3600) +print(token) + +#要上传文件的本地路径 +localfile = r'E:/Leeing/python/python/show-me-code/_assets/images/weixin_avatar1.png' +ret, info = put_file(token, key, localfile) +print(info) + +assert ret['key'] == key +assert ret['hash'] == etag(localfile) \ No newline at end of file diff --git a/show-me-code/show_me_the_code@2/test.py b/show-me-code/show_me_the_code@2/test.py new file mode 100644 index 0000000..7b11b2c --- /dev/null +++ b/show-me-code/show_me_the_code@2/test.py @@ -0,0 +1,44 @@ +#!/usr/bin/python +# -*- coding: UTF-8 -*- +ANGRY_ASCII =""" + .-''''''-. + .' _ _ '. + / O O \\ + : : + | | + : __ : + \ .-"` `"-. / + '. .' + '-......-' + YOU SHOULDN'T BE HERE +""" + +from enum import Enum + +class EnumUserType(Enum): + admin = 'leeing' + common = 2 + red = 1 + green = 2 + blue = 3 + white = 3 + yellow = 8 + +def foo(*args): + print(EnumUserType['red']) + print(EnumUserType['white']) + print('*'*10) + print(EnumUserType(8)) + print(EnumUserType['admin']) + print(EnumUserType('leeing')) + print(EnumUserType['white'].name) + print(EnumUserType['white'].value) + for item in EnumUserType: + print(item.name, item.value) + +def main(): + foo() + # foo([('val1', 5), ('val2', 0.3), ('val3', 1)]) + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/show-me-code/show_me_the_code@2/test.txt b/show-me-code/show_me_the_code@2/test.txt new file mode 100644 index 0000000..bd3991d --- /dev/null +++ b/show-me-code/show_me_the_code@2/test.txt @@ -0,0 +1,14 @@ +#!/usr/bin/python +# -*- coding: UTF-8 -*- +ANGRY_ASCII =""" + .-''''''-. + .' _ _ '. + / O O \\ + : : + | | + : __ : + \ .-"` `"-. / + '. .' + '-......-' + YOU SHOULDN'T BE HERE +""" \ No newline at end of file diff --git a/show-me-code/show_me_the_code@2/use_decorate.py b/show-me-code/show_me_the_code@2/use_decorate.py new file mode 100644 index 0000000..df74293 --- /dev/null +++ b/show-me-code/show_me_the_code@2/use_decorate.py @@ -0,0 +1,89 @@ +# -*- coding:utf-8 -*- +""" +2 道极好的 Python 算法题 | 带你透彻理解装饰器的妙用 + +1.斐波那契数列 + +2.爬楼梯 + 比如我有7阶台阶,我们可以用两种爬发,一次一步或者两步,只能进不能退,算算有多少种爬法 +""" +def fib(n): + """斐波那契""" + if n == 0 or n == 1: + return 1 + else: + return fib(n-2) + fib(n-1) + +print([fib(n) for n in range(10)]) + +# 这里没有进行优化的情况下,打印n=40的时候需要 150s左右。所以我们考虑加一个缓存 cache + +def fibo(n, cache=None): # 为什么这里的cache不能直接设置为 {}。因为需要递归啊。会产生一个变量缓存不变的问题 + if cache is None: + cache = {} + if n in cache: + return cache[n] + if n is 0 or n is 1: + return 1 + else: + cache[n] = fibo(n-2, cache) + fibo(n-1, cache) + return cache[n] + +def fibonacci(n): + a, b = 0, 1 + while True and b < 100: + yield a # 这里使用 生成器函数,实现懒计算 + a, b = b, a + b + + +######################### 爬楼梯 ######################### +""" +若只有一阶台阶,那么不管是一次选择一步还是两步,都只有一种爬法 + +若只有两阶台阶,选择一步or两步,会有两种爬法 + +若只有三阶台阶,选择一步然后一步然后一步,或者一步,两步,或者两步,一步,这样有3种爬法 + +若只有四阶台阶,选择一步,然后剩下3阶台阶的爬法,这3阶爬法可以直接取前面3阶台阶的计算结果 +""" + +def climb(n, steps): + count = 0 + if n <= 1: + count = 1 + else: + for step in steps: + count += climb(n-step, steps) + return count + +print(climb(7, [1, 2])) + +# 此时不想再写一次 cache +# 使用 装饰器 的时候到了 + +def decorate(fn): + cache = {} + def wrap(*args): + if args not in cache: + cache[args] = fn(*args) # 很巧妙的使用 tuple 类型作为 dict 的键名 + return cache[args] + return wrap + +@decorate +def Fib(n): + if n == 0 or n == 1: + return 1 + else: + return Fib(n-2) + Fib(n-1) + +@decorate +def Climb(n, steps): + count = 0 + if n <= 1: + count = 1 + else: + for step in steps: + count += Climb(n-step, steps) + return count + +print(Climb(7, (1,2))) # 注意,这里调用时传参发生了变化,不能使用 list 的形式了,只能用 tuple 的形式 \ No newline at end of file