You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@community.apache.org by se...@apache.org on 2015/09/22 21:11:32 UTC

svn commit: r1704694 - /comdev/projects.apache.org/scripts/import/parsecommittees.py

Author: sebb
Date: Tue Sep 22 19:11:29 2015
New Revision: 1704694

URL: http://svn.apache.org/viewvc?rev=1704694&view=rev
Log:
Allow script to create missing directories

Modified:
    comdev/projects.apache.org/scripts/import/parsecommittees.py

Modified: comdev/projects.apache.org/scripts/import/parsecommittees.py
URL: http://svn.apache.org/viewvc/comdev/projects.apache.org/scripts/import/parsecommittees.py?rev=1704694&r1=1704693&r2=1704694&view=diff
==============================================================================
--- comdev/projects.apache.org/scripts/import/parsecommittees.py (original)
+++ comdev/projects.apache.org/scripts/import/parsecommittees.py Tue Sep 22 19:11:29 2015
@@ -131,7 +131,13 @@ for s in itemlist :
             mode = "w"
         else:
             mode = "wb"
-        with open("../../site/doap/%s/pmc-doap.rdf" % committeeId, mode) as f:
+        path = "../../site/doap/%s" % committeeId
+        try:
+            os.stat(path)
+        except:
+            print("INFO: creating new directory %s for %s" % (path, url))
+            os.mkdir(path)
+        with open("%s/pmc-doap.rdf" % path, mode) as f:
             f.write(rdf)
             f.close()