[prev in list] [next in list] [prev in thread] [next in thread] 

List:       samba-technical
Subject:    SWAT2 some steps to get it working
From:       <jahn.matthias () freenet ! de>
Date:       2012-12-30 21:53:08
Message-ID: vmime.50e0b7c4.b0f.ab6427dc3c74dc84 () localhost ! localdomain
[Download RAW message or body]

Hello,

recently i did some tests with SWAT2 and SAMBA (git master).
To get it running with ubuntu 12.4 i did:

1.
apt-get install python-pylons python-yaml python-repoze.who-plugins python-repoze.who \
python-paste python-pam python-authkit libjs-mootools  (the deeps from Jelmer \
Vernooij's debian package)

2. apply the attached patch

3. in a shell:  export PYTHONPATH=[PATH to SAMBA4]/lib/python2.7/  
for me "export PYTHONPATH=/usr/local/samba/lib/python2.7/site-packages"


4. in your swat2 git checkout:
paster serve development.ini

5. now you could connect to swat2: http://127.0.0.1:5000

I was not able yet to start swat2 from samba (server services = +web)


Regards,

Matthias Jahn


["0001-pylons-url_for-deprecated.-change-url_for-to-url.patch" (text/x-diff)]

From 53e4065e0cc13e2262b218a43f24b11e9eab90a6 Mon Sep 17 00:00:00 2001
From: Matthias Jahn <jahn.matthias@freenet.de>
Date: Sun, 30 Dec 2012 22:45:48 +0100
Subject: [PATCH] - pylons url_for deprecated. change url_for to url - fix a
 mistake in pagination.mako range() only accept integers

---
 swat/controllers/account.py                      |    6 +++---
 swat/templates/default/component/pagination.mako |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/swat/controllers/account.py b/swat/controllers/account.py
index 64c1796..101555c 100644
--- a/swat/controllers/account.py
+++ b/swat/controllers/account.py
@@ -17,7 +17,7 @@ import logging
 
 from formencode import variabledecode
 from pylons import request, tmpl_context as c, url
-from pylons.controllers.util import redirect, url_for
+from pylons.controllers.util import redirect
 
 from swat.lib.base import BaseController, render
 from swat.lib.samr_manager import SAMPipeManager, User, Group
@@ -137,7 +137,7 @@ class AccountController(BaseController):
             SwatMessages.add(message, type)
             
             if subaction == "save_add":
-                redirect(url_for("with_subaction", controller='account', \
action="user", subaction="add")) +                redirect(url("with_subaction", \
controller='account', action="user", subaction="add"))  elif subaction == "save":
                 redirect(url(controller='account', action='user'))
             elif subaction == "apply":
@@ -271,7 +271,7 @@ class AccountController(BaseController):
             SwatMessages.add(message, type)
             
             if subaction == "save_add":
-                redirect(url_for("with_subaction", controller='account', \
action="group", subaction="add")) +                redirect(url("with_subaction", \
controller='account', action="group", subaction="add"))  elif subaction == "save":
                 redirect(url(controller='account', action='group'))
             elif subaction == "apply":
diff --git a/swat/templates/default/component/pagination.mako \
b/swat/templates/default/component/pagination.mako index 3f7546e..71bb4fa 100644
--- a/swat/templates/default/component/pagination.mako
+++ b/swat/templates/default/component/pagination.mako
@@ -42,7 +42,7 @@
                 </li>
             % endif
             
-            % for i in range(1, total_pages + 1):
+            % for i in range(1, int(total_pages + 1)):
                 <% current_item_class = "" %>
                 
                 <%doc>FIXME if per_page is one all items will be highlighted</%doc>
-- 
1.7.9.5



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic