Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sourcery refactored master branch #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented Nov 29, 2023

Branch master 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 master branch, then run:

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

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from Mlamalerie November 29, 2023 14:44
res = [mat.upper() for mat in m]
return res
return [mat.upper() for mat in m]
Copy link
Author

Choose a reason for hiding this comment

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

Function get_matieres refactored with the following changes:

Comment on lines -16 to +18
nomEmplacementSauvegarde = ou + "/" + doss
nomEmplacementSauvegarde = f"{ou}/{doss}"
if not os.path.exists(nomEmplacementSauvegarde):
os.mkdir(nomEmplacementSauvegarde)
return nomEmplacementSauvegarde
else:
return nomEmplacementSauvegarde
return nomEmplacementSauvegarde
Copy link
Author

Choose a reason for hiding this comment

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

Function CreerDossierSauvegarde refactored with the following changes:

Comment on lines -29 to +26
if diff < 1000:
return True, diff
else:
return False, diff
return (True, diff) if diff < 1000 else (False, diff)
Copy link
Author

Choose a reason for hiding this comment

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

Function SemblableFichier refactored with the following changes:

Comment on lines -40 to +34
print("Impossible de supprimer le fichier " + path + " car il n'existe pas")
print(f"Impossible de supprimer le fichier {path} car il n'existe pas")
Copy link
Author

Choose a reason for hiding this comment

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

Function SupprimerFichier refactored with the following changes:

Comment on lines -62 to +66
if not nomMatiere == listeMatieres[-1]:
nomEmplacementSauvegarde = CreerDossierSauvegarde(CreerDossierSauvegarde("H:/Desktop", "SCREENEY"), "- " + nomMatiere)
if nomMatiere != listeMatieres[-1]:
nomEmplacementSauvegarde = CreerDossierSauvegarde(
CreerDossierSauvegarde("H:/Desktop", "SCREENEY"), f"- {nomMatiere}"
)

path = nomEmplacementSauvegarde
path = path.replace('/','\\')

print("open", path)
if os.path.exists(path):
command = 'explorer.exe ' + path
command = f'explorer.exe {path}'
Copy link
Author

Choose a reason for hiding this comment

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

Function open_folder refactored with the following changes:

Comment on lines -91 to +124
if not nomMatiere == listeMatieres[-1]:
if nomMatiere != listeMatieres[-1]:
nomEmplacementSauvegarde = CreerDossierSauvegarde(
CreerDossierSauvegarde(CreerDossierSauvegarde("h:/Desktop", "SCREENEY"), "- " + nomMatiere.lower()),
datetime.datetime.now().strftime('%Y-%m-%d (%a)'))
CreerDossierSauvegarde(
CreerDossierSauvegarde("h:/Desktop", "SCREENEY"),
f"- {nomMatiere.lower()}",
),
datetime.datetime.now().strftime('%Y-%m-%d (%a)'),
)

comm = Comment.get()
comm = comm.strip()
if len(comm) > 0:
comm = ' ' + comm
comm = f' {comm}'

myDatetime = datetime.datetime.now()
nomFichier = myDatetime.strftime('%Y-%m-%d-%H%M%S' + comm)
photo = nomEmplacementSauvegarde + "/" + nomFichier + ".png"
nomFichier = myDatetime.strftime(f'%Y-%m-%d-%H%M%S{comm}')
photo = f"{nomEmplacementSauvegarde}/{nomFichier}.png"

# prendre photo
pyautogui.screenshot(photo)
print("#" + str(c) + "# " + photo)
print(f"#{str(c)}# {photo}")

# pour les photo sauf la premiere
if (c > 0):
# si photo semblable a lancienne photo alors suprr photo
semblable = SemblableFichier(photo, ancienphoto)
if semblable[0]:
print(">>> PAREIL! " + str(semblable[1]) + " # " + photo + " VS " + ancienphoto)
print(f">>> PAREIL! {str(semblable[1])} # {photo} VS {ancienphoto}")
label.config(text="Image similaire ! Je cala pas", fg='red')
SupprimerFichier(photo)
# sinon, si nouvelle photo
else:
c += 1
label.config(text="#" + str(c) + " ▪ " + photo.split('/')[-1], fg='green')
label.config(text=f"#{c} ▪ " + photo.split('/')[-1], fg='green')
ancienphoto = photo

else:
c += 1
label.config(text="#" + str(c) + " ▪ " + photo.split('/')[-1], fg='green')
label.config(text=f"#{c} ▪ " + photo.split('/')[-1], fg='green')
Copy link
Author

Choose a reason for hiding this comment

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

Function capturer refactored with the following changes:

This removes the following comments ( why? ):

# sinon, si nouvelle photo

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.

0 participants