#!/usr/bin/python

# script to call mateconfpkg for every schemas installed
# this script will be called by mateconf trigger

# (C) 2011 Stefano Karapetsas <stefano@karapetsas.com>

import os
import subprocess

schemas_location = "/usr/share/mateconf/schemas"
schemas = []
for schemas_file in os.listdir(schemas_location):
    if schemas_file.endswith(".schemas"):
        schemas.append(schemas_file[:-8])
schemas.sort()

for schema in schemas:
    command = ["mateconfpkg", "--install", schema]
    #print " ".join(command)
    subprocess.call(command)
