Total Complexity | 4 |
Total Lines | 45 |
Duplicated Lines | 0 % |
Coverage | 78.26% |
Changes | 0 |
1 | 1 | import platform |
|
2 | 1 | import tkinter as tk |
|
3 | 1 | import tkinter.ttk as ttk |
|
4 | |||
5 | 1 | import i18n |
|
6 | 1 | from . import data |
|
7 | |||
8 | |||
9 | 1 | class MainClass(ttk.Frame): |
|
10 | """メインクラス. |
||
11 | |||
12 | 定数を定義しておくプログラム群 |
||
13 | |||
14 | Args: |
||
15 | locale_var (str): ロケーション |
||
16 | master (instance): toplevel のインスタンス |
||
17 | """ |
||
18 | 1 | def __init__(self, locale_var, master=None): |
|
19 | 1 | super().__init__(master) |
|
20 | 1 | self.dic = i18n.initialize(locale_var) |
|
21 | 1 | self.TREE_FOLDER = [ |
|
22 | ['data/character', self.dic.get_dict("Character")], |
||
23 | ['data/occupation', self.dic.get_dict("Occupation")], |
||
24 | ['data/space', self.dic.get_dict("Space")], |
||
25 | ['data/event', self.dic.get_dict("Event")], |
||
26 | ['data/image', self.dic.get_dict("Image")], |
||
27 | ['data/nobel', self.dic.get_dict("Novel")] |
||
28 | ] |
||
29 | 1 | self.TITLE_BINARY = data.TITLE_BINARY |
|
30 | 1 | self.BLANK_IMAGE = data.BLANK_IMAGE |
|
31 | 1 | self.VERSION = data.__version__ |
|
32 | # メニューバーの作成 |
||
33 | 1 | self.menu_bar = tk.Menu(master) |
|
34 | 1 | self.master.config(menu=self.menu_bar) |
|
35 | # フォントをOSごとに変える |
||
36 | 1 | pf = platform.system() |
|
37 | 1 | if pf == 'Windows': |
|
38 | 1 | self.font = "メイリオ" |
|
39 | elif pf == 'Darwin': # MacOS |
||
40 | self.font = "Osaka-等幅" |
||
41 | elif pf == 'Linux': |
||
42 | self.font = "IPAゴシック" |
||
43 | else: |
||
44 | self.font = "" |
||
45 |