Beispiel #1
0
 def setUp(self):
     password = Tier().password(self.USERNAME)
     opts = dict(comment="filter testing", password=password)
     Tests.session = Session.create_session(self.USERNAME, **opts)
Beispiel #2
0
                    "-v",
                    help="create version",
                    action="store_true")
parser.add_argument("--publishable",
                    "-p",
                    help="make version publishable",
                    action="store_true")
parser.add_argument("--force",
                    "-f",
                    help="force checkout",
                    action="store_true")
opts = parser.parse_args()
if opts.session:
    session = Session(opts.session, tier=opts.tier)
else:
    session = Session.create_session(opts.user, tier=opts.tier)
print(session)
with open(opts.xml, "rb") as fp:
    xml = fp.read()
doc = Doc(session, id=opts.id, doctype=opts.doctype, xml=xml)
if opts.id:
    doc.check_out(force=opts.force)
version = opts.version or opts.publishable
val_types = ["schema", "links"] if opts.publishable else None
save_opts = dict(
    version=version,
    publishable=opts.publishable,
    val_types=val_types,
    comment=opts.comment,
    unlock=True,
)
Beispiel #3
0
 def session(self):
     if not hasattr(self, "_session"):
         opts = dict(password=cdr.getpw("pdqcontent"))
         self._session = Session.create_session("pdqcontent", **opts)
     return self._session