From f5392ad3ad1e26b06f296e93d99208cd41bb7746 Mon Sep 17 00:00:00 2001 From: amartya-dev Date: Tue, 10 Mar 2020 14:15:38 +0530 Subject: [PATCH] release ready --- __init__.py | 1 + djangify.py | 19 +++++++++---------- setup.cfg | 2 ++ setup.py | 23 +++++++++++++++++++++++ 4 files changed, 35 insertions(+), 10 deletions(-) create mode 100644 __init__.py create mode 100644 setup.cfg create mode 100644 setup.py diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..a7a165f --- /dev/null +++ b/__init__.py @@ -0,0 +1 @@ +from Djangify import djangify \ No newline at end of file diff --git a/djangify.py b/djangify.py index d363676..593995f 100644 --- a/djangify.py +++ b/djangify.py @@ -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'] @@ -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.') @@ -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")) : diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..224a779 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[metadata] +description-file = README.md \ No newline at end of file diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..4de6e01 --- /dev/null +++ b/setup.py @@ -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 = 'amarkaushik1999@gmail.com', # 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 + ], +)