Skip to content

Conversation

@sourcery-ai
Copy link

@sourcery-ai sourcery-ai bot commented Jul 17, 2023

Branch main refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the main branch, then run:

git fetch origin sourcery/main
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from Haythem-Jaidane July 17, 2023 14:50
Comment on lines -21 to -26
if(operation==1):
if (operation==1):
delate_qury+=" AND "
elif(operation==2):
delate_qury+=" OR "
else:
pass
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function MainControl.check_and_or refactored with the following changes:

Comment on lines -30 to +28
mycursor.execute("SELECT * FROM "+table_name)
mycursor.execute(f"SELECT * FROM {table_name}")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function MainControl.read refactored with the following changes:

Comment on lines -34 to +39
create_qury = "Insert into "+str(table_name)+" ( "
create_qury = f"Insert into {str(table_name)} ( "
for i in range(len(colum)):
create_qury+=str(colum[i])
if (i != len(colum)-1 ):
create_qury+=","
else:
create_qury+=") "
create_qury += "," if (i != len(colum)-1 ) else ") "
create_qury+="VALUES ("
for i in range(len(values)):
check_string_type(create_qury,values[i])
if (i != len(values)-1 ):
create_qury+=","
else:
create_qury+=") "
create_qury += "," if (i != len(values)-1 ) else ") "
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function MainControl.create refactored with the following changes:

Comment on lines -51 to +47
update_qury = "UPDATE "+table_name+" SET "+str(change_colum)+" = "
update_qury = f"UPDATE {table_name} SET {str(change_colum)} = "
check_string_type(update_qury,new_value)
update_qury += " WHERE "
for i in range(len(colum_condition)):
update_qury += str(colum_condition[i])+" = "
update_qury += f"{str(colum_condition[i])} = "
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function MainControl.update refactored with the following changes:

Comment on lines -62 to +56
delate_qury = "DELETE FROM "+table_name+" WHERE "
delate_qury = f"DELETE FROM {table_name} WHERE "
for i in range(len(colum)):
delate_qury+=str(colum[i])+" = "
delate_qury += f"{str(colum[i])} = "
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function MainControl.delete refactored with the following changes:

Comment on lines -14 to -23
mydb = mysql.connector.connect(
return mysql.connector.connect(
host=self.host,
user=self.user,
password=self.password,
database="TeamUp"
database="TeamUp",
)
return mydb
except:
raise ("check your database")
return null
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function DataBase.connectMySQL refactored with the following changes:

M=MainControl.MainControl()
H=M.read("Student")
self.window.XP.setText(str(self.window.XP.text())+" : "+str(H[0][4]))
self.window.XP.setText(f"{str(self.window.XP.text())} : {str(H[0][4])}")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function MainView.submit_button refactored with the following changes:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant