Ejemplo n.º 1
0
def is_mailman_arch_dir (path):
    path = validations.is_local_dir_exists (path)
    file = os.path.join (path, "archives/public")
    try:
        validations.is_local_dir_exists (file)
    except:
        raise ValueError, _("It does not look like a Mailman archive directory.")
    return path
Ejemplo n.º 2
0
def is_trac_data (path):
    path = validations.is_local_dir_exists (path)
    manage = os.path.join (path, "htdocs")

    try:
        validations.is_local_dir_exists (manage)
    except:
        raise ValueError, _(ERROR_NO_DATA)
    return path
Ejemplo n.º 3
0
def is_mailman_imgs_dir(path):
    path = validations.is_local_dir_exists(path)
    file = os.path.join(path, "mailman.jpg")
    if not os.path.exists(file):
        raise ValueError, _(
            "It does not look like a Mailman images directory.")
    return path
Ejemplo n.º 4
0
def is_joomla_dir (path):
    path = validations.is_local_dir_exists (path)
    module_inc = os.path.join (path, 'includes/framework.php')
    try:
        validations.is_local_file_exists (module_inc)
    except:
        raise ValueError, _(ERROR_NO_SRC)
    return path
Ejemplo n.º 5
0
def is_mediawiki_dir(path):
    path = validations.is_local_dir_exists(path)
    module_inc = os.path.join(path, "includes/Article.php")
    try:
        validations.is_local_file_exists(module_inc)
    except:
        raise ValueError, _(ERROR_NO_SRC)
    return path
Ejemplo n.º 6
0
def is_concrete5_dir(path):
    path = validations.is_local_dir_exists(path)
    module_inc = os.path.join(path, 'concrete/libraries/loader.php')
    try:
        validations.is_local_file_exists(module_inc)
    except:
        raise ValueError(_(ERROR_NO_SRC))
    return path
Ejemplo n.º 7
0
def is_moodle_dir (path):
    path = validations.is_local_dir_exists (path)
    module_inc = os.path.join (path, 'lib/moodlelib.php')
    try:
        validations.is_local_file_exists (module_inc)
    except:
        raise ValueError, _(ERROR_NO_SRC)
    return path
Ejemplo n.º 8
0
def is_drupal_dir (path):
    path = validations.is_local_dir_exists (path)
    module_inc = os.path.join (path, 'includes/module.inc')
    try:
        validations.is_local_file_exists (module_inc)
    except:
        raise ValueError, _(ERROR_NO_SRC)
    return path
Ejemplo n.º 9
0
def is_sugar_dir (path):
    path = validations.is_local_dir_exists (path)
    module_inc = os.path.join (path, 'include/entryPoint.php')
    try:
        validations.is_local_file_exists (module_inc)
    except:
        raise ValueError, _(ERROR_NO_SRC)
    return path
Ejemplo n.º 10
0
def is_concrete5_dir (path):
    path = validations.is_local_dir_exists (path)
    module_inc = os.path.join (path, 'concrete/libraries/loader.php')
    try:
        validations.is_local_file_exists (module_inc)
    except:
        raise ValueError, _(ERROR_NO_SRC)
    return path
Ejemplo n.º 11
0
def is_wordpress_dir (path):
    path = validations.is_local_dir_exists (path)
    module_inc = os.path.join (path, 'wp-login.php')
    try:
        validations.is_local_file_exists (module_inc)
    except:
        raise ValueError, _(ERROR_NO_SRC)
    return path
Ejemplo n.º 12
0
def is_moinmoin_wiki (path):
    path = validations.is_local_dir_exists (path)
    manage = os.path.join (path, "config/wikiconfig.py")
    try:
        validations.is_local_file_exists (manage)
    except:
        raise ValueError, _(ERROR_NO_MOINMOIN_WIKI)
    return path
def is_phpmyadmin_dir (path):
    path = validations.is_local_dir_exists (path)
    module_inc = os.path.join (path, 'libraries/common.inc.php')
    try:
        validations.is_local_file_exists (module_inc)
    except:
        raise ValueError, _(ERROR_NO_SRC)
    return path
Ejemplo n.º 14
0
def is_mono_dir(path):
    path = validations.is_local_dir_exists(path)

    real_path = get_real_path(path)
    files = [x.lower() for x in os.listdir(real_path)]
    if 'index.aspx' in files or 'default.aspx' in files:
        return path

    raise ValueError, _(ERROR_NO_MONO)
Ejemplo n.º 15
0
def is_trac_project (path):
    path = validations.is_local_dir_exists (path)
    manage = os.path.join (path, "conf/trac.ini")

    try:
        validations.is_local_file_exists (manage)
    except:
        raise ValueError, _(ERROR_NO_PROJECT)
    return path
Ejemplo n.º 16
0
def is_mono_dir(path):
    path = validations.is_local_dir_exists(path)

    real_path = get_real_path(path)
    files = [x.lower() for x in os.listdir(real_path)]
    if "index.aspx" in files or "default.aspx" in files:
        return path

    raise ValueError, _(ERROR_NO_MONO)
Ejemplo n.º 17
0
def is_django_dir (path):
    path = validations.is_local_dir_exists (path)
    manage = os.path.join (path, "manage.py")

    try:
        validations.is_local_file_exists (manage)
    except:
        raise ValueError, _("Directory doesn't look like a Django based project.")
    return path
Ejemplo n.º 18
0
def is_ror3_dir (path):
    try:
        path    = validations.is_local_dir_exists (path)
        gemfile = validations.is_local_file_exists (os.path.join (path, 'Gemfile'))

        data    = open(gemfile, 'r').read()
        tmp     = re.findall("^gem\s+'rails',\s+'3[.0-9]*'", data, re.MULTILINE)
        if tmp:
            return True
    except:
        pass

    return False
Ejemplo n.º 19
0
def get_ror_version(path):
    path = validations.is_local_dir_exists (path)

    ror2_bin = os.path.join(path, "script/server")
    ror3_bin = os.path.join(path, "script/rails")
    ror4_bin = os.path.join(path, "bin/rails")

    if os.path.exists(ror2_bin):
        return 2
    elif os.path.exists(ror3_bin):
        return 3
    elif os.path.exists(ror4_bin):
        return 4
Ejemplo n.º 20
0
def is_symfony_dir (path):
    path = validations.is_local_dir_exists (path)

    try:
        module_inc = os.path.join (path, 'bin/symfony')
        validations.is_local_file_exists (module_inc)
    except ValueError:
        module_inc = os.path.join (path, 'bin/check_configuration.php')
        validations.is_local_file_exists (module_inc)
    except:
        raise ValueError, _(ERROR_NO_SRC)

    return path
Ejemplo n.º 21
0
def is_ror_dir (path):
    path = validations.is_local_dir_exists (path)

    try:
        manage = os.path.join (path, "script/server")
        validations.is_local_file_exists (manage)
    except:
        try:
            manage = os.path.join (path, "script/rails")
            validations.is_local_file_exists (manage)
        except:
            raise ValueError, _(ERROR_NO_ROR)

    return path
Ejemplo n.º 22
0
def is_ror_dir(path):
    path = validations.is_local_dir_exists(path)

    try:
        manage = os.path.join(path, "script/server")
        validations.is_local_file_exists(manage)
    except:
        try:
            manage = os.path.join(path, "script/rails")
            validations.is_local_file_exists(manage)
        except:
            raise ValueError, _(ERROR_NO_ROR)

    return path
Ejemplo n.º 23
0
def is_ror_dir(path):
    path = validations.is_local_dir_exists (path)

    ror2_bin = os.path.join(path, "script/server")
    ror3_bin = os.path.join(path, "script/rails")
    ror4_bin = os.path.join(path, "bin/rails")

    if os.path.exists(ror2_bin):
        return path
    elif os.path.exists(ror3_bin):
        return path
    elif os.path.exists(ror4_bin):
        return path
    else:
        raise ValueError, _(ERROR_NO_ROR)
Ejemplo n.º 24
0
def is_mailman_data_dir (path):
    path = validations.is_local_dir_exists (path)
    file = os.path.join (path, "bin/newlist")
    if not os.path.exists (file):
        raise ValueError, _("It does not look like a Mailman data directory.")
    return path
Ejemplo n.º 25
0
def is_mailman_imgs_dir (path):
    path = validations.is_local_dir_exists (path)
    file = os.path.join (path, "mailman.jpg")
    if not os.path.exists (file):
        raise ValueError, _("It does not look like a Mailman images directory.")
    return path
Ejemplo n.º 26
0
def is_mailman_cgi_dir (path):
    path = validations.is_local_dir_exists (path)
    file = os.path.join (path, "listinfo")
    if not os.path.exists (file):
        raise ValueError, _("It does not look like a Mailman CGI directory.")
    return path