You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by jo...@apache.org on 2013/07/18 00:40:27 UTC

git commit: [#6456] WIP (stash commit)

Updated Branches:
  refs/heads/cj/6456 38bba1b09 -> 0bce7ed80


[#6456] WIP (stash commit)

Signed-off-by: Cory Johns <cj...@slashdotmedia.com>


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/0bce7ed8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/0bce7ed8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/0bce7ed8

Branch: refs/heads/cj/6456
Commit: 0bce7ed80db991306b2572702e1367881eeb1392
Parents: 38bba1b
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Wed Jul 17 22:40:17 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Wed Jul 17 22:40:17 2013 +0000

----------------------------------------------------------------------
 .../forgeimporters/google/__init__.py           |  0
 ForgeImporters/forgeimporters/google/project.py | 41 ++++++++++++++++++++
 .../google/templates/project.html               | 31 +++++++++++++++
 ForgeImporters/forgeimporters/google/tracker.py | 13 +++++++
 ForgeImporters/setup.py                         |  2 +
 5 files changed, 87 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0bce7ed8/ForgeImporters/forgeimporters/google/__init__.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/google/__init__.py b/ForgeImporters/forgeimporters/google/__init__.py
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0bce7ed8/ForgeImporters/forgeimporters/google/project.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/google/project.py b/ForgeImporters/forgeimporters/google/project.py
new file mode 100644
index 0000000..7009d3a
--- /dev/null
+++ b/ForgeImporters/forgeimporters/google/project.py
@@ -0,0 +1,41 @@
+#       Licensed to the Apache Software Foundation (ASF) under one
+#       or more contributor license agreements.  See the NOTICE file
+#       distributed with this work for additional information
+#       regarding copyright ownership.  The ASF licenses this file
+#       to you under the Apache License, Version 2.0 (the
+#       "License"); you may not use this file except in compliance
+#       with the License.  You may obtain a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#       Unless required by applicable law or agreed to in writing,
+#       software distributed under the License is distributed on an
+#       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#       KIND, either express or implied.  See the License for the
+#       specific language governing permissions and limitations
+#       under the License.
+
+from tg import expose, validate
+from tg.decorators import with_trailing_slash
+from formencode import validators
+
+from allura.lib.decorators import require_post
+
+from .. import base
+
+
+class GoogleCodeProjectImporter(base.ProjectImporter):
+    source = 'Google Code'
+
+    @with_trailing_slash
+    @expose('jinja:forgeimporters.google:templates/project.html')
+    def index(self, **kw):
+        return {'importer': self}
+
+    @require_post()
+    @expose()
+    @validate(error_handler=index, validators={
+        'project_name': validators.PlainText(not_empty=True),
+        'tools': base.ToolsValidator(source)})
+    def process(self, project_name=None, tools=None, **kw):
+        return '<br/>\n'.join([str(project_name), str(tools)])

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0bce7ed8/ForgeImporters/forgeimporters/google/templates/project.html
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/google/templates/project.html b/ForgeImporters/forgeimporters/google/templates/project.html
new file mode 100644
index 0000000..6c9dd0c
--- /dev/null
+++ b/ForgeImporters/forgeimporters/google/templates/project.html
@@ -0,0 +1,31 @@
+{#-
+       Licensed to the Apache Software Foundation (ASF) under one
+       or more contributor license agreements.  See the NOTICE file
+       distributed with this work for additional information
+       regarding copyright ownership.  The ASF licenses this file
+       to you under the Apache License, Version 2.0 (the
+       "License"); you may not use this file except in compliance
+       with the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing,
+       software distributed under the License is distributed on an
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       KIND, either express or implied.  See the License for the
+       specific language governing permissions and limitations
+       under the License.
+-#}
+{% extends 'forgeimporters:templates/project_base.html' %}
+
+{% block project_fields %}
+    <div class="grid-4">
+        <label>Project Name</label>
+    </div>
+    <div class="grid-10">
+        <input name="project_name" value="{{c.form_values['project_name']}}"/>
+        {% if c.form_errors['project_name'] %}
+        <div class="error">{{c.form_errors['project_name']}}</div>
+        {% endif %}
+    </div>
+{% endblock %}

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0bce7ed8/ForgeImporters/forgeimporters/google/tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/google/tracker.py b/ForgeImporters/forgeimporters/google/tracker.py
new file mode 100644
index 0000000..983b38a
--- /dev/null
+++ b/ForgeImporters/forgeimporters/google/tracker.py
@@ -0,0 +1,13 @@
+
+from forgetracker.tracker_main import ForgeTrackerApp
+from ..base import ToolImporter
+
+
+class GoogleCodeTrackerImporter(ToolImporter):
+    source = 'Google Code'
+    target_app = ForgeTrackerApp
+    controller = None
+    tool_label = 'Issues'
+
+    def import_tool(self, project, mount_point):
+        pass

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0bce7ed8/ForgeImporters/setup.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/setup.py b/ForgeImporters/setup.py
index 5e45638..7738d1d 100644
--- a/ForgeImporters/setup.py
+++ b/ForgeImporters/setup.py
@@ -34,6 +34,8 @@ setup(name='ForgeImporters',
       entry_points="""
       # -*- Entry points: -*-
       [allura.project_importers]
+      google-code = forgeimporters.google.project:GoogleCodeProjectImporter
 
       [allura.importers]
+      google-code-tracker = forgeimporters.google.tracker:GoogleCodeTrackerImporter
       """,)