issue: Permissions in odfpy

Philipp Hagemeister phihag at phihag.de
Tue May 19 18:57:48 EDT 2009


Hi Shruti,

your message is kind of hard to read. Please note the following:

· Do not put useless junk("issue") in title.
· Multiple exclamation marks convey a sure sign of a diseased mind,
especially syntactically interesting constructions such as "??.."
· You didn't purchase your keyboard in August 2001, did you? (
http://ars.userfriendly.org/cartoons/?id=20010820 )
· It's probably just me, but "so please give me some solution" sounds
really rude. Why not "any ideas?", "thanks in advance" or just nothing?
Would you answer an email that ended like this? Please keep in mind, you
are not paying us, and we're trying to help you just because we want
happy python users (or trying to offset us being evil at times).
· Everyone mistpyes, and I'd be throwing mountains in my glass house if
I complained about grammar, but please show at least some effort.

That being said, this might help:

import odf.opendocument

doc = odf.opendocument.load('in.ods')
# You may want to use another way to select the sheet,
# this selects just the first one
sheet = doc.spreadsheet.childNodes[0]
sheet.setAttrNS(
    'urn:oasis:names:tc:opendocument:xmlns:table:1.0',
    'protected',
    'true')
doc.save('out.ods')

Regards,

Philipp

shruti surve wrote:
> hey,
> i am using odfpy and  generating spreadsheet in open office..but nobody
> should modify the file..so can anybody tell me how can we give permissions
> (read only) to spreadsheet in odfpy??..i have change the properties of my
> normal open office spreadsheet file and made it read only..n also
extracted
> it..but in conteny.xml also i am not finding any property which can be
used
> in odfpy...so please give me some solution..
>
>
> regards
> shruti surve
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 204 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20090520/df35ec53/attachment-0001.sig>


More information about the Python-list mailing list