Exemplo n.º 1
0
 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')
Exemplo n.º 2
0
 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')
Exemplo n.º 3
0
 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()
Exemplo n.º 4
0
 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)
Exemplo n.º 5
0
 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)
Exemplo n.º 6
0
 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()
Exemplo n.º 7
0
    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()
Exemplo n.º 8
0
    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()
Exemplo n.º 9
0
 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')
Exemplo n.º 10
0
 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')
Exemplo n.º 11
0
 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",
         )
Exemplo n.º 12
0
    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()
Exemplo n.º 13
0
    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()
Exemplo n.º 14
0
 def save_build_log(self, text):
     s3.save_file('builds',
                  self.build_log,
                  text,
                  public=True,
                  content_type='text/plain')
Exemplo n.º 15
0
 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')
Exemplo n.º 16
0
 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')
Exemplo n.º 17
0
 def save_simplyjs(self, javascript):
     s3.save_file('builds',
                  self.simplyjs,
                  javascript,
                  public=True,
                  content_type='text/javascript')