Merge reactormixins-4987
[twisted.git] / admin / update-documentation.py
blobd53f00df5582c436384ee94f5335893baf3b82bc
1 #!/usr/bin/env python
2 # Copyright (c) Twisted Matrix Laboratories.
3 # See LICENSE for details.
5 import sys
6 from twisted.python import filepath
8 def updateDocumentation(project, twistedCheckoutPath, websiteCheckoutPath):
9 """
10 Copy documentation for a particular project out of the craphole where lore
11 dumps it, and into a WebSite working copy.
13 @param generatedDocPath: The path to the root of a Twisted checkout, ie
14 ~/Projects/Twisted/tags/releases/TwistedWeb/0.5.x/
16 @param websiteCheckoutPath: The path to the root of a WebSite checkout, ie
17 ~/Projects/WebSite/branches/update-web-docs-123/
18 """
19 docPath = twistedCheckoutPath.child('doc').child(project)
20 minusSVN = docPath.temporarySibling()
21 docPath.copyTo(minusSVN)
22 for child in minusSVN.walk():
23 if child.basename() == '.svn':
24 child.remove()
26 minusSVN.copyTo(websiteCheckoutPath.child('vhosts').child('twistedmatrix.com').child('projects').child(project).child('documentation'))
27 minusSVN.remove()
30 if __name__ == '__main__':
31 if len(sys.argv) != 4:
32 raise SystemExit("Usage: %s <project> <twisted checkout root> <website checkout root>" % (sys.argv[0],))
33 updateDocumentation(sys.argv[1], filepath.FilePath(sys.argv[2]), filepath.FilePath(sys.argv[3]))