Sindbad~EG File Manager

Current Path : /home/numerotech/status.numerotech.com/status_app/core/library/
Upload File :
Current File : //home/numerotech/status.numerotech.com/status_app/core/library/helper.py

from core import app
from flask import render_template_string
from flask import url_for
from datetime import datetime, date, time, timedelta
import datetime
import imp,sys

#settime working as global variable but commented for easy identification of this variable using class name 
# global settime
# settime = 5

class Helper:
	Institution = ['ksos23']
	def_cat_id = 161
	mark1 = 10
	mark2 = 10
	mark3 = 10
	test_mail = "mukeshkumar@numerotec.com"
	testmail = "mukeshkumar@numerotec.com"
	master_email_ids = ["mukeshkumar@numerotec.com","manjula@numerotec.com","priyavarthana@numerotec.com"]
	CC_Presentation_type_id = 23
	AppType = "AdminApplication"
	
	# def isAjax(request):
	# 	if request.headers.get("X-Requested-With") == "XMLHttpRequest":
	# 		return True
	# 	else:
	# 		return False 

	# def convert_jinja_template_v1(data1,data):
	# 	# data1 = data1[0]
	# 	temp = app.jinja_env.from_string(data1["template_data"]).render(data=data)
	# 	return render_template_string(temp)

	# def convert_jinja_template(data1,data):
	# 	data1 = data1[0]
	# 	temp = app.jinja_env.from_string(data1["template_data"]).render(data=data)
	# 	return render_template_string(temp)

	# def footer_text():
	# 	return ""

	# def email_mask(email):
	# 	if email:
	# 		lo = email.find('@')
	# 		if lo>0:
	# 			mask_email =  email[0]+"*****"+email[lo-1:]
	# 		return mask_email
	# 	return email

	# def mobile_mask(mobile):
	# 	if mobile:
	# 		lo = len(mobile)
	# 		if lo>0:
	# 			mask =  mobile[:2]+"******"+mobile[lo-2:]
	# 			return mask
	# 	return mobile

	# def call_custom_controller(abs_type,conf_key):
	# 	module_name = abs_type+"Controller"
	# 	fp, pathname, description = imp.find_module(module_name,["./core/controller/"+conf_key.upper()])
	# 	module = imp.load_module(module_name, fp, pathname, description)
	# 	myclass = getattr(module, module_name)
	# 	return myclass

	# def merge_tags(text,values):
	# 	for k, v in values.items():
	# 		text = text.replace('*|'+k+'|*', v)
	# 	return text

	# def convert_html_for_mail_screen(data):
	# 	temp = app.jinja_env.from_string("{{mail_content|safe}}").render(**data)
	# 	return render_template_string(temp,**data)
		
	# def getcurrenttimestamp():
	# 	ct = datetime.datetime.now()
	# 	ts = ct.timestamp()
	# 	return ts 
	
	# def calculate_age(born):
	# 	today = date.today()
	# 	return today.year - born.year - ((today.month, today.day) < (born.month, born.day))

	def check_dates_is_open(start,end):
		today = date.today()
		start_date  = start.strftime("%Y-%m-%d %H:%M")
		end_date  = end.strftime("%Y-%m-%d %H:%M")
		today_date= today.strftime("%Y-%m-%d %H:%M")
		
		if start_date <= today_date <= end_date:
			return 1
		else:
			return 0
		# print(fDateTime.strftime("%Y-%m-%d"))
		# print(tDateTime.strftime("%Y-%m-%d"))
		# return "success"


app.jinja_env.globals.update(Helper=Helper) 




Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists