Tools

class tools.System

System routines to manipulate users and peripheral.

addPrinter(printer_name)

Configure one of the printers approved by MC.

clients()

Get local network interface and list machines connected to it.

getPrinters()

Return a list of installed printers.

class tools.Task

Execute system tasks that are not allowed for www-data user.

addGroup(group)

Performs group creation in ldap.

addToGroup(name, group)

Add a user in an existing ldap group.

addUser(name, passwd, quota=0)

Performs user creation in ldap.

alterUser(oldname, newname, quota=0)

Performs user modification in ldap.

blockUrl(keyword, block)

Put or remove a keyword in a blocked list on Squid.

changePassword(username, newpasswd)

Changes the password of a user in ldap.

newBackup(passwd)

Performs a backup of /etc/squid3/sites-bloqueados, ldap base and local user base.

readLog(lines, logfile)

Return the Squid log filtering the blocked addresses. lines: Number of lines to display logfile: squid3 log file localization

removeFromGroup(name, group)

Removes a user from an group in ldap.

removeGroup(group)

Perform removal of the group in ldap.

removeUser(name)

Performs user exclusion in ldap.

renameGroup(old_name, new_name)

Performs the modification of the group name in ldap.

restoreBackup()

Performs a restoration of the last backup.

setGeoLocation(location)

Write the telecentro geolocation to a JSON file after the registration.

togglePrinting(printer, groups)

Block or unblock printer permissions for groups.

write_to_file(values, filename)

Writes a sequence of commands to be executed in a file that is monitored by a daemon.

class tools.Util

Utility class for manipulating data.

diff(l1, l2)

Return a dictionary with diff between two lists.

get_hash(superid='00000')

Create a superID for new ‘telecentros’.”

get_telecentro_info(superid)

Get all the telecentro info by superid.

load_by_state(state, city)

Method to load a list of cities in json format from http://telecentros.sid.mc.gov.br

Previous topic

System

This Page