def save_debug_info(self, json_info, platform, kind): text = json.dumps(json_info) s3.save_file('builds', self.get_debug_info_filename(platform, kind), text, public=True, content_type='application/json')
def save_debug_info(self, json_info): text = json.dumps(json_info) if not settings.AWS_ENABLED: with open(self.debug_info, 'w') as f: f.write(text) else: s3.save_file('builds', self.debug_info, text, public=True, content_type='application/json')
def save_string(self, string): if not settings.AWS_ENABLED: self._save_string_local(string) else: s3.save_file(self.bucket_name, self.s3_path, string) if self.project: self.project.last_modified = now() self.project.save()
def save_string(self, string): if not settings.AWS_ENABLED: if not os.path.exists(os.path.dirname(self.local_filename)): os.makedirs(os.path.dirname(self.local_filename)) with open(self.local_filename, 'wb') as out: out.write(string) else: s3.save_file('source', self.s3_path, string)
def save_file(self, content): if not settings.AWS_ENABLED: if not os.path.exists(os.path.dirname(self.local_filename)): os.makedirs(os.path.dirname(self.local_filename)) open(self.local_filename, 'w').write(content.encode('utf-8')) else: s3.save_file('source', self.s3_path, content.encode('utf-8')) self.save()
def save_simplyjs(self, javascript): if not settings.AWS_ENABLED: with open(self.simplyjs, 'w') as f: f.write(javascript) else: s3.save_file('builds', self.simplyjs, javascript, public=True, content_type='text/javascript')
def save_build_log(self, text): if not settings.AWS_ENABLED: with open(self.build_log, 'w') as f: f.write(text) else: s3.save_file('builds', self.build_log, text, public=True, content_type='text/plain')
def save_debug_info(self, json_info, platform, kind): text = json.dumps(json_info) if not settings.AWS_ENABLED: with open(self.get_debug_info_filename(platform, kind), "w") as f: f.write(text) else: s3.save_file( "builds", self.get_debug_info_filename(platform, kind), text, public=True, content_type="application/json", )
def save_file(self, stream, file_size=0): if file_size > 5 * 1024 * 1024: raise Exception(_("Uploaded file too big.")) if not settings.AWS_ENABLED: if not os.path.exists(os.path.dirname(self.local_filename)): os.makedirs(os.path.dirname(self.local_filename)) with open(self.local_filename, 'wb') as out: out.write(stream.read()) else: s3.save_file('source', self.s3_path, stream.read()) self.resource_file.project.last_modified = now() self.resource_file.project.save()
def save_file(self, stream, file_size=0): if file_size > 5*1024*1024: raise Exception("Uploaded file too big."); if not settings.AWS_ENABLED: if not os.path.exists(os.path.dirname(self.local_filename)): os.makedirs(os.path.dirname(self.local_filename)) with open(self.local_filename, 'wb') as out: out.write(stream.read()) else: s3.save_file('source', self.s3_path, stream.read()) self.project.last_modified = now() self.project.save()
def save_build_log(self, text): s3.save_file('builds', self.build_log, text, public=True, content_type='text/plain')
def save_simplyjs(self, javascript): s3.save_file('builds', self.simplyjs, javascript, public=True, content_type='text/javascript')