init
This commit is contained in:
parent
787b958e45
commit
2f67e81740
7 changed files with 78 additions and 0 deletions
23
logger.py
Normal file
23
logger.py
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import logging
|
||||
|
||||
# Configure logging
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
|
||||
# Create a StreamHandler and set its log level to DEBUG
|
||||
console_handler = logging.StreamHandler()
|
||||
console_handler.setLevel(logging.DEBUG)
|
||||
|
||||
# Create a formatter and attach it to the handler
|
||||
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
|
||||
console_handler.setFormatter(formatter)
|
||||
|
||||
# Create a logger and add the console handler
|
||||
logger = logging.getLogger(__name__)
|
||||
logger.addHandler(console_handler)
|
||||
|
||||
# Log messages
|
||||
logger.debug("This is a debug message")
|
||||
logger.info("This is an info message")
|
||||
logger.warning("This is a warning message")
|
||||
logger.error("This is an error message")
|
||||
logger.critical("This is a critical message")
|
||||
0
main.py
Normal file
0
main.py
Normal file
27
readme.md
Normal file
27
readme.md
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<center>
|
||||
|
||||
# Zipssion
|
||||
|
||||
</center>
|
||||
|
||||
## What is this?
|
||||
Zipssion is a command line program that aids in the design and reverse engineering of custom file types.
|
||||
|
||||
## More about this repository
|
||||
|
||||
This project is just getting started and only has a couple of features implemented
|
||||
|
||||
## Known issues / TODOs
|
||||
|
||||
- [ ] Write TODOs
|
||||
|
||||
## View source
|
||||
|
||||
[](https://github.com/coborski/zipssion/)
|
||||
|
||||
|
||||
## Credits and references
|
||||
|
||||
- !!!
|
||||
|
||||
[🔝](#zipssion)
|
||||
BIN
test.zip
Normal file
BIN
test.zip
Normal file
Binary file not shown.
BIN
test_files/test.zipssion
Normal file
BIN
test_files/test.zipssion
Normal file
Binary file not shown.
BIN
test_files/test1.zipssion
Normal file
BIN
test_files/test1.zipssion
Normal file
Binary file not shown.
28
zipssion.py
Normal file
28
zipssion.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
import argparse
|
||||
import pathlib
|
||||
import shutil
|
||||
import tempfile
|
||||
import zipfile
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
|
||||
parser.add_argument("filename")
|
||||
args = parser.parse_args()
|
||||
|
||||
print (args.filename)
|
||||
|
||||
def view_files_content(filename):
|
||||
|
||||
path = pathlib.Path(filename)
|
||||
print(path)
|
||||
zip_path = path.stem + '.zip'
|
||||
print(zip_path)
|
||||
|
||||
if (path.exists() and path.is_file()):
|
||||
shutil.copy(path, zip_path)
|
||||
|
||||
print(path.is_file())
|
||||
file = zipfile.ZipFile(zip_path)
|
||||
file.printdir()
|
||||
|
||||
view_files_content(args.filename)
|
||||
Loading…
Reference in a new issue