/usr/share/pyshared/tp/netlib/objects/Design.py is in python-tp-netlib 0.2.5-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | from xstruct import pack
from Header import Processed
class Design(Processed):
"""\
The Design packet consists of:
* a SInt32, design ID
* a SInt64, the last modified time
* a list of,
* a UInt32, category this design is in
* a String, name of the design
* a String, description of the design
* a SInt32, number of times in use
* a SInt32, owner of the design
* a list of,
* a UInt32, the ID of the component
* a UInt32, the number of this component
* a String, design feedback
* a list of,
* a UInt32, property id
* a String, property display string
"""
no = 48
struct = "jT[I]SSjj[II]S[IS]"
def __init__(self, sequence, id, modify_time, categories, name, desc, used, owner, components, feedback, properties):
Processed.__init__(self, sequence)
# Length is:
#
self.length = 4 + 8 + \
4 + len(categories)*4 + \
4 + len(name) + \
4 + len(desc) + \
4 + 4 + \
4 + len(components)*8 + \
4 + len(feedback) + \
4
for x, s in properties:
self.length += 4 + 4 + len(s)
self.id = id
self.modify_time = modify_time
self.categories = categories
self.name = name
self.desc = desc
self.used = used
self.owner = owner
self.components = components
self.feedback = feedback
self.properties = properties
def __str__(self):
output1 = pack(self.struct, self.id, self.modify_time, self.categories, self.name, self.desc, self.used, self.owner, self.components, self.feedback, self.properties)
self.length = len(output1)
output2 = Processed.__str__(self)
return output2+output1
|