Permalink
Browse files

Formatting according to google style.

Signed-off-by: Yesudeep Mangalapilly <yesudeep@google.com>
  • Loading branch information...
1 parent bab1f3e commit 6e530bac0df6526ce8e0e841b506c4dac6d4251a @gorakhargosh committed Mar 18, 2012
View
@@ -8,36 +8,36 @@
current_path = os.path.abspath(os.path.dirname(__file__))
tests_path = os.path.join(current_path, 'tests')
sys.path[0:0] = [
- current_path,
- tests_path,
-]
+ current_path,
+ tests_path,
+ ]
all_tests = [f[:-3] for f in os.listdir(tests_path)
if f.startswith('test_') and f.endswith(".py")]
def get_suite(tests):
- tests = sorted(tests)
- suite = unittest.TestSuite()
- loader = unittest.TestLoader()
- for test in tests:
- suite.addTest(loader.loadTestsFromName(test))
- return suite
+ tests = sorted(tests)
+ suite = unittest.TestSuite()
+ loader = unittest.TestLoader()
+ for test in tests:
+ suite.addTest(loader.loadTestsFromName(test))
+ return suite
if __name__ == '__main__':
- """
- To run all tests:
- $ python run_tests.py
- To run a single test:
- $ python run_tests.py app
- To run a couple of tests:
- $ python run_tests.py app config sessions
- To run code coverage:
- $ coverage run run_tests.py
- $ coverage report -m
- """
- tests = sys.argv[1:]
- if not tests:
- tests = all_tests
- tests = ['%s' % t for t in tests]
- suite = get_suite(tests)
- unittest.TextTestRunner(verbosity=2).run(suite)
+ """
+ To run all tests:
+ $ python run_tests.py
+ To run a single test:
+ $ python run_tests.py app
+ To run a couple of tests:
+ $ python run_tests.py app config sessions
+ To run code coverage:
+ $ coverage run run_tests.py
+ $ coverage report -m
+ """
+ tests = sys.argv[1:]
+ if not tests:
+ tests = all_tests
+ tests = ['%s' % t for t in tests]
+ suite = get_suite(tests)
+ unittest.TextTestRunner(verbosity=2).run(suite)
View
179 setup.py
@@ -39,82 +39,81 @@
# Determine platform to pick the implementation.
def determine_platform():
- platform = get_platform()
- if platform.startswith('macosx'):
- platform = PLATFORM_MACOSX
- elif platform.startswith('linux'):
- platform = PLATFORM_LINUX
- elif platform.startswith('win'):
- platform = PLATFORM_WINDOWS
- else:
- platform = None
- return platform
+ platform = get_platform()
+ if platform.startswith('macosx'):
+ platform = PLATFORM_MACOSX
+ elif platform.startswith('linux'):
+ platform = PLATFORM_LINUX
+ elif platform.startswith('win'):
+ platform = PLATFORM_WINDOWS
+ else:
+ platform = None
+ return platform
platform = determine_platform()
ext_modules = {
- PLATFORM_MACOSX: [
- Extension(name='_watchdog_fsevents',
- sources=[
- 'src/watchdog_fsevents.c',
- ],
- libraries=['m'],
- define_macros=[
- ('WATCHDOG_VERSION_STRING',
- '"' + version.VERSION_STRING + '"'),
- ('WATCHDOG_VERSION_MAJOR', version.VERSION_MAJOR),
- ('WATCHDOG_VERSION_MINOR', version.VERSION_MINOR),
- ('WATCHDOG_VERSION_BUILD', version.VERSION_BUILD),
- ],
- extra_link_args=[
- '-framework', 'CoreFoundation',
- '-framework', 'CoreServices',
- ],
- extra_compile_args=[
- '-std=c99',
- '-pedantic',
- '-Wall',
- '-Wextra',
- '-fPIC',
- ]
- ),
+ PLATFORM_MACOSX: [
+ Extension(name='_watchdog_fsevents',
+ sources=[
+ 'src/watchdog_fsevents.c',
+ ],
+ libraries=['m'],
+ define_macros=[
+ ('WATCHDOG_VERSION_STRING',
+ '"' + version.VERSION_STRING + '"'),
+ ('WATCHDOG_VERSION_MAJOR', version.VERSION_MAJOR),
+ ('WATCHDOG_VERSION_MINOR', version.VERSION_MINOR),
+ ('WATCHDOG_VERSION_BUILD', version.VERSION_BUILD),
+ ],
+ extra_link_args=[
+ '-framework', 'CoreFoundation',
+ '-framework', 'CoreServices',
+ ],
+ extra_compile_args=[
+ '-std=c99',
+ '-pedantic',
+ '-Wall',
+ '-Wextra',
+ '-fPIC',
+ ]
+ ),
],
-}
-
-extra_args =dict(
- cmdclass={
- 'build_ext': build_ext
- },
- ext_modules=ext_modules.get(platform, []),
-)
+ }
+extra_args = dict(
+ cmdclass={
+ 'build_ext': build_ext
+ },
+ ext_modules=ext_modules.get(platform, []),
+ )
install_requires = ['PyYAML >=3.09',
'argh >=0.8.1',
'pathtools']
if sys.version_info < (2, 7, 0):
# argparse is merged into Python 2.7 in the Python 2x series
# and Python 3.2 in the Python 3x series.
- install_requires.append('argparse >=1.1')
- if any([key in sys.platform for key in ['bsd', 'darwin']]):
- # Python 2.6 and below have the broken/non-existent kqueue implementations
- # in the select module. This backported patch adds one from Python 2.7,
- # which works.
- install_requires.append('select_backport >=0.2')
+ install_requires.append('argparse >=1.1')
+ if any([key in sys.platform for key in ['bsd', 'darwin']]):
+ # Python 2.6 and below have the broken/non-existent kqueue implementations
+ # in the select module. This backported patch adds one from Python 2.7,
+ # which works.
+ install_requires.append('select_backport >=0.2')
def read_file(filename):
- """
- Reads the contents of a given file relative to the directory
- containing this file and returns it.
+ """
+ Reads the contents of a given file relative to the directory
+ containing this file and returns it.
- :param filename:
- The file to open and read contents from.
- """
- return open(os.path.join(os.path.dirname(__file__), filename)).read()
+ :param filename:
+ The file to open and read contents from.
+ """
+ return open(os.path.join(os.path.dirname(__file__), filename)).read()
if not sys.version_info < (3,):
- extra_args.update(dict(use_2to3=True))
+ extra_args.update(dict(use_2to3=True))
setup(name="watchdog",
version=version.VERSION_STRING,
@@ -125,46 +124,46 @@ def read_file(filename):
license="Apache License 2.0",
url="http://github.com/gorakhargosh/watchdog",
keywords=' '.join([
- 'python',
- 'filesystem',
- 'monitoring',
- 'monitor',
- 'FSEvents',
- 'kqueue',
- 'inotify',
- 'ReadDirectoryChangesW',
- 'polling',
- 'DirectorySnapshot',
- ]
- ),
+ 'python',
+ 'filesystem',
+ 'monitoring',
+ 'monitor',
+ 'FSEvents',
+ 'kqueue',
+ 'inotify',
+ 'ReadDirectoryChangesW',
+ 'polling',
+ 'DirectorySnapshot',
+ ]
+ ),
classifiers=[
- 'Development Status :: 3 - Alpha',
- 'Environment :: Console',
- 'Intended Audience :: Developers',
- 'Intended Audience :: System Administrators',
- 'License :: OSI Approved :: Apache License 2.0',
- 'Natural Language :: English',
- 'Operating System :: POSIX :: Linux',
- 'Operating System :: MacOS :: MacOS X',
- 'Operating System :: POSIX :: BSD',
- 'Operating System :: Microsoft :: Windows :: Windows NT/2000',
- 'Operating System :: OS Independent',
- 'Programming Language :: Python',
- 'Programming Language :: C',
- 'Topic :: Software Development :: Libraries',
- 'Topic :: System :: Monitoring',
- 'Topic :: System :: Filesystems',
- 'Topic :: Utilities',
- ],
+ 'Development Status :: 3 - Alpha',
+ 'Environment :: Console',
+ 'Intended Audience :: Developers',
+ 'Intended Audience :: System Administrators',
+ 'License :: OSI Approved :: Apache License 2.0',
+ 'Natural Language :: English',
+ 'Operating System :: POSIX :: Linux',
+ 'Operating System :: MacOS :: MacOS X',
+ 'Operating System :: POSIX :: BSD',
+ 'Operating System :: Microsoft :: Windows :: Windows NT/2000',
+ 'Operating System :: OS Independent',
+ 'Programming Language :: Python',
+ 'Programming Language :: C',
+ 'Topic :: Software Development :: Libraries',
+ 'Topic :: System :: Monitoring',
+ 'Topic :: System :: Filesystems',
+ 'Topic :: Utilities',
+ ],
package_dir={'': SRC_DIR},
packages=find_packages(SRC_DIR),
include_package_data=True,
install_requires=install_requires,
entry_points={
- 'console_scripts': [
- 'watchmedo = watchdog.watchmedo:main',
+ 'console_scripts': [
+ 'watchmedo = watchdog.watchmedo:main',
]
},
zip_safe=False,
**extra_args
- )
+)
Oops, something went wrong.

0 comments on commit 6e530ba

Please sign in to comment.