POKův kanál

pokův kanál

webdesign, linux a blog

Starting development of Fedora Statistics 2.0 with Moksha

09. 07. 2010, 08.14

We are trying to extend Statistics 2.0 module running inside of Fedora Community portal using Moksha web framework. When I was trying to get it working, I have used Statistics 2.0: The beginnings tutorial, but it looks to be slightly outdated, so I have jumped on #moksha on FreeNode IRC channel where lmacken provided great help. Thanks.

Installing Moksha

Packages in the repository are outdated, so we will build ours. First just install these packages: yum -y install python-paver pytz python-tw-jquery. And then build and install Moksha:

$ git clone git://git.fedorahosted.org/git/moksha $ cd noksha $ vim setup.py # comment-out ToscaWidgets in install_requires variable $ paver reinstall # this will build and try to install moksha rpms using sudo

I do not have sudo configured so when it was asking about my password, just pressed Ctrl+C and installed moksha manually - just package moksha is enough.

During build, I have seen few errors:

$ paver reinstall [...] mv dist/* ~/rpmbuild/SOURCES/ mv: cannot move `dist/moksha-0.4.4.tar.bz2' to `/home/pok/rpmbuild/SOURCES/': Not a directory Captured Task Output: --------------------- ---> pavement.reinstall rm -fr dist/ python setup.py sdist --format=bztar mv dist/* ~/rpmbuild/SOURCES/ Build failed running pavement.reinstall: Subprocess return code: 1

This simply meant I do not have SOURCES directory in my rpmbuild dir. Creating it done the trick.

$ paver reinstall [...] Running Sphinx v0.6.6 loading pickled environment... not found building [html]: targets for 47 source files that are out of date updating environment: 47 added, 0 changed, 0 removed reading sources... [ 2%] apps/MokshaMenus Exception occurred: File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 1948, in load entry = __import__(self.module_name, globals(),globals(), ['__name__']) ImportError: No module named menus.default The full traceback has been saved in /tmp/sphinx-err-8CbAPH.log, if you want to report the issue to the developers. Please also report this if it was a user error, so that a better error message can be provided next time. Either send bugs to the mailing list at , or report them in the tracker at . Thanks! make: *** [html] Error 1 make: Leaving directory `/home/pok/rpmbuild/BUILD/moksha-0.4.4/docs' error: Bad exit status from /var/tmp/rpm-tmp.pumQPz (%build) RPM build errors: Bad exit status from /var/tmp/rpm-tmp.pumQPz (%build) Captured Task Output: --------------------- ---> pavement.reinstall rm -fr dist/ python setup.py sdist --format=bztar mv dist/* ~/rpmbuild/SOURCES/ cp moksha.spec ~/rpmbuild/SPECS/ rpmbuild -ba ~/rpmbuild/SPECS/moksha.spec Build failed running pavement.reinstall: Subprocess return code: 1

This was caused by the fact, I had another moksha package installed.

Running Fedora Community

Checkout sources, configure plugins and run development server:

$ git clone git://git.fedorahosted.org/fedoracommunity.git $ cd fedoracommunity $ python setup.py egg_info $ paster serve development.ini

Adding HelloWorld page

To add some sample HelloWorld page you can use pre-created module (located in fedoracommunity/mokshaapps/helloworld/) in the sources and you have to edit config file, re-configure plug-ins and restart server.

$ vim development.ini $ vim setup.py $ python setup.py egg_info $ paster serve development.ini

You need to add this to the config to the fedoracommunity.mainnav.apps list:

MokshaApp('HelloWorld','fedoracommunity.helloworld', params={'username': None}),

And in the setup.py in section [moksha.application] add line:

fedoracommunity.helloworld = fedoracommunity.mokshaapps.helloworld.controllers.root:RootController

Starší příspěvky...

Kolem 17:00 mě někdo začal buzerovat protože sem ještě běhal v pyžamě

--Leonr

Popelnice Evropy

Počítadlo - Toplist.cz

Copyleft 2005 pok, http://jhutar.ic.cz