Skip to content

Commit

Permalink
Merge pull request #3 from ZhengqiaoWang/2-offline-support-pyecharts-…
Browse files Browse the repository at this point in the history
…with-offline-assets

2-offline-support-pyecharts-with-offline-assets
  • Loading branch information
ZhengqiaoWang authored Mar 15, 2023
2 parents b8f0c69 + 55f1258 commit 101b152
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "assets"]
path = assets
url = git@github.com:pyecharts/pyecharts-assets.git
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@

## 如何使用

### 下载程序

```shell
git clone --recursive git@github.com:ZhengqiaoWang/SystemResourceMonitor.git
```

### 环境准备

首先,你需要保证你可以运行`Python3`,如果没有安装`Python3`请移步[Python官方网站](https://www.python.org/)下载安装`Python3`和对应的`Pip`
Expand Down
1 change: 1 addition & 0 deletions assets
Submodule assets added at be8458
5 changes: 5 additions & 0 deletions exporter.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
from pyecharts import charts
from pyecharts import options as opts
from pyecharts.globals import CurrentConfig, OnlineHostType
import os
import datetime
import shutil

CurrentConfig.ONLINE_HOST = "./assets/"

def exportCharts(process_name, data, output_path):
page = charts.Page(
Expand Down Expand Up @@ -39,6 +42,8 @@ def export(data_dict: dict, output_path: str, interval):
summury_txt_path = os.path.join(output_path, "summury.txt")

os.makedirs(process_dat_path, exist_ok=True)
shutil.copytree(os.path.join(os.path.dirname(os.path.abspath(
__file__)), "assets", "assets"), os.path.join(process_dat_path, "assets"))

# 统计信息
close_process_set = set() # 统计这个时间段内关闭的进程
Expand Down

0 comments on commit 101b152

Please sign in to comment.