コード例 #1
0
ファイル: io.py プロジェクト: GabrielDiniz/FluxNetControl
 def getDecryptedFile():
     """
         Retorna o conteudo do arquivo de configuracao
         caso nao exista gera uma excecao
     """
     cipher = CCrypt()
     return cipher.decrypt(IOConfig.getFile(IOConfig.FILE))
コード例 #2
0
 def getDecryptedFile():
     """
         Retorna o conteudo do arquivo de configuracao
         caso nao exista gera uma excecao
     """
     cipher = CCrypt()
     return cipher.decrypt(IOConfig.getFile(IOConfig.FILE))
コード例 #3
0
ファイル: io.py プロジェクト: GabrielDiniz/FluxNetControl
    def getRoot():
        """Retorna o node principal do XML"""
        if not IOConfig.exists():
            raise Exception("Arquivo de configuração não encontrado.")
        else:
            f = open(IOConfig.FILE)
            xmlstr = f.read()
            f.close()

            cipher = CCrypt()
            xmlstr = cipher.decrypt(xmlstr)

            xml = minidom.parseString(xmlstr)
            root = xml.getElementsByTagName("config")[0]
            return root
コード例 #4
0
    def getRoot():
        """Retorna o node principal do XML"""
        if not IOConfig.exists():
            raise Exception('Arquivo de configuração não encontrado.')
        else:
            f = open(IOConfig.FILE)
            xmlstr = f.read()
            f.close()

            cipher = CCrypt()
            xmlstr = cipher.decrypt(xmlstr)

            xml = minidom.parseString(xmlstr)
            root = xml.getElementsByTagName('config')[0]
            return root
コード例 #5
0
ファイル: io.py プロジェクト: GabrielDiniz/FluxNetControl
 def encryptFile(config):
     cipher = CCrypt()
     return cipher.encrypt(config)
コード例 #6
0
 def encryptFile(config):
     cipher = CCrypt()
     return cipher.encrypt(config)