8000 Merge remote-tracking branch 'origin/master' · balanced/balanced-python@69d4c43 · GitHub
[go: up one dir, main page]

Skip to content

Commit 69d4c43

Browse files
author
Marshall Jones
committed
Merge remote-tracking branch 'origin/master'
2 parents 68b0117 + f5c3fb9 commit 69d4c43

File tree

48 files changed

+103
-205
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+103
-205
lines changed

render_docs.py

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,17 @@ def render_exec():
6969
template = Template(filename=path, lookup=lookup,)
7070
try:
7171
request = data[event_name].get('request', {})
72+
7273
payload = request.get('payload')
7374
text = template.render(api_key=data['api_key'],
74-
request=request, payload=payload).strip()
75-
with open(os.path.join(os.path.dirname(path),
76-
'{}.py'.format(event_name)),
77-
'w+'
78-
) as write_to:
79-
write_to.write(text)
75+
request=request, payload=payload).strip()
8076
except KeyError:
77+
text = ''
8178
print "WARN: Skipped {} since {} not in scenario.cache".format(
8279
path, event_name)
80+
with open(os.path.join(os.path.dirname(path),
81+
'{}.py'.format(event_name)), 'w+') as write_to:
82+
write_to.write(text)
8383

8484
def render_rest():
8585
for path in glob2.glob('./scenarios/**/*.py'):
@@ -88,10 +88,19 @@ def render_rest():
8888
top = open(os.path.join(dir, 'definition.mako'),'r').read()
8989
bottom = open(path).read()
9090
body = "% if mode == 'definition':\n\n{}".format(top) + "\n% " \
91-
"else:\n" + bottom + "\n\n% endif"
91+
"else:\n" + bottom + "\n\n% endif"
9292
wfile.write(body)
9393

94+
def no_python_mako():
9495

96+
set_has_mako = set([])
97+
set_no_python_mako = set([])
98+
for path in glob2.glob('./scenarios/**/*.mako'):
99+
set_has_mako.add(os.path.dirname(p 10000 ath))
100+
for path in glob2.glob('./scenarios/**/python.mako'):
101+
set_no_python_mako.add(os.path.dirname(path))
102+
print 'The following dont have a python.mako file. Look into it!'
103+
print set_has_mako.difference(set_no_python_mako)
95104

96105

97106

@@ -109,5 +118,6 @@ def render_rest():
109118
render_exec()
110119
print "Rendering new mako files"
111120
render_rest()
112-
121+
delete_by_file_type('original.mako')
122+
no_python_mako()
113123

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +0,0 @@
1-
import balanced
2-
3-
balanced.configure("46c08048cd8811e2acae026ba7c1aba6")
4-
5-
6-
account = balanced.Account.find('/v1/marketplaces/TEST-MP29J5STPtZVvnjAFndM0N62/accounts/AC41WWE1V0nZtw5J8BicNwnB')
7-
account.debit(amount=1000, hold_uri='/v1/marketplaces/TEST-MP29J5STPtZVvnjAFndM0N62/holds/HL4b3zuvRlumVNFMeKl0h5Pk')

scenarios/account_capture_hold/python.mako

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22

33
balanced.Account.debit()
44
% else:
5-
import balanced
65

7-
balanced.configure("46c08048cd8811e2acae026ba7c1aba6")
8-
9-
10-
account = balanced.Account.find('/v1/marketplaces/TEST-MP29J5STPtZVvnjAFndM0N62/accounts/AC41WWE1V0nZtw5J8BicNwnB')
11-
account.debit(amount=1000, hold_uri='/v1/marketplaces/TEST-MP29J5STPtZVvnjAFndM0N62/holds/HL4b3zuvRlumVNFMeKl0h5Pk')
126

137
% endif
Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +0,0 @@
1-
import balanced
2-
3-
balanced.configure("46c08048cd8811e2acae026ba7c1aba6")
4-
5-
6-
account = balanced.Account.find('/v1/marketplaces/TEST-MP29J5STPtZVvnjAFndM0N62/accounts/AC41WWE1V0nZtw5J8BicNwnB')
7-
account.debit(amount=1000, hold_uri='/v1/marketplaces/TEST-MP29J5STPtZVvnjAFndM0N62/holds/HL4b3zuvRlumVNFMeKl0h5Pk')
Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +0,0 @@
1-
import balanced
2-
3-
balanced.configure("46c08048cd8811e2acae026ba7c1aba6")
4-
5-
6-
account = balanced.Account.find('/v1/marketplaces/TEST-MP29J5STPtZVvnjAFndM0N62/accounts/AC41WWE1V0nZtw5J8BicNwnB')
7-
account.debit(amount='1000')

scenarios/account_create_debit/python.mako

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22

33
balanced.Account.debit()
44
% else:
5-
import balanced
65

7-
balanced.configure("46c08048cd8811e2acae026ba7c1aba6")
8-
9-
10-
account = balanced.Account.find('/v1/marketplaces/TEST-MP29J5STPtZVvnjAFndM0N62/accounts/AC41WWE1V0nZtw5J8BicNwnB')
11-
account.debit(amount='1000')
126

137
% endif
Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +0,0 @@
1-
import balanced
2-
3-
balanced.configure("46c08048cd8811e2acae026ba7c1aba6")
4-
5-
6-
account = balanced.Account.find('/v1/marketplaces/TEST-MP29J5STPtZVvnjAFndM0N62/accounts/AC41WWE1V0nZtw5J8BicNwnB')
7-
account.debit(amount='1000')
Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +0,0 @@
1-
import balanced
2-
3-
balanced.configure("46c08048cd8811e2acae026ba7c1aba6")
4-
5-
6-
account = balanced.Account.find('/v1/marketplaces/TEST-MP29J5STPtZVvnjAFndM0N62/accounts/AC41WWE1V0nZtw5J8BicNwnB')
7-
account.hold(amount='1000')

scenarios/account_create_hold/python.mako

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22

33
balanced.Account.debit()
44
% else:
5-
import balanced
65

7-
balanced.configure("46c08048cd8811e2acae026ba7c1aba6")
8-
9-
10-
account = balanced.Account.find('/v1/marketplaces/TEST-MP29J5STPtZVvnjAFndM0N62/accounts/AC41WWE1V0nZtw5J8BicNwnB')
11-
account.hold(amount='1000')
126

137
% endif
Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +0,0 @@
1-
import balanced
2-
3-
balanced.configure("46c08048cd8811e2acae026ba7c1aba6")
4-
5-
6-
account = balanced.Account.find('/v1/marketplaces/TEST-MP29J5STPtZVvnjAFndM0N62/accounts/AC41WWE1V0nZtw5J8BicNwnB')
7-
account.hold(amount='1000')

0 commit comments

Comments
 (0)
0