Commit a6ea3966cd92870ea2c5c34f980de556a969cedf

Authored by Gust
1 parent 69e35926

Change repository structure, enable pip install

.gitignore 0 → 100644
@@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
  1 +*.egg*
  2 +*pyc
MANIFEST.in 0 → 100644
@@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
  1 +include README.rst
  2 +include MANIFEST.in
  3 +recursive-include colab_spb *.html *.txt *.xml
  4 +recursive-exclude * __pycache__
  5 +recursive-exclude * *.py[co]
  6 +include requirements.txt
README.rst 0 → 100644
@@ -0,0 +1,75 @@ @@ -0,0 +1,75 @@
  1 +.. -*- coding: utf-8 -*-
  2 +
  3 +.. highlight:: rest
  4 +
  5 +.. _colab_software:
  6 +
  7 +=================================
  8 +Colab-Spb - A Gitlab-Noosfero Connector for the SPB
  9 +=================================
  10 +
  11 +
  12 +
  13 +What is Colab?
  14 +==============
  15 +
  16 +Application that integrates existing systems to represent the contributions of the members through:
  17 +
  18 +* Discussions at the mailman list.
  19 +
  20 +* And other systems in the community.
  21 +
  22 +
  23 +
  24 +Features
  25 +========
  26 +
  27 +* Developed by Interlegis Communities http://colab.interlegis.leg.br/
  28 +
  29 +* Written in Python http://python.org/
  30 +
  31 +* Built with Django Web Framework https://www.djangoproject.com/
  32 +
  33 +* Search engine with Solr https://lucene.apache.org/solr/
  34 +
  35 +
  36 +
  37 +Installation
  38 +============
  39 +
  40 +After installing the colab
  41 +
  42 +.. code-block::
  43 +
  44 + pip install colab-spb
  45 +
  46 +Create a colab plugin configuration fila with at least the following:
  47 +
  48 +.. code-block::
  49 +
  50 + vim /etc/colab/plugins.d/colab_spb.py
  51 +
  52 + name='colab_spb'
  53 +
  54 +Running Colab
  55 +=============
  56 +
  57 +To run Colab with development server you will have to:
  58 +
  59 +1- Create the example configuration file:
  60 +
  61 +.. code-block::
  62 +
  63 + colab-init-config > /etc/colab/settings.py
  64 +
  65 +2- Edit the configuration file. Make sure you set everything you need including **database** credentials.
  66 +
  67 +3- Run the development server:
  68 +
  69 +.. code-block::
  70 +
  71 + colab-admin runserver 0.0.0.0:8000
  72 +
  73 +
  74 +**NOTE**: In case you want to keep the configuration file else where just set the
  75 +desired location in environment variable **COLAB_SETTINGS**.
__init__.py
@@ -1,3 +0,0 @@ @@ -1,3 +0,0 @@
1 -from django.contrib import admin  
2 -  
3 -# Register your models here.  
colab_spb/__init__.py 0 → 100644
@@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
  1 +__version__ = '0.1.0'
  2 +
  3 +default_app_config = 'colab_spb.apps.SpbAppConfig'
colab_spb/admin.py 0 → 100644
@@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
  1 +from django.contrib import admin
  2 +
  3 +# Register your models here.
colab_spb/apps.py 0 → 100644
@@ -0,0 +1,7 @@ @@ -0,0 +1,7 @@
  1 +
  2 +from django.apps import AppConfig
  3 +
  4 +
  5 +class SpbAppConfig(AppConfig):
  6 + name = 'colab.plugins.colab_spb'
  7 + verbose_name = 'SPB'
colab_spb/migrations/__init__.py 0 → 100644
colab_spb/models.py 0 → 100644
@@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
  1 +from django.db import models
  2 +
  3 +# Create your models here.
colab_spb/urls.py 0 → 100644
@@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
  1 +from django.conf.urls import patterns, url
  2 +
  3 +
  4 +urlpatterns = patterns('',
  5 +)
colab_spb/views.py 0 → 100644
@@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
  1 +from django.shortcuts import render
  2 +
  3 +# Create your views here.
migrations/__init__.py
models.py
@@ -1,3 +0,0 @@ @@ -1,3 +0,0 @@
1 -from django.db import models  
2 -  
3 -# Create your models here.  
requirements.txt 0 → 100644
@@ -0,0 +1 @@ @@ -0,0 +1 @@
  1 +colab
0 \ No newline at end of file 2 \ No newline at end of file
setup.py 0 → 100644
@@ -0,0 +1,54 @@ @@ -0,0 +1,54 @@
  1 +import codecs
  2 +import os
  3 +import re
  4 +
  5 +from setuptools import setup
  6 +
  7 +# if you are not using vagrant, just delete os.link directly,
  8 +# The hard link only saves a little disk space, so you should not care
  9 +if os.environ.get('USER', '') == 'vagrant':
  10 + del os.link
  11 +
  12 +def read(*parts):
  13 + return codecs.open(os.path.join(os.path.dirname(__file__), *parts),
  14 + encoding='utf8').read()
  15 +
  16 +
  17 +def find_version(*file_paths):
  18 + version_file = read(*file_paths)
  19 + version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
  20 + version_file, re.M)
  21 + if version_match:
  22 + return version_match.group(1)
  23 + raise RuntimeError("Unable to find version string.")
  24 +
  25 +
  26 +setup(
  27 + name='colab-spb',
  28 + url='https://github.com/colab/colab-spb',
  29 + description='Yet another Django reverse proxy application.',
  30 + version=find_version('colab_spb/__init__.py'),
  31 + long_description=read('README.rst'),
  32 + packages=['colab_spb'],
  33 + install_requires=[
  34 + 'colab',
  35 + ],
  36 + tests_require=['mock'],
  37 + test_suite="tests.run.runtests",
  38 + author='Sergio Oliveira',
  39 + author_email='sergio@tracy.com.br',
  40 + license='GPL 2.0',
  41 + classifiers=[
  42 + 'Development Status :: 3 - Alpha',
  43 + 'Environment :: Web Environment',
  44 + 'Framework :: Django',
  45 + 'Intended Audience :: Developers',
  46 + 'Operating System :: OS Independent',
  47 + 'Programming Language :: Python',
  48 + 'Programming Language :: Python :: 2',
  49 + 'Programming Language :: Python :: 2.7',
  50 + 'Topic :: Internet :: WWW/HTTP',
  51 + 'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
  52 + 'Topic :: Internet :: WWW/HTTP :: WSGI',
  53 + ],
  54 +)
@@ -1,3 +0,0 @@ @@ -1,3 +0,0 @@
1 -from django.test import TestCase  
2 -  
3 -# Create your tests here.  
tests/__init__.py 0 → 100644
tests/config_settings.py 0 → 100644
@@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
  1 +SECRET_KEY = 'ddddddddddddddddddddddddddddddddddddddddddddddddddddddaddddddddd'
  2 +
  3 +DATABASES = {
  4 + 'default': {
  5 + 'ENGINE': 'django.db.backends.sqlite3',
  6 + 'NAME': 'colab.sqlite',
  7 + }
  8 +}
  9 +
tests/plugins.d/gitlab.py 0 → 100644
@@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
  1 +from django.utils.translation import ugettext_lazy as _
  2 +from colab.plugins.utils.menu import colab_url_factory
  3 +
  4 +name = 'colab_spb'
  5 +verbose_name = 'Spb plugin'
  6 +
  7 +urls = {
  8 + 'include': 'colab_spb.urls',
  9 + 'namespace': 'spb',
  10 + 'prefix': 'spb',
  11 +}
  12 +
tests/run.py 0 → 100755
@@ -0,0 +1,37 @@ @@ -0,0 +1,37 @@
  1 +#!/usr/bin/env python
  2 +
  3 +import os
  4 +import sys
  5 +
  6 +os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'
  7 +os.environ['COLAB_SETTINGS'] = 'tests/config_settings.py'
  8 +os.environ['COLAB_YAML_SETTINGS'] = 'tests/settings.yaml'
  9 +os.environ['COLAB_PLUGINS'] = 'tests/plugins.d'
  10 +os.environ['COVERAGE_PROCESS_START'] = '.coveragerc'
  11 +os.environ['REUSE_DB'] = '0'
  12 +
  13 +import django
  14 +import coverage
  15 +
  16 +from django.test.utils import get_runner
  17 +from django.conf import settings
  18 +
  19 +
  20 +def runtests():
  21 + if django.VERSION >= (1, 7, 0):
  22 + django.setup()
  23 +
  24 + test_runner = get_runner(settings)
  25 + failures = test_runner(interactive=False, failfast=False).run_tests([])
  26 + sys.exit(failures)
  27 +
  28 +
  29 +def run_with_coverage():
  30 + if os.path.exists('.coverage'):
  31 + os.remove('.coverage')
  32 + coverage.process_startup()
  33 + runtests()
  34 +
  35 +
  36 +if __name__ == '__main__':
  37 + run_with_coverage()
tests/settings.py 0 → 100644
@@ -0,0 +1,39 @@ @@ -0,0 +1,39 @@
  1 +from colab.settings import * # noqa
  2 +
  3 +SOCIAL_NETWORK_ENABLED = True
  4 +STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'
  5 +
  6 +LOGGING = {
  7 + 'version': 1,
  8 +
  9 + 'handlers': {
  10 + 'null': {
  11 + 'level': 'DEBUG',
  12 + 'class': 'logging.NullHandler',
  13 + },
  14 + },
  15 +
  16 + 'loggers': {
  17 + 'colab.mailman': {
  18 + 'handlers': ['null'],
  19 + 'propagate': False,
  20 + },
  21 + 'haystack': {
  22 + 'handlers': ['null'],
  23 + 'propagate': False,
  24 + },
  25 + 'pysolr': {
  26 + 'handlers': ['null'],
  27 + 'propagate': False,
  28 + },
  29 + },
  30 +}
  31 +
  32 +import os
  33 +HAYSTACK_CONNECTIONS = {
  34 + 'default': {
  35 + 'ENGINE': 'haystack.backends.solr_backend.SolrEngine',
  36 + 'URL': 'http://127.0.0.1:8983/solr'
  37 + },
  38 +}
  39 +
@@ -1,3 +0,0 @@ @@ -1,3 +0,0 @@
1 -from django.shortcuts import render  
2 -  
3 -# Create your views here.