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)
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'))
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'))
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"))
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)