File: xbb_help.py

package info (click to toggle)
python-biopython 1.78%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 65,756 kB
  • sloc: python: 221,141; xml: 178,777; ansic: 13,369; sql: 1,208; makefile: 131; sh: 70
file content (104 lines) | stat: -rw-r--r-- 3,209 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/usr/bin/env python
# Copyright 2000 by Thomas Sicheritz-Ponten.
# Copyrigth 2016 by Markus Piotrowski.
# All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license.  Please see the LICENSE file that should have been included
# as part of this package.

# Created: Tue Sep  4 09:05:16 2001
# thomas@cbs.dtu.dk, http://www.cbs.dtu.dk/thomas

"""Help code for graphical Xbbtools tool."""

import tkinter as tk
from tkinter import scrolledtext


class xbbtools_help(tk.Toplevel):
    """Help window."""

    def __init__(self, *args):
        """Make toplevel help window."""
        tk.Toplevel.__init__(self)
        self.tid = scrolledtext.ScrolledText(self)
        self.tid.pack(fill=tk.BOTH, expand=1)
        self.Styles()
        self.Show()

    def Styles(self):
        """Define text styles."""
        for c in [
            "red",
            "blue",
            "magenta",
            "yellow",
            "green",
            "red4",
            "green4",
            "blue4",
        ]:
            self.tid.tag_configure(c, foreground=c)

        self.tid.tag_config("underline", underline=1)
        self.tid.tag_config("italic", font=("Courier", 6, "italic"))
        self.tid.tag_config("bold", font=("Courier", 8, "bold"))
        self.tid.tag_config("title", font=("Courier", 12, "bold"))
        self.tid.tag_config("small", font=("Courier", 6, ""))
        self.tid.tag_config("highlight", background="gray")

    def Show(self):
        """Display help text."""
        t = self.tid
        t.insert(tk.END, "XBBtools Help\n", "title")
        t.insert(
            tk.END,
            """
Copyright 2001 by Thomas Sicheritz-Ponten.
Modified 2016 by Markus Piotrowski.
All rights reserved.
This code is part of the Biopython distribution and governed by its
license.  Please see the LICENSE file that should have been included
as part of this package.\n
""",
            "italic",
        )
        t.insert(tk.END, "thomas@biopython.org\n\n", "blue")
        t.insert(tk.END, "* Goto Field\n", "bold")
        t.insert(tk.END, "\tinserting one position moves cursor to position\n")
        t.insert(tk.END, "\tinserting two positions, separated by ':' ")
        t.insert(tk.END, "highlights", "highlight")
        t.insert(tk.END, " selected range\n")
        t.insert(tk.END, "\n")
        t.insert(tk.END, "* Search\n", "bold")
        t.insert(tk.END, "\tambiguous dna values are\n")
        t.insert(
            tk.END,
            """
                A: A
                C: C
                G: G
                T: T
                M: AC
                R: AG
                W: AT
                S: CG
                Y: CT
                K: GT
                V: ACG
                H: ACT
                D: AGT
                B: CGT
                X: GATC
                N: GATC
                """,
            "small",
        )
        t.insert(tk.END, "\n")
        t.insert(tk.END, "* BLAST\n", "bold")
        t.insert(
            tk.END,
            "\tto use the 'Blast' option, you need to have the "
            "BLAST binaries installed\n\tand at least one database in "
            "BLAST format",
        )