@@ -90,7 +90,7 @@ def encrypt_command(ctx, pathname, delete, key):
90
90
ctx .fail (f'Your encryption key is invalid.' )
91
91
if key is None :
92
92
key = generate_aes_key ().decode ()
93
- click .echo (f'Your randomly encryption key is { key } ' )
93
+ click .echo (f'Your randomly encryption 🔑 is { key } ' )
94
94
95
95
path = Path (pathname )
96
96
work_dir = Path (os .getcwd ()) / 'encrypted' / 'src'
@@ -103,12 +103,13 @@ def encrypt_command(ctx, pathname, delete, key):
103
103
shutil .copytree (path , work_dir )
104
104
files = set (path .glob ('**/*.py' )) - set (
105
105
path .glob (f'encrypted/**/*.py' ))
106
- for file in files :
107
- if can_encrypt (file ):
108
- print (file )
109
- new_path = work_dir / file .relative_to (path )
110
- new_path .unlink ()
111
- encrypt_file (file , key , delete , new_path .with_suffix ('.pye' ))
106
+ with click .progressbar (files , label = '🔐 Encrypting' ) as bar :
107
+ for file in bar :
108
+ if can_encrypt (file ):
109
+ new_path = work_dir / file .relative_to (path )
110
+ new_path .unlink ()
111
+ encrypt_file (file , key , delete ,
112
+ new_path .with_suffix ('.pye' ))
112
113
else :
113
114
raise Exception (f'{ path } is not a valid path.' )
114
115
@@ -139,10 +140,10 @@ def decrypt_command(pathname, key):
139
140
work_dir .exists () and shutil .rmtree (work_dir )
140
141
shutil .copytree (path , work_dir )
141
142
files = list (path .glob ('**/*.pye' ))
142
- for file in files :
143
- print ( file )
144
- new_path = work_dir / file .relative_to (path )
145
- decrypt_file (file , key , new_path )
143
+ with click . progressbar ( files , label = '🔓 Decrypting' ) as bar :
144
+ for file in files :
145
+ new_path = work_dir / file .relative_to (path )
146
+ decrypt_file (file , key , new_path )
146
147
else :
147
148
raise Exception (f'{ path } is not a valid path.' )
148
149
0 commit comments