Skip to content

Commit 63900ed

Browse files
author
Bill Majoros
committedOct 8, 2016
new-python-class.py
1 parent 35ec03b commit 63900ed

File tree

4 files changed

+74
-2
lines changed

4 files changed

+74
-2
lines changed
 

‎FastaReader.py

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#=========================================================================
2+
# This is OPEN SOURCE SOFTWARE governed by the Gnu General Public
3+
# License (GPL) version 3, as described at www.opensource.org.
4+
# Copyright (C)2016 William H. Majoros (martiandna@gmail.com).
5+
#=========================================================================
6+
from __future__ import (absolute_import, division, print_function
7+
unicode_literals, generators, nested_scopes, with_statement)
8+
from builtins import (bytes, dict, int, list, object, range, str, ascii,
9+
chr, hex, input, next, oct, open, pow, round, super, filter, map, zip)
10+
11+
#=========================================================================
12+
# Attributes:
13+
#
14+
# Methods:
15+
# FastaReader()
16+
#=========================================================================
17+
class FastaReader:
18+
"""FastaReader"""
19+
def __init__(self):
20+
pass
21+
22+
23+

‎Interval.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/bin/env python
21
#=========================================================================
32
# This is OPEN SOURCE SOFTWARE governed by the Gnu General Public
43
# License (GPL) version 3, as described at www.opensource.org.

‎TempFilename.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/bin/env python
21
#=========================================================================
32
# This is OPEN SOURCE SOFTWARE governed by the Gnu General Public
43
# License (GPL) version 3, as described at www.opensource.org.

‎new-python-class.py

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/bin/env python
2+
#=========================================================================
3+
# This is OPEN SOURCE SOFTWARE governed by the Gnu General Public
4+
# License (GPL) version 3, as described at www.opensource.org.
5+
# Copyright (C)2016 William H. Majoros (martiandna@gmail.com).
6+
#=========================================================================
7+
from __future__ import (absolute_import, division, print_function,
8+
unicode_literals, generators, nested_scopes, with_statement)
9+
from builtins import (bytes, dict, int, list, object, range, str, ascii,
10+
chr, hex, input, next, oct, open, pow, round, super, filter, map, zip)
11+
import os
12+
import sys
13+
import ProgramName
14+
15+
# Process command line
16+
name=ProgramName.get();
17+
if(len(sys.argv)!=2):
18+
sys.exit(name+" <classname>")
19+
className=sys.argv[1]
20+
21+
# Write file
22+
filename=className+".py"
23+
if(os.path.exists(filename)):
24+
sys.exit(filename+" exists");
25+
fh=open(filename,"w")
26+
header="\n".join(["#=========================================================================",
27+
"# This is OPEN SOURCE SOFTWARE governed by the Gnu General Public",
28+
"# License (GPL) version 3, as described at www.opensource.org.",
29+
"# Copyright (C)2016 William H. Majoros (martiandna@gmail.com).",
30+
"#=========================================================================",
31+
"from __future__ import (absolute_import, division, print_function",
32+
" unicode_literals, generators, nested_scopes, with_statement)",
33+
"from builtins import (bytes, dict, int, list, object, range, str, ascii,",
34+
" chr, hex, input, next, oct, open, pow, round, super, filter, map, zip)",
35+
"\n"
36+
"#=========================================================================",
37+
"# Attributes:",
38+
"# ",
39+
"# Methods:",
40+
"# "+className+"()",
41+
"#=========================================================================\n",
42+
])
43+
fh.write(header)
44+
fh.write("class "+className+":\n")
45+
fh.write(" \"\"\""+className+"\"\"\"\n");
46+
fh.write(" def __init__(self):\n")
47+
fh.write(" pass\n")
48+
fh.write("\n\n\n")
49+
fh.close()
50+
51+

0 commit comments

Comments
 (0)