44import sys
55import subprocess
66import shutil
7- from os .path import exists
87import logging
98import tempfile
109import re
1110import platform
1211import argparse
12+ from subprocess import PIPE
1313
14- __version__ = "0.0.2 "
14+ __version__ = "0.0.3 "
1515
1616logging .basicConfig (level = logging .INFO ) # DEBUG => print ALL msgs
1717log = logging .getLogger ("pyv8unpack" )
@@ -34,7 +34,7 @@ def get_config_param(param):
3434 try :
3535 with open (os .path .join (loc , "precommit1c.ini" )) as source :
3636 if sys .version_info < (3 ,0 ,0 ):
37- from ConfigParser import ConfigParser
37+ from ConfigParser import ConfigParser # @NoMove @UnusedImport
3838 else :
3939 from configparser import ConfigParser
4040
@@ -94,7 +94,7 @@ def get_path_to_1c():
9494 #FIXME: проверить архетиктуру.
9595 program_files = os .getenv ("PROGRAMFILES" )
9696 if program_files is None :
97- raise Exeption ( "path to Program files not found" ) ;
97+ raise "path to Program files not found" ;
9898 cmd = os .path .join (program_files , "1cv8" )
9999 maxversion = max (list (filter ((lambda x : '8.' in x ), os .listdir (cmd ))))
100100 if maxversion is None :
@@ -165,8 +165,7 @@ def decompile(list_of_files, source=None, platform=None):
165165
166166 for filename in dataprocessor_files :
167167 logging .info ("file %s" % filename )
168- #TODO: добавить копирование этих же файлов в каталог src/имяфайла/...
169- #get file name.
168+
170169 fullpathfile = os .path .abspath (filename )
171170 basename = os .path .splitext (os .path .basename (filename ))[0 ]
172171 fullbasename = os .path .basename (filename )
@@ -221,7 +220,7 @@ def add_to_git(pathlists):
221220 logging .error (result )
222221 exit (result )
223222
224- def compile (input , output , ext ):
223+ def compilefromsource (input , output , ext ):
225224 import codecs
226225
227226 assert not input is None , "Не указан путь к входящему каталогу"
@@ -244,22 +243,22 @@ def compile(input, output, ext):
244243 for l in lines :
245244 if l .startswith (u'\ufeff ' ):
246245 l = l [1 :]
247- list = l .split ("-->" )
248- if len (list ) < 2 :
246+ listline = l .split ("-->" )
247+ if len (listline ) < 2 :
249248 continue
250249 log .debug (l )
251- newPath = os .path .join (tempPath , list [0 ])
250+ newPath = os .path .join (tempPath , listline [0 ])
252251 dirname = os .path .dirname (newPath )
253252 if not os .path .exists (dirname ):
254253 os .mkdir (dirname )
255254 oldPath = os .path .join (dirsource ,
256- list [1 ].replace (
255+ listline [1 ].replace (
257256 "\\ " , os .path .sep )
258257 )
259258
260259 if os .path .isdir (oldPath ):
261260 #tempFile = tempfile.mkstemp()
262- newPath = os .path .join (tempPath , list [0 ])
261+ newPath = os .path .join (tempPath , listline [0 ])
263262 shutil .copytree (oldPath , newPath )
264263 else :
265264 log .debug (oldPath )
@@ -320,7 +319,7 @@ def main():
320319 add_to_git (indexes )
321320
322321 if (args .compile ):
323- compile (args .inputPath , args .output , args .type )
322+ compilefromsource (args .inputPath , args .output , args .type )
324323 if args .inputPath is not None :
325324 files = [os .path .abspath (
326325 os .path .join (os .path .curdir , args .inputPath ))]
0 commit comments