import logging
import logging.handlers
import os
import random
import stat
import sys
import threading
import time
import urlgrabber
import urlparse
from xmlrpclib import ServerProxy
from SimpleXMLRPCServer import SimpleXMLRPCServer

# To modify configuration parameters, see /etc/intelligentmirror.conf .
# Read config file using Yum's config parsers.
mainconf = readMainConfig(readStartupConfig('/etc/intelligentmirror.conf', '/'))

# Global Options
base_dir = mainconf.base_dir
temp_dir = os.path.join(base_dir, mainconf.temp_dir)
max_parallel_downloads = int(mainconf.max_parallel_downloads)
cache_host =  mainconf.cache_host
rpc_host = mainconf.rpc_host
rpc_port = int(mainconf.rpc_port)
logfile = mainconf.logfile
max_logfile_size = int(mainconf.max_logfile_size) * 1024 * 1024
max_logfile_backups = int(mainconf.max_logfile_backups)
proxy = mainconf.proxy
proxy_username = mainconf.proxy_username
proxy_password = mainconf.proxy_password
import logging
import logging.handlers
import os
import random
import stat
import sys
import threading
import time
import urlgrabber
import urlparse
from xmlrpclib import ServerProxy
from SimpleXMLRPCServer import SimpleXMLRPCServer

# To modify configuration parameters, see /etc/intelligentmirror.conf .
# Read config file using Yum's config parsers.
mainconf = readMainConfig(readStartupConfig("/etc/intelligentmirror.conf", "/"))

# Global Options
base_dir = mainconf.base_dir
temp_dir = os.path.join(base_dir, mainconf.temp_dir)
max_parallel_downloads = int(mainconf.max_parallel_downloads)
cache_host = mainconf.cache_host
rpc_host = mainconf.rpc_host
rpc_port = int(mainconf.rpc_port)
logfile = mainconf.logfile
max_logfile_size = int(mainconf.max_logfile_size) * 1024 * 1024
max_logfile_backups = int(mainconf.max_logfile_backups)
proxy = mainconf.proxy
proxy_username = mainconf.proxy_username
proxy_password = mainconf.proxy_password
Ejemplo n.º 3
0
import logging
import logging.handlers
import os
import random
import re
import socket
import statvfs
import sys
import threading
import time
import urlgrabber
import urllib
import urllib2
import urlparse

mainconf =  readMainConfig(readStartupConfig('/etc/videocache.conf', '/'))

# Gloabl Options
enable_video_cache = int(mainconf.enable_video_cache)
base_dir_list = mainconf.base_dir.split('|')
base_dir = []
for dir in base_dir_list:
    try:
        dir_tup = [val.strip() for val in dir.split(':')]
        if len(dir_tup) == 1 or (len(dir_tup) == 2 and dir_tup[1] == ''):
            base_dir.append((dir_tup[0], 0))
        elif len(dir_tup) == 2:
            base_dir.append((dir_tup[0], int(dir_tup[1])))
    except:
        # WTF?? Can't even set cache directories properly
        pass