mirror of
https://github.com/th3r00t/pyShelf.git
synced 2026-04-28 01:59:35 -04:00
25 lines
678 B
Python
Executable File
25 lines
678 B
Python
Executable File
#!/usr/bin/python
|
|
import os
|
|
import zipfile
|
|
from config import Config
|
|
from lib.library import Catalogue
|
|
from lib.storage import Storage
|
|
config = Config()
|
|
Storage = Storage()
|
|
|
|
|
|
class InitFiles:
|
|
"""First run file creation operations"""
|
|
def __init__(self, file_array):
|
|
print("Begining creation of file structure")
|
|
for _pointer in file_array:
|
|
if not os.path.isfile(_pointer):
|
|
self.CreateFile(_pointer)
|
|
|
|
def CreateFile(self, _pointer):
|
|
"""Create the file"""
|
|
if not os.path.isdir(os.path.split(_pointer)[0]):
|
|
os.mkdir(os.path.split(_pointer)[0])
|
|
f = open(_pointer, "w+")
|
|
f.close()
|