
__author__ = '<NAME>'
from plyer import notification
import os
from kivy.utils import platform

platform = platform()

if __name__ == '__main__':
    """Initialize the service"""

    try:
        # Import the service main class
        from syncservice import SyncService
    except Exception as e:
        notification.notify("Optimal File Sync Service", "Error in init :" + str(e))


    try:
        # Find home dir
        if platform == "android":
            _home = "/storage/emulated/0/Android/data/"
        else:
            _home = os.path.expanduser("~")
        # Check if there is a settings file there
        _config_path = os.path.join(_home, "se.optimalbpm.optimal_file_sync/config.txt")
        # Raise error if non existing config
        if not os.path.exists(_config_path):
            notification.notify("Optimal File Sync Service", "Could not find config: " + _config_path + ", quitting.")
        else:
            # Pass to service
            _service=SyncService(_cfg_file=_config_path)
            _service.start("Default")
    except Exception as e:
        notification.notify("Optimal File Sync Service", "Error finding config :" + str(e))






__author__ = '<NAME>'
from plyer import notification
import os
from kivy.utils import platform

platform = platform()

if __name__ == '__main__':
    """Initialize the service"""

    try:
        # Import the service main class
        from syncservice import SyncService
    except Exception as e:
        notification.notify("Optimal File Sync Service", "Error in init :" + str(e))


    try:
        # Find home dir
        if platform == "android":
            _home = "/storage/emulated/0/Android/data/"
        else:
            _home = os.path.expanduser("~")
        # Check if there is a settings file there
        _config_path = os.path.join(_home, "se.optimalbpm.optimal_file_sync/config.txt")
        # Raise error if non existing config
        if not os.path.exists(_config_path):
            notification.notify("Optimal File Sync Service", "Could not find config: " + _config_path + ", quitting.")
        else:
            # Pass to service
            _service=SyncService(_cfg_file=_config_path)
            _service.start("Default")
    except Exception as e:
        notification.notify("Optimal File Sync Service", "Error finding config :" + str(e))





Initialize the service # Import the service main class # Find home dir # Check if there is a settings file there # Raise error if non existing config # Pass to service