File: xbb_help.py

package info (click to toggle)
python-biopython 1.68%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 46,860 kB
  • ctags: 13,237
  • sloc: python: 160,306; xml: 93,216; ansic: 9,118; sql: 1,208; makefile: 155; sh: 63
file content (83 lines) | stat: -rw-r--r-- 2,965 bytes parent folder | download | duplicates (2)
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
#!/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
# File: xbb_help.py

try:  # Python 2
    import Tkinter as tk
    import ScrolledText as scrolledtext
except ImportError:  # Python 3
    import tkinter as tk
    from tkinter import scrolledtext


class xbbtools_help(tk.Toplevel):
    def __init__(self, *args):
        tk.Toplevel.__init__(self)
        self.tid = scrolledtext.ScrolledText(self)
        self.tid.pack(fill=tk.BOTH, expand=1)
        self.Styles()
        self.Show()

    def Styles(self):
        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):
        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, seperated 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")