13 changed files with 240 additions and 28 deletions
Binary file not shown.
Binary file not shown.
@ -0,0 +1,4 @@
|
||||
Copyright (c) 2010-2011, Jeff Bell [www.randombell.com] | [jeffbell@randombell.com]. |
||||
This font may be distributed freely however must retain this document as well as the Readme.txt file. |
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1. |
||||
This license is available with a FAQ at: http://scripts.sil.org/OFL |
||||
@ -0,0 +1,21 @@
|
||||
TR2N v1.3 |
||||
|
||||
ABOUT THE FONT: |
||||
A font based upon the poster text for TRON LEGACY. |
||||
|
||||
The font is different from the pre-existing TRON font currently on the web. Similar in minor aspects but different in most. Style based upon text from different region posters. |
||||
|
||||
UPDATE HISTORY: |
||||
3/7/11 - Adjusted the letter B (both lowercase and uppercase), capped off the ends of T, P and R, added a few more punctuation marks, as well as added the TR and TP ligature to allow for the solid bar connect as in the poster art. |
||||
|
||||
1/22/11 - Made minor corrections to all previous letters and punctuation. Corrected issue with number 8's top filling in. |
||||
|
||||
ABOUT THE AUTHOR: |
||||
Jeff Bell has produced fonts before, but this is the first one in over 10 years. His original 3 fonts were under the name DJ-JOHNNYRKA and include "CASPER", "BEVERLY HILLS COP", "THE GODFATHER" and "FIDDUMS FAMILY". |
||||
|
||||
For more information on Jeff Bell and his work can be found online: |
||||
|
||||
www.randombell.com |
||||
www.damovieman.deviantart.com |
||||
http://www.imdb.com/name/nm3983081/ |
||||
http://www.vimeo.com/user4004969/videos |
||||
Binary file not shown.
@ -0,0 +1,179 @@
|
||||
# -*- encoding: utf8 -*- |
||||
|
||||
'''Module exchange_rate: |
||||
|
||||
This module is responsible for getting the conversion rates between different |
||||
currencies. |
||||
''' |
||||
|
||||
from kivy.network.urlrequest import UrlRequest |
||||
#kivy.event import EventDispatcher |
||||
from kivy.clock import Clock |
||||
import decimal |
||||
import json |
||||
|
||||
class Exchanger(object): |
||||
''' |
||||
''' |
||||
|
||||
symbols = {'ALL': 'Lek', 'AED': 'د.إ', 'AFN':'؋', 'ARS': '$', 'AMD': '֏', |
||||
'AWG': 'ƒ', 'ANG': 'ƒ', 'AOA': 'Kz', 'BDT': '৳', 'BHD': 'BD', |
||||
'BIF': 'FBu', 'BTC': 'BTC', 'BTN': 'Nu', |
||||
'AUD': '$', 'AZN': 'ман', 'BSD': '$', 'BBD': '$', 'BYR': 'p', |
||||
'BZD': 'BZ$', 'BMD': '$', 'BOB': '$b', 'BAM': 'KM', 'BWP': 'P', |
||||
'BGN': 'лв', 'BRL': 'R$', 'BND': '$', 'KHR': '៛', 'CAD': '$', |
||||
'KYD': '$', 'USD': '$', 'CLP': '$', 'CNY': '¥', 'COP': '$', 'CRC': '₡', |
||||
'HRK': 'kn', 'CUP':'₱', 'CZK': 'Kč', 'DKK': 'kr', 'DOP': 'RD$', |
||||
'XCD': '$', 'EGP': '£', 'SVC': '$' , 'EEK': 'kr', 'EUR': '€', |
||||
'FKP': '£', 'FJD': '$', 'GHC': '¢', 'GIP': '£', 'GTQ': 'Q', 'GBP': '£', |
||||
'GYD': '$', 'HNL': 'L', 'HKD': '$', 'HUF': 'Ft', 'ISK': 'kr', |
||||
'INR': '₹', 'IDR': 'Rp', 'IRR': '﷼', 'IMP': '£', 'ILS': '₪', |
||||
'JMD': 'J$', 'JPY': '¥', 'JEP': '£', 'KZT': 'лв', 'KPW': '₩', |
||||
'KRW': '₩', 'KGS': 'лв', 'LAK': '₭', 'LVL': 'Ls'} |
||||
|
||||
def __init__(self, parent): |
||||
self.parent = parent |
||||
self.quote_currencies = None |
||||
self.exchanges = ('BlockChain', 'Coinbase', 'CoinDesk') |
||||
try: |
||||
self.use_exchange = parent.electrum_config.get('use_exchange', |
||||
'BlockChain') |
||||
except AttributeError: |
||||
self.use_exchange = 'BlockChain' |
||||
self.currencies = self.symbols.keys() |
||||
|
||||
def exchange(self, btc_amount, quote_currency): |
||||
if self.quote_currencies is None: |
||||
return None |
||||
quote_currencies = self.quote_currencies.copy() |
||||
if quote_currency not in quote_currencies: |
||||
return None |
||||
if self.use_exchange == "CoinDesk": |
||||
try: |
||||
connection = httplib.HTTPSConnection('api.coindesk.com') |
||||
connection.request("GET", "/v1/bpi/currentprice/" + str(quote_currency) + ".json") |
||||
except Exception: |
||||
return |
||||
resp = connection.getresponse() |
||||
if resp.reason == httplib.responses[httplib.NOT_FOUND]: |
||||
return |
||||
try: |
||||
resp_rate = json.loads(resp.read()) |
||||
except Exception: |
||||
return |
||||
return btc_amount * decimal.Decimal(str(resp_rate["bpi"][str(quote_currency)]["rate_float"])) |
||||
return btc_amount * decimal.Decimal(quote_currencies[quote_currency]) |
||||
|
||||
def check_rates(self, dt): |
||||
if self.use_exchange == 'BlockChain': |
||||
self.check_blockchain() |
||||
elif self.use_exchange == 'CoinDesk': |
||||
self.check_coindesk() |
||||
elif self.use_exchange == 'Coinbase': |
||||
self.check_coinbase() |
||||
|
||||
def check_coindesk(self): |
||||
|
||||
def _lookup_rate(response, quote_id): |
||||
return decimal.Decimal(str(response[str(quote_id)]["15m"])) |
||||
|
||||
def on_success(request, response): |
||||
quote_currencies = {} |
||||
try: |
||||
for r in response: |
||||
quote_currencies[r] = _lookup_rate(response, r) |
||||
self.quote_currencies = quote_currencies |
||||
except KeyError: |
||||
pass |
||||
self.parent.set_currencies(quote_currencies) |
||||
|
||||
def on_failure(*args): |
||||
pass |
||||
|
||||
def on_error(*args): |
||||
pass |
||||
|
||||
def on_redirect(*args): |
||||
pass |
||||
|
||||
req = UrlRequest( |
||||
url='https://api.coindesk.com/v1/bpi/supported-currencies.json', |
||||
on_success=on_success, |
||||
on_failure=on_failure, |
||||
on_error=on_error, |
||||
on_redirect=on_redirect, |
||||
timeout=5) |
||||
|
||||
def check_coinbase(self): |
||||
|
||||
def _lookup_rate(response, quote_id): |
||||
return decimal.Decimal(str(response[str(quote_id)])) |
||||
|
||||
def on_success(request, response): |
||||
quote_currencies = {} |
||||
try: |
||||
for r in response: |
||||
if r[:7] == "btc_to_": |
||||
quote_currencies[r[7:].upper()] =\ |
||||
_lookup_rate(response, r) |
||||
self.quote_currencies = quote_currencies |
||||
except KeyError: |
||||
pass |
||||
self.parent.set_currencies(quote_currencies) |
||||
|
||||
def on_failure(*args): |
||||
pass |
||||
|
||||
def on_error(*args): |
||||
pass |
||||
|
||||
def on_redirect(*args): |
||||
pass |
||||
|
||||
req = UrlRequest( |
||||
url='https://coinbase.com/api/v1/currencies/exchange_rates', |
||||
on_success=on_success, |
||||
on_failure=on_failure, |
||||
on_error=on_error, |
||||
on_redirect=on_redirect, |
||||
timeout=5) |
||||
|
||||
def check_blockchain(self): |
||||
|
||||
def _lookup_rate(response, quote_id): |
||||
return decimal.Decimal(str(response[str(quote_id)]["15m"])) |
||||
|
||||
def on_success(request, response): |
||||
quote_currencies = {} |
||||
try: |
||||
for r in response: |
||||
quote_currencies[r] = _lookup_rate(response, r) |
||||
self.quote_currencies = quote_currencies |
||||
except KeyError: |
||||
pass |
||||
self.parent.set_currencies(quote_currencies) |
||||
|
||||
def on_failure(*args): |
||||
pass |
||||
|
||||
def on_error(*args): |
||||
pass |
||||
|
||||
def on_redirect(*args): |
||||
pass |
||||
|
||||
req = UrlRequest(url='https://blockchain.info/ticker', |
||||
on_success=on_success, |
||||
on_failure=on_failure, |
||||
on_error=on_error, |
||||
on_redirect=on_redirect, |
||||
timeout=5) |
||||
|
||||
def start(self): |
||||
# check every 5 seconds |
||||
self.check_rates(0) |
||||
Clock.schedule_interval(self.check_rates, 5) |
||||
|
||||
def stop(self): |
||||
Clock.unschedule(self.check_rates) |
||||
|
||||
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 219 KiB |
Loading…
Reference in new issue