| 123456789101112131415161718192021222324252627282930 |
- from ._anvil_designer import Form1Template
- from anvil import *
- import anvil.server
- import anvil.tables as tables
- import anvil.tables.query as q
- from anvil.tables import app_tables
- class Form1(Form1Template):
- def __init__(self, **properties):
- # Set Form properties and Data Bindings.
- self.init_components(**properties)
- # Any code you write here will run when the form opens.
- def check_yaml_click(self, **event_args):
- """This method is called when the button is clicked"""
- status, parsed_data = anvil.server.call('parse_yaml',self.input.text)
- if status==1:
- self.output.foreground = 'red'
- else:
- self.output.foreground = 'blue'
- self.output.text = parsed_data
- def check_json_click(self, **event_args):
- """This method is called when the button is clicked"""
- parsed_data = anvil.server.call('parse_json',self.input.text)
- self.output.text = parsed_data
|