Commits

Shu Zong Chen  committed 48b7725

Initial code

  • Participants

Comments (0)

Files changed (3)

+# use glob syntax.
+syntax: glob
+
+*.swp
+*.pyc
+build/*
+dist/*
+masq_yaml.egg-info/*

File masq_yaml/__init__.py

+from masquerade.formatters.generic import MasqueradeFormatter
+import yaml
+
+class YAMLFormatter(MasqueradeFormatter):
+	editable = True
+
+	@staticmethod
+	def read(fh):
+		return yaml.load(fh)
+
+	@staticmethod
+	def write(data):
+		return yaml.safe_dump(data)
+
+	@staticmethod
+	def commit(data, fn):
+		with open(fn) as fh:
+			fh.write(YAMLFormatter.write(data))
+
+export = YAMLFormatter
+#!/usr/bin/env python
+from setuptools import setup, find_packages
+
+setup(
+	name='masq_yaml',
+  version='0.1.0',
+  packages = ["masq_yaml",],
+	install_requires = ["PyYAML", "masq"],
+
+	author = "Shu Zong Chen",
+	author_email = "shu.chen@freelancedreams.com",
+
+	description = "YAML Formatter for masq",
+
+	long_description = \
+"""
+YAML Formatter for masq.
+""",
+	license = "MIT License",
+	keywords = "utility yaml",
+	classifiers = [
+		'Development Status :: 5 - Production/Stable',
+		'Intended Audience :: Developers',
+		'License :: OSI Approved :: MIT License',
+		'Operating System :: OS Independent',
+		'Programming Language :: Python',
+	],
+	platforms = ['any'],
+	url = 'https://bitbucket.org/sirpengi/masq_yaml',
+	download_url = 'https://bitbucket.org/sirpengi/masq_yaml/downloads',
+)