예제 #1
0
파일: mail_hooks.py 프로젝트: syncloud/mail
 def __init__(self):
     self.log = logger.get_logger('mail_installer')
     self.app_dir = paths.get_app_dir(APP_NAME)
     self.app_data_dir = paths.get_data_dir(APP_NAME)
     self.app_url = urls.get_app_url(APP_NAME)
     self.app_domain_name = urls.get_app_domain_name(APP_NAME)
     self.platform_data_dir = paths.get_data_dir('platform')
     self.device_domain_name = urls.get_device_domain_name()
     
     self.database_path = '{0}/database'.format(self.app_data_dir)
     self.config_path = join(self.app_data_dir, 'config')
     self.config = Config(self.config_path)
     self.user_config = UserConfig(self.app_data_dir)
예제 #2
0
    def __init__(self):
        if not logger.factory_instance:
            logger.init(logging.DEBUG, True)

        self.log = logger.get_logger('{0}_installer'.format(APP_NAME))
        self.app_dir = paths.get_app_dir(APP_NAME)
        self.app_data_dir = paths.get_data_dir(APP_NAME)
예제 #3
0
    def __init__(self):
        if not logger.factory_instance:
            logger.init(logging.DEBUG, True)

        self.log = logger.get_logger('{0}_installer'.format(APP_NAME))
        self.app_dir = paths.get_app_dir(APP_NAME)
        self.common_dir = paths.get_data_dir(APP_NAME)
        self.snap_data_dir = os.environ['SNAP_DATA']
예제 #4
0
    def __init__(self):
        self.log = logger.get_logger('diaspora')

        self.app_dir = paths.get_app_dir(APP_NAME)
        self.app_data_dir = paths.get_data_dir(APP_NAME)
        self.app_url = urls.get_app_url(APP_NAME)
        self.app_domain_name = urls.get_app_domain_name(APP_NAME)
        self.platform_app_dir = paths.get_app_dir('platform')
        self.platform_data_dir = paths.get_data_dir('platform')
        self.device_domain_name = urls.get_device_domain_name()
        self.rails_env = 'production'
        self.gem_home = '{0}/ruby'.format(self.app_dir)
        self.path = '{0}/ruby/bin:{0}/nodejs/bin:{0}/ImageMagick/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'.format(
            self.app_dir)
        self.ld_library_path = '{0}/ruby/lib:{0}/ImageMagick/lib:{0}/postgresql/lib'.format(
            self.app_dir)
        self.rake_db_cmd = '{0}/bin/update_db'.format(self.app_dir)
        self.diaspora_dir = '{0}/diaspora'.format(self.app_dir)
        self.psql_bin = '{0}/postgresql/bin/psql'.format(self.app_dir)
        self.diaspora_config = '{0}/config/diaspora/diaspora.yml'.format(
            self.app_data_dir)
        self.database_path = '{0}/database'.format(self.app_data_dir)
        self.database_socket = '{0}/.s.PGSQL.{1}'.format(
            self.database_path, PSQL_PORT)
        self.database_path_escaped = self.database_path.replace("/", "%2F")
        self.database_url = "postgresql://*****:*****@{0}:{1}/diaspora?encoding=unicode".format(
            self.database_path_escaped, PSQL_PORT)
        self.diaspora_gemfile = '{0}/Gemfile'.format(self.diaspora_dir)

        environ['RAILS_ENV'] = self.rails_env
        environ['DB'] = DB_TYPE
        environ['GEM_HOME'] = self.gem_home
        environ['PATH'] = self.path
        environ['LD_LIBRARY_PATH'] = self.ld_library_path
        environ['DIASPORA_CONFIG_DIR'] = '{0}/config/diaspora'.format(
            self.app_data_dir)
        environ['DATABASE_URL'] = self.database_url
        environ['BUNDLE_GEMFILE'] = self.diaspora_gemfile
예제 #5
0
    def __init__(self):
        if not logger.factory_instance:
            logger.init(logging.DEBUG, True)

        self.log = logger.get_logger('nextcloud_installer')
        self.app_dir = paths.get_app_dir(APP_NAME)
        self.common_dir = paths.get_data_dir(APP_NAME)
        self.data_dir = join('/var/snap', APP_NAME, 'current')
        self.config_dir = join(self.data_dir, 'config')
        self.extra_apps_dir = join(self.data_dir, 'extra-apps')
        self.occ = OCConsole(join(self.app_dir, OCC_RUNNER_PATH))
        self.nextcloud_config_path = join(self.data_dir, 'nextcloud', 'config')
        self.nextcloud_config_file = join(self.nextcloud_config_path,
                                          'config.php')
        self.cron = Cron(CRON_USER)
        self.db = Database(self.app_dir, self.data_dir, self.config_dir,
                           PSQL_PORT)
        self.oc_config = OCConfig(join(self.app_dir, 'bin/nextcloud-config'))
예제 #6
0
import sys
from syncloudlib.application.paths import get_data_dir

print(get_data_dir(sys.argv[1]))
예제 #7
0
import sys
from syncloudlib.application.paths import get_data_dir

print get_data_dir(sys.argv[1])
예제 #8
0
def test_api_data_path(data_dir):
    response = get_data_dir('platform')
    assert data_dir in response, response