Commit 75a4d6b8 authored by Vincent Le gallic's avatar Vincent Le gallic
Browse files

[impression/digicode.py] import foireux de crans.utils

parent db2b0f0a
...@@ -25,8 +25,15 @@ ...@@ -25,8 +25,15 @@
Copyright (c) 2006, 2007, 2008, 2009 by Cr@ns (http://www.crans.org) Copyright (c) 2006, 2007, 2008, 2009 by Cr@ns (http://www.crans.org)
""" """
import sys, time, tempfile, os, commands, string, random import sys
import crans.utils.files import time
import tempfile
import os
import commands
import string
import random
sys.path.append("/usr/scripts/")
import lib.utils.files
# ############################################################# # #############################################################
# CONSTANTES # CONSTANTES
# ############################################################# # #############################################################
...@@ -125,7 +132,7 @@ def list_code(): ...@@ -125,7 +132,7 @@ def list_code():
files = os.listdir(CODES_DIR) files = os.listdir(CODES_DIR)
code_list = [] code_list = []
for aCode in files: for aCode in files:
age = crans.utils.files.ageOfFile(os.path.join(CODES_DIR, aCode ) ) age = lib.utils.files.ageOfFile(os.path.join(CODES_DIR, aCode ) )
content = read_code_file(aCode) content = read_code_file(aCode)
code_list.append((aCode, age, content ) ) code_list.append((aCode, age, content ) )
return code_list return code_list
...@@ -154,5 +161,5 @@ def menage(): ...@@ -154,5 +161,5 @@ def menage():
for aFile in fileList: for aFile in fileList:
aFilePath = os.path.join(CODES_DIR, aFile) aFilePath = os.path.join(CODES_DIR, aFile)
if os.path.isfile(aFilePath): if os.path.isfile(aFilePath):
if crans.utils.files.fileIsOlderThan(aFilePath, days=1): if lib.utils.files.fileIsOlderThan(aFilePath, days=1):
os.remove(aFilePath) os.remove(aFilePath)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment