Skip to content

Commit

Permalink
bump to v0.1.23, support modifyfoldericon
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlesPikachu committed May 16, 2022
1 parent cd0cbaf commit 8a1719e
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ You can star this repository to keep track of the project if it's helpful for yo
| tianyancha | [click](https://mp.weixin.qq.com/s/IpaOCq1600JyIf9QWieoTQ) | [click](./pytools/modules/tianyancha) | 天眼查 |
| decryptbrowser | [click](https://mp.weixin.qq.com/s/sotiVBWrFxcyYAgdRJ5ydA) | [click](./pytools/modules/decryptbrowser) | 盗取浏览器里的账号密码 |
| githubacceleration | [click](https://mp.weixin.qq.com/s/OEWi5y_AbM1jE526LCp4aw) | [click](./pytools/modules/githubacceleration) | 国内访问Github一键加速脚本 |
| modifyfoldericon | [click]() | [click](./pytools/modules/modifyfoldericon) | 文件夹图标批量修改 |


# Install
Expand Down
7 changes: 6 additions & 1 deletion docs/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,9 @@
**2022-05-11**

- 版本号: v0.1.22,
- 更新内容: 国内访问Github一键加速脚本。
- 更新内容: 支持国内访问Github一键加速脚本。

**2022-05-16**

- 版本号: v0.1.23,
- 更新内容: 支持文件夹图标批量修改。
27 changes: 27 additions & 0 deletions docs/Quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -1009,6 +1009,33 @@ tool_client.execute('githubacceleration')
}
```

#### 文件夹图标批量修改

**1.公众号文章链接**

[点击查看]()

**2.功能介绍**

文件夹图标批量修改。

**3.调用示例代码**

```python
from pytools import pytools

tool_client = pytools.pytools()
tool_client.execute('modifyfoldericon', config={'icon_path': r'D:\icon.ico'})
```

**4.config中支持的参数**

```
{
icon_path: 目标图标路径,
}
```


## 随机运行一个小程序

Expand Down
2 changes: 1 addition & 1 deletion pytools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
'''url'''
__url__ = 'https://github.com/CharlesPikachu/pytools'
'''version'''
__version__ = '0.1.22'
__version__ = '0.1.23'
'''author'''
__author__ = 'Charles'
'''email'''
Expand Down
1 change: 1 addition & 0 deletions pytools/modules/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from .coupletgenerator import CoupletGenerator
from .artsigngenerator import ArtSignGenerator
from .controlpcbyemail import ControlPCbyEmail
from .modifyfoldericon import ModifyFolderICON
from .naughtyconfession import NaughtyConfession
from .goodgoodgenerator import GoodGoodGenerator
from .githubacceleration import GithubAcceleration
Expand Down
2 changes: 2 additions & 0 deletions pytools/modules/modifyfoldericon/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
'''初始化'''
from .modifyfoldericon import ModifyFolderICON
31 changes: 31 additions & 0 deletions pytools/modules/modifyfoldericon/modifyfoldericon.py
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}')
1 change: 1 addition & 0 deletions pytools/pytools.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def initialize(self):
'artsigngenerator': ArtSignGenerator, 'controlpcbyemail': ControlPCbyEmail, 'naughtyconfession': NaughtyConfession, 'luxunsentencesquery': LuxunSentencesQuery,
'hubbleseeonbirthday': HubbleSeeOnBirthday, 'newyearcardgenerator': NewYearCardGenerator, 'trumptweetsgenerator': TrumpTweetsGenerator, 'sovietgenerator': SovietGenerator,
'goodgoodgenerator': GoodGoodGenerator, 'tianyancha': Tianyancha, 'decryptbrowser': DecryptBrowser, 'githubacceleration': GithubAcceleration,
'modifyfoldericon': ModifyFolderICON,
}
return supported_tools
'''获得所有支持的tools信息'''
Expand Down

0 comments on commit 8a1719e

Please sign in to comment.