Skip to content

Commit de14cdd

Browse files
Merge pull request #183 from Robot-Inventor/release-v5.1
2 parents 6083651 + f383e55 commit de14cdd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+3352
-2178
lines changed

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ dmypy.json
129129
.pyre/
130130

131131
# ORIZIN Agent settings and other files
132-
resource/setting/flag.otfd
133-
resource/setting/setting.otfd
132+
resource/setting/flag.json
133+
resource/setting/setting.json
134134
resource/css/theme_setting.css
135135
resource/css/theme/user/*.css
136136
resource/dictionary/unknownQuestions.txt

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ ORIZIN Agent HTML is an open-source AI assistant using Python programing languag
1919

2020
## ライセンスとバージョンについて
2121

22-
ライセンスはMITライセンスです。ライセンス全文はLICENSE.txt、バージョン等の情報はresource/information.txtにあります。これらは、ORIZIN Agentのメニューの「ORIZIN Agentについて」からも見られます。
22+
ライセンスはMITライセンスです。ライセンス全文はLICENSE.txt、バージョン等の情報はresource/information.jsonにあります。これらは、ORIZIN Agentのメニューの「ORIZIN Agentについて」からも見られます。

changelog.md

+91-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
Series Name: ORIZIN Agent
88
Edition: ORIZIN Agent HTML
99

10-
他の情報を読むには、resource/information.txtを参照してください
10+
他の情報を読むには、resource/information.jsonを参照してください
1111

1212
## バージョニング
1313

@@ -35,6 +35,96 @@ Edition: ORIZIN Agent HTML
3535

3636
## リリース
3737

38+
### [v5.1.147.2-Eagle] - 2021-05-11
39+
40+
#### 追加
41+
42+
- 設定の検索時に検索対象・検索キーワードの両方に対し、半角・全角の正規化とひらがな・カタカナの正規化を行う機能を追加しました [#120](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/120)
43+
- 次の試験機能を追加しました
44+
- ヒントの設定を表示する [#53](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/53)
45+
- 読み取り専用モードのサポートの有効化 [#173](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/173)
46+
- フィードバックにシステム情報を含めるオプションを追加しました [#116](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/116)
47+
- 設定の検索にタグ機能を追加しました [#99](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/99)
48+
- stylelintを導入しました [#171](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/171)
49+
50+
#### 変更
51+
52+
- 試験機能ページの各項目をコンポーネント化しました [#101](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/101)
53+
- コンポーネント関連のJavaScriptを別ファイルに分けました [#105](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/105)
54+
- フィードバックの送信時にシステムの情報を送信するオプションが追加されたため、プライバシーポリシーを改定しました [#116](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/116)
55+
- information.txtはinformation.jsonに変わりました [#133](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/133)
56+
- 設定ファイルをjson形式に移行しました [#162](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/162)
57+
58+
#### 削除
59+
60+
- 「改善されたカスタムテーマの編集ページを使用する」試験機能を削除しました [#98](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/98)
61+
62+
#### 修正
63+
64+
- 試験機能ページで続行確認後にメッセージが切り替わらないバグを修正しました [#100](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/100)
65+
- 検索機能が動作しないバグを修正しました [#110](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/110)
66+
- 初期設定画面でメニューを開くと背景をクリックしてもメニューが閉じないバグを修正しました [#94](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/94)
67+
- 「オープンソースソフトウェアライセンス」ページのデータをjson化しました [#124](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/124)
68+
- オープンソースソフトウェアライセンスに[Material Web Components](https://github.com/material-components/material-components-web-components)が抜けていたため修正しました [#128](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/128)
69+
- 試験機能ページの検索対象に試験機能のタイトルが含まれていなかったため修正しました [#131](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/131)
70+
- デバッグ用に使ったまま残っているconsole.log()を削除しました [#144](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/144)
71+
- flag.js内の試験機能一覧をjson化しました [#174](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/174)
72+
- アップデートの確認時にリリースチャンネルが無視されるバグを修正しました [#178](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/178)
73+
74+
#### Notice
75+
76+
- このバージョンは、v5.0.144.11dev-Eagleからv5.1.146.1dev-Eagleまでのアップデートの正式版です
77+
- このバージョンでは設定ファイルのファイル形式が変更されており、後方互換性はありません。アップデートではなく再ダウンロードを推奨します
78+
79+
### [v5.1.146.1dev-Eagle] - 2021-05-11
80+
81+
#### 修正
82+
83+
- アップデートの確認時にリリースチャンネルが無視されるバグを修正しました [#178](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/178)
84+
85+
### [v5.1.145.0dev-Eagle] - 2021-05-10
86+
87+
#### 追加
88+
89+
- 設定の検索時に検索対象・検索キーワードの両方に対し、半角・全角の正規化とひらがな・カタカナの正規化を行う機能を追加しました [#120](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/120)
90+
- 次の試験機能を追加しました
91+
- ヒントの設定を表示する [#53](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/53)
92+
- 読み取り専用モードのサポートの有効化 [#173](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/173)
93+
- フィードバックにシステム情報を含めるオプションを追加しました [#116](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/116)
94+
- 設定の検索にタグ機能を追加しました [#99](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/99)
95+
- stylelintを導入しました [#171](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/171)
96+
97+
#### 変更
98+
99+
- フィードバックの送信時にシステムの情報を送信するオプションが追加されたため、プライバシーポリシーを改定しました [#116](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/116)
100+
- information.txtはinformation.jsonに変わりました [#133](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/133)
101+
- 設定ファイルをjson形式に移行しました [#162](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/162)
102+
103+
#### 修正
104+
105+
- 「オープンソースソフトウェアライセンス」ページのデータをjson化しました [#124](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/124)
106+
- オープンソースソフトウェアライセンスに[Material Web Components](https://github.com/material-components/material-components-web-components)が抜けていたため修正しました [#128](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/128)
107+
- 試験機能ページの検索対象に試験機能のタイトルが含まれていなかったため修正しました [#131](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/131)
108+
- デバッグ用に使ったまま残っているconsole.log()を削除しました [#144](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/144)
109+
- flag.js内の試験機能一覧をjson化しました [#174](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/174)
110+
111+
### [v5.0.144.11dev-Eagle] - 2021-05-03
112+
113+
#### 変更
114+
115+
- 試験機能ページの各項目をコンポーネント化しました [#101](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/101)
116+
- コンポーネント関連のJavaScriptを別ファイルに分けました [#105](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/105)
117+
118+
#### 削除
119+
120+
- 「改善されたカスタムテーマの編集ページを使用する」試験機能を削除しました [#98](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/98)
121+
122+
#### 修正
123+
124+
- 試験機能ページで続行確認後にメッセージが切り替わらないバグを修正しました [#100](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/100)
125+
- 検索機能が動作しないバグを修正しました [#110](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/110)
126+
- 初期設定画面でメニューを開くと背景をクリックしてもメニューが閉じないバグを修正しました [#94](https://github.com/Robot-Inventor/ORIZIN-Agent-HTML/issues/94)
127+
38128
### [v5.0.143.10-Eagle] - 2021-03-08
39129

40130
#### 変更

oa_core.py

+26-35
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import typing
1616
import pathlib
1717
import shutil
18+
import json
1819

1920

2021
def normalize(sentence: str) -> str:
@@ -182,34 +183,35 @@ def convert_to_bool(value: typing.Any) -> bool:
182183
return False
183184

184185

185-
def read_setting(_setting_file_path: str, setting_name: typing.Any) -> typing.Optional[str]:
186+
def read_setting(_setting_file_path: str, setting_name: str = "") -> typing.Any:
186187
if os.path.exists(_setting_file_path) is False:
187188
return
188189
else:
189-
root = otfdlib.Otfd()
190-
root.load(_setting_file_path)
191-
root.parse()
192-
return root.get_value(setting_name)
190+
with open(_setting_file_path, encoding="utf-8_sig", mode="r") as f:
191+
json_dictionary = json.load(f)
192+
if setting_name:
193+
return json_dictionary[setting_name]
194+
else:
195+
return json_dictionary
193196

194197

195-
def write_setting(_setting_file_path: str, setting_name: typing.Any, setting_value: typing.Any) -> None:
198+
def write_setting(_setting_file_path: str, setting_name: str, setting_value: typing.Any) -> None:
196199
if os.path.exists(_setting_file_path) is False:
197200
with open(_setting_file_path, mode="w", encoding="utf-8_sig") as f:
198-
f.write("")
199-
root = otfdlib.Otfd()
200-
root.load(_setting_file_path)
201-
root.parse()
202-
root.add(str(setting_name), str(setting_value))
203-
root.write()
204-
return
201+
json.dump({}, f)
202+
with open(_setting_file_path, encoding="utf-8_sig", mode="r") as f:
203+
json_dictionary = json.load(f)
204+
json_dictionary[setting_name] = setting_value
205+
with open(_setting_file_path, encoding="utf-8_sig", mode="w") as f:
206+
json.dump(json_dictionary, f, indent=4)
205207

206208

207-
def read_flag(_flag_file_path: str, flag_name: typing.Any) -> bool:
208-
return convert_to_bool(read_setting(_flag_file_path, flag_name))
209+
def read_flag(_flag_file_path: str, flag_name: str) -> bool:
210+
return read_setting(_flag_file_path, flag_name)
209211

210212

211-
def set_flag(_flag_file_path: str, flag_name: typing.Any, flag_value: typing.Any) -> None:
212-
write_setting(_flag_file_path, str(flag_name), convert_to_bool(flag_value))
213+
def set_flag(_flag_file_path: str, flag_name: str, flag_value: bool) -> None:
214+
write_setting(_flag_file_path, flag_name, flag_value)
213215
return
214216

215217

@@ -222,26 +224,15 @@ def solve_setting_conflict(default_setting_file_path: str, current_setting_file_
222224
current.write(default.read())
223225
return
224226
else:
225-
default_setting = otfdlib.Otfd()
226-
default_setting.load(default_setting_file_path)
227-
default_setting.parse()
228-
default_index_list = default_setting.get_index_list()
229-
current_setting = otfdlib.Otfd()
230-
current_setting.load(current_setting_file_path)
231-
current_setting.parse()
232-
current_index_list = current_setting.get_index_list()
233-
need_to_add = list(set(default_index_list) - set(current_index_list))
234-
current_setting.update(
235-
{index: default_setting.get_value(index) for index in need_to_add})
236-
need_to_delete = list(set(current_index_list) -
237-
set(default_index_list))
227+
default_setting = read_setting(default_setting_file_path)
228+
current_setting = read_setting(current_setting_file_path)
229+
need_to_delete = list(
230+
set(current_setting.keys()) - set(default_setting.keys()))
238231
for index in need_to_delete:
239232
current_setting.pop(index)
240-
default_setting.sorted()
241-
current_setting.sorted()
242-
default_setting.write()
243-
current_setting.write()
244-
return
233+
solved_setting = default_setting | current_setting
234+
with open(current_setting_file_path, encoding="utf-8_sig", mode="w") as f:
235+
json.dump(solved_setting, f, indent=4)
245236

246237

247238
def generate_search_engine_url(search_engine: str = "google", keyword: str = None, define: bool = False) -> str:

0 commit comments

Comments
 (0)