Open and import the refrenced schema. @param options: An options dictionary. @type options: L{options.Options} @return: The referenced schema. @rtype: L{Schema}
(self, options)
| 521 | self.opened = False |
| 522 | |
| 523 | def open(self, options): |
| 524 | """ |
| 525 | Open and import the refrenced schema. |
| 526 | @param options: An options dictionary. |
| 527 | @type options: L{options.Options} |
| 528 | @return: The referenced schema. |
| 529 | @rtype: L{Schema} |
| 530 | """ |
| 531 | if self.opened: |
| 532 | return |
| 533 | self.opened = True |
| 534 | log.debug('%s, importing ns="%s", location="%s"', |
| 535 | self.id, |
| 536 | self.ns[1], |
| 537 | self.location |
| 538 | ) |
| 539 | result = self.locate() |
| 540 | if result is None: |
| 541 | if self.location is None: |
| 542 | log.debug('imported schema (%s) not-found', self.ns[1]) |
| 543 | else: |
| 544 | result = self.download(options) |
| 545 | log.debug('imported:\n%s', result) |
| 546 | return result |
| 547 | |
| 548 | def locate(self): |
| 549 | """ find the schema locally """ |
no test coverage detected