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)
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)
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']
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
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'))
import sys from syncloudlib.application.paths import get_data_dir print(get_data_dir(sys.argv[1]))
import sys from syncloudlib.application.paths import get_data_dir print get_data_dir(sys.argv[1])
def test_api_data_path(data_dir): response = get_data_dir('platform') assert data_dir in response, response