def setup_config(self): # Get revision information. revision = util.query_revision() if revision is None: revisionURL = 'unknown' revisionNum = '0000' revision = 'unknown' else: revisionURL, revisionNum = revision revision = '%s - %s' % revision # Inject the revision number into app.config.template to get app.config. appConfigTemplatePath = os.path.join(ROOT_DIR, 'resources/app.config.template') self.appConfigPath = os.path.join(ROOT_DIR, 'resources/app.config') self.fillTemplate(appConfigTemplatePath, self.appConfigPath, BUILD_MACHINE="%s@%s" % (os.getlogin(), os.uname()[1]), BUILD_TIME=str(time.time()), APP_REVISION = revision, APP_REVISION_URL = revisionURL, APP_REVISION_NUM = revisionNum, APP_PLATFORM = 'osx') if self.theme is not None: if not os.path.exists(self.theme): raise DistutilsFileError, "theme file %s not found" % self.theme else: print "Using theme %s" % self.theme self.config = Config(self.appConfigPath, self.theme)
def install_app_config(self): template = os.path.join(resources_dir, 'app.config.template') dest = os.path.join(self.install_dir, 'resources', 'app.config') revision = util.query_revision() if revision is None: revision = "unknown" revisionurl = "unknown" revisionnum = "unknown" else: revisionurl = revision[0] revisionnum = revision[1] revision = "%s - %s" % revision print "Using %s" % revisionnum self.mkpath(os.path.dirname(dest)) # We don't use the dist utils copy_file() because it only # copies the file if the timestamp is newer fill_template(template, dest, APP_REVISION=revision, APP_REVISION_NUM=revisionnum, APP_REVISION_URL=revisionurl, APP_PLATFORM='windows', BUILD_MACHINE="%s@%s" % (os.environ['username'], socket.gethostname()), BUILD_TIME=str(time.time())) self.outfiles.append(dest)
def install_app_config(self): template = os.path.join(resources_dir, 'app.config.template') dest = os.path.join(self.install_dir, 'resources', 'app.config') revision = util.query_revision() if revision is None: revision = "unknown" revisionurl = "unknown" revisionnum = "unknown" else: revisionurl = revision[0] revisionnum = revision[1] revision = "%s - %s" % revision print "Using %s" % revisionnum self.mkpath(os.path.dirname(dest)) # We don't use the dist utils copy_file() because it only # copies the file if the timestamp is newer fill_template(template, dest, APP_REVISION=revision, APP_REVISION_NUM=revisionnum, APP_REVISION_URL=revisionurl, APP_PLATFORM='windows', BUILD_MACHINE="%s@%s" % (os.environ['username'], socket.gethostname()), BUILD_TIME=str(time.time())) self.outfiles.append(dest)
def setup_config(self): # Get revision information. revision = util.query_revision() if revision is None: revisionURL = 'unknown' revisionNum = '0000' revision = 'unknown' else: revisionURL, revisionNum = revision revision = '%s - %s' % revision # Inject the revision number into app.config.template to get app.config. appConfigTemplatePath = os.path.join(ROOT_DIR, 'resources/app.config.template') self.appConfigPath = os.path.join(ROOT_DIR, 'resources/app.config') self.fillTemplate(appConfigTemplatePath, self.appConfigPath, BUILD_MACHINE="%s@%s" % (os.getlogin(), os.uname()[1]), BUILD_TIME=str(time.time()), APP_REVISION = revision, APP_REVISION_URL = revisionURL, APP_REVISION_NUM = revisionNum, APP_PLATFORM = 'osx') if self.theme is not None: if not os.path.exists(self.theme): raise DistutilsFileError, "theme file %s not found" % self.theme else: print "Using theme %s" % self.theme self.config = Config(self.appConfigPath, self.theme)
def install_app_config(self): source = os.path.join(resource_dir, 'app.config.template') dest = '/usr/share/miro/resources/app.config' config_file = util.read_simple_config_file(source) print "Trying to figure out the git revision...." if config_file["appVersion"].endswith("git"): revision = util.query_revision() if revision is None: revision = "unknown" revisionurl = "unknown" revisionnum = "unknown" else: revisionurl = revision[0] revisionnum = revision[1] revision = "%s - %s" % (revisionurl, revisionnum) else: revisionurl = "" revisionnum = "" revision = "" print "Using %s" % revisionnum if self.root: dest = change_root(self.root, dest) self.mkpath(os.path.dirname(dest)) # We don't use the dist utils copy_file() because it only copies # the file if the timestamp is newer shutil.copyfile(source, dest) expand_file_contents(dest, APP_REVISION=revision, APP_REVISION_NUM=revisionnum, APP_REVISION_URL=revisionurl, APP_PLATFORM='linux', BUILD_MACHINE="%s@%s" % (getlogin(), os.uname()[1]), BUILD_TIME=str(time.time()), MOZILLA_LIB_PATH="") self.outfiles.append(dest) locale_dir = os.path.join(resource_dir, "locale") for source in glob(os.path.join(locale_dir, "*.mo")): lang = os.path.basename(source)[:-3] if 'LINGUAS' in os.environ and lang not in os.environ['LINGUAS']: continue dest = '/usr/share/locale/%s/LC_MESSAGES/miro.mo' % lang if self.root: dest = change_root(self.root, dest) self.mkpath(os.path.dirname(dest)) self.copy_file(source, dest) self.outfiles.append(dest)
def install_app_config(self): source = os.path.join(resource_dir, 'app.config.template') dest = '/usr/share/miro/resources/app.config' config_file = util.read_simple_config_file(source) print "Trying to figure out the git revision...." if config_file["appVersion"].endswith("git"): revision = util.query_revision() if revision is None: revision = "unknown" revisionurl = "unknown" revisionnum = "unknown" else: revisionurl = revision[0] revisionnum = revision[1] revision = "%s - %s" % (revisionurl, revisionnum) else: revisionurl = "" revisionnum = "" revision = "" print "Using %s" % revisionnum if self.root: dest = change_root(self.root, dest) self.mkpath(os.path.dirname(dest)) # We don't use the dist utils copy_file() because it only copies # the file if the timestamp is newer shutil.copyfile(source, dest) expand_file_contents(dest, APP_REVISION=revision, APP_REVISION_NUM=revisionnum, APP_REVISION_URL=revisionurl, APP_PLATFORM='linux', BUILD_MACHINE="%s@%s" % (getlogin(), os.uname()[1]), BUILD_TIME=str(time.time()), MOZILLA_LIB_PATH="") self.outfiles.append(dest) locale_dir = os.path.join (resource_dir, "locale") for source in glob (os.path.join (locale_dir, "*.mo")): lang = os.path.basename(source)[:-3] if 'LINGUAS' in os.environ and lang not in os.environ['LINGUAS']: continue dest = '/usr/share/locale/%s/LC_MESSAGES/miro.mo' % lang if self.root: dest = change_root(self.root, dest) self.mkpath(os.path.dirname(dest)) self.copy_file(source, dest) self.outfiles.append(dest)