~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to utilities/create-lp-wadl-and-apidoc.py

  • Committer: Gary Poster
  • Date: 2011-07-07 20:07:36 UTC
  • mto: This revision was merged to the branch mainline in revision 13394.
  • Revision ID: gary.poster@canonical.com-20110707200736-7a1h1ec9fc6koqrd
lint

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
    % LPCONFIG=development bin/py utilities/create-lp-wadl-and-apidoc.py \\
11
11
      "lib/canonical/launchpad/apidoc/wadl-development-%(version)s.xml"
12
12
"""
13
 
import _pythonpath # Not lint, actually needed.
 
13
import _pythonpath  # Not lint, actually needed.
14
14
 
15
15
from multiprocessing import Process
16
16
import optparse
26
26
    generate_html,
27
27
    generate_json,
28
28
    generate_wadl,
29
 
    ) 
 
29
    )
30
30
from canonical.launchpad.scripts import execute_zcml_for_scripts
31
31
from canonical.launchpad.systemhomes import WebServiceApplication
32
32
from lazr.restful.interfaces import IWebServiceConfiguration
37
37
    f = open(filename, 'w')
38
38
    f.write(content)
39
39
    f.close()
40
 
    os.utime(filename, (timestamp, timestamp)) # (atime, mtime)
 
40
    os.utime(filename, (timestamp, timestamp))  # (atime, mtime)
 
41
 
41
42
 
42
43
def make_files(directory, version, timestamp, force):
43
44
    version_directory = os.path.join(directory, version)
98
99
    # We support that here.
99
100
    if not os.path.exists(brokenwadl_index):
100
101
        os.symlink(os.path.basename(wadl_index), brokenwadl_index)
101
 
    
 
102
 
102
103
    # Now, convert the WADL into an human-readable description and
103
104
    # put the HTML in the same directory as the WADL.
104
105
    # If the HTML file doesn't exist or we're being forced to regenerate
120
121
 
121
122
 
122
123
def main(directory, force=False):
123
 
    WebServiceApplication.cached_wadl = None # do not use cached file version
 
124
    WebServiceApplication.cached_wadl = None  # do not use cached file version
124
125
    execute_zcml_for_scripts()
125
126
    config = getUtility(IWebServiceConfiguration)
126
127