def commit(self, *commands): log.info("Commit files") for cmd in commands: kwargs = {'cwd': self.dest_dir} try: run(cmd, **kwargs) except RunError, err: log.error(err)
def init_tx_client_resources(self): """ Initialize Transifex client resources """ resources = VCSResource.objects.filter(vcs_project=self.pk) for resource in resources: command = ['tx', 'set', '--execute', '--auto-local', '-r', '%s.%s' % (self.tx_project.slug, resource.tx_resource.slug), '-s', self.tx_source_language.code, '-f', resource.vcs_source_language_file, u"%s" % resource.vcs_language_map ] run(command, **{'cwd': self.destdir()})
def update(self, *commands): log.info("Updating repo %s" % (self.dest_dir)) for cmd in commands: run(cmd)
def checkout(self, *commands): log.info("Checkout project in %s" % (self.dest_dir)) for cmd in commands: run(cmd)
def pull(self, language): """ Pull resource file from Transifex in the selected language """ command = ['tx', 'pull', '-f', '-r', '%s.%s' % (self.vcs_project.tx_project.slug, self.tx_resource.slug), '-l', language.code] run(command, **{'cwd': self.vcs_project.destdir()})
def init_tx_client(self): """ Initialize Transifex client for VCS project """ if not os.path.exists(os.path.join(self.destdir(), '.tx', 'config')): command = ['tx', 'init', '--host', TX_HOST, '--user', TX_USER, '--pass', TX_PASS] run(command, **{'cwd': self.destdir()})