Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(26)  |  Call(19)  |  Derive(0)  |  Import(7)

src/a/r/archivematica-HEAD/src/dashboard/src/components/filesystem_ajax/views.py   archivematica(Download)
def sorted_directory_list(path):
    cleaned = []
    entries = os.listdir(archivematicaFunctions.unicodeToStr(path))
    cleaned = [archivematicaFunctions.unicodeToStr(entry) for entry in entries]
    return sorted(cleaned, key=helpers.keynat)
            entries.append(entry)
            entry_path = os.path.join(path, entry)
            if os.path.isdir(archivematicaFunctions.unicodeToStr(entry_path)) and os.access(archivematicaFunctions.unicodeToStr(entry_path), os.R_OK):
                directories.append(entry)
 
def copy_transfer_component(request):
    transfer_name = archivematicaFunctions.unicodeToStr(request.POST.get('name', ''))
    # Note that the path may contain arbitrary, non-unicode characters,
    # and hence is POSTed to the server base64-encoded
    path = base64.b64decode(request.POST.get('path', ''))

src/a/r/archivematica-HEAD/src/MCPServer/lib/watchDirectory.py   archivematica(Download)
import sys
sys.path.append("/usr/lib/archivematica/archivematicaCommon")
from archivematicaFunctions import unicodeToStr
 
from archivematicaMCP import debug
                    print "Added: ", ", ".join (added)
                for i in added:
                    i = unicodeToStr(i)
                    directory = unicodeToStr(self.directory)
                    self.event(os.path.join(directory, i), self.variablesAdded, self.callBackFunctionAdded)
            if removed:
                if DEBUG: 
                    print "Removed: ", ", ".join (removed)
                for i in removed:
                    i = unicodeToStr(i)
                for i in removed:
                    i = unicodeToStr(i)
                    directory = unicodeToStr(self.directory)
                    self.event(os.path.join(directory, i), self.variablesRemoved, self.callBackFunctionRemoved)
            before = after

src/a/r/archivematica-HEAD/src/archivematicaCommon/lib/fileOperations.py   archivematica(Download)
from databaseFunctions import insertIntoEvents
import MySQLdb
from archivematicaFunctions import unicodeToStr
 
def updateSizeAndChecksum(fileUUID, filePath, date, eventIdentifierUUID):
def updateFileLocation(src, dst, eventType, eventDateTime, eventDetail, eventIdentifierUUID = uuid.uuid4().__str__(), fileUUID="None", sipUUID = None, transferUUID=None, eventOutcomeDetailNote = ""):
    """If the file uuid is not provided, will use the sip uuid and old path to find the file uuid"""
    src = unicodeToStr(src)
    dst = unicodeToStr(dst)
    fileUUID = unicodeToStr(fileUUID)
        row = c.fetchone()
        while row != None:
            fileUUID = unicodeToStr(row[0])
            row = c.fetchone()
        sqlLock.release()

src/a/r/archivematica-HEAD/src/archivematicaCommon/lib/databaseFunctions.py   archivematica(Download)
import MySQLdb
import uuid
from archivematicaFunctions import unicodeToStr
 
def escapeForDB(str):
    str = unicodeToStr(str)

src/a/r/archivematica-HEAD/src/MCPClient/lib/clientScripts/extractMaildirAttachments.py   archivematica(Download)
from externals.extractMaildirAttachments import parse
from fileOperations import addFileToTransfer, updateSizeAndChecksum
from archivematicaFunctions import unicodeToStr
from sharedVariablesAcrossModules import sharedVariablesAcrossModules 
import databaseInterface
                                filePath = os.path.join(transferDir, "objects", "attachments", maildirsub, subDir, "%s_%s" % (attachedFileUUID, attachment.name))
                                print '\tAttachment path:', filePath
                                filePath = unicodeToStr(filePath)
                                writeFile(filePath, attachment)
                                eventDetail="Unpacked from: {%s}%s" % (sourceFileUUID, sourceFilePath) 

src/a/r/archivematica-HEAD/src/MCPServer/lib/linkTaskManagerChoice.py   archivematica(Download)
choicesAvailableForUnitsLock = threading.Lock()
sys.path.append("/usr/lib/archivematica/archivematicaCommon")
from archivematicaFunctions import unicodeToStr
 
waitingOnTimer="waitingOnTimer"
                                        archivematicaMCP.config.get('MCPServer', "processingXMLFile") \
                                    )
        xmlFilePath = unicodeToStr(xmlFilePath)
        if os.path.isfile(xmlFilePath):
            # For a list of items with pks:

src/a/r/archivematica-HEAD/src/MCPServer/lib/archivematicaMCP.py   archivematica(Download)
import traceback
from externals.singleInstance import singleinstance
from archivematicaFunctions import unicodeToStr
 
# Print SQL sent to the database interface 
def createUnitAndJobChain(path, config, terminate=False):
    path = unicodeToStr(path)
    if os.path.isdir(path):
            path = path + "/"
    print "createUnitAndJobChain", path, config

src/a/r/archivematica-HEAD/src/MCPClient/lib/clientScripts/sanitizeObjectNames.py   archivematica(Download)
from databaseFunctions import insertIntoEvents
from fileOperations import updateFileLocation
from archivematicaFunctions import unicodeToStr
 
if __name__ == '__main__':