Changeset 661

Show
Ignore:
Timestamp:
2007-12-04 16:02:37 (1 year ago)
Author:
MaierMan
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • tools/make.py

    r506 r661  
    3232locales_file = 'locales.tar.gz' 
    3333update_url = 'http://code.downthemall.net/nightly/update.rdf' 
    34  
    35 release_id = '{DDC359D1-844A-42a7-9AA1-88A850A938A8}' 
    3634 
    3735xpi_file = 'downthemall.xpi' 
     
    6159            yield "nightlifying" 
    6260            self.nightlify(update_url) 
    63         if self.opts.release
    64             yield "releasifying
    65             self.releasify() 
     61        if self.opts.extid
     62            yield "setting the extension id
     63            self.setId() 
    6664        if self.opts.nocomments: 
    6765            yield "stripping comments" 
     
    149147        f.close()        
    150148 
    151     def releasify(self): 
    152         global release_id 
     149    def setId(self): 
    153150        rdf = xml_open('%s/install.rdf' % self.opts.exportTo) 
    154151 
    155         'update the version
     152        'update the id
    156153        node = rdf.getElementsByTagName('id')[0].childNodes[0] 
    157         node.data = release_id 
     154        node.data = self.opts.extid 
    158155 
    159156        'save' 
     
    165162        f.close() 
    166163 
    167         f = open('%s/chrome/content/common/verinfo.js' % self.opts.exportTo) 
    168         lines = f.readlines() 
    169         f.close() 
    170         f = open('%s/chrome/content/common/verinfo.js' % self.opts.exportTo, 'wb') 
    171         for l in lines: 
    172             if re.search('const DTA_ID', l): 
    173                 l = "const DTA_ID = '%s';\n" % release_id 
    174             f.write(l) 
    175         f.close() 
     164        vi = '%s/chrome/content/common/verinfo.js' % self.opts.exportTo; 
     165 
     166        if os.path.exists(vi): 
     167            f = open(vi) 
     168            lines = f.readlines() 
     169            f.close() 
     170            f = open(vi, 'wb') 
     171            for l in lines: 
     172                if re.search('const DTA_ID', l): 
     173                    l = "const DTA_ID = '%s';\n" % self.opts.extid 
     174                f.write(l) 
     175            f.close() 
     176             
    176177    def jar(self): 
    177178        f = open('%s/chrome.manifest' % self.opts.exportTo) 
     
    180181        f = open('%s/chrome.manifest' % self.opts.exportTo, 'wb') 
    181182        for l in lines: 
    182             l = re.sub(r'(\s)chrome/', r'\1jar:chrome/dta.jar!/', l); 
     183            l = re.sub(r'(\s)chrome/', r'\1jar:chrome/chrome.jar!/', l); 
    183184            f.write(l) 
    184185        f.close() 
     
    193194            if path.isdir(f): 
    194195                dirs += f, 
    195         jar_file = ZipFile(p + "/dta.jar", 'w', ZIP_STORED) 
     196        jar_file = ZipFile(p + "/chrome.jar", 'w', ZIP_STORED) 
    196197        for d in dirs: 
    197198            for x in self.getfilelist(d): 
     
    290291        '--release', 
    291292        dest='release', 
    292         help='is a release', 
    293         action='store_true', 
    294         default=False 
    295         )        
     293        help='Is a release', 
     294        action='store_true', 
     295        default=False 
     296        ) 
     297    parser.add_option( 
     298        '--extid', 
     299        dest='extid', 
     300        help='Set the extension id', 
     301        type='string' 
     302        )     
    296303    parser.add_option( 
    297304        '--nocomment',