-
-
Notifications
You must be signed in to change notification settings - Fork 502
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bump to v0.1.23, support modifyfoldericon
- Loading branch information
1 parent
cd0cbaf
commit 8a1719e
Showing
8 changed files
with
70 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
'''初始化''' | ||
from .modifyfoldericon import ModifyFolderICON |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
''' | ||
Function: | ||
文件夹图标批量修改 | ||
Author: | ||
Charles | ||
微信公众号: | ||
Charles的皮卡丘 | ||
''' | ||
import os | ||
import stat | ||
|
||
|
||
'''文件夹图标批量修改''' | ||
class ModifyFolderICON(): | ||
def __init__(self, icon_path, **kwargs): | ||
assert os.path.exists(icon_path) | ||
self.icon_path = icon_path | ||
'''run''' | ||
def run(self): | ||
cur_dir = os.getcwd() | ||
for root, dirs, files in os.walk(os.getcwd(), topdown=False): | ||
os.chmod(root, stat.S_IREAD) | ||
for d in dirs: | ||
os.chdir(f'{os.path.join(root, d)}') | ||
if os.path.exists('desktop.ini'): | ||
os.system('attrib -h -s desktop.ini') | ||
fp = open('desktop.ini', 'w') | ||
fp.write('[.ShellClassInfo]' + '\n' + f'IconResource={self.icon_path},0') | ||
fp.close() | ||
os.system('attrib +h desktop.ini') | ||
os.chdir(f'{cur_dir}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters