From dfda5d7399da4b4d19f13abd6dc390e23ff294c4 Mon Sep 17 00:00:00 2001 From: pepperpepperpepper Date: Mon, 16 Nov 2015 19:58:26 -0800 Subject: ok time to finish this gallery --- share/Flask_test/blueprint_test.py | 21 -- share/Flask_test/pbserver.py | 40 --- share/Flask_test/test.py | 46 --- share/Flask_test/test2.py | 1 - share/OLD/inspect_objects_example.py | 15 - share/frontend/htmljs/imbreak_main.js | 113 ------ share/frontend/htmljs/imgradient_index.html | 539 ---------------------------- share/frontend/htmljs/imgrid_main.js | 121 ------- share/frontend/server/simple_proxy.py | 27 -- 9 files changed, 923 deletions(-) delete mode 100644 share/Flask_test/blueprint_test.py delete mode 100755 share/Flask_test/pbserver.py delete mode 100644 share/Flask_test/test.py delete mode 100644 share/Flask_test/test2.py delete mode 100644 share/OLD/inspect_objects_example.py delete mode 100644 share/frontend/htmljs/imbreak_main.js delete mode 100644 share/frontend/htmljs/imgradient_index.html delete mode 100644 share/frontend/htmljs/imgrid_main.js delete mode 100644 share/frontend/server/simple_proxy.py (limited to 'share') diff --git a/share/Flask_test/blueprint_test.py b/share/Flask_test/blueprint_test.py deleted file mode 100644 index 2e7c31d..0000000 --- a/share/Flask_test/blueprint_test.py +++ /dev/null @@ -1,21 +0,0 @@ -from flask import Blueprint, abort, jsonify -simple_page = Blueprint('simple_page', __name__) -@simple_page.route('/homies') -def show(): - return "what's up"; - -@simple_page.route('/nope') -def nope(): - return bad_request("oh hell no") - -def bad_request(message): - response = jsonify({'message': message}) - response.status_code = 400 - return response - - -#@simple_page.errorhandler(500) -#def custom400(error): -# response = jsonify({'message': error.description['message']}) -# # etc. - diff --git a/share/Flask_test/pbserver.py b/share/Flask_test/pbserver.py deleted file mode 100755 index 400883a..0000000 --- a/share/Flask_test/pbserver.py +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/python2.7 - -#static routes -#{{{ -@route('/im/') -def server_static(filename): - return static_file(filename, root='frontend/im/') -@route('/im') -def server_static(): - return static_file("index.html", root='frontend/im/') -@route('/imgrid') -def server_static(): - return static_file("index.html", root='frontend/imgrid/') -@route('/imgradient') -def server_static(): - return static_file("index.html", root='frontend/imgradient/') -@route('/imlandscape') -def server_static(): - return static_file("index.html", root='frontend/imlandscape/') -@route('/impattern') -def server_static(): - return static_file("index.html", root='frontend/impattern/') -@route('/imbreak') -def server_static(): - return static_file("index.html", root='frontend/imbreak/') -@route('/') -def server_static(): - return static_file("index.html", root='frontend/im/') -@route('/css/') -def server_static(filename): - return static_file(filename, root='frontend/css/') -@route('/js/') -def server_static(filename): - return static_file(filename, root='frontend/js/') -@route('/img/') -def server_static(filename): - return static_file(filename, root='frontend/img/') -#}}} - -#run(host='0.0.0.0', port=8999, debug=True) diff --git a/share/Flask_test/test.py b/share/Flask_test/test.py deleted file mode 100644 index b383b0d..0000000 --- a/share/Flask_test/test.py +++ /dev/null @@ -1,46 +0,0 @@ -import simplejson as json -from flask import Flask -from flask import abort, redirect, url_for -from blueprint_test import simple_page -app = Flask(__name__) -app.register_blueprint(simple_page) -#app.logger.debug('A value for debugging') -#app.logger.warning('A warning occurred (%d apples)', 42) -#app.logger.error('An error occurred') - -@app.route("/") -def hello(): - return "Hello World!" - -if __name__ == "__main__": - app.run() - -@app.route('/login', methods=['POST', 'GET']) -def login(): - error = None - if request.method == 'POST': - if valid_login(request.form['username'], - request.form['password']): - return log_the_user_in(request.form['username']) - else: - error = 'Invalid username/password' - #searchword = request.args.get('key', '') - # the code below is executed if the request method - # was GET or the credentials were invalid - return render_template('login.html', error=error) - - - -@app.route('/') -def index(): - return redirect(url_for('login')) - -@app.route('/login') -def login(): - abort(401) - this_is_never_executed() - - -url_for('static', filename='style.css') - - diff --git a/share/Flask_test/test2.py b/share/Flask_test/test2.py deleted file mode 100644 index 0a831b6..0000000 --- a/share/Flask_test/test2.py +++ /dev/null @@ -1 +0,0 @@ -print __name__ diff --git a/share/OLD/inspect_objects_example.py b/share/OLD/inspect_objects_example.py deleted file mode 100644 index 92e28b7..0000000 --- a/share/OLD/inspect_objects_example.py +++ /dev/null @@ -1,15 +0,0 @@ -class Test(object): - def __init__(self, one="la", two="di"): - self._test_args(inspect.getargvalues(inspect.currentframe())); - - def _test_args(self, _args_vals): - for arg in _args_vals.args: - if arg == "self": - continue - try: - sys.stdout.write("%s\n" % arg) - sys.stdout.write("\t%s\n" % _args_vals.locals.get(arg)) - except Exception as e: - sys.stderr.write("%s\n" % e ); - -t = Test(); diff --git a/share/frontend/htmljs/imbreak_main.js b/share/frontend/htmljs/imbreak_main.js deleted file mode 100644 index c56c9a2..0000000 --- a/share/frontend/htmljs/imbreak_main.js +++ /dev/null @@ -1,113 +0,0 @@ -var Main = - { - firsttime: true, - generating: false, - thelast: "", - enter: function (e) - { - if (Main.generating) - return - if (e.keyCode === 13) - Main.go() - }, - go: function () - { - if (Main.generating) - return - Main.generating = true - var theloader = '' - $("#output-cmd").html(theloader).show() - $('.result').show() - $('.results').show() - $("#output-img").show() - $("#output-url").show() - $("#result").show() - var data = - { - breakmode:$('input:radio[name=modeswitch]:checked').val(), - breaktype: $('#breaktype :selected').val(), - breakangle: $("#breakangle").val(), - url: $('#url').val(), - username: $('#username').val(), - firsttime: Main.firsttime.toString() - } - if (data["breakmode"] == "gradual") - { - data["breakmode"] = "subtle" - if (Main.lines && Main.thelast == $('#url').val()) - { - Main.firsttime = false - data["url"] = Main.lines[1] - } - } - else - { - Main.firsttime = true - } - Main.thelast = $('#url').val(); - thestring = JSON.stringify(data); - $('#error').append(thestring); - if (data.username.length > 0) - document.cookie = "imname="+data.username+";path=/;domain=.asdf.us;max-age=1086400" - $.post("/im/api/imbreak", data, Main.callback) - }, - error: function (s) - { - $("#output-cmd").html("ERROR: " + s + "").show() - $("#output-url").hide() - $("#output-img").hide() - }, - filesize: function (size) - { - if (size < 1024) - return size.toString() + " bytes" - if (size < 1024 * 1024) - return Math.floor (size/1024).toString() + " KB" - else - return Math.floor (size/(1024*1024)).toString() + " MB" - }, - callback: function (data) - { - data = JSON.parse(data) - $('#error').append('called'); - $("#output-cmd").html('') - $('#output-url').val(data.url) - $("#output-img").html("click image to enlarge
"+"
"+"
" -); - $("#output-info").html('-ACTUAL SIZE-
'+Main.filesize(data.size)+'
'+data.width+'
'+data.height+'

'+'see more at →photoblaster gallery'+'
') - Main.generating = false - }, - cookie: function () - { - if (document.cookie) - { - var cookies = document.cookie.split(";") - for (i in cookies) - { - var cookie = cookies[i].split("=") - if (cookie[0].indexOf("imname") !== -1) - { - if (cookie[1] !== 'false' && cookie[1] !== 'undefined' && cookie[1].length) - { - return cookie[1] - } - } - } - } - return "" - }, - init: function () - { - var name = Main.cookie () - $("#username").val(name) - $("#breakbutton").bind("click", Main.go) - $(document).bind("keydown", Main.enter) - } - } -//$('#theform').each(function(){ -// this.reset(); -// }); - - - -Main.init () diff --git a/share/frontend/htmljs/imgradient_index.html b/share/frontend/htmljs/imgradient_index.html deleted file mode 100644 index 275bfec..0000000 --- a/share/frontend/htmljs/imgradient_index.html +++ /dev/null @@ -1,539 +0,0 @@ - - - - - - -GRADIENT PHOTOBLASTER - - - - - - - - - - - - -
-
-
-

- GRADIENT GENERATOR FOR PHOTOBLASTER - - - - - - - - -

- - - - - - - - - - - px -
- - - - - px -
- - - - - list of color names - - - - - -
- - - - - -
- - - - - - - if yes...0-4000-2000 - - - - - - - -
- -
- - - -
- -
- - - -
- -
- - - -
- -
- - - - - - - - - - - - - - - % - - - - - - -
- - - -
- - ° -
- - - - ° -
- - - - - - - - - - - - -
- - - - - - - -
- VIEW AND ARRANGE THE PHOTOBLASTS → Image Gallery
- - OPEN THE PHOTOBLASTER EDITOR → PHOTOBLASTER - - TOP PHOTOBLASTS GO TO THE TUMBLR → Photoblaster Tumblr -

- -
- -
- →
-
- - -
- - - -
-
-
- - - - - - - - diff --git a/share/frontend/htmljs/imgrid_main.js b/share/frontend/htmljs/imgrid_main.js deleted file mode 100644 index f88e235..0000000 --- a/share/frontend/htmljs/imgrid_main.js +++ /dev/null @@ -1,121 +0,0 @@ -var Main = - { - API_HEADER: "#@imgrid", - generating: false, - enter: function (e) - { - if (Main.generating) - return - if (e.keyCode === 13) - Main.go() - }, - go: function () - { - if (Main.generating) - return - Main.generating = true - var theloader = '' - $("#output-cmd").html(theloader).show() - if($('#transition :selected').val() === 'tile'||$('#transition :selected').val()=== 'random') - { - $('#output-cmd').append("
WARNING: THIS REQUEST MIGHT TAKE A WHILE") - } - $('.results').show() - $("#output-img").show() - $("#output-url").show() - $("#result").show() - var data = - { - width: $("#img-width").val(), - height: $("#img-height").val(), - linethickness: $("#line-thickness").val(), - opacity: $("#line-opacity").val(), - linecolor: $("#line-color").val(), - spacing: $("#line-spacing").val(), - vlines: $('#v-lines:checked').val() !== undefined ? "true" : "false", - hlines: $('#h-lines:checked').val() !== undefined ? "true" : "false", - shadow: $('#shadow:checked').val() !== undefined ? "true" : "false", - bgimage: $("#bg-image").val(), - bgcolor: $("#bg-color").val(), - imageinstead: $("#imageinstead").val(), - planebgcolor: $("#planebgcolor").val(), - skycolor: $("#skycolor").val(), - planebgimage: $("#planebgimage").val(), - transition: $('#transition :selected').val(), - swing: $("#swing").val(), - tilt: $("#tilt").val(), - roll: $("#roll").val(), - zoom: $("#zoom").val(), - trim: $("#trim:checked").val() !== undefined ? "true" : "false", - format: $('#format :selected').val(), - username: $('#username').val() - } - if (data.transition == 'infinite'){ - $('#genbutton').append("WARNING:This might take a while")} - if (data.username.length > 0) - document.cookie = "imname="+data.username+";path=/;domain=.asdf.us;max-age=1086400" - $.post("/im/api/imgrid", data, Main.callback) - }, - error: function (s) - { - $("#output-cmd").html("ERROR: " + s + "").show() - $("#output-url").hide() - $("#output-img").hide() - }, - filesize: function (size) - { - if (size < 1024) - return size.toString() + " bytes" - if (size < 1024 * 1024) - return Math.floor (size/1024).toString() + " KB" - else - return Math.floor (size/(1024*1024)).toString() + " MB" - }, - callback: function (data) - { - data = JSON.parse(data) - $("#output-cmd").html('') - $("#output-img").html(""+"
"+"
"); - $("#output-url").val(data.url) - $("#output-info").html('-ACTUAL SIZE-
'+Main.filesize(data.size)+'
'+data.width+'
'+data.height+'

'+'see more at →photoblaster gallery'+'
') - Main.generating = false - }, - cookie: function () - { - if (document.cookie) - { - var cookies = document.cookie.split(";") - for (i in cookies) - { - var cookie = cookies[i].split("=") - if (cookie[0].indexOf("imname") !== -1) - { - if (cookie[1] !== 'false' && cookie[1] !== 'undefined' && cookie[1].length) - { - return cookie[1] - } - } - } - } - return "" - }, - init: function () - { - var name = Main.cookie () - $("#username").val(name) - if (name) - { -// $("#userlink").show() - // $("#userlink a").attr("href", "/im/gallery/?name="+name).html(name+"'s photoblasts") - } - $("#generate").bind("click", Main.go) - $(document).bind("keydown", Main.enter) - } - } -$('#theform').each(function(){ - this.reset(); - }); - - - -Main.init () diff --git a/share/frontend/server/simple_proxy.py b/share/frontend/server/simple_proxy.py deleted file mode 100644 index 8588887..0000000 --- a/share/frontend/server/simple_proxy.py +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env python3 -import http.server -import urllib.request -import re - -class MyHTTPRequestHandler(http.server.CGIHTTPRequestHandler ): - def end_headers(self): - self.send_my_headers() - - http.server.CGIHTTPRequestHandler .end_headers(self) - - def send_my_headers(self): - self.send_header("Access-Control-Allow-Origin", "*") - - def do_GET(self): - if self.path[0:14] == "/cgi-bin/proxy": - self.copyfile(urllib.request.urlopen(self.path[15:]), self.wfile) - super().do_GET(); - else: - super().do_GET() - - def do_POST(self): - super().do_POST(); - -if __name__ == '__main__': - http.server.test(port=8181, HandlerClass=MyHTTPRequestHandler) - -- cgit v1.2.3-70-g09d2