Files
swift3/swift3/utils.py
MORITA Kazutaka 373e4158c7 tox: update pep8 parameters based on the latest Swift
This also fixes newly detected style errors.

Change-Id: Ib0c2241986415ec0246611c2155dc1d773399b3a
2014-08-06 23:38:34 +09:00

25 lines
758 B
Python

# Copyright (c) 2014 OpenStack Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import re
def camel_to_snake(camel):
return re.sub('(.)([A-Z])', r'\1_\2', camel).lower()
def snake_to_camel(snake):
return snake.title().replace('_', '')