File: makeappletlist.py

package info (click to toggle)
p4vasp 0.3.30%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 6,504 kB
  • sloc: python: 37,179; cpp: 13,894; ansic: 2,076; makefile: 377; sql: 207; xml: 102; sh: 13
file content (20 lines) | stat: -rw-r--r-- 584 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
from glob import *
from os.path import join,split

def applets(path):
    modules=[]
    for x in glob(join(path,"*Applet.py")):
        l=["p4vasp","applet"]
        s=split(x)[1].replace(".py","")
        if s not in ["Applet"]:
            l.append(s)
            l.append(s)
            modules.append(".".join(l))
    return sorted(modules)

f=open(join("..","lib","p4vasp","applet","appletlist.py"),"w")
f.write("def appletlist():\n")
f.write("  return [\n")
app=applets(join("..","lib","p4vasp","applet"))
f.write(",\n".join(map(lambda x:"    '%s'"%x,app)))
f.write("\n  ]\n")