Le blog de pingou - Tag - pkgdb-cliLe blog de pingou, ses actualités sur Fedora, ses RPMs, ses tests, son Linux... :-)
Pingou's weblog, his fedora's news, his RPMs, his tests, his Linux... :-)2022-02-17T10:46:15+01:00pingouurn:md5:66db5ce1ed1a80cb2f424695b4bb7780DotclearAlign text in python CLIurn:md5:e427eb40c241e8360623b0e19306f7a32012-09-18T15:45:00+01:002012-09-18T15:45:00+01:00Pierre-YvesGénéralAstucesFedoraFedora-planetpkgdb-cliPython<p><img src="https://blog.pingoured.fr/public/source.png" alt="source.png" /></p>
<p>A small reminder on how to align text in python</p> <p><strong><em>English version</em></strong></p>
<p>I have had the problem a couple of time, I saw the solution passing by at least once but I had lost it, so I am posting this for the lazy web and myself :-)</p>
<p>If you need to align text in python a bit like you would do tables, you can use the <code>ljust</code> and <code>rjust</code> methods from a string object.</p>
<p>Example:</p>
<pre>
>>> for cnt in range(3):
... print 'foo'.ljust(10), 'bar'.ljust(10)
foo bar
foo bar
foo bar
>>> for cnt in range(3):
... print ('foo'*cnt).ljust(10), ('bar'*cnt).ljust(10)
foo bar
foofoo barbar
</pre>
<p>You can see how nicely it is left align, but of course you can also aligned it on the right:</p>
<pre>
>>> for cnt in range(3):
... print ('foo'*cnt).rjust(10), ('bar'*cnt).rjust(10)
foo bar
foofoo barbar
</pre>
<p>I have to port pkgdb-cli to use this!</p>PackageDB-cli 1.1.0urn:md5:0f8c9314dd67bdf9e585356d6f5c7b9f2011-08-05T13:44:00+01:002011-08-05T13:13:14+01:00Pierre-YvesRPMsFedoraFedora-planetpkgdbpkgdb-cliPythonRPM<p><img src="https://blog.pingoured.fr/public/rpm.png" alt="rpm.png" /><img src="https://blog.pingoured.fr/public/source.png" alt="source.png" /></p>
<p>Version 1.1.0 du client text pour pkgdb.</p>
<p>Release 1.1.0 of the command-line interface for pkgdb.</p> <p><strong><em>English version</em></strong> (no French)</p>
<p>I have pushed to testing few days ago a new version of packagedb-cli (aka pkgdb-cli).</p>
<p>With this new version:</p>
<ul>
<li>You can adopt an orphaned package</li>
<li>The user name if not specified can be retrieved from the fedora_cert file (if presents)</li>
<li>If the package is orphaned, it is now highlighted</li>
<li>Approve all the request for someone but only the requested ACLs (not all ACLs)</li>
</ul>
<p>There has also been some bugs fixed thanks to <a href="http://inputvalidation.blogspot.com/">sochotni</a> and ppisar who reported them on the <a href="https://fedorahosted.org/packagedb-cli/">trac</a>.</p>
<p>Feel free to test and comment the updates:</p>
<ul>
<li>F16 <a href="https://admin.fedoraproject.org/updates/packagedb-cli-1.1.0-1.fc16">https://admin.fedoraproject.org/updates/packagedb-cli-1.1.0-1.fc16</a></li>
<li>F15 <a href="https://admin.fedoraproject.org/updates/packagedb-cli-1.1.0-1.fc15">https://admin.fedoraproject.org/updates/packagedb-cli-1.1.0-1.fc15</a></li>
<li>F14 <a href="https://admin.fedoraproject.org/updates/packagedb-cli-1.1.0-1.fc14">https://admin.fedoraproject.org/updates/packagedb-cli-1.1.0-1.fc14</a></li>
</ul>
<ul>
<li>EL6 <a href="https://admin.fedoraproject.org/updates/packagedb-cli-1.1.0-1.el6">https://admin.fedoraproject.org/updates/packagedb-cli-1.1.0-1.el6</a></li>
<li>EL5 <a href="https://admin.fedoraproject.org/updates/packagedb-cli-1.1.0-1.el5">https://admin.fedoraproject.org/updates/packagedb-cli-1.1.0-1.el5</a></li>
</ul>PackageDB-cli 1.0.0urn:md5:e2fce9849ef6f254c910c5da81e056c82011-06-29T12:25:00+01:002011-06-29T14:15:59+01:00Pierre-YvesRPMsFedoraFedora-planetpkgdbpkgdb-cliPython<p><img src="https://blog.pingoured.fr/public/rpm.png" alt="rpm.png" /><img src="https://blog.pingoured.fr/public/source.png" alt="source.png" /></p>
<p>Version 1.0.0 du client text pour pkgdb.</p>
<p>Release 1.0.0 of the command-line interface for pkgdb.</p> <p><strong><em>English version</em></strong> (no French)</p>
<p>This morning has just been <a href="https://bugzilla.redhat.com/show_bug.cgi?id=717555">reviewed and approved</a> the rpm for packagedb-cli (Thanks Elad!).</p>
<p>I am waiting for the SCM to be validated and I will upload and build this first release.</p>
<p><br /></p>
<p>I am looking forward to hear your suggestions, comments and bug reports on the <a href="https://fedorahosted.org/packagedb-cli/">trac of the project</a></p>
<p><br />
<br />
PS: If you rebuild the src.rpm from the review, I was pointed out that the USAGE in <code>--help</code> is not quite accurate, this is already fixed in git and will fixed at import.</p>PackageDB-cliurn:md5:4ad75995c54b9588d5707a4251dc819a2011-06-08T17:29:00+01:002011-06-29T14:16:19+01:00Pierre-YvesGénéralFedoraFedora-planetpkgdbpkgdb-cliPythontest<p><img src="https://blog.pingoured.fr/public/source.png" alt="source.png" /></p>
<p>Un client text pour pkgdb.</p>
<p>A command-line interface for pkgdb.</p> <p><strong><em>English version</em></strong> (no French)</p>
<p>With the help and advices from <a href="http://anonbadger.wordpress.com/">abadger1999</a> and <a href="http://akurtakov.blogspot.com/">akurtakov</a> I have recently been working on <a href="https://fedorahosted.org/packagedb-cli/">pkgdb-cli</a>, a command line version of the famous tool <a href="http://admin.fedoraproject.org/pkgdb">pkgdb</a>.</p>
<p>The idea behind this tool is to allow you to do everything you do on pkgdb without having to use the website. Using it, you can therefore:</p>
<ul>
<li>request ACL for a package</li>
<li>approve/deny ACL to someone's ACL request</li>
<li>orphan a package</li>
<li>check the ACL for a package</li>
<li>list the package for a user</li>
<li>list all the package in pkgdb</li>
<li>and some more :-)</li>
</ul>
<p>The code is now in a decent shape, nothing fancy but it should work and for now what it needs is <strong>testers</strong>.</p>
<p>So if you have to request/approve/deny acl, if you want to see the list of packages owned by someone, if you what to check the ACL for your packages and if you feel like, feel free to test it.</p>
<p>And of course, if you run into bugs please report them !</p>
<p>PS: Also Thanks to <a href="http://fedoraproject.org/wiki/HaikelGuemar">Haikel</a> for his help</p>