This file is indexed.

/usr/share/doc/viewmol/html/node28.html is in viewmol 2.4.1-24+b1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--****************************************************************************
*                                                                              *
*                                   Viewmol                                    *
*                                                                              *
*                            N O D E 2 8 . H T M L                             *
*                                                                              *
*                    Copyright (c) Joerg-R. Hill, October 2003                 *
*                                                                              *
********************************************************************************
*-->
<html>
<head>
<title>10.10 Installing Python scripts in the ``Run script" menu</title>
<META NAME="description" CONTENT="10.10 Installing Python scripts in the ``Run script" menu">
<META NAME="keywords" CONTENT="viewmol">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="STYLESHEET" href="viewmol.css">
<link rel="first" href="viewmol.html">

</head>
<body>
<H2><A NAME="SECTION00010100000000000000000">
10.10 Installing Python scripts in the ``Run script" menu</A>
</H2>
Python scripts can be installed as menu entries in the ``Run script" submenu.
For this to work the Python script needs to implement a class with the
same name as the script. This class needs to provide at least the
methods <code>register</code> and <code>run</code>. The <code>register</code> method
is passed a language setting as abbreviation of a locale (currently
<code>en_US</code>, <code>fr</code>, <code>de</code>, <code>hu</code>,
<code>pl</code>, <code>ru</code>, or <code>es</code>). The method
needs to call the <code>registerMenuItem</code> function implemented in the
<code>viewmol</code> module to pass a string back which will appear as the
identification of this script in the submenu.

<P>
The <code>run</code> method does not take any argument, but is the entry
point for the script when the user selects the corresponding menu
item in the ``Run script" submenu.

<P>
A minimal Python script which will install itself in the ``Run script"
menu would be the following (available at <code>$VIEWMOLPATH/scripts/template.py</code>):
<dl><dd><pre class="verbatim">
import viewmol

class template:
  def run(self):
    print "This is a script template which just prints this silly message."

  def register(self, language):
    viewmol.registerMenuItem("Script template")

# The following three lines are not necessary for running this script
# from the "Run script" menu, but allow the script to also be run
# standalone
if __name__ == '__main__':
  script=template()
  script.run()
</pre></dl>

<P>
All scripts which are to appear in the ``Run script" menu have to be
installed in the <code>scripts</code> subdirectory under <code>VIEWMOLPATH</code>.

<P>

<p><hr>
<ADDRESS>
<a href="mailto:joehill@users.sourceforge.net"><i>J&ouml;rg-R&uuml;diger Hill</i></a> Fri Oct 31 14:19:21 CET 2003
</ADDRESS>
</BODY>
</HTML>