提交 d3471839 编写于 作者: Huan (李卓桓)'s avatar Huan (李卓桓)

code clean up

上级 21d5a27f
......@@ -47,6 +47,8 @@ class PuppetWeb extends Puppet {
this.userId = null // user id
this.user = null // <Contact> of user self
this.on('watchdog', Watchdog.onFeed.bind(this))
}
toString() { return `Class PuppetWeb({browser:${this.browser},port:${this.port}})` }
......@@ -56,8 +58,6 @@ class PuppetWeb extends Puppet {
this.readyState('connecting')
this.on('watchdog', Watchdog.onFeed.bind(this))
return co.call(this, function* () {
this.port = yield UtilLib.getPort(Config.DEFAULT_PUPPET_PORT)
......@@ -75,7 +75,6 @@ class PuppetWeb extends Puppet {
this.bridge = yield this.initBridge()
log.verbose('PuppetWeb', 'initBridge() done')
// this.watchDog('inited') // start watchdog
this.emit('watchdog', { data: 'inited' })
})
.catch(e => { // Reject
......@@ -317,12 +316,12 @@ class PuppetWeb extends Puppet {
}
}
Object.assign(PuppetWeb, {
default: PuppetWeb
, PuppetWeb
, Server
, Browser
, Bridge
})
// Object.assign(PuppetWeb, {
// default: PuppetWeb
// , PuppetWeb
// , Server
// , Browser
// , Bridge
// })
module.exports = PuppetWeb
module.exports = PuppetWeb.default = PuppetWeb.PuppetWeb = PuppetWeb
......@@ -9,16 +9,14 @@
*
*/
const EventEmitter = require('events')
const path = require('path')
const co = require('co')
const fs = require('fs')
const path = require('path')
const log = require('./brolog-env')
const UtilLib = require('./util-lib')
const PuppetWeb = require('./puppet-web')
const UtilLib = require('./util-lib')
const Config = require('./config')
const log = require('./brolog-env')
class Wechaty extends EventEmitter {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册