Created
July 10, 2010 15:40
-
-
Save emre/470781 to your computer and use it in GitHub Desktop.
python thumbnailler icin isimlendirme isleri
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ThumbnailTools(object): | |
@staticmethod | |
def get_thumb_info(file): | |
reply = re.search("(.*?)\.([a-zA-Z]{3,4})$", file) | |
return (reply.group(1), reply.group(2)) | |
@staticmethod | |
def get_thumb_name(file, thumb_type): | |
file_info = ThumbnailTools.get_thumb_info(file) | |
return "%s-%s.%s" % (file_info[0], thumb_type, file_info[1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment