Exemple #1
0
#!/opt/sac/bin/python
import time
import BaseHTTPServer
from sac import util
from sac.com import NoInternet

PORT_NUMBER = 8080
TEMPLATE_DIR = "templates/"

contents = {"registered": "", "unregistered": "", "no_internet": ""}

variables = {"@device_id": util.get_device_id(), "@secret": util.get_secret()}


class DefHandler(BaseHTTPServer.BaseHTTPRequestHandler):
    """
    Only delivers the html code that POSTs data to the
    Middleware.
    """
    def do_GET(s):
        """Only Get is supported"""
        s.send_response(200)
        s.send_header("Content-type", "text/html")
        s.end_headers()
        try:
            registered = util.is_registered()
        except NoInternet:
            s.wfile.write(contents["no_internet"])
            return

        if registered:
Exemple #2
0
import time
import BaseHTTPServer
from sac import util
from sac.com import NoInternet

PORT_NUMBER = 8080
TEMPLATE_DIR = "templates/"

contents = {
    "registered": "",
    "unregistered": "",
    "no_internet": ""
}

variables = {
    "@device_id": util.get_device_id(),
    "@secret": util.get_secret()
}


class DefHandler(BaseHTTPServer.BaseHTTPRequestHandler):
    """
    Only delivers the html code that POSTs data to the
    Middleware.
    """
    def do_GET(s):
        """Only Get is supported"""
        s.send_response(200)
        s.send_header("Content-type", "text/html")
        s.end_headers()
        try:
Exemple #3
0
#!/opt/sac/bin/python
from sac import com
from sac import util
from sac import config

client = com.Client(util.get_device_id(), util.get_secret(), config.API_SERVER, config.CERT_PATH)

print(client.get_next_appointment_raw())
Exemple #4
0
#!/opt/sac/bin/python
from sac import com
from sac import util
from sac import config

client = com.Client(util.get_device_id(), util.get_secret(), config.API_SERVER,
                    config.CERT_PATH)

print(client.get_next_appointment_raw())