コード例 #1
0
 def _validate(self):
     hasher = hashlib.md5()
     hasher.update(self.raw['text'].encode())
     self.raw['script_hash'] = hasher.hexdigest()
     _, err_str = compile_script(self.raw['script_hash'], self.raw['text'], self.raw['title'])
     if err_str:
         raise DataError(err_str)
コード例 #2
0
ファイル: scripts.py プロジェクト: cookiezeater/Lampost-Mud
def validate(script_dict):
    code, err_str = compile_script(script_dict['text'], script_dict['name'])
    if err_str:
        raise DataError(err_str)
    return code