pour utiliser un faux digicode sur egon
darcs-hash:20070531104523-f46e9-490fbd9eaa9c8f6dd5f692b984ac94ff62800221.gz
This commit is contained in:
parent
1ce1644112
commit
e7dbc7161e
1 changed files with 15 additions and 7 deletions
|
@ -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
|
||||
# ###############################
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue