Beispiel #1
0
 def finish_parameters(self):
     """Finish up parameter setup which requires parsed command line arguments."""
     self.username = self.args.username or config.get_username()
     password = config.get_password()
     self.base_url = config.get_server_url(self.observatory)
     self.submission_info = api.get_submission_info(self.observatory,
                                                    self.username)
     self.instruments_filekinds = utils.get_instruments_filekinds(
         self.observatory, self.files) if self.args.files else {}
     self.instrument = list(self.instruments_filekinds.keys())[0] if len(
         self.instruments_filekinds) == 1 else "none"
     self.connection = web.CrdsDjangoConnection(
         locked_instrument=self.instrument,
         username=self.username,
         password=password,
         base_url=self.base_url)
     if self.args.derive_from_context in ["edit", "ops"]:
         self.pmap_mode = "pmap_" + self.args.derive_from_context
         self.pmap_name = self.resolve_context(
             self.observatory + "-" + self.args.derive_from_context)
     else:
         self.pmap_mode = "pmap_text"
         self.pmap_name = self.args.derive_from_context
     assert config.is_context(
         self.pmap_name), "Invalid pmap_name " + repr(self.pmap_name)
     assert not (self.args.keep_existing_files and self.args.wipe_existing_files), \
         "--keep-existing-files and --wipe-existing-files are mutually exclusive."
Beispiel #2
0
 def finish_parameters(self):
     """Finish up parameter setup which requires parsed command line arguments."""
     self.username = self.args.username or config.get_username()
     password = config.get_password()
     self.base_url = config.get_server_url(self.observatory)
     self.instruments_filekinds = utils.get_instruments_filekinds(
         self.observatory, self.files) if self.args.files else {}
     self.instrument = list(self.instruments_filekinds.keys())[0] if len(
         self.instruments_filekinds) == 1 else "none"
     self.connection = web.CrdsDjangoConnection(
         locked_instrument=self.instrument,
         username=self.username,
         password=password,
         base_url=self.base_url)
     if self.args.derive_from_context is None:
         self.args.derive_from_context = self.observatory + "-edit"
     if self.args.derive_from_context.endswith(("-edit", "-operational")):
         # this actually floats for concurrent deliveries
         self.pmap_mode = "pmap_" + self.args.derive_from_context.split(
             "-")[-1]
     else:
         self.pmap_mode = "pmap_text"
     self.pmap_name = self.resolve_context(self.args.derive_from_context)
     assert config.is_context(
         self.pmap_name), "Invalid pmap_name " + repr(self.pmap_name)
     assert not (self.args.keep_existing_files and self.args.wipe_existing_files), \
         "--keep-existing-files and --wipe-existing-files are mutually exclusive."
Beispiel #3
0
 def finish_parameters(self):
     """Finish up parameter setup which requires parsed command line arguments."""
     self.username = self.args.username or config.get_username()
     password = config.get_password()
     self.base_url = config.get_server_url(self.observatory)
     self.submission_info = api.get_submission_info(self.observatory, self.username)
     self.instruments_filekinds = utils.get_instruments_filekinds(self.observatory, self.files) if self.args.files else {}
     self.instrument = list(self.instruments_filekinds.keys())[0] if len(self.instruments_filekinds) == 1 else "none"
     self.connection = web.CrdsDjangoConnection(
         locked_instrument=self.instrument, username=self.username, password=password, base_url=self.base_url)
     if self.args.derive_from_context in ["edit", "ops"]:
         self.pmap_mode = "pmap_" + self.args.derive_from_context
         self.pmap_name = self.resolve_context(self.observatory + "-" + self.args.derive_from_context)
     else:
         self.pmap_mode = "pmap_text"
         self.pmap_name = self.args.derive_from_context
     assert config.is_context(self.pmap_name), "Invalid pmap_name " + repr(self.pmap_name)
     assert not (self.args.keep_existing_files and self.args.wipe_existing_files), \
         "--keep-existing-files and --wipe-existing-files are mutually exclusive."