#!/usr/local/bin/python
version = "0.0.3"
#####################################################################
# fluxspace-sync-idesk-with-appdirs
#
# Converted during build from the .py to an executable script.
# The local python path is inserted (e.g. "#!/usr/bin/python") in
# order to make it self-running and to have the proper process name.
#####################################################################

import sys
import os.path
from fluxspace.ideskutil import Desktop

scriptName = os.path.split(sys.argv[0])[1]

######################################################################
class Helper:
######################################################################
    def Message(self, level, message):
        print '%s' % message
    def Trace(self, message):
        print 'Trace: %s' % message

######################################################################
if __name__ == '__main__':
######################################################################
    if len(sys.argv) != 3:
        print '''
Usage: %s <workspace #> <directory>
''' % scriptName
        sys.exit(1)

    workspace = int(sys.argv[1])
    directory = sys.argv[2]
    helper    = Helper()
    desktop   = Desktop(helper, workspace)

    desktop.SyncAppDirs(os.path.expanduser(directory))
    print 'Synchronized desktop %d with "%s"' % (workspace, directory)
