From 9c9d37260e9562522663c01ab5004d20e1b5aa2d Mon Sep 17 00:00:00 2001 From: kthoden Date: Mon, 27 Jan 2020 16:15:06 +0100 Subject: [PATCH] Docstrings --- .../management/commands/publicationimport.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/eoapublications/management/commands/publicationimport.py b/eoapublications/management/commands/publicationimport.py index 7e8a055..8a0526a 100644 --- a/eoapublications/management/commands/publicationimport.py +++ b/eoapublications/management/commands/publicationimport.py @@ -13,14 +13,12 @@ import shlex import subprocess -""" -export PYTHONPATH="/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages" -""" - class Command(BaseCommand): - help = "RTFM!" - # process as string to be used to create html text for elements + help = "Import a publication into the Django database." + def process_as_string(self,xmlElement): + """Create html text for elements""" + strResult = xmlElement.text or "" for xmlChild in xmlElement.iterchildren(): strResult = strResult + etree.tostring(xmlChild).decode() @@ -241,6 +239,8 @@ def progress(self, count, total, status=''): def handle(self, **options): + """The main bit.""" + # Get current directory, and append /import strDir = os.getcwd() + '/import' # Read .cfg-File