def deploy_package(self, package_id, session): dp = self.get_package(package_id, session) if is_archive_file(dp.payload_name) or is_python_file(dp.payload_name): return self._deploy_package(session, package_id, dp.payload_name, dp.payload) else: # This shouldn't really happen at all because the pickup notifier is to # filter such things out but life is full of surprises self._update_deployment_status(session, package_id, DEPLOYMENT_STATUS.IGNORED) self.logger.warn( 'Ignoring package id:`%s`, payload_name:`%s`, not a Python file nor an archive', dp.id, dp.payload_name)
def _should_process(self, event_name): """ Returns True if the file name's is either a Python source code file we can handle or an archive that can be uncompressed. """ return is_python_file(event_name) or is_archive_file(event_name)