INNER CODE UNIT · Python

do_select_company

infobyte/emploleaks · emploleaks.py:1878

    def do_select_company(self, args):
        """Select a company to work with from the local database."""
        cur = self.local_conn.cursor()
        try:
            cur.execute("SELECT company_id, company_name FROM companies WHERE company_name = ?", (args.name,))
            row = cur.fetchone()
            if row:
                self.company_id = row['company_id']
                self.company_name = row['company_name']
                
                if self.plugin_name == '':
                    self.prompt = f"{Fore.RED}emploleaks{Style.RESET_ALL}({self.company_name})> "
                else:
                    self.prompt = f"{Fore.RED}emploleaks{Style.RESET_ALL}({self.company_name})({self.plugin_name})> "
            else:
                log.error("There is no company with that name in the database.")
        except sqlite3.Error as error:
            log.error(f"Database error: {error}")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…