Skip to content

Commit

Permalink
release ready
Browse files Browse the repository at this point in the history
  • Loading branch information
amartya-dev committed Mar 10, 2020
1 parent 5aceacd commit f5392ad
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 10 deletions.
1 change: 1 addition & 0 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from Djangify import djangify
19 changes: 9 additions & 10 deletions djangify.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@
import os
import re
import argparse
import logging

logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.DEBUG)

TEXT = ""

def displayPathInfo():
dirpath = os.getcwd()
print("Current Directory is : " + dirpath )
logging.info("Current Directory is : " + dirpath )
foldername = os.path.basename(dirpath)
print( "Directory name is : " + foldername )

def getPath():
PATH = input( "\nEnter file name/location : " )
return PATH
logging.info( "Directory name is : " + foldername )

def checkLine(line):
words = ['src', 'href', 'url']
Expand Down Expand Up @@ -110,11 +109,11 @@ def func(directory, filepath, fname) :
f.write(temp)

except IOError:
print('An error occurred trying to read the file.')
logging.error('An error occurred trying to read the file.')
finally:
f.close()

print("Succeeded.. Generated Modified_Files/"+ fname + "."+extension+" in the directory passed.")
logging.info("Succeeded.. Generated Modified_Files/"+ fname + "."+extension+" in the directory passed.")

if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Converts specified html files or all html files to django format within a \n specified directory.')
Expand All @@ -134,8 +133,8 @@ def func(directory, filepath, fname) :
if directory is None :
directory = os.getcwd()

print("Directory : " + str(directory))
print("app_name : " + str(app_name))
logging.info("Directory : " + str(directory))
logging.info("app_name : " + str(app_name))

files_to_change = []
if not os.path.exists(os.path.join(directory,"Modified_files")) :
Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[metadata]
description-file = README.md
23 changes: 23 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from distutils.core import setup
setup(
name = 'djangify', # How you named your package folder (MyLib)
packages = ['djangify'], # Chose the same as "name"
version = '0.1.0', # Start with a small number and increase it with every change you make
license='MIT', # Chose a license from here: https://help.github.com/articles/licensing-a-repository
description = 'A Python script that converts HTML Files / Templates to Django compatible HTML Templates.', # Give a short description about your library
author = 'amartya', # Type in your name
author_email = '[email protected]', # Type in your E-Mail
url = 'https://github.com/L4TTiCe/djangify', # Provide either the link to your github or to your website
download_url = 'https://github.com/L4TTiCe/djangify/archive/v0.1.0.tar.gz',
keywords = ['DJANGO', 'TEMPLATES', 'STATIC'], # Keywords that define your package best
install_requires=[

],
classifiers=[
'Development Status :: 3 - Alpha', # Chose either "3 - Alpha", "4 - Beta" or "5 - Production/Stable" as the current state of your package
'Intended Audience :: Developers', # Define that your audience are developers
'Topic :: Software Development :: Build Tools',
'License :: OSI Approved :: MIT License', # Again, pick a license
'Programming Language :: Python :: 3', #Specify which pyhton versions that you want to support
],
)

0 comments on commit f5392ad

Please sign in to comment.