# Path: lanshark/configuration.py
# class Boolean(Key):
#     """Represents a bool"""
#     keytype = bool
#     def parse(self, value):
#         return (value.lower() != "false")
# 
# class Integer(Key):
#     """Represents a int"""
#     keytype = int
# 
# class String(Key):
#     """Represents a str"""
#     keytype = str
# 
# class StringList(List, String):
#     "list of strings"
#     pass
# 
# class Enum(String):
#     """Represents an enum"""
#     def __init__(self, default, values, doc):
#         """Creates new instance. `values` is a tuple of all valid enum
#         values"""
#         String.__init__(self, default, doc)
#         self.values = values
# 
#     def parse(self, value):
#         retval = String.parse(self, value)
#         if retval not in self.values:
#             raise ValueError('Invalid enum value %s' % retval)
#         return retval
# 
# Path: lanshark/configuration.py
# class Error(Exception):
# class Config(observable.Observable):
# class Key:
# class String(Key):
# class Integer(Key):
# class Float(float):
# class Boolean(Key):
# class Enum(String):
# class List:
# class StringList(List, String):
# class JSON(Key):
#     class TestConfig(Config):
#     def __init__(self, lineno, line, cause):
#     def __str__(self):
#     def __repr__(self):
#     def __init__(self):
#     def __setattr__(self, attr, value):
#     def load(self, f):
#     def _load(self, f):
#     def save(self, f):
#     def _save(self, f):
#     def __init__(self, default, doc):
#     def parse(self, value):
#     def dump(self, value):
#     def __repr__(self):
#     def parse(self, value):
#     def __init__(self, default, values, doc):
#     def parse(self, value):
#     def parse(self, value):
#         def parse(value):
#     def dump(self, value):
#         def dump(value):
#     def parse(self, value):
#     def dump(self, value):
# def test():


import os, sys
import socket
import locale
        import _winreg
                import psyco
import logging
from lanshark.configuration import Boolean, Integer, String, StringList, Enum
from lanshark import configuration
                         r"cover\.(png|jpg|gif)$",
                         r"(cover\-)?front\.(png|jpg|gif)$",
                         r"cover.*?\.(png|jpg|gif)$",
                         r"albumart.*?large\.jpg$",
                         r"albumart.*?\.jpg"],
            "regexps to match the folder images/covers")
    MAX_IMAGE_SIZE = Integer(250000,
            "Maximal size of preview images/covers to use")
    DAEMON_IN_GUI = Boolean(True,
            "Integrates daemon in the gui process")
    RESOLVE_HOSTS = Boolean(False, "Resolve hostnames")
    INDEX_INTERVAL = Integer(3600,
            "Interval to update the fileindex in seconds")
    GUI_ICON_SIZE = Integer(48, "Icon size in the gtkui")
    # thats a little hacky but works well ;)
    PID_FILE = String(os.path.join("$configdir", "lanshark.pid"),
            "Location of the pid file")
    SOCKET_TIMEOUT = Integer(5000, "The timeout of tcp sockets in ms")
    VIDEO_PLAYER = String(get_mediaplayer(),
            "Command to play video files %s gets replaced with "
            "the url to the video")
    AUDIO_PLAYER = String(get_mediaplayer(),
            "Command to play audio files %s gets replaced with"
            "the url to the audio file ")
    IMAGE_VIEWER = String(get_imageviewer(),
            "Command to view images files %s gets replaced with"
            "the url to the image ")
    DISABLE_WEBINTERFACE = Boolean(False, "Do not show html interface")
    FS_ENCODING = String(sys.getfilesystemencoding(), "Filesystem encoding")
    SYS_ENCODING = String(get_sys_encoding(), 'System Encoding')

# Path: lanshark/configuration.py
# class Boolean(Key):
#     """Represents a bool"""
#     keytype = bool
#     def parse(self, value):
#         return (value.lower() != "false")
# 
# class Integer(Key):
#     """Represents a int"""
#     keytype = int
# 
# class String(Key):
#     """Represents a str"""
#     keytype = str
# 
# class StringList(List, String):
#     "list of strings"
#     pass
# 
# class Enum(String):
#     """Represents an enum"""
#     def __init__(self, default, values, doc):
#         """Creates new instance. `values` is a tuple of all valid enum
#         values"""
#         String.__init__(self, default, doc)
#         self.values = values
# 
#     def parse(self, value):
#         retval = String.parse(self, value)
#         if retval not in self.values:
#             raise ValueError('Invalid enum value %s' % retval)
#         return retval
# 
# Path: lanshark/configuration.py
# class Error(Exception):
# class Config(observable.Observable):
# class Key:
# class String(Key):
# class Integer(Key):
# class Float(float):
# class Boolean(Key):
# class Enum(String):
# class List:
# class StringList(List, String):
# class JSON(Key):
#     class TestConfig(Config):
#     def __init__(self, lineno, line, cause):
#     def __str__(self):
#     def __repr__(self):
#     def __init__(self):
#     def __setattr__(self, attr, value):
#     def load(self, f):
#     def _load(self, f):
#     def save(self, f):
#     def _save(self, f):
#     def __init__(self, default, doc):
#     def parse(self, value):
#     def dump(self, value):
#     def __repr__(self):
#     def parse(self, value):
#     def __init__(self, default, values, doc):
#     def parse(self, value):
#     def parse(self, value):
#         def parse(value):
#     def dump(self, value):
#         def dump(value):
#     def parse(self, value):
#     def dump(self, value):
# def test():


# Path: lanshark/config.py
import os, sys
import socket
import locale
        import _winreg
                import psyco
import logging
from lanshark.configuration import Boolean, Integer, String, StringList, Enum
from lanshark import configuration

                         r"cover\.(png|jpg|gif)$",
                         r"(cover\-)?front\.(png|jpg|gif)$",
                         r"cover.*?\.(png|jpg|gif)$",
                         r"albumart.*?large\.jpg$",
                         r"albumart.*?\.jpg"],
            "regexps to match the folder images/covers")
    MAX_IMAGE_SIZE = Integer(250000,
            "Maximal size of preview images/covers to use")
    DAEMON_IN_GUI = Boolean(True,
            "Integrates daemon in the gui process")
    RESOLVE_HOSTS = Boolean(False, "Resolve hostnames")
    INDEX_INTERVAL = Integer(3600,
            "Interval to update the fileindex in seconds")
    GUI_ICON_SIZE = Integer(48, "Icon size in the gtkui")
    # thats a little hacky but works well ;)
    PID_FILE = String(os.path.join("$configdir", "lanshark.pid"),
            "Location of the pid file")
    SOCKET_TIMEOUT = Integer(5000, "The timeout of tcp sockets in ms")
    VIDEO_PLAYER = String(get_mediaplayer(),
            "Command to play video files %s gets replaced with "
            "the url to the video")
    AUDIO_PLAYER = String(get_mediaplayer(),
            "Command to play audio files %s gets replaced with"
            "the url to the audio file ")
    IMAGE_VIEWER = String(get_imageviewer(),
            "Command to view images files %s gets replaced with"
            "the url to the image ")
    DISABLE_WEBINTERFACE = Boolean(False, "Do not show html interface")
    FS_ENCODING = String(sys.getfilesystemencoding(), "Filesystem encoding")
    SYS_ENCODING = String(get_sys_encoding(), 'System Encoding')

    HOSTNAME = String(socket.gethostname(), "The name of your host/share")