-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from Open-Security-Group-OSG/update_0
Merge latest changes to master
- Loading branch information
Showing
7 changed files
with
122 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ python: | |
- "3.6" | ||
- "3.7" | ||
- "3.8" | ||
- "3.8-dev" | ||
- "3.9-dev" | ||
- "nightly" | ||
install: | ||
- pip install coverage | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
# TODO Write DocString | ||
__version__ = "0.0a1.dev4" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from hiddeneye_reborn.models.model_compression import CompressionModel | ||
import shutil | ||
from os.path import exists | ||
from os import makedirs | ||
|
||
|
||
class CompressionController: | ||
def __init__(self, model=CompressionModel()): | ||
self._model = model | ||
self._compress_7zip = self._model.compress_7zip | ||
self._extract_7zip = self._model.extract_7zip | ||
|
||
def extract_7zip(self, filename, extract_dir=""): | ||
shutil.register_unpack_format('7zip', ['.7z'], self._extract_7zip) | ||
if extract_dir == "": | ||
if not exists("templates"): | ||
makedirs("templates") | ||
extract_dir = "templates" | ||
|
||
if ".7z" in filename: | ||
shutil.unpack_archive(filename=filename, extract_dir=extract_dir) | ||
else: | ||
raise ValueError("Invalid input, please add .7z to the end of your file and try again") | ||
|
||
def compress_7zip(self, archive_name, target_dir, go_to_dir=''): | ||
shutil.register_archive_format('7zip', self._compress_7zip, description='7zip archive') | ||
if go_to_dir == "": | ||
go_to_dir = "templates" | ||
if target_dir == "": | ||
raise ValueError("Target dir has to be specified") | ||
shutil.make_archive(archive_name, '7zip', go_to_dir, target_dir) | ||
|
||
# TODO create templates_helper methods to get rid of default "templates" folders assignment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import py7zr | ||
|
||
|
||
class CompressionModel: | ||
def __init__(self, model_7zip = py7zr): | ||
self._model_7zip = model_7zip | ||
self._compress_7zip = self._model_7zip.pack_7zarchive | ||
self._extract_7zip = self._model_7zip.unpack_7zarchive | ||
|
||
@property | ||
def model_7zip(self): | ||
return self._model_7zip | ||
|
||
@model_7zip.setter | ||
def model_7zip(self, new_7zip_model): | ||
self._model_7zip = new_7zip_model | ||
|
||
@property | ||
def compress_7zip(self): | ||
return self._compress_7zip | ||
|
||
@compress_7zip.setter | ||
def compress_7zip(self, new_7zip_compressor): | ||
self._compress_7zip = new_7zip_compressor | ||
|
||
@property | ||
def extract_7zip(self): | ||
return self._extract_7zip | ||
|
||
@extract_7zip.setter | ||
def extract_7zip(self, new_7zip_extractor): | ||
self._extract_7zip = new_7zip_extractor |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
alabaster==0.7.12 | ||
Babel==2.8.0 | ||
beautifulsoup4==4.9.2 | ||
bleach==3.2.1 | ||
bs4==0.0.1 | ||
certifi==2020.6.20 | ||
cffi==1.14.3 | ||
chardet==3.0.4 | ||
colorama==0.4.3 | ||
cryptography==3.1.1 | ||
cssselect==1.1.0 | ||
docutils==0.16 | ||
fire==0.3.1 | ||
idna==2.10 | ||
imagesize==1.2.0 | ||
jeepney==0.4.3 | ||
Jinja2==2.11.2 | ||
keyring==21.4.0 | ||
lxml==4.5.2 | ||
MarkupSafe==1.1.1 | ||
packaging==20.4 | ||
parse==1.18.0 | ||
pkginfo==1.5.0.1 | ||
pycparser==2.20 | ||
Pygments==2.7.1 | ||
pyparsing==2.4.7 | ||
pyquery==1.4.1 | ||
pytz==2020.1 | ||
pywebcopy==6.3.0 | ||
readme-renderer==26.0 | ||
requests==2.24.0 | ||
requests-toolbelt==0.9.1 | ||
rfc3986==1.4.0 | ||
SecretStorage==3.1.2 | ||
six==1.15.0 | ||
snowballstemmer==2.0.0 | ||
soupsieve==2.0.1 | ||
Sphinx==3.2.1 | ||
sphinx-rtd-theme==0.5.0 | ||
sphinxcontrib-applehelp==1.0.2 | ||
sphinxcontrib-devhelp==1.0.2 | ||
sphinxcontrib-htmlhelp==1.0.3 | ||
sphinxcontrib-jsmath==1.0.1 | ||
sphinxcontrib-qthelp==1.0.3 | ||
sphinxcontrib-serializinghtml==1.1.4 | ||
termcolor==1.1.0 | ||
tqdm==4.50.0 | ||
twine==3.2.0 | ||
urllib3==1.25.10 | ||
w3lib==1.22.0 | ||
webencodings==0.5.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3a7542d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi sir how can I open it
I tried python2 hiddeneye_reborn.py
But it is not worked
3a7542d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.