<s> import os <EOL> import sys <EOL> from flask import Flask , render_template , request <EOL> sys . path . append ( os . path . abspath ( os . path . join ( __file__ , '<STR_LIT>' ) ) ) <EOL> from ovsdb_client import OVSDBClient <EOL> app = Flask ( __name__ ) <EOL> @ app . route ( '<STR_LIT:/>' ) <EOL> def index ( ) : <EOL> client = OVSDBClient ( '<STR_LIT:localhost>' , <NUM_LIT> ) <EOL> query = { <EOL> '<STR_LIT:id>' : <NUM_LIT:1> , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : [ <EOL> '<STR_LIT>' , <EOL> { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : [ ] <EOL> } <EOL> ] <EOL> } <EOL> response = client . request ( query ) <EOL> return render_template ( '<STR_LIT>' , stamps = response [ '<STR_LIT:result>' ] [ <NUM_LIT:0> ] [ '<STR_LIT>' ] ) <EOL> @ app . route ( '<STR_LIT>' ) <EOL> def view ( ) : <EOL> client = OVSDBClient ( '<STR_LIT:localhost>' , <NUM_LIT> ) <EOL> query = { <EOL> '<STR_LIT:id>' : <NUM_LIT:2> , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : [ <EOL> '<STR_LIT>' , <EOL> { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : [ <EOL> [ '<STR_LIT>' , '<STR_LIT>' , [ '<STR_LIT>' , request . args . get ( '<STR_LIT:id>' ) ] ] <EOL> ] <EOL> } <EOL> ] <EOL> } <EOL> response = client . request ( query ) <EOL> return render_template ( '<STR_LIT>' , stamp = response [ '<STR_LIT:result>' ] [ <NUM_LIT:0> ] [ '<STR_LIT>' ] [ <NUM_LIT:0> ] ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> app . debug = True <EOL> app . run ( host = '<STR_LIT>' , port = <NUM_LIT> ) </s>
