# run with -> python kpvtab.py # #[1] the first input is the dir location of the section to check (es. "/home/xxx/kernel/") # #[2] the "name for the link page" input create the link for the file, # for example, using "Hardy-kernel-drivers-ata-" the resulting tab section is: # [[ Hardy-kernel-drivers-ata-Kconfig | Kconfig ]] (for the "Konfig" file) import os, dircache from time import gmtime, strftime while 1: print "\n(digita 'esci' per uscire)" cercare=raw_input("\nPercorso della cartella in cui sono i files: ") #[1] if cercare=='esci': break name=raw_input("name for the link page: ") #[2] try: cartella = os.listdir(cercare) dircache.annotate(cercare,cartella) cartella.sort() print "\nFile:\n",">"*30 print "|| border=1\n||!Section||!Owner||!Date adopted (DD MMM YY)||!Total number of files in section (including README's etc.)||!Percentage of section completed||!Percentage of section certified free||!All suspected non-free software reported (Yes/ No or N/A if none to report)||!Date of summary (DD MMM YY)||" for x in cartella: a=str(name)+str(x) print "||[[",a,"|",x,"]]||[[~crap0101]]||", strftime("%d %b %y", gmtime()),"||1||100%||100%||n/a||", strftime("%d %b %y", gmtime()),"||\n" print ">"*30,"\n\nLa cartella '",cercare,"' contiene",len(cartella),"files/dir\n\n",">"*30,"\n" except:print "\n","-"*30,"\nQuesta cartella non esiste!!!\n","-"*30,"\n"