Exemple #1
0
def upload_gcode_single(path, summary, labels, username, password):
    googlecode_upload.upload(
        file=path,
        project_name="dragonfly",
        user_name=username,
        password=password,
        summary=summary,
        labels=labels,
    )
def upload_gcode_single(path, summary, labels, username, password):
    googlecode_upload.upload(
                             file=path,
                             project_name="dragonfly",
                             user_name=username,
                             password=password,
                             summary=summary,
                             labels=labels,
                            )
def update_file(info, dist_dir, username, password):
  """Updates the file by re-uploading it.

  Only way I could figure to remove the 'Featured' label, ugh.
  Unfortunately, it also updates the upload date, oh well.

  Args:
    info: dictionary filled with project_name, fname, summary, and labels
    dist_dir: the destination filename that must exist.
    username: username to use
  """
  print 'Updating %s' % info['fname']
  googlecode_upload.upload(
      '%s/%s' % (dist_dir, info['fname']),
      info['project_name'], username, password, info['summary'], info['labels'])
def maybe_upload_file(project_name, dist_dir, fname,
    summary, labels, username, password):
  """Verify the checksums."""
  details = get_file_details(project_name, fname)
  dist_filename = os.path.join(dist_dir, fname)
  if details['sha1']:
    fin = open(dist_filename, 'rb')
    sha1 = hashlib.sha1()
    sha1.update(fin.read())
    fin.close()
    hex_digest = sha1.hexdigest()
  else:
    hex_digest = '-'
  if not details['sha1'] or hex_digest != details['sha1']:
    if details['sha1']:
      print 'SHA1 checksums don\'t match, uploading %r.' % fname
    else:
      print 'File not there, uploading %r.' % fname
    status, reason, url= googlecode_upload.upload(
      os.path.join(dist_dir, fname), project_name, username, password, summary, labels)
    if not url:
      print '%r, %r' % (status, reason)
      print '%r, %r, %r, %r' % (os.path.join(dist_dir, fname), project_name, summary, labels)
      #print '%r, %r' % (username, password)
      sys.exit(-1)
  else:
    print 'Checksums match, not uploading %r.' % fname
Exemple #5
0
def upload_googlecode():
    """Uploads a source package to Google Code."""

    dist_file = path("dist/%s-%s.zip" % (options.setup.name,
                                         options.setup.version))
    # TODO: sdist won't produce a .zip on non-Windows.
    if not dist_file.exists():
        call_task("sdist")
    if not dist_file.exists():
        raise BuildFailure("Can't find dist file %s" % dist_file)

    summary = "%s v%s" % (options.setup.name,
                          options.setup.version)

    import googlecode_upload
    googlecode_upload.upload(str(dist_file), "browsertests", options.username,
                             options.password, summary)
Exemple #6
0
def upload(filename, summary, labels):
  print("Uploading {}".format(filename))
  from netrc import netrc
  authenticators = netrc().authenticators("code.google.com")
  username = authenticators[0]
  password = authenticators[2]
  status, reason, url = googlecode_upload.upload(
    filename, project, username, password, summary, labels)
  if not url:
    print('Google Code upload error: {} ({})'.format(reason, status))
def gupload(file, summary, labels):
   statuscode, msg, url = googlecode_upload.upload("%s/rel/%s" % (home,file), 
      'Genyris', 
      '*****@*****.**',
      password,
      summary % version, labels)
   print "upload: %s %s %s" % (statuscode, msg, url)
   if( statuscode != 201):
	 print "*** Googlecode upload failed: %s %s %s" % (statuscode, msg, url)
	 print "continuing..."
Exemple #8
0
def upload(filename, summary, labels):
    print("Uploading {}".format(filename))
    from netrc import netrc
    authenticators = netrc().authenticators("code.google.com")
    username = authenticators[0]
    password = authenticators[2]
    status, reason, url = googlecode_upload.upload(filename, project, username,
                                                   password, summary, labels)
    if not url:
        print('Google Code upload error: {} ({})'.format(reason, status))
Exemple #9
0
def uploadFile(file, summary):
    (http_status, http_reason,
     file_url) = googlecode_upload.upload(file=file,
                                          project_name="chromedevtools",
                                          user_name=user_name,
                                          password=pwd,
                                          summary=summary)
    if http_status != 201:
        raise Exception("Failed to upload file %s: %d '%s'" %
                        (file, http_status, http_reason))
    print "Uploaded to %s" % file_url
Exemple #10
0
def doUpload(args, username, password):
    # fail gracefully if no username or password set
    if not username or not password:
        return

    if len(args) != 5:
        return usage(args[0])
    builder = args[2]
    summary = args[3]
    filename = args[4]

    from googlecode_upload import upload
    code, msg, url = upload(
        filename, # filename
        upload_project, # 'go'
        username,
        password,
        summary,
        builder.split('-'), # labels
    )
    if code != 201:
        raise Failed('Upload returned code %s msg "%s".' % (code, msg))
Exemple #11
0
def main():
  dist_dir = os.path.dirname(os.path.abspath(__file__))
  root_dir = os.path.normpath(os.path.join(dist_dir, ".."))

  # Read the version file
  version = VersionInfo(root_dir)

  # Display the files that will be uploaded
  for release in RELEASES:
    filename = version.filename(release)
    description = version.description(release)

    if not os.path.exists(filename):
      print
      print "%s - file not found" % filename
      print "Run this script from a directory containing all the release packages"
      return 1

    size = os.path.getsize(filename)

    if size < MIN_SIZE[release[0]]:
      print
      print "%s - file not big enough" % filename
      print "%s files are expected to be at least %d bytes, but this was %d bytes" % (
        release[0], MIN_SIZE[release[0]], size)
      return 1

    labels = version.labels(release)

    print "%-40s %15s   %-55s %s" % (filename, "%d bytes" % size, description, " ".join(sorted(labels)))

  print

  # Prompt for username and password
  username = raw_input("Google username: "******"%s: (%d) %s" % (version.filename(release), status, reason)
    else:
      print "Uploaded %s" % url

  return 0
Exemple #12
0
z = zipfile.ZipFile(zipFilename + '.zip', 'w', zipfile.ZIP_DEFLATED)
for file in zipFileList:
    z.write(file, file.replace('dist/', zipFilename + '/'))
z.close()

print "Created zip at", zipFilename

# i store my google code username/pw in a config so i can have this file in public source control 
config = ConfigParser.ConfigParser()
configFilename = os.path.join(compile_dir, "gc.ini")
config.read(configFilename)

gc_username = config.get("GC", "username")
gc_password = config.get("GC", "password")

# upload to google code unless I tell it not to
if "noup" not in oldArgs and "test" not in oldArgs:
    print "Uploading zip to google code"
    googlecode_upload.upload(os.path.abspath(zipFilename + ".zip"), "SickGear", gc_username, gc_password,
                             "Win32 alpha build " + str(currentBuildNumber) + " (unstable/development release)",
                             ["Featured", "Type-Executable", "OpSys-Windows"])

if 'nopush' not in oldArgs and 'test' not in oldArgs:
    # tag commit as a new build and push changes to github
    print 'Tagging commit and pushing'
    p = subprocess.Popen('git tag -a "build-' + str(currentBuildNumber) + '" -m "Windows build ' + zipFilename + '"',
                         shell=True, cwd=compile_dir)
    o, e = p.communicate()
    p = subprocess.Popen('git push --tags origin windows_binaries', shell=True, cwd=compile_dir)
    o, e = p.communicate()
Exemple #13
0
               'docs' not in filename:
                labels.append('Type-Source')
            elif filename.endswith('.msi'):
                labels.append('OpSys-Windows')
            elif filename.endswith('.dmg'):
                labels.append('OpSys-OSX')
            # Don't feature 1.1 until release time
            #if not filename.endswith('.egg'):
            #    labels.append('Featured')
            files[filename] = description, labels

            print filename
            print '   %s' % description
            print '   %s' % ', '.join(labels)

    print 'Ok to upload? [type "y"]'
    if raw_input().strip() != 'y':
        print 'Aborted.'
        sys.exit(1)

    for filename, (description, labels) in files.items():
        status, reason, url = googlecode_upload.upload(
            os.path.join(dist, filename), 'pyglet', 'Alex.Holkner', password,
            description, labels)
        if url:
            print 'OK: %s' % url
        else:
            print 'Error: %s (%s)' % (reason, status)

    print 'Done!'
def main():
  dist_dir = os.path.dirname(os.path.abspath(__file__))
  root_dir = os.path.normpath(os.path.join(dist_dir, ".."))

  # Read the version file
  version = VersionInfo(root_dir)

  # Display the files that will be uploaded
  for release in RELEASES:
    filename = version.filename(release)
    description = version.description(release)

    if not os.path.exists(filename):
      print
      print "%s - file not found" % filename
      print "Run this script from a directory containing all the release packages"
      return 1

    size = os.path.getsize(filename)

    if size < MIN_SIZE[release[0]]:
      print
      print "%s - file not big enough" % filename
      print "%s files are expected to be at least %d bytes, but this was %d bytes" % (
        release[0], MIN_SIZE[release[0]], size)
      return 1

    labels = version.labels(release)

    print "%-40s %15s   %-55s %s" % (filename, "%d bytes" % size, description, " ".join(sorted(labels)))

  print

  # Prompt for username and password
  username = raw_input("Google username: "******"Google Code password (different to your Google account): ")
  if not password:
    return 1

  print

  # Upload everything
  for release in RELEASES:
    (status, reason, url) = googlecode_upload.upload(
      file=version.filename(release),
      project_name=PROJECT_NAME,
      user_name=username,
      password=password,
      summary=version.description(release),
      labels=version.labels(release),
    )

    if status != 201:
      print "%s: (%d) %s" % (version.filename(release), status, reason)
    else:
      print "Uploaded %s" % url

  return 0
Exemple #15
0
def upload(path, version, user, password):
  summary = 'Extension version ' + version + ' download'
  labels = ['Type-Executable']
  print googlecode_upload.upload(
      path, 'np-activex', user, password, summary, labels)
Exemple #16
0
def upload(path, version, user, password):
  summary = 'Extension version ' + version + ' download'
  labels = ['Type-Executable']
  print googlecode_upload.upload(
      path, 'np-activex', user, password, summary, labels)
Exemple #17
0
            elif filename.endswith('.dmg'):
                labels.append('OpSys-OSX')
            # Don't feature 1.1 until release time
            #if not filename.endswith('.egg'):
            #    labels.append('Featured')
            files[filename] = description, labels

            print filename
            print '   %s' % description
            print '   %s' % ', '.join(labels)

    print 'Ok to upload? [type "y"]'
    if raw_input().strip() != 'y':
        print 'Aborted.'
        sys.exit(1)

    for filename, (description, labels) in files.items():
        status, reason, url = googlecode_upload.upload(
            os.path.join(dist, filename),
            'pyglet',
            'Alex.Holkner',
            password,
            description,
            labels)
        if url:
            print 'OK: %s' % url
        else:
            print 'Error: %s (%s)' % (reason, status)

    print 'Done!'
def uploadFile(file, summary):
    (http_status, http_reason, file_url) = googlecode_upload.upload(file=file, project_name="chromedevtools", user_name=user_name, password=pwd, summary=summary)
    if http_status != 201:
        raise Exception("Failed to upload file %s: %d '%s'" % (file, http_status, http_reason))
    print "Uploaded to %s" % file_url