Skip to content

Commit f9f114c

Browse files
wip
1 parent 09e2f3f commit f9f114c

File tree

18 files changed

+198
-198
lines changed

18 files changed

+198
-198
lines changed

synapse/datamodel.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def getRuntPode(self):
218218
'form': self.form.name,
219219
'relname': self.name,
220220
'base': self.name.split(':')[-1],
221-
'ro': int(self.info.get('ro', False)),
221+
'computed': int(self.info.get('computed', False)),
222222
'extmodel': self.isext,
223223
},
224224
})
@@ -627,7 +627,7 @@ def __init__(self, core=None):
627627
info = {
628628
'virts': (
629629
('form', ('syn:form', {}), {
630-
'ro': True,
630+
'computed': True,
631631
'doc': 'The form of node which is referenced.'}),
632632
),
633633
'doc': 'The node definition type for a (form,valu) compound field.',
@@ -638,7 +638,7 @@ def __init__(self, core=None):
638638
info = {
639639
'virts': (
640640
('size', ('int', {}), {
641-
'ro': True,
641+
'computed': True,
642642
'doc': 'The number of elements in the array.'}),
643643
),
644644
'doc': 'A typed array which indexes each field.'

synapse/lib/editor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ async def _set(self, prop, valu, norminfo=None):
793793

794794
cval = curv[0]
795795

796-
if prop.info.get('ro') and cval:
796+
if prop.info.get('computed') and cval:
797797
raise s_exc.ReadOnlyProp(mesg=f'Property is read only: {prop.full}.')
798798

799799
if cval is not None and norminfo.get('merge', True):
@@ -847,7 +847,7 @@ async def pop(self, name):
847847
if valu is s_common.novalu:
848848
return False
849849

850-
if prop.info.get('ro'):
850+
if prop.info.get('computed'):
851851
raise s_exc.ReadOnlyProp(mesg=f'Property is read only: {prop.full}.', name=prop.full)
852852

853853
self.props.pop(name, None)

synapse/lib/storm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3225,7 +3225,7 @@ async def execStormCmd(self, runt, genr):
32253225
for name, valu in node.getProps().items():
32263226

32273227
prop = node.form.prop(name)
3228-
if prop.info.get('ro'):
3228+
if prop.info.get('computed'):
32293229
curv = proto.get(name)
32303230
if curv is not None and curv != valu:
32313231
valurepr = prop.type.repr(curv)
@@ -3665,7 +3665,7 @@ async def diffgenr():
36653665
if propfilter(prop.full):
36663666
continue
36673667

3668-
if prop.info.get('ro'):
3668+
if prop.info.get('computed'):
36693669
isset = False
36703670
for undr in sodes[1:]:
36713671
props = undr.get('props')

synapse/models/auth.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ async def norm(self, valu, view=None):
5050
'forms': (
5151
('auth:passwd', {}, (
5252
('md5', ('crypto:hash:md5', {}), {
53-
'ro': True,
53+
'computed': True,
5454
'doc': 'The MD5 hash of the password.'}),
5555

5656
('sha1', ('crypto:hash:sha1', {}), {
57-
'ro': True,
57+
'computed': True,
5858
'doc': 'The SHA1 hash of the password.'}),
5959

6060
('sha256', ('crypto:hash:sha256', {}), {
61-
'ro': True,
61+
'computed': True,
6262
'doc': 'The SHA256 hash of the password.'}),
6363
)),
6464
),

synapse/models/base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,15 +250,15 @@
250250
'doc': 'A display sort order for siblings.'}),
251251

252252
('base', ('taxon', {}), {
253-
'ro': True,
253+
'computed': True,
254254
'doc': 'The base taxon.'}),
255255

256256
('depth', ('int', {}), {
257-
'ro': True,
257+
'computed': True,
258258
'doc': 'The depth indexed from 0.'}),
259259

260260
('parent', ('$self', {}), {
261-
'ro': True,
261+
'computed': True,
262262
'doc': 'The taxonomy parent.'}),
263263
),
264264
}),

synapse/models/crypto.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,9 @@
309309

310310
('crypto:currency:block', {}, (
311311
('coin', ('econ:currency', {}), {
312-
'doc': 'The coin/blockchain this block resides on.', 'ro': True, }),
312+
'doc': 'The coin/blockchain this block resides on.', 'computed': True, }),
313313
('offset', ('int', {}), {
314-
'doc': 'The index of this block.', 'ro': True, }),
314+
'doc': 'The index of this block.', 'computed': True, }),
315315
('hash', ('hex', {}), {
316316
'doc': 'The unique hash for the block.'}),
317317
('minedby', ('crypto:currency:address', {}), {
@@ -338,11 +338,11 @@
338338
('crypto:smart:token', {}, (
339339

340340
('contract', ('crypto:smart:contract', {}), {
341-
'ro': True,
341+
'computed': True,
342342
'doc': 'The smart contract which defines and manages the token.'}),
343343

344344
('tokenid', ('hugenum', {}), {
345-
'ro': True,
345+
'computed': True,
346346
'doc': 'The token ID.'}),
347347

348348
('owner', ('crypto:currency:address', {}), {
@@ -458,13 +458,13 @@
458458
('crypto:currency:address', {}, (
459459

460460
('coin', ('econ:currency', {}), {
461-
'doc': 'The crypto coin to which the address belongs.', 'ro': True, }),
461+
'doc': 'The crypto coin to which the address belongs.', 'computed': True, }),
462462

463463
('seed', ('crypto:key', {}), {
464464
'doc': 'The cryptographic key and or password used to generate the address.'}),
465465

466466
('iden', ('str', {}), {
467-
'doc': 'The coin specific address identifier.', 'ro': True, }),
467+
'doc': 'The coin specific address identifier.', 'computed': True, }),
468468

469469
('desc', ('str', {}), {
470470
'doc': 'A free-form description of the address.'}),
@@ -542,10 +542,10 @@
542542
('crypto:currency:client', {}, (
543543

544544
('inetaddr', ('inet:client', {}), {
545-
'doc': 'The Internet client address observed using the crypto currency address.', 'ro': True, }),
545+
'doc': 'The Internet client address observed using the crypto currency address.', 'computed': True, }),
546546

547547
('coinaddr', ('crypto:currency:address', {}), {
548-
'doc': 'The crypto currency address observed in use by the Internet client.', 'ro': True, }),
548+
'doc': 'The crypto currency address observed in use by the Internet client.', 'computed': True, }),
549549
)),
550550

551551
('crypto:hash:md5', {}, ()),
@@ -568,9 +568,9 @@
568568

569569
('crypto:x509:signedfile', {}, (
570570
('cert', ('crypto:x509:cert', {}), {
571-
'doc': 'The certificate for the key which signed the file.', 'ro': True, }),
571+
'doc': 'The certificate for the key which signed the file.', 'computed': True, }),
572572
('file', ('file:bytes', {}), {
573-
'doc': 'The file which was signed by the certificates key.', 'ro': True, }),
573+
'doc': 'The file which was signed by the certificates key.', 'computed': True, }),
574574
)),
575575

576576
('crypto:x509:crl', {}, (
@@ -582,9 +582,9 @@
582582

583583
('crypto:x509:revoked', {}, (
584584
('crl', ('crypto:x509:crl', {}), {
585-
'doc': 'The CRL which revoked the certificate.', 'ro': True, }),
585+
'doc': 'The CRL which revoked the certificate.', 'computed': True, }),
586586
('cert', ('crypto:x509:cert', {}), {
587-
'doc': 'The certificate revoked by the CRL.', 'ro': True, }),
587+
'doc': 'The certificate revoked by the CRL.', 'computed': True, }),
588588
)),
589589

590590
('crypto:x509:cert', {}, (

synapse/models/dns.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -213,45 +213,45 @@ async def _normPyStr(self, valu, view=None):
213213

214214
'forms': (
215215
('inet:dns:a', {}, (
216-
('fqdn', ('inet:fqdn', {}), {'ro': True,
216+
('fqdn', ('inet:fqdn', {}), {'computed': True,
217217
'doc': 'The domain queried for its DNS A record.'}),
218-
('ip', ('inet:ip', {}), {'ro': True,
218+
('ip', ('inet:ip', {}), {'computed': True,
219219
'doc': 'The IPv4 address returned in the A record.',
220220
'prevnames': ('ipv4',)}),
221221
('seen', ('ival', {}), {
222222
'doc': 'The time range where the record was observed.'}),
223223
)),
224224
('inet:dns:aaaa', {}, (
225-
('fqdn', ('inet:fqdn', {}), {'ro': True,
225+
('fqdn', ('inet:fqdn', {}), {'computed': True,
226226
'doc': 'The domain queried for its DNS AAAA record.'}),
227-
('ip', ('inet:ip', {}), {'ro': True,
227+
('ip', ('inet:ip', {}), {'computed': True,
228228
'doc': 'The IPv6 address returned in the AAAA record.',
229229
'prevnames': ('ipv6',)}),
230230
)),
231231
('inet:dns:rev', {'prevnames': ('inet:dns:rev6',)}, (
232-
('ip', ('inet:ip', {}), {'ro': True,
232+
('ip', ('inet:ip', {}), {'computed': True,
233233
'doc': 'The IP address queried for its DNS PTR record.',
234234
'prevnames': ('ipv4', 'ipv6')}),
235235

236-
('fqdn', ('inet:fqdn', {}), {'ro': True,
236+
('fqdn', ('inet:fqdn', {}), {'computed': True,
237237
'doc': 'The domain returned in the PTR record.'}),
238238
)),
239239
('inet:dns:ns', {}, (
240-
('zone', ('inet:fqdn', {}), {'ro': True,
240+
('zone', ('inet:fqdn', {}), {'computed': True,
241241
'doc': 'The domain queried for its DNS NS record.'}),
242-
('ns', ('inet:fqdn', {}), {'ro': True,
242+
('ns', ('inet:fqdn', {}), {'computed': True,
243243
'doc': 'The domain returned in the NS record.'}),
244244
)),
245245
('inet:dns:cname', {}, (
246-
('fqdn', ('inet:fqdn', {}), {'ro': True,
246+
('fqdn', ('inet:fqdn', {}), {'computed': True,
247247
'doc': 'The domain queried for its CNAME record.'}),
248-
('cname', ('inet:fqdn', {}), {'ro': True,
248+
('cname', ('inet:fqdn', {}), {'computed': True,
249249
'doc': 'The domain returned in the CNAME record.'}),
250250
)),
251251
('inet:dns:mx', {}, (
252-
('fqdn', ('inet:fqdn', {}), {'ro': True,
252+
('fqdn', ('inet:fqdn', {}), {'computed': True,
253253
'doc': 'The domain queried for its MX record.'}),
254-
('mx', ('inet:fqdn', {}), {'ro': True,
254+
('mx', ('inet:fqdn', {}), {'computed': True,
255255
'doc': 'The domain returned in the MX record.'}),
256256
)),
257257

@@ -265,20 +265,20 @@ async def _normPyStr(self, valu, view=None):
265265
)),
266266

267267
('inet:dns:txt', {}, (
268-
('fqdn', ('inet:fqdn', {}), {'ro': True,
268+
('fqdn', ('inet:fqdn', {}), {'computed': True,
269269
'doc': 'The domain queried for its TXT record.'}),
270-
('txt', ('str', {}), {'ro': True,
270+
('txt', ('str', {}), {'computed': True,
271271
'doc': 'The string returned in the TXT record.'}),
272272
)),
273273

274274
('inet:dns:query', {}, (
275-
('client', ('inet:client', {}), {'ro': True, }),
276-
('name', ('inet:dns:name', {}), {'ro': True, }),
275+
('client', ('inet:client', {}), {'computed': True, }),
276+
('name', ('inet:dns:name', {}), {'computed': True, }),
277277
('name:ip', ('inet:ip', {}), {
278278
'prevnames': ('name:ipv4', 'name:ipv6')}),
279279

280280
('name:fqdn', ('inet:fqdn', {}), {}),
281-
('type', ('int', {}), {'ro': True, }),
281+
('type', ('int', {}), {'computed': True, }),
282282
)),
283283

284284
('inet:dns:request', {}, (
@@ -311,17 +311,17 @@ async def _normPyStr(self, valu, view=None):
311311
)),
312312

313313
('inet:dns:wild:a', {}, (
314-
('fqdn', ('inet:fqdn', {}), {'ro': True,
314+
('fqdn', ('inet:fqdn', {}), {'computed': True,
315315
'doc': 'The domain containing a wild card record.'}),
316-
('ip', ('inet:ip', {}), {'ro': True,
316+
('ip', ('inet:ip', {}), {'computed': True,
317317
'doc': 'The IPv4 address returned by wild card resolutions.',
318318
'prevnames': ('ipv4',)}),
319319
)),
320320

321321
('inet:dns:wild:aaaa', {}, (
322-
('fqdn', ('inet:fqdn', {}), {'ro': True,
322+
('fqdn', ('inet:fqdn', {}), {'computed': True,
323323
'doc': 'The domain containing a wild card record.'}),
324-
('ip', ('inet:ip', {}), {'ro': True,
324+
('ip', ('inet:ip', {}), {'computed': True,
325325
'doc': 'The IPv6 address returned by wild card resolutions.',
326326
'prevnames': ('ipv6',)}),
327327
)),

synapse/models/files.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,15 @@ async def _normPyStr(self, valu, view=None):
146146
('file:path', 'synapse.models.files.FilePath', {}, {
147147
'virts': (
148148
('ext', ('str', {}), {
149-
'ro': True,
149+
'computed': True,
150150
'doc': 'The file extension from the path.'}),
151151

152152
('dir', ('file:path', {}), {
153-
'ro': True,
153+
'computed': True,
154154
'doc': 'The directory from the path.'}),
155155

156156
('base', ('file:base', {}), {
157-
'ro': True,
157+
'computed': True,
158158
'doc': 'The file base name from the path.'}),
159159
),
160160
'doc': 'A normalized file path.',
@@ -517,27 +517,27 @@ async def _normPyStr(self, valu, view=None):
517517
('file:mime:pe:vsvers:keyval', {}, (
518518

519519
('name', ('str', {}), {
520-
'ro': True,
520+
'computed': True,
521521
'doc': 'The key for the VS_VERSIONINFO keyval pair.'}),
522522

523523
('value', ('str', {}), {
524-
'ro': True,
524+
'computed': True,
525525
'doc': 'The value for the VS_VERSIONINFO keyval pair.'}),
526526
)),
527527

528528
('file:base', {}, (
529-
('ext', ('str', {}), {'ro': True,
529+
('ext', ('str', {}), {'computed': True,
530530
'doc': 'The file extension (if any).'}),
531531
)),
532532

533533
('file:filepath', {}, (
534534

535535
('file', ('file:bytes', {}), {
536-
'ro': True,
536+
'computed': True,
537537
'doc': 'The file seen at a path.'}),
538538

539539
('path', ('file:path', {}), {
540-
'ro': True,
540+
'computed': True,
541541
'doc': 'The path a file was seen at.'}),
542542

543543
)),
@@ -601,25 +601,25 @@ async def _normPyStr(self, valu, view=None):
601601

602602
('file:subfile', {}, (
603603
('parent', ('file:bytes', {}), {
604-
'ro': True,
604+
'computed': True,
605605
'doc': 'The parent file containing the child file.'}),
606606

607607
('child', ('file:bytes', {}), {
608-
'ro': True,
608+
'computed': True,
609609
'doc': 'The child file contained in the parent file.'}),
610610

611611
('path', ('file:path', {}), {
612612
'doc': 'The path that the parent uses to refer to the child file.'}),
613613
)),
614614

615615
('file:path', {}, (
616-
('dir', ('file:path', {}), {'ro': True,
616+
('dir', ('file:path', {}), {'computed': True,
617617
'doc': 'The parent directory.'}),
618618

619-
('base', ('file:base', {}), {'ro': True,
619+
('base', ('file:base', {}), {'computed': True,
620620
'doc': 'The file base name.'}),
621621

622-
('base:ext', ('str', {}), {'ro': True,
622+
('base:ext', ('str', {}), {'computed': True,
623623
'doc': 'The file extension.'}),
624624
)),
625625

0 commit comments

Comments
 (0)