OLD | NEW |
(Empty) | |
| 1 # Copyright 2012 Google Inc. |
| 2 # |
| 3 # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 # you may not use this file except in compliance with the License. |
| 5 # You may obtain a copy of the License at |
| 6 # |
| 7 # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 # |
| 9 # Unless required by applicable law or agreed to in writing, software |
| 10 # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 # See the License for the specific language governing permissions and |
| 13 # limitations under the License. |
| 14 |
| 15 from gslib.help_provider import HELP_NAME |
| 16 from gslib.help_provider import HELP_NAME_ALIASES |
| 17 from gslib.help_provider import HELP_ONE_LINE_SUMMARY |
| 18 from gslib.help_provider import HelpProvider |
| 19 from gslib.help_provider import HELP_TEXT |
| 20 from gslib.help_provider import HelpType |
| 21 from gslib.help_provider import HELP_TYPE |
| 22 |
| 23 _detailed_help_text = (""" |
| 24 <B>OVERVIEW</B> |
| 25 We're open to incorporating gsutil code changes authored by users. Here |
| 26 are some guidelines: |
| 27 |
| 28 1. If you found a bug or have an idea for a feature enhancement, we suggest |
| 29 you check http://code.google.com/p/gsutil/issues/list to see if it has |
| 30 already been reported by another user. From there you can also add yourself |
| 31 to the Cc list for an issue, so you will find out about any developments. |
| 32 |
| 33 2. It's usually worthwhile to send email to gs-team@google.com about your |
| 34 idea before sending actual code. Often we can discuss the idea and help |
| 35 propose things that could save you later revision work. |
| 36 |
| 37 3. We tend to avoid adding command line options that are of use to only |
| 38 a very small fraction of users, especially if there's some other way |
| 39 to accommodate such needs. Adding such options complicates the code and |
| 40 also adds overhead to users having to read through an "alphabet soup" |
| 41 list of option documentation. |
| 42 |
| 43 4. While gsutil has a number of features specific to Google Cloud Storage, |
| 44 it can also be used with other cloud storage providers. We're open to |
| 45 including changes for making gsutil support features specific to other |
| 46 providers, as long as those changes don't make gsutil work worse for Google |
| 47 Cloud Storage. If you do make such changes we recommend including someone |
| 48 with knowledge of the specific provider as a code reviewer (see below). |
| 49 |
| 50 5. You can check out the gsutil code from svn - see |
| 51 http://code.google.com/p/gsutil/source/checkout. Then change directories |
| 52 into gsutil/src, and check out the boto code from github: |
| 53 git clone git://github.com/boto/boto.git |
| 54 |
| 55 6. Please make sure to run all tests against your modified code. To |
| 56 do this, change directories into the gsutil top-level directory and run: |
| 57 |
| 58 export PYTHONPATH=./boto:$PYTHONPATH |
| 59 ./gslib/test_commands.py |
| 60 ./gslib/test_plurality_checkable_iterator.py |
| 61 ./gslib/test_thread_pool.py |
| 62 ./gslib/test_wildcard_iterator.py |
| 63 |
| 64 The above tests run quickly, as they run against an in-memory mock |
| 65 storage service implementation. We have an additional set of tests |
| 66 that take longer because they send requests to the production service; |
| 67 please also run these tests: |
| 68 |
| 69 ./gsutil test |
| 70 |
| 71 If you made mods to boto please run the boto tests. For these tests you |
| 72 need to use HMAC credentials (from gsutil config -a), because the current |
| 73 boto test suite doesn't import the OAuth2 handler. You'll also need to |
| 74 install some python modules: change directories into the top-level gsutil |
| 75 directory and run: |
| 76 pip install -qr boto/requirements.txt |
| 77 (You probably need to run this commad using sudo.) |
| 78 Make sure each of the individual installations succeeded. If they don't |
| 79 you may need to run individual ones again, e.g., |
| 80 pip install unittest2 |
| 81 |
| 82 Then ensure your .boto file has HMAC credentials defined (the boto tests |
| 83 don't load the OAUTH2 plugin), and then change directories into boto/tests |
| 84 and run: |
| 85 python test.py -t s3 -t gs -t ssl |
| 86 |
| 87 7. Please consider contributing test code for your change, especially if the |
| 88 change impacts any of the core gsutil code (like the gsutil cp command). |
| 89 |
| 90 8. When it's time to send us code, please use the Rietveld code review tool |
| 91 rather than simply sending us a code patch. Do this as follows: |
| 92 - check out the gsutil code from at |
| 93 http://code.google.com/p/gsutil/source/checkout and apply your changes |
| 94 in the checked out directory. |
| 95 - download the "upload.py" script from |
| 96 http://code.google.com/p/rietveld/wiki/UploadPyUsage |
| 97 - run upload.py from the above gsutil svn directory. |
| 98 - click the codereview.appspot.com link it generates, click "Edit Issue", |
| 99 and add mfschwartz@google.com as a reviewer, and Cc gs-team@google.com. |
| 100 - click Publish+Mail Comments. |
| 101 """) |
| 102 |
| 103 |
| 104 |
| 105 class CommandOptions(HelpProvider): |
| 106 """Additional help about Access Control Lists.""" |
| 107 |
| 108 help_spec = { |
| 109 # Name of command or auxiliary help info for which this help applies. |
| 110 HELP_NAME : 'dev', |
| 111 # List of help name aliases. |
| 112 HELP_NAME_ALIASES : ['development', 'developer', 'code', 'mods', |
| 113 'software'], |
| 114 # Type of help: |
| 115 HELP_TYPE : HelpType.ADDITIONAL_HELP, |
| 116 # One line summary of this help. |
| 117 HELP_ONE_LINE_SUMMARY : 'Making modifications to gsutil', |
| 118 # The full help text. |
| 119 HELP_TEXT : _detailed_help_text, |
| 120 } |
OLD | NEW |