euscanwww: Removing duplicated code
Signed-off-by: volpino <fox91@anche.no>
This commit is contained in:
parent
43e996d83d
commit
b43bf8fa28
21
bin/euscan
21
bin/euscan
@ -271,26 +271,15 @@ def main():
|
||||
output.eerror('%s: %s' % (query, str(err)))
|
||||
exit_helper(1)
|
||||
|
||||
if not CONFIG['quiet'] and not CONFIG['format']:
|
||||
print()
|
||||
|
||||
if (CONFIG['format'] or CONFIG['quiet']) and isatty:
|
||||
on_progress_gen.next()
|
||||
print("\n", file=sys.stderr)
|
||||
|
||||
if ret is not None:
|
||||
if len(ret) > 0:
|
||||
for cp, url, version, handler, confidence in ret:
|
||||
output.result(cp, version, url, handler, confidence)
|
||||
|
||||
if (CONFIG['format'] or CONFIG['quiet']) and isatty:
|
||||
print("\n", file=sys.stderr)
|
||||
|
||||
elif not CONFIG['quiet']:
|
||||
output.ewarn(
|
||||
"Didn't find any new version, check package's homepage " +
|
||||
"for more informations"
|
||||
)
|
||||
if not ret and not CONFIG['quiet']:
|
||||
output.ewarn(
|
||||
"Didn't find any new version, check package's homepage " +
|
||||
"for more informations"
|
||||
)
|
||||
|
||||
output.set_query(None)
|
||||
|
||||
|
@ -22,11 +22,7 @@ class ScanUpstream(object):
|
||||
CONFIG["format"] = "dict"
|
||||
output.set_query(package)
|
||||
|
||||
ret = scan_upstream(package)
|
||||
if ret is not None:
|
||||
if len(ret) > 0:
|
||||
for cp, url, version, handler, confidence in ret:
|
||||
output.result(cp, version, url, handler, confidence)
|
||||
scan_upstream(package)
|
||||
|
||||
out = output.get_formatted_output()
|
||||
out_json = output.get_formatted_output("json")
|
||||
|
@ -68,10 +68,13 @@
|
||||
var url = "{% url "apply_task" "task_name" %}";
|
||||
|
||||
$.post(url.replace("task_name", task_name), data, function() {
|
||||
//location.reload();
|
||||
alert("Submitted!");
|
||||
location.reload();
|
||||
});
|
||||
});
|
||||
|
||||
setTimeout(location.reload, 10000);
|
||||
|
||||
});
|
||||
})(django.jQuery);
|
||||
</script>
|
||||
|
@ -1,4 +1,7 @@
|
||||
from __future__ import print_function
|
||||
|
||||
import os
|
||||
import sys
|
||||
from datetime import datetime
|
||||
|
||||
import portage
|
||||
@ -212,4 +215,11 @@ def scan_upstream(query, on_progress=None):
|
||||
if on_progress:
|
||||
on_progress(maxval, curval)
|
||||
|
||||
if len(result) > 0:
|
||||
if not (CONFIG['format'] or CONFIG['quiet']):
|
||||
print("\n", file=sys.stderr)
|
||||
|
||||
for cp, url, version, handler, confidence in result:
|
||||
output.result(cp, version, url, handler, confidence)
|
||||
|
||||
return result
|
||||
|
Loading…
Reference in New Issue
Block a user