Karma weekly report and minor fixes.
Next, Karma widget also shows user rank. This is the rank of a user based on total karma score attained. This rank is purely score based irrespective of whether karma is developer or marketing type. I have kept the Rank calculation also a part of the cron script, so that means ranks are calculated every 5 minutes.
Also, during this time Marguerite Su, chinese wiki admin pointed out that wiki score calculated during karma score updation didn't include localed wikis. So I corrected the wiki and planet openSUSE part to include localed wiki and global posts.
I also fixed some minor bugs with wiki score calculation and kudos calculation.
I have started off with the documentation, though not much has been done, I will now concentrate solely on that.
osc2: syntax update
Hi,
as I already I wrote in an earlier post the last week I worked on implementing osc2’s “request”
command. In order to create a new submit request the user has to run
osc request create --submit api://src_project/src_package api://tgt_project
What’s still needed is a way to specify a revision of the src_package. It isn’t possible
to introduce a “–revision ” option because it’s possible to specify multiple submit
actions for a request (so we can’t distinguish to which –submit action a revision
belongs to).
Finally I implemented darix’ cool idea: simply use a svn-like syntax:
osc request create --submit api://src_project/src_package@rev api://tgt_project
Marcus
[gsoc] osc2 client – summary of week 12
Hi,
here’s a small summary of the 12th (coding) week. The last week I continued
the work on the new user interface. As a result the “request” command is more
or less implemented. Yesterday I pushed the current code and it’s also possible
to play around with it:
- checkout the code [1]
- cd osc2/osc/cli
- export PYTHONPATH=/path/to/osc2
- python cli.py -h (for more information)
Example:
In order to list a request it is sufficient to run
“python cli.py request api://your_project” (Note: all https requests are
_insecure_ – so far the certificate etc. is not checked).
Some implementation details:
In my last mail/post I described how a new (sub)command can be specified
so I’ll leave out the details here.
In the following I’ll shortly explain how the arguments specified by the
user at the commandline are passed to a function (which does the actual
work – like listing the requests).
class RequestList(CommandDescription, Request):
"""
...
"""
cmd = 'list'
args = 'api://project?/package?'
opt_user = Option('U', 'user', 'list only requests for USER')
func = call(request.list)
As we can see the project and package parameters are optional. After
the parsing process a so called “info” object is returned which encapsulates
the specified arguments. Assume the user runs “request list api://test_prj”
then the info object has the following attributes:
info.apiurl = the default apiurl
info.project = 'test_prj'
info.package = None
The question is how can we pass this data to the request.list function?
A simple (and naive) approach would be to simply pass the “info” object
to the request.list function that is “list” has the following signature
“def list(info)”. As a consequence inside the method we always have to
use “info.project”, “info.package” etc. which is a bit awkward – at least
for parameters which are quite frequently used in the method definition.
So it would be nice if there’s a way to pass frequently used parameters
directly to the method (that is they’re declared as formal parameters
in the method definition) and infrequently used parameters can still be
accessed via the info object. Exactly like this it is currently
implementend in osc2.
So the following signatures would be correct for our example:
def list(project, package, info)
def list(project, package, user)
def list(project, package, user, info)
def list(project, info)
def list(info, project)
def list(project) # using the info object is not mandatory
def list() # quite useless...
...
Invalid signatures:
def list(prj, pkg, info)
def list(foo, info)
...
So it is up to the developer how to define the signature of the
request.list function – it is not completely dictated by osc:)
Marcus
Vagas para desenvolvimento e suporte na Mandriva Brasil
1. Profissional de desenvolvimento (kernel). Requisitos: experiência em desenvolvimento e manutenção do kernel de Linux.
2. Profissional de suporte técnico. Requisitos: experiência em suporte técnico interno e externo, conhecimentos avançados no sistema operacional Linux e soluções para servidores: DNS (BIND), web server HTTP/HTTPS (Apache), FTP, SMTP, IMAP, POP3, SQUID, SARG, SAMBA, OpenVPN, LDAP, Firewall e boot remoto. Desejável: Certificação Mandriva ou LPI.
Local de trabalho: Curitiba/Paraná. Jornada: de segunda a sexta-feira, das 09h às 18h. Início: imediato. Benefícios: plano de saúde e odontológico, vale refeição, seguro de vida.
Interessados deverão enviar currículo, com pretensão salarial, para: curriculo_tech@mandriva.com.br.
Fonte: http://br-linux.org/2012/vagas-para-desenvolvimento-e-suporte-na-mandriva-brasil/
Avise se algum erro for encontrado nesse artigo.
O conteúdo desse artigo pode ser modificado ou atualizado, por isso, visite essa página constantemente e mantenha-se atualizado.
Pavadas (1)
Cosas de tener instalados KDE y GNOME en una misma instalación 1: Tracker
[gsoc] osc2 client – summary of week 11
Hi,
here’s a small summary of the 11th (coding) week. Last week I worked on
implementing the new commandline interface. While doing so I faced several
“issues”:
-
How to combine argparse and our oscargs url-like syntax?
Basically we have to run our oscargs parser on the result which is
returned by argparse.ArgumentParser’s parse_args method. The problem is
that both parsers have a different “syntax” that is using a naive approach
will lead to some redundancies (we specify the ui twice: one time for
argparse and one time for oscargs). In order to avoid this we need some
“interface” to which the oscargs syntax is passed and which configures
the argparse parser accordingly. -
How to support custom commands?
We also have to provide an “easy” way to specify custom commands.
Additionally it might be handy if existing commands can be enhanced
(either by adding additional options etc. or by adding a new subcommand
etc.). The best would be if the user simply drop his/her plugins in a
specific directory and osc will scan this directory and use the new
plugins/commands. -
Specifying the ui programmatically is somehow confusing/cluttered. It would
be much better if the ui can be specified in a more “declarative” way
without the syntactic “overhead” (well that’s a bit exaggerated) which
is needed to configure the parser. Additionally it would be nice to have
a convenient way to specify a multi line description for a command
(hardcoding the str into the source makes the code “harder” to read).
Finally I ended up with a small DSL which can be used to specify the
ui in a “declarative” way (the initial idea + syntax is taken from the
django framework (see [1])).
Example:
Assume we want to implement a request command which consists (for the
sake of simplicity) of 2 subcommands “list” and “accept”. This can be
specified like the following:
# file: osc/cli/request/ui.py
class Request(CommandDescription, OscCommand):
"""Show and modify requests."""
cmd = 'request'
class RequestList(CommandDescription, Request):
"""List requests.
By default open requests for a specific project or package will be
listed.
Examples:
osc request list api://
osc request list api://project
osc request list api://project/package
"""
cmd = 'list'
args = 'api://project?/package?'
opt_user = Option('U', 'user', 'list only requests for USER')
opt_group = Option('G', 'group', 'list only requests for GROUP')
opt_state = Option('s', 'state', 'list only requests with state STATE',
choices=['new', 'review', 'accepted', 'revoked',
'declined', 'superseded'], action='append')
func = request_list
class RequestAccept(CommandDescription, Request):
"""Accept a specific request.
...
"""
cmd = 'accept'
args = 'api://reqid'
func = request_accept
In order to add the request command it is sufficient to add an
import osc.cli.request.ui
statement to the main cli module. This produces the following output:
marcus@linux:~/osc2/osc/cli> python cli.py request -h
usage: cli.py request [-h] {list,accept} ...
Show and modify requests.
positional arguments:
{list,accept}
list List requests.
accept Accept a specific request.
optional arguments:
-h, --help show this help message and exit
marcus@linux:~/osc2/osc/cli>
and
marcus@linux:~/osc2/osc/cli> python cli.py request list -h
usage: cli.py request list [-h]
[-s {new,review,accepted,revoked,declined,superseded}]
[-G GROUP] [-U USER]
api://project?/package?
List requests.
By default open requests for a specific project or package will be
listed.
Examples:
osc request list api://
osc request list api://project
osc request list api://project/package
positional arguments:
api://project?/package?
optional arguments:
-h, --help show this help message and exit
-s {new,review,accepted,revoked,declined,superseded}, --state {new,review,accepted,revoked,declined,superseded}
list only requests with state STATE
-G GROUP, --group GROUP
list only requests for GROUP
-U USER, --user USER list only requests for USER
marcus@linux:~/osc2/osc/cli>
How does it work?
First of all each class which defines a command or subcommand has to inherit
from class “CommandDescription”. If a subcommand is to be defined it also
has to inherit from the “parent” command (that is in our example “RequestList”
and “RequestAccept” inherit from class “Request” (which in turn inherits from
class “OscCommand” (from this class all toplevel commands have to inherit))).
In short: with the help of the inheritance hierarchy it is possible to define
a command <- subcommand hierarchy.
Note: actually the classes "RequestList" and "RequestAccept" only inherit
from "CommandDescription". The "parent" command base class is only needed
for a "marking" purpose (it is filtered out with the help of a metaclass
when the concrete class is "constructed" – I'll leave out the details for
now and may write a dedicated blogpost about it).
Now the remaining task is to define and implement the commands (note: we will
definitely not finish the project on the "suggested pencils down" date and
use the week until the "firm pencils down" date for coding…).
Marcus
[1] https://docs.djangoproject.com/en/1.4/topics/db/models
Here’s a small example how to modify an existing command:
# plugins/myrequestaccept.py
from osc.cli.description import Option
import osc.cli.request.ui
class MyRequestAccept(osc.cli.request.ui.RequestAccept):
# add a new option
opt_foo = Option('f', 'foo', help='foo option')
This leads to
marcus@linux:~/osc2/osc/cli> python cli.py request accept -h usage: cli.py request accept [-h] [-f FOO] api://reqid positional arguments: api://reqid optional arguments: -h, --help show this help message and exit -f FOO, --foo FOO foo option marcus@linux:~/osc2/osc/cli>
New domain and migrating data between Google Apps
Short version
- If you can't reach me at my @cgoncalves.info, use @cgoncalves.pt from now on.
- Google Apps doesn't allow one to switch a primary domain with an alias. Had to migrate all data by myself...
A not so short version
Migrating emails
#!/bin/bashimapsync \--host1 imap.gmail.com \--user1 account@old-domain.com \--passfile1 ./passfile1 \--ssl1 \--host2 imap.gmail.com \--user2 account@new-domain.com \--passfile2 ./passfile2 \--ssl2 \--authmech1 LOGIN \--authmech2 LOGIN \--useheader 'Message-Id' \--useheader 'X-Gmail-Received'
Back to Google Apps drama
Conclusion
Karma statistics available through Connect's API
In my previous post, I mentioned about allowing karma statistics to be available through Connect's API. So, that is done. The method karma.details which requires a GET call, passing the username of the user, called only after authenticating with the api, returns user score in each respect, i.e score on fixinng bugs, making posts, tweeting, build service commits and wiki edits. It also returns user badge and the last karma update time of the user.
I plan to deploy the second version of the Karma plugin as soon as my mentor Michal Hrusecky, who is away currently, gets back. Also, if you have any ideas to give across or want to comment on how you liked or disliked the karma plugin, do leave a comment, I will work on it and improve it in the second version itself.
Next, I am starting off with the documentation. Hope to finish this asap, not much time left for the pencils down date.
Announce: LDTP 3.0 - Linux GUI test automation tool
Highlights:
* Java / C# / VB.NET / PowerShell / Ruby are now officially supported LDTP scripting languages other than Python
New Features:
* Firefox have check / uncheck as actions for check box
New APIs:
* selectpanel
* selectpanelname
* selectpanelindex
Bug fix:
* Simplified the implementation verifyselect for combobox menuitem
* Fix QT related accessibility issue
* Bug#673931 - Python-ldtp has issues if the application calls an env or other program to run
Credit:
* Ubuntu QA team members (Dave Morley, Ara Pulido)
* VMware desktop QA team members
* Kartik Mistry (Debian package maintainer)
* Thanks to all others who have reported bugs through forum / email / in-person / IRC
Please spread the word and also share your feedback with us.
About LDTP:
Cross Platform GUI Automation tool Linux version is LDTP, Windows version is Cobra and Mac version is PyATOM (Work in progress).
* Linux version is known to work on GNOME / KDE (QT >= 4.8) / Java Swing / LibreOffice / Mozilla application on all major Linux distribution.
* Windows version is known to work on application written in .NET / C++ / Java / QT on Windows XP SP3 / Windows 7 / Windows 8 development version.
* Mac version is currently under development and verified only on OS X Lion. Where ever PyATOM runs, LDTP should work on it.
Download source / binary (RPM / DEB)
Documentation references: For detailed information on LDTP framework and latest updates visit
LDTP API doc / Java doc
Report bugs
