Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Merge branch 'develop' of http://github.com/kwinkunks/modelr_app into…
Browse files Browse the repository at this point in the history
… develop
  • Loading branch information
kwinkunks committed Jun 17, 2014
2 parents 4088243 + 62b6600 commit 44de0d7
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 15 deletions.
5 changes: 5 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
modelr 0.2.1 Jun 14
changed path to cloud bucket

modelr 0.2 Jun 13
Added image based modelling
2 changes: 1 addition & 1 deletion app.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
application: agile-modelr
application: agilemodelr
version: 1
runtime: python27
api_version: 1
Expand Down
19 changes: 10 additions & 9 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1328,13 +1328,14 @@ def post(self):

# Create the customer account
try:
customer = \
stripe.Customer.create(card=token,
email=email,
description="New Modelr customer")

customer = stripe.Customer.create(card=token,
email=email,
description="New Modelr customer")
except:
self.response.out.write("Payment failed, credit card type not excepted")
# The card has been declined
# Let the user know and DON'T UPGRADE USER
self.response.out.write("Payment failed. Credit card not accepted at this time")
return

# Check the country to see if we need to charge tax
country = self.request.get('stripeBillingAddressCountry')
Expand Down Expand Up @@ -1490,7 +1491,7 @@ def post(self):
#event["data"]["object"]["total"] = price

stripe_id = event["data"]["object"]["customer"]
amount = price #event["data"]["object"]["total"]
amount = PRICE
event_id = event["data"]["object"]["id"]
user = User.all().ancestor(ModelrRoot)
user = user.filter("stripe_id =", stripe_id).fetch(1)
Expand Down Expand Up @@ -1742,7 +1743,7 @@ def post(self):
output = StringIO.StringIO()
im.save(output, format='PNG')

bucket = '/modelr_bucket/'
bucket = '/modelr_live_bucket/'
output_filename = (bucket + str(user.user_id) +'/2' +
str(time.time()))

Expand Down Expand Up @@ -1791,7 +1792,7 @@ def post(self):
self.response.headers['Content-Type'] = 'text/plain'
self.response.out.write('All OK!!')

bucket = '/modelr_bucket/'
bucket = '/modelr_live_bucket/'
filename = bucket + str(user.user_id) +'/' + str(time.time())

encoded_image = self.request.get('image').split(',')[1]
Expand Down
Binary file added static/img/help/help_default_rocks.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/help/help_edit_rocks.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions templates/help.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ <h4 class="panel-title">

<div class="media">
<a class="pull-left" href="#">
<p><img src="http://placehold.it/150x150"></p>
<p><img src="/static/img/help/help_edit_rocks.png"></p>
</a>
<div class="media-body">
<h4 class="media-heading">Define your own rocks</h4>
Expand All @@ -100,7 +100,7 @@ <h4 class="media-heading">Define your own rocks</h4>

<div class="media">
<a class="pull-left" href="#">
<p><img src="http://placehold.it/150x150"></p>
<p><img src="/static/img/help/help_default_rocks.png"></p>
</a>
<div class="media-body">
<h4 class="media-heading">Use default rocks</h4>
Expand Down
6 changes: 3 additions & 3 deletions templates/scenario.html
Original file line number Diff line number Diff line change
Expand Up @@ -405,21 +405,21 @@ <h3 class="panel-title">Result</h3>
<!--[if IE 9]><select disabled style="display:none"><![endif]-->

{% for rock in rocks %}
<option data-value="{{rock.vp}},{{rock.rho}},{{rock.vs}},
<option data-value="{{rock.vp}},{{rock.vs}},{{rock.rho}},
{{rock.vp_std}}, {{rock.vs_std}}, {{rock.rho_std}}"
data-name="{{rock.name}}">{{rock.name}}</option>
{% endfor %}
{% for group in group_rocks %}
{% for rock in group.rocks %}
<option data-value="{{rock.vp}},{{rock.rho}},{{rock.vs}},
<option data-value="{{rock.vp}},{{rock.vs}},{{rock.rho}},
{{rock.vp_std}}, {{rock.vs_std}}, {{rock.rho_std}}"
data-name="{{rock.name}}">
{{rock.name}}
</option>
{% endfor %}
{% endfor %}
{% for rock in default_rocks %}
<option data-value="{{rock.vp}},{{rock.rho}},{{rock.vs}},
<option data-value="{{rock.vp}},{{rock.vs}},{{rock.rho}},
{{rock.vp_std}}, {{rock.vs_std}}, {{rock.rho_std}}"
data-name="{{rock.name}}">{{rock.name}}
</option>
Expand Down

0 comments on commit 44de0d7

Please sign in to comment.