Blog
Best vacation - so far
After some time I blog again. Year wasn't that good to me (so far), after some fighting with my eyes, they finally gave up and now they are again working as they should. Almost as good as before.
But that didn't stop me from my biggest adventure so far. As you might have heard, I moved to Sevilla almost 2 year ago in search of more sun. Funny ... that the actual reason. I met some wonderful people, made some new till-dead-do-us-part friendship, worked with some extra awesome and smart people (Yaco) and even learn a new language. Who knew that you can learn Spanish faster then C++. Well now I know, good for me.
As all goodbyes also this one is hard and I just can not say how much I will miss Sevilla since it really grew to me. But don't believe me, go to Sevilla and check it yourself. If you need advise from (ex)local, just ask me. :)
So where next? Let me take you on a trip...
We (me and girlfriend) flew to Sevilla, jump into my car, fill it up with my stuff and head across Europe. To Gandsk. Yes people, that's north of Poland. 4200km. With my car. Yes the car people think will not make it around the corner. But proper love and carrying, and you can do impossible stuff.
Passing trough Spain was hot and fast. Reaching San Sebastian on day 3. Then going village by village trough countryside of France, beautiful. I must say I've seen more cathedrals and more castles then never before. Somewhere in the middle that cold wind from the south start blowing and we knew that we have to adjust our route. Easy. Why not visit Belgium. Brugge. Next stop Amsterdam. I only wish hostels there were cheaper, so we could spend more time. I guess we will just have to return. Visit friends in Arnhem (you know them all very well, cool guys from fourdigits). Then visit Bremen, but weather was getting worse and worse. During the day it was not more then 15*C which kinda kills all the fun. So we drove almost without the stop to Gdansk.
This is extra short summary. To write everything would be too long so here is short movie I did (10:00min). Happy to be here and Sad because I had to leave.
New country. New culture. New adventures. Bring it on!
artsprint report: snipmate again alive
Not that I doubted it wouldn't be nice, but for sure it was a lot of fun. Actually it was different from all the other sprints I attended. There was no real goal for the sprint, except have fun and work on stuff you love.
We even have a culture sidetrack of the sprint, which sadly I wasn't attending that much, my German is still too poor for going into theaters, but its improving. Soon I will speak flawlessly a mixture of English, German and Spanish.
While sprint was on our way there was also
Sprint topics
Since quite some time passed I hope you will forgive me if forgot something. But here are the topics I can remember people were working on:
- node (not nodejs): to describe it with one sentence is hard, maybe best fit would be: "It is everything and nothing"
- plumber: Plumbing, an alternative to subclassing.
- yafowil (Yet Another Form Widget Library): using above mentions node and plumber to create form widget.
- plone.app.event: recurrence events for Plone. This was also a reason why I came, but sadly didn't make any progress. Still we put all of remaining issues on the paper (also in Plone issue tracker) so hopefully with days coming I will be able to devote some time and continue work on it.
- dotfiles-vim: I mostly spent time working on vim configuration and make it reusable. Especially I was looking how to make development of Javascript easier, since as a beginner I need all the help I can get.
(please kick my butt and say it in the comments what I'm missing)
Snipmate
Besides dotfiles-vim I was learning about Javascript, and played with many of its libraries: Aloha-Editor, backbone, doodle, jsdom, nodejs, npm, qunit, underscore.
I've done some small experiments with them and hopefully in next posts I will be able to finish blogpost about my first thoughts on Javascript.
As thing that took me most of the time on the sprint is that I took maintenance of snipmate, vim add-on which you are probably using if you are using vim and also. Sadly I had to do fork since original author is not responding. I did a review of all pending Pull Requests and merged them. Since then I'm testing it and hopefully we will soon see release. More about it you can read here.
Message I send to all waiting for their pull requests to be merged:
After several unsuccessful attempts of contacting Michael Sanders, no commits in last half year and long pull request line on github (none of pull requests were commented/replied/rejected) I decided to take action and step up and bring some love to this widly used plugin. But nothing to worry about. We all get busy, accupied with our daily work or just lose interest in doing boring maintainance. While reviewing pull requests on github.com/msanders I found lots of great improvements and I decided to **friendly** fork it, review and apply patches that were sent, notify all the patch submiters and decided to do maintainance of snipmate.vim from now on. Ofcourse if somebody want to help, please don't hesitate to write me, I'm open to all suggestions. The only thing in what I'm not interested is leaving things like they are now. Maybe I'll only maintain it for a while until Michael Sanders takes things back into his hand or until some other super-hero shows up. Tnx and happy snipmating, Rok Garbas, 2011-02-02
As last I would like to say Thank you, Gogo for organizing it. It was amazing.
Send patches using git send-email
I'm going to show you how easy it is to setup and send patches from where you write your code. Why is that important? Well in my case I want to bring some attention on mailing list about things I'm working on, before I will commit them and create mess in trunk. Also changes are not that big that I would create new branch for it. Of course I could send very long email explaining with my English, but in most cases it would be nice to send patches with my comments so others can quickly test and see what I really meant without messing up trunk.
Here is where git-send-email comes into play.
Install git with send-email support
Don't want to solve everybody problems here. Probably if you don't have a clue where to setup send-email support it is already included in whatever is your way of installing packages.
This days I'm using Mac OSX 10.6 (pussycat edition). More or less successfully I use nix package manager and its nixpkgs package repository. I'm not going to talk much about this. This is a topic for a some other blogpost. All I can say stay away from macports ...
Here is what I do to install it.
% nix-channel --update
fetching list of Nix archives ...
% echo '{ git = { sendEmailSupport = true; }; }' > ~/.nixpkgs/config.nix
% nix-env -i git
i686-darwin i686-darwin i686-darwin 0
i686-darwin i686-darwin i686-darwin 0
warning: there are multiple derivations named `git-1.7.4'; using the first one
replacing old `git-1.7.3.1'
installing `git-1.7.4'
the following derivations will be built: ...
...
% which git
/Users/rok/.nix-profile/bin/git
% nix-env -q --installed "git"
git-1.7.3.1
Of course cool thing about nix is that if something goes wrong there is always rollback and I mean real rollback, not like macports one, where you can only hope things work after.
Well enough about nix, I promise to write more about it ... hopefully this year.
Send email via Gmail
Now lets configure git-send-email to send emails via Gmail. Since i-dont-know which version git supports TLS stuff needed for connecting to Gmail please use latest or at least my version or higher.
% git config --global sendemail.smtpencryption tls % git config --global sendemail.smtpserver smtp.gmail.com % git config --global sendemail.smtpuser info@garbas.si % git config --global sendemail.smtpserverport 587
It'll ask you later for your password when you're sending the emails. And to have a little bit nice patch structure use this option [1], [2], but thats personal decidion.
% git config --global sendemail.chainreplyto false
Integrate adressbook
It would be possible to integrate any kind of addressbook out there, but for now I'm keeping thigs simple. We setup aliases in one file [3].
% git config --global sendemail.aliasesfile ~/.gitaliases % git config --global sendemail.aliasfiletype mailrc % echo "plone-devel plone-developers@lists.sourceforge.net" >> ~/.gitaliases
Send emails
Now were are ready to send some mails out right?
% git send-email --to test@garbas.si --annotate --cover-letter master
I really don't have to tell you you can create git aliases for this right? Few times hit OK and mail will be sent. Now it will never happen to you to forget to send your patches upstream. Year right :P
| [1] | git send-email tricks |
| [2] | making --no-chain-reply-to the default |
| [3] | Installing Git 1.5.2.4 on Mac OS X Leopard |
github/collective experiment - status report
There is quite some traffic on Github/collective and they are commits being pushed on daily basis. Still we are not that busy then svn/collective but we are not lagging that much behind. I'm trying to say is that we are creating enough traffic to make first assumptions.
Git is not hard to learn
What surprised me the most is that there were no bigger complains about people using git. I've talked with a lot of developers over IRC and asking them about their experience with git. Its also true that most developers who joined were already familiar with git, but they are quite some git newbies, who just joined from curiosity about git and Github.
So next time someone coming from SVN world tries to convince you that git is hard to use, please point them to this snippet of .bash_profile:
alias svn-up="git pull" alias svn-st="git status" alias svn-ci="git commit -av && git push"
Nobody is forcing you use git-rebase, git-stash, git-send-email and other cool features git gives you possibility to use. You can still use git as you did SVN.
Github permissions are just not ready for us
As much as I was enthusiastic about Github, there are quite some limitation that does not meet our needs. Especially there is a big lack of different permission. Github only implements some basic permissions and leaves everything else for you to setup by hand or via their API.
Right now we have a strange bug that after you fork repository to Github/collective you actually lose the right to administer it. So in case you want to change title or description you just can't do that... well you write me and I do it for you. This is definitely something I wouldn't like to do on daily basis. This is because of current setup of permissions. I won't explain here how I setup permissions, I can just say I tried a lot of scenarios and lots of hours went into testing how Github actually works.
The only option that Github also promotes is that you create external script and manager groups/users/permission via their API. This would actually solve problems, but I'm not volunteering to do it. I believe Github should be that flexible that it should allow us to connect our LDAP and fed it with users.
I didn't really say nothing nice about Github. Even with all the above mentioned problems I still believe it is the best tool to use right now. So I would guess we are using it wrong.
Where to go in the future
And yes we are using it wrong. Github is already one freaking big collective. Just as Ploners we are not that interested in other projects. What svn/collective is giving us is one common place to put our code related to Plone for other people to reuse it. Meaning, if you don't put something in svn/collective your code does not exists in Plone world.
Now I would like current collective to evolve a little bit. In sense that I want other to see my commits of my Plone related projects in collective-cvs list. I'm not proposing to extend only to Github, but also to other (D)VCS providers. Actually you could put in also your company public svn repositories. Now this is a thing I'm willing to commit to and work on it.
In sense, just like we have planet.plone.org we could also have collective-planet.plone.org.
And what with happen with github/collective?
Now we definitely should not keep it in a state that its now. We created Github/collective also with intention to give projects, that overcome only personal usage and are becoming important part of others as well, a home. I would even go further. Projects that want to be included into Github/collective will have to commit to some design pattern, have testing, documentation and will be generally adopted by Plone community. Now with this base its easy to setup Jenkins and run tests on daily basis.
Plone moving to DCVS?
Now this is a topic I get asked a lot. No Plone is not moving to Github. Now that said I hope we could start some discussion to move from SVN to some DCVS. I said start talking more about it, not actually doing it.
One of the reason is that its impossible to mirror SVN->DCVS_ way, but its possible the other way around. It would be also nice to provide mirroring infrastructure to mirror code to services like Github, Bitbucket.
I was also asked how would DCVS impact us from legal point of view. Since we only accept contribution from developers who signed Agreement. I think best would be to give you a practical example in cronological order:
- Plone switches to git
- Plone is also mirroring repositories to Github/Bitbucket
- Adam sends Pull request over Github.
- Plone developers watching this mirror advices him via freaking nice Github comments to sign an Agreement and pull changes by himself.
- Since Bitbucket doesn't support Pull request Eva sends an email on plone-devel list saying that she have some interesting features.
- Plone developers again advise to first sign an Agreement and then pull in her changes by herself.
- Adam and Eva lived happily ever after in their paradises
We wont benefit all from this. People who like that SVN way of working will continue to work that way (see aliases above). But instead of forcing some way of contribution (even if its the most liberal one) we are opening to more developers by letting developers use their way of working.
Fire away ... :P
iTerm2 ... finally a terminal for macosx
I'm really excited about this one. You just have to give it a try. Say goodbye to 16 colors from Terminal.app. I actually believe that Apple is making Terminal.app worse for each release, just to enforce you with Steve Jobs way of doing things.
There are many really cool features are already available to us:
- performance is much better compared with iTerm
- 256 colors
- Full screen environment
- Growl support
- Focus follow mouse
- Mouse support
- Tabs (with all the management)
- Bookmarks (no more session/profile/bookmarks mess from iTerm)
- Multi-Lingual
Real about all features here.
And thats not all. More are coming. Keep in mind that iTerm2 is still alpha and is being actively developed, so you will be probably using last nightly release.
Also another cool thing (at least for me) is that there is mirror on Github. Go here and start following it.
Now time to download and give it a try.
Finally home
Living Statues Sprint
My trip started in August (25.8. 2010) when I jumped on the plane to Living Statues Sprint in Arnhem hosted by wonderfull people from Four Digits. Upon my arrival (I was half a day late) I was greeted by wall of tickets.
I quickly got "dirty" and start working on ticker #10995 (sitemap / navigation tile). After initial introduction into Deco / Blocks infrastructure I already got some results and first problems. Navigation portlet and Sitemap page can be now successfully replaced by navigation tile, yaaay.
I must admit that sprint was incredibly organized, tickets prepered beforehand and delagated to sprinters. So number of closed Deco / Blocks / Tiles related tickets is definetly reflecting great preparation from Rob Gietema. More on results with videos you can check on this link and judge it for yourself.
"mrs.developer" Sprint
You know the feeling when you have to rerun the buildout for the 2nd time in a row? And just because you want to add new source deactivated by default, but activated for you. Or when you simply want to hack on some code which is laying in some egg (in buildout), while keeping it sane and to create paches and apply them on production later on.
While hacking on Deco at Living Statues Sprint there was a lot of ideas flying around how to address common issues we developers have currently. Especially me and Florian Frisdorf were so much bothered by this issues that we decided to act upon. After Living Statues Sprint we headed to Munich to offices of Syslab.com Gmbh and Starzel.de to continue on this ideas.
For that reasons we started a thing called mrs.developer. mrs.developer provides buildout extension as well as comand like tool called "mrsd". For now its prove of concept that you don't have to rerun buildout if you start working on some code. Right now I can say mrs.devloper is a working patching solution, but might soon step into the area of mr.developer and also took care of handling sources. I wont go into details how it works since this is a topic for other blog post after initial phase of development is done, but more about it read on PyPi page.
But you probably didn't know that mrs.developer can dance right?
German Zope Usergroup Conference in Dresden
I was a little sceptical wheather I should go to such event since I dont speak german that well, but then again I didn't spoke spanish and I moved here for even more irrational reasons. Soon after visiting Munich I did a little tour to visit my girlfriend in Gdansk (Poland) then I was already on my way to Dresden.
I also gave a talk "Migrations with transmogrifier" (which I will soon turn into tutorial, wait for another blogpost or just contact me) which turned out to be quite well accepted, especially now that we have Plone 4 out, we (as developers) are more and more faced with a task to migrate Plone 2.X (not even Plone 3) sites to Plone 4. You might think its hard, but with tools (blueprints) developed in last months this can be not so frustrating experience.

Zope Cummunity
There was also a lot of talking about Zope community in general, especially after that Zope summit which was held few days before. There is definetly a confusion about identifying yourself as a part of Zope community, since everybody is more involved in "sister organisations": Zope2/Plone, Grok, Bluebream, repoze.bfg, ... But with ZTK 1.0 out this is starting to improve and soon we might see projects like Pylons using small parts of ZTK. Maybe even frameworks like Django might found ZTK or parts of it usefull, especially since they are trying to address similar problems which Zope community had to answer 5 years ago (I'm talking about "Making Django Apps reusable" which was broght up in last DjangoCon). repoze.bfg might be a nice way to see how ZCA can be used in non-scary way. There is a bright and exciting future ahead of us ... thats for sure.
Opengever - future of Swiss goverment
After Dresden I head back to Sevilla (via Gdnask, picking up my girlfriend) and we took well deserved week of vacations. I finally took time to visit other cities in Andalucia, after living here for a year I really haven't had that much oportunities to travel around. So I packed my car (yup this is another story, coming in a blogpost after this) and drive with my girlfriend to Cadiz, Cordoba, Huelva and just enjoy the nature and being offline for a week.
Then I got an call from guys at 4teamwork and I was already on my flight to Bern (Swiss). They are working on a goverment project for one of Swiss cantons, canton Zug. Being part of project of such size and importance is just fun from the start. They are using Plone and other future tools from Plone's future (like Dexterity, Diazo) so you will definetly hear from them some more about this amazing project.
Ljubljana, my sweet Ljubljana
After my work being done in Swiss I headed to Ljubljana. Anything I would say wouldn't be enough. Meet a lot of friends, went to all those parties I was talking people to go to and spend some time with my sisters. I guess my next visit will be next year ... and until then: "Friends its time for you to visit me. We don't have snow here. Snow is bad for you... well for sure its bad for me."
I also did some preparations for what is waiting for me the week after visit of ljubljana, and that is ...
Plone Conference 2010 Bristol
I was already on the train from Ljubaljana to Venice, taking a flight to Bristol. I met some Slovenian Plonistats in line waiting for drop-off-ing luggage. We spend all trip talking about Plone, our expectations for Plone Conference and I was more then ready for fun to begin.
I could do a whole book about Plone Conference behind us. Any word would not be enough to describe it. I think Plone community with its maturity and profesionalism, while still keeping it fun, is just a starting line how I would describe it. To keep it short i will only write something little about parts where I contributed.
If you want to see all Plone Conference's videos ... click here. Amazing video coverage.
Funny... whole Plone Conference I haven't written a line of python code. Javascript hacking all the time. Don't know if i should be proud or ashamed :)
Giving light to dark corners of z3c.form
z3c.forms everybody working with Plone use then and in the future we will use them even more (they are part of Dexterity). There is definetly a part of z3c.form which is "ugly" and "overcomplex", still its a lot better to choose some form framework which is a lot nicer, but does not provide you all of the fancy stuff that is possible with z3c.form. Also in a last year a lot of this issues were addresses and nowdays working with z3c.form can be a real pleasure. More about it you can read in my talk published on github (I'm playing with idea to actually turn/extend it into a tutorial, we'll see how I'm doing with my time) or just watch the video from the conference.
plone.app.event - final chance of recurrence events in plone
This is one of those features in Plone which nobody really want to spend a lot of money on, since its possible to move your workflow around it, but if it would be there it would definetly be used. There some atempts of succiding this in the past, but all more or less failed to bring this functionality into Plone's core. This PLIP is leaded by fearless Johannes Raggam which put on himself to bring this unpleasent task down. Plone community showed big need for it since a lot of people step up and join us coding at Plone Conference Sprint time: Tom Gross, Mike Rhodes, Dorneles Tremea, Simone Orsi, Vitaliy Podoba, Philip Bauer, Ryan Northey and me.
We are 5 days before PLIP deadline for 4.1 series of Plone. Everything looks really good and we might finish it on time, but there are still some task with which our PLIP won't be accepted. Nevertheless it was a pleasure to work with you guys and I hope in next days we bring our code to Framework team for evaluation.
github/collective - experimental (repeat after me: experimental) for possible enhancement of svn/collective
Recently (2 months ago) we started organization on github called "collective". You could consider github/collective as evaluation area for possible enhancement of current svn-collective.
Keep in mind this is experimental, experimental and once again experimental.
I'm not sure how best to emphasis this, but this is nothing officially supported or started from Plone Fundation, but they probably appreciate any effort to make development processes easier. We are just bunch of git enthusiasts who think service like github could bring some order in the mess we have in svn-collective. And instead of working in our own github accounts, we bring the spirit of Plone collective to github.
Who this evaluation are for?
github/collective is ment for:
- developers who are already familiar with git or the not feeling afraid
- their companies are already using git or even github for their work
- and for those who are aware that in case of not using github for collective this organisation might be turned off and they will have to move their code to their own user accounts (2 clicks) or import it into svn/collective (3 commands)
Right before Plone Conference sprinting weekend we already had 24 projects and 26 developers using github/collective, today I must say we are happily serveing home for 34 projects and more then 50 developers is part of it.
Why we didn't ask wider Plone Community and raise debate on mailing list first?
Main reason is that I tried to talk with many people about this and what I got back was speculations "Git is too hard to learn." and some more speculations "Github can not fit into the collective way of working together.". And I don't blame them ... really I don't. So I'm on a missing to collect some facts. Facts about wheather we could use service like github in spirit of collective and improve our way of working together. This reasies a number of different questions, from administration point of view, to documentation point of view ... since this is impossible to predict and to explore in advance we need to take this steps slowly and have some "experimental group" doing this for us.
Join us now. Send PM to garbas (on github) or just scream github/collective on #plone channel
But I don't like git, I think X (place your favorite VCS here) is better and easier to learn?
Ok heard that a lot of times. Maybe you did't notice but in text above I was not mentioning git at all. Yes I was always talking about github. But why is that different? I'm not on a mission how to convert all of you to use git, I want to explore how "social coding" might benefit us. If you don't want to use git you can also use Hg with github or you can even use svn to checkout and commit to github project (this is only limited to master/trunk but this might change soon). But why github and not bitbucket for example? I might be a little bit biased here because I'm a git user myself, but some facts are not to be missed. The only real "social coding" is actually happening on github, at least thats why numbers (of users) say. Well if not real at least more of "social coding" is happening at github and we will see our results faster.
And after evaluation period?
We'll try to investigate github for a bit, see how it fits our "collective-ness". If I say we some time frame after which we will bring this into discussion to plone developers / users list, I would be shooting blank. It might be one or two months from now, it might be more ... I certain that we will all know when time will come. Right now I wont focus on any date, but I will try to make github/collective a friendly place to share code.
Final thoughts
I had a blasting 2 months behind me. I learned a lot, met a lot of great people and there are exciting time ahead of me.
Since I'm a freelancer and there is no big project waiting for me in short future, please contact me if I you might need some help. Maybe my blog is not saying much about what I'm good at (need to change this soon), but I'm mastering lots of Plone aspects:
- Migrations from Plone 2.X to Plone
- Newsletters via Singing & Dancing
- Diazo(xdv) / Deliverance
- Archetypes / Dexterity development and all that comes with it
- z3c.form: I can convince them to do (almost) anything
Happy Plone year...
Fighting with svn
In the past I've wrote an article about "How to use git with collective (svn)". This is something like that post, but a little more tricks.
Lets first repeat what we "already know"
1. get first revision
$ svn log https://svn.plone.org/svn/collective/collective.vdexvocabulary
....
------------------------------------------------------------------------
r99681 | garbas | 2009-10-17 01:05:29 +0200 (sáb 17 de oct de 2009) | 2 lines
initial code, no tests ... todavia
------------------------------------------------------------------------
r99678 | garbas | 2009-10-16 21:58:02 +0200 (vie 16 de oct de 2009) | 2 lines
vdexvocabulary initial commit
------------------------------------------------------------------------
$
2. pull out the code from collective
$ svn clone https://svn.plone.org/svn/collective/collective.vdexvocabulary -s -r 99678:HEAD
3. commiting to collective and updating from it
$ cd collective.vdexvocabulary
$ echo "#useless code" >> README.txt
$ git commit
...
$ git svn dcommit
...
$ git svn rebase
4. tagging for release
$ git svn tag 1.2
5. stashing
$ git stash
...
$ git stash apply
6. working localy with branches
$ git branch -r
1.1 1.2 stripped tags/1.0 tags/1.0rc1 tags/1.0rc2 trunk $ git branch
* master $ git checkout -b fix-strange-1.2-bug 1.2 $ git branch
* fix-strange-1.2-bug master $ git checkout master
$ git merge fix-strange-1.2-bug
That was quick review of previous commands. For more detailed explanation look at my previous post.
Working on remote branches
1. first we create remote branch
$ git svn branch plone4-compatibility
2. create local branch from remote branch
$ git branch -b plone4-compatibility remotes/plone4-compatibility
voila!. now when you do "git svn dcommit" it will actually commit to remote "plone4-compatibility" branch in collective.
Show me your .gitconfig
I'll share my .gitconfig here, I hope I'll get some feedback how even better configure my git.
[user]
name = Rok Garbas
email = rok@garbas.si
[color]
diff = auto
branch = auto
status = auto
interactive = auto
[diff]
renames = true
[alias]
merge = merge --no-ff
s = status
d = diff
ci = commit -v
cia = commit -v -a
co = checkout
l = log
ll = log -p
b = branch
cis = svn dcommit
[github]
user = garbas
token = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[core]
editor = mvim
[merge]
tool = opendiff
Gitify
I know I'm not the only one struggling with this question. Since some Tom Lazar was working on his own tool called gitify, which should make usage of git-svn, a little easier. And it actually does. For more you can read here.
Book review: Plone 3 Multimedia
Nice to see another Plone book landed in my mailbox. This time is Plone 3 Multimedia, writem by Tom Gross. There is also a sample chapter avaliable on packpub site.
Whole book just about Plone and multimedia. Are there really so much to talk about? Is there more aspects to cover then Plone4Artists packages and maybe Plumi? Book is targeting Plone integrators, which are the biggest part of Plone community, so there is definetly a market if the book explains the topic right ofcourse. With Plone 4rc1 out just few days ago I fear book is a little outdated, but lets see ...
Chapters 2-5: Image, Audio, Video and Flash
After introductiory chapter you dive streight into dealing with why this book is all about. Multimedia. For each multimedia type it shows how core Plone is handling it them and then how and with which addon can you extend the Plone's default functionality. At the end of every chapter it also shows how to represent multimedia in HTML5. To quickly recap the addons mentions in this chapters, I'll just draw the listing:
| Multimedia vs. Plone addons | |
|---|---|
| Image | p4a.ploneimage, collective.plonetruegallery |
| Audio | p4a.ploneaudio, collective.flowplayer |
| Video | p4a.plonevideo, p4a.plonevideoembed, collective.flowplayer, Plumi |
Personaly I don't have much experienced with audiio and video, but for images I have some. I'm suprised that product Products.ImageEditor was missed out. Well, I understand not everything can be in the book. Also chapter on Plumi - which is receiving quite some attention lately - could be more extended, since Plumi provides quite rich and useful set of features.
Chapters 6-10: Categorisation, Syndication, Mass upload, Storage, Caching
Multimedia in Plone is not only multimedia as content type, but also all the things around it. Again for each section it describes what comes out-of-the box with Plone and then shows how to extend this functionality with addons. Again, like before, I'll list them:
| | Additonal addons |
|---|---|
| Categorisation | Products.PloneGlossary, p4a.plonetagging, plone.contentratings, Products.Maps, collective.virtualtreecategories, collective.categorizing, qi.portlet.TagClouds, collective.contentlicensing |
| Syndication | Products.fatsyndication, Vice |
| Mass upload | collective.uploadify, Products.PloneFlashUpload, atreal.massloader, EnfoldDesktop |
| Storage | ExternalStorage, FileSystemStorage, plone.app.blob, Reflecto |
| Caching | CacheFu |
Conclusion
If you are infront of the task to integrate multimedia with Plone then this book will definetly give you a boost in your project. There are ofcourse more products then the one listed above, but you can quickly find yourself lost among them. That's why goal oriented guides like this will definetly make your job easier. A lot of things explained in the book are also true in upcoming Plone4 and also with there is a initiative to make plone4artists pack ready for Plone4.
Overall the book is not that nicely written, but to be honest I really don't care about that. Example and links that it provides, tougth me some new stuff and help me remember some which I forgot. Book will also give you valuble examples and how to easily adjust Plone. If you are integrator, you should definetly make a room for this book.
P.S. This blog post was written using Firefox 4b2 and its the shit. So if I didn't convince you to buy a book, then I dare you to leave your slow Chrome and reclain the web again :)
I DISAGREE -> "Developer-centric version control considered harmful"
Since I couldn't comment on last Martin Aspeli's blog post (couldn't login with openID, maybe its only me, but i think something is not working right there) I decided to write my response here. There are many arguments that don't hold and a lot more is not being covered and should be mentioned.
As first I'm excited that Github is becoming so popular. I'm git user and just having git in the name of Github makes me happy. No joke, really. But all of the talk Martin did in his post should go in direction of "social coding portals" like: github, bitbucket, ... and probably some more ... not only Github itself, but this you probably know.
Lets go line by line...
from Martin's blog:
Someone else forks my repository and tinkers a bit. They then email me to ask me to pull their changes into my repository. If I have the time and inclination (and read my email), that may bring us back to one canonical version. However, in time, there is a single point of failure on me as the maintainer. At some point, I may stop caring or get too busy to follow up.
I agree with this, but the same problem you will get with most of the projects out there. In Plone world we have collective where almost everybody has commit rights, so we kinda got spoiled that you can simply commit to some repository. With all other projects you still need to contact the author to get your patched in. Its been like this since ages. Just with git this is done with one or two commands, while applying patch takes a little more.
from Martin's blog:
Here, Git has an answer: anyone can fork my repository and take over ownership. This is powerful and adds fault tolerance to the "single maintainer" model. But socially, it is dubious. Who really controls development? Who has a right to publish a new release? What if I come back after a few months and decide I wanted to own the project all along? We now need to reconcile the two forks. This may be tricky. Perhaps we don't do it. People now have to figure out which one of two versions of the software to "bet" on. This is onerous, and likely to deter other contributors.
Normally you check pypi page or home page of software you want to use, there you get direction where to start looking for source code. So once you found a place, then here is where Github shines. All forks which are done through the web are considered friendly forks, since its easy to commit back. Its even possible to look the history of forks and where they split. And now the "porn" part, you can actually diff different forks in Github, to see the differences. You hate/love me already? :)
from Martin's blog:
Let's say we bring the main line of development back to "my" repository. Once again, I have to commit a lot of time to reviewing and pulling in changes. Maybe I fall behind. So another user comes around and wants to work a bit. Which one of the two trees does he fork? Which ones does he pull in updates for?
Look the link above. With Github is easy to look friendly forks and compare changes. Its all just few clicks away.
from Martin's blog:
Perhaps I decide to relinquish control to another developer. I let my GitHub fork die, and expect people to use another one. But how do I manage this? How do I hand over ownership to someone else's account without confusing people who've been using my repository? Or people who stumble upon it in the future?
- since project is growing create its own github user and place it there. give permission to developer and then no problems after that.
- you can also aprove permissions to new maintainer and he continues to work under your github user. so everything stays the same
Now for every little project you start and you start your own project in some of the tools. its kinda silly, makes its hard to maintain. since you will probably use it only you. but if the project overgrows you then best way is to create new github user as you would do with any other project oriented system out there.
from Martin's blog:
Here's a cautionary tale that happened to me today: I've been using Soaplib, a Python library for building SOAP servers. There was a release on PyPI, but it had a bug that meant I had to get a checkout. The PyPI page listed a GitHub URL, so I used that to clone the repository. A few weeks later, all our builds suddenly broke. The remote repository was gone, deleted from GitHub. Turns out, the original maintainer had given owner responsibility to another person, who has his own GitHub repository. Development had gone on there for months, unbeknownst to me. One day, the original maintainer decided to delete his repository to not confuse people. Noble, but rather inconvenient.
This can be easily solved by you friendly forking Soaplib, for the time of development. Then in production you of-course wont use any url dependent resources, right? Then even if the project is moved you can easily friendly fork it again or just use the version. I never ran into a product that was discontinued while developing. But as also Martin said, this is rather minor thing (inconvenient).
from Martin's blog:
Again, there are lots of solutions to this problem. However, I think that fundamentally, as a user and potential contributor to a library, I want to find "the" repository and commit my changes there. A personal fork is a good idea until I can get access, but there has to be a path for me to get repository access and become a recognised, trusted contributor. Open source projects have used this model for years, as a way to encourage, recognise and empower contributors and build a shared sense of ownership around the project. I expect the project to be bigger than any one contributor or owner, and I expect the infrastructure to be able to outlive their involvement.
I think this is a feature of Github that you missed out. Organisations. For quick example look at MongoDB.
from Martin's blog:
This is why, for things that are a bit bigger than one person, and a bit smaller than a major open source project, I've got mixed feelings about GitHub, and even mixed feelings about Git itself. They are great tools. I find myself wanting to use them. But I also worry that they are too flexible for their own good, and that the most obvious way of using GitHub is not a good one for open source projects.
I dont see such problems there. Since others can work under your github account or you create its own project github account. Now saying that Git is "a little to much" for small projects. You can also give your contributors possibility to use Hg or Svn ... AT THE SAME TIME and commiting to the same codebase. (more in next comments)
from Martin's blog:
I think Hanno Schlichting put it well: With Subversion, you get a development model, which, whilst not perfect, is easy to understand and has worked out very well in practice for numerous projects. With Git, you're expected to make up your own model. I don't think people are very good at that, and rarely plan ahead for when their code outgrows them.
I know it's possible to use Git like Subversion, with a central repository. But I'm also not seeing a great many people doing that. We have to remember that Git was first built for the Linux kernel, which has a development model unlike most other projects, where it really is up to a set of core maintainers to review every patch and selectively pull it in. They need the kind of flexibility and power that Git offers. For many other projects, I'm not sure this flexibility is always a good thing.
Conclusion
While I use git and share my code with others a like to use the power of Github which lets me share my code with other developers and not forcing my own preferences of (D)VCS, but I simply let them choose among them.
While reading Martins post and adding my comments it actually comes down to personal preferences. Thats why statement in title "considered harmful" is overly used.
Hope this post will be understood as "friendly fork" of Martins post and will bring some interesting comments/posts.
Flame away. :)
Translations for z3cform datetimewidget needed
While waiting for my flight in Fankfurt Hahn i received italian translation to my inbox and make release. And since this package is used by Dexterity it would be nice to have translations in as many languages as possible.
There is really nothing much to it. There are three strings that needs translations. Here is pot file:
# --- PLEASE EDIT THE LINES BELOW CORRECTLY ---
# SOME DESCRIPTIVE TITLE.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2010-06-30 13:17+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0\n"
"Language-Code: en\n"
"Language-Name: English\n"
"Preferred-Encodings: utf-8 latin1\n"
"Domain: collective.z3cform.datetimewidget\n"
#: collective/z3cform/datetimewidget/interfaces.py:69
msgid "Please enter a valid date and time."
msgstr ""
#: collective/z3cform/datetimewidget/interfaces.py:65
msgid "Please enter a valid date."
msgstr ""
#: collective/z3cform/datetimewidget/widget_date.py:133
msgid "Today"
msgstr ""
LANGUAGES= ['hr', 'sl', 'sr', 'sr_Latn', 'en', 'es', 'pt', 'de', 'fr', 'it']
So send me email, commit to collective or write in comment bellow ... gracias!
fast vocabularies for zope/plone (collective.vdexvocabulary)
Poor me I could not reuse existing stuff which are already out there:
- Products.ATVocabularyManage - missing relations, hard to edit +10.000 terms, don't even want to imagine creating 30.000 terms
- z3c.csvvocabulary - wasn't there when I had problem, came 4 month later, no relations, no i18n support
At the same time I was amazed that nobody before me didn't provide some solution since creating vocabularies is quite common task when working with CMS-es. Well why cry. Inspired by freelance work I did for Seantis start working on collective.vdexvocabulary.
For format I didn't chose csv or similar, but I decided better to use IMS VDEX which is format that defines vocabularies. It supported all my requirements and for sure i don't want to come up with yet another way to do things.
How you can use it?
In your configure.zcml add:
<configure
...
xmlns:vdex="http://namespaces.zope.org/vdex"
...>
<include package="collective.vdexvocabulary" />
And to register a vdex vocabulary simply add line bellow pointing to file containing vdex vocabulary:
<configure
...
xmlns:vdex="http://namespaces.zope.org/vdex"
...>
<vdex:vocabulary file="path-to/very-interesting.xml" />
To make registration of vocabularies even easier you can also register several vocabularies and just point to directory:
<configure
...
xmlns:vdex="http://namespaces.zope.org/vdex"
...>
<vdex:vocabulary directory="path-to/my-vdex-vocabularies"
Need more?
Currently collective.vdexvocabulary supports i18n, relations (iso2788_relations.xml) which were needed to finish the requirements for the project. Ofcourse there is many work left, check todo list for that.
If you have any quiestion / problems dont hasitate to contact me. Or hire me as contractor and we'll get job done together.
Survived EPS2010 - Sorrento
First thanks guys from Abstract for organizing such a lovely event. And yes i survived it althought few people were questioning this because I was driving from my hostel (up in the hill) down to sprint place (at the beach) every day with my longboard. Few bruces and that's it :) Oh ... maybe i had luck, but my phone (Nokia E71) didn't. Screen is now in as many parts as there are people who think that Django pony is cool, hehe. Admit it ... zebra would be far better.
Deliverance / XDV
One part of my sprint time I spend on doing benchmark between the 2 of them and getting familiar XDV code. Other time I spend convincing Laurence that XSLT is evil! To be honest we were trying to find easy, non-obtrusive ways to combine the speed of XDV and the flexibility of Deliverance. Well benchmark will come this weekend when i have a little more time to finish it up and present it with some nice graphs. so stay tuned up in next days...
Presentations
I also gave 2 talks which you can see bellow.
also code from presentation can be found on my github account here.
As i promised quick and dirty. Happy Ploning!
New blog tool
I started with blogging on Blogspot. At the time I also tried Wordpress, but I settled on Blogspot for some reasons. Then i realize that blogging can actually be fun or at least easy to do. I heard many things about plone not being best choice for blogging and i think at the time maybe people were right (at least partly), so I search for some simple blogging solution to also offer it to my clients. It came down to Zine vs. Wordpress. Since Zine is python based solution this was a clear winner for me. I really didn't have the time nor the will to dive into PHP.
So last year i was running Zine and was pretty happy with it. I used reStructuredText for writing blogposts and for the time i was happy. But then things - which are trivial in Plone - become difficult or even impossible to do in Zine. Simple example is creating a gallery for people to see. This reasons got me thinking about using plone as blogging solution.
In the meantime i was actually thinking of doing my own - static html - solution, but give up on it because didnt have the will to devote time to it, if Plone, which i also provide hosting for, can do the same thing. And i start looking into.
Right now you are looking at the brand new Plone site. I use only to addons:
- collective.disqus - to provide reach commenting solution, since plone.app.commenting is still way behind this, but is improving a lot lately.
- PloneFormGen - to provide contact form (and later also other forms). I can only hope PFG will be in part of Plone 5
For RSS feed i use Plone's default syndication. Will see how well this works. But since i'm a Plone developer it would be pretty simple to adjust it to my needs, if needed ofcourse.
Theming was done with Deliverance which took me less then 1h to style. Theme was taken from some site which i dont remember, but was offered for free and it also looks clean and really nice - at least by my opinion. One really interesting thing i notice when i was doing quick benchmarks with ab, was that final page was 30-50% faster then original plone site. Strange a? well "secret" is that i strip all plone styles and use a lot less css/js then Plone is using. Here we clearly see how important weight of the portal is. In my case I do all of the editing from non-themed plone so i can afford to do this separation. It was quite a surprise that process time of Deliverance was actually hidden behind the download resource time. It might be i'm doing something wrong, but for sure is an interesting thing.
well now lets see how this will motivate me to write more ...
More and more products getting ready for Plone4
while project i'm working on is successfully going forward, we decided to give Plone4 a go and try it. changing buildout files felt just too easy, but yes thats the right way :P then we found out we are actually depending on some products that are not yet working on Plone4. well list is very short:
so i thought my weekend plans should be forgotten and try to make this work over weekend. well by my surprise somebody already did this for me. from svn logs i would say: smcmahon and dukebody. i hope i didnt miss somebody. tnx you all you save my weekend and now i can do some other stuff instead, like trying to finish Deliverance tutorial.
if you are eager to try Plone4 and depend on upper products. here are the relevant parts from my buildout.cfg
[buildout]
extensions = mr.developer
sources = sources
...
auto-checkout =
...
Products.PloneSoftwareCenter
Products.ArchAddOn
Products.PloneHelpCenter
Products.PloneFormGen
Products.PythonField
Products.TALESField
Products.TemplateFields
...
[sources]
Products.PloneSoftwareCenter = svn http://svn.plone.org/svn/collective/Products.PloneSoftwareCenter/trunk
Products.ArchAddOn = svn http://svn.plone.org/svn/collective/Products.ArchAddOn/trunk
Products.PloneHelpCenter = svn http://svn.plone.org/svn/collective/Products.PloneHelpCenter/branches/dukebody-plone4-compatibility
Products.PloneFormGen = svn http://svn.plone.org/svn/collective/Products.PloneFormGen/trunk
Products.PythonField = svn http://svn.plone.org/svn/archetypes/Products.PythonField/trunk
Products.TALESField = svn http://svn.plone.org/svn/archetypes/Products.TALESField/trunk
Products.TemplateFields = svn http://svn.plone.org/svn/archetypes/Products.TemplateFields/trunk
...
i'm sure this packages are almost ready to be released with Plone4 support, but for the time being we need to pull them from sources.
even achieving better performance with Chameleon was even easier. adding cmf.pt to my buildout.
[buildout]
...
eggs =
cmf.pt
...
zcml =
cmf.pt
...
Still not convinced about migrating to Plone4?
there are some quick and dirty performance checks on Plone4. which places Plone4 at the top of a CMS food chain. with that it shouldn't really be too hard to convince you clients to pay for migration. if they need it of-course. even if not for a client, do it for your own fun. i know i will.
while its still in alpha its only days away from its beta releases. maybe i should say: "Migrate to Plone 4, everybody is doing it! And write about it!" :)
Still not happy with blogging
What I need?
- i really need to persuade myself to publish every a post. so in "my perfect" world i would do:
-
- write post in reStructedText with vim
- preview it with a click (or one command)
- push to the server when online
- blog software should also have:
-
- commenting
- and taging
And what will i do about it?
i'm not sure i want to put even more workload to myself develop certain software and then maintain it. i simply want to use tools out there. configure them a little bit and voila ... thats should suffice.
- so my master plan:
-
- use git to able offline mode editing
- write hook to use docutils to compile to html on push
- preview script that generates html and fires up a browser
- provide tags block for reStructedText
- commenting .. use external services.
well that should be it right. looks like a day of work. maybe by the end of the month i'll be able to pull this through. since i'll have a lot of time while i travel.
well if anybody know for similar project with similar goals please let me know.
Main_template as BrowserView
So for now this is my solution, surely not the best (you don't have to convince me about this), but if you know how to do it better, i'm all ears.
Solution
in your deployment you can apply this diff bellow. using collective.recipe.patch or monkeypatch as you wish.
script to run diff against is OFS/Traversable.py (probably is somewhere in parts/zope2/lib/python)
189c189,192 - if name and name[:1] in '@+' and name != '+' and nsParse(name)[1]: --- + if name == 'main_template': + raise NotFound(name+', with the BrowserView hook') + + elif name and name[:1] in '@+' and name != '+' and nsParse(name)[1]
Follow up
since all this is custom, i can now also apply some caching on certain parts of main_template. let see what it says, is it faster by 1% or 10% :P
Python 2009 meme
my answers for tarek's python 2009 meme questions:
- What is the coolest Python application, framework or library you have discovered in 2009 ?
wow hard question. lets say its repoze.bfg ... i'm really excited about it, done some small stuff with it and i think i slowly getting "in love" with it. very close Deliverance is following. started also contributing and pushing 0.3 release. i hope soon we'll see 0.4 version. next tool would probably be Sphinx ... now its really a pleasure to write documentation.
- What new programming technique did you learn in 2009 ?
TDD - test driven development. using Sphinx your project ends up with tested requirements and end user guide. just sexy and clients love it too :P
- What is the name of the open source project you contributed the most in 2009 ? What did you do ?
Plone: being around, helping with answers, now and then fix some bugs. Deliverance: join developers of deliverance in december, exciting year is waiting for us.
- What was the Python blog or website you read the most in 2009 ?
Planet Plone, Planet Plone, Planet Twisted, Planet Python, Slashdot
- What are the three top things you want to learn in 2010 ?
- learn spanish
- get into repoze.bfg
- make Deliverance faster / easier to use
How to use git with collective (svn)
For start you need git. its important that is version 1.6.1 (or above) since new cool options just found place in this release.
1. pulling project out of collective
$ git svn clone https://svn.plone.org/svn/collective/Products.TinyMCE -s --revision=75010:HEAD
- options (see "git svn clone --help" for more):
-
- --trunk: used to define where trunk folder lives
- --tags: used to define where tags folder lives
- --branches: used to define where branches folder lives
- --revision: range of history with revisions that you want to pull
75010 is revision when Products.TinyMCE was first introduced in collective. and because collective is pretty large repository and we dont want to overload it, i really advice you to specifiy --revision. this will also make cloning go faster. git creates Products.TinyMCE folder with trunk content inside it.
2. commiting to collective and updating from it
now that we have our working git clone we start working and soon and as we work we can commit changes, but this changes wont show up in the collective repo just yet. you could say you have local repo. so commiting works the same way we would normaly do with plain git.
$ cd Products.TinyMCE
$ echo "# useless code" >> setup.py # we do some changes
$ git commit # commit local
... # we work some more
$ git svn dcommit # finaly we push to collective
... # now new changes are avail. in collective
# for us to pick them
$ git svn rebase # works like svn update
3. taging for release
normaly before release you also tag certain revision to some tag.
$ git svn dcommit # make sure all is commited to collective $ git svn tag # tag it
4. stashing ... (your boss will like it)
its a calm monday morning and you just started to work on new feature on project you are working. last weekend deployment was a success. next minute your boss brakes the door because there is some very important bug you need to fix (normaly is not that important, since nobody dies because of my code, but anyway some takes life more serious then me). you have some not commited code laying around and you would quickly need to return to commited version. with git its easy...
$ git stash # now your uncommited changes are stashed
... # work on that important bug and make your
# boss happy, commit it, deploy, etc...
$ git stash apply # and you are back to calm monday morning
5. working with branches
all your branches and tags are pulled into git. lets look them:
$ git branch -r # list all remote branches
1.1
1.2
stripped
tags/1.0
tags/1.0rc1
tags/1.0rc2
trunk
$ git branch # list all local branches
* master
$ git checkout -b fix-strange-1.2-bug 1.2
# we create local branch for fixing strange bug
# that apeared in 1.2 branch
$ git branch</span> # * is marking current active branch
* fix-strange-1.2-bug
master
$ git checkout master</span> # we switch back to master branch
$ git svn fetch # fetches the updates with out modifying the local
# working files (which git svn rebase would)
convinced?
there is one drawback when using git with svn. this is external repositories, but more about this next time.
De puta madre - first weeks in sevilla
If you know me, you know that i'm a person who really doesn't worry too much about things. i really don't like to plan my trips, my life, my everything .... normally i just follow how things evolve. i guess i like surprises. so ... i bought plane ticket on a rainy day in ljubljana and the date of my departure was set ... but that was about it. nothing else was
finding a flat
you think its impossible for a person who doesn't speak spanish to find a flat? well you're right. spanish is a must in this area. and with my poor spanish i wasn't getting nowhere. then in the begining of september i contacted Maria Luisa Perez Beltran (http://bit.ly/BrMiP) to help me. she's from sevilla, but in september she was also moving to stockholm, sweden for a semester. so i almost though i'm going to stay the first days in hostel or somewhere, but then few days before my departure (when i was visiting eurobasket finals in poland) i got a call from her saying she found a flat. woow was i happy. and above all now i also have 2 coolest roomates ever, which don't speak english (or very little), but thats how i wanted to be, so i learn my spanish faster.
did i mentioned i have to invite her for a dinner? well luisa when you return home for holidays, prepare that i take you somewhere, if i'm not cooking myself.
time to leave
even if i'm a practical person i think that style matters a lot. well thats why i bough ibook and not those "timeless designs" from ibm/lenovo. so i try to do everything with at least a little style. going away, for who knows how long, can be done only in one way. yes you are thinking correctly. you can only throw as much as parties you can and invite all ppl you will miss when you are gone. so i did. after i moved from my old flat (week before my departure) we had a party where we carried my couch to a friends flat by foot through a center of ljubljana. yes it was crazy as hell (http://bit.ly/1ae0jx). then on the last evening (train to venice airport was leaving at 2:30am) i invited all to Exen for some cocktails and salsa. i guess you could say that i danced from ljubljana.
and this is not it, i even got and "escort team" which followed me the first weeks. well maybe i should wrote "escort tim", because my friend Tim (http://bit.ly/1EWRMm) decided to go for a little vacations with me.
learning spanish
my arrival was perfect. with a little hangover from the party the night before, but that was expected. we (me and tim) found a flat in no time and meet my new roommates. well as i said before my roommates dont speak english so i was only lucky that tim was doing his internship a two years ago in madrid and that continue with erazmus in barcelona. and so we start with a project "learn garbas a language in which you cant code". i must say tim you are a really good teacher and you should think of being a teacher/profesor, well maybe not spanish, but for sure something.
after flat comes an office
on my previous post got really nice comments with suggestions to meet guys from yaco, a plone/django company with offices in sevilla. if you ever go to sevilla you have to meet them. this guys really know how to work and to be happy to work. their offices are open, colorful, with futbolin and wii to relax from work. i wasn't really expecting much from them, just some cool friends to go for a beer and talk about tech stuff and to be able to show my geeky side of me. well since i was also looking for an office to rent they offered me desk at their office which i gladly took, because when i first step though the office door i though: "man, how great must be working here."
finally vacations i've been waiting so long
after a few days in sevilla, another friend came to visit me. Irena Nose (http://www.irenanose.com). well i planned for some time to do a trip around spain and this was perfect time and company to do something like this. so friday morning (exactly a week after arriving to sevilla) we took a bus to madrid, spend there great 2 nights and then continue to barcelona for another 4 days of crazy longboarding. then it was time to say goodbye to irena and tim and head home, but this time home is sevilla :P
next?
well there are a lot of things i must do, take proper spanish language course for example, but start was fantastic. i'm mostly busy this days with client work, but soon i hope to be able to give some time into public project (plone, deliverance, repoze.bfg ...). i think ones you start traveling its hard to stop, so this friday i'm leaving to venice, where i meet with Dylan (http://www.pretaweb.org) and we continue to ljubljana where we stay for 2 days (meeting my friend and do some hacking), then on sunday guys from Noiza (http://noiza.com), trieste based company, will pick us up and we leave together for Plone conference in budapest.
well this was i short update on how things were, are and will be now lets finish that z3c.form presentation i promised.
Sorting in python, unicode sorting with zope.ucol
- sorting with python
so sorting in python is be easy.
In [1]: slovenian_cities = [u'Ljubljana', u'Maribor', u'Škofja Loka', u'Trbovlje'] In [2]: slovenian_cities.sort() In [3]: print slovenian_cities ------> print(slovenian_cities) [u'Ljubljana', u'Maribor', u'Trbovlje', u'Škofja Loka']
lets even complicate more since we normally don't have to deal lists like this, but with a more structural data. lets say we have some additional data and we want to sort it first over name and then over description field.
In [4]: slovenian_cities = [
...: dict(name=u'Ljubljana',
...: desc=u'Capital',
...: coord=u'46°03‚...'),
...: dict(name=u'Maribor',
...: desc=u'Purple city',
...: coord=u'46°33,...'),
...: dict(name=u'Škofja Loka',
...: desc=u'Coffee city',
...: coord=u'46°10,...'),
...: dict(name=u'Trbovlje',
...: desc=u'Miners city',
...: coord=u'46°8,...'),]
In [5]: slovenian_cities.sort(key=lambda x: (x['name'], x['desc']))
In [6]: print slovenian_cities
------> print(slovenian_cities)
[{'name': u'Ljubljana',
'coord': u'46°03,...',
'desc': u'Capital'},
{'name': u'Maribor',
'cord': u'46°33,...',
'desc': u'Purple city'},
{'name': u'Trbovlje',
'coord': u'46°8,...',
'desc': u'Miners city'},
{'name': u'Škofja Loka',
'coord': u'46°10,...',
'desc': u'Coffee city'}]
as we see sorting is not correct. Škofja Loka should not be the last one.
sorting with unicode suport (zope.ucol)
first if we want to use zope.ucol we need to install ICU and then install zope.ucol using ICU libraries. to make things easier i'll provide buildout config file
[buildout]
parts = icu zope.ucol ...
...
[icu]
recipe = zc.recipe.icu
version = 3.2
[zope.ucol]
recipe = zc.recipe.egg:custom
egg = zope.ucol
include-dirs = ${buildout:directory}/parts/icu/include
library-dirs = ${buildout:directory}/parts/icu/lib
rpath = ${buildout:directory}/parts/icu/lib
...
when sorting you do something like this
In [7]: collator = zope.ucol.Collator('sl')
In [8]: slovenian_cities.sort(
...: key=lambda x: (
...: collator.key(x['name']),
...: collator.key(x['desc'])
...: ))
In [6]: print slovenian_cities
------> print(slovenian_cities)
[{'name': u'Ljubljana',
'coord': u'46°03,...',
'desc': u'Capital'},
{'name': u'Maribor',
'cord': u'46°33,...',
'desc': u'Purple city'},
{'name': u'Škofja Loka',
'coord': u'46°10,...',
'desc': u'Coffee city'},
{'name': u'Trbovlje',
'coord': u'46°8,...',
'desc': u'Miners city'}]
and thats about it, hope this help somebody as it did me.
SphinxBuilder updated to Sphinx 0.6.3
I simplify it to the maximum so now you only need
[buildout] parts = docs [docs] recipe = collective.recipe.sphinxbuilder source = my.package:docs
which will install html documentation from custom my.package
Documentation
now also documentation is online on http://docs.garbas.si/collective.recipe.sphinxbuilder, but you can also build it yourself.
all documentation section on http://docs.garbas.si is built using SphinxBuilder.
enjoy!
Moving to sevilla (spain)
still loking for a flat in sevilla
well i still don't have an apartment there yet. i'm pulling all muscles to find it, but until know, no luck. well my plane ticket are already bought and my plane lands in sevilla on 2.10. evening. if nothing i'll spend my first week looking for a flat. if you (reader of this blog) by any chance know somebody or somebody who knows somebody who would like to share a flat in sevilla, with a geeky guy, who likes to cook, dance salsa and play basketball please contact me.
python/zope/plone in sevilla (andalucia)
since i don't plan to quit working on python/zope/plone things (on the contrary i plan to work even more) i will also need some kind of office or a office room or only a desk to escape from my room. and if you just happen to be a python/zope/plone programmer who have a spare space in the office or you are just looking for some good tech talk over some beer dont hesitate to contact me. i'll be delighted.
my spanish
the one who knows me they know my spanish is not that good, but thats is also one of the reasons why i'm moving there. i dont only want to learn spanish, i want to start thinking in it. the moment i find a flat there i sing up for a spanish class.
goodbye ljubljana
well ljubljana is an awesome city as well. there are some really cool things that i will certainly miss...
- if you leave in a center you don't even need a bike, since everything is in reach of 15min of walk
- local LUG Kiberpipa (http://www.kiberpipa.org), its just the best place to hang around and go for some interesting presentation about IT related stuff
- all the traditional students parties that i still visit every year
- bikofe, my favorite bar here
- metekova (http://metelkovamesto.org), best place to hang around
... and much more.
if nothing else see you in plone conference in budapest ... until then good luck, i for sure will need it :P
New blog tool
So blog is running on Zine and About section is Sphinx powered, everything on top of Python 2.6 and styled using deliverance.
- there are 2 more sections coming up soon:
-
- Code (mrgit.web, my public git repositories)
- Docs (documentation of various projects)
i just hope i'll have some free time to finish mrgit.web stuff and publish some useful code generated documentation. until then have fun ...
8th plone tuneup, doc team joining
Lately there has been also a lot of movement on plone-documentation mailing list. JoAnna Springsteen wrote in email to plone-doc and plone-users list:
I'd like to take this opportunity to announce that started with the December 5th Tune Up Day, we will now have documentation tasks available for people to work on. The Doc team Editors have carefully chosen several items that would be great for anyone who wants to get involved with writing docs. You can see the documentation specific tickets for tune up day here: http://tinyurl.com/tuneupdocs If none of these appeal to you, trust me, we have more. If you have an idea for a document that you'd like to work on and it's not listed in trac, we'll put it in there and get it tagged for tune up day. I will be participating in Tune Up Day and available to help you find a doc task to work on. This is a great opportunity for newbies that want to start contributing to the doc team or for anyone that wants a non-programming task. Our goal is to make this a regular and easy way to contribute to the doc team. Hope to see you there!
- here is my todo list for tomorrow. i'll be joing at late hours, but i'll put my share there for sure.
-
- resolve one/two tickets (i didnt decide which one yet)
- - release sphinxbuilder for sphinx 0.5
-
- start documenting one of plone.* package
So plone comunity is working towards better Plone, are you?
Jqueryui datepicker as z3cform widget for plone
You can find source code on github: http://github.com/garbas/collective.z3cform.datepicker
miohtama generously helped me with developing and actually pushed me to work on it. current state of code is rc, so expect some minor problems, but soon also stable release will be made.
not all options from datepicker are used and there is a lot of room for improvement. for now there are only 2 kinds of widgets: date and datetime widget. simple example would look like:
from collective.z3cform.datepicker.widget import DatePickerFieldWidget
from collective.z3cform.datepicker.widget import DateTimePickerFieldWidget
class ExampleForm(Form):
""" form """
fields = field.Fields(IExampleSchema)
fields['datetime_field'].widgetFactory[interfaces.INPUT_MODE] = DateTimePickerFieldWidget
fields['date_field'].widgetFactory[interfaces.INPUT_MODE] = DatePickerFieldWidget
code was also pushed to plone.org/products (using collective.dist.. tnx tarek for this usefull tool). but i found plone.org/products a little annoying since i need to wait for confirmation before my package is seen to public. is this the purpose how plone.org/product works or i screw something up.
Need help: importing wikipedia
few months ago i wrote blueprint for importing wikipedia articles into plone. (reason was this post)
since then i didnt have enough resources (my leptop is not that fast) to import bigger set of articles into plone. i reached 25 000 articles then job was pushing and i need cpu for work. i would really like to see how far plone could go. is it possible to import whole wikipedia into plone? would be nice for promotion of plone... "look you can have wikipedia is that big enough for you sir" :P
well if you have some testing server that has spare cpu power and you are also wondering how far plone could go drop me an email and lets try too push it to the limits.
Website mockups, giving instructions with images
Well maybe there is. Pencil (http://www.evolus.vn/Pencil/). small (400k), comes standalone (GTK+) or as firefox plugin. that means if you are running system that you have problems installing freaky software like flash, air, etc... , like i have (ppc/linux) then tool that just works with your browser is +100.
- how it works?
- Tools -> Pencil sketcking
- you drag 'n drop screenshot of site you are working with
- right click on default page, and select properties, give our current page a name and select siz
- and thats how i start sketching ...
Pencil have concept of multiple pages inside one document. which fit nicely since you normaly need to show how to change website (eg. default plone) in steps. and when you create new page you can select one of previouspages as background, which boosts sketching up. now i really feel that telling story with images is fun.
the only thing missing in this tool is to have a button that will screenshot one of my websites in firefox, but i use differenet tool for that (actually is batch script, one of first scripts i wrote in linux)
since Pencil is really too-easy-to-use tool, let it be enough and i'll leave you to try it. if you are using some cool tool that would make sketching even easier, please i'm all ears.
Plone-coredev with git (recursive svn:external solved)
If you are an old svn user and want to give git a try here is a nice tutorial with comparison to svn commands (http://git.or.cz/course/svn.html). there are also other good tutorials on the web, uncle google is the guy to ask.
there were some cool changes in plone-coredev/trunk lately so this is a reason more to give it a try. but ofcourse i'll use git. there are many svn:externals which git-svn does not support but there is a workaround ofcourse. so lets start...
rok@bestia ~/Projects $ git svn clone https://svn.plone.org/svn/plone/buildouts/plone-coredev --trunk=trunk --branches=branches --tags=tags --revision=21212:HEAD
rok@bestia ~/Projects $ cd plone-coredev
this only pulls buidlout from svn, svn:externals are not pulled out. now we use git-externals script which will pull svn:externals.
rok@bestia ~/Projects/plone-coredev $ ./path/to/git-externals
... fetch a coffie/tea/beer this will take time ...
rok@bestia ~/Projects/plone-coredev $ virtualenv-2.4 --no-site-packages ./
rok@bestia ~/Projects/plone-coredev $ source bin/activate
(plone-coredev)rok@bestia ~/Projects/plone-coredev $ python2.4 bootstrap.py
(plone-coredev)rok@bestia ~/Projects/plone-coredev $ buildout -v
(plone-coredev)rok@bestia ~/Projects/plone-coredev $ instance
and you have plone-coredev/trunk running... from first tast ... its fats :)
so what that does that git-externals script do?
its a script i wrote today, probably is buggy as hell but it works for now. it clones svn:externals in place they should be. in every package that has svn:exernals, .svn-externals file is created. reason i created it is because i didnt found any that can handle svn:externals recursivly. so here it is, ... http://github.com/garbas/garbasgit.svnexternals/tree/master/git-externals
if you have any ideas, wishes, suggestions just write on rok-dot-garbas-at-gmail-dot-com.
Z3c.form in viewlets
My obstacle today/tonight was z3c.form+viewlet coctail. after 2h of testing and optimizing i got quite nice peace of code:
and layout_viewlet.pt
now instead of wrapping with FormWrapper we wrap with our new ViewletFormWrapper, like:
OurViewletView = wrap_form(OurCustomZ3CForm, __wrapper_class=ViewletFormWrapper)
all that is left to do is register OurViewletView with browser:viewlet directive and form is ready.
i found this wrapper really usefull and i hope it can get into plone.z3cform. or is there any other way of doing this?
My plone wish list
- everything is a folder (no folder content type)
idea is not new, its taken from limi's blog, but everything (except File, Image) content types should be folderish. - no Image content type
well Image is nothing more then extended File content type. what i saw in past was that users were confused that there are so many content types. by having only one content type it make plone even easier and close to file-like-system. - small/tiny/micro plonecore code base
when plannning next release please also consider developers happiness not only end-users. we are ppl too you know :P. what i mean is that 90% time i work with plone i really dont need all those features that are builtin. 90% time i need only 2 content types (Document, File) which i extend, superclass, ... this is again subject to argue about, whether plone is framework or software. why it couldnt be both? having light plone core which developers could use to build on it, and end users ready packages like plonefor.community (curent plone), plonefor.getpaid, plonefor.goverment, plonefor.education, ... - link content types, wtf?@#$%
maybe i should read some more end user doc but i just dont get what with link content types all about. just to store link to some page. i would expet form it to show content inside plone (like Windowz product), redirect to that link or even both options. but ofourse this is something that should not be in plonecore (menitoned above). - portlets+viewlets=widgets (or call it as you want)
again idea is nothing knew. all i would ask from plone4 is that it provides rock solid UI to manipulate with them. draging and droping please. - no XML please
i use genricsetup in day to day basis and writing all that xml is just not fun you know. we use perfect language - python - if you forgot. use it. it can do more then just magic. sonce XML is only computer friendly and if we really must use xml then an UI tool must be provided or if not next plone book should be "pistol for developers included - for self puprose only" - unified plone registry
this has nothing to do with windows registry so dont panic. its just some centralized way of storing site configuration that can be also (ab)used by add-on products. now we have a mess. every configuration is stored in its own way and place.
if i may dare this could also be next-generation of genericsetup (with no usage of XML ofcource). - no kss in plonecore, ship only with jquery
50% of time i disable kss since it slows down the site. yes kss is usefull but not in all scenarios. make developers choose whether they would like to write javascript or use kss. - developer reference documentation
this should be killer feature of plone4. currently there is no - or is really in bad shape - reference developer documentation. Christopher Warner few days ago wrote "If core code is undocumented it's broken". but who should be responsible for this? core developers. when there is new feature added/removed documentation should be alsoo updated. sphinx here offers a great way to document our code. it can be api, doctests, docstrings all in one. and can be done from the code ,so all those doctests, docstrings that are already there will be used.
--- after a while i found some more ---
- plone theming
deliverence promises a lot, but still plone itself must provide easier theming expirience. something as easy as old zope2 skins and scalable/reusable as zope3 resources. - wsgi out-of-the-box
this is a must, repoze middleware that is availiable now looks so usefull i'm just wainting for some project to try it out.
well this is it, for now ... i'm exited with plone4 release and now its time for me to go back to bed. i think by the end of this night i'll come up with few more.