View btc_send.py
from pywallet import wallet
from transactions import Transactions
from bitcoinrpc.authproxy import AuthServiceProxy
BITCOIND_JSON_RPC_URL = 'http://user:pass@host:8332'
def create_wallet(seed: str=None, network: str='BTC', children=0) -> dict:
""" Step 1 """
if not seed:
View push_tx.py
import os
import requests
os.environ.setdefault('PYCOIN_DEFAULT_NETCODE', 'XTN')
os.environ.setdefault('PYCOIN_XTN_PROVIDERS', 'chain.so')
from pycoin.key.electrum import ElectrumWallet
from pycoin.tx.tx_utils import (create_tx, sign_tx)
from pycoin.services import spendables_for_address
View profit.py
from datetime import datetime
from time import sleep
from colorclass import Color
from poloniex import Poloniex
from terminaltables import AsciiTable
API_KEY = ""
API_SECRET = ''
polo = Poloniex(API_KEY, API_SECRET)
View backup_file_fields.py
import os
import tarfile
import progressbar
import django.apps
from datetime import datetime
from django.core.management.base import BaseCommand
from django.utils.encoding import smart_str
class Command(BaseCommand):
View put_pos.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import os
import shutil
SHUUP_PATH = '~/.pyenv/versions/project/lib/python3.5/site-packages/shuup'
SOURCE_PATH = '~/projects/project'
View urls.py
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
urlpatterns = [
# ...
]
handler400 = 'apps.common.views.handler400'
handler403 = 'apps.common.views.handler403'
View middleware.py
# -*- coding: utf-8 -*
from __future__ import unicode_literals
import logging
from django.conf import settings
from importlib import import_module
engine = import_module(settings.SESSION_ENGINE)
SessionStore = engine.SessionStore
View dashboard.py
# -*- coding: utf-8 -*-
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from admin_tools.dashboard import modules
from admin_tools.dashboard import Dashboard
from admin_tools.menu import Menu
from admin_tools.menu import items
from project.dashboard_modules import WorkedTaskDashboardModuleChart
View is_owner.py
# -*- coding: utf-8 -*-
from django import template
register = template.Library()
@register.assignment_tag(takes_context=True)
def is_owner(context, obj, user, field_name='user'):
return getattr(obj, field_name, None) == user