Affichage des articles dont le libellé est present. Afficher tous les articles
Affichage des articles dont le libellé est present. Afficher tous les articles

samedi 25 janvier 2014

Knox present? topic




Guys yesterday I bought a new Note 3 sm n900 and when i went to the download mode there was no knox counter... so is knox present?


Sent from my GT-N7000 using XDA Premium 4 mobile app








Attached Thumbnails


Click image for larger version<br/><br/>Name:	1390638359519.jpg<br/>Views:	N/A<br/>Size:	38.2 KB<br/>ID:	2537816
 
















vendredi 24 janvier 2014

Re: Elementree and insert new element if it is not present - FIXED topic




On 2014-01-24, Tharanga Abeyseela <(E-Mail Removed)> wrote:
> manged to fix it. need to add the namespace when checking the
> condition.


I wish there was a rule that if your xml doesn't need a namespace
it doesn't use one. They are a pain when there's just one useless
namespace.

But maybe I'm just naive.

--
Neil Cerutti






jeudi 23 janvier 2014

Elementree and insert new element if it is not present topic




Hi,

I have the following xml,a nd i need to add Description element if it is
not present.

<TVSeries><Provider>xxx</Provider><Title>X</Title><SortTitle>World's
Fastest Indian, The</SortTitle></TvSeries>
<Movies><Provider>xxx</Provider><Title>The World's Fastest
Indian</Title><Description> The World's Fastest Indian
</Description><SortTitle>World's Fastest Indian,
The</SortTitle></Movies>

here is my function.

def insert_description(root,type):
for child in root.findall('.//{
http://schemas.microsoft.com/xxx/2011/06/13/ingest}%s' % type):
title=child.find('.//{
http://schemas.microsoft.com/xxx/2011/06/13/ingestion}Title').text
try:
if child.find('Description') is None:
new_desc = ET.Element('Description')
new_desc.text = title
child.insert(1, new_desc)

except:
pass

root is the xm lfile, type includes (movies,shows,dramas etc)

But this will add the description without checking the "Description" is
exist. i have a problem with the following statement. (i guess)

if child.find('Description') is None:

what i'm doing wrong here, appreciate your help

Regards,
Tharanga