def send_file(data, seed): waves = Waves('https://testnode2.wavesnodes.com', 'testnet', seed) print(seed) tx_data = data.get("content").get("content") owner_id = waves.get_address_from_seed() title = data.get("file").get("title") description = data.get("file").get("description") user_id = data.get("recipients")[0] transaction = [{'type': 'string', 'key': 'file', 'value': tx_data}] print(transaction) tx_info = waves.send_data_transaction(transaction) print(tx_info) tx_id = tx_info.get("id") DocumentRepository.add_info_into_documents(tx_id, owner_id, title, description) DocumentRepository.add_info_into_sign_request(tx_id, user_id) return tx_id
def download_file(id): waves = Waves('https://testnode2.wavesnodes.com', 'testnet', seed) file = waves.get_transaction_by_id(id) file1 = file.get("data") #to 64 return file1
def get_documents(seed): waves = Waves('https://testnode2.wavesnodes.com', 'testnet', seed) address = waves.get_address_from_seed() print(str(address)) return DocumentRepository.find_all(address)
def get_counters(seed): waves = Waves('https://testnode2.wavesnodes.com', 'testnet', seed) address = waves.get_address_from_seed() return DocumentRepository.find_counters(address)
def sign_document(id, seed): waves = Waves('https://testnode2.wavesnodes.com', 'testnet', seed) address = waves.get_address_from_seed() transaction = [{'type': 'string', 'key': 'file', 'value': id}] waves.send_data_transaction(transaction) DocumentRepository.update_status(address, id)
from raver import Raver from waves import Waves from fullred import FullRed from sine import Sine from flat import Flat from wheel import Wheel from patterns import PATTERNS COLS = 20 ROWS = 12 # Testing toggle if False: pat = PATTERNS['dear-big'] effects = [ Waves(COLS, ROWS, pat), Sine(COLS, ROWS, pat), Flat(COLS, ROWS, pat), Wheel(COLS, ROWS, pat) ] else: pat = PATTERNS['orphan-asylum-3'] effects = [Flat(COLS, ROWS, pat)] # effects = [Waves(COLS, ROWS, PATTERNS['dear-bold'])] #------------------------------------------------------------------------------- # handle command line fake = os.environ.get('FAKE') if len(sys.argv) == 1:
import math import sys import opc import os import color_utils import random from fake_client import FakeClient from raver import Raver from waves import Waves from fullred import FullRed from sine import Sine effects = [Waves(200), FullRed(200), Sine(200)] effect_idx = 0 #------------------------------------------------------------------------------- # handle command line fake = os.environ.get('FAKE') if len(sys.argv) == 1: IP_PORT = '127.0.0.1:7890' elif len(sys.argv ) == 2 and ':' in sys.argv[1] and not sys.argv[1].startswith('-'): IP_PORT = sys.argv[1] else: print print ' Usage: raver_plaid.py [ip:port]'
from raver import Raver from waves import Waves from fullred import FullRed from sine import Sine from flat import Flat from wheel import Wheel from patterns import PATTERNS COLS = 20 ROWS = 12 # Testing toggle if False: pat = PATTERNS['dear-big'] effects = [Waves(COLS, ROWS, pat), Sine(COLS, ROWS, pat), Flat(COLS, ROWS, pat), Wheel(COLS, ROWS, pat)] else: effects = [Waves(COLS, ROWS, PATTERNS['dear-bold'])] #------------------------------------------------------------------------------- # handle command line fake = os.environ.get('FAKE') if len(sys.argv) == 1: IP_PORT = '127.0.0.1:7890' elif len(sys.argv) == 2 and ':' in sys.argv[1] and not sys.argv[1].startswith('-'):