VPlayer /

import os
import re

cleanrx = re.compile('[^\w\ \-\_\[\]\+\(\)]*', re.U)

def get_user_home_dir():
    return os.path.expanduser('~')

def get_config_dir():
    if == 'nt':
        return os.path.join(get_user_home_dir(), 'VPlayer')
        return os.path.join(get_user_home_dir(), '.vplayer')

def get_covers_dir():
    return os.path.join(get_config_dir(), 'covers')

def get_plugins_dir():
    return os.path.join(get_config_dir(), 'plugins')

def clean_string(string):
    return cleanrx.sub('', string)

def clean_spaces(string):
    if string:
        string = re.sub('\s+', ' ', string)
        while string and string[-1] == ' ':
            string = string[:-1]
        while string and string[0] == ' ':
            string = string[1:]
    return string