def push(self):
        dirs, files = default_storage.listdir(self.forms_path)
        for form_dir in dirs:
            dir_path = os.path.join(self.forms_path, form_dir)
            form_dirs, form_files = default_storage.listdir(dir_path)
            form_xml = '%s.xml' % form_dir
            if form_xml in form_files:
                form_xml_path = os.path.join(dir_path, form_xml)
                x = self._upload_xform(form_xml_path, form_xml)
                if isinstance(x, dict):
                    self.logger.error("Failed to publish %s" % form_dir)
                else:
                    self.logger.debug("Successfully published %s" % form_dir)
            if 'instances' in form_dirs:
                self.logger.debug("Uploading instances")
                c = self._upload_instances(os.path.join(dir_path, 'instances'))
                self.logger.debug("Published %d instances for %s" %
                                  (c, form_dir))
dataset/ETHPy150Open kobotoolbox/kobocat/onadata/libs/utils/briefcase_client.py/BriefcaseClient.push/original