~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/scripts/utilities/js/jssize.py

  • Committer: Curtis Hovey
  • Date: 2011-07-15 15:55:34 UTC
  • mto: This revision was merged to the branch mainline in revision 13449.
  • Revision ID: curtis.hovey@canonical.com-20110715155534-2wbp8yjgvzx1zr2k
Removed jssize because it only exists for windmill which was removed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env python
2
 
# Copyright 2010 Canonical Ltd.  This software is licensed under the
3
 
# GNU Affero General Public License version 3 (see the file LICENSE).
4
 
 
5
 
"""Script to check the size of the generated javascript.
6
 
 
7
 
This script tests to ensure optimized javascript never gets over a certain
8
 
size.  If it gets too big, Windmill has issues. This is a hack until we can
9
 
find out why Windmill has such issues.
10
 
"""
11
 
 
12
 
import os
13
 
 
14
 
 
15
 
FILE_NAME = 'lib/canonical/launchpad/icing/build/launchpad.js'
16
 
MAX_FILE_SIZE = 512 * 1024
17
 
 
18
 
def main():
19
 
    size = os.path.getsize(FILE_NAME)
20
 
    if size > MAX_FILE_SIZE:
21
 
        raise Exception(
22
 
            'launchpad.js is greater than %d bytes' % MAX_FILE_SIZE)