# Path: jasper_erpnext_report/utils/utils.py
# def jasper_report_names_from_db(origin="both", filters_report=None, filters_param=None, filters_permrole=None):
# def jasper_print_formats(doc):
# def validate_print_permission(doc):
# def import_all_jasper_remote_reports(docs, force=True):
# def check_queryString_with_param(query, param):
# def check_queryString_param(query, param):
# def get_default_param_value(param, error=True):
# def call_hook_for_param(doc, method, *args):
# def call_hook_for_param_with_default(doc, hook_name, *args):
# def testHookScriptlet(JasperScriptlet, ids, data, cols, cur_doctype, cur_docname):
# 		def __init__(self, JasperScriplet, ids=None, data=None, cols=None, doctype=None):
# 		def test(self, args):
# def make_jasper_hooks_path():
# def get_hook_module(hook_name, report_name=None):
# def jasper_run_method(hook_name, *args, **kargs):
# def jasper_run_method_once_with_default(hook_name, docname, default):
# def check_jasper_perm(perms, ptypes=("read",), user=None):
# 		def check_perm(perms, user_roles, ptype):
# def check_frappe_permission(doctype, docname, ptypes=("read", )):
# def jasper_users_login(user):
# def pipInstall(package=None):
# def get_Frappe_Version(version=None):
# def getFrappeVersion():
# def add_to_time_str(date=None, hours=0, days=0, weeks=0):
# 	def __init__(self, site, user):
# 	def __enter__(self):
# 	def __exit__(self, type, value, trace):
# 	class MyJasperCustomScripletDefault(JasperCustomScripletDefault):
# class FrappeContext:
# 
# Path: jasper_erpnext_report/utils/file.py
# def remove_directory(path, ignore_errors=True):
# 	import shutil
# 	shutil.rmtree(path, ignore_errors)


import frappe
	import ast
	import frappe.utils
from frappe import _
from jasper_erpnext_report.utils.utils import jaspersession_get_value,get_expiry_in_seconds,\
	get_jasper_data, get_jasper_session_expiry_seconds, getFrappeVersion
from jasper_erpnext_report.utils.file import remove_directory
	from memcache_stats import MemcachedStats
	from memcache_stats import MemcachedStats
	from memcache_stats import MemcachedStats
	from jasper_erpnext_report.utils.jasper_email import get_email_pdf_path
	version = getFrappeVersion().major
	if version > 4:
		r = clear_all_jasper_user_redis_cache(force=force)
		removed += r
	else:
		r = clear_all_jasper_user_cache_v4(force=force)
		removed += r

	clear_jasper_list(force=force)
	removed += clear_jasper_sessions(force=force)
	frappe.db.commit()

	if removed == 0:
		print _("No goblal jasper cache was removed.")
	else:
		print _("Was removed {0} global jasper cache(s)".format(removed))

	return removed

def clear_expired_jasper_reports(force=False):
	clear_all_jasper_reports(force=force)

def clear_expired_jasper_sessions(force=False):
	clear_all_jasper_cache(force=force)


def clear_jasper_sessions(force=True):
	removed = 0
	sid = "jaspersession"
	deleted = force

# Path: jasper_erpnext_report/utils/utils.py
# def jasper_report_names_from_db(origin="both", filters_report=None, filters_param=None, filters_permrole=None):
# def jasper_print_formats(doc):
# def validate_print_permission(doc):
# def import_all_jasper_remote_reports(docs, force=True):
# def check_queryString_with_param(query, param):
# def check_queryString_param(query, param):
# def get_default_param_value(param, error=True):
# def call_hook_for_param(doc, method, *args):
# def call_hook_for_param_with_default(doc, hook_name, *args):
# def testHookScriptlet(JasperScriptlet, ids, data, cols, cur_doctype, cur_docname):
# 		def __init__(self, JasperScriplet, ids=None, data=None, cols=None, doctype=None):
# 		def test(self, args):
# def make_jasper_hooks_path():
# def get_hook_module(hook_name, report_name=None):
# def jasper_run_method(hook_name, *args, **kargs):
# def jasper_run_method_once_with_default(hook_name, docname, default):
# def check_jasper_perm(perms, ptypes=("read",), user=None):
# 		def check_perm(perms, user_roles, ptype):
# def check_frappe_permission(doctype, docname, ptypes=("read", )):
# def jasper_users_login(user):
# def pipInstall(package=None):
# def get_Frappe_Version(version=None):
# def getFrappeVersion():
# def add_to_time_str(date=None, hours=0, days=0, weeks=0):
# 	def __init__(self, site, user):
# 	def __enter__(self):
# 	def __exit__(self, type, value, trace):
# 	class MyJasperCustomScripletDefault(JasperCustomScripletDefault):
# class FrappeContext:
# 
# Path: jasper_erpnext_report/utils/file.py
# def remove_directory(path, ignore_errors=True):
# 	import shutil
# 	shutil.rmtree(path, ignore_errors)


# Path: jasper_erpnext_report/utils/scheduler.py
import frappe
	import ast
	import frappe.utils
from frappe import _
from jasper_erpnext_report.utils.utils import jaspersession_get_value,get_expiry_in_seconds,\
	get_jasper_data, get_jasper_session_expiry_seconds, getFrappeVersion
from jasper_erpnext_report.utils.file import remove_directory
	from memcache_stats import MemcachedStats
	from memcache_stats import MemcachedStats
	from memcache_stats import MemcachedStats
	from jasper_erpnext_report.utils.jasper_email import get_email_pdf_path

	version = getFrappeVersion().major
	if version > 4:
		r = clear_all_jasper_user_redis_cache(force=force)
		removed += r
	else:
		r = clear_all_jasper_user_cache_v4(force=force)
		removed += r

	clear_jasper_list(force=force)
	removed += clear_jasper_sessions(force=force)
	frappe.db.commit()

	if removed == 0:
		print _("No goblal jasper cache was removed.")
	else:
		print _("Was removed {0} global jasper cache(s)".format(removed))

	return removed

def clear_expired_jasper_reports(force=False):
	clear_all_jasper_reports(force=force)

def clear_expired_jasper_sessions(force=False):
	clear_all_jasper_cache(force=force)


def clear_jasper_sessions(force=True):
	removed = 0
	sid = "jaspersession"
	deleted = force

	data = get_jasper_data(sid)