# cython:language_level=3
# python 3.7.9
# from m1001CloudServerUDP import *
# from mwgHtmlFile import *#
# 2022-05-31 18:27:32 不能优化...
from __future__ import print_function
if 82 - 82: Iii1i
if 87 - 87: Ii % i1i1i1111I . Oo / OooOoo * I1Ii1I1 - I1I
if 81 - 81: i1 + ooOOO / oOo0O00 * i1iiIII111 * IiIIii11Ii
if 84 - 84: ooo000 - Ooo0Ooo + iI1iII1I1I1i . IIiIIiIi11I1
if 98 - 98: I11iiIi11i1I % oOO
if 31 - 31: i1I
import os
import sys
import socket
import binascii
import time
import datetime
import struct
import configparser
from twisted . internet . threads import deferToThread
from collections import deque
if 9 - 9: IiI11Ii111 / oOo0O00 / IiIIii11Ii - I11iiIi11i1I - iI1iII1I1I1i
from twisted . internet . protocol import DatagramProtocol
from twisted . internet import reactor
if 16 - 16: i1i1i1111I / i1iiIII111
if 3 - 3: i1 % i1 % i1i1i1111I . Ii * i1
from . m1005rsacls import WGRsa
from . m1007tcpcli import clearFaceLog
from . wgpacket import WGPacket , WGControllerinfo , WGSwipeRecord , WGTools , WGCommand , tdz
from . sm4 import CryptSM4 , SM4_ENCRYPT , SM4_DECRYPT
import subprocess
if 9 - 9: i1iiIII111
if 10 - 10: ooOOO / IIiIIiIi11I1 * oOO / i1I / i1I
from twisted . web . server import Site , NOT_DONE_YET
from twisted . web . resource import Resource
from twisted . internet import endpoints
if 61 - 61: Ooo0Ooo - I1I
from twisted . internet . task import deferLater
from twisted . internet import task
if 13 - 13: Ooo0Ooo
import json
from operator import itemgetter
if 46 - 46: iI1iII1I1I1i - Ii * Oo * Ii
from . wgpacket import WGPacket , WGControllerinfo , WGSwipeRecord , WGTools , WGCommand , WGSwipeRecord24Byte , wgGlobal
from . mMonitorInfo import wgcontrollerDoorStatus , mMonitorInfo
from . wgpacket import WGSwipeRecord16PrimByte
if 52 - 52: Oo + I1I / oOO / OooOoo - I1Ii1I1 - ooOOO
if 60 - 60: iI1iII1I1I1i . oOO
if 13 - 13: oOO
if 2 - 2: i1
if 22 - 22: IIiIIiIi11I1 - ooo000 / I1Ii1I1 . ooo000
if 1 - 1: iI1iII1I1I1i + Ooo0Ooo + oOO * IIiIIiIi11I1
if 20 - 20: I1I + Ii
from . wgAppConfig import wgAppConfig
if 75 - 75: Ii % i1iiIII111 * Ii . IIiIIiIi11I1 % I11iiIi11i1I % I1Ii1I1
from tinydb import TinyDB , Query
if 8 - 8: I1Ii1I1 . IiI11Ii111 . i1 . Oo - i1I
from . m1006OptimizePrivilege import wgOptimizePrivilege
import re
import copy
if 32 - 32: Ii % i1i1i1111I % i1I - I11iiIi11i1I % i1iiIII111
if 34 - 34: i1iiIII111 * i1
if 34 - 34: oOo0O00 / i1iiIII111 - Iii1i . iI1iII1I1I1i
if 80 - 80: i1i1i1111I . I1I % ooOOO % IiIIii11Ii / i1i1i1111I
if 32 - 32: I1Ii1I1 + oOO - oOo0O00
if 79 - 79: Iii1i % oOO * Oo + ooOOO / Oo . oOO
if 20 - 20: IiI11Ii111 + i1iiIII111 / I1I
if 88 - 88: I11iiIi11i1I + ooOOO - i1i1i1111I . Ooo0Ooo * Ii + Iii1i
if 43 - 43: ooOOO * I1Ii1I1
if 95 - 95: Ooo0Ooo % Iii1i % i1i1i1111I . OooOoo
if 70 - 70: IiIIii11Ii
if 75 - 75: Ooo0Ooo / Ii / IiIIii11Ii + IiIIii11Ii . I1I
if 88 - 88: Oo * IiIIii11Ii
if 100 - 100: IiI11Ii111 - OooOoo * I1Ii1I1 / Ooo0Ooo / Iii1i
if 23 - 23: Ooo0Ooo + i1 * I1Ii1I1 + Oo * Ii - IIiIIiIi11I1
if 29 - 29: IiIIii11Ii - oOo0O00
if 30 - 30: I1I . ooo000
if 43 - 43: ooOOO . I11iiIi11i1I + ooo000
if 87 - 87: Iii1i + ooOOO . i1I / Ii + Oo
if 77 - 77: i1iiIII111 + IiI11Ii111 - Oo % ooo000
if 74 - 74: Ii + Ooo0Ooo
if 1 - 1: I1I % Ooo0Ooo + i1iiIII111 . i1iiIII111 % Oo
if 93 - 93: oOo0O00 % Ooo0Ooo * i1iiIII111
if 52 - 52: oOO + I1I / ooo000 - I1Ii1I1 * i1I % oOo0O00
if 52 - 52: oOo0O00 . I1I + i1I - i1iiIII111 % iI1iII1I1I1i
if 57 - 57: I1I * IIiIIiIi11I1 % I1Ii1I1 * i1i1i1111I
if 37 - 37: IiI11Ii111 * i1i1i1111I + oOo0O00 / I1I / OooOoo
if 4 - 4: i1
if 61 - 61: iI1iII1I1I1i . i1I - ooo000 / ooo000 - i1
if 19 - 19: Iii1i * Ooo0Ooo . I1Ii1I1 / I11iiIi11i1I * Ii - oOO
class xid4webapi ( object ) :
 def __init__ ( self , oldxid , sender ) :
  self . xid = oldxid
  self . sender = sender
  self . currentTime = time . time ( )
  if 32 - 32: iI1iII1I1I1i
  if 18 - 18: I11iiIi11i1I * IiI11Ii111 % iI1iII1I1I1i + IiI11Ii111
class wgConRPCCommon ( DatagramProtocol ) :
 if 93 - 93: oOO - I1Ii1I1 - IIiIIiIi11I1 * ooOOO - i1
 _Global_xid = 0
 _xid = 0
 if 82 - 82: IIiIIiIi11I1 % i1 * ooOOO
 if 57 - 57: oOo0O00
 if 31 - 31: i1iiIII111 + i1i1i1111I % OooOoo
 if 20 - 20: OooOoo - I1I
 if 9 - 9: i1iiIII111 - iI1iII1I1I1i % Ii - I1I
 if 54 - 54: Iii1i % ooo000 % Iii1i - IiIIii11Ii
 def __init__ ( self ) :
  self . dictXid = dict ( )
  if 39 - 39: oOO - oOO * i1 % IIiIIiIi11I1
 def getNewXid ( self ) :
  wgConRPCCommon . _Global_xid = wgConRPCCommon . _Global_xid + 1
  if ( wgConRPCCommon . _Global_xid >= 0x4fffffff ) or ( wgConRPCCommon . _Global_xid < 0x40000001 ) :
   wgConRPCCommon . _Global_xid = 0x40000001
  self . _xid = wgConRPCCommon . _Global_xid
  return self . _xid
  if 29 - 29: IIiIIiIi11I1 - ooo000 . i1iiIII111
 def startProtocol ( self ) :
  pass
  if 86 - 86: I1Ii1I1 - OooOoo - oOO % ooo000 . i1I % Iii1i
 def run ( self , commandbytes , sender ) :
  if self . transport is None :
   return
  IIii = WGTools . getLongByByte ( commandbytes , 40 , 4 )
  OoOOOOO = self . getNewXid ( )
  OOo = OoOOOOO
  I1i1i = list ( commandbytes )
  for ii1ii in ( 40 , 41 , 42 , 43 ) :
   I1i1i [ ii1ii ] = OoOOOOO & 0xff
   OoOOOOO = OoOOOOO >> 8
  Ii1iI1IIi111 = xid4webapi ( IIii , sender )
  if 92 - 92: I1Ii1I1
  self . dictXid [ OOo ] = Ii1iI1IIi111
  if 40 - 40: i1I
  if 4 - 4: ooo000 % I1I - i1i1i1111I
  if wgGlobal . allowprint :
   iI11i1iI1I1Ii = [ '%02X' % i for i in I1i1i ]
   wgAppConfig . logdebug ( "--HTTP Send 61005  DataLen=%d HexData: %s" % ( len ( I1i1i ) , " " . join ( iI11i1iI1I1Ii ) ) )
  if wgGlobal . dataserverIP == "0.0.0.0" :
   self . transport . write ( bytes ( I1i1i ) , ( "127.0.0.1" , wgGlobal . dataserverPort ) )
  else :
   self . transport . write ( bytes ( I1i1i ) , ( wgGlobal . dataserverIP , wgGlobal . dataserverPort ) )
   if 65 - 65: Iii1i + IIiIIiIi11I1 - Ooo0Ooo . iI1iII1I1I1i + OooOoo * Ooo0Ooo
  if self . dictXid . __len__ ( ) > 100 :
   if 23 - 23: ooOOO % oOO % iI1iII1I1I1i - i1I - i1iiIII111 + i1
   IiI111IIi = self . dictXid . keys ( )
   OOoO = time . time ( )
   if 34 - 34: IiI11Ii111 + ooOOO * oOO
   if 2 - 2: i1i1i1111I / Ooo0Ooo / oOO - IIiIIiIi11I1 / IIiIIiIi11I1
   for ii1ii in list ( IiI111IIi ) :
    Ii1iI1IIi111 = self . dictXid . get ( ii1ii )
    if OOoO > Ii1iI1IIi111 . currentTime + 3 :
     self . dictXid . pop ( ii1ii , None )
     if 58 - 58: i1i1i1111I
     if 38 - 38: i1 - oOo0O00
     if 85 - 85: IIiIIiIi11I1 + I11iiIi11i1I % Ooo0Ooo + oOO * i1iiIII111
 cmdWithResponseLocbyte8 = [ 0x40 ,
 0x50 ,
 0x52 ,
 0x54 ,
 0x56 ,
 0xB2 ,
 0x8a , 0x88 ,
 0xcc ,
 0x8e ,
 0x24 ,
 0
 ]
 if 46 - 46: ooOOO - ooOOO + Oo / I1I * Oo + oOO
 def datagramReceived ( self , data , addr ) :
  if len ( data ) % 64 == 0 :
   i1II1 = WGPacket ( data , addr )
   if wgGlobal . allowprint :
    iI11i1iI1I1Ii = [ '%02X' % i for i in data ]
    wgAppConfig . logdebug ( "**HTTP Receive 61005  DataLen=%d HexData: %s" % ( len ( data ) , " " . join ( iI11i1iI1I1Ii ) ) )
   Ii1iI1IIi111 = self . dictXid . get ( i1II1 . sid )
   if Ii1iI1IIi111 is not None :
    OoOOOOO = Ii1iI1IIi111 . xid
    oOoOo = Ii1iI1IIi111 . sender
    oOoOo . runticks = time . time ( )
    if i1II1 . controllerSN == 0 :
     if 39 - 39: oOO
     oOoOo . runStatus = 2
    elif OoOOOOO == oOoOo . xid :
     if 17 - 17: Ii . oOo0O00 % OooOoo
     o0 = 0
     if i1II1 . cmdtype == 0 :
      if 37 - 37: iI1iII1I1I1i - I1Ii1I1 + ooOOO . IIiIIiIi11I1
      pass
     elif i1II1 . functionID in self . cmdWithResponseLocbyte8 :
      if data [ 8 ] == 1 :
       o0 = 0
      else :
       o0 = 1
     self . dictXid . pop ( i1II1 . sid , None )
     oOoOo . recv = data
     oOoOo . runStatus = o0
   del i1II1
   if 15 - 15: ooo000
   if 63 - 63: i1I
   if 81 - 81: OooOoo . i1I / i1i1i1111I + Oo / Ooo0Ooo % IiI11Ii111
class wgConRPC ( object ) :
 runStatus = - 1
 _Global_xid = 0
 _xid = 0
 recv = None
 if 77 - 77: I11iiIi11i1I / iI1iII1I1I1i - oOo0O00 - Ooo0Ooo % oOo0O00
 if 73 - 73: IiI11Ii111 . Oo * I1I / i1i1i1111I + I1Ii1I1
 if 31 - 31: i1i1i1111I % I1Ii1I1
 if 1 - 1: IiI11Ii111 - oOo0O00 - i1 . oOo0O00
 if 91 - 91: iI1iII1I1I1i * i1 . ooOOO
 def __init__ ( self ) :
  self . xid = None
  self . runticks = time . time ( )
  self . closed = False
  if 81 - 81: I1I * Oo - i1 % OooOoo * ooOOO
 def getNewXid ( self ) :
  wgConRPC . _Global_xid = wgConRPC . _Global_xid + 1
  if ( wgConRPC . _Global_xid >= 0x4fffffff ) or ( wgConRPC . _Global_xid < 0x40000001 ) :
   wgConRPC . _Global_xid = 0x40000001
  self . _xid = wgConRPC . _Global_xid
  self . xid = self . _xid
  return self . _xid
  if 19 - 19: Ii
  if 22 - 22: i1I % iI1iII1I1I1i + Oo
 def run ( self , command ) :
  self . runStatus = - 1
  oOoOo = self
  mMonitorInfo . wgConRPCCommonWebapi . run ( command , oOoOo )
  if 60 - 60: ooo000 + I11iiIi11i1I + IIiIIiIi11I1 % i1i1i1111I - Ii % Ooo0Ooo
  if 95 - 95: ooOOO % i1i1i1111I . i1
class wgCommStatus ( object ) :
 if 87 - 87: Iii1i % ooOOO * Ii % IIiIIiIi11I1 / I11iiIi11i1I
 tryMaxTimesCount = wgGlobal . commTimeout10ms
 tryResendCount = 0
 lastCommandByte = None
 privilegesAll = None
 privilegesSentIndex = 0
 errMessage = None
 cardbyte8 = False
 totalPrivilege = 0
 totalPrivilege2024err512 = 0
 sentPrivilegeIndex = 0
 getAllSwipeStep = 0
 recordIndexGot4GetSwipe = - 1
 recordlastSwipeIndex = - 1
 recordfirstSwipeIndex = - 1
 recordCount = 0
 recordList = [ ]
 responseStop = False
 loginOK = False
 if 84 - 84: I1Ii1I1 + Ooo0Ooo % IIiIIiIi11I1 * i1i1i1111I
 comm = None
 port1 = None
 createTime = time . time ( )
 deactivateTime = time . time ( ) + 5 * 60
 wgpacketList4Monitor = [ ]
 wgpacketList4MonitorQR = [ ]
 if 61 - 61: i1iiIII111 - Oo + I1Ii1I1
 if 43 - 43: IIiIIiIi11I1 * ooo000 + Ii % iI1iII1I1I1i
 paramsIndex = 0
 paramsCmd = None
 if 12 - 12: i1iiIII111 + ooo000 . I11iiIi11i1I
 paramsResultOK = [ ]
 paramsResultFailed = [ ]
 paramsResultNotConnected = [ ]
 paramsResultDetail = [ ]
 if 1 - 1: iI1iII1I1I1i % Ii - I11iiIi11i1I / IiI11Ii111 + iI1iII1I1I1i - Ii
 indexOfPrivilege = 0
 receviedSwipeIndex = - 1
 command63string = None
 receviedPrivilegesValidIndex = 0
 PrivilegeNum = 0
 if 27 - 27: OooOoo % iI1iII1I1I1i + IIiIIiIi11I1
 arrFloors4remoteopen = [ ]
 vcard4remoteopen = 0
 if 16 - 16: IiI11Ii111
 uart485mode = 0
 if 31 - 31: oOo0O00 / Iii1i % Ooo0Ooo % i1 . iI1iII1I1I1i . Oo
 def reset ( self ) :
  self . paramsIndex = 0
  self . paramsCmd = None
  self . paramsResultOK = [ ]
  self . paramsResultFailed = [ ]
  self . paramsResultNotConnected = [ ]
  self . paramsResultDetail = [ ]
  if 83 - 83: oOo0O00 - I11iiIi11i1I
  if 91 - 91: IIiIIiIi11I1 - i1 - iI1iII1I1I1i
  if 71 - 71: I1I - IiI11Ii111
  if 66 - 66: i1i1i1111I / Ooo0Ooo + I11iiIi11i1I + Iii1i + oOo0O00 + i1I
  if 75 - 75: OooOoo - oOO - IiIIii11Ii - oOO + ooo000 % iI1iII1I1I1i
  if 42 - 42: i1 * i1I
  if 50 - 50: Ii - i1iiIII111
  if 96 - 96: ooo000 * OooOoo - Ii - OooOoo
def getcontrolsegCommand ( wgCommStatusVal ) :
 if wgCommStatusVal . comm is None :
  wgCommStatusVal . comm = wgConRPC ( )
 OoOOOOO = wgCommStatusVal . comm . getNewXid ( )
 oo0Oo0oO0 = None
 if ( wgCommStatusVal . method == 'UploadAllTimeProfiles' ) :
  if wgCommStatusVal . indexOfcontrolseg == - 1 :
   if 20 - 20: IIiIIiIi11I1
   oo0Oo0oO0 = WGCommand . cmdclearAllcontrolseg64ByCloudServer ( wgCommStatusVal . conSN , OoOOOOO )
   wgCommStatusVal . indexOfcontrolseg = 0
   pass
  else :
   if 34 - 34: ooo000 % i1i1i1111I * i1iiIII111
   if 87 - 87: i1iiIII111 - IIiIIiIi11I1 * Ii % i1i1i1111I % i1
   if 81 - 81: i1 + i1i1i1111I * Oo - Oo * I1Ii1I1 - oOo0O00
   if 4 - 4: i1iiIII111
   if 8 - 8: IiIIii11Ii + OooOoo - i1
   if 68 - 68: I1Ii1I1 % I1Ii1I1 / IiI11Ii111 . ooo000
   if 80 - 80: IIiIIiIi11I1 / OooOoo % iI1iII1I1I1i / ooOOO * ooOOO - Iii1i
   if 60 - 60: oOO * i1i1i1111I / iI1iII1I1I1i
   if ( wgCommStatusVal . indexOfcontrolseg >= wgCommStatusVal . controlsegCount ) :
    if 45 - 45: Ooo0Ooo + ooOOO * oOo0O00 - ooo000 / IIiIIiIi11I1
    return None
   oo0Oo0oO0 = WGCommand . cmduploadAllcontrolseg64ByCloudServer ( wgCommStatusVal . conSN ,
 wgCommStatusVal . controlsegAll [
 wgCommStatusVal . indexOfcontrolseg + 0 ] ,
 OoOOOOO + 0 )
   wgCommStatusVal . indexOfcontrolseg = wgCommStatusVal . indexOfcontrolseg + 1
   if 14 - 14: i1I - IiIIii11Ii
 if wgCommStatusVal . method == 'ClearTimeProfiles' :
  oo0Oo0oO0 = WGCommand . cmdclearAllcontrolseg64ByCloudServer ( wgCommStatusVal . conSN , OoOOOOO )
  wgCommStatusVal . indexOfcontrolseg = 0
 return oo0Oo0oO0
 if 74 - 74: oOo0O00 * ooo000 . ooOOO
 if 2 - 2: Ii * IIiIIiIi11I1 % i1 + IiIIii11Ii % i1
def gettasklistCommand ( wgCommStatusVal ) :
 if wgCommStatusVal . comm is None :
  wgCommStatusVal . comm = wgConRPC ( )
 OoOOOOO = wgCommStatusVal . comm . getNewXid ( )
 oo0Oo0oO0 = None
 if wgCommStatusVal . method == 'UploadAllScheduledTasks' :
  if wgCommStatusVal . indexOftasklist == - 1 :
   if 82 - 82: ooOOO % OooOoo
   oo0Oo0oO0 = WGCommand . cmdcleartasklist64ByCloudServer ( wgCommStatusVal . conSN , OoOOOOO )
   wgCommStatusVal . indexOftasklist = 0
   pass
  elif wgCommStatusVal . indexOftasklist == wgCommStatusVal . tasklistCount :
   oo0Oo0oO0 = WGCommand . cmdrefreshtasklist64ByCloudServer ( wgCommStatusVal . conSN , OoOOOOO )
   wgCommStatusVal . indexOftasklist = wgCommStatusVal . indexOftasklist + 1
  else :
   if 81 - 81: Ii
   if wgCommStatusVal . indexOftasklist >= wgCommStatusVal . tasklistCount :
    if 40 - 40: i1I . OooOoo + oOo0O00 . i1iiIII111
    return None
   oo0Oo0oO0 = WGCommand . cmduploadAlltasklist64ByCloudServer ( wgCommStatusVal . conSN ,
 wgCommStatusVal . tasklistAll [
 wgCommStatusVal . indexOftasklist + 0 ] ,
 OoOOOOO + 0 )
   wgCommStatusVal . indexOftasklist = wgCommStatusVal . indexOftasklist + 1
   if 96 - 96: I1I / oOO / I11iiIi11i1I + I11iiIi11i1I
   if 35 - 35: IIiIIiIi11I1 + oOo0O00
   if 96 - 96: iI1iII1I1I1i . OooOoo . i1
   if 87 - 87: ooo000 * IiIIii11Ii % ooo000 . ooOOO . Oo % iI1iII1I1I1i
 return oo0Oo0oO0
 if 48 - 48: ooOOO * ooo000 % IiIIii11Ii * i1 . Iii1i - IiI11Ii111
 if 72 - 72: i1 % i1i1i1111I * iI1iII1I1I1i
class wgDoorControllerWEBApi ( Resource ) :
 isLeaf = True
 dictControllersRecordIndex4Moinitor = dict ( )
 arrUsers = dict ( )
 if 90 - 90: Ooo0Ooo * OooOoo . Ii
 if 5 - 5: Oo - i1 . oOO
 if 18 - 18: IiIIii11Ii - oOO * i1I - OooOoo
 if 54 - 54: IIiIIiIi11I1 . Ooo0Ooo % Ii + IiIIii11Ii * iI1iII1I1I1i / iI1iII1I1I1i
 if 31 - 31: IiIIii11Ii . IiIIii11Ii % Ii
 if 51 - 51: Oo / i1i1i1111I - I1I
 if 83 - 83: Iii1i % i1iiIII111 . OooOoo / I1I % oOO . I1I
 if 76 - 76: i1iiIII111 / OooOoo
 if 77 - 77: ooOOO
 if 19 - 19: ooOOO % I1Ii1I1
 if 15 - 15: OooOoo . IiIIii11Ii . i1I / Iii1i + ooOOO / Ii
 if 17 - 17: I11iiIi11i1I - i1i1i1111I . iI1iII1I1I1i - I11iiIi11i1I + Oo % iI1iII1I1I1i
 if 65 - 65: Ii % I11iiIi11i1I
 if 39 - 39: Iii1i * IIiIIiIi11I1 . Ooo0Ooo - Oo
 if 63 - 63: i1i1i1111I - i1iiIII111 . OooOoo % OooOoo . IiI11Ii111 + i1I
 if 71 - 71: ooo000 + I11iiIi11i1I % iI1iII1I1I1i + IiI11Ii111 % Oo - Oo
 if 84 - 84: I1I % iI1iII1I1I1i - Ooo0Ooo / iI1iII1I1I1i + Ooo0Ooo - Oo
 if 41 - 41: ooOOO + OooOoo + IIiIIiIi11I1 * i1i1i1111I
 def __init__ ( self ) :
  super ( wgDoorControllerWEBApi , self ) . __init__ ( )
  self . taskMain = task . LoopingCall ( self . checkRunning )
  self . taskMain . start ( 30 , True )
  if 12 - 12: i1i1i1111I
 def checkRunning ( self ) :
  try :
   mMonitorInfo . checkoverrun ( )
   mMonitorInfo . checkAllControllersNotConnected ( )
   if not ( self . arrUsers is None ) :
    if len ( self . arrUsers ) > 0 :
     o0Oo0o000O0oO = time . time ( )
     if 46 - 46: Ii - IiI11Ii111 + IiIIii11Ii + i1I . I1I % OooOoo
     if 85 - 85: Oo / oOO + Oo + ooOOO
     if 74 - 74: oOO - IiI11Ii111
     if 79 - 79: oOO * IiI11Ii111 . ooOOO * I1Ii1I1 . oOo0O00 + i1iiIII111
     for ii1ii in list ( self . arrUsers . keys ( ) ) :
      if o0Oo0o000O0oO > self . arrUsers [ ii1ii ] . deactivateTime :
       self . arrUsers . pop ( ii1ii )
   wgOptimizePrivilege . work ( )
   mMonitorInfo . mqtt_tryconnect ( )
  except Exception as oo00 :
   if 52 - 52: OooOoo
   print ( oo00 )
   if 95 - 95: i1i1i1111I . I11iiIi11i1I * ooo000 / iI1iII1I1I1i - I1Ii1I1 + IiIIii11Ii
   if 40 - 40: i1I + i1i1i1111I % OooOoo . IiI11Ii111 / i1i1i1111I . ooOOO
 def checkCompressSend ( self , wgCommStatusVal ) :
  O0OOOo0oO = wgCommStatusVal . privilegesAll [ wgCommStatusVal . privilegesSentIndex ]
  o000O0 = 240
  if wgCommStatusVal . cardbyte8 :
   o000O0 = 120
  if o000O0 > wgCommStatusVal . totalPrivilege - wgCommStatusVal . privilegesSentIndex :
   o000O0 = wgCommStatusVal . totalPrivilege - wgCommStatusVal . privilegesSentIndex
  if o000O0 > wgCommStatusVal . cardCount :
   o000O0 = wgCommStatusVal . cardCount
  oO0oo = datetime . datetime . now ( )
  IiIII = len ( O0OOOo0oO )
  if 16 - 16: IIiIIiIi11I1
  for ii1ii in range ( 1 , o000O0 ) :
   oO00 = wgCommStatusVal . privilegesAll [ ii1ii ]
   if 30 - 30: IiIIii11Ii % ooo000 . Ii * Iii1i - iI1iII1I1I1i
   if 10 - 10: Ooo0Ooo % ooo000 % Ooo0Ooo
   if 38 - 38: ooo000
   if 3 - 3: IiI11Ii111 / IiIIii11Ii - i1i1i1111I
   if 56 - 56: i1
   if 56 - 56: I11iiIi11i1I - ooo000 . i1iiIII111 + i1iiIII111 / I1Ii1I1
   if 10 - 10: Oo * I11iiIi11i1I % IiIIii11Ii / OooOoo + i1
   if 14 - 14: I1I + I1Ii1I1
   if ( ( ( O0OOOo0oO [ 1 ] == oO00 [ 1 ] )
   or ( ( oO0oo >= O0OOOo0oO [ 1 ] ) and ( oO0oo >= oO00 [ 1 ] ) ) )
   # i1i1i1111I / IIiIIiIi11I1 / i1I - iI1iII1I1I1i % i1I
   and ( O0OOOo0oO [ 2 : IiIII ] == oO00 [ 2 : IiIII ] ) ) :
    if 83 - 83: i1iiIII111 % i1iiIII111 * iI1iII1I1I1i / IIiIIiIi11I1 . oOo0O00 - ooOOO
    pass
   else :
    return False
  return True
  if 76 - 76: IiIIii11Ii
  if 65 - 65: oOo0O00
 def getPrivilegeCommand ( self , wgCommStatusVal ) :
  if wgCommStatusVal . comm is None :
   wgCommStatusVal . comm = wgConRPC ( )
  OoOOOOO = wgCommStatusVal . comm . getNewXid ( )
  oo0Oo0oO0 = None
  if wgCommStatusVal . method == 'UploadAllPrivilegesByZip' :
   if wgCommStatusVal . cardbyte8 :
    oo0Oo0oO0 = WGCommand . cmduploadAllPriviege1024_Card8PostByCloudServer ( wgCommStatusVal . conSN ,
 wgCommStatusVal . privilegesAll ,
 wgCommStatusVal . cardCount ,
 wgCommStatusVal . indexOfPrivilege ,
 OoOOOOO ,
 wgCommStatusVal . totalPrivilege ,
 wgCommStatusVal . sentPrivilegeIndex )
    wgCommStatusVal . indexOfPrivilege = wgCommStatusVal . indexOfPrivilege + 120
   else :
    oo0Oo0oO0 = WGCommand . cmduploadAllPriviege1024_Card4PostByCloudServer ( wgCommStatusVal . conSN ,
 wgCommStatusVal . privilegesAll ,
 wgCommStatusVal . cardCount ,
 wgCommStatusVal . indexOfPrivilege ,
 OoOOOOO ,
 wgCommStatusVal . totalPrivilege ,
 wgCommStatusVal . sentPrivilegeIndex )
    wgCommStatusVal . indexOfPrivilege = wgCommStatusVal . indexOfPrivilege + 240
  if wgCommStatusVal . method == 'UploadAllPrivileges' :
   if self . checkCompressSend ( wgCommStatusVal ) :
    if wgCommStatusVal . cardbyte8 :
     oo0Oo0oO0 = WGCommand . cmduploadAllPriviege1024_Card8PostByCloudServer ( wgCommStatusVal . conSN ,
 wgCommStatusVal . privilegesAll ,
 wgCommStatusVal . cardCount ,
 wgCommStatusVal . indexOfPrivilege ,
 OoOOOOO ,
 wgCommStatusVal . totalPrivilege ,
 wgCommStatusVal . sentPrivilegeIndex )
     wgCommStatusVal . indexOfPrivilege = wgCommStatusVal . indexOfPrivilege + 120
    else :
     oo0Oo0oO0 = WGCommand . cmduploadAllPriviege1024_Card4PostByCloudServer ( wgCommStatusVal . conSN ,
 wgCommStatusVal . privilegesAll ,
 wgCommStatusVal . cardCount ,
 wgCommStatusVal . indexOfPrivilege ,
 OoOOOOO ,
 wgCommStatusVal . totalPrivilege ,
 wgCommStatusVal . sentPrivilegeIndex )
     wgCommStatusVal . indexOfPrivilege = wgCommStatusVal . indexOfPrivilege + 240
   else :
    oo0Oo0oO0 = WGCommand . cmduploadAllPriviege1024PostByCloudServer ( wgCommStatusVal . conSN ,
 wgCommStatusVal . privilegesAll ,
 wgCommStatusVal . cardCount ,
 wgCommStatusVal . indexOfPrivilege , OoOOOOO ,
 wgCommStatusVal . totalPrivilege ,
 wgCommStatusVal . sentPrivilegeIndex )
    wgCommStatusVal . indexOfPrivilege = wgCommStatusVal . indexOfPrivilege + 16
    if 60 - 60: Ii . oOo0O00 + i1i1i1111I . IiI11Ii111
  if wgCommStatusVal . method == 'AddEditPrivilege' :
   oo0Oo0oO0 = WGCommand . cmduploadPrivieges0x50ByCloudServer ( wgCommStatusVal . conSN ,
 wgCommStatusVal . privilegesAll ,
 wgCommStatusVal . cardCount ,
 wgCommStatusVal . indexOfPrivilege , OoOOOOO )
   wgCommStatusVal . indexOfPrivilege = wgCommStatusVal . indexOfPrivilege + 16
  if wgCommStatusVal . method == 'DeletePrivilege' :
   oo0Oo0oO0 = WGCommand . cmdDeletePriviegeByCloudServer ( wgCommStatusVal . conSN , wgCommStatusVal . privilegesAll ,
 wgCommStatusVal . cardCount ,
 wgCommStatusVal . indexOfPrivilege , OoOOOOO )
   wgCommStatusVal . indexOfPrivilege = wgCommStatusVal . indexOfPrivilege + 16
  return oo0Oo0oO0
  if 77 - 77: iI1iII1I1I1i - oOO % Ii * i1I - I1I
 def getHolidayConfigCommand ( self , wgCommStatusVal ) :
  if wgCommStatusVal . comm is None :
   wgCommStatusVal . comm = wgConRPC ( )
  OoOOOOO = wgCommStatusVal . comm . getNewXid ( )
  oo0Oo0oO0 = None
  if wgCommStatusVal . method == 'UploadHolidayControl' :
   if wgCommStatusVal . indexOfcontrolseg == - 1 :
    if 42 - 42: I11iiIi11i1I - Ii / Oo - i1i1i1111I + I11iiIi11i1I
    i1II1IIIII11 = b'17CC0000FFFFFFFFA5'
    oo0Oo0oO0 = WGCommand . cmdgetComm64X37 ( wgCommStatusVal . conSN , i1II1IIIII11 , OoOOOOO )
    wgCommStatusVal . indexOfcontrolseg = 0
    pass
   else :
    if wgCommStatusVal . indexOfcontrolseg >= wgCommStatusVal . controlsegCount :
     if 7 - 7: i1iiIII111 * i1iiIII111 . oOO . ooo000 * ooOOO + IiI11Ii111
     return None
    oo0Oo0oO0 = WGCommand . cmduploadAllHolidayConfig64ByCloudServer ( wgCommStatusVal . conSN ,
 wgCommStatusVal . controlsegAll [
 wgCommStatusVal . indexOfcontrolseg + 0 ] ,
 OoOOOOO + 0 )
    wgCommStatusVal . indexOfcontrolseg = wgCommStatusVal . indexOfcontrolseg + 1
    if 20 - 20: i1I . OooOoo * IiIIii11Ii
    if 40 - 40: ooo000 * IiI11Ii111 / i1i1i1111I * oOO + i1iiIII111 - OooOoo
    if 86 - 86: I11iiIi11i1I * Ooo0Ooo . IiIIii11Ii % IiIIii11Ii . I1Ii1I1 + I1I
    if 44 - 44: i1 / OooOoo / oOo0O00 . Oo
    if 65 - 65: I11iiIi11i1I * i1iiIII111 . OooOoo % ooo000 % OooOoo
    if 21 - 21: IiI11Ii111 * I1Ii1I1
    if 93 - 93: Ooo0Ooo . i1 + IiI11Ii111 - oOo0O00
   if wgCommStatusVal . holidaysNO > 0 :
    oo0Oo0oO0 [ 21 ] = wgCommStatusVal . holidaysNO
    if 97 - 97: i1 - i1 % IIiIIiIi11I1 + IiIIii11Ii / i1I * iI1iII1I1I1i
  return oo0Oo0oO0
  if 60 - 60: I11iiIi11i1I - Ooo0Ooo % I1Ii1I1
  if 26 - 26: ooOOO / IIiIIiIi11I1 . oOO + I11iiIi11i1I . Oo
 def dealGettingSwipe ( self , wgCommStatusVal ) :
  oOO0 = wgCommStatusVal . comm . recv
  wgCommStatusVal . recordIndexGot4GetSwipe = WGTools . getLongByByte ( oOO0 , 8 , 4 )
  IiI = False
  oo0Oo0oO0 = None
  if ( len ( oOO0 ) == 64 ) or ( len ( oOO0 ) == 1024 ) :
   for ii1ii in range ( 0 , 1 ) :
    ooO0OoOo = oOO0 [ 64 * ii1ii + 12 ]
    if ooO0OoOo == 0 :
     if 48 - 48: i1iiIII111 . Oo
     if 92 - 92: OooOoo + Ii / IIiIIiIi11I1 + OooOoo * IIiIIiIi11I1 * iI1iII1I1I1i
     if 79 - 79: i1i1i1111I
     if ( wgCommStatusVal . recordIndexGot4GetSwipe >= wgCommStatusVal . recordlastSwipeIndex ) or (
 wgCommStatusVal . recordIndexGot4GetSwipe == 0 ) :
      IiI = True
      return oo0Oo0oO0
     else :
      wgCommStatusVal . recordIndexGot4GetSwipe = WGTools . getLongByByte ( oOO0 , 64 * ii1ii + 8 ,
 4 )
      if 3 - 3: OooOoo / IiI11Ii111 % I11iiIi11i1I
     break
    if ooO0OoOo == 0xff :
     if wgCommStatusVal . recordIndexGot4GetSwipe > wgCommStatusVal . recordlastSwipeIndex or wgCommStatusVal . recordfirstSwipeIndex > wgCommStatusVal . recordIndexGot4GetSwipe :
      ooOooo = 0
      wgCommStatusVal . processStep = 1
      wgCommStatusVal . getAllSwipeStep = 1
      if 54 - 54: iI1iII1I1I1i % Oo . IiI11Ii111 - Iii1i % I11iiIi11i1I * i1I
      OoOOOOO = wgCommStatusVal . comm . getNewXid ( )
      oo0Oo0oO0 = WGCommand . cmdgetrecord64ByCloudServer ( wgCommStatusVal . conSN , 0 ,
 OoOOOOO )
      if 31 - 31: oOo0O00 / Iii1i - IiIIii11Ii % i1I / I1Ii1I1 - i1i1i1111I
      return oo0Oo0oO0
     break
    wgCommStatusVal . recordCount = wgCommStatusVal . recordCount + 1
    wgCommStatusVal . recordList . append ( WGSwipeRecord ( oOO0 [ 64 * ii1ii : 64 * ii1ii + 63 ] ) . getDescriptionJSON ( ) )
    wgCommStatusVal . recordIndexGot4GetSwipe = WGTools . getLongByByte ( oOO0 , 64 * ii1ii + 8 , 4 )
    if len ( oOO0 ) == 64 :
     break
   if ( ( wgCommStatusVal . getSwipeMaxlen > 0 ) and (
 wgCommStatusVal . recordCount >= wgCommStatusVal . getSwipeMaxlen ) ) :
    IiI = True
    if 68 - 68: I11iiIi11i1I . I11iiIi11i1I % I11iiIi11i1I
   elif len ( oOO0 ) == 1024 :
    if wgGlobal . supportNXP4G :
     for ii1ii in range ( 0 , 60 - 1 ) :
      if 71 - 71: ooo000
      oOOO0oOoOo00 = WGSwipeRecord16PrimByte ( oOO0 , 64 + 4 + 16 * ii1ii , ii1ii )
      ooO0OoOo = oOOO0oOoOo00 . recordType
      if ooO0OoOo == 0 :
       if 81 - 81: i1I
       if 95 - 95: Ii / oOO + i1iiIII111
       if 83 - 83: iI1iII1I1I1i * IIiIIiIi11I1
       if wgCommStatusVal . recordIndexGot4GetSwipe >= wgCommStatusVal . recordlastSwipeIndex :
        IiI = True
        if 81 - 81: i1i1i1111I / iI1iII1I1I1i
        break
       else :
        wgCommStatusVal . recordIndexGot4GetSwipe = wgCommStatusVal . recordIndexGot4GetSwipe + 1
        if 5 - 5: Ii / Ii / i1iiIII111
        continue
        if 40 - 40: oOO - ooOOO - I1I . IiIIii11Ii + Ii
      if ooO0OoOo == 0xff :
       if wgCommStatusVal . recordIndexGot4GetSwipe > wgCommStatusVal . recordlastSwipeIndex or wgCommStatusVal . recordfirstSwipeIndex > wgCommStatusVal . recordIndexGot4GetSwipe :
        IiI = True
        if 84 - 84: Oo + Ooo0Ooo + ooo000
        if 96 - 96: i1iiIII111 - IIiIIiIi11I1 / IIiIIiIi11I1 * IiIIii11Ii
        break
       else :
        wgCommStatusVal . recordIndexGot4GetSwipe = wgCommStatusVal . recordIndexGot4GetSwipe + 1
        if 67 - 67: Ooo0Ooo . Ooo0Ooo . IiI11Ii111
        continue
      wgCommStatusVal . recordCount = wgCommStatusVal . recordCount + 1
      wgCommStatusVal . recordList . append ( oOOO0oOoOo00 . getDescriptionJSON ( ) )
      wgCommStatusVal . recordIndexGot4GetSwipe = wgCommStatusVal . recordIndexGot4GetSwipe + 1
      if ( ( wgCommStatusVal . getSwipeMaxlen > 0 ) and (
 wgCommStatusVal . recordCount >= wgCommStatusVal . getSwipeMaxlen ) ) :
       IiI = True
       if 24 - 24: i1iiIII111 + i1i1i1111I . oOo0O00 + iI1iII1I1I1i + IiI11Ii111
       break
    else :
     if 92 - 92: iI1iII1I1I1i / iI1iII1I1I1i + IiIIii11Ii . IiI11Ii111
     for ii1ii in range ( 0 , 40 - 1 ) :
      ooO0OoOo = oOO0 [
 64 + 4 + 24 * ii1ii + 4 ]
      if ooO0OoOo == 0 :
       if 56 - 56: Ii * ooo000 . IiIIii11Ii
       if 66 - 66: I1Ii1I1 * OooOoo . iI1iII1I1I1i % OooOoo . i1 . IiIIii11Ii
       if 47 - 47: Ii % OooOoo % iI1iII1I1I1i * IiIIii11Ii
       if wgCommStatusVal . recordIndexGot4GetSwipe >= wgCommStatusVal . recordlastSwipeIndex :
        IiI = True
        if 48 - 48: i1I . I11iiIi11i1I / ooo000 + i1iiIII111
        break
       else :
        wgCommStatusVal . recordIndexGot4GetSwipe = wgCommStatusVal . recordIndexGot4GetSwipe + 1
        if 84 - 84: Oo / I1Ii1I1 . IIiIIiIi11I1
        continue
        if 67 - 67: Oo % ooOOO + iI1iII1I1I1i * I1I
      if ooO0OoOo == 0xff :
       if wgCommStatusVal . recordIndexGot4GetSwipe > wgCommStatusVal . recordlastSwipeIndex or wgCommStatusVal . recordfirstSwipeIndex > wgCommStatusVal . recordIndexGot4GetSwipe :
        IiI = True
        if 79 - 79: IIiIIiIi11I1 * Oo / OooOoo
        if 10 - 10: iI1iII1I1I1i / i1iiIII111 . IiIIii11Ii * i1i1i1111I
        break
       else :
        wgCommStatusVal . recordIndexGot4GetSwipe = wgCommStatusVal . recordIndexGot4GetSwipe + 1
        if 71 - 71: oOo0O00 + I1Ii1I1 / I11iiIi11i1I + Oo / I1I
        continue
      wgCommStatusVal . recordCount = wgCommStatusVal . recordCount + 1
      wgCommStatusVal . recordList . append (
 WGSwipeRecord24Byte ( oOO0 , 64 + 4 + 24 * ii1ii , ii1ii ) . getDescriptionJSON ( ) )
      wgCommStatusVal . recordIndexGot4GetSwipe = wgCommStatusVal . recordIndexGot4GetSwipe + 1
      if ( ( wgCommStatusVal . getSwipeMaxlen > 0 ) and (
 wgCommStatusVal . recordCount >= wgCommStatusVal . getSwipeMaxlen ) ) :
       IiI = True
       if 18 - 18: Iii1i - IiIIii11Ii
       break
  if IiI :
   if 71 - 71: iI1iII1I1I1i + OooOoo % i1i1i1111I % oOo0O00 . ooo000
   pass
  else :
   wgCommStatusVal . recordIndexGot4GetSwipe = wgCommStatusVal . recordIndexGot4GetSwipe + 1
   if 92 - 92: I11iiIi11i1I - Ooo0Ooo - i1i1i1111I % i1iiIII111 / i1i1i1111I * iI1iII1I1I1i
   OoOOOOO = wgCommStatusVal . comm . getNewXid ( )
   oo0Oo0oO0 = WGCommand . cmdgetrecord1024_Card8ByCloudServer ( wgCommStatusVal . conSN ,
 wgCommStatusVal . recordIndexGot4GetSwipe ,
 OoOOOOO )
  return oo0Oo0oO0
  if 60 - 60: IiIIii11Ii % oOO / i1I * OooOoo / I11iiIi11i1I - Ii
 def dealGettingSwipeWithTimeControl ( self ,
 wgCommStatusVal ) :
  oOO0 = wgCommStatusVal . comm . recv
  if wgCommStatusVal . getAllSwipeStep == 1 :
   if wgCommStatusVal . getRecordTimeControl > 0 :
    if wgCommStatusVal . getRecordGotLastIndex > 1 :
     wgCommStatusVal . getAllSwipeStep = 4
     OoOOOOO = wgCommStatusVal . comm . getNewXid ( )
     oo0Oo0oO0 = WGCommand . cmdgetrecord1024_Card8ByCloudServer ( wgCommStatusVal . conSN ,
 wgCommStatusVal . recordIndexGot4GetSwipe ,
 OoOOOOO )
     if 16 - 16: oOo0O00 / I1Ii1I1 / i1 + I11iiIi11i1I + oOo0O00
     if 11 - 11: oOO / OooOoo + oOo0O00
     if 79 - 79: I11iiIi11i1I . I1Ii1I1 * i1I % I1Ii1I1 / IiI11Ii111
     if 93 - 93: i1I + Iii1i . Ii . i1I * ooOOO
     if 84 - 84: Ooo0Ooo % IiI11Ii111
     return oo0Oo0oO0
     if 82 - 82: IIiIIiIi11I1
    Oo0OOOo0o = WGTools . getLongByByte ( oOO0 , 64 + 8 , 4 )
    IIIiI1iI = WGTools . getLongByByte ( oOO0 , 64 + 64 + 8 , 4 )
    OoO00oOo = WGTools . getLongByByte ( oOO0 , 64 + 64 + 64 + 8 , 4 )
    if IIIiI1iI < 1000 :
     if 60 - 60: ooOOO
     wgCommStatusVal . recordIndexGot4GetSwipe = Oo0OOOo0o
     pass
    else :
     oooO = WGSwipeRecord ( oOO0 [ 64 : 64 + 63 ] ) . getDescriptionJSON ( )
     wgAppConfig . wglog ( oooO )
     OoO00 = WGSwipeRecord ( oOO0 [ 64 * 2 : 64 * 2 + 63 ] ) . getDescriptionJSON ( )
     wgAppConfig . wglog ( OoO00 )
     wgCommStatusVal . getAllSwipeStep = 3
     if Oo0OOOo0o > 0 and datetime . datetime . strptime ( oooO [ "Time" ] ,
 "%Y-%m-%d %H:%M:%S" ) > wgCommStatusVal . dtpDeactivate :
      wgCommStatusVal . recordIndexGot4GetSwipe = IIIiI1iI
      if 41 - 41: IIiIIiIi11I1 / I11iiIi11i1I
     elif IIIiI1iI > 0 and datetime . datetime . strptime ( OoO00 [ "Time" ] ,
 "%Y-%m-%d %H:%M:%S" ) < wgCommStatusVal . dtpActivate :
      wgCommStatusVal . recordIndexGot4GetSwipe = IIIiI1iI
      if 60 - 60: IIiIIiIi11I1 + i1i1i1111I . I11iiIi11i1I - iI1iII1I1I1i
     else :
      wgCommStatusVal . getAllSwipeStep = 3
      OoOOOOO = wgCommStatusVal . comm . getNewXid ( )
      oo0Oo0oO0 = WGCommand . cmdgetrecord1024_64byteByCloudServer ( wgCommStatusVal . conSN ,
 Oo0OOOo0o , IIIiI1iI ,
 OoOOOOO )
      return oo0Oo0oO0
    wgCommStatusVal . getAllSwipeStep = 4
    if wgCommStatusVal . recordIndexGot4GetSwipe <= 0 :
     wgCommStatusVal . recordIndexGot4GetSwipe = Oo0OOOo0o
    OoOOOOO = wgCommStatusVal . comm . getNewXid ( )
    oo0Oo0oO0 = WGCommand . cmdgetrecord1024_Card8ByCloudServer ( wgCommStatusVal . conSN ,
 wgCommStatusVal . recordIndexGot4GetSwipe ,
 OoOOOOO )
    if 31 - 31: IiIIii11Ii % Ii
    if 7 - 7: IiI11Ii111 - IIiIIiIi11I1 * oOo0O00
    if 69 - 69: Oo
    if 56 - 56: IiIIii11Ii + ooo000
    return oo0Oo0oO0
  if wgCommStatusVal . getAllSwipeStep == 3 :
   if len ( oOO0 ) == 1024 :
    if 47 - 47: ooo000
    i1IiI1I = 0
    ooOO = 0
    for Oo00 in range ( 16 ) :
     oo = WGSwipeRecord ( oOO0 [ 64 * Oo00 : 64 * Oo00 + 63 ] ) . getDescriptionJSON ( )
     if 'Time' not in oo :
      break
      if 18 - 18: IIiIIiIi11I1 + iI1iII1I1I1i % IiI11Ii111 / OooOoo % IiI11Ii111 + i1iiIII111
     if datetime . datetime . strptime ( oo [ "Time" ] ,
 "%Y-%m-%d %H:%M:%S" ) <= wgCommStatusVal . dtpActivate :
      i1IiI1I = oo [ "RecordIndex" ]
     else :
      ooOO = oo [ "RecordIndex" ]
      break
    if i1IiI1I > 0 and ooOO - i1IiI1I > 1000 :
     wgCommStatusVal . getAllSwipeStep = 3
     OoOOOOO = wgCommStatusVal . comm . getNewXid ( )
     oo0Oo0oO0 = WGCommand . cmdgetrecord1024_64byteByCloudServer ( wgCommStatusVal . conSN ,
 i1IiI1I , ooOO ,
 OoOOOOO )
    else :
     wgCommStatusVal . recordIndexGot4GetSwipe = i1IiI1I
     if 21 - 21: oOo0O00 % i1iiIII111 % I11iiIi11i1I % oOO
     if 63 - 63: oOo0O00 % Iii1i - i1iiIII111 + Oo * i1I - oOo0O00
     wgCommStatusVal . getAllSwipeStep = 4
     OoOOOOO = wgCommStatusVal . comm . getNewXid ( )
     oo0Oo0oO0 = WGCommand . cmdgetrecord1024_Card8ByCloudServer ( wgCommStatusVal . conSN ,
 wgCommStatusVal . recordIndexGot4GetSwipe ,
 OoOOOOO )
    return oo0Oo0oO0
  if not wgCommStatusVal . getAllSwipeStep == 4 :
   return None
   if 93 - 93: Iii1i * IIiIIiIi11I1 % i1I + i1 % Ii * i1I
  wgCommStatusVal . recordIndexGot4GetSwipe = WGTools . getLongByByte ( oOO0 , 8 , 4 )
  IiI = False
  oo0Oo0oO0 = None
  if ( len ( oOO0 ) == 64 ) or ( len ( oOO0 ) == 1024 ) :
   for ii1ii in range ( 0 , 1 ) :
    ooO0OoOo = oOO0 [ 64 * ii1ii + 12 ]
    if ooO0OoOo == 0 :
     if 62 - 62: IiI11Ii111 % ooo000
     if 19 - 19: Ii / Oo % Iii1i / i1iiIII111 - OooOoo - Ooo0Ooo
     if ( wgCommStatusVal . recordIndexGot4GetSwipe >= wgCommStatusVal . recordlastSwipeIndex ) or (
 wgCommStatusVal . recordIndexGot4GetSwipe == 0 ) :
      IiI = True
      return oo0Oo0oO0
     else :
      wgCommStatusVal . recordIndexGot4GetSwipe = WGTools . getLongByByte ( oOO0 , 64 * ii1ii + 8 ,
 4 )
      if 89 - 89: I11iiIi11i1I - IiI11Ii111
     break
    if ooO0OoOo == 0xff :
     if 61 - 61: Ii * OooOoo * I1I % i1iiIII111 % IIiIIiIi11I1 * I11iiIi11i1I
     if 49 - 49: iI1iII1I1I1i / i1iiIII111 % oOO
     if 46 - 46: ooOOO * IIiIIiIi11I1 % i1 / oOO + i1 + oOo0O00
     if 99 - 99: I1I * IIiIIiIi11I1 * i1iiIII111
     if 62 - 62: ooOOO % Oo + i1I
     if 87 - 87: ooo000 - OooOoo + Ii + i1i1i1111I + IiIIii11Ii
     if 57 - 57: IIiIIiIi11I1 + I1I / ooOOO % ooOOO % Oo / IiI11Ii111
     if 95 - 95: i1 / I11iiIi11i1I . i1 / Oo . Ooo0Ooo
     if 43 - 43: Oo - OooOoo * oOO . Ooo0Ooo / IIiIIiIi11I1 * IIiIIiIi11I1
     if wgCommStatusVal . recordIndexGot4GetSwipe > wgCommStatusVal . recordlastSwipeIndex or wgCommStatusVal . recordfirstSwipeIndex > wgCommStatusVal . recordIndexGot4GetSwipe :
      ooOooo = 0
      wgCommStatusVal . processStep = 1
      wgCommStatusVal . getAllSwipeStep = 1
      if 84 - 84: i1iiIII111 + oOo0O00
      OoOOOOO = wgCommStatusVal . comm . getNewXid ( )
      oo0Oo0oO0 = WGCommand . cmdgetrecord64ByCloudServer ( wgCommStatusVal . conSN , 0 ,
 OoOOOOO )
      if 83 - 83: i1i1i1111I
      return oo0Oo0oO0
     break
    oo = WGSwipeRecord ( oOO0 [ 64 * ii1ii : 64 * ii1ii + 63 ] ) . getDescriptionJSON ( )
    if datetime . datetime . strptime ( oo [ "Time" ] ,
 "%Y-%m-%d %H:%M:%S" ) > wgCommStatusVal . dtpDeactivate :
     IiI = True
     break
    elif datetime . datetime . strptime ( oo [ "Time" ] ,
 "%Y-%m-%d %H:%M:%S" ) < wgCommStatusVal . dtpActivate :
     pass
    else :
     wgCommStatusVal . recordCount = wgCommStatusVal . recordCount + 1
     wgCommStatusVal . recordList . append ( oo )
    wgCommStatusVal . recordIndexGot4GetSwipe = WGTools . getLongByByte ( oOO0 , 64 * ii1ii + 8 , 4 )
    if len ( oOO0 ) == 64 :
     break
   if ( ( wgCommStatusVal . getSwipeMaxlen > 0 ) and (
 wgCommStatusVal . recordCount >= wgCommStatusVal . getSwipeMaxlen ) ) :
    IiI = True
    if 84 - 84: oOO / Ii * Ooo0Ooo / Ii / ooo000
   elif len ( oOO0 ) == 1024 :
    if wgGlobal . supportNXP4G > 0 :
     for ii1ii in range ( 0 , 60 - 1 ) :
      if 64 - 64: oOo0O00 * Ii
      oOOO0oOoOo00 = WGSwipeRecord16PrimByte ( oOO0 , 64 + 4 + 16 * ii1ii , ii1ii )
      ooO0OoOo = oOOO0oOoOo00 . recordType
      if ooO0OoOo == 0 :
       if 2 - 2: IiI11Ii111 % i1iiIII111 . oOo0O00
       if 59 - 59: I11iiIi11i1I % OooOoo - iI1iII1I1I1i % I1I + i1iiIII111 . I1Ii1I1
       if 94 - 94: ooOOO * I1Ii1I1 * i1iiIII111 . oOo0O00
       if wgCommStatusVal . recordIndexGot4GetSwipe >= wgCommStatusVal . recordlastSwipeIndex :
        IiI = True
        if 73 - 73: I1Ii1I1 / ooo000 % I11iiIi11i1I - i1i1i1111I + Oo - I1Ii1I1
        break
       else :
        wgCommStatusVal . recordIndexGot4GetSwipe = wgCommStatusVal . recordIndexGot4GetSwipe + 1
        if 18 - 18: i1 + ooOOO . i1 - iI1iII1I1I1i
        continue
        if 97 - 97: oOo0O00 + i1I % Iii1i
      if ooO0OoOo == 0xff :
       if wgCommStatusVal . recordIndexGot4GetSwipe > wgCommStatusVal . recordlastSwipeIndex or wgCommStatusVal . recordfirstSwipeIndex > wgCommStatusVal . recordIndexGot4GetSwipe :
        IiI = True
        if 34 - 34: i1 + Oo . oOo0O00 - ooo000 / I11iiIi11i1I * oOo0O00
        if 89 - 89: oOo0O00
        break
       else :
        wgCommStatusVal . recordIndexGot4GetSwipe = wgCommStatusVal . recordIndexGot4GetSwipe + 1
        if 48 - 48: i1 / IIiIIiIi11I1 / iI1iII1I1I1i / IiI11Ii111 * IiIIii11Ii
        continue
        if 54 - 54: IIiIIiIi11I1 % I1I % IiI11Ii111 / I11iiIi11i1I . I11iiIi11i1I - IiIIii11Ii
      oo = oOOO0oOoOo00 . getDescriptionJSON ( )
      if "Time" in oo :
       if datetime . datetime . strptime ( oo [ "Time" ] ,
 "%Y-%m-%d %H:%M:%S" ) > wgCommStatusVal . dtpDeactivate :
        IiI = True
        break
       elif datetime . datetime . strptime ( oo [ "Time" ] ,
 "%Y-%m-%d %H:%M:%S" ) < wgCommStatusVal . dtpActivate :
        pass
       else :
        wgCommStatusVal . recordCount = wgCommStatusVal . recordCount + 1
        wgCommStatusVal . recordList . append ( oo )
        if 10 - 10: Ii . I11iiIi11i1I % i1I / OooOoo % I1Ii1I1
        if 42 - 42: Oo - I1I * i1I * i1i1i1111I - I11iiIi11i1I
        if 58 - 58: iI1iII1I1I1i
      wgCommStatusVal . recordIndexGot4GetSwipe = wgCommStatusVal . recordIndexGot4GetSwipe + 1
      if ( ( wgCommStatusVal . getSwipeMaxlen > 0 ) and (
 wgCommStatusVal . recordCount >= wgCommStatusVal . getSwipeMaxlen ) ) :
       IiI = True
       break
    else :
     for ii1ii in range ( 0 , 40 - 1 ) :
      ooO0OoOo = oOO0 [ 64 + 4 + 24 * ii1ii + 4 ]
      if ooO0OoOo == 0 :
       if 17 - 17: iI1iII1I1I1i - Ii % iI1iII1I1I1i % oOo0O00 * Iii1i
       if 51 - 51: I1I . i1i1i1111I % Ii
       if wgCommStatusVal . recordIndexGot4GetSwipe >= wgCommStatusVal . recordlastSwipeIndex :
        IiI = True
        if 55 - 55: i1i1i1111I * Ii % i1i1i1111I
        break
       else :
        wgCommStatusVal . recordIndexGot4GetSwipe = wgCommStatusVal . recordIndexGot4GetSwipe + 1
        if 61 - 61: oOo0O00
        continue
        if 53 - 53: Ooo0Ooo / IiIIii11Ii
      if ooO0OoOo == 0xff :
       if 49 - 49: ooo000 - oOO . IiIIii11Ii / Oo
       if 23 - 23: I11iiIi11i1I - i1 / Iii1i . iI1iII1I1I1i + oOO
       if wgCommStatusVal . recordIndexGot4GetSwipe > wgCommStatusVal . recordlastSwipeIndex or wgCommStatusVal . recordfirstSwipeIndex > wgCommStatusVal . recordIndexGot4GetSwipe :
        IiI = True
        if 55 - 55: i1 - iI1iII1I1I1i / OooOoo + I1I + Oo
        if 5 - 5: IiI11Ii111 - i1 . i1i1i1111I / IiI11Ii111 . iI1iII1I1I1i . IiI11Ii111
        break
       else :
        wgCommStatusVal . recordIndexGot4GetSwipe = wgCommStatusVal . recordIndexGot4GetSwipe + 1
        if 87 - 87: i1 . Ii * iI1iII1I1I1i - oOO / Ii / OooOoo
        continue
      oo = WGSwipeRecord24Byte ( oOO0 , 64 + 4 + 24 * ii1ii , ii1ii ) . getDescriptionJSON ( )
      if datetime . datetime . strptime ( oo [ "Time" ] ,
 "%Y-%m-%d %H:%M:%S" ) > wgCommStatusVal . dtpDeactivate :
       IiI = True
       break
      elif datetime . datetime . strptime ( oo [ "Time" ] ,
 "%Y-%m-%d %H:%M:%S" ) < wgCommStatusVal . dtpActivate :
       pass
      else :
       wgCommStatusVal . recordCount = wgCommStatusVal . recordCount + 1
       wgCommStatusVal . recordList . append ( oo )
       if 65 - 65: i1I / i1I + IiI11Ii111
       if 99 - 99: i1 + OooOoo + I11iiIi11i1I * Ooo0Ooo / ooOOO + Ii
       if 72 - 72: I1Ii1I1 * Ooo0Ooo * IIiIIiIi11I1 % IiIIii11Ii . ooo000
      wgCommStatusVal . recordIndexGot4GetSwipe = wgCommStatusVal . recordIndexGot4GetSwipe + 1
      if ( ( wgCommStatusVal . getSwipeMaxlen > 0 ) and (
 wgCommStatusVal . recordCount >= wgCommStatusVal . getSwipeMaxlen ) ) :
       IiI = True
       break
  if IiI :
   if 68 - 68: Ooo0Ooo * OooOoo - oOo0O00
   pass
  else :
   wgCommStatusVal . recordIndexGot4GetSwipe = wgCommStatusVal . recordIndexGot4GetSwipe + 1
   OoOOOOO = wgCommStatusVal . comm . getNewXid ( )
   oo0Oo0oO0 = WGCommand . cmdgetrecord1024_Card8ByCloudServer ( wgCommStatusVal . conSN ,
 wgCommStatusVal . recordIndexGot4GetSwipe ,
 OoOOOOO )
  return oo0Oo0oO0
  if 49 - 49: IIiIIiIi11I1 % i1
  if 29 - 29: OooOoo * Ii - oOO
 def dealGettingPrivileges ( self , wgCommStatusVal ) :
  O0oOoOoO0o = wgCommStatusVal . comm . recv
  IiI = False
  oo0Oo0oO0 = None
  if len ( O0oOoOoO0o ) == 1024 :
   for Oo00 in range ( 16 ) :
    oOO0 = O0oOoOoO0o [ Oo00 * 64 : ( Oo00 + 1 ) * 64 ]
    O00 = struct . unpack_from ( "I" , oOO0 , 8 ) [ 0 ]
    iI111i = struct . unpack_from ( "I" , oOO0 , 44 ) [ 0 ]
    O00 = O00 + ( iI111i << 32 )
    if O00 >= 0x8000000000000000 :
     O00 = O00 - 0x10000000000000000
     if 10 - 10: oOO % I1I
    if O00 == 0 :
     if 62 - 62: oOo0O00 + Iii1i
     if 28 - 28: Oo * IIiIIiIi11I1
     wgCommStatusVal . recordIndexGot4GetSwipe = wgCommStatusVal . recordIndexGot4GetSwipe + Oo00 - 1
     IiI = True
     break
    elif O00 == 0xffffffff :
     continue
    ii1IIII1 = "{0:0>2X}{1:0>2X}-{2:0>2X}-{3:0>2X}" . format ( oOO0 [ 12 ] , oOO0 [ 13 ] , oOO0 [ 14 ] , oOO0 [ 15 ] )
    if wgCommStatusVal . conSN < 300000000 and ( not oOO0 [ 48 ] == 3 ) :
     if oOO0 [ 50 ] != 0 or oOO0 [ 51 ] != 0 or oOO0 [ 52 ] != 0 :
      ii1IIII1 = "{0:0>2X}{1:0>2X}-{2:0>2X}-{3:0>2X} {4:0>2X}:{5:0>2X}:{6:0>2X}" . format ( oOO0 [ 12 ] , oOO0 [ 13 ] ,
 oOO0 [ 14 ] , oOO0 [ 15 ] ,
 oOO0 [ 50 ] , oOO0 [ 51 ] ,
 oOO0 [ 52 ] )
    try :
     OO0OOo = ii1IIII1
    except Exception as OOOOo :
     pass
     OO0OOo = datetime . datetime . strptime ( "2020-01-01 00:00:00" , "%Y-%m-%d %H:%M:%S" )
     if 73 - 73: OooOoo * Iii1i
    ii1IIII1 = "{0:0>2X}{1:0>2X}-{2:0>2X}-{3:0>2X}" . format ( oOO0 [ 16 ] , oOO0 [ 17 ] , oOO0 [ 18 ] , oOO0 [ 19 ] )
    if oOO0 [ 38 ] != 0 or oOO0 [ 39 ] != 0 :
     ii1IIII1 = "{0:0>2X}{1:0>2X}-{2:0>2X}-{3:0>2X} {4:0>2X}:{5:0>2X}" . format ( oOO0 [ 16 ] , oOO0 [ 17 ] , oOO0 [ 18 ] ,
 oOO0 [ 19 ] , oOO0 [ 38 ] , oOO0 [ 39 ] )
     if 34 - 34: i1I % Ooo0Ooo * OooOoo + i1iiIII111 / i1
    if wgCommStatusVal . conSN < 300000000 and ( not oOO0 [ 48 ] == 3 ) :
     if oOO0 [ 38 ] != 0 or oOO0 [ 39 ] != 0 or oOO0 [ 49 ] != 0 :
      ii1IIII1 = "{0:0>2X}{1:0>2X}-{2:0>2X}-{3:0>2X} {4:0>2X}:{5:0>2X}:{6:0>2X}" . format ( oOO0 [ 16 ] , oOO0 [ 17 ] ,
 oOO0 [ 18 ] , oOO0 [ 19 ] ,
 oOO0 [ 38 ] , oOO0 [ 39 ] ,
 oOO0 [ 49 ] )
      if 49 - 49: IIiIIiIi11I1 / i1iiIII111 % IIiIIiIi11I1 + IIiIIiIi11I1 * iI1iII1I1I1i
    try :
     Ii11 = ii1IIII1
    except Exception as OOOOo :
     pass
     Ii11 = datetime . datetime . strptime ( "2099-12-31 23:59:59" , "%Y-%m-%d %H:%M:%S" )
     if 63 - 63: Ii % I11iiIi11i1I
    iiiIi1ii1iii = oOO0 [ 20 ]
    O0 = oOO0 [ 21 ]
    Ooo0 = oOO0 [ 22 ]
    O0oo0 = oOO0 [ 23 ]
    i11II = struct . unpack_from ( "I" , oOO0 , 24 ) [ 0 ]
    i11II = i11II & 0xffffff
    wgCommStatusVal . receviedPrivilegesValidIndex = wgCommStatusVal . receviedPrivilegesValidIndex + 1
    if oOO0 [ 48 ] == 0x3 :
     if 35 - 35: IiIIii11Ii . iI1iII1I1I1i - i1 % i1
     if 39 - 39: Ii . ooo000 . ooo000 - IIiIIiIi11I1 % Iii1i . I1Ii1I1
     if 11 - 11: i1iiIII111 - Oo % Ii % i1
     if 28 - 28: IIiIIiIi11I1 % Ii + ooOOO . i1I % Ii * I1Ii1I1
     if 41 - 41: I1I
     IIi = WGTools . getLongByByte ( oOO0 , 20 , 4 )
     I1II1i11i11I = [ ]
     for iiiI111I in range ( 32 ) :
      if IIi & ( 1 << iiiI111I ) :
       I1II1i11i11I . append ( iiiI111I + 2 )
     oOOOoO0OOo00 = [ ]
     for iiiI111I in range ( 24 ) :
      if i11II & ( 1 << iiiI111I ) :
       oOOOoO0OOo00 . append ( iiiI111I + 2 )
     oOo0ooOoO00 = (
 { "ID" : wgCommStatusVal . recordIndexGot4GetSwipe + Oo00 , "CardNO" : O00 ,
 "BeginDateTime" : OO0OOo ,
 "EndDateTime" : Ii11 ,
 "UnifiedControlTimeProfileArray" : I1II1i11i11I ,
 "HolidayControlArray" : oOOOoO0OOo00 } )
    else :
     oOo0ooOoO00 = (
 { "ID" : wgCommStatusVal . recordIndexGot4GetSwipe + Oo00 , "CardNO" : O00 ,
 "BeginDateTime" : OO0OOo ,
 "EndDateTime" : Ii11 , "Door1TimeProfileID" : iiiIi1ii1iii ,
 "Door2TimeProfileID" : O0 , "Door3TimeProfileID" : Ooo0 ,
 "Door4TimeProfileID" : O0oo0 , "UserPassword" : i11II } )
     if oOO0 [ 48 ] == 0x2 :
      oOo0ooOoO00 = ( { "ID" : wgCommStatusVal . recordIndexGot4GetSwipe + Oo00 , "CardNO" : O00 ,
 "BeginDateTime" : OO0OOo ,
 "EndDateTime" : Ii11 , "Door1TimeProfileID" : iiiIi1ii1iii ,
 "Door2TimeProfileID" : O0 , "Door3TimeProfileID" : Ooo0 ,
 "Door4TimeProfileID" : O0oo0 , "UserPassword" : i11II ,
 "OnlyOnce" : "Enabled" } )
     if 180000000 > wgCommStatusVal . conSN > 170000000 :
      IIiiiII = ( oOO0 [ 21 ] , oOO0 [ 22 ] , oOO0 [ 23 ] , oOO0 [ 29 ] , oOO0 [ 30 ] )
      Ooo = [ ]
      I111IiiiI = 0
      for IiIIIi11 in IIiiiII :
       for iiiI111I in range ( 8 ) :
        I111IiiiI += 1
        if IiIIIi11 & ( 1 << iiiI111I ) :
         Ooo . append ( I111IiiiI )
      O0 = 0
      Ooo0 = 0
      O0oo0 = 0
      oOo0ooOoO00 = ( { "ID" : wgCommStatusVal . recordIndexGot4GetSwipe + Oo00 , "CardNO" : O00 ,
 "BeginDateTime" : OO0OOo ,
 "EndDateTime" : Ii11 , "Door1TimeProfileID" : iiiIi1ii1iii ,

      # I11iiIi11i1I % I1Ii1I1
      "AllowFloorsNO" : Ooo ,
 "UserPassword" : i11II } )
      if oOO0 [ 48 ] == 0x2 :
       oOo0ooOoO00 = ( { "ID" : wgCommStatusVal . recordIndexGot4GetSwipe + Oo00 , "CardNO" : O00 ,
 "BeginDateTime" : OO0OOo ,
 "EndDateTime" : Ii11 , "Door1TimeProfileID" : iiiIi1ii1iii ,

       # I1Ii1I1 - ooOOO / ooOOO + OooOoo - I1Ii1I1 . Ooo0Ooo
       "AllowFloorsNO" : Ooo ,
 "UserPassword" : i11II ,
 "OnlyOnce" : "Enabled" } )
       if 36 - 36: IIiIIiIi11I1 + IiIIii11Ii . i1 + IIiIIiIi11I1
    wgCommStatusVal . recordCount = wgCommStatusVal . recordCount + 1
    wgCommStatusVal . recordList . append ( oOo0ooOoO00 )
   if not IiI :
    wgCommStatusVal . recordIndexGot4GetSwipe = wgCommStatusVal . recordIndexGot4GetSwipe + 16
    if 77 - 77: iI1iII1I1I1i / OooOoo . Iii1i + i1iiIII111 - IiI11Ii111
   if wgCommStatusVal . receviedPrivilegesValidIndex >= wgCommStatusVal . PrivilegeNum :
    IiI = True
    if 49 - 49: i1iiIII111 - IiI11Ii111 - OooOoo
  if ( IiI ) :
   if 39 - 39: I1I % i1iiIII111 - I1Ii1I1
   pass
  else :
   if 51 - 51: IIiIIiIi11I1 + i1 % i1iiIII111
   if 49 - 49: IiIIii11Ii - i1I . I1I
   OoOOOOO = wgCommStatusVal . comm . getNewXid ( )
   oo0Oo0oO0 = WGCommand . cmdgetPriviegeInfoByIndex1024ByCloudServer ( wgCommStatusVal . conSN ,
 wgCommStatusVal . recordIndexGot4GetSwipe ,
 OoOOOOO )
  return oo0Oo0oO0
  if 76 - 76: oOO / iI1iII1I1I1i . I1I * oOo0O00 - i1i1i1111I
 def dealGettingControlSegments ( self , wgCommStatusVal ) :
  O0oOoOoO0o = wgCommStatusVal . comm . recv
  IiI = False
  oo0Oo0oO0 = None
  if ( len ( O0oOoOoO0o ) == 1024 ) :
   for Oo00 in range ( 16 ) :
    oOO0 = O0oOoOoO0o [ Oo00 * 64 : ( Oo00 + 1 ) * 64 ]
    O0Oo = oOO0 [ 8 ]
    if O0Oo < 2 :
     if 33 - 33: Ooo0Ooo / i1i1i1111I - IiI11Ii111 - i1I - oOO - I11iiIi11i1I
     continue
     if 89 - 89: Ii % oOO + i1i1i1111I % Oo
    ii1IIII1 = "{0:0>2X}{1:0>2X}-{2:0>2X}-{3:0>2X}" . format ( oOO0 [ 9 ] , oOO0 [ 10 ] , oOO0 [ 11 ] , oOO0 [ 12 ] )
    try :
     OO0OOo = ii1IIII1
    except Exception as OOOOo :
     pass
     OO0OOo = datetime . datetime . strptime ( "2020-01-01" , "%Y-%m-%d" )
     if 99 - 99: IiIIii11Ii * I1Ii1I1
    ii1IIII1 = "{0:0>2X}{1:0>2X}-{2:0>2X}-{3:0>2X}" . format ( oOO0 [ 13 ] , oOO0 [ 14 ] , oOO0 [ 15 ] , oOO0 [ 16 ] )
    try :
     Ii11 = ii1IIII1
    except Exception as OOOOo :
     pass
     Ii11 = datetime . datetime . strptime ( "2099-12-31" , "%Y-%m-%d" )
     if 83 - 83: i1I . ooo000 * Ooo0Ooo + Iii1i . Oo
    iiiIi1ii1iii = "{0:0>2X}:{1:0>2X}" . format ( oOO0 [ 24 ] , oOO0 [ 25 ] )
    O0 = "{0:0>2X}:{1:0>2X}" . format ( oOO0 [ 26 ] , oOO0 [ 27 ] )
    Ooo0 = "{0:0>2X}:{1:0>2X}" . format ( oOO0 [ 28 ] , oOO0 [ 29 ] )
    O0oo0 = "{0:0>2X}:{1:0>2X}" . format ( oOO0 [ 30 ] , oOO0 [ 31 ] )
    o000000oOO = "{0:0>2X}:{1:0>2X}" . format ( oOO0 [ 32 ] , oOO0 [ 33 ] )
    O000oOoOoOOo = "{0:0>2X}:{1:0>2X}" . format ( oOO0 [ 34 ] , oOO0 [ 35 ] )
    if 15 - 15: IiIIii11Ii / i1iiIII111 + I1I - IIiIIiIi11I1 % IIiIIiIi11I1 + Oo
    i11II = struct . unpack_from ( "I" , oOO0 , 24 ) [ 0 ]
    i11II = i11II & 0xffffff
    wgCommStatusVal . receviedPrivilegesValidIndex = wgCommStatusVal . receviedPrivilegesValidIndex + 1
    if 57 - 57: iI1iII1I1I1i * i1i1i1111I + Ii + Oo * i1iiIII111 . Oo
    if 87 - 87: i1 * I11iiIi11i1I
    if 23 - 23: i1iiIII111 / Ooo0Ooo % i1 - I1Ii1I1 - I1Ii1I1
    if 82 - 82: ooo000 - IiI11Ii111 . iI1iII1I1I1i / Ooo0Ooo % Iii1i - I1I
    if 27 - 27: i1i1i1111I * Oo % oOO
    if 24 - 24: I1I + Oo - ooOOO
    if 86 - 86: i1iiIII111 % ooo000 % ooo000 % i1I
    if 15 - 15: iI1iII1I1I1i + I1Ii1I1 % oOo0O00
    if 79 - 79: OooOoo . Oo + oOo0O00 / I1Ii1I1 . IiIIii11Ii
    oOo0ooOoO00 = ( { "TimeProfileID" : O0Oo , "BeginDate" : OO0OOo , "EndDate" : Ii11 ,
 "Mon" : oOO0 [ 17 ] , "Tue" : oOO0 [ 18 ] , "Wed" : oOO0 [ 19 ] ,
 "Thu" : oOO0 [ 20 ] , "Fri" : oOO0 [ 21 ] , "Sat" : oOO0 [ 22 ] , "Sun" : oOO0 [ 23 ] ,
 "TimeZone1BeginTime" : iiiIi1ii1iii , "TimeZone1EndTime" : O0 ,
 "TimeZone2BeginTime" : Ooo0 , "TimeZone2EndTime" : O0oo0 ,
 "TimeZone3BeginTime" : o000000oOO , "TimeZone3EndTime" : O000oOoOoOOo ,
 "NextLinkedTimeProfileID" : oOO0 [ 36 ] ,
 "HolidayControl" : oOO0 [ 47 ] ,
    "LimitedAccessTimesMode" : oOO0 [ 37 ] ,
    "CurrentDayLimitedTimes" : oOO0 [ 38 ] ,
    "CurrentMonthLimitedTimes" : oOO0 [ 39 ] ,
    "TimeZone1LimitedTimes" : oOO0 [ 44 ] ,
    "TimeZone2LimitedTimes" : oOO0 [ 45 ] ,
    "TimeZone3LimitedTimes" : oOO0 [ 46 ]
    } )
    wgCommStatusVal . recordCount = wgCommStatusVal . recordCount + 1
    wgCommStatusVal . recordList . append ( oOo0ooOoO00 )
   if not IiI :
    wgCommStatusVal . recordIndexGot4GetSwipe = wgCommStatusVal . recordIndexGot4GetSwipe + 16
    if 89 - 89: ooo000 % Ooo0Ooo
   if wgCommStatusVal . receviedPrivilegesValidIndex >= 255 :
    IiI = True
    if 77 - 77: ooo000 % Ooo0Ooo
  if ( IiI ) :
   if 24 - 24: oOO * I1Ii1I1 * I1Ii1I1 % IIiIIiIi11I1
   pass
  else :
   if 37 - 37: i1iiIII111 / iI1iII1I1I1i
   if 80 - 80: IiIIii11Ii
   OoOOOOO = wgCommStatusVal . comm . getNewXid ( )
   oo0Oo0oO0 = WGCommand . cmdgetControlSegmentInfoByIndex1024ByCloudServer ( wgCommStatusVal . conSN ,
 wgCommStatusVal . recordIndexGot4GetSwipe ,
 OoOOOOO )
  return oo0Oo0oO0
  if 2 - 2: I1I / oOO - IIiIIiIi11I1 % Ooo0Ooo
  if 88 - 88: iI1iII1I1I1i - I1Ii1I1 - i1I . Iii1i
 def getSwipeBuffer ( self , wgCommStatusVal ) :
  oOO0 = wgCommStatusVal . comm . recv
  wgCommStatusVal . recordIndexGot4GetSwipe = WGTools . getLongByByte ( oOO0 , 8 , 4 )
  IiI = False
  oo0Oo0oO0 = None
  if 98 - 98: Ii + ooOOO
  wgCommStatusVal . wgpacketList4Monitor . append ( wgCommStatusVal . comm . recv )
  if 29 - 29: I1Ii1I1 + i1I - IIiIIiIi11I1 * I11iiIi11i1I % Oo
  if ( 20 > len ( wgCommStatusVal . wgpacketList4Monitor ) ) :
   i1II1IIIII11 = b'172000009DC99A3B'
   OoOOOOO = wgCommStatusVal . comm . getNewXid ( )
   wgCommStatusVal . conSN = 999999901
   oo0Oo0oO0 = WGCommand . cmdgetComm64X37 ( wgCommStatusVal . conSN , i1II1IIIII11 , OoOOOOO )
  return oo0Oo0oO0
  if 74 - 74: ooOOO
  if 100 - 100: oOO + iI1iII1I1I1i . I1I % Oo - i1
 def getNewSwipes ( self , wgCommStatusVal ) :
  oOOoOooo0 = [ ]
  for ii1ii in wgCommStatusVal . wgpacketList4Monitor :
   O0oo = WGControllerinfo ( ii1ii , ( "0.0.0.0" , 0 ) )
   if O0oo . recordIndex >= 1 :
    if O0oo . controllerSN not in self . dictControllersRecordIndex4Moinitor :
     if 27 - 27: i1I
     self . dictControllersRecordIndex4Moinitor [
 O0oo . controllerSN ] = 0 if O0oo . recordIndex <= 1 else O0oo . recordIndex - 1
    O0oo . getNewSwipeJSON ( self . dictControllersRecordIndex4Moinitor [ O0oo . controllerSN ] ,
 oOOoOooo0 )
    self . dictControllersRecordIndex4Moinitor [ O0oo . controllerSN ] = O0oo . recordIndex
  return oOOoOooo0
  if 45 - 45: IiI11Ii111 + I1Ii1I1 % oOo0O00 + i1I + ooOOO
  if 66 - 66: OooOoo . Ii - OooOoo + OooOoo * OooOoo / i1iiIII111
 def getPrivilegInfo ( self , wgCommStatusVal ) :
  oOOoOooo0 = [ ]
  if 32 - 32: IIiIIiIi11I1 - i1I / ooOOO * Ooo0Ooo * iI1iII1I1I1i - i1i1i1111I
  oOO0 = wgCommStatusVal . comm . recv
  O00 = struct . unpack_from ( "I" , oOO0 , 8 ) [ 0 ]
  iI111i = struct . unpack_from ( "I" , oOO0 , 44 ) [ 0 ]
  O00 = O00 + ( iI111i << 32 )
  if O00 >= 0x8000000000000000 :
   O00 = O00 - 0x10000000000000000
   if 82 - 82: ooo000
  ii1IIII1 = "{0:0>2X}{1:0>2X}-{2:0>2X}-{3:0>2X}" . format ( oOO0 [ 12 ] , oOO0 [ 13 ] , oOO0 [ 14 ] , oOO0 [ 15 ] )
  try :
   OO0OOo = ii1IIII1
  except Exception as OOOOo :
   pass
   OO0OOo = datetime . datetime . strptime ( "2020-01-01 00:00:00" , "%Y-%m-%d %H:%M:%S" )
   if 66 - 66: IiIIii11Ii + IIiIIiIi11I1 - i1I + i1i1i1111I . iI1iII1I1I1i * IiIIii11Ii
  ii1IIII1 = "{0:0>2X}{1:0>2X}-{2:0>2X}-{3:0>2X}" . format ( oOO0 [ 16 ] , oOO0 [ 17 ] , oOO0 [ 18 ] , oOO0 [ 19 ] )
  if oOO0 [ 38 ] != 0 or oOO0 [ 39 ] != 0 :
   ii1IIII1 = "{0:0>2X}{1:0>2X}-{2:0>2X}-{3:0>2X} {4:0>2X}:{5:0>2X}" . format ( oOO0 [ 16 ] , oOO0 [ 17 ] , oOO0 [ 18 ] ,
 oOO0 [ 19 ] , oOO0 [ 38 ] , oOO0 [ 39 ] )
   if 9 - 9: I1I - I1I - ooOOO - oOo0O00 + i1iiIII111
  if wgCommStatusVal . conSN < 300000000 and ( not oOO0 [ 48 ] == 3 ) :
   if oOO0 [ 38 ] != 0 or oOO0 [ 39 ] != 0 or oOO0 [ 49 ] != 0 :
    ii1IIII1 = "{0:0>2X}{1:0>2X}-{2:0>2X}-{3:0>2X} {4:0>2X}:{5:0>2X}:{6:0>2X}" . format ( oOO0 [ 16 ] , oOO0 [ 17 ] ,
 oOO0 [ 18 ] , oOO0 [ 19 ] ,
 oOO0 [ 38 ] , oOO0 [ 39 ] ,
 oOO0 [ 49 ] )
  try :
   Ii11 = ii1IIII1
  except Exception as OOOOo :
   pass
   Ii11 = datetime . datetime . strptime ( "2099-12-31 23:59:59" , "%Y-%m-%d %H:%M:%S" )
   if 71 - 71: i1I / i1iiIII111 - Ii * Oo . iI1iII1I1I1i
  iiiIi1ii1iii = oOO0 [ 20 ]
  O0 = oOO0 [ 21 ]
  Ooo0 = oOO0 [ 22 ]
  O0oo0 = oOO0 [ 23 ]
  i11II = struct . unpack_from ( "I" , oOO0 , 24 ) [ 0 ]
  i11II = i11II & 0xffffff
  if oOO0 [ 48 ] == 0x3 :
   IIi = WGTools . getLongByByte ( oOO0 , 20 , 4 )
   I1II1i11i11I = [ ]
   for iiiI111I in range ( 32 ) :
    if IIi & ( 1 << iiiI111I ) :
     I1II1i11i11I . append ( iiiI111I + 2 )
   oOOOoO0OOo00 = [ ]
   for iiiI111I in range ( 24 ) :
    if i11II & ( 1 << iiiI111I ) :
     oOOOoO0OOo00 . append ( iiiI111I + 2 )
   oOo0ooOoO00 = ( { "CardNO" : O00 , "BeginDateTime" : OO0OOo ,
 "EndDateTime" : Ii11 ,
 "UnifiedControlTimeProfileArray" : I1II1i11i11I ,
 "HolidayControlArray" : oOOOoO0OOo00 } )
  else :
   oOo0ooOoO00 = ( { "CardNO" : O00 , "BeginDateTime" : OO0OOo ,
 "EndDateTime" : Ii11 , "Door1TimeProfileID" : iiiIi1ii1iii ,
 "Door2TimeProfileID" : O0 , "Door3TimeProfileID" : Ooo0 ,
 "Door4TimeProfileID" : O0oo0 , "UserPassword" : i11II } )
   if 180000000 > wgCommStatusVal . conSN > 170000000 :
    IIiiiII = ( oOO0 [ 21 ] , oOO0 [ 22 ] , oOO0 [ 23 ] , oOO0 [ 29 ] , oOO0 [ 30 ] )
    Ooo = [ ]
    I111IiiiI = 0
    for IiIIIi11 in IIiiiII :
     for iiiI111I in range ( 8 ) :
      I111IiiiI += 1
      if IiIIIi11 & ( 1 << iiiI111I ) :
       Ooo . append ( I111IiiiI )
    O0 = 0
    Ooo0 = 0
    O0oo0 = 0
    oOo0ooOoO00 = ( { "CardNO" : O00 ,
 "BeginDateTime" : OO0OOo ,
 "EndDateTime" : Ii11 , "Door1TimeProfileID" : iiiIi1ii1iii ,
 "Door2TimeProfileID" : O0 , "Door3TimeProfileID" : Ooo0 ,
 "Door4TimeProfileID" : O0oo0 ,
 "AllowFloorsNO" : Ooo ,
 "UserPassword" : i11II } )
    if 3 - 3: I1Ii1I1
    if 57 - 57: Ooo0Ooo . OooOoo / oOo0O00 * I1Ii1I1
    if 36 - 36: IiIIii11Ii
  oOOoOooo0 . append ( oOo0ooOoO00 )
  return oOOoOooo0
  if 33 - 33: IiIIii11Ii
 def nxp4GDelay ( self ) :
  if wgGlobal . supportNXP4G > 0 :
   if 86 - 86: Ii / oOo0O00 - i1 * i1i1i1111I - Oo * Iii1i
   pass
   if 28 - 28: OooOoo . i1 % iI1iII1I1I1i % Iii1i
   if 2 - 2: Oo + OooOoo - i1i1i1111I - ooo000 / Oo . Oo
 def _delayedRender ( self , request ) :
  if 41 - 41: OooOoo + OooOoo - OooOoo
  if 9 - 9: Iii1i % I1Ii1I1 % IiIIii11Ii - I1I * OooOoo
  if 53 - 53: iI1iII1I1I1i * i1i1i1111I / OooOoo . i1I . ooo000
  if 45 - 45: OooOoo + ooOOO / i1i1i1111I * i1
  if 71 - 71: IiI11Ii111 % Iii1i + oOo0O00 * I11iiIi11i1I / IiI11Ii111
  if 66 - 66: ooo000 * oOo0O00
  if 83 - 83: i1
  if 64 - 64: i1 . IiI11Ii111 - I11iiIi11i1I . Iii1i
  if 47 - 47: ooo000 / Ooo0Ooo % IiIIii11Ii
  if request in self . arrUsers :
   Ii1 = self . arrUsers [ request ]
   if Ii1 . responseStop :
    return
  else :
   return
   if 9 - 9: ooOOO
  oo0Oo0oO0 = None
  if wgGlobal . debugWEBAPI :
   mMonitorInfo . printCHS ( " _delayedRender wgCommStatusVal.tryMaxTimesCount {0} receive {1} " . format (
 time . strftime ( '%Y-%m-%d %H:%M:%S' ) , Ii1 . tryMaxTimesCount ) )
   mMonitorInfo . wglog ( " _delayedRender wgCommStatusVal.tryMaxTimesCount {0} receive {1} " . format (
 time . strftime ( '%Y-%m-%d %H:%M:%S' ) , Ii1 . tryMaxTimesCount ) )
   if 28 - 28: Ii
  if Ii1 . comm . runStatus == - 1 :
   Ii1 . tryMaxTimesCount = Ii1 . tryMaxTimesCount - 1
   if Ii1 . tryMaxTimesCount > 0 :
    Ii1 . tryResendCount = Ii1 . tryResendCount + 1
    if 51 - 51: I11iiIi11i1I + Ooo0Ooo - ooo000 * oOO . oOO
    if 79 - 79: i1i1i1111I + oOo0O00
    if 11 - 11: OooOoo / i1iiIII111 % i1I - i1i1i1111I * oOo0O00
    if 90 - 90: i1 * i1 . Ooo0Ooo . Oo
    if 59 - 59: Ii % I1Ii1I1 + Iii1i . OooOoo * Iii1i
    if Ii1 . method in [ 'UploadAllPrivileges' ,
 'UploadAllPrivilegesByZip' ] :
     pass
     if 21 - 21: I11iiIi11i1I + ooOOO % IiIIii11Ii / OooOoo
     if 96 - 96: Oo * i1iiIII111 . Ooo0Ooo
     if 35 - 35: ooOOO . i1I * i1i1i1111I * iI1iII1I1I1i - I11iiIi11i1I
     if 47 - 47: IIiIIiIi11I1
    elif wgGlobal . supportNXP4G > 0 :
     if Ii1 . tryResendCount > 60 :
      Ii1 . tryResendCount = 0
      Ii1 . comm . run ( Ii1 . lastCommandByte )
    elif Ii1 . tryResendCount > 30 :
     Ii1 . tryResendCount = 0
     Ii1 . comm . run ( Ii1 . lastCommandByte )
     if 73 - 73: I1Ii1I1 + ooOOO
    i11ii = deferLater ( reactor , 0.01 , lambda : request )
    i11ii . addCallback ( self . _delayedRender )
    return
    if 2 - 2: IIiIIiIi11I1 . IiIIii11Ii
  Ii1 . tryResendCount = 0
  if 50 - 50: Ii / oOO
  if 92 - 92: Ooo0Ooo * i1iiIII111 / Ooo0Ooo / i1iiIII111 * i1i1i1111I + i1I
  if Ii1 . comm . runStatus == 0 :
   if 48 - 48: I11iiIi11i1I
   oo0Oo0oO0 = None
   if Ii1 . method == 'GetRecordBuffer' :
    oo0Oo0oO0 = self . getSwipeBuffer ( Ii1 )
    pass
   elif Ii1 . method == 'GetQRCode' :
    Ii1 . wgpacketList4MonitorQR . append ( Ii1 . comm . recv )
    if 10 > len ( Ii1 . wgpacketList4MonitorQR ) :
     OoOOOOO = Ii1 . comm . getNewXid ( )
     i1II1IIIII11 = b'172000009DC99A3B'
     Ii1 . conSN = 999999902
     oo0Oo0oO0 = WGCommand . cmdgetComm64X37 ( Ii1 . conSN , i1II1IIIII11 , OoOOOOO )
   elif Ii1 . method in [ 'UploadAllPrivileges' , 'UploadAllPrivilegesByZip' , 'AddEditPrivilege' ,
 'DeletePrivilege' ] :
    if Ii1 . indexOfPrivilege < Ii1 . cardCount :
     oo0Oo0oO0 = self . getPrivilegeCommand ( Ii1 )
    else :
     if Ii1 . totalPrivilege2024err512 > 0 and (
 Ii1 . totalPrivilege2024err512 - 1 ) == Ii1 . totalPrivilege :
      if 87 - 87: I1Ii1I1
      if Ii1 . indexOfPrivilege + Ii1 . sentPrivilegeIndex > Ii1 . totalPrivilege :
       Ii1 . cardCount = Ii1 . cardCount + 1
       Ii1 . indexOfPrivilege = Ii1 . totalPrivilege
       Ii1 . totalPrivilege = Ii1 . totalPrivilege + 1
       if 29 - 29: ooo000 . iI1iII1I1I1i . oOo0O00 + i1i1i1111I + oOO
       if 59 - 59: IiIIii11Ii
       OoOOOOO = Ii1 . comm . getNewXid ( )
       oo0Oo0oO0 = WGCommand . cmduploadPrivieges0x50ByCloudServer ( Ii1 . conSN ,
 Ii1 . privilegesAll ,
 Ii1 . cardCount ,
 Ii1 . indexOfPrivilege ,
 OoOOOOO )
       Ii1 . indexOfPrivilege = Ii1 . indexOfPrivilege + 1
     elif Ii1 . totalPrivilege2024err512 > 0 and (
 Ii1 . totalPrivilege2024err512 + 1 ) == Ii1 . totalPrivilege :
      if 26 - 26: oOo0O00 % IiI11Ii111 * i1
      if Ii1 . indexOfPrivilege + Ii1 . sentPrivilegeIndex > Ii1 . totalPrivilege :
       Ii1 . indexOfPrivilege = Ii1 . cardCount - 1
       if 60 - 60: IIiIIiIi11I1 % oOO / i1
       OoOOOOO = Ii1 . comm . getNewXid ( )
       if 20 - 20: Ooo0Ooo
       if 4 - 4: IiIIii11Ii % Iii1i
       if 43 - 43: ooo000
       if 95 - 95: Oo + I11iiIi11i1I / Ooo0Ooo / Ii - ooOOO / i1i1i1111I
       if 6 - 6: Ooo0Ooo % IiIIii11Ii
       oo0Oo0oO0 = WGCommand . cmdDeletePriviegeByCloudServer ( Ii1 . conSN ,
 Ii1 . privilegesAll ,
 Ii1 . cardCount ,
 Ii1 . indexOfPrivilege ,
 OoOOOOO )
       if 59 - 59: i1I . I11iiIi11i1I . ooo000 / i1I . Ii % Ooo0Ooo
       Ii1 . cardCount = Ii1 . cardCount - 1
       Ii1 . indexOfPrivilege = Ii1 . totalPrivilege - 1
       Ii1 . totalPrivilege = Ii1 . totalPrivilege - 1
   elif Ii1 . method == 'UploadAllTimeProfiles' :
    oo0Oo0oO0 = getcontrolsegCommand ( Ii1 )
   elif Ii1 . method == 'UploadHolidayControl' :
    oo0Oo0oO0 = self . getHolidayConfigCommand ( Ii1 )
   elif Ii1 . method == 'UploadAllScheduledTasks' :
    oo0Oo0oO0 = gettasklistCommand ( Ii1 )
   elif Ii1 . method == 'DownloadSwipe' :
    self . nxp4GDelay ( )
    if Ii1 . getAllSwipeStep == 901 :
     if 85 - 85: oOo0O00 / ooOOO
     OoOOOOO = Ii1 . comm . getNewXid ( )
     oo0Oo0oO0 = WGCommand . cmdgetrecordParam1024ByCloudServer ( Ii1 . conSN ,
 Ii1 . receviedSwipeIndex + 1 ,
 OoOOOOO )
     Ii1 . getAllSwipeStep = 1
    elif Ii1 . getAllSwipeStep == 1 :
     if 41 - 41: i1iiIII111 * iI1iII1I1I1i + i1 + i1i1i1111I
     oOO0 = Ii1 . comm . recv
     if 26 - 26: Oo % OooOoo
     if 14 - 14: iI1iII1I1I1i - i1iiIII111
     oOoOOOOooo = WGTools . getLongByByte ( oOO0 , 8 , 4 )
     Oo0OOOo0o = WGTools . getLongByByte ( oOO0 , 64 + 8 , 4 )
     IIIiI1iI = WGTools . getLongByByte ( oOO0 , 64 + 64 + 8 , 4 )
     OoO00oOo = WGTools . getLongByByte ( oOO0 , 64 + 64 + 64 + 8 , 4 )
     oOoo0 = WGTools . getLongByByte ( oOO0 , 64 + 64 + 64 + 8 + 4 , 1 )
     if 32 - 32: I11iiIi11i1I - oOo0O00 . ooOOO
     if 23 - 23: ooo000
     if ( ( OoO00oOo > 0 ) and 0 < oOoo0 < 0xff
 and Ii1 . receviedSwipeIndex > 0 ) :
      Ii1 . recordIndexGot4GetSwipe = OoO00oOo
      pass
     elif Ii1 . getRecordGotLastIndex == IIIiI1iI :
      Ii1 . recordIndexGot4GetSwipe = IIIiI1iI + 1
     elif ( oOoOOOOooo >= Oo0OOOo0o ) and ( oOoOOOOooo <= IIIiI1iI ) :
      Ii1 . recordIndexGot4GetSwipe = oOoOOOOooo + 1
      pass
     else :
      Ii1 . recordIndexGot4GetSwipe = Oo0OOOo0o
     Ii1 . recordlastSwipeIndex = IIIiI1iI
     Ii1 . recordfirstSwipeIndex = Oo0OOOo0o
     if 58 - 58: oOO * Oo / Oo - Oo / Iii1i
     if 8 - 8: I1I / ooo000
     if 48 - 48: i1i1i1111I * i1I % i1i1i1111I + i1i1i1111I . iI1iII1I1I1i / OooOoo
     if 12 - 12: Ii . Ii - I1Ii1I1
     if 74 - 74: ooo000 * Iii1i - Ooo0Ooo - I1Ii1I1
     if 46 - 46: ooOOO / ooOOO
     if 58 - 58: IiI11Ii111 . IiI11Ii111
     if 79 - 79: oOo0O00 * IIiIIiIi11I1
     if 53 - 53: Ii - ooOOO . OooOoo - I1I - I11iiIi11i1I
     if Ii1 . getRecordTimeControl > 0 :
      oo0Oo0oO0 = self . dealGettingSwipeWithTimeControl ( Ii1 )
     else :
      Ii1 . getAllSwipeStep = 2
      OoOOOOO = Ii1 . comm . getNewXid ( )
      oo0Oo0oO0 = WGCommand . cmdgetrecord1024_Card8ByCloudServer ( Ii1 . conSN ,
 Ii1 . recordIndexGot4GetSwipe ,
 OoOOOOO )
    elif Ii1 . getAllSwipeStep == 2 :
     oo0Oo0oO0 = self . dealGettingSwipe ( Ii1 )
    elif Ii1 . getAllSwipeStep in [ 3 , 4 ] :
     oo0Oo0oO0 = self . dealGettingSwipeWithTimeControl ( Ii1 )
   elif Ii1 . method == 'GetPrivilege' :
    self . nxp4GDelay ( )
    if Ii1 . getAllSwipeStep == 1 :
     if 32 - 32: Iii1i % IiIIii11Ii - oOO - IiIIii11Ii - I11iiIi11i1I % i1iiIII111
     oOO0 = Ii1 . comm . recv
     OoO0 = struct . unpack_from ( "I" , oOO0 , 8 ) [ 0 ]
     if OoO0 > 0 :
      if 29 - 29: ooOOO
      II1iiii1iI = 0
      iIIiii1I11I = 0
      I1i1iI1IiIi = OoO0
      i1ii1 = 0
      o0ooO0o = 0
      if 42 - 42: Iii1i
      Ii1 . getAllSwipeStep = 2
      OoOOOOO = Ii1 . comm . getNewXid ( )
      Ii1 . PrivilegeNum = OoO0
      Ii1 . recordIndexGot4GetSwipe = 1
      oo0Oo0oO0 = WGCommand . cmdgetPriviegeInfoByIndex1024ByCloudServer ( Ii1 . conSN ,
 Ii1 . recordIndexGot4GetSwipe ,
 OoOOOOO )
    elif Ii1 . getAllSwipeStep == 2 :
     oo0Oo0oO0 = self . dealGettingPrivileges ( Ii1 )
   elif Ii1 . method == 'GetTimeProfiles' :
    oo0Oo0oO0 = self . dealGettingControlSegments ( Ii1 )
   elif Ii1 . method == 'RemoteOpenDoor' :
    if len ( Ii1 . arrFloors4remoteopen ) > 16 :
     i1II1I1iIIIii1I1 = 1
     O000 = 1
     o0oOO00Ooo0o = 0
     OoOOOOO = Ii1 . comm . getNewXid ( )
     Ii1 . arrFloors4remoteopen = Ii1 . arrFloors4remoteopen [
 16 : ]
     I111IiiiI = Ii1 . arrFloors4remoteopen [ 0 ]
     if I111IiiiI > 40 :
      o0oOO00Ooo0o = 5
     oo0Oo0oO0 = WGCommand . cmdremoteOpenDoorByCloudServer1024 ( Ii1 . conSN , i1II1I1iIIIii1I1 ,
 O000 ,
 Ii1 . vcard4remoteopen ,
 OoOOOOO , Ii1 . arrFloors4remoteopen ,
 o0oOO00Ooo0o )
     if 90 - 90: i1I - I1Ii1I1 . i1iiIII111 % i1 % i1I
   if oo0Oo0oO0 is not None :
    if 14 - 14: i1iiIII111 / i1i1i1111I * IiIIii11Ii / i1iiIII111
    if 22 - 22: i1iiIII111 . Iii1i - I1I + i1i1i1111I / ooOOO + Oo
    if 93 - 93: Ii
    if 50 - 50: Ooo0Ooo * Ooo0Ooo / ooo000 - IiIIii11Ii
    if 70 - 70: IIiIIiIi11I1 . i1 % iI1iII1I1I1i / i1i1i1111I
    if 5 - 5: i1iiIII111 . Oo + i1i1i1111I
    if 44 - 44: I1Ii1I1 - i1i1i1111I
    if 71 - 71: i1iiIII111
    if 77 - 77: Iii1i - I1Ii1I1 - Ooo0Ooo % Ii / Oo
    Ii1 . lastCommandByte = bytes ( oo0Oo0oO0 )
    Ii1 . comm . run (
 Ii1 . lastCommandByte )
    if 43 - 43: Ooo0Ooo / oOO
    if 93 - 93: ooOOO % oOo0O00 * i1 + Ii . i1I - oOO
    if 63 - 63: IiIIii11Ii . Iii1i
    Ii1 . tryMaxTimesCount = wgGlobal . commTimeout10ms
    i11ii = deferLater ( reactor , 0.01 , lambda : request )
    i11ii . addCallback ( self . _delayedRender )
    return
    if 55 - 55: oOo0O00
    if 85 - 85: IIiIIiIi11I1 % Oo / I1I . oOo0O00 / IIiIIiIi11I1 . Oo
    if 40 - 40: IIiIIiIi11I1 - ooOOO * oOO . ooo000
    if 24 - 24: IiIIii11Ii - iI1iII1I1I1i / Ii
    if 34 - 34: ooOOO - ooOOO / Ii % OooOoo
    if 97 - 97: Oo * IiIIii11Ii . Ooo0Ooo % i1 % Ii % ooo000
    if 67 - 67: IIiIIiIi11I1 % i1 % oOo0O00 - i1i1i1111I
    if 51 - 51: I11iiIi11i1I . I11iiIi11i1I % IiI11Ii111 % Oo / I1Ii1I1 - I1Ii1I1
    if 28 - 28: Ii / Ooo0Ooo
    if 11 - 11: I1I - OooOoo * ooOOO % i1i1i1111I + ooo000 . oOO
    if 51 - 51: ooOOO + iI1iII1I1I1i % IiI11Ii111 . I11iiIi11i1I % Ooo0Ooo
    if 15 - 15: OooOoo / i1I % Oo % Oo
    if 73 - 73: oOo0O00
    if 69 - 69: ooOOO - IIiIIiIi11I1 - i1I
    if 78 - 78: I1Ii1I1 . ooo000 + IiI11Ii111 / IiI11Ii111
    if 88 - 88: Ii - i1iiIII111 - i1 * IIiIIiIi11I1 . IiIIii11Ii + Iii1i
    if 44 - 44: ooOOO + Oo - i1
    if 18 - 18: iI1iII1I1I1i * ooOOO + Ooo0Ooo
    if 78 - 78: I1I . I1I - IIiIIiIi11I1 - IiIIii11Ii % I11iiIi11i1I . I1Ii1I1
    if 9 - 9: I11iiIi11i1I * OooOoo - I11iiIi11i1I
    if 73 - 73: I1Ii1I1
    if 25 - 25: i1 . Ii
    if 59 - 59: IiIIii11Ii
    if 91 - 91: IiIIii11Ii + iI1iII1I1I1i
    if 65 - 65: Oo * Iii1i * IiIIii11Ii / IIiIIiIi11I1
    if 77 - 77: IIiIIiIi11I1 / oOO % IiIIii11Ii + I1Ii1I1
    if 34 - 34: i1i1i1111I * Iii1i + Ii - i1I / i1 / i1
    if 87 - 87: Ooo0Ooo + I11iiIi11i1I
    if 3 - 3: IIiIIiIi11I1 . I1Ii1I1 / Iii1i % ooOOO / oOo0O00 % ooOOO
    if 55 - 55: iI1iII1I1I1i + I1I + oOo0O00 - I11iiIi11i1I
    if 80 - 80: Oo % I11iiIi11i1I . IiIIii11Ii * oOO
    if 83 - 83: oOo0O00 % Oo + i1i1i1111I - ooOOO + i1iiIII111
    if 36 - 36: oOo0O00 * OooOoo / I11iiIi11i1I
    if 98 - 98: IiI11Ii111 . ooo000
    if 85 - 85: OooOoo * Iii1i * IIiIIiIi11I1
    if 38 - 38: ooo000 - Ii - i1I
    if 91 - 91: i1iiIII111 / i1 * oOO * IIiIIiIi11I1 * IiIIii11Ii
  if Ii1 . method == 'GetRecordBuffer' :
   o0oOoOo0O00o = ( { "success" : False , "msg" : "No new swipes" , "code" : 0 } )
   oOOoOooo0 = self . getNewSwipes ( Ii1 )
   if len ( oOOoOooo0 ) > 0 :
    o0oOoOo0O00o = ( { "success" : True , "msg" : "controller instructions execute successfully ok" , "code" : 1 , "SwipeCount" : len ( oOOoOooo0 ) ,
 "NewSwipeInformation" : oOOoOooo0 } )
    if 88 - 88: i1i1i1111I * IiIIii11Ii / i1
  elif Ii1 . method == 'GetQRCode' :
   o0oOoOo0O00o = ( { "success" : False , "msg" : "No QR Code" , "code" : 0 } )
   oOOoOooo0 = [ ]
   for ii1ii in Ii1 . wgpacketList4MonitorQR :
    O0oo = WGControllerinfo ( ii1ii , ( "0.0.0.0" , 0 ) )
    if 96 - 96: i1iiIII111 - ooOOO + i1I
    if ( O0oo . recordIndex >= 1 ) :
     if 38 - 38: IIiIIiIi11I1 . i1I . IiI11Ii111 % i1i1i1111I
     oo0O0OOooo = str ( binascii . hexlify ( Ii1 . comm . recv [ 64 : 64 + O0oo . recordIndex ] ) ,
 encoding = 'UTF-8' )
     I1IiI1ii = ""
     try :
      I1IiI1ii = str ( ii1ii [ 64 : 64 + O0oo . recordIndex ] , encoding = "utf-8" )
     except Exception as OOOOo :
      pass
      pass
     OoO0ooOOoo0o = ( {
 "ControllerSN" : O0oo . controllerSN ,
 'PrimitHexData' : oo0O0OOooo ,
 'ConvertedToString' : I1IiI1ii ,
 'Time' : O0oo . timeOfCon . strftime ( "%Y-%m-%d %H:%M:%S" ) ,
 'DoorNO' : O0oo . recordDoorNO ,
 'InExit' : 'In' if ii1ii [ 15 ] == 1 else 'Exit' ,
     'Sid' : O0oo . sid
 } )
     o0O0 = tdz . parseCommand (
 Ii1 . comm . recv [ 64 : 64 + O0oo . recordIndex ] )
     if o0O0 is not None :
      OoO0ooOOoo0o = ( {
 "ControllerSN" : O0oo . controllerSN ,
 'PrimitHexData' : oo0O0OOooo ,
 "GateInformation" : o0O0 ,
      'Time' : O0oo . timeOfCon . strftime ( "%Y-%m-%d %H:%M:%S" ) ,

      # Ooo0Ooo - ooo000 - Ii . oOO
      'SerialNumber' : O0oo . sid
 } )
     oOOoOooo0 . append ( OoO0ooOOoo0o )
   if len ( oOOoOooo0 ) > 0 :
    o0oOoOo0O00o = ( { "success" : True , "msg" : "controller instructions execute successfully ok" , "code" : 1 ,
 "QRCodeInformation" : oOOoOooo0 } )
    if 26 - 26: Iii1i + I11iiIi11i1I + Iii1i / Iii1i * i1 * i1
  elif ( Ii1 . method in [ 'Primit64ByteCommand' , 'QueryControllerStatus' , 'DownloadSwipe' , 'GetPrivilegeTotal' , "QueryPrivilege" ,
 'GetPrivilege' ,
 'GetTimeProfiles' , 'GetDoorControlParameter' ,
  # oOo0O00 + Oo / I11iiIi11i1I - oOo0O00 % i1i1i1111I / Ii
  "GetPrivilegeWithSelectedID" ] ) :
   if Ii1 . comm . runStatus == 0 :
    o0oOoOo0O00o = (
 { "success" : True , "msg" : "controller instructions execute successfully ok" , "code" : 1 , "ControllerSN" : Ii1 . conSN ,
 "ReturnPacket" : str ( binascii . hexlify ( Ii1 . comm . recv ) , encoding = 'UTF-8' ) } )
    if Ii1 . method == 'QueryControllerStatus' :
     O0oo = WGControllerinfo ( Ii1 . comm . recv , ( "0.0.0.0" , 0 ) )
     O0000OO0o = int ( Ii1 . conSN / 100000000 )
     if 44 - 44: I1I + ooo000 / i1 . i1
     if 94 - 94: Iii1i / i1I
     if 65 - 65: IiIIii11Ii . Ii
     O0o0o0o0oo = 0
     if 89 - 89: Ooo0Ooo
     if 57 - 57: oOO . IIiIIiIi11I1 + OooOoo * I1I
     if 89 - 89: Iii1i * Ooo0Ooo + Oo * I11iiIi11i1I * IiI11Ii111 + IiI11Ii111
     if 90 - 90: Oo - I11iiIi11i1I
     if ( Ii1 . comm . recv [ 50 ] & 0x80 ) > 0 :
      O0o0o0o0oo = 1
     if O0o0o0o0oo == 1 :
      if O0000OO0o == 1 :
       IiIi1iI1I = ( {
 'Time' : O0oo . timeOfCon . strftime ( "%Y-%m-%d %H:%M:%S" ) ,
       'Door1#' : 'Closed' if Ii1 . comm . recv [ 28 ] == 0 else 'Open' ,

       'ExternOutput1' : 'NormalClosed' if ( Ii1 . comm . recv [ 54 ] & 0x1 ) == 0 else 'NormalOpen' ,
 'ExternOutput2' : 'NormalClosed' if ( Ii1 . comm . recv [ 54 ] & 0x2 ) == 0 else 'NormalOpen' ,
 'ExternOutput3' : 'NormalClosed' if ( Ii1 . comm . recv [ 54 ] & 0x4 ) == 0 else 'NormalOpen' ,
 'ExternOutput4' : 'NormalClosed' if ( Ii1 . comm . recv [ 54 ] & 0x8 ) == 0 else 'NormalOpen' ,
 'ExternInput1' : 'Connected' if ( Ii1 . comm . recv [ 54 ] & 0x10 ) != 0 else 'Unconnected' ,
 'ExternInput2' : 'Connected' if ( Ii1 . comm . recv [ 54 ] & 0x20 ) != 0 else 'Unconnected' ,
 'ExternInput3' : 'Connected' if ( Ii1 . comm . recv [ 54 ] & 0x40 ) != 0 else 'Unconnected' ,
 'ExternInput4' : 'Connected' if ( Ii1 . comm . recv [ 54 ] & 0x80 ) == 0 else 'Unconnected' ,
 'Fire' : 'Deactive' if ( Ii1 . comm . recv [ 50 ] & 0x2 ) == 0 else 'Active' ,
 'LastSixRecords' : O0oo . get5SwipeJSON ( 0 )
       } )
      elif O0000OO0o == 2 :
       IiIi1iI1I = ( {
 'Time' : O0oo . timeOfCon . strftime ( "%Y-%m-%d %H:%M:%S" ) ,
       'Door1#' : 'Closed' if Ii1 . comm . recv [ 28 ] == 0 else 'Open' ,
 'Door2#' : 'Closed' if Ii1 . comm . recv [ 29 ] == 0 else 'Open' ,
 'ExternOutput1' : 'NormalClosed' if ( Ii1 . comm . recv [ 54 ] & 0x1 ) == 0 else 'NormalOpen' ,
 'ExternOutput2' : 'NormalClosed' if ( Ii1 . comm . recv [ 54 ] & 0x2 ) == 0 else 'NormalOpen' ,
 'ExternOutput3' : 'NormalClosed' if ( Ii1 . comm . recv [ 54 ] & 0x4 ) == 0 else 'NormalOpen' ,
 'ExternOutput4' : 'NormalClosed' if ( Ii1 . comm . recv [ 54 ] & 0x8 ) == 0 else 'NormalOpen' ,
 'ExternInput1' : 'Connected' if ( Ii1 . comm . recv [ 54 ] & 0x10 ) != 0 else 'Unconnected' ,
 'ExternInput2' : 'Connected' if ( Ii1 . comm . recv [ 54 ] & 0x20 ) != 0 else 'Unconnected' ,
 'ExternInput3' : 'Connected' if ( Ii1 . comm . recv [ 54 ] & 0x40 ) != 0 else 'Unconnected' ,
 'ExternInput4' : 'Connected' if ( Ii1 . comm . recv [ 54 ] & 0x80 ) == 0 else 'Unconnected' ,
 'Fire' : 'Deactive' if ( Ii1 . comm . recv [ 50 ] & 0x2 ) == 0 else 'Active' ,
 'LastSixRecords' : O0oo . get5SwipeJSON ( 0 )
       } )
      else :
       IiIi1iI1I = ( {
 'Time' : O0oo . timeOfCon . strftime ( "%Y-%m-%d %H:%M:%S" ) ,
       'Door1#' : 'Closed' if Ii1 . comm . recv [ 28 ] == 0 else 'Open' ,
 'Door2#' : 'Closed' if Ii1 . comm . recv [ 29 ] == 0 else 'Open' ,
 'Door3#' : 'Closed' if Ii1 . comm . recv [ 30 ] == 0 else 'Open' ,
 'Door4#' : 'Closed' if Ii1 . comm . recv [ 31 ] == 0 else 'Open' ,
 'ExternOutput1' : 'NormalClosed' if ( Ii1 . comm . recv [ 54 ] & 0x1 ) == 0 else 'NormalOpen' ,
 'ExternOutput2' : 'NormalClosed' if ( Ii1 . comm . recv [ 54 ] & 0x2 ) == 0 else 'NormalOpen' ,
 'ExternOutput3' : 'NormalClosed' if ( Ii1 . comm . recv [ 54 ] & 0x4 ) == 0 else 'NormalOpen' ,
 'ExternOutput4' : 'NormalClosed' if ( Ii1 . comm . recv [ 54 ] & 0x8 ) == 0 else 'NormalOpen' ,
 'ExternInput1' : 'Connected' if ( Ii1 . comm . recv [ 54 ] & 0x10 ) != 0 else 'Unconnected' ,
 'ExternInput2' : 'Connected' if ( Ii1 . comm . recv [ 54 ] & 0x20 ) != 0 else 'Unconnected' ,
 'ExternInput3' : 'Connected' if ( Ii1 . comm . recv [ 54 ] & 0x40 ) != 0 else 'Unconnected' ,
 'ExternInput4' : 'Connected' if ( Ii1 . comm . recv [ 54 ] & 0x80 ) == 0 else 'Unconnected' ,
 'Fire' : 'Deactive' if ( Ii1 . comm . recv [ 50 ] & 0x2 ) == 0 else 'Active' ,
 'LastSixRecords' : O0oo . get5SwipeJSON ( 0 )
       } )
     else :
      if O0000OO0o == 1 :
       IiIi1iI1I = ( {
 'Time' : O0oo . timeOfCon . strftime ( "%Y-%m-%d %H:%M:%S" ) ,
       'Door1#' : 'Closed' if Ii1 . comm . recv [ 28 ] == 0 else 'Open' ,
 'LastSixRecords' : O0oo . get5SwipeJSON ( 0 )
       } )
      elif O0000OO0o == 2 :
       IiIi1iI1I = ( {
 'Time' : O0oo . timeOfCon . strftime ( "%Y-%m-%d %H:%M:%S" ) ,
       'Door1#' : 'Closed' if Ii1 . comm . recv [ 28 ] == 0 else 'Open' ,
 'Door2#' : 'Closed' if Ii1 . comm . recv [ 29 ] == 0 else 'Open' ,
 'LastSixRecords' : O0oo . get5SwipeJSON ( 0 )
       } )
      else :
       IiIi1iI1I = ( {
 'Time' : O0oo . timeOfCon . strftime ( "%Y-%m-%d %H:%M:%S" ) ,
       'Door1#' : 'Closed' if Ii1 . comm . recv [ 28 ] == 0 else 'Open' ,
 'Door2#' : 'Closed' if Ii1 . comm . recv [ 29 ] == 0 else 'Open' ,
 'Door3#' : 'Closed' if Ii1 . comm . recv [ 30 ] == 0 else 'Open' ,
 'Door4#' : 'Closed' if Ii1 . comm . recv [ 31 ] == 0 else 'Open' ,
 'LastSixRecords' : O0oo . get5SwipeJSON ( 0 )
       } )
     if 180000000 > Ii1 . conSN > 170000000 :
      o0oOOooo0oo00Oo = [ ]
      i1iI1iIIIIiii = [ ]
      I1II1ii = 0
      i11i = 0
      if Ii1 . comm . recv [ 34 ] & 0x80 == 0 :
       O0O0oOOoo = "Not connected"
      else :
       O0O0oOOoo = "Connected"
       OOO0OO0oo = Ii1 . comm . recv [ 32 ] + ( Ii1 . comm . recv [ 33 ] << 8 ) + (
 Ii1 . comm . recv [ 34 ] << 16 )
       for Oo00 in range ( 20 ) :
        if ( OOO0OO0oo & ( 1 << Oo00 ) ) > 0 :
         if 17 - 17: Ii * Oo / i1I - i1I - iI1iII1I1I1i * I1Ii1I1
         o0oOOooo0oo00Oo . append ( Oo00 + 1 )
         I1II1ii += 1
        else :
         if 79 - 79: IiI11Ii111 + OooOoo . IIiIIiIi11I1 - Oo
         i1iI1iIIIIiii . append ( Oo00 + 1 )
         i11i += 1
      if Ii1 . comm . recv [ 30 ] & 0x80 == 0 :
       OoO0I1111iI11i = "Not connected"
      else :
       OoO0I1111iI11i = "Connected"
       OOO0OO0oo = Ii1 . comm . recv [ 28 ] + ( Ii1 . comm . recv [ 29 ] << 8 ) + (
 Ii1 . comm . recv [ 30 ] << 16 )
       for Oo00 in range ( 20 ) :
        if ( OOO0OO0oo & ( 1 << Oo00 ) ) > 0 :
         if 62 - 62: ooo000 * oOO / IiI11Ii111
         o0oOOooo0oo00Oo . append ( Oo00 + 21 )
         I1II1ii += 1
        else :
         if 7 - 7: I1Ii1I1
         i1iI1iIIIIiii . append ( Oo00 + 21 )
         i11i += 1
         if 65 - 65: I1Ii1I1 - IIiIIiIi11I1 . i1 + i1iiIII111
      oo00OOooOO = ( { "Cabinet01-20InputPort" : O0O0oOOoo ,
      "Cabinet21-40InputPort" : OoO0I1111iI11i ,
      "OpenedCabinetDoor" : o0oOOooo0oo00Oo ,
 "ClosededCabinetDoor" : i1iI1iIIIIiii } )
      IiIi1iI1I . update ( oo00OOooOO )
      if 74 - 74: IIiIIiIi11I1 . i1iiIII111 - IIiIIiIi11I1 . Iii1i
     o0oOoOo0O00o = (
 { "success" : True , "msg" : "controller instructions execute successfully ok" , "code" : 1 , "ControllerSN" : Ii1 . conSN ,
 "ControllerInformation" : IiIi1iI1I } )
    elif ( Ii1 . method == 'DownloadSwipe' ) :
     if ( Ii1 . recordCount > 0 ) :
      o0oOoOo0O00o = (
 { "success" : True , "msg" : "controller instructions execute successfully ok" , "code" : 1 ,
 "ControllerSN" : Ii1 . conSN ,
 "GetSwipeNumber" : Ii1 . recordCount ,
 "LastSwipeIndex" : Ii1 . recordIndexGot4GetSwipe ,
 "RecordInformation" : Ii1 . recordList } )
     else :
      o0oOoOo0O00o = (
 { "success" : True , "msg" : "controller instructions execute successfully ok" , "code" : 1 ,
 "ControllerSN" : Ii1 . conSN ,
 "GetSwipeNumber" : Ii1 . recordCount } )
    elif Ii1 . method == 'GetPrivilege' :
     if Ii1 . recordCount > 0 :
      o0oOoOo0O00o = (
 { "success" : True , "msg" : "controller instructions execute successfully ok" , "code" : 1 ,
 "ControllerSN" : Ii1 . conSN ,
 "GotPrivilegeNumber" : Ii1 . recordCount ,
 "LastPrivilegeIndex" : Ii1 . recordIndexGot4GetSwipe ,
 "RecordInformation" : Ii1 . recordList } )
     else :
      o0oOoOo0O00o = (
 { "success" : True , "msg" : "controller instructions execute successfully ok" , "code" : 1 ,
 "ControllerSN" : Ii1 . conSN ,
 "GotPrivilegeNumber" : Ii1 . recordCount } )
    elif Ii1 . method == 'GetTimeProfiles' :
     if Ii1 . recordCount > 0 :
      o0oOoOo0O00o = (
 { "success" : True , "msg" : "controller instructions execute successfully ok" , "code" : 1 ,
 "ControllerSN" : Ii1 . conSN ,
 "GotTimeProfileNumber" : Ii1 . recordCount ,
 "RecordInformation" : Ii1 . recordList } )
     else :
      o0oOoOo0O00o = (
 { "success" : True , "msg" : "controller instructions execute successfully ok" , "code" : 1 ,
 "ControllerSN" : Ii1 . conSN ,
 "GotTimeProfileNumber" : Ii1 . recordCount } )
    elif Ii1 . method == 'GetPrivilegeTotal' :
     o0oOoOo0O00o = (
 { "success" : True , "msg" : "controller instructions execute successfully ok" , "code" : 1 , "ControllerSN" : Ii1 . conSN ,
 "PrivilegeTotal" : struct . unpack_from ( "I" , Ii1 . comm . recv , 8 ) [ 0 ] } )
     Ii11ii11 = struct . unpack_from ( "I" , Ii1 . comm . recv , 16 ) [ 0 ]
     if Ii11ii11 > 0 :
      o0oOoOo0O00o = (
 { "success" : True , "msg" : "controller instructions execute successfully ok" , "code" : 1 ,
 "ControllerSN" : Ii1 . conSN ,
 "PrivilegeTotal" : struct . unpack_from ( "I" , Ii1 . comm . recv , 8 ) [ 0 ] ,
 "DeletedPrivileteTotal" : Ii11ii11 } )
      if 82 - 82: oOO % iI1iII1I1I1i / i1iiIII111
    elif Ii1 . method == 'GetDoorControlParameter' :
     oOO00 = ( 'NormalOpen' , 'NormalClosed' , 'OnLine' )
     OOoo0ooOO0O00 = [ "OnLine" , "OnLine" , "OnLine" , "OnLine" ]
     ooo00OoO0oooOoO = "OnLine"
     if 25 - 25: Oo + Ii - i1I * iI1iII1I1I1i . i1I - I11iiIi11i1I
     if 18 - 18: I11iiIi11i1I . Ii * Ooo0Ooo % i1I
     if 62 - 62: i1I / OooOoo / ooo000 . IiI11Ii111 * IiI11Ii111
     if 42 - 42: Ooo0Ooo - i1 % ooo000 + oOo0O00 + iI1iII1I1I1i
     if 18 - 18: IiI11Ii111 - I11iiIi11i1I
     for Oo00 in range ( 4 ) :
      if Ii1 . comm . recv [ 64 * Oo00 + 9 ] in ( 1 , 2 , 3 ) :
       OOoo0ooOO0O00 [ Oo00 ] = oOO00 [ Ii1 . comm . recv [ 64 * Oo00 + 9 ] - 1 ]
     if Ii1 . conSN > 400000000 :
      o0oOoOo0O00o = (
 { "success" : True , "msg" : "controller instructions execute successfully ok" , "code" : 1 ,
 "ControllerSN" : Ii1 . conSN ,
 "1#DoorControlMode" : OOoo0ooOO0O00 [ 0 ] ,
 "1#DoorOpenDelay(seconds)" : Ii1 . comm . recv [ 64 * 0 + 10 ] ,
 "2#DoorControlMode" : OOoo0ooOO0O00 [ 1 ] ,
 "2#DoorOpenDelay(seconds)" : Ii1 . comm . recv [ 64 * 1 + 10 ] ,
 "3#DoorControlMode" : OOoo0ooOO0O00 [ 2 ] ,
 "3#DoorOpenDelay(seconds)" : Ii1 . comm . recv [ 64 * 2 + 10 ] ,
 "4#DoorControlMode" : OOoo0ooOO0O00 [ 3 ] ,
 "4#DoorOpenDelay(seconds)" : Ii1 . comm . recv [ 64 * 3 + 10 ]
 } )
     elif Ii1 . conSN > 200000000 :
      o0oOoOo0O00o = (
 { "success" : True , "msg" : "controller instructions execute successfully ok" , "code" : 1 ,
 "ControllerSN" : Ii1 . conSN ,
 "1#DoorControlMode" : OOoo0ooOO0O00 [ 0 ] ,
 "1#DoorOpenDelay(seconds)" : Ii1 . comm . recv [ 64 * 0 + 10 ] ,
 "2#DoorControlMode" : OOoo0ooOO0O00 [ 1 ] ,
 "2#DoorOpenDelay(seconds)" : Ii1 . comm . recv [ 64 * 1 + 10 ]
 } )
     else :
      o0oOoOo0O00o = (
 { "success" : True , "msg" : "controller instructions execute successfully ok" , "code" : 1 ,
 "ControllerSN" : Ii1 . conSN ,
 "1#DoorControlMode" : OOoo0ooOO0O00 [ 0 ] ,
 "1#DoorOpenDelay(seconds)" : Ii1 . comm . recv [ 64 * 0 + 10 ]
 } )
      if 39 - 39: i1iiIII111 % oOO * I1I * I1I / oOo0O00 % IiIIii11Ii
    elif Ii1 . method == 'QueryPrivilege' :
     i111I1iI1I = struct . unpack_from ( "I" , Ii1 . comm . recv , 8 ) [ 0 ]
     if i111I1iI1I == 0 :
      o0oOoOo0O00o = ( { "success" : False , "msg" : "Controller run commmand failed" , "code" : 0 , "Reason" : "This card is not authorized" ,
 "ControllerSN" : Ii1 . conSN } )
     else :
      o0oOoOo0O00o = (
 { "success" : True , "msg" : "controller instructions execute successfully ok" , "code" : 1 ,
 "ControllerSN" : Ii1 . conSN ,
 "Privilege" : ( self . getPrivilegInfo ( Ii1 ) ) } )
      if 75 - 75: Ooo0Ooo * oOO * Ooo0Ooo + I11iiIi11i1I . Oo
    elif Ii1 . method == 'GetPrivilegeWithSelectedID' :
     i111I1iI1I = struct . unpack_from ( "I" , Ii1 . comm . recv , 8 ) [ 0 ]
     if i111I1iI1I == 0 :
      o0oOoOo0O00o = (
 { "success" : False , "msg" : "Controller run commmand failed" , "code" : 0 ,
 "Reason" : "No Privile(Getting Finished)" ,
 "ControllerSN" : Ii1 . conSN } )
     elif i111I1iI1I == 0xffffffff :
      o0oOoOo0O00o = ( { "success" : False , "msg" : "Controller run commmand failed" , "code" : 0 , "Reason" : "the privilege is deleted" ,
 "ControllerSN" : Ii1 . conSN } )
     else :
      o0oOoOo0O00o = (
 { "success" : True , "msg" : "controller instructions execute successfully ok" , "code" : 1 ,
 "ControllerSN" : Ii1 . conSN ,
 "Privilege" : ( self . getPrivilegInfo ( Ii1 ) ) } )
   elif Ii1 . comm . runStatus == 1 :
    o0oOoOo0O00o = ( { "success" : False , "msg" : "Controller run commmand failed" , "code" : 0 , "ControllerSN" : Ii1 . conSN ,
 "ReturnPacket" : str ( binascii . hexlify ( Ii1 . comm . recv ) , encoding = 'UTF-8' ) } )
   else :
    o0oOoOo0O00o = ( { "success" : False , "msg" : "Controller Communicate Failed" , "code" : 0 , "ControllerSN" : Ii1 . conSN } )
    if 4 - 4: Ii / Ii * ooOOO / I1Ii1I1
  elif Ii1 . method in [ 'UploadAllPrivileges' , 'UploadAllPrivilegesByZip' ] :
   if 37 - 37: OooOoo + oOo0O00 . oOO / IiIIii11Ii . Oo - IiI11Ii111
   if Ii1 . comm . runStatus == 0 :
    o0oOoOo0O00o = (
 { "success" : True , "msg" : "controller instructions execute successfully ok" , "code" : 1 , "ControllerSN" : Ii1 . conSN } )
    if Ii1 . totalPrivilege <= ( Ii1 . sentPrivilegeIndex + Ii1 . cardCount ) :
     o0oOoOo0O00o = (
 { "success" : True , "msg" : "controller instructions execute successfully ok" , "code" : 1 , "UploadStep" : "Upload Privileges Completely" ,
 "UploadedPrivilegeNumber" : ( Ii1 . sentPrivilegeIndex + Ii1 . cardCount ) ,
 "ControllerSN" : Ii1 . conSN } )
    else :
     o0oOoOo0O00o = (
 { "success" : True , "msg" : "controller instructions execute successfully ok" , "code" : 1 ,
 "UploadStep" : "Please continue uploading the remaining permissions..." ,
 "UploadedPrivilegeNumber" : ( Ii1 . sentPrivilegeIndex + Ii1 . cardCount ) ,
 "ControllerSN" : Ii1 . conSN } )
   elif Ii1 . comm . runStatus == 1 :
    o0oOoOo0O00o = ( { "success" : False , "msg" : "Controller run commmand failed" , "code" : 0 ,
 "Reason" : "Privileges are uploaded in the order of card number asc, and the total number of privileges and the number of transmitted privileges are specified" ,
 "ControllerSN" : Ii1 . conSN } )
   else :
    o0oOoOo0O00o = ( { "success" : False , "msg" : "Controller Communicate Failed" , "code" : 0 , "ControllerSN" : Ii1 . conSN } )
    if 87 - 87: i1 % oOO * i1 - oOo0O00 % Ii * ooo000
    if 50 - 50: i1iiIII111 * Ii % ooOOO . I1I
  elif Ii1 . method in [ 'UploadAllTimeProfiles' , 'UploadHolidayControl' , 'UploadAllScheduledTasks' ] :
   if 80 - 80: IiIIii11Ii / oOO % IiI11Ii111 * I1I
   if Ii1 . comm . runStatus == 0 :
    o0oOoOo0O00o = (
 { "success" : True , "msg" : "controller instructions execute successfully ok" , "code" : 1 , "ControllerSN" : Ii1 . conSN } )
   elif Ii1 . comm . runStatus == 1 :
    o0oOoOo0O00o = ( { "success" : False , "msg" : "Controller run commmand failed" , "code" : 0 , "Reason" : "Configration incorrect" ,
 "ControllerSN" : Ii1 . conSN } )
   else :
    o0oOoOo0O00o = ( { "success" : False , "msg" : "Controller Communicate Failed" , "code" : 0 , "ControllerSN" : Ii1 . conSN } )
    if 100 - 100: oOo0O00 / I1Ii1I1 - i1i1i1111I * I1Ii1I1 / I11iiIi11i1I * Oo
  elif Ii1 . method == 'ExtendedFunctions' :
   if 49 - 49: Ooo0Ooo
   if Ii1 . comm . runStatus == 0 :
    o0oOoOo0O00o = (
 { "success" : True , "msg" : "controller instructions execute successfully ok" , "code" : 1 , "ControllerSN" : Ii1 . conSN } )
    if 36 - 36: OooOoo + i1I / Iii1i + iI1iII1I1I1i + OooOoo
    if 6 - 6: IiI11Ii111 + Ii
    if 100 - 100: oOo0O00 % i1I - IiIIii11Ii % i1iiIII111 . i1 % I1Ii1I1
    if 67 - 67: I11iiIi11i1I
    if 21 - 21: oOO % i1i1i1111I - i1 + I1I
    if 85 - 85: IiIIii11Ii + I1I + IiI11Ii111
    if Ii1 . externFuncName == 'SetOpenDoorSuperPassword' :
     if Ii1 . comm . recv [ 8 ] == 1 :
      pass
     else :
      o0oOoOo0O00o = (
 { "success" : False , "msg" : "Controller run commmand failed" , "code" : 0 ,
 "ControllerSN" : Ii1 . conSN } )
      if 68 - 68: Iii1i % IiIIii11Ii . i1 - IiI11Ii111
    if Ii1 . externFuncName == 'GetOpenDoorSuperPassword' :
     iIIiII11Ii1I = 0xEF - 0x5c
     OO = Ii1 . comm . recv [ 212 ] + ( Ii1 . comm . recv [ 213 ] << 8 ) + (
 Ii1 . comm . recv [ 212 + iIIiII11Ii1I ] << 16 )
     Iiii11i1ii = Ii1 . comm . recv [ 212 + 2 ] + ( Ii1 . comm . recv [ 213 + 2 ] << 8 ) + (
 Ii1 . comm . recv [ 212 + iIIiII11Ii1I + 1 ] << 16 )
     Ii1o0ooO0OoooooO = Ii1 . comm . recv [ 212 + 4 ] + ( Ii1 . comm . recv [ 213 + 4 ] << 8 ) + (
 Ii1 . comm . recv [ 212 + iIIiII11Ii1I + 2 ] << 16 )
     iIII1I = Ii1 . comm . recv [ 212 + 6 ] + ( Ii1 . comm . recv [ 213 + 6 ] << 8 ) + (
 Ii1 . comm . recv [ 212 + iIIiII11Ii1I + 3 ] << 16 )
     OO = 0 if OO == 0xffffff else OO
     Iiii11i1ii = 0 if Iiii11i1ii == 0xffffff else Iiii11i1ii
     Ii1o0ooO0OoooooO = 0 if Ii1o0ooO0OoooooO == 0xffffff else Ii1o0ooO0OoooooO
     iIII1I = 0 if iIII1I == 0xffffff else iIII1I
     if 56 - 56: ooo000 . Oo * oOO
     o0oOoOo0O00o = (
 { "success" : True , "msg" : "controller instructions execute successfully ok" , "code" : 1 ,
 "ControllerSN" : Ii1 . conSN ,
 "Password#1" : OO ,
 "Password#2" : Iiii11i1ii ,
 "Password#3" : Ii1o0ooO0OoooooO ,
 "Password#4" : iIII1I

     } )
   elif Ii1 . comm . runStatus == 1 :
    o0oOoOo0O00o = (
 { "success" : False , "msg" : "Controller run commmand failed" , "code" : 0 , "ControllerSN" : Ii1 . conSN } )
   else :
    o0oOoOo0O00o = ( { "success" : False , "msg" : "Controller Communicate Failed" , "code" : 0 , "ControllerSN" : Ii1 . conSN } )
  elif Ii1 . method == 'FunctionConfig' :
   if 1 - 1: IiI11Ii111 * i1I . i1i1i1111I . I11iiIi11i1I + oOo0O00 . oOo0O00
   if Ii1 . comm . runStatus == 0 :
    o0oOoOo0O00o = (
 { "success" : True , "msg" : "controller instructions execute successfully ok" , "code" : 1 , "ControllerSN" : Ii1 . conSN } )
    if Ii1 . comm . recv [ 8 ] == 1 :
     pass
    else :
     o0oOoOo0O00o = (
 { "success" : False , "msg" : "Controller run commmand failed" , "code" : 0 ,
 "ControllerSN" : Ii1 . conSN } )
   elif Ii1 . comm . runStatus == 1 :
    o0oOoOo0O00o = (
 { "success" : False , "msg" : "Controller run commmand failed" , "code" : 0 , "ControllerSN" : Ii1 . conSN } )
   else :
    o0oOoOo0O00o = ( { "success" : False , "msg" : "Controller Communicate Failed" , "code" : 0 , "ControllerSN" : Ii1 . conSN } )
  elif Ii1 . method == 'SerialPortTransparentTransmission' :
   if 78 - 78: oOo0O00
   if Ii1 . comm . runStatus == 0 :
    o0oOoOo0O00o = (
 { "success" : True , "msg" : "controller instructions execute successfully ok" , "code" : 1 , "ControllerSN" : Ii1 . conSN } )
    if Ii1 . comm . recv [ 8 ] == 1 :
     pass
     if 98 - 98: ooo000 - Iii1i * I1Ii1I1 - oOO
     if Ii1 . uart485mode == 1 :
      o0oOoOo0O00o = (
 { "success" : True , "msg" : "controller instructions execute successfully ok" , "code" : 1 ,
 "ControllerSN" : Ii1 . conSN ,
 "AbnormalInformation" : "Barrier gate 485 communication abnormal" } )
      if Ii1 . comm . recv [ 44 ] == 0xa5 :
       if Ii1 . comm . recv [ 9 ] == 0x10 :
        iI1I1iI111Ii1 = Ii1 . comm . recv [ 10 : 26 ]
        ii = [ '%02X' % Oo00 for Oo00 in iI1I1iI111Ii1 ]
        if iI1I1iI111Ii1 [ 15 ] == tdz . checksum ( iI1I1iI111Ii1 ) :
         o0oOoOo0O00o = (
 { "success" : True , "msg" : "controller instructions execute successfully ok" , "code" : 1 ,
 "ControllerSN" : Ii1 . conSN ,
 "SerialPortData" : " " . join ( ii ) ,
 "BarrierGateInformation" : tdz . parseCommand ( iI1I1iI111Ii1 ) } )
        else :
         o0oOoOo0O00o = (
 { "success" : True , "msg" : "controller instructions execute successfully ok" , "code" : 1 ,
 "ControllerSN" : Ii1 . conSN ,
 "SerialPortData" : " " . join ( ii ) ,
 "AbnormalInformation" : "Checksum failure" } )
       elif Ii1 . comm . recv [ 9 ] == 0x0 :
        o0oOoOo0O00o = (
 { "success" : True , "msg" : "controller instructions execute successfully ok" , "code" : 1 ,
 "ControllerSN" : Ii1 . conSN ,
 "AbnormalInformation" : "Barrier gate 485 communication failure" } )
        if 74 - 74: oOO - i1i1i1111I % I1I + IiIIii11Ii * I1I
    else :
     o0oOoOo0O00o = ( { "success" : False , "msg" : "Controller run commmand failed" , "Reason" : "Serial ComPort not open" , "code" : 0 ,
 "ControllerSN" : Ii1 . conSN } )
   elif Ii1 . comm . runStatus == 1 :
    if 53 - 53: OooOoo % I1Ii1I1 / IiI11Ii111 / I1I + I1Ii1I1 . i1I
    o0oOoOo0O00o = ( { "success" : False , "msg" : "Controller run commmand failed" , "Reason" : "Serial ComPort not open" , "code" : 0 ,
 "ControllerSN" : Ii1 . conSN } )
    if 7 - 7: oOO - oOo0O00 . i1i1i1111I * Oo + I1I
   else :
    o0oOoOo0O00o = ( { "success" : False , "msg" : "Controller Communicate Failed" , "code" : 0 , "ControllerSN" : Ii1 . conSN } )
  else :
   if 93 - 93: i1iiIII111 - OooOoo + i1 * oOo0O00 . IiI11Ii111
   if Ii1 . comm . runStatus == 0 :
    o0oOoOo0O00o = (
 { "success" : True , "msg" : "controller instructions execute successfully ok" , "code" : 1 , "ControllerSN" : Ii1 . conSN } )
   elif Ii1 . comm . runStatus == 1 :
    o0oOoOo0O00o = (
 { "success" : False , "msg" : "Controller run commmand failed" , "code" : 0 , "ControllerSN" : Ii1 . conSN } )
   else :
    o0oOoOo0O00o = ( { "success" : False , "msg" : "Controller Communicate Failed" , "code" : 0 , "ControllerSN" : Ii1 . conSN } )
  iIII11I = ( { "jsonrpc" : "2.0" , "result" : o0oOoOo0O00o , "id" : Ii1 . rpcID } )
  if 89 - 89: i1I / IiIIii11Ii % Ooo0Ooo + Iii1i / i1iiIII111
  if 32 - 32: Ooo0Ooo * ooOOO
  if Ii1 . paramsCmd is None :
   pass
  elif len ( Ii1 . paramsCmd ) > 1 :
   if Ii1 . comm . runStatus == 0 :
    Ii1 . paramsResultOK . append ( Ii1 . conSN )
   elif Ii1 . comm . runStatus == 1 :
    Ii1 . paramsResultFailed . append ( Ii1 . conSN )
   elif Ii1 . comm . runStatus == 2 :
    Ii1 . paramsResultNotConnected . append ( Ii1 . conSN )
    if 47 - 47: i1iiIII111 * IIiIIiIi11I1
   else :
    Ii1 . paramsResultNotConnected . append ( Ii1 . conSN )
   Ii1 . paramsResultDetail . append ( o0oOoOo0O00o )
   OOO0oo0 = len ( Ii1 . paramsCmd )
   if Ii1 . paramsIndex < OOO0oo0 :
    if 78 - 78: ooOOO
    oo0Oo0oO0 = self . dealParams ( request , Ii1 )
    if oo0Oo0oO0 is not None :
     if 18 - 18: ooOOO / i1i1i1111I * i1i1i1111I * I11iiIi11i1I . Iii1i
     if 75 - 75: i1I - Ii / ooOOO % oOO % IIiIIiIi11I1
     Ii1 . lastCommandByte = bytes ( oo0Oo0oO0 )
     Ii1 . comm . run ( Ii1 . lastCommandByte )
     if 84 - 84: ooo000 + i1
     if 99 - 99: oOo0O00 * iI1iII1I1I1i / I11iiIi11i1I % ooo000 . IiIIii11Ii
     Ii1 . tryMaxTimesCount = wgGlobal . commTimeout10ms
     i11ii = deferLater ( reactor , 0.01 , lambda : request )
     i11ii . addCallback ( self . _delayedRender )
     return
   else :
    if 65 - 65: i1
    if 79 - 79: I11iiIi11i1I / iI1iII1I1I1i / I1Ii1I1 / i1I % OooOoo * IIiIIiIi11I1
    if 46 - 46: i1
    if 98 - 98: i1i1i1111I / IiIIii11Ii + Ii / I1I
    if 67 - 67: IIiIIiIi11I1 - Ii - Ii
    if 84 - 84: I11iiIi11i1I . ooOOO * ooOOO
    o0oOoOo0O00o = (
 { "success" : True , "msg" : "controller instructions execute successfully ok" , "code" : 1 ,
 "detail" : Ii1 . paramsResultDetail } )
    if OOO0oo0 == len ( Ii1 . paramsResultOK ) :
     pass
    else :
     o0oOoOo0O00o = ( { "success" : False , "msg" : "Controller run commmand failed" , "code" : 0 ,
 "FailedControllerSN" : Ii1 . paramsResultFailed ,
 "NotConnectedControllerSN" : Ii1 . paramsResultNotConnected ,
 "detail" : Ii1 . paramsResultDetail } )
    iIII11I = ( { "jsonrpc" : "2.0" , "result" : o0oOoOo0O00o , "id" : Ii1 . rpcID } )
    if 75 - 75: I1Ii1I1 % ooo000 - i1I + i1i1i1111I * I11iiIi11i1I
    if 33 - 33: I11iiIi11i1I / IiIIii11Ii - IIiIIiIi11I1 + IIiIIiIi11I1
    if 78 - 78: I11iiIi11i1I
    if 18 - 18: i1 / I11iiIi11i1I . ooOOO * I1I
    if 20 - 20: IiIIii11Ii / IiI11Ii111
    if 92 - 92: i1
    if 54 - 54: Oo * IIiIIiIi11I1 - IIiIIiIi11I1
    if 27 - 27: Ooo0Ooo / i1 . OooOoo . i1I % I1Ii1I1
    if 18 - 18: Ii % OooOoo % I1Ii1I1 . I1Ii1I1 + ooo000 % IiI11Ii111
    if 73 - 73: oOo0O00 . I1I . IiI11Ii111 - IIiIIiIi11I1 - i1 / Ooo0Ooo
  request . responseHeaders . addRawHeader ( b"content-type" , b"application/json;charset=UTF-8" )
  request . responseHeaders . addRawHeader ( b"Access-Control-Allow-Origin" , b"*" )
  request . responseHeaders . addRawHeader ( b"Access-Control-Allow-Method" ,
 b"POST, GET, OPTIONS" )
  request . responseHeaders . addRawHeader ( b"Access-Control-Allow-Headers" , b"Content-Type" )
  if 77 - 77: I1Ii1I1 % IiI11Ii111
  if 85 - 85: I1Ii1I1 + i1iiIII111 * IiI11Ii111 - i1i1i1111I % i1
  if 49 - 49: Oo / I1I . I11iiIi11i1I % Ooo0Ooo
  if 20 - 20: I1Ii1I1 . IiI11Ii111 - Ii % I11iiIi11i1I % Oo
  if 12 - 12: OooOoo * oOO % Ooo0Ooo . I11iiIi11i1I
  if 54 - 54: I11iiIi11i1I . i1 - IIiIIiIi11I1
  if 99 - 99: i1I + i1I * Ooo0Ooo . OooOoo
  if 33 - 33: i1i1i1111I / IiI11Ii111 + Ooo0Ooo % ooOOO
  if 25 - 25: Iii1i
  if 74 - 74: I11iiIi11i1I . ooo000 . I1I * i1iiIII111 * Ooo0Ooo
  if 47 - 47: OooOoo
  if 55 - 55: ooOOO % oOO + i1I - IiI11Ii111 + ooo000 + I1I
  if 53 - 53: IIiIIiIi11I1 % IiIIii11Ii / oOO % ooOOO - oOo0O00
  request . write ( bytes ( json . dumps ( iIII11I , sort_keys = False , indent = 4 ) , encoding = 'utf8' ) )
  if 74 - 74: ooo000 * OooOoo * Oo
  if 96 - 96: I1Ii1I1 - Oo
  request . finish ( )
  if 28 - 28: i1iiIII111 - IiI11Ii111 % Ii * ooo000 / Iii1i
  self . arrUsers . pop ( request )
  if 12 - 12: IiI11Ii111 - Ooo0Ooo
  if 12 - 12: ooOOO
  if 29 - 29: IiI11Ii111 . ooo000 . ooo000
  if 79 - 79: oOo0O00 % IiI11Ii111 * I1Ii1I1 . IIiIIiIi11I1 * Iii1i - I1I
  if 85 - 85: I1I + IiI11Ii111 . I11iiIi11i1I % i1 * IiI11Ii111
  if 22 - 22: IiIIii11Ii . Iii1i / i1i1i1111I / ooo000 + ooo000 + ooo000
  if 76 - 76: Iii1i % i1i1i1111I
  if 12 - 12: oOO + IiIIii11Ii % ooOOO + IiI11Ii111 / I1I
 def _responseFailed ( self , err , call , requestSessionID = None ) :
  if 59 - 59: Iii1i % I1Ii1I1 + I11iiIi11i1I - Oo
  try :
   if 72 - 72: I11iiIi11i1I
   if 38 - 38: I11iiIi11i1I . oOO + i1I
   mMonitorInfo . wglog ( '??????????????????? _responseFailed' )
   if requestSessionID is not None :
    if requestSessionID in self . arrUsers :
     self . arrUsers [ requestSessionID ] . responseStop = True
     self . arrUsers . pop ( requestSessionID )
    call . cancel ( )
   mMonitorInfo . wglog ( err )
  except Exception as OOOOo :
   pass
   mMonitorInfo . wglog ( "1303" )
   mMonitorInfo . wglog ( OOOOo )
   if 33 - 33: ooo000 - IIiIIiIi11I1 % i1iiIII111 / iI1iII1I1I1i - Iii1i % IIiIIiIi11I1
   if 15 - 15: ooo000 . i1 * i1
   if 41 - 41: I11iiIi11i1I + Iii1i % ooOOO * i1
 def _responseError ( self , request ) :
  if 37 - 37: ooo000
  if 87 - 87: i1i1i1111I + I1Ii1I1 % i1iiIII111 - I1I + ooOOO % I1Ii1I1
  if 96 - 96: IIiIIiIi11I1 / I1I * i1 / I1I + I1I / i1
  iIII11I = ( { "jsonrpc" : "2.0" ,
 "error" : { "code" : - 32700 ,
 "message" : "Parse error: Invalid Command Format" ,
 "version" : wgGlobal . softwareVersion } ,
 "id" : None } )
  if 80 - 80: Oo / i1i1i1111I . IIiIIiIi11I1
  if 79 - 79: oOO
  if 6 - 6: IiI11Ii111 + IIiIIiIi11I1 + ooOOO % IIiIIiIi11I1
  if 24 - 24: ooo000 + i1I / Ii / Ooo0Ooo % IIiIIiIi11I1
  if 70 - 70: I11iiIi11i1I
  if 45 - 45: I1Ii1I1 * Oo - I11iiIi11i1I * iI1iII1I1I1i
  if 41 - 41: Iii1i . I1I * i1I - i1iiIII111 . IiI11Ii111 + ooOOO
  if 24 - 24: i1 + IIiIIiIi11I1 + i1iiIII111 % I1Ii1I1 + IIiIIiIi11I1
  if 55 - 55: IiIIii11Ii - IiIIii11Ii
  if 52 - 52: I1Ii1I1 - OooOoo % i1I
  if 88 - 88: ooOOO . i1
  if 72 - 72: I1I - OooOoo / Iii1i - I1Ii1I1
  if request in self . arrUsers :
   Ii1 = self . arrUsers [ request ]
   if Ii1 . responseStop :
    return
   Ii1 . responseStop = True
   if Ii1 . errMessage is None :
    pass
   else :
    iIII11I = Ii1 . errMessage
   self . arrUsers . pop ( request )
   if 54 - 54: I11iiIi11i1I / i1iiIII111 % oOo0O00 - ooOOO
   if 72 - 72: ooo000 . I1Ii1I1 . I1I . IIiIIiIi11I1 + Oo
   if 58 - 58: ooOOO + IiIIii11Ii + oOO % IiIIii11Ii + Ooo0Ooo . Oo
   if 45 - 45: I1I % i1I % oOO * oOo0O00 / i1iiIII111 + I11iiIi11i1I
   if 63 - 63: i1i1i1111I - IiI11Ii111 - iI1iII1I1I1i + OooOoo * i1iiIII111 / Ooo0Ooo
  request . responseHeaders . addRawHeader ( b"content-type" , b"application/json;charset=UTF-8" )
  request . write ( bytes ( json . dumps ( iIII11I , sort_keys = False , indent = 4 ) , encoding = 'utf8' ) )
  request . finish ( )
  if 81 - 81: ooo000 % i1i1i1111I . i1iiIII111 / i1iiIII111 / i1iiIII111
  if 84 - 84: ooOOO * ooo000 % ooOOO
 def _responseInvalidProd ( self , request ) :
  if 57 - 57: i1I * iI1iII1I1I1i % Ooo0Ooo
  if 22 - 22: OooOoo . i1
  if 85 - 85: i1i1i1111I * I1Ii1I1 / ooo000
  iIII11I = ( { "jsonrpc" : "2.0" ,
 "error" : { "code" : - 32701 ,
 "message" : "This device is incompatible; please purchase genuine products from formal channels..." ,
 "version" : wgGlobal . softwareVersion } ,
 "id" : None } )
  if request in self . arrUsers :
   Ii1 = self . arrUsers [ request ]
   if Ii1 . responseStop :
    return
   Ii1 . responseStop = True
   if Ii1 . errMessage is None :
    pass
   else :
    iIII11I = Ii1 . errMessage
   self . arrUsers . pop ( request )
  request . responseHeaders . addRawHeader ( b"content-type" , b"application/json;charset=UTF-8" )
  request . write ( bytes ( json . dumps ( iIII11I , sort_keys = False , indent = 4 ) , encoding = 'utf8' ) )
  request . finish ( )
  if 14 - 14: i1i1i1111I
 def _responselowversionCon ( self , request ) :
  if 61 - 61: Iii1i . I11iiIi11i1I - Oo . IiI11Ii111 + OooOoo
  if 11 - 11: oOo0O00 - i1 / oOo0O00 * OooOoo - I11iiIi11i1I / I1Ii1I1
  if 4 - 4: IiIIii11Ii
  iIII11I = ( { "jsonrpc" : "2.0" ,
 "error" : { "code" : - 32701 ,
 "message" : "The driver version of this device is too low to upgrade. Please contact the dealer or manufacturer..." ,
 "version" : wgGlobal . softwareVersion } ,
 "id" : None } )
  if request in self . arrUsers :
   Ii1 = self . arrUsers [ request ]
   if Ii1 . responseStop :
    return
   Ii1 . responseStop = True
   if Ii1 . errMessage is None :
    pass
   else :
    iIII11I = Ii1 . errMessage
   self . arrUsers . pop ( request )
  request . responseHeaders . addRawHeader ( b"content-type" , b"application/json;charset=UTF-8" )
  request . write ( bytes ( json . dumps ( iIII11I , sort_keys = False , indent = 4 ) , encoding = 'utf8' ) )
  request . finish ( )
  if 42 - 42: oOO - oOO + OooOoo - oOO
  if 23 - 23: iI1iII1I1I1i % i1I * I11iiIi11i1I - oOO * oOo0O00
  if 45 - 45: i1 % iI1iII1I1I1i . IiIIii11Ii + Ooo0Ooo
  if 34 - 34: Iii1i + Iii1i
  if 67 - 67: oOo0O00 + IIiIIiIi11I1
  if 69 - 69: IIiIIiIi11I1
  if 97 - 97: Iii1i + oOo0O00 - i1 % Iii1i
  if 71 - 71: Ooo0Ooo / Ooo0Ooo % ooo000
  if 32 - 32: ooo000 * ooo000
  if 29 - 29: Ooo0Ooo . i1 * I11iiIi11i1I
  if 98 - 98: ooOOO * oOO + Ooo0Ooo + i1i1i1111I / I1Ii1I1
  if 18 - 18: iI1iII1I1I1i . iI1iII1I1I1i % ooOOO
 def dealParams ( self , request , wgCommStatusVal ) :
  oooo0oo = True
  if 14 - 14: OooOoo + iI1iII1I1I1i * Iii1i
  if 30 - 30: OooOoo
  if 2 - 2: i1iiIII111 / oOo0O00 - IiIIii11Ii - iI1iII1I1I1i
  Iii = None
  oo0Oo0oO0 = None
  if 35 - 35: oOO . I1Ii1I1 - ooOOO / ooo000
  if 2 - 2: i1
  if 50 - 50: Ii / iI1iII1I1I1i / Oo * I11iiIi11i1I
  if 86 - 86: ooo000 - oOo0O00
  if 42 - 42: Ii * oOO
  if 67 - 67: ooOOO
  if wgCommStatusVal . method not in [ 'GetRecordBuffer' , 'GetQRCode' , 'CreateQRCode' , 'VisitorAdd' ,
 'VisitorCancel' , 'VisitorClearAll' ,
 'VisitorConfiguration' ,
 'ExternFunctions' ] :
   if 62 - 62: I1I + Ii + I1I * i1 . Ooo0Ooo * i1iiIII111
   if 2 - 2: i1I + Oo
   if 51 - 51: Ii . i1I
   if 89 - 89: IiI11Ii111 * IiIIii11Ii / i1 . I1Ii1I1
   if 64 - 64: IiI11Ii111
   if 44 - 44: Ii . OooOoo + oOO * OooOoo . i1 - i1iiIII111
   if 72 - 72: iI1iII1I1I1i + I1I * ooo000 . OooOoo + Ii + IIiIIiIi11I1
   if 91 - 91: oOo0O00 % IIiIIiIi11I1 % i1I / I1Ii1I1
   Iii = wgCommStatusVal . paramsCmd [ wgCommStatusVal . paramsIndex ]
   if 'ControllerSN' not in Iii :
    oooo0oo = False
   else :
    wgCommStatusVal . conSN = Iii [ 'ControllerSN' ]
    if 70 - 70: iI1iII1I1I1i + IiI11Ii111 + oOO
  if oooo0oo :
   if 21 - 21: I11iiIi11i1I
   if 20 - 20: ooOOO + IiIIii11Ii % Iii1i - I11iiIi11i1I
   if wgCommStatusVal . comm is None :
    wgCommStatusVal . comm = wgConRPC ( )
   OoOOOOO = wgCommStatusVal . comm . getNewXid ( )
   oo0Oo0oO0 = None
   if 1 < 0 :
    pass
   elif wgCommStatusVal . method == 'RemoteOpenDoor' :
    i1II1I1iIIIii1I1 = 0 if 'DoorNO' not in Iii else Iii [ 'DoorNO' ]
    O000 = 1 if 'InExit' not in Iii else Iii [ 'InExit' ]
    o0o0o00Oo = 0 if 'VirtualCardNO' not in Iii else Iii [ 'VirtualCardNO' ]
    I111IiiiI = 0
    o0oOO00Ooo0o = 0
    oo0Oo0oO0 = None
    wgCommStatusVal . arrFloors4remoteopen = [ ]
    wgCommStatusVal . vcard4remoteopen = o0o0o00Oo
    if "DirectToFloorNO" in Iii :
     i1II1I1iIIIii1I1 = 1
     if 68 - 68: oOO - IiI11Ii111 / i1iiIII111 + i1iiIII111 - Oo . I11iiIi11i1I
     if type ( Iii [ "DirectToFloorNO" ] ) is int :
      I111IiiiI = Iii [ "DirectToFloorNO" ]
     elif type ( Iii [ "DirectToFloorNO" ] ) is list :
      I111IiiiI = Iii [ "DirectToFloorNO" ] [ 0 ]
      iiii = [ x for x in Iii [ "DirectToFloorNO" ] ]
      wgCommStatusVal . arrFloors4remoteopen = iiii
      oo0Oo0oO0 = WGCommand . cmdremoteOpenDoorByCloudServer1024 ( wgCommStatusVal . conSN , i1II1I1iIIIii1I1 ,
 O000 ,
 o0o0o00Oo ,
 OoOOOOO , iiii , o0oOO00Ooo0o )
    elif "AllowFloorsNO" in Iii :
     i1II1I1iIIIii1I1 = 1
     o0oOO00Ooo0o = 5
     if type ( Iii [ "AllowFloorsNO" ] ) is int :
      I111IiiiI = Iii [ "AllowFloorsNO" ] + 40
     elif type ( Iii [ "AllowFloorsNO" ] ) is list :
      I111IiiiI = Iii [ "AllowFloorsNO" ] [ 0 ] + 40
      if 14 - 14: Oo / i1I . ooo000 * IIiIIiIi11I1
      iiii = [ x + 40 for x in Iii [ "AllowFloorsNO" ] ]
      if 68 - 68: i1I * Ii + i1 + i1i1i1111I % Iii1i
      if 27 - 27: i1i1i1111I - Ii - oOO + Ooo0Ooo * Ii + IiI11Ii111
      wgCommStatusVal . arrFloors4remoteopen = iiii
      oo0Oo0oO0 = WGCommand . cmdremoteOpenDoorByCloudServer1024 ( wgCommStatusVal . conSN , i1II1I1iIIIii1I1 ,
 O000 ,
 o0o0o00Oo ,
 OoOOOOO , iiii , o0oOO00Ooo0o )
      if 35 - 35: i1i1i1111I . i1i1i1111I + I11iiIi11i1I / Oo . i1
    elif 170000000 < wgCommStatusVal . conSN < 179999999 and i1II1I1iIIIii1I1 > 0 :
     I111IiiiI = i1II1I1iIIIii1I1
     i1II1I1iIIIii1I1 = 1
     if 69 - 69: I1I / i1 % I1Ii1I1 % oOO
     if 96 - 96: Oo - i1I * iI1iII1I1I1i + Ooo0Ooo * Oo
    if oo0Oo0oO0 is None :
     oo0Oo0oO0 = WGCommand . cmdremoteOpenDoorByCloudServer ( wgCommStatusVal . conSN , i1II1I1iIIIii1I1 , O000 , o0o0o00Oo ,
 OoOOOOO , I111IiiiI , o0oOO00Ooo0o )
   elif wgCommStatusVal . method == 'Reset' :
    i1II1I1iIIIii1I1 = 0 if 'ExternBoardPort' not in Iii else Iii [ 'ExternBoardPort' ]
    iI1I1i11II = 0
    oo0Oo0oO0 = WGCommand . cmdremoteExternBoardByCloudServer ( wgCommStatusVal . conSN , i1II1I1iIIIii1I1 , iI1I1i11II , OoOOOOO )
   elif wgCommStatusVal . method == 'NormalOpen' :
    i1II1I1iIIIii1I1 = 0 if 'ExternBoardPort' not in Iii else Iii [ 'ExternBoardPort' ]
    iI1I1i11II = 0xfff0 if 'Delay(seconds)' not in Iii else Iii [ 'Delay(seconds)' ]
    if iI1I1i11II >= 0xffff :
     iI1I1i11II = 0xfff0
    oo0Oo0oO0 = WGCommand . cmdremoteExternBoardByCloudServer ( wgCommStatusVal . conSN , i1II1I1iIIIii1I1 , iI1I1i11II , OoOOOOO )
    if 41 - 41: IiIIii11Ii + Ooo0Ooo - i1iiIII111 * i1 % i1I
   elif wgCommStatusVal . method == 'QueryControllerStatus' :
    i1II1IIIII11 = b'17260000FFFFFFFF'
    oo0Oo0oO0 = WGCommand . cmdgetComm64X37 ( wgCommStatusVal . conSN , i1II1IIIII11 , OoOOOOO )
   elif wgCommStatusVal . method == 'Primit64ByteCommand' :
    i1II1IIIII11 = '00' if 'CommandPacket' not in Iii else Iii [ 'CommandPacket' ]
    if ',' in i1II1IIIII11 :
     i1II1IIIII11 = i1II1IIIII11 . split ( ',' )
     oo0Oo0oO0 = WGCommand . cmdgetComm1024X37 ( wgCommStatusVal . conSN , i1II1IIIII11 ,
 OoOOOOO )
    else :
     oo0Oo0oO0 = WGCommand . cmdgetComm64X37 ( wgCommStatusVal . conSN , i1II1IIIII11 , OoOOOOO )
   elif wgCommStatusVal . method == 'SerialPortTransparentTransmission' :
    i1II1IIIII11 = '00' if 'HexCommandPacket' not in Iii else Iii [ 'HexCommandPacket' ]
    oo0Oo0oO0 = WGCommand . cmdgetCommFromUARTInfo ( wgCommStatusVal . conSN , i1II1IIIII11 , OoOOOOO )
    if 'HexCommandPacket' not in Iii :
     I1IIIIIi1i = tdz . getCommand ( Iii )
     if I1IIIIIi1i is not None :
      wgCommStatusVal . uart485mode = 1
      i1II1IIIII11 = I1IIIIIi1i
      oo0Oo0oO0 = WGCommand . cmdgetCommFromUARTInfo ( wgCommStatusVal . conSN , i1II1IIIII11 , OoOOOOO )
      oo0Oo0oO0 [ 44 ] = 0xa5
      if 37 - 37: I11iiIi11i1I . oOo0O00 / oOo0O00 . I1I / i1iiIII111
      if 3 - 3: oOO + oOO % i1I % Oo / iI1iII1I1I1i . IiIIii11Ii
   elif wgCommStatusVal . method == 'ExtendedFunctions' :
    if 20 - 20: IiIIii11Ii + i1I
    if 32 - 32: oOo0O00 + i1i1i1111I
    if 74 - 74: I1I % i1i1i1111I * i1iiIII111 * IIiIIiIi11I1
    if 23 - 23: i1I * IiI11Ii111 . oOo0O00 * Ii
    if 94 - 94: i1i1i1111I - i1iiIII111 . Ooo0Ooo + Oo - i1
    if 96 - 96: Iii1i % ooo000 * oOo0O00 . Ii % oOO + i1I
    if 'FunctionName' in Iii :
     if Iii [ 'FunctionName' ] == 'GetOpenDoorSuperPassword' :
      if 20 - 20: i1 % Ii / ooo000
      wgCommStatusVal . externFuncName = Iii [ 'FunctionName' ]
      oo0Oo0oO0 = WGCommand . cmdgetConfigure1024ByCloudServer ( wgCommStatusVal . conSN , OoOOOOO )
     if Iii [ 'FunctionName' ] == 'SetOpenDoorSuperPassword' :
      wgCommStatusVal . externFuncName = Iii [ 'FunctionName' ]
      oOOOo = "8C0000FFFFFFFF0{}000000" . format ( 1 )
      II1 = 0 if 'Password#1' not in Iii else Iii [ 'Password#1' ]
      IiI1I1 = 0 if 'Password#2' not in Iii else Iii [ 'Password#2' ]
      i1iII11i1 = 0 if 'Password#3' not in Iii else Iii [ 'Password#3' ]
      iII = 0 if 'Password#4' not in Iii else Iii [ 'Password#4' ]
      o0O = [ II1 , IiI1I1 , i1iII11i1 , iII ]
      for OoOO00o in o0O :
       oOOOo += WGTools . getHexString4Byte ( OoOO00o )
      o0O0oOo = "8C0000FFFFFFFF0{}000000" . format ( 2 )
      for OoOO00o in o0O :
       o0O0oOo += WGTools . getHexString4Byte ( OoOO00o )
      iIi1ii1ii1iI = "8C0000FFFFFFFF0{}000000" . format ( 3 )
      for OoOO00o in o0O :
       iIi1ii1ii1iI += WGTools . getHexString4Byte ( OoOO00o )
      IiIIIiIi11ii1 = "8C0000FFFFFFFF0{}000000" . format ( 4 )
      for OoOO00o in o0O :
       IiIIIiIi11ii1 += WGTools . getHexString4Byte ( OoOO00o )
      O0o000oO000 = ( oOOOo . ljust ( 126 , '0' ) , o0O0oOo . ljust ( 126 , '0' ) ,
 iIi1ii1ii1iI . ljust ( 126 , '0' ) , IiIIIiIi11ii1 . ljust ( 126 , '0' ) )
      if 6 - 6: Ii / I1I + IiI11Ii111
      i1II1IIIII11 = WGTools . getarrStringWithsplitDou ( O0o000oO000 )
      if ',' in i1II1IIIII11 :
       i1II1IIIII11 = i1II1IIIII11 . split ( ',' )
       oo0Oo0oO0 = WGCommand . cmdgetComm1024X37 ( wgCommStatusVal . conSN , i1II1IIIII11 ,
 OoOOOOO )
      else :
       oo0Oo0oO0 = WGCommand . cmdgetComm64X37 ( wgCommStatusVal . conSN , i1II1IIIII11 , OoOOOOO )
   elif wgCommStatusVal . method == 'AdjustTime' :
    OOoO = None if 'NewDateTime' not in Iii else Iii [ 'NewDateTime' ]
    oo0Oo0oO0 = WGCommand . cmdAdjustTime ( wgCommStatusVal . conSN , OOoO , OoOOOOO )
    if 35 - 35: iI1iII1I1I1i
   elif wgCommStatusVal . method == 'SetDoorControlMode' :
    i1II1I1iIIIii1I1 = 0 if 'DoorNO' not in Iii else Iii [ 'DoorNO' ]
    oOO00 = 3
    if 'DoorControlMode' in Iii :
     if Iii [ 'DoorControlMode' ] == 'NormalOpen' :
      oOO00 = 1
     if Iii [ 'DoorControlMode' ] == 'NormalClosed' :
      oOO00 = 2
    iI1I1i11II = 3 if 'OpenDelay(seconds)' not in Iii else Iii [ 'OpenDelay(seconds)' ]
    oo0Oo0oO0 = WGCommand . cmdSetControlModeByCloudServer ( wgCommStatusVal . conSN , i1II1I1iIIIii1I1 , oOO00 , iI1I1i11II ,
 OoOOOOO )
   elif wgCommStatusVal . method == 'GetDoorControlParameter' :
    oo0Oo0oO0 = WGCommand . cmdGetControlModeByCloudServer ( wgCommStatusVal . conSN , OoOOOOO )
   elif wgCommStatusVal . method in [ 'UploadAllPrivileges' , 'UploadAllPrivilegesByZip' , 'AddEditPrivilege' ,
 'DeletePrivilege' ] :
    i1I11Iii = None if "Privilege" not in Iii else Iii [ "Privilege" ]
    oo0Oo0oO0 = None
    if i1I11Iii is None :
     oooo0oo = False
    else :
     OO00o = [ ]
     O0ooo0O00oo = None
     for III1iiI in i1I11Iii :
      if 88 - 88: oOo0O00 + I11iiIi11i1I / ooOOO
      if 8 - 8: ooo000 + oOO . i1 + i1iiIII111 / OooOoo - i1i1i1111I
      O00 = 0
      O0ooo0O00oo = III1iiI
      if 'CardNO' in III1iiI :
       if type ( III1iiI [ 'CardNO' ] ) is list :
        O00 = III1iiI [ 'CardNO' ] [ 0 ]
       elif type ( III1iiI [ 'CardNO' ] ) is int :
        O00 = III1iiI [ 'CardNO' ]
        if 94 - 94: IiI11Ii111 % i1 * i1 - i1I
      if O00 == 0 :
       if oo0Oo0oO0 == None :
        oooo0oo = False
       break
      else :
       if 20 - 20: IiI11Ii111 + iI1iII1I1I1i + OooOoo % I1I
       if 84 - 84: oOO % I1I
       if 18 - 18: I11iiIi11i1I * Ooo0Ooo / OooOoo
       if 84 - 84: i1iiIII111 / oOO . Oo % i1iiIII111 / OooOoo
       IIII111I = datetime . datetime ( 2099 , 12 , 31 , 23 , 59 , 59 )
       try :
        OO0OOo = datetime . datetime . strptime (
 "2020-01-01 00:00:00" if 'BeginDateTime' not in III1iiI else III1iiI [ 'BeginDateTime' ] ,
 "%Y-%m-%d %H:%M:%S" )
        if OO0OOo > IIII111I :
         OO0OOo = IIII111I
       except Exception as OOOOo :
        pass
        OO0OOo = datetime . datetime . strptime ( "2020-01-01 00:00:00" , "%Y-%m-%d %H:%M:%S" )
        if 20 - 20: OooOoo . I1Ii1I1
       try :
        Ii11 = datetime . datetime . strptime (
 "2099-12-31 23:59:59" if 'EndDateTime' not in III1iiI else III1iiI [ 'EndDateTime' ] ,
 "%Y-%m-%d %H:%M:%S" )
        if Ii11 > IIII111I :
         Ii11 = IIII111I
       except Exception as OOOOo :
        pass
        if 4 - 4: ooOOO % i1I % i1 % i1 % i1
        Ii11 = IIII111I
        if 88 - 88: IiIIii11Ii
        if 11 - 11: OooOoo - IiI11Ii111 % IiIIii11Ii - ooo000 / IIiIIiIi11I1 - OooOoo
        if 21 - 21: Ii / Ooo0Ooo
        if 98 - 98: ooOOO
        if 53 - 53: I1I * I1I
       iiiIi1ii1iii = 255 if 'Door1TimeProfileID' not in III1iiI else III1iiI [
 'Door1TimeProfileID' ]
       O0 = 255 if 'Door2TimeProfileID' not in III1iiI else III1iiI [
 'Door2TimeProfileID' ]
       Ooo0 = 255 if 'Door3TimeProfileID' not in III1iiI else III1iiI [
 'Door3TimeProfileID' ]
       O0oo0 = 255 if 'Door4TimeProfileID' not in III1iiI else III1iiI [
 'Door4TimeProfileID' ]
       i1I1IIiII , III11111111i1 = 0 , 0
       i11II = 0 if 'UserPassword' not in III1iiI else III1iiI [ 'UserPassword' ]
       if 'OnlyOnce' in III1iiI :
        if III1iiI [ 'OnlyOnce' ] == 'Enabled' :
         III11111111i1 = 0x2
         if 14 - 14: Ii - I11iiIi11i1I / ooo000 % Ii
         if 72 - 72: Ii % oOo0O00 / ooo000 - oOo0O00
       if 'UnifiedControlTimeProfileArray' in III1iiI :
        OOO0OO0oo = 0
        OOO0 = 0
        for i1Ii11ii1 in III1iiI [ 'UnifiedControlTimeProfileArray' ] :
         if i1Ii11ii1 == 0 :
          iiiIi1ii1iii = 0
          OOO0 = 1
          break
         if i1Ii11ii1 == 1 :
          OOO0 = 1
          break
         if ( i1Ii11ii1 >= 2 ) and ( i1Ii11ii1 <= 33 ) :
          OOO0OO0oo |= ( 1 << ( i1Ii11ii1 - 2 ) )
        if OOO0 == 0 :
         iiiIi1ii1iii = OOO0OO0oo & 0xff
         O0 = ( OOO0OO0oo >> 8 ) & 0xff
         Ooo0 = ( OOO0OO0oo >> 16 ) & 0xff
         O0oo0 = ( OOO0OO0oo >> 24 ) & 0xff
         if 90 - 90: ooo000 / i1iiIII111 - Iii1i - iI1iII1I1I1i / i1I
         III11111111i1 = 3
         if 92 - 92: i1i1i1111I - ooOOO
         i11II = 0
         if "HolidayControlArray" in III1iiI :
          OOO0OO0oo = 0
          OOO0 = 0
          for i1Ii11ii1 in III1iiI [ 'HolidayControlArray' ] :
           if i1Ii11ii1 == 0 :
            iiiIi1ii1iii = 0
            OOO0 = 1
            break
           if i1Ii11ii1 == 1 :
            OOO0 = 1
            break
           if ( i1Ii11ii1 >= 2 ) and ( i1Ii11ii1 <= 25 ) :
            OOO0OO0oo |= ( 1 << ( i1Ii11ii1 - 2 ) )
          i11II = OOO0OO0oo
       IIiiiII = [ ]
       if "AllowFloorsNO" in III1iiI or "AllowCabinetDoorNO" in III1iiI :
        if not 180000000 > wgCommStatusVal . conSN > 170000000 :
         oooo0oo = False
        else :
         Ooo = [ ]
         if "AllowFloorsNO" in III1iiI :
          Ooo = III1iiI [ 'AllowFloorsNO' ]
         if "AllowCabinetDoorNO" in III1iiI :
          Ooo = III1iiI [ 'AllowCabinetDoorNO' ]
         o0ooo0O0Oo00O , IIiiI11iii , iII1II1i , ii1Ii , O0o0Ooo00 , OOo00oo0 = 0 , 0 , 0 , 0 , 0 , 0
         if "ForceMoreFloor" in III1iiI :
          OOo00oo0 = III1iiI [ "ForceMoreFloor" ]
         for Oo00 in range ( 0 , len ( Ooo ) ) :
          ooiIiii111IIii = Ooo [ Oo00 ]
          if 0 >= ooiIiii111IIii :
           pass
          elif 8 >= ooiIiii111IIii > 0 :
           o0ooo0O0Oo00O = o0ooo0O0Oo00O | ( 1 << ( ooiIiii111IIii - 1 ) )
          elif 16 >= ooiIiii111IIii > 8 :
           IIiiI11iii = IIiiI11iii | ( 1 << ( ooiIiii111IIii - 1 - 8 ) )
          elif 24 >= ooiIiii111IIii > 16 :
           iII1II1i = iII1II1i | ( 1 << ( ooiIiii111IIii - 1 - 16 ) )
          elif 32 >= ooiIiii111IIii > 24 :
           ii1Ii = ii1Ii | ( 1 << ( ooiIiii111IIii - 1 - 24 ) )
          elif 40 >= ooiIiii111IIii > 32 :
           O0o0Ooo00 = O0o0Ooo00 | ( 1 << ( ooiIiii111IIii - 1 - 32 ) )
         IIiiiII = [ o0ooo0O0Oo00O , IIiiI11iii , iII1II1i , ii1Ii , O0o0Ooo00 , OOo00oo0 ]
       Ii1I = [ ]
       if len ( IIiiiII ) == 0 :
        if "moreCardGroupIndex" in III1iiI :
         Ii1I = III1iiI [ "moreCardGroupIndex" ]
         if 79 - 79: IiI11Ii111 * oOO % iI1iII1I1I1i / i1I * Ii + i1i1i1111I
       if oooo0oo :
        if type ( III1iiI [ 'CardNO' ] ) is list :
         if 99 - 99: IiIIii11Ii + i1i1i1111I - Ooo0Ooo
         for Oo00 in range ( 0 , len ( III1iiI [ 'CardNO' ] ) ) :
          O00 = III1iiI [ 'CardNO' ] [ Oo00 ]
          if O00 >= 0x100000000 :
           wgCommStatusVal . cardbyte8 = True
          OO00o . append (
 [ O00 , OO0OOo , Ii11 , iiiIi1ii1iii ,
 O0 ,
 Ooo0 , O0oo0 , i11II , 0 ,

          III11111111i1 , IIiiiII ,
 Ii1I ] )
        elif type ( III1iiI [ 'CardNO' ] ) is int :
         O00 = III1iiI [ 'CardNO' ]
         if 71 - 71: oOo0O00
         if 61 - 61: ooOOO . i1iiIII111
         if O00 >= 0x100000000 :
          wgCommStatusVal . cardbyte8 = True
         OO00o . append (
 [ O00 , OO0OOo , Ii11 , iiiIi1ii1iii ,
 O0 ,
 Ooo0 , O0oo0 , i11II , 0 ,

         III11111111i1 , IIiiiII ,
 Ii1I ] )
         if 68 - 68: I1I % I1I * Ii % Oo
         if 74 - 74: I11iiIi11i1I * IIiIIiIi11I1 . IiI11Ii111 * oOo0O00 * IiI11Ii111 - i1iiIII111
         if 34 - 34: IiI11Ii111 % OooOoo + i1I % I11iiIi11i1I - IIiIIiIi11I1
         if 64 - 64: i1 % oOo0O00
         if 25 - 25: Oo
         if 4 - 4: Oo * I1I * Ooo0Ooo % Ooo0Ooo
         if 6 - 6: oOO + I1I * Iii1i
         if 82 - 82: oOo0O00 * ooOOO
         if 9 - 9: I11iiIi11i1I + i1iiIII111 % Iii1i
     if oooo0oo :
      OO00o . sort ( key = itemgetter ( 0 ) )
      wgCommStatusVal . privilegesAll = OO00o
      wgCommStatusVal . cardCount = len ( OO00o )
      wgCommStatusVal . indexOfPrivilege = 0
      wgCommStatusVal . totalPrivilege = wgCommStatusVal . cardCount if "PrivilegeTotal" not in Iii else Iii [
 "PrivilegeTotal" ]
      wgCommStatusVal . sentPrivilegeIndex = 0 if "UploadedPrivilegeNumber" not in Iii else Iii [
 "UploadedPrivilegeNumber" ]
      if 15 - 15: i1iiIII111 + i1I - Iii1i % I1I / i1iiIII111 + IIiIIiIi11I1
      if 61 - 61: OooOoo
      if wgCommStatusVal . method in [ 'UploadAllPrivileges' ,
 'UploadAllPrivilegesByZip' ] :
       wgCommStatusVal . totalPrivilege2024err512 = wgCommStatusVal . totalPrivilege
       if 62 - 62: iI1iII1I1I1i * oOO
       if 43 - 43: Ii - oOo0O00 % i1iiIII111 % oOO
       if 69 - 69: I1I
       if 74 - 74: IiIIii11Ii + OooOoo . Iii1i + ooo000 + oOO * I1Ii1I1
       if wgCommStatusVal . totalPrivilege2024err512 > 0 and wgCommStatusVal . totalPrivilege2024err512 % 512 == 0 :
        if wgCommStatusVal . cardCount + wgCommStatusVal . indexOfPrivilege + wgCommStatusVal . sentPrivilegeIndex >= wgCommStatusVal . totalPrivilege :
         if 74 - 74: I1Ii1I1 - Oo % i1iiIII111 + Ii * ooOOO
         ooOOOo0Oo = copy . deepcopy ( OO00o [ len ( OO00o ) - 1 ] )
         OO00o . append ( ooOOOo0Oo )
         OO00o [ len ( OO00o ) - 1 ] [ 0 ] = OO00o [ len ( OO00o ) - 1 ] [ 0 ] + 1
         if 15 - 15: I1I . iI1iII1I1I1i . I11iiIi11i1I
         wgCommStatusVal . totalPrivilege = wgCommStatusVal . totalPrivilege + 1
         wgCommStatusVal . cardCount = wgCommStatusVal . cardCount + 1
      if wgGlobal . supportNXP4G > 0 and wgCommStatusVal . cardCount > 1 :
       i1II1IIIII11 = b'17260000FFFFFFFF'
       oo0Oo0oO0 = WGCommand . cmdgetComm64X37 ( wgCommStatusVal . conSN , i1II1IIIII11 , OoOOOOO )
       wgCommStatusVal . getAllSwipeStep = 901
      else :
       oo0Oo0oO0 = self . getPrivilegeCommand ( wgCommStatusVal )
      wgOptimizePrivilege . updatePrivilegeCommandMode ( wgCommStatusVal . conSN ,
 wgCommStatusVal . method , O0ooo0O00oo ,
 wgCommStatusVal . rpcID )
   elif wgCommStatusVal . method == 'PrivilegeClear' :
    oo0Oo0oO0 = WGCommand . cmdclearPriviege64ByCloudServer ( wgCommStatusVal . conSN , OoOOOOO )
   elif wgCommStatusVal . method == 'GetPrivilegeTotal' :
    oo0Oo0oO0 = WGCommand . cmdgetPriviegeNum64ByCloudServer ( wgCommStatusVal . conSN , OoOOOOO )
   elif wgCommStatusVal . method == 'QueryPrivilege' :
    if "CardNO" in Iii :
     if 4 - 4: OooOoo % i1iiIII111 / I11iiIi11i1I - oOo0O00
     if 100 - 100: Oo / OooOoo % I1I
     if 93 - 93: iI1iII1I1I1i
     if 50 - 50: Oo % oOo0O00 . IiI11Ii111 . i1iiIII111 . Ii - Oo
     if 67 - 67: oOo0O00 * i1I . I1I + I1I + oOo0O00 / ooOOO
     if 69 - 69: Oo - OooOoo + I1Ii1I1
     if type ( Iii [ 'CardNO' ] ) is list :
      O00 = Iii [ 'CardNO' ] [ 0 ]
      wgCommStatusVal . cardCount = len ( Iii [ "CardNO" ] )
      if 36 - 36: Iii1i
      oo0Oo0oO0 = WGCommand . cmdgetPriviegeInfoByCardNO64ByCloudServer ( wgCommStatusVal . conSN , O00 ,
 OoOOOOO )
     elif type ( Iii [ 'CardNO' ] ) is int :
      O00 = Iii [ 'CardNO' ]
      wgCommStatusVal . cardCount = 1
      if 80 - 80: Oo % oOO / oOO + ooOOO + OooOoo
      oo0Oo0oO0 = WGCommand . cmdgetPriviegeInfoByCardNO64ByCloudServer ( wgCommStatusVal . conSN , O00 ,
 OoOOOOO )
      if 91 - 91: i1 % i1i1i1111I / oOo0O00
   elif wgCommStatusVal . method == 'GetPrivilegeWithSelectedID' :
    if "PrivilegeIndex" in Iii :
     if len ( Iii [ "PrivilegeIndex" ] ) > 0 :
      wgCommStatusVal . cardCount = len ( Iii [ "PrivilegeIndex" ] )
      OoIiiIiiIIi111 = Iii [ "PrivilegeIndex" ] [ 0 ]
      oo0Oo0oO0 = WGCommand . cmdgetPriviegeInfoByIndex64ByCloudServer ( wgCommStatusVal . conSN ,
 OoIiiIiiIIi111 , OoOOOOO )
   elif wgCommStatusVal . method == 'DownloadSwipe' :
    if 81 - 81: iI1iII1I1I1i * IiIIii11Ii % i1iiIII111 + oOO / iI1iII1I1I1i . i1I
    wgCommStatusVal . getSwipeMaxlen = - 1 if "RecordNumberAtEveryTime" not in Iii else Iii [ "RecordNumberAtEveryTime" ]
    wgCommStatusVal . recordCount = 0
    wgCommStatusVal . recordList = [ ]
    OO0OOo = datetime . datetime . strptime ( "2020-01-01 00:00:00" , "%Y-%m-%d %H:%M:%S" )
    Ii11 = datetime . datetime . strptime ( "2099-12-31 23:59:59" , "%Y-%m-%d %H:%M:%S" )
    iIiII111IIiii = 0
    if "BeginDateTime" in Iii :
     try :
      OO0OOo = datetime . datetime . strptime ( Iii [ 'BeginDateTime' ] , "%Y-%m-%d %H:%M:%S" )
      iIiII111IIiii |= 1
     except Exception as OOOOo :
      pass
      pass
    if "EndDateTime" in Iii :
     try :
      Ii11 = datetime . datetime . strptime ( Iii [ 'EndDateTime' ] , "%Y-%m-%d %H:%M:%S" )
      iIiII111IIiii |= 2
     except Exception as OOOOo :
      pass
      pass
    wgCommStatusVal . dtpActivate = OO0OOo
    wgCommStatusVal . dtpDeactivate = Ii11
    wgCommStatusVal . getRecordTimeControl = iIiII111IIiii
    wgCommStatusVal . getRecordGotLastIndex = - 1 if "GotRecordLastIndex" not in Iii else Iii [
 "GotRecordLastIndex" ]
    wgCommStatusVal . receviedSwipeIndex = - 1 if "GotRecordLastIndex" not in Iii else Iii [
 "GotRecordLastIndex" ]
    if wgGlobal . supportNXP4G > 0 :
     i1II1IIIII11 = b'17260000FFFFFFFF'
     oo0Oo0oO0 = WGCommand . cmdgetComm64X37 ( wgCommStatusVal . conSN , i1II1IIIII11 , OoOOOOO )
     wgCommStatusVal . getAllSwipeStep = 901
    else :
     oo0Oo0oO0 = WGCommand . cmdgetrecordParam1024ByCloudServer ( wgCommStatusVal . conSN ,
 wgCommStatusVal . receviedSwipeIndex + 1 ,
 OoOOOOO )
     wgCommStatusVal . getAllSwipeStep = 1
    self . nxp4GDelay ( )
    if 79 - 79: ooo000 + i1iiIII111 / i1iiIII111
   elif wgCommStatusVal . method == 'GetPrivilege' :
    if 59 - 59: i1i1i1111I . Oo - IIiIIiIi11I1 + iI1iII1I1I1i
    wgCommStatusVal . recordList . clear ( )
    wgCommStatusVal . getSwipeMaxlen = - 1 if "RecordNumberAtEveryTime" not in Iii else Iii [ "RecordNumberAtEveryTime" ]
    wgCommStatusVal . receviedSwipeIndex = - 1 if "GotRecordLastIndex" not in Iii else Iii [
 "GotRecordLastIndex" ]
    oo0Oo0oO0 = WGCommand . cmdgetPriviegeNum64ByCloudServer ( wgCommStatusVal . conSN , OoOOOOO )
    wgCommStatusVal . getAllSwipeStep = 1
    self . nxp4GDelay ( )
   elif wgCommStatusVal . method == 'GetTimeProfiles' :
    wgCommStatusVal . recordList . clear ( )
    wgCommStatusVal . getSwipeMaxlen = 255
    wgCommStatusVal . recordIndexGot4GetSwipe = 0
    oo0Oo0oO0 = WGCommand . cmdgetControlSegmentInfoByIndex1024ByCloudServer ( wgCommStatusVal . conSN ,
 wgCommStatusVal . recordIndexGot4GetSwipe ,
 OoOOOOO )
    if 22 - 22: IiI11Ii111 + OooOoo % I11iiIi11i1I
   elif wgCommStatusVal . method == 'ConfirmGotSwipe' :
    if "LastSwipeIndex" in Iii :
     oo0Oo0oO0 = WGCommand . cmdsetrecordIndexReadByCloudServer ( wgCommStatusVal . conSN ,
 Iii [ 'LastSwipeIndex' ] ,
 OoOOOOO )
     self . nxp4GDelay ( )
   elif wgCommStatusVal . method == 'FunctionConfig' :
    if "QRCodeTransparentTransmission" in Iii :
     if Iii [ 'QRCodeTransparentTransmission' ] == 'Enabled' :
      i1II1IIIII11 = "17F20000FFFFFFFF55AAAA55F10187"
     else :
      i1II1IIIII11 = "17F20000FFFFFFFF55AAAA55F10100"
     oo0Oo0oO0 = WGCommand . cmdgetComm64X37 ( wgCommStatusVal . conSN , i1II1IIIII11 , OoOOOOO )
    elif "ActiveRecordDSPushButtonEvent" in Iii :
     if Iii [ 'ActiveRecordDSPushButtonEvent' ] == 'Enabled' :
      i1II1IIIII11 = "178E0000FFFFFFFF01"
     else :
      i1II1IIIII11 = "178E0000FFFFFFFF00"
     oo0Oo0oO0 = WGCommand . cmdgetComm64X37 ( wgCommStatusVal . conSN , i1II1IIIII11 , OoOOOOO )
    elif ( "Input4DigitsPasswordAsCardNO" in Iii ) or ( "Input6DigitsPasswordAsCardNO" in Iii ) or (
 "Input8DigitsPasswordAsCardNO" in Iii ) :
     if 14 - 14: Oo * oOO + i1i1i1111I * oOo0O00
     if ( "Input4DigitsPasswordAsCardNO" in Iii ) and Iii [ 'Input4DigitsPasswordAsCardNO' ] == 'Enabled' :
      i1II1IIIII11 = "17F20000FFFFFFFF55AAAA55ED011F" + "DF 00 7E"
     elif ( "Input6DigitsPasswordAsCardNO" in Iii ) and Iii [ 'Input6DigitsPasswordAsCardNO' ] == 'Enabled' :
      i1II1IIIII11 = "17F20000FFFFFFFF55AAAA55ED012F" + "DF 00 7E"
     elif ( "Input8DigitsPasswordAsCardNO" in Iii ) and Iii [ 'Input8DigitsPasswordAsCardNO' ] == 'Enabled' :
      i1II1IIIII11 = "17F20000FFFFFFFF55AAAA55ED013F" + "DF 00 7E"
     else :
      i1II1IIIII11 = "17F20000FFFFFFFF55AAAA55ED0100" + "DF 00 00"
     oo0Oo0oO0 = WGCommand . cmdgetComm64X37 ( wgCommStatusVal . conSN , i1II1IIIII11 , OoOOOOO )
    elif "AllowNormalOpenFloors" in Iii :
     if 180000000 > wgCommStatusVal . conSN > 170000000 :
      Ooo = Iii [ 'AllowNormalOpenFloors' ]
      OOo0o0oOOoO = [ 0 , 0 , 0 , 0 , 0 ]
      I1I11ii1 = True
      for Oo00 in range ( 0 , len ( Ooo ) ) :
       ooiIiii111IIii = Ooo [ Oo00 ]
       if 0 >= ooiIiii111IIii :
        pass
       elif 40 >= ooiIiii111IIii > 0 :
        OOo0o0oOOoO [ ( ooiIiii111IIii - 1 ) >> 3 ] |= ( 1 << ( ( ooiIiii111IIii - 1 ) & 0x7 ) )
        I1I11ii1 = False
      if not I1I11ii1 :
       i1II1IIIII11 = "17F20000FFFFFFFF55AAAA551B00011C00011D0001"
       for ooiIiii111IIii in range ( len ( OOo0o0oOOoO ) ) :
        if 86 - 86: i1I
        i1II1IIIII11 += "{}00{}" . format ( '%02X' % ( ooiIiii111IIii + 0x14 ) ,
 '%02X' % OOo0o0oOOoO [ ooiIiii111IIii ] )
      else :
       i1II1IIIII11 = "17F20000FFFFFFFF55AAAA551B00001C00001D0000"
      oo0Oo0oO0 = WGCommand . cmdgetComm64X37 ( wgCommStatusVal . conSN , i1II1IIIII11 , OoOOOOO )
    elif "SerialPortTransparentTransmission" in Iii :
     if Iii [ 'SerialPortTransparentTransmission' ] == 'Enabled' :
      if 63 - 63: i1I
      if 'ModbusAddress' in Iii and Iii [ 'ModbusAddress' ] <= 255 :
       i1II1IIIII11 = "17F20000FFFFFFFF55AAAA55F90106EC0180EF01" + ( '%02X' % Iii [ 'ModbusAddress' ] )
      else :
       i1II1IIIII11 = "17F20000FFFFFFFF55AAAA55F90106EC0180EF0101"
     else :
      i1II1IIIII11 = "17F20000FFFFFFFF55AAAA55F90100EC0100EF0100"
     oo0Oo0oO0 = WGCommand . cmdgetComm64X37 ( wgCommStatusVal . conSN , i1II1IIIII11 , OoOOOOO )
    elif "Antiback" in Iii :
     if Iii [ 'Antiback' ] == 'Enabled' :
      if 'AntibackMode' in Iii and Iii [ 'AntibackMode' ] <= 255 :
       i1II1IIIII11 = "17840000FFFFFFFF" + ( '%02X' % Iii [ 'AntibackMode' ] )
      else :
       i1II1IIIII11 = "17840000FFFFFFFF01"
     else :
      i1II1IIIII11 = "17840000FFFFFFFF00"
     oo0Oo0oO0 = WGCommand . cmdgetComm64X37 ( wgCommStatusVal . conSN , i1II1IIIII11 , OoOOOOO )
    elif "Interlock" in Iii :
     if Iii [ 'Interlock' ] == 'Enabled' :
      if 'InterlockMode' in Iii and Iii [ 'InterlockMode' ] <= 255 :
       i1II1IIIII11 = "17A20000FFFFFFFF" + ( '%02X' % Iii [ 'InterlockMode' ] )
      else :
       i1II1IIIII11 = "17A20000FFFFFFFF01"
     else :
      i1II1IIIII11 = "17A20000FFFFFFFF00"
     oo0Oo0oO0 = WGCommand . cmdgetComm64X37 ( wgCommStatusVal . conSN , i1II1IIIII11 , OoOOOOO )
     if 77 - 77: oOO + iI1iII1I1I1i . oOo0O00 / ooo000
     if 9 - 9: IiI11Ii111 . i1iiIII111 - Ii - I1I . OooOoo
     if 75 - 75: OooOoo . OooOoo * oOO - ooo000 + i1I % iI1iII1I1I1i
     if 26 - 26: i1iiIII111 * oOo0O00
     if 73 - 73: Ooo0Ooo + IiIIii11Ii * i1I . IiI11Ii111 . ooo000 % OooOoo
     if 38 - 38: IiIIii11Ii
   elif wgCommStatusVal . method == 'GetRecordBuffer' :
    wgCommStatusVal . wgpacketList4Monitor = [ ]
    i1II1IIIII11 = b'172000009DC99A3B'
    wgCommStatusVal . conSN = 999999901
    oo0Oo0oO0 = WGCommand . cmdgetComm64X37 ( wgCommStatusVal . conSN , i1II1IIIII11 , OoOOOOO )
   elif wgCommStatusVal . method == 'GetQRCode' :
    wgCommStatusVal . wgpacketList4MonitorQR = [ ]
    i1II1IIIII11 = b'172000009EC99A3B'
    wgCommStatusVal . conSN = 999999902
    oo0Oo0oO0 = WGCommand . cmdgetComm64X37 ( wgCommStatusVal . conSN , i1II1IIIII11 , OoOOOOO )
    if 71 - 71: Iii1i
   elif wgCommStatusVal . method == 'ClearTimeProfiles' :
    wgCommStatusVal . sentcontrolsegIndex = - 1
    oo0Oo0oO0 = getcontrolsegCommand ( wgCommStatusVal )
   elif wgCommStatusVal . method == 'UploadAllTimeProfiles' :
    oooO00 = None if "TimeProfile" not in Iii else Iii [ "TimeProfile" ]
    oo0Oo0oO0 = None
    if oooO00 is None :
     oooo0oo = False
    else :
     OOOOO0o0oOoo0 = [ ]
     for i1Ii11ii1 in oooO00 :
      if 50 - 50: OooOoo - OooOoo + OooOoo
      iii1I1Iiii1I = 0 if 'TimeProfileID' not in i1Ii11ii1 else i1Ii11ii1 [ 'TimeProfileID' ]
      if ( iii1I1Iiii1I > 254 ) or ( iii1I1Iiii1I < 2 ) :
       if oo0Oo0oO0 is None :
        oooo0oo = False
       break
      else :
       try :
        OO0OOo = datetime . datetime . strptime (
 "2020-01-01" if 'BeginDate' not in i1Ii11ii1 else i1Ii11ii1 [ 'BeginDate' ] , "%Y-%m-%d" )
       except Exception as OOOOo :
        pass
        OO0OOo = datetime . datetime . strptime ( "2020-01-01" , "%Y-%m-%d" )
       try :
        Ii11 = datetime . datetime . strptime (
 "2099-12-31" if 'EndDate' not in i1Ii11ii1 else i1Ii11ii1 [ 'EndDate' ] , "%Y-%m-%d" )
       except Exception as OOOOo :
        pass
        Ii11 = datetime . datetime . strptime ( "2099-12-31" , "%Y-%m-%d" )
       OoO0O0OOOoo = 1 if 'Mon' not in i1Ii11ii1 else i1Ii11ii1 [ 'Mon' ]
       oO0o00OO00O = 1 if 'Tue' not in i1Ii11ii1 else i1Ii11ii1 [ 'Tue' ]
       iI1Ii1I1ii1 = 1 if 'Wed' not in i1Ii11ii1 else i1Ii11ii1 [ 'Wed' ]
       Oo00ooO000 = 1 if 'Thu' not in i1Ii11ii1 else i1Ii11ii1 [ 'Thu' ]
       IiI1iII1I11 = 1 if 'Fri' not in i1Ii11ii1 else i1Ii11ii1 [ 'Fri' ]
       OOOoo00 = 1 if 'Sat' not in i1Ii11ii1 else i1Ii11ii1 [ 'Sat' ]
       O0oo0O00oOOoo = 1 if 'Sun' not in i1Ii11ii1 else i1Ii11ii1 [ 'Sun' ]
       if 65 - 65: ooOOO
       oOOOo0o0o00 = datetime . datetime . strptime (
 "00:00" if 'TimeZone1BeginTime' not in i1Ii11ii1 else i1Ii11ii1 [ 'TimeZone1BeginTime' ] , "%H:%M" )
       IiI1iIi = datetime . datetime . strptime (
 "00:00" if 'TimeZone1BeginTime' not in i1Ii11ii1 else i1Ii11ii1 [ 'TimeZone1EndTime' ] , "%H:%M" )
       Ii1IIi1I11i = datetime . datetime . strptime (
 "00:00" if 'TimeZone2BeginTime' not in i1Ii11ii1 else i1Ii11ii1 [ 'TimeZone2BeginTime' ] , "%H:%M" )
       I1 = datetime . datetime . strptime (
 "00:00" if 'TimeZone2BeginTime' not in i1Ii11ii1 else i1Ii11ii1 [ 'TimeZone2EndTime' ] , "%H:%M" )
       ooOOO00oO00 = datetime . datetime . strptime (
 "00:00" if 'TimeZone3BeginTime' not in i1Ii11ii1 else i1Ii11ii1 [ 'TimeZone3BeginTime' ] , "%H:%M" )
       Oo0OoO = datetime . datetime . strptime (
 "00:00" if 'TimeZone3BeginTime' not in i1Ii11ii1 else i1Ii11ii1 [ 'TimeZone3EndTime' ] , "%H:%M" )
       if 58 - 58: i1iiIII111 * Ii % oOO . IiIIii11Ii
       OOOoO00 = 0 if 'NextLinkedTimeProfileID' not in i1Ii11ii1 else i1Ii11ii1 [ 'NextLinkedTimeProfileID' ]
       O0o000o0O00o = 1 if 'HolidayControl' not in i1Ii11ii1 else i1Ii11ii1 [ 'HolidayControl' ]
       if 41 - 41: Iii1i . Iii1i . Oo - Oo % iI1iII1I1I1i
       if 45 - 45: oOo0O00 * ooOOO
       i1i1i11i1ii1i = 0 if 'LimitedAccessTimesMode' not in i1Ii11ii1 else i1Ii11ii1 [ 'LimitedAccessTimesMode' ]
       o0o = 0 if 'CurrentDayLimitedTimes' not in i1Ii11ii1 else i1Ii11ii1 [ 'CurrentDayLimitedTimes' ]
       O0o0OOO00 = 0 if 'CurrentMonthLimitedTimes' not in i1Ii11ii1 else i1Ii11ii1 [ 'CurrentMonthLimitedTimes' ]
       OoOo = 0 if 'TimeZone1LimitedTimes' not in i1Ii11ii1 else i1Ii11ii1 [ 'TimeZone1LimitedTimes' ]
       OoOOoOo = 0 if 'TimeZone2LimitedTimes' not in i1Ii11ii1 else i1Ii11ii1 [ 'TimeZone2LimitedTimes' ]
       oOo0Ooo0Oo0 = 0 if 'TimeZone3LimitedTimes' not in i1Ii11ii1 else i1Ii11ii1 [ 'TimeZone3LimitedTimes' ]
       if 83 - 83: iI1iII1I1I1i
       if 92 - 92: Ii . i1i1i1111I . i1I
       if 94 - 94: Iii1i - OooOoo - Iii1i
       if 5 - 5: ooOOO - i1iiIII111 / i1I - I11iiIi11i1I . IIiIIiIi11I1 * IIiIIiIi11I1
       if 56 - 56: i1i1i1111I * i1 % ooo000 . IIiIIiIi11I1
       OOOOO0o0oOoo0 . append (
 [ iii1I1Iiii1I , OO0OOo , Ii11 , OoO0O0OOOoo , oO0o00OO00O , iI1Ii1I1ii1 , Oo00ooO000 , IiI1iII1I11 , OOOoo00 , O0oo0O00oOOoo ,
 oOOOo0o0o00 , IiI1iIi , Ii1IIi1I11i , I1 , ooOOO00oO00 , Oo0OoO ,
 OOOoO00 , O0o000o0O00o , i1i1i11i1ii1i , o0o ,
 O0o0OOO00 ,
 OoOo , OoOOoOo , oOo0Ooo0Oo0 ] )
     if oooo0oo :
      OOOOO0o0oOoo0 . sort ( key = itemgetter ( 0 ) )
      wgCommStatusVal . controlsegAll = OOOOO0o0oOoo0
      wgCommStatusVal . controlsegCount = len ( OOOOO0o0oOoo0 )
      wgCommStatusVal . indexOfcontrolseg = - 1
      wgCommStatusVal . totalcontrolseg = wgCommStatusVal . controlsegCount
      wgCommStatusVal . sentcontrolsegIndex = 0
      oo0Oo0oO0 = getcontrolsegCommand ( wgCommStatusVal )
   elif wgCommStatusVal . method == 'UploadHolidayControl' :
    oooO00 = None if "Holiday(OffWork)" not in Iii else Iii [ "Holiday(OffWork)" ]
    I1IIi11 = None if "NeedWork" not in Iii else Iii [ "NeedWork" ]
    IIiII1ii1i = 0 if "HolidayID" not in Iii else Iii [ "HolidayID" ]
    oo0Oo0oO0 = None
    if ( oooO00 is None ) and I1IIi11 is None :
     oooo0oo = False
    else :
     OOOOO0o0oOoo0 = [ ]
     for o0Oo00 in [ oooO00 , I1IIi11 ] :
      O0O = 0
      if o0Oo00 is oooO00 :
       O0O = 1
      if o0Oo00 is I1IIi11 :
       O0O = 2
      for i1Ii11ii1 in o0Oo00 :
       OO0OOo = datetime . datetime . strptime ( "2020-01-01 00:00:00" ,
 "%Y-%m-%d %H:%M:%S" )
       Ii11 = datetime . datetime . strptime ( "2099-12-31 23:59:59" ,
 "%Y-%m-%d %H:%M:%S" )
       if "BeginDateTime" in i1Ii11ii1 :
        try :
         OO0OOo = datetime . datetime . strptime ( i1Ii11ii1 [ 'BeginDateTime' ] , "%Y-%m-%d %H:%M:%S" )
        except Exception as OOOOo :
         pass
         pass
       if "EndDateTime" in i1Ii11ii1 :
        try :
         Ii11 = datetime . datetime . strptime ( i1Ii11ii1 [ 'EndDateTime' ] , "%Y-%m-%d %H:%M:%S" )
        except Exception as OOOOo :
         pass
         pass
         if 95 - 95: Ii / I1I
       if "BeginDate" in i1Ii11ii1 :
        try :
         OO0OOo = datetime . datetime . strptime ( "{} 00:00:00" . format ( i1Ii11ii1 [ 'BeginDate' ] ) ,
 "%Y-%m-%d %H:%M:%S" )
        except Exception as OOOOo :
         pass
         pass
       if "EndDate" in i1Ii11ii1 :
        try :
         Ii11 = datetime . datetime . strptime ( "{} 23:59:59" . format ( i1Ii11ii1 [ 'EndDate' ] ) ,
 "%Y-%m-%d %H:%M:%S" )
        except Exception as OOOOo :
         pass
         pass
       OOOOO0o0oOoo0 . append (
 [ O0O , OO0OOo , Ii11 ] )
       if 4 - 4: i1 % ooo000 - oOO . oOo0O00 * oOO - iI1iII1I1I1i
     if ( oooo0oo ) :
      if 3 - 3: i1iiIII111
      wgCommStatusVal . controlsegAll = OOOOO0o0oOoo0
      wgCommStatusVal . controlsegCount = len ( OOOOO0o0oOoo0 )
      wgCommStatusVal . indexOfcontrolseg = - 1
      wgCommStatusVal . totalcontrolseg = wgCommStatusVal . controlsegCount
      wgCommStatusVal . sentcontrolsegIndex = 0
      if 8 - 8: Ii * Oo - I1I
      wgCommStatusVal . holidaysNO = IIiII1ii1i
      oo0Oo0oO0 = self . getHolidayConfigCommand ( wgCommStatusVal )
   elif wgCommStatusVal . method == 'UploadAllScheduledTasks' :
    o0ooo0oO0oO0o = None if "Task" not in Iii else Iii [ "Task" ]
    oo0Oo0oO0 = None
    if o0ooo0oO0oO0o is None :
     oooo0oo = False
    else :
     iiII1 = [ ]
     iiI = False
     for i1Ii11ii1 in o0ooo0oO0oO0o :
      if 77 - 77: i1i1i1111I / Ooo0Ooo / ooo000 + Oo + i1I
      try :
       OO0OOo = datetime . datetime . strptime (
 "2020-01-01" if 'BeginDate' not in i1Ii11ii1 else i1Ii11ii1 [ 'BeginDate' ] , "%Y-%m-%d" )
      except Exception as OOOOo :
       pass
       OO0OOo = datetime . datetime . strptime ( "2020-01-01" , "%Y-%m-%d" )
      try :
       Ii11 = datetime . datetime . strptime (
 "2099-12-31" if 'EndDate' not in i1Ii11ii1 else i1Ii11ii1 [ 'EndDate' ] , "%Y-%m-%d" )
      except Exception as OOOOo :
       pass
       Ii11 = datetime . datetime . strptime ( "2099-12-31" , "%Y-%m-%d" )
      OoO0O0OOOoo = 1 if 'Mon' not in i1Ii11ii1 else i1Ii11ii1 [ 'Mon' ]
      oO0o00OO00O = 1 if 'Tue' not in i1Ii11ii1 else i1Ii11ii1 [ 'Tue' ]
      iI1Ii1I1ii1 = 1 if 'Wed' not in i1Ii11ii1 else i1Ii11ii1 [ 'Wed' ]
      Oo00ooO000 = 1 if 'Thu' not in i1Ii11ii1 else i1Ii11ii1 [ 'Thu' ]
      IiI1iII1I11 = 1 if 'Fri' not in i1Ii11ii1 else i1Ii11ii1 [ 'Fri' ]
      OOOoo00 = 1 if 'Sat' not in i1Ii11ii1 else i1Ii11ii1 [ 'Sat' ]
      O0oo0O00oOOoo = 1 if 'Sun' not in i1Ii11ii1 else i1Ii11ii1 [ 'Sun' ]
      if 70 - 70: I1I + Ii
      IiII1I1 = datetime . datetime . strptime (
 "00:00" if 'ActionTime' not in i1Ii11ii1 else i1Ii11ii1 [ 'ActionTime' ] , "%H:%M" )
      I1iii = 0 if 'DoorControlMode' not in i1Ii11ii1 else i1Ii11ii1 [ 'DoorControlMode' ]
      oO = 1 if 'ApplicableDoorNumber' not in i1Ii11ii1 else i1Ii11ii1 [ 'ApplicableDoorNumber' ]
      iiI1I1iii1 = 0 if 'OptionalParameters' not in i1Ii11ii1 else i1Ii11ii1 [ 'OptionalParameters' ]
      if 180000000 > wgCommStatusVal . conSN > 170000000 :
       if 35 - 35: Ooo0Ooo - I1Ii1I1 / Ii % I1Ii1I1 % IIiIIiIi11I1
       if type ( oO ) is list :
        IIi1iii = 0
        for ooiIiii111IIii in range ( 40 ) :
         if ooiIiii111IIii + 1 in oO :
          IIi1iii = IIi1iii + ( 1 << ( ooiIiii111IIii & 0x7 ) )
         if ( ooiIiii111IIii & 0x7 ) == 0x7 :
          if IIi1iii > 0 :
           I1iI11iIii = 0x14 + ( ooiIiii111IIii >> 3 )
           if I1iii == 1 :
            iiI = True
           else :
            IIi1iii = 0
           iiII1 . append (
 [ IiII1I1 , OO0OOo , Ii11 , OoO0O0OOOoo , oO0o00OO00O , iI1Ii1I1ii1 , Oo00ooO000 ,
 IiI1iII1I11 , OOOoo00 ,
 O0oo0O00oOOoo , I1iI11iIii , IIi1iii , iiI1I1iii1 ] )
          IIi1iii = 0
          if 15 - 15: IIiIIiIi11I1 * IIiIIiIi11I1
       else :
        I1iI11iIii = 0x14 + ( oO >> 3 )
        IIi1iii = 0
        if I1iii == 1 :
         IIi1iii = 1 << ( oO & 0xf )
         iiI = True
        iiII1 . append (
 [ IiII1I1 , OO0OOo , Ii11 , OoO0O0OOOoo , oO0o00OO00O , iI1Ii1I1ii1 , Oo00ooO000 , IiI1iII1I11 , OOOoo00 ,
 O0oo0O00oOOoo , I1iI11iIii , IIi1iii , iiI1I1iii1 ] )
      else :
       if type ( oO ) is list :
        for I1iI11iIii in oO :
         iiII1 . append (
 [ IiII1I1 , OO0OOo , Ii11 , OoO0O0OOOoo , oO0o00OO00O , iI1Ii1I1ii1 , Oo00ooO000 , IiI1iII1I11 ,
 OOOoo00 , O0oo0O00oOOoo ,
 I1iI11iIii , I1iii , iiI1I1iii1 ] )
       else :
        I1iI11iIii = oO
        iiII1 . append (
 [ IiII1I1 , OO0OOo , Ii11 , OoO0O0OOOoo , oO0o00OO00O , iI1Ii1I1ii1 , Oo00ooO000 , IiI1iII1I11 , OOOoo00 ,
 O0oo0O00oOOoo , I1iI11iIii , I1iii , iiI1I1iii1 ] )
     if 180000000 > wgCommStatusVal . conSN > 170000000 and iiI :
      if 23 - 23: Ii * Ii
      OO0OOo = datetime . datetime . strptime ( "2020-01-01" , "%Y-%m-%d" )
      Ii11 = datetime . datetime . strptime ( "2099-12-31" , "%Y-%m-%d" )
      OoO0O0OOOoo = 1
      oO0o00OO00O = 1
      iI1Ii1I1ii1 = 1
      Oo00ooO000 = 1
      IiI1iII1I11 = 1
      OOOoo00 = 1
      O0oo0O00oOOoo = 1
      IiII1I1 = datetime . datetime . strptime ( "00:00" , "%H:%M" )
      for Oo00 in range ( 3 ) :
       I1iI11iIii = 0x1B + Oo00
       I1iii = 1
       iiII1 . append (
 [ IiII1I1 , OO0OOo , Ii11 , OoO0O0OOOoo , oO0o00OO00O , iI1Ii1I1ii1 , Oo00ooO000 , IiI1iII1I11 , OOOoo00 ,
 O0oo0O00oOOoo , I1iI11iIii , I1iii , 0 ] )
       if 83 - 83: I1I + ooOOO - i1iiIII111
     if oooo0oo :
      if 79 - 79: Oo . Ii * I1Ii1I1 % I1Ii1I1
      iiII1 . sort ( key = itemgetter ( 0 , 11 ) )
      if 4 - 4: Oo % i1 . iI1iII1I1I1i * i1I
      wgCommStatusVal . tasklistAll = iiII1
      wgCommStatusVal . tasklistCount = len ( iiII1 )
      wgCommStatusVal . indexOftasklist = - 1
      wgCommStatusVal . totaltasklist = wgCommStatusVal . tasklistCount
      wgCommStatusVal . senttasklistIndex = 0
      oo0Oo0oO0 = gettasklistCommand ( wgCommStatusVal )
  if not ( oo0Oo0oO0 is None ) :
   wgCommStatusVal . paramsIndex = wgCommStatusVal . paramsIndex + 1
   if 75 - 75: I1I - i1iiIII111 * i1
  return oo0Oo0oO0
  if 100 - 100: i1iiIII111
  if 30 - 30: i1
  if 95 - 95: ooo000 / i1i1i1111I / i1I - IIiIIiIi11I1
 validCommands = [ 'Primit64ByteCommand' , 'RemoteOpenDoor' , 'QueryControllerStatus' , 'AdjustTime' ,
 'AddEditPrivilege' , 'DeletePrivilege' , 'PrivilegeClear' , 'UploadAllPrivileges' , 'UploadAllPrivilegesByZip' , "GetPrivilegeTotal" ,
 "QueryPrivilege" ,
 "GetPrivilegeWithSelectedID" ,
 'DownloadSwipe' , 'ConfirmGotSwipe' ,
 'SetDoorControlMode' ,
 'GetDoorControlParameter' ,
 'GetRecordBuffer' ,
 'GetQRCode' ,
 'GetPrivilege' , 'UploadAllTimeProfiles' , 'ClearTimeProfiles' , 'GetTimeProfiles' , 'ExtendedFunctions' ,
 'FunctionConfig' ,
 'UploadHolidayControl' ,
 'CreateQRCode' ,
 'NormalOpen' , 'Reset' ,
 'SerialPortTransparentTransmission' ,
 'VisitorAdd' , 'VisitorCancel' , 'VisitorClearAll' , 'VisitorConfiguration' ,
 'ExternFunctions' ,
 'UploadAllScheduledTasks' ,
 'end' ]
 if 7 - 7: I1I / iI1iII1I1I1i % ooo000 / IiIIii11Ii
 if 18 - 18: I1I * IiIIii11Ii * I1I + i1iiIII111
 if 17 - 17: i1I
 if 8 - 8: Oo / iI1iII1I1I1i - Ooo0Ooo
 if 22 - 22: oOo0O00 / I1Ii1I1 % IiI11Ii111
 check_whitespace_times = 0
 if 22 - 22: i1 % Ooo0Ooo . IIiIIiIi11I1 % i1I / IIiIIiIi11I1
 def contains_whitespace ( self , text ) :
  if 60 - 60: Ooo0Ooo . i1 * i1
  return bool ( re . search ( r'\s' , text ) )
  if 42 - 42: i1 % OooOoo % Iii1i % Ooo0Ooo
 def check_whitespace_keys ( self , data ) :
  if 6 - 6: IIiIIiIi11I1
  if 94 - 94: Ooo0Ooo . ooo000 % Oo - IIiIIiIi11I1 - i1
  self . check_whitespace_times = self . check_whitespace_times + 1
  if self . check_whitespace_times > 50 :
   return None
  i1IiiIIi1iiI1 = None
  if isinstance ( data , dict ) :
   for oO000oOOo0OoO , ooO0O0oOOO00 in data . items ( ) :
    if 70 - 70: i1i1i1111I / i1iiIII111 % Ii * IiIIii11Ii % Ii
    if self . contains_whitespace ( oO000oOOo0OoO ) :
     return oO000oOOo0OoO
     if 15 - 15: iI1iII1I1I1i + Ii % IiIIii11Ii + I1Ii1I1
    i1IiiIIi1iiI1 = self . check_whitespace_keys ( ooO0O0oOOO00 )
    if i1IiiIIi1iiI1 is not None :
     return i1IiiIIi1iiI1
  elif isinstance ( data , list ) :
   for iIi1 in data :
    if 15 - 15: i1I - I1I * i1 * IiIIii11Ii + I11iiIi11i1I + Ooo0Ooo
    i1IiiIIi1iiI1 = self . check_whitespace_keys ( iIi1 )
    if i1IiiIIi1iiI1 is not None :
     return i1IiiIIi1iiI1
  return i1IiiIIi1iiI1
  if 36 - 36: i1i1i1111I
  if 48 - 48: IIiIIiIi11I1 - I11iiIi11i1I % Oo
 def render_POST ( self , request ) :
  if 61 - 61: oOO % iI1iII1I1I1i + IiIIii11Ii % i1i1i1111I * iI1iII1I1I1i / i1i1i1111I
  try :
   if 11 - 11: oOo0O00 / Oo . ooOOO / Oo
   if 90 - 90: OooOoo - I1I
   if 67 - 67: oOo0O00 . oOO - IIiIIiIi11I1 / Ooo0Ooo + Iii1i - oOo0O00
   if 25 - 25: Iii1i
   if 30 - 30: i1iiIII111 * i1I - i1iiIII111 + i1I - I11iiIi11i1I
   if 71 - 71: oOo0O00 - OooOoo % I1Ii1I1 + ooOOO
   if 30 - 30: oOo0O00 + OooOoo . oOo0O00 + iI1iII1I1I1i
   if 22 - 22: oOO / I1Ii1I1 + OooOoo / i1 / Oo
   if 6 - 6: OooOoo % ooOOO - IiIIii11Ii
   try :
    if not wgGlobal . checkwhitelist (
 request . client . host ) :
     if 24 - 24: Ii % i1iiIII111
     if 45 - 45: iI1iII1I1I1i + oOO
     request . transport . abortConnection ( )
     return NOT_DONE_YET
   except Exception as IiIoOoo000O0 :
    pass
    if 91 - 91: oOo0O00 - OooOoo % i1I
    mMonitorInfo . wglog ( "1303" )
    mMonitorInfo . wglog ( IiIoOoo000O0 )
    if 94 - 94: Oo + IIiIIiIi11I1 * OooOoo . oOO
   Ii1 = wgCommStatus ( )
   self . arrUsers [ request ] = Ii1
   Ii1 . deactivateTime = time . time ( ) + 5 * 60
   if 15 - 15: ooo000 . i1 % iI1iII1I1I1i
   if 46 - 46: i1iiIII111
   if 8 - 8: I1I * I11iiIi11i1I % ooOOO / Iii1i / i1i1i1111I
   o0oOoOo0O00o = dict ( )
   Ii1 . conSN = 0
   Ii1 . paramsIndex = 0
   Ii1 . responseStop = False
   if 69 - 69: i1i1i1111I * ooo000 % IIiIIiIi11I1 / i1iiIII111
   if 78 - 78: Ii % IiIIii11Ii * OooOoo - Ooo0Ooo * IiIIii11Ii
   OOOO0oo0 = False
   if 57 - 57: iI1iII1I1I1i - I1Ii1I1 + Ooo0Ooo * Ooo0Ooo * i1I / IiI11Ii111
   if 12 - 12: oOo0O00 / IIiIIiIi11I1
   if 68 - 68: i1I . i1i1i1111I - Iii1i
   if 53 - 53: Ooo0Ooo + oOO / i1I - I1I / ooo000 / oOo0O00
   if 71 - 71: oOo0O00 . oOo0O00 % oOO - iI1iII1I1I1i
   if 29 - 29: Iii1i
   if 20 - 20: IIiIIiIi11I1 + oOo0O00 . Ooo0Ooo
   if 23 - 23: i1 * Oo . IIiIIiIi11I1 + i1i1i1111I
   if 77 - 77: i1I + i1I - ooOOO - IIiIIiIi11I1 * Oo * IiIIii11Ii
   if 66 - 66: Iii1i % I1Ii1I1 + Ii % i1iiIII111 / OooOoo - IiIIii11Ii
   if 21 - 21: ooOOO
   if 47 - 47: IiIIii11Ii * oOo0O00 . I11iiIi11i1I + i1i1i1111I
   if 66 - 66: I1Ii1I1 * Oo
   if 77 - 77: i1iiIII111 % i1iiIII111
   if 88 - 88: IiIIii11Ii + oOO . i1I
   if 46 - 46: OooOoo . I11iiIi11i1I
   if 37 - 37: Ooo0Ooo - I1Ii1I1 + Oo
   if len ( request . args ) > 0 :
    for ii1ii in request . args :
     o0oOoOo0O00o [ ii1ii . decode ( 'utf-8' ) ] = request . args [ ii1ii ] [ 0 ] . decode ( 'utf-8' )
     if 28 - 28: i1 % I1I
     if 72 - 72: I11iiIi11i1I * oOO % Oo * iI1iII1I1I1i - i1i1i1111I
     if 15 - 15: IIiIIiIi11I1 . IiIIii11Ii
   else :
    if 40 - 40: OooOoo + IiI11Ii111 - i1iiIII111 % oOo0O00 / Oo . i1
    iiIiiiiI1iiiI = request . content . read ( )
    if 97 - 97: I1I . Ii . I11iiIi11i1I * i1I
    try :
     if 8 - 8: ooOOO . i1i1i1111I . Iii1i + Oo
     iii1Iiii1I1 = iiIiiiiI1iiiI . decode ( "utf-8" )
     if iii1Iiii1I1 . startswith ( "'" ) or iii1Iiii1I1 . startswith (
 "\"" ) :
      iii1Iiii1I1 = iii1Iiii1I1 [ 1 : - 1 ]
      iii1Iiii1I1 = iii1Iiii1I1 . replace ( '%20' , ' ' ) . replace ( '&nbsp' , ' ' ) . replace ( r'\"' , r'"' )
      if 45 - 45: I11iiIi11i1I / IiI11Ii111 * i1
      if 65 - 65: Oo . Iii1i % I1I % I1I * oOo0O00
     o0oOoOo0O00o = json . loads ( iii1Iiii1I1 )
     if 22 - 22: Oo . I11iiIi11i1I / IIiIIiIi11I1 * i1I + I1Ii1I1
     OOOO0oo0 = True
     self . check_whitespace_times = 0
     oOOO = self . check_whitespace_keys ( o0oOoOo0O00o )
     if oOOO is not None :
      OOOO0oo0 = False
      try :
       if 28 - 28: Ooo0Ooo / i1iiIII111 . iI1iII1I1I1i . I11iiIi11i1I . OooOoo
       mMonitorInfo . wglog ( "??????????????????? 1304A HTTPError" )
       mMonitorInfo . wglog ( iiIiiiiI1iiiI )
       try :
        if 64 - 64: oOo0O00 * Ii % i1i1i1111I
        if 42 - 42: ooo000 . iI1iII1I1I1i + oOo0O00 % iI1iII1I1I1i
        if 29 - 29: oOo0O00 - I1I - IIiIIiIi11I1 . IiIIii11Ii * I1Ii1I1
        Ii1 . errMessage = (
 { "jsonrpc" : "2.0" , "error" : { "code" : - 62700 , "message" : "{}---{}" . format ( oOOO ,
 "Contains spaces (as a key-value pair, spaces are prohibited), please correct it" ) ,
 "ProblemSource" : "Please troubleshoot: Spaces" } ,
 "id" : None } )
       except Exception as IiII111iiiII :
        pass
        pass
       i11ii = deferLater ( reactor , 0.01 , lambda : request )
       i11ii . addCallback ( self . _responseError )
       return NOT_DONE_YET
      except Exception as oo00 :
       if 89 - 89: I1Ii1I1 . IiIIii11Ii . i1iiIII111 / IiI11Ii111 / ooo000
       pass
       mMonitorInfo . wglog ( "1301A" )
       mMonitorInfo . wglog ( oo00 )
    except Exception as i1II111I :
     pass
     if 97 - 97: IiIIii11Ii - IiI11Ii111 - IIiIIiIi11I1 - ooOOO % iI1iII1I1I1i / Oo
     if 16 - 16: IIiIIiIi11I1 - OooOoo / Iii1i
     if 13 - 13: i1i1i1111I . Iii1i - ooo000 / i1iiIII111 % oOo0O00 / IiI11Ii111
     if 80 - 80: i1i1i1111I
     try :
      from urllib . parse import parse_qs
      if 85 - 85: iI1iII1I1I1i - oOo0O00 / IIiIIiIi11I1 * I11iiIi11i1I - ooOOO
      oOIIIIIiii1 = parse_qs ( iiIiiiiI1iiiI . decode ( 'utf-8' ) )
      for ii1ii in oOIIIIIiii1 :
       o0oOoOo0O00o [ ii1ii ] = oOIIIIIiii1 [ ii1ii ] [ 0 ]
     except Exception as oOoO0OOo0 :
      pass
      if 87 - 87: oOO * oOO * IIiIIiIi11I1 % IIiIIiIi11I1
      pass
      if 72 - 72: Ii % ooo000
      if 34 - 34: ooo000 % IiIIii11Ii % i1iiIII111 + Ii
      if 4 - 4: OooOoo . IiIIii11Ii + i1I * i1iiIII111 . ooo000
   oooo0oo = True
   if 13 - 13: IiIIii11Ii + IiIIii11Ii - i1 . i1
   if 31 - 31: i1I + i1i1i1111I . Oo + I1Ii1I1 + oOO . i1iiIII111
   II11IIi1I1iI = True
   if not ( ( "jsonrpc" in o0oOoOo0O00o ) and ( "method" in o0oOoOo0O00o ) and ( "id" in o0oOoOo0O00o ) ) :
    oooo0oo = False
   elif not ( "params" in o0oOoOo0O00o ) :
    if 49 - 49: i1iiIII111 - Oo % Oo - I1I * i1iiIII111
    if 64 - 64: i1iiIII111 * IiI11Ii111 / IiIIii11Ii + I1I - IIiIIiIi11I1
    if 82 - 82: oOO
    if o0oOoOo0O00o [ 'method' ] not in [ 'GetRecordBuffer' , 'GetQRCode' ,
 'VisitorClearAll' ,
 'ExternFunctions' ] :
     oooo0oo = False
    else :
     II11IIi1I1iI = False
     if 28 - 28: Ii + i1I + ooo000
     if 29 - 29: i1i1i1111I * i1I * i1I . ooOOO + i1i1i1111I
   elif o0oOoOo0O00o [ 'jsonrpc' ] != '2.0' :
    oooo0oo = False
   elif not ( o0oOoOo0O00o [ 'method' ] in self . validCommands ) :
    oooo0oo = False
   elif o0oOoOo0O00o [ 'id' ] is None :
    oooo0oo = False
   elif o0oOoOo0O00o [ 'params' ] is None :
    oooo0oo = False
    if 73 - 73: Ooo0Ooo - IiIIii11Ii / oOo0O00 . oOo0O00 % Ooo0Ooo
    if 85 - 85: I1I + ooo000 - IiI11Ii111 + iI1iII1I1I1i % oOO
   if oooo0oo :
    if 24 - 24: I11iiIi11i1I
    Ii1 . rpcID = o0oOoOo0O00o [ 'id' ]
    Ii1 . method = o0oOoOo0O00o [ 'method' ]
    if 24 - 24: I1I - iI1iII1I1I1i * oOO + Ooo0Ooo % i1I
    if o0oOoOo0O00o [ 'method' ] in [ 'VisitorAdd' , 'VisitorCancel' , 'VisitorClearAll' ,
 'VisitorConfiguration' ] :
     Ii1 . reset ( )
     Ii1 . errMessage = self . dealvisitorInfo ( Ii1 . rpcID ,
 o0oOoOo0O00o )
     i11ii = deferLater ( reactor , 0.01 , lambda : request )
     i11ii . addCallback ( self . _responseError )
     return NOT_DONE_YET
    if o0oOoOo0O00o [ 'method' ] in [ 'ExternFunctions' ] :
     Ii1 . reset ( )
     Ii1 . errMessage = self . dealexternfunc ( Ii1 . rpcID ,
 o0oOoOo0O00o )
     i11ii = deferLater ( reactor , 0.01 , lambda : request )
     i11ii . addCallback ( self . _responseError )
     return NOT_DONE_YET
    Iii = None
    if II11IIi1I1iI :
     if 94 - 94: I11iiIi11i1I . IiIIii11Ii / OooOoo - OooOoo / oOo0O00 * Ooo0Ooo
     O0o = o0oOoOo0O00o [ 'params' ]
     OOO0OO0oo = json . dumps ( O0o , ensure_ascii = False )
     if 53 - 53: I1Ii1I1 + IiI11Ii111 + i1
     Ii1 . reset ( )
     if 52 - 52: OooOoo . I1I
     if OOOO0oo0 :
      if 4 - 4: iI1iII1I1I1i + IIiIIiIi11I1
      Ii1 . paramsCmd = json . JSONDecoder ( ) . decode ( OOO0OO0oo )
      Iii = ( json . JSONDecoder ( ) . decode ( OOO0OO0oo ) ) [ 0 ]
     else :
      if 72 - 72: Ii - I1Ii1I1 / OooOoo + Iii1i
      Ii1 . paramsCmd = json . JSONDecoder ( ) . decode ( json . JSONDecoder ( ) . decode ( OOO0OO0oo ) )
      Iii = json . JSONDecoder ( ) . decode ( json . JSONDecoder ( ) . decode ( OOO0OO0oo ) ) [ 0 ]
     if 'ControllerSN' not in Iii :
      oooo0oo = False
      if 34 - 34: oOO * Ii / IIiIIiIi11I1
      if o0oOoOo0O00o [ 'method' ] == "CreateQRCode" :
       if 3 - 3: i1i1i1111I
       if 41 - 41: i1i1i1111I + IiIIii11Ii - i1i1i1111I * OooOoo - i1
       Ii1 . errMessage = self . createNewQR ( Iii , Ii1 ,
 Ii1 . rpcID )
       i11ii = deferLater ( reactor , 0.01 , lambda : request )
       i11ii . addCallback ( self . _responseError )
       return NOT_DONE_YET
       if 15 - 15: I11iiIi11i1I * I11iiIi11i1I . i1I * ooOOO % IIiIIiIi11I1
       if 12 - 12: Oo % i1iiIII111
       if 43 - 43: ooo000 * i1 * I1I - Oo / I1Ii1I1
       if 28 - 28: Ooo0Ooo - i1I + Ii
       if 63 - 63: Oo + oOO + IIiIIiIi11I1 - i1 * ooOOO
       if 19 - 19: IiIIii11Ii - Iii1i + IiI11Ii111
     else :
      if 5 - 5: Ii * i1 * oOO + oOo0O00 - IiIIii11Ii * Oo
      Ii1 . conSN = Iii [ 'ControllerSN' ]
      if Ii1 . conSN in WGRsa . invalidCon :
       if Ii1 . conSN in WGRsa . lowversionCon :
        i11ii = deferLater ( reactor , 0.01 , lambda : request )
        i11ii . addCallback ( self . _responselowversionCon )
        return NOT_DONE_YET
       else :
        i11ii = deferLater ( reactor , 0.01 , lambda : request )
        i11ii . addCallback ( self . _responseInvalidProd )
        return NOT_DONE_YET
    if not ( webpwd is None ) :
     if 69 - 69: ooo000 - Iii1i
     if 51 - 51: i1i1i1111I + oOo0O00 / I1I
     if 21 - 21: i1iiIII111 * Ooo0Ooo * ooOOO . i1i1i1111I
     if 100 - 100: Ooo0Ooo - Ooo0Ooo + I1Ii1I1 . ooOOO
     if 65 - 65: IiIIii11Ii
     if 'webpwd' not in o0oOoOo0O00o :
      oooo0oo = False
      if 54 - 54: oOO * i1iiIII111 * Iii1i - I1Ii1I1 . iI1iII1I1I1i
     elif not ( webpwd == o0oOoOo0O00o [ 'webpwd' ] ) :
      if 83 - 83: ooo000 . I1I
      oooo0oo = False
   if oooo0oo :
    if 81 - 81: i1I + Oo . I1Ii1I1
    if 32 - 32: OooOoo * Ooo0Ooo % iI1iII1I1I1i + OooOoo - ooOOO
    if 23 - 23: i1iiIII111 % I1I + Ooo0Ooo . I1Ii1I1 + ooo000 - i1I
    if Ii1 . comm is None :
     if 29 - 29: Iii1i
     Ii1 . comm = wgConRPC ( )
    OoOOOOO = Ii1 . comm . getNewXid ( )
    if 72 - 72: i1 % iI1iII1I1I1i . ooOOO / I1Ii1I1 * ooo000 . IiI11Ii111
    oo0Oo0oO0 = self . dealParams ( request , Ii1 )
    if 55 - 55: OooOoo + IiIIii11Ii . i1I / Iii1i . I11iiIi11i1I
    if 56 - 56: IIiIIiIi11I1 * i1 . I1I * I1I
    if 35 - 35: IIiIIiIi11I1 * OooOoo - Ooo0Ooo
    if oo0Oo0oO0 is None :
     oooo0oo = False
    if oooo0oo :
     if 27 - 27: oOo0O00 / I1I * I1Ii1I1 - OooOoo - Iii1i
     if Ii1 . comm is None :
      if 38 - 38: IiI11Ii111 / i1 - IiIIii11Ii
      Ii1 . comm = wgConRPC ( )
      if 75 - 75: iI1iII1I1I1i * Iii1i . OooOoo - ooo000 + I1I * ooo000
      if 91 - 91: IiI11Ii111 * i1i1i1111I + oOO . Ii
      if 7 - 7: IIiIIiIi11I1 / IiI11Ii111 + IiI11Ii111
      if 91 - 91: Iii1i . I11iiIi11i1I + ooo000 % ooo000 + IiIIii11Ii * OooOoo
      if 72 - 72: i1I
     Ii1 . lastCommandByte = bytes ( oo0Oo0oO0 )
     Ii1 . comm . run ( Ii1 . lastCommandByte )
     if 23 - 23: I11iiIi11i1I / i1iiIII111 - iI1iII1I1I1i
     if 17 - 17: i1iiIII111
     if 91 - 91: OooOoo - Oo + Ii + IIiIIiIi11I1 / ooOOO
     if 96 - 96: oOo0O00 - IiI11Ii111 + ooOOO
     Ii1 . tryMaxTimesCount = wgGlobal . commTimeout10ms
     i11ii = deferLater ( reactor , 0.01 , lambda : request )
     i11ii . addCallback ( self . _delayedRender )
     i11ii . addErrback ( self . _responseFailed , i11ii )
     if 67 - 67: I1Ii1I1 - IIiIIiIi11I1 + OooOoo
     if 72 - 72: iI1iII1I1I1i * I1I . Ii / I1Ii1I1 / IIiIIiIi11I1 . ooOOO
     request . notifyFinish ( ) . addErrback ( self . _responseFailed , i11ii ,
 request )
     return NOT_DONE_YET
     if 21 - 21: Ooo0Ooo - IIiIIiIi11I1 . iI1iII1I1I1i . oOO + iI1iII1I1I1i - IIiIIiIi11I1
   if oooo0oo :
    if 15 - 15: Oo / i1i1i1111I + oOo0O00 / I1Ii1I1 / I11iiIi11i1I * ooOOO
    pass
   else :
    if 73 - 73: I1I % Iii1i % i1I % Ooo0Ooo / i1 . IIiIIiIi11I1
    if 87 - 87: i1iiIII111
    if 4 - 4: Oo * IiIIii11Ii - i1I
    if 14 - 14: Iii1i / iI1iII1I1I1i . IIiIIiIi11I1
    i11ii = deferLater ( reactor , 0.01 , lambda : request )
    i11ii . addCallback ( self . _responseError )
    return NOT_DONE_YET
    if 59 - 59: IiI11Ii111 + Iii1i * Ii + IiI11Ii111 * i1iiIII111 - i1I
    if 17 - 17: oOo0O00 . i1iiIII111
  except Exception as OOOOo :
   pass
   try :
    if 8 - 8: oOO . ooo000 % ooo000 . I1Ii1I1 + ooo000 / i1i1i1111I
    mMonitorInfo . wglog ( "??????????????????? 1304 HTTPError" )
    if 3 - 3: ooo000 / ooo000
    if 37 - 37: OooOoo * oOo0O00 . Ooo0Ooo - oOo0O00 * IiI11Ii111 * OooOoo
    if 46 - 46: IiIIii11Ii . I1I % iI1iII1I1I1i - IIiIIiIi11I1 - i1I + IiI11Ii111
    if 55 - 55: Ooo0Ooo
    mMonitorInfo . wglog ( OOOOo )
    if 48 - 48: Ooo0Ooo / Ooo0Ooo * Ii . i1iiIII111 % iI1iII1I1I1i
    if 87 - 87: OooOoo * IIiIIiIi11I1
    if 68 - 68: I11iiIi11i1I * oOo0O00 . Ooo0Ooo - IIiIIiIi11I1 . OooOoo + OooOoo
    if 88 - 88: I11iiIi11i1I / oOo0O00 - i1I
    if 7 - 7: Ii . Oo % Ooo0Ooo % Oo - iI1iII1I1I1i
    if 85 - 85: ooOOO % ooOOO + i1i1i1111I % Iii1i % iI1iII1I1I1i . I1Ii1I1
    Ii1 . errMessage = (
 { "jsonrpc" : "2.0" , "error" : { "code" : - 62700 , "message" : "Unknown reason render_POST" ,
 "ProblemSource" : "Error: Please troubleshoot: Spaces; full-width characters are prohibited; for parameters that should be numeric values in the command, fill in according to the command requirements without adding quotation marks to turn them into strings (refer to the WebAPI development guide for command specifications);" } ,
 "id" : None } )
    try :
     if 24 - 24: i1i1i1111I . oOo0O00 - i1I + iI1iII1I1I1i
     if 97 - 97: IiI11Ii111 - i1iiIII111 + I1I / i1i1i1111I / IiI11Ii111 * ooOOO
     if 87 - 87: Ooo0Ooo
     Ii1 . errMessage = (
 { "jsonrpc" : "2.0" , "error" : { "code" : - 62700 , "message" : OOOOo . args [ 0 ] ,
 "ProblemSource" : OOOOo . doc + "Please troubleshoot: Spaces; full-width characters are prohibited; for parameters that should be numeric values in the command, fill in according to the command requirements without adding quotation marks to turn them into strings (refer to the WebAPI development guide for command specifications);" } ,
 "id" : None } )
     mMonitorInfo . wglog ( OOOOo . doc )
    except Exception as IiII111iiiII :
     pass
     pass
    i11ii = deferLater ( reactor , 0.01 , lambda : request )
    i11ii . addCallback ( self . _responseError )
    return NOT_DONE_YET
   except Exception as oo00 :
    if 69 - 69: Iii1i
    pass
    mMonitorInfo . wglog ( "1301" )
    mMonitorInfo . wglog ( oo00 )
    if 51 - 51: Iii1i
    if 22 - 22: iI1iII1I1I1i - ooo000 * IiI11Ii111 * IIiIIiIi11I1 * IiI11Ii111 + IiI11Ii111
    if 47 - 47: ooo000 * i1i1i1111I + OooOoo / I1I . Iii1i . I1I
    if 4 - 4: OooOoo - i1
    if 56 - 56: I1I % oOo0O00 . OooOoo - Ooo0Ooo - Oo . I1Ii1I1
 def render_GET ( self , request ) :
  if 20 - 20: iI1iII1I1I1i * IIiIIiIi11I1 - iI1iII1I1I1i . i1 % oOo0O00 / i1I
  try :
   if not wgGlobal . checkwhitelist ( request . client . host ) :
    request . transport . abortConnection ( )
    return None
   if request . uri == b'/favicon.ico' and wgAppConfig . htmlIconExisted :
    if 51 - 51: i1iiIII111
    if 2 - 2: Ooo0Ooo
    O0000OoOOO000 = open ( 'favicon.ico' , 'rb' )
    ii = O0000OoOOO000 . read ( )
    O0000OoOOO000 . close ( )
    return ii
    if 79 - 79: i1 - Ii * Iii1i % i1I - oOO + i1i1i1111I
   if wgAppConfig . htmlDirExisted :
    if request . uri == b'/' :
     if 35 - 35: IIiIIiIi11I1 - IIiIIiIi11I1 . IiIIii11Ii % Ooo0Ooo - I1Ii1I1 . oOo0O00
     if 93 - 93: IiIIii11Ii - iI1iII1I1I1i
     O0000OoOOO000 = open ( "./index.html" , 'rb' )
     ii = O0000OoOOO000 . read ( )
     O0000OoOOO000 . close ( )
     return ii
     if 30 - 30: i1I / i1iiIII111 * iI1iII1I1I1i % oOo0O00 / ooo000
    else :
     if 54 - 54: IiIIii11Ii * I1Ii1I1 - I1I % i1i1i1111I + IIiIIiIi11I1 * OooOoo
     O0000OoOOO000 = open ( "./htmlZone" + bytes . decode ( request . uri ) , 'rb' )
     ii = O0000OoOOO000 . read ( )
     O0000OoOOO000 . close ( )
     return ii
     if 23 - 23: IiI11Ii111 / IIiIIiIi11I1
  except Exception as oo00 :
   if 13 - 13: oOo0O00 - I1I / Ii % Iii1i
   pass
   mMonitorInfo . wglog ( "1302" )
   mMonitorInfo . wglog ( oo00 )
   if 46 - 46: I1Ii1I1 + I11iiIi11i1I / Ii
  return bytes ( "File Not Found" , encoding = 'utf8' )
  if 9 - 9: Oo - i1 % Oo
 def render_OPTIONS ( self , request ) :
  ii = """wiegand.com 微耕门禁控制器"""
  request . responseHeaders . addRawHeader ( b"Access-Control-Allow-Origin" , b"*" )
  request . responseHeaders . addRawHeader ( b"Access-Control-Allow-Method" ,
 b"POST, GET, OPTIONS" )
  request . responseHeaders . addRawHeader ( b"Access-Control-Allow-Headers" , b"Content-Type" )
  return bytes ( ii , encoding = 'utf8' )
  if 72 - 72: ooOOO - i1iiIII111
 def createNewQR ( self , cmd , wgCommStatusVal , cmdid ) :
  oOo0000o0o = ""
  if 57 - 57: Oo . IiI11Ii111 % oOO . Ii
  if 65 - 65: I1Ii1I1
  oO0oo = datetime . datetime . now ( )
  if oOo0000o0o == "" and datetime . datetime . strptime ( cmd [ "EndDateTime" ] , "%Y-%m-%d %H:%M:%S" ) < oO0oo :
   oOo0000o0o = "EndDateTime is out of date."
  if oOo0000o0o == "" and datetime . datetime . strptime ( cmd [ "EndDateTime" ] , "%Y-%m-%d %H:%M:%S" ) > (
 oO0oo + datetime . timedelta ( days = 366 ) ) :
   oOo0000o0o = "The validity period cannot exceed one year."
   if 81 - 81: I1I
   if 47 - 47: oOo0O00 * iI1iII1I1I1i
   if 98 - 98: Oo - IiIIii11Ii / OooOoo + I1I . iI1iII1I1I1i
  oOOO0 = b'\x77\x69\x65\x67\x61\x6e\x64\x32\x30\x31\x37\x30\x34\x32\x37\x57'
  if oOo0000o0o == "" and "QRCodePassword" in cmd and len ( cmd [ 'QRCodePassword' ] ) > 0 :
   if 22 - 22: ooOOO
   oOOO0 = bytes ( cmd [ 'QRCodePassword' ] , encoding = "utf8" )
   if len ( oOOO0 ) > 16 or len ( oOOO0 ) < 1 :
    oOo0000o0o = 'QRCodePassword length must be not larger than 16'
   elif len ( oOOO0 ) < 16 :
    O00oo0O = [ 0x0 , 0x0 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ]
    iIII11Ii = len ( oOOO0 )
    O00oo0O [ 0 : iIII11Ii ] = oOOO0 [ 0 : iIII11Ii ]
    oOOO0 = bytes ( O00oo0O )
    if 57 - 57: I11iiIi11i1I . i1i1i1111I
  if oOo0000o0o != "" :
   IIiIiIi = ( {
 "jsonrpc" : "2.0" ,
 "result" : {
 "success" : False ,
 "msg" : oOo0000o0o ,
   "code" : 0 ,
 "CardNO" : cmd [ "CardNO" ] ,
 "EndDateTime" : cmd [ "EndDateTime" ]
 } ,
 "id" : cmdid
   } )
   return IIiIiIi
   if 85 - 85: i1I / I11iiIi11i1I . Ooo0Ooo + oOO - i1iiIII111 + IiIIii11Ii
  I1i1II1i11 = CryptSM4 ( )
  I1i1II1i11 . set_key ( oOOO0 , SM4_ENCRYPT )
  OOoOoo0OO000 = [ 0 ] * 16
  OOoOoo0OO000 [ 15 ] = 2
  if 17 - 17: oOo0O00 % i1i1i1111I / oOO % I11iiIi11i1I + i1iiIII111
  if 97 - 97: Iii1i / oOO . ooOOO % oOo0O00 / Ooo0Ooo * I11iiIi11i1I
  if 15 - 15: IiIIii11Ii . I11iiIi11i1I + Oo + Oo . oOo0O00 - i1I
  Ii11111 = WGTools . getYMD ( oO0oo . year , oO0oo . month , oO0oo . day )
  II1111 = 0
  if 'BeginDateTime' in cmd :
   I1iiI11iII = datetime . datetime . strptime ( cmd [ "BeginDateTime" ] , "%Y-%m-%d %H:%M:%S" )
   Ii11111 = WGTools . getYMD ( I1iiI11iII . year , I1iiI11iII . month , I1iiI11iII . day )
   II1111 = WGTools . getHMS ( I1iiI11iII . hour , I1iiI11iII . minute , I1iiI11iII . second )
  OOoOoo0OO000 [ 8 ] = ( Ii11111 & 0xff )
  OOoOoo0OO000 [ 9 ] = ( ( Ii11111 >> 8 ) & 0xff )
  OOoOoo0OO000 [ 10 ] = ( ( II1111 >> 8 ) & 0xff )
  OOoOoo0OO000 [ 11 ] = ( II1111 & 0xE0 )
  iIIiiiIiIiIiI = datetime . datetime . strptime ( cmd [ "EndDateTime" ] , "%Y-%m-%d %H:%M:%S" )
  if 87 - 87: i1I - I11iiIi11i1I % ooOOO - IIiIIiIi11I1 % Ooo0Ooo
  Ii11111 = WGTools . getYMD ( iIIiiiIiIiIiI . year , iIIiiiIiIiIiI . month , iIIiiiIiIiIiI . day )
  II1111 = WGTools . getHMS ( iIIiiiIiIiIiI . hour , iIIiiiIiIiIiI . minute , iIIiiiIiIiIiI . second )
  OOoOoo0OO000 [ 11 ] = ( OOoOoo0OO000 [ 11 ] + ( ( II1111 & 0xE0 ) >> 4 ) )
  OOoOoo0OO000 [ 12 ] = ( Ii11111 & 0xff )
  OOoOoo0OO000 [ 13 ] = ( ( Ii11111 >> 8 ) & 0xff )
  OOoOoo0OO000 [ 14 ] = ( ( II1111 >> 8 ) & 0xff )
  if ( II1111 & 0xE0 ) == 0xE0 :
   if 57 - 57: Ooo0Ooo - OooOoo / OooOoo % iI1iII1I1I1i - I11iiIi11i1I / I11iiIi11i1I
   OOoOoo0OO000 [ 14 ] = OOoOoo0OO000 [ 14 ] + 1
  O00 = cmd [ "CardNO" ]
  if O00 > 0 :
   OOoOoo0OO000 [ 0 ] = ( O00 & 0xff )
   OOoOoo0OO000 [ 1 ] = ( ( O00 >> 8 ) & 0xff )
   OOoOoo0OO000 [ 2 ] = ( ( O00 >> 16 ) & 0xff )
   OOoOoo0OO000 [ 3 ] = ( ( O00 >> 24 ) & 0xff )
   OOoOoo0OO000 [ 4 ] = ( ( O00 >> 32 ) & 0xff )
   OOoOoo0OO000 [ 5 ] = ( ( O00 >> 40 ) & 0xff )
   OOoOoo0OO000 [ 6 ] = ( ( O00 >> 48 ) & 0xff )
   OOoOoo0OO000 [ 7 ] = ( ( O00 >> 56 ) & 0xff )
   if 16 - 16: iI1iII1I1I1i / Ii - I1Ii1I1 * IiIIii11Ii % IiI11Ii111 . Ooo0Ooo
  i1Ii1ii = I1i1II1i11 . crypt_ecb ( OOoOoo0OO000 )
  ii = '' . join ( [ '%02X' % i for i in i1Ii1ii ] )
  OOOOooo = (
 {
 "jsonrpc" : "2.0" ,
 "result" : {
 "success" : True ,
 "msg" : "run success OK" ,
 "code" : 1 ,
 "CardNO" : O00 ,
 "EndDateTime" : cmd [ "EndDateTime" ] ,
 "QRCodeInformation" : ii
 } ,
 "id" : cmdid
  } )
  return OOOOooo
  if 76 - 76: oOo0O00 . I1I + IIiIIiIi11I1 / Iii1i
  if 16 - 16: i1i1i1111I + Ooo0Ooo . i1I - i1I + iI1iII1I1I1i
 def dealvisitorInfo ( self , cmdid , param ) :
  if 44 - 44: IiI11Ii111 - OooOoo / iI1iII1I1I1i % iI1iII1I1I1i
  if 86 - 86: i1iiIII111 / IiI11Ii111 . IiI11Ii111 * Ooo0Ooo
  if 50 - 50: i1iiIII111 - oOO
  if 6 - 6: ooOOO - i1i1i1111I * Iii1i / oOo0O00 % Oo % oOO
  if wgGlobal . visitorDB is None :
   if 11 - 11: oOO % i1I
   if 97 - 97: i1I
   wgGlobal . visitorDB = TinyDB ( 'vistors.json' )
   if 67 - 67: I11iiIi11i1I - Iii1i
  if param [ 'method' ] == 'VisitorAdd' :
   return self . dealvisitorInfoAdd ( cmdid , param )
  if param [ 'method' ] == 'VisitorCancel' :
   return self . dealvisitorInfoDel ( cmdid , param )
  if param [ 'method' ] == 'VisitorClearAll' :
   return self . dealvisitorInfoClear ( cmdid , param )
  if param [ 'method' ] == 'VisitorConfiguration' :
   return self . dealvisitorInfoSetup ( cmdid , param )
   if 16 - 16: I1Ii1I1 % ooOOO . i1 / i1I * i1i1i1111I - oOO
   if 78 - 78: i1I - IIiIIiIi11I1 . Iii1i
 def dealvisitorInfoAdd ( self , cmdid , param ) :
  if 44 - 44: Ooo0Ooo / I11iiIi11i1I . ooo000 + ooOOO
  if 12 - 12: Oo
  if 70 - 70: OooOoo + I1Ii1I1
  O0o = param [ 'params' ]
  OOO0OO0oo = json . dumps ( O0o , ensure_ascii = False )
  if 33 - 33: OooOoo
  Iii = ( json . JSONDecoder ( ) . decode ( OOO0OO0oo ) ) [ 0 ]
  oOo0000o0o = ""
  oO0oo = datetime . datetime . now ( )
  if oOo0000o0o == "" and datetime . datetime . strptime ( Iii [ "End" ] , "%Y-%m-%d %H:%M:%S" ) < oO0oo :
   oOo0000o0o = "EndDateTime is out of date."
  if oOo0000o0o == "" and datetime . datetime . strptime ( Iii [ "End" ] , "%Y-%m-%d %H:%M:%S" ) > (
 oO0oo + datetime . timedelta ( days = 366 ) ) :
   oOo0000o0o = "The validity period cannot exceed one year."
  if oOo0000o0o != "" :
   IIiIiIi = ( {
 "jsonrpc" : "2.0" ,
 "result" : {
 "success" : False ,
 "msg" : oOo0000o0o ,
   "code" : 0 ,
 } ,
 "id" : cmdid
   } )
   return IIiIiIi
   if 40 - 40: I1Ii1I1 * IiI11Ii111 . I1Ii1I1 + Iii1i
   if 92 - 92: oOo0O00
   if 50 - 50: i1iiIII111
   if 19 - 19: ooOOO + Oo - I1I . i1
  I1IiIiII1I = wgGlobal . visitorDB
  II = Query ( )
  if 82 - 82: ooOOO . oOO
  i1iI1IIi11 = I1IiIiII1I . search (
 ( II [ "CardNO" ] == Iii [ "CardNO" ] ) & ( II [ "Begin" ] == Iii [ "Begin" ] ) & ( II [ "End" ] == Iii [ "End" ] ) )
  if 27 - 27: oOO + I1Ii1I1
  if ( i1iI1IIi11 is not None ) and ( i1iI1IIi11 != [ ] ) :
   oOo0000o0o = "VisitorExisted"
   IIiIiIi = ( {
 "jsonrpc" : "2.0" ,
 "result" : {
 "success" : False ,
 "msg" : oOo0000o0o ,
   "code" : 0 ,
 } ,
 "id" : cmdid
   } )
   return IIiIiIi
  wgGlobal . visitorDB . insert ( Iii )
  if not wgGlobal . visitorDBIsEnabled :
   wgGlobal . visitorDBIsEnabled = True
   if 32 - 32: oOO - Ii - iI1iII1I1I1i . oOo0O00 % I1Ii1I1
  O00 = Iii [ "CardNO" ]
  if 1 - 1: IIiIIiIi11I1
  if 35 - 35: ooo000 + I1I + I11iiIi11i1I % Ii + I1Ii1I1
  OOOOooo = (
 {
 "jsonrpc" : "2.0" ,
 "result" : {
 "success" : True ,
 "msg" : "run success OK" ,
 "code" : 1 ,
 "CardNO" : O00 ,
 } ,
 "id" : cmdid
  } )
  return OOOOooo
  if 95 - 95: i1i1i1111I % i1i1i1111I + Oo - oOO / ooOOO
 def dealvisitorInfoDel ( self , cmdid , param ) :
  O0o = param [ 'params' ]
  OOO0OO0oo = json . dumps ( O0o , ensure_ascii = False )
  if 56 - 56: I11iiIi11i1I % i1iiIII111
  Iii = ( json . JSONDecoder ( ) . decode ( OOO0OO0oo ) ) [ 0 ]
  I1IiIiII1I = wgGlobal . visitorDB
  II = Query ( )
  if 88 - 88: ooOOO * iI1iII1I1I1i * ooOOO
  i1iI1IIi11 = I1IiIiII1I . search (
 ( II [ "CardNO" ] == Iii [ "CardNO" ] ) )
  if 32 - 32: i1iiIII111 + iI1iII1I1I1i / i1iiIII111 % OooOoo . Iii1i * IiI11Ii111
  if not ( ( i1iI1IIi11 is not None ) and ( i1iI1IIi11 != [ ] ) ) :
   oOo0000o0o = "VisitorNonexisted"
   IIiIiIi = ( {
 "jsonrpc" : "2.0" ,
 "result" : {
 "success" : False ,
 "msg" : oOo0000o0o ,
   "code" : 0 ,
 } ,
 "id" : cmdid
   } )
   return IIiIiIi
  wgGlobal . visitorDB . remove ( II [ "CardNO" ] == Iii [ "CardNO" ] )
  if 61 - 61: Iii1i
  if 87 - 87: oOO - IIiIIiIi11I1
  if 98 - 98: i1i1i1111I % i1i1i1111I * Iii1i % iI1iII1I1I1i
  if 87 - 87: IiIIii11Ii
  OOOOooo = (
 {
 "jsonrpc" : "2.0" ,
 "result" : {
 "success" : True ,
 "msg" : "run success OK" ,
 "code" : 1 ,

  } ,
 "id" : cmdid
  } )
  return OOOOooo
  if 49 - 49: ooo000 + Iii1i / iI1iII1I1I1i . I1I + iI1iII1I1I1i
 def dealvisitorInfoClear ( self , cmdid , param ) :
  I1IiIiII1I = wgGlobal . visitorDB
  if 2 - 2: Iii1i * ooOOO
  if 88 - 88: I1I + IiI11Ii111 . oOo0O00 * i1 * IIiIIiIi11I1 / IiIIii11Ii
  if 5 - 5: IiI11Ii111 - Iii1i / I1I
  if 82 - 82: ooOOO . I11iiIi11i1I % I1Ii1I1 - oOO
  if 25 - 25: i1I * IiI11Ii111 * I1Ii1I1 % i1I . i1i1i1111I / OooOoo
  if 34 - 34: I11iiIi11i1I / ooOOO * Iii1i / oOO * IiI11Ii111
  if 33 - 33: iI1iII1I1I1i % Ooo0Ooo . Ii * Ooo0Ooo + ooOOO - Oo
  if 88 - 88: IIiIIiIi11I1 - I11iiIi11i1I + i1 . ooOOO . Ooo0Ooo
  if 69 - 69: Iii1i + I1I - i1i1i1111I + i1I
  if 4 - 4: Ooo0Ooo / i1 . I1Ii1I1 / oOo0O00 + Oo . Iii1i
  if 62 - 62: i1I . i1iiIII111 * i1 + Oo
  if 61 - 61: Ii + i1iiIII111
  if 67 - 67: IiI11Ii111 . IiI11Ii111
  if 57 - 57: iI1iII1I1I1i
  if 75 - 75: i1i1i1111I
  if 8 - 8: ooo000
  if 41 - 41: OooOoo . iI1iII1I1I1i . oOo0O00 . Ooo0Ooo % Oo . Ii
  if 72 - 72: oOo0O00
  I1IiIiII1I . truncate ( )
  if wgGlobal . visitorDBIsEnabled :
   wgGlobal . visitorDBIsEnabled = False
   if 49 - 49: IiI11Ii111 . i1 - IiI11Ii111 % Iii1i
   if 59 - 59: Ooo0Ooo - IiI11Ii111 % i1iiIII111 . Iii1i
   if 59 - 59: i1I + Oo / Iii1i . i1i1i1111I % i1I
  OOOOooo = (
 {
 "jsonrpc" : "2.0" ,
 "result" : {
 "success" : True ,
 "msg" : "run success OK" ,
 "code" : 1 ,

  } ,
 "id" : cmdid
  } )
  return OOOOooo
  if 25 - 25: I11iiIi11i1I / IiIIii11Ii + IIiIIiIi11I1 - IiI11Ii111 * iI1iII1I1I1i
 def dealvisitorInfoSetup ( self , cmdid , param ) :
  O0o = param [ 'params' ]
  OOO0OO0oo = json . dumps ( O0o , ensure_ascii = False )
  if 24 - 24: Ii / Ii
  if 17 - 17: Ooo0Ooo % IiIIii11Ii % oOo0O00
  Iii = ( json . JSONDecoder ( ) . decode ( OOO0OO0oo ) ) [ 0 ]
  I1IiIiII1I = wgGlobal . visitorDB
  II = Query ( )
  if 75 - 75: OooOoo / oOo0O00 - i1iiIII111 % IiIIii11Ii + Iii1i
  i1iI1IIi11 = I1IiIiII1I . search (
 ( II [ "Description" ] == Iii [ "Description" ] ) )
  print ( i1iI1IIi11 )
  if not ( ( i1iI1IIi11 is not None ) and ( i1iI1IIi11 != [ ] ) ) :
   pass
  else :
   wgGlobal . visitorDB . remove ( II [ "Description" ] == Iii [ "Description" ] )
  wgGlobal . visitorDB . insert ( Iii )
  wgGlobal . visitorDBConfigOnlyOnce = 0
  if 'SwipeValidOnlyOnce' in Iii :
   wgGlobal . visitorDBConfigOnlyOnce = Iii [ "SwipeValidOnlyOnce" ]
   if 67 - 67: OooOoo * i1 . oOO % Ooo0Ooo . IiIIii11Ii
  print ( wgGlobal . visitorDB . all ( ) )
  if 26 - 26: I1I * i1i1i1111I
  if 44 - 44: IIiIIiIi11I1 * iI1iII1I1I1i
  if 77 - 77: i1I + i1iiIII111 % oOo0O00 % i1iiIII111 - Oo / iI1iII1I1I1i
  OOOOooo = (
 {
 "jsonrpc" : "2.0" ,
 "result" : {
 "success" : True ,
 "msg" : "run success OK" ,
 "code" : 1 ,

  } ,
 "id" : cmdid
  } )
  return OOOOooo
  if 6 - 6: Iii1i / i1 * i1 * iI1iII1I1I1i
 def dealexternfunc ( self , cmdid , param ) :
  O0o = param [ 'params' ]
  OOO0OO0oo = json . dumps ( O0o , ensure_ascii = False )
  Iii = ( json . JSONDecoder ( ) . decode ( OOO0OO0oo ) ) [ 0 ]
  if 'FunctionName' in Iii :
   OOOOooo = (
 {
 "jsonrpc" : "2.0" ,
 "result" : {
 "success" : True ,
 "msg" : "run success OK" ,
 "code" : 1 ,
 'FunctionName' : Iii [ 'FunctionName' ] ,
 } ,
 "id" : cmdid
   } )
   if Iii [ 'FunctionName' ] == 'EnableDebug' :
    wgAppConfig . allowprint = True
    wgAppConfig . wgrecordlogEnable = True
    wgGlobal . testModeDebugPrint = 1
    wgGlobal . allowprint = True
    return OOOOooo
   if Iii [ 'FunctionName' ] == 'DisableDebug' :
    wgAppConfig . allowprint = False
    wgAppConfig . wgrecordlogEnable = False
    wgGlobal . testModeDebugPrint = 0
    wgGlobal . allowprint = False
    return OOOOooo
   if Iii [ 'FunctionName' ] == 'OptimizePrivilege' :
    if "ControllerSN" in Iii :
     try :
      wgOptimizePrivilege . forceUpate = 1
      if type ( Iii [ "ControllerSN" ] ) is int :
       if 80 - 80: IIiIIiIi11I1 / i1iiIII111
       wgOptimizePrivilege . qControllerEditPrivi . append ( Iii [ "ControllerSN" ] )
      else :
       for IiIIIi11 in Iii [ "ControllerSN" ] :
        if 95 - 95: ooo000 / Iii1i / Iii1i + i1i1i1111I
        wgOptimizePrivilege . qControllerEditPrivi . append ( IiIIIi11 )
      wgOptimizePrivilege . startWakeup ( )
     except Exception as oooOOo00Oo :
      print ( oooOOo00Oo )
      if 4 - 4: oOo0O00 / I1Ii1I1
      if 29 - 29: I1Ii1I1 * oOO + i1
      if 23 - 23: I1Ii1I1 . ooOOO
      if 13 - 13: OooOoo
      if 49 - 49: i1iiIII111 . oOo0O00 / i1 - IiIIii11Ii + I1Ii1I1 * I11iiIi11i1I
      if 80 - 80: i1i1i1111I * OooOoo . I1I / I1I
      if 69 - 69: IiIIii11Ii * IiI11Ii111 + i1 - Ii
      if 98 - 98: I1I % oOo0O00 % i1iiIII111 / Ii / ooOOO
      if 17 - 17: IIiIIiIi11I1 % i1i1i1111I / IiI11Ii111 - I1Ii1I1 . I11iiIi11i1I
      if 50 - 50: IiIIii11Ii % I11iiIi11i1I - I1Ii1I1 - IiIIii11Ii + IIiIIiIi11I1 % IIiIIiIi11I1
      if 61 - 61: ooo000 % i1I * Ii
    return OOOOooo
   if Iii [ 'FunctionName' ] == 'Get1001RunningInformation' :
    iIiIi = mMonitorInfo . getAllControllerDSInfo ( )
    if iIiIi is None :
     iIiIi = [ ]
    else :
     iIiIi = json . loads ( iIiIi . decode ( "utf-8" ) )
    OOOOooo = (
 {
 "jsonrpc" : "2.0" ,
 "result" : {
 "success" : True ,
 "msg" : "run success OK" ,
 "code" : 1 ,
 'FunctionName' : Iii [ 'FunctionName' ] ,
 '1001StartupTime' : wgGlobal . startuptime ,
 "JoinedControllerSN" : iIiIi
 } ,
 "id" : cmdid
    } )
    if 40 - 40: i1I - IiIIii11Ii / oOO + i1i1i1111I
    if 18 - 18: oOo0O00
    if 57 - 57: i1 + Ii % I11iiIi11i1I - i1iiIII111 % Ooo0Ooo
    if 58 - 58: Ooo0Ooo - IIiIIiIi11I1 + ooOOO + ooo000
    return OOOOooo
   if Iii [ 'FunctionName' ] == 'SearchController' :
    mMonitorInfo . bSearchController = 1
    if 4 - 4: i1 - ooOOO
    if 83 - 83: IiIIii11Ii
    try :
     if mMonitorInfo . wgFrmADCT3000 :
      mMonitorInfo . wgFrmADCT3000 . checkNetChanged ( )
     for IiIIIi11 in mMonitorInfo . arrwgControllerCenter2023 :
      if IiIIIi11 . taskqueueWGControllerCenter2023 . empty ( ) :
       IiIIIi11 . taskqueueWGControllerCenter2023 . put ( 1 )
    except Exception as OOOOo :
     pass
     mMonitorInfo . wglog ( "1303" )
     mMonitorInfo . wglog ( OOOOo )
    return OOOOooo
    if 11 - 11: I11iiIi11i1I % i1i1i1111I % ooOOO
    if 30 - 30: Oo
    if 10 - 10: oOO . i1iiIII111 / I1I
    if 87 - 87: oOo0O00 + ooOOO * I1I
   if Iii [ 'FunctionName' ] == 'SoftwareRestart' :
    mMonitorInfo . wglog ( "{} Restart..." . format ( time . strftime ( '%Y-%m-%d %H:%M:%S' ) ) )
    IIOO00oO00 = sys . executable
    os . execl ( IIOO00oO00 , IIOO00oO00 , * sys . argv )
    sys . exit ( )
   if Iii [ 'FunctionName' ] == 'Retrieve the wgconfig.ini file' :
    iIiIi = [ ]
    try :
     O0000OoOOO000 = open ( wgGlobal . wgcloudpath1001configfileName , 'r' , encoding = 'utf-8-sig' )
     ii = O0000OoOOO000 . read ( )
     if len ( ii ) > 0 :
      iIiIi = ii
      iIiIi = iIiIi . replace ( "\"" , "'" )
      if 98 - 98: i1 - i1
    except Exception as oo00 :
     if 93 - 93: IIiIIiIi11I1 / I11iiIi11i1I / oOO % iI1iII1I1I1i - i1i1i1111I + i1iiIII111
     print ( oo00 )
     pass
     if 25 - 25: Ooo0Ooo * iI1iII1I1I1i / oOO - Iii1i
    OOOOooo = (
 {
 "jsonrpc" : "2.0" ,
 "result" : {
 "success" : True ,
 "msg" : "run success OK" ,
 "code" : 1 ,
 'FunctionName' : Iii [ 'FunctionName' ] ,
 "Content" : iIiIi
 } ,
 "id" : cmdid
    } )
    return OOOOooo
   if Iii [ 'FunctionName' ] == 'Configure the wgconfig.ini file' :
    OOOOooo = (
 {
 "jsonrpc" : "2.0" ,
 "result" : {
 "success" : False ,
 "msg" : "Failed to write file" ,
 "code" : 0 ,
 'FunctionName' : Iii [ 'FunctionName' ] ,
 } ,
 "id" : cmdid
    } )
    if 'Content' in Iii :
     iIiIi = Iii [ 'Content' ]
     try :
      O0000OoOOO000 = open ( wgGlobal . wgcloudpath1001configfileName , 'w' , encoding = 'utf-8-sig' )
      O0000OoOOO000 . write ( iIiIi )
      O0000OoOOO000 . close ( )
      OOOOooo = (
 {
 "jsonrpc" : "2.0" ,
 "result" : {
 "success" : True ,
 "msg" : "run success OK" ,
 "code" : 1 ,
 'FunctionName' : Iii [ 'FunctionName' ]

 } ,
 "id" : cmdid
      } )
      if 48 - 48: OooOoo % oOo0O00
     except Exception as oo00 :
      if 95 - 95: IIiIIiIi11I1
      print ( oo00 )
      pass
     return OOOOooo
     if 85 - 85: i1 + Ooo0Ooo - ooo000
   if Iii [ 'FunctionName' ] == 'GetFile' and 'FileName' in Iii :
    iIiIi = [ ]
    Oo0oooO0000 = 0
    OOo0O = Iii [ 'FileName' ]
    II1Ooo = 0 if "SpecifyStartingPosition" not in Iii else Iii [ 'SpecifyStartingPosition' ]
    i1IiiiiIIiiI1 = - 1 if "SpecifyLength" not in Iii else Iii [ 'SpecifyLength' ]
    IIiIIiii1 = 0
    OoOoooOO00Oo0 = 0
    try :
     o00OOoooOo = os . stat ( wgGlobal . wgcloudpath1001configfileName . replace ( "wgconfig.ini" , OOo0O ) )
     IIiIIiii1 = o00OOoooOo . st_size
     if 52 - 52: I11iiIi11i1I / i1I + iI1iII1I1I1i - i1I - Ii
     O0000OoOOO000 = open ( wgGlobal . wgcloudpath1001configfileName . replace ( "wgconfig.ini" , OOo0O ) , 'r' ,
 encoding = 'utf-8-sig' )
     O0000OoOOO000 . seek ( II1Ooo )
     ii = O0000OoOOO000 . read ( i1IiiiiIIiiI1 )
     Oo0oooO0000 = len ( ii )
     if len ( ii ) > 0 :
      iIiIi = ii
      OoOoooOO00Oo0 = O0000OoOOO000 . tell ( )
      if 95 - 95: oOo0O00
      if 83 - 83: oOo0O00 + IiI11Ii111 - Ooo0Ooo / i1
    except Exception as oo00 :
     if 23 - 23: Ooo0Ooo * ooo000 - I1Ii1I1 * i1I * Oo
     print ( oo00 )
     pass
     if 51 - 51: i1 . ooOOO / oOO * i1i1i1111I + I1I * IIiIIiIi11I1
    OOOOooo = (
 {
 "jsonrpc" : "2.0" ,
 "result" : {
 "success" : True ,
 "msg" : "run success OK" ,
 "code" : 1 ,
 'FunctionName' : Iii [ 'FunctionName' ] ,
 'FileName' : Iii [ 'FileName' ] ,
 'FileSize' : IIiIIiii1 ,
 'StartLocation' : II1Ooo ,
 'EndLocation' : OoOoooOO00Oo0 ,
 'ContentLength' : Oo0oooO0000 ,
 "Content" : iIiIi
 } ,
 "id" : cmdid
    } )
    return OOOOooo
    if 53 - 53: IiIIii11Ii . Oo . i1iiIII111 % iI1iII1I1I1i - I1Ii1I1
   if Iii [ 'FunctionName' ] == 'ClearFaceReaderLog' and 'FaceReaderIP' in Iii :
    iIiIi = ""
    Oo0oooO0000 = 0
    ooOoo0000O = Iii [ 'FaceReaderIP' ]
    try :
     if type ( ooOoo0000O ) is str :
      i1IiiIIi1iiI1 = clearFaceLog ( [ ooOoo0000O ] )
     else :
      i1IiiIIi1iiI1 = clearFaceLog ( ooOoo0000O )
     if i1IiiIIi1iiI1 > 0 :
      iIiIi = "Command Sent"
     else :
      iIiIi = "Command Send Failed"
      if 49 - 49: ooo000 * ooo000 / Ii
    except Exception as oo00 :
     if 2 - 2: OooOoo . iI1iII1I1I1i + IIiIIiIi11I1
     print ( oo00 )
     pass
     if 60 - 60: i1i1i1111I
    OOOOooo = (
 {
 "jsonrpc" : "2.0" ,
 "result" : {
 "success" : True ,
 "msg" : "run success OK" ,
 "code" : 1 ,
 'FunctionName' : Iii [ 'FunctionName' ] ,

    "Content" : iIiIi
 } ,
 "id" : cmdid
    } )
    return OOOOooo
    if 71 - 71: iI1iII1I1I1i / IIiIIiIi11I1 / I1Ii1I1 + Iii1i / Oo % I1Ii1I1
    if 38 - 38: oOO
    if 95 - 95: i1i1i1111I / Iii1i * ooOOO * OooOoo
    if 57 - 57: I1I / Ii * oOO
    if 28 - 28: Ii * I11iiIi11i1I * Oo * ooo000
    if 89 - 89: Ii - Iii1i % Ii
    if 99 - 99: i1 / i1 + i1i1i1111I / Iii1i
    if 54 - 54: Iii1i
    if 44 - 44: i1i1i1111I * i1
    if 13 - 13: I1Ii1I1 / Ooo0Ooo . Oo % i1iiIII111 + I1I % IiI11Ii111
    if 27 - 27: Ooo0Ooo - i1 . Oo / i1iiIII111 + I1Ii1I1
    if 2 - 2: i1iiIII111 * ooo000 . iI1iII1I1I1i / i1
    if 9 - 9: IiI11Ii111 + Ii + I1I . oOo0O00 - IIiIIiIi11I1 % Oo
    if 92 - 92: I1Ii1I1 % Oo + i1iiIII111 % ooo000 * OooOoo
    if 43 - 43: i1iiIII111 * IIiIIiIi11I1
    if 9 - 9: IiI11Ii111 . iI1iII1I1I1i % ooo000
    if 66 - 66: i1 * i1I % Iii1i * Iii1i / Oo % oOo0O00
    if 31 - 31: i1 - i1i1i1111I % OooOoo . IIiIIiIi11I1 + I1I + OooOoo
    if 49 - 49: Ii * i1
    if 93 - 93: i1iiIII111 - ooOOO / Ii + Ooo0Ooo % oOo0O00
    if 97 - 97: i1
    if 94 - 94: i1 + oOO / Ii
  iIII11I = ( { "jsonrpc" : "2.0" ,
 "error" : { "code" : - 32700 ,
 "message" : "Parse error: Invalid Command Format" ,
 "version" : wgGlobal . softwareVersion } ,
 "id" : None } )
  return iIII11I
  if 86 - 86: i1 * IiI11Ii111
  if 49 - 49: I1Ii1I1 + Iii1i - IIiIIiIi11I1 . I1I . Ii
 def dealrunningInfo ( self , cmdid , param ) :
  if 82 - 82: OooOoo / i1i1i1111I
  if 23 - 23: I1I % I11iiIi11i1I / Ooo0Ooo . iI1iII1I1I1i * oOo0O00
  if 22 - 22: i1 / I1Ii1I1 - i1 % oOo0O00 + iI1iII1I1I1i % I1I
  if 35 - 35: IiIIii11Ii . ooo000 - IIiIIiIi11I1 / iI1iII1I1I1i
  if 55 - 55: Ooo0Ooo % IIiIIiIi11I1 / ooo000 . i1i1i1111I - oOo0O00
  if 77 - 77: oOO / I1Ii1I1 * ooo000 + oOo0O00 - iI1iII1I1I1i
  if 37 - 37: IiI11Ii111 % i1i1i1111I - OooOoo + IIiIIiIi11I1
  if 26 - 26: Iii1i / Iii1i
  if 65 - 65: IiIIii11Ii * ooo000 - ooo000 - IiIIii11Ii * IIiIIiIi11I1 - oOo0O00
  if 83 - 83: Ooo0Ooo . Oo . i1I - I1I / Ooo0Ooo
  if 33 - 33: I11iiIi11i1I + IIiIIiIi11I1 * IiIIii11Ii * Ii * ooo000 * Ooo0Ooo
  if 95 - 95: IIiIIiIi11I1 / Ii
  if 47 - 47: Iii1i * OooOoo * IiI11Ii111 + OooOoo - i1 + IiI11Ii111
  import os
  OOOOooo = (
 {
 "jsonrpc" : "2.0" ,
 "result" : {
 "success" : True ,
 "msg" : "run success OK" ,
 "code" : 1 ,
 "MemmoryOccupied(MB)" : mMonitorInfo . getmem ( ) ,

  "MemmoryMax(MB)" : mMonitorInfo . memAllocMaxMB ,

  # I1Ii1I1 * Oo . ooo000 . i1I - i1i1i1111I
  # Ooo0Ooo / Ooo0Ooo / oOo0O00 + oOO % ooo000
  # Ooo0Ooo + i1i1i1111I * i1I . OooOoo + ooOOO
  # ooo000 / oOo0O00 * I1Ii1I1 . Iii1i - i1i1i1111I . Ooo0Ooo
  # oOo0O00 - Ooo0Ooo * I1Ii1I1 / I1Ii1I1 + OooOoo
  # I1Ii1I1 - I11iiIi11i1I
  # iI1iII1I1I1i
  # I1Ii1I1 / Ii / I1Ii1I1 * ooOOO / Ooo0Ooo
  # IiI11Ii111 * I1Ii1I1 . oOo0O00 . i1i1i1111I
  # ooOOO . i1iiIII111 . i1I . i1
  # Oo - Ii . Iii1i + i1I
  } ,
 "id" : cmdid
  } )
  return OOOOooo
  if 6 - 6: I1I
  if 67 - 67: ooo000
  if 78 - 78: IIiIIiIi11I1 + i1iiIII111 - Ooo0Ooo % IiIIii11Ii + i1iiIII111
  if 41 - 41: ooo000 + ooo000
  if 79 - 79: IiIIii11Ii
  if 43 - 43: Iii1i
  if 59 - 59: OooOoo - IiI11Ii111 . I11iiIi11i1I . i1 + iI1iII1I1I1i + IiI11Ii111
  if 88 - 88: I11iiIi11i1I - I1I - i1iiIII111 . IiIIii11Ii . i1iiIII111 . iI1iII1I1I1i
  if 30 - 30: ooo000 - IiI11Ii111 * IiIIii11Ii . IIiIIiIi11I1 - Oo
  if 94 - 94: IiI11Ii111 + OooOoo / i1I % I11iiIi11i1I
  if 5 - 5: i1i1i1111I - oOo0O00
  if 87 - 87: I1Ii1I1 - Oo - oOO - i1 / I1I
  if 22 - 22: i1i1i1111I * Ooo0Ooo . Iii1i * i1iiIII111 / ooOOO - i1
  if 93 - 93: IIiIIiIi11I1 * Oo * OooOoo
  if 69 - 69: IIiIIiIi11I1 * i1iiIII111 . i1I / i1i1i1111I % i1iiIII111 * ooo000
  if 92 - 92: ooo000 * oOO * i1 - ooOOO / oOo0O00 . i1i1i1111I
  if 15 - 15: i1iiIII111
  if 95 - 95: Oo / IiIIii11Ii % i1iiIII111 / i1I - Iii1i
  if 40 - 40: i1I
  if 69 - 69: Ooo0Ooo - i1iiIII111
  if 99 - 99: OooOoo * IiI11Ii111 % i1I
  if 29 - 29: ooo000
  if 2 - 2: i1iiIII111 - oOo0O00 / IIiIIiIi11I1 / iI1iII1I1I1i * OooOoo
  if 77 - 77: Ii / i1iiIII111 % oOo0O00
  if 65 - 65: ooOOO . i1I * I1I - oOo0O00 - ooo000 * Ii
  if 43 - 43: I1I * i1
  if 90 - 90: I1Ii1I1 . ooo000 - I1Ii1I1 + oOO . i1iiIII111 - Ooo0Ooo
  if 87 - 87: ooo000 + i1i1i1111I - oOo0O00 % oOo0O00
  if 90 - 90: oOO * ooo000
  if 13 - 13: i1I + Ii
  if 91 - 91: I1Ii1I1 - OooOoo % iI1iII1I1I1i
  if 90 - 90: OooOoo + I1I / I1I * Iii1i
  if 47 - 47: Oo % OooOoo * Ooo0Ooo - I1Ii1I1 * Oo . IiIIii11Ii
  if 61 - 61: Oo . I11iiIi11i1I
  if 84 - 84: Ooo0Ooo % ooo000 / i1
  if 5 - 5: i1
  if 51 - 51: IiI11Ii111 + ooo000 / i1i1i1111I * iI1iII1I1I1i
  if 84 - 84: iI1iII1I1I1i + Iii1i + Oo . i1i1i1111I
  if 16 - 16: I11iiIi11i1I * Iii1i / i1I % i1I
  if 62 - 62: Oo * I1Ii1I1 % ooo000
  if 62 - 62: Ooo0Ooo * i1I + Oo / i1i1i1111I + oOO * I1Ii1I1
  if 52 - 52: ooo000 . oOO % IIiIIiIi11I1 % I11iiIi11i1I . oOO % Oo
  if 97 - 97: Oo * I1Ii1I1
  if 77 - 77: Iii1i / iI1iII1I1I1i % Oo + OooOoo . I1I % I1Ii1I1
  if 12 - 12: Ii + Oo . oOo0O00 % oOO + I1Ii1I1
  if 55 - 55: i1 . Ii + oOo0O00 % oOO * OooOoo - i1I
  if 63 - 63: I11iiIi11i1I + IiI11Ii111 + I11iiIi11i1I % Oo / Ii * i1
  if 5 - 5: oOo0O00 / I1I
  if 18 - 18: I1I % IiIIii11Ii % OooOoo + IiI11Ii111 * Ooo0Ooo
  if 10 - 10: ooOOO + I1Ii1I1 - iI1iII1I1I1i - ooOOO . Ooo0Ooo
  if 89 - 89: I1I % i1i1i1111I
  if 81 - 81: I1I + IiIIii11Ii * I11iiIi11i1I % I1Ii1I1 % OooOoo - i1iiIII111
  if 56 - 56: IiI11Ii111 . i1i1i1111I / Oo + oOO
  if 15 - 15: Ooo0Ooo % i1iiIII111 . i1i1i1111I * i1iiIII111 + OooOoo + i1
  if 36 - 36: Oo
  if 49 - 49: Oo - Oo
  if 23 - 23: oOo0O00 * IIiIIiIi11I1 % I11iiIi11i1I . i1I + oOo0O00
  if 71 - 71: Oo % I1Ii1I1 . i1iiIII111
  if 97 - 97: IiIIii11Ii / oOO * IiI11Ii111 % ooo000
  if 62 - 62: ooOOO / I11iiIi11i1I . OooOoo * OooOoo * OooOoo
  if 49 - 49: ooOOO * IiIIii11Ii . i1 * IiI11Ii111 * Ooo0Ooo
  if 91 - 91: iI1iII1I1I1i / iI1iII1I1I1i + oOo0O00 % ooOOO
  if 55 - 55: i1 * i1i1i1111I + Ooo0Ooo + i1i1i1111I + i1i1i1111I
  if 10 - 10: i1i1i1111I / i1I / i1i1i1111I . oOo0O00 * IIiIIiIi11I1 % Iii1i
  if 55 - 55: OooOoo % IIiIIiIi11I1 - oOO % Oo * Iii1i - IiI11Ii111
  if 25 - 25: Ooo0Ooo . oOO * IiIIii11Ii * I11iiIi11i1I / IiI11Ii111 * Ii
  if 78 - 78: I11iiIi11i1I / I1Ii1I1 / IiIIii11Ii . OooOoo
  if 66 - 66: Ooo0Ooo . ooo000 - I1Ii1I1
  if 48 - 48: i1iiIII111
  if 87 - 87: Oo % oOo0O00
  if 39 - 39: ooOOO + Iii1i / i1I * ooo000
  if 28 - 28: I11iiIi11i1I * iI1iII1I1I1i . IiI11Ii111
  if 63 - 63: IiIIii11Ii
  if 1 - 1: i1iiIII111 - IiIIii11Ii + Iii1i . I1Ii1I1 + ooo000
  if 46 - 46: Oo
  if 56 - 56: i1i1i1111I / I11iiIi11i1I % Ooo0Ooo / Oo
  if 63 - 63: OooOoo
  if 99 - 99: i1 + ooo000 - oOo0O00 + Ooo0Ooo + oOO / ooOOO
  if 14 - 14: iI1iII1I1I1i * OooOoo / Ooo0Ooo + Iii1i
  if 46 - 46: Oo / oOo0O00 / OooOoo . Ooo0Ooo - i1iiIII111 * Ii
  if 21 - 21: IIiIIiIi11I1 / ooOOO * Ooo0Ooo . oOO - OooOoo - i1iiIII111
  if 97 - 97: ooo000 % Oo / Iii1i . OooOoo
  if 20 - 20: Iii1i % i1 * Ii
  if 87 - 87: IiI11Ii111 - Iii1i * Ooo0Ooo
  if 62 - 62: IIiIIiIi11I1 + Ooo0Ooo . i1
  if 80 - 80: I11iiIi11i1I * I1Ii1I1
  if 32 - 32: ooOOO . i1 * Ooo0Ooo
  if 26 - 26: Oo * I11iiIi11i1I * I1Ii1I1 % I1I
  if 76 - 76: OooOoo * Oo / ooo000 / ooOOO . OooOoo / Ooo0Ooo
  if 3 - 3: i1i1i1111I / ooo000 . I11iiIi11i1I - i1 + i1
  if 44 - 44: Ii - Ooo0Ooo % Ii * oOo0O00
  if 15 - 15: ooOOO + Ooo0Ooo + i1
  if 41 - 41: I1Ii1I1
  if 6 - 6: Ii
  if 85 - 85: I1I + IIiIIiIi11I1 + IiI11Ii111 + Ooo0Ooo . ooOOO / IIiIIiIi11I1
  if 47 - 47: Oo + Iii1i . oOO
  if 99 - 99: IiIIii11Ii + IiIIii11Ii
  if 96 - 96: IiI11Ii111 % i1 + ooOOO * i1I / ooo000
  if 12 - 12: OooOoo
  if 81 - 81: Oo % i1I . I1I * iI1iII1I1I1i / i1i1i1111I . oOO
  if 80 - 80: IIiIIiIi11I1 + oOO / OooOoo
  if 6 - 6: Ooo0Ooo / oOO
  if 92 - 92: IiIIii11Ii % iI1iII1I1I1i + Oo
  if 56 - 56: IIiIIiIi11I1
  if 54 - 54: Iii1i % IiI11Ii111 / OooOoo + Ii + i1I
  if 8 - 8: ooo000 / oOO - i1i1i1111I % iI1iII1I1I1i / ooo000 % oOO
  if 100 - 100: IiI11Ii111 - I1I + Iii1i / I1Ii1I1
  if 74 - 74: Iii1i % I11iiIi11i1I
  if 59 - 59: I11iiIi11i1I * oOo0O00 + oOo0O00 / ooOOO * oOO
  if 16 - 16: Ii / oOO
  if 31 - 31: OooOoo . OooOoo + ooOOO
  if 7 - 7: I1I / Oo % IiIIii11Ii . IiI11Ii111 * i1iiIII111 + i1i1i1111I
  if 91 - 91: OooOoo + IiI11Ii111 - i1iiIII111 + Iii1i . IiIIii11Ii
  if 29 - 29: I1Ii1I1 + Iii1i + i1I % ooo000 . ooOOO * IiI11Ii111
  if 71 - 71: i1 - i1iiIII111
  if 35 - 35: ooo000 % OooOoo
  if 58 - 58: Ooo0Ooo * IiIIii11Ii
  if 19 - 19: IIiIIiIi11I1 . iI1iII1I1I1i / I1Ii1I1 / I1I
  if 73 - 73: I1Ii1I1 * oOo0O00 * oOo0O00 . I1Ii1I1
  if 23 - 23: IiI11Ii111 * i1i1i1111I / i1i1i1111I / Ooo0Ooo
  if 32 - 32: ooo000 * I11iiIi11i1I . Iii1i / IiI11Ii111
  if 13 - 13: Iii1i - Iii1i . Ii * OooOoo
  if 32 - 32: ooOOO
  if 19 - 19: Iii1i % Oo . i1iiIII111 % i1i1i1111I * OooOoo / IIiIIiIi11I1
  if 98 - 98: I1Ii1I1 - i1iiIII111 + OooOoo - Ii / oOO
  if 89 - 89: oOO * Iii1i . Ii
  if 14 - 14: Oo + Ooo0Ooo % Iii1i / Iii1i / i1
  if 55 - 55: IiIIii11Ii / oOo0O00 * ooo000 / Oo
  if 63 - 63: i1 . Oo
  if 37 - 37: IiI11Ii111 . Oo + IiIIii11Ii
  if 11 - 11: IiI11Ii111
  if 20 - 20: I11iiIi11i1I - i1iiIII111
  if 77 - 77: Ooo0Ooo * OooOoo
  if 86 - 86: IiI11Ii111 + IiIIii11Ii + ooOOO . IiIIii11Ii - i1i1i1111I + Iii1i
  if 20 - 20: i1iiIII111 / ooo000 / IIiIIiIi11I1 - Oo . Ooo0Ooo % ooOOO
  if 19 - 19: i1iiIII111
  if 17 - 17: IiIIii11Ii - i1iiIII111
  if 64 - 64: Ooo0Ooo - i1iiIII111 % i1 / ooo000
  if 54 - 54: oOO - IIiIIiIi11I1 % oOO % ooo000 / i1i1i1111I
  if 75 - 75: I11iiIi11i1I - i1 % i1i1i1111I * IiIIii11Ii / I1I . Iii1i
  if 47 - 47: OooOoo - Ii . IiIIii11Ii + oOo0O00 / iI1iII1I1I1i
  if 19 - 19: i1 - i1 / OooOoo . OooOoo . ooo000
  if 94 - 94: Ooo0Ooo
  if 48 - 48: Oo
  if 85 - 85: IIiIIiIi11I1 . I1Ii1I1 % OooOoo . OooOoo + i1i1i1111I
  if 32 - 32: Iii1i
  if 73 - 73: I1Ii1I1 / OooOoo - I11iiIi11i1I * oOo0O00
  if 61 - 61: i1iiIII111 * Iii1i - Oo + OooOoo
  if 8 - 8: IiI11Ii111 . I11iiIi11i1I / Iii1i / Ooo0Ooo - iI1iII1I1I1i * oOO
  if 92 - 92: I11iiIi11i1I % i1 + Ooo0Ooo
  if 21 - 21: I11iiIi11i1I . OooOoo - I1I
  if 52 - 52: i1 . I1Ii1I1 - oOO * i1i1i1111I % iI1iII1I1I1i
  if 62 - 62: ooo000 * I1Ii1I1 - Ii
  if 48 - 48: I1I - Oo + i1i1i1111I . IiI11Ii111 + Iii1i + i1
  if 37 - 37: Oo % i1i1i1111I
  if 28 - 28: oOo0O00 . oOO / Ii / ooOOO / i1i1i1111I
  if 73 - 73: i1I . Ii - i1iiIII111 . oOo0O00 . Iii1i
  if 46 - 46: I11iiIi11i1I - i1iiIII111 / ooo000
  if 93 - 93: Oo / Ooo0Ooo + I11iiIi11i1I
  if 13 - 13: Iii1i / ooo000 % i1I - oOo0O00 . I1Ii1I1
  if 20 - 20: i1i1i1111I - i1i1i1111I * i1 * OooOoo / I1Ii1I1 * I11iiIi11i1I
  if 67 - 67: I11iiIi11i1I % iI1iII1I1I1i + i1iiIII111 / IiIIii11Ii + Ooo0Ooo % Ii
  if 92 - 92: i1 - IiI11Ii111 / i1i1i1111I % i1I / IIiIIiIi11I1 * Oo
  if 2 - 2: oOO + i1i1i1111I
  if 64 - 64: iI1iII1I1I1i
  if 41 - 41: I1Ii1I1 + i1i1i1111I
  if 36 - 36: IiIIii11Ii + i1i1i1111I . iI1iII1I1I1i / IIiIIiIi11I1 + ooOOO
  if 98 - 98: OooOoo * i1I . Ii - IiIIii11Ii
  if 37 - 37: IiI11Ii111 - OooOoo * IiIIii11Ii - I11iiIi11i1I
  if 80 - 80: i1i1i1111I + Ooo0Ooo * I11iiIi11i1I
  if 58 - 58: Ii * Ii % i1
  if 90 - 90: OooOoo . oOo0O00 . I1Ii1I1 - ooo000 % i1i1i1111I
  if 29 - 29: i1i1i1111I - iI1iII1I1I1i + oOO - iI1iII1I1I1i
  if 14 - 14: I1Ii1I1
  if 94 - 94: ooo000
  if 99 - 99: ooo000 / i1i1i1111I + i1iiIII111 + IiI11Ii111
  if 63 - 63: IIiIIiIi11I1 * Oo
  if 36 - 36: oOO . IIiIIiIi11I1 / I1I / i1iiIII111
  if 73 - 73: IiI11Ii111
  if 100 - 100: IiIIii11Ii . IIiIIiIi11I1 - Ii / I1I
  if 3 - 3: ooOOO - I1Ii1I1 + OooOoo . ooOOO . i1i1i1111I - oOo0O00
  if 92 - 92: I11iiIi11i1I - ooOOO / Ii / i1i1i1111I
  if 55 - 55: I1Ii1I1 + IiIIii11Ii / Ooo0Ooo
  if 62 - 62: I1Ii1I1 % Ooo0Ooo * i1I + ooo000
  if 2 - 2: I1I % i1I . OooOoo % i1iiIII111 + Iii1i
  if 20 - 20: IIiIIiIi11I1 / Oo + Ooo0Ooo * ooOOO
  if 67 - 67: iI1iII1I1I1i . iI1iII1I1I1i / i1I * Ii . I1I / Ooo0Ooo
  if 90 - 90: IiI11Ii111 / I1I - I1I + i1I / Iii1i
  if 48 - 48: oOo0O00 . I11iiIi11i1I + Oo
  if 90 - 90: iI1iII1I1I1i * Ooo0Ooo - IiIIii11Ii + oOO
  if 55 - 55: Oo + iI1iII1I1I1i / IiIIii11Ii - oOO / IiI11Ii111
  if 21 - 21: ooo000 - Ooo0Ooo + oOo0O00 * IiI11Ii111 * Oo
  if 12 - 12: i1i1i1111I
  if 84 - 84: IiI11Ii111
  if 53 - 53: IIiIIiIi11I1
  if 96 - 96: Oo % iI1iII1I1I1i * i1I % oOo0O00 . Ooo0Ooo
  if 28 - 28: oOO - ooo000
  if 15 - 15: Oo - IiIIii11Ii
  if 60 - 60: ooo000 * IiIIii11Ii . I11iiIi11i1I / oOo0O00
  if 35 - 35: oOo0O00 + i1 - Ooo0Ooo . Iii1i . OooOoo . IiIIii11Ii
  if 67 - 67: i1iiIII111 % I1Ii1I1 + Ooo0Ooo % oOO / I1I - IiI11Ii111
  if 83 - 83: i1I . OooOoo - ooo000 * I1Ii1I1
  if 52 - 52: I1Ii1I1 % i1 - Oo
  if 91 - 91: Oo % i1I
  if 51 - 51: oOO + i1iiIII111 / i1i1i1111I / Iii1i . Iii1i - i1I
  if 20 - 20: IiI11Ii111
  if 91 - 91: i1I . Iii1i - OooOoo * IiIIii11Ii - I1Ii1I1
  if 31 - 31: oOo0O00 / oOO / ooo000 / Ii + i1i1i1111I + OooOoo
  if 81 - 81: i1I
  if 14 - 14: iI1iII1I1I1i
  if 77 - 77: Oo
  if 19 - 19: I1Ii1I1 + i1i1i1111I . IIiIIiIi11I1
  if 47 - 47: Oo - IIiIIiIi11I1
  if 3 - 3: IIiIIiIi11I1 . i1i1i1111I * Ooo0Ooo / ooo000
  if 41 - 41: I1Ii1I1 - oOo0O00 / I1Ii1I1 . i1I * IiI11Ii111 * Ii
  if 16 - 16: IIiIIiIi11I1 + IiI11Ii111 % oOO
  if 1 - 1: ooOOO % Oo
  if 25 - 25: oOO . I11iiIi11i1I . OooOoo % IiIIii11Ii / Oo
  if 28 - 28: i1iiIII111
  if 18 - 18: OooOoo . ooOOO
  if 36 - 36: i1i1i1111I / oOO + oOo0O00 * iI1iII1I1I1i
  if 96 - 96: I11iiIi11i1I - I1I - I1Ii1I1 + I1I
  if 88 - 88: ooo000 + i1I . oOo0O00 % I1I / IIiIIiIi11I1 * Ooo0Ooo
  if 58 - 58: ooOOO % IiI11Ii111 + IiI11Ii111 . ooo000
  if 55 - 55: IiIIii11Ii % IiIIii11Ii
  if 81 - 81: iI1iII1I1I1i
  if 22 - 22: I11iiIi11i1I
  if 33 - 33: oOo0O00 - I11iiIi11i1I % ooo000 + Oo . I1Ii1I1
  if 42 - 42: IiIIii11Ii / i1i1i1111I / IiIIii11Ii / IiIIii11Ii
  if 19 - 19: Iii1i . Iii1i + i1iiIII111
  if 28 - 28: i1iiIII111 % oOO / ooo000 . oOo0O00
  if 78 - 78: I1I % Oo
  if 72 - 72: IiI11Ii111 * i1i1i1111I * i1I
  if 83 - 83: Ooo0Ooo * i1iiIII111 + I1I / Ii
  if 64 - 64: ooOOO . Oo - iI1iII1I1I1i . I1Ii1I1
  if 77 - 77: ooo000 % i1I / Iii1i
  if 37 - 37: i1I
  if 1 - 1: OooOoo + Ii - I11iiIi11i1I % Ii
  if 44 - 44: i1i1i1111I . Oo - oOo0O00 - i1iiIII111 + ooo000 + i1i1i1111I
  if 72 - 72: IiI11Ii111 - ooo000 . oOo0O00
  if 90 - 90: Oo - IiI11Ii111 + Iii1i . i1
  if 7 - 7: OooOoo
  if 14 - 14: Ooo0Ooo * I1Ii1I1 / i1i1i1111I
  if 25 - 25: oOO + Ii . Ii + Ii . i1i1i1111I + ooOOO
  if 43 - 43: ooo000 % I1Ii1I1 + i1I / Oo - i1iiIII111 / OooOoo
  if 97 - 97: iI1iII1I1I1i - Oo * I11iiIi11i1I % i1I / IIiIIiIi11I1
  if 85 - 85: i1iiIII111 + IIiIIiIi11I1 * i1i1i1111I / ooOOO
  if 99 - 99: i1i1i1111I * oOO + i1
  if 85 - 85: I1I * i1i1i1111I * IIiIIiIi11I1 . I1I . I1I . iI1iII1I1I1i
  if 50 - 50: Oo - i1iiIII111
webpwd = None
webServerPort = 0
autoCompressStartTimeFullsame = 0
httpsKey = ""
httpsCert = ""
if 27 - 27: I11iiIi11i1I % oOo0O00 + iI1iII1I1I1i * OooOoo * I11iiIi11i1I
if 14 - 14: IiIIii11Ii / ooo000
cp = configparser . ConfigParser ( allow_no_value = True )
cp . read ( wgGlobal . wgcloudpath1001configfileName , encoding = "utf-8-sig" )
if cp . has_section ( 'wgconf' ) :
 config = cp . items ( "wgconf" )
 if 58 - 58: I1I % I1I - ooOOO . I1Ii1I1 - oOo0O00
 if cp . has_option ( 'wgconf' , 'cloudserverIP' ) :
  wgGlobal . dataserverIP = cp [ 'wgconf' ] [ 'cloudserverIP' ]
 if cp . has_option ( 'wgconf' , 'cloudserverPort' ) :
  wgGlobal . dataserverPort = int ( cp [ 'wgconf' ] [ 'cloudserverPort' ] )
  if 74 - 74: OooOoo . Oo - Oo * Iii1i / I1Ii1I1 - ooOOO
  if 4 - 4: I11iiIi11i1I * IiIIii11Ii - Oo + oOO
 if cp . has_option ( 'wgconf' , 'httpsKey' ) :
  httpsKey = cp [ 'wgconf' ] [ 'httpsKey' ]
 if cp . has_option ( 'wgconf' , 'httpsCert' ) :
  httpsCert = cp [ 'wgconf' ] [ 'httpsCert' ]
 if cp . has_option ( 'wgconf' , 'webServerPort' ) :
  webServerPort = int ( cp [ 'wgconf' ] [ 'webServerPort' ] )
 if cp . has_option ( 'wgconf' , 'autoCompressStartTimeFullsame' ) :
  autoCompressStartTimeFullsame = cp [ 'wgconf' ] [ 'autoCompressStartTimeFullsame' ]
  if 11 - 11: I1I - ooo000 / I11iiIi11i1I
 if cp . has_option ( 'wgconf' , 'webpwd' ) :
  webpwd = cp [ 'wgconf' ] [ 'webpwd' ]
 if cp . has_option ( 'wgconf' , 'commTimeout10ms' ) :
  wgGlobal . commTimeout10ms = int ( cp [ 'wgconf' ] [ 'commTimeout10ms' ] )
  if 56 - 56: Ii + ooOOO - Oo + ooo000 . Ooo0Ooo
  if 25 - 25: ooo000 / IiI11Ii111 / ooOOO
  if 68 - 68: I11iiIi11i1I - Oo - Ii * i1 * Oo
  if 29 - 29: Ii
  if 5 - 5: i1 + oOO . ooOOO . IiI11Ii111 / ooo000
  if 51 - 51: i1 . ooOOO * I1I - I1Ii1I1
  if 27 - 27: oOo0O00 * IiI11Ii111 * oOo0O00
  if 94 - 94: Oo
  if 24 - 24: IiI11Ii111 * oOo0O00 - i1 * i1iiIII111 / i1i1i1111I
  if 22 - 22: iI1iII1I1I1i + OooOoo
  if 2 - 2: Ooo0Ooo - Iii1i + ooOOO / I1Ii1I1 . Iii1i * IiI11Ii111
  if 46 - 46: Iii1i % i1 - Oo - Ii
  if 3 - 3: oOo0O00 * I11iiIi11i1I / I1Ii1I1 % Oo / Oo
  if 39 - 39: iI1iII1I1I1i + IiIIii11Ii - ooOOO % IIiIIiIi11I1 * IiIIii11Ii + iI1iII1I1I1i
  if 2 - 2: i1iiIII111 + IiI11Ii111 % IIiIIiIi11I1
  if 15 - 15: I11iiIi11i1I * Iii1i * OooOoo
  if 53 - 53: OooOoo * IiIIii11Ii
  if 64 - 64: i1
  if 74 - 74: Ooo0Ooo * I1I + i1i1i1111I * ooo000 / Oo * ooOOO
  if 81 - 81: iI1iII1I1I1i % I1Ii1I1 % IiIIii11Ii + ooo000 + Ooo0Ooo % ooOOO
  if 40 - 40: i1I . I11iiIi11i1I
  if 90 - 90: Oo % iI1iII1I1I1i - i1I
  if 45 - 45: Iii1i . OooOoo - iI1iII1I1I1i
  if 88 - 88: oOo0O00 % IiI11Ii111
  if 72 - 72: oOo0O00 / oOo0O00 - oOo0O00 . iI1iII1I1I1i . I1I . oOo0O00
  if 76 - 76: Ii
  if 63 - 63: Ooo0Ooo . Iii1i + Ii
  if 33 - 33: oOo0O00 + I11iiIi11i1I
  if 86 - 86: i1i1i1111I / ooOOO * I1I / i1I - i1i1i1111I
  if 38 - 38: IIiIIiIi11I1 . IiIIii11Ii
  if 32 - 32: ooo000 * ooo000 - ooOOO . IiI11Ii111 + I1Ii1I1 + i1I
  if 56 - 56: i1I + I1I / OooOoo + oOO - oOo0O00 / oOo0O00
  if 11 - 11: iI1iII1I1I1i % I1Ii1I1 % ooo000
  if 56 - 56: OooOoo
  if 68 - 68: i1iiIII111 * IiIIii11Ii % IiIIii11Ii - Ooo0Ooo
  if 60 - 60: iI1iII1I1I1i - oOO . Ooo0Ooo . i1i1i1111I
  if 97 - 97: oOo0O00 % i1
  if 75 - 75: OooOoo + oOO % oOo0O00 % ooo000 . OooOoo
  if 52 - 52: iI1iII1I1I1i . iI1iII1I1I1i % i1i1i1111I . ooOOO . Oo * i1iiIII111
  if 77 - 77: oOo0O00
  if 73 - 73: i1iiIII111 * Oo . i1I * I11iiIi11i1I
  if 95 - 95: I1I . OooOoo % IIiIIiIi11I1 % i1 / OooOoo * oOo0O00
  if 81 - 81: Iii1i * IiI11Ii111 - I1I
  if 15 - 15: Iii1i
  if 20 - 20: I11iiIi11i1I . i1 . Oo / Iii1i - I11iiIi11i1I
  if 57 - 57: Oo . ooo000 + I1Ii1I1 - i1
  if 70 - 70: iI1iII1I1I1i % IiI11Ii111 * Oo
  if 56 - 56: Iii1i * I1Ii1I1
  if 19 - 19: i1 * I11iiIi11i1I / oOO * IIiIIiIi11I1 / oOo0O00 - oOo0O00
  if 86 - 86: i1I
  if 64 - 64: ooOOO * ooo000 - Oo
  if 60 - 60: OooOoo - oOo0O00 . Oo - i1I
  if 50 - 50: i1I
  if 39 - 39: IiI11Ii111
  if 57 - 57: IiIIii11Ii
  if 18 - 18: iI1iII1I1I1i * Iii1i + IiIIii11Ii / I11iiIi11i1I
  if 65 - 65: I11iiIi11i1I + ooo000
  if 66 - 66: I1Ii1I1
  if 84 - 84: i1I + i1iiIII111
  if 59 - 59: ooOOO / oOo0O00 * i1i1i1111I - IIiIIiIi11I1 * IIiIIiIi11I1 - IiI11Ii111
  if 85 - 85: I11iiIi11i1I % I11iiIi11i1I
  if 34 - 34: i1iiIII111 * i1I
  if 75 - 75: IiI11Ii111 % i1i1i1111I - Ii
  if 4 - 4: i1 / Oo . IIiIIiIi11I1 - i1 + i1 * Oo
  if 23 - 23: Ooo0Ooo - Ii . ooOOO % Ii . i1i1i1111I * iI1iII1I1I1i
  if 98 - 98: Iii1i % i1iiIII111 / Oo
  if 90 - 90: OooOoo - i1I * I1I % I1I
  if 33 - 33: oOo0O00 - I1I / I1Ii1I1 * Ooo0Ooo
  if 68 - 68: i1I . Iii1i
  if 81 - 81: I1I . OooOoo . IiIIii11Ii . i1I - i1i1i1111I % i1iiIII111
  if 24 - 24: I11iiIi11i1I * I1I - i1I / I11iiIi11i1I - IiIIii11Ii + IiI11Ii111
  if 72 - 72: iI1iII1I1I1i . Ooo0Ooo
  if 81 - 81: i1I . OooOoo . oOo0O00 % Oo
  if 16 - 16: Ii / oOO % Iii1i + i1
  if 38 - 38: IiIIii11Ii - I1Ii1I1 . oOo0O00
  if 10 - 10: i1 % IiI11Ii111 % oOo0O00 % IiI11Ii111 - Ii
  if 70 - 70: i1I . ooOOO - Iii1i * i1iiIII111 . ooOOO - I1I
  if 43 - 43: OooOoo
  if 27 - 27: i1iiIII111 * Ii * IIiIIiIi11I1 / i1I . IiI11Ii111
  if 90 - 90: IiIIii11Ii
  if 10 - 10: IiI11Ii111 % oOO . OooOoo - ooOOO
# dd678faae9ac167bc83abf78e5cb2f3f0688d3a3
