Changeset 34459

Show
Ignore:
Timestamp:
17.10.2020 16:31:17 (8 days ago)
Author:
davidb
Message:

Now works with dnzkey.txt to separate out where the key is stored

Location:
main/trunk/model-sites-dev/atea/collect/digital-nz/prepare
Files:
1 added
3 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/model-sites-dev/atea/collect/digital-nz/prepare/01-PREP.sh

    r34448 r34459  
    2222else 
    2323    if [ $pydnz_source_opt = "git" ] ; then 
    24     echo "Already git cloned pydnz repository" 
     24    echo "Already git cloned Python-based Digital NZ API repository: 'pydnz'" 
    2525    else 
    2626    # Assume "untar" 
    27     echo "Already untarred pydnz.tar.gz" 
     27    echo "Already untarred: pydnz.tar.gz" 
    2828    fi 
    2929fi 
     
    3737fi 
    3838 
     39 
     40if [ ! -f dnzkey.txt ] ; then 
     41    echo "Generating 'dnzkey.txt' from 'dnzkey.txt.in'" 
     42    /bin/cp dnzkey.txt.in dnzkey.txt 
     43    echo  
     44    echo "New edit:" 
     45    echo "  dnzkey.txt" 
     46    echo "And change <CHANGEME> to be your actual Digital NZ API key, accessed through:"    
     47    echo "  https://digitalnz.org/login" 
     48    echo 
     49else 
     50    echo "Already generated: 'dnzkey.txt'" 
     51    echo "=> Assuming this has been setup with a valid Digital NZ API key" 
     52fi 
  • main/trunk/model-sites-dev/atea/collect/digital-nz/prepare/02-RUN.sh

    r34448 r34459  
    1919echo "*    import" 
    2020echo "*" 
    21 echo "* These can be moved to the collection's import folder with:" 
     21echo "* To remove a previous download set from collection's import folder:" 
    2222echo "*   echo ../import/http* | xargs rm" 
     23echo "*" 
     24echo "* To move in a freshly downloaded set into the collection's import folder" 
    2325echo "*   echo import/http* | xargs mv -t ../import/" 
    2426echo "****" 
  • main/trunk/model-sites-dev/atea/collect/digital-nz/prepare/dnz-search-language-mi--python3.py

    r34453 r34459  
    1414 
    1515# DNZ key 
    16 DNZ = dnz.api.Dnz('<CHANGEME>') 
     16with open('dnzkey.txt','r') as file: 
     17    dnzkey_str = file.read().strip() 
     18     
     19# print("dnzkey_str = '" + dnzkey_str + "'") 
     20DNZ = dnz.api.Dnz(dnzkey_str)  
     21 
    1722 
    1823#result = dnz.search('kiwi tui')