Skip to content

Commit

Permalink
Add setup.py for distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
livibetter committed May 13, 2012
1 parent aee9fee commit 27d7551
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build
dist
*.egg-info
45 changes: 45 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/bin/env python

from setuptools import setup

script_name = 'sortcss.py'

with open(script_name) as f:
meta = dict(
(k.strip(' _'), eval(v)) for k, v in
# There will be a '\n', with eval(), it's safe to ignore
(line.split('=') for line in f if line.startswith('__'))
)

classifiers = [
'Development Status :: 3 - Alpha',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Operating System :: POSIX',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Topic :: Utilities',
]

setup_d = dict(
name = meta['program'],
version = meta['version'],
license = meta['license'],
url = meta['website'],

description = meta['description'],

classifiers = classifiers,

author = meta['author'],
author_email = meta['email'],

scripts = [script_name],

install_requires = ['distribute'],
)

if __name__ == '__main__':
setup(**setup_d)
20 changes: 16 additions & 4 deletions sortcss.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,32 @@
# -*- coding: utf-8 -*-

'''CSS Property Sorter Script
This script will sort CSS properties by defined rule. Script reads standard
input and sort it by lines if the lines are CSS property, and write them to
standard output.
This script will sort CSS properties by defined rule.
WEBSITE
https://github.com/livibetter/css-prop-sorter
CREDITS
This script is based on Kyo Nagashima's Perl script:
http://hail2u.net/blog/coding/perl-sort-css-properties.html
Author: Yu-Jie Lin <livibetter@gmail.com>, http://yjl.im
Author: Yu I. <Twitter @japboy>
Original author: Kyo Nagashima <kyo@hail2u.net>, http://hail2u.net/
xaicron, http://blog.livedoor.jp/xaicron/
License: MIT license (http://opensource.org/licenses/mit-license.php)
License: MIT license, see COPYING
'''

__program__ = 'sortcss.py'
__version__ = '0.1.0'
__license__ = 'MIT'
__description__ = 'CSS Property Sorter Script'
__website__ = 'https://github.com/livibetter/css-prop-sorter'

__author__ = 'Yu-Jie Lin'
__email__ = 'livibetter@gmail.com'
__credits__ = ['Yu-Jie Lin', 'Yu I.', 'Kyo Nagashima', 'xaicron']

import argparse
import itertools
import sys
Expand Down

0 comments on commit 27d7551

Please sign in to comment.