Skip to content

Commit deb48e5

Browse files
author
Сосна Евгений
committed
Обновить V8Reader.epf xDrivenDevelopment#16 - вынесен в submodule
Ошибка при первом коммите файла xDrivenDevelopment#15 Зависание на разборе штатной обработки обмена через xml xDrivenDevelopment#14
1 parent bb3184a commit deb48e5

File tree

5 files changed

+73
-8
lines changed

5 files changed

+73
-8
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "v8Reader"]
2+
path = v8Reader
3+
url = https://github.com/xDrivenDevelopment/v8Reader.git

V8Reader.epf

-591 KB
Binary file not shown.

pyv8unpack.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,11 @@ def get_list_of_comitted_files():
118118
output = subprocess.check_output(['git','diff-index', '--name-status', '--cached','HEAD']
119119
).decode("utf-8")
120120
except subprocess.CalledProcessError:
121-
print("Error diff files get: trace %s" % subprocess.CalledProcessError.output)
122-
return files
121+
try:
122+
output = subprocess.check_output(['git', 'status', '--porcelain']).decode("utf-8")
123+
except subprocess.CalledProcessError:
124+
print("Error diff files get")
125+
return files
123126

124127
for result in output.split("\n"):
125128
logging.info(result)
@@ -190,7 +193,7 @@ def decompile(list_of_files, source=None, platform=None):
190193

191194
formatstring = format('/C"decompile;pathtocf;%s;pathout;%s;ЗавершитьРаботуПосле;"' % (fullpathfile, newsourcepath))
192195
base = '/F"'+os.path.join(curabsdirpath,".git", "hooks","ibService")+'"'
193-
V8Reader = '/execute"'+os.path.join(curabsdirpath,".git", "hooks", "V8Reader.epf")+'"'
196+
V8Reader = '/execute"'+os.path.join(curabsdirpath,".git", "hooks", "v8Reader", "V8Reader.epf")+'"'
194197
tempbat = tempfile.mktemp(".bat")
195198
logging.debug("formatstring is %s , base is %s, V8Reader is %s, temp \
196199
is %s" % (formatstring, base, V8Reader, tempbat))

tests/test_compile.py

Lines changed: 63 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import tempfile
66
import shutil
77
from pathlib import Path
8+
import subprocess
89

910

1011
class TestV8Unpack(unittest.TestCase):
@@ -17,19 +18,21 @@ def setUp(self):
1718

1819
pathIb = path.join(path.curdir, ".git", "hooks", "ibService")
1920
if (path.exists(pathIb)):
20-
shutil.rmtree(pathIb)
21+
shutil.rmtree(pathIb)
2122
shutil.copytree(path.join(path.curdir, "ibService"),
22-
pathIb)
23-
shutil.copy(path.join(path.curdir, "V8Reader.epf"),
24-
path.join(path.curdir, ".git", "hooks", "V8Reader.epf"))
23+
pathIb)
24+
os.mkdir(path.join(path.curdir, ".git", "hooks", "v8Reader"))
25+
shutil.copy(path.join(path.curdir, "v8Reader", "V8Reader.epf"),
26+
path.join(path.curdir, ".git", "hooks", "v8Reader", "V8Reader.epf"))
2527

2628
def tearDown(self):
2729

2830
if os.path.exists(self.tfile):
2931
os.remove(self.tfile)
3032
shutil.rmtree(self.tpath)
3133
shutil.rmtree(path.join(path.curdir, ".git", "hooks", "ibService"))
32-
os.remove(path.join(path.curdir, ".git", "hooks", "V8Reader.epf"))
34+
os.remove(path.join(path.curdir, ".git", "hooks", "v8Reader", "V8Reader.epf"))
35+
shutil.rmtree(path.join(path.curdir, ".git", "hooks", "v8Reader"))
3336

3437

3538
def test_compile_from_source(self):
@@ -53,3 +56,58 @@ def test_decompile_checkfullpath(self):
5356
self.tpath = tempfile.mkdtemp()
5457
file = path.join(path.curdir, "tests", "Fixture.epf")
5558
assert pyv8unpack.decompile([file], self.tpath);
59+
60+
61+
class TestGitInit(unittest.TestCase):
62+
63+
def setUp(self):
64+
unittest.TestCase.setUp(self)
65+
self.tpath = tempfile.mkdtemp()
66+
self.curdir = os.path.abspath(os.curdir);
67+
68+
print("cur dir {}, temp path {}".format(self.curdir, self.tpath))
69+
70+
os.chdir(self.tpath)
71+
72+
try:
73+
output = subprocess.check_output(['git','init', self.tpath]
74+
).decode("utf-8")
75+
except subprocess.CalledProcessError:
76+
print("Error diff files get: trace %s" % subprocess.CalledProcessError.output)
77+
78+
pathIb = path.join(self.tpath, ".git", "hooks", "ibService")
79+
if (path.exists(pathIb)):
80+
shutil.rmtree(pathIb)
81+
shutil.copytree(path.join(self.curdir, "ibService"),
82+
pathIb)
83+
os.mkdir(path.join(self.tpath, ".git", "hooks", "v8Reader"))
84+
shutil.copy(path.join(self.curdir, "v8Reader", "V8Reader.epf"),
85+
path.join(self.tpath, ".git", "hooks", "v8Reader", "V8Reader.epf"))
86+
shutil.copy(path.join(self.curdir,"pre-commit"),
87+
path.join(self.tpath, ".git", "hooks", "pre-commit"))
88+
shutil.copy(path.join(self.curdir,"pyv8unpack.py"),
89+
path.join(self.tpath, ".git", "hooks", "pyv8unpack.py"))
90+
91+
92+
def tearDown(self):
93+
94+
#shutil.rmtree(self.tpath)
95+
os.chdir(self.curdir)
96+
print("cur dir {}".format(os.curdir))
97+
98+
def test_firstadd(self):
99+
file = path.join(self.curdir, "tests", "Fixture.epf")
100+
shutil.copy(file,
101+
path.join(self.tpath, "Fixture.epf"))
102+
103+
104+
output = subprocess.check_output(['git','add', "-A", "."]
105+
).decode("utf-8")
106+
print("output {}".format(output))
107+
output = subprocess.check_output(['git','commit', "-m", "'init commit'"]
108+
).decode("utf-8")
109+
print("output {}".format(output))
110+
111+
112+
113+

v8Reader

Submodule v8Reader added at 2409521

0 commit comments

Comments
 (0)