# Path: scrypture/webapi.py
# class WebAPI(flask_wtf.Form):
# class PassHTTPAuthorizationHeader(requests.auth.AuthBase):
# def text_input(*args, **kwargs):
# def list_input(*args, **kwargs):
# def line_input(*args, **kwargs):
# def password_input(*args, **kwargs):
# def radio_field(*args, **kwargs):
# def submit_button(*args, **kwargs):
# def multiple_input(*args, **kwargs):
# def checkbox_field(*args, **kwargs):
# def file_field(*args, **kwargs):
#     def __init__(self, header):
#     def __call__(self, r):


from datetime import datetime
from scrypture import webapi
#!/usr/bin/env python
# module_template.py
"""
Convert epoch time (UNIX timestamps) to human readable form.
One per line.
"""

from __future__ import print_function

def convert_epoch_time(t):
    try:
        return datetime.utcfromtimestamp(int(t)).strftime('%Y-%m-%d %H:%M:%S')
    except:
        return "Could not convert. Is this a valid timestamp?"

### WebAPI ###


# Path: scrypture/webapi.py
# class WebAPI(flask_wtf.Form):
# class PassHTTPAuthorizationHeader(requests.auth.AuthBase):
# def text_input(*args, **kwargs):
# def list_input(*args, **kwargs):
# def line_input(*args, **kwargs):
# def password_input(*args, **kwargs):
# def radio_field(*args, **kwargs):
# def submit_button(*args, **kwargs):
# def multiple_input(*args, **kwargs):
# def checkbox_field(*args, **kwargs):
# def file_field(*args, **kwargs):
#     def __init__(self, header):
#     def __call__(self, r):


# Path: scrypture/demo_scripts/Utils/convert_epoch_time.py
from datetime import datetime
from scrypture import webapi

#!/usr/bin/env python
# module_template.py
"""
Convert epoch time (UNIX timestamps) to human readable form.
One per line.
"""

from __future__ import print_function

def convert_epoch_time(t):
    try:
        return datetime.utcfromtimestamp(int(t)).strftime('%Y-%m-%d %H:%M:%S')
    except:
        return "Could not convert. Is this a valid timestamp?"

### WebAPI ###


class WebAPI(webapi.WebAPI):