Package src :: Module controller
[hide private]
[frames] | no frames]

Module controller

source code

The module forwards files to the proper inspector.

After the inspection it collects the feedback to be shown on the user interface.


See Also: Function beginInspection().

Author: Vili Auvinen, Olli Kauppinen, Juho Tammela

Functions [hide private]
 
checkZipFiles(zipFile, fileName, feedback, requirements)
Checks if the file is a zip file and forwards the document files to the proper inspector function.
source code
 
stringToParagraph(s)
Converts a string to html paragraph.
source code
 
resultsToDom(fileName, results)
Converts with DOM the results of an inspection to the HTML format.
source code
 
getFileExtension(fileName)
Gets the file extension from the file name string.
source code
 
printResults(resultsDict) source code
 
beginInspection(sentfile, filename, feedback, email)
Begins the inspection of a file.
source code
Variables [hide private]
  __package__ = 'src'
Function Details [hide private]

checkZipFiles(zipFile, fileName, feedback, requirements)

source code 

Checks if the file is a zip file and forwards the document files to the proper inspector function.

Recursively checks if files inside a zip file are zip files. If the file is a zip file and it's in Microsoft Office or OpenOffice.org file format, gives the file forward.

resultsToDom(fileName, results)

source code 

Converts with DOM the results of an inspection to the HTML format.

Parameters:
  • fileName - The name of the file where the results are saved.
  • results - The results of the inspection.
Returns:
Results as HTML format.

getFileExtension(fileName)

source code 

Gets the file extension from the file name string.

Splits the given string at the character . and returns the string on the right side of it.

Parameters:
  • fileName - the ile name as a string.
Returns:
The file extension or the original string if the character . is not found.

beginInspection(sentfile, filename, feedback, email)

source code 

Begins the inspection of a file. Gets the requirements.xml using the email-address as a folder name.

Parameters:
  • sentFile - the file to be inspected, can be Microsoft Office docx file, OpenOffice.org odt file or a zip file containing them.
  • filename - the name of the file.
  • feedback - empty list where the feedback of the inspection is stored.
  • email - the email address of the user.
Returns:
An error string as a HTML paragraph if the requirements file is not found.