From fdfe069b07371d652f1ba38a5a150c06b440dae3 Mon Sep 17 00:00:00 2001 From: Ali Abid Date: Tue, 25 Aug 2020 09:42:35 -0700 Subject: [PATCH] updated PyPi version --- build/lib/gradio/cors.py | 43 ------------------ build/lib/gradio/generate_docs.py | 72 ------------------------------- gradio.egg-info/PKG-INFO | 2 +- setup.py | 2 +- 4 files changed, 2 insertions(+), 117 deletions(-) delete mode 100644 build/lib/gradio/cors.py delete mode 100644 build/lib/gradio/generate_docs.py diff --git a/build/lib/gradio/cors.py b/build/lib/gradio/cors.py deleted file mode 100644 index 7b153b9ab4..0000000000 --- a/build/lib/gradio/cors.py +++ /dev/null @@ -1,43 +0,0 @@ -import SimpleHTTPServer -class CORSHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): - def send_head(self): - """Common code for GET and HEAD commands. - This sends the response code and MIME headers. - Return value is either a file object (which has to be copied - to the outputfile by the caller unless the command was HEAD, - and must be closed by the caller under all circumstances), or - None, in which case the caller has nothing further to do. - """ - path = self.translate_path(self.path) - f = None - if os.path.isdir(path): - if not self.path.endswith('/'): - # redirect browser - doing basically what apache does - self.send_response(301) - self.send_header("Location", self.path + "/") - self.end_headers() - return None - for index in "index.html", "index.htm": - index = os.path.join(path, index) - if os.path.exists(index): - path = index - break - else: - return self.list_directory(path) - ctype = self.guess_type(path) - try: - # Always read in binary mode. Opening files in text mode may cause - # newline translations, making the actual size of the content - # transmitted *less* than the content-length! - f = open(path, 'rb') - except IOError: - self.send_error(404, "File not found") - return None - self.send_response(200) - self.send_header("Content-type", ctype) - fs = os.fstat(f.fileno()) - self.send_header("Content-Length", str(fs[6])) - self.send_header("Last-Modified", self.date_time_string(fs.st_mtime)) - self.send_header("Access-Control-Allow-Origin", "*") - self.end_headers() - return f diff --git a/build/lib/gradio/generate_docs.py b/build/lib/gradio/generate_docs.py deleted file mode 100644 index 30a798666b..0000000000 --- a/build/lib/gradio/generate_docs.py +++ /dev/null @@ -1,72 +0,0 @@ -import json -from gradio.inputs import InputComponent -from gradio.outputs import OutputComponent -from gradio.interface import Interface -import inspect - -def get_params(func): - params_str = inspect.getdoc(func) - params_doc = [] - documented_params = {"self"} - for param_line in params_str.split("\n")[1:]: - if param_line.strip() == "Returns": - break - space_index = param_line.index(" ") - colon_index = param_line.index(":") - name = param_line[:space_index] - documented_params.add(name) - params_doc.append((name, param_line[space_index+2:colon_index-1], param_line[colon_index+2:])) - params = inspect.getfullargspec(func) - param_set = [] - for i in range(len(params.args)): - neg_index = -1 - i - if params.args[neg_index] not in documented_params: - continue - if i < len(params.defaults): - default = params.defaults[neg_index] - if type(default) == str: - default = '"' + default + '"' - else: - default = str(default) - param_set.insert(0, (params.args[neg_index], default)) - else: - param_set.insert(0, (params.args[neg_index],)) - return param_set, params_doc - -def document(cls_set): - docset = [] - for cls in cls_set: - inp = {} - inp["name"] = cls.__name__ - doc = inspect.getdoc(cls) - if doc.startswith("DEPRECATED"): - continue - inp["doc"] = "\n".join(doc.split("\n")[:-1]) - inp["type"] = doc.split("\n")[-1].split("type: ")[-1] - inp["params"], inp["params_doc"] = get_params(cls.__init__) - inp["shortcuts"] = list(cls.get_shortcut_implementations().items()) - docset.append(inp) - return docset - -inputs = document(InputComponent.__subclasses__()) -outputs = document(OutputComponent.__subclasses__()) -interface_params = get_params(Interface.__init__) -interface = { - "doc": inspect.getdoc(Interface), - "params": interface_params[0], - "params_doc": interface_params[1], -} -launch_params = get_params(Interface.launch) -launch = { - "params": launch_params[0], - "params_doc": launch_params[1], -} - -with open("docs.json", "w") as docs: - json.dump({ - "inputs": inputs, - "outputs": outputs, - "interface": interface, - "launch": launch - }, docs) - diff --git a/gradio.egg-info/PKG-INFO b/gradio.egg-info/PKG-INFO index 78ddb328a3..2dcb1bdf14 100644 --- a/gradio.egg-info/PKG-INFO +++ b/gradio.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: gradio -Version: 1.1.6 +Version: 1.1.7 Summary: Python library for easily interacting with trained machine learning models Home-page: https://github.com/gradio-app/gradio-UI Author: Abubakar Abid diff --git a/setup.py b/setup.py index f1000b8c8c..83e1accf1d 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: setup( name='gradio', - version='1.1.6', + version='1.1.7', include_package_data=True, description='Python library for easily interacting with trained machine learning models', author='Abubakar Abid',