Index: /quintagroup.skin.switcher/branches/domain_or_path/README.txt
===================================================================
--- /quintagroup.skin.switcher/branches/domain_or_path/README.txt	(revision 1838)
+++ /quintagroup.skin.switcher/branches/domain_or_path/README.txt	(revision 1838)
@@ -0,0 +1,20 @@
+Introduction
+============
+
+Overview
+--------
+A product for switching themes by domain.
+
+Installation
+------------
+Using portal_setup/quickinstaller - install product
+
+Than in portal_properties/skin_switcher properties sheet
+set following properties:
+
+  - domain prefix for skin switching in 'theme_switch_prefix' property.
+  - theme name for switching to if domain starts with specified prefix
+
+If in config module 'USE_FS_CONFIG' set to `True` - than installation
+not needed. This case usefull for zope instance with single plone
+instance.
Index: /quintagroup.skin.switcher/branches/domain_or_path/docs/HISTORY.txt
===================================================================
--- /quintagroup.skin.switcher/branches/domain_or_path/docs/HISTORY.txt	(revision 1838)
+++ /quintagroup.skin.switcher/branches/domain_or_path/docs/HISTORY.txt	(revision 1838)
@@ -0,0 +1,13 @@
+Changelog
+=========
+
+0.2 (unreleased)
+----------------
+
+- Nothing changed yet.
+
+
+0.1 (2009-03-05)
+----------------
+
+* Initial release
Index: /quintagroup.skin.switcher/branches/domain_or_path/quintagroup/__init__.py
===================================================================
--- /quintagroup.skin.switcher/branches/domain_or_path/quintagroup/__init__.py	(revision 1838)
+++ /quintagroup.skin.switcher/branches/domain_or_path/quintagroup/__init__.py	(revision 1838)
@@ -0,0 +1,6 @@
+# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
+try:
+    __import__('pkg_resources').declare_namespace(__name__)
+except ImportError:
+    from pkgutil import extend_path
+    __path__ = extend_path(__path__, __name__)
Index: /quintagroup.skin.switcher/branches/domain_or_path/quintagroup/skin/__init__.py
===================================================================
--- /quintagroup.skin.switcher/branches/domain_or_path/quintagroup/skin/__init__.py	(revision 1838)
+++ /quintagroup.skin.switcher/branches/domain_or_path/quintagroup/skin/__init__.py	(revision 1838)
@@ -0,0 +1,6 @@
+# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
+try:
+    __import__('pkg_resources').declare_namespace(__name__)
+except ImportError:
+    from pkgutil import extend_path
+    __path__ = extend_path(__path__, __name__)
Index: /quintagroup.skin.switcher/branches/domain_or_path/quintagroup/skin/switcher/config.py
===================================================================
--- /quintagroup.skin.switcher/branches/domain_or_path/quintagroup/skin/switcher/config.py	(revision 1838)
+++ /quintagroup.skin.switcher/branches/domain_or_path/quintagroup/skin/switcher/config.py	(revision 1838)
@@ -0,0 +1,4 @@
+USE_FS_CONFIG = False
+DO_SWITCH = False
+SKIN_SWITCH_PREFIX = 'm.'
+SWITCH_THEME = ''
Index: /quintagroup.skin.switcher/branches/domain_or_path/quintagroup/skin/switcher/configure.zcml
===================================================================
--- /quintagroup.skin.switcher/branches/domain_or_path/quintagroup/skin/switcher/configure.zcml	(revision 1838)
+++ /quintagroup.skin.switcher/branches/domain_or_path/quintagroup/skin/switcher/configure.zcml	(revision 1838)
@@ -0,0 +1,21 @@
+<configure
+  xmlns="http://namespaces.zope.org/zope"
+  xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
+  xmlns:five="http://namespaces.zope.org/five">
+
+  <genericsetup:registerProfile
+    name="default"
+    title="quintagroup skin switcher"
+    directory="profiles/default"
+    description='Extension profile for the quintagroup.skin.switcher'
+    provides="Products.GenericSetup.interfaces.EXTENSION"
+    />
+
+
+  <subscriber
+    for="Products.CMFPlone.interfaces.siteroot.IPloneSiteRoot
+    zope.app.publication.interfaces.IBeforeTraverseEvent"
+    handler=".skinswitcher.setSkin"
+    />
+
+</configure>
Index: /quintagroup.skin.switcher/branches/domain_or_path/quintagroup/skin/switcher/profiles/default/metadata.xml
===================================================================
--- /quintagroup.skin.switcher/branches/domain_or_path/quintagroup/skin/switcher/profiles/default/metadata.xml	(revision 1838)
+++ /quintagroup.skin.switcher/branches/domain_or_path/quintagroup/skin/switcher/profiles/default/metadata.xml	(revision 1838)
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<metadata>
+  <version>0.1</version>
+</metadata>
Index: /quintagroup.skin.switcher/branches/domain_or_path/quintagroup/skin/switcher/profiles/default/propertiestool.xml
===================================================================
--- /quintagroup.skin.switcher/branches/domain_or_path/quintagroup/skin/switcher/profiles/default/propertiestool.xml	(revision 1838)
+++ /quintagroup.skin.switcher/branches/domain_or_path/quintagroup/skin/switcher/profiles/default/propertiestool.xml	(revision 1838)
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<object name="portal_properties" meta_type="Plone Properties Tool">
+ <object name="skin_switcher" meta_type="Plone Property Sheet">
+   <property name="do_switch" type="boolean">False</property>
+   <property name="theme_switch_prefix" type="string">m.</property>
+   <property name="switch_theme" type="string"></property>
+ </object>
+</object>
Index: /quintagroup.skin.switcher/branches/domain_or_path/quintagroup/skin/switcher/skinswitcher.py
===================================================================
--- /quintagroup.skin.switcher/branches/domain_or_path/quintagroup/skin/switcher/skinswitcher.py	(revision 1838)
+++ /quintagroup.skin.switcher/branches/domain_or_path/quintagroup/skin/switcher/skinswitcher.py	(revision 1838)
@@ -0,0 +1,32 @@
+from urlparse import urlsplit
+
+from Products.CMFCore.utils import getToolByName
+
+from config import *
+
+def setSkin(site, event):
+    ps = getToolByName(site,'portal_skins')
+
+    if USE_FS_CONFIG:
+        do_switch = DO_SWITCH
+        pref = SKIN_SWITCH_PREFIX
+        switch_theme = SWITCH_THEME
+    else:
+        pp = getToolByName(site,'portal_properties')
+        ss = getattr(pp,'skin_switcher',None)
+        if not ss:
+            return
+        pref = ss.getProperty('theme_switch_prefix', SKIN_SWITCH_PREFIX)
+        switch_theme = ss.getProperty('switch_theme', SWITCH_THEME)
+        do_switch = ss.getProperty('do_switch', DO_SWITCH)
+
+    if not do_switch:
+        return
+
+    avail_skins = ps.getSkinSelections()
+    if not (pref and switch_theme and switch_theme in avail_skins):
+       return
+
+    scheme, netloc, path, query, fragm = urlsplit(event.request.URL)
+    if netloc.startswith(pref):
+        site.changeSkin(switch_theme, event.request)
Index: /quintagroup.skin.switcher/branches/domain_or_path/setup.cfg
===================================================================
--- /quintagroup.skin.switcher/branches/domain_or_path/setup.cfg	(revision 1838)
+++ /quintagroup.skin.switcher/branches/domain_or_path/setup.cfg	(revision 1838)
@@ -0,0 +1,3 @@
+[egg_info]
+tag_build = dev
+tag_svn_revision = true
Index: /quintagroup.skin.switcher/branches/domain_or_path/setup.py
===================================================================
--- /quintagroup.skin.switcher/branches/domain_or_path/setup.py	(revision 1838)
+++ /quintagroup.skin.switcher/branches/domain_or_path/setup.py	(revision 1838)
@@ -0,0 +1,32 @@
+from setuptools import setup, find_packages
+import os
+
+version = '0.2'
+
+setup(name='quintagroup.skin.switcher',
+      version=version,
+      description="Package for switching skin by domain prefix",
+      long_description=open("README.txt").read() + "\n" +
+                       open(os.path.join("docs", "HISTORY.txt")).read(),
+      # Get more strings from http://www.python.org/pypi?%3Aaction=list_classifiers
+      classifiers=[
+        "Programming Language :: Python",
+        "Topic :: Software Development :: Libraries :: Python Modules",
+        ],
+      keywords='Quintagroup skin switching',
+      author='Quintagroup',
+      author_email='support@quintgroup.com',
+      url='quintagroup.com',
+      license='GPL',
+      packages=find_packages(exclude=['ez_setup']),
+      namespace_packages=['quintagroup', 'quintagroup.skin'],
+      include_package_data=True,
+      zip_safe=False,
+      install_requires=[
+          'setuptools',
+          # -*- Extra requirements: -*-
+      ],
+      entry_points="""
+      # -*- Entry points: -*-
+      """,
+      )
