Classes | |
class | AbstractRpcServer |
class | ClientLoginError |
class | GitVCS |
class | HttpRpcServer |
elif e.code >= 500 and e.code < 600: # Server Error - try again. More... | |
class | MercurialVCS |
class | SubversionVCS |
class | VersionControlSystem |
Functions | |
def | EncodeMultipartFormData |
def | ErrorExit |
def | GetContentType |
def | GetEmail |
def | GetRpcServer |
def | GuessVCS |
def | main |
def | RealMain |
def | RunShell |
def | RunShellWithReturnCode |
def | SplitPatch |
def | StatusUpdate |
def | UploadSeparatePatches |
Variables | |
string | default = "codereview.appspot.com" |
string | dest = "assume_yes" |
tuple | group = parser.add_option_group("Logging options") |
string | help = "Assume that the answer to yes/no questions is 'yes'." |
int | MAX_UPLOAD_SIZE = 900 |
string | metavar = "SERVER" |
tuple | parser = optparse.OptionParser(usage="%prog [options] [-- diff_options]") |
tuple | use_shell = sys.platform.startswith("win") |
int | verbosity = 1 |
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: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/146306
def upload.ErrorExit | ( | msg | ) |
def upload.GetContentType | ( | filename | ) |
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.
def upload.GetRpcServer | ( | options | ) |
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.
def upload.main | ( | void | ) |
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).
def upload.RunShell | ( | command, | |
silent_ok = False , |
|||
universal_newlines = True , |
|||
print_output = False |
|||
) |
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)
def upload.SplitPatch | ( | data | ) |
def upload.StatusUpdate | ( | msg | ) |
def upload.UploadSeparatePatches | ( | issue, | |
rpc_server, | |||
patchset, | |||
data, | |||
options | |||
) |
upload::default = "codereview.appspot.com" |
string upload::dest = "assume_yes" |
tuple upload::group = parser.add_option_group("Logging options") |
string upload::help = "Assume that the answer to yes/no questions is 'yes'." |
int upload::MAX_UPLOAD_SIZE = 900 |
string upload::metavar = "SERVER" |
tuple upload::parser = optparse.OptionParser(usage="%prog [options] [-- diff_options]") |
tuple upload::use_shell = sys.platform.startswith("win") |
int upload::verbosity = 1 |