proxygen
|
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 | GetEmail (prompt) |
def | StatusUpdate (msg) |
def | ErrorExit (msg) |
def | GetRpcServer (options) |
def | EncodeMultipartFormData (fields, files) |
def | GetContentType (filename) |
def | RunShellWithReturnCode (command, print_output=False, universal_newlines=True) |
def | RunShell (command, silent_ok=False, universal_newlines=True, print_output=False) |
def | SplitPatch (data) |
def | UploadSeparatePatches (issue, rpc_server, patchset, data, options) |
def | GuessVCS (options) |
def | RealMain (argv, data=None) |
def | main () |
Variables | |
int | verbosity = 1 |
int | MAX_UPLOAD_SIZE = 900 |
parser = optparse.OptionParser(usage="%prog [options] [-- diff_options]") | |
action | |
dest | |
default | |
help | |
group = parser.add_option_group("Logging options") | |
const | |
metavar | |
type | |
use_shell = sys.platform.startswith("win") | |
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
Definition at line 498 of file upload.py.
References GetContentType().
Referenced by upload.HttpRpcServer._GetOpener(), upload.MercurialVCS.GetBaseFile(), RealMain(), upload.VersionControlSystem.UploadBaseFiles(), and UploadSeparatePatches().
def upload.ErrorExit | ( | msg | ) |
Print an error message to stderr and exit.
Definition at line 109 of file upload.py.
Referenced by upload.SubversionVCS.__init__(), upload.HttpRpcServer._GetOpener(), upload.SubversionVCS._GuessBase(), upload.VersionControlSystem.CheckForUnknownFiles(), upload.SubversionVCS.GenerateDiff(), upload.GitVCS.GenerateDiff(), upload.MercurialVCS.GenerateDiff(), upload.GitVCS.GetBaseFile(), upload.MercurialVCS.GetBaseFile(), upload.SubversionVCS.GetStatus(), GuessVCS(), RealMain(), and RunShell().
def upload.GetContentType | ( | filename | ) |
Helper to guess the content-type from the filename.
Definition at line 533 of file upload.py.
Referenced by upload.HttpRpcServer._GetOpener(), and EncodeMultipartFormData().
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 upload.py.
References folly::detail::distributed_mutex.strip().
Referenced by upload.HttpRpcServer._GetOpener(), and 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 upload.py.
References GetEmail().
Referenced by upload.HttpRpcServer._GetOpener(), upload.MercurialVCS.GetBaseFile(), and RealMain().
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 upload.py.
References ErrorExit(), and RunShellWithReturnCode().
Referenced by upload.MercurialVCS.GetBaseFile(), and RealMain().
def upload.main | ( | void | ) |
Definition at line 1377 of file upload.py.
References RealMain(), and StatusUpdate().
Referenced by upload.MercurialVCS.GetBaseFile().
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 upload.py.
References count, EncodeMultipartFormData(), ErrorExit(), GetRpcServer(), GuessVCS(), StatusUpdate(), folly::detail::distributed_mutex.strip(), and UploadSeparatePatches().
Referenced by upload.MercurialVCS.GetBaseFile(), and main().
def upload.RunShell | ( | command, | |
silent_ok = False , |
|||
universal_newlines = True , |
|||
print_output = False |
|||
) |
Definition at line 578 of file upload.py.
References ErrorExit(), and RunShellWithReturnCode().
Referenced by upload.MercurialVCS.__init__(), upload.HttpRpcServer._GetOpener(), upload.SubversionVCS._GuessBase(), upload.SubversionVCS.GenerateDiff(), upload.GitVCS.GenerateDiff(), upload.MercurialVCS.GenerateDiff(), upload.SubversionVCS.GetBaseFile(), upload.MercurialVCS.GetBaseFile(), upload.SubversionVCS.GetStatus(), upload.SubversionVCS.GetUnknownFiles(), upload.GitVCS.GetUnknownFiles(), upload.MercurialVCS.GetUnknownFiles(), and 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 542 of file upload.py.
References join, and RunShell().
Referenced by upload.HttpRpcServer._GetOpener(), upload.SubversionVCS.GetBaseFile(), upload.GitVCS.GetBaseFile(), upload.MercurialVCS.GetBaseFile(), upload.SubversionVCS.GetStatus(), GuessVCS(), and RunShell().
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 upload.py.
References join, and replace().
Referenced by upload.MercurialVCS.GetBaseFile(), and UploadSeparatePatches().
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 upload.py.
Referenced by upload.HttpRpcServer._Authenticate(), upload.HttpRpcServer._GetOpener(), upload.SubversionVCS.GetBaseFile(), upload.MercurialVCS.GetBaseFile(), main(), RealMain(), upload.VersionControlSystem.UploadBaseFiles(), and 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 upload.py.
References EncodeMultipartFormData(), SplitPatch(), and StatusUpdate().
Referenced by upload.MercurialVCS.GetBaseFile(), and RealMain().
upload.action |
Definition at line 393 of file upload.py.
Referenced by testing::Action< InnerFunctionType >.Action(), fizz::test::ProtocolTest< ClientTypes, Actions >.expectAction(), folly::Subprocess::Options.fd(), fizz::test::ProtocolTest< ClientTypes, Actions >.getNumActions(), folly::Subprocess::Options.Options(), testing::internal::InvokeMethodAction< Class, MethodPtr >.Perform(), testing::gmock_generated_actions_test::SubstractAction.Perform(), testing::internal::ActionHelper< Result, Impl >.Perform(), fizz::FizzBase< Derived, ActionMoveVisitor, StateMachine >.processActions(), fizz::test::ProtocolTest< ClientTypes, Actions >.processStateMutations(), testing::gmock_generated_actions_test.TEST(), proxygen.TEST_F(), testing::internal::FunctionMockerBase< R(A1, A2)>.UntypedFindMatchingExpectation(), testing::internal::FunctionMockerBase< R(A1, A2)>.UntypedPerformAction(), testing::internal::OnCallSpec< F >.WillByDefault(), testing::internal::TypedExpectation< F >.WillRepeatedly(), testing.WithArg(), testing.WithArgs(), and testing.WithoutArgs().
upload.const |
Definition at line 398 of file upload.py.
Referenced by folly::pushmi::any_constrained_single_sender< E, TP, VN... >.any_constrained_single_sender(), folly::pushmi::any_flow_many_sender< PE, PV, E, VN >.any_flow_many_sender(), folly::pushmi::any_flow_receiver< PE, PV, E, VN >.any_flow_receiver(), folly::pushmi::any_flow_single_sender< PE, E, VN >.any_flow_single_sender(), folly::pushmi::any_many_sender< E, VN >.any_many_sender(), folly::pushmi::any_receiver< E, folly::pushmi::any_executor_ref< E > >.any_receiver(), folly::pushmi::any_single_sender< E, VN >.any_single_sender(), folly::exception_wrapper::Buffer.as(), folly::exception_wrapper::ExceptionPtr.as_exception_(), folly::exception_wrapper::ExceptionPtr.as_int_(), folly::exception_wrapper::ExceptionPtr.as_type_(), folly::detail::IteratorFacade< dynamic::const_key_iterator, dynamic const , std::forward_iterator_tag >.asDerivedConst(), folly::dynamic.at(), folly::AtomicHashArray< KeyT, ValueT, HashFcn, EqualFcn, Allocator, ProbeFcn, KeyConvertFcn >.cellKeyPtr(), folly::replaceable_detail::copy_ctor_mixin< T, true >.copy_ctor_mixin(), folly::dynamic.get_ptr(), folly::F14VectorSet< Key, Hasher, KeyEqual, Alloc >.operator=(), folly::replaceable_detail::copy_assignment_mixin< T, true >.operator=(), folly::StringKeyedMap< Value, Compare, Alloc >.operator==(), folly::StringKeyedSetBase< Compare, Alloc >.operator==(), folly.poly_call(), TEST(), and folly::detail.to_exception_arg_().
upload.dest |
Definition at line 394 of file upload.py.
Referenced by testing::internal::CodeLocation.CodeLocation(), folly::BasicFixedString< Char, N >.copy(), folly::bser.decodeString(), folly.demangle(), folly::symbolizer::Dwarf::Path.file(), folly::IOBufQueue.fillWritableRangeCache(), testing::internal.IsPathSeparator(), testing::internal::FilePath.Normalize(), folly::compression::detail::UpperBitsReader< Encoder, Instructions, SizeType >.prepareSkipTo(), producerConsumerBench(), proxygen::TraceEvent.readIntMeta(), folly::fbvector< HTTPHeaderCode >.relocate_undo(), folly::NestedCommandLineApp.resolveAlias(), runElementTypeTest(), runNeverFailThread(), runNeverFailUntilThread(), folly::fbvector< HTTPHeaderCode >.S_copy_n(), folly::fbvector< HTTPHeaderCode >.S_uninitialized_copy(), folly::fbvector< HTTPHeaderCode >.S_uninitialized_copy_a(), folly::fbvector< HTTPHeaderCode >.S_uninitialized_fill_n(), folly::fbvector< HTTPHeaderCode >.S_uninitialized_fill_n_a(), testing::internal.ShouldRunTestCase(), folly::compression::BitVectorReader< Encoder, Instructions, kUnchecked >.skip(), folly::compression::detail::UpperBitsReader< Encoder, Instructions, SizeType >.skip(), folly::compression::detail::UpperBitsReader< Encoder, Instructions, SizeType >.skipToNext(), folly.TEST(), TEST(), folly::LockFreeRingBuffer< T, Atom >.tryRead(), folly::detail::RingBufferSlot< T, Atom >.tryRead(), folly::LockFreeRingBuffer< T, Atom >.waitAndTryRead(), and folly::detail::RingBufferSlot< T, Atom >.waitAndTryRead().
upload.parser = optparse.OptionParser(usage="%prog [options] [-- diff_options]") |
int upload.verbosity = 1 |
Definition at line 59 of file upload.py.
Referenced by proxygen::HTTPMessage.getUpgradeProtocol().