Skip to content

Commit

Permalink
Fixed all indentation for 2 spaces and removed unnecessary files
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvinwelter committed Sep 2, 2019
1 parent ff414ee commit eec0d2b
Show file tree
Hide file tree
Showing 80 changed files with 1,976 additions and 3,771 deletions.
549 changes: 549 additions & 0 deletions .pylintrc

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion example/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
from tago import Tago
import os

TOKEN = os.environ.get('TAGO_TOKEN_DEVICE') or 'b125e477-067f-46f4-86c5-830b426d25e9'
TOKEN = os.environ.get('TAGO_TOKEN_DEVICE') or 'a5da3fc5-3cd5-4ee4-9ab4-d781aab65ffd'

def func_callback(context, scope):
print('token:', context.token)
print('environment:', context.environment)
account_token = list(filter(lambda account_token: account_token['key'] == 'abc', context.environment))
print(account_token[0]['value'])
print('analysis_id:', context.analysis_id)
print('\n')
context.log(scope[0])
Expand Down
4 changes: 4 additions & 0 deletions example/create_device.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import os
from tago import Tago

ACCOUNT_TOKEN = os.environ.get('TAGO_TOKEN_DEVICE') or '4b119ae3-ea55-4ddc-b2df-7a0cfd6e8804'
10 changes: 5 additions & 5 deletions example/extra/extra_currency.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@


def print_result(result):
for key, value in result.iteritems():
print(key + " : ", value)
for key, value in result.iteritems():
print(key + " : ", value)


def test_convert():
result = Tago(TOKEN).extra.currency().convert('USD', 'GBP')
print("Convert USD to GBP:")
print_result(result)
result = Tago(TOKEN).extra.currency().convert('USD', 'GBP')
print("Convert USD to GBP:")
print_result(result)


test_convert()
12 changes: 6 additions & 6 deletions example/extra/extra_distance.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@


def print_result(result):
for key, value in result.iteritems():
print(key + " : ", value)
for key, value in result.iteritems():
print(key + " : ", value)


def test_measure():
result = Tago(TOKEN).extra.distance().measure(
'35.7706256,-78.6952835', '35.7728213,-78.6865257', '', '')
print("Distance Test:")
print_result(result)
result = Tago(TOKEN).extra.distance().measure(
'35.7706256,-78.6952835', '35.7728213,-78.6865257', '', '')
print("Distance Test:")
print_result(result)


test_measure()
18 changes: 9 additions & 9 deletions example/extra/extra_geo.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@


def print_result(result):
for key, value in result.iteritems():
print(key + " : ", value)
for key, value in result.iteritems():
print(key + " : ", value)


def test_getAddress():
result = Tago(TOKEN).extra.geocoding().getAddress('23.434213,24.3233323')
print("Get Address test")
print_result(result)
result = Tago(TOKEN).extra.geocoding().getAddress('23.434213,24.3233323')
print("Get Address test")
print_result(result)


def test_getGeolocation():
result = Tago(TOKEN).extra.geocoding().getGeolocation(
'Empire State Building, New York')
print("Get Geolocation test")
print_result(result)
result = Tago(TOKEN).extra.geocoding().getGeolocation(
'Empire State Building, New York')
print("Get Geolocation test")
print_result(result)


test_getGeolocation()
Expand Down
30 changes: 15 additions & 15 deletions example/extra/extra_weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,33 @@


def print_result(result):
for key, value in result.value.iteritems():
print(key + " : ", value)
for key, value in result.value.iteritems():
print(key + " : ", value)


def test_current():
result = Tago(TOKEN).extra.weather().current('27606', False, 'EN')
print("Current Weather Test:")
print_result(result)
result = Tago(TOKEN).extra.weather().current('27606', False, 'EN')
print("Current Weather Test:")
print_result(result)


def test_history():
result = Tago(TOKEN).extra.weather().history(
'2017-02-21', '27606', False, 'EN')
print("Weather History Test:")
print_result(result)
result = Tago(TOKEN).extra.weather().history(
'2017-02-21', '27606', False, 'EN')
print("Weather History Test:")
print_result(result)


def test_forecast():
result = Tago(TOKEN).extra.weather().forecast('27606', False, 'EN')
print("Weather Forecast Test:")
print_result(result)
result = Tago(TOKEN).extra.weather().forecast('27606', False, 'EN')
print("Weather Forecast Test:")
print_result(result)


def test_alerts():
result = Tago(TOKEN).extra.weather().alerts('27606', False, 'EN')
print("Weather Alert Test:")
print_result(result)
result = Tago(TOKEN).extra.weather().alerts('27606', False, 'EN')
print("Weather Alert Test:")
print_result(result)


test_current()
Expand Down
15 changes: 15 additions & 0 deletions example/listDevicesByTag.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import sys
import os
from tago import Tago

ANALYSYS_TOKEN = os.environ.get('TAGO_TOKEN_DEVICE') or 'a5da3fc5-3cd5-4ee4-9ab4-d781aab65ffd'

def myAnalysis(context, scope):
print(environment_variables)
account_token = list(filter(lambda account_token: account_token['key'] == 'account_token', context.environment))
account_token = account_token[0]{'account_token'}
account = Tago.account(account_token)
devices = account.devices.list(1, ['id', 'tags'], {tags: [{
key: 'analysis', value: 'geotraq',
}]}, 1000)
print(devices)
14 changes: 7 additions & 7 deletions example/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@


def test_sms():
result = Tago(TOKEN).services.sms().send(to_phone, message)
print("SmS test result:")
print(result)
result = Tago(TOKEN).services.sms().send(to_phone, message)
print("SmS test result:")
print(result)


def test_email():
result = Tago(TOKEN).services.email().send(
to_email, email_sub, message, '', '')
print("Email test result:")
print(result)
result = Tago(TOKEN).services.email().send(
to_email, email_sub, message, '', '')
print("Email test result:")
print(result)


test_sms()
Expand Down
Loading

0 comments on commit eec0d2b

Please sign in to comment.