from django.conf.urls.defaults import url, include, patterns
from corehq.apps.appstore.dispatcher import AppstoreDispatcher

store_urls = patterns('corehq.apps.appstore.views',
    url(r'^$', 'appstore_default', name="appstore_interfaces_default"),
    AppstoreDispatcher.url_pattern(),
)

urlpatterns = patterns('corehq.apps.appstore.views',
    url(r'^$', 'appstore', name='appstore'),
    url(r'^api/', 'appstore_api', name='appstore_api'),
    url(r'^store/', include(store_urls)),

    url(r'^(?P<domain>[\w\.-]+)/info/$', 'project_info', name='project_info'),

    url(r'^deployments/$', 'deployments', name='deployments'),
    url(r'^deployments/api/$', 'deployments_api', name='deployments_api'),
    url(r'^deployments/(?P<domain>[\w\.-]+)/info/$', 'deployment_info', name='deployment_info'),

    url(r'^(?P<domain>[\w\.-]+)/approve/$', 'approve_app', name='approve_appstore_app'),
    url(r'^(?P<domain>[\w\.-]+)/copy/$', 'copy_snapshot', name='domain_copy_snapshot'),
    url(r'^(?P<domain>[\w\.-]+)/importapp/$', 'import_app', name='import_app_from_snapshot'),
    url(r'^(?P<domain>[\w\.-]+)/image/$', 'project_image', name='appstore_project_image'),
    url(r'^(?P<domain>[\w\.-]+)/multimedia/$', 'media_files', name='media_files'),
)


[((181, 246), 'django.conf.urls.defaults.url', 'url', (['"""^$"""', '"""appstore_default"""'], {'name': '"""appstore_interfaces_default"""'}), "('^$', 'appstore_default', name='appstore_interfaces_default')\n", (184, 246), False, 'from django.conf.urls.defaults import url, include, patterns\n'), ((253, 285), 'corehq.apps.appstore.dispatcher.AppstoreDispatcher.url_pattern', 'AppstoreDispatcher.url_pattern', ([], {}), '()\n', (283, 285), False, 'from corehq.apps.appstore.dispatcher import AppstoreDispatcher\n'), ((347, 385), 'django.conf.urls.defaults.url', 'url', (['"""^$"""', '"""appstore"""'], {'name': '"""appstore"""'}), "('^$', 'appstore', name='appstore')\n", (350, 385), False, 'from django.conf.urls.defaults import url, include, patterns\n'), ((392, 441), 'django.conf.urls.defaults.url', 'url', (['"""^api/"""', '"""appstore_api"""'], {'name': '"""appstore_api"""'}), "('^api/', 'appstore_api', name='appstore_api')\n", (395, 441), False, 'from django.conf.urls.defaults import url, include, patterns\n'), ((491, 565), 'django.conf.urls.defaults.url', 'url', (['"""^(?P<domain>[\\\\w\\\\.-]+)/info/$"""', '"""project_info"""'], {'name': '"""project_info"""'}), "('^(?P<domain>[\\\\w\\\\.-]+)/info/$', 'project_info', name='project_info')\n", (494, 565), False, 'from django.conf.urls.defaults import url, include, patterns\n'), ((571, 627), 'django.conf.urls.defaults.url', 'url', (['"""^deployments/$"""', '"""deployments"""'], {'name': '"""deployments"""'}), "('^deployments/$', 'deployments', name='deployments')\n", (574, 627), False, 'from django.conf.urls.defaults import url, include, patterns\n'), ((634, 702), 'django.conf.urls.defaults.url', 'url', (['"""^deployments/api/$"""', '"""deployments_api"""'], {'name': '"""deployments_api"""'}), "('^deployments/api/$', 'deployments_api', name='deployments_api')\n", (637, 702), False, 'from django.conf.urls.defaults import url, include, patterns\n'), ((709, 806), 'django.conf.urls.defaults.url', 'url', (['"""^deployments/(?P<domain>[\\\\w\\\\.-]+)/info/$"""', '"""deployment_info"""'], {'name': '"""deployment_info"""'}), "('^deployments/(?P<domain>[\\\\w\\\\.-]+)/info/$', 'deployment_info', name=\n    'deployment_info')\n", (712, 806), False, 'from django.conf.urls.defaults import url, include, patterns\n'), ((807, 896), 'django.conf.urls.defaults.url', 'url', (['"""^(?P<domain>[\\\\w\\\\.-]+)/approve/$"""', '"""approve_app"""'], {'name': '"""approve_appstore_app"""'}), "('^(?P<domain>[\\\\w\\\\.-]+)/approve/$', 'approve_app', name=\n    'approve_appstore_app')\n", (810, 896), False, 'from django.conf.urls.defaults import url, include, patterns\n'), ((896, 984), 'django.conf.urls.defaults.url', 'url', (['"""^(?P<domain>[\\\\w\\\\.-]+)/copy/$"""', '"""copy_snapshot"""'], {'name': '"""domain_copy_snapshot"""'}), "('^(?P<domain>[\\\\w\\\\.-]+)/copy/$', 'copy_snapshot', name=\n    'domain_copy_snapshot')\n", (899, 984), False, 'from django.conf.urls.defaults import url, include, patterns\n'), ((984, 1078), 'django.conf.urls.defaults.url', 'url', (['"""^(?P<domain>[\\\\w\\\\.-]+)/importapp/$"""', '"""import_app"""'], {'name': '"""import_app_from_snapshot"""'}), "('^(?P<domain>[\\\\w\\\\.-]+)/importapp/$', 'import_app', name=\n    'import_app_from_snapshot')\n", (987, 1078), False, 'from django.conf.urls.defaults import url, include, patterns\n'), ((1078, 1169), 'django.conf.urls.defaults.url', 'url', (['"""^(?P<domain>[\\\\w\\\\.-]+)/image/$"""', '"""project_image"""'], {'name': '"""appstore_project_image"""'}), "('^(?P<domain>[\\\\w\\\\.-]+)/image/$', 'project_image', name=\n    'appstore_project_image')\n", (1081, 1169), False, 'from django.conf.urls.defaults import url, include, patterns\n'), ((1169, 1247), 'django.conf.urls.defaults.url', 'url', (['"""^(?P<domain>[\\\\w\\\\.-]+)/multimedia/$"""', '"""media_files"""'], {'name': '"""media_files"""'}), "('^(?P<domain>[\\\\w\\\\.-]+)/multimedia/$', 'media_files', name='media_files')\n", (1172, 1247), False, 'from django.conf.urls.defaults import url, include, patterns\n'), ((464, 483), 'django.conf.urls.defaults.include', 'include', (['store_urls'], {}), '(store_urls)\n', (471, 483), False, 'from django.conf.urls.defaults import url, include, patterns\n')]