
import sys
import os

sys.path.append('.')
import roche.settings

from os import walk
from eulexistdb.db import ExistDB
from roche.settings import EXISTDB_SERVER_URL

#
# Timeout higher?
#
xmldb = ExistDB(timeout=30)

xmldb.createCollection('docker', True)
xmldb.createCollection('docker/texts', True)

os.chdir('../dublin-store')

for (dirpath, dirnames, filenames) in walk('浙江大學圖書館'):
    xmldb.createCollection('docker/texts' + '/' + dirpath, True)
    if filenames:
        for filename in filenames:
            with open(dirpath + '/' + filename) as f:
                xmldb.load(f, 'docker/texts' + '/' + dirpath + '/' + filename, True)


import sys
import os

sys.path.append('.')
import roche.settings

from os import walk
from eulexistdb.db import ExistDB
from roche.settings import EXISTDB_SERVER_URL

#
# Timeout higher?
#
xmldb = ExistDB(timeout=30)

xmldb.createCollection('docker', True)
xmldb.createCollection('docker/texts', True)

os.chdir('../dublin-store')

for (dirpath, dirnames, filenames) in walk('浙江大學圖書館'):
    xmldb.createCollection('docker/texts' + '/' + dirpath, True)
    if filenames:
        for filename in filenames:
            with open(dirpath + '/' + filename) as f:
                xmldb.load(f, 'docker/texts' + '/' + dirpath + '/' + filename, True)

#
# Load resources
#
for (dirpath, dirnames, filenames) in walk('resources'):
    xmldb.createCollection('docker' + '/' + dirpath, True)
    if filenames:
        for filename in filenames:
            with open(dirpath + '/' + filename) as f:
                xmldb.load(f, 'docker' + '/' + dirpath + '/' + filename, True)

Load other resources into exist-db
Load other resources into exist-db

  
  import sys
  import os
  
  sys.path.append('.')
  import roche.settings
  
  from os import walk
  from eulexistdb.db import ExistDB
  from roche.settings import EXISTDB_SERVER_URL
  
  #
  # Timeout higher?
  #
  xmldb = ExistDB(timeout=30)
  
  xmldb.createCollection('docker', True)
  xmldb.createCollection('docker/texts', True)
  
  os.chdir('../dublin-store')
  
  for (dirpath, dirnames, filenames) in walk('浙江大學圖書館'):
      xmldb.createCollection('docker/texts' + '/' + dirpath, True)
      if filenames:
          for filename in filenames:
              with open(dirpath + '/' + filename) as f:
                  xmldb.load(f, 'docker/texts' + '/' + dirpath + '/' + filename, True)
  
+ #
+ # Load resources
+ #
+ for (dirpath, dirnames, filenames) in walk('resources'):
+     xmldb.createCollection('docker' + '/' + dirpath, True)
+     if filenames:
+         for filename in filenames:
+             with open(dirpath + '/' + filename) as f:
+                 xmldb.load(f, 'docker' + '/' + dirpath + '/' + filename, True)
+ 
Load other resources into exist-db
## Code Before:

import sys
import os

sys.path.append('.')
import roche.settings

from os import walk
from eulexistdb.db import ExistDB
from roche.settings import EXISTDB_SERVER_URL

#
# Timeout higher?
#
xmldb = ExistDB(timeout=30)

xmldb.createCollection('docker', True)
xmldb.createCollection('docker/texts', True)

os.chdir('../dublin-store')

for (dirpath, dirnames, filenames) in walk('浙江大學圖書館'):
    xmldb.createCollection('docker/texts' + '/' + dirpath, True)
    if filenames:
        for filename in filenames:
            with open(dirpath + '/' + filename) as f:
                xmldb.load(f, 'docker/texts' + '/' + dirpath + '/' + filename, True)

## Instruction:
Load other resources into exist-db
## Code After:

import sys
import os

sys.path.append('.')
import roche.settings

from os import walk
from eulexistdb.db import ExistDB
from roche.settings import EXISTDB_SERVER_URL

#
# Timeout higher?
#
xmldb = ExistDB(timeout=30)

xmldb.createCollection('docker', True)
xmldb.createCollection('docker/texts', True)

os.chdir('../dublin-store')

for (dirpath, dirnames, filenames) in walk('浙江大學圖書館'):
    xmldb.createCollection('docker/texts' + '/' + dirpath, True)
    if filenames:
        for filename in filenames:
            with open(dirpath + '/' + filename) as f:
                xmldb.load(f, 'docker/texts' + '/' + dirpath + '/' + filename, True)

#
# Load resources
#
for (dirpath, dirnames, filenames) in walk('resources'):
    xmldb.createCollection('docker' + '/' + dirpath, True)
    if filenames:
        for filename in filenames:
            with open(dirpath + '/' + filename) as f:
                xmldb.load(f, 'docker' + '/' + dirpath + '/' + filename, True)
