4
4
import sys
5
5
import subprocess
6
6
import shutil
7
- from os .path import exists
8
7
import logging
9
8
import tempfile
10
9
import re
11
10
import platform
12
11
import argparse
12
+ from subprocess import PIPE
13
13
14
- __version__ = "0.0.2 "
14
+ __version__ = "0.0.3 "
15
15
16
16
logging .basicConfig (level = logging .INFO ) # DEBUG => print ALL msgs
17
17
log = logging .getLogger ("pyv8unpack" )
@@ -34,7 +34,7 @@ def get_config_param(param):
34
34
try :
35
35
with open (os .path .join (loc , "precommit1c.ini" )) as source :
36
36
if sys .version_info < (3 ,0 ,0 ):
37
- from ConfigParser import ConfigParser
37
+ from ConfigParser import ConfigParser # @NoMove @UnusedImport
38
38
else :
39
39
from configparser import ConfigParser
40
40
@@ -94,7 +94,7 @@ def get_path_to_1c():
94
94
#FIXME: проверить архетиктуру.
95
95
program_files = os .getenv ("PROGRAMFILES" )
96
96
if program_files is None :
97
- raise Exeption ( "path to Program files not found" ) ;
97
+ raise "path to Program files not found" ;
98
98
cmd = os .path .join (program_files , "1cv8" )
99
99
maxversion = max (list (filter ((lambda x : '8.' in x ), os .listdir (cmd ))))
100
100
if maxversion is None :
@@ -165,8 +165,7 @@ def decompile(list_of_files, source=None, platform=None):
165
165
166
166
for filename in dataprocessor_files :
167
167
logging .info ("file %s" % filename )
168
- #TODO: добавить копирование этих же файлов в каталог src/имяфайла/...
169
- #get file name.
168
+
170
169
fullpathfile = os .path .abspath (filename )
171
170
basename = os .path .splitext (os .path .basename (filename ))[0 ]
172
171
fullbasename = os .path .basename (filename )
@@ -221,7 +220,7 @@ def add_to_git(pathlists):
221
220
logging .error (result )
222
221
exit (result )
223
222
224
- def compile (input , output , ext ):
223
+ def compilefromsource (input , output , ext ):
225
224
import codecs
226
225
227
226
assert not input is None , "Не указан путь к входящему каталогу"
@@ -244,22 +243,22 @@ def compile(input, output, ext):
244
243
for l in lines :
245
244
if l .startswith (u'\ufeff ' ):
246
245
l = l [1 :]
247
- list = l .split ("-->" )
248
- if len (list ) < 2 :
246
+ listline = l .split ("-->" )
247
+ if len (listline ) < 2 :
249
248
continue
250
249
log .debug (l )
251
- newPath = os .path .join (tempPath , list [0 ])
250
+ newPath = os .path .join (tempPath , listline [0 ])
252
251
dirname = os .path .dirname (newPath )
253
252
if not os .path .exists (dirname ):
254
253
os .mkdir (dirname )
255
254
oldPath = os .path .join (dirsource ,
256
- list [1 ].replace (
255
+ listline [1 ].replace (
257
256
"\\ " , os .path .sep )
258
257
)
259
258
260
259
if os .path .isdir (oldPath ):
261
260
#tempFile = tempfile.mkstemp()
262
- newPath = os .path .join (tempPath , list [0 ])
261
+ newPath = os .path .join (tempPath , listline [0 ])
263
262
shutil .copytree (oldPath , newPath )
264
263
else :
265
264
log .debug (oldPath )
@@ -320,7 +319,7 @@ def main():
320
319
add_to_git (indexes )
321
320
322
321
if (args .compile ):
323
- compile (args .inputPath , args .output , args .type )
322
+ compilefromsource (args .inputPath , args .output , args .type )
324
323
if args .inputPath is not None :
325
324
files = [os .path .abspath (
326
325
os .path .join (os .path .curdir , args .inputPath ))]
0 commit comments