This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
demo@archivematicaDev:~$ ls -l /usr/share/elasticsearch/ | |
total 36 | |
drwxrwxr-x 2 demo demo 4096 Apr 22 14:42 bin | |
drwxrwxr-x 2 demo demo 4096 Apr 22 14:42 config | |
drwxrwxr-x 3 demo demo 4096 Apr 22 14:42 lib | |
-rw-r--r-- 1 demo demo 11358 Oct 13 2012 LICENSE.txt | |
-rw-r--r-- 1 demo demo 165 Oct 13 2012 NOTICE.txt | |
-rw-r--r-- 1 demo demo 7935 Mar 25 02:39 README.textile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get transfer info | |
transfer = models.Transfer.objects.get(uuid=transfer_uuid) | |
transfer_path = transfer.currentlocation.replace( | |
'%sharedPath%', | |
helpers.get_server_config_value('sharedDirectory') | |
) | |
# extra transfer name | |
transfer_directory_name = os.path.basename(transfer_path[:-1]) | |
transfer_name = transfer_directory_name[:-37] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from lxml import etree | |
stuff = { | |
"aaa": "bbb", | |
"ccc": "ddd" | |
} | |
# create XML | |
root = etree.Element('processingMCP') | |
choices = etree.Element('preconfiguredChoices') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
forms.py: | |
class ProcessingForm(forms.Form): | |
def __init__(self, *args, **kwargs): | |
if 'extra' in kwargs: | |
extra = kwargs.pop('extra') | |
super(ProcessingForm, self).__init__(*args, **kwargs) | |
if 'extra' in locals(): | |
for i, question in enumerate(extra): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install curl | |
curl https://raw.github.com/artefactual/archivematica/master/src/archivematicaCommon/lib/utilities/sword-diagnose.py | python |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Part I | |
1. Why the Web needs Node | |
2. Getting started with Node | |
3. Asynchronous programming | |
Part II | |
4. Building Node web applications | |
5. Storing Node application data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) Use one of the task files as guidance… for example: | |
lib/task/import/csvAuthorityRecordImportTask.class.php | |
2) Some code to create a repo: | |
<?php | |
$repo = new QubitRepository(); | |
$repo->authorizedFormOfName = 'My Repository'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
conn = pyes.ES('127.0.0.1:9200') | |
indexes = conn.get_indices() | |
if 'fpr_file' not in indexes: | |
# Grab relevant FPR data from the DB | |
results = get_fpr_table() | |
# Setup indexing for some Elastic Search action. | |
for row in results: | |
conn.index(row, 'fpr_file', 'fpr_files') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys, MySQLdb, cPickle, base64 | |
sys.path.append("/usr/lib/archivematica/archivematicaCommon") | |
import databaseInterface | |
sys.path.append("/usr/lib/archivematica/archivematicaCommon/externals") | |
import pyes | |
def index_documents_from_database(index, type): | |
indexed = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python -OO | |
# This file is part of Archivematica. | |
# | |
# Copyright 2010-2011 Artefactual Systems Inc. <http://artefactual.com> | |
# | |
# Archivematica is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 2 of the License, or | |
# (at your option) any later version. |