From db7af666a6f4502a93516a556f496dcfd365ce78 Mon Sep 17 00:00:00 2001 From: Anas Khan Date: Wed, 6 Dec 2017 18:36:11 +0530 Subject: [PATCH] cleaning up --- project/.gitignore | 1 + project/client/app.py | 14 ---------- project/client/main.py | 42 ---------------------------- project/client/static/css/signin.css | 40 -------------------------- project/client/static/js/script.js | 20 ------------- 5 files changed, 1 insertion(+), 116 deletions(-) create mode 100644 project/.gitignore delete mode 100644 project/client/app.py delete mode 100644 project/client/main.py delete mode 100755 project/client/static/css/signin.css delete mode 100755 project/client/static/js/script.js diff --git a/project/.gitignore b/project/.gitignore new file mode 100644 index 0000000..c68210b --- /dev/null +++ b/project/.gitignore @@ -0,0 +1 @@ +client/__pycache__/ diff --git a/project/client/app.py b/project/client/app.py deleted file mode 100644 index 7bd814a..0000000 --- a/project/client/app.py +++ /dev/null @@ -1,14 +0,0 @@ -""" -Application stub -""" - - -def initialize(): - # perform heavy stuff here - return True - - -def do_stuff(): - # do whatever you need to do - response = "This is response from Python backend" - return response \ No newline at end of file diff --git a/project/client/main.py b/project/client/main.py deleted file mode 100644 index f54c335..0000000 --- a/project/client/main.py +++ /dev/null @@ -1,42 +0,0 @@ -import sys - -from threading import Thread, Lock -import logging -import webview -from time import sleep -from server import run_server - -server_lock = Lock() - -logger = logging.getLogger(__name__) - - -def url_ok(url, port): - # Use httplib on Python 2 - try: - from http.client import HTTPConnection - except ImportError: - from httplib import HTTPConnection - - try: - conn = HTTPConnection(url, port) - conn.request("GET", "/") - r = conn.getresponse() - return r.status == 200 - except: - logger.exception("Server not started") - return False - -if __name__ == '__main__': - logger.debug("Starting server") - t = Thread(target=run_server) - t.daemon = True - t.start() - logger.debug("Checking server") - - while not url_ok("127.0.0.1", 23948): - sleep(0.1) - - logger.debug("Server started") - webview.create_window("My first pywebview application", "http://127.0.0.1:23948", min_size=(640, 480)) - diff --git a/project/client/static/css/signin.css b/project/client/static/css/signin.css deleted file mode 100755 index 995df48..0000000 --- a/project/client/static/css/signin.css +++ /dev/null @@ -1,40 +0,0 @@ -body { - padding-top: 40px; - padding-bottom: 40px; - background-color: #eee; -} - -.form-signin { - max-width: 330px; - padding: 15px; - margin: 0 auto; -} -.form-signin .form-signin-heading, -.form-signin .checkbox { - margin-bottom: 10px; -} -.form-signin .checkbox { - font-weight: normal; -} -.form-signin .form-control { - position: relative; - height: auto; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - padding: 10px; - font-size: 16px; -} -.form-signin .form-control:focus { - z-index: 2; -} -.form-signin input[type="email"] { - margin-bottom: -1px; - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; -} -.form-signin input[type="password"] { - margin-bottom: 10px; - border-top-left-radius: 0; - border-top-right-radius: 0; -} diff --git a/project/client/static/js/script.js b/project/client/static/js/script.js deleted file mode 100755 index 3f37bcc..0000000 --- a/project/client/static/js/script.js +++ /dev/null @@ -1,20 +0,0 @@ -$(function(){ - $('button').click(function(){ - var jsonPayload = { - user:$('#txtUsername').val(), - pass:$('#txtPassword').val() - } - $.ajax({ - url: '/signUpRequest', - data: JSON.stringify(jsonPayload), - type: 'POST', - dataType: 'JSON', - success: function(response){ - console.log(response); - }, - error: function(error){ - console.log(error); - } - }); - }); -});