Skip to content
Snippets Groups Projects
Select Git revision
  • c60745cf27edef74de07d082777c5a7a139de6a0
  • master default protected
  • dev
  • appimage
  • fix_gitlab
  • fixappveyor
  • gitlab
  • fix_ci
  • fix_dbus_error
  • fix_ci_osx
  • sakia020
  • fix_travis#1105
  • feature/backend
  • check_uniq_node_by_endpoints
  • qt5.7
  • feature/agent_architecture
  • translations
  • pyqt5.6
  • qtwebengine
  • pyinstaller
  • landscape
  • 0.53.2
  • 0.53.1
  • 0.53.0
  • 0.52.0
  • 0.51.1
  • 0.51.0
  • 0.50.5
  • 0.50.4
  • 0.50.3
  • 0.50.2
  • 0.50.1
  • 0.50.0
  • 0.33.0rc7
  • 0.33.0rc6
  • 0.33.0rc5
  • 0.33.0rc4
  • 0.33.0rc3
  • 0.33.0rc2
  • 0.33.0rc1
  • 0.32.10post1
41 results

status.py

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)