# Ramile
_Ramile a handy tool used to automatically extract 3000 lines of source codes from given project/folder, as a requirement of China Software Copyright application process. The goal of Ramile is to save 0.5~1 hour of your time spent on preparing the 60 pages of source code for each Software Copyright submission._
Currently Ramile has below features:
- Automatically extracting the source code and generating a docx file containing 3000 lines. (You have to manually remove the last few pages of the docx to make it exactly 60 pages, though)
- Supporting most of the commmon front-end projects: android/ios/web/Wechat mini program, etc
- Configurable. Just place a `.ramileconfig.json` under the project root folder. (See "Config" section for details)
Tested under python 3.6.1.
## Installation
Right now we can only run Ramile from source code. In the future it may be uploaded to pypi.
To run Ramile source code, clone the repository and install dependencies: `pip install -r requirements.txt`. Or if in China, mirros could be used `pip install -i https://pypi.mirrors.ustc.edu.cn/simple/ -r requirements.txt`
## Basic Usage
Running from source code:
```
python ramile-cli.py extract <path to your project root>
```
When the extraction is completed, a file named `extracted_code.docx` will be generated under your project root directory, with 3000 lines of code. You just have to open it and remove unnecessary pages to make the document exact 60 pages.
If you want to strictly meet the [regulation](./著作权法.md#第十条-软件的鉴别材料包括程序和文档的鉴别材料), you can extract all the lines by append `Inf` to the command line:
```
python ramile-cli.py extract <path to your project root> Inf
```
And then you just have to open it and keep the first 30 pages and the last 30 pages, and remove all the intermediate pages.
## Config
Ramile automatically loads the config file `.ramileconfig.json` from the project root, if it exits. The file should be in json format. Possible config items as below:
| Key | Description | Default | Example |
| :--------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------ | :--------------- |
| ignore | Sets the directories/files to be ignored by Ramile. "ignore" paths should be sub directories/files under source_root. Any directories/files starting with any one of the "ignore" items will be ignored. Wildcars are not supported. | [] | ['Pods', 'libs'] |
| source_root | Overwrites the root directory of source codes to avoid Ramile process from the project root. | '' | 'app' |
| filters | Sets the exclusive filters (which means, all other extensions will NOT be processed) for file extensions. By default all files will be processed. | [] | ['.js', '.vue'] |
| lines_to_extract | Sets the total lines to extract | 3000 | 3000 |
## Supported Languages
| Language | Extensions |
| :---------- | :-------------------- |
| JavaScript | .js, .jsx, .vue, .wpy |
| Java | .java |
| PHP | .php |
| HTML | .html, .htm |
| CSS | .css, .less, .sass |
| Swift | .swift |
| Objective-C | .m |
## Test:
```shell
cd tests
pytest
```
真好玩主人
- 粉丝: 21
- 资源: 4632
最新资源
- 基于java的自习室预订系统设计与实现.docx
- 不平衡电网有源电力滤波器,不平衡电网APF,L型有源电力滤波器,谐波补偿,APF simulink仿真,电力电子仿真 提供参考文献
- 宠物咖啡馆平台的设计与实现-springboot毕业项目,适合计算机毕-设、实训项目、大作业学习.zip
- 宠物领养系统的设计与实现-springboot毕业项目,适合计算机毕-设、实训项目、大作业学习.rar
- 大学生竞赛管理系统-springboot毕业项目,适合计算机毕-设、实训项目、大作业学习.rar
- 大型商场应急预案管理系统-springboot毕业项目,适合计算机毕-设、实训项目、大作业学习.zip
- 大学城水电管理系统-springboot毕业项目,适合计算机毕-设、实训项目、大作业学习.zip
- 热站 SMART程序 西门子PLC一拖二热站自控系统程序,2个循环泵,2个补水泵,循环泵与补水泵采用一用一备,按设置时间自动切,硬件:西门子200smart sr30 PLC+昆仑通泰触摸屏,程序有完
- 大学生入学审核系统的设计与实现-springboot毕业项目,适合计算机毕-设、实训项目、大作业学习.zip
- 大学生就业招聘系统的设计与实现-springboot毕业项目,适合计算机毕-设、实训项目、大作业学习.zip
- 大学生租房平台的设计与实现-springboot毕业项目,适合计算机毕-设、实训项目、大作业学习.zip
- 电影评论网站系统设计与实现-springboot毕业项目,适合计算机毕-设、实训项目、大作业学习.zip
- 党员教育和管理系统-springboot毕业项目,适合计算机毕-设、实训项目、大作业学习.rar
- 房产销售系统-springboot毕业项目,适合计算机毕-设、实训项目、大作业学习.zip
- 房屋租赁管理系统的设计与实现-springboot毕业项目,适合计算机毕-设、实训项目、大作业学习.zip
- 服装生产管理的设计与实现-springboot毕业项目,适合计算机毕-设、实训项目、大作业学习.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
评论0