~0x44/nova/bug838466

« back to all changes in this revision

Viewing changes to tools/ajaxterm/configure

  • Committer: Eric Day
  • Date: 2010-10-21 18:49:51 UTC
  • mto: This revision was merged to the branch mainline in revision 377.
  • Revision ID: eday@oddments.org-20101021184951-x0vs3s8y7mc0aeyy
PEP8 and pylint cleanup. There should be no functional changes here, just style changes to get violations down.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env python
2
 
 
3
 
import optparse,os
4
 
 
5
 
parser = optparse.OptionParser()
6
 
parser.add_option("", "--prefix", dest="prefix",default="/usr/local",help="installation prefix (default: /usr/local)")
7
 
parser.add_option("", "--confdir", dest="confdir", default="/etc",help="configuration files directory prefix (default: /etc)")
8
 
parser.add_option("", "--port", dest="port", default="8022", help="set the listening TCP port (default: 8022)")
9
 
parser.add_option("", "--command", dest="cmd", default=None,help="set the command (default: /bin/login or ssh localhost)")
10
 
(o, a) = parser.parse_args()
11
 
 
12
 
print "Configuring prefix=",o.prefix," port=",o.port
13
 
 
14
 
etc=o.confdir
15
 
port=o.port
16
 
cmd=o.cmd
17
 
bin=os.path.join(o.prefix,"bin")
18
 
lib=os.path.join(o.prefix,"share/ajaxterm")
19
 
man=os.path.join(o.prefix,"share/man/man1")
20
 
 
21
 
file("ajaxterm.bin","w").write(file("configure.ajaxterm.bin").read()%locals())
22
 
file("Makefile","w").write(file("configure.makefile").read()%locals())
23
 
 
24
 
if os.path.isfile("/etc/gentoo-release"):
25
 
        file("ajaxterm.initd","w").write(file("configure.initd.gentoo").read()%locals())
26
 
elif os.path.isfile("/etc/fedora-release") or os.path.isfile("/etc/redhat-release"):
27
 
        file("ajaxterm.initd","w").write(file("configure.initd.redhat").read()%locals())
28
 
else:
29
 
        file("ajaxterm.initd","w").write(file("configure.initd.debian").read()%locals())
30
 
 
31
 
os.system("chmod a+x ajaxterm.bin")
32
 
os.system("chmod a+x ajaxterm.initd")