Classes | Functions | Variables
upload Namespace Reference

Classes

class  AbstractRpcServer
 
class  ClientLoginError
 
class  GitVCS
 
class  HttpRpcServer
 elif e.code >= 500 and e.code < 600: More...
 
class  MercurialVCS
 
class  SubversionVCS
 
class  VersionControlSystem
 

Functions

def EncodeMultipartFormData (fields, files)
 
def ErrorExit (msg)
 
def GetContentType (filename)
 
def GetEmail (prompt)
 
def GetRpcServer (options)
 
def GuessVCS (options)
 
def main ()
 
def RealMain (argv, data=None)
 
def RunShell (command, silent_ok=False, universal_newlines=True, print_output=False)
 
def RunShellWithReturnCode (command, print_output=False, universal_newlines=True)
 
def SplitPatch (data)
 
def StatusUpdate (msg)
 
def UploadSeparatePatches (issue, rpc_server, patchset, data, options)
 

Variables

 action
 
 const
 
 default
 
 dest
 
 group = parser.add_option_group("Logging options")
 
 help
 
int MAX_UPLOAD_SIZE = 900 * 1024
 
 metavar
 
 parser = optparse.OptionParser(usage="%prog [options] [-- diff_options]")
 
 type
 
 use_shell = sys.platform.startswith("win")
 
int verbosity = 1
 

Function Documentation

◆ EncodeMultipartFormData()

def upload.EncodeMultipartFormData (   fields,
  files 
)
Encode form fields for multipart/form-data.

Args:
  fields: A sequence of (name, value) elements for regular form fields.
  files: A sequence of (name, filename, value) elements for data to be
         uploaded as files.
Returns:
  (content_type, body) ready for httplib.HTTP instance.

Source:
  https://web.archive.org/web/20160116052001/code.activestate.com/recipes/146306

Definition at line 498 of file googlemock/scripts/upload.py.

◆ ErrorExit()

def upload.ErrorExit (   msg)
Print an error message to stderr and exit.

Definition at line 109 of file googlemock/scripts/upload.py.

◆ GetContentType()

def upload.GetContentType (   filename)
Helper to guess the content-type from the filename.

Definition at line 533 of file googlemock/scripts/upload.py.

◆ GetEmail()

def upload.GetEmail (   prompt)
Prompts the user for their email address and returns it.

The last used email address is saved to a file and offered up as a suggestion
to the user. If the user presses enter without typing in anything the last
used email address is used. If the user enters a new address, it is saved
for next time we prompt.

Definition at line 65 of file googlemock/scripts/upload.py.

◆ GetRpcServer()

def upload.GetRpcServer (   options)
Returns an instance of an AbstractRpcServer.

Returns:
  A new AbstractRpcServer, on which RPC calls can be made.

Definition at line 458 of file googlemock/scripts/upload.py.

◆ GuessVCS()

def upload.GuessVCS (   options)
Helper to guess the version control system.

This examines the current directory, guesses which VersionControlSystem
we're using, and returns an instance of the appropriate class.  Exit with an
error if we can't figure it out.

Returns:
  A VersionControlSystem instance. Exits if the VCS can't be guessed.

Definition at line 1209 of file googlemock/scripts/upload.py.

◆ main()

def upload.main ( )

Definition at line 1377 of file googlemock/scripts/upload.py.

◆ RealMain()

def upload.RealMain (   argv,
  data = None 
)
The real main function.

Args:
  argv: Command line arguments.
  data: Diff contents. If None (default) the diff is generated by
    the VersionControlSystem implementation returned by GuessVCS().

Returns:
  A 2-tuple (issue id, patchset id).
  The patchset id is None if the base files are not uploaded by this
  script (applies only to SVN checkouts).

Definition at line 1250 of file googlemock/scripts/upload.py.

◆ RunShell()

def upload.RunShell (   command,
  silent_ok = False,
  universal_newlines = True,
  print_output = False 
)

Definition at line 577 of file googlemock/scripts/upload.py.

◆ RunShellWithReturnCode()

def upload.RunShellWithReturnCode (   command,
  print_output = False,
  universal_newlines = True 
)
Executes a command and returns the output from stdout and the return code.

Args:
  command: Command to execute.
  print_output: If True, the output is printed to stdout.
                If False, both stdout and stderr are ignored.
  universal_newlines: Use universal_newlines flag (default: True).

Returns:
  Tuple (output, return code)

Definition at line 541 of file googlemock/scripts/upload.py.

◆ SplitPatch()

def upload.SplitPatch (   data)
Splits a patch into separate pieces for each file.

Args:
  data: A string containing the output of svn diff.

Returns:
  A list of 2-tuple (filename, text) where text is the svn diff output
    pertaining to filename.

Definition at line 1141 of file googlemock/scripts/upload.py.

◆ StatusUpdate()

def upload.StatusUpdate (   msg)
Print a status message to stdout.

If 'verbosity' is greater than 0, print the message.

Args:
  msg: The string to print.

Definition at line 97 of file googlemock/scripts/upload.py.

◆ UploadSeparatePatches()

def upload.UploadSeparatePatches (   issue,
  rpc_server,
  patchset,
  data,
  options 
)
Uploads a separate patch for each file in the diff output.

Returns a list of [patch_key, filename] for each file.

Definition at line 1181 of file googlemock/scripts/upload.py.

Variable Documentation

◆ action

upload.action

Definition at line 393 of file googlemock/scripts/upload.py.

◆ const

upload.const

Definition at line 398 of file googlemock/scripts/upload.py.

◆ default

upload.default

Definition at line 394 of file googlemock/scripts/upload.py.

◆ dest

upload.dest

Definition at line 394 of file googlemock/scripts/upload.py.

◆ group

upload.group = parser.add_option_group("Logging options")

Definition at line 397 of file googlemock/scripts/upload.py.

◆ help

upload.help

Definition at line 395 of file googlemock/scripts/upload.py.

◆ MAX_UPLOAD_SIZE

int upload.MAX_UPLOAD_SIZE = 900 * 1024

Definition at line 62 of file googlemock/scripts/upload.py.

◆ metavar

upload.metavar

Definition at line 409 of file googlemock/scripts/upload.py.

◆ parser

upload.parser = optparse.OptionParser(usage="%prog [options] [-- diff_options]")

Definition at line 392 of file googlemock/scripts/upload.py.

◆ type

upload.type

Definition at line 443 of file googlemock/scripts/upload.py.

◆ use_shell

upload.use_shell = sys.platform.startswith("win")

Definition at line 539 of file googlemock/scripts/upload.py.

◆ verbosity

int upload.verbosity = 1

Definition at line 59 of file googlemock/scripts/upload.py.



libaditof
Author(s):
autogenerated on Wed May 21 2025 02:07:11