Passed
Push — master ( 3731d5...59a60b )
by Yoshihiro
02:04
created

EM.EditMenuClass.redo()   A

Complexity

Conditions 1

Size

Total Lines 10
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nop 2
dl 0
loc 10
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
#!/usr/bin/env python3
2 1
class EditMenuClass():
3
    """編集メニューバーのクラス.
4
5
    ・編集メニューバーにあるプログラム群
6
7
    Args:
8
        app (instance): MainProcessingClassインスタンス
9
10
    """
11 1
    def __init__(self, app):
12 1
        self.APP = app
13
14 1
    def redo(self, event=None):
15
        """Redo.
16
17
        ・Redo処理を行う。
18
19
        Args:
20
            event (instance): tkinter.Event のインスタンス
21
22
        """
23 1
        self.APP.text.edit_redo()
24
25 1
    def undo(self, event=None):
26
        """Undo.
27
28
        ・Uedo処理を行う。
29
30
        Args:
31
            event (instance): tkinter.Event のインスタンス
32
33
        """
34 1
        self.APP.text.edit_undo()
35
36 1
    def copy(self, event=None):
37
        """Copy.
38
39
        ・Copy処理を行う。
40
41
        Args:
42
            event (instance): tkinter.Event のインスタンス
43
44
        """
45 1
        self.APP.clipboard_clear()
46 1
        self.APP.clipboard_append(self.APP.text.selection_get())
47
48 1
    def cut(self, event=None):
49
        """Cut.
50
51
        ・Cut処理を行う。
52
53
        Args:
54
            event (instance): tkinter.Event のインスタンス
55
56
        """
57 1
        self.copy()
58 1
        self.APP.text.delete("sel.first", "sel.last")
59
60 1
    def paste(self, event=None):
61
        """Paste.
62
63
        ・Paste処理を行う。
64
65
        Args:
66
            event (instance): tkinter.Event のインスタンス
67
68
        """
69
        self.APP.text.insert('insert', self.APP.clipboard_get())
70