common/i18n.py
branch3.5
changeset 3156 cd56d5c379cb
parent 3118 9e7a155bc4e5
child 3230 1d25e928c299
child 3316 c4c07aab1c39
equal deleted inserted replaced
3155:14e30e2520d7 3156:cd56d5c379cb
     7 """
     7 """
     8 __docformat__ = "restructuredtext en"
     8 __docformat__ = "restructuredtext en"
     9 
     9 
    10 import re
    10 import re
    11 import os
    11 import os
       
    12 import sys
    12 from os.path import join, basename, splitext, exists
    13 from os.path import join, basename, splitext, exists
    13 from glob import glob
    14 from glob import glob
    14 
    15 
    15 from cubicweb.toolsutils import create_dir
    16 from cubicweb.toolsutils import create_dir
    16 
    17 
    42 def execute(cmd):
    43 def execute(cmd):
    43     """display the command, execute it and raise an Exception if returned
    44     """display the command, execute it and raise an Exception if returned
    44     status != 0
    45     status != 0
    45     """
    46     """
    46     print cmd.replace(os.getcwd() + os.sep, '')
    47     print cmd.replace(os.getcwd() + os.sep, '')
    47     from subprocess import call
    48     if sys.platform == 'win32':
       
    49         from subprocess import call
       
    50     else:
       
    51         call = os.system
    48     status = call(cmd)
    52     status = call(cmd)
    49     if status != 0:
    53     if status != 0:
    50         raise Exception('status = %s' % status)
    54         raise Exception('status = %s' % status)
    51 
    55 
    52 
    56