Skip to content
Snippets Groups Projects
Select Git revision
  • c8f4e65f8c863f197a77b8c1947ef17b901bf9eb
  • master default protected
  • duniter-v2s-issue-123-industrialize-releases
  • develop
  • v1.8.3
  • 1.8.2
6 results

lib.rs

Blame
  • status.py 880 B
    '''
    Created on 2 déc. 2014
    
    @author: inso
    '''
    
    from . import Document
    from .. import PROTOCOL_VERSION
    
    
    class Status(Document):
        '''
        Version: VERSION
        Type: Status
        Currency: CURRENCY_NAME
        Status: STATUS
        Block: BLOCK
        From: SENDER
        To: RECIPIENT
        '''
    
        def __init__(self, currency, status, blockid, sender, recipient):
            '''
            Constructor
            '''
            self.currency = currency
            self.status = status
            self.blockid = blockid
            self.sender = sender
            self.recipient = recipient
    
        @classmethod
        def from_raw(cls, raw):
            #TODO : Parsing
            return cls()
    
        def content(self):
            return '''
    Version: {0}
    Type: Status
    Currency: {1}
    Status: {2}
    Block: {3}
    From: {4}
    To: {5}
    '''.format(PROTOCOL_VERSION, self.currency, self.status,
               self.blockid, self.sender, self.recipient)