Skip to content

Commit d6db3ed

Browse files
committed
Reworked payload generation
1 parent 6a69447 commit d6db3ed

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

astroquery/vizier/core.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -610,22 +610,22 @@ def _args_to_payload(self, *args, **kwargs):
610610
body['-ucd'] = ucd
611611

612612
# create final script starting with keywords
613-
script = ""
613+
script = []
614614
if (not isinstance(self.keywords, property) and
615615
self.keywords is not None):
616-
script += str(self.keywords)
616+
script += [str(self.keywords)]
617617
# add all items that are not lists
618618
for key, val in body.items():
619619
if type(val) is not list:
620-
script += "\n{key}={val}".format(key=key, val=val)
620+
script += ["{key}={val}".format(key=key, val=val)]
621621
# add list at the end
622622
for key, val in body.items():
623623
if type(val) is list:
624-
script += "\n{key}=<<====AstroqueryList".format(key=key)
625-
script += "\n" + "\n".join(val)
626-
script += "\n====AstroqueryList"
627-
# add keywords
628-
return script
624+
script += ["{key}=<<====AstroqueryList".format(key=key)]
625+
script += val
626+
script += ["====AstroqueryList"]
627+
# merge result
628+
return "\n".join(script)
629629

630630
def _parse_result(self, response, get_catalog_names=False, verbose=False,
631631
invalid='warn'):

0 commit comments

Comments
 (0)