diff --git a/lib/impression/digicode.py b/lib/impression/digicode.py index 5805442c..62024004 100755 --- a/lib/impression/digicode.py +++ b/lib/impression/digicode.py @@ -1,5 +1,4 @@ -#!/usr/bin/env python -# -*- coding: iso-8859-15 -*- +# -*- coding: utf-8 -*- # ############################################################# # .. # .... ............ ........ @@ -19,16 +18,14 @@ # # ############################################################# """ - digicode.py + fake_digicode.py - Fonctions pour controler le digicode du 4@J + Fonctions pour controler le digicode du 4@J (simulation) Copyright (c) 2006 by www.crans.org """ import sys, time, tempfile, os, commands, string, random import crans.utils.files -def __init__(): - pass # ############################################################# # CONSTANTES # ############################################################# @@ -48,8 +45,19 @@ def CodeAlreadyExists(Exception): # test pour voir si on est bien sur la bonne machine import socket if socket.gethostname() != CODES_SERVER: - raise EnvironmentError, "La manipulation des codes pour le digicode n'est possible que sur %s" % CODES_SERVER + CODES_DIR = tempfile.mkdtemp(prefix='fake_digicode') + FAKE_DIR = True + #raise EnvironmentError, "La manipulation des codes pour le digicode n'est possible que sur %s" % CODES_SERVER +else: + FAKE_DIR = False + +def __del__(): + if FAKE_DIR: + os.rmdir(CODES_DIR) + +def __init__(): + pass # ############################### # save_code # ###############################