Skip to content

Commit

Permalink
Update README and related utils
Browse files Browse the repository at this point in the history
  • Loading branch information
heqin-zhu committed Jun 24, 2020
1 parent 257b763 commit 5bd1477
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 50 deletions.
15 changes: 0 additions & 15 deletions .github/workflows/automerge.yml

This file was deleted.

19 changes: 5 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
## HTTPS
- [github 网页](#课程目录)
- [GitHub 网页](#课程目录)
- [DownGit](http://downgit.zhoudaxiaa.com/#/home)
- [gitzip-chrome-extension](https://chrome.google.com/webstore/detail/gitzip-for-github/ffabmkklhbepgcgfonabamgnfafbdlkn)
Expand Down Expand Up @@ -93,7 +93,6 @@ course
* [代数结构](./代数结构)
* [概率论与数理统计](./概率论与数理统计)
* [光学与原子物理](./光学与原子物理)
* [images](./images)
* [Java软件开发基础](./Java软件开发基础)
* [计算方法](./计算方法)
* [计算机图像学](./计算机图像学)
Expand All @@ -107,25 +106,17 @@ course
* [数理逻辑](./数理逻辑)
* [算法基础](./算法基础)
* [随机过程](./随机过程)
* [utils](./utils)
* [Web-信息处理与应用](./Web-信息处理与应用)
* [微机原理与系统](./微机原理与系统)
* [自然语言处理](./自然语言处理)

# 贡献投稿
>感谢您的贡献~

>感谢您的贡献 :smiley:
## [GitHub Commit](https://github.com/USTC-Resource/USTC-Course/graphs/contributors)
[![](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)

## 内容创作者
在对应文件内容或者文件名中标明。若有疏漏,请修改后 pull request 或者提出 issue.

欢迎大家的参与与贡献^_^
* 仅接受学生原创的或者获得授权的资源
* github 上不能直接上传大于 100mb 的文件。对于超过 100 mb 的文件,可以存在网盘,然后在 README 文件中贴上链接
* 文件内容的改动会使 git 重新上传, 在没有必要的情况下, 不要对二进制文件做任何更改.
- 仅接受学生原创的或者获得授权的资源
- GitHub 上不能直接上传大于 100Mb 的文件。对于超过 100 Mb 的文件,可以存在网盘,然后在 README.md 中贴上链接
- 文件内容的改动会使 git 重新上传, 在没有必要的情况下, 不要对二进制文件做任何更改.

<!--
可以通过如下方式贡献
Expand Down
17 changes: 5 additions & 12 deletions utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
## HTTPS
- [github 网页](#课程目录)
- [GitHub 网页](#课程目录)
- [DownGit](http://downgit.zhoudaxiaa.com/#/home)
- [gitzip-chrome-extension](https://chrome.google.com/webstore/detail/gitzip-for-github/ffabmkklhbepgcgfonabamgnfafbdlkn)
Expand Down Expand Up @@ -149,19 +149,12 @@
{index}
# 贡献投稿
>感谢您的贡献~
>感谢您的贡献 :smiley:
## [GitHub Commit](https://github.com/USTC-Resource/USTC-Course/graphs/contributors)
[![](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)
## 内容创作者
在对应文件内容或者文件名中标明。若有疏漏,请修改后 pull request 或者提出 issue.
欢迎大家的参与与贡献^_^
* 仅接受学生原创的或者获得授权的资源
* github 上不能直接上传大于 100mb 的文件。对于超过 100 mb 的文件,可以存在网盘,然后在 README 文件中贴上链接
* 文件内容的改动会使 git 重新上传, 在没有必要的情况下, 不要对二进制文件做任何更改.
- 仅接受学生原创的或者获得授权的资源
- GitHub 上不能直接上传大于 100Mb 的文件。对于超过 100 Mb 的文件,可以存在网盘,然后在 README.md 中贴上链接
- 文件内容的改动会使 git 重新上传, 在没有必要的情况下, 不要对二进制文件做任何更改.
<!--
可以通过如下方式贡献
Expand Down
6 changes: 3 additions & 3 deletions utils/genReadme.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding: utf-8
from md_tree_links import tree
from argparse import ArgumentParser
from config import README
from config import README, IGNORE

parser = ArgumentParser()

Expand All @@ -12,13 +12,13 @@
action='store_true',
help='if has, list files and dirs, else only dirs')
parser.add_argument('-d', '--depth', type=int, default=1)
#获取参数
# 获取参数
args = parser.parse_args()
FILE = args.fileinclude
PATH = args.path
DEPTH = args.depth

idxs = tree(PATH, DEPTH, FILE)
idxs = tree(PATH, DEPTH, FILE, IGNORE)
s = README.format(index='\n'.join(idxs))
with open('README.md', 'w') as f:
f.write(s)
18 changes: 12 additions & 6 deletions utils/md_tree_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pinyinSort import pinyinSort
from argparse import ArgumentParser

#命令行输入参数处理
# 命令行输入参数处理
parser = ArgumentParser()

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


def tree(path='.', depth=2, showfile=False):
def tree(path='.', depth=2, showfile=False, ignore=None):
while not os.path.isdir(path):
print('[error]: please input a directory, not file path')
path = input()
li = os.listdir(path)
items = [os.path.join(path, i) for i in li if not i.startswith('.')]
if ignore is None:
ignore = set()
else:
ignore = set(ignore)
li = [i for i in os.listdir(
path) if i not in ignore and not i.startswith('.')]
items = [os.path.join(path, i) for i in li]
items = clean(items)
items = pinyinSort(items)
if not showfile: items = [i for i in items if os.path.isdir(i)]
if not showfile:
items = [i for i in items if os.path.isdir(i)]
if depth == 1:
return [mklink(path)] + [' ' * 4 + mklink(i) for i in items]
else:
Expand Down

0 comments on commit 5bd1477

Please sign in to comment.