hier ein Versuch os-unabhängig ein MANIFEST-file für distutils automatisch zu generieren.
Code: Alles auswählen
def produce_manifest():
"""produce MANIFEST file with all files in the project"""
try:
manifest = open('MANIFEST', 'w')
except IOError, msg:
raise IOError(msg)
depth = len(os.getcwd().split(os.sep))
for root, dirs, files in os.walk(os.getcwd()):
# ignore hidden dirs and files, particularly of svn
if '.' in root:
continue
for fname in files:
manifest.write(os.sep.join(os.path.join(root, fname).split(os.sep)[depth:]) + os.linesep)
manifest.close()
Gruß,
Christian
PS Die Funktion ist Teil meines setup-Skripts, wobei das Skript und das MANIFEST-File im Hauptprojektordner sind - der Odner kann natürlich bei jedem, der das Download macht, eine andere relative Position haben.