Correction des import crans.utils partout
Ça semble provoquer des erreurs d'import, donc autant tout corriger
This commit is contained in:
parent
c3e28ac9c1
commit
31bb376741
4 changed files with 23 additions and 14 deletions
|
@ -31,9 +31,15 @@
|
||||||
# Début : Ajout log pour réestimer les coûts
|
# Début : Ajout log pour réestimer les coûts
|
||||||
import time
|
import time
|
||||||
# Fin
|
# Fin
|
||||||
import sys, tempfile, os, commands, shutil, syslog, stat
|
import sys
|
||||||
sys.path.append('/usr/scripts/gestion')
|
import tempfile
|
||||||
from crans.utils import QuoteForPOSIX as escapeForShell
|
import os
|
||||||
|
import commands
|
||||||
|
import shutil
|
||||||
|
import syslog
|
||||||
|
import stat
|
||||||
|
sys.path.append('/usr/scripts/')
|
||||||
|
from lib.utils import QuoteForPOSIX as escapeForShell
|
||||||
def __init__():
|
def __init__():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -42,7 +48,7 @@ def __init__():
|
||||||
# ########################################################### #
|
# ########################################################### #
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
import config.impression
|
from gestion import config.impression
|
||||||
COUT_UNITE_COULEUR = config.impression.c_coul
|
COUT_UNITE_COULEUR = config.impression.c_coul
|
||||||
COUT_UNITE_NOIRE = config.impression.c_noir
|
COUT_UNITE_NOIRE = config.impression.c_noir
|
||||||
COUT_PASSAGE_TAMBOUR_NOIR = config.impression.c_tambour_noir
|
COUT_PASSAGE_TAMBOUR_NOIR = config.impression.c_tambour_noir
|
||||||
|
|
|
@ -34,7 +34,8 @@ import sys, os.path
|
||||||
sys.path.append('/usr/scripts/gestion')
|
sys.path.append('/usr/scripts/gestion')
|
||||||
from config import impression as config_impression
|
from config import impression as config_impression
|
||||||
from commands import getstatusoutput
|
from commands import getstatusoutput
|
||||||
import crans.utils.logs
|
sys.path.append('/usr/scripts/')
|
||||||
|
from lib.utils import logs
|
||||||
from subprocess import Popen, PIPE
|
from subprocess import Popen, PIPE
|
||||||
|
|
||||||
# ######################################################## #
|
# ######################################################## #
|
||||||
|
@ -188,7 +189,7 @@ class impression:
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# On ouvre les logs
|
# On ouvre les logs
|
||||||
self.log = crans.utils.logs.getFileLogger('impression')
|
self.log = logs.getFileLogger('impression')
|
||||||
|
|
||||||
self._fichier = path_to_pdf
|
self._fichier = path_to_pdf
|
||||||
self._adh = adh
|
self._adh = adh
|
||||||
|
|
|
@ -1,10 +1,13 @@
|
||||||
#! /usr/bin/env python
|
#! /usr/bin/env python
|
||||||
|
|
||||||
import re, commands
|
import re
|
||||||
import crans.utils.logs
|
import commands
|
||||||
|
import sys
|
||||||
|
sys.path.append('/usr/scripts/')
|
||||||
|
import lib.utils.logs
|
||||||
import logging
|
import logging
|
||||||
LOGGER = logging.getLogger("crans.autologout")
|
LOGGER = logging.getLogger("crans.autologout")
|
||||||
LOGGER.addHandler(crans.utils.logs.CransFileHandler("autologout"))
|
LOGGER.addHandler(lib.utils.logs.CransFileHandler("autologout"))
|
||||||
LOGGER.setLevel(logging.WARNING)
|
LOGGER.setLevel(logging.WARNING)
|
||||||
|
|
||||||
def run_autologout():
|
def run_autologout():
|
||||||
|
@ -15,11 +18,8 @@ def run_autologout():
|
||||||
# on splite
|
# on splite
|
||||||
w = w.split()
|
w = w.split()
|
||||||
|
|
||||||
if w[0] in ['cohen','segaud']:
|
|
||||||
continue
|
|
||||||
|
|
||||||
# on verifie que c'est une connection du bde
|
# on verifie que c'est une connection du bde
|
||||||
hosts = ['bde.crans.org','cableur.crans.org','cableuse.crans.org','venus.crans.org']
|
hosts = ['cableur.crans.org','cableuse.crans.org','venus.crans.org','kfet.crans.org']
|
||||||
if w[2] not in [ h[0:16] for h in hosts ] :
|
if w[2] not in [ h[0:16] for h in hosts ] :
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from crans.utils.logs import getFileLogger
|
import sys
|
||||||
|
sys.path.append('/usr/scripts/')
|
||||||
|
from lib.utils.logs import getFileLogger
|
||||||
#LOGGER = logging.getLogger("crans.scripts.test")
|
#LOGGER = logging.getLogger("crans.scripts.test")
|
||||||
LOGGER = getFileLogger("helloworld")
|
LOGGER = getFileLogger("helloworld")
|
||||||
LOGGER.setLevel(logging.INFO)
|
LOGGER.setLevel(logging.INFO)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue