@@ -874,20 +874,20 @@ def GetConfig32(self):
874874 self .local .add_log ("start GetConfig32 function" , "debug" )
875875 config32 = Dict ()
876876 result = self .liteClient .Run ("getconfig 32" )
877- config32 ["totalValidators" ] = int (parse (result , "total:" , ' ' ))
878- config32 ["mainValidators" ] = int (parse (result , "main:" , ' ' ))
879- config32 ["startWorkTime" ] = int (parse (result , "utime_since:" , ' ' ))
880- config32 ["endWorkTime" ] = int (parse (result , "utime_until:" , ' ' ))
877+ config32 ["totalValidators" ] = int (parse (result , "total:" , ' ' ) or 0 )
878+ config32 ["mainValidators" ] = int (parse (result , "main:" , ' ' ) or 0 )
879+ config32 ["startWorkTime" ] = int (parse (result , "utime_since:" , ' ' ) or 0 )
880+ config32 ["endWorkTime" ] = int (parse (result , "utime_until:" , ' ' ) or 0 )
881881 lines = result .split ('\n ' )
882882 validators = list ()
883883 for line in lines :
884884 if "public_key:" in line :
885885 validatorAdnlAddr = parse (line , "adnl_addr:x" , ')' )
886886 pubkey = parse (line , "pubkey:x" , ')' )
887887 try :
888- validatorWeight = int (parse (line , "weight:" , ' ' ))
888+ validatorWeight = int (parse (line , "weight:" , ' ' ) or 0 )
889889 except ValueError :
890- validatorWeight = int (parse (line , "weight:" , ')' ))
890+ validatorWeight = int (parse (line , "weight:" , ')' ) or 0 )
891891 buff = Dict ()
892892 buff ["adnlAddr" ] = validatorAdnlAddr
893893 buff ["pubkey" ] = pubkey
@@ -911,21 +911,21 @@ def GetConfig34(self):
911911 self .local .add_log ("start GetConfig34 function" , "debug" )
912912 config34 = Dict ()
913913 result = self .liteClient .Run ("getconfig 34" )
914- config34 ["totalValidators" ] = int (parse (result , "total:" , ' ' ))
915- config34 ["mainValidators" ] = int (parse (result , "main:" , ' ' ))
916- config34 ["startWorkTime" ] = int (parse (result , "utime_since:" , ' ' ))
917- config34 ["endWorkTime" ] = int (parse (result , "utime_until:" , ' ' ))
918- config34 ["totalWeight" ] = int (parse (result , "total_weight:" , ' ' ))
914+ config34 ["totalValidators" ] = int (parse (result , "total:" , ' ' ) or 0 )
915+ config34 ["mainValidators" ] = int (parse (result , "main:" , ' ' ) or 0 )
916+ config34 ["startWorkTime" ] = int (parse (result , "utime_since:" , ' ' ) or 0 )
917+ config34 ["endWorkTime" ] = int (parse (result , "utime_until:" , ' ' ) or 0 )
918+ config34 ["totalWeight" ] = int (parse (result , "total_weight:" , ' ' ) or 0 )
919919 lines = result .split ('\n ' )
920920 validators = list ()
921921 for line in lines :
922922 if "public_key:" in line :
923923 validatorAdnlAddr = parse (line , "adnl_addr:x" , ')' )
924924 pubkey = parse (line , "pubkey:x" , ')' )
925925 try :
926- validatorWeight = int (parse (line , "weight:" , ' ' ))
926+ validatorWeight = int (parse (line , "weight:" , ' ' ) or 0 )
927927 except ValueError :
928- validatorWeight = int (parse (line , "weight:" , ')' ))
928+ validatorWeight = int (parse (line , "weight:" , ')' ) or 0 )
929929 buff = Dict ()
930930 buff ["adnlAddr" ] = validatorAdnlAddr
931931 buff ["pubkey" ] = pubkey
@@ -950,9 +950,9 @@ def GetConfig36(self):
950950 config36 = dict ()
951951 try :
952952 result = self .liteClient .Run ("getconfig 36" )
953- config36 ["totalValidators" ] = int (parse (result , "total:" , ' ' ))
954- config36 ["startWorkTime" ] = int (parse (result , "utime_since:" , ' ' ))
955- config36 ["endWorkTime" ] = int (parse (result , "utime_until:" , ' ' ))
953+ config36 ["totalValidators" ] = int (parse (result , "total:" , ' ' ) or 0 )
954+ config36 ["startWorkTime" ] = int (parse (result , "utime_since:" , ' ' ) or 0 )
955+ config36 ["endWorkTime" ] = int (parse (result , "utime_until:" , ' ' ) or 0 )
956956 lines = result .split ('\n ' )
957957 validators = list ()
958958 for line in lines :
0 commit comments