diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..6c76527 Binary files /dev/null and b/.DS_Store differ diff --git a/app.py b/app.py index 0445c00..689d0bd 100644 --- a/app.py +++ b/app.py @@ -54,7 +54,7 @@ def webpage(): # redirect with url query param so that user can navigate back later next_rec = service.get_next_unlabelled() if next_rec: - return redirect("/?url=%s" % (urllib.quote(next_rec['url']))) + return redirect("/?url=%s" % (urllib.parse.quote(next_rec['url']))) else: featured_content = "No Unlabelled Record Found." else: @@ -84,7 +84,7 @@ def update(): next_rec = service.get_next_unlabelled() target = "/" if next_rec: - target += "?url=%s" % (urllib.quote(next_rec['url'])) + target += "?url=%s" % (urllib.parse.quote(next_rec['url'])) return redirect(location=target) else: return abort(400, "Failed... No records updated") @@ -104,7 +104,7 @@ def get_next(url=None): next_rec = service.get_record(url) url = next_rec['url'] template_name = '%s.html' % service.settings['type'] - data_url = url if url.startswith('http') else "/proxy?url=%s" % urllib.quote(next_rec['url']) + data_url = url if url.startswith('http') else "/proxy?url=%s" % urllib.parse.quote(next_rec['url']) data = { 'data_url' : data_url, 'url': url, @@ -215,4 +215,5 @@ def __del__(self): host = '0.0.0.0' service = DbService(args['work_dir'], args['input']) print("Starting on %s %s/" % (host, args['port'])) + app.debug = True app.run(host=host, port=args['port']) diff --git a/rawdata/test.txt b/rawdata/test.txt new file mode 100644 index 0000000..339e02d --- /dev/null +++ b/rawdata/test.txt @@ -0,0 +1 @@ +test for labelling \ No newline at end of file diff --git a/templates/text-labeling.html b/templates/text-labeling.html new file mode 100644 index 0000000..90798ce --- /dev/null +++ b/templates/text-labeling.html @@ -0,0 +1,45 @@ +
This text is from {{ url }}
+