Пример #1
0
 def fromJSON(s, file_name, template_replace=False):
     J = JSON_deser_type_and_ver_check(s, "Election", 1)
     if template_replace:
         J = templateReplace(J, J)
     return Election(proposal_hash=J["proposal"],
                     proposal_meta_hash=J["proposal_meta"],
                     vote_hashes=J["votes"],
                     file_name=file_name)
Пример #2
0
 def fromJSON(s, file_name, template_replace=False):
     J=JSON_deser_type_and_ver_check(s, "Election", 1)
     if template_replace:
         J=templateReplace(J, J)
     return Election(
         proposal_hash      =J["proposal"],
         proposal_meta_hash =J["proposal_meta"],
         vote_hashes        =J["votes"],
         file_name          =file_name)
Пример #3
0
 def fromJSON(s, file_name, template_replace=False):
     J = JSON_deser_type_and_ver_check(s, "Vote", 1)
     if template_replace:
         J = templateReplace(J, J)
     return Vote(handle=J["handle"],
                 ballot_option=J["ballot_option"],
                 proposal_hash=J["proposal"],
                 proposal_meta_hash=J["proposal_meta"],
                 addr=J["addr"],
                 signature=J["signature"],
                 file_name=file_name)
Пример #4
0
 def fromJSON(s, file_name, template_replace=False):
     J = JSON_deser_type_and_ver_check(s, "ProposalMetadata", 1)
     if template_replace:
         J = templateReplace(J, J)
     return ProposalMetadata(title=J["title"],
                             proposal_hash=J["proposal"],
                             team_hash=J["team"],
                             supersede_hashes=J["supersedes"],
                             confirm_hashes=J["confirms"],
                             ballot_options=J["ballot_options"],
                             voting_methods=J["voting_methods"],
                             file_name=file_name)
Пример #5
0
 def fromJSON(s, file_name, template_replace=False):
     J=JSON_deser_type_and_ver_check(s, "Vote", 1)
     if template_replace:
         J=templateReplace(J, J)
     return Vote(
         handle             =J["handle"],
         ballot_option      =J["ballot_option"],
         proposal_hash      =J["proposal"],
         proposal_meta_hash =J["proposal_meta"],
         addr               =J["addr"],
         signature          =J["signature"],
         file_name          =file_name)
Пример #6
0
 def fromJSON(s, file_name, template_replace=False):
     J=JSON_deser_type_and_ver_check(s, "ProposalMetadata", 1)
     if template_replace:
         J=templateReplace(J, J)
     return ProposalMetadata(
              title               =J["title"],
              proposal_hash       =J["proposal"],
              team_hash           =J["team"],
              supersede_hashes    =J["supersedes"],
              confirm_hashes      =J["confirms"],
              ballot_options      =J["ballot_options"],
              voting_methods      =J["voting_methods"],
              file_name           =file_name)
Пример #7
0
 def fromJSON(s, file_name, template_replace=False):
     J = JSON_deser_type_and_ver_check(s, "MemberDict", 1)
     if template_replace:
         J = templateReplace(J, J)
     return MemberDict(member_map=J["member_map"], file_name=file_name)
Пример #8
0
 def fromJSON(s, file_name, template_replace=False):
     J = JSON_deser_type_and_ver_check(s, "ProposalText", 1)
     if template_replace:
         J = templateReplace(J, J)
     return ProposalText(fulltext=J["fulltext"], file_name=file_name)
Пример #9
0
 def fromJSON(s, file_name, template_replace=False):
     J=JSON_deser_type_and_ver_check(s, "MemberDict", 1)
     if template_replace:
         J=templateReplace(J, J)
     return MemberDict(member_map = J["member_map"],
                       file_name  = file_name)
Пример #10
0
 def fromJSON(s, file_name, template_replace=False):
     J=JSON_deser_type_and_ver_check(s, "ProposalText", 1)
     if template_replace:
         J=templateReplace(J, J)
     return ProposalText(fulltext=  J["fulltext"],
                         file_name =file_name)