Skip to content

Commit 8a55214

Browse files
committed
Made module a package
- Updated test output - Initialized README, LICENSE
2 parents 5d4d63f + 0f2dd76 commit 8a55214

9 files changed

Lines changed: 66 additions & 9 deletions

File tree

.gitignore

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,11 @@ venv/
33
__pycache__/
44
*.pyc
55

6-
test/*-fresh.html
7-
test/csskrt*
6+
# Setuptools distribution folder.
7+
/dist/
8+
9+
# Python egg metadata, regenerated from source files by setuptools.
10+
/*.egg-info
11+
/*.egg
12+
13+
test/output/*

LICENSE.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 Adil Asim
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# _CSSKRT_
2+
3+
Csskrt is a python module for automatically adding css styles for popular frameworks
4+
to make them more visually appealing and make it faster to get started with them.
5+
6+
7+
## Usage
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from bs4 import Tag
2-
from csskrt import Csskrt
2+
from .csskrt import Csskrt
33

44

55
class BootstrapCsskrt(Csskrt):

bulmaCsskrt.py renamed to csskrt/bulmaCsskrt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from bs4 import BeautifulSoup, Tag, NavigableString
2-
from csskrt import Csskrt
1+
from bs4 import Tag
2+
from .csskrt import Csskrt
33

44

55
class BulmaCsskrt(Csskrt):

csskrt.py renamed to csskrt/csskrt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from bs4 import BeautifulSoup, Tag, NavigableString, Doctype
1+
from bs4 import BeautifulSoup, Tag
22
import os
33
from abc import ABC, abstractmethod
44
from typing import List, Dict, NoReturn
@@ -172,7 +172,7 @@ def output(self) -> NoReturn:
172172
file = os.path.basename(self.file_path)
173173
file_name, ext = os.path.splitext(file)
174174

175-
new_file_name = os.path.join(folder, 'csskrt_' + file_name + ext)
175+
new_file_name = os.path.join(folder, 'output/csskrt_' + file_name + ext)
176176
with open(new_file_name, 'w') as out_file:
177177
if self.pretty_print:
178178
out_file.write(str(self.soup))

main.py renamed to csskrt/main.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
#!/usr/bin/env python
12
import click
2-
from bulmaCsskrt import BulmaCsskrt
3-
from bootstrapCsskrt import BootstrapCsskrt
3+
from .bulmaCsskrt import BulmaCsskrt
4+
from .bootstrapCsskrt import BootstrapCsskrt
45

56

67
@click.command()

setup.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
from setuptools import setup, find_packages
2+
import codecs
3+
4+
def long_description():
5+
with codecs.open('README.md', encoding='utf8') as f:
6+
return f.read()
7+
8+
9+
setup(
10+
name='csskrt',
11+
version='0.1',
12+
packages=find_packages(),
13+
include_package_data=True,
14+
license='MIT',
15+
long_description=long_description(),
16+
long_description_content_type='text/markdown',
17+
url='https://github.com/4d11/csskrt',
18+
entry_points='''
19+
[console_scripts]
20+
csskrt=csskrt.main:freshify
21+
''',
22+
)

0 commit comments

Comments
 (0)