Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
smogonet
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dominik Rosiek
smogonet
Commits
e14064f5
Commit
e14064f5
authored
Dec 20, 2016
by
Dominik Rosiek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
measurement_view
parent
0ef3506c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
42 deletions
+0
-42
measurement_viewer.py
measurement_viewer.py
+0
-42
No files found.
measurement_viewer.py
View file @
e14064f5
...
...
@@ -3,21 +3,12 @@ import sys
import
tornado.ioloop
import
tornado.web
import
models
import
json
import
decimal
#import boto.dynamodb2
#from boto.dynamodb2.table import Table
#from time import sleep
from
tornado
import
gen
class
MainHandler
(
tornado
.
web
.
RequestHandler
):
@
gen
.
coroutine
def
get
(
self
):
#stations = self.get_stations()
#stations = models.Station.get_all()
#stations = models.Station.getall()
stations
=
yield
models
.
Station
.
get_all
()
pollutions
=
yield
models
.
Type
.
get_all
()
...
...
@@ -26,39 +17,6 @@ class MainHandler(tornado.web.RequestHandler):
measurement
=
yield
models
.
Measurement
.
get_last
(
station
,
pollution
)
self
.
write
(
str
(
measurement
))
# measurement = models.Measurement.getlast(station=s.id)
# self.write("".format())
#measurements = self.get_measurements()
def
get_stations
(
self
):
c
=
boto
.
dynamodb2
.
connect_to_region
(
aws_access_key_id
=
"AKIAI6N5UWFTE5HR3FWQ"
,
aws_secret_access_key
=
"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"
,
region_name
=
"eu-central-1"
)
tab
=
Table
(
"stations"
,
connection
=
c
)
return
tab
.
scan
()
#a = tab.get_item(station_id='1')
#print x
#self.write("fdskfds")
#for i in x:
# self.write(i['station_id'])
# return a
''' tab.put_item(data={
'station_id':'3',
'city':'krakow',
'longitude':12,
'latitude':1,
'name':'nazwa'
})
'''
#a = tab.get_item(station_id='1')
#x = tab.scan()
# print x
# for i in x:
# print(json.dumps(i, cls=DecimalEncoder))
def
make_app
():
return
tornado
.
web
.
Application
([
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment