mirror of https://github.com/scrapy/scrapy.git
add proper docstring to string_camelcase. refs #58
--HG-- extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%40821
This commit is contained in:
parent
751a844e36
commit
bf87fb8455
|
|
@ -157,4 +157,12 @@ def items_to_csv(file, items, delimiter=';', headers=None):
|
|||
|
||||
CAMELCASE_INVALID_CHARS = re.compile('[^a-zA-Z]')
|
||||
def string_camelcase(string):
|
||||
""" Convert a word to it CamelCase version
|
||||
>>> string_camelcase('lost-pound')
|
||||
LostPound
|
||||
|
||||
>>> string_camelcase('missing_images')
|
||||
MissingImages
|
||||
|
||||
"""
|
||||
return CAMELCASE_INVALID_CHARS.sub('', string.title())
|
||||
|
|
|
|||
Loading…
Reference in New Issue