I'm trying to create a graphical program to deal with packages easily for end-users. However, I'm facing a problem in retrieving the package's description beside some other information.
I've seen the python-apt API here and i understood that i have to deal with the apt.package.Version()
class.
But when i tried to use it, all what i got is some errors like:
Traceback (most recent call last):
File "./myprogram", line 6, in <module>
print package.description
File "/usr/lib/python2.7/dist-packages/apt/package.py", line 374, in description
dsc = self._translated_records.long_desc
File "/usr/lib/python2.7/dist-packages/apt/package.py", line 315, in _translated_records
desc_iter = self._cand.translated_description
AttributeError: 'list' object has no attribute 'translated_description'
So, is there any body who can create a running example for the apt.package.Version() class please?
Thanks!
Best Answer
The following python commands should give you the long description when available:
Note: My locale are set to
LANG=en_US.UTF-8
so translated strings may not be a problem here.