Skip to content

Commit 5bd1477

Browse files
committed
Update README and related utils
1 parent 257b763 commit 5bd1477

File tree

5 files changed

+25
-50
lines changed

5 files changed

+25
-50
lines changed

.github/workflows/automerge.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

README.md

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
5757
## HTTPS
5858
59-
- [github 网页](#课程目录)
59+
- [GitHub 网页](#课程目录)
6060
- [DownGit](http://downgit.zhoudaxiaa.com/#/home)
6161
- [gitzip-chrome-extension](https://chrome.google.com/webstore/detail/gitzip-for-github/ffabmkklhbepgcgfonabamgnfafbdlkn)
6262
@@ -93,7 +93,6 @@ course
9393
* [代数结构](./代数结构)
9494
* [概率论与数理统计](./概率论与数理统计)
9595
* [光学与原子物理](./光学与原子物理)
96-
* [images](./images)
9796
* [Java软件开发基础](./Java软件开发基础)
9897
* [计算方法](./计算方法)
9998
* [计算机图像学](./计算机图像学)
@@ -107,25 +106,17 @@ course
107106
* [数理逻辑](./数理逻辑)
108107
* [算法基础](./算法基础)
109108
* [随机过程](./随机过程)
110-
* [utils](./utils)
111109
* [Web-信息处理与应用](./Web-信息处理与应用)
112110
* [微机原理与系统](./微机原理与系统)
113111
* [自然语言处理](./自然语言处理)
114112

115113
# 贡献投稿
116-
>感谢您的贡献~
117114

115+
>感谢您的贡献 :smiley:
118116
119-
## [GitHub Commit](https://github.com/USTC-Resource/USTC-Course/graphs/contributors)
120-
[![](https://sourcerer.io/fame/mbinary/USTC-Resource/USTC-Course/images/0)](https://sourcerer.io/fame/mbinary/USTC-Resource/USTC-Course/links/0)[![](https://sourcerer.io/fame/mbinary/USTC-Resource/USTC-Course/images/1)](https://sourcerer.io/fame/mbinary/USTC-Resource/USTC-Course/links/1)[![](https://sourcerer.io/fame/mbinary/USTC-Resource/USTC-Course/images/2)](https://sourcerer.io/fame/mbinary/USTC-Resource/USTC-Course/links/2)[![](https://sourcerer.io/fame/mbinary/USTC-Resource/USTC-Course/images/3)](https://sourcerer.io/fame/mbinary/USTC-Resource/USTC-Course/links/3)[![](https://sourcerer.io/fame/mbinary/USTC-Resource/USTC-Course/images/4)](https://sourcerer.io/fame/mbinary/USTC-Resource/USTC-Course/links/4)[![](https://sourcerer.io/fame/mbinary/USTC-Resource/USTC-Course/images/5)](https://sourcerer.io/fame/mbinary/USTC-Resource/USTC-Course/links/5)[![](https://sourcerer.io/fame/mbinary/USTC-Resource/USTC-Course/images/6)](https://sourcerer.io/fame/mbinary/USTC-Resource/USTC-Course/links/6)[![](https://sourcerer.io/fame/mbinary/USTC-Resource/USTC-Course/images/7)](https://sourcerer.io/fame/mbinary/USTC-Resource/USTC-Course/links/7)[![](https://sourcerer.io/fame/mbinary/USTC-Resource/USTC-Course/images/8)](https://sourcerer.io/fame/mbinary/USTC-Resource/USTC-Course/links/8)
121-
122-
## 内容创作者
123-
在对应文件内容或者文件名中标明。若有疏漏,请修改后 pull request 或者提出 issue.
124-
125-
欢迎大家的参与与贡献^_^
126-
* 仅接受学生原创的或者获得授权的资源
127-
* github 上不能直接上传大于 100mb 的文件。对于超过 100 mb 的文件,可以存在网盘,然后在 README 文件中贴上链接
128-
* 文件内容的改动会使 git 重新上传, 在没有必要的情况下, 不要对二进制文件做任何更改.
117+
- 仅接受学生原创的或者获得授权的资源
118+
- GitHub 上不能直接上传大于 100Mb 的文件。对于超过 100 Mb 的文件,可以存在网盘,然后在 README.md 中贴上链接
119+
- 文件内容的改动会使 git 重新上传, 在没有必要的情况下, 不要对二进制文件做任何更改.
129120

130121
<!--
131122
可以通过如下方式贡献

utils/config.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
117117
## HTTPS
118118
119-
- [github 网页](#课程目录)
119+
- [GitHub 网页](#课程目录)
120120
- [DownGit](http://downgit.zhoudaxiaa.com/#/home)
121121
- [gitzip-chrome-extension](https://chrome.google.com/webstore/detail/gitzip-for-github/ffabmkklhbepgcgfonabamgnfafbdlkn)
122122
@@ -149,19 +149,12 @@
149149
{index}
150150
151151
# 贡献投稿
152-
>感谢您的贡献~
153152
153+
>感谢您的贡献 :smiley:
154154
155-
## [GitHub Commit](https://github.com/USTC-Resource/USTC-Course/graphs/contributors)
156-
[![](https://sourcerer.io/fame/mbinary/USTC-Resource/USTC-Course/images/0)](https://sourcerer.io/fame/mbinary/USTC-Resource/USTC-Course/links/0)[![](https://sourcerer.io/fame/mbinary/USTC-Resource/USTC-Course/images/1)](https://sourcerer.io/fame/mbinary/USTC-Resource/USTC-Course/links/1)[![](https://sourcerer.io/fame/mbinary/USTC-Resource/USTC-Course/images/2)](https://sourcerer.io/fame/mbinary/USTC-Resource/USTC-Course/links/2)[![](https://sourcerer.io/fame/mbinary/USTC-Resource/USTC-Course/images/3)](https://sourcerer.io/fame/mbinary/USTC-Resource/USTC-Course/links/3)[![](https://sourcerer.io/fame/mbinary/USTC-Resource/USTC-Course/images/4)](https://sourcerer.io/fame/mbinary/USTC-Resource/USTC-Course/links/4)[![](https://sourcerer.io/fame/mbinary/USTC-Resource/USTC-Course/images/5)](https://sourcerer.io/fame/mbinary/USTC-Resource/USTC-Course/links/5)[![](https://sourcerer.io/fame/mbinary/USTC-Resource/USTC-Course/images/6)](https://sourcerer.io/fame/mbinary/USTC-Resource/USTC-Course/links/6)[![](https://sourcerer.io/fame/mbinary/USTC-Resource/USTC-Course/images/7)](https://sourcerer.io/fame/mbinary/USTC-Resource/USTC-Course/links/7)[![](https://sourcerer.io/fame/mbinary/USTC-Resource/USTC-Course/images/8)](https://sourcerer.io/fame/mbinary/USTC-Resource/USTC-Course/links/8)
157-
158-
## 内容创作者
159-
在对应文件内容或者文件名中标明。若有疏漏,请修改后 pull request 或者提出 issue.
160-
161-
欢迎大家的参与与贡献^_^
162-
* 仅接受学生原创的或者获得授权的资源
163-
* github 上不能直接上传大于 100mb 的文件。对于超过 100 mb 的文件,可以存在网盘,然后在 README 文件中贴上链接
164-
* 文件内容的改动会使 git 重新上传, 在没有必要的情况下, 不要对二进制文件做任何更改.
155+
- 仅接受学生原创的或者获得授权的资源
156+
- GitHub 上不能直接上传大于 100Mb 的文件。对于超过 100 Mb 的文件,可以存在网盘,然后在 README.md 中贴上链接
157+
- 文件内容的改动会使 git 重新上传, 在没有必要的情况下, 不要对二进制文件做任何更改.
165158
166159
<!--
167160
可以通过如下方式贡献

utils/genReadme.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# coding: utf-8
22
from md_tree_links import tree
33
from argparse import ArgumentParser
4-
from config import README
4+
from config import README, IGNORE
55

66
parser = ArgumentParser()
77

@@ -12,13 +12,13 @@
1212
action='store_true',
1313
help='if has, list files and dirs, else only dirs')
1414
parser.add_argument('-d', '--depth', type=int, default=1)
15-
#获取参数
15+
# 获取参数
1616
args = parser.parse_args()
1717
FILE = args.fileinclude
1818
PATH = args.path
1919
DEPTH = args.depth
2020

21-
idxs = tree(PATH, DEPTH, FILE)
21+
idxs = tree(PATH, DEPTH, FILE, IGNORE)
2222
s = README.format(index='\n'.join(idxs))
2323
with open('README.md', 'w') as f:
2424
f.write(s)

utils/md_tree_links.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from pinyinSort import pinyinSort
44
from argparse import ArgumentParser
55

6-
#命令行输入参数处理
6+
# 命令行输入参数处理
77
parser = ArgumentParser()
88

99
parser.add_argument('-p', '--path', default='.', help='path to walk')
@@ -13,7 +13,7 @@
1313
action='store_true',
1414
help='if has, list files and dirs, else only dirs')
1515
parser.add_argument('-d', '--depth', type=int, default=2)
16-
#获取参数
16+
# 获取参数
1717
args = parser.parse_args()
1818
FILE = args.fileinclude
1919
PATH = args.path
@@ -33,15 +33,21 @@ def clean(paths):
3333
return ret
3434

3535

36-
def tree(path='.', depth=2, showfile=False):
36+
def tree(path='.', depth=2, showfile=False, ignore=None):
3737
while not os.path.isdir(path):
3838
print('[error]: please input a directory, not file path')
3939
path = input()
40-
li = os.listdir(path)
41-
items = [os.path.join(path, i) for i in li if not i.startswith('.')]
40+
if ignore is None:
41+
ignore = set()
42+
else:
43+
ignore = set(ignore)
44+
li = [i for i in os.listdir(
45+
path) if i not in ignore and not i.startswith('.')]
46+
items = [os.path.join(path, i) for i in li]
4247
items = clean(items)
4348
items = pinyinSort(items)
44-
if not showfile: items = [i for i in items if os.path.isdir(i)]
49+
if not showfile:
50+
items = [i for i in items if os.path.isdir(i)]
4551
if depth == 1:
4652
return [mklink(path)] + [' ' * 4 + mklink(i) for i in items]
4753
else:

0 commit comments

Comments
 (0)