Ejemplo n.º 1
0
def folder_add(path):
    "Add a folder to the Library"
    ret = FolderManager.add(path)
    if ret != FolderManager.SUCCESS:
        print FolderManager.error_str(ret)
    else:
        print "Folder '{}' added".format(path)
Ejemplo n.º 2
0
def folder_add(path):
    "Add a folder to the Library"
    ret = FolderManager.add(path)
    if ret != FolderManager.SUCCESS:
        print FolderManager.error_str(ret)
    else:
        print "Folder '{}' added".format(path)
Ejemplo n.º 3
0
def add_folder():
    if request.method == 'GET':
        return render_template('addfolder.html')

    error = False
    (name, path) = map(request.form.get, ['name', 'path'])
    if name in (None, ''):
        flash('The name is required.')
        error = True
    if path in (None, ''):
        flash('The path is required.')
        error = True
    if error:
        return render_template('addfolder.html')

    ret = FolderManager.add(name, path)
    if ret != FolderManager.SUCCESS:
        flash(FolderManager.error_str(ret))
        return render_template('addfolder.html')

    flash("Folder '%s' created. You should now run a scan" % name)

    return redirect(url_for('folder_index'))
Ejemplo n.º 4
0
def add_folder():
	if request.method == 'GET':
		return render_template('addfolder.html')

	error = False
	(name, path) = map(request.form.get, [ 'name', 'path' ])
	if name in (None, ''):
		flash('The name is required.')
		error = True
	if path in (None, ''):
		flash('The path is required.')
		error = True
	if error:
		return render_template('addfolder.html')

	ret = FolderManager.add(name, path)
	if ret != FolderManager.SUCCESS:
		flash(FolderManager.error_str(ret))
		return render_template('addfolder.html')

	flash("Folder '%s' created. You should now run a scan" % name)

	return redirect(url_for('folder_index'))
Ejemplo n.º 5
0
def add_folder():
    if request.method == "GET":
        return render_template("addfolder.html")

    error = False
    (name, path) = map(request.form.get, ["name", "path"])
    if name in (None, ""):
        flash("The name is required.")
        error = True
    if path in (None, ""):
        flash("The path is required.")
        error = True
    if error:
        return render_template("addfolder.html")

    ret = FolderManager.add(name, path)
    if ret != FolderManager.SUCCESS:
        flash(FolderManager.error_str(ret))
        return render_template("addfolder.html")

    flash("Folder '%s' created. You should now run a scan" % name)

    return redirect(url_for("folder_index"))
Ejemplo n.º 6
0
 def folder_add(self, name, path):
     ret = FolderManager.add(name, path)
     if ret != FolderManager.SUCCESS:
         print FolderManager.error_str(ret)
     else:
         print "Folder '{}' added".format(name)