1010from lib .core .common import randomStr
1111from lib .core .data import conf
1212from lib .core .data import logger
13+ from lib .core .enums import REGISTRY_OPERATION
1314
1415class Registry :
1516 """
@@ -49,11 +50,11 @@ def _initVars(self, regKey, regValue, regType=None, regData=None, parse=False):
4950 def _createLocalBatchFile (self ):
5051 self ._batPathFp = open (self ._batPathLocal , "w" )
5152
52- if self ._operation == "read" :
53+ if self ._operation == REGISTRY_OPERATION . READ :
5354 lines = self ._batRead
54- elif self ._operation == "add" :
55+ elif self ._operation == REGISTRY_OPERATION . ADD :
5556 lines = self ._batAdd
56- elif self ._operation == "delete" :
57+ elif self ._operation == REGISTRY_OPERATION . DELETE :
5758 lines = self ._batDel
5859
5960 for line in lines :
@@ -70,7 +71,7 @@ def _createRemoteBatchFile(self):
7071 os .unlink (self ._batPathLocal )
7172
7273 def readRegKey (self , regKey , regValue , parse = False ):
73- self ._operation = "read"
74+ self ._operation = REGISTRY_OPERATION . READ
7475
7576 Registry ._initVars (self , regKey , regValue , parse = parse )
7677 self ._createRemoteBatchFile ()
@@ -90,7 +91,7 @@ def readRegKey(self, regKey, regValue, parse=False):
9091 return data
9192
9293 def addRegKey (self , regKey , regValue , regType , regData ):
93- self ._operation = "add"
94+ self ._operation = REGISTRY_OPERATION . ADD
9495
9596 Registry ._initVars (self , regKey , regValue , regType , regData )
9697 self ._createRemoteBatchFile ()
@@ -103,7 +104,7 @@ def addRegKey(self, regKey, regValue, regType, regData):
103104 self .delRemoteFile (self ._batPathRemote )
104105
105106 def delRegKey (self , regKey , regValue ):
106- self ._operation = "delete"
107+ self ._operation = REGISTRY_OPERATION . DELETE
107108
108109 Registry ._initVars (self , regKey , regValue )
109110 self ._createRemoteBatchFile ()
0 commit comments