Example #1
0
    def toObj(self):
        account = {
            "id": self.myId,
            "name": self.name,
            "address": self.address,
            "hostname": self.hostname,
            "lastSync": getStrTime(self.lastSync),
            "createTime": getStrTime(self.createTime),
        }

        return account
Example #2
0
	def toObj(self):
		obj = {
			"id": self.myId,
			"group": self.group,
			"message": self.messageCapacity,
			"robot": self.robots,
			"lastSync": getStrTime(self.lastSync),
			"createTime": getStrTime(self.createTime),
		}

		return obj
Example #3
0
    def toObj(self):

        return {
            "id": self.myId,
            "user": self.username,
            "userId": self.userId,
            "userRole": self.role,
            "cookie": self.cookie,
            "creatTime": getStrTime(self.createTime),
            "expireTime": getStrTime(self.expireTime)
        }
Example #4
0
    def toObj(self):
        item = {
            "id": self.myId,
            "name": self.name,
            "type": self.type,
            "typeName": self.typeName,
            "state": self.state,
            "infoObj": self.infoObj,
            "desc": self.desc,
            "lastSync": getStrTime(self.lastSync),
            "createTime": getStrTime(self.createTime),
        }

        return item
Example #5
0
 def toObj(self):
     return {
         "id": self.myId,
         "api": self.apiId,
         "state": self.state,
         "type": self.type,
         "user": self.user,
         "name": self.name,
         "request": self.request,
         "reply": self.reply,
         "hashValue": CRC32(self.myId + self.state),
         "startTime": getStrTime(self.startTime),
         "finishTime": getStrTime(self.finishTime)
     }
Example #6
0
 def simpleObj(self):
     return {
         "id": self.myId,
         "api": self.apiId,
         "state": self.state,
         "type": self.type,
         "startTime": getStrTime(self.startTime),
     }
Example #7
0
File: Msg.py Project: maqg/quantum
    def toObj(self):
        obj = {
            "type": self.type,
            "msg": self.msg,
            "agentId": self.agentId,
            "time": getStrTime(self.time)
        }

        return obj
Example #8
0
	def toObj(self):
		account = {
			"id": self.myId,
			"name": self.name,
			"email": self.email,
			"phone": self.phone,
			"state": self.state,
			"lastLogin": howLongAgo(self.lastLogin),
			"lastSync": getStrTime(self.lastSync),
			"createTime": getStrTime(self.createTime),
			"ukey": self.ukey,
			"ldapUid": self.ldapUid,
			"desc": self.desc,
			"role": self.role,
			"roleCN": self.roleCN,
			"stateCN": self.stateCN
		}
		
		return account
Example #9
0
    def toObj(self):
        account = {
            "id": self.myId,
            "name": self.name,
            "email": self.email,
            "phone": self.phone,
            "state": self.state,
            "lastLogin": howLongAgo(self.lastLogin),
            "lastSync": getStrTime(self.lastSync),
            "createTime": getStrTime(self.createTime),
            "role": self.role,
            "roleCN": self.roleCN,
            "stateCN": self.stateCN,
            "quotaId": self.quotaId
        }

        if self.quota:
            account["quota"] = self.quota.toObj()

        return account
Example #10
0
    def toObj(self):
        obj = {
            "id": self.myId,
            "name": self.name,
            "state": self.state,
            "stateCN": self.stateCN,
            "uId": self.uId,
            "uName": self.uName,
            "lastLogin": howLongAgo(self.lastLogin) or "从未登录",
            "lastSync": getStrTime(self.lastSync) or "未修改",
            "createTime": getStrTime(self.createTime),
            "contacts": self.contacts,
            "groups": self.groups,
            "messages": self.messages,
        }

        if self.robot:
            obj["contactList"] = self.robot.contact_list
        else:
            obj["contactList"] = []

        return obj
Example #11
0
    def toObj(self):

        item = {
            "id": self.myId,
            "name": self.name,
            "type": self.type,
            "price": self.price,
            "points": self.points,
            "typeCN": PRICING_TYPES[self.type]["name"],
            "info": self.info,
            "desc": self.desc,
            "paras": self.paras,
            "createTime": getStrTime(self.createTime),
        }

        return item
Example #12
0
def get_sys_info():
	sysinfo = {
		"os": platform.system() + " Debian " + get_debian_version(),
		"kernel": get_kernel_info(),
		"cmdline": get_cmdline(),
		"maxOpenFiles": get_max_open_files(),
		"maxUserProcesses": get_max_processes(),
		"hostname": platform.node()
	}

	uptime = get_uptime()
	if not uptime:
		ERROR("got uptime error")
		return sysinfo

	sysinfo["upTime"] = "%d 天 %d 时 %d 分 %d 秒" % (uptime["day"],
			uptime["hour"], uptime["minute"], uptime["second"])
	sysinfo["freeRate"] = uptime["freeRate"]

	rebootTime = get_current_time() - uptime["seconds"] * 1000
	sysinfo["lastRebootTime"] = getStrTime(rebootTime)

	return sysinfo