Monday, February 26, 2018

More Python, CSS, and some Classes

Finally got back to more of a system's focus this week even though I spent a a little time in the classroom.

  1. My newest python code is pretty cool, as it will now automatically restore and reindex the various collections is our eXist database, and if there are any errors you see them as well. This is the basic guts of the code below for the restore process:

    import config as cfg

    for directory in restore :

        directory_backup = backup_date + "/db/" + directory + "/__contents__.xml"
        arguments = ["-u", cfg.login['user'], "-p", cfg.login['password'], "-r", directory_backup]
        command = [restore_program]
        command.extend(arguments)
        #restore directory
        try:
            out_bytes = subprocess.check_call(command, stdout=f,stderr=f)
        except subprocess.CalledProcessError as e:
            pass


    Basically it writes the standard output and errors to a file, which it later emails upon completion.

  2. I also spent an afternoon last week dropping in the new CSS code for the Alma mash_up that controls the Get It / View It windows in our Primo instance. Thank you to Paul Ojennus, Whitworth University for creating it. Below is what our Get It window now looks like, a serious upgrade from before:


  3. Also got to drop into two classes this week, one a Museum Studies course that might use Omeka, and the other a Civic Communication & Media class where I showed them how to use Zotero.

No comments:

Post a Comment