Revisión 38
Añadido por Manu Mora Gordillo hace más de 14 años
MyUtils.py | ||
---|---|---|
|
||
import hashlib
|
||
import os
|
||
import socket
|
||
|
||
def getMD5Hash(file, block_size=2**20):
|
||
f = open(file)
|
||
... | ... | |
return "application/x-iso9660-image"
|
||
elif path.endswith(".md5"):
|
||
return "text/plain"
|
||
|
||
def getClassroomName():
|
||
name = socket.gethostname()
|
||
classname="noclassroomname"
|
||
hostname=name.strip().split('.')[0].replace('_','-')
|
||
items=hostname.split('-')
|
||
|
||
if len(items)==2:
|
||
if len(items[1])==3 and (items[1].upper()=='PRO' or items[1][:1].upper()=='O'):
|
||
classname= items[0]
|
||
|
||
return classname
|
Exportar a: Unified diff
Obtener nombre del aula