def editAccount(self): new_first = self.firstNameInput.text() new_last = self.lastNameInput.text() new_email = self.emailInput.text() new_phone = self.phoneInput.text() new_street = self.streetInput.text() new_city = self.cityInput.text() new_state = self.stateInput.currentText() new_zip = self.zipInput.text() new_number = self.cardNumberInput.text() new_exp = self.expInput.text() new_cvv = self.cvvInput.text() new_name = self.nameInput.text() new_billingStreet = self.billingStreetInput.text() new_billingCity = self.billingCityInput.text() new_billingState = self.billingStateInput.currentText() new_billingZip = self.billingZipInput.text() if self.billingCheckbox.isChecked(): new_billingStreet = new_street new_billingCity = new_city new_billingState = new_state new_billingZip = new_zip accounts = account_handler.get_all_accounts() new_account = [ new_first, new_last, new_email, new_phone, new_street, new_city, new_state, new_zip, new_number, new_exp, new_cvv, new_name, new_billingStreet, new_billingCity, new_billingState, new_billingZip ] accounts[self.index] = new_account account_handler.insert_accounts(accounts) self.close()
def task_runner(self): self.all_tasks = task_handler.get_all_tasks() self.all_accounts = account_handler.get_all_accounts() self.all_proxies = proxy_handler.get_all_proxies() supreme_t_shirts_tasks = [] supreme_t_shirts_accounts = [] supreme_t_shirts_proxies = [] supreme_accessories_tasks = [] supreme_accessories_accounts = [] supreme_accessories_proxies = [] index = 0 for task in self.all_tasks: if task[0] == 'Supreme (T-Shirts)': # shop supreme_t_shirts_tasks.append(task) supreme_t_shirts_accounts.append(self.all_accounts[index]) supreme_t_shirts_proxies.append(self.all_proxies[index]) if task[0] == 'Supreme (Accessories)': supreme_accessories_tasks.append(task) supreme_accessories_accounts.append(self.all_accounts[index]) supreme_accessories_proxies.append(self.all_proxies[index]) index += 1 if len(supreme_t_shirts_tasks) > 0: # if there are tasks supreme_tasks = SupremeTShirt(supreme_t_shirts_tasks, supreme_t_shirts_accounts, supreme_t_shirts_proxies) supreme_tasks.task_pool() if len(supreme_accessories_tasks) > 0: supreme_tasks = SupremeAccessories(supreme_accessories_tasks, supreme_accessories_accounts, supreme_accessories_proxies) supreme_tasks.task_pool()
def export_file(filename): if filename: accounts = account_handler.get_all_accounts() top_row = [ 'First', 'Last', 'Email', 'Phone', 'Address', 'City', 'State', 'Zip', 'Card', 'Exp', 'CVV', 'Name', 'Address', 'City', 'State', 'Zip' ] with open(filename, 'w') as exportfile: newfile = csv.writer(exportfile, dialect='excel') newfile.writerow(top_row) for account in accounts: newfile.writerow(account)
def import_file(csv_file): if csv_file: with open(csv_file, 'r') as file: csv_reader = csv.reader(file, delimiter=',') new_accounts = [] line_count = 0 for row in csv_reader: if line_count > 0: new_account = [ row[0], row[1], row[2], row[3], row[4], row[5], row[6], row[7], row[8], row[9], row[10], row[11], row[12], row[13], row[14], row[15] ] new_accounts.append(new_account) line_count += 1 all_accounts = account_handler.get_all_accounts() all_accounts += new_accounts account_handler.insert_accounts(all_accounts)
def addAccount(self): can_add_account = True first = self.firstNameInput.text() if len(first) == 0: self.firstNameLabel.setText("First name*") self.firstNameLabel.setStyleSheet("color: red;" "font-size: 15px;" "font-weight: bold;") can_add_account = False last = self.lastNameInput.text() if len(last) == 0: self.lastNameLabel.setText("last name*") self.lastNameLabel.setStyleSheet("color: red;" "font-size: 15px;" "font-weight: bold;") can_add_account = False email = self.emailInput.text() if len(email) == 0: self.emailLabel.setText("email address*") self.emailLabel.setStyleSheet("color: red;" "font-size: 15px;" "font-weight: bold;") can_add_account = False phone = self.phoneInput.text() if len(phone) == 0: self.phoneLabel.setText("phone number*") self.phoneLabel.setStyleSheet("color: red;" "font-size: 15px;" "font-weight: bold;") can_add_account = False street = self.streetInput.text() if len(street) == 0: self.streetLabel.setText("street*") self.streetLabel.setStyleSheet("color: red;" "font-size: 15px;" "font-weight: bold;") can_add_account = False city = self.cityInput.text() if len(city) == 0: self.cityLabel.setText("city*") self.cityLabel.setStyleSheet("color: red;" "font-size: 15px;" "font-weight: bold;") can_add_account = False state = self.stateInput.currentText() if state == "Select State": self.stateLabel.setText("state*") self.stateLabel.setStyleSheet("color: red;" "font-size: 15px;" "font-weight: bold;") can_add_account = False zip = self.zipInput.text() if len(zip) == 0: self.zipLabel.setText("zip code*") self.zipLabel.setStyleSheet("color: red;" "font-size: 15px;" "font-weight: bold;") can_add_account = False number = self.cardNumberInput.text() if len(number) == 0: self.cardNumberLabel.setText("Card Number*") self.cardNumberLabel.setStyleSheet("color: red;" "font-size: 15px;" "font-weight: bold;") can_add_account = False exp = self.expInput.text() if len(exp) == 0 or "/" not in exp: self.expLabel.setText("expiration date*") self.expLabel.setStyleSheet("color: red;" "font-size: 15px;" "font-weight: bold;") can_add_account = False cvv = self.cvvInput.text() if len(cvv) == 0: self.cvvLabel.setText("cvv*") self.cvvLabel.setStyleSheet("color: red;" "font-size: 15px;" "font-weight: bold;") can_add_account = False name = self.nameInput.text() if len(name) == 0: self.nameLabel.setText("name on card*") self.nameLabel.setStyleSheet("color: red;" "font-size: 15px;" "font-weight: bold;") can_add_account = False if self.billingCheckbox.isChecked(): billingStreet = street billingCity = city billingState = state billingZip = zip else: billingStreet = self.billingStreetInput.text() if len(billingStreet) == 0: self.billingStreetLabel.setText("street*") self.billingStreetLabel.setStyleSheet("color: red;" "font-size: 15px;" "font-weight: bold;") can_add_account = False billingCity = self.billingCityInput.text() if len(billingCity) == 0: self.billingCityLabel.setText("city*") self.billingCityLabel.setStyleSheet("color: red;" "font-size: 15px;" "font-weight: bold;") can_add_account = False billingState = self.billingStateInput.currentText() if billingState == 'Select State': self.billingStateLabel.setText("state*") self.billingStateLabel.setStyleSheet("color: red;" "font-size: 15px;" "font-weight: bold;") can_add_account = False billingZip = self.billingZipInput.text() if len(billingZip) == 0: self.billingZipLabel.setText("zip code*") self.billingZipLabel.setStyleSheet("color: red;" "font-size: 15px;" "font-weight: bold;") can_add_account = False if can_add_account: all_accounts = account_handler.get_all_accounts() all_accounts.append([ first, last, email, phone, street, city, state, zip, number, exp, cvv, name, billingStreet, billingCity, billingState, billingZip ]) account_handler.insert_accounts(all_accounts) self.close()