Esempio n. 1
0
import os
import sys
import string
import shutil

from toolkit import osconfig
from toolkit.jsonhelper import jsonObject
from toolkit import filehelper

filemgrArchive = osconfig.filemgrArchive()

def privateFilesExist(meetingID):
    # JSON Response BEGIN (error message)
    jsonError = jsonObject()
    jsonError.clearResponse()
    jsonError.add('result','false')
    jsonError.add('method','privateFilesExist')
    jsonError.add('meetingID', meetingID)
    #JSON Response END
    
    # JSON Response BEGIN (success message)
    jsonSuccess = jsonObject()
    jsonSuccess.clearResponse()
    jsonSuccess.add('result','true')
    jsonSuccess.add('method','privateFilesExist')
    jsonSuccess.add('meetingID', meetingID)
    #JSON Response END
    
    if meetingID == '':
        return jsonError.jsonResponse()
    
Esempio n. 2
0
import os
import sys
import fileMgr
import zipfile
from toolkit import osconfig
from toolkit import unzip

archiveLoc = osconfig.filemgrArchive()


def uploadLogo(logoFile, meetingID, logoType):
    
    # Upload Logo accepts a logo file (image file) of different types - .png, .jpeg etc.
    try:
        fileMgr.deleteImageFiles(meetingID)
        dirPath = os.path.join(archiveLoc, meetingID)
        if not os.path.exists(dirPath):
            os.makedirs(dirPath)
        fileStoreLocation = os.path.join(dirPath, 'dimdim_logo')
        fileStoreLocation += '.' + logoType

        storedFile = None
        if sys.platform.startswith('win'):
            storedFile = open(fileStoreLocation, 'wb')
        else:
            storedFile = open(fileStoreLocation, 'w')
        while True:
            data = logoFile.file.read(8192)
            if not data:
                break
            storedFile.write(data)
Esempio n. 3
0
import os
import sys
import fileMgr
import zipfile
from toolkit import osconfig
from toolkit import unzip

archiveLoc = osconfig.filemgrArchive()


def uploadLogo(logoFile, meetingID, logoType):

    # Upload Logo accepts a logo file (image file) of different types - .png, .jpeg etc.
    try:
        fileMgr.deleteImageFiles(meetingID)
        dirPath = os.path.join(archiveLoc, meetingID)
        if not os.path.exists(dirPath):
            os.makedirs(dirPath)
        fileStoreLocation = os.path.join(dirPath, 'dimdim_logo')
        fileStoreLocation += '.' + logoType

        storedFile = None
        if sys.platform.startswith('win'):
            storedFile = open(fileStoreLocation, 'wb')
        else:
            storedFile = open(fileStoreLocation, 'w')
        while True:
            data = logoFile.file.read(8192)
            if not data:
                break
            storedFile.write(data)