parameters: (gallery_name)
return_statement: return True
docstring: Check if gallery folder exists and create new one if not.
docstring_summary: Check if gallery folder exists and create new one if not.
docstring_tokens: Check if gallery folder exists and create new one if not .
function: def create_gallery(gallery_name):
      """
      Check if gallery folder exists and create new one if not.
      """
      filepath = os.path.join(settings.MEDIA_ROOT, gallery_name)
      thumb_path = os.path.join(filepath, 'thumbs')
      if not os.path.exists(filepath):
          try:
              os.makedirs(os.path.join(filepath, 'thumbs'))
              return True
          except IOError:
              return False
      return True
function_tokens: def create_gallery ( gallery_name ) : filepath = os . path . join ( settings . MEDIA_ROOT , gallery_name ) thumb_path = os . path . join ( filepath , 'thumbs' ) if not os . path . exists ( filepath ) : try : os . makedirs ( os . path . join ( filepath , 'thumbs' ) ) return True except IOError : return False return True