Skip to content
This repository was archived by the owner on Oct 25, 2018. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 39 additions & 2 deletions pyv8unpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,47 @@
import logging
import tempfile
import re
import platform

logging.basicConfig(level=logging.ERROR) # DEBUG => print ALL msgs

modified = re.compile('^(?:M|A)(\s+)(?P<name>.*)')

def get_path_to_1c():
'''
get path to 1c binary.
fist env, "PATH1C"
two env "PROGRAMFILES" on windows
three /opt/1c - only linux

'''

cmd = os.getenv("PATH1C")
if not cmd is None:
return os.getenv("PATH1C")

if platform.system() == "Darwin":
raise Exception("MacOS not run 1C")
elif platform.system() == "Windows":
program_files = os.getenv("PROGRAMFILES(X86)")
if program_files is None:
#FIXME: проверить архетиктуру.
program_files = os.getenv("PROGRAMFILES")
if program_files is None:
raise Exeption("path to Program files not found");
cmd = os.path.join(program_files, "1cv8")
maxversion = max(list(filter((lambda x: '8.' in x), os.listdir(cmd))))
if maxversion is None:
raise Exception("not found verion dirs")
cmd = os.path.join(cmd, maxversion + os.path.sep + "bin"+os.path.sep+"1cv8.exe")

if not os.path.isfile(cmd):
raise Exception("file not found %s" %(cmd))

else:
cmd = subprocess.Popen(["which", "1cv8"], stdout=PIPE).communicate()[0].strip()

return cmd

def get_list_of_comitted_files():
"""
Expand Down Expand Up @@ -61,8 +97,9 @@ def decompile():

dirsource = os.path.abspath(os.path.join(os.path.curdir, "src"))
curabsdirpath = os.path.abspath(os.path.curdir)
pathbin1c = "C:\\Program Files\\1cv82\8.2.17.153\\bin\\1cv8.exe"
pathbin1c = "c:\\Program Files (x86)\\1cv8\\8.3.4.304\\bin\\1cv8.exe"
#pathbin1c = "C:\\Program Files\\1cv82\8.2.17.153\\bin\\1cv8.exe"
#pathbin1c = "c:\\Program Files (x86)\\1cv8\\8.3.4.304\\bin\\1cv8.exe"
pathbin1c = get_path_to_1c()

for filename in dataprocessor_files:
print("file %s" % filename)
Expand Down