Exemple #1
0
async def get_all_employees(request):
    """Return all employees from DB."""
    async with request.app['db'].acquire() as conn:
        employees_list = await select_all_employees(conn)
        try:
            validate(instance=employees_list, schema=get_all_employees_output)
        except exceptions.ValidationError as ex:
            error_message = 'Server returns invalid data...\n{0}'.format(ex)
            return web.Response(text=error_message)
        return web.Response(text=json.dumps(employees_list))
Exemple #2
0
async def get_company(request):
    """Return one company by ID."""
    async with request.app['db'].acquire() as conn:
        company_id = request.match_info.get('company_id')
        try:
            select_result = await select_company(conn, company_id)
        except RecordNotFound as ex:
            raise web.HTTPNotFound(text=str(ex))
        try:
            validate(instance=select_result, schema=get_one_company_output)
        except exceptions.ValidationError as ex:
            error_message = 'Server returns invalid data...\n{0}'.format(ex)
            return web.Response(text=error_message)
        return web.Response(text=json.dumps(select_result))
Exemple #3
0
    def validate_mobile(self):

        self.SENDING_LIST = []
        V = validate()
        sending_numbers = self.text_ctrl_selected_contacts.Value
        sending_numbers = sending_numbers.split(";")

        for mobile in sending_numbers:

            if not mobile:
                continue

            if V.validate_mobile(mobile)[0]:
                self.SENDING_LIST.append(mobile)

            else:

                msg = mobile + " is invalid mobile number. Either edit it or delete to continue!"
                dlg = wx.MessageDialog(self, msg, 'Error',
                                       wx.OK | wx.ICON_ERROR)
                dlg.ShowModal()
                dlg.Destroy()

                return 0

        return True
Exemple #4
0
async def add_employee(request):
    """Add new employee by name. Return new employee."""
    async with request.app['db'].acquire() as conn:
        post_body = await request.json()
        try:
            validate(instance=post_body, schema=add_employee_input)
        except exceptions.ValidationError as ex:
            error_message = 'Sorry, you send invalid data...\n{0}'.format(ex)
            return web.Response(text=error_message)
        new_employee = await insert_employee(conn, post_body['employee_name'])
        try:
            validate(instance=new_employee, schema=add_employee_output)
        except exceptions.ValidationError as ex:
            error_message = 'Server returns invalid data...\n{0}'.format(ex)
            return web.Response(text=error_message)
        return web.Response(text=json.dumps(new_employee))
Exemple #5
0
async def add_company(request):
    """Add company by name. Return company."""
    async with request.app['db'].acquire() as conn:
        post_body = await request.json()
        try:
            validate(instance=post_body, schema=add_company_input)
        except exceptions.ValidationError as ex:
            error_message = 'Sorry, you send invalid data...\n{0}'.format(ex)
            return web.Response(text=error_message)
        else:
            new_company = await insert_company(conn, post_body['company_name'])
        try:
            validate(instance=new_company, schema=add_company_output)
        except exceptions.ValidationError as ex:
            error_message = 'Server returns invalid data...\n{0}'.format(ex)
            return web.Response(text=error_message)
        return web.Response(text=json.dumps(new_company))
Exemple #6
0
async def assign_item(request):
    """Assign item to employee. Returns assigned 'item'."""
    async with request.app['db'].acquire() as conn:
        post_body = await request.json()
        try:
            validate(instance=post_body, schema=assign_item_input)
        except exceptions.ValidationError as ex:
            error_message = 'Sorry, you send invalid data...\n{0}'.format(ex)
            return web.Response(text=error_message)
        new_assignee = await item_to_employee(
            conn,
            post_body['item_id'],
            post_body['employee_id'],
        )
        try:
            validate(instance=new_assignee, schema=assign_item_output)
        except exceptions.ValidationError as ex:
            error_message = 'Server returns invalid data...\n{0}'.format(ex)
            return web.Response(text=error_message)
        return web.Response(text=json.dumps(new_assignee))
Exemple #7
0
async def add_item(request):
    """Add new item to company goods. Returns 'item'."""
    async with request.app['db'].acquire() as conn:
        post_body = await request.json()
        try:
            validate(instance=post_body, schema=add_item_input)
        except exceptions.ValidationError as ex:
            error_message = 'Sorry, you send invalid data...\n{0}'.format(ex)
            return web.Response(text=error_message)
        new_item = await insert_item(
            conn,
            post_body['item_name'],
            post_body['company_id'],
        )
        try:
            validate(instance=new_item, schema=add_item_output)
        except exceptions.ValidationError as ex:
            error_message = 'Server returns invalid data...\n{0}'.format(ex)
            return web.Response(text=error_message)
        return web.Response(text=json.dumps(new_item))
Exemple #8
0
def main():
    args = parse_args()

    logging.basicConfig(
        format="%(asctime)-5s %(name)-15s %(levelname)-8s %(message)s",
        level=args.debug,
    )

    if not os.path.isdir(args.path_dir):
        raise IsNotDirectoryError(args.path_dir)

    validate(args.path_dir)

    # Export group structure
    logging.info("🔧 - Exporting group structure")
    group_export_import(get_config()["OLD_GROUP_ID"], args.path_dir)

    logging.info("🔧 - Exporting projects")
    migrate_projects(args.path_dir)

    # Clean
    clean_files(args.path_dir)
Exemple #9
0
    def load_students_info(self):

        #if self.checklist_ctrl_1.GetItemCount():
        self.checklist_ctrl_1.DeleteAllItems()
        self.SENDING_LIST = []
        self.NO_MOBILE_LIST = []

        #Updating colum headers
        self.checklist_ctrl_1.DeleteAllColumns()
        self.checklist_ctrl_1.InsertColumn(0, "Sl No", width=50)
        self.checklist_ctrl_1.InsertColumn(1, 'Name of Student', width=220)
        self.checklist_ctrl_1.InsertColumn(2, 'Name of Parent', width=220)
        self.checklist_ctrl_1.InsertColumn(3, 'Mobile', width=150)
        #end of updation

        self.temp_list = self.DB.Get_Student_List(self.YEAR,
                                                  self.combo_box_class.Value,
                                                  self.combo_box_div.Value)

        V = validate()
        for each in self.temp_list:

            mobile = self.DB.Get_Mobile(each[1])
            #print "mob",mobile,"        ",self.validate_mobile(mobile,silent=True)
            if mobile and V.validate_mobile(mobile)[0]:

                father = self.DB.Get_Father(each[1])
                self.SENDING_LIST.append([each[2], father, mobile])
            else:

                self.NO_MOBILE_LIST.append(each[2])

        i = 0

        for each in self.SENDING_LIST:

            if i == 0:
                index = self.checklist_ctrl_1.InsertStringItem(0, '')

                self.checklist_ctrl_1.SetStringItem(index, 1, "Select All")
                i += 1
                #continue

            index = self.checklist_ctrl_1.InsertStringItem(sys.maxint, each[0])
            self.checklist_ctrl_1.SetStringItem(index, 0, str(i))
            self.checklist_ctrl_1.SetStringItem(index, 1, each[0])
            self.checklist_ctrl_1.SetStringItem(index, 2, each[1])
            self.checklist_ctrl_1.SetStringItem(index, 3, each[2])

            i += 1
Exemple #10
0
    def load_staff_info(self):
        self.checklist_ctrl_1.DeleteAllItems()
        self.SENDING_LIST = []
        self.NO_MOBILE_LIST = []

        self.checklist_ctrl_1.DeleteAllColumns()
        self.checklist_ctrl_1.InsertColumn(0, "Sl No", width=50)
        self.checklist_ctrl_1.InsertColumn(1, 'Name of Staff', width=220)
        self.checklist_ctrl_1.InsertColumn(2, 'Designation', width=220)
        self.checklist_ctrl_1.InsertColumn(3, 'Mobile', width=150)

        self.temp_list = self.DB.Get_Staff_Info()
        V = validate()

        for each in self.temp_list:

            mobile = each[2]
            if not each[2]: mobile = ''
            #print "mob",mobile,"        ",self.validate_mobile(mobile,silent=True)
            if mobile and V.validate_mobile(mobile)[0]:

                if not each[1]: each[1] = ''

                self.SENDING_LIST.append([each[0], each[1], mobile])
            else:

                self.NO_MOBILE_LIST.append(each[0])

        i = 0

        for each in self.SENDING_LIST:

            if i == 0:
                index = self.checklist_ctrl_1.InsertStringItem(0, '')

                self.checklist_ctrl_1.SetStringItem(index, 1, "Select All")
                i += 1
                #continue

            index = self.checklist_ctrl_1.InsertStringItem(sys.maxint, each[0])
            self.checklist_ctrl_1.SetStringItem(index, 0, str(i))
            self.checklist_ctrl_1.SetStringItem(index, 1, each[0])
            self.checklist_ctrl_1.SetStringItem(index, 2, each[1])
            self.checklist_ctrl_1.SetStringItem(index, 3, each[2])

            i += 1
Exemple #11
0
    def __init__(self, *args, **kwds):
        # begin wxGlade: email_dialog.__init__
        kwds["style"] = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER | wx.MAXIMIZE_BOX | wx.THICK_FRAME
        wx.Dialog.__init__(self, *args, **kwds)
        self.notebook_1 = wx.Notebook(self, wx.ID_ANY, style=wx.NB_LEFT)
        self.pane_send1 = wx.Panel(self.notebook_1, wx.ID_ANY)
        self.combo_box_staff = wx.ComboBox(self.pane_send1, wx.ID_ANY, choices=[_("Select"), _("Staff"), _("Students")], style=wx.CB_DROPDOWN | wx.CB_DROPDOWN | wx.CB_READONLY | wx.CB_SORT)
        self.combo_box_year = wx.ComboBox(self.pane_send1, wx.ID_ANY, choices=[], style=wx.CB_DROPDOWN | wx.CB_READONLY)
        self.combo_box_class = wx.ComboBox(self.pane_send1, wx.ID_ANY, choices=["Select Standard","8","9","10"], style=wx.CB_DROPDOWN | wx.CB_READONLY)
        self.combo_box_div = wx.ComboBox(self.pane_send1, wx.ID_ANY, choices=[], style=wx.CB_DROPDOWN | wx.CB_READONLY)
        
        self.checklist_ctrl_1 = CheckListCtrl(self.pane_send1)
        
        self.button_add_email = wx.Button(self.pane_send1, wx.ID_ANY, _("Add Email"))
        self.text_ctrl_selected_email = wx.TextCtrl(self.pane_send1, wx.ID_ANY, "", style=wx.TE_READONLY|wx.TE_MULTILINE  | wx.TE_LINEWRAP)
        self.button_clear_all = wx.Button(self.pane_send1, wx.ID_ANY, _("Clear all"))
        self.button_close = wx.Button(self.pane_send1, wx.ID_ANY, _("Close"))
        self.button_next = wx.Button(self.pane_send1, wx.ID_ANY, _("Next ->>"))
        self.pane_send2 = wx.Panel(self.notebook_1, wx.ID_ANY, style=wx.SUNKEN_BORDER | wx.TAB_TRAVERSAL)
        self.label_id = wx.StaticText(self.pane_send2, wx.ID_ANY, _("Email"))
        self.combo_box_templates = wx.ComboBox(self.pane_send2, wx.ID_ANY, choices=[_("Select Templates")], style=wx.CB_DROPDOWN | wx.CB_DROPDOWN | wx.CB_READONLY)
        self.label_5 = wx.StaticText(self.pane_send2, wx.ID_ANY, _("Message body(plain Text or HTML)"))
        self.label_10 = wx.StaticText(self.pane_send2, wx.ID_ANY, _("Preview"))
        self.text_ctrl_msg = wx.TextCtrl(self.pane_send2, wx.ID_ANY, "", style=wx.TE_MULTILINE)
        self.html_preview_1 = html.HtmlWindow(self.pane_send2, wx.ID_ANY, size=(1, 1))#wx.TextCtrl(self.pane_send2, wx.ID_ANY, "")
        self.checkbox_1 = wx.CheckBox(self.pane_send2, wx.ID_ANY, _("Attach Performance Card"))
        self.text_ctrl_attachment = wx.TextCtrl(self.pane_send2, wx.ID_ANY, "")#, style=wx.TE_READONLY)
        self.button_attachment = wx.Button(self.pane_send2, wx.ID_ANY, _("Other Attchments"))
        self.label_4 = wx.StaticText(self.pane_send2, wx.ID_ANY, _("* In order to personalise message use tags <STUDENT>,<FATHER>,<SCHOOL> in capital letters which wil be replaced by actual names of student, parent and school."))
        self.button_back = wx.Button(self.pane_send2, wx.ID_ANY, _("<<- Back"))
        self.button_send = wx.Button(self.pane_send2, wx.ID_ANY, _("Send"))
        self.pane_templates = wx.Panel(self.notebook_1, wx.ID_ANY)
        self.label_11 = wx.StaticText(self.pane_templates, wx.ID_ANY, _("Email Templates"))
        self.combo_box_templates_2 = wx.ComboBox(self.pane_templates, wx.ID_ANY, choices=[_("Select Templates")], style=wx.CB_DROPDOWN | wx.CB_DROPDOWN | wx.CB_READONLY)
        self.text_ctrl_msg_2 = wx.TextCtrl(self.pane_templates, wx.ID_ANY, "", style=wx.TE_MULTILINE)
        self.html_preview_2 = wx.TextCtrl(self.pane_templates, wx.ID_ANY, "")
        self.button_delete_temp = wx.Button(self.pane_templates, wx.ID_ANY, _("Delete"))
        self.button_add_temp = wx.Button(self.pane_templates, wx.ID_ANY, _("Save New"))
        self.button_save_temp = wx.Button(self.pane_templates, wx.ID_ANY, _("Save"))
        self.pane_report = wx.Panel(self.notebook_1, wx.ID_ANY)
        self.panel_3 = wx.Panel(self.pane_report, wx.ID_ANY)
        self.label_6 = wx.StaticText(self.panel_3, wx.ID_ANY, _("Recent Emails"))
        self.text_ctrl_report = wx.TextCtrl(self.panel_3, wx.ID_ANY, "", style=wx.TE_MULTILINE | wx.TE_READONLY)
        self.pane_password = wx.Panel(self.notebook_1, wx.ID_ANY)
        self.panel_5 = wx.Panel(self.pane_password, wx.ID_ANY)
        self.label_7 = wx.StaticText(self.panel_5, wx.ID_ANY, _("Institution Email"))
        self.text_ctrl_email = wx.TextCtrl(self.panel_5, wx.ID_ANY, "")
        self.label_8 = wx.StaticText(self.panel_5, wx.ID_ANY, _("Email Password"))
        self.text_ctrl_email_passwd = wx.TextCtrl(self.panel_5, wx.ID_ANY, "", style=wx.TE_PASSWORD)
        self.button_cancel = wx.Button(self.panel_5, wx.ID_ANY, _("Cancel"))
        self.button_save = wx.Button(self.panel_5, wx.ID_ANY, _("Save"))

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_COMBOBOX, self.on_combo_staff, self.combo_box_staff)
        self.Bind(wx.EVT_COMBOBOX, self.on_combo_year, self.combo_box_year)
        self.Bind(wx.EVT_COMBOBOX, self.on_combo_class, self.combo_box_class)
        self.Bind(wx.EVT_COMBOBOX, self.on_combo_div, self.combo_box_div)
        #self.Bind(wx.EVT_BUTTON, self.on_button_add_email, self.button_add_email)
        #self.Bind(wx.EVT_BUTTON, self.on_button_clear_all, self.button_clear_all)
        self.Bind(wx.EVT_BUTTON, self.on_button_close, self.button_close)
        self.Bind(wx.EVT_BUTTON, self.on_button_next, self.button_next)
        self.Bind(wx.EVT_COMBOBOX, self.on_combo_template_1, self.combo_box_templates)
        self.Bind(wx.EVT_CHECKBOX, self.on_checkbox, self.checkbox_1)
        self.Bind(wx.EVT_BUTTON, self.on_button_attachments, self.button_attachment)
        self.Bind(wx.EVT_BUTTON, self.on_button_back, self.button_back)
        self.Bind(wx.EVT_BUTTON, self.on_button_send, self.button_send)
        self.Bind(wx.EVT_COMBOBOX, self.on_combo_template_2, self.combo_box_templates_2)
        self.Bind(wx.EVT_BUTTON, self.on_button_delete_temp, self.button_delete_temp)
        self.Bind(wx.EVT_BUTTON, self.on_button_add_temp, self.button_add_temp)
        self.Bind(wx.EVT_BUTTON, self.on_button_save_temp, self.button_save_temp)
        self.Bind(wx.EVT_TEXT, self.on_email, self.text_ctrl_email)
        self.Bind(wx.EVT_TEXT, self.on_email_password, self.text_ctrl_email_passwd)
        self.Bind(wx.EVT_BUTTON, self.on_button_cancel, self.button_cancel)
        self.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGED, self.on_page_change, self.notebook_1)
        # end wxGlade
        
        self.checklist_ctrl_1.OnCheckItem = self.on_check
        
        #self.Bind(wx.EVT_TEXT, self.on_sending_list_text, self.text_ctrl_selected_email)
        self.Bind(wx.EVT_TEXT,self.on_msg_text,self.text_ctrl_msg)
        self.Bind(wx.EVT_BUTTON,self.on_button_email_passwd,self.button_save)
        self.Bind(wx.EVT_BUTTON,self.on_button_cancel,self.button_cancel)
        #self.Bind(wx.EVT_BUTTON,self.on_button_cancel2,self.button_cancel2)
        
        #self.text_ctrl_selected_email.Bind(wx.EVT_KEY_DOWN, self.on_keydown_email)
        #self.text_ctrl_id.Bind(wx.EVT_KEY_UP, self.on_keydown_sms_id)
        
        self.DB=db_operations()
        self.V=validate()
def test_runner(desired_cap_list, big_dict, target_url_list, wks, bs_local):
    #while q.empty() is False:

    for elem in desired_cap_list:
        desired_cap = elem
        print('Browser : {} ,Version :{}'.format(elem['browser'],
                                                 elem['browser_version']))
        #options.add_argument("--headless")

        browser = webdriver.Remote(
            command_executor='http://hub.browserstack.com:80/wd/hub',
            desired_capabilities=desired_cap)
        import navigation
        import validations
        for target_url in target_url_list:
            target_url = target_url[0]

            navigation.homepageNavigate(target_url, browser)
            validations.validate(browser, big_dict, desired_cap,
                                 target_url.replace('pwa', ''), wks)

            domain = target_url.replace('pwa', '')

            navigation.hsrNavigate(domain, browser)
            validations.validate(browser, big_dict, desired_cap, domain, wks)

            navigation.hisNavigate(domain, browser)
            validations.validate(browser, big_dict, desired_cap, domain, wks)

        browser.quit()

    #stop the Local instance
    bs_local.stop()

    from validations import flag

    wks_local = gc.open("BoomAudit").worksheet('PWA Browsers & POSa')
    length_browsers = len(wks_local.col_values(1)) - 2

    #wks_local = gc.open("BoomAudit").worksheet('PWA POSa')
    length_posa = len(wks_local.col_values(6)) - 1

    wks = gc.open("BoomAudit").worksheet('PWA Logs')
    passed_num = length_browsers * length_posa * 3

    print('flag: {}, passed_num : {}'.format(flag, passed_num))
    if flag == passed_num:
        date = datetime.now().strftime("%Y-%m-%d")
        hour = datetime.now().strftime("%H")
        browser_version_os = ''
        sites = ''
        for elem in desired_cap_list:
            browser_version_os += 'Browser: {} Version: {} OS: {} ,'.format(
                elem['browser'], elem['browser_version'], elem['os'])
        for target_url in target_url_list:
            sites += '{},'.format(target_url[0])
        gsheet_values = [
            date, hour, browser_version_os, sites, 'All Pages',
            'Yay! All Good', '', '', 'PASSED', browser.session_id
        ]
        wks.insert_row(gsheet_values, index=2, value_input_option='RAW')
Exemple #13
0
    def __init__(self, *args, **kwds):
        # begin wxGlade: student_profie.__init__
        kwds[
            "style"] = wx.CAPTION | wx.CLOSE_BOX | wx.MINIMIZE_BOX | wx.MAXIMIZE | wx.MAXIMIZE_BOX | wx.SYSTEM_MENU | wx.RESIZE_BORDER | wx.CLIP_CHILDREN
        wx.Dialog.__init__(self, *args, **kwds)
        self.panel_1 = wx.Panel(self,
                                wx.ID_ANY,
                                style=wx.RAISED_BORDER | wx.TAB_TRAVERSAL)
        self.label_13 = wx.StaticText(self.panel_1, wx.ID_ANY, ("Year"))
        self.label_14 = wx.StaticText(self.panel_1, wx.ID_ANY, ("Stadard"))
        self.combo_box_year = wx.ComboBox(self.panel_1,
                                          wx.ID_ANY,
                                          choices=[],
                                          style=wx.CB_DROPDOWN | wx.CB_DROPDOWN
                                          | wx.CB_READONLY | wx.CB_SORT)
        self.combo_box_class = wx.ComboBox(
            self.panel_1,
            wx.ID_ANY,
            choices=["Select Standard", "8", "9", "10"],
            style=wx.CB_DROPDOWN | wx.CB_DROPDOWN | wx.CB_READONLY
            | wx.CB_SORT)
        self.label_16 = wx.StaticText(self.panel_1, wx.ID_ANY, ("Division"))
        self.label_17 = wx.StaticText(self.panel_1, wx.ID_ANY,
                                      ("Student List"))
        self.combo_box_div = wx.ComboBox(self.panel_1,
                                         wx.ID_ANY,
                                         choices=[],
                                         style=wx.CB_DROPDOWN | wx.CB_DROPDOWN
                                         | wx.CB_READONLY | wx.CB_SORT)
        self.combo_box_adno = wx.ComboBox(self.panel_1,
                                          wx.ID_ANY,
                                          choices=[""],
                                          style=wx.CB_DROPDOWN
                                          | wx.CB_DROPDOWN)
        cur_dir = os.path.dirname(os.path.abspath((sys.argv[0])))

        self.bitmap_photo = wx.BitmapButton(
            self.panel_1, wx.ID_ANY,
            wx.Bitmap(cur_dir + "/Resources/img/browse.jpg",
                      wx.BITMAP_TYPE_ANY))
        self.static_line_1 = wx.StaticLine(self.panel_1, wx.ID_ANY)
        self.button_add = wx.Button(self.panel_1, wx.ID_ANY,
                                    ("Add New Student"))
        self.static_line_3 = wx.StaticLine(self.panel_1, wx.ID_ANY)
        self.label_1 = wx.StaticText(self.panel_1, wx.ID_ANY, ("Roll No"))
        self.label_2 = wx.StaticText(self.panel_1, wx.ID_ANY, ("Name"))
        self.label_3 = wx.StaticText(self.panel_1, wx.ID_ANY, ("UID"))
        self.text_ctrl_roll = wx.TextCtrl(self.panel_1,
                                          wx.ID_ANY,
                                          "",
                                          style=wx.TE_PROCESS_ENTER)
        self.text_ctrl_name = wx.TextCtrl(self.panel_1,
                                          wx.ID_ANY,
                                          "",
                                          style=wx.TE_PROCESS_ENTER)
        self.text_ctrl_uid = wx.TextCtrl(self.panel_1,
                                         wx.ID_ANY,
                                         "",
                                         style=wx.TE_PROCESS_ENTER)
        self.label_4 = wx.StaticText(self.panel_1, wx.ID_ANY, ("Gender"))
        self.label_5 = wx.StaticText(self.panel_1, wx.ID_ANY,
                                     ("Date of Birth"))
        self.label_6 = wx.StaticText(self.panel_1, wx.ID_ANY, ("Category"))
        self.combo_box_gender = wx.ComboBox(self.panel_1,
                                            wx.ID_ANY,
                                            choices=[("Select"), ("M"), ("F"),
                                                     ("N")],
                                            style=wx.CB_DROPDOWN
                                            | wx.CB_DROPDOWN | wx.CB_READONLY
                                            | wx.CB_SORT)
        self.text_ctrl_dob = wx.TextCtrl(self.panel_1,
                                         wx.ID_ANY,
                                         "",
                                         style=wx.TE_PROCESS_ENTER)
        self.text_ctrl_category = wx.TextCtrl(self.panel_1,
                                              wx.ID_ANY,
                                              "",
                                              style=wx.TE_PROCESS_ENTER)
        self.label_7 = wx.StaticText(self.panel_1, wx.ID_ANY, ("Religion"))
        self.label_8 = wx.StaticText(self.panel_1, wx.ID_ANY, ("Caste"))
        self.label_9 = wx.StaticText(self.panel_1, wx.ID_ANY, ("Language"))
        self.text_ctrl_religion = wx.TextCtrl(self.panel_1,
                                              wx.ID_ANY,
                                              "",
                                              style=wx.TE_PROCESS_ENTER)
        self.text_ctrl_caste = wx.TextCtrl(self.panel_1,
                                           wx.ID_ANY,
                                           "",
                                           style=wx.TE_PROCESS_ENTER)
        self.text_ctrl_language = wx.TextCtrl(self.panel_1,
                                              wx.ID_ANY,
                                              "",
                                              style=wx.TE_PROCESS_ENTER)
        self.label_10 = wx.StaticText(self.panel_1, wx.ID_ANY, ("Father"))
        self.label_11 = wx.StaticText(self.panel_1, wx.ID_ANY, ("Mother"))
        self.label_12 = wx.StaticText(self.panel_1, wx.ID_ANY, ("Mobile"))
        self.text_ctrl_father = wx.TextCtrl(self.panel_1,
                                            wx.ID_ANY,
                                            "",
                                            style=wx.TE_PROCESS_ENTER)
        self.text_ctrl_mother = wx.TextCtrl(self.panel_1,
                                            wx.ID_ANY,
                                            "",
                                            style=wx.TE_PROCESS_ENTER)
        self.text_ctrl_mobile = wx.TextCtrl(self.panel_1,
                                            wx.ID_ANY,
                                            "",
                                            style=wx.TE_PROCESS_ENTER)
        self.label_18 = wx.StaticText(self.panel_1, wx.ID_ANY, ("Email"))
        self.text_ctrl_email = wx.TextCtrl(self.panel_1,
                                           wx.ID_ANY,
                                           "",
                                           style=wx.TE_PROCESS_ENTER)
        self.hyperlink_2 = wx.HyperlinkCtrl(self.panel_1, wx.ID_ANY, "", "")
        self.hyperlink_3 = wx.HyperlinkCtrl(self.panel_1, wx.ID_ANY, "", "")
        self.static_line_2 = wx.StaticLine(self.panel_1, wx.ID_ANY)
        self.button_close = wx.Button(self.panel_1, wx.ID_ANY, ("&Close"))
        self.button_delete = wx.Button(self.panel_1, wx.ID_ANY, ("&Delete"))
        self.button_save = wx.Button(self.panel_1, wx.ID_SAVE, "Edit")

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_COMBOBOX, self.on_year, self.combo_box_year)
        self.Bind(wx.EVT_COMBOBOX, self.on_class, self.combo_box_class)
        self.Bind(wx.EVT_COMBOBOX, self.on_div, self.combo_box_div)
        self.Bind(wx.EVT_TEXT, self.on_adno_edit, self.combo_box_adno)
        self.Bind(wx.EVT_COMBOBOX, self.on_student_list, self.combo_box_adno)
        self.Bind(wx.EVT_BUTTON, self.on_photo, self.bitmap_photo)
        #self.Bind(wx.EVT_TEXT_ENTER, self.on_name_text, self.text_ctrl_roll)
        #self.Bind(wx.EVT_TEXT, self.on_name_text, self.text_ctrl_roll)
        #self.Bind(wx.EVT_TEXT_ENTER, self.on_name_text, self.text_ctrl_name)
        #self.Bind(wx.EVT_TEXT, self.on_name_text, self.text_ctrl_name)
        #self.Bind(wx.EVT_TEXT_ENTER, self.on_uid_enter, self.text_ctrl_uid)
        #self.Bind(wx.EVT_TEXT, self.on_uid_text, self.text_ctrl_uid)
        self.Bind(wx.EVT_COMBOBOX, self.on_gender__change,
                  self.combo_box_gender)

        self.Bind(wx.EVT_BUTTON, self.on_add_new, self.button_add)
        self.Bind(wx.EVT_BUTTON, self.on_close, self.button_close)
        self.Bind(wx.EVT_BUTTON, self.on_delete, self.button_delete)
        self.Bind(wx.EVT_BUTTON, self.on_save, self.button_save)

        # end wxGlade

        self.YEAR = ''
        self.current_id = 0
        self.current_admission_no = ''
        self.path = ''
        self.prof_pic_path = ''

        self.DB = db_operations()
        self.VALID = validate()
        self.load_year()
        self.set_editable(False)  #sets all controls read only