| OLD | NEW |
| 1 # -*- coding: utf-8 -*- |
| 1 # Copyright 2012 Google Inc. All Rights Reserved. | 2 # Copyright 2012 Google Inc. All Rights Reserved. |
| 2 # | 3 # |
| 3 # Licensed under the Apache License, Version 2.0 (the "License"); | 4 # 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 not use this file except in compliance with the License. |
| 5 # You may obtain a copy of the License at | 6 # You may obtain a copy of the License at |
| 6 # | 7 # |
| 7 # http://www.apache.org/licenses/LICENSE-2.0 | 8 # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 # | 9 # |
| 9 # Unless required by applicable law or agreed to in writing, software | 10 # Unless required by applicable law or agreed to in writing, software |
| 10 # distributed under the License is distributed on an "AS IS" BASIS, | 11 # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 # See the License for the specific language governing permissions and | 13 # See the License for the specific language governing permissions and |
| 13 # limitations under the License. | 14 # limitations under the License. |
| 15 """Additional help about subdirectory handling in gsutil.""" |
| 14 | 16 |
| 15 from gslib.help_provider import HELP_NAME | 17 from __future__ import absolute_import |
| 16 from gslib.help_provider import HELP_NAME_ALIASES | 18 |
| 17 from gslib.help_provider import HELP_ONE_LINE_SUMMARY | |
| 18 from gslib.help_provider import HelpProvider | 19 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 | 20 |
| 23 _detailed_help_text = (""" | 21 _DETAILED_HELP_TEXT = (""" |
| 24 <B>OVERVIEW</B> | 22 <B>OVERVIEW</B> |
| 25 This section provides details about how subdirectories work in gsutil. | 23 This section provides details about how subdirectories work in gsutil. |
| 26 Most users probably don't need to know these details, and can simply use | 24 Most users probably don't need to know these details, and can simply use |
| 27 the commands (like cp -R) that work with subdirectories. We provide this | 25 the commands (like cp -R) that work with subdirectories. We provide this |
| 28 additional documentation to help users understand how gsutil handles | 26 additional documentation to help users understand how gsutil handles |
| 29 subdirectories differently than most GUI / web-based tools (e.g., why | 27 subdirectories differently than most GUI / web-based tools (e.g., why |
| 30 those other tools create "dir_$folder$" objects), and also to explain cost and | 28 those other tools create "dir_$folder$" objects), and also to explain cost and |
| 31 performance implications of the gsutil approach, for those interested in such | 29 performance implications of the gsutil approach, for those interested in such |
| 32 details. | 30 details. |
| 33 | 31 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 limit result data. Moreover, gsutil makes only one bucket listing request | 93 limit result data. Moreover, gsutil makes only one bucket listing request |
| 96 per cp/mv command, and thus amortizes the bucket listing cost across all | 94 per cp/mv command, and thus amortizes the bucket listing cost across all |
| 97 transferred objects (e.g., when performing a recursive copy of a directory | 95 transferred objects (e.g., when performing a recursive copy of a directory |
| 98 to the cloud). | 96 to the cloud). |
| 99 """) | 97 """) |
| 100 | 98 |
| 101 | 99 |
| 102 class CommandOptions(HelpProvider): | 100 class CommandOptions(HelpProvider): |
| 103 """Additional help about subdirectory handling in gsutil.""" | 101 """Additional help about subdirectory handling in gsutil.""" |
| 104 | 102 |
| 105 help_spec = { | 103 # Help specification. See help_provider.py for documentation. |
| 106 # Name of command or auxiliary help info for which this help applies. | 104 help_spec = HelpProvider.HelpSpec( |
| 107 HELP_NAME : 'subdirs', | 105 help_name='subdirs', |
| 108 # List of help name aliases. | 106 help_name_aliases=[ |
| 109 HELP_NAME_ALIASES : ['dirs', 'directory', 'directories', 'folder', | 107 'dirs', 'directory', 'directories', 'folder', 'folders', 'hierarchy', |
| 110 'folders', 'hierarchy', 'subdir', 'subdirectory', | 108 'subdir', 'subdirectory', 'subdirectories'], |
| 111 'subdirectories'], | 109 help_type='additional_help', |
| 112 # Type of help: | 110 help_one_line_summary='How Subdirectories Work', |
| 113 HELP_TYPE : HelpType.ADDITIONAL_HELP, | 111 help_text=_DETAILED_HELP_TEXT, |
| 114 # One line summary of this help. | 112 subcommand_help_text={}, |
| 115 HELP_ONE_LINE_SUMMARY : 'How Subdirectories Work', | 113 ) |
| 116 # The full help text. | |
| 117 HELP_TEXT : _detailed_help_text, | |
| 118 } | |
| OLD | NEW |