Skip to content
This repository has been archived by the owner on Oct 25, 2018. It is now read-only.

Commit

Permalink
Обновить V8Reader.epf #16 - вынесен в submodule
Browse files Browse the repository at this point in the history
 Ошибка при первом коммите файла #15
 Зависание на разборе штатной обработки обмена через xml #14
  • Loading branch information
Сосна Евгений committed Nov 22, 2014
1 parent bb3184a commit deb48e5
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "v8Reader"]
path = v8Reader
url = https://github.com/xDrivenDevelopment/v8Reader.git
Binary file removed V8Reader.epf
Binary file not shown.
9 changes: 6 additions & 3 deletions pyv8unpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,11 @@ def get_list_of_comitted_files():
output = subprocess.check_output(['git','diff-index', '--name-status', '--cached','HEAD']
).decode("utf-8")
except subprocess.CalledProcessError:
print("Error diff files get: trace %s" % subprocess.CalledProcessError.output)
return files
try:
output = subprocess.check_output(['git', 'status', '--porcelain']).decode("utf-8")
except subprocess.CalledProcessError:
print("Error diff files get")
return files

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

formatstring = format('/C"decompile;pathtocf;%s;pathout;%s;ЗавершитьРаботуПосле;"' % (fullpathfile, newsourcepath))
base = '/F"'+os.path.join(curabsdirpath,".git", "hooks","ibService")+'"'
V8Reader = '/execute"'+os.path.join(curabsdirpath,".git", "hooks", "V8Reader.epf")+'"'
V8Reader = '/execute"'+os.path.join(curabsdirpath,".git", "hooks", "v8Reader", "V8Reader.epf")+'"'
tempbat = tempfile.mktemp(".bat")
logging.debug("formatstring is %s , base is %s, V8Reader is %s, temp \
is %s" % (formatstring, base, V8Reader, tempbat))
Expand Down
68 changes: 63 additions & 5 deletions tests/test_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import tempfile
import shutil
from pathlib import Path
import subprocess


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

pathIb = path.join(path.curdir, ".git", "hooks", "ibService")
if (path.exists(pathIb)):
shutil.rmtree(pathIb)
shutil.rmtree(pathIb)
shutil.copytree(path.join(path.curdir, "ibService"),
pathIb)
shutil.copy(path.join(path.curdir, "V8Reader.epf"),
path.join(path.curdir, ".git", "hooks", "V8Reader.epf"))
pathIb)
os.mkdir(path.join(path.curdir, ".git", "hooks", "v8Reader"))
shutil.copy(path.join(path.curdir, "v8Reader", "V8Reader.epf"),
path.join(path.curdir, ".git", "hooks", "v8Reader", "V8Reader.epf"))

def tearDown(self):

if os.path.exists(self.tfile):
os.remove(self.tfile)
shutil.rmtree(self.tpath)
shutil.rmtree(path.join(path.curdir, ".git", "hooks", "ibService"))
os.remove(path.join(path.curdir, ".git", "hooks", "V8Reader.epf"))
os.remove(path.join(path.curdir, ".git", "hooks", "v8Reader", "V8Reader.epf"))
shutil.rmtree(path.join(path.curdir, ".git", "hooks", "v8Reader"))


def test_compile_from_source(self):
Expand All @@ -53,3 +56,58 @@ def test_decompile_checkfullpath(self):
self.tpath = tempfile.mkdtemp()
file = path.join(path.curdir, "tests", "Fixture.epf")
assert pyv8unpack.decompile([file], self.tpath);


class TestGitInit(unittest.TestCase):

def setUp(self):
unittest.TestCase.setUp(self)
self.tpath = tempfile.mkdtemp()
self.curdir = os.path.abspath(os.curdir);

print("cur dir {}, temp path {}".format(self.curdir, self.tpath))

os.chdir(self.tpath)

try:
output = subprocess.check_output(['git','init', self.tpath]
).decode("utf-8")
except subprocess.CalledProcessError:
print("Error diff files get: trace %s" % subprocess.CalledProcessError.output)

pathIb = path.join(self.tpath, ".git", "hooks", "ibService")
if (path.exists(pathIb)):
shutil.rmtree(pathIb)
shutil.copytree(path.join(self.curdir, "ibService"),
pathIb)
os.mkdir(path.join(self.tpath, ".git", "hooks", "v8Reader"))
shutil.copy(path.join(self.curdir, "v8Reader", "V8Reader.epf"),
path.join(self.tpath, ".git", "hooks", "v8Reader", "V8Reader.epf"))
shutil.copy(path.join(self.curdir,"pre-commit"),
path.join(self.tpath, ".git", "hooks", "pre-commit"))
shutil.copy(path.join(self.curdir,"pyv8unpack.py"),
path.join(self.tpath, ".git", "hooks", "pyv8unpack.py"))


def tearDown(self):

#shutil.rmtree(self.tpath)
os.chdir(self.curdir)
print("cur dir {}".format(os.curdir))

def test_firstadd(self):
file = path.join(self.curdir, "tests", "Fixture.epf")
shutil.copy(file,
path.join(self.tpath, "Fixture.epf"))


output = subprocess.check_output(['git','add', "-A", "."]
).decode("utf-8")
print("output {}".format(output))
output = subprocess.check_output(['git','commit', "-m", "'init commit'"]
).decode("utf-8")
print("output {}".format(output))




1 change: 1 addition & 0 deletions v8Reader
Submodule v8Reader added at 240952

0 comments on commit deb48e5

Please sign in to comment.