def _download_links(self, links, directory):
        for link in links:
            if re.match(self.pattern, link):
                filename = os.path.join(directory, link.split('/')[-1])

                download = DownloadFile()
                download.get_file(link, filename)
Esempio n. 2
0
    def do(self):
        self.create_tmp_directory()

        # Download local file
        download = DownloadFile()
        download.get_file(self.url, os.path.join(self.temp_dir, self.filename))

        self.build()
        self.remove_tmp_directory()
    def do(self):
        # Download po files
        download = DownloadFile()
        download.get_file(self.url, self.filename)

        self._uncompress()
        self.build()

        if os.path.exists(self.filename):
            os.remove(self.filename)
    def do(self):
        self.create_tmp_directory()

        # Download local file
        download = DownloadFile()
        download.get_file(self.url, os.path.join(self.temp_dir, self.filename))

        self.convert_ts_files_to_po()
        self.add_comments()
        self.build()
        self.remove_tmp_directory()
Esempio n. 5
0
    def do(self):
        self.create_tmp_directory()

        # Download po files
        download = DownloadFile()
        download.get_file(self.url, self.filename)

        self._uncompress()
        self.build()

        if os.path.exists(self.filename):
            os.remove(self.filename)
        self.remove_tmp_directory()
    def do(self):
        self.create_tmp_directory()

        # Download po files
        download = DownloadFile()
        download.get_file(self.url, self.filename)

        self._uncompress()
        self.build()

        if os.path.exists(self.filename):
            os.remove(self.filename)
        self.remove_tmp_directory()
Esempio n. 7
0
    def do(self):
        # Download JSON file
        download = DownloadFile()
        download.get_file(self.url, self.filename)

        self._remove_first_line_from_file(self.filename)

        # The Gerrit project has a single fileset assigned (this)
        # We empty the fileset and add dynamically the ones referenced by Gerrit
        self.project.filesets = []

        with open(self.filename) as json_data:
            data = json.load(json_data)

            # Get every project entry
            for attribute, value in data.items():
                name = None
                url = None
                for prj_attribute, prj_value in value.iteritems():
                    if prj_attribute == 'name':
                        name = prj_value
                    elif prj_attribute == 'clone_url':
                        url = prj_value

                if not re.match(self.pattern, name):
                    logging.debug('GerritDirectoryFileSet. Discarding:' + name)
                    continue

                fileset = GitFileSet(self.project_name, name, url, '')

                # Some Android projects contain there own po files like
                # https://android.googlesource.com/platform/ndk and they have
                # the name standard "ca.po"
                # The rest are produced by a2po then they have the pattern '-ca.po'
                fileset.set_pattern('.*?ca.po')
                logging.debug("Gerrit adding {0}-{1}".format(
                    self.project_name, name))
                self.project.add(fileset)

        # All the new filesets have been added re-process project now
        logging.debug(
            'GerritDirectoryFileSet. Added {0} filesets dynamically'.format(
                len(self.project.filesets)))

        self.project.do()
    def do(self):
        # Download JSON file
        download = DownloadFile()
        download.get_file(self.url, self.filename)

        self._remove_first_line_from_file(self.filename)

        # The Gerrit project has a single fileset assigned (this)
        # We empty the fileset and add dynamically the ones referenced by Gerrit
        self.project.filesets = []

        with open(self.filename) as json_data:
            data = json.load(json_data)

            # Get every project entry
            for attribute, value in data.items():
                name = None
                url = None
                for prj_attribute, prj_value in value.iteritems():
                    if prj_attribute == 'name':
                        name = prj_value
                    elif prj_attribute == 'clone_url':
                        url = prj_value

                if not re.match(self.pattern, name):
                    logging.debug('GerritDirectoryFileSet. Discarding:' + name)
                    continue

                fileset = GitFileSet(self.project_name, name, url, '')

                # Some Android projects contain there own po files like
                # https://android.googlesource.com/platform/ndk and they have
                # the name standard "ca.po"
                # The rest are produced by a2po then they have the pattern '-ca.po'
                fileset.set_pattern('.*?ca.po')
                logging.debug("Gerrit adding {0}-{1}".format(self.project_name, name))
                self.project.add(fileset)

        # All the new filesets have been added re-process project now
        logging.debug('GerritDirectoryFileSet. Added {0} filesets dynamically'.
                      format(len(self.project.filesets)))

        self.project.do()
    def do(self):
        # Download local file
        download = DownloadFile()
        download.get_file(self.url, os.path.join(self.temp_dir, self.filename))

        self.build()