commit
stringlengths
40
40
old_file
stringlengths
4
118
new_file
stringlengths
4
118
old_contents
stringlengths
0
2.94k
new_contents
stringlengths
1
4.43k
subject
stringlengths
15
444
message
stringlengths
16
3.45k
lang
stringclasses
1 value
license
stringclasses
13 values
repos
stringlengths
5
43.2k
prompt
stringlengths
17
4.58k
response
stringlengths
1
4.43k
prompt_tagged
stringlengths
58
4.62k
response_tagged
stringlengths
1
4.43k
text
stringlengths
132
7.29k
text_tagged
stringlengths
173
7.33k
223a04b3be53d998f75eb10a95c69116ee31c793
setup.py
setup.py
#!/usr/bin/env python import codecs from setuptools import setup version = 0.1 def read(filename): try: with codecs.open(filename, encoding='utf-8') as f: return unicode(f.read()) except NameError: with open(filename, 'r', encoding='utf-8') as f: return f.read() long_description = u'\n\n'.join([read('README.rst'), #read('CREDITS.rst'), #read('CHANGES.rst') ]) long_description = long_description.encode('utf-8') setup(name='tactic_client_lib', version=version, install_requires=[], description='Tactic Client Library', long_description=long_description, author='Roland van Laar', author_email='roland@micite.net', url='https://github.com/rvanlaar/tactic-client', include_package_data=True, zip_safe=False, classifiers=[ 'Development Status :: 5 - Production/Stable', 'License :: OSI Approved', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 2 :: Only', ] )
#!/usr/bin/env python import codecs from setuptools import setup, find_packages version = 0.3 def read(filename): try: with codecs.open(filename, encoding='utf-8') as f: return unicode(f.read()) except NameError: with open(filename, 'r', encoding='utf-8') as f: return f.read() long_description = read('README.rst').encode('utf-8') setup(name='tactic_client_lib', version=version, install_requires=[], description='Tactic Client Library', long_description=long_description, author='Roland van Laar', author_email='roland@micite.net', url='https://github.com/rvanlaar/tactic-client', packages=find_packages(), include_package_data=True, zip_safe=False, classifiers=[ 'Development Status :: 5 - Production/Stable', 'License :: OSI Approved', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 2 :: Only', ] )
Include package data in package.
Include package data in package. Also up version and better long_description logic.
Python
epl-1.0
rvanlaar/tactic-client
#!/usr/bin/env python import codecs from setuptools import setup version = 0.1 def read(filename): try: with codecs.open(filename, encoding='utf-8') as f: return unicode(f.read()) except NameError: with open(filename, 'r', encoding='utf-8') as f: return f.read() long_description = u'\n\n'.join([read('README.rst'), #read('CREDITS.rst'), #read('CHANGES.rst') ]) long_description = long_description.encode('utf-8') setup(name='tactic_client_lib', version=version, install_requires=[], description='Tactic Client Library', long_description=long_description, author='Roland van Laar', author_email='roland@micite.net', url='https://github.com/rvanlaar/tactic-client', include_package_data=True, zip_safe=False, classifiers=[ 'Development Status :: 5 - Production/Stable', 'License :: OSI Approved', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 2 :: Only', ] ) Include package data in package. Also up version and better long_description logic.
#!/usr/bin/env python import codecs from setuptools import setup, find_packages version = 0.3 def read(filename): try: with codecs.open(filename, encoding='utf-8') as f: return unicode(f.read()) except NameError: with open(filename, 'r', encoding='utf-8') as f: return f.read() long_description = read('README.rst').encode('utf-8') setup(name='tactic_client_lib', version=version, install_requires=[], description='Tactic Client Library', long_description=long_description, author='Roland van Laar', author_email='roland@micite.net', url='https://github.com/rvanlaar/tactic-client', packages=find_packages(), include_package_data=True, zip_safe=False, classifiers=[ 'Development Status :: 5 - Production/Stable', 'License :: OSI Approved', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 2 :: Only', ] )
<commit_before>#!/usr/bin/env python import codecs from setuptools import setup version = 0.1 def read(filename): try: with codecs.open(filename, encoding='utf-8') as f: return unicode(f.read()) except NameError: with open(filename, 'r', encoding='utf-8') as f: return f.read() long_description = u'\n\n'.join([read('README.rst'), #read('CREDITS.rst'), #read('CHANGES.rst') ]) long_description = long_description.encode('utf-8') setup(name='tactic_client_lib', version=version, install_requires=[], description='Tactic Client Library', long_description=long_description, author='Roland van Laar', author_email='roland@micite.net', url='https://github.com/rvanlaar/tactic-client', include_package_data=True, zip_safe=False, classifiers=[ 'Development Status :: 5 - Production/Stable', 'License :: OSI Approved', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 2 :: Only', ] ) <commit_msg>Include package data in package. Also up version and better long_description logic.<commit_after>
#!/usr/bin/env python import codecs from setuptools import setup, find_packages version = 0.3 def read(filename): try: with codecs.open(filename, encoding='utf-8') as f: return unicode(f.read()) except NameError: with open(filename, 'r', encoding='utf-8') as f: return f.read() long_description = read('README.rst').encode('utf-8') setup(name='tactic_client_lib', version=version, install_requires=[], description='Tactic Client Library', long_description=long_description, author='Roland van Laar', author_email='roland@micite.net', url='https://github.com/rvanlaar/tactic-client', packages=find_packages(), include_package_data=True, zip_safe=False, classifiers=[ 'Development Status :: 5 - Production/Stable', 'License :: OSI Approved', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 2 :: Only', ] )
#!/usr/bin/env python import codecs from setuptools import setup version = 0.1 def read(filename): try: with codecs.open(filename, encoding='utf-8') as f: return unicode(f.read()) except NameError: with open(filename, 'r', encoding='utf-8') as f: return f.read() long_description = u'\n\n'.join([read('README.rst'), #read('CREDITS.rst'), #read('CHANGES.rst') ]) long_description = long_description.encode('utf-8') setup(name='tactic_client_lib', version=version, install_requires=[], description='Tactic Client Library', long_description=long_description, author='Roland van Laar', author_email='roland@micite.net', url='https://github.com/rvanlaar/tactic-client', include_package_data=True, zip_safe=False, classifiers=[ 'Development Status :: 5 - Production/Stable', 'License :: OSI Approved', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 2 :: Only', ] ) Include package data in package. Also up version and better long_description logic.#!/usr/bin/env python import codecs from setuptools import setup, find_packages version = 0.3 def read(filename): try: with codecs.open(filename, encoding='utf-8') as f: return unicode(f.read()) except NameError: with open(filename, 'r', encoding='utf-8') as f: return f.read() long_description = read('README.rst').encode('utf-8') setup(name='tactic_client_lib', version=version, install_requires=[], description='Tactic Client Library', long_description=long_description, author='Roland van Laar', author_email='roland@micite.net', url='https://github.com/rvanlaar/tactic-client', packages=find_packages(), include_package_data=True, zip_safe=False, classifiers=[ 'Development Status :: 5 - Production/Stable', 'License :: OSI Approved', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 2 :: Only', ] )
<commit_before>#!/usr/bin/env python import codecs from setuptools import setup version = 0.1 def read(filename): try: with codecs.open(filename, encoding='utf-8') as f: return unicode(f.read()) except NameError: with open(filename, 'r', encoding='utf-8') as f: return f.read() long_description = u'\n\n'.join([read('README.rst'), #read('CREDITS.rst'), #read('CHANGES.rst') ]) long_description = long_description.encode('utf-8') setup(name='tactic_client_lib', version=version, install_requires=[], description='Tactic Client Library', long_description=long_description, author='Roland van Laar', author_email='roland@micite.net', url='https://github.com/rvanlaar/tactic-client', include_package_data=True, zip_safe=False, classifiers=[ 'Development Status :: 5 - Production/Stable', 'License :: OSI Approved', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 2 :: Only', ] ) <commit_msg>Include package data in package. Also up version and better long_description logic.<commit_after>#!/usr/bin/env python import codecs from setuptools import setup, find_packages version = 0.3 def read(filename): try: with codecs.open(filename, encoding='utf-8') as f: return unicode(f.read()) except NameError: with open(filename, 'r', encoding='utf-8') as f: return f.read() long_description = read('README.rst').encode('utf-8') setup(name='tactic_client_lib', version=version, install_requires=[], description='Tactic Client Library', long_description=long_description, author='Roland van Laar', author_email='roland@micite.net', url='https://github.com/rvanlaar/tactic-client', packages=find_packages(), include_package_data=True, zip_safe=False, classifiers=[ 'Development Status :: 5 - Production/Stable', 'License :: OSI Approved', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 2 :: Only', ] )
652497ec0365893a0fcbc39191cb60032bf88c23
setup.py
setup.py
from setuptools import setup setup( name='pyticketswitch', version='1.6.4', author='Ingresso', author_email='systems@ingresso.co.uk', packages=[ 'pyticketswitch', 'pyticketswitch.interface_objects' ], license='MIT', description='A Python interface for the Ingresso XML Core API', long_description=open('README.rst').read(), classifiers=[ 'Development Status :: 5 - Production/Stable', 'Programming Language :: Python :: 2.7', 'Intended Audience :: Developers', 'Natural Language :: English', ], )
from setuptools import setup setup( name='pyticketswitch', version='1.6.4', author='Ingresso', author_email='systems@ingresso.co.uk', url='https://github.com/ingresso-group/pyticketswitch/', packages=[ 'pyticketswitch', 'pyticketswitch.interface_objects' ], license='MIT', description='A Python interface for the Ingresso XML Core API', long_description=open('README.rst').read(), classifiers=[ 'Development Status :: 5 - Production/Stable', 'Programming Language :: Python :: 2.7', 'Intended Audience :: Developers', 'Natural Language :: English', ], )
Add URL to make it easier to find this GitHub page
Add URL to make it easier to find this GitHub page
Python
mit
ingresso-group/pyticketswitch
from setuptools import setup setup( name='pyticketswitch', version='1.6.4', author='Ingresso', author_email='systems@ingresso.co.uk', packages=[ 'pyticketswitch', 'pyticketswitch.interface_objects' ], license='MIT', description='A Python interface for the Ingresso XML Core API', long_description=open('README.rst').read(), classifiers=[ 'Development Status :: 5 - Production/Stable', 'Programming Language :: Python :: 2.7', 'Intended Audience :: Developers', 'Natural Language :: English', ], ) Add URL to make it easier to find this GitHub page
from setuptools import setup setup( name='pyticketswitch', version='1.6.4', author='Ingresso', author_email='systems@ingresso.co.uk', url='https://github.com/ingresso-group/pyticketswitch/', packages=[ 'pyticketswitch', 'pyticketswitch.interface_objects' ], license='MIT', description='A Python interface for the Ingresso XML Core API', long_description=open('README.rst').read(), classifiers=[ 'Development Status :: 5 - Production/Stable', 'Programming Language :: Python :: 2.7', 'Intended Audience :: Developers', 'Natural Language :: English', ], )
<commit_before>from setuptools import setup setup( name='pyticketswitch', version='1.6.4', author='Ingresso', author_email='systems@ingresso.co.uk', packages=[ 'pyticketswitch', 'pyticketswitch.interface_objects' ], license='MIT', description='A Python interface for the Ingresso XML Core API', long_description=open('README.rst').read(), classifiers=[ 'Development Status :: 5 - Production/Stable', 'Programming Language :: Python :: 2.7', 'Intended Audience :: Developers', 'Natural Language :: English', ], ) <commit_msg>Add URL to make it easier to find this GitHub page<commit_after>
from setuptools import setup setup( name='pyticketswitch', version='1.6.4', author='Ingresso', author_email='systems@ingresso.co.uk', url='https://github.com/ingresso-group/pyticketswitch/', packages=[ 'pyticketswitch', 'pyticketswitch.interface_objects' ], license='MIT', description='A Python interface for the Ingresso XML Core API', long_description=open('README.rst').read(), classifiers=[ 'Development Status :: 5 - Production/Stable', 'Programming Language :: Python :: 2.7', 'Intended Audience :: Developers', 'Natural Language :: English', ], )
from setuptools import setup setup( name='pyticketswitch', version='1.6.4', author='Ingresso', author_email='systems@ingresso.co.uk', packages=[ 'pyticketswitch', 'pyticketswitch.interface_objects' ], license='MIT', description='A Python interface for the Ingresso XML Core API', long_description=open('README.rst').read(), classifiers=[ 'Development Status :: 5 - Production/Stable', 'Programming Language :: Python :: 2.7', 'Intended Audience :: Developers', 'Natural Language :: English', ], ) Add URL to make it easier to find this GitHub pagefrom setuptools import setup setup( name='pyticketswitch', version='1.6.4', author='Ingresso', author_email='systems@ingresso.co.uk', url='https://github.com/ingresso-group/pyticketswitch/', packages=[ 'pyticketswitch', 'pyticketswitch.interface_objects' ], license='MIT', description='A Python interface for the Ingresso XML Core API', long_description=open('README.rst').read(), classifiers=[ 'Development Status :: 5 - Production/Stable', 'Programming Language :: Python :: 2.7', 'Intended Audience :: Developers', 'Natural Language :: English', ], )
<commit_before>from setuptools import setup setup( name='pyticketswitch', version='1.6.4', author='Ingresso', author_email='systems@ingresso.co.uk', packages=[ 'pyticketswitch', 'pyticketswitch.interface_objects' ], license='MIT', description='A Python interface for the Ingresso XML Core API', long_description=open('README.rst').read(), classifiers=[ 'Development Status :: 5 - Production/Stable', 'Programming Language :: Python :: 2.7', 'Intended Audience :: Developers', 'Natural Language :: English', ], ) <commit_msg>Add URL to make it easier to find this GitHub page<commit_after>from setuptools import setup setup( name='pyticketswitch', version='1.6.4', author='Ingresso', author_email='systems@ingresso.co.uk', url='https://github.com/ingresso-group/pyticketswitch/', packages=[ 'pyticketswitch', 'pyticketswitch.interface_objects' ], license='MIT', description='A Python interface for the Ingresso XML Core API', long_description=open('README.rst').read(), classifiers=[ 'Development Status :: 5 - Production/Stable', 'Programming Language :: Python :: 2.7', 'Intended Audience :: Developers', 'Natural Language :: English', ], )
c32b0f49ca0997e5bd041e68993e624014f60305
setup.py
setup.py
from setuptools import setup, find_packages version = '1.1.3' requires = [ 'neo4j-driver<1.5.0', 'six>=1.10.0', ] testing_requires = [ 'nose', 'coverage', 'nosexcover', ] setup( name='norduniclient', version=version, url='https://github.com/NORDUnet/python-norduniclient', license='Apache License, Version 2.0', author='Johan Lundberg', author_email='lundberg@nordu.net', description='Neo4j (>=3.2.2) database client using bolt for NORDUnet network inventory', packages=find_packages(), zip_safe=False, install_requires=requires, tests_require=testing_requires, test_suite='nose.collector', extras_require={ 'testing': testing_requires } )
from setuptools import setup, find_packages version = '1.1.3' requires = [ 'neo4j-driver<2.0', 'six>=1.10.0', ] testing_requires = [ 'nose', 'coverage', 'nosexcover', ] setup( name='norduniclient', version=version, url='https://github.com/NORDUnet/python-norduniclient', license='Apache License, Version 2.0', author='Johan Lundberg', author_email='lundberg@nordu.net', description='Neo4j (>=3.2.2) database client using bolt for NORDUnet network inventory', packages=find_packages(), zip_safe=False, install_requires=requires, tests_require=testing_requires, test_suite='nose.collector', extras_require={ 'testing': testing_requires } )
Allow newer neo4j driver versions (<2)
Allow newer neo4j driver versions (<2)
Python
apache-2.0
NORDUnet/python-norduniclient,NORDUnet/python-norduniclient
from setuptools import setup, find_packages version = '1.1.3' requires = [ 'neo4j-driver<1.5.0', 'six>=1.10.0', ] testing_requires = [ 'nose', 'coverage', 'nosexcover', ] setup( name='norduniclient', version=version, url='https://github.com/NORDUnet/python-norduniclient', license='Apache License, Version 2.0', author='Johan Lundberg', author_email='lundberg@nordu.net', description='Neo4j (>=3.2.2) database client using bolt for NORDUnet network inventory', packages=find_packages(), zip_safe=False, install_requires=requires, tests_require=testing_requires, test_suite='nose.collector', extras_require={ 'testing': testing_requires } ) Allow newer neo4j driver versions (<2)
from setuptools import setup, find_packages version = '1.1.3' requires = [ 'neo4j-driver<2.0', 'six>=1.10.0', ] testing_requires = [ 'nose', 'coverage', 'nosexcover', ] setup( name='norduniclient', version=version, url='https://github.com/NORDUnet/python-norduniclient', license='Apache License, Version 2.0', author='Johan Lundberg', author_email='lundberg@nordu.net', description='Neo4j (>=3.2.2) database client using bolt for NORDUnet network inventory', packages=find_packages(), zip_safe=False, install_requires=requires, tests_require=testing_requires, test_suite='nose.collector', extras_require={ 'testing': testing_requires } )
<commit_before>from setuptools import setup, find_packages version = '1.1.3' requires = [ 'neo4j-driver<1.5.0', 'six>=1.10.0', ] testing_requires = [ 'nose', 'coverage', 'nosexcover', ] setup( name='norduniclient', version=version, url='https://github.com/NORDUnet/python-norduniclient', license='Apache License, Version 2.0', author='Johan Lundberg', author_email='lundberg@nordu.net', description='Neo4j (>=3.2.2) database client using bolt for NORDUnet network inventory', packages=find_packages(), zip_safe=False, install_requires=requires, tests_require=testing_requires, test_suite='nose.collector', extras_require={ 'testing': testing_requires } ) <commit_msg>Allow newer neo4j driver versions (<2)<commit_after>
from setuptools import setup, find_packages version = '1.1.3' requires = [ 'neo4j-driver<2.0', 'six>=1.10.0', ] testing_requires = [ 'nose', 'coverage', 'nosexcover', ] setup( name='norduniclient', version=version, url='https://github.com/NORDUnet/python-norduniclient', license='Apache License, Version 2.0', author='Johan Lundberg', author_email='lundberg@nordu.net', description='Neo4j (>=3.2.2) database client using bolt for NORDUnet network inventory', packages=find_packages(), zip_safe=False, install_requires=requires, tests_require=testing_requires, test_suite='nose.collector', extras_require={ 'testing': testing_requires } )
from setuptools import setup, find_packages version = '1.1.3' requires = [ 'neo4j-driver<1.5.0', 'six>=1.10.0', ] testing_requires = [ 'nose', 'coverage', 'nosexcover', ] setup( name='norduniclient', version=version, url='https://github.com/NORDUnet/python-norduniclient', license='Apache License, Version 2.0', author='Johan Lundberg', author_email='lundberg@nordu.net', description='Neo4j (>=3.2.2) database client using bolt for NORDUnet network inventory', packages=find_packages(), zip_safe=False, install_requires=requires, tests_require=testing_requires, test_suite='nose.collector', extras_require={ 'testing': testing_requires } ) Allow newer neo4j driver versions (<2)from setuptools import setup, find_packages version = '1.1.3' requires = [ 'neo4j-driver<2.0', 'six>=1.10.0', ] testing_requires = [ 'nose', 'coverage', 'nosexcover', ] setup( name='norduniclient', version=version, url='https://github.com/NORDUnet/python-norduniclient', license='Apache License, Version 2.0', author='Johan Lundberg', author_email='lundberg@nordu.net', description='Neo4j (>=3.2.2) database client using bolt for NORDUnet network inventory', packages=find_packages(), zip_safe=False, install_requires=requires, tests_require=testing_requires, test_suite='nose.collector', extras_require={ 'testing': testing_requires } )
<commit_before>from setuptools import setup, find_packages version = '1.1.3' requires = [ 'neo4j-driver<1.5.0', 'six>=1.10.0', ] testing_requires = [ 'nose', 'coverage', 'nosexcover', ] setup( name='norduniclient', version=version, url='https://github.com/NORDUnet/python-norduniclient', license='Apache License, Version 2.0', author='Johan Lundberg', author_email='lundberg@nordu.net', description='Neo4j (>=3.2.2) database client using bolt for NORDUnet network inventory', packages=find_packages(), zip_safe=False, install_requires=requires, tests_require=testing_requires, test_suite='nose.collector', extras_require={ 'testing': testing_requires } ) <commit_msg>Allow newer neo4j driver versions (<2)<commit_after>from setuptools import setup, find_packages version = '1.1.3' requires = [ 'neo4j-driver<2.0', 'six>=1.10.0', ] testing_requires = [ 'nose', 'coverage', 'nosexcover', ] setup( name='norduniclient', version=version, url='https://github.com/NORDUnet/python-norduniclient', license='Apache License, Version 2.0', author='Johan Lundberg', author_email='lundberg@nordu.net', description='Neo4j (>=3.2.2) database client using bolt for NORDUnet network inventory', packages=find_packages(), zip_safe=False, install_requires=requires, tests_require=testing_requires, test_suite='nose.collector', extras_require={ 'testing': testing_requires } )
c89d90e03ef88593eb1c23f10667c7125bf80a16
setup.py
setup.py
from setuptools import setup from setuptools.command.test import test as TestCommand import sys import doubles with open('README.md') as f: long_description = f.read() class PyTest(TestCommand): def finalize_options(self): TestCommand.finalize_options(self) self.test_args = [] self.test_suite = True def run_tests(self): import pytest errcode = pytest.main(self.test_args) sys.exit(errcode) setup( name='doubles', version=doubles.__version__, description='Test doubles for Python.', long_description=long_description, author='Jimmy Cuadra', author_email='jimmy@uber.com', url='https://github.com/uber/doubles', license='MIT', packages=['doubles'], tests_require=['pytest'], cmdclass={'test': PyTest}, entry_points = { 'pytest11': ['doubles = doubles.pytest'], 'nose.plugins.0.10': ['doubles = doubles.nose:NoseIntegration'] }, zip_safe=True, keywords=['testing', 'test doubles', 'mocks', 'mocking', 'stubs', 'stubbing'], classifiers=[ 'Development Status :: 1 - Planning', 'Programming Language :: Python', 'Programming Language :: Python :: 2.7', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Topic :: Software Development :: Testing', ] )
from setuptools import setup from setuptools.command.test import test as TestCommand import sys import doubles with open('README.md') as f: long_description = f.read() class PyTest(TestCommand): def finalize_options(self): TestCommand.finalize_options(self) self.test_args = [] self.test_suite = True def run_tests(self): import pytest errcode = pytest.main(self.test_args) sys.exit(errcode) setup( name='doubles', version=doubles.__version__, description='Test doubles for Python.', long_description=long_description, author='Jimmy Cuadra', author_email='jimmy@uber.com', url='https://github.com/uber/doubles', license='MIT', packages=['doubles', 'doubles.targets'], tests_require=['pytest'], cmdclass={'test': PyTest}, entry_points = { 'pytest11': ['doubles = doubles.pytest'], 'nose.plugins.0.10': ['doubles = doubles.nose:NoseIntegration'] }, zip_safe=True, keywords=['testing', 'test doubles', 'mocks', 'mocking', 'stubs', 'stubbing'], classifiers=[ 'Development Status :: 1 - Planning', 'Programming Language :: Python', 'Programming Language :: Python :: 2.7', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Topic :: Software Development :: Testing', ] )
Include doubles.targets in packages list.
Include doubles.targets in packages list.
Python
mit
uber/doubles
from setuptools import setup from setuptools.command.test import test as TestCommand import sys import doubles with open('README.md') as f: long_description = f.read() class PyTest(TestCommand): def finalize_options(self): TestCommand.finalize_options(self) self.test_args = [] self.test_suite = True def run_tests(self): import pytest errcode = pytest.main(self.test_args) sys.exit(errcode) setup( name='doubles', version=doubles.__version__, description='Test doubles for Python.', long_description=long_description, author='Jimmy Cuadra', author_email='jimmy@uber.com', url='https://github.com/uber/doubles', license='MIT', packages=['doubles'], tests_require=['pytest'], cmdclass={'test': PyTest}, entry_points = { 'pytest11': ['doubles = doubles.pytest'], 'nose.plugins.0.10': ['doubles = doubles.nose:NoseIntegration'] }, zip_safe=True, keywords=['testing', 'test doubles', 'mocks', 'mocking', 'stubs', 'stubbing'], classifiers=[ 'Development Status :: 1 - Planning', 'Programming Language :: Python', 'Programming Language :: Python :: 2.7', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Topic :: Software Development :: Testing', ] ) Include doubles.targets in packages list.
from setuptools import setup from setuptools.command.test import test as TestCommand import sys import doubles with open('README.md') as f: long_description = f.read() class PyTest(TestCommand): def finalize_options(self): TestCommand.finalize_options(self) self.test_args = [] self.test_suite = True def run_tests(self): import pytest errcode = pytest.main(self.test_args) sys.exit(errcode) setup( name='doubles', version=doubles.__version__, description='Test doubles for Python.', long_description=long_description, author='Jimmy Cuadra', author_email='jimmy@uber.com', url='https://github.com/uber/doubles', license='MIT', packages=['doubles', 'doubles.targets'], tests_require=['pytest'], cmdclass={'test': PyTest}, entry_points = { 'pytest11': ['doubles = doubles.pytest'], 'nose.plugins.0.10': ['doubles = doubles.nose:NoseIntegration'] }, zip_safe=True, keywords=['testing', 'test doubles', 'mocks', 'mocking', 'stubs', 'stubbing'], classifiers=[ 'Development Status :: 1 - Planning', 'Programming Language :: Python', 'Programming Language :: Python :: 2.7', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Topic :: Software Development :: Testing', ] )
<commit_before>from setuptools import setup from setuptools.command.test import test as TestCommand import sys import doubles with open('README.md') as f: long_description = f.read() class PyTest(TestCommand): def finalize_options(self): TestCommand.finalize_options(self) self.test_args = [] self.test_suite = True def run_tests(self): import pytest errcode = pytest.main(self.test_args) sys.exit(errcode) setup( name='doubles', version=doubles.__version__, description='Test doubles for Python.', long_description=long_description, author='Jimmy Cuadra', author_email='jimmy@uber.com', url='https://github.com/uber/doubles', license='MIT', packages=['doubles'], tests_require=['pytest'], cmdclass={'test': PyTest}, entry_points = { 'pytest11': ['doubles = doubles.pytest'], 'nose.plugins.0.10': ['doubles = doubles.nose:NoseIntegration'] }, zip_safe=True, keywords=['testing', 'test doubles', 'mocks', 'mocking', 'stubs', 'stubbing'], classifiers=[ 'Development Status :: 1 - Planning', 'Programming Language :: Python', 'Programming Language :: Python :: 2.7', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Topic :: Software Development :: Testing', ] ) <commit_msg>Include doubles.targets in packages list.<commit_after>
from setuptools import setup from setuptools.command.test import test as TestCommand import sys import doubles with open('README.md') as f: long_description = f.read() class PyTest(TestCommand): def finalize_options(self): TestCommand.finalize_options(self) self.test_args = [] self.test_suite = True def run_tests(self): import pytest errcode = pytest.main(self.test_args) sys.exit(errcode) setup( name='doubles', version=doubles.__version__, description='Test doubles for Python.', long_description=long_description, author='Jimmy Cuadra', author_email='jimmy@uber.com', url='https://github.com/uber/doubles', license='MIT', packages=['doubles', 'doubles.targets'], tests_require=['pytest'], cmdclass={'test': PyTest}, entry_points = { 'pytest11': ['doubles = doubles.pytest'], 'nose.plugins.0.10': ['doubles = doubles.nose:NoseIntegration'] }, zip_safe=True, keywords=['testing', 'test doubles', 'mocks', 'mocking', 'stubs', 'stubbing'], classifiers=[ 'Development Status :: 1 - Planning', 'Programming Language :: Python', 'Programming Language :: Python :: 2.7', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Topic :: Software Development :: Testing', ] )
from setuptools import setup from setuptools.command.test import test as TestCommand import sys import doubles with open('README.md') as f: long_description = f.read() class PyTest(TestCommand): def finalize_options(self): TestCommand.finalize_options(self) self.test_args = [] self.test_suite = True def run_tests(self): import pytest errcode = pytest.main(self.test_args) sys.exit(errcode) setup( name='doubles', version=doubles.__version__, description='Test doubles for Python.', long_description=long_description, author='Jimmy Cuadra', author_email='jimmy@uber.com', url='https://github.com/uber/doubles', license='MIT', packages=['doubles'], tests_require=['pytest'], cmdclass={'test': PyTest}, entry_points = { 'pytest11': ['doubles = doubles.pytest'], 'nose.plugins.0.10': ['doubles = doubles.nose:NoseIntegration'] }, zip_safe=True, keywords=['testing', 'test doubles', 'mocks', 'mocking', 'stubs', 'stubbing'], classifiers=[ 'Development Status :: 1 - Planning', 'Programming Language :: Python', 'Programming Language :: Python :: 2.7', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Topic :: Software Development :: Testing', ] ) Include doubles.targets in packages list.from setuptools import setup from setuptools.command.test import test as TestCommand import sys import doubles with open('README.md') as f: long_description = f.read() class PyTest(TestCommand): def finalize_options(self): TestCommand.finalize_options(self) self.test_args = [] self.test_suite = True def run_tests(self): import pytest errcode = pytest.main(self.test_args) sys.exit(errcode) setup( name='doubles', version=doubles.__version__, description='Test doubles for Python.', long_description=long_description, author='Jimmy Cuadra', author_email='jimmy@uber.com', url='https://github.com/uber/doubles', license='MIT', packages=['doubles', 'doubles.targets'], tests_require=['pytest'], cmdclass={'test': PyTest}, entry_points = { 'pytest11': ['doubles = doubles.pytest'], 'nose.plugins.0.10': ['doubles = doubles.nose:NoseIntegration'] }, zip_safe=True, keywords=['testing', 'test doubles', 'mocks', 'mocking', 'stubs', 'stubbing'], classifiers=[ 'Development Status :: 1 - Planning', 'Programming Language :: Python', 'Programming Language :: Python :: 2.7', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Topic :: Software Development :: Testing', ] )
<commit_before>from setuptools import setup from setuptools.command.test import test as TestCommand import sys import doubles with open('README.md') as f: long_description = f.read() class PyTest(TestCommand): def finalize_options(self): TestCommand.finalize_options(self) self.test_args = [] self.test_suite = True def run_tests(self): import pytest errcode = pytest.main(self.test_args) sys.exit(errcode) setup( name='doubles', version=doubles.__version__, description='Test doubles for Python.', long_description=long_description, author='Jimmy Cuadra', author_email='jimmy@uber.com', url='https://github.com/uber/doubles', license='MIT', packages=['doubles'], tests_require=['pytest'], cmdclass={'test': PyTest}, entry_points = { 'pytest11': ['doubles = doubles.pytest'], 'nose.plugins.0.10': ['doubles = doubles.nose:NoseIntegration'] }, zip_safe=True, keywords=['testing', 'test doubles', 'mocks', 'mocking', 'stubs', 'stubbing'], classifiers=[ 'Development Status :: 1 - Planning', 'Programming Language :: Python', 'Programming Language :: Python :: 2.7', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Topic :: Software Development :: Testing', ] ) <commit_msg>Include doubles.targets in packages list.<commit_after>from setuptools import setup from setuptools.command.test import test as TestCommand import sys import doubles with open('README.md') as f: long_description = f.read() class PyTest(TestCommand): def finalize_options(self): TestCommand.finalize_options(self) self.test_args = [] self.test_suite = True def run_tests(self): import pytest errcode = pytest.main(self.test_args) sys.exit(errcode) setup( name='doubles', version=doubles.__version__, description='Test doubles for Python.', long_description=long_description, author='Jimmy Cuadra', author_email='jimmy@uber.com', url='https://github.com/uber/doubles', license='MIT', packages=['doubles', 'doubles.targets'], tests_require=['pytest'], cmdclass={'test': PyTest}, entry_points = { 'pytest11': ['doubles = doubles.pytest'], 'nose.plugins.0.10': ['doubles = doubles.nose:NoseIntegration'] }, zip_safe=True, keywords=['testing', 'test doubles', 'mocks', 'mocking', 'stubs', 'stubbing'], classifiers=[ 'Development Status :: 1 - Planning', 'Programming Language :: Python', 'Programming Language :: Python :: 2.7', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Topic :: Software Development :: Testing', ] )
2f33ba5a84630e405e388719ee3db0674cd11f81
setup.py
setup.py
import os from distutils.core import setup VERSION = '0.1.0' README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read() required = [ 'Django >= 1.5.0', ] setup( name='madmin', version=VERSION, description="Virtual mail administration django app", author="Lewis Gunsch", author_email="lewis@gunsch.ca", url="https://github.com/lgunsch/madmin", license='MIT', long_description=README, packages=[ 'madmin', 'madmin.management', 'madmin.management.commands', 'madmin.migrations', 'madmin.tests', ], scripts=[], install_requires=required, include_package_data=True, classifiers=[ 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Topic :: Communications :: Email', 'Topic :: Communications :: Email :: Mail Transport Agents', 'Topic :: Internet :: WWW/HTTP', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', ], )
import os from distutils.core import setup VERSION = '0.2.0-dev' README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read() required = [ 'Django >= 1.5.0', ] setup( name='madmin', version=VERSION, description="Virtual mail administration django app", author="Lewis Gunsch", author_email="lewis@gunsch.ca", url="https://github.com/lgunsch/madmin", license='MIT', long_description=README, packages=[ 'madmin', 'madmin.management', 'madmin.management.commands', 'madmin.migrations', 'madmin.tests', ], scripts=[], install_requires=required, include_package_data=True, classifiers=[ 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Topic :: Communications :: Email', 'Topic :: Communications :: Email :: Mail Transport Agents', 'Topic :: Internet :: WWW/HTTP', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', ], )
Bump the version number - 0.2.0-dev.
Bump the version number - 0.2.0-dev. Signed-off-by: Lewis Gunsch <748e1641a368164906d4a0c0e3965345453dcc93@gunsch.ca>
Python
mit
lgunsch/django-vmail
import os from distutils.core import setup VERSION = '0.1.0' README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read() required = [ 'Django >= 1.5.0', ] setup( name='madmin', version=VERSION, description="Virtual mail administration django app", author="Lewis Gunsch", author_email="lewis@gunsch.ca", url="https://github.com/lgunsch/madmin", license='MIT', long_description=README, packages=[ 'madmin', 'madmin.management', 'madmin.management.commands', 'madmin.migrations', 'madmin.tests', ], scripts=[], install_requires=required, include_package_data=True, classifiers=[ 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Topic :: Communications :: Email', 'Topic :: Communications :: Email :: Mail Transport Agents', 'Topic :: Internet :: WWW/HTTP', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', ], ) Bump the version number - 0.2.0-dev. Signed-off-by: Lewis Gunsch <748e1641a368164906d4a0c0e3965345453dcc93@gunsch.ca>
import os from distutils.core import setup VERSION = '0.2.0-dev' README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read() required = [ 'Django >= 1.5.0', ] setup( name='madmin', version=VERSION, description="Virtual mail administration django app", author="Lewis Gunsch", author_email="lewis@gunsch.ca", url="https://github.com/lgunsch/madmin", license='MIT', long_description=README, packages=[ 'madmin', 'madmin.management', 'madmin.management.commands', 'madmin.migrations', 'madmin.tests', ], scripts=[], install_requires=required, include_package_data=True, classifiers=[ 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Topic :: Communications :: Email', 'Topic :: Communications :: Email :: Mail Transport Agents', 'Topic :: Internet :: WWW/HTTP', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', ], )
<commit_before>import os from distutils.core import setup VERSION = '0.1.0' README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read() required = [ 'Django >= 1.5.0', ] setup( name='madmin', version=VERSION, description="Virtual mail administration django app", author="Lewis Gunsch", author_email="lewis@gunsch.ca", url="https://github.com/lgunsch/madmin", license='MIT', long_description=README, packages=[ 'madmin', 'madmin.management', 'madmin.management.commands', 'madmin.migrations', 'madmin.tests', ], scripts=[], install_requires=required, include_package_data=True, classifiers=[ 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Topic :: Communications :: Email', 'Topic :: Communications :: Email :: Mail Transport Agents', 'Topic :: Internet :: WWW/HTTP', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', ], ) <commit_msg>Bump the version number - 0.2.0-dev. Signed-off-by: Lewis Gunsch <748e1641a368164906d4a0c0e3965345453dcc93@gunsch.ca><commit_after>
import os from distutils.core import setup VERSION = '0.2.0-dev' README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read() required = [ 'Django >= 1.5.0', ] setup( name='madmin', version=VERSION, description="Virtual mail administration django app", author="Lewis Gunsch", author_email="lewis@gunsch.ca", url="https://github.com/lgunsch/madmin", license='MIT', long_description=README, packages=[ 'madmin', 'madmin.management', 'madmin.management.commands', 'madmin.migrations', 'madmin.tests', ], scripts=[], install_requires=required, include_package_data=True, classifiers=[ 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Topic :: Communications :: Email', 'Topic :: Communications :: Email :: Mail Transport Agents', 'Topic :: Internet :: WWW/HTTP', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', ], )
import os from distutils.core import setup VERSION = '0.1.0' README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read() required = [ 'Django >= 1.5.0', ] setup( name='madmin', version=VERSION, description="Virtual mail administration django app", author="Lewis Gunsch", author_email="lewis@gunsch.ca", url="https://github.com/lgunsch/madmin", license='MIT', long_description=README, packages=[ 'madmin', 'madmin.management', 'madmin.management.commands', 'madmin.migrations', 'madmin.tests', ], scripts=[], install_requires=required, include_package_data=True, classifiers=[ 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Topic :: Communications :: Email', 'Topic :: Communications :: Email :: Mail Transport Agents', 'Topic :: Internet :: WWW/HTTP', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', ], ) Bump the version number - 0.2.0-dev. Signed-off-by: Lewis Gunsch <748e1641a368164906d4a0c0e3965345453dcc93@gunsch.ca>import os from distutils.core import setup VERSION = '0.2.0-dev' README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read() required = [ 'Django >= 1.5.0', ] setup( name='madmin', version=VERSION, description="Virtual mail administration django app", author="Lewis Gunsch", author_email="lewis@gunsch.ca", url="https://github.com/lgunsch/madmin", license='MIT', long_description=README, packages=[ 'madmin', 'madmin.management', 'madmin.management.commands', 'madmin.migrations', 'madmin.tests', ], scripts=[], install_requires=required, include_package_data=True, classifiers=[ 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Topic :: Communications :: Email', 'Topic :: Communications :: Email :: Mail Transport Agents', 'Topic :: Internet :: WWW/HTTP', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', ], )
<commit_before>import os from distutils.core import setup VERSION = '0.1.0' README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read() required = [ 'Django >= 1.5.0', ] setup( name='madmin', version=VERSION, description="Virtual mail administration django app", author="Lewis Gunsch", author_email="lewis@gunsch.ca", url="https://github.com/lgunsch/madmin", license='MIT', long_description=README, packages=[ 'madmin', 'madmin.management', 'madmin.management.commands', 'madmin.migrations', 'madmin.tests', ], scripts=[], install_requires=required, include_package_data=True, classifiers=[ 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Topic :: Communications :: Email', 'Topic :: Communications :: Email :: Mail Transport Agents', 'Topic :: Internet :: WWW/HTTP', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', ], ) <commit_msg>Bump the version number - 0.2.0-dev. Signed-off-by: Lewis Gunsch <748e1641a368164906d4a0c0e3965345453dcc93@gunsch.ca><commit_after>import os from distutils.core import setup VERSION = '0.2.0-dev' README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read() required = [ 'Django >= 1.5.0', ] setup( name='madmin', version=VERSION, description="Virtual mail administration django app", author="Lewis Gunsch", author_email="lewis@gunsch.ca", url="https://github.com/lgunsch/madmin", license='MIT', long_description=README, packages=[ 'madmin', 'madmin.management', 'madmin.management.commands', 'madmin.migrations', 'madmin.tests', ], scripts=[], install_requires=required, include_package_data=True, classifiers=[ 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Topic :: Communications :: Email', 'Topic :: Communications :: Email :: Mail Transport Agents', 'Topic :: Internet :: WWW/HTTP', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', ], )
6ee03020e5670c80e43fe1cadf3539a53056773d
setup.py
setup.py
from setuptools import setup, find_packages setup( name='vumi-wikipedia', version='0.1.2', description='Vumi Wikipedia App', packages=find_packages(), include_package_data=True, install_requires=[ 'vumi>=0.5', 'unidecode', ], url='http://github.com/praekelt/vumi-wikipedia', license='BSD', long_description=open('README', 'r').read(), maintainer='Praekelt Foundation', maintainer_email='dev@praekelt.com', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: POSIX', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: System :: Networking', ], )
from setuptools import setup, find_packages setup( name='vumi-wikipedia', version='0.2.0a', description='Vumi Wikipedia App', packages=find_packages(), include_package_data=True, install_requires=[ 'vumi>=0.5', 'unidecode', ], url='http://github.com/praekelt/vumi-wikipedia', license='BSD', long_description=open('README', 'r').read(), maintainer='Praekelt Foundation', maintainer_email='dev@praekelt.com', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: POSIX', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: System :: Networking', ], )
Change version back to 0.2.0a post-release.
Change version back to 0.2.0a post-release.
Python
bsd-3-clause
praekelt/vumi-wikipedia,praekelt/vumi-wikipedia
from setuptools import setup, find_packages setup( name='vumi-wikipedia', version='0.1.2', description='Vumi Wikipedia App', packages=find_packages(), include_package_data=True, install_requires=[ 'vumi>=0.5', 'unidecode', ], url='http://github.com/praekelt/vumi-wikipedia', license='BSD', long_description=open('README', 'r').read(), maintainer='Praekelt Foundation', maintainer_email='dev@praekelt.com', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: POSIX', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: System :: Networking', ], ) Change version back to 0.2.0a post-release.
from setuptools import setup, find_packages setup( name='vumi-wikipedia', version='0.2.0a', description='Vumi Wikipedia App', packages=find_packages(), include_package_data=True, install_requires=[ 'vumi>=0.5', 'unidecode', ], url='http://github.com/praekelt/vumi-wikipedia', license='BSD', long_description=open('README', 'r').read(), maintainer='Praekelt Foundation', maintainer_email='dev@praekelt.com', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: POSIX', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: System :: Networking', ], )
<commit_before>from setuptools import setup, find_packages setup( name='vumi-wikipedia', version='0.1.2', description='Vumi Wikipedia App', packages=find_packages(), include_package_data=True, install_requires=[ 'vumi>=0.5', 'unidecode', ], url='http://github.com/praekelt/vumi-wikipedia', license='BSD', long_description=open('README', 'r').read(), maintainer='Praekelt Foundation', maintainer_email='dev@praekelt.com', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: POSIX', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: System :: Networking', ], ) <commit_msg>Change version back to 0.2.0a post-release.<commit_after>
from setuptools import setup, find_packages setup( name='vumi-wikipedia', version='0.2.0a', description='Vumi Wikipedia App', packages=find_packages(), include_package_data=True, install_requires=[ 'vumi>=0.5', 'unidecode', ], url='http://github.com/praekelt/vumi-wikipedia', license='BSD', long_description=open('README', 'r').read(), maintainer='Praekelt Foundation', maintainer_email='dev@praekelt.com', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: POSIX', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: System :: Networking', ], )
from setuptools import setup, find_packages setup( name='vumi-wikipedia', version='0.1.2', description='Vumi Wikipedia App', packages=find_packages(), include_package_data=True, install_requires=[ 'vumi>=0.5', 'unidecode', ], url='http://github.com/praekelt/vumi-wikipedia', license='BSD', long_description=open('README', 'r').read(), maintainer='Praekelt Foundation', maintainer_email='dev@praekelt.com', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: POSIX', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: System :: Networking', ], ) Change version back to 0.2.0a post-release.from setuptools import setup, find_packages setup( name='vumi-wikipedia', version='0.2.0a', description='Vumi Wikipedia App', packages=find_packages(), include_package_data=True, install_requires=[ 'vumi>=0.5', 'unidecode', ], url='http://github.com/praekelt/vumi-wikipedia', license='BSD', long_description=open('README', 'r').read(), maintainer='Praekelt Foundation', maintainer_email='dev@praekelt.com', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: POSIX', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: System :: Networking', ], )
<commit_before>from setuptools import setup, find_packages setup( name='vumi-wikipedia', version='0.1.2', description='Vumi Wikipedia App', packages=find_packages(), include_package_data=True, install_requires=[ 'vumi>=0.5', 'unidecode', ], url='http://github.com/praekelt/vumi-wikipedia', license='BSD', long_description=open('README', 'r').read(), maintainer='Praekelt Foundation', maintainer_email='dev@praekelt.com', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: POSIX', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: System :: Networking', ], ) <commit_msg>Change version back to 0.2.0a post-release.<commit_after>from setuptools import setup, find_packages setup( name='vumi-wikipedia', version='0.2.0a', description='Vumi Wikipedia App', packages=find_packages(), include_package_data=True, install_requires=[ 'vumi>=0.5', 'unidecode', ], url='http://github.com/praekelt/vumi-wikipedia', license='BSD', long_description=open('README', 'r').read(), maintainer='Praekelt Foundation', maintainer_email='dev@praekelt.com', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: POSIX', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: System :: Networking', ], )
e90eb4500e551e8205d6317be6cd010c58cdfa7b
setup.py
setup.py
import subprocess import sys from setuptools import Command, setup class RunTests(Command): user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): errno = subprocess.call([sys.executable, '-m', 'unittest', 'gis_metadata.tests.tests']) raise SystemExit(errno) setup( name='gis_metadata_parser', description='Parser for GIS metadata standards including FGDC and ISO-19115', keywords='fgdc,iso,ISO-19115,ISO-19139,metadata,xml,parser', version='0.5.0', packages=[ 'gis_metadata', 'gis_metadata.tests' ], install_requires=[ 'parserutils', 'six' ], url='https://github.com/consbio/gis-metadata-parser', license='BSD', cmdclass={'test': RunTests} )
import subprocess import sys from setuptools import Command, setup class RunTests(Command): user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): errno = subprocess.call([sys.executable, '-m', 'unittest', 'gis_metadata.tests.tests']) raise SystemExit(errno) setup( name='gis_metadata_parser', description='Parser for GIS metadata standards including FGDC and ISO-19115', keywords='fgdc,iso,ISO-19115,ISO-19139,metadata,xml,parser', version='0.6.0', packages=[ 'gis_metadata', 'gis_metadata.tests' ], install_requires=[ 'parserutils', 'six' ], url='https://github.com/consbio/gis-metadata-parser', license='BSD', cmdclass={'test': RunTests} )
Increment version in preparation for release
Increment version in preparation for release
Python
bsd-3-clause
consbio/gis-metadata-parser
import subprocess import sys from setuptools import Command, setup class RunTests(Command): user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): errno = subprocess.call([sys.executable, '-m', 'unittest', 'gis_metadata.tests.tests']) raise SystemExit(errno) setup( name='gis_metadata_parser', description='Parser for GIS metadata standards including FGDC and ISO-19115', keywords='fgdc,iso,ISO-19115,ISO-19139,metadata,xml,parser', version='0.5.0', packages=[ 'gis_metadata', 'gis_metadata.tests' ], install_requires=[ 'parserutils', 'six' ], url='https://github.com/consbio/gis-metadata-parser', license='BSD', cmdclass={'test': RunTests} ) Increment version in preparation for release
import subprocess import sys from setuptools import Command, setup class RunTests(Command): user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): errno = subprocess.call([sys.executable, '-m', 'unittest', 'gis_metadata.tests.tests']) raise SystemExit(errno) setup( name='gis_metadata_parser', description='Parser for GIS metadata standards including FGDC and ISO-19115', keywords='fgdc,iso,ISO-19115,ISO-19139,metadata,xml,parser', version='0.6.0', packages=[ 'gis_metadata', 'gis_metadata.tests' ], install_requires=[ 'parserutils', 'six' ], url='https://github.com/consbio/gis-metadata-parser', license='BSD', cmdclass={'test': RunTests} )
<commit_before>import subprocess import sys from setuptools import Command, setup class RunTests(Command): user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): errno = subprocess.call([sys.executable, '-m', 'unittest', 'gis_metadata.tests.tests']) raise SystemExit(errno) setup( name='gis_metadata_parser', description='Parser for GIS metadata standards including FGDC and ISO-19115', keywords='fgdc,iso,ISO-19115,ISO-19139,metadata,xml,parser', version='0.5.0', packages=[ 'gis_metadata', 'gis_metadata.tests' ], install_requires=[ 'parserutils', 'six' ], url='https://github.com/consbio/gis-metadata-parser', license='BSD', cmdclass={'test': RunTests} ) <commit_msg>Increment version in preparation for release<commit_after>
import subprocess import sys from setuptools import Command, setup class RunTests(Command): user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): errno = subprocess.call([sys.executable, '-m', 'unittest', 'gis_metadata.tests.tests']) raise SystemExit(errno) setup( name='gis_metadata_parser', description='Parser for GIS metadata standards including FGDC and ISO-19115', keywords='fgdc,iso,ISO-19115,ISO-19139,metadata,xml,parser', version='0.6.0', packages=[ 'gis_metadata', 'gis_metadata.tests' ], install_requires=[ 'parserutils', 'six' ], url='https://github.com/consbio/gis-metadata-parser', license='BSD', cmdclass={'test': RunTests} )
import subprocess import sys from setuptools import Command, setup class RunTests(Command): user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): errno = subprocess.call([sys.executable, '-m', 'unittest', 'gis_metadata.tests.tests']) raise SystemExit(errno) setup( name='gis_metadata_parser', description='Parser for GIS metadata standards including FGDC and ISO-19115', keywords='fgdc,iso,ISO-19115,ISO-19139,metadata,xml,parser', version='0.5.0', packages=[ 'gis_metadata', 'gis_metadata.tests' ], install_requires=[ 'parserutils', 'six' ], url='https://github.com/consbio/gis-metadata-parser', license='BSD', cmdclass={'test': RunTests} ) Increment version in preparation for releaseimport subprocess import sys from setuptools import Command, setup class RunTests(Command): user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): errno = subprocess.call([sys.executable, '-m', 'unittest', 'gis_metadata.tests.tests']) raise SystemExit(errno) setup( name='gis_metadata_parser', description='Parser for GIS metadata standards including FGDC and ISO-19115', keywords='fgdc,iso,ISO-19115,ISO-19139,metadata,xml,parser', version='0.6.0', packages=[ 'gis_metadata', 'gis_metadata.tests' ], install_requires=[ 'parserutils', 'six' ], url='https://github.com/consbio/gis-metadata-parser', license='BSD', cmdclass={'test': RunTests} )
<commit_before>import subprocess import sys from setuptools import Command, setup class RunTests(Command): user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): errno = subprocess.call([sys.executable, '-m', 'unittest', 'gis_metadata.tests.tests']) raise SystemExit(errno) setup( name='gis_metadata_parser', description='Parser for GIS metadata standards including FGDC and ISO-19115', keywords='fgdc,iso,ISO-19115,ISO-19139,metadata,xml,parser', version='0.5.0', packages=[ 'gis_metadata', 'gis_metadata.tests' ], install_requires=[ 'parserutils', 'six' ], url='https://github.com/consbio/gis-metadata-parser', license='BSD', cmdclass={'test': RunTests} ) <commit_msg>Increment version in preparation for release<commit_after>import subprocess import sys from setuptools import Command, setup class RunTests(Command): user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): errno = subprocess.call([sys.executable, '-m', 'unittest', 'gis_metadata.tests.tests']) raise SystemExit(errno) setup( name='gis_metadata_parser', description='Parser for GIS metadata standards including FGDC and ISO-19115', keywords='fgdc,iso,ISO-19115,ISO-19139,metadata,xml,parser', version='0.6.0', packages=[ 'gis_metadata', 'gis_metadata.tests' ], install_requires=[ 'parserutils', 'six' ], url='https://github.com/consbio/gis-metadata-parser', license='BSD', cmdclass={'test': RunTests} )
028d537f65d5ed0f71a0c1279f10ffbc2a1b7e07
setup.py
setup.py
from setuptools import setup, find_packages deps = [ 'mozillapulse>=1.1', 'mozci>=0.13.1', 'treeherder-client>=1.5', 'ijson>=2.2', 'requests', ] setup(name='pulse-actions', version='0.1.4', description='A pulse listener that acts upon messages with mozci.', classifiers=['Intended Audience :: Developers', 'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)', 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Software Development :: Libraries :: Python Modules', ], author='Alice Scarpa', author_email='alicescarpa@gmail.com', license='MPL 2.0', packages=find_packages(), include_package_data=True, zip_safe=False, install_requires=deps, url='https://github.com/adusca/pulse_actions', entry_points={ 'console_scripts': [ 'run-pulse-actions = pulse_actions.worker:main' ], })
from setuptools import setup, find_packages deps = [ 'mozillapulse>=1.1', 'mozci>=0.13.2', 'treeherder-client>=1.5', 'ijson>=2.2', 'requests', ] setup(name='pulse-actions', version='0.1.4', description='A pulse listener that acts upon messages with mozci.', classifiers=['Intended Audience :: Developers', 'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)', 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Software Development :: Libraries :: Python Modules', ], author='Alice Scarpa', author_email='alicescarpa@gmail.com', license='MPL 2.0', packages=find_packages(), include_package_data=True, zip_safe=False, install_requires=deps, url='https://github.com/adusca/pulse_actions', entry_points={ 'console_scripts': [ 'run-pulse-actions = pulse_actions.worker:main' ], })
Update mozci version to 0.13.2
Update mozci version to 0.13.2
Python
mpl-2.0
armenzg/pulse_actions,adusca/pulse_actions,nikkisquared/pulse_actions,mozilla/pulse_actions
from setuptools import setup, find_packages deps = [ 'mozillapulse>=1.1', 'mozci>=0.13.1', 'treeherder-client>=1.5', 'ijson>=2.2', 'requests', ] setup(name='pulse-actions', version='0.1.4', description='A pulse listener that acts upon messages with mozci.', classifiers=['Intended Audience :: Developers', 'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)', 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Software Development :: Libraries :: Python Modules', ], author='Alice Scarpa', author_email='alicescarpa@gmail.com', license='MPL 2.0', packages=find_packages(), include_package_data=True, zip_safe=False, install_requires=deps, url='https://github.com/adusca/pulse_actions', entry_points={ 'console_scripts': [ 'run-pulse-actions = pulse_actions.worker:main' ], }) Update mozci version to 0.13.2
from setuptools import setup, find_packages deps = [ 'mozillapulse>=1.1', 'mozci>=0.13.2', 'treeherder-client>=1.5', 'ijson>=2.2', 'requests', ] setup(name='pulse-actions', version='0.1.4', description='A pulse listener that acts upon messages with mozci.', classifiers=['Intended Audience :: Developers', 'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)', 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Software Development :: Libraries :: Python Modules', ], author='Alice Scarpa', author_email='alicescarpa@gmail.com', license='MPL 2.0', packages=find_packages(), include_package_data=True, zip_safe=False, install_requires=deps, url='https://github.com/adusca/pulse_actions', entry_points={ 'console_scripts': [ 'run-pulse-actions = pulse_actions.worker:main' ], })
<commit_before>from setuptools import setup, find_packages deps = [ 'mozillapulse>=1.1', 'mozci>=0.13.1', 'treeherder-client>=1.5', 'ijson>=2.2', 'requests', ] setup(name='pulse-actions', version='0.1.4', description='A pulse listener that acts upon messages with mozci.', classifiers=['Intended Audience :: Developers', 'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)', 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Software Development :: Libraries :: Python Modules', ], author='Alice Scarpa', author_email='alicescarpa@gmail.com', license='MPL 2.0', packages=find_packages(), include_package_data=True, zip_safe=False, install_requires=deps, url='https://github.com/adusca/pulse_actions', entry_points={ 'console_scripts': [ 'run-pulse-actions = pulse_actions.worker:main' ], }) <commit_msg>Update mozci version to 0.13.2<commit_after>
from setuptools import setup, find_packages deps = [ 'mozillapulse>=1.1', 'mozci>=0.13.2', 'treeherder-client>=1.5', 'ijson>=2.2', 'requests', ] setup(name='pulse-actions', version='0.1.4', description='A pulse listener that acts upon messages with mozci.', classifiers=['Intended Audience :: Developers', 'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)', 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Software Development :: Libraries :: Python Modules', ], author='Alice Scarpa', author_email='alicescarpa@gmail.com', license='MPL 2.0', packages=find_packages(), include_package_data=True, zip_safe=False, install_requires=deps, url='https://github.com/adusca/pulse_actions', entry_points={ 'console_scripts': [ 'run-pulse-actions = pulse_actions.worker:main' ], })
from setuptools import setup, find_packages deps = [ 'mozillapulse>=1.1', 'mozci>=0.13.1', 'treeherder-client>=1.5', 'ijson>=2.2', 'requests', ] setup(name='pulse-actions', version='0.1.4', description='A pulse listener that acts upon messages with mozci.', classifiers=['Intended Audience :: Developers', 'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)', 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Software Development :: Libraries :: Python Modules', ], author='Alice Scarpa', author_email='alicescarpa@gmail.com', license='MPL 2.0', packages=find_packages(), include_package_data=True, zip_safe=False, install_requires=deps, url='https://github.com/adusca/pulse_actions', entry_points={ 'console_scripts': [ 'run-pulse-actions = pulse_actions.worker:main' ], }) Update mozci version to 0.13.2from setuptools import setup, find_packages deps = [ 'mozillapulse>=1.1', 'mozci>=0.13.2', 'treeherder-client>=1.5', 'ijson>=2.2', 'requests', ] setup(name='pulse-actions', version='0.1.4', description='A pulse listener that acts upon messages with mozci.', classifiers=['Intended Audience :: Developers', 'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)', 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Software Development :: Libraries :: Python Modules', ], author='Alice Scarpa', author_email='alicescarpa@gmail.com', license='MPL 2.0', packages=find_packages(), include_package_data=True, zip_safe=False, install_requires=deps, url='https://github.com/adusca/pulse_actions', entry_points={ 'console_scripts': [ 'run-pulse-actions = pulse_actions.worker:main' ], })
<commit_before>from setuptools import setup, find_packages deps = [ 'mozillapulse>=1.1', 'mozci>=0.13.1', 'treeherder-client>=1.5', 'ijson>=2.2', 'requests', ] setup(name='pulse-actions', version='0.1.4', description='A pulse listener that acts upon messages with mozci.', classifiers=['Intended Audience :: Developers', 'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)', 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Software Development :: Libraries :: Python Modules', ], author='Alice Scarpa', author_email='alicescarpa@gmail.com', license='MPL 2.0', packages=find_packages(), include_package_data=True, zip_safe=False, install_requires=deps, url='https://github.com/adusca/pulse_actions', entry_points={ 'console_scripts': [ 'run-pulse-actions = pulse_actions.worker:main' ], }) <commit_msg>Update mozci version to 0.13.2<commit_after>from setuptools import setup, find_packages deps = [ 'mozillapulse>=1.1', 'mozci>=0.13.2', 'treeherder-client>=1.5', 'ijson>=2.2', 'requests', ] setup(name='pulse-actions', version='0.1.4', description='A pulse listener that acts upon messages with mozci.', classifiers=['Intended Audience :: Developers', 'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)', 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Software Development :: Libraries :: Python Modules', ], author='Alice Scarpa', author_email='alicescarpa@gmail.com', license='MPL 2.0', packages=find_packages(), include_package_data=True, zip_safe=False, install_requires=deps, url='https://github.com/adusca/pulse_actions', entry_points={ 'console_scripts': [ 'run-pulse-actions = pulse_actions.worker:main' ], })
6000a6943259698382eca2aa077cec62d6116142
setup.py
setup.py
from setuptools import setup from sys import version_info setup( name='avatar2', version='1.3.0', packages=['avatar2', 'avatar2/archs', 'avatar2/targets', 'avatar2/protocols', 'avatar2/peripherals', 'avatar2/plugins', 'avatar2/plugins/arm', 'avatar2/installer' ], install_requires=[ 'pygdbmi>=0.7.3.1', 'intervaltree', 'posix_ipc>=1.0.0', 'capstone>=3.0.4', 'keystone-engine', 'parse', 'configparser', 'npyscreen', 'enum34', 'unicorn', 'bitstring', 'pylink-square', ], url='https://github.com/avatartwo/avatar2', description='A Dynamic Multi-Target Orchestration Framework', maintainer='Marius Muench', maintainer_email='marius.muench@eurecom.fr' )
from setuptools import setup from sys import version_info setup( name='avatar2', version='1.3.0', packages=['avatar2', 'avatar2/archs', 'avatar2/targets', 'avatar2/protocols', 'avatar2/peripherals', 'avatar2/plugins', 'avatar2/plugins/arm', 'avatar2/installer' ], install_requires=[ 'pygdbmi>=0.7.3.1', 'intervaltree', 'posix_ipc>=1.0.0', 'capstone>=3.0.4', 'keystone-engine', 'parse', 'configparser', 'npyscreen', 'enum34;python_version<"3.4"', 'unicorn', 'bitstring', 'pylink-square', ], url='https://github.com/avatartwo/avatar2', description='A Dynamic Multi-Target Orchestration Framework', maintainer='Marius Muench', maintainer_email='marius.muench@eurecom.fr' )
Make enum34 dependency conditional on python version
Make enum34 dependency conditional on python version
Python
apache-2.0
avatartwo/avatar2,avatartwo/avatar2
from setuptools import setup from sys import version_info setup( name='avatar2', version='1.3.0', packages=['avatar2', 'avatar2/archs', 'avatar2/targets', 'avatar2/protocols', 'avatar2/peripherals', 'avatar2/plugins', 'avatar2/plugins/arm', 'avatar2/installer' ], install_requires=[ 'pygdbmi>=0.7.3.1', 'intervaltree', 'posix_ipc>=1.0.0', 'capstone>=3.0.4', 'keystone-engine', 'parse', 'configparser', 'npyscreen', 'enum34', 'unicorn', 'bitstring', 'pylink-square', ], url='https://github.com/avatartwo/avatar2', description='A Dynamic Multi-Target Orchestration Framework', maintainer='Marius Muench', maintainer_email='marius.muench@eurecom.fr' ) Make enum34 dependency conditional on python version
from setuptools import setup from sys import version_info setup( name='avatar2', version='1.3.0', packages=['avatar2', 'avatar2/archs', 'avatar2/targets', 'avatar2/protocols', 'avatar2/peripherals', 'avatar2/plugins', 'avatar2/plugins/arm', 'avatar2/installer' ], install_requires=[ 'pygdbmi>=0.7.3.1', 'intervaltree', 'posix_ipc>=1.0.0', 'capstone>=3.0.4', 'keystone-engine', 'parse', 'configparser', 'npyscreen', 'enum34;python_version<"3.4"', 'unicorn', 'bitstring', 'pylink-square', ], url='https://github.com/avatartwo/avatar2', description='A Dynamic Multi-Target Orchestration Framework', maintainer='Marius Muench', maintainer_email='marius.muench@eurecom.fr' )
<commit_before>from setuptools import setup from sys import version_info setup( name='avatar2', version='1.3.0', packages=['avatar2', 'avatar2/archs', 'avatar2/targets', 'avatar2/protocols', 'avatar2/peripherals', 'avatar2/plugins', 'avatar2/plugins/arm', 'avatar2/installer' ], install_requires=[ 'pygdbmi>=0.7.3.1', 'intervaltree', 'posix_ipc>=1.0.0', 'capstone>=3.0.4', 'keystone-engine', 'parse', 'configparser', 'npyscreen', 'enum34', 'unicorn', 'bitstring', 'pylink-square', ], url='https://github.com/avatartwo/avatar2', description='A Dynamic Multi-Target Orchestration Framework', maintainer='Marius Muench', maintainer_email='marius.muench@eurecom.fr' ) <commit_msg>Make enum34 dependency conditional on python version<commit_after>
from setuptools import setup from sys import version_info setup( name='avatar2', version='1.3.0', packages=['avatar2', 'avatar2/archs', 'avatar2/targets', 'avatar2/protocols', 'avatar2/peripherals', 'avatar2/plugins', 'avatar2/plugins/arm', 'avatar2/installer' ], install_requires=[ 'pygdbmi>=0.7.3.1', 'intervaltree', 'posix_ipc>=1.0.0', 'capstone>=3.0.4', 'keystone-engine', 'parse', 'configparser', 'npyscreen', 'enum34;python_version<"3.4"', 'unicorn', 'bitstring', 'pylink-square', ], url='https://github.com/avatartwo/avatar2', description='A Dynamic Multi-Target Orchestration Framework', maintainer='Marius Muench', maintainer_email='marius.muench@eurecom.fr' )
from setuptools import setup from sys import version_info setup( name='avatar2', version='1.3.0', packages=['avatar2', 'avatar2/archs', 'avatar2/targets', 'avatar2/protocols', 'avatar2/peripherals', 'avatar2/plugins', 'avatar2/plugins/arm', 'avatar2/installer' ], install_requires=[ 'pygdbmi>=0.7.3.1', 'intervaltree', 'posix_ipc>=1.0.0', 'capstone>=3.0.4', 'keystone-engine', 'parse', 'configparser', 'npyscreen', 'enum34', 'unicorn', 'bitstring', 'pylink-square', ], url='https://github.com/avatartwo/avatar2', description='A Dynamic Multi-Target Orchestration Framework', maintainer='Marius Muench', maintainer_email='marius.muench@eurecom.fr' ) Make enum34 dependency conditional on python versionfrom setuptools import setup from sys import version_info setup( name='avatar2', version='1.3.0', packages=['avatar2', 'avatar2/archs', 'avatar2/targets', 'avatar2/protocols', 'avatar2/peripherals', 'avatar2/plugins', 'avatar2/plugins/arm', 'avatar2/installer' ], install_requires=[ 'pygdbmi>=0.7.3.1', 'intervaltree', 'posix_ipc>=1.0.0', 'capstone>=3.0.4', 'keystone-engine', 'parse', 'configparser', 'npyscreen', 'enum34;python_version<"3.4"', 'unicorn', 'bitstring', 'pylink-square', ], url='https://github.com/avatartwo/avatar2', description='A Dynamic Multi-Target Orchestration Framework', maintainer='Marius Muench', maintainer_email='marius.muench@eurecom.fr' )
<commit_before>from setuptools import setup from sys import version_info setup( name='avatar2', version='1.3.0', packages=['avatar2', 'avatar2/archs', 'avatar2/targets', 'avatar2/protocols', 'avatar2/peripherals', 'avatar2/plugins', 'avatar2/plugins/arm', 'avatar2/installer' ], install_requires=[ 'pygdbmi>=0.7.3.1', 'intervaltree', 'posix_ipc>=1.0.0', 'capstone>=3.0.4', 'keystone-engine', 'parse', 'configparser', 'npyscreen', 'enum34', 'unicorn', 'bitstring', 'pylink-square', ], url='https://github.com/avatartwo/avatar2', description='A Dynamic Multi-Target Orchestration Framework', maintainer='Marius Muench', maintainer_email='marius.muench@eurecom.fr' ) <commit_msg>Make enum34 dependency conditional on python version<commit_after>from setuptools import setup from sys import version_info setup( name='avatar2', version='1.3.0', packages=['avatar2', 'avatar2/archs', 'avatar2/targets', 'avatar2/protocols', 'avatar2/peripherals', 'avatar2/plugins', 'avatar2/plugins/arm', 'avatar2/installer' ], install_requires=[ 'pygdbmi>=0.7.3.1', 'intervaltree', 'posix_ipc>=1.0.0', 'capstone>=3.0.4', 'keystone-engine', 'parse', 'configparser', 'npyscreen', 'enum34;python_version<"3.4"', 'unicorn', 'bitstring', 'pylink-square', ], url='https://github.com/avatartwo/avatar2', description='A Dynamic Multi-Target Orchestration Framework', maintainer='Marius Muench', maintainer_email='marius.muench@eurecom.fr' )
9424a3385f1330cffbf9fa084e58ef107f73a4b8
setup.py
setup.py
from setuptools import setup setup( name='timeflow', packages=['timeflow'], version='0.1', description='Small CLI time logger', author='Justas Trimailovas', author_email='j.trimailvoas@gmail.com', url='https://github.com/trimailov/timeflow', keywords=['timelogger', 'logging', 'timetracker', 'tracker'], py_modules=['timeflow'], entry_points=''' [console_scripts] timeflow=timeflow.main:main tf=timeflow.main:main ''', )
import os from setuptools import setup # Utility function to read the README file. # Used for the long_description. It's nice, because now 1) we have a top level # README file and 2) it's easier to type in the README file than to put a raw # string in below ... def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name='timeflow', packages=['timeflow'], version='0.1', description='Small CLI time logger', author='Justas Trimailovas', author_email='j.trimailvoas@gmail.com', url='https://github.com/trimailov/timeflow', keywords=['timelogger', 'logging', 'timetracker', 'tracker'], long_description=read('README.rst'), py_modules=['timeflow'], entry_points=''' [console_scripts] timeflow=timeflow.main:main tf=timeflow.main:main ''', )
Add long description from README.rst
Add long description from README.rst
Python
mit
trimailov/timeflow
from setuptools import setup setup( name='timeflow', packages=['timeflow'], version='0.1', description='Small CLI time logger', author='Justas Trimailovas', author_email='j.trimailvoas@gmail.com', url='https://github.com/trimailov/timeflow', keywords=['timelogger', 'logging', 'timetracker', 'tracker'], py_modules=['timeflow'], entry_points=''' [console_scripts] timeflow=timeflow.main:main tf=timeflow.main:main ''', ) Add long description from README.rst
import os from setuptools import setup # Utility function to read the README file. # Used for the long_description. It's nice, because now 1) we have a top level # README file and 2) it's easier to type in the README file than to put a raw # string in below ... def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name='timeflow', packages=['timeflow'], version='0.1', description='Small CLI time logger', author='Justas Trimailovas', author_email='j.trimailvoas@gmail.com', url='https://github.com/trimailov/timeflow', keywords=['timelogger', 'logging', 'timetracker', 'tracker'], long_description=read('README.rst'), py_modules=['timeflow'], entry_points=''' [console_scripts] timeflow=timeflow.main:main tf=timeflow.main:main ''', )
<commit_before>from setuptools import setup setup( name='timeflow', packages=['timeflow'], version='0.1', description='Small CLI time logger', author='Justas Trimailovas', author_email='j.trimailvoas@gmail.com', url='https://github.com/trimailov/timeflow', keywords=['timelogger', 'logging', 'timetracker', 'tracker'], py_modules=['timeflow'], entry_points=''' [console_scripts] timeflow=timeflow.main:main tf=timeflow.main:main ''', ) <commit_msg>Add long description from README.rst<commit_after>
import os from setuptools import setup # Utility function to read the README file. # Used for the long_description. It's nice, because now 1) we have a top level # README file and 2) it's easier to type in the README file than to put a raw # string in below ... def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name='timeflow', packages=['timeflow'], version='0.1', description='Small CLI time logger', author='Justas Trimailovas', author_email='j.trimailvoas@gmail.com', url='https://github.com/trimailov/timeflow', keywords=['timelogger', 'logging', 'timetracker', 'tracker'], long_description=read('README.rst'), py_modules=['timeflow'], entry_points=''' [console_scripts] timeflow=timeflow.main:main tf=timeflow.main:main ''', )
from setuptools import setup setup( name='timeflow', packages=['timeflow'], version='0.1', description='Small CLI time logger', author='Justas Trimailovas', author_email='j.trimailvoas@gmail.com', url='https://github.com/trimailov/timeflow', keywords=['timelogger', 'logging', 'timetracker', 'tracker'], py_modules=['timeflow'], entry_points=''' [console_scripts] timeflow=timeflow.main:main tf=timeflow.main:main ''', ) Add long description from README.rstimport os from setuptools import setup # Utility function to read the README file. # Used for the long_description. It's nice, because now 1) we have a top level # README file and 2) it's easier to type in the README file than to put a raw # string in below ... def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name='timeflow', packages=['timeflow'], version='0.1', description='Small CLI time logger', author='Justas Trimailovas', author_email='j.trimailvoas@gmail.com', url='https://github.com/trimailov/timeflow', keywords=['timelogger', 'logging', 'timetracker', 'tracker'], long_description=read('README.rst'), py_modules=['timeflow'], entry_points=''' [console_scripts] timeflow=timeflow.main:main tf=timeflow.main:main ''', )
<commit_before>from setuptools import setup setup( name='timeflow', packages=['timeflow'], version='0.1', description='Small CLI time logger', author='Justas Trimailovas', author_email='j.trimailvoas@gmail.com', url='https://github.com/trimailov/timeflow', keywords=['timelogger', 'logging', 'timetracker', 'tracker'], py_modules=['timeflow'], entry_points=''' [console_scripts] timeflow=timeflow.main:main tf=timeflow.main:main ''', ) <commit_msg>Add long description from README.rst<commit_after>import os from setuptools import setup # Utility function to read the README file. # Used for the long_description. It's nice, because now 1) we have a top level # README file and 2) it's easier to type in the README file than to put a raw # string in below ... def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name='timeflow', packages=['timeflow'], version='0.1', description='Small CLI time logger', author='Justas Trimailovas', author_email='j.trimailvoas@gmail.com', url='https://github.com/trimailov/timeflow', keywords=['timelogger', 'logging', 'timetracker', 'tracker'], long_description=read('README.rst'), py_modules=['timeflow'], entry_points=''' [console_scripts] timeflow=timeflow.main:main tf=timeflow.main:main ''', )
2dfd4021a705811cb1047914318a727aef4ac5ac
setup.py
setup.py
# # setup.py # # Copyright (c) 2013 Luis Garcia. # This source file is subject to terms of the MIT License. (See file LICENSE) # """Setup script for the scope library.""" from distutils.core import setup NAME = 'scope' VERSION = '0.1.1' DESCRIPTION = 'Template library for multi-language code generation' AUTHOR = 'Luis Garcia' AUTHOR_EMAIL = 'lgarcia@codespot.in' URL = 'https://github.com/lrgar/scope' CLASSIFIERS = [ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: C++', 'Programming Language :: Python', 'Topic :: Software Development :: Code Generators', 'Topic :: Software Development :: Libraries' ] LICENSE = 'MIT' setup( name=NAME, version=VERSION, description=DESCRIPTION, author=AUTHOR, author_email=AUTHOR_EMAIL, url=URL, packages=['scope', 'scope.lang'], license=LICENSE, classifiers=CLASSIFIERS )
# # setup.py # # Copyright (c) 2013 Luis Garcia. # This source file is subject to terms of the MIT License. (See file LICENSE) # """Setup script for the scope library.""" from distutils.core import setup NAME = 'scope' VERSION = '0.1.1' DESCRIPTION = 'Template library for multi-language code generation' AUTHOR = 'Luis Garcia' AUTHOR_EMAIL = 'lgarcia@codespot.in' URL = 'https://github.com/lrgar/scope' CLASSIFIERS = [ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: C++', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3', 'Topic :: Software Development :: Code Generators', 'Topic :: Software Development :: Libraries' ] LICENSE = 'MIT' setup( name=NAME, version=VERSION, description=DESCRIPTION, author=AUTHOR, author_email=AUTHOR_EMAIL, url=URL, packages=['scope', 'scope.lang'], license=LICENSE, classifiers=CLASSIFIERS )
Add classifiers for Python 2 and 3
Add classifiers for Python 2 and 3
Python
mit
lrgar/scope
# # setup.py # # Copyright (c) 2013 Luis Garcia. # This source file is subject to terms of the MIT License. (See file LICENSE) # """Setup script for the scope library.""" from distutils.core import setup NAME = 'scope' VERSION = '0.1.1' DESCRIPTION = 'Template library for multi-language code generation' AUTHOR = 'Luis Garcia' AUTHOR_EMAIL = 'lgarcia@codespot.in' URL = 'https://github.com/lrgar/scope' CLASSIFIERS = [ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: C++', 'Programming Language :: Python', 'Topic :: Software Development :: Code Generators', 'Topic :: Software Development :: Libraries' ] LICENSE = 'MIT' setup( name=NAME, version=VERSION, description=DESCRIPTION, author=AUTHOR, author_email=AUTHOR_EMAIL, url=URL, packages=['scope', 'scope.lang'], license=LICENSE, classifiers=CLASSIFIERS ) Add classifiers for Python 2 and 3
# # setup.py # # Copyright (c) 2013 Luis Garcia. # This source file is subject to terms of the MIT License. (See file LICENSE) # """Setup script for the scope library.""" from distutils.core import setup NAME = 'scope' VERSION = '0.1.1' DESCRIPTION = 'Template library for multi-language code generation' AUTHOR = 'Luis Garcia' AUTHOR_EMAIL = 'lgarcia@codespot.in' URL = 'https://github.com/lrgar/scope' CLASSIFIERS = [ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: C++', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3', 'Topic :: Software Development :: Code Generators', 'Topic :: Software Development :: Libraries' ] LICENSE = 'MIT' setup( name=NAME, version=VERSION, description=DESCRIPTION, author=AUTHOR, author_email=AUTHOR_EMAIL, url=URL, packages=['scope', 'scope.lang'], license=LICENSE, classifiers=CLASSIFIERS )
<commit_before># # setup.py # # Copyright (c) 2013 Luis Garcia. # This source file is subject to terms of the MIT License. (See file LICENSE) # """Setup script for the scope library.""" from distutils.core import setup NAME = 'scope' VERSION = '0.1.1' DESCRIPTION = 'Template library for multi-language code generation' AUTHOR = 'Luis Garcia' AUTHOR_EMAIL = 'lgarcia@codespot.in' URL = 'https://github.com/lrgar/scope' CLASSIFIERS = [ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: C++', 'Programming Language :: Python', 'Topic :: Software Development :: Code Generators', 'Topic :: Software Development :: Libraries' ] LICENSE = 'MIT' setup( name=NAME, version=VERSION, description=DESCRIPTION, author=AUTHOR, author_email=AUTHOR_EMAIL, url=URL, packages=['scope', 'scope.lang'], license=LICENSE, classifiers=CLASSIFIERS ) <commit_msg>Add classifiers for Python 2 and 3<commit_after>
# # setup.py # # Copyright (c) 2013 Luis Garcia. # This source file is subject to terms of the MIT License. (See file LICENSE) # """Setup script for the scope library.""" from distutils.core import setup NAME = 'scope' VERSION = '0.1.1' DESCRIPTION = 'Template library for multi-language code generation' AUTHOR = 'Luis Garcia' AUTHOR_EMAIL = 'lgarcia@codespot.in' URL = 'https://github.com/lrgar/scope' CLASSIFIERS = [ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: C++', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3', 'Topic :: Software Development :: Code Generators', 'Topic :: Software Development :: Libraries' ] LICENSE = 'MIT' setup( name=NAME, version=VERSION, description=DESCRIPTION, author=AUTHOR, author_email=AUTHOR_EMAIL, url=URL, packages=['scope', 'scope.lang'], license=LICENSE, classifiers=CLASSIFIERS )
# # setup.py # # Copyright (c) 2013 Luis Garcia. # This source file is subject to terms of the MIT License. (See file LICENSE) # """Setup script for the scope library.""" from distutils.core import setup NAME = 'scope' VERSION = '0.1.1' DESCRIPTION = 'Template library for multi-language code generation' AUTHOR = 'Luis Garcia' AUTHOR_EMAIL = 'lgarcia@codespot.in' URL = 'https://github.com/lrgar/scope' CLASSIFIERS = [ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: C++', 'Programming Language :: Python', 'Topic :: Software Development :: Code Generators', 'Topic :: Software Development :: Libraries' ] LICENSE = 'MIT' setup( name=NAME, version=VERSION, description=DESCRIPTION, author=AUTHOR, author_email=AUTHOR_EMAIL, url=URL, packages=['scope', 'scope.lang'], license=LICENSE, classifiers=CLASSIFIERS ) Add classifiers for Python 2 and 3# # setup.py # # Copyright (c) 2013 Luis Garcia. # This source file is subject to terms of the MIT License. (See file LICENSE) # """Setup script for the scope library.""" from distutils.core import setup NAME = 'scope' VERSION = '0.1.1' DESCRIPTION = 'Template library for multi-language code generation' AUTHOR = 'Luis Garcia' AUTHOR_EMAIL = 'lgarcia@codespot.in' URL = 'https://github.com/lrgar/scope' CLASSIFIERS = [ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: C++', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3', 'Topic :: Software Development :: Code Generators', 'Topic :: Software Development :: Libraries' ] LICENSE = 'MIT' setup( name=NAME, version=VERSION, description=DESCRIPTION, author=AUTHOR, author_email=AUTHOR_EMAIL, url=URL, packages=['scope', 'scope.lang'], license=LICENSE, classifiers=CLASSIFIERS )
<commit_before># # setup.py # # Copyright (c) 2013 Luis Garcia. # This source file is subject to terms of the MIT License. (See file LICENSE) # """Setup script for the scope library.""" from distutils.core import setup NAME = 'scope' VERSION = '0.1.1' DESCRIPTION = 'Template library for multi-language code generation' AUTHOR = 'Luis Garcia' AUTHOR_EMAIL = 'lgarcia@codespot.in' URL = 'https://github.com/lrgar/scope' CLASSIFIERS = [ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: C++', 'Programming Language :: Python', 'Topic :: Software Development :: Code Generators', 'Topic :: Software Development :: Libraries' ] LICENSE = 'MIT' setup( name=NAME, version=VERSION, description=DESCRIPTION, author=AUTHOR, author_email=AUTHOR_EMAIL, url=URL, packages=['scope', 'scope.lang'], license=LICENSE, classifiers=CLASSIFIERS ) <commit_msg>Add classifiers for Python 2 and 3<commit_after># # setup.py # # Copyright (c) 2013 Luis Garcia. # This source file is subject to terms of the MIT License. (See file LICENSE) # """Setup script for the scope library.""" from distutils.core import setup NAME = 'scope' VERSION = '0.1.1' DESCRIPTION = 'Template library for multi-language code generation' AUTHOR = 'Luis Garcia' AUTHOR_EMAIL = 'lgarcia@codespot.in' URL = 'https://github.com/lrgar/scope' CLASSIFIERS = [ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: C++', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3', 'Topic :: Software Development :: Code Generators', 'Topic :: Software Development :: Libraries' ] LICENSE = 'MIT' setup( name=NAME, version=VERSION, description=DESCRIPTION, author=AUTHOR, author_email=AUTHOR_EMAIL, url=URL, packages=['scope', 'scope.lang'], license=LICENSE, classifiers=CLASSIFIERS )
93754f12f86f7c083fec2e0b187533add206f4c9
setup.py
setup.py
import codecs from setuptools import find_packages, setup import digestive setup( name='digestive', version=digestive.__version__, url='https://github.com/akaIDIOT/Digestive', packages=find_packages(), description='Run several digest algorithms on the same data efficiently', author='Mattijs Ugen', author_email=codecs.encode('nxnvqvbg@hfref.abercyl.tvguho.pbz', 'rot_13'), license='ISC', classifiers=[ 'Development Status :: 3 - Alpha', 'Environment :: Console', 'License :: OSI Approved :: ISC License (ISCL)', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', ], install_requires=['decorator'], tests_require=['pytest', 'mock'], entry_points={ 'console_scripts': { 'digestive = digestive.main:main' } } )
import codecs from setuptools import find_packages, setup import digestive requires = ['decorator'] setup( name='digestive', version=digestive.__version__, url='https://github.com/akaIDIOT/Digestive', packages=find_packages(), description='Run several digest algorithms on the same data efficiently', author='Mattijs Ugen', author_email=codecs.encode('nxnvqvbg@hfref.abercyl.tvguho.pbz', 'rot_13'), license='ISC', classifiers=[ 'Development Status :: 3 - Alpha', 'Environment :: Console', 'License :: OSI Approved :: ISC License (ISCL)', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', ], install_requires=requires, tests_require=requires + ['pytest', 'mock', 'decorator'], entry_points={ 'console_scripts': { 'digestive = digestive.main:main' } } )
Include decorator requirement for tests as well
Include decorator requirement for tests as well One would think setup.py would include runtime deps with test deps, but no... References #6
Python
isc
akaIDIOT/Digestive
import codecs from setuptools import find_packages, setup import digestive setup( name='digestive', version=digestive.__version__, url='https://github.com/akaIDIOT/Digestive', packages=find_packages(), description='Run several digest algorithms on the same data efficiently', author='Mattijs Ugen', author_email=codecs.encode('nxnvqvbg@hfref.abercyl.tvguho.pbz', 'rot_13'), license='ISC', classifiers=[ 'Development Status :: 3 - Alpha', 'Environment :: Console', 'License :: OSI Approved :: ISC License (ISCL)', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', ], install_requires=['decorator'], tests_require=['pytest', 'mock'], entry_points={ 'console_scripts': { 'digestive = digestive.main:main' } } ) Include decorator requirement for tests as well One would think setup.py would include runtime deps with test deps, but no... References #6
import codecs from setuptools import find_packages, setup import digestive requires = ['decorator'] setup( name='digestive', version=digestive.__version__, url='https://github.com/akaIDIOT/Digestive', packages=find_packages(), description='Run several digest algorithms on the same data efficiently', author='Mattijs Ugen', author_email=codecs.encode('nxnvqvbg@hfref.abercyl.tvguho.pbz', 'rot_13'), license='ISC', classifiers=[ 'Development Status :: 3 - Alpha', 'Environment :: Console', 'License :: OSI Approved :: ISC License (ISCL)', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', ], install_requires=requires, tests_require=requires + ['pytest', 'mock', 'decorator'], entry_points={ 'console_scripts': { 'digestive = digestive.main:main' } } )
<commit_before>import codecs from setuptools import find_packages, setup import digestive setup( name='digestive', version=digestive.__version__, url='https://github.com/akaIDIOT/Digestive', packages=find_packages(), description='Run several digest algorithms on the same data efficiently', author='Mattijs Ugen', author_email=codecs.encode('nxnvqvbg@hfref.abercyl.tvguho.pbz', 'rot_13'), license='ISC', classifiers=[ 'Development Status :: 3 - Alpha', 'Environment :: Console', 'License :: OSI Approved :: ISC License (ISCL)', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', ], install_requires=['decorator'], tests_require=['pytest', 'mock'], entry_points={ 'console_scripts': { 'digestive = digestive.main:main' } } ) <commit_msg>Include decorator requirement for tests as well One would think setup.py would include runtime deps with test deps, but no... References #6<commit_after>
import codecs from setuptools import find_packages, setup import digestive requires = ['decorator'] setup( name='digestive', version=digestive.__version__, url='https://github.com/akaIDIOT/Digestive', packages=find_packages(), description='Run several digest algorithms on the same data efficiently', author='Mattijs Ugen', author_email=codecs.encode('nxnvqvbg@hfref.abercyl.tvguho.pbz', 'rot_13'), license='ISC', classifiers=[ 'Development Status :: 3 - Alpha', 'Environment :: Console', 'License :: OSI Approved :: ISC License (ISCL)', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', ], install_requires=requires, tests_require=requires + ['pytest', 'mock', 'decorator'], entry_points={ 'console_scripts': { 'digestive = digestive.main:main' } } )
import codecs from setuptools import find_packages, setup import digestive setup( name='digestive', version=digestive.__version__, url='https://github.com/akaIDIOT/Digestive', packages=find_packages(), description='Run several digest algorithms on the same data efficiently', author='Mattijs Ugen', author_email=codecs.encode('nxnvqvbg@hfref.abercyl.tvguho.pbz', 'rot_13'), license='ISC', classifiers=[ 'Development Status :: 3 - Alpha', 'Environment :: Console', 'License :: OSI Approved :: ISC License (ISCL)', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', ], install_requires=['decorator'], tests_require=['pytest', 'mock'], entry_points={ 'console_scripts': { 'digestive = digestive.main:main' } } ) Include decorator requirement for tests as well One would think setup.py would include runtime deps with test deps, but no... References #6import codecs from setuptools import find_packages, setup import digestive requires = ['decorator'] setup( name='digestive', version=digestive.__version__, url='https://github.com/akaIDIOT/Digestive', packages=find_packages(), description='Run several digest algorithms on the same data efficiently', author='Mattijs Ugen', author_email=codecs.encode('nxnvqvbg@hfref.abercyl.tvguho.pbz', 'rot_13'), license='ISC', classifiers=[ 'Development Status :: 3 - Alpha', 'Environment :: Console', 'License :: OSI Approved :: ISC License (ISCL)', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', ], install_requires=requires, tests_require=requires + ['pytest', 'mock', 'decorator'], entry_points={ 'console_scripts': { 'digestive = digestive.main:main' } } )
<commit_before>import codecs from setuptools import find_packages, setup import digestive setup( name='digestive', version=digestive.__version__, url='https://github.com/akaIDIOT/Digestive', packages=find_packages(), description='Run several digest algorithms on the same data efficiently', author='Mattijs Ugen', author_email=codecs.encode('nxnvqvbg@hfref.abercyl.tvguho.pbz', 'rot_13'), license='ISC', classifiers=[ 'Development Status :: 3 - Alpha', 'Environment :: Console', 'License :: OSI Approved :: ISC License (ISCL)', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', ], install_requires=['decorator'], tests_require=['pytest', 'mock'], entry_points={ 'console_scripts': { 'digestive = digestive.main:main' } } ) <commit_msg>Include decorator requirement for tests as well One would think setup.py would include runtime deps with test deps, but no... References #6<commit_after>import codecs from setuptools import find_packages, setup import digestive requires = ['decorator'] setup( name='digestive', version=digestive.__version__, url='https://github.com/akaIDIOT/Digestive', packages=find_packages(), description='Run several digest algorithms on the same data efficiently', author='Mattijs Ugen', author_email=codecs.encode('nxnvqvbg@hfref.abercyl.tvguho.pbz', 'rot_13'), license='ISC', classifiers=[ 'Development Status :: 3 - Alpha', 'Environment :: Console', 'License :: OSI Approved :: ISC License (ISCL)', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', ], install_requires=requires, tests_require=requires + ['pytest', 'mock', 'decorator'], entry_points={ 'console_scripts': { 'digestive = digestive.main:main' } } )
41021030afe45c61d8551128515d7d17ebdd09b8
setup.py
setup.py
import sys from setuptools import find_packages, setup with open('VERSION') as version_fp: VERSION = version_fp.read().strip() install_requires = [ 'django-local-settings>=1.0a13', 'stashward', ] if sys.version_info[:2] < (3, 4): install_requires.append('enum34') setup( name='django-arcutils', version=VERSION, url='https://github.com/PSU-OIT-ARC/django-arcutils', author='PSU - OIT - ARC', author_email='consultants@pdx.edu', description='Common utilities used in ARC Django projects', packages=find_packages(), include_package_data=True, zip_safe=False, install_requires=install_requires, extras_require={ 'ldap': [ 'certifi>=2015.11.20.1', 'ldap3>=1.0.3', ], 'dev': [ 'django>=1.7,<1.9', 'djangorestframework>3.3', 'flake8', 'ldap3', ], }, entry_points=""" [console_scripts] arcutils = arcutils.__main__:main """, classifiers=[ 'Development Status :: 3 - Alpha', 'Framework :: Django', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', ], )
import sys from setuptools import find_packages, setup with open('VERSION') as version_fp: VERSION = version_fp.read().strip() install_requires = [ 'django-local-settings>=1.0a13', 'stashward', ] if sys.version_info[:2] < (3, 4): install_requires.append('enum34') setup( name='django-arcutils', version=VERSION, url='https://github.com/PSU-OIT-ARC/django-arcutils', author='PSU - OIT - ARC', author_email='consultants@pdx.edu', description='Common utilities used in ARC Django projects', packages=find_packages(), include_package_data=True, zip_safe=False, install_requires=install_requires, extras_require={ 'ldap': [ 'certifi>=2015.11.20.1', 'ldap3>=1.0.4', ], 'dev': [ 'django>=1.7,<1.9', 'djangorestframework>3.3', 'flake8', 'ldap3', ], }, entry_points=""" [console_scripts] arcutils = arcutils.__main__:main """, classifiers=[ 'Development Status :: 3 - Alpha', 'Framework :: Django', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', ], )
Update ldap3 1.0.3 => 1.0.4
Update ldap3 1.0.3 => 1.0.4
Python
mit
wylee/django-arcutils,PSU-OIT-ARC/django-arcutils,wylee/django-arcutils,PSU-OIT-ARC/django-arcutils
import sys from setuptools import find_packages, setup with open('VERSION') as version_fp: VERSION = version_fp.read().strip() install_requires = [ 'django-local-settings>=1.0a13', 'stashward', ] if sys.version_info[:2] < (3, 4): install_requires.append('enum34') setup( name='django-arcutils', version=VERSION, url='https://github.com/PSU-OIT-ARC/django-arcutils', author='PSU - OIT - ARC', author_email='consultants@pdx.edu', description='Common utilities used in ARC Django projects', packages=find_packages(), include_package_data=True, zip_safe=False, install_requires=install_requires, extras_require={ 'ldap': [ 'certifi>=2015.11.20.1', 'ldap3>=1.0.3', ], 'dev': [ 'django>=1.7,<1.9', 'djangorestframework>3.3', 'flake8', 'ldap3', ], }, entry_points=""" [console_scripts] arcutils = arcutils.__main__:main """, classifiers=[ 'Development Status :: 3 - Alpha', 'Framework :: Django', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', ], ) Update ldap3 1.0.3 => 1.0.4
import sys from setuptools import find_packages, setup with open('VERSION') as version_fp: VERSION = version_fp.read().strip() install_requires = [ 'django-local-settings>=1.0a13', 'stashward', ] if sys.version_info[:2] < (3, 4): install_requires.append('enum34') setup( name='django-arcutils', version=VERSION, url='https://github.com/PSU-OIT-ARC/django-arcutils', author='PSU - OIT - ARC', author_email='consultants@pdx.edu', description='Common utilities used in ARC Django projects', packages=find_packages(), include_package_data=True, zip_safe=False, install_requires=install_requires, extras_require={ 'ldap': [ 'certifi>=2015.11.20.1', 'ldap3>=1.0.4', ], 'dev': [ 'django>=1.7,<1.9', 'djangorestframework>3.3', 'flake8', 'ldap3', ], }, entry_points=""" [console_scripts] arcutils = arcutils.__main__:main """, classifiers=[ 'Development Status :: 3 - Alpha', 'Framework :: Django', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', ], )
<commit_before>import sys from setuptools import find_packages, setup with open('VERSION') as version_fp: VERSION = version_fp.read().strip() install_requires = [ 'django-local-settings>=1.0a13', 'stashward', ] if sys.version_info[:2] < (3, 4): install_requires.append('enum34') setup( name='django-arcutils', version=VERSION, url='https://github.com/PSU-OIT-ARC/django-arcutils', author='PSU - OIT - ARC', author_email='consultants@pdx.edu', description='Common utilities used in ARC Django projects', packages=find_packages(), include_package_data=True, zip_safe=False, install_requires=install_requires, extras_require={ 'ldap': [ 'certifi>=2015.11.20.1', 'ldap3>=1.0.3', ], 'dev': [ 'django>=1.7,<1.9', 'djangorestframework>3.3', 'flake8', 'ldap3', ], }, entry_points=""" [console_scripts] arcutils = arcutils.__main__:main """, classifiers=[ 'Development Status :: 3 - Alpha', 'Framework :: Django', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', ], ) <commit_msg>Update ldap3 1.0.3 => 1.0.4<commit_after>
import sys from setuptools import find_packages, setup with open('VERSION') as version_fp: VERSION = version_fp.read().strip() install_requires = [ 'django-local-settings>=1.0a13', 'stashward', ] if sys.version_info[:2] < (3, 4): install_requires.append('enum34') setup( name='django-arcutils', version=VERSION, url='https://github.com/PSU-OIT-ARC/django-arcutils', author='PSU - OIT - ARC', author_email='consultants@pdx.edu', description='Common utilities used in ARC Django projects', packages=find_packages(), include_package_data=True, zip_safe=False, install_requires=install_requires, extras_require={ 'ldap': [ 'certifi>=2015.11.20.1', 'ldap3>=1.0.4', ], 'dev': [ 'django>=1.7,<1.9', 'djangorestframework>3.3', 'flake8', 'ldap3', ], }, entry_points=""" [console_scripts] arcutils = arcutils.__main__:main """, classifiers=[ 'Development Status :: 3 - Alpha', 'Framework :: Django', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', ], )
import sys from setuptools import find_packages, setup with open('VERSION') as version_fp: VERSION = version_fp.read().strip() install_requires = [ 'django-local-settings>=1.0a13', 'stashward', ] if sys.version_info[:2] < (3, 4): install_requires.append('enum34') setup( name='django-arcutils', version=VERSION, url='https://github.com/PSU-OIT-ARC/django-arcutils', author='PSU - OIT - ARC', author_email='consultants@pdx.edu', description='Common utilities used in ARC Django projects', packages=find_packages(), include_package_data=True, zip_safe=False, install_requires=install_requires, extras_require={ 'ldap': [ 'certifi>=2015.11.20.1', 'ldap3>=1.0.3', ], 'dev': [ 'django>=1.7,<1.9', 'djangorestframework>3.3', 'flake8', 'ldap3', ], }, entry_points=""" [console_scripts] arcutils = arcutils.__main__:main """, classifiers=[ 'Development Status :: 3 - Alpha', 'Framework :: Django', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', ], ) Update ldap3 1.0.3 => 1.0.4import sys from setuptools import find_packages, setup with open('VERSION') as version_fp: VERSION = version_fp.read().strip() install_requires = [ 'django-local-settings>=1.0a13', 'stashward', ] if sys.version_info[:2] < (3, 4): install_requires.append('enum34') setup( name='django-arcutils', version=VERSION, url='https://github.com/PSU-OIT-ARC/django-arcutils', author='PSU - OIT - ARC', author_email='consultants@pdx.edu', description='Common utilities used in ARC Django projects', packages=find_packages(), include_package_data=True, zip_safe=False, install_requires=install_requires, extras_require={ 'ldap': [ 'certifi>=2015.11.20.1', 'ldap3>=1.0.4', ], 'dev': [ 'django>=1.7,<1.9', 'djangorestframework>3.3', 'flake8', 'ldap3', ], }, entry_points=""" [console_scripts] arcutils = arcutils.__main__:main """, classifiers=[ 'Development Status :: 3 - Alpha', 'Framework :: Django', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', ], )
<commit_before>import sys from setuptools import find_packages, setup with open('VERSION') as version_fp: VERSION = version_fp.read().strip() install_requires = [ 'django-local-settings>=1.0a13', 'stashward', ] if sys.version_info[:2] < (3, 4): install_requires.append('enum34') setup( name='django-arcutils', version=VERSION, url='https://github.com/PSU-OIT-ARC/django-arcutils', author='PSU - OIT - ARC', author_email='consultants@pdx.edu', description='Common utilities used in ARC Django projects', packages=find_packages(), include_package_data=True, zip_safe=False, install_requires=install_requires, extras_require={ 'ldap': [ 'certifi>=2015.11.20.1', 'ldap3>=1.0.3', ], 'dev': [ 'django>=1.7,<1.9', 'djangorestframework>3.3', 'flake8', 'ldap3', ], }, entry_points=""" [console_scripts] arcutils = arcutils.__main__:main """, classifiers=[ 'Development Status :: 3 - Alpha', 'Framework :: Django', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', ], ) <commit_msg>Update ldap3 1.0.3 => 1.0.4<commit_after>import sys from setuptools import find_packages, setup with open('VERSION') as version_fp: VERSION = version_fp.read().strip() install_requires = [ 'django-local-settings>=1.0a13', 'stashward', ] if sys.version_info[:2] < (3, 4): install_requires.append('enum34') setup( name='django-arcutils', version=VERSION, url='https://github.com/PSU-OIT-ARC/django-arcutils', author='PSU - OIT - ARC', author_email='consultants@pdx.edu', description='Common utilities used in ARC Django projects', packages=find_packages(), include_package_data=True, zip_safe=False, install_requires=install_requires, extras_require={ 'ldap': [ 'certifi>=2015.11.20.1', 'ldap3>=1.0.4', ], 'dev': [ 'django>=1.7,<1.9', 'djangorestframework>3.3', 'flake8', 'ldap3', ], }, entry_points=""" [console_scripts] arcutils = arcutils.__main__:main """, classifiers=[ 'Development Status :: 3 - Alpha', 'Framework :: Django', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', ], )
82905bbbd7077d201363b96ffbbc78c099095764
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup setup( name='Rubra', version='0.1.5', author='Bernie Pope', author_email='bjpope@unimelb.edu.au', packages=['rubra'], package_data={'rubra': ['examples/*.py']}, entry_points={ 'console_scripts': ['rubra = rubra.rubra:main'] }, url='https://github.com/bjpop/rubra', license='LICENSE.txt', description='Rubra is a pipeline system for bioinformatics workflows\ with support for running pipeline stages on a distributed compute cluster.', long_description=open('README.txt').read(), install_requires=[ "ruffus >= 2.0.0", ], classifiers=[ 'Development Status :: 4 - Beta', 'License :: OSI Approved :: MIT', 'Operating System :: POSIX', 'Programming Language :: Python', ], )
#!/usr/bin/env python from setuptools import setup setup( name='Rubra', version='0.1.5', author='Bernie Pope', author_email='bjpope@unimelb.edu.au', packages=['rubra'], package_data={'rubra': ['examples/*.py']}, entry_points={ 'console_scripts': ['rubra = rubra.rubra:main'] }, url='https://github.com/bjpop/rubra', license='LICENSE.txt', description='Rubra is a pipeline system for bioinformatics workflows\ with support for running pipeline stages on a distributed compute cluster.', long_description=open('README.txt').read(), install_requires=[ "ruffus==2.2", ], classifiers=[ 'Development Status :: 4 - Beta', 'License :: OSI Approved :: MIT', 'Operating System :: POSIX', 'Programming Language :: Python', ], )
Fix the version dependency on ruffus to 2.2, rather than >= 2.0.0
Fix the version dependency on ruffus to 2.2, rather than >= 2.0.0
Python
mit
magosil86/rubra,bjpop/rubra
#!/usr/bin/env python from setuptools import setup setup( name='Rubra', version='0.1.5', author='Bernie Pope', author_email='bjpope@unimelb.edu.au', packages=['rubra'], package_data={'rubra': ['examples/*.py']}, entry_points={ 'console_scripts': ['rubra = rubra.rubra:main'] }, url='https://github.com/bjpop/rubra', license='LICENSE.txt', description='Rubra is a pipeline system for bioinformatics workflows\ with support for running pipeline stages on a distributed compute cluster.', long_description=open('README.txt').read(), install_requires=[ "ruffus >= 2.0.0", ], classifiers=[ 'Development Status :: 4 - Beta', 'License :: OSI Approved :: MIT', 'Operating System :: POSIX', 'Programming Language :: Python', ], ) Fix the version dependency on ruffus to 2.2, rather than >= 2.0.0
#!/usr/bin/env python from setuptools import setup setup( name='Rubra', version='0.1.5', author='Bernie Pope', author_email='bjpope@unimelb.edu.au', packages=['rubra'], package_data={'rubra': ['examples/*.py']}, entry_points={ 'console_scripts': ['rubra = rubra.rubra:main'] }, url='https://github.com/bjpop/rubra', license='LICENSE.txt', description='Rubra is a pipeline system for bioinformatics workflows\ with support for running pipeline stages on a distributed compute cluster.', long_description=open('README.txt').read(), install_requires=[ "ruffus==2.2", ], classifiers=[ 'Development Status :: 4 - Beta', 'License :: OSI Approved :: MIT', 'Operating System :: POSIX', 'Programming Language :: Python', ], )
<commit_before>#!/usr/bin/env python from setuptools import setup setup( name='Rubra', version='0.1.5', author='Bernie Pope', author_email='bjpope@unimelb.edu.au', packages=['rubra'], package_data={'rubra': ['examples/*.py']}, entry_points={ 'console_scripts': ['rubra = rubra.rubra:main'] }, url='https://github.com/bjpop/rubra', license='LICENSE.txt', description='Rubra is a pipeline system for bioinformatics workflows\ with support for running pipeline stages on a distributed compute cluster.', long_description=open('README.txt').read(), install_requires=[ "ruffus >= 2.0.0", ], classifiers=[ 'Development Status :: 4 - Beta', 'License :: OSI Approved :: MIT', 'Operating System :: POSIX', 'Programming Language :: Python', ], ) <commit_msg>Fix the version dependency on ruffus to 2.2, rather than >= 2.0.0<commit_after>
#!/usr/bin/env python from setuptools import setup setup( name='Rubra', version='0.1.5', author='Bernie Pope', author_email='bjpope@unimelb.edu.au', packages=['rubra'], package_data={'rubra': ['examples/*.py']}, entry_points={ 'console_scripts': ['rubra = rubra.rubra:main'] }, url='https://github.com/bjpop/rubra', license='LICENSE.txt', description='Rubra is a pipeline system for bioinformatics workflows\ with support for running pipeline stages on a distributed compute cluster.', long_description=open('README.txt').read(), install_requires=[ "ruffus==2.2", ], classifiers=[ 'Development Status :: 4 - Beta', 'License :: OSI Approved :: MIT', 'Operating System :: POSIX', 'Programming Language :: Python', ], )
#!/usr/bin/env python from setuptools import setup setup( name='Rubra', version='0.1.5', author='Bernie Pope', author_email='bjpope@unimelb.edu.au', packages=['rubra'], package_data={'rubra': ['examples/*.py']}, entry_points={ 'console_scripts': ['rubra = rubra.rubra:main'] }, url='https://github.com/bjpop/rubra', license='LICENSE.txt', description='Rubra is a pipeline system for bioinformatics workflows\ with support for running pipeline stages on a distributed compute cluster.', long_description=open('README.txt').read(), install_requires=[ "ruffus >= 2.0.0", ], classifiers=[ 'Development Status :: 4 - Beta', 'License :: OSI Approved :: MIT', 'Operating System :: POSIX', 'Programming Language :: Python', ], ) Fix the version dependency on ruffus to 2.2, rather than >= 2.0.0#!/usr/bin/env python from setuptools import setup setup( name='Rubra', version='0.1.5', author='Bernie Pope', author_email='bjpope@unimelb.edu.au', packages=['rubra'], package_data={'rubra': ['examples/*.py']}, entry_points={ 'console_scripts': ['rubra = rubra.rubra:main'] }, url='https://github.com/bjpop/rubra', license='LICENSE.txt', description='Rubra is a pipeline system for bioinformatics workflows\ with support for running pipeline stages on a distributed compute cluster.', long_description=open('README.txt').read(), install_requires=[ "ruffus==2.2", ], classifiers=[ 'Development Status :: 4 - Beta', 'License :: OSI Approved :: MIT', 'Operating System :: POSIX', 'Programming Language :: Python', ], )
<commit_before>#!/usr/bin/env python from setuptools import setup setup( name='Rubra', version='0.1.5', author='Bernie Pope', author_email='bjpope@unimelb.edu.au', packages=['rubra'], package_data={'rubra': ['examples/*.py']}, entry_points={ 'console_scripts': ['rubra = rubra.rubra:main'] }, url='https://github.com/bjpop/rubra', license='LICENSE.txt', description='Rubra is a pipeline system for bioinformatics workflows\ with support for running pipeline stages on a distributed compute cluster.', long_description=open('README.txt').read(), install_requires=[ "ruffus >= 2.0.0", ], classifiers=[ 'Development Status :: 4 - Beta', 'License :: OSI Approved :: MIT', 'Operating System :: POSIX', 'Programming Language :: Python', ], ) <commit_msg>Fix the version dependency on ruffus to 2.2, rather than >= 2.0.0<commit_after>#!/usr/bin/env python from setuptools import setup setup( name='Rubra', version='0.1.5', author='Bernie Pope', author_email='bjpope@unimelb.edu.au', packages=['rubra'], package_data={'rubra': ['examples/*.py']}, entry_points={ 'console_scripts': ['rubra = rubra.rubra:main'] }, url='https://github.com/bjpop/rubra', license='LICENSE.txt', description='Rubra is a pipeline system for bioinformatics workflows\ with support for running pipeline stages on a distributed compute cluster.', long_description=open('README.txt').read(), install_requires=[ "ruffus==2.2", ], classifiers=[ 'Development Status :: 4 - Beta', 'License :: OSI Approved :: MIT', 'Operating System :: POSIX', 'Programming Language :: Python', ], )
173f59cbaa945ea949905981538ddb3e8e836b55
setup.py
setup.py
""" Flask-FlatPages --------------- Provides flat static pages to a Flask application, based on text files as opposed to a relationnal database. """ from setuptools import setup setup( name='Flask-FlatPages', version='0.1', url='http://exyr.org/Flask-FlatPages/', license='BSD', author='Simon Sapin', author_email='simon.sapin@exyr.org', description='Provides flat static pages to a Flask application', long_description=__doc__, packages=['flaskext'], namespace_packages=['flaskext'], test_suite='test_flatpages', zip_safe=False, platforms='any', install_requires=[ 'Flask', 'PyYAML', 'Markdown', ], classifiers=[ 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', 'Topic :: Software Development :: Libraries :: Python Modules' ] )
""" Flask-FlatPages --------------- Provides flat static pages to a Flask application, based on text files as opposed to a relationnal database. """ from setuptools import setup setup( name='Flask-FlatPages', version='0.1dev', url='http://exyr.org/Flask-FlatPages/', license='BSD', author='Simon Sapin', author_email='simon.sapin@exyr.org', description='Provides flat static pages to a Flask application', long_description=__doc__, packages=['flaskext'], namespace_packages=['flaskext'], test_suite='test_flatpages', zip_safe=False, platforms='any', install_requires=[ 'Flask', 'PyYAML', 'Markdown', ], classifiers=[ 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', 'Topic :: Software Development :: Libraries :: Python Modules' ] )
Change version number to 0.1dev
Change version number to 0.1dev
Python
bsd-3-clause
SimonSapin/Flask-FlatPages,johnmee/Flask-FlatPages,SimonSapin/Flask-FlatPages,johnmee/Flask-FlatPages
""" Flask-FlatPages --------------- Provides flat static pages to a Flask application, based on text files as opposed to a relationnal database. """ from setuptools import setup setup( name='Flask-FlatPages', version='0.1', url='http://exyr.org/Flask-FlatPages/', license='BSD', author='Simon Sapin', author_email='simon.sapin@exyr.org', description='Provides flat static pages to a Flask application', long_description=__doc__, packages=['flaskext'], namespace_packages=['flaskext'], test_suite='test_flatpages', zip_safe=False, platforms='any', install_requires=[ 'Flask', 'PyYAML', 'Markdown', ], classifiers=[ 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', 'Topic :: Software Development :: Libraries :: Python Modules' ] ) Change version number to 0.1dev
""" Flask-FlatPages --------------- Provides flat static pages to a Flask application, based on text files as opposed to a relationnal database. """ from setuptools import setup setup( name='Flask-FlatPages', version='0.1dev', url='http://exyr.org/Flask-FlatPages/', license='BSD', author='Simon Sapin', author_email='simon.sapin@exyr.org', description='Provides flat static pages to a Flask application', long_description=__doc__, packages=['flaskext'], namespace_packages=['flaskext'], test_suite='test_flatpages', zip_safe=False, platforms='any', install_requires=[ 'Flask', 'PyYAML', 'Markdown', ], classifiers=[ 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', 'Topic :: Software Development :: Libraries :: Python Modules' ] )
<commit_before>""" Flask-FlatPages --------------- Provides flat static pages to a Flask application, based on text files as opposed to a relationnal database. """ from setuptools import setup setup( name='Flask-FlatPages', version='0.1', url='http://exyr.org/Flask-FlatPages/', license='BSD', author='Simon Sapin', author_email='simon.sapin@exyr.org', description='Provides flat static pages to a Flask application', long_description=__doc__, packages=['flaskext'], namespace_packages=['flaskext'], test_suite='test_flatpages', zip_safe=False, platforms='any', install_requires=[ 'Flask', 'PyYAML', 'Markdown', ], classifiers=[ 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', 'Topic :: Software Development :: Libraries :: Python Modules' ] ) <commit_msg>Change version number to 0.1dev<commit_after>
""" Flask-FlatPages --------------- Provides flat static pages to a Flask application, based on text files as opposed to a relationnal database. """ from setuptools import setup setup( name='Flask-FlatPages', version='0.1dev', url='http://exyr.org/Flask-FlatPages/', license='BSD', author='Simon Sapin', author_email='simon.sapin@exyr.org', description='Provides flat static pages to a Flask application', long_description=__doc__, packages=['flaskext'], namespace_packages=['flaskext'], test_suite='test_flatpages', zip_safe=False, platforms='any', install_requires=[ 'Flask', 'PyYAML', 'Markdown', ], classifiers=[ 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', 'Topic :: Software Development :: Libraries :: Python Modules' ] )
""" Flask-FlatPages --------------- Provides flat static pages to a Flask application, based on text files as opposed to a relationnal database. """ from setuptools import setup setup( name='Flask-FlatPages', version='0.1', url='http://exyr.org/Flask-FlatPages/', license='BSD', author='Simon Sapin', author_email='simon.sapin@exyr.org', description='Provides flat static pages to a Flask application', long_description=__doc__, packages=['flaskext'], namespace_packages=['flaskext'], test_suite='test_flatpages', zip_safe=False, platforms='any', install_requires=[ 'Flask', 'PyYAML', 'Markdown', ], classifiers=[ 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', 'Topic :: Software Development :: Libraries :: Python Modules' ] ) Change version number to 0.1dev""" Flask-FlatPages --------------- Provides flat static pages to a Flask application, based on text files as opposed to a relationnal database. """ from setuptools import setup setup( name='Flask-FlatPages', version='0.1dev', url='http://exyr.org/Flask-FlatPages/', license='BSD', author='Simon Sapin', author_email='simon.sapin@exyr.org', description='Provides flat static pages to a Flask application', long_description=__doc__, packages=['flaskext'], namespace_packages=['flaskext'], test_suite='test_flatpages', zip_safe=False, platforms='any', install_requires=[ 'Flask', 'PyYAML', 'Markdown', ], classifiers=[ 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', 'Topic :: Software Development :: Libraries :: Python Modules' ] )
<commit_before>""" Flask-FlatPages --------------- Provides flat static pages to a Flask application, based on text files as opposed to a relationnal database. """ from setuptools import setup setup( name='Flask-FlatPages', version='0.1', url='http://exyr.org/Flask-FlatPages/', license='BSD', author='Simon Sapin', author_email='simon.sapin@exyr.org', description='Provides flat static pages to a Flask application', long_description=__doc__, packages=['flaskext'], namespace_packages=['flaskext'], test_suite='test_flatpages', zip_safe=False, platforms='any', install_requires=[ 'Flask', 'PyYAML', 'Markdown', ], classifiers=[ 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', 'Topic :: Software Development :: Libraries :: Python Modules' ] ) <commit_msg>Change version number to 0.1dev<commit_after>""" Flask-FlatPages --------------- Provides flat static pages to a Flask application, based on text files as opposed to a relationnal database. """ from setuptools import setup setup( name='Flask-FlatPages', version='0.1dev', url='http://exyr.org/Flask-FlatPages/', license='BSD', author='Simon Sapin', author_email='simon.sapin@exyr.org', description='Provides flat static pages to a Flask application', long_description=__doc__, packages=['flaskext'], namespace_packages=['flaskext'], test_suite='test_flatpages', zip_safe=False, platforms='any', install_requires=[ 'Flask', 'PyYAML', 'Markdown', ], classifiers=[ 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', 'Topic :: Software Development :: Libraries :: Python Modules' ] )
6daef6533c1cc830aead7d7334f8baf78e8624d1
froide/foirequest/file_utils.py
froide/foirequest/file_utils.py
import os import tempfile import subprocess import logging def convert_to_pdf(filepath, binary_name=None, construct_call=None): if binary_name is None and construct_call is None: return outpath = tempfile.mkdtemp() path, filename = os.path.split(filepath) name, extension = filename.rsplit('.', 1) output_file = os.path.join(outpath, '%s.pdf' % name) arguments = [ binary_name, "--headless", "--convert-to", "pdf", "--outdir", outpath, filepath ] if construct_call is not None: arguments, output_file = construct_call(filepath, outpath) # Set different HOME so libreoffice can write to it env = dict(os.environ) env.update({'HOME': outpath}) logging.info("Running: %s", ' '.join(arguments)) logging.info("Env: %s", env) p = subprocess.Popen( arguments, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env ) out, err = p.communicate() p.wait() if p.returncode == 0: if os.path.exists(output_file): return output_file else: logging.error("Error during Doc to PDF conversion: %s", err) return None
import os import tempfile import subprocess import logging try: TimeoutExpired = subprocess.TimeoutExpired HAS_TIMEOUT = True except AttributeError: TimeoutExpired = Exception HAS_TIMEOUT = False def convert_to_pdf(filepath, binary_name=None, construct_call=None, timeout=50): if binary_name is None and construct_call is None: return outpath = tempfile.mkdtemp() path, filename = os.path.split(filepath) name, extension = filename.rsplit('.', 1) output_file = os.path.join(outpath, '%s.pdf' % name) arguments = [ binary_name, "--headless", "--convert-to", "pdf", "--outdir", outpath, filepath ] if construct_call is not None: arguments, output_file = construct_call(filepath, outpath) # Set different HOME so libreoffice can write to it env = dict(os.environ) env.update({'HOME': outpath}) logging.info("Running: %s", ' '.join(arguments)) logging.info("Env: %s", env) try: p = subprocess.Popen( arguments, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env ) kwargs = {} if HAS_TIMEOUT: kwargs['timeout'] = timeout out, err = p.communicate(**kwargs) p.wait() except TimeoutExpired: p.kill() out, err = p.communicate() finally: if p.returncode is None: p.kill() out, err = p.communicate() if p.returncode == 0: if os.path.exists(output_file): return output_file else: logging.error("Error during Doc to PDF conversion: %s", err) return None
Add better timeout killing to file conversion
Add better timeout killing to file conversion
Python
mit
stefanw/froide,stefanw/froide,stefanw/froide,stefanw/froide,fin/froide,stefanw/froide,fin/froide,fin/froide,fin/froide
import os import tempfile import subprocess import logging def convert_to_pdf(filepath, binary_name=None, construct_call=None): if binary_name is None and construct_call is None: return outpath = tempfile.mkdtemp() path, filename = os.path.split(filepath) name, extension = filename.rsplit('.', 1) output_file = os.path.join(outpath, '%s.pdf' % name) arguments = [ binary_name, "--headless", "--convert-to", "pdf", "--outdir", outpath, filepath ] if construct_call is not None: arguments, output_file = construct_call(filepath, outpath) # Set different HOME so libreoffice can write to it env = dict(os.environ) env.update({'HOME': outpath}) logging.info("Running: %s", ' '.join(arguments)) logging.info("Env: %s", env) p = subprocess.Popen( arguments, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env ) out, err = p.communicate() p.wait() if p.returncode == 0: if os.path.exists(output_file): return output_file else: logging.error("Error during Doc to PDF conversion: %s", err) return None Add better timeout killing to file conversion
import os import tempfile import subprocess import logging try: TimeoutExpired = subprocess.TimeoutExpired HAS_TIMEOUT = True except AttributeError: TimeoutExpired = Exception HAS_TIMEOUT = False def convert_to_pdf(filepath, binary_name=None, construct_call=None, timeout=50): if binary_name is None and construct_call is None: return outpath = tempfile.mkdtemp() path, filename = os.path.split(filepath) name, extension = filename.rsplit('.', 1) output_file = os.path.join(outpath, '%s.pdf' % name) arguments = [ binary_name, "--headless", "--convert-to", "pdf", "--outdir", outpath, filepath ] if construct_call is not None: arguments, output_file = construct_call(filepath, outpath) # Set different HOME so libreoffice can write to it env = dict(os.environ) env.update({'HOME': outpath}) logging.info("Running: %s", ' '.join(arguments)) logging.info("Env: %s", env) try: p = subprocess.Popen( arguments, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env ) kwargs = {} if HAS_TIMEOUT: kwargs['timeout'] = timeout out, err = p.communicate(**kwargs) p.wait() except TimeoutExpired: p.kill() out, err = p.communicate() finally: if p.returncode is None: p.kill() out, err = p.communicate() if p.returncode == 0: if os.path.exists(output_file): return output_file else: logging.error("Error during Doc to PDF conversion: %s", err) return None
<commit_before>import os import tempfile import subprocess import logging def convert_to_pdf(filepath, binary_name=None, construct_call=None): if binary_name is None and construct_call is None: return outpath = tempfile.mkdtemp() path, filename = os.path.split(filepath) name, extension = filename.rsplit('.', 1) output_file = os.path.join(outpath, '%s.pdf' % name) arguments = [ binary_name, "--headless", "--convert-to", "pdf", "--outdir", outpath, filepath ] if construct_call is not None: arguments, output_file = construct_call(filepath, outpath) # Set different HOME so libreoffice can write to it env = dict(os.environ) env.update({'HOME': outpath}) logging.info("Running: %s", ' '.join(arguments)) logging.info("Env: %s", env) p = subprocess.Popen( arguments, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env ) out, err = p.communicate() p.wait() if p.returncode == 0: if os.path.exists(output_file): return output_file else: logging.error("Error during Doc to PDF conversion: %s", err) return None <commit_msg>Add better timeout killing to file conversion<commit_after>
import os import tempfile import subprocess import logging try: TimeoutExpired = subprocess.TimeoutExpired HAS_TIMEOUT = True except AttributeError: TimeoutExpired = Exception HAS_TIMEOUT = False def convert_to_pdf(filepath, binary_name=None, construct_call=None, timeout=50): if binary_name is None and construct_call is None: return outpath = tempfile.mkdtemp() path, filename = os.path.split(filepath) name, extension = filename.rsplit('.', 1) output_file = os.path.join(outpath, '%s.pdf' % name) arguments = [ binary_name, "--headless", "--convert-to", "pdf", "--outdir", outpath, filepath ] if construct_call is not None: arguments, output_file = construct_call(filepath, outpath) # Set different HOME so libreoffice can write to it env = dict(os.environ) env.update({'HOME': outpath}) logging.info("Running: %s", ' '.join(arguments)) logging.info("Env: %s", env) try: p = subprocess.Popen( arguments, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env ) kwargs = {} if HAS_TIMEOUT: kwargs['timeout'] = timeout out, err = p.communicate(**kwargs) p.wait() except TimeoutExpired: p.kill() out, err = p.communicate() finally: if p.returncode is None: p.kill() out, err = p.communicate() if p.returncode == 0: if os.path.exists(output_file): return output_file else: logging.error("Error during Doc to PDF conversion: %s", err) return None
import os import tempfile import subprocess import logging def convert_to_pdf(filepath, binary_name=None, construct_call=None): if binary_name is None and construct_call is None: return outpath = tempfile.mkdtemp() path, filename = os.path.split(filepath) name, extension = filename.rsplit('.', 1) output_file = os.path.join(outpath, '%s.pdf' % name) arguments = [ binary_name, "--headless", "--convert-to", "pdf", "--outdir", outpath, filepath ] if construct_call is not None: arguments, output_file = construct_call(filepath, outpath) # Set different HOME so libreoffice can write to it env = dict(os.environ) env.update({'HOME': outpath}) logging.info("Running: %s", ' '.join(arguments)) logging.info("Env: %s", env) p = subprocess.Popen( arguments, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env ) out, err = p.communicate() p.wait() if p.returncode == 0: if os.path.exists(output_file): return output_file else: logging.error("Error during Doc to PDF conversion: %s", err) return None Add better timeout killing to file conversionimport os import tempfile import subprocess import logging try: TimeoutExpired = subprocess.TimeoutExpired HAS_TIMEOUT = True except AttributeError: TimeoutExpired = Exception HAS_TIMEOUT = False def convert_to_pdf(filepath, binary_name=None, construct_call=None, timeout=50): if binary_name is None and construct_call is None: return outpath = tempfile.mkdtemp() path, filename = os.path.split(filepath) name, extension = filename.rsplit('.', 1) output_file = os.path.join(outpath, '%s.pdf' % name) arguments = [ binary_name, "--headless", "--convert-to", "pdf", "--outdir", outpath, filepath ] if construct_call is not None: arguments, output_file = construct_call(filepath, outpath) # Set different HOME so libreoffice can write to it env = dict(os.environ) env.update({'HOME': outpath}) logging.info("Running: %s", ' '.join(arguments)) logging.info("Env: %s", env) try: p = subprocess.Popen( arguments, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env ) kwargs = {} if HAS_TIMEOUT: kwargs['timeout'] = timeout out, err = p.communicate(**kwargs) p.wait() except TimeoutExpired: p.kill() out, err = p.communicate() finally: if p.returncode is None: p.kill() out, err = p.communicate() if p.returncode == 0: if os.path.exists(output_file): return output_file else: logging.error("Error during Doc to PDF conversion: %s", err) return None
<commit_before>import os import tempfile import subprocess import logging def convert_to_pdf(filepath, binary_name=None, construct_call=None): if binary_name is None and construct_call is None: return outpath = tempfile.mkdtemp() path, filename = os.path.split(filepath) name, extension = filename.rsplit('.', 1) output_file = os.path.join(outpath, '%s.pdf' % name) arguments = [ binary_name, "--headless", "--convert-to", "pdf", "--outdir", outpath, filepath ] if construct_call is not None: arguments, output_file = construct_call(filepath, outpath) # Set different HOME so libreoffice can write to it env = dict(os.environ) env.update({'HOME': outpath}) logging.info("Running: %s", ' '.join(arguments)) logging.info("Env: %s", env) p = subprocess.Popen( arguments, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env ) out, err = p.communicate() p.wait() if p.returncode == 0: if os.path.exists(output_file): return output_file else: logging.error("Error during Doc to PDF conversion: %s", err) return None <commit_msg>Add better timeout killing to file conversion<commit_after>import os import tempfile import subprocess import logging try: TimeoutExpired = subprocess.TimeoutExpired HAS_TIMEOUT = True except AttributeError: TimeoutExpired = Exception HAS_TIMEOUT = False def convert_to_pdf(filepath, binary_name=None, construct_call=None, timeout=50): if binary_name is None and construct_call is None: return outpath = tempfile.mkdtemp() path, filename = os.path.split(filepath) name, extension = filename.rsplit('.', 1) output_file = os.path.join(outpath, '%s.pdf' % name) arguments = [ binary_name, "--headless", "--convert-to", "pdf", "--outdir", outpath, filepath ] if construct_call is not None: arguments, output_file = construct_call(filepath, outpath) # Set different HOME so libreoffice can write to it env = dict(os.environ) env.update({'HOME': outpath}) logging.info("Running: %s", ' '.join(arguments)) logging.info("Env: %s", env) try: p = subprocess.Popen( arguments, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env ) kwargs = {} if HAS_TIMEOUT: kwargs['timeout'] = timeout out, err = p.communicate(**kwargs) p.wait() except TimeoutExpired: p.kill() out, err = p.communicate() finally: if p.returncode is None: p.kill() out, err = p.communicate() if p.returncode == 0: if os.path.exists(output_file): return output_file else: logging.error("Error during Doc to PDF conversion: %s", err) return None
556e6ba4d9bc32384526501acbbc4c0c2b6f983e
mopidy/frontends/mpd/__init__.py
mopidy/frontends/mpd/__init__.py
import logging from mopidy.frontends.mpd.dispatcher import MpdDispatcher from mopidy.frontends.mpd.process import MpdProcess from mopidy.utils.process import unpickle_connection logger = logging.getLogger('mopidy.frontends.mpd') class MpdFrontend(object): """ The MPD frontend. **Settings:** - :attr:`mopidy.settings.MPD_SERVER_HOSTNAME` - :attr:`mopidy.settings.MPD_SERVER_PORT` """ def __init__(self, core_queue, backend): self.core_queue = core_queue self.process = None self.dispatcher = MpdDispatcher(backend) def start(self): """Starts the MPD server.""" self.process = MpdProcess(self.core_queue) self.process.start() def process_message(self, message): """ Processes messages with the MPD frontend as destination. :param message: the message :type message: dict """ assert message['to'] == 'frontend', \ u'Message recipient must be "frontend".' if message['command'] == 'mpd_request': response = self.dispatcher.handle_request(message['request']) connection = unpickle_connection(message['reply_to']) connection.send(response) else: logger.warning(u'Cannot handle message: %s', message)
import logging from mopidy.frontends.base import BaseFrontend from mopidy.frontends.mpd.dispatcher import MpdDispatcher from mopidy.frontends.mpd.process import MpdProcess from mopidy.utils.process import unpickle_connection logger = logging.getLogger('mopidy.frontends.mpd') class MpdFrontend(BaseFrontend): """ The MPD frontend. **Settings:** - :attr:`mopidy.settings.MPD_SERVER_HOSTNAME` - :attr:`mopidy.settings.MPD_SERVER_PORT` """ def __init__(self, *args, **kwargs): super(MpdFrontend, self).__init__(*args, **kwargs) self.process = None self.dispatcher = MpdDispatcher(self.backend) def start(self): """Starts the MPD server.""" self.process = MpdProcess(self.core_queue) self.process.start() def destroy(self): """Destroys the MPD server.""" self.process.destroy() def process_message(self, message): """ Processes messages with the MPD frontend as destination. :param message: the message :type message: dict """ assert message['to'] == 'frontend', \ u'Message recipient must be "frontend".' if message['command'] == 'mpd_request': response = self.dispatcher.handle_request(message['request']) connection = unpickle_connection(message['reply_to']) connection.send(response) else: logger.warning(u'Cannot handle message: %s', message)
Make MpdFrontend a subclass of BaseFrontend
Make MpdFrontend a subclass of BaseFrontend
Python
apache-2.0
kingosticks/mopidy,SuperStarPL/mopidy,rawdlite/mopidy,tkem/mopidy,rawdlite/mopidy,diandiankan/mopidy,ZenithDK/mopidy,jcass77/mopidy,jodal/mopidy,SuperStarPL/mopidy,hkariti/mopidy,mokieyue/mopidy,rawdlite/mopidy,bacontext/mopidy,quartz55/mopidy,diandiankan/mopidy,tkem/mopidy,woutervanwijk/mopidy,adamcik/mopidy,swak/mopidy,quartz55/mopidy,mokieyue/mopidy,rawdlite/mopidy,abarisain/mopidy,mokieyue/mopidy,glogiotatidis/mopidy,mokieyue/mopidy,dbrgn/mopidy,bacontext/mopidy,diandiankan/mopidy,bacontext/mopidy,vrs01/mopidy,hkariti/mopidy,ZenithDK/mopidy,bacontext/mopidy,priestd09/mopidy,abarisain/mopidy,woutervanwijk/mopidy,jmarsik/mopidy,ali/mopidy,ali/mopidy,jmarsik/mopidy,mopidy/mopidy,ZenithDK/mopidy,glogiotatidis/mopidy,quartz55/mopidy,dbrgn/mopidy,dbrgn/mopidy,SuperStarPL/mopidy,bencevans/mopidy,mopidy/mopidy,jodal/mopidy,swak/mopidy,adamcik/mopidy,pacificIT/mopidy,bencevans/mopidy,diandiankan/mopidy,quartz55/mopidy,jcass77/mopidy,bencevans/mopidy,liamw9534/mopidy,SuperStarPL/mopidy,swak/mopidy,tkem/mopidy,pacificIT/mopidy,ZenithDK/mopidy,kingosticks/mopidy,priestd09/mopidy,glogiotatidis/mopidy,swak/mopidy,ali/mopidy,kingosticks/mopidy,hkariti/mopidy,jcass77/mopidy,priestd09/mopidy,pacificIT/mopidy,jmarsik/mopidy,vrs01/mopidy,bencevans/mopidy,vrs01/mopidy,pacificIT/mopidy,hkariti/mopidy,vrs01/mopidy,dbrgn/mopidy,tkem/mopidy,ali/mopidy,jmarsik/mopidy,glogiotatidis/mopidy,mopidy/mopidy,liamw9534/mopidy,jodal/mopidy,adamcik/mopidy
import logging from mopidy.frontends.mpd.dispatcher import MpdDispatcher from mopidy.frontends.mpd.process import MpdProcess from mopidy.utils.process import unpickle_connection logger = logging.getLogger('mopidy.frontends.mpd') class MpdFrontend(object): """ The MPD frontend. **Settings:** - :attr:`mopidy.settings.MPD_SERVER_HOSTNAME` - :attr:`mopidy.settings.MPD_SERVER_PORT` """ def __init__(self, core_queue, backend): self.core_queue = core_queue self.process = None self.dispatcher = MpdDispatcher(backend) def start(self): """Starts the MPD server.""" self.process = MpdProcess(self.core_queue) self.process.start() def process_message(self, message): """ Processes messages with the MPD frontend as destination. :param message: the message :type message: dict """ assert message['to'] == 'frontend', \ u'Message recipient must be "frontend".' if message['command'] == 'mpd_request': response = self.dispatcher.handle_request(message['request']) connection = unpickle_connection(message['reply_to']) connection.send(response) else: logger.warning(u'Cannot handle message: %s', message) Make MpdFrontend a subclass of BaseFrontend
import logging from mopidy.frontends.base import BaseFrontend from mopidy.frontends.mpd.dispatcher import MpdDispatcher from mopidy.frontends.mpd.process import MpdProcess from mopidy.utils.process import unpickle_connection logger = logging.getLogger('mopidy.frontends.mpd') class MpdFrontend(BaseFrontend): """ The MPD frontend. **Settings:** - :attr:`mopidy.settings.MPD_SERVER_HOSTNAME` - :attr:`mopidy.settings.MPD_SERVER_PORT` """ def __init__(self, *args, **kwargs): super(MpdFrontend, self).__init__(*args, **kwargs) self.process = None self.dispatcher = MpdDispatcher(self.backend) def start(self): """Starts the MPD server.""" self.process = MpdProcess(self.core_queue) self.process.start() def destroy(self): """Destroys the MPD server.""" self.process.destroy() def process_message(self, message): """ Processes messages with the MPD frontend as destination. :param message: the message :type message: dict """ assert message['to'] == 'frontend', \ u'Message recipient must be "frontend".' if message['command'] == 'mpd_request': response = self.dispatcher.handle_request(message['request']) connection = unpickle_connection(message['reply_to']) connection.send(response) else: logger.warning(u'Cannot handle message: %s', message)
<commit_before>import logging from mopidy.frontends.mpd.dispatcher import MpdDispatcher from mopidy.frontends.mpd.process import MpdProcess from mopidy.utils.process import unpickle_connection logger = logging.getLogger('mopidy.frontends.mpd') class MpdFrontend(object): """ The MPD frontend. **Settings:** - :attr:`mopidy.settings.MPD_SERVER_HOSTNAME` - :attr:`mopidy.settings.MPD_SERVER_PORT` """ def __init__(self, core_queue, backend): self.core_queue = core_queue self.process = None self.dispatcher = MpdDispatcher(backend) def start(self): """Starts the MPD server.""" self.process = MpdProcess(self.core_queue) self.process.start() def process_message(self, message): """ Processes messages with the MPD frontend as destination. :param message: the message :type message: dict """ assert message['to'] == 'frontend', \ u'Message recipient must be "frontend".' if message['command'] == 'mpd_request': response = self.dispatcher.handle_request(message['request']) connection = unpickle_connection(message['reply_to']) connection.send(response) else: logger.warning(u'Cannot handle message: %s', message) <commit_msg>Make MpdFrontend a subclass of BaseFrontend<commit_after>
import logging from mopidy.frontends.base import BaseFrontend from mopidy.frontends.mpd.dispatcher import MpdDispatcher from mopidy.frontends.mpd.process import MpdProcess from mopidy.utils.process import unpickle_connection logger = logging.getLogger('mopidy.frontends.mpd') class MpdFrontend(BaseFrontend): """ The MPD frontend. **Settings:** - :attr:`mopidy.settings.MPD_SERVER_HOSTNAME` - :attr:`mopidy.settings.MPD_SERVER_PORT` """ def __init__(self, *args, **kwargs): super(MpdFrontend, self).__init__(*args, **kwargs) self.process = None self.dispatcher = MpdDispatcher(self.backend) def start(self): """Starts the MPD server.""" self.process = MpdProcess(self.core_queue) self.process.start() def destroy(self): """Destroys the MPD server.""" self.process.destroy() def process_message(self, message): """ Processes messages with the MPD frontend as destination. :param message: the message :type message: dict """ assert message['to'] == 'frontend', \ u'Message recipient must be "frontend".' if message['command'] == 'mpd_request': response = self.dispatcher.handle_request(message['request']) connection = unpickle_connection(message['reply_to']) connection.send(response) else: logger.warning(u'Cannot handle message: %s', message)
import logging from mopidy.frontends.mpd.dispatcher import MpdDispatcher from mopidy.frontends.mpd.process import MpdProcess from mopidy.utils.process import unpickle_connection logger = logging.getLogger('mopidy.frontends.mpd') class MpdFrontend(object): """ The MPD frontend. **Settings:** - :attr:`mopidy.settings.MPD_SERVER_HOSTNAME` - :attr:`mopidy.settings.MPD_SERVER_PORT` """ def __init__(self, core_queue, backend): self.core_queue = core_queue self.process = None self.dispatcher = MpdDispatcher(backend) def start(self): """Starts the MPD server.""" self.process = MpdProcess(self.core_queue) self.process.start() def process_message(self, message): """ Processes messages with the MPD frontend as destination. :param message: the message :type message: dict """ assert message['to'] == 'frontend', \ u'Message recipient must be "frontend".' if message['command'] == 'mpd_request': response = self.dispatcher.handle_request(message['request']) connection = unpickle_connection(message['reply_to']) connection.send(response) else: logger.warning(u'Cannot handle message: %s', message) Make MpdFrontend a subclass of BaseFrontendimport logging from mopidy.frontends.base import BaseFrontend from mopidy.frontends.mpd.dispatcher import MpdDispatcher from mopidy.frontends.mpd.process import MpdProcess from mopidy.utils.process import unpickle_connection logger = logging.getLogger('mopidy.frontends.mpd') class MpdFrontend(BaseFrontend): """ The MPD frontend. **Settings:** - :attr:`mopidy.settings.MPD_SERVER_HOSTNAME` - :attr:`mopidy.settings.MPD_SERVER_PORT` """ def __init__(self, *args, **kwargs): super(MpdFrontend, self).__init__(*args, **kwargs) self.process = None self.dispatcher = MpdDispatcher(self.backend) def start(self): """Starts the MPD server.""" self.process = MpdProcess(self.core_queue) self.process.start() def destroy(self): """Destroys the MPD server.""" self.process.destroy() def process_message(self, message): """ Processes messages with the MPD frontend as destination. :param message: the message :type message: dict """ assert message['to'] == 'frontend', \ u'Message recipient must be "frontend".' if message['command'] == 'mpd_request': response = self.dispatcher.handle_request(message['request']) connection = unpickle_connection(message['reply_to']) connection.send(response) else: logger.warning(u'Cannot handle message: %s', message)
<commit_before>import logging from mopidy.frontends.mpd.dispatcher import MpdDispatcher from mopidy.frontends.mpd.process import MpdProcess from mopidy.utils.process import unpickle_connection logger = logging.getLogger('mopidy.frontends.mpd') class MpdFrontend(object): """ The MPD frontend. **Settings:** - :attr:`mopidy.settings.MPD_SERVER_HOSTNAME` - :attr:`mopidy.settings.MPD_SERVER_PORT` """ def __init__(self, core_queue, backend): self.core_queue = core_queue self.process = None self.dispatcher = MpdDispatcher(backend) def start(self): """Starts the MPD server.""" self.process = MpdProcess(self.core_queue) self.process.start() def process_message(self, message): """ Processes messages with the MPD frontend as destination. :param message: the message :type message: dict """ assert message['to'] == 'frontend', \ u'Message recipient must be "frontend".' if message['command'] == 'mpd_request': response = self.dispatcher.handle_request(message['request']) connection = unpickle_connection(message['reply_to']) connection.send(response) else: logger.warning(u'Cannot handle message: %s', message) <commit_msg>Make MpdFrontend a subclass of BaseFrontend<commit_after>import logging from mopidy.frontends.base import BaseFrontend from mopidy.frontends.mpd.dispatcher import MpdDispatcher from mopidy.frontends.mpd.process import MpdProcess from mopidy.utils.process import unpickle_connection logger = logging.getLogger('mopidy.frontends.mpd') class MpdFrontend(BaseFrontend): """ The MPD frontend. **Settings:** - :attr:`mopidy.settings.MPD_SERVER_HOSTNAME` - :attr:`mopidy.settings.MPD_SERVER_PORT` """ def __init__(self, *args, **kwargs): super(MpdFrontend, self).__init__(*args, **kwargs) self.process = None self.dispatcher = MpdDispatcher(self.backend) def start(self): """Starts the MPD server.""" self.process = MpdProcess(self.core_queue) self.process.start() def destroy(self): """Destroys the MPD server.""" self.process.destroy() def process_message(self, message): """ Processes messages with the MPD frontend as destination. :param message: the message :type message: dict """ assert message['to'] == 'frontend', \ u'Message recipient must be "frontend".' if message['command'] == 'mpd_request': response = self.dispatcher.handle_request(message['request']) connection = unpickle_connection(message['reply_to']) connection.send(response) else: logger.warning(u'Cannot handle message: %s', message)
2d6f0d419b2bd40f4e44b0cb193e2f0f93cfb4e0
panoptes_cli/scripts/panoptes.py
panoptes_cli/scripts/panoptes.py
import click from panoptes_client.panoptes import Panoptes panoptes = Panoptes('https://panoptes.zooniverse.org/api') @click.group() def cli(): pass @cli.command() @click.option('--id', help='Project ID', required=False, type=int) @click.option('--display-name') @click.argument('slug', required=False) def project(id, display_name, slug): projects = panoptes.get_projects(id, slug=slug, display_name=display_name) for proj_data in projects['projects']: click.echo('Project name: %s' % proj_data['display_name']) click.echo('\tClassification count: %s' % proj_data['classifications_count']) click.echo('\tSubject count: %s' % proj_data['subjects_count']) click.echo('') @cli.command() @click.argument('subject_id', required=True) def subject(subject_id): subject = panoptes.get_subject(subject_id)['subjects'][0] project = panoptes.get_project(subject['links']['project']) click.echo('Project: %s' % project['display_name']) click.echo('Locations:') for location in subject['locations']: for mimetype, uri in location.items(): click.echo('\t%s: %s' % (mimetype, uri))
import click from panoptes_client.panoptes import Panoptes panoptes = Panoptes('https://panoptes.zooniverse.org/api') @click.group() def cli(): pass @cli.command() @click.option('--id', help='Project ID', required=False, type=int) @click.option('--display-name') @click.argument('slug', required=False) def project(id, display_name, slug): projects = panoptes.get_projects(id, slug=slug, display_name=display_name) for proj_data in projects['projects']: click.echo('Project name: %s' % proj_data['display_name']) click.echo('\tClassification count: %s' % proj_data['classifications_count']) click.echo('\tSubject count: %s' % proj_data['subjects_count']) click.echo('') @cli.command() @click.argument('subject_id', required=True, type=int) def subject(subject_id): subject = panoptes.get_subject(subject_id)['subjects'][0] project = panoptes.get_project(subject['links']['project']) click.echo('Project: %s' % project['display_name']) click.echo('Locations:') for location in subject['locations']: for mimetype, uri in location.items(): click.echo('\t%s: %s' % (mimetype, uri))
Set type for subject ID
Set type for subject ID
Python
apache-2.0
zooniverse/panoptes-cli
import click from panoptes_client.panoptes import Panoptes panoptes = Panoptes('https://panoptes.zooniverse.org/api') @click.group() def cli(): pass @cli.command() @click.option('--id', help='Project ID', required=False, type=int) @click.option('--display-name') @click.argument('slug', required=False) def project(id, display_name, slug): projects = panoptes.get_projects(id, slug=slug, display_name=display_name) for proj_data in projects['projects']: click.echo('Project name: %s' % proj_data['display_name']) click.echo('\tClassification count: %s' % proj_data['classifications_count']) click.echo('\tSubject count: %s' % proj_data['subjects_count']) click.echo('') @cli.command() @click.argument('subject_id', required=True) def subject(subject_id): subject = panoptes.get_subject(subject_id)['subjects'][0] project = panoptes.get_project(subject['links']['project']) click.echo('Project: %s' % project['display_name']) click.echo('Locations:') for location in subject['locations']: for mimetype, uri in location.items(): click.echo('\t%s: %s' % (mimetype, uri)) Set type for subject ID
import click from panoptes_client.panoptes import Panoptes panoptes = Panoptes('https://panoptes.zooniverse.org/api') @click.group() def cli(): pass @cli.command() @click.option('--id', help='Project ID', required=False, type=int) @click.option('--display-name') @click.argument('slug', required=False) def project(id, display_name, slug): projects = panoptes.get_projects(id, slug=slug, display_name=display_name) for proj_data in projects['projects']: click.echo('Project name: %s' % proj_data['display_name']) click.echo('\tClassification count: %s' % proj_data['classifications_count']) click.echo('\tSubject count: %s' % proj_data['subjects_count']) click.echo('') @cli.command() @click.argument('subject_id', required=True, type=int) def subject(subject_id): subject = panoptes.get_subject(subject_id)['subjects'][0] project = panoptes.get_project(subject['links']['project']) click.echo('Project: %s' % project['display_name']) click.echo('Locations:') for location in subject['locations']: for mimetype, uri in location.items(): click.echo('\t%s: %s' % (mimetype, uri))
<commit_before>import click from panoptes_client.panoptes import Panoptes panoptes = Panoptes('https://panoptes.zooniverse.org/api') @click.group() def cli(): pass @cli.command() @click.option('--id', help='Project ID', required=False, type=int) @click.option('--display-name') @click.argument('slug', required=False) def project(id, display_name, slug): projects = panoptes.get_projects(id, slug=slug, display_name=display_name) for proj_data in projects['projects']: click.echo('Project name: %s' % proj_data['display_name']) click.echo('\tClassification count: %s' % proj_data['classifications_count']) click.echo('\tSubject count: %s' % proj_data['subjects_count']) click.echo('') @cli.command() @click.argument('subject_id', required=True) def subject(subject_id): subject = panoptes.get_subject(subject_id)['subjects'][0] project = panoptes.get_project(subject['links']['project']) click.echo('Project: %s' % project['display_name']) click.echo('Locations:') for location in subject['locations']: for mimetype, uri in location.items(): click.echo('\t%s: %s' % (mimetype, uri)) <commit_msg>Set type for subject ID<commit_after>
import click from panoptes_client.panoptes import Panoptes panoptes = Panoptes('https://panoptes.zooniverse.org/api') @click.group() def cli(): pass @cli.command() @click.option('--id', help='Project ID', required=False, type=int) @click.option('--display-name') @click.argument('slug', required=False) def project(id, display_name, slug): projects = panoptes.get_projects(id, slug=slug, display_name=display_name) for proj_data in projects['projects']: click.echo('Project name: %s' % proj_data['display_name']) click.echo('\tClassification count: %s' % proj_data['classifications_count']) click.echo('\tSubject count: %s' % proj_data['subjects_count']) click.echo('') @cli.command() @click.argument('subject_id', required=True, type=int) def subject(subject_id): subject = panoptes.get_subject(subject_id)['subjects'][0] project = panoptes.get_project(subject['links']['project']) click.echo('Project: %s' % project['display_name']) click.echo('Locations:') for location in subject['locations']: for mimetype, uri in location.items(): click.echo('\t%s: %s' % (mimetype, uri))
import click from panoptes_client.panoptes import Panoptes panoptes = Panoptes('https://panoptes.zooniverse.org/api') @click.group() def cli(): pass @cli.command() @click.option('--id', help='Project ID', required=False, type=int) @click.option('--display-name') @click.argument('slug', required=False) def project(id, display_name, slug): projects = panoptes.get_projects(id, slug=slug, display_name=display_name) for proj_data in projects['projects']: click.echo('Project name: %s' % proj_data['display_name']) click.echo('\tClassification count: %s' % proj_data['classifications_count']) click.echo('\tSubject count: %s' % proj_data['subjects_count']) click.echo('') @cli.command() @click.argument('subject_id', required=True) def subject(subject_id): subject = panoptes.get_subject(subject_id)['subjects'][0] project = panoptes.get_project(subject['links']['project']) click.echo('Project: %s' % project['display_name']) click.echo('Locations:') for location in subject['locations']: for mimetype, uri in location.items(): click.echo('\t%s: %s' % (mimetype, uri)) Set type for subject IDimport click from panoptes_client.panoptes import Panoptes panoptes = Panoptes('https://panoptes.zooniverse.org/api') @click.group() def cli(): pass @cli.command() @click.option('--id', help='Project ID', required=False, type=int) @click.option('--display-name') @click.argument('slug', required=False) def project(id, display_name, slug): projects = panoptes.get_projects(id, slug=slug, display_name=display_name) for proj_data in projects['projects']: click.echo('Project name: %s' % proj_data['display_name']) click.echo('\tClassification count: %s' % proj_data['classifications_count']) click.echo('\tSubject count: %s' % proj_data['subjects_count']) click.echo('') @cli.command() @click.argument('subject_id', required=True, type=int) def subject(subject_id): subject = panoptes.get_subject(subject_id)['subjects'][0] project = panoptes.get_project(subject['links']['project']) click.echo('Project: %s' % project['display_name']) click.echo('Locations:') for location in subject['locations']: for mimetype, uri in location.items(): click.echo('\t%s: %s' % (mimetype, uri))
<commit_before>import click from panoptes_client.panoptes import Panoptes panoptes = Panoptes('https://panoptes.zooniverse.org/api') @click.group() def cli(): pass @cli.command() @click.option('--id', help='Project ID', required=False, type=int) @click.option('--display-name') @click.argument('slug', required=False) def project(id, display_name, slug): projects = panoptes.get_projects(id, slug=slug, display_name=display_name) for proj_data in projects['projects']: click.echo('Project name: %s' % proj_data['display_name']) click.echo('\tClassification count: %s' % proj_data['classifications_count']) click.echo('\tSubject count: %s' % proj_data['subjects_count']) click.echo('') @cli.command() @click.argument('subject_id', required=True) def subject(subject_id): subject = panoptes.get_subject(subject_id)['subjects'][0] project = panoptes.get_project(subject['links']['project']) click.echo('Project: %s' % project['display_name']) click.echo('Locations:') for location in subject['locations']: for mimetype, uri in location.items(): click.echo('\t%s: %s' % (mimetype, uri)) <commit_msg>Set type for subject ID<commit_after>import click from panoptes_client.panoptes import Panoptes panoptes = Panoptes('https://panoptes.zooniverse.org/api') @click.group() def cli(): pass @cli.command() @click.option('--id', help='Project ID', required=False, type=int) @click.option('--display-name') @click.argument('slug', required=False) def project(id, display_name, slug): projects = panoptes.get_projects(id, slug=slug, display_name=display_name) for proj_data in projects['projects']: click.echo('Project name: %s' % proj_data['display_name']) click.echo('\tClassification count: %s' % proj_data['classifications_count']) click.echo('\tSubject count: %s' % proj_data['subjects_count']) click.echo('') @cli.command() @click.argument('subject_id', required=True, type=int) def subject(subject_id): subject = panoptes.get_subject(subject_id)['subjects'][0] project = panoptes.get_project(subject['links']['project']) click.echo('Project: %s' % project['display_name']) click.echo('Locations:') for location in subject['locations']: for mimetype, uri in location.items(): click.echo('\t%s: %s' % (mimetype, uri))
13b96626a35bc7a430352cf21d6c9a5d206bd910
simplesqlite/loader/formatter.py
simplesqlite/loader/formatter.py
# encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com> """ from __future__ import absolute_import import abc import six from .acceptor import LoaderAcceptor from .error import InvalidDataError @six.add_metaclass(abc.ABCMeta) class TableFormatterInterface(object): """ Abstract class of table data validator. """ @abc.abstractmethod def to_table_data(self): # pragma: no cover pass @abc.abstractmethod def _validate_source_data(self): # pragma: no cover pass class TableFormatter(LoaderAcceptor, TableFormatterInterface): """ Abstract class of |TableData| formatter. """ def _validate_source_data(self): if len(self._source_data) == 0: raise InvalidDataError("souce data is empty") def __init__(self, source_data): self._source_data = source_data
# encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com> """ from __future__ import absolute_import import abc import six from .acceptor import LoaderAcceptor from .error import InvalidDataError @six.add_metaclass(abc.ABCMeta) class TableFormatterInterface(object): """ Abstract class of table data validator. """ @abc.abstractmethod def to_table_data(self): # pragma: no cover pass class TableFormatter(LoaderAcceptor, TableFormatterInterface): """ Abstract class of |TableData| formatter. """ def _validate_source_data(self): if len(self._source_data) == 0: raise InvalidDataError("souce data is empty") def __init__(self, source_data): self._source_data = source_data
Delete a private method from interface
Delete a private method from interface
Python
mit
thombashi/SimpleSQLite,thombashi/SimpleSQLite
# encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com> """ from __future__ import absolute_import import abc import six from .acceptor import LoaderAcceptor from .error import InvalidDataError @six.add_metaclass(abc.ABCMeta) class TableFormatterInterface(object): """ Abstract class of table data validator. """ @abc.abstractmethod def to_table_data(self): # pragma: no cover pass @abc.abstractmethod def _validate_source_data(self): # pragma: no cover pass class TableFormatter(LoaderAcceptor, TableFormatterInterface): """ Abstract class of |TableData| formatter. """ def _validate_source_data(self): if len(self._source_data) == 0: raise InvalidDataError("souce data is empty") def __init__(self, source_data): self._source_data = source_data Delete a private method from interface
# encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com> """ from __future__ import absolute_import import abc import six from .acceptor import LoaderAcceptor from .error import InvalidDataError @six.add_metaclass(abc.ABCMeta) class TableFormatterInterface(object): """ Abstract class of table data validator. """ @abc.abstractmethod def to_table_data(self): # pragma: no cover pass class TableFormatter(LoaderAcceptor, TableFormatterInterface): """ Abstract class of |TableData| formatter. """ def _validate_source_data(self): if len(self._source_data) == 0: raise InvalidDataError("souce data is empty") def __init__(self, source_data): self._source_data = source_data
<commit_before># encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com> """ from __future__ import absolute_import import abc import six from .acceptor import LoaderAcceptor from .error import InvalidDataError @six.add_metaclass(abc.ABCMeta) class TableFormatterInterface(object): """ Abstract class of table data validator. """ @abc.abstractmethod def to_table_data(self): # pragma: no cover pass @abc.abstractmethod def _validate_source_data(self): # pragma: no cover pass class TableFormatter(LoaderAcceptor, TableFormatterInterface): """ Abstract class of |TableData| formatter. """ def _validate_source_data(self): if len(self._source_data) == 0: raise InvalidDataError("souce data is empty") def __init__(self, source_data): self._source_data = source_data <commit_msg>Delete a private method from interface<commit_after>
# encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com> """ from __future__ import absolute_import import abc import six from .acceptor import LoaderAcceptor from .error import InvalidDataError @six.add_metaclass(abc.ABCMeta) class TableFormatterInterface(object): """ Abstract class of table data validator. """ @abc.abstractmethod def to_table_data(self): # pragma: no cover pass class TableFormatter(LoaderAcceptor, TableFormatterInterface): """ Abstract class of |TableData| formatter. """ def _validate_source_data(self): if len(self._source_data) == 0: raise InvalidDataError("souce data is empty") def __init__(self, source_data): self._source_data = source_data
# encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com> """ from __future__ import absolute_import import abc import six from .acceptor import LoaderAcceptor from .error import InvalidDataError @six.add_metaclass(abc.ABCMeta) class TableFormatterInterface(object): """ Abstract class of table data validator. """ @abc.abstractmethod def to_table_data(self): # pragma: no cover pass @abc.abstractmethod def _validate_source_data(self): # pragma: no cover pass class TableFormatter(LoaderAcceptor, TableFormatterInterface): """ Abstract class of |TableData| formatter. """ def _validate_source_data(self): if len(self._source_data) == 0: raise InvalidDataError("souce data is empty") def __init__(self, source_data): self._source_data = source_data Delete a private method from interface# encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com> """ from __future__ import absolute_import import abc import six from .acceptor import LoaderAcceptor from .error import InvalidDataError @six.add_metaclass(abc.ABCMeta) class TableFormatterInterface(object): """ Abstract class of table data validator. """ @abc.abstractmethod def to_table_data(self): # pragma: no cover pass class TableFormatter(LoaderAcceptor, TableFormatterInterface): """ Abstract class of |TableData| formatter. """ def _validate_source_data(self): if len(self._source_data) == 0: raise InvalidDataError("souce data is empty") def __init__(self, source_data): self._source_data = source_data
<commit_before># encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com> """ from __future__ import absolute_import import abc import six from .acceptor import LoaderAcceptor from .error import InvalidDataError @six.add_metaclass(abc.ABCMeta) class TableFormatterInterface(object): """ Abstract class of table data validator. """ @abc.abstractmethod def to_table_data(self): # pragma: no cover pass @abc.abstractmethod def _validate_source_data(self): # pragma: no cover pass class TableFormatter(LoaderAcceptor, TableFormatterInterface): """ Abstract class of |TableData| formatter. """ def _validate_source_data(self): if len(self._source_data) == 0: raise InvalidDataError("souce data is empty") def __init__(self, source_data): self._source_data = source_data <commit_msg>Delete a private method from interface<commit_after># encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com> """ from __future__ import absolute_import import abc import six from .acceptor import LoaderAcceptor from .error import InvalidDataError @six.add_metaclass(abc.ABCMeta) class TableFormatterInterface(object): """ Abstract class of table data validator. """ @abc.abstractmethod def to_table_data(self): # pragma: no cover pass class TableFormatter(LoaderAcceptor, TableFormatterInterface): """ Abstract class of |TableData| formatter. """ def _validate_source_data(self): if len(self._source_data) == 0: raise InvalidDataError("souce data is empty") def __init__(self, source_data): self._source_data = source_data
9846b4460cde52c5f8d1128801c96b3637f7ddc6
chaco/variable_size_scatterplot.py
chaco/variable_size_scatterplot.py
""" The base ScatterPlot class now accepts variable sized markers. This definition remains for backwards compatability. """ from chaco.scatterplot import ScatterPlot class VariableSizeScatterPlot(ScatterPlot): pass
""" The base ScatterPlot class now accepts variable sized markers. This definition remains for backwards compatibility. """ from chaco.scatterplot import ScatterPlot # TODO: This should be officially deprecated. class VariableSizeScatterPlot(ScatterPlot): pass
Correct typo, comment about deprecating class.
Correct typo, comment about deprecating class.
Python
bsd-3-clause
tommy-u/chaco,burnpanck/chaco,burnpanck/chaco,burnpanck/chaco,tommy-u/chaco,tommy-u/chaco
""" The base ScatterPlot class now accepts variable sized markers. This definition remains for backwards compatability. """ from chaco.scatterplot import ScatterPlot class VariableSizeScatterPlot(ScatterPlot): pass Correct typo, comment about deprecating class.
""" The base ScatterPlot class now accepts variable sized markers. This definition remains for backwards compatibility. """ from chaco.scatterplot import ScatterPlot # TODO: This should be officially deprecated. class VariableSizeScatterPlot(ScatterPlot): pass
<commit_before>""" The base ScatterPlot class now accepts variable sized markers. This definition remains for backwards compatability. """ from chaco.scatterplot import ScatterPlot class VariableSizeScatterPlot(ScatterPlot): pass <commit_msg>Correct typo, comment about deprecating class.<commit_after>
""" The base ScatterPlot class now accepts variable sized markers. This definition remains for backwards compatibility. """ from chaco.scatterplot import ScatterPlot # TODO: This should be officially deprecated. class VariableSizeScatterPlot(ScatterPlot): pass
""" The base ScatterPlot class now accepts variable sized markers. This definition remains for backwards compatability. """ from chaco.scatterplot import ScatterPlot class VariableSizeScatterPlot(ScatterPlot): pass Correct typo, comment about deprecating class.""" The base ScatterPlot class now accepts variable sized markers. This definition remains for backwards compatibility. """ from chaco.scatterplot import ScatterPlot # TODO: This should be officially deprecated. class VariableSizeScatterPlot(ScatterPlot): pass
<commit_before>""" The base ScatterPlot class now accepts variable sized markers. This definition remains for backwards compatability. """ from chaco.scatterplot import ScatterPlot class VariableSizeScatterPlot(ScatterPlot): pass <commit_msg>Correct typo, comment about deprecating class.<commit_after>""" The base ScatterPlot class now accepts variable sized markers. This definition remains for backwards compatibility. """ from chaco.scatterplot import ScatterPlot # TODO: This should be officially deprecated. class VariableSizeScatterPlot(ScatterPlot): pass
07c2874f88b95b47badfd3199e0a73c57e9249e1
server/provider.py
server/provider.py
class Provider(object): """Base provider class""" regions = {} def __init__(self, key=''): self.key = key def create(self, region, name='hello'): raise NotImplemented() def start(self): raise NotImplemented() def stop(self): raise NotImplemented() def dstroy(self): raise NotImplemented() def list_servers(self): raise NotImplemented() def status(self): raise NotImplemented()
class Provider(object): """Base provider class""" regions = {} def __init__(self, key=''): self.key = key def create(self, region, name='hello'): raise NotImplemented() def start(self): raise NotImplemented() def stop(self): raise NotImplemented() def destroy(self): raise NotImplemented() def list_servers(self): raise NotImplemented() def status(self): raise NotImplemented()
Fix typo in method name
Fix typo in method name
Python
mit
beeworking/voyant,beeworking/voyant,beeworking/voyant,beeworking/voyant
class Provider(object): """Base provider class""" regions = {} def __init__(self, key=''): self.key = key def create(self, region, name='hello'): raise NotImplemented() def start(self): raise NotImplemented() def stop(self): raise NotImplemented() def dstroy(self): raise NotImplemented() def list_servers(self): raise NotImplemented() def status(self): raise NotImplemented() Fix typo in method name
class Provider(object): """Base provider class""" regions = {} def __init__(self, key=''): self.key = key def create(self, region, name='hello'): raise NotImplemented() def start(self): raise NotImplemented() def stop(self): raise NotImplemented() def destroy(self): raise NotImplemented() def list_servers(self): raise NotImplemented() def status(self): raise NotImplemented()
<commit_before>class Provider(object): """Base provider class""" regions = {} def __init__(self, key=''): self.key = key def create(self, region, name='hello'): raise NotImplemented() def start(self): raise NotImplemented() def stop(self): raise NotImplemented() def dstroy(self): raise NotImplemented() def list_servers(self): raise NotImplemented() def status(self): raise NotImplemented() <commit_msg>Fix typo in method name<commit_after>
class Provider(object): """Base provider class""" regions = {} def __init__(self, key=''): self.key = key def create(self, region, name='hello'): raise NotImplemented() def start(self): raise NotImplemented() def stop(self): raise NotImplemented() def destroy(self): raise NotImplemented() def list_servers(self): raise NotImplemented() def status(self): raise NotImplemented()
class Provider(object): """Base provider class""" regions = {} def __init__(self, key=''): self.key = key def create(self, region, name='hello'): raise NotImplemented() def start(self): raise NotImplemented() def stop(self): raise NotImplemented() def dstroy(self): raise NotImplemented() def list_servers(self): raise NotImplemented() def status(self): raise NotImplemented() Fix typo in method nameclass Provider(object): """Base provider class""" regions = {} def __init__(self, key=''): self.key = key def create(self, region, name='hello'): raise NotImplemented() def start(self): raise NotImplemented() def stop(self): raise NotImplemented() def destroy(self): raise NotImplemented() def list_servers(self): raise NotImplemented() def status(self): raise NotImplemented()
<commit_before>class Provider(object): """Base provider class""" regions = {} def __init__(self, key=''): self.key = key def create(self, region, name='hello'): raise NotImplemented() def start(self): raise NotImplemented() def stop(self): raise NotImplemented() def dstroy(self): raise NotImplemented() def list_servers(self): raise NotImplemented() def status(self): raise NotImplemented() <commit_msg>Fix typo in method name<commit_after>class Provider(object): """Base provider class""" regions = {} def __init__(self, key=''): self.key = key def create(self, region, name='hello'): raise NotImplemented() def start(self): raise NotImplemented() def stop(self): raise NotImplemented() def destroy(self): raise NotImplemented() def list_servers(self): raise NotImplemented() def status(self): raise NotImplemented()
eca0f263e8a944a144a08f130e06aeb651e645b4
social/apps/django_app/urls.py
social/apps/django_app/urls.py
"""URLs module""" from django.conf import settings try: from django.conf.urls import patterns, url except ImportError: # Django < 1.4 from django.conf.urls.defaults import patterns, url from social.utils import setting_name extra = getattr(settings, setting_name('TRAILING_SLASH'), True) and '/' or '' urlpatterns = patterns('social.apps.django_app.views', # authentication / association url(r'^login/(?P<backend>[^/]+){0}$'.format(extra), 'auth', name='begin'), url(r'^complete/(?P<backend>[^/]+){0}$'.format(extra), 'complete', name='complete'), # disconnection url(r'^disconnect/(?P<backend>[^/]+){0}$'.format(extra), 'disconnect', name='disconnect'), url(r'^disconnect/(?P<backend>[^/]+)/(?P<association_id>[^/]+){0}$' .format(extra), 'disconnect', name='disconnect_individual'), )
"""URLs module""" from django.conf import settings try: from django.conf.urls import url except ImportError: # Django < 1.4 from django.conf.urls.defaults import url from social.utils import setting_name from social.apps.django_app import views extra = getattr(settings, setting_name('TRAILING_SLASH'), True) and '/' or '' urlpatterns = [ # authentication / association url(r'^login/(?P<backend>[^/]+){0}$'.format(extra), views.auth, name='begin'), url(r'^complete/(?P<backend>[^/]+){0}$'.format(extra), views.complete, name='complete'), # disconnection url(r'^disconnect/(?P<backend>[^/]+){0}$'.format(extra), views.disconnect, name='disconnect'), url(r'^disconnect/(?P<backend>[^/]+)/(?P<association_id>[^/]+){0}$' .format(extra), views.disconnect, name='disconnect_individual'), ]
Fix Django 1.10 deprecation warnings
Fix Django 1.10 deprecation warnings In django_app/urls.py: * Use a list instead of `patterns` * Use view callables instead of strings Fixes #804, #754
Python
bsd-3-clause
tkajtoch/python-social-auth,cjltsod/python-social-auth,python-social-auth/social-core,S01780/python-social-auth,tobias47n9e/social-core,fearlessspider/python-social-auth,tkajtoch/python-social-auth,python-social-auth/social-app-cherrypy,python-social-auth/social-app-django,fearlessspider/python-social-auth,python-social-auth/social-app-django,python-social-auth/social-core,cjltsod/python-social-auth,merutak/python-social-auth,python-social-auth/social-docs,fearlessspider/python-social-auth,merutak/python-social-auth,webjunkie/python-social-auth,python-social-auth/social-app-django,tkajtoch/python-social-auth,rsalmaso/python-social-auth,S01780/python-social-auth,webjunkie/python-social-auth,merutak/python-social-auth,webjunkie/python-social-auth,rsalmaso/python-social-auth,S01780/python-social-auth,python-social-auth/social-storage-sqlalchemy
"""URLs module""" from django.conf import settings try: from django.conf.urls import patterns, url except ImportError: # Django < 1.4 from django.conf.urls.defaults import patterns, url from social.utils import setting_name extra = getattr(settings, setting_name('TRAILING_SLASH'), True) and '/' or '' urlpatterns = patterns('social.apps.django_app.views', # authentication / association url(r'^login/(?P<backend>[^/]+){0}$'.format(extra), 'auth', name='begin'), url(r'^complete/(?P<backend>[^/]+){0}$'.format(extra), 'complete', name='complete'), # disconnection url(r'^disconnect/(?P<backend>[^/]+){0}$'.format(extra), 'disconnect', name='disconnect'), url(r'^disconnect/(?P<backend>[^/]+)/(?P<association_id>[^/]+){0}$' .format(extra), 'disconnect', name='disconnect_individual'), ) Fix Django 1.10 deprecation warnings In django_app/urls.py: * Use a list instead of `patterns` * Use view callables instead of strings Fixes #804, #754
"""URLs module""" from django.conf import settings try: from django.conf.urls import url except ImportError: # Django < 1.4 from django.conf.urls.defaults import url from social.utils import setting_name from social.apps.django_app import views extra = getattr(settings, setting_name('TRAILING_SLASH'), True) and '/' or '' urlpatterns = [ # authentication / association url(r'^login/(?P<backend>[^/]+){0}$'.format(extra), views.auth, name='begin'), url(r'^complete/(?P<backend>[^/]+){0}$'.format(extra), views.complete, name='complete'), # disconnection url(r'^disconnect/(?P<backend>[^/]+){0}$'.format(extra), views.disconnect, name='disconnect'), url(r'^disconnect/(?P<backend>[^/]+)/(?P<association_id>[^/]+){0}$' .format(extra), views.disconnect, name='disconnect_individual'), ]
<commit_before>"""URLs module""" from django.conf import settings try: from django.conf.urls import patterns, url except ImportError: # Django < 1.4 from django.conf.urls.defaults import patterns, url from social.utils import setting_name extra = getattr(settings, setting_name('TRAILING_SLASH'), True) and '/' or '' urlpatterns = patterns('social.apps.django_app.views', # authentication / association url(r'^login/(?P<backend>[^/]+){0}$'.format(extra), 'auth', name='begin'), url(r'^complete/(?P<backend>[^/]+){0}$'.format(extra), 'complete', name='complete'), # disconnection url(r'^disconnect/(?P<backend>[^/]+){0}$'.format(extra), 'disconnect', name='disconnect'), url(r'^disconnect/(?P<backend>[^/]+)/(?P<association_id>[^/]+){0}$' .format(extra), 'disconnect', name='disconnect_individual'), ) <commit_msg>Fix Django 1.10 deprecation warnings In django_app/urls.py: * Use a list instead of `patterns` * Use view callables instead of strings Fixes #804, #754<commit_after>
"""URLs module""" from django.conf import settings try: from django.conf.urls import url except ImportError: # Django < 1.4 from django.conf.urls.defaults import url from social.utils import setting_name from social.apps.django_app import views extra = getattr(settings, setting_name('TRAILING_SLASH'), True) and '/' or '' urlpatterns = [ # authentication / association url(r'^login/(?P<backend>[^/]+){0}$'.format(extra), views.auth, name='begin'), url(r'^complete/(?P<backend>[^/]+){0}$'.format(extra), views.complete, name='complete'), # disconnection url(r'^disconnect/(?P<backend>[^/]+){0}$'.format(extra), views.disconnect, name='disconnect'), url(r'^disconnect/(?P<backend>[^/]+)/(?P<association_id>[^/]+){0}$' .format(extra), views.disconnect, name='disconnect_individual'), ]
"""URLs module""" from django.conf import settings try: from django.conf.urls import patterns, url except ImportError: # Django < 1.4 from django.conf.urls.defaults import patterns, url from social.utils import setting_name extra = getattr(settings, setting_name('TRAILING_SLASH'), True) and '/' or '' urlpatterns = patterns('social.apps.django_app.views', # authentication / association url(r'^login/(?P<backend>[^/]+){0}$'.format(extra), 'auth', name='begin'), url(r'^complete/(?P<backend>[^/]+){0}$'.format(extra), 'complete', name='complete'), # disconnection url(r'^disconnect/(?P<backend>[^/]+){0}$'.format(extra), 'disconnect', name='disconnect'), url(r'^disconnect/(?P<backend>[^/]+)/(?P<association_id>[^/]+){0}$' .format(extra), 'disconnect', name='disconnect_individual'), ) Fix Django 1.10 deprecation warnings In django_app/urls.py: * Use a list instead of `patterns` * Use view callables instead of strings Fixes #804, #754"""URLs module""" from django.conf import settings try: from django.conf.urls import url except ImportError: # Django < 1.4 from django.conf.urls.defaults import url from social.utils import setting_name from social.apps.django_app import views extra = getattr(settings, setting_name('TRAILING_SLASH'), True) and '/' or '' urlpatterns = [ # authentication / association url(r'^login/(?P<backend>[^/]+){0}$'.format(extra), views.auth, name='begin'), url(r'^complete/(?P<backend>[^/]+){0}$'.format(extra), views.complete, name='complete'), # disconnection url(r'^disconnect/(?P<backend>[^/]+){0}$'.format(extra), views.disconnect, name='disconnect'), url(r'^disconnect/(?P<backend>[^/]+)/(?P<association_id>[^/]+){0}$' .format(extra), views.disconnect, name='disconnect_individual'), ]
<commit_before>"""URLs module""" from django.conf import settings try: from django.conf.urls import patterns, url except ImportError: # Django < 1.4 from django.conf.urls.defaults import patterns, url from social.utils import setting_name extra = getattr(settings, setting_name('TRAILING_SLASH'), True) and '/' or '' urlpatterns = patterns('social.apps.django_app.views', # authentication / association url(r'^login/(?P<backend>[^/]+){0}$'.format(extra), 'auth', name='begin'), url(r'^complete/(?P<backend>[^/]+){0}$'.format(extra), 'complete', name='complete'), # disconnection url(r'^disconnect/(?P<backend>[^/]+){0}$'.format(extra), 'disconnect', name='disconnect'), url(r'^disconnect/(?P<backend>[^/]+)/(?P<association_id>[^/]+){0}$' .format(extra), 'disconnect', name='disconnect_individual'), ) <commit_msg>Fix Django 1.10 deprecation warnings In django_app/urls.py: * Use a list instead of `patterns` * Use view callables instead of strings Fixes #804, #754<commit_after>"""URLs module""" from django.conf import settings try: from django.conf.urls import url except ImportError: # Django < 1.4 from django.conf.urls.defaults import url from social.utils import setting_name from social.apps.django_app import views extra = getattr(settings, setting_name('TRAILING_SLASH'), True) and '/' or '' urlpatterns = [ # authentication / association url(r'^login/(?P<backend>[^/]+){0}$'.format(extra), views.auth, name='begin'), url(r'^complete/(?P<backend>[^/]+){0}$'.format(extra), views.complete, name='complete'), # disconnection url(r'^disconnect/(?P<backend>[^/]+){0}$'.format(extra), views.disconnect, name='disconnect'), url(r'^disconnect/(?P<backend>[^/]+)/(?P<association_id>[^/]+){0}$' .format(extra), views.disconnect, name='disconnect_individual'), ]
6ec35a123f6156001f779ccb5ff3bbda2b1f4477
src/json_to_csv.py
src/json_to_csv.py
# -*- coding: utf-8 -*- import json, os, sys from utils.file import load_json # Parse a json-formatted input instance and produce a csv file with # all involved coordinates. def coord_to_csv(array): return str(array[0]) + ',' + str(array[1]) + '\n' def write_to_csv(input_file): input = load_json(input_file) lines = [] for v in input['vehicles']: if 'start' in v: lines.append(coord_to_csv(v['start'])) if 'end' in v: lines.append(coord_to_csv(v['end'])) for job in input['jobs']: lines.append(coord_to_csv(job['location'])) output_name = input_file[:input_file.rfind('.json')] + '.csv' with open(output_name, 'w') as output_file: for l in lines: output_file.write(l) if __name__ == "__main__": write_to_csv(sys.argv[1])
#!/usr/bin/env python # -*- coding: utf-8 -*- import json, os, sys from utils.file import load_json # Parse a json-formatted input instance and produce a csv file with # all involved coordinates in Lat,Lng order. def coord_to_csv(array): return str(array[1]) + ',' + str(array[0]) + '\n' def write_to_csv(input_file): input = load_json(input_file) lines = [] for v in input['vehicles']: if 'start' in v: lines.append(coord_to_csv(v['start'])) if 'end' in v: lines.append(coord_to_csv(v['end'])) for job in input['jobs']: lines.append(coord_to_csv(job['location'])) output_name = input_file[:input_file.rfind('.json')] + '.csv' with open(output_name, 'w') as output_file: for l in lines: output_file.write(l) if __name__ == "__main__": write_to_csv(sys.argv[1])
Change coordinates order to Lat,Lng to match the frontend geocoding.
Change coordinates order to Lat,Lng to match the frontend geocoding.
Python
bsd-2-clause
VROOM-Project/vroom-scripts,VROOM-Project/vroom-scripts
# -*- coding: utf-8 -*- import json, os, sys from utils.file import load_json # Parse a json-formatted input instance and produce a csv file with # all involved coordinates. def coord_to_csv(array): return str(array[0]) + ',' + str(array[1]) + '\n' def write_to_csv(input_file): input = load_json(input_file) lines = [] for v in input['vehicles']: if 'start' in v: lines.append(coord_to_csv(v['start'])) if 'end' in v: lines.append(coord_to_csv(v['end'])) for job in input['jobs']: lines.append(coord_to_csv(job['location'])) output_name = input_file[:input_file.rfind('.json')] + '.csv' with open(output_name, 'w') as output_file: for l in lines: output_file.write(l) if __name__ == "__main__": write_to_csv(sys.argv[1]) Change coordinates order to Lat,Lng to match the frontend geocoding.
#!/usr/bin/env python # -*- coding: utf-8 -*- import json, os, sys from utils.file import load_json # Parse a json-formatted input instance and produce a csv file with # all involved coordinates in Lat,Lng order. def coord_to_csv(array): return str(array[1]) + ',' + str(array[0]) + '\n' def write_to_csv(input_file): input = load_json(input_file) lines = [] for v in input['vehicles']: if 'start' in v: lines.append(coord_to_csv(v['start'])) if 'end' in v: lines.append(coord_to_csv(v['end'])) for job in input['jobs']: lines.append(coord_to_csv(job['location'])) output_name = input_file[:input_file.rfind('.json')] + '.csv' with open(output_name, 'w') as output_file: for l in lines: output_file.write(l) if __name__ == "__main__": write_to_csv(sys.argv[1])
<commit_before># -*- coding: utf-8 -*- import json, os, sys from utils.file import load_json # Parse a json-formatted input instance and produce a csv file with # all involved coordinates. def coord_to_csv(array): return str(array[0]) + ',' + str(array[1]) + '\n' def write_to_csv(input_file): input = load_json(input_file) lines = [] for v in input['vehicles']: if 'start' in v: lines.append(coord_to_csv(v['start'])) if 'end' in v: lines.append(coord_to_csv(v['end'])) for job in input['jobs']: lines.append(coord_to_csv(job['location'])) output_name = input_file[:input_file.rfind('.json')] + '.csv' with open(output_name, 'w') as output_file: for l in lines: output_file.write(l) if __name__ == "__main__": write_to_csv(sys.argv[1]) <commit_msg>Change coordinates order to Lat,Lng to match the frontend geocoding.<commit_after>
#!/usr/bin/env python # -*- coding: utf-8 -*- import json, os, sys from utils.file import load_json # Parse a json-formatted input instance and produce a csv file with # all involved coordinates in Lat,Lng order. def coord_to_csv(array): return str(array[1]) + ',' + str(array[0]) + '\n' def write_to_csv(input_file): input = load_json(input_file) lines = [] for v in input['vehicles']: if 'start' in v: lines.append(coord_to_csv(v['start'])) if 'end' in v: lines.append(coord_to_csv(v['end'])) for job in input['jobs']: lines.append(coord_to_csv(job['location'])) output_name = input_file[:input_file.rfind('.json')] + '.csv' with open(output_name, 'w') as output_file: for l in lines: output_file.write(l) if __name__ == "__main__": write_to_csv(sys.argv[1])
# -*- coding: utf-8 -*- import json, os, sys from utils.file import load_json # Parse a json-formatted input instance and produce a csv file with # all involved coordinates. def coord_to_csv(array): return str(array[0]) + ',' + str(array[1]) + '\n' def write_to_csv(input_file): input = load_json(input_file) lines = [] for v in input['vehicles']: if 'start' in v: lines.append(coord_to_csv(v['start'])) if 'end' in v: lines.append(coord_to_csv(v['end'])) for job in input['jobs']: lines.append(coord_to_csv(job['location'])) output_name = input_file[:input_file.rfind('.json')] + '.csv' with open(output_name, 'w') as output_file: for l in lines: output_file.write(l) if __name__ == "__main__": write_to_csv(sys.argv[1]) Change coordinates order to Lat,Lng to match the frontend geocoding.#!/usr/bin/env python # -*- coding: utf-8 -*- import json, os, sys from utils.file import load_json # Parse a json-formatted input instance and produce a csv file with # all involved coordinates in Lat,Lng order. def coord_to_csv(array): return str(array[1]) + ',' + str(array[0]) + '\n' def write_to_csv(input_file): input = load_json(input_file) lines = [] for v in input['vehicles']: if 'start' in v: lines.append(coord_to_csv(v['start'])) if 'end' in v: lines.append(coord_to_csv(v['end'])) for job in input['jobs']: lines.append(coord_to_csv(job['location'])) output_name = input_file[:input_file.rfind('.json')] + '.csv' with open(output_name, 'w') as output_file: for l in lines: output_file.write(l) if __name__ == "__main__": write_to_csv(sys.argv[1])
<commit_before># -*- coding: utf-8 -*- import json, os, sys from utils.file import load_json # Parse a json-formatted input instance and produce a csv file with # all involved coordinates. def coord_to_csv(array): return str(array[0]) + ',' + str(array[1]) + '\n' def write_to_csv(input_file): input = load_json(input_file) lines = [] for v in input['vehicles']: if 'start' in v: lines.append(coord_to_csv(v['start'])) if 'end' in v: lines.append(coord_to_csv(v['end'])) for job in input['jobs']: lines.append(coord_to_csv(job['location'])) output_name = input_file[:input_file.rfind('.json')] + '.csv' with open(output_name, 'w') as output_file: for l in lines: output_file.write(l) if __name__ == "__main__": write_to_csv(sys.argv[1]) <commit_msg>Change coordinates order to Lat,Lng to match the frontend geocoding.<commit_after>#!/usr/bin/env python # -*- coding: utf-8 -*- import json, os, sys from utils.file import load_json # Parse a json-formatted input instance and produce a csv file with # all involved coordinates in Lat,Lng order. def coord_to_csv(array): return str(array[1]) + ',' + str(array[0]) + '\n' def write_to_csv(input_file): input = load_json(input_file) lines = [] for v in input['vehicles']: if 'start' in v: lines.append(coord_to_csv(v['start'])) if 'end' in v: lines.append(coord_to_csv(v['end'])) for job in input['jobs']: lines.append(coord_to_csv(job['location'])) output_name = input_file[:input_file.rfind('.json')] + '.csv' with open(output_name, 'w') as output_file: for l in lines: output_file.write(l) if __name__ == "__main__": write_to_csv(sys.argv[1])
ae6967c20d68c497147abbea7495ef874fa08599
src/akllt/tests/test_z2loader.py
src/akllt/tests/test_z2loader.py
# coding: utf-8 from __future__ import unicode_literals import unittest import pkg_resources import pathlib from akllt.z2loader import load_metadata class Z2LoaderTests(unittest.TestCase): def test_z2loader(self): path = pkg_resources.resource_filename( 'akllt', 'tests/fixtures/naujienos/.z2meta/naujiena_0001', ) path = pathlib.Path(path) assert path.exists() meta = load_metadata(str(path)) self.assertEqual(meta, { 'date': '2002-10-15', 'title': 'Konkursas', 'blurb': meta['blurb'], }) self.assertIn('konkursas\n„Geriausias 2002 metų', meta['blurb'])
# coding: utf-8 from __future__ import unicode_literals import unittest import pkg_resources import pathlib from akllt.dataimport.z2loader import load_metadata class Z2LoaderTests(unittest.TestCase): def test_z2loader(self): path = pkg_resources.resource_filename( 'akllt', 'tests/fixtures/naujienos/.z2meta/naujiena_0001', ) path = pathlib.Path(path) assert path.exists() meta = load_metadata(str(path)) self.assertEqual(meta, { 'date': '2002-10-15', 'title': 'Konkursas', 'blurb': meta['blurb'], }) self.assertIn('konkursas\n„Geriausias 2002 metų', meta['blurb'])
Fix z2loader import path in tests.
Fix z2loader import path in tests.
Python
agpl-3.0
python-dirbtuves/akl.lt,python-dirbtuves/akl.lt,python-dirbtuves/akl.lt,python-dirbtuves/akl.lt,python-dirbtuves/akl.lt
# coding: utf-8 from __future__ import unicode_literals import unittest import pkg_resources import pathlib from akllt.z2loader import load_metadata class Z2LoaderTests(unittest.TestCase): def test_z2loader(self): path = pkg_resources.resource_filename( 'akllt', 'tests/fixtures/naujienos/.z2meta/naujiena_0001', ) path = pathlib.Path(path) assert path.exists() meta = load_metadata(str(path)) self.assertEqual(meta, { 'date': '2002-10-15', 'title': 'Konkursas', 'blurb': meta['blurb'], }) self.assertIn('konkursas\n„Geriausias 2002 metų', meta['blurb']) Fix z2loader import path in tests.
# coding: utf-8 from __future__ import unicode_literals import unittest import pkg_resources import pathlib from akllt.dataimport.z2loader import load_metadata class Z2LoaderTests(unittest.TestCase): def test_z2loader(self): path = pkg_resources.resource_filename( 'akllt', 'tests/fixtures/naujienos/.z2meta/naujiena_0001', ) path = pathlib.Path(path) assert path.exists() meta = load_metadata(str(path)) self.assertEqual(meta, { 'date': '2002-10-15', 'title': 'Konkursas', 'blurb': meta['blurb'], }) self.assertIn('konkursas\n„Geriausias 2002 metų', meta['blurb'])
<commit_before># coding: utf-8 from __future__ import unicode_literals import unittest import pkg_resources import pathlib from akllt.z2loader import load_metadata class Z2LoaderTests(unittest.TestCase): def test_z2loader(self): path = pkg_resources.resource_filename( 'akllt', 'tests/fixtures/naujienos/.z2meta/naujiena_0001', ) path = pathlib.Path(path) assert path.exists() meta = load_metadata(str(path)) self.assertEqual(meta, { 'date': '2002-10-15', 'title': 'Konkursas', 'blurb': meta['blurb'], }) self.assertIn('konkursas\n„Geriausias 2002 metų', meta['blurb']) <commit_msg>Fix z2loader import path in tests.<commit_after>
# coding: utf-8 from __future__ import unicode_literals import unittest import pkg_resources import pathlib from akllt.dataimport.z2loader import load_metadata class Z2LoaderTests(unittest.TestCase): def test_z2loader(self): path = pkg_resources.resource_filename( 'akllt', 'tests/fixtures/naujienos/.z2meta/naujiena_0001', ) path = pathlib.Path(path) assert path.exists() meta = load_metadata(str(path)) self.assertEqual(meta, { 'date': '2002-10-15', 'title': 'Konkursas', 'blurb': meta['blurb'], }) self.assertIn('konkursas\n„Geriausias 2002 metų', meta['blurb'])
# coding: utf-8 from __future__ import unicode_literals import unittest import pkg_resources import pathlib from akllt.z2loader import load_metadata class Z2LoaderTests(unittest.TestCase): def test_z2loader(self): path = pkg_resources.resource_filename( 'akllt', 'tests/fixtures/naujienos/.z2meta/naujiena_0001', ) path = pathlib.Path(path) assert path.exists() meta = load_metadata(str(path)) self.assertEqual(meta, { 'date': '2002-10-15', 'title': 'Konkursas', 'blurb': meta['blurb'], }) self.assertIn('konkursas\n„Geriausias 2002 metų', meta['blurb']) Fix z2loader import path in tests.# coding: utf-8 from __future__ import unicode_literals import unittest import pkg_resources import pathlib from akllt.dataimport.z2loader import load_metadata class Z2LoaderTests(unittest.TestCase): def test_z2loader(self): path = pkg_resources.resource_filename( 'akllt', 'tests/fixtures/naujienos/.z2meta/naujiena_0001', ) path = pathlib.Path(path) assert path.exists() meta = load_metadata(str(path)) self.assertEqual(meta, { 'date': '2002-10-15', 'title': 'Konkursas', 'blurb': meta['blurb'], }) self.assertIn('konkursas\n„Geriausias 2002 metų', meta['blurb'])
<commit_before># coding: utf-8 from __future__ import unicode_literals import unittest import pkg_resources import pathlib from akllt.z2loader import load_metadata class Z2LoaderTests(unittest.TestCase): def test_z2loader(self): path = pkg_resources.resource_filename( 'akllt', 'tests/fixtures/naujienos/.z2meta/naujiena_0001', ) path = pathlib.Path(path) assert path.exists() meta = load_metadata(str(path)) self.assertEqual(meta, { 'date': '2002-10-15', 'title': 'Konkursas', 'blurb': meta['blurb'], }) self.assertIn('konkursas\n„Geriausias 2002 metų', meta['blurb']) <commit_msg>Fix z2loader import path in tests.<commit_after># coding: utf-8 from __future__ import unicode_literals import unittest import pkg_resources import pathlib from akllt.dataimport.z2loader import load_metadata class Z2LoaderTests(unittest.TestCase): def test_z2loader(self): path = pkg_resources.resource_filename( 'akllt', 'tests/fixtures/naujienos/.z2meta/naujiena_0001', ) path = pathlib.Path(path) assert path.exists() meta = load_metadata(str(path)) self.assertEqual(meta, { 'date': '2002-10-15', 'title': 'Konkursas', 'blurb': meta['blurb'], }) self.assertIn('konkursas\n„Geriausias 2002 metų', meta['blurb'])
94c98ad923f1a136bcf14b81d559f634c1bc262e
populous/generators/select.py
populous/generators/select.py
from .base import Generator class Select(Generator): def get_arguments(self, table=None, where=None, pk='id', **kwargs): super(Select, self).get_arguments(**kwargs) self.table = table self.where = where self.pk = pk def generate(self): backend = self.blueprint.backend while True: values = backend.select_random(self.table, fields=(self.pk,), where=self.where, max_rows=10000) for value in values: yield value
from .base import Generator from .vars import parse_vars class Select(Generator): def get_arguments(self, table=None, where=None, pk='id', **kwargs): super(Select, self).get_arguments(**kwargs) self.table = table self.where = parse_vars(where) self.pk = pk def generate(self): backend = self.blueprint.backend while True: where = self.evaluate(self.where) values = backend.select_random(self.table, fields=(self.pk,), where=where, max_rows=10000) for value in values: if self.evaluate(self.where) != where: break yield value
Handle where with variables in Select generator
Handle where with variables in Select generator
Python
mit
novafloss/populous
from .base import Generator class Select(Generator): def get_arguments(self, table=None, where=None, pk='id', **kwargs): super(Select, self).get_arguments(**kwargs) self.table = table self.where = where self.pk = pk def generate(self): backend = self.blueprint.backend while True: values = backend.select_random(self.table, fields=(self.pk,), where=self.where, max_rows=10000) for value in values: yield value Handle where with variables in Select generator
from .base import Generator from .vars import parse_vars class Select(Generator): def get_arguments(self, table=None, where=None, pk='id', **kwargs): super(Select, self).get_arguments(**kwargs) self.table = table self.where = parse_vars(where) self.pk = pk def generate(self): backend = self.blueprint.backend while True: where = self.evaluate(self.where) values = backend.select_random(self.table, fields=(self.pk,), where=where, max_rows=10000) for value in values: if self.evaluate(self.where) != where: break yield value
<commit_before>from .base import Generator class Select(Generator): def get_arguments(self, table=None, where=None, pk='id', **kwargs): super(Select, self).get_arguments(**kwargs) self.table = table self.where = where self.pk = pk def generate(self): backend = self.blueprint.backend while True: values = backend.select_random(self.table, fields=(self.pk,), where=self.where, max_rows=10000) for value in values: yield value <commit_msg>Handle where with variables in Select generator<commit_after>
from .base import Generator from .vars import parse_vars class Select(Generator): def get_arguments(self, table=None, where=None, pk='id', **kwargs): super(Select, self).get_arguments(**kwargs) self.table = table self.where = parse_vars(where) self.pk = pk def generate(self): backend = self.blueprint.backend while True: where = self.evaluate(self.where) values = backend.select_random(self.table, fields=(self.pk,), where=where, max_rows=10000) for value in values: if self.evaluate(self.where) != where: break yield value
from .base import Generator class Select(Generator): def get_arguments(self, table=None, where=None, pk='id', **kwargs): super(Select, self).get_arguments(**kwargs) self.table = table self.where = where self.pk = pk def generate(self): backend = self.blueprint.backend while True: values = backend.select_random(self.table, fields=(self.pk,), where=self.where, max_rows=10000) for value in values: yield value Handle where with variables in Select generatorfrom .base import Generator from .vars import parse_vars class Select(Generator): def get_arguments(self, table=None, where=None, pk='id', **kwargs): super(Select, self).get_arguments(**kwargs) self.table = table self.where = parse_vars(where) self.pk = pk def generate(self): backend = self.blueprint.backend while True: where = self.evaluate(self.where) values = backend.select_random(self.table, fields=(self.pk,), where=where, max_rows=10000) for value in values: if self.evaluate(self.where) != where: break yield value
<commit_before>from .base import Generator class Select(Generator): def get_arguments(self, table=None, where=None, pk='id', **kwargs): super(Select, self).get_arguments(**kwargs) self.table = table self.where = where self.pk = pk def generate(self): backend = self.blueprint.backend while True: values = backend.select_random(self.table, fields=(self.pk,), where=self.where, max_rows=10000) for value in values: yield value <commit_msg>Handle where with variables in Select generator<commit_after>from .base import Generator from .vars import parse_vars class Select(Generator): def get_arguments(self, table=None, where=None, pk='id', **kwargs): super(Select, self).get_arguments(**kwargs) self.table = table self.where = parse_vars(where) self.pk = pk def generate(self): backend = self.blueprint.backend while True: where = self.evaluate(self.where) values = backend.select_random(self.table, fields=(self.pk,), where=where, max_rows=10000) for value in values: if self.evaluate(self.where) != where: break yield value
b61769bec41a93366eae3030eec5d8fcaedcedd6
chainerrl/explorers/additive_gaussian.py
chainerrl/explorers/additive_gaussian.py
from __future__ import division from __future__ import unicode_literals from __future__ import print_function from __future__ import absolute_import from builtins import * # NOQA from future import standard_library standard_library.install_aliases() import numpy as np from chainerrl import explorer class AdditiveGaussian(explorer.Explorer): """Additive Gaussian noise""" def __init__(self, scale): self.scale = scale def select_action(self, t, greedy_action_func, action_value=None): a = greedy_action_func() noise = np.random.normal( scale=self.scale, size=a.shape).astype(np.float32) return a + noise def __repr__(self): return 'AdditiveGaussian(scale={})'.format(self.scale)
from __future__ import division from __future__ import unicode_literals from __future__ import print_function from __future__ import absolute_import from builtins import * # NOQA from future import standard_library standard_library.install_aliases() import numpy as np from chainerrl import explorer class AdditiveGaussian(explorer.Explorer): """Additive Gaussian noise to actions. Each action must be numpy.ndarray. Args: scale (float or array_like of floats): Scale parameter. """ def __init__(self, scale): self.scale = scale def select_action(self, t, greedy_action_func, action_value=None): a = greedy_action_func() noise = np.random.normal( scale=self.scale, size=a.shape).astype(np.float32) return a + noise def __repr__(self): return 'AdditiveGaussian(scale={})'.format(self.scale)
Improve the docstring of AdditiveGaussian
Improve the docstring of AdditiveGaussian
Python
mit
toslunar/chainerrl,toslunar/chainerrl
from __future__ import division from __future__ import unicode_literals from __future__ import print_function from __future__ import absolute_import from builtins import * # NOQA from future import standard_library standard_library.install_aliases() import numpy as np from chainerrl import explorer class AdditiveGaussian(explorer.Explorer): """Additive Gaussian noise""" def __init__(self, scale): self.scale = scale def select_action(self, t, greedy_action_func, action_value=None): a = greedy_action_func() noise = np.random.normal( scale=self.scale, size=a.shape).astype(np.float32) return a + noise def __repr__(self): return 'AdditiveGaussian(scale={})'.format(self.scale) Improve the docstring of AdditiveGaussian
from __future__ import division from __future__ import unicode_literals from __future__ import print_function from __future__ import absolute_import from builtins import * # NOQA from future import standard_library standard_library.install_aliases() import numpy as np from chainerrl import explorer class AdditiveGaussian(explorer.Explorer): """Additive Gaussian noise to actions. Each action must be numpy.ndarray. Args: scale (float or array_like of floats): Scale parameter. """ def __init__(self, scale): self.scale = scale def select_action(self, t, greedy_action_func, action_value=None): a = greedy_action_func() noise = np.random.normal( scale=self.scale, size=a.shape).astype(np.float32) return a + noise def __repr__(self): return 'AdditiveGaussian(scale={})'.format(self.scale)
<commit_before>from __future__ import division from __future__ import unicode_literals from __future__ import print_function from __future__ import absolute_import from builtins import * # NOQA from future import standard_library standard_library.install_aliases() import numpy as np from chainerrl import explorer class AdditiveGaussian(explorer.Explorer): """Additive Gaussian noise""" def __init__(self, scale): self.scale = scale def select_action(self, t, greedy_action_func, action_value=None): a = greedy_action_func() noise = np.random.normal( scale=self.scale, size=a.shape).astype(np.float32) return a + noise def __repr__(self): return 'AdditiveGaussian(scale={})'.format(self.scale) <commit_msg>Improve the docstring of AdditiveGaussian<commit_after>
from __future__ import division from __future__ import unicode_literals from __future__ import print_function from __future__ import absolute_import from builtins import * # NOQA from future import standard_library standard_library.install_aliases() import numpy as np from chainerrl import explorer class AdditiveGaussian(explorer.Explorer): """Additive Gaussian noise to actions. Each action must be numpy.ndarray. Args: scale (float or array_like of floats): Scale parameter. """ def __init__(self, scale): self.scale = scale def select_action(self, t, greedy_action_func, action_value=None): a = greedy_action_func() noise = np.random.normal( scale=self.scale, size=a.shape).astype(np.float32) return a + noise def __repr__(self): return 'AdditiveGaussian(scale={})'.format(self.scale)
from __future__ import division from __future__ import unicode_literals from __future__ import print_function from __future__ import absolute_import from builtins import * # NOQA from future import standard_library standard_library.install_aliases() import numpy as np from chainerrl import explorer class AdditiveGaussian(explorer.Explorer): """Additive Gaussian noise""" def __init__(self, scale): self.scale = scale def select_action(self, t, greedy_action_func, action_value=None): a = greedy_action_func() noise = np.random.normal( scale=self.scale, size=a.shape).astype(np.float32) return a + noise def __repr__(self): return 'AdditiveGaussian(scale={})'.format(self.scale) Improve the docstring of AdditiveGaussianfrom __future__ import division from __future__ import unicode_literals from __future__ import print_function from __future__ import absolute_import from builtins import * # NOQA from future import standard_library standard_library.install_aliases() import numpy as np from chainerrl import explorer class AdditiveGaussian(explorer.Explorer): """Additive Gaussian noise to actions. Each action must be numpy.ndarray. Args: scale (float or array_like of floats): Scale parameter. """ def __init__(self, scale): self.scale = scale def select_action(self, t, greedy_action_func, action_value=None): a = greedy_action_func() noise = np.random.normal( scale=self.scale, size=a.shape).astype(np.float32) return a + noise def __repr__(self): return 'AdditiveGaussian(scale={})'.format(self.scale)
<commit_before>from __future__ import division from __future__ import unicode_literals from __future__ import print_function from __future__ import absolute_import from builtins import * # NOQA from future import standard_library standard_library.install_aliases() import numpy as np from chainerrl import explorer class AdditiveGaussian(explorer.Explorer): """Additive Gaussian noise""" def __init__(self, scale): self.scale = scale def select_action(self, t, greedy_action_func, action_value=None): a = greedy_action_func() noise = np.random.normal( scale=self.scale, size=a.shape).astype(np.float32) return a + noise def __repr__(self): return 'AdditiveGaussian(scale={})'.format(self.scale) <commit_msg>Improve the docstring of AdditiveGaussian<commit_after>from __future__ import division from __future__ import unicode_literals from __future__ import print_function from __future__ import absolute_import from builtins import * # NOQA from future import standard_library standard_library.install_aliases() import numpy as np from chainerrl import explorer class AdditiveGaussian(explorer.Explorer): """Additive Gaussian noise to actions. Each action must be numpy.ndarray. Args: scale (float or array_like of floats): Scale parameter. """ def __init__(self, scale): self.scale = scale def select_action(self, t, greedy_action_func, action_value=None): a = greedy_action_func() noise = np.random.normal( scale=self.scale, size=a.shape).astype(np.float32) return a + noise def __repr__(self): return 'AdditiveGaussian(scale={})'.format(self.scale)
a9c7cab5606465526f8b39da7b497e1072e120af
autotime/__init__.py
autotime/__init__.py
from __future__ import print_function import time from IPython.core.magics.execution import _format_time as format_delta class LineWatcher(object): """Class that implements a basic timer. Notes ----- * Register the `start` and `stop` methods with the IPython events API. """ def __init__(self): self.start_time = 0.0 def start(self): self.start_time = time.time() def stop(self): stop_time = time.time() if self.start_time: diff = stop_time - self.start_time assert diff > 0 print('time: {}'.format(format_delta(diff))) timer = LineWatcher() def load_ipython_extension(ip): ip.events.register('pre_run_cell', timer.start) ip.events.register('post_run_cell', timer.stop) def unload_ipython_extension(ip): ip.events.unregister('pre_run_cell', timer.start) ip.events.unregister('post_run_cell', timer.stop) from ._version import get_versions __version__ = get_versions()['version'] del get_versions
from __future__ import print_function import time from IPython.core.magics.execution import _format_time as format_delta class LineWatcher(object): """Class that implements a basic timer. Notes ----- * Register the `start` and `stop` methods with the IPython events API. """ def __init__(self): self.start_time = 0.0 def start(self): self.start_time = time.time() def stop(self): stop_time = time.time() if self.start_time: diff = stop_time - self.start_time assert diff >= 0 print('time: {}'.format(format_delta(diff))) timer = LineWatcher() def load_ipython_extension(ip): ip.events.register('pre_run_cell', timer.start) ip.events.register('post_run_cell', timer.stop) def unload_ipython_extension(ip): ip.events.unregister('pre_run_cell', timer.start) ip.events.unregister('post_run_cell', timer.stop) from ._version import get_versions __version__ = get_versions()['version'] del get_versions
Change time difference assert from > to >= 0
Change time difference assert from > to >= 0 diff == 0 occurs on when executing trivial code in a cell. Updating the assert to include this.
Python
apache-2.0
cpcloud/ipython-autotime
from __future__ import print_function import time from IPython.core.magics.execution import _format_time as format_delta class LineWatcher(object): """Class that implements a basic timer. Notes ----- * Register the `start` and `stop` methods with the IPython events API. """ def __init__(self): self.start_time = 0.0 def start(self): self.start_time = time.time() def stop(self): stop_time = time.time() if self.start_time: diff = stop_time - self.start_time assert diff > 0 print('time: {}'.format(format_delta(diff))) timer = LineWatcher() def load_ipython_extension(ip): ip.events.register('pre_run_cell', timer.start) ip.events.register('post_run_cell', timer.stop) def unload_ipython_extension(ip): ip.events.unregister('pre_run_cell', timer.start) ip.events.unregister('post_run_cell', timer.stop) from ._version import get_versions __version__ = get_versions()['version'] del get_versions Change time difference assert from > to >= 0 diff == 0 occurs on when executing trivial code in a cell. Updating the assert to include this.
from __future__ import print_function import time from IPython.core.magics.execution import _format_time as format_delta class LineWatcher(object): """Class that implements a basic timer. Notes ----- * Register the `start` and `stop` methods with the IPython events API. """ def __init__(self): self.start_time = 0.0 def start(self): self.start_time = time.time() def stop(self): stop_time = time.time() if self.start_time: diff = stop_time - self.start_time assert diff >= 0 print('time: {}'.format(format_delta(diff))) timer = LineWatcher() def load_ipython_extension(ip): ip.events.register('pre_run_cell', timer.start) ip.events.register('post_run_cell', timer.stop) def unload_ipython_extension(ip): ip.events.unregister('pre_run_cell', timer.start) ip.events.unregister('post_run_cell', timer.stop) from ._version import get_versions __version__ = get_versions()['version'] del get_versions
<commit_before>from __future__ import print_function import time from IPython.core.magics.execution import _format_time as format_delta class LineWatcher(object): """Class that implements a basic timer. Notes ----- * Register the `start` and `stop` methods with the IPython events API. """ def __init__(self): self.start_time = 0.0 def start(self): self.start_time = time.time() def stop(self): stop_time = time.time() if self.start_time: diff = stop_time - self.start_time assert diff > 0 print('time: {}'.format(format_delta(diff))) timer = LineWatcher() def load_ipython_extension(ip): ip.events.register('pre_run_cell', timer.start) ip.events.register('post_run_cell', timer.stop) def unload_ipython_extension(ip): ip.events.unregister('pre_run_cell', timer.start) ip.events.unregister('post_run_cell', timer.stop) from ._version import get_versions __version__ = get_versions()['version'] del get_versions <commit_msg>Change time difference assert from > to >= 0 diff == 0 occurs on when executing trivial code in a cell. Updating the assert to include this.<commit_after>
from __future__ import print_function import time from IPython.core.magics.execution import _format_time as format_delta class LineWatcher(object): """Class that implements a basic timer. Notes ----- * Register the `start` and `stop` methods with the IPython events API. """ def __init__(self): self.start_time = 0.0 def start(self): self.start_time = time.time() def stop(self): stop_time = time.time() if self.start_time: diff = stop_time - self.start_time assert diff >= 0 print('time: {}'.format(format_delta(diff))) timer = LineWatcher() def load_ipython_extension(ip): ip.events.register('pre_run_cell', timer.start) ip.events.register('post_run_cell', timer.stop) def unload_ipython_extension(ip): ip.events.unregister('pre_run_cell', timer.start) ip.events.unregister('post_run_cell', timer.stop) from ._version import get_versions __version__ = get_versions()['version'] del get_versions
from __future__ import print_function import time from IPython.core.magics.execution import _format_time as format_delta class LineWatcher(object): """Class that implements a basic timer. Notes ----- * Register the `start` and `stop` methods with the IPython events API. """ def __init__(self): self.start_time = 0.0 def start(self): self.start_time = time.time() def stop(self): stop_time = time.time() if self.start_time: diff = stop_time - self.start_time assert diff > 0 print('time: {}'.format(format_delta(diff))) timer = LineWatcher() def load_ipython_extension(ip): ip.events.register('pre_run_cell', timer.start) ip.events.register('post_run_cell', timer.stop) def unload_ipython_extension(ip): ip.events.unregister('pre_run_cell', timer.start) ip.events.unregister('post_run_cell', timer.stop) from ._version import get_versions __version__ = get_versions()['version'] del get_versions Change time difference assert from > to >= 0 diff == 0 occurs on when executing trivial code in a cell. Updating the assert to include this.from __future__ import print_function import time from IPython.core.magics.execution import _format_time as format_delta class LineWatcher(object): """Class that implements a basic timer. Notes ----- * Register the `start` and `stop` methods with the IPython events API. """ def __init__(self): self.start_time = 0.0 def start(self): self.start_time = time.time() def stop(self): stop_time = time.time() if self.start_time: diff = stop_time - self.start_time assert diff >= 0 print('time: {}'.format(format_delta(diff))) timer = LineWatcher() def load_ipython_extension(ip): ip.events.register('pre_run_cell', timer.start) ip.events.register('post_run_cell', timer.stop) def unload_ipython_extension(ip): ip.events.unregister('pre_run_cell', timer.start) ip.events.unregister('post_run_cell', timer.stop) from ._version import get_versions __version__ = get_versions()['version'] del get_versions
<commit_before>from __future__ import print_function import time from IPython.core.magics.execution import _format_time as format_delta class LineWatcher(object): """Class that implements a basic timer. Notes ----- * Register the `start` and `stop` methods with the IPython events API. """ def __init__(self): self.start_time = 0.0 def start(self): self.start_time = time.time() def stop(self): stop_time = time.time() if self.start_time: diff = stop_time - self.start_time assert diff > 0 print('time: {}'.format(format_delta(diff))) timer = LineWatcher() def load_ipython_extension(ip): ip.events.register('pre_run_cell', timer.start) ip.events.register('post_run_cell', timer.stop) def unload_ipython_extension(ip): ip.events.unregister('pre_run_cell', timer.start) ip.events.unregister('post_run_cell', timer.stop) from ._version import get_versions __version__ = get_versions()['version'] del get_versions <commit_msg>Change time difference assert from > to >= 0 diff == 0 occurs on when executing trivial code in a cell. Updating the assert to include this.<commit_after>from __future__ import print_function import time from IPython.core.magics.execution import _format_time as format_delta class LineWatcher(object): """Class that implements a basic timer. Notes ----- * Register the `start` and `stop` methods with the IPython events API. """ def __init__(self): self.start_time = 0.0 def start(self): self.start_time = time.time() def stop(self): stop_time = time.time() if self.start_time: diff = stop_time - self.start_time assert diff >= 0 print('time: {}'.format(format_delta(diff))) timer = LineWatcher() def load_ipython_extension(ip): ip.events.register('pre_run_cell', timer.start) ip.events.register('post_run_cell', timer.stop) def unload_ipython_extension(ip): ip.events.unregister('pre_run_cell', timer.start) ip.events.unregister('post_run_cell', timer.stop) from ._version import get_versions __version__ = get_versions()['version'] del get_versions
e4d06cf4121bc9e1a1f9635e159187b8bed1b2ee
pyalysis/analysers/raw.py
pyalysis/analysers/raw.py
# coding: utf-8 """ pyalysis.analysers.raw ~~~~~~~~~~~~~~~~~~~~~~ :copyright: 2014 by Daniel Neuhäuser and Contributors :license: BSD, see LICENSE.rst for details """ import codecs from blinker import Signal from pyalysis.utils import detect_encoding, Location from pyalysis.warnings import LineTooLong class LineAnalyser(object): """ Line-level analyser of Python source code. """ on_analyse = Signal() on_line = Signal() def __init__(self, module): self.module = module self.encoding = detect_encoding(module) self.warnings = [] def emit(self, warning_cls, message, lineno, start, end): self.warnings.append( warning_cls( message, self.module.name, Location(lineno, start), Location(lineno, end) ) ) def analyse(self): self.on_analyse.send(self) reader = codecs.lookup(self.encoding).streamreader(self.module) for i, line in enumerate(reader, 1): self.on_line.send(self, lineno=i, line=line) return self.warnings @LineAnalyser.on_line.connect def check_line_length(analyser, lineno, line): if len(line.rstrip()) > 79: analyser.emit( LineTooLong, u'Line is longer than 79 characters. ' u'You should keep it below that', lineno, 79, len(line.rstrip()) )
# coding: utf-8 """ pyalysis.analysers.raw ~~~~~~~~~~~~~~~~~~~~~~ :copyright: 2014 by Daniel Neuhäuser and Contributors :license: BSD, see LICENSE.rst for details """ import codecs from blinker import Signal from pyalysis.utils import detect_encoding, Location from pyalysis.warnings import LineTooLong class LineAnalyser(object): """ Line-level analyser of Python source code. """ on_analyse = Signal() on_line = Signal() def __init__(self, module): self.module = module self.encoding = detect_encoding(module) self.warnings = [] def emit(self, warning_cls, message): self.warnings.append( warning_cls( message, self.module.name, Location(self.lineno, 0), Location(self.lineno, len(self.line)) ) ) def analyse(self): self.on_analyse.send(self) reader = codecs.lookup(self.encoding).streamreader(self.module) for i, line in enumerate(reader, 1): self.lineno = i self.line = line self.on_line.send(self, lineno=i, line=line) return self.warnings @LineAnalyser.on_line.connect def check_line_length(analyser, lineno, line): if len(line.rstrip()) > 79: analyser.emit( LineTooLong, u'Line is longer than 79 characters. ' u'You should keep it below that', )
Fix location of line length check
Fix location of line length check
Python
bsd-3-clause
DasIch/pyalysis,DasIch/pyalysis
# coding: utf-8 """ pyalysis.analysers.raw ~~~~~~~~~~~~~~~~~~~~~~ :copyright: 2014 by Daniel Neuhäuser and Contributors :license: BSD, see LICENSE.rst for details """ import codecs from blinker import Signal from pyalysis.utils import detect_encoding, Location from pyalysis.warnings import LineTooLong class LineAnalyser(object): """ Line-level analyser of Python source code. """ on_analyse = Signal() on_line = Signal() def __init__(self, module): self.module = module self.encoding = detect_encoding(module) self.warnings = [] def emit(self, warning_cls, message, lineno, start, end): self.warnings.append( warning_cls( message, self.module.name, Location(lineno, start), Location(lineno, end) ) ) def analyse(self): self.on_analyse.send(self) reader = codecs.lookup(self.encoding).streamreader(self.module) for i, line in enumerate(reader, 1): self.on_line.send(self, lineno=i, line=line) return self.warnings @LineAnalyser.on_line.connect def check_line_length(analyser, lineno, line): if len(line.rstrip()) > 79: analyser.emit( LineTooLong, u'Line is longer than 79 characters. ' u'You should keep it below that', lineno, 79, len(line.rstrip()) ) Fix location of line length check
# coding: utf-8 """ pyalysis.analysers.raw ~~~~~~~~~~~~~~~~~~~~~~ :copyright: 2014 by Daniel Neuhäuser and Contributors :license: BSD, see LICENSE.rst for details """ import codecs from blinker import Signal from pyalysis.utils import detect_encoding, Location from pyalysis.warnings import LineTooLong class LineAnalyser(object): """ Line-level analyser of Python source code. """ on_analyse = Signal() on_line = Signal() def __init__(self, module): self.module = module self.encoding = detect_encoding(module) self.warnings = [] def emit(self, warning_cls, message): self.warnings.append( warning_cls( message, self.module.name, Location(self.lineno, 0), Location(self.lineno, len(self.line)) ) ) def analyse(self): self.on_analyse.send(self) reader = codecs.lookup(self.encoding).streamreader(self.module) for i, line in enumerate(reader, 1): self.lineno = i self.line = line self.on_line.send(self, lineno=i, line=line) return self.warnings @LineAnalyser.on_line.connect def check_line_length(analyser, lineno, line): if len(line.rstrip()) > 79: analyser.emit( LineTooLong, u'Line is longer than 79 characters. ' u'You should keep it below that', )
<commit_before># coding: utf-8 """ pyalysis.analysers.raw ~~~~~~~~~~~~~~~~~~~~~~ :copyright: 2014 by Daniel Neuhäuser and Contributors :license: BSD, see LICENSE.rst for details """ import codecs from blinker import Signal from pyalysis.utils import detect_encoding, Location from pyalysis.warnings import LineTooLong class LineAnalyser(object): """ Line-level analyser of Python source code. """ on_analyse = Signal() on_line = Signal() def __init__(self, module): self.module = module self.encoding = detect_encoding(module) self.warnings = [] def emit(self, warning_cls, message, lineno, start, end): self.warnings.append( warning_cls( message, self.module.name, Location(lineno, start), Location(lineno, end) ) ) def analyse(self): self.on_analyse.send(self) reader = codecs.lookup(self.encoding).streamreader(self.module) for i, line in enumerate(reader, 1): self.on_line.send(self, lineno=i, line=line) return self.warnings @LineAnalyser.on_line.connect def check_line_length(analyser, lineno, line): if len(line.rstrip()) > 79: analyser.emit( LineTooLong, u'Line is longer than 79 characters. ' u'You should keep it below that', lineno, 79, len(line.rstrip()) ) <commit_msg>Fix location of line length check<commit_after>
# coding: utf-8 """ pyalysis.analysers.raw ~~~~~~~~~~~~~~~~~~~~~~ :copyright: 2014 by Daniel Neuhäuser and Contributors :license: BSD, see LICENSE.rst for details """ import codecs from blinker import Signal from pyalysis.utils import detect_encoding, Location from pyalysis.warnings import LineTooLong class LineAnalyser(object): """ Line-level analyser of Python source code. """ on_analyse = Signal() on_line = Signal() def __init__(self, module): self.module = module self.encoding = detect_encoding(module) self.warnings = [] def emit(self, warning_cls, message): self.warnings.append( warning_cls( message, self.module.name, Location(self.lineno, 0), Location(self.lineno, len(self.line)) ) ) def analyse(self): self.on_analyse.send(self) reader = codecs.lookup(self.encoding).streamreader(self.module) for i, line in enumerate(reader, 1): self.lineno = i self.line = line self.on_line.send(self, lineno=i, line=line) return self.warnings @LineAnalyser.on_line.connect def check_line_length(analyser, lineno, line): if len(line.rstrip()) > 79: analyser.emit( LineTooLong, u'Line is longer than 79 characters. ' u'You should keep it below that', )
# coding: utf-8 """ pyalysis.analysers.raw ~~~~~~~~~~~~~~~~~~~~~~ :copyright: 2014 by Daniel Neuhäuser and Contributors :license: BSD, see LICENSE.rst for details """ import codecs from blinker import Signal from pyalysis.utils import detect_encoding, Location from pyalysis.warnings import LineTooLong class LineAnalyser(object): """ Line-level analyser of Python source code. """ on_analyse = Signal() on_line = Signal() def __init__(self, module): self.module = module self.encoding = detect_encoding(module) self.warnings = [] def emit(self, warning_cls, message, lineno, start, end): self.warnings.append( warning_cls( message, self.module.name, Location(lineno, start), Location(lineno, end) ) ) def analyse(self): self.on_analyse.send(self) reader = codecs.lookup(self.encoding).streamreader(self.module) for i, line in enumerate(reader, 1): self.on_line.send(self, lineno=i, line=line) return self.warnings @LineAnalyser.on_line.connect def check_line_length(analyser, lineno, line): if len(line.rstrip()) > 79: analyser.emit( LineTooLong, u'Line is longer than 79 characters. ' u'You should keep it below that', lineno, 79, len(line.rstrip()) ) Fix location of line length check# coding: utf-8 """ pyalysis.analysers.raw ~~~~~~~~~~~~~~~~~~~~~~ :copyright: 2014 by Daniel Neuhäuser and Contributors :license: BSD, see LICENSE.rst for details """ import codecs from blinker import Signal from pyalysis.utils import detect_encoding, Location from pyalysis.warnings import LineTooLong class LineAnalyser(object): """ Line-level analyser of Python source code. """ on_analyse = Signal() on_line = Signal() def __init__(self, module): self.module = module self.encoding = detect_encoding(module) self.warnings = [] def emit(self, warning_cls, message): self.warnings.append( warning_cls( message, self.module.name, Location(self.lineno, 0), Location(self.lineno, len(self.line)) ) ) def analyse(self): self.on_analyse.send(self) reader = codecs.lookup(self.encoding).streamreader(self.module) for i, line in enumerate(reader, 1): self.lineno = i self.line = line self.on_line.send(self, lineno=i, line=line) return self.warnings @LineAnalyser.on_line.connect def check_line_length(analyser, lineno, line): if len(line.rstrip()) > 79: analyser.emit( LineTooLong, u'Line is longer than 79 characters. ' u'You should keep it below that', )
<commit_before># coding: utf-8 """ pyalysis.analysers.raw ~~~~~~~~~~~~~~~~~~~~~~ :copyright: 2014 by Daniel Neuhäuser and Contributors :license: BSD, see LICENSE.rst for details """ import codecs from blinker import Signal from pyalysis.utils import detect_encoding, Location from pyalysis.warnings import LineTooLong class LineAnalyser(object): """ Line-level analyser of Python source code. """ on_analyse = Signal() on_line = Signal() def __init__(self, module): self.module = module self.encoding = detect_encoding(module) self.warnings = [] def emit(self, warning_cls, message, lineno, start, end): self.warnings.append( warning_cls( message, self.module.name, Location(lineno, start), Location(lineno, end) ) ) def analyse(self): self.on_analyse.send(self) reader = codecs.lookup(self.encoding).streamreader(self.module) for i, line in enumerate(reader, 1): self.on_line.send(self, lineno=i, line=line) return self.warnings @LineAnalyser.on_line.connect def check_line_length(analyser, lineno, line): if len(line.rstrip()) > 79: analyser.emit( LineTooLong, u'Line is longer than 79 characters. ' u'You should keep it below that', lineno, 79, len(line.rstrip()) ) <commit_msg>Fix location of line length check<commit_after># coding: utf-8 """ pyalysis.analysers.raw ~~~~~~~~~~~~~~~~~~~~~~ :copyright: 2014 by Daniel Neuhäuser and Contributors :license: BSD, see LICENSE.rst for details """ import codecs from blinker import Signal from pyalysis.utils import detect_encoding, Location from pyalysis.warnings import LineTooLong class LineAnalyser(object): """ Line-level analyser of Python source code. """ on_analyse = Signal() on_line = Signal() def __init__(self, module): self.module = module self.encoding = detect_encoding(module) self.warnings = [] def emit(self, warning_cls, message): self.warnings.append( warning_cls( message, self.module.name, Location(self.lineno, 0), Location(self.lineno, len(self.line)) ) ) def analyse(self): self.on_analyse.send(self) reader = codecs.lookup(self.encoding).streamreader(self.module) for i, line in enumerate(reader, 1): self.lineno = i self.line = line self.on_line.send(self, lineno=i, line=line) return self.warnings @LineAnalyser.on_line.connect def check_line_length(analyser, lineno, line): if len(line.rstrip()) > 79: analyser.emit( LineTooLong, u'Line is longer than 79 characters. ' u'You should keep it below that', )
347545cc7ece8c0763ef194654fbaa34d16efe54
styleguide/views.py
styleguide/views.py
from django.shortcuts import get_object_or_404, render from django import forms class ExampleForm(forms.Form): text = forms.CharField() disabled_text = forms.CharField(disabled=True) readonly_text = forms.CharField( widget=forms.TextInput(attrs={'readonly':'readonly'}) ) checkbox1 = forms.BooleanField() checkbox2 = forms.BooleanField() select = forms.ChoiceField(choices=[('', "Select an Option"), (1, 'one'), (2, 'two'), (3, 'three')]) radio = forms.ChoiceField(choices=[(1, 'one'), (2, 'two'), (3, 'three')], widget=forms.RadioSelect()) form_initial = { "text": "", "disabled_text": "This field can't be changed", } def styleguide(request): return render(request, "styleguide/styleguide.html", { }) def styleguide_page(request, name): return render(request, "styleguide/styleguide-%s.html" % name, { "example_form": ExampleForm(initial=form_initial), }) def styleguide_sub_page(request, name, sub_page): return render(request, "styleguide/styleguide-%s-%s.html" % (name, sub_page), { "example_form": ExampleForm(initial=form_initial), })
from django.shortcuts import get_object_or_404, render from django import forms class ExampleForm(forms.Form): text = forms.CharField() disabled_text = forms.CharField(disabled=True) readonly_text = forms.CharField( widget=forms.TextInput(attrs={'readonly':'readonly'}) ) checkbox1 = forms.BooleanField() checkbox2 = forms.BooleanField() select = forms.ChoiceField(choices=[('', "Select an Option"), (1, 'one'), (2, 'two'), (3, 'three')]) radio = forms.ChoiceField(choices=[(1, 'one'), (2, 'two'), (3, 'three')], widget=forms.RadioSelect()) form_initial = { "text": "", "disabled_text": "This field can't be changed", "readonly_text": "This field is read only", } def styleguide(request): return render(request, "styleguide/styleguide.html", { }) def styleguide_page(request, name): return render(request, "styleguide/styleguide-%s.html" % name, { "example_form": ExampleForm(initial=form_initial), }) def styleguide_sub_page(request, name, sub_page): return render(request, "styleguide/styleguide-%s-%s.html" % (name, sub_page), { "example_form": ExampleForm(initial=form_initial), })
Add readonly text to form
Add readonly text to form
Python
bsd-3-clause
caktus/django-styleguide,caktus/django-styleguide,caktus/django-styleguide
from django.shortcuts import get_object_or_404, render from django import forms class ExampleForm(forms.Form): text = forms.CharField() disabled_text = forms.CharField(disabled=True) readonly_text = forms.CharField( widget=forms.TextInput(attrs={'readonly':'readonly'}) ) checkbox1 = forms.BooleanField() checkbox2 = forms.BooleanField() select = forms.ChoiceField(choices=[('', "Select an Option"), (1, 'one'), (2, 'two'), (3, 'three')]) radio = forms.ChoiceField(choices=[(1, 'one'), (2, 'two'), (3, 'three')], widget=forms.RadioSelect()) form_initial = { "text": "", "disabled_text": "This field can't be changed", } def styleguide(request): return render(request, "styleguide/styleguide.html", { }) def styleguide_page(request, name): return render(request, "styleguide/styleguide-%s.html" % name, { "example_form": ExampleForm(initial=form_initial), }) def styleguide_sub_page(request, name, sub_page): return render(request, "styleguide/styleguide-%s-%s.html" % (name, sub_page), { "example_form": ExampleForm(initial=form_initial), }) Add readonly text to form
from django.shortcuts import get_object_or_404, render from django import forms class ExampleForm(forms.Form): text = forms.CharField() disabled_text = forms.CharField(disabled=True) readonly_text = forms.CharField( widget=forms.TextInput(attrs={'readonly':'readonly'}) ) checkbox1 = forms.BooleanField() checkbox2 = forms.BooleanField() select = forms.ChoiceField(choices=[('', "Select an Option"), (1, 'one'), (2, 'two'), (3, 'three')]) radio = forms.ChoiceField(choices=[(1, 'one'), (2, 'two'), (3, 'three')], widget=forms.RadioSelect()) form_initial = { "text": "", "disabled_text": "This field can't be changed", "readonly_text": "This field is read only", } def styleguide(request): return render(request, "styleguide/styleguide.html", { }) def styleguide_page(request, name): return render(request, "styleguide/styleguide-%s.html" % name, { "example_form": ExampleForm(initial=form_initial), }) def styleguide_sub_page(request, name, sub_page): return render(request, "styleguide/styleguide-%s-%s.html" % (name, sub_page), { "example_form": ExampleForm(initial=form_initial), })
<commit_before>from django.shortcuts import get_object_or_404, render from django import forms class ExampleForm(forms.Form): text = forms.CharField() disabled_text = forms.CharField(disabled=True) readonly_text = forms.CharField( widget=forms.TextInput(attrs={'readonly':'readonly'}) ) checkbox1 = forms.BooleanField() checkbox2 = forms.BooleanField() select = forms.ChoiceField(choices=[('', "Select an Option"), (1, 'one'), (2, 'two'), (3, 'three')]) radio = forms.ChoiceField(choices=[(1, 'one'), (2, 'two'), (3, 'three')], widget=forms.RadioSelect()) form_initial = { "text": "", "disabled_text": "This field can't be changed", } def styleguide(request): return render(request, "styleguide/styleguide.html", { }) def styleguide_page(request, name): return render(request, "styleguide/styleguide-%s.html" % name, { "example_form": ExampleForm(initial=form_initial), }) def styleguide_sub_page(request, name, sub_page): return render(request, "styleguide/styleguide-%s-%s.html" % (name, sub_page), { "example_form": ExampleForm(initial=form_initial), }) <commit_msg>Add readonly text to form<commit_after>
from django.shortcuts import get_object_or_404, render from django import forms class ExampleForm(forms.Form): text = forms.CharField() disabled_text = forms.CharField(disabled=True) readonly_text = forms.CharField( widget=forms.TextInput(attrs={'readonly':'readonly'}) ) checkbox1 = forms.BooleanField() checkbox2 = forms.BooleanField() select = forms.ChoiceField(choices=[('', "Select an Option"), (1, 'one'), (2, 'two'), (3, 'three')]) radio = forms.ChoiceField(choices=[(1, 'one'), (2, 'two'), (3, 'three')], widget=forms.RadioSelect()) form_initial = { "text": "", "disabled_text": "This field can't be changed", "readonly_text": "This field is read only", } def styleguide(request): return render(request, "styleguide/styleguide.html", { }) def styleguide_page(request, name): return render(request, "styleguide/styleguide-%s.html" % name, { "example_form": ExampleForm(initial=form_initial), }) def styleguide_sub_page(request, name, sub_page): return render(request, "styleguide/styleguide-%s-%s.html" % (name, sub_page), { "example_form": ExampleForm(initial=form_initial), })
from django.shortcuts import get_object_or_404, render from django import forms class ExampleForm(forms.Form): text = forms.CharField() disabled_text = forms.CharField(disabled=True) readonly_text = forms.CharField( widget=forms.TextInput(attrs={'readonly':'readonly'}) ) checkbox1 = forms.BooleanField() checkbox2 = forms.BooleanField() select = forms.ChoiceField(choices=[('', "Select an Option"), (1, 'one'), (2, 'two'), (3, 'three')]) radio = forms.ChoiceField(choices=[(1, 'one'), (2, 'two'), (3, 'three')], widget=forms.RadioSelect()) form_initial = { "text": "", "disabled_text": "This field can't be changed", } def styleguide(request): return render(request, "styleguide/styleguide.html", { }) def styleguide_page(request, name): return render(request, "styleguide/styleguide-%s.html" % name, { "example_form": ExampleForm(initial=form_initial), }) def styleguide_sub_page(request, name, sub_page): return render(request, "styleguide/styleguide-%s-%s.html" % (name, sub_page), { "example_form": ExampleForm(initial=form_initial), }) Add readonly text to formfrom django.shortcuts import get_object_or_404, render from django import forms class ExampleForm(forms.Form): text = forms.CharField() disabled_text = forms.CharField(disabled=True) readonly_text = forms.CharField( widget=forms.TextInput(attrs={'readonly':'readonly'}) ) checkbox1 = forms.BooleanField() checkbox2 = forms.BooleanField() select = forms.ChoiceField(choices=[('', "Select an Option"), (1, 'one'), (2, 'two'), (3, 'three')]) radio = forms.ChoiceField(choices=[(1, 'one'), (2, 'two'), (3, 'three')], widget=forms.RadioSelect()) form_initial = { "text": "", "disabled_text": "This field can't be changed", "readonly_text": "This field is read only", } def styleguide(request): return render(request, "styleguide/styleguide.html", { }) def styleguide_page(request, name): return render(request, "styleguide/styleguide-%s.html" % name, { "example_form": ExampleForm(initial=form_initial), }) def styleguide_sub_page(request, name, sub_page): return render(request, "styleguide/styleguide-%s-%s.html" % (name, sub_page), { "example_form": ExampleForm(initial=form_initial), })
<commit_before>from django.shortcuts import get_object_or_404, render from django import forms class ExampleForm(forms.Form): text = forms.CharField() disabled_text = forms.CharField(disabled=True) readonly_text = forms.CharField( widget=forms.TextInput(attrs={'readonly':'readonly'}) ) checkbox1 = forms.BooleanField() checkbox2 = forms.BooleanField() select = forms.ChoiceField(choices=[('', "Select an Option"), (1, 'one'), (2, 'two'), (3, 'three')]) radio = forms.ChoiceField(choices=[(1, 'one'), (2, 'two'), (3, 'three')], widget=forms.RadioSelect()) form_initial = { "text": "", "disabled_text": "This field can't be changed", } def styleguide(request): return render(request, "styleguide/styleguide.html", { }) def styleguide_page(request, name): return render(request, "styleguide/styleguide-%s.html" % name, { "example_form": ExampleForm(initial=form_initial), }) def styleguide_sub_page(request, name, sub_page): return render(request, "styleguide/styleguide-%s-%s.html" % (name, sub_page), { "example_form": ExampleForm(initial=form_initial), }) <commit_msg>Add readonly text to form<commit_after>from django.shortcuts import get_object_or_404, render from django import forms class ExampleForm(forms.Form): text = forms.CharField() disabled_text = forms.CharField(disabled=True) readonly_text = forms.CharField( widget=forms.TextInput(attrs={'readonly':'readonly'}) ) checkbox1 = forms.BooleanField() checkbox2 = forms.BooleanField() select = forms.ChoiceField(choices=[('', "Select an Option"), (1, 'one'), (2, 'two'), (3, 'three')]) radio = forms.ChoiceField(choices=[(1, 'one'), (2, 'two'), (3, 'three')], widget=forms.RadioSelect()) form_initial = { "text": "", "disabled_text": "This field can't be changed", "readonly_text": "This field is read only", } def styleguide(request): return render(request, "styleguide/styleguide.html", { }) def styleguide_page(request, name): return render(request, "styleguide/styleguide-%s.html" % name, { "example_form": ExampleForm(initial=form_initial), }) def styleguide_sub_page(request, name, sub_page): return render(request, "styleguide/styleguide-%s-%s.html" % (name, sub_page), { "example_form": ExampleForm(initial=form_initial), })
54cf69b4c105038f896ceaf8af10c82fd3772bf9
pyethapp/tests/test_export.py
pyethapp/tests/test_export.py
from StringIO import StringIO import subprocess from pyethapp.app import app from click.testing import CliRunner from ethereum.blocks import BlockHeader import rlp def test_export(): # requires a chain with at least 5 blocks assert subprocess.call('pyethapp export', shell=True) != 0 assert subprocess.call('pyethapp export --from -1 -', shell=True) != 0 assert subprocess.call('pyethapp export --to -3 -', shell=True) != 0 assert subprocess.call('pyethapp export --from 4 --to 2 -', shell=True) != 0 result = subprocess.Popen('pyethapp export --from 2 --to 4 -', shell=True, stdout=subprocess.PIPE) result.wait() assert result.returncode == 0 s = result.stdout.read() headers = [] end = 0 while end < len(s): item, end = rlp.codec.consume_item(s, end) headers.append(BlockHeader.deserialize(item[0])) assert [header.number for header in headers] == [2, 3, 4]
from StringIO import StringIO import subprocess from pyethapp.app import app from click.testing import CliRunner from ethereum.blocks import BlockHeader import rlp import pytest @pytest.mark.xfail # can not work without mock-up chain def test_export(): # requires a chain with at least 5 blocks assert subprocess.call('pyethapp export', shell=True) != 0 assert subprocess.call('pyethapp export --from -1 -', shell=True) != 0 assert subprocess.call('pyethapp export --to -3 -', shell=True) != 0 assert subprocess.call('pyethapp export --from 4 --to 2 -', shell=True) != 0 result = subprocess.Popen('pyethapp export --from 2 --to 4 -', shell=True, stdout=subprocess.PIPE) result.wait() assert result.returncode == 0 s = result.stdout.read() headers = [] end = 0 while end < len(s): item, end = rlp.codec.consume_item(s, end) headers.append(BlockHeader.deserialize(item[0])) assert [header.number for header in headers] == [2, 3, 4]
Mark export test XFAIL since no chain mockup exists
Mark export test XFAIL since no chain mockup exists
Python
mit
gsalgado/pyethapp,changwu-tw/pyethapp,RomanZacharia/pyethapp,ethereum/pyethapp,gsalgado/pyethapp,ethereum/pyethapp,changwu-tw/pyethapp,vaporry/pyethapp,RomanZacharia/pyethapp,d-das/pyethapp
from StringIO import StringIO import subprocess from pyethapp.app import app from click.testing import CliRunner from ethereum.blocks import BlockHeader import rlp def test_export(): # requires a chain with at least 5 blocks assert subprocess.call('pyethapp export', shell=True) != 0 assert subprocess.call('pyethapp export --from -1 -', shell=True) != 0 assert subprocess.call('pyethapp export --to -3 -', shell=True) != 0 assert subprocess.call('pyethapp export --from 4 --to 2 -', shell=True) != 0 result = subprocess.Popen('pyethapp export --from 2 --to 4 -', shell=True, stdout=subprocess.PIPE) result.wait() assert result.returncode == 0 s = result.stdout.read() headers = [] end = 0 while end < len(s): item, end = rlp.codec.consume_item(s, end) headers.append(BlockHeader.deserialize(item[0])) assert [header.number for header in headers] == [2, 3, 4] Mark export test XFAIL since no chain mockup exists
from StringIO import StringIO import subprocess from pyethapp.app import app from click.testing import CliRunner from ethereum.blocks import BlockHeader import rlp import pytest @pytest.mark.xfail # can not work without mock-up chain def test_export(): # requires a chain with at least 5 blocks assert subprocess.call('pyethapp export', shell=True) != 0 assert subprocess.call('pyethapp export --from -1 -', shell=True) != 0 assert subprocess.call('pyethapp export --to -3 -', shell=True) != 0 assert subprocess.call('pyethapp export --from 4 --to 2 -', shell=True) != 0 result = subprocess.Popen('pyethapp export --from 2 --to 4 -', shell=True, stdout=subprocess.PIPE) result.wait() assert result.returncode == 0 s = result.stdout.read() headers = [] end = 0 while end < len(s): item, end = rlp.codec.consume_item(s, end) headers.append(BlockHeader.deserialize(item[0])) assert [header.number for header in headers] == [2, 3, 4]
<commit_before>from StringIO import StringIO import subprocess from pyethapp.app import app from click.testing import CliRunner from ethereum.blocks import BlockHeader import rlp def test_export(): # requires a chain with at least 5 blocks assert subprocess.call('pyethapp export', shell=True) != 0 assert subprocess.call('pyethapp export --from -1 -', shell=True) != 0 assert subprocess.call('pyethapp export --to -3 -', shell=True) != 0 assert subprocess.call('pyethapp export --from 4 --to 2 -', shell=True) != 0 result = subprocess.Popen('pyethapp export --from 2 --to 4 -', shell=True, stdout=subprocess.PIPE) result.wait() assert result.returncode == 0 s = result.stdout.read() headers = [] end = 0 while end < len(s): item, end = rlp.codec.consume_item(s, end) headers.append(BlockHeader.deserialize(item[0])) assert [header.number for header in headers] == [2, 3, 4] <commit_msg>Mark export test XFAIL since no chain mockup exists<commit_after>
from StringIO import StringIO import subprocess from pyethapp.app import app from click.testing import CliRunner from ethereum.blocks import BlockHeader import rlp import pytest @pytest.mark.xfail # can not work without mock-up chain def test_export(): # requires a chain with at least 5 blocks assert subprocess.call('pyethapp export', shell=True) != 0 assert subprocess.call('pyethapp export --from -1 -', shell=True) != 0 assert subprocess.call('pyethapp export --to -3 -', shell=True) != 0 assert subprocess.call('pyethapp export --from 4 --to 2 -', shell=True) != 0 result = subprocess.Popen('pyethapp export --from 2 --to 4 -', shell=True, stdout=subprocess.PIPE) result.wait() assert result.returncode == 0 s = result.stdout.read() headers = [] end = 0 while end < len(s): item, end = rlp.codec.consume_item(s, end) headers.append(BlockHeader.deserialize(item[0])) assert [header.number for header in headers] == [2, 3, 4]
from StringIO import StringIO import subprocess from pyethapp.app import app from click.testing import CliRunner from ethereum.blocks import BlockHeader import rlp def test_export(): # requires a chain with at least 5 blocks assert subprocess.call('pyethapp export', shell=True) != 0 assert subprocess.call('pyethapp export --from -1 -', shell=True) != 0 assert subprocess.call('pyethapp export --to -3 -', shell=True) != 0 assert subprocess.call('pyethapp export --from 4 --to 2 -', shell=True) != 0 result = subprocess.Popen('pyethapp export --from 2 --to 4 -', shell=True, stdout=subprocess.PIPE) result.wait() assert result.returncode == 0 s = result.stdout.read() headers = [] end = 0 while end < len(s): item, end = rlp.codec.consume_item(s, end) headers.append(BlockHeader.deserialize(item[0])) assert [header.number for header in headers] == [2, 3, 4] Mark export test XFAIL since no chain mockup existsfrom StringIO import StringIO import subprocess from pyethapp.app import app from click.testing import CliRunner from ethereum.blocks import BlockHeader import rlp import pytest @pytest.mark.xfail # can not work without mock-up chain def test_export(): # requires a chain with at least 5 blocks assert subprocess.call('pyethapp export', shell=True) != 0 assert subprocess.call('pyethapp export --from -1 -', shell=True) != 0 assert subprocess.call('pyethapp export --to -3 -', shell=True) != 0 assert subprocess.call('pyethapp export --from 4 --to 2 -', shell=True) != 0 result = subprocess.Popen('pyethapp export --from 2 --to 4 -', shell=True, stdout=subprocess.PIPE) result.wait() assert result.returncode == 0 s = result.stdout.read() headers = [] end = 0 while end < len(s): item, end = rlp.codec.consume_item(s, end) headers.append(BlockHeader.deserialize(item[0])) assert [header.number for header in headers] == [2, 3, 4]
<commit_before>from StringIO import StringIO import subprocess from pyethapp.app import app from click.testing import CliRunner from ethereum.blocks import BlockHeader import rlp def test_export(): # requires a chain with at least 5 blocks assert subprocess.call('pyethapp export', shell=True) != 0 assert subprocess.call('pyethapp export --from -1 -', shell=True) != 0 assert subprocess.call('pyethapp export --to -3 -', shell=True) != 0 assert subprocess.call('pyethapp export --from 4 --to 2 -', shell=True) != 0 result = subprocess.Popen('pyethapp export --from 2 --to 4 -', shell=True, stdout=subprocess.PIPE) result.wait() assert result.returncode == 0 s = result.stdout.read() headers = [] end = 0 while end < len(s): item, end = rlp.codec.consume_item(s, end) headers.append(BlockHeader.deserialize(item[0])) assert [header.number for header in headers] == [2, 3, 4] <commit_msg>Mark export test XFAIL since no chain mockup exists<commit_after>from StringIO import StringIO import subprocess from pyethapp.app import app from click.testing import CliRunner from ethereum.blocks import BlockHeader import rlp import pytest @pytest.mark.xfail # can not work without mock-up chain def test_export(): # requires a chain with at least 5 blocks assert subprocess.call('pyethapp export', shell=True) != 0 assert subprocess.call('pyethapp export --from -1 -', shell=True) != 0 assert subprocess.call('pyethapp export --to -3 -', shell=True) != 0 assert subprocess.call('pyethapp export --from 4 --to 2 -', shell=True) != 0 result = subprocess.Popen('pyethapp export --from 2 --to 4 -', shell=True, stdout=subprocess.PIPE) result.wait() assert result.returncode == 0 s = result.stdout.read() headers = [] end = 0 while end < len(s): item, end = rlp.codec.consume_item(s, end) headers.append(BlockHeader.deserialize(item[0])) assert [header.number for header in headers] == [2, 3, 4]
27e573d55b37869e09b8cf9809ea41e9b2ce1567
tests/data_test.py
tests/data_test.py
from pork.data import Data from mock import Mock, patch from StringIO import StringIO patch.TEST_PREFIX = 'it' class TestData: def it_sets_and_gets_keys(self): with patch("__builtin__.open", side_effect=IOError): data = Data() with patch("__builtin__.open"): data.set('foo', 'bar') assert data.get('foo') == 'bar' def it_deletes_existing_keys(self): with patch("__builtin__.open", side_effect=IOError): data = Data() with patch("__builtin__.open"): data.set('foo', 'bar') data.delete('foo') assert data.get('foo') is None def it_is_empty_if_there_are_no_keys(self): with patch("__builtin__.open", side_effect=IOError): data = Data() assert data.is_empty() def it_returns_the_data_dict(self): with patch("__builtin__.open", side_effect=IOError): data = Data() data.set('foo', 'bar') assert data.list() == { 'foo': 'bar' } def it_fails_silently_if_it_cannot_save(self): with patch("__builtin__.open", side_effect=IOError): data = Data() with patch("__builtin__.open", side_effect=ValueError): data.set('foo', 'bar') assert True
from pork.data import Data from mock import Mock, patch, mock_open from StringIO import StringIO patch.TEST_PREFIX = 'it' class TestData: def it_loads_json_data_from_file(self): with patch("__builtin__.open", mock_open(read_data='{"foo":"bar"}'), create=True) as m: data = Data() assert data.get('foo') == 'bar' def it_sets_and_gets_keys(self): data = Data() data.set('foo', 'bar') assert data.get('foo') == 'bar' def it_deletes_existing_keys(self): data = Data() data.set('foo', 'bar') data.delete('foo') assert data.get('foo') is None def it_is_empty_if_there_are_no_keys(self): data = Data() assert data.is_empty() def it_returns_the_data_dict(self): data = Data() data.set('foo', 'bar') assert data.list() == { 'foo': 'bar' } def it_fails_silently_if_it_cannot_save(self): data = Data() with patch("__builtin__.open", side_effect=ValueError): data.set('foo', 'bar') assert True
Use mock_open and remove unnecessary stubbing of open.
Use mock_open and remove unnecessary stubbing of open.
Python
mit
jimmycuadra/pork,jimmycuadra/pork
from pork.data import Data from mock import Mock, patch from StringIO import StringIO patch.TEST_PREFIX = 'it' class TestData: def it_sets_and_gets_keys(self): with patch("__builtin__.open", side_effect=IOError): data = Data() with patch("__builtin__.open"): data.set('foo', 'bar') assert data.get('foo') == 'bar' def it_deletes_existing_keys(self): with patch("__builtin__.open", side_effect=IOError): data = Data() with patch("__builtin__.open"): data.set('foo', 'bar') data.delete('foo') assert data.get('foo') is None def it_is_empty_if_there_are_no_keys(self): with patch("__builtin__.open", side_effect=IOError): data = Data() assert data.is_empty() def it_returns_the_data_dict(self): with patch("__builtin__.open", side_effect=IOError): data = Data() data.set('foo', 'bar') assert data.list() == { 'foo': 'bar' } def it_fails_silently_if_it_cannot_save(self): with patch("__builtin__.open", side_effect=IOError): data = Data() with patch("__builtin__.open", side_effect=ValueError): data.set('foo', 'bar') assert True Use mock_open and remove unnecessary stubbing of open.
from pork.data import Data from mock import Mock, patch, mock_open from StringIO import StringIO patch.TEST_PREFIX = 'it' class TestData: def it_loads_json_data_from_file(self): with patch("__builtin__.open", mock_open(read_data='{"foo":"bar"}'), create=True) as m: data = Data() assert data.get('foo') == 'bar' def it_sets_and_gets_keys(self): data = Data() data.set('foo', 'bar') assert data.get('foo') == 'bar' def it_deletes_existing_keys(self): data = Data() data.set('foo', 'bar') data.delete('foo') assert data.get('foo') is None def it_is_empty_if_there_are_no_keys(self): data = Data() assert data.is_empty() def it_returns_the_data_dict(self): data = Data() data.set('foo', 'bar') assert data.list() == { 'foo': 'bar' } def it_fails_silently_if_it_cannot_save(self): data = Data() with patch("__builtin__.open", side_effect=ValueError): data.set('foo', 'bar') assert True
<commit_before>from pork.data import Data from mock import Mock, patch from StringIO import StringIO patch.TEST_PREFIX = 'it' class TestData: def it_sets_and_gets_keys(self): with patch("__builtin__.open", side_effect=IOError): data = Data() with patch("__builtin__.open"): data.set('foo', 'bar') assert data.get('foo') == 'bar' def it_deletes_existing_keys(self): with patch("__builtin__.open", side_effect=IOError): data = Data() with patch("__builtin__.open"): data.set('foo', 'bar') data.delete('foo') assert data.get('foo') is None def it_is_empty_if_there_are_no_keys(self): with patch("__builtin__.open", side_effect=IOError): data = Data() assert data.is_empty() def it_returns_the_data_dict(self): with patch("__builtin__.open", side_effect=IOError): data = Data() data.set('foo', 'bar') assert data.list() == { 'foo': 'bar' } def it_fails_silently_if_it_cannot_save(self): with patch("__builtin__.open", side_effect=IOError): data = Data() with patch("__builtin__.open", side_effect=ValueError): data.set('foo', 'bar') assert True <commit_msg>Use mock_open and remove unnecessary stubbing of open.<commit_after>
from pork.data import Data from mock import Mock, patch, mock_open from StringIO import StringIO patch.TEST_PREFIX = 'it' class TestData: def it_loads_json_data_from_file(self): with patch("__builtin__.open", mock_open(read_data='{"foo":"bar"}'), create=True) as m: data = Data() assert data.get('foo') == 'bar' def it_sets_and_gets_keys(self): data = Data() data.set('foo', 'bar') assert data.get('foo') == 'bar' def it_deletes_existing_keys(self): data = Data() data.set('foo', 'bar') data.delete('foo') assert data.get('foo') is None def it_is_empty_if_there_are_no_keys(self): data = Data() assert data.is_empty() def it_returns_the_data_dict(self): data = Data() data.set('foo', 'bar') assert data.list() == { 'foo': 'bar' } def it_fails_silently_if_it_cannot_save(self): data = Data() with patch("__builtin__.open", side_effect=ValueError): data.set('foo', 'bar') assert True
from pork.data import Data from mock import Mock, patch from StringIO import StringIO patch.TEST_PREFIX = 'it' class TestData: def it_sets_and_gets_keys(self): with patch("__builtin__.open", side_effect=IOError): data = Data() with patch("__builtin__.open"): data.set('foo', 'bar') assert data.get('foo') == 'bar' def it_deletes_existing_keys(self): with patch("__builtin__.open", side_effect=IOError): data = Data() with patch("__builtin__.open"): data.set('foo', 'bar') data.delete('foo') assert data.get('foo') is None def it_is_empty_if_there_are_no_keys(self): with patch("__builtin__.open", side_effect=IOError): data = Data() assert data.is_empty() def it_returns_the_data_dict(self): with patch("__builtin__.open", side_effect=IOError): data = Data() data.set('foo', 'bar') assert data.list() == { 'foo': 'bar' } def it_fails_silently_if_it_cannot_save(self): with patch("__builtin__.open", side_effect=IOError): data = Data() with patch("__builtin__.open", side_effect=ValueError): data.set('foo', 'bar') assert True Use mock_open and remove unnecessary stubbing of open.from pork.data import Data from mock import Mock, patch, mock_open from StringIO import StringIO patch.TEST_PREFIX = 'it' class TestData: def it_loads_json_data_from_file(self): with patch("__builtin__.open", mock_open(read_data='{"foo":"bar"}'), create=True) as m: data = Data() assert data.get('foo') == 'bar' def it_sets_and_gets_keys(self): data = Data() data.set('foo', 'bar') assert data.get('foo') == 'bar' def it_deletes_existing_keys(self): data = Data() data.set('foo', 'bar') data.delete('foo') assert data.get('foo') is None def it_is_empty_if_there_are_no_keys(self): data = Data() assert data.is_empty() def it_returns_the_data_dict(self): data = Data() data.set('foo', 'bar') assert data.list() == { 'foo': 'bar' } def it_fails_silently_if_it_cannot_save(self): data = Data() with patch("__builtin__.open", side_effect=ValueError): data.set('foo', 'bar') assert True
<commit_before>from pork.data import Data from mock import Mock, patch from StringIO import StringIO patch.TEST_PREFIX = 'it' class TestData: def it_sets_and_gets_keys(self): with patch("__builtin__.open", side_effect=IOError): data = Data() with patch("__builtin__.open"): data.set('foo', 'bar') assert data.get('foo') == 'bar' def it_deletes_existing_keys(self): with patch("__builtin__.open", side_effect=IOError): data = Data() with patch("__builtin__.open"): data.set('foo', 'bar') data.delete('foo') assert data.get('foo') is None def it_is_empty_if_there_are_no_keys(self): with patch("__builtin__.open", side_effect=IOError): data = Data() assert data.is_empty() def it_returns_the_data_dict(self): with patch("__builtin__.open", side_effect=IOError): data = Data() data.set('foo', 'bar') assert data.list() == { 'foo': 'bar' } def it_fails_silently_if_it_cannot_save(self): with patch("__builtin__.open", side_effect=IOError): data = Data() with patch("__builtin__.open", side_effect=ValueError): data.set('foo', 'bar') assert True <commit_msg>Use mock_open and remove unnecessary stubbing of open.<commit_after>from pork.data import Data from mock import Mock, patch, mock_open from StringIO import StringIO patch.TEST_PREFIX = 'it' class TestData: def it_loads_json_data_from_file(self): with patch("__builtin__.open", mock_open(read_data='{"foo":"bar"}'), create=True) as m: data = Data() assert data.get('foo') == 'bar' def it_sets_and_gets_keys(self): data = Data() data.set('foo', 'bar') assert data.get('foo') == 'bar' def it_deletes_existing_keys(self): data = Data() data.set('foo', 'bar') data.delete('foo') assert data.get('foo') is None def it_is_empty_if_there_are_no_keys(self): data = Data() assert data.is_empty() def it_returns_the_data_dict(self): data = Data() data.set('foo', 'bar') assert data.list() == { 'foo': 'bar' } def it_fails_silently_if_it_cannot_save(self): data = Data() with patch("__builtin__.open", side_effect=ValueError): data.set('foo', 'bar') assert True
0b7e957fea7bbd08c79c2b2b4d9b8edfced38496
tests/providers.py
tests/providers.py
import unittest import foauth.providers class ProviderTests(unittest.TestCase): def setUp(self): class Example(foauth.providers.OAuth): provider_url = 'http://example.com' api_domain = 'api.example.com' self.provider = Example def test_auto_name(self): self.assertEqual(self.provider.name, 'Example') def test_auto_alias(self): self.assertEqual(self.provider.alias, 'example') def test_auto_favicon_url(self): url = 'https://www.google.com/s2/favicons?domain=example.com' self.assertEqual(self.provider.favicon_url, url) def test_auto_api_domains(self): self.assertEqual(self.provider.api_domains, ['api.example.com'])
import unittest import foauth.providers import urllib class ProviderTests(unittest.TestCase): def setUp(self): class Example(foauth.providers.OAuth): provider_url = 'http://example.com' api_domain = 'api.example.com' self.provider = Example def test_auto_name(self): self.assertEqual(self.provider.name, 'Example') def test_auto_alias(self): self.assertEqual(self.provider.alias, 'example') def test_auto_favicon_url(self): primary = 'https://getfavicon.appspot.com/http://example.com' backup = 'https://www.google.com/s2/favicons?domain=example.com' url = '%s?defaulticon=%s' % (primary, urllib.quote(backup)) self.assertEqual(self.provider.favicon_url, url) def test_auto_api_domains(self): self.assertEqual(self.provider.api_domains, ['api.example.com'])
Fix favicon tests to match the new scheme
Fix favicon tests to match the new scheme
Python
bsd-3-clause
foauth/foauth.org,foauth/foauth.org,foauth/foauth.org
import unittest import foauth.providers class ProviderTests(unittest.TestCase): def setUp(self): class Example(foauth.providers.OAuth): provider_url = 'http://example.com' api_domain = 'api.example.com' self.provider = Example def test_auto_name(self): self.assertEqual(self.provider.name, 'Example') def test_auto_alias(self): self.assertEqual(self.provider.alias, 'example') def test_auto_favicon_url(self): url = 'https://www.google.com/s2/favicons?domain=example.com' self.assertEqual(self.provider.favicon_url, url) def test_auto_api_domains(self): self.assertEqual(self.provider.api_domains, ['api.example.com']) Fix favicon tests to match the new scheme
import unittest import foauth.providers import urllib class ProviderTests(unittest.TestCase): def setUp(self): class Example(foauth.providers.OAuth): provider_url = 'http://example.com' api_domain = 'api.example.com' self.provider = Example def test_auto_name(self): self.assertEqual(self.provider.name, 'Example') def test_auto_alias(self): self.assertEqual(self.provider.alias, 'example') def test_auto_favicon_url(self): primary = 'https://getfavicon.appspot.com/http://example.com' backup = 'https://www.google.com/s2/favicons?domain=example.com' url = '%s?defaulticon=%s' % (primary, urllib.quote(backup)) self.assertEqual(self.provider.favicon_url, url) def test_auto_api_domains(self): self.assertEqual(self.provider.api_domains, ['api.example.com'])
<commit_before>import unittest import foauth.providers class ProviderTests(unittest.TestCase): def setUp(self): class Example(foauth.providers.OAuth): provider_url = 'http://example.com' api_domain = 'api.example.com' self.provider = Example def test_auto_name(self): self.assertEqual(self.provider.name, 'Example') def test_auto_alias(self): self.assertEqual(self.provider.alias, 'example') def test_auto_favicon_url(self): url = 'https://www.google.com/s2/favicons?domain=example.com' self.assertEqual(self.provider.favicon_url, url) def test_auto_api_domains(self): self.assertEqual(self.provider.api_domains, ['api.example.com']) <commit_msg>Fix favicon tests to match the new scheme<commit_after>
import unittest import foauth.providers import urllib class ProviderTests(unittest.TestCase): def setUp(self): class Example(foauth.providers.OAuth): provider_url = 'http://example.com' api_domain = 'api.example.com' self.provider = Example def test_auto_name(self): self.assertEqual(self.provider.name, 'Example') def test_auto_alias(self): self.assertEqual(self.provider.alias, 'example') def test_auto_favicon_url(self): primary = 'https://getfavicon.appspot.com/http://example.com' backup = 'https://www.google.com/s2/favicons?domain=example.com' url = '%s?defaulticon=%s' % (primary, urllib.quote(backup)) self.assertEqual(self.provider.favicon_url, url) def test_auto_api_domains(self): self.assertEqual(self.provider.api_domains, ['api.example.com'])
import unittest import foauth.providers class ProviderTests(unittest.TestCase): def setUp(self): class Example(foauth.providers.OAuth): provider_url = 'http://example.com' api_domain = 'api.example.com' self.provider = Example def test_auto_name(self): self.assertEqual(self.provider.name, 'Example') def test_auto_alias(self): self.assertEqual(self.provider.alias, 'example') def test_auto_favicon_url(self): url = 'https://www.google.com/s2/favicons?domain=example.com' self.assertEqual(self.provider.favicon_url, url) def test_auto_api_domains(self): self.assertEqual(self.provider.api_domains, ['api.example.com']) Fix favicon tests to match the new schemeimport unittest import foauth.providers import urllib class ProviderTests(unittest.TestCase): def setUp(self): class Example(foauth.providers.OAuth): provider_url = 'http://example.com' api_domain = 'api.example.com' self.provider = Example def test_auto_name(self): self.assertEqual(self.provider.name, 'Example') def test_auto_alias(self): self.assertEqual(self.provider.alias, 'example') def test_auto_favicon_url(self): primary = 'https://getfavicon.appspot.com/http://example.com' backup = 'https://www.google.com/s2/favicons?domain=example.com' url = '%s?defaulticon=%s' % (primary, urllib.quote(backup)) self.assertEqual(self.provider.favicon_url, url) def test_auto_api_domains(self): self.assertEqual(self.provider.api_domains, ['api.example.com'])
<commit_before>import unittest import foauth.providers class ProviderTests(unittest.TestCase): def setUp(self): class Example(foauth.providers.OAuth): provider_url = 'http://example.com' api_domain = 'api.example.com' self.provider = Example def test_auto_name(self): self.assertEqual(self.provider.name, 'Example') def test_auto_alias(self): self.assertEqual(self.provider.alias, 'example') def test_auto_favicon_url(self): url = 'https://www.google.com/s2/favicons?domain=example.com' self.assertEqual(self.provider.favicon_url, url) def test_auto_api_domains(self): self.assertEqual(self.provider.api_domains, ['api.example.com']) <commit_msg>Fix favicon tests to match the new scheme<commit_after>import unittest import foauth.providers import urllib class ProviderTests(unittest.TestCase): def setUp(self): class Example(foauth.providers.OAuth): provider_url = 'http://example.com' api_domain = 'api.example.com' self.provider = Example def test_auto_name(self): self.assertEqual(self.provider.name, 'Example') def test_auto_alias(self): self.assertEqual(self.provider.alias, 'example') def test_auto_favicon_url(self): primary = 'https://getfavicon.appspot.com/http://example.com' backup = 'https://www.google.com/s2/favicons?domain=example.com' url = '%s?defaulticon=%s' % (primary, urllib.quote(backup)) self.assertEqual(self.provider.favicon_url, url) def test_auto_api_domains(self): self.assertEqual(self.provider.api_domains, ['api.example.com'])
c75c1764e276d1cbda61e1258eb6e09298bce3ce
tests/test_bulk.py
tests/test_bulk.py
import json from django.db import models from django.conf import settings from django.test import TestCase from localized_fields.fields import LocalizedField, LocalizedUniqueSlugField from .data import get_init_values from .fake_model import get_fake_model class LocalizedBulkTestCase(TestCase): """Tests bulk operations with data structures provided by the django-localized-fields library.""" @staticmethod def test_localized_bulk_insert(): """Tests whether bulk inserts work properly when using a :see:LocalizedUniqueSlugField in the model.""" model = get_fake_model( 'BulkSlugInsertModel', { 'name': LocalizedField(), 'slug': LocalizedUniqueSlugField(populate_from='name', include_time=True), 'score': models.IntegerField() } ) objects = model.objects.bulk_create([ model(name={'en': 'english name 1', 'ro': 'romanian name 1'}, score=1), model(name={'en': 'english name 2', 'ro': 'romanian name 2'}, score=2), model(name={'en': 'english name 3', 'ro': 'romanian name 3'}, score=3) ]) assert model.objects.all().count() == 3
from django.db import models from django.test import TestCase from localized_fields.fields import LocalizedField, LocalizedUniqueSlugField from .fake_model import get_fake_model class LocalizedBulkTestCase(TestCase): """Tests bulk operations with data structures provided by the django-localized-fields library.""" @staticmethod def test_localized_bulk_insert(): """Tests whether bulk inserts work properly when using a :see:LocalizedUniqueSlugField in the model.""" model = get_fake_model( 'BulkSlugInsertModel', { 'name': LocalizedField(), 'slug': LocalizedUniqueSlugField(populate_from='name', include_time=True), 'score': models.IntegerField() } ) to_create = [ model(name={'en': 'english name 1', 'ro': 'romanian name 1'}, score=1), model(name={'en': 'english name 2', 'ro': 'romanian name 2'}, score=2), model(name={'en': 'english name 3', 'ro': 'romanian name 3'}, score=3) ] model.objects.bulk_create(to_create) assert model.objects.all().count() == 3 for obj in to_create: obj_db = model.objects.filter( name__en=obj.name.en, name__ro=obj.name.ro, score=obj.score ).first() assert obj_db assert len(obj_db.slug.en) >= len(obj_db.name.en) assert len(obj_db.slug.ro) >= len(obj_db.name.ro)
Improve test case for bulk_create
Improve test case for bulk_create
Python
mit
SectorLabs/django-localized-fields,SectorLabs/django-localized-fields,SectorLabs/django-localized-fields
import json from django.db import models from django.conf import settings from django.test import TestCase from localized_fields.fields import LocalizedField, LocalizedUniqueSlugField from .data import get_init_values from .fake_model import get_fake_model class LocalizedBulkTestCase(TestCase): """Tests bulk operations with data structures provided by the django-localized-fields library.""" @staticmethod def test_localized_bulk_insert(): """Tests whether bulk inserts work properly when using a :see:LocalizedUniqueSlugField in the model.""" model = get_fake_model( 'BulkSlugInsertModel', { 'name': LocalizedField(), 'slug': LocalizedUniqueSlugField(populate_from='name', include_time=True), 'score': models.IntegerField() } ) objects = model.objects.bulk_create([ model(name={'en': 'english name 1', 'ro': 'romanian name 1'}, score=1), model(name={'en': 'english name 2', 'ro': 'romanian name 2'}, score=2), model(name={'en': 'english name 3', 'ro': 'romanian name 3'}, score=3) ]) assert model.objects.all().count() == 3 Improve test case for bulk_create
from django.db import models from django.test import TestCase from localized_fields.fields import LocalizedField, LocalizedUniqueSlugField from .fake_model import get_fake_model class LocalizedBulkTestCase(TestCase): """Tests bulk operations with data structures provided by the django-localized-fields library.""" @staticmethod def test_localized_bulk_insert(): """Tests whether bulk inserts work properly when using a :see:LocalizedUniqueSlugField in the model.""" model = get_fake_model( 'BulkSlugInsertModel', { 'name': LocalizedField(), 'slug': LocalizedUniqueSlugField(populate_from='name', include_time=True), 'score': models.IntegerField() } ) to_create = [ model(name={'en': 'english name 1', 'ro': 'romanian name 1'}, score=1), model(name={'en': 'english name 2', 'ro': 'romanian name 2'}, score=2), model(name={'en': 'english name 3', 'ro': 'romanian name 3'}, score=3) ] model.objects.bulk_create(to_create) assert model.objects.all().count() == 3 for obj in to_create: obj_db = model.objects.filter( name__en=obj.name.en, name__ro=obj.name.ro, score=obj.score ).first() assert obj_db assert len(obj_db.slug.en) >= len(obj_db.name.en) assert len(obj_db.slug.ro) >= len(obj_db.name.ro)
<commit_before>import json from django.db import models from django.conf import settings from django.test import TestCase from localized_fields.fields import LocalizedField, LocalizedUniqueSlugField from .data import get_init_values from .fake_model import get_fake_model class LocalizedBulkTestCase(TestCase): """Tests bulk operations with data structures provided by the django-localized-fields library.""" @staticmethod def test_localized_bulk_insert(): """Tests whether bulk inserts work properly when using a :see:LocalizedUniqueSlugField in the model.""" model = get_fake_model( 'BulkSlugInsertModel', { 'name': LocalizedField(), 'slug': LocalizedUniqueSlugField(populate_from='name', include_time=True), 'score': models.IntegerField() } ) objects = model.objects.bulk_create([ model(name={'en': 'english name 1', 'ro': 'romanian name 1'}, score=1), model(name={'en': 'english name 2', 'ro': 'romanian name 2'}, score=2), model(name={'en': 'english name 3', 'ro': 'romanian name 3'}, score=3) ]) assert model.objects.all().count() == 3 <commit_msg>Improve test case for bulk_create<commit_after>
from django.db import models from django.test import TestCase from localized_fields.fields import LocalizedField, LocalizedUniqueSlugField from .fake_model import get_fake_model class LocalizedBulkTestCase(TestCase): """Tests bulk operations with data structures provided by the django-localized-fields library.""" @staticmethod def test_localized_bulk_insert(): """Tests whether bulk inserts work properly when using a :see:LocalizedUniqueSlugField in the model.""" model = get_fake_model( 'BulkSlugInsertModel', { 'name': LocalizedField(), 'slug': LocalizedUniqueSlugField(populate_from='name', include_time=True), 'score': models.IntegerField() } ) to_create = [ model(name={'en': 'english name 1', 'ro': 'romanian name 1'}, score=1), model(name={'en': 'english name 2', 'ro': 'romanian name 2'}, score=2), model(name={'en': 'english name 3', 'ro': 'romanian name 3'}, score=3) ] model.objects.bulk_create(to_create) assert model.objects.all().count() == 3 for obj in to_create: obj_db = model.objects.filter( name__en=obj.name.en, name__ro=obj.name.ro, score=obj.score ).first() assert obj_db assert len(obj_db.slug.en) >= len(obj_db.name.en) assert len(obj_db.slug.ro) >= len(obj_db.name.ro)
import json from django.db import models from django.conf import settings from django.test import TestCase from localized_fields.fields import LocalizedField, LocalizedUniqueSlugField from .data import get_init_values from .fake_model import get_fake_model class LocalizedBulkTestCase(TestCase): """Tests bulk operations with data structures provided by the django-localized-fields library.""" @staticmethod def test_localized_bulk_insert(): """Tests whether bulk inserts work properly when using a :see:LocalizedUniqueSlugField in the model.""" model = get_fake_model( 'BulkSlugInsertModel', { 'name': LocalizedField(), 'slug': LocalizedUniqueSlugField(populate_from='name', include_time=True), 'score': models.IntegerField() } ) objects = model.objects.bulk_create([ model(name={'en': 'english name 1', 'ro': 'romanian name 1'}, score=1), model(name={'en': 'english name 2', 'ro': 'romanian name 2'}, score=2), model(name={'en': 'english name 3', 'ro': 'romanian name 3'}, score=3) ]) assert model.objects.all().count() == 3 Improve test case for bulk_createfrom django.db import models from django.test import TestCase from localized_fields.fields import LocalizedField, LocalizedUniqueSlugField from .fake_model import get_fake_model class LocalizedBulkTestCase(TestCase): """Tests bulk operations with data structures provided by the django-localized-fields library.""" @staticmethod def test_localized_bulk_insert(): """Tests whether bulk inserts work properly when using a :see:LocalizedUniqueSlugField in the model.""" model = get_fake_model( 'BulkSlugInsertModel', { 'name': LocalizedField(), 'slug': LocalizedUniqueSlugField(populate_from='name', include_time=True), 'score': models.IntegerField() } ) to_create = [ model(name={'en': 'english name 1', 'ro': 'romanian name 1'}, score=1), model(name={'en': 'english name 2', 'ro': 'romanian name 2'}, score=2), model(name={'en': 'english name 3', 'ro': 'romanian name 3'}, score=3) ] model.objects.bulk_create(to_create) assert model.objects.all().count() == 3 for obj in to_create: obj_db = model.objects.filter( name__en=obj.name.en, name__ro=obj.name.ro, score=obj.score ).first() assert obj_db assert len(obj_db.slug.en) >= len(obj_db.name.en) assert len(obj_db.slug.ro) >= len(obj_db.name.ro)
<commit_before>import json from django.db import models from django.conf import settings from django.test import TestCase from localized_fields.fields import LocalizedField, LocalizedUniqueSlugField from .data import get_init_values from .fake_model import get_fake_model class LocalizedBulkTestCase(TestCase): """Tests bulk operations with data structures provided by the django-localized-fields library.""" @staticmethod def test_localized_bulk_insert(): """Tests whether bulk inserts work properly when using a :see:LocalizedUniqueSlugField in the model.""" model = get_fake_model( 'BulkSlugInsertModel', { 'name': LocalizedField(), 'slug': LocalizedUniqueSlugField(populate_from='name', include_time=True), 'score': models.IntegerField() } ) objects = model.objects.bulk_create([ model(name={'en': 'english name 1', 'ro': 'romanian name 1'}, score=1), model(name={'en': 'english name 2', 'ro': 'romanian name 2'}, score=2), model(name={'en': 'english name 3', 'ro': 'romanian name 3'}, score=3) ]) assert model.objects.all().count() == 3 <commit_msg>Improve test case for bulk_create<commit_after>from django.db import models from django.test import TestCase from localized_fields.fields import LocalizedField, LocalizedUniqueSlugField from .fake_model import get_fake_model class LocalizedBulkTestCase(TestCase): """Tests bulk operations with data structures provided by the django-localized-fields library.""" @staticmethod def test_localized_bulk_insert(): """Tests whether bulk inserts work properly when using a :see:LocalizedUniqueSlugField in the model.""" model = get_fake_model( 'BulkSlugInsertModel', { 'name': LocalizedField(), 'slug': LocalizedUniqueSlugField(populate_from='name', include_time=True), 'score': models.IntegerField() } ) to_create = [ model(name={'en': 'english name 1', 'ro': 'romanian name 1'}, score=1), model(name={'en': 'english name 2', 'ro': 'romanian name 2'}, score=2), model(name={'en': 'english name 3', 'ro': 'romanian name 3'}, score=3) ] model.objects.bulk_create(to_create) assert model.objects.all().count() == 3 for obj in to_create: obj_db = model.objects.filter( name__en=obj.name.en, name__ro=obj.name.ro, score=obj.score ).first() assert obj_db assert len(obj_db.slug.en) >= len(obj_db.name.en) assert len(obj_db.slug.ro) >= len(obj_db.name.ro)
84dea9ec30135e193789bc81c982070f4389427e
api/serializers.py
api/serializers.py
from django.forms import widgets from rest_framework import serializers from api.models import Reading from django.contrib.auth.models import User class ReadingSerializer(serializers.ModelSerializer): owner = serializers.Field(source='owner.username') class Meta: model = Reading fields = ('created', 'owner', 'pm10', 'pm10_reading', 'pm25', 'pm25_reading')
from rest_framework import serializers from api.models import Reading from django.contrib.auth.models import User import datetime class ReadingSerializer(serializers.HyperlinkedModelSerializer): owner = serializers.ReadOnlyField(source='owner.username') class Meta: model = Reading fields = ('url', 'pm10', 'pm25', 'pm10count', 'pm25count','created', 'owner','createdHour') def create(self, validated_data): return Reading.objects.create(**validated_data) class UserSerializer(serializers.HyperlinkedModelSerializer): readings = serializers.HyperlinkedRelatedField(many=True, view_name='reading-detail', read_only=True) class Meta: model = User fields = ('url', 'username', 'password', 'email', 'readings') write_only_fields = ('password',)
Add User Serializer to be able to create users from REST API
Add User Serializer to be able to create users from REST API
Python
bsd-3-clause
developmentseed/dustduino-server,codefornigeria/dustduino-server,developmentseed/dustduino-server,codefornigeria/dustduino-server,codefornigeria/dustduino-server,developmentseed/dustduino-server
from django.forms import widgets from rest_framework import serializers from api.models import Reading from django.contrib.auth.models import User class ReadingSerializer(serializers.ModelSerializer): owner = serializers.Field(source='owner.username') class Meta: model = Reading fields = ('created', 'owner', 'pm10', 'pm10_reading', 'pm25', 'pm25_reading') Add User Serializer to be able to create users from REST API
from rest_framework import serializers from api.models import Reading from django.contrib.auth.models import User import datetime class ReadingSerializer(serializers.HyperlinkedModelSerializer): owner = serializers.ReadOnlyField(source='owner.username') class Meta: model = Reading fields = ('url', 'pm10', 'pm25', 'pm10count', 'pm25count','created', 'owner','createdHour') def create(self, validated_data): return Reading.objects.create(**validated_data) class UserSerializer(serializers.HyperlinkedModelSerializer): readings = serializers.HyperlinkedRelatedField(many=True, view_name='reading-detail', read_only=True) class Meta: model = User fields = ('url', 'username', 'password', 'email', 'readings') write_only_fields = ('password',)
<commit_before>from django.forms import widgets from rest_framework import serializers from api.models import Reading from django.contrib.auth.models import User class ReadingSerializer(serializers.ModelSerializer): owner = serializers.Field(source='owner.username') class Meta: model = Reading fields = ('created', 'owner', 'pm10', 'pm10_reading', 'pm25', 'pm25_reading') <commit_msg>Add User Serializer to be able to create users from REST API<commit_after>
from rest_framework import serializers from api.models import Reading from django.contrib.auth.models import User import datetime class ReadingSerializer(serializers.HyperlinkedModelSerializer): owner = serializers.ReadOnlyField(source='owner.username') class Meta: model = Reading fields = ('url', 'pm10', 'pm25', 'pm10count', 'pm25count','created', 'owner','createdHour') def create(self, validated_data): return Reading.objects.create(**validated_data) class UserSerializer(serializers.HyperlinkedModelSerializer): readings = serializers.HyperlinkedRelatedField(many=True, view_name='reading-detail', read_only=True) class Meta: model = User fields = ('url', 'username', 'password', 'email', 'readings') write_only_fields = ('password',)
from django.forms import widgets from rest_framework import serializers from api.models import Reading from django.contrib.auth.models import User class ReadingSerializer(serializers.ModelSerializer): owner = serializers.Field(source='owner.username') class Meta: model = Reading fields = ('created', 'owner', 'pm10', 'pm10_reading', 'pm25', 'pm25_reading') Add User Serializer to be able to create users from REST APIfrom rest_framework import serializers from api.models import Reading from django.contrib.auth.models import User import datetime class ReadingSerializer(serializers.HyperlinkedModelSerializer): owner = serializers.ReadOnlyField(source='owner.username') class Meta: model = Reading fields = ('url', 'pm10', 'pm25', 'pm10count', 'pm25count','created', 'owner','createdHour') def create(self, validated_data): return Reading.objects.create(**validated_data) class UserSerializer(serializers.HyperlinkedModelSerializer): readings = serializers.HyperlinkedRelatedField(many=True, view_name='reading-detail', read_only=True) class Meta: model = User fields = ('url', 'username', 'password', 'email', 'readings') write_only_fields = ('password',)
<commit_before>from django.forms import widgets from rest_framework import serializers from api.models import Reading from django.contrib.auth.models import User class ReadingSerializer(serializers.ModelSerializer): owner = serializers.Field(source='owner.username') class Meta: model = Reading fields = ('created', 'owner', 'pm10', 'pm10_reading', 'pm25', 'pm25_reading') <commit_msg>Add User Serializer to be able to create users from REST API<commit_after>from rest_framework import serializers from api.models import Reading from django.contrib.auth.models import User import datetime class ReadingSerializer(serializers.HyperlinkedModelSerializer): owner = serializers.ReadOnlyField(source='owner.username') class Meta: model = Reading fields = ('url', 'pm10', 'pm25', 'pm10count', 'pm25count','created', 'owner','createdHour') def create(self, validated_data): return Reading.objects.create(**validated_data) class UserSerializer(serializers.HyperlinkedModelSerializer): readings = serializers.HyperlinkedRelatedField(many=True, view_name='reading-detail', read_only=True) class Meta: model = User fields = ('url', 'username', 'password', 'email', 'readings') write_only_fields = ('password',)
3b9d15fcedd5edbe6dcf8ad58e9dbee0cecb6a04
sentry/core/processors.py
sentry/core/processors.py
""" sentry.core.processors ~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ class Processor(object): def process(self, data): resp = self.get_data(data) if resp: data['extra'].update(resp) return data def get_data(self, data): return {} from pprint import pprint def sanitize_passwords_processor(data): """ Asterisk out passwords from password fields in frames. """ if 'sentry.interfaces.Exception' in data: if 'frames' in data['sentry.interfaces.Exception']: for frame in data['sentry.interfaces.Exception']['frames']: if 'vars' in frame: print frame['vars'] for k,v in frame['vars'].iteritems(): if k.startswith('password'): frame['vars'][k] = '*'*len(v) return data #class SantizePasswordsProcessor(Processor):
""" sentry.core.processors ~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ class Processor(object): def process(self, data): resp = self.get_data(data) if resp: data['extra'].update(resp) return data def get_data(self, data): return {} def sanitize_passwords_processor(data): """ Asterisk out passwords from password fields in frames. """ if 'sentry.interfaces.Exception' in data: if 'frames' in data['sentry.interfaces.Exception']: for frame in data['sentry.interfaces.Exception']['frames']: if 'vars' in frame: for k,v in frame['vars'].iteritems(): if k.startswith('password'): # store mask as a fixed length for security frame['vars'][k] = '*'*16 return data #class SantizePasswordsProcessor(Processor):
Remove print statement and change mask to use a fixed length
Remove print statement and change mask to use a fixed length
Python
bsd-3-clause
dcramer/sentry-old,dcramer/sentry-old,dcramer/sentry-old
""" sentry.core.processors ~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ class Processor(object): def process(self, data): resp = self.get_data(data) if resp: data['extra'].update(resp) return data def get_data(self, data): return {} from pprint import pprint def sanitize_passwords_processor(data): """ Asterisk out passwords from password fields in frames. """ if 'sentry.interfaces.Exception' in data: if 'frames' in data['sentry.interfaces.Exception']: for frame in data['sentry.interfaces.Exception']['frames']: if 'vars' in frame: print frame['vars'] for k,v in frame['vars'].iteritems(): if k.startswith('password'): frame['vars'][k] = '*'*len(v) return data #class SantizePasswordsProcessor(Processor): Remove print statement and change mask to use a fixed length
""" sentry.core.processors ~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ class Processor(object): def process(self, data): resp = self.get_data(data) if resp: data['extra'].update(resp) return data def get_data(self, data): return {} def sanitize_passwords_processor(data): """ Asterisk out passwords from password fields in frames. """ if 'sentry.interfaces.Exception' in data: if 'frames' in data['sentry.interfaces.Exception']: for frame in data['sentry.interfaces.Exception']['frames']: if 'vars' in frame: for k,v in frame['vars'].iteritems(): if k.startswith('password'): # store mask as a fixed length for security frame['vars'][k] = '*'*16 return data #class SantizePasswordsProcessor(Processor):
<commit_before>""" sentry.core.processors ~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ class Processor(object): def process(self, data): resp = self.get_data(data) if resp: data['extra'].update(resp) return data def get_data(self, data): return {} from pprint import pprint def sanitize_passwords_processor(data): """ Asterisk out passwords from password fields in frames. """ if 'sentry.interfaces.Exception' in data: if 'frames' in data['sentry.interfaces.Exception']: for frame in data['sentry.interfaces.Exception']['frames']: if 'vars' in frame: print frame['vars'] for k,v in frame['vars'].iteritems(): if k.startswith('password'): frame['vars'][k] = '*'*len(v) return data #class SantizePasswordsProcessor(Processor): <commit_msg>Remove print statement and change mask to use a fixed length<commit_after>
""" sentry.core.processors ~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ class Processor(object): def process(self, data): resp = self.get_data(data) if resp: data['extra'].update(resp) return data def get_data(self, data): return {} def sanitize_passwords_processor(data): """ Asterisk out passwords from password fields in frames. """ if 'sentry.interfaces.Exception' in data: if 'frames' in data['sentry.interfaces.Exception']: for frame in data['sentry.interfaces.Exception']['frames']: if 'vars' in frame: for k,v in frame['vars'].iteritems(): if k.startswith('password'): # store mask as a fixed length for security frame['vars'][k] = '*'*16 return data #class SantizePasswordsProcessor(Processor):
""" sentry.core.processors ~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ class Processor(object): def process(self, data): resp = self.get_data(data) if resp: data['extra'].update(resp) return data def get_data(self, data): return {} from pprint import pprint def sanitize_passwords_processor(data): """ Asterisk out passwords from password fields in frames. """ if 'sentry.interfaces.Exception' in data: if 'frames' in data['sentry.interfaces.Exception']: for frame in data['sentry.interfaces.Exception']['frames']: if 'vars' in frame: print frame['vars'] for k,v in frame['vars'].iteritems(): if k.startswith('password'): frame['vars'][k] = '*'*len(v) return data #class SantizePasswordsProcessor(Processor): Remove print statement and change mask to use a fixed length""" sentry.core.processors ~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ class Processor(object): def process(self, data): resp = self.get_data(data) if resp: data['extra'].update(resp) return data def get_data(self, data): return {} def sanitize_passwords_processor(data): """ Asterisk out passwords from password fields in frames. """ if 'sentry.interfaces.Exception' in data: if 'frames' in data['sentry.interfaces.Exception']: for frame in data['sentry.interfaces.Exception']['frames']: if 'vars' in frame: for k,v in frame['vars'].iteritems(): if k.startswith('password'): # store mask as a fixed length for security frame['vars'][k] = '*'*16 return data #class SantizePasswordsProcessor(Processor):
<commit_before>""" sentry.core.processors ~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ class Processor(object): def process(self, data): resp = self.get_data(data) if resp: data['extra'].update(resp) return data def get_data(self, data): return {} from pprint import pprint def sanitize_passwords_processor(data): """ Asterisk out passwords from password fields in frames. """ if 'sentry.interfaces.Exception' in data: if 'frames' in data['sentry.interfaces.Exception']: for frame in data['sentry.interfaces.Exception']['frames']: if 'vars' in frame: print frame['vars'] for k,v in frame['vars'].iteritems(): if k.startswith('password'): frame['vars'][k] = '*'*len(v) return data #class SantizePasswordsProcessor(Processor): <commit_msg>Remove print statement and change mask to use a fixed length<commit_after>""" sentry.core.processors ~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ class Processor(object): def process(self, data): resp = self.get_data(data) if resp: data['extra'].update(resp) return data def get_data(self, data): return {} def sanitize_passwords_processor(data): """ Asterisk out passwords from password fields in frames. """ if 'sentry.interfaces.Exception' in data: if 'frames' in data['sentry.interfaces.Exception']: for frame in data['sentry.interfaces.Exception']['frames']: if 'vars' in frame: for k,v in frame['vars'].iteritems(): if k.startswith('password'): # store mask as a fixed length for security frame['vars'][k] = '*'*16 return data #class SantizePasswordsProcessor(Processor):
a3b9a98265c56f2a687e618ca1851f3a70ead34c
thetis/__init__.py
thetis/__init__.py
from __future__ import absolute_import from thetis.utility import * from thetis.log import * import thetis.timeintegrator as timeintegrator # NOQA import thetis.solver as solver # NOQA import thetis.solver2d as solver2d # NOQA from thetis.callback import DiagnosticCallback # NOQA import thetis.limiter as limiter # NOQA parameters['assembly_cache']['enabled'] = False
from __future__ import absolute_import from thetis.utility import * # NOQA from thetis.log import * # NOQA import thetis.timeintegrator as timeintegrator # NOQA import thetis.solver as solver # NOQA import thetis.solver2d as solver2d # NOQA from thetis.callback import DiagnosticCallback # NOQA import thetis.limiter as limiter # NOQA
Remove no longer existing assembly cache option.
Remove no longer existing assembly cache option.
Python
mit
tkarna/cofs
from __future__ import absolute_import from thetis.utility import * from thetis.log import * import thetis.timeintegrator as timeintegrator # NOQA import thetis.solver as solver # NOQA import thetis.solver2d as solver2d # NOQA from thetis.callback import DiagnosticCallback # NOQA import thetis.limiter as limiter # NOQA parameters['assembly_cache']['enabled'] = False Remove no longer existing assembly cache option.
from __future__ import absolute_import from thetis.utility import * # NOQA from thetis.log import * # NOQA import thetis.timeintegrator as timeintegrator # NOQA import thetis.solver as solver # NOQA import thetis.solver2d as solver2d # NOQA from thetis.callback import DiagnosticCallback # NOQA import thetis.limiter as limiter # NOQA
<commit_before>from __future__ import absolute_import from thetis.utility import * from thetis.log import * import thetis.timeintegrator as timeintegrator # NOQA import thetis.solver as solver # NOQA import thetis.solver2d as solver2d # NOQA from thetis.callback import DiagnosticCallback # NOQA import thetis.limiter as limiter # NOQA parameters['assembly_cache']['enabled'] = False <commit_msg>Remove no longer existing assembly cache option.<commit_after>
from __future__ import absolute_import from thetis.utility import * # NOQA from thetis.log import * # NOQA import thetis.timeintegrator as timeintegrator # NOQA import thetis.solver as solver # NOQA import thetis.solver2d as solver2d # NOQA from thetis.callback import DiagnosticCallback # NOQA import thetis.limiter as limiter # NOQA
from __future__ import absolute_import from thetis.utility import * from thetis.log import * import thetis.timeintegrator as timeintegrator # NOQA import thetis.solver as solver # NOQA import thetis.solver2d as solver2d # NOQA from thetis.callback import DiagnosticCallback # NOQA import thetis.limiter as limiter # NOQA parameters['assembly_cache']['enabled'] = False Remove no longer existing assembly cache option.from __future__ import absolute_import from thetis.utility import * # NOQA from thetis.log import * # NOQA import thetis.timeintegrator as timeintegrator # NOQA import thetis.solver as solver # NOQA import thetis.solver2d as solver2d # NOQA from thetis.callback import DiagnosticCallback # NOQA import thetis.limiter as limiter # NOQA
<commit_before>from __future__ import absolute_import from thetis.utility import * from thetis.log import * import thetis.timeintegrator as timeintegrator # NOQA import thetis.solver as solver # NOQA import thetis.solver2d as solver2d # NOQA from thetis.callback import DiagnosticCallback # NOQA import thetis.limiter as limiter # NOQA parameters['assembly_cache']['enabled'] = False <commit_msg>Remove no longer existing assembly cache option.<commit_after>from __future__ import absolute_import from thetis.utility import * # NOQA from thetis.log import * # NOQA import thetis.timeintegrator as timeintegrator # NOQA import thetis.solver as solver # NOQA import thetis.solver2d as solver2d # NOQA from thetis.callback import DiagnosticCallback # NOQA import thetis.limiter as limiter # NOQA
d391f6fe8371b045cd684841da59984e5b28b1b3
plata/product/producer/models.py
plata/product/producer/models.py
from datetime import datetime from django.db import models from django.db.models import Sum, signals from django.utils.translation import ugettext_lazy as _ from plata.product.models import Product class ProducerManager(models.Manager): def active(self): return self.filter(is_active=True) class Producer(models.Model): is_active = models.BooleanField(_('is active'), default=True) name = models.CharField(_('name'), max_length=100) slug = models.SlugField(_('slug'), unique=True) ordering = models.PositiveIntegerField(_('ordering'), default=0) description = models.TextField(_('description'), blank=True) class Meta: app_label = 'product' ordering = ['ordering', 'name'] verbose_name = _('producer') verbose_name_plural = _('producers') def __unicode__(self): return self.name Product.add_to_class('producer', models.ForeignKey(Producer, related_name='products', verbose_name=_('producer')))
from datetime import datetime from django.db import models from django.db.models import Sum, signals from django.utils.translation import ugettext_lazy as _ from plata.product.models import Product class ProducerManager(models.Manager): def active(self): return self.filter(is_active=True) class Producer(models.Model): is_active = models.BooleanField(_('is active'), default=True) name = models.CharField(_('name'), max_length=100) slug = models.SlugField(_('slug'), unique=True) ordering = models.PositiveIntegerField(_('ordering'), default=0) description = models.TextField(_('description'), blank=True) class Meta: app_label = 'product' ordering = ['ordering', 'name'] verbose_name = _('producer') verbose_name_plural = _('producers') def __unicode__(self): return self.name Product.add_to_class('producer', models.ForeignKey(Producer, blank=True, null=True, related_name='products', verbose_name=_('producer')))
Revert "It shouldn't be that hard to define a producer, really"
Revert "It shouldn't be that hard to define a producer, really" Sometimes it is. This reverts commit 883c518d8844bd006d6abc783b315aea01d59b69.
Python
bsd-3-clause
allink/plata,armicron/plata,stefanklug/plata,armicron/plata,armicron/plata
from datetime import datetime from django.db import models from django.db.models import Sum, signals from django.utils.translation import ugettext_lazy as _ from plata.product.models import Product class ProducerManager(models.Manager): def active(self): return self.filter(is_active=True) class Producer(models.Model): is_active = models.BooleanField(_('is active'), default=True) name = models.CharField(_('name'), max_length=100) slug = models.SlugField(_('slug'), unique=True) ordering = models.PositiveIntegerField(_('ordering'), default=0) description = models.TextField(_('description'), blank=True) class Meta: app_label = 'product' ordering = ['ordering', 'name'] verbose_name = _('producer') verbose_name_plural = _('producers') def __unicode__(self): return self.name Product.add_to_class('producer', models.ForeignKey(Producer, related_name='products', verbose_name=_('producer'))) Revert "It shouldn't be that hard to define a producer, really" Sometimes it is. This reverts commit 883c518d8844bd006d6abc783b315aea01d59b69.
from datetime import datetime from django.db import models from django.db.models import Sum, signals from django.utils.translation import ugettext_lazy as _ from plata.product.models import Product class ProducerManager(models.Manager): def active(self): return self.filter(is_active=True) class Producer(models.Model): is_active = models.BooleanField(_('is active'), default=True) name = models.CharField(_('name'), max_length=100) slug = models.SlugField(_('slug'), unique=True) ordering = models.PositiveIntegerField(_('ordering'), default=0) description = models.TextField(_('description'), blank=True) class Meta: app_label = 'product' ordering = ['ordering', 'name'] verbose_name = _('producer') verbose_name_plural = _('producers') def __unicode__(self): return self.name Product.add_to_class('producer', models.ForeignKey(Producer, blank=True, null=True, related_name='products', verbose_name=_('producer')))
<commit_before>from datetime import datetime from django.db import models from django.db.models import Sum, signals from django.utils.translation import ugettext_lazy as _ from plata.product.models import Product class ProducerManager(models.Manager): def active(self): return self.filter(is_active=True) class Producer(models.Model): is_active = models.BooleanField(_('is active'), default=True) name = models.CharField(_('name'), max_length=100) slug = models.SlugField(_('slug'), unique=True) ordering = models.PositiveIntegerField(_('ordering'), default=0) description = models.TextField(_('description'), blank=True) class Meta: app_label = 'product' ordering = ['ordering', 'name'] verbose_name = _('producer') verbose_name_plural = _('producers') def __unicode__(self): return self.name Product.add_to_class('producer', models.ForeignKey(Producer, related_name='products', verbose_name=_('producer'))) <commit_msg>Revert "It shouldn't be that hard to define a producer, really" Sometimes it is. This reverts commit 883c518d8844bd006d6abc783b315aea01d59b69.<commit_after>
from datetime import datetime from django.db import models from django.db.models import Sum, signals from django.utils.translation import ugettext_lazy as _ from plata.product.models import Product class ProducerManager(models.Manager): def active(self): return self.filter(is_active=True) class Producer(models.Model): is_active = models.BooleanField(_('is active'), default=True) name = models.CharField(_('name'), max_length=100) slug = models.SlugField(_('slug'), unique=True) ordering = models.PositiveIntegerField(_('ordering'), default=0) description = models.TextField(_('description'), blank=True) class Meta: app_label = 'product' ordering = ['ordering', 'name'] verbose_name = _('producer') verbose_name_plural = _('producers') def __unicode__(self): return self.name Product.add_to_class('producer', models.ForeignKey(Producer, blank=True, null=True, related_name='products', verbose_name=_('producer')))
from datetime import datetime from django.db import models from django.db.models import Sum, signals from django.utils.translation import ugettext_lazy as _ from plata.product.models import Product class ProducerManager(models.Manager): def active(self): return self.filter(is_active=True) class Producer(models.Model): is_active = models.BooleanField(_('is active'), default=True) name = models.CharField(_('name'), max_length=100) slug = models.SlugField(_('slug'), unique=True) ordering = models.PositiveIntegerField(_('ordering'), default=0) description = models.TextField(_('description'), blank=True) class Meta: app_label = 'product' ordering = ['ordering', 'name'] verbose_name = _('producer') verbose_name_plural = _('producers') def __unicode__(self): return self.name Product.add_to_class('producer', models.ForeignKey(Producer, related_name='products', verbose_name=_('producer'))) Revert "It shouldn't be that hard to define a producer, really" Sometimes it is. This reverts commit 883c518d8844bd006d6abc783b315aea01d59b69.from datetime import datetime from django.db import models from django.db.models import Sum, signals from django.utils.translation import ugettext_lazy as _ from plata.product.models import Product class ProducerManager(models.Manager): def active(self): return self.filter(is_active=True) class Producer(models.Model): is_active = models.BooleanField(_('is active'), default=True) name = models.CharField(_('name'), max_length=100) slug = models.SlugField(_('slug'), unique=True) ordering = models.PositiveIntegerField(_('ordering'), default=0) description = models.TextField(_('description'), blank=True) class Meta: app_label = 'product' ordering = ['ordering', 'name'] verbose_name = _('producer') verbose_name_plural = _('producers') def __unicode__(self): return self.name Product.add_to_class('producer', models.ForeignKey(Producer, blank=True, null=True, related_name='products', verbose_name=_('producer')))
<commit_before>from datetime import datetime from django.db import models from django.db.models import Sum, signals from django.utils.translation import ugettext_lazy as _ from plata.product.models import Product class ProducerManager(models.Manager): def active(self): return self.filter(is_active=True) class Producer(models.Model): is_active = models.BooleanField(_('is active'), default=True) name = models.CharField(_('name'), max_length=100) slug = models.SlugField(_('slug'), unique=True) ordering = models.PositiveIntegerField(_('ordering'), default=0) description = models.TextField(_('description'), blank=True) class Meta: app_label = 'product' ordering = ['ordering', 'name'] verbose_name = _('producer') verbose_name_plural = _('producers') def __unicode__(self): return self.name Product.add_to_class('producer', models.ForeignKey(Producer, related_name='products', verbose_name=_('producer'))) <commit_msg>Revert "It shouldn't be that hard to define a producer, really" Sometimes it is. This reverts commit 883c518d8844bd006d6abc783b315aea01d59b69.<commit_after>from datetime import datetime from django.db import models from django.db.models import Sum, signals from django.utils.translation import ugettext_lazy as _ from plata.product.models import Product class ProducerManager(models.Manager): def active(self): return self.filter(is_active=True) class Producer(models.Model): is_active = models.BooleanField(_('is active'), default=True) name = models.CharField(_('name'), max_length=100) slug = models.SlugField(_('slug'), unique=True) ordering = models.PositiveIntegerField(_('ordering'), default=0) description = models.TextField(_('description'), blank=True) class Meta: app_label = 'product' ordering = ['ordering', 'name'] verbose_name = _('producer') verbose_name_plural = _('producers') def __unicode__(self): return self.name Product.add_to_class('producer', models.ForeignKey(Producer, blank=True, null=True, related_name='products', verbose_name=_('producer')))
64a1bb661f7ff1beb2e65b8f87a7528787e27b06
test/use_lldb_suite.py
test/use_lldb_suite.py
import inspect import os import sys def find_lldb_root(): lldb_root = os.path.dirname(inspect.getfile(inspect.currentframe())) while True: lldb_root = os.path.dirname(lldb_root) if lldb_root is None: return None test_path = os.path.join(lldb_root, "use_lldb_suite_root.py") if os.path.isfile(test_path): return lldb_root return None lldb_root = find_lldb_root() if lldb_root is not None: import imp fp, pathname, desc = imp.find_module("use_lldb_suite_root", [lldb_root]) try: imp.load_module("use_lldb_suite_root", fp, pathname, desc) finally: if fp: fp.close()
import inspect import os import sys def find_lldb_root(): lldb_root = os.path.dirname( os.path.abspath(inspect.getfile(inspect.currentframe())) ) while True: lldb_root = os.path.dirname(lldb_root) if lldb_root is None: return None test_path = os.path.join(lldb_root, "use_lldb_suite_root.py") if os.path.isfile(test_path): return lldb_root return None lldb_root = find_lldb_root() if lldb_root is not None: import imp fp, pathname, desc = imp.find_module("use_lldb_suite_root", [lldb_root]) try: imp.load_module("use_lldb_suite_root", fp, pathname, desc) finally: if fp: fp.close()
Modify lldb_suite.py to enable python debugging
Modify lldb_suite.py to enable python debugging Summary: pudb and pdb interfere with the behavior of the inspect module. calling `inspect.getfile(inspect.currentframe())` returns a different result depending on whether or not you're in a debugger. Calling `os.path.abspath` on the result of `inspect.getfile(...)` normalizes the result between the two environments. Patch by Nathan Lanza <lanza@fb.com> Differential Revision: https://reviews.llvm.org/D49620 git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@338923 91177308-0d34-0410-b5e6-96231b3b80d8
Python
apache-2.0
llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb
import inspect import os import sys def find_lldb_root(): lldb_root = os.path.dirname(inspect.getfile(inspect.currentframe())) while True: lldb_root = os.path.dirname(lldb_root) if lldb_root is None: return None test_path = os.path.join(lldb_root, "use_lldb_suite_root.py") if os.path.isfile(test_path): return lldb_root return None lldb_root = find_lldb_root() if lldb_root is not None: import imp fp, pathname, desc = imp.find_module("use_lldb_suite_root", [lldb_root]) try: imp.load_module("use_lldb_suite_root", fp, pathname, desc) finally: if fp: fp.close() Modify lldb_suite.py to enable python debugging Summary: pudb and pdb interfere with the behavior of the inspect module. calling `inspect.getfile(inspect.currentframe())` returns a different result depending on whether or not you're in a debugger. Calling `os.path.abspath` on the result of `inspect.getfile(...)` normalizes the result between the two environments. Patch by Nathan Lanza <lanza@fb.com> Differential Revision: https://reviews.llvm.org/D49620 git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@338923 91177308-0d34-0410-b5e6-96231b3b80d8
import inspect import os import sys def find_lldb_root(): lldb_root = os.path.dirname( os.path.abspath(inspect.getfile(inspect.currentframe())) ) while True: lldb_root = os.path.dirname(lldb_root) if lldb_root is None: return None test_path = os.path.join(lldb_root, "use_lldb_suite_root.py") if os.path.isfile(test_path): return lldb_root return None lldb_root = find_lldb_root() if lldb_root is not None: import imp fp, pathname, desc = imp.find_module("use_lldb_suite_root", [lldb_root]) try: imp.load_module("use_lldb_suite_root", fp, pathname, desc) finally: if fp: fp.close()
<commit_before>import inspect import os import sys def find_lldb_root(): lldb_root = os.path.dirname(inspect.getfile(inspect.currentframe())) while True: lldb_root = os.path.dirname(lldb_root) if lldb_root is None: return None test_path = os.path.join(lldb_root, "use_lldb_suite_root.py") if os.path.isfile(test_path): return lldb_root return None lldb_root = find_lldb_root() if lldb_root is not None: import imp fp, pathname, desc = imp.find_module("use_lldb_suite_root", [lldb_root]) try: imp.load_module("use_lldb_suite_root", fp, pathname, desc) finally: if fp: fp.close() <commit_msg>Modify lldb_suite.py to enable python debugging Summary: pudb and pdb interfere with the behavior of the inspect module. calling `inspect.getfile(inspect.currentframe())` returns a different result depending on whether or not you're in a debugger. Calling `os.path.abspath` on the result of `inspect.getfile(...)` normalizes the result between the two environments. Patch by Nathan Lanza <lanza@fb.com> Differential Revision: https://reviews.llvm.org/D49620 git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@338923 91177308-0d34-0410-b5e6-96231b3b80d8<commit_after>
import inspect import os import sys def find_lldb_root(): lldb_root = os.path.dirname( os.path.abspath(inspect.getfile(inspect.currentframe())) ) while True: lldb_root = os.path.dirname(lldb_root) if lldb_root is None: return None test_path = os.path.join(lldb_root, "use_lldb_suite_root.py") if os.path.isfile(test_path): return lldb_root return None lldb_root = find_lldb_root() if lldb_root is not None: import imp fp, pathname, desc = imp.find_module("use_lldb_suite_root", [lldb_root]) try: imp.load_module("use_lldb_suite_root", fp, pathname, desc) finally: if fp: fp.close()
import inspect import os import sys def find_lldb_root(): lldb_root = os.path.dirname(inspect.getfile(inspect.currentframe())) while True: lldb_root = os.path.dirname(lldb_root) if lldb_root is None: return None test_path = os.path.join(lldb_root, "use_lldb_suite_root.py") if os.path.isfile(test_path): return lldb_root return None lldb_root = find_lldb_root() if lldb_root is not None: import imp fp, pathname, desc = imp.find_module("use_lldb_suite_root", [lldb_root]) try: imp.load_module("use_lldb_suite_root", fp, pathname, desc) finally: if fp: fp.close() Modify lldb_suite.py to enable python debugging Summary: pudb and pdb interfere with the behavior of the inspect module. calling `inspect.getfile(inspect.currentframe())` returns a different result depending on whether or not you're in a debugger. Calling `os.path.abspath` on the result of `inspect.getfile(...)` normalizes the result between the two environments. Patch by Nathan Lanza <lanza@fb.com> Differential Revision: https://reviews.llvm.org/D49620 git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@338923 91177308-0d34-0410-b5e6-96231b3b80d8import inspect import os import sys def find_lldb_root(): lldb_root = os.path.dirname( os.path.abspath(inspect.getfile(inspect.currentframe())) ) while True: lldb_root = os.path.dirname(lldb_root) if lldb_root is None: return None test_path = os.path.join(lldb_root, "use_lldb_suite_root.py") if os.path.isfile(test_path): return lldb_root return None lldb_root = find_lldb_root() if lldb_root is not None: import imp fp, pathname, desc = imp.find_module("use_lldb_suite_root", [lldb_root]) try: imp.load_module("use_lldb_suite_root", fp, pathname, desc) finally: if fp: fp.close()
<commit_before>import inspect import os import sys def find_lldb_root(): lldb_root = os.path.dirname(inspect.getfile(inspect.currentframe())) while True: lldb_root = os.path.dirname(lldb_root) if lldb_root is None: return None test_path = os.path.join(lldb_root, "use_lldb_suite_root.py") if os.path.isfile(test_path): return lldb_root return None lldb_root = find_lldb_root() if lldb_root is not None: import imp fp, pathname, desc = imp.find_module("use_lldb_suite_root", [lldb_root]) try: imp.load_module("use_lldb_suite_root", fp, pathname, desc) finally: if fp: fp.close() <commit_msg>Modify lldb_suite.py to enable python debugging Summary: pudb and pdb interfere with the behavior of the inspect module. calling `inspect.getfile(inspect.currentframe())` returns a different result depending on whether or not you're in a debugger. Calling `os.path.abspath` on the result of `inspect.getfile(...)` normalizes the result between the two environments. Patch by Nathan Lanza <lanza@fb.com> Differential Revision: https://reviews.llvm.org/D49620 git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@338923 91177308-0d34-0410-b5e6-96231b3b80d8<commit_after>import inspect import os import sys def find_lldb_root(): lldb_root = os.path.dirname( os.path.abspath(inspect.getfile(inspect.currentframe())) ) while True: lldb_root = os.path.dirname(lldb_root) if lldb_root is None: return None test_path = os.path.join(lldb_root, "use_lldb_suite_root.py") if os.path.isfile(test_path): return lldb_root return None lldb_root = find_lldb_root() if lldb_root is not None: import imp fp, pathname, desc = imp.find_module("use_lldb_suite_root", [lldb_root]) try: imp.load_module("use_lldb_suite_root", fp, pathname, desc) finally: if fp: fp.close()
d1f0d0d913f8857b5390b8e17e96892525f87895
doc/fake_cffi.py
doc/fake_cffi.py
"""Mock module for Sphinx autodoc.""" class FFI(object): NULL = NotImplemented I_AM_FAKE = True # This is used for the documentation of "default" def cdef(self, _): pass def dlopen(self, _): return FakePortAudio() class FakePortAudio(object): paFloat32 = paInt32 = paInt24 = paInt16 = paInt8 = paUInt8 = NotImplemented paFramesPerBufferUnspecified = 0 def Pa_Initialize(self): return 0 def Pa_Terminate(self): return 0
"""Mock module for Sphinx autodoc.""" class FFI(object): NULL = NotImplemented I_AM_FAKE = True # This is used for the documentation of "default" def cdef(self, _): pass def dlopen(self, _): return FakeLibrary() class FakeLibrary(object): # from portaudio.h: paFloat32 = paInt32 = paInt24 = paInt16 = paInt8 = paUInt8 = NotImplemented paFramesPerBufferUnspecified = 0 def Pa_Initialize(self): return 0 def Pa_Terminate(self): return 0 # from stdio.h: def fopen(*args, **kwargs): return NotImplemented def fclose(*args): pass
Add fopen()/fclose() to CFFI mock module
DOC: Add fopen()/fclose() to CFFI mock module
Python
mit
spatialaudio/python-sounddevice,tgarc/python-sounddevice,dholl/python-sounddevice,dholl/python-sounddevice,spatialaudio/python-sounddevice,tgarc/python-sounddevice
"""Mock module for Sphinx autodoc.""" class FFI(object): NULL = NotImplemented I_AM_FAKE = True # This is used for the documentation of "default" def cdef(self, _): pass def dlopen(self, _): return FakePortAudio() class FakePortAudio(object): paFloat32 = paInt32 = paInt24 = paInt16 = paInt8 = paUInt8 = NotImplemented paFramesPerBufferUnspecified = 0 def Pa_Initialize(self): return 0 def Pa_Terminate(self): return 0 DOC: Add fopen()/fclose() to CFFI mock module
"""Mock module for Sphinx autodoc.""" class FFI(object): NULL = NotImplemented I_AM_FAKE = True # This is used for the documentation of "default" def cdef(self, _): pass def dlopen(self, _): return FakeLibrary() class FakeLibrary(object): # from portaudio.h: paFloat32 = paInt32 = paInt24 = paInt16 = paInt8 = paUInt8 = NotImplemented paFramesPerBufferUnspecified = 0 def Pa_Initialize(self): return 0 def Pa_Terminate(self): return 0 # from stdio.h: def fopen(*args, **kwargs): return NotImplemented def fclose(*args): pass
<commit_before>"""Mock module for Sphinx autodoc.""" class FFI(object): NULL = NotImplemented I_AM_FAKE = True # This is used for the documentation of "default" def cdef(self, _): pass def dlopen(self, _): return FakePortAudio() class FakePortAudio(object): paFloat32 = paInt32 = paInt24 = paInt16 = paInt8 = paUInt8 = NotImplemented paFramesPerBufferUnspecified = 0 def Pa_Initialize(self): return 0 def Pa_Terminate(self): return 0 <commit_msg>DOC: Add fopen()/fclose() to CFFI mock module<commit_after>
"""Mock module for Sphinx autodoc.""" class FFI(object): NULL = NotImplemented I_AM_FAKE = True # This is used for the documentation of "default" def cdef(self, _): pass def dlopen(self, _): return FakeLibrary() class FakeLibrary(object): # from portaudio.h: paFloat32 = paInt32 = paInt24 = paInt16 = paInt8 = paUInt8 = NotImplemented paFramesPerBufferUnspecified = 0 def Pa_Initialize(self): return 0 def Pa_Terminate(self): return 0 # from stdio.h: def fopen(*args, **kwargs): return NotImplemented def fclose(*args): pass
"""Mock module for Sphinx autodoc.""" class FFI(object): NULL = NotImplemented I_AM_FAKE = True # This is used for the documentation of "default" def cdef(self, _): pass def dlopen(self, _): return FakePortAudio() class FakePortAudio(object): paFloat32 = paInt32 = paInt24 = paInt16 = paInt8 = paUInt8 = NotImplemented paFramesPerBufferUnspecified = 0 def Pa_Initialize(self): return 0 def Pa_Terminate(self): return 0 DOC: Add fopen()/fclose() to CFFI mock module"""Mock module for Sphinx autodoc.""" class FFI(object): NULL = NotImplemented I_AM_FAKE = True # This is used for the documentation of "default" def cdef(self, _): pass def dlopen(self, _): return FakeLibrary() class FakeLibrary(object): # from portaudio.h: paFloat32 = paInt32 = paInt24 = paInt16 = paInt8 = paUInt8 = NotImplemented paFramesPerBufferUnspecified = 0 def Pa_Initialize(self): return 0 def Pa_Terminate(self): return 0 # from stdio.h: def fopen(*args, **kwargs): return NotImplemented def fclose(*args): pass
<commit_before>"""Mock module for Sphinx autodoc.""" class FFI(object): NULL = NotImplemented I_AM_FAKE = True # This is used for the documentation of "default" def cdef(self, _): pass def dlopen(self, _): return FakePortAudio() class FakePortAudio(object): paFloat32 = paInt32 = paInt24 = paInt16 = paInt8 = paUInt8 = NotImplemented paFramesPerBufferUnspecified = 0 def Pa_Initialize(self): return 0 def Pa_Terminate(self): return 0 <commit_msg>DOC: Add fopen()/fclose() to CFFI mock module<commit_after>"""Mock module for Sphinx autodoc.""" class FFI(object): NULL = NotImplemented I_AM_FAKE = True # This is used for the documentation of "default" def cdef(self, _): pass def dlopen(self, _): return FakeLibrary() class FakeLibrary(object): # from portaudio.h: paFloat32 = paInt32 = paInt24 = paInt16 = paInt8 = paUInt8 = NotImplemented paFramesPerBufferUnspecified = 0 def Pa_Initialize(self): return 0 def Pa_Terminate(self): return 0 # from stdio.h: def fopen(*args, **kwargs): return NotImplemented def fclose(*args): pass
a15c8bce9c59dcba3e7143903d95feb85ee7abe5
tests/ex12_tests.py
tests/ex12_tests.py
from nose.tools import * from exercises import ex12 def test_histogram(): ''' Test our histogram output is correct ''' test_histogram = ex12.histogram([1, 2, 3]) # assert_equal(test_histogram, '*\n**\n***\n')
from nose.tools import * from exercises import ex12 try: from io import StringIO except: from StringIO import StringIO import sys def test_histogram(): ''' Test our histogram output is correct ''' std_out = sys.stdout result = StringIO() sys.stdout = result test_histogram = ex12.histogram([1, 2, 3]) sys.stdout = std_out result_string = result.getvalue() assert_equal(result_string, '*\n**\n***\n')
Update ex12 test so it actually reads output.
Update ex12 test so it actually reads output.
Python
mit
gravyboat/python-exercises
from nose.tools import * from exercises import ex12 def test_histogram(): ''' Test our histogram output is correct ''' test_histogram = ex12.histogram([1, 2, 3]) # assert_equal(test_histogram, '*\n**\n***\n') Update ex12 test so it actually reads output.
from nose.tools import * from exercises import ex12 try: from io import StringIO except: from StringIO import StringIO import sys def test_histogram(): ''' Test our histogram output is correct ''' std_out = sys.stdout result = StringIO() sys.stdout = result test_histogram = ex12.histogram([1, 2, 3]) sys.stdout = std_out result_string = result.getvalue() assert_equal(result_string, '*\n**\n***\n')
<commit_before>from nose.tools import * from exercises import ex12 def test_histogram(): ''' Test our histogram output is correct ''' test_histogram = ex12.histogram([1, 2, 3]) # assert_equal(test_histogram, '*\n**\n***\n') <commit_msg>Update ex12 test so it actually reads output.<commit_after>
from nose.tools import * from exercises import ex12 try: from io import StringIO except: from StringIO import StringIO import sys def test_histogram(): ''' Test our histogram output is correct ''' std_out = sys.stdout result = StringIO() sys.stdout = result test_histogram = ex12.histogram([1, 2, 3]) sys.stdout = std_out result_string = result.getvalue() assert_equal(result_string, '*\n**\n***\n')
from nose.tools import * from exercises import ex12 def test_histogram(): ''' Test our histogram output is correct ''' test_histogram = ex12.histogram([1, 2, 3]) # assert_equal(test_histogram, '*\n**\n***\n') Update ex12 test so it actually reads output.from nose.tools import * from exercises import ex12 try: from io import StringIO except: from StringIO import StringIO import sys def test_histogram(): ''' Test our histogram output is correct ''' std_out = sys.stdout result = StringIO() sys.stdout = result test_histogram = ex12.histogram([1, 2, 3]) sys.stdout = std_out result_string = result.getvalue() assert_equal(result_string, '*\n**\n***\n')
<commit_before>from nose.tools import * from exercises import ex12 def test_histogram(): ''' Test our histogram output is correct ''' test_histogram = ex12.histogram([1, 2, 3]) # assert_equal(test_histogram, '*\n**\n***\n') <commit_msg>Update ex12 test so it actually reads output.<commit_after>from nose.tools import * from exercises import ex12 try: from io import StringIO except: from StringIO import StringIO import sys def test_histogram(): ''' Test our histogram output is correct ''' std_out = sys.stdout result = StringIO() sys.stdout = result test_histogram = ex12.histogram([1, 2, 3]) sys.stdout = std_out result_string = result.getvalue() assert_equal(result_string, '*\n**\n***\n')
943d575749d34a985b4bb9bdde40a8c3fe1cd911
spritecss/css/__init__.py
spritecss/css/__init__.py
"""Pure-Python CSS parser - no dependencies!""" # Copyright held by Yo Studios AB <opensource@yo.se>, 2011 # # Some kind of BSD license, contact above e-mail for more information on # matters of licensing. from .parser import CSSParser, print_css from itertools import ifilter, imap __all__ = ["CSSParser", "iter_events", "split_declaration", "print_css", "iter_declarations"] def iter_events(parser, lexemes=None, predicate=None): if lexemes and predicate: raise TypeError("specify either events or predicate, not both") elif lexemes: predicate = lambda e: e.lexeme in lexemes return ifilter(predicate, iter(parser)) def split_declaration(decl): parts = decl.split(":", 1) if len(parts) == 1: return (parts[0], None) else: (prop, val) = parts return (prop, val) def iter_declarations(parser, predicate=None): evs = iter_events(parser, lexemes=("declaration",)) return imap(split_declaration, evs)
"""Pure-Python CSS parser - no dependencies!""" # Copyright held by Yo Studios AB <opensource@yo.se>, 2011 # # Part of Spritemapper (https://github.com/yostudios/Spritemapper) # Released under a MIT/X11 license from .parser import CSSParser, print_css from itertools import ifilter, imap __all__ = ["CSSParser", "iter_events", "split_declaration", "print_css", "iter_declarations"] def iter_events(parser, lexemes=None, predicate=None): if lexemes and predicate: raise TypeError("specify either events or predicate, not both") elif lexemes: predicate = lambda e: e.lexeme in lexemes return ifilter(predicate, iter(parser)) def split_declaration(decl): parts = decl.split(":", 1) if len(parts) == 1: return (parts[0], None) else: (prop, val) = parts return (prop, val) def iter_declarations(parser, predicate=None): evs = iter_events(parser, lexemes=("declaration",)) return imap(split_declaration, evs)
Modify licensing info for css parser
Modify licensing info for css parser
Python
mit
wpj-cz/Spritemapper,wpj-cz/Spritemapper,wpj-cz/Spritemapper,yostudios/Spritemapper,wpj-cz/Spritemapper,yostudios/Spritemapper,yostudios/Spritemapper
"""Pure-Python CSS parser - no dependencies!""" # Copyright held by Yo Studios AB <opensource@yo.se>, 2011 # # Some kind of BSD license, contact above e-mail for more information on # matters of licensing. from .parser import CSSParser, print_css from itertools import ifilter, imap __all__ = ["CSSParser", "iter_events", "split_declaration", "print_css", "iter_declarations"] def iter_events(parser, lexemes=None, predicate=None): if lexemes and predicate: raise TypeError("specify either events or predicate, not both") elif lexemes: predicate = lambda e: e.lexeme in lexemes return ifilter(predicate, iter(parser)) def split_declaration(decl): parts = decl.split(":", 1) if len(parts) == 1: return (parts[0], None) else: (prop, val) = parts return (prop, val) def iter_declarations(parser, predicate=None): evs = iter_events(parser, lexemes=("declaration",)) return imap(split_declaration, evs) Modify licensing info for css parser
"""Pure-Python CSS parser - no dependencies!""" # Copyright held by Yo Studios AB <opensource@yo.se>, 2011 # # Part of Spritemapper (https://github.com/yostudios/Spritemapper) # Released under a MIT/X11 license from .parser import CSSParser, print_css from itertools import ifilter, imap __all__ = ["CSSParser", "iter_events", "split_declaration", "print_css", "iter_declarations"] def iter_events(parser, lexemes=None, predicate=None): if lexemes and predicate: raise TypeError("specify either events or predicate, not both") elif lexemes: predicate = lambda e: e.lexeme in lexemes return ifilter(predicate, iter(parser)) def split_declaration(decl): parts = decl.split(":", 1) if len(parts) == 1: return (parts[0], None) else: (prop, val) = parts return (prop, val) def iter_declarations(parser, predicate=None): evs = iter_events(parser, lexemes=("declaration",)) return imap(split_declaration, evs)
<commit_before>"""Pure-Python CSS parser - no dependencies!""" # Copyright held by Yo Studios AB <opensource@yo.se>, 2011 # # Some kind of BSD license, contact above e-mail for more information on # matters of licensing. from .parser import CSSParser, print_css from itertools import ifilter, imap __all__ = ["CSSParser", "iter_events", "split_declaration", "print_css", "iter_declarations"] def iter_events(parser, lexemes=None, predicate=None): if lexemes and predicate: raise TypeError("specify either events or predicate, not both") elif lexemes: predicate = lambda e: e.lexeme in lexemes return ifilter(predicate, iter(parser)) def split_declaration(decl): parts = decl.split(":", 1) if len(parts) == 1: return (parts[0], None) else: (prop, val) = parts return (prop, val) def iter_declarations(parser, predicate=None): evs = iter_events(parser, lexemes=("declaration",)) return imap(split_declaration, evs) <commit_msg>Modify licensing info for css parser<commit_after>
"""Pure-Python CSS parser - no dependencies!""" # Copyright held by Yo Studios AB <opensource@yo.se>, 2011 # # Part of Spritemapper (https://github.com/yostudios/Spritemapper) # Released under a MIT/X11 license from .parser import CSSParser, print_css from itertools import ifilter, imap __all__ = ["CSSParser", "iter_events", "split_declaration", "print_css", "iter_declarations"] def iter_events(parser, lexemes=None, predicate=None): if lexemes and predicate: raise TypeError("specify either events or predicate, not both") elif lexemes: predicate = lambda e: e.lexeme in lexemes return ifilter(predicate, iter(parser)) def split_declaration(decl): parts = decl.split(":", 1) if len(parts) == 1: return (parts[0], None) else: (prop, val) = parts return (prop, val) def iter_declarations(parser, predicate=None): evs = iter_events(parser, lexemes=("declaration",)) return imap(split_declaration, evs)
"""Pure-Python CSS parser - no dependencies!""" # Copyright held by Yo Studios AB <opensource@yo.se>, 2011 # # Some kind of BSD license, contact above e-mail for more information on # matters of licensing. from .parser import CSSParser, print_css from itertools import ifilter, imap __all__ = ["CSSParser", "iter_events", "split_declaration", "print_css", "iter_declarations"] def iter_events(parser, lexemes=None, predicate=None): if lexemes and predicate: raise TypeError("specify either events or predicate, not both") elif lexemes: predicate = lambda e: e.lexeme in lexemes return ifilter(predicate, iter(parser)) def split_declaration(decl): parts = decl.split(":", 1) if len(parts) == 1: return (parts[0], None) else: (prop, val) = parts return (prop, val) def iter_declarations(parser, predicate=None): evs = iter_events(parser, lexemes=("declaration",)) return imap(split_declaration, evs) Modify licensing info for css parser"""Pure-Python CSS parser - no dependencies!""" # Copyright held by Yo Studios AB <opensource@yo.se>, 2011 # # Part of Spritemapper (https://github.com/yostudios/Spritemapper) # Released under a MIT/X11 license from .parser import CSSParser, print_css from itertools import ifilter, imap __all__ = ["CSSParser", "iter_events", "split_declaration", "print_css", "iter_declarations"] def iter_events(parser, lexemes=None, predicate=None): if lexemes and predicate: raise TypeError("specify either events or predicate, not both") elif lexemes: predicate = lambda e: e.lexeme in lexemes return ifilter(predicate, iter(parser)) def split_declaration(decl): parts = decl.split(":", 1) if len(parts) == 1: return (parts[0], None) else: (prop, val) = parts return (prop, val) def iter_declarations(parser, predicate=None): evs = iter_events(parser, lexemes=("declaration",)) return imap(split_declaration, evs)
<commit_before>"""Pure-Python CSS parser - no dependencies!""" # Copyright held by Yo Studios AB <opensource@yo.se>, 2011 # # Some kind of BSD license, contact above e-mail for more information on # matters of licensing. from .parser import CSSParser, print_css from itertools import ifilter, imap __all__ = ["CSSParser", "iter_events", "split_declaration", "print_css", "iter_declarations"] def iter_events(parser, lexemes=None, predicate=None): if lexemes and predicate: raise TypeError("specify either events or predicate, not both") elif lexemes: predicate = lambda e: e.lexeme in lexemes return ifilter(predicate, iter(parser)) def split_declaration(decl): parts = decl.split(":", 1) if len(parts) == 1: return (parts[0], None) else: (prop, val) = parts return (prop, val) def iter_declarations(parser, predicate=None): evs = iter_events(parser, lexemes=("declaration",)) return imap(split_declaration, evs) <commit_msg>Modify licensing info for css parser<commit_after>"""Pure-Python CSS parser - no dependencies!""" # Copyright held by Yo Studios AB <opensource@yo.se>, 2011 # # Part of Spritemapper (https://github.com/yostudios/Spritemapper) # Released under a MIT/X11 license from .parser import CSSParser, print_css from itertools import ifilter, imap __all__ = ["CSSParser", "iter_events", "split_declaration", "print_css", "iter_declarations"] def iter_events(parser, lexemes=None, predicate=None): if lexemes and predicate: raise TypeError("specify either events or predicate, not both") elif lexemes: predicate = lambda e: e.lexeme in lexemes return ifilter(predicate, iter(parser)) def split_declaration(decl): parts = decl.split(":", 1) if len(parts) == 1: return (parts[0], None) else: (prop, val) = parts return (prop, val) def iter_declarations(parser, predicate=None): evs = iter_events(parser, lexemes=("declaration",)) return imap(split_declaration, evs)
1a67e28fe3b5eaa6d640f0bb82b5a18ebdefa0ba
src/pytest_django_lite/plugin.py
src/pytest_django_lite/plugin.py
import os import pytest try: from django.conf import settings except ImportError: settings = None # NOQA def is_configured(): if settings is None: return False return settings.configured or os.environ.get('DJANGO_SETTINGS_MODULE') @pytest.fixture(autouse=True, scope='session') def _django_runner(request): if not is_configured(): return from django.test.simple import DjangoTestSuiteRunner try: import django django.setup() except AttributeError: pass runner = DjangoTestSuiteRunner(interactive=False) runner.setup_test_environment() request.addfinalizer(runner.teardown_test_environment) config = runner.setup_databases() def teardown_database(): runner.teardown_databases(config) request.addfinalizer(teardown_database) return runner
import os import pytest try: from django.conf import settings except ImportError: settings = None # NOQA def is_configured(): if settings is None: return False return settings.configured or os.environ.get('DJANGO_SETTINGS_MODULE') @pytest.fixture(autouse=True, scope='session') def _django_runner(request): if not is_configured(): return from django.test.simple import DjangoTestSuiteRunner import django if hasattr(django, 'setup'): django.setup() runner = DjangoTestSuiteRunner(interactive=False) runner.setup_test_environment() request.addfinalizer(runner.teardown_test_environment) config = runner.setup_databases() def teardown_database(): runner.teardown_databases(config) request.addfinalizer(teardown_database) return runner
Use hasattr instead of try/except to call django setup.
Use hasattr instead of try/except to call django setup.
Python
apache-2.0
pombredanne/pytest-django-lite,dcramer/pytest-django-lite
import os import pytest try: from django.conf import settings except ImportError: settings = None # NOQA def is_configured(): if settings is None: return False return settings.configured or os.environ.get('DJANGO_SETTINGS_MODULE') @pytest.fixture(autouse=True, scope='session') def _django_runner(request): if not is_configured(): return from django.test.simple import DjangoTestSuiteRunner try: import django django.setup() except AttributeError: pass runner = DjangoTestSuiteRunner(interactive=False) runner.setup_test_environment() request.addfinalizer(runner.teardown_test_environment) config = runner.setup_databases() def teardown_database(): runner.teardown_databases(config) request.addfinalizer(teardown_database) return runner Use hasattr instead of try/except to call django setup.
import os import pytest try: from django.conf import settings except ImportError: settings = None # NOQA def is_configured(): if settings is None: return False return settings.configured or os.environ.get('DJANGO_SETTINGS_MODULE') @pytest.fixture(autouse=True, scope='session') def _django_runner(request): if not is_configured(): return from django.test.simple import DjangoTestSuiteRunner import django if hasattr(django, 'setup'): django.setup() runner = DjangoTestSuiteRunner(interactive=False) runner.setup_test_environment() request.addfinalizer(runner.teardown_test_environment) config = runner.setup_databases() def teardown_database(): runner.teardown_databases(config) request.addfinalizer(teardown_database) return runner
<commit_before>import os import pytest try: from django.conf import settings except ImportError: settings = None # NOQA def is_configured(): if settings is None: return False return settings.configured or os.environ.get('DJANGO_SETTINGS_MODULE') @pytest.fixture(autouse=True, scope='session') def _django_runner(request): if not is_configured(): return from django.test.simple import DjangoTestSuiteRunner try: import django django.setup() except AttributeError: pass runner = DjangoTestSuiteRunner(interactive=False) runner.setup_test_environment() request.addfinalizer(runner.teardown_test_environment) config = runner.setup_databases() def teardown_database(): runner.teardown_databases(config) request.addfinalizer(teardown_database) return runner <commit_msg>Use hasattr instead of try/except to call django setup.<commit_after>
import os import pytest try: from django.conf import settings except ImportError: settings = None # NOQA def is_configured(): if settings is None: return False return settings.configured or os.environ.get('DJANGO_SETTINGS_MODULE') @pytest.fixture(autouse=True, scope='session') def _django_runner(request): if not is_configured(): return from django.test.simple import DjangoTestSuiteRunner import django if hasattr(django, 'setup'): django.setup() runner = DjangoTestSuiteRunner(interactive=False) runner.setup_test_environment() request.addfinalizer(runner.teardown_test_environment) config = runner.setup_databases() def teardown_database(): runner.teardown_databases(config) request.addfinalizer(teardown_database) return runner
import os import pytest try: from django.conf import settings except ImportError: settings = None # NOQA def is_configured(): if settings is None: return False return settings.configured or os.environ.get('DJANGO_SETTINGS_MODULE') @pytest.fixture(autouse=True, scope='session') def _django_runner(request): if not is_configured(): return from django.test.simple import DjangoTestSuiteRunner try: import django django.setup() except AttributeError: pass runner = DjangoTestSuiteRunner(interactive=False) runner.setup_test_environment() request.addfinalizer(runner.teardown_test_environment) config = runner.setup_databases() def teardown_database(): runner.teardown_databases(config) request.addfinalizer(teardown_database) return runner Use hasattr instead of try/except to call django setup.import os import pytest try: from django.conf import settings except ImportError: settings = None # NOQA def is_configured(): if settings is None: return False return settings.configured or os.environ.get('DJANGO_SETTINGS_MODULE') @pytest.fixture(autouse=True, scope='session') def _django_runner(request): if not is_configured(): return from django.test.simple import DjangoTestSuiteRunner import django if hasattr(django, 'setup'): django.setup() runner = DjangoTestSuiteRunner(interactive=False) runner.setup_test_environment() request.addfinalizer(runner.teardown_test_environment) config = runner.setup_databases() def teardown_database(): runner.teardown_databases(config) request.addfinalizer(teardown_database) return runner
<commit_before>import os import pytest try: from django.conf import settings except ImportError: settings = None # NOQA def is_configured(): if settings is None: return False return settings.configured or os.environ.get('DJANGO_SETTINGS_MODULE') @pytest.fixture(autouse=True, scope='session') def _django_runner(request): if not is_configured(): return from django.test.simple import DjangoTestSuiteRunner try: import django django.setup() except AttributeError: pass runner = DjangoTestSuiteRunner(interactive=False) runner.setup_test_environment() request.addfinalizer(runner.teardown_test_environment) config = runner.setup_databases() def teardown_database(): runner.teardown_databases(config) request.addfinalizer(teardown_database) return runner <commit_msg>Use hasattr instead of try/except to call django setup.<commit_after>import os import pytest try: from django.conf import settings except ImportError: settings = None # NOQA def is_configured(): if settings is None: return False return settings.configured or os.environ.get('DJANGO_SETTINGS_MODULE') @pytest.fixture(autouse=True, scope='session') def _django_runner(request): if not is_configured(): return from django.test.simple import DjangoTestSuiteRunner import django if hasattr(django, 'setup'): django.setup() runner = DjangoTestSuiteRunner(interactive=False) runner.setup_test_environment() request.addfinalizer(runner.teardown_test_environment) config = runner.setup_databases() def teardown_database(): runner.teardown_databases(config) request.addfinalizer(teardown_database) return runner
888fb12572defbfba1998f2f208cad43ae0c74d4
tests/test_RI_CC.py
tests/test_RI_CC.py
from addons import * from utils import * tdir = 'Coupled-Cluster' def test_CCSD_DIIS(workspace): exe_py(workspace, tdir, 'CCSD_DIIS') def test_CCSD(workspace): exe_py(workspace, tdir, 'CCSD') def test_CCSD_T(workspace): exe_py(workspace, tdir, 'CCSD_T') #def test_TD_CCSD(workspace): # exe_py(workspace, tdir, 'TD-CCSD')
from addons import * from utils import * tdir = 'Coupled-Cluster' def test_CCSD_DIIS(workspace): exe_py(workspace, tdir, 'CCSD_DIIS') def test_CCSD(workspace): exe_py(workspace, tdir, 'CCSD') def test_CCSD_T(workspace): exe_py(workspace, tdir, 'CCSD_T') def test_EOM_CCSD(workspace): exe_py(workspace, tdir+'/spin_free_CC','EOM_CCSD') #def test_TD_CCSD(workspace): # exe_py(workspace, tdir, 'TD-CCSD')
Add EOM_CCSD ref imp to tests
[EOM] Add EOM_CCSD ref imp to tests
Python
bsd-3-clause
psi4/psi4numpy,dsirianni/psi4numpy
from addons import * from utils import * tdir = 'Coupled-Cluster' def test_CCSD_DIIS(workspace): exe_py(workspace, tdir, 'CCSD_DIIS') def test_CCSD(workspace): exe_py(workspace, tdir, 'CCSD') def test_CCSD_T(workspace): exe_py(workspace, tdir, 'CCSD_T') #def test_TD_CCSD(workspace): # exe_py(workspace, tdir, 'TD-CCSD') [EOM] Add EOM_CCSD ref imp to tests
from addons import * from utils import * tdir = 'Coupled-Cluster' def test_CCSD_DIIS(workspace): exe_py(workspace, tdir, 'CCSD_DIIS') def test_CCSD(workspace): exe_py(workspace, tdir, 'CCSD') def test_CCSD_T(workspace): exe_py(workspace, tdir, 'CCSD_T') def test_EOM_CCSD(workspace): exe_py(workspace, tdir+'/spin_free_CC','EOM_CCSD') #def test_TD_CCSD(workspace): # exe_py(workspace, tdir, 'TD-CCSD')
<commit_before>from addons import * from utils import * tdir = 'Coupled-Cluster' def test_CCSD_DIIS(workspace): exe_py(workspace, tdir, 'CCSD_DIIS') def test_CCSD(workspace): exe_py(workspace, tdir, 'CCSD') def test_CCSD_T(workspace): exe_py(workspace, tdir, 'CCSD_T') #def test_TD_CCSD(workspace): # exe_py(workspace, tdir, 'TD-CCSD') <commit_msg>[EOM] Add EOM_CCSD ref imp to tests<commit_after>
from addons import * from utils import * tdir = 'Coupled-Cluster' def test_CCSD_DIIS(workspace): exe_py(workspace, tdir, 'CCSD_DIIS') def test_CCSD(workspace): exe_py(workspace, tdir, 'CCSD') def test_CCSD_T(workspace): exe_py(workspace, tdir, 'CCSD_T') def test_EOM_CCSD(workspace): exe_py(workspace, tdir+'/spin_free_CC','EOM_CCSD') #def test_TD_CCSD(workspace): # exe_py(workspace, tdir, 'TD-CCSD')
from addons import * from utils import * tdir = 'Coupled-Cluster' def test_CCSD_DIIS(workspace): exe_py(workspace, tdir, 'CCSD_DIIS') def test_CCSD(workspace): exe_py(workspace, tdir, 'CCSD') def test_CCSD_T(workspace): exe_py(workspace, tdir, 'CCSD_T') #def test_TD_CCSD(workspace): # exe_py(workspace, tdir, 'TD-CCSD') [EOM] Add EOM_CCSD ref imp to testsfrom addons import * from utils import * tdir = 'Coupled-Cluster' def test_CCSD_DIIS(workspace): exe_py(workspace, tdir, 'CCSD_DIIS') def test_CCSD(workspace): exe_py(workspace, tdir, 'CCSD') def test_CCSD_T(workspace): exe_py(workspace, tdir, 'CCSD_T') def test_EOM_CCSD(workspace): exe_py(workspace, tdir+'/spin_free_CC','EOM_CCSD') #def test_TD_CCSD(workspace): # exe_py(workspace, tdir, 'TD-CCSD')
<commit_before>from addons import * from utils import * tdir = 'Coupled-Cluster' def test_CCSD_DIIS(workspace): exe_py(workspace, tdir, 'CCSD_DIIS') def test_CCSD(workspace): exe_py(workspace, tdir, 'CCSD') def test_CCSD_T(workspace): exe_py(workspace, tdir, 'CCSD_T') #def test_TD_CCSD(workspace): # exe_py(workspace, tdir, 'TD-CCSD') <commit_msg>[EOM] Add EOM_CCSD ref imp to tests<commit_after>from addons import * from utils import * tdir = 'Coupled-Cluster' def test_CCSD_DIIS(workspace): exe_py(workspace, tdir, 'CCSD_DIIS') def test_CCSD(workspace): exe_py(workspace, tdir, 'CCSD') def test_CCSD_T(workspace): exe_py(workspace, tdir, 'CCSD_T') def test_EOM_CCSD(workspace): exe_py(workspace, tdir+'/spin_free_CC','EOM_CCSD') #def test_TD_CCSD(workspace): # exe_py(workspace, tdir, 'TD-CCSD')
fcb92a64502099e05ea94368ffcddf72cd449b02
txtools/cli/vis.py
txtools/cli/vis.py
import click from textx.metamodel import metamodel_from_file from textx.lang import get_language from textx.exceptions import TextXError from txtools.vis import metamodel_export, model_export @click.command() @click.argument('model_file') @click.option('-l', '--language', default='textx', help='Registered language name. ' 'Default is "textx" - for textX grammars.') @click.option('-d', '--debug', default=False, is_flag=True, help='run in debug mode') def vis(model_file, language, debug): """ Visualize (meta)model using dot. """ try: if language == 'textx': mm = metamodel_from_file(model_file, debug=debug) click.echo("Generating '%s.dot' file for meta-model." % model_file) click.echo("To convert to png run 'dot -Tpng -O %s.dot'" % model_file) metamodel_export(mm, "%s.dot" % model_file) else: mm = get_language(language) model = mm.model_from_file(model_file, debug=debug) click.echo("Generating '%s.dot' file for model." % model_file) click.echo("To convert to png run 'dot -Tpng -O %s.dot'" % model_file) model_export(model, "%s.dot" % model_file) except TextXError as e: click.echo(e)
import click from textx.metamodel import metamodel_from_file from textx.lang import get_language from textx.exceptions import TextXError from txtools.vis import metamodel_export, model_export @click.command() @click.argument('model_file') @click.option('-l', '--language', default='textx', help='Registered language name. ' 'Default is "textx" - for textX grammars.') @click.option('-d', '--debug', default=False, is_flag=True, help='run in debug mode') def vis(model_file, language, debug): """ Visualize (meta)model using dot. """ try: if language == 'textx': mm = metamodel_from_file(model_file, debug=debug) click.echo("Generating '%s.dot' file for meta-model." % model_file) click.echo("To convert to PDF run 'dot -Tpdf -O %s.dot'" % model_file) metamodel_export(mm, "%s.dot" % model_file) else: mm = get_language(language) model = mm.model_from_file(model_file, debug=debug) click.echo("Generating '%s.dot' file for model." % model_file) click.echo("To convert to PDF run 'dot -Tpdf -O %s.dot'" % model_file) model_export(model, "%s.dot" % model_file) except TextXError as e: click.echo(e)
Change dot generate message to suggest PDF format.
Change dot generate message to suggest PDF format.
Python
mit
igordejanovic/textx-tools,igordejanovic/textx-tools
import click from textx.metamodel import metamodel_from_file from textx.lang import get_language from textx.exceptions import TextXError from txtools.vis import metamodel_export, model_export @click.command() @click.argument('model_file') @click.option('-l', '--language', default='textx', help='Registered language name. ' 'Default is "textx" - for textX grammars.') @click.option('-d', '--debug', default=False, is_flag=True, help='run in debug mode') def vis(model_file, language, debug): """ Visualize (meta)model using dot. """ try: if language == 'textx': mm = metamodel_from_file(model_file, debug=debug) click.echo("Generating '%s.dot' file for meta-model." % model_file) click.echo("To convert to png run 'dot -Tpng -O %s.dot'" % model_file) metamodel_export(mm, "%s.dot" % model_file) else: mm = get_language(language) model = mm.model_from_file(model_file, debug=debug) click.echo("Generating '%s.dot' file for model." % model_file) click.echo("To convert to png run 'dot -Tpng -O %s.dot'" % model_file) model_export(model, "%s.dot" % model_file) except TextXError as e: click.echo(e) Change dot generate message to suggest PDF format.
import click from textx.metamodel import metamodel_from_file from textx.lang import get_language from textx.exceptions import TextXError from txtools.vis import metamodel_export, model_export @click.command() @click.argument('model_file') @click.option('-l', '--language', default='textx', help='Registered language name. ' 'Default is "textx" - for textX grammars.') @click.option('-d', '--debug', default=False, is_flag=True, help='run in debug mode') def vis(model_file, language, debug): """ Visualize (meta)model using dot. """ try: if language == 'textx': mm = metamodel_from_file(model_file, debug=debug) click.echo("Generating '%s.dot' file for meta-model." % model_file) click.echo("To convert to PDF run 'dot -Tpdf -O %s.dot'" % model_file) metamodel_export(mm, "%s.dot" % model_file) else: mm = get_language(language) model = mm.model_from_file(model_file, debug=debug) click.echo("Generating '%s.dot' file for model." % model_file) click.echo("To convert to PDF run 'dot -Tpdf -O %s.dot'" % model_file) model_export(model, "%s.dot" % model_file) except TextXError as e: click.echo(e)
<commit_before> import click from textx.metamodel import metamodel_from_file from textx.lang import get_language from textx.exceptions import TextXError from txtools.vis import metamodel_export, model_export @click.command() @click.argument('model_file') @click.option('-l', '--language', default='textx', help='Registered language name. ' 'Default is "textx" - for textX grammars.') @click.option('-d', '--debug', default=False, is_flag=True, help='run in debug mode') def vis(model_file, language, debug): """ Visualize (meta)model using dot. """ try: if language == 'textx': mm = metamodel_from_file(model_file, debug=debug) click.echo("Generating '%s.dot' file for meta-model." % model_file) click.echo("To convert to png run 'dot -Tpng -O %s.dot'" % model_file) metamodel_export(mm, "%s.dot" % model_file) else: mm = get_language(language) model = mm.model_from_file(model_file, debug=debug) click.echo("Generating '%s.dot' file for model." % model_file) click.echo("To convert to png run 'dot -Tpng -O %s.dot'" % model_file) model_export(model, "%s.dot" % model_file) except TextXError as e: click.echo(e) <commit_msg>Change dot generate message to suggest PDF format.<commit_after>
import click from textx.metamodel import metamodel_from_file from textx.lang import get_language from textx.exceptions import TextXError from txtools.vis import metamodel_export, model_export @click.command() @click.argument('model_file') @click.option('-l', '--language', default='textx', help='Registered language name. ' 'Default is "textx" - for textX grammars.') @click.option('-d', '--debug', default=False, is_flag=True, help='run in debug mode') def vis(model_file, language, debug): """ Visualize (meta)model using dot. """ try: if language == 'textx': mm = metamodel_from_file(model_file, debug=debug) click.echo("Generating '%s.dot' file for meta-model." % model_file) click.echo("To convert to PDF run 'dot -Tpdf -O %s.dot'" % model_file) metamodel_export(mm, "%s.dot" % model_file) else: mm = get_language(language) model = mm.model_from_file(model_file, debug=debug) click.echo("Generating '%s.dot' file for model." % model_file) click.echo("To convert to PDF run 'dot -Tpdf -O %s.dot'" % model_file) model_export(model, "%s.dot" % model_file) except TextXError as e: click.echo(e)
import click from textx.metamodel import metamodel_from_file from textx.lang import get_language from textx.exceptions import TextXError from txtools.vis import metamodel_export, model_export @click.command() @click.argument('model_file') @click.option('-l', '--language', default='textx', help='Registered language name. ' 'Default is "textx" - for textX grammars.') @click.option('-d', '--debug', default=False, is_flag=True, help='run in debug mode') def vis(model_file, language, debug): """ Visualize (meta)model using dot. """ try: if language == 'textx': mm = metamodel_from_file(model_file, debug=debug) click.echo("Generating '%s.dot' file for meta-model." % model_file) click.echo("To convert to png run 'dot -Tpng -O %s.dot'" % model_file) metamodel_export(mm, "%s.dot" % model_file) else: mm = get_language(language) model = mm.model_from_file(model_file, debug=debug) click.echo("Generating '%s.dot' file for model." % model_file) click.echo("To convert to png run 'dot -Tpng -O %s.dot'" % model_file) model_export(model, "%s.dot" % model_file) except TextXError as e: click.echo(e) Change dot generate message to suggest PDF format. import click from textx.metamodel import metamodel_from_file from textx.lang import get_language from textx.exceptions import TextXError from txtools.vis import metamodel_export, model_export @click.command() @click.argument('model_file') @click.option('-l', '--language', default='textx', help='Registered language name. ' 'Default is "textx" - for textX grammars.') @click.option('-d', '--debug', default=False, is_flag=True, help='run in debug mode') def vis(model_file, language, debug): """ Visualize (meta)model using dot. """ try: if language == 'textx': mm = metamodel_from_file(model_file, debug=debug) click.echo("Generating '%s.dot' file for meta-model." % model_file) click.echo("To convert to PDF run 'dot -Tpdf -O %s.dot'" % model_file) metamodel_export(mm, "%s.dot" % model_file) else: mm = get_language(language) model = mm.model_from_file(model_file, debug=debug) click.echo("Generating '%s.dot' file for model." % model_file) click.echo("To convert to PDF run 'dot -Tpdf -O %s.dot'" % model_file) model_export(model, "%s.dot" % model_file) except TextXError as e: click.echo(e)
<commit_before> import click from textx.metamodel import metamodel_from_file from textx.lang import get_language from textx.exceptions import TextXError from txtools.vis import metamodel_export, model_export @click.command() @click.argument('model_file') @click.option('-l', '--language', default='textx', help='Registered language name. ' 'Default is "textx" - for textX grammars.') @click.option('-d', '--debug', default=False, is_flag=True, help='run in debug mode') def vis(model_file, language, debug): """ Visualize (meta)model using dot. """ try: if language == 'textx': mm = metamodel_from_file(model_file, debug=debug) click.echo("Generating '%s.dot' file for meta-model." % model_file) click.echo("To convert to png run 'dot -Tpng -O %s.dot'" % model_file) metamodel_export(mm, "%s.dot" % model_file) else: mm = get_language(language) model = mm.model_from_file(model_file, debug=debug) click.echo("Generating '%s.dot' file for model." % model_file) click.echo("To convert to png run 'dot -Tpng -O %s.dot'" % model_file) model_export(model, "%s.dot" % model_file) except TextXError as e: click.echo(e) <commit_msg>Change dot generate message to suggest PDF format.<commit_after> import click from textx.metamodel import metamodel_from_file from textx.lang import get_language from textx.exceptions import TextXError from txtools.vis import metamodel_export, model_export @click.command() @click.argument('model_file') @click.option('-l', '--language', default='textx', help='Registered language name. ' 'Default is "textx" - for textX grammars.') @click.option('-d', '--debug', default=False, is_flag=True, help='run in debug mode') def vis(model_file, language, debug): """ Visualize (meta)model using dot. """ try: if language == 'textx': mm = metamodel_from_file(model_file, debug=debug) click.echo("Generating '%s.dot' file for meta-model." % model_file) click.echo("To convert to PDF run 'dot -Tpdf -O %s.dot'" % model_file) metamodel_export(mm, "%s.dot" % model_file) else: mm = get_language(language) model = mm.model_from_file(model_file, debug=debug) click.echo("Generating '%s.dot' file for model." % model_file) click.echo("To convert to PDF run 'dot -Tpdf -O %s.dot'" % model_file) model_export(model, "%s.dot" % model_file) except TextXError as e: click.echo(e)
8ffdd3127d6226815b508bd10ccd84eec22e6d1c
runserver.py
runserver.py
import os from mmmpaste import app # Get the port from the enviroment or fall back to the default. PORT = int(os.environ.get('PORT', 5000)) app.run(debug = True, port = PORT)
import os from mmmpaste import app # Get the port from the enviroment or fall back to the default. PORT = int(os.environ.get('PORT', 5000)) DEBUG = bool(os.environ.get('PORT', True)) app.run(debug = DEBUG, port = PORT)
Allow debug mode to be configured via an environment variable.
Allow debug mode to be configured via an environment variable.
Python
bsd-2-clause
ryanc/mmmpaste,ryanc/mmmpaste
import os from mmmpaste import app # Get the port from the enviroment or fall back to the default. PORT = int(os.environ.get('PORT', 5000)) app.run(debug = True, port = PORT) Allow debug mode to be configured via an environment variable.
import os from mmmpaste import app # Get the port from the enviroment or fall back to the default. PORT = int(os.environ.get('PORT', 5000)) DEBUG = bool(os.environ.get('PORT', True)) app.run(debug = DEBUG, port = PORT)
<commit_before>import os from mmmpaste import app # Get the port from the enviroment or fall back to the default. PORT = int(os.environ.get('PORT', 5000)) app.run(debug = True, port = PORT) <commit_msg>Allow debug mode to be configured via an environment variable.<commit_after>
import os from mmmpaste import app # Get the port from the enviroment or fall back to the default. PORT = int(os.environ.get('PORT', 5000)) DEBUG = bool(os.environ.get('PORT', True)) app.run(debug = DEBUG, port = PORT)
import os from mmmpaste import app # Get the port from the enviroment or fall back to the default. PORT = int(os.environ.get('PORT', 5000)) app.run(debug = True, port = PORT) Allow debug mode to be configured via an environment variable.import os from mmmpaste import app # Get the port from the enviroment or fall back to the default. PORT = int(os.environ.get('PORT', 5000)) DEBUG = bool(os.environ.get('PORT', True)) app.run(debug = DEBUG, port = PORT)
<commit_before>import os from mmmpaste import app # Get the port from the enviroment or fall back to the default. PORT = int(os.environ.get('PORT', 5000)) app.run(debug = True, port = PORT) <commit_msg>Allow debug mode to be configured via an environment variable.<commit_after>import os from mmmpaste import app # Get the port from the enviroment or fall back to the default. PORT = int(os.environ.get('PORT', 5000)) DEBUG = bool(os.environ.get('PORT', True)) app.run(debug = DEBUG, port = PORT)
15f45c0fedab40f486085a3f4158cc2af2374bf5
applications/views.py
applications/views.py
from django.shortcuts import render from applications.forms import ApplicationForm from datetime import datetime from django.views.generic.edit import FormView APPLICATION_START_DATE = datetime(2018, 8, 13) APPLICATION_END_DATE = datetime(2018, 9, 2, 1, 0, 0) class ApplicationView(FormView): template_name = 'applications/application_form.html' form_class = ApplicationForm success_url = '/opptak/success' def form_valid(self, form): form.send_email() form.save() return super(ApplicationView, self).form_valid(form) def dispatch(self, request, *args, **kwargs): current_date = datetime.now() if current_date < APPLICATION_START_DATE: return render(request, 'applications/application_too_early.html') elif current_date > APPLICATION_END_DATE: return render(request, 'applications/application_too_late.html') else: return super(ApplicationView, self).dispatch(request, *args, **kwargs)
from django.shortcuts import render from applications.forms import ApplicationForm from datetime import datetime from django.views.generic.edit import FormView APPLICATION_START_DATE = datetime(2018, 8, 13) APPLICATION_END_DATE = datetime(2018, 9, 3) class ApplicationView(FormView): template_name = 'applications/application_form.html' form_class = ApplicationForm success_url = '/opptak/success' def form_valid(self, form): form.send_email() form.save() return super(ApplicationView, self).form_valid(form) def dispatch(self, request, *args, **kwargs): current_date = datetime.now() if current_date < APPLICATION_START_DATE: return render(request, 'applications/application_too_early.html') elif current_date > APPLICATION_END_DATE: return render(request, 'applications/application_too_late.html') else: return super(ApplicationView, self).dispatch(request, *args, **kwargs)
Fix so that application is due to 24:00 the 2.
Fix so that application is due to 24:00 the 2.
Python
mit
hackerspace-ntnu/website,hackerspace-ntnu/website,hackerspace-ntnu/website
from django.shortcuts import render from applications.forms import ApplicationForm from datetime import datetime from django.views.generic.edit import FormView APPLICATION_START_DATE = datetime(2018, 8, 13) APPLICATION_END_DATE = datetime(2018, 9, 2, 1, 0, 0) class ApplicationView(FormView): template_name = 'applications/application_form.html' form_class = ApplicationForm success_url = '/opptak/success' def form_valid(self, form): form.send_email() form.save() return super(ApplicationView, self).form_valid(form) def dispatch(self, request, *args, **kwargs): current_date = datetime.now() if current_date < APPLICATION_START_DATE: return render(request, 'applications/application_too_early.html') elif current_date > APPLICATION_END_DATE: return render(request, 'applications/application_too_late.html') else: return super(ApplicationView, self).dispatch(request, *args, **kwargs) Fix so that application is due to 24:00 the 2.
from django.shortcuts import render from applications.forms import ApplicationForm from datetime import datetime from django.views.generic.edit import FormView APPLICATION_START_DATE = datetime(2018, 8, 13) APPLICATION_END_DATE = datetime(2018, 9, 3) class ApplicationView(FormView): template_name = 'applications/application_form.html' form_class = ApplicationForm success_url = '/opptak/success' def form_valid(self, form): form.send_email() form.save() return super(ApplicationView, self).form_valid(form) def dispatch(self, request, *args, **kwargs): current_date = datetime.now() if current_date < APPLICATION_START_DATE: return render(request, 'applications/application_too_early.html') elif current_date > APPLICATION_END_DATE: return render(request, 'applications/application_too_late.html') else: return super(ApplicationView, self).dispatch(request, *args, **kwargs)
<commit_before>from django.shortcuts import render from applications.forms import ApplicationForm from datetime import datetime from django.views.generic.edit import FormView APPLICATION_START_DATE = datetime(2018, 8, 13) APPLICATION_END_DATE = datetime(2018, 9, 2, 1, 0, 0) class ApplicationView(FormView): template_name = 'applications/application_form.html' form_class = ApplicationForm success_url = '/opptak/success' def form_valid(self, form): form.send_email() form.save() return super(ApplicationView, self).form_valid(form) def dispatch(self, request, *args, **kwargs): current_date = datetime.now() if current_date < APPLICATION_START_DATE: return render(request, 'applications/application_too_early.html') elif current_date > APPLICATION_END_DATE: return render(request, 'applications/application_too_late.html') else: return super(ApplicationView, self).dispatch(request, *args, **kwargs) <commit_msg>Fix so that application is due to 24:00 the 2.<commit_after>
from django.shortcuts import render from applications.forms import ApplicationForm from datetime import datetime from django.views.generic.edit import FormView APPLICATION_START_DATE = datetime(2018, 8, 13) APPLICATION_END_DATE = datetime(2018, 9, 3) class ApplicationView(FormView): template_name = 'applications/application_form.html' form_class = ApplicationForm success_url = '/opptak/success' def form_valid(self, form): form.send_email() form.save() return super(ApplicationView, self).form_valid(form) def dispatch(self, request, *args, **kwargs): current_date = datetime.now() if current_date < APPLICATION_START_DATE: return render(request, 'applications/application_too_early.html') elif current_date > APPLICATION_END_DATE: return render(request, 'applications/application_too_late.html') else: return super(ApplicationView, self).dispatch(request, *args, **kwargs)
from django.shortcuts import render from applications.forms import ApplicationForm from datetime import datetime from django.views.generic.edit import FormView APPLICATION_START_DATE = datetime(2018, 8, 13) APPLICATION_END_DATE = datetime(2018, 9, 2, 1, 0, 0) class ApplicationView(FormView): template_name = 'applications/application_form.html' form_class = ApplicationForm success_url = '/opptak/success' def form_valid(self, form): form.send_email() form.save() return super(ApplicationView, self).form_valid(form) def dispatch(self, request, *args, **kwargs): current_date = datetime.now() if current_date < APPLICATION_START_DATE: return render(request, 'applications/application_too_early.html') elif current_date > APPLICATION_END_DATE: return render(request, 'applications/application_too_late.html') else: return super(ApplicationView, self).dispatch(request, *args, **kwargs) Fix so that application is due to 24:00 the 2.from django.shortcuts import render from applications.forms import ApplicationForm from datetime import datetime from django.views.generic.edit import FormView APPLICATION_START_DATE = datetime(2018, 8, 13) APPLICATION_END_DATE = datetime(2018, 9, 3) class ApplicationView(FormView): template_name = 'applications/application_form.html' form_class = ApplicationForm success_url = '/opptak/success' def form_valid(self, form): form.send_email() form.save() return super(ApplicationView, self).form_valid(form) def dispatch(self, request, *args, **kwargs): current_date = datetime.now() if current_date < APPLICATION_START_DATE: return render(request, 'applications/application_too_early.html') elif current_date > APPLICATION_END_DATE: return render(request, 'applications/application_too_late.html') else: return super(ApplicationView, self).dispatch(request, *args, **kwargs)
<commit_before>from django.shortcuts import render from applications.forms import ApplicationForm from datetime import datetime from django.views.generic.edit import FormView APPLICATION_START_DATE = datetime(2018, 8, 13) APPLICATION_END_DATE = datetime(2018, 9, 2, 1, 0, 0) class ApplicationView(FormView): template_name = 'applications/application_form.html' form_class = ApplicationForm success_url = '/opptak/success' def form_valid(self, form): form.send_email() form.save() return super(ApplicationView, self).form_valid(form) def dispatch(self, request, *args, **kwargs): current_date = datetime.now() if current_date < APPLICATION_START_DATE: return render(request, 'applications/application_too_early.html') elif current_date > APPLICATION_END_DATE: return render(request, 'applications/application_too_late.html') else: return super(ApplicationView, self).dispatch(request, *args, **kwargs) <commit_msg>Fix so that application is due to 24:00 the 2.<commit_after>from django.shortcuts import render from applications.forms import ApplicationForm from datetime import datetime from django.views.generic.edit import FormView APPLICATION_START_DATE = datetime(2018, 8, 13) APPLICATION_END_DATE = datetime(2018, 9, 3) class ApplicationView(FormView): template_name = 'applications/application_form.html' form_class = ApplicationForm success_url = '/opptak/success' def form_valid(self, form): form.send_email() form.save() return super(ApplicationView, self).form_valid(form) def dispatch(self, request, *args, **kwargs): current_date = datetime.now() if current_date < APPLICATION_START_DATE: return render(request, 'applications/application_too_early.html') elif current_date > APPLICATION_END_DATE: return render(request, 'applications/application_too_late.html') else: return super(ApplicationView, self).dispatch(request, *args, **kwargs)
576700daadd8d1dcee19f169ad3bcd8cd9a20349
example/example/settings.py
example/example/settings.py
import os import dj_database_url BASE_DIR = os.path.dirname(os.path.dirname(__file__)) DEBUG = TEMPLATE_DEBUG = True SECRET_KEY = 'example-app!' ROOT_URLCONF = 'example.urls' STATIC_URL = '/static/' DATABASES = {'default': dj_database_url.config( default='postgres://localhost/conman_example', )} DATABASES['default']['ATOMIC_REQUESTS'] = True INSTALLED_APPS = ( 'conman.routes', 'conman.pages', 'conman.redirects', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', ) MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', )
import os import dj_database_url BASE_DIR = os.path.dirname(os.path.dirname(__file__)) DEBUG = TEMPLATE_DEBUG = True SECRET_KEY = 'example-app!' ROOT_URLCONF = 'example.urls' STATIC_URL = '/static/' DATABASES = {'default': dj_database_url.config( default='postgres://localhost/conman_example', )} DATABASES['default']['ATOMIC_REQUESTS'] = True INSTALLED_APPS = ( 'conman.routes', 'conman.pages', 'conman.redirects', 'polymorphic', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', ) MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', )
Add missing requirement to example app
Add missing requirement to example app
Python
bsd-2-clause
Ian-Foote/django-conman,meshy/django-conman,meshy/django-conman
import os import dj_database_url BASE_DIR = os.path.dirname(os.path.dirname(__file__)) DEBUG = TEMPLATE_DEBUG = True SECRET_KEY = 'example-app!' ROOT_URLCONF = 'example.urls' STATIC_URL = '/static/' DATABASES = {'default': dj_database_url.config( default='postgres://localhost/conman_example', )} DATABASES['default']['ATOMIC_REQUESTS'] = True INSTALLED_APPS = ( 'conman.routes', 'conman.pages', 'conman.redirects', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', ) MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ) Add missing requirement to example app
import os import dj_database_url BASE_DIR = os.path.dirname(os.path.dirname(__file__)) DEBUG = TEMPLATE_DEBUG = True SECRET_KEY = 'example-app!' ROOT_URLCONF = 'example.urls' STATIC_URL = '/static/' DATABASES = {'default': dj_database_url.config( default='postgres://localhost/conman_example', )} DATABASES['default']['ATOMIC_REQUESTS'] = True INSTALLED_APPS = ( 'conman.routes', 'conman.pages', 'conman.redirects', 'polymorphic', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', ) MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', )
<commit_before>import os import dj_database_url BASE_DIR = os.path.dirname(os.path.dirname(__file__)) DEBUG = TEMPLATE_DEBUG = True SECRET_KEY = 'example-app!' ROOT_URLCONF = 'example.urls' STATIC_URL = '/static/' DATABASES = {'default': dj_database_url.config( default='postgres://localhost/conman_example', )} DATABASES['default']['ATOMIC_REQUESTS'] = True INSTALLED_APPS = ( 'conman.routes', 'conman.pages', 'conman.redirects', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', ) MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ) <commit_msg>Add missing requirement to example app<commit_after>
import os import dj_database_url BASE_DIR = os.path.dirname(os.path.dirname(__file__)) DEBUG = TEMPLATE_DEBUG = True SECRET_KEY = 'example-app!' ROOT_URLCONF = 'example.urls' STATIC_URL = '/static/' DATABASES = {'default': dj_database_url.config( default='postgres://localhost/conman_example', )} DATABASES['default']['ATOMIC_REQUESTS'] = True INSTALLED_APPS = ( 'conman.routes', 'conman.pages', 'conman.redirects', 'polymorphic', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', ) MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', )
import os import dj_database_url BASE_DIR = os.path.dirname(os.path.dirname(__file__)) DEBUG = TEMPLATE_DEBUG = True SECRET_KEY = 'example-app!' ROOT_URLCONF = 'example.urls' STATIC_URL = '/static/' DATABASES = {'default': dj_database_url.config( default='postgres://localhost/conman_example', )} DATABASES['default']['ATOMIC_REQUESTS'] = True INSTALLED_APPS = ( 'conman.routes', 'conman.pages', 'conman.redirects', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', ) MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ) Add missing requirement to example appimport os import dj_database_url BASE_DIR = os.path.dirname(os.path.dirname(__file__)) DEBUG = TEMPLATE_DEBUG = True SECRET_KEY = 'example-app!' ROOT_URLCONF = 'example.urls' STATIC_URL = '/static/' DATABASES = {'default': dj_database_url.config( default='postgres://localhost/conman_example', )} DATABASES['default']['ATOMIC_REQUESTS'] = True INSTALLED_APPS = ( 'conman.routes', 'conman.pages', 'conman.redirects', 'polymorphic', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', ) MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', )
<commit_before>import os import dj_database_url BASE_DIR = os.path.dirname(os.path.dirname(__file__)) DEBUG = TEMPLATE_DEBUG = True SECRET_KEY = 'example-app!' ROOT_URLCONF = 'example.urls' STATIC_URL = '/static/' DATABASES = {'default': dj_database_url.config( default='postgres://localhost/conman_example', )} DATABASES['default']['ATOMIC_REQUESTS'] = True INSTALLED_APPS = ( 'conman.routes', 'conman.pages', 'conman.redirects', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', ) MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ) <commit_msg>Add missing requirement to example app<commit_after>import os import dj_database_url BASE_DIR = os.path.dirname(os.path.dirname(__file__)) DEBUG = TEMPLATE_DEBUG = True SECRET_KEY = 'example-app!' ROOT_URLCONF = 'example.urls' STATIC_URL = '/static/' DATABASES = {'default': dj_database_url.config( default='postgres://localhost/conman_example', )} DATABASES['default']['ATOMIC_REQUESTS'] = True INSTALLED_APPS = ( 'conman.routes', 'conman.pages', 'conman.redirects', 'polymorphic', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', ) MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', )
fb3ae8739dc5af77c91660e10e2370ad6df05787
addisonarches/sequences/stripeyhole/interludes.py
addisonarches/sequences/stripeyhole/interludes.py
#!/usr/bin/env python # -*- encoding: UTF-8 -*- # This file is part of Addison Arches. # # Addison Arches is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Addison Arches is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with Addison Arches. If not, see <http://www.gnu.org/licenses/>. async def default(folder, ensemble, log=None, loop=None): if log is not None: log.debug("No activity during interlude") return folder async def stop(folder, ensemble, log=None, loop=None): if log is not None: log.debug("Interlude stops dialogue") return None
#!/usr/bin/env python # -*- encoding: UTF-8 -*- # This file is part of Addison Arches. # # Addison Arches is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Addison Arches is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with Addison Arches. If not, see <http://www.gnu.org/licenses/>. from turberfield.dialogue.types import Player async def default(folder, ensemble:list, log=None, loop=None): if log is not None: log.debug("No activity during interlude") return folder async def stop(folder, ensemble:list, log=None, loop=None): if log is not None: log.debug("Interlude stops dialogue") for entity in ensemble[:]: if not isinstance(entity, Player): ensemble.remove(entity) return None
Stop interlude removes non-player characters.
Stop interlude removes non-player characters.
Python
agpl-3.0
tundish/addisonarches,tundish/addisonarches,tundish/addisonarches
#!/usr/bin/env python # -*- encoding: UTF-8 -*- # This file is part of Addison Arches. # # Addison Arches is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Addison Arches is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with Addison Arches. If not, see <http://www.gnu.org/licenses/>. async def default(folder, ensemble, log=None, loop=None): if log is not None: log.debug("No activity during interlude") return folder async def stop(folder, ensemble, log=None, loop=None): if log is not None: log.debug("Interlude stops dialogue") return None Stop interlude removes non-player characters.
#!/usr/bin/env python # -*- encoding: UTF-8 -*- # This file is part of Addison Arches. # # Addison Arches is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Addison Arches is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with Addison Arches. If not, see <http://www.gnu.org/licenses/>. from turberfield.dialogue.types import Player async def default(folder, ensemble:list, log=None, loop=None): if log is not None: log.debug("No activity during interlude") return folder async def stop(folder, ensemble:list, log=None, loop=None): if log is not None: log.debug("Interlude stops dialogue") for entity in ensemble[:]: if not isinstance(entity, Player): ensemble.remove(entity) return None
<commit_before>#!/usr/bin/env python # -*- encoding: UTF-8 -*- # This file is part of Addison Arches. # # Addison Arches is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Addison Arches is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with Addison Arches. If not, see <http://www.gnu.org/licenses/>. async def default(folder, ensemble, log=None, loop=None): if log is not None: log.debug("No activity during interlude") return folder async def stop(folder, ensemble, log=None, loop=None): if log is not None: log.debug("Interlude stops dialogue") return None <commit_msg>Stop interlude removes non-player characters.<commit_after>
#!/usr/bin/env python # -*- encoding: UTF-8 -*- # This file is part of Addison Arches. # # Addison Arches is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Addison Arches is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with Addison Arches. If not, see <http://www.gnu.org/licenses/>. from turberfield.dialogue.types import Player async def default(folder, ensemble:list, log=None, loop=None): if log is not None: log.debug("No activity during interlude") return folder async def stop(folder, ensemble:list, log=None, loop=None): if log is not None: log.debug("Interlude stops dialogue") for entity in ensemble[:]: if not isinstance(entity, Player): ensemble.remove(entity) return None
#!/usr/bin/env python # -*- encoding: UTF-8 -*- # This file is part of Addison Arches. # # Addison Arches is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Addison Arches is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with Addison Arches. If not, see <http://www.gnu.org/licenses/>. async def default(folder, ensemble, log=None, loop=None): if log is not None: log.debug("No activity during interlude") return folder async def stop(folder, ensemble, log=None, loop=None): if log is not None: log.debug("Interlude stops dialogue") return None Stop interlude removes non-player characters.#!/usr/bin/env python # -*- encoding: UTF-8 -*- # This file is part of Addison Arches. # # Addison Arches is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Addison Arches is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with Addison Arches. If not, see <http://www.gnu.org/licenses/>. from turberfield.dialogue.types import Player async def default(folder, ensemble:list, log=None, loop=None): if log is not None: log.debug("No activity during interlude") return folder async def stop(folder, ensemble:list, log=None, loop=None): if log is not None: log.debug("Interlude stops dialogue") for entity in ensemble[:]: if not isinstance(entity, Player): ensemble.remove(entity) return None
<commit_before>#!/usr/bin/env python # -*- encoding: UTF-8 -*- # This file is part of Addison Arches. # # Addison Arches is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Addison Arches is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with Addison Arches. If not, see <http://www.gnu.org/licenses/>. async def default(folder, ensemble, log=None, loop=None): if log is not None: log.debug("No activity during interlude") return folder async def stop(folder, ensemble, log=None, loop=None): if log is not None: log.debug("Interlude stops dialogue") return None <commit_msg>Stop interlude removes non-player characters.<commit_after>#!/usr/bin/env python # -*- encoding: UTF-8 -*- # This file is part of Addison Arches. # # Addison Arches is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Addison Arches is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with Addison Arches. If not, see <http://www.gnu.org/licenses/>. from turberfield.dialogue.types import Player async def default(folder, ensemble:list, log=None, loop=None): if log is not None: log.debug("No activity during interlude") return folder async def stop(folder, ensemble:list, log=None, loop=None): if log is not None: log.debug("Interlude stops dialogue") for entity in ensemble[:]: if not isinstance(entity, Player): ensemble.remove(entity) return None
56a2a873bb23631779eebb0dc35359ccf67f04e7
source/bark/logger/dynamic.py
source/bark/logger/dynamic.py
# :coding: utf-8 # :copyright: Copyright (c) 2013 Martin Pengelly-Phillips # :license: See LICENSE.txt. from .base import Logger class Dynamic(Logger): '''Dynamic logger allowing delayed computation of values.''' def __getitem__(self, key): '''Return value referenced by *key*. If the value is a callable, then call it and return the result. In addition store the computed result for future use. ''' value = self._mapping[key] if callable(value): self[key] = value = value() return value
# :coding: utf-8 # :copyright: Copyright (c) 2013 Martin Pengelly-Phillips # :license: See LICENSE.txt. import collections from .base import Logger class Dynamic(Logger): '''Dynamic logger allowing delayed computation of values.''' def __getitem__(self, key): '''Return value referenced by *key*. If the value is a callable, then call it and return the result. In addition store the computed result for future use. ''' value = self._mapping[key] if isinstance(value, collections.Callable): self[key] = value = value() return value
Use collections.Callable test for future compatibility.
Use collections.Callable test for future compatibility.
Python
apache-2.0
4degrees/mill,4degrees/sawmill
# :coding: utf-8 # :copyright: Copyright (c) 2013 Martin Pengelly-Phillips # :license: See LICENSE.txt. from .base import Logger class Dynamic(Logger): '''Dynamic logger allowing delayed computation of values.''' def __getitem__(self, key): '''Return value referenced by *key*. If the value is a callable, then call it and return the result. In addition store the computed result for future use. ''' value = self._mapping[key] if callable(value): self[key] = value = value() return value Use collections.Callable test for future compatibility.
# :coding: utf-8 # :copyright: Copyright (c) 2013 Martin Pengelly-Phillips # :license: See LICENSE.txt. import collections from .base import Logger class Dynamic(Logger): '''Dynamic logger allowing delayed computation of values.''' def __getitem__(self, key): '''Return value referenced by *key*. If the value is a callable, then call it and return the result. In addition store the computed result for future use. ''' value = self._mapping[key] if isinstance(value, collections.Callable): self[key] = value = value() return value
<commit_before># :coding: utf-8 # :copyright: Copyright (c) 2013 Martin Pengelly-Phillips # :license: See LICENSE.txt. from .base import Logger class Dynamic(Logger): '''Dynamic logger allowing delayed computation of values.''' def __getitem__(self, key): '''Return value referenced by *key*. If the value is a callable, then call it and return the result. In addition store the computed result for future use. ''' value = self._mapping[key] if callable(value): self[key] = value = value() return value <commit_msg>Use collections.Callable test for future compatibility.<commit_after>
# :coding: utf-8 # :copyright: Copyright (c) 2013 Martin Pengelly-Phillips # :license: See LICENSE.txt. import collections from .base import Logger class Dynamic(Logger): '''Dynamic logger allowing delayed computation of values.''' def __getitem__(self, key): '''Return value referenced by *key*. If the value is a callable, then call it and return the result. In addition store the computed result for future use. ''' value = self._mapping[key] if isinstance(value, collections.Callable): self[key] = value = value() return value
# :coding: utf-8 # :copyright: Copyright (c) 2013 Martin Pengelly-Phillips # :license: See LICENSE.txt. from .base import Logger class Dynamic(Logger): '''Dynamic logger allowing delayed computation of values.''' def __getitem__(self, key): '''Return value referenced by *key*. If the value is a callable, then call it and return the result. In addition store the computed result for future use. ''' value = self._mapping[key] if callable(value): self[key] = value = value() return value Use collections.Callable test for future compatibility.# :coding: utf-8 # :copyright: Copyright (c) 2013 Martin Pengelly-Phillips # :license: See LICENSE.txt. import collections from .base import Logger class Dynamic(Logger): '''Dynamic logger allowing delayed computation of values.''' def __getitem__(self, key): '''Return value referenced by *key*. If the value is a callable, then call it and return the result. In addition store the computed result for future use. ''' value = self._mapping[key] if isinstance(value, collections.Callable): self[key] = value = value() return value
<commit_before># :coding: utf-8 # :copyright: Copyright (c) 2013 Martin Pengelly-Phillips # :license: See LICENSE.txt. from .base import Logger class Dynamic(Logger): '''Dynamic logger allowing delayed computation of values.''' def __getitem__(self, key): '''Return value referenced by *key*. If the value is a callable, then call it and return the result. In addition store the computed result for future use. ''' value = self._mapping[key] if callable(value): self[key] = value = value() return value <commit_msg>Use collections.Callable test for future compatibility.<commit_after># :coding: utf-8 # :copyright: Copyright (c) 2013 Martin Pengelly-Phillips # :license: See LICENSE.txt. import collections from .base import Logger class Dynamic(Logger): '''Dynamic logger allowing delayed computation of values.''' def __getitem__(self, key): '''Return value referenced by *key*. If the value is a callable, then call it and return the result. In addition store the computed result for future use. ''' value = self._mapping[key] if isinstance(value, collections.Callable): self[key] = value = value() return value
b1f9ef9422010c5398852377946969ab98bc17e1
changes/artifacts/manifest_json.py
changes/artifacts/manifest_json.py
from __future__ import absolute_import import json from changes.config import db from changes.constants import Result from changes.models import FailureReason from .base import ArtifactHandler class ManifestJsonHandler(ArtifactHandler): """ Artifact handler for manifest.json files. Makes sure their contents are valid. """ FILENAMES = ('manifest.json',) def process(self, fp): try: contents = json.load(fp) if contents['job_step_id'] != self.step.id.hex: self.logger.warning('manifest.json had wrong step id (build=%s): expected %s but got %s', self.step.job.build_id.hex, self.step.id.hex, contents['job_step_id']) # TODO(nate): temporarily disabled # self._add_failure_reason() except Exception: self.logger.exception('Failed to parse manifest.json; (build=%s, step=%s)', self.step.job.build_id.hex, self.step.id.hex) # TODO(nate): temporarily disabled # self._add_failure_reason() def _add_failure_reason(self): db.session.add(FailureReason( step_id=self.step.id, job_id=self.step.job_id, build_id=self.step.job.build_id, project_id=self.step.project_id, reason='malformed_manifest_json' )) self.step.result = Result.infra_failed db.session.add(self.step) db.session.commit()
from __future__ import absolute_import import json from changes.config import db from changes.constants import Result from changes.models import FailureReason from .base import ArtifactHandler class ManifestJsonHandler(ArtifactHandler): """ Artifact handler for manifest.json files. Makes sure their contents are valid. """ FILENAMES = ('manifest.json',) def process(self, fp): try: contents = json.load(fp) if contents['job_step_id'] != self.step.id.hex: self.logger.warning('manifest.json had wrong step id (build=%s): expected %s but got %s', self.step.job.build_id.hex, self.step.id.hex, contents['job_step_id']) self._add_failure_reason() except Exception: self.logger.warning('Failed to parse manifest.json; (build=%s, step=%s)', self.step.job.build_id.hex, self.step.id.hex, exc_info=True) self._add_failure_reason() def _add_failure_reason(self): db.session.add(FailureReason( step_id=self.step.id, job_id=self.step.job_id, build_id=self.step.job.build_id, project_id=self.step.project_id, reason='malformed_manifest_json' )) self.step.result = Result.infra_failed db.session.add(self.step) db.session.commit()
Make malformed/mismatched manifest.json an infra failure
Make malformed/mismatched manifest.json an infra failure Summary: - This was disabled for a while due to problems with phased jobsteps, but Sentry shows that these errors occasionally still happen, but seem to be "real" errors now. Should almost certainly be marked infra failures. - Also make malformed manifest a warning (and use exc_info=True) since malformed vs mismatched jobstep id seem like approximately the same severity. Test Plan: Sentry indicates these happen rarely and when they do are probably legitimate infra failures. Reviewers: paulruan Reviewed By: paulruan Subscribers: changesbot, kylec Differential Revision: https://tails.corp.dropbox.com/D152534
Python
apache-2.0
dropbox/changes,dropbox/changes,dropbox/changes,dropbox/changes
from __future__ import absolute_import import json from changes.config import db from changes.constants import Result from changes.models import FailureReason from .base import ArtifactHandler class ManifestJsonHandler(ArtifactHandler): """ Artifact handler for manifest.json files. Makes sure their contents are valid. """ FILENAMES = ('manifest.json',) def process(self, fp): try: contents = json.load(fp) if contents['job_step_id'] != self.step.id.hex: self.logger.warning('manifest.json had wrong step id (build=%s): expected %s but got %s', self.step.job.build_id.hex, self.step.id.hex, contents['job_step_id']) # TODO(nate): temporarily disabled # self._add_failure_reason() except Exception: self.logger.exception('Failed to parse manifest.json; (build=%s, step=%s)', self.step.job.build_id.hex, self.step.id.hex) # TODO(nate): temporarily disabled # self._add_failure_reason() def _add_failure_reason(self): db.session.add(FailureReason( step_id=self.step.id, job_id=self.step.job_id, build_id=self.step.job.build_id, project_id=self.step.project_id, reason='malformed_manifest_json' )) self.step.result = Result.infra_failed db.session.add(self.step) db.session.commit() Make malformed/mismatched manifest.json an infra failure Summary: - This was disabled for a while due to problems with phased jobsteps, but Sentry shows that these errors occasionally still happen, but seem to be "real" errors now. Should almost certainly be marked infra failures. - Also make malformed manifest a warning (and use exc_info=True) since malformed vs mismatched jobstep id seem like approximately the same severity. Test Plan: Sentry indicates these happen rarely and when they do are probably legitimate infra failures. Reviewers: paulruan Reviewed By: paulruan Subscribers: changesbot, kylec Differential Revision: https://tails.corp.dropbox.com/D152534
from __future__ import absolute_import import json from changes.config import db from changes.constants import Result from changes.models import FailureReason from .base import ArtifactHandler class ManifestJsonHandler(ArtifactHandler): """ Artifact handler for manifest.json files. Makes sure their contents are valid. """ FILENAMES = ('manifest.json',) def process(self, fp): try: contents = json.load(fp) if contents['job_step_id'] != self.step.id.hex: self.logger.warning('manifest.json had wrong step id (build=%s): expected %s but got %s', self.step.job.build_id.hex, self.step.id.hex, contents['job_step_id']) self._add_failure_reason() except Exception: self.logger.warning('Failed to parse manifest.json; (build=%s, step=%s)', self.step.job.build_id.hex, self.step.id.hex, exc_info=True) self._add_failure_reason() def _add_failure_reason(self): db.session.add(FailureReason( step_id=self.step.id, job_id=self.step.job_id, build_id=self.step.job.build_id, project_id=self.step.project_id, reason='malformed_manifest_json' )) self.step.result = Result.infra_failed db.session.add(self.step) db.session.commit()
<commit_before>from __future__ import absolute_import import json from changes.config import db from changes.constants import Result from changes.models import FailureReason from .base import ArtifactHandler class ManifestJsonHandler(ArtifactHandler): """ Artifact handler for manifest.json files. Makes sure their contents are valid. """ FILENAMES = ('manifest.json',) def process(self, fp): try: contents = json.load(fp) if contents['job_step_id'] != self.step.id.hex: self.logger.warning('manifest.json had wrong step id (build=%s): expected %s but got %s', self.step.job.build_id.hex, self.step.id.hex, contents['job_step_id']) # TODO(nate): temporarily disabled # self._add_failure_reason() except Exception: self.logger.exception('Failed to parse manifest.json; (build=%s, step=%s)', self.step.job.build_id.hex, self.step.id.hex) # TODO(nate): temporarily disabled # self._add_failure_reason() def _add_failure_reason(self): db.session.add(FailureReason( step_id=self.step.id, job_id=self.step.job_id, build_id=self.step.job.build_id, project_id=self.step.project_id, reason='malformed_manifest_json' )) self.step.result = Result.infra_failed db.session.add(self.step) db.session.commit() <commit_msg>Make malformed/mismatched manifest.json an infra failure Summary: - This was disabled for a while due to problems with phased jobsteps, but Sentry shows that these errors occasionally still happen, but seem to be "real" errors now. Should almost certainly be marked infra failures. - Also make malformed manifest a warning (and use exc_info=True) since malformed vs mismatched jobstep id seem like approximately the same severity. Test Plan: Sentry indicates these happen rarely and when they do are probably legitimate infra failures. Reviewers: paulruan Reviewed By: paulruan Subscribers: changesbot, kylec Differential Revision: https://tails.corp.dropbox.com/D152534<commit_after>
from __future__ import absolute_import import json from changes.config import db from changes.constants import Result from changes.models import FailureReason from .base import ArtifactHandler class ManifestJsonHandler(ArtifactHandler): """ Artifact handler for manifest.json files. Makes sure their contents are valid. """ FILENAMES = ('manifest.json',) def process(self, fp): try: contents = json.load(fp) if contents['job_step_id'] != self.step.id.hex: self.logger.warning('manifest.json had wrong step id (build=%s): expected %s but got %s', self.step.job.build_id.hex, self.step.id.hex, contents['job_step_id']) self._add_failure_reason() except Exception: self.logger.warning('Failed to parse manifest.json; (build=%s, step=%s)', self.step.job.build_id.hex, self.step.id.hex, exc_info=True) self._add_failure_reason() def _add_failure_reason(self): db.session.add(FailureReason( step_id=self.step.id, job_id=self.step.job_id, build_id=self.step.job.build_id, project_id=self.step.project_id, reason='malformed_manifest_json' )) self.step.result = Result.infra_failed db.session.add(self.step) db.session.commit()
from __future__ import absolute_import import json from changes.config import db from changes.constants import Result from changes.models import FailureReason from .base import ArtifactHandler class ManifestJsonHandler(ArtifactHandler): """ Artifact handler for manifest.json files. Makes sure their contents are valid. """ FILENAMES = ('manifest.json',) def process(self, fp): try: contents = json.load(fp) if contents['job_step_id'] != self.step.id.hex: self.logger.warning('manifest.json had wrong step id (build=%s): expected %s but got %s', self.step.job.build_id.hex, self.step.id.hex, contents['job_step_id']) # TODO(nate): temporarily disabled # self._add_failure_reason() except Exception: self.logger.exception('Failed to parse manifest.json; (build=%s, step=%s)', self.step.job.build_id.hex, self.step.id.hex) # TODO(nate): temporarily disabled # self._add_failure_reason() def _add_failure_reason(self): db.session.add(FailureReason( step_id=self.step.id, job_id=self.step.job_id, build_id=self.step.job.build_id, project_id=self.step.project_id, reason='malformed_manifest_json' )) self.step.result = Result.infra_failed db.session.add(self.step) db.session.commit() Make malformed/mismatched manifest.json an infra failure Summary: - This was disabled for a while due to problems with phased jobsteps, but Sentry shows that these errors occasionally still happen, but seem to be "real" errors now. Should almost certainly be marked infra failures. - Also make malformed manifest a warning (and use exc_info=True) since malformed vs mismatched jobstep id seem like approximately the same severity. Test Plan: Sentry indicates these happen rarely and when they do are probably legitimate infra failures. Reviewers: paulruan Reviewed By: paulruan Subscribers: changesbot, kylec Differential Revision: https://tails.corp.dropbox.com/D152534from __future__ import absolute_import import json from changes.config import db from changes.constants import Result from changes.models import FailureReason from .base import ArtifactHandler class ManifestJsonHandler(ArtifactHandler): """ Artifact handler for manifest.json files. Makes sure their contents are valid. """ FILENAMES = ('manifest.json',) def process(self, fp): try: contents = json.load(fp) if contents['job_step_id'] != self.step.id.hex: self.logger.warning('manifest.json had wrong step id (build=%s): expected %s but got %s', self.step.job.build_id.hex, self.step.id.hex, contents['job_step_id']) self._add_failure_reason() except Exception: self.logger.warning('Failed to parse manifest.json; (build=%s, step=%s)', self.step.job.build_id.hex, self.step.id.hex, exc_info=True) self._add_failure_reason() def _add_failure_reason(self): db.session.add(FailureReason( step_id=self.step.id, job_id=self.step.job_id, build_id=self.step.job.build_id, project_id=self.step.project_id, reason='malformed_manifest_json' )) self.step.result = Result.infra_failed db.session.add(self.step) db.session.commit()
<commit_before>from __future__ import absolute_import import json from changes.config import db from changes.constants import Result from changes.models import FailureReason from .base import ArtifactHandler class ManifestJsonHandler(ArtifactHandler): """ Artifact handler for manifest.json files. Makes sure their contents are valid. """ FILENAMES = ('manifest.json',) def process(self, fp): try: contents = json.load(fp) if contents['job_step_id'] != self.step.id.hex: self.logger.warning('manifest.json had wrong step id (build=%s): expected %s but got %s', self.step.job.build_id.hex, self.step.id.hex, contents['job_step_id']) # TODO(nate): temporarily disabled # self._add_failure_reason() except Exception: self.logger.exception('Failed to parse manifest.json; (build=%s, step=%s)', self.step.job.build_id.hex, self.step.id.hex) # TODO(nate): temporarily disabled # self._add_failure_reason() def _add_failure_reason(self): db.session.add(FailureReason( step_id=self.step.id, job_id=self.step.job_id, build_id=self.step.job.build_id, project_id=self.step.project_id, reason='malformed_manifest_json' )) self.step.result = Result.infra_failed db.session.add(self.step) db.session.commit() <commit_msg>Make malformed/mismatched manifest.json an infra failure Summary: - This was disabled for a while due to problems with phased jobsteps, but Sentry shows that these errors occasionally still happen, but seem to be "real" errors now. Should almost certainly be marked infra failures. - Also make malformed manifest a warning (and use exc_info=True) since malformed vs mismatched jobstep id seem like approximately the same severity. Test Plan: Sentry indicates these happen rarely and when they do are probably legitimate infra failures. Reviewers: paulruan Reviewed By: paulruan Subscribers: changesbot, kylec Differential Revision: https://tails.corp.dropbox.com/D152534<commit_after>from __future__ import absolute_import import json from changes.config import db from changes.constants import Result from changes.models import FailureReason from .base import ArtifactHandler class ManifestJsonHandler(ArtifactHandler): """ Artifact handler for manifest.json files. Makes sure their contents are valid. """ FILENAMES = ('manifest.json',) def process(self, fp): try: contents = json.load(fp) if contents['job_step_id'] != self.step.id.hex: self.logger.warning('manifest.json had wrong step id (build=%s): expected %s but got %s', self.step.job.build_id.hex, self.step.id.hex, contents['job_step_id']) self._add_failure_reason() except Exception: self.logger.warning('Failed to parse manifest.json; (build=%s, step=%s)', self.step.job.build_id.hex, self.step.id.hex, exc_info=True) self._add_failure_reason() def _add_failure_reason(self): db.session.add(FailureReason( step_id=self.step.id, job_id=self.step.job_id, build_id=self.step.job.build_id, project_id=self.step.project_id, reason='malformed_manifest_json' )) self.step.result = Result.infra_failed db.session.add(self.step) db.session.commit()
e84a72050c18bcdf97e1f04086c873fbd1a6cebf
trackon/gaeutils.py
trackon/gaeutils.py
from google.appengine.api import memcache as MC def logmsg(msg, log_name='default'): # TODO Should optimize to avoid memcache's pickling # XXX There is an obvious race if we try to store two msgs at the same time l = MC.get(log_name, namespace='msg-logs') or [] l.insert(0, msg) MC.set(log_name, l[:64], namespace='msg-logs') # Keep 64 messages def getmsglog(log_name='default'): return MC.get(log_name, namespace='msg-logs')
from google.appengine.api import memcache as MC from time import gmtime def logmsg(msg, log_name='default'): # TODO Should optimize to avoid memcache's pickling # XXX There is an obvious race if we try to store two msgs at the same time l = MC.get(log_name, namespace='msg-logs') or [] d = "%d/%02d/%02d %02d:%02d" % (gmtime()[:5]) l.insert(0, "%s - %s" %(d, msg)) MC.set(log_name, l[:128], namespace='msg-logs') # Keep 64 messages def getmsglog(log_name='default'): return MC.get(log_name, namespace='msg-logs')
Prepend date/time to log messages, and expand the size of the message log to 128 entries.
Prepend date/time to log messages, and expand the size of the message log to 128 entries.
Python
mit
CorralPeltzer/newTrackon
from google.appengine.api import memcache as MC def logmsg(msg, log_name='default'): # TODO Should optimize to avoid memcache's pickling # XXX There is an obvious race if we try to store two msgs at the same time l = MC.get(log_name, namespace='msg-logs') or [] l.insert(0, msg) MC.set(log_name, l[:64], namespace='msg-logs') # Keep 64 messages def getmsglog(log_name='default'): return MC.get(log_name, namespace='msg-logs') Prepend date/time to log messages, and expand the size of the message log to 128 entries.
from google.appengine.api import memcache as MC from time import gmtime def logmsg(msg, log_name='default'): # TODO Should optimize to avoid memcache's pickling # XXX There is an obvious race if we try to store two msgs at the same time l = MC.get(log_name, namespace='msg-logs') or [] d = "%d/%02d/%02d %02d:%02d" % (gmtime()[:5]) l.insert(0, "%s - %s" %(d, msg)) MC.set(log_name, l[:128], namespace='msg-logs') # Keep 64 messages def getmsglog(log_name='default'): return MC.get(log_name, namespace='msg-logs')
<commit_before>from google.appengine.api import memcache as MC def logmsg(msg, log_name='default'): # TODO Should optimize to avoid memcache's pickling # XXX There is an obvious race if we try to store two msgs at the same time l = MC.get(log_name, namespace='msg-logs') or [] l.insert(0, msg) MC.set(log_name, l[:64], namespace='msg-logs') # Keep 64 messages def getmsglog(log_name='default'): return MC.get(log_name, namespace='msg-logs') <commit_msg>Prepend date/time to log messages, and expand the size of the message log to 128 entries.<commit_after>
from google.appengine.api import memcache as MC from time import gmtime def logmsg(msg, log_name='default'): # TODO Should optimize to avoid memcache's pickling # XXX There is an obvious race if we try to store two msgs at the same time l = MC.get(log_name, namespace='msg-logs') or [] d = "%d/%02d/%02d %02d:%02d" % (gmtime()[:5]) l.insert(0, "%s - %s" %(d, msg)) MC.set(log_name, l[:128], namespace='msg-logs') # Keep 64 messages def getmsglog(log_name='default'): return MC.get(log_name, namespace='msg-logs')
from google.appengine.api import memcache as MC def logmsg(msg, log_name='default'): # TODO Should optimize to avoid memcache's pickling # XXX There is an obvious race if we try to store two msgs at the same time l = MC.get(log_name, namespace='msg-logs') or [] l.insert(0, msg) MC.set(log_name, l[:64], namespace='msg-logs') # Keep 64 messages def getmsglog(log_name='default'): return MC.get(log_name, namespace='msg-logs') Prepend date/time to log messages, and expand the size of the message log to 128 entries.from google.appengine.api import memcache as MC from time import gmtime def logmsg(msg, log_name='default'): # TODO Should optimize to avoid memcache's pickling # XXX There is an obvious race if we try to store two msgs at the same time l = MC.get(log_name, namespace='msg-logs') or [] d = "%d/%02d/%02d %02d:%02d" % (gmtime()[:5]) l.insert(0, "%s - %s" %(d, msg)) MC.set(log_name, l[:128], namespace='msg-logs') # Keep 64 messages def getmsglog(log_name='default'): return MC.get(log_name, namespace='msg-logs')
<commit_before>from google.appengine.api import memcache as MC def logmsg(msg, log_name='default'): # TODO Should optimize to avoid memcache's pickling # XXX There is an obvious race if we try to store two msgs at the same time l = MC.get(log_name, namespace='msg-logs') or [] l.insert(0, msg) MC.set(log_name, l[:64], namespace='msg-logs') # Keep 64 messages def getmsglog(log_name='default'): return MC.get(log_name, namespace='msg-logs') <commit_msg>Prepend date/time to log messages, and expand the size of the message log to 128 entries.<commit_after>from google.appengine.api import memcache as MC from time import gmtime def logmsg(msg, log_name='default'): # TODO Should optimize to avoid memcache's pickling # XXX There is an obvious race if we try to store two msgs at the same time l = MC.get(log_name, namespace='msg-logs') or [] d = "%d/%02d/%02d %02d:%02d" % (gmtime()[:5]) l.insert(0, "%s - %s" %(d, msg)) MC.set(log_name, l[:128], namespace='msg-logs') # Keep 64 messages def getmsglog(log_name='default'): return MC.get(log_name, namespace='msg-logs')
85edd0e25a74c9fb144468adc88b3081acef8ce2
ds_binary_tree.py
ds_binary_tree.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function class BinaryTree(oject): """Binary Tree using class.""" def __init__(self, root): self.key = root self.left_tree = None self.right_tree = None pass def main(): pass if __name__ == '__main__': main()
from __future__ import absolute_import from __future__ import division from __future__ import print_function class BinaryTree(oject): """Binary Tree using class.""" def __init__(self, root): self.key = root self.left_tree = None self.right_tree = None def insert_left(self, new_node): if self.left_tree is None: self.left_tree = BinaryTree(new_node) else: t = BinaryTree(new_node) t.left = self.left_tree self.left_tree = t def insert_right(self, new_node): if self.right_tree is None: self.right_tree = BinaryTree(new_node) else: t = BinaryTree(new_node) t.right_tree = self.right_tree self.right_tree = t def get_root_value(self): return self.key def set_root_value(self): # TODO: here pass def main(): pass if __name__ == '__main__': main()
Implement binary tree at Narity Airportx
Implement binary tree at Narity Airportx
Python
bsd-2-clause
bowen0701/algorithms_data_structures
from __future__ import absolute_import from __future__ import division from __future__ import print_function class BinaryTree(oject): """Binary Tree using class.""" def __init__(self, root): self.key = root self.left_tree = None self.right_tree = None pass def main(): pass if __name__ == '__main__': main() Implement binary tree at Narity Airportx
from __future__ import absolute_import from __future__ import division from __future__ import print_function class BinaryTree(oject): """Binary Tree using class.""" def __init__(self, root): self.key = root self.left_tree = None self.right_tree = None def insert_left(self, new_node): if self.left_tree is None: self.left_tree = BinaryTree(new_node) else: t = BinaryTree(new_node) t.left = self.left_tree self.left_tree = t def insert_right(self, new_node): if self.right_tree is None: self.right_tree = BinaryTree(new_node) else: t = BinaryTree(new_node) t.right_tree = self.right_tree self.right_tree = t def get_root_value(self): return self.key def set_root_value(self): # TODO: here pass def main(): pass if __name__ == '__main__': main()
<commit_before>from __future__ import absolute_import from __future__ import division from __future__ import print_function class BinaryTree(oject): """Binary Tree using class.""" def __init__(self, root): self.key = root self.left_tree = None self.right_tree = None pass def main(): pass if __name__ == '__main__': main() <commit_msg>Implement binary tree at Narity Airportx<commit_after>
from __future__ import absolute_import from __future__ import division from __future__ import print_function class BinaryTree(oject): """Binary Tree using class.""" def __init__(self, root): self.key = root self.left_tree = None self.right_tree = None def insert_left(self, new_node): if self.left_tree is None: self.left_tree = BinaryTree(new_node) else: t = BinaryTree(new_node) t.left = self.left_tree self.left_tree = t def insert_right(self, new_node): if self.right_tree is None: self.right_tree = BinaryTree(new_node) else: t = BinaryTree(new_node) t.right_tree = self.right_tree self.right_tree = t def get_root_value(self): return self.key def set_root_value(self): # TODO: here pass def main(): pass if __name__ == '__main__': main()
from __future__ import absolute_import from __future__ import division from __future__ import print_function class BinaryTree(oject): """Binary Tree using class.""" def __init__(self, root): self.key = root self.left_tree = None self.right_tree = None pass def main(): pass if __name__ == '__main__': main() Implement binary tree at Narity Airportxfrom __future__ import absolute_import from __future__ import division from __future__ import print_function class BinaryTree(oject): """Binary Tree using class.""" def __init__(self, root): self.key = root self.left_tree = None self.right_tree = None def insert_left(self, new_node): if self.left_tree is None: self.left_tree = BinaryTree(new_node) else: t = BinaryTree(new_node) t.left = self.left_tree self.left_tree = t def insert_right(self, new_node): if self.right_tree is None: self.right_tree = BinaryTree(new_node) else: t = BinaryTree(new_node) t.right_tree = self.right_tree self.right_tree = t def get_root_value(self): return self.key def set_root_value(self): # TODO: here pass def main(): pass if __name__ == '__main__': main()
<commit_before>from __future__ import absolute_import from __future__ import division from __future__ import print_function class BinaryTree(oject): """Binary Tree using class.""" def __init__(self, root): self.key = root self.left_tree = None self.right_tree = None pass def main(): pass if __name__ == '__main__': main() <commit_msg>Implement binary tree at Narity Airportx<commit_after>from __future__ import absolute_import from __future__ import division from __future__ import print_function class BinaryTree(oject): """Binary Tree using class.""" def __init__(self, root): self.key = root self.left_tree = None self.right_tree = None def insert_left(self, new_node): if self.left_tree is None: self.left_tree = BinaryTree(new_node) else: t = BinaryTree(new_node) t.left = self.left_tree self.left_tree = t def insert_right(self, new_node): if self.right_tree is None: self.right_tree = BinaryTree(new_node) else: t = BinaryTree(new_node) t.right_tree = self.right_tree self.right_tree = t def get_root_value(self): return self.key def set_root_value(self): # TODO: here pass def main(): pass if __name__ == '__main__': main()
7e19c69d8315863965a59007b716d92c115833a4
autocloud/__init__.py
autocloud/__init__.py
# -*- coding: utf-8 -*- import ConfigParser import os PROJECT_ROOT = os.path.abspath(os.path.dirname(__name__)) name = '/etc/autocloud/autocloud.cfg' if not os.path.exists(name): raise Exception('Please add a proper cofig file under /etc/autocloud/') config.read(name) KOJI_SERVER_URL = config.get('autocloud', 'koji_server_url') BASE_KOJI_TASK_URL = config.get('autocloud', 'base_koji_task_url') HOST = config.get('autocloud', 'host') or '127.0.0.1' PORT = int(config.get('autocloud', 'port')) or 5000 DEBUG = config.getboolean('autocloud', 'debug') SQLALCHEMY_URI = config.get('sqlalchemy', 'uri') VIRTUALBOX = config.getboolean('autocloud', 'virtualbox')
# -*- coding: utf-8 -*- import ConfigParser import os PROJECT_ROOT = os.path.abspath(os.path.dirname(__name__)) name = '/etc/autocloud/autocloud.cfg' if not os.path.exists(name): raise Exception('Please add a proper cofig file under /etc/autocloud/') config = ConfigParser.RawConfigParser() config.read(name) KOJI_SERVER_URL = config.get('autocloud', 'koji_server_url') BASE_KOJI_TASK_URL = config.get('autocloud', 'base_koji_task_url') HOST = config.get('autocloud', 'host') or '127.0.0.1' PORT = int(config.get('autocloud', 'port')) or 5000 DEBUG = config.getboolean('autocloud', 'debug') SQLALCHEMY_URI = config.get('sqlalchemy', 'uri') VIRTUALBOX = config.getboolean('autocloud', 'virtualbox')
Fix config name error for autocloud service
Fix config name error for autocloud service
Python
agpl-3.0
kushaldas/autocloud,maxamillion/autocloud,maxamillion/autocloud,maxamillion/autocloud,maxamillion/autocloud,kushaldas/autocloud,kushaldas/autocloud,kushaldas/autocloud
# -*- coding: utf-8 -*- import ConfigParser import os PROJECT_ROOT = os.path.abspath(os.path.dirname(__name__)) name = '/etc/autocloud/autocloud.cfg' if not os.path.exists(name): raise Exception('Please add a proper cofig file under /etc/autocloud/') config.read(name) KOJI_SERVER_URL = config.get('autocloud', 'koji_server_url') BASE_KOJI_TASK_URL = config.get('autocloud', 'base_koji_task_url') HOST = config.get('autocloud', 'host') or '127.0.0.1' PORT = int(config.get('autocloud', 'port')) or 5000 DEBUG = config.getboolean('autocloud', 'debug') SQLALCHEMY_URI = config.get('sqlalchemy', 'uri') VIRTUALBOX = config.getboolean('autocloud', 'virtualbox') Fix config name error for autocloud service
# -*- coding: utf-8 -*- import ConfigParser import os PROJECT_ROOT = os.path.abspath(os.path.dirname(__name__)) name = '/etc/autocloud/autocloud.cfg' if not os.path.exists(name): raise Exception('Please add a proper cofig file under /etc/autocloud/') config = ConfigParser.RawConfigParser() config.read(name) KOJI_SERVER_URL = config.get('autocloud', 'koji_server_url') BASE_KOJI_TASK_URL = config.get('autocloud', 'base_koji_task_url') HOST = config.get('autocloud', 'host') or '127.0.0.1' PORT = int(config.get('autocloud', 'port')) or 5000 DEBUG = config.getboolean('autocloud', 'debug') SQLALCHEMY_URI = config.get('sqlalchemy', 'uri') VIRTUALBOX = config.getboolean('autocloud', 'virtualbox')
<commit_before># -*- coding: utf-8 -*- import ConfigParser import os PROJECT_ROOT = os.path.abspath(os.path.dirname(__name__)) name = '/etc/autocloud/autocloud.cfg' if not os.path.exists(name): raise Exception('Please add a proper cofig file under /etc/autocloud/') config.read(name) KOJI_SERVER_URL = config.get('autocloud', 'koji_server_url') BASE_KOJI_TASK_URL = config.get('autocloud', 'base_koji_task_url') HOST = config.get('autocloud', 'host') or '127.0.0.1' PORT = int(config.get('autocloud', 'port')) or 5000 DEBUG = config.getboolean('autocloud', 'debug') SQLALCHEMY_URI = config.get('sqlalchemy', 'uri') VIRTUALBOX = config.getboolean('autocloud', 'virtualbox') <commit_msg>Fix config name error for autocloud service<commit_after>
# -*- coding: utf-8 -*- import ConfigParser import os PROJECT_ROOT = os.path.abspath(os.path.dirname(__name__)) name = '/etc/autocloud/autocloud.cfg' if not os.path.exists(name): raise Exception('Please add a proper cofig file under /etc/autocloud/') config = ConfigParser.RawConfigParser() config.read(name) KOJI_SERVER_URL = config.get('autocloud', 'koji_server_url') BASE_KOJI_TASK_URL = config.get('autocloud', 'base_koji_task_url') HOST = config.get('autocloud', 'host') or '127.0.0.1' PORT = int(config.get('autocloud', 'port')) or 5000 DEBUG = config.getboolean('autocloud', 'debug') SQLALCHEMY_URI = config.get('sqlalchemy', 'uri') VIRTUALBOX = config.getboolean('autocloud', 'virtualbox')
# -*- coding: utf-8 -*- import ConfigParser import os PROJECT_ROOT = os.path.abspath(os.path.dirname(__name__)) name = '/etc/autocloud/autocloud.cfg' if not os.path.exists(name): raise Exception('Please add a proper cofig file under /etc/autocloud/') config.read(name) KOJI_SERVER_URL = config.get('autocloud', 'koji_server_url') BASE_KOJI_TASK_URL = config.get('autocloud', 'base_koji_task_url') HOST = config.get('autocloud', 'host') or '127.0.0.1' PORT = int(config.get('autocloud', 'port')) or 5000 DEBUG = config.getboolean('autocloud', 'debug') SQLALCHEMY_URI = config.get('sqlalchemy', 'uri') VIRTUALBOX = config.getboolean('autocloud', 'virtualbox') Fix config name error for autocloud service# -*- coding: utf-8 -*- import ConfigParser import os PROJECT_ROOT = os.path.abspath(os.path.dirname(__name__)) name = '/etc/autocloud/autocloud.cfg' if not os.path.exists(name): raise Exception('Please add a proper cofig file under /etc/autocloud/') config = ConfigParser.RawConfigParser() config.read(name) KOJI_SERVER_URL = config.get('autocloud', 'koji_server_url') BASE_KOJI_TASK_URL = config.get('autocloud', 'base_koji_task_url') HOST = config.get('autocloud', 'host') or '127.0.0.1' PORT = int(config.get('autocloud', 'port')) or 5000 DEBUG = config.getboolean('autocloud', 'debug') SQLALCHEMY_URI = config.get('sqlalchemy', 'uri') VIRTUALBOX = config.getboolean('autocloud', 'virtualbox')
<commit_before># -*- coding: utf-8 -*- import ConfigParser import os PROJECT_ROOT = os.path.abspath(os.path.dirname(__name__)) name = '/etc/autocloud/autocloud.cfg' if not os.path.exists(name): raise Exception('Please add a proper cofig file under /etc/autocloud/') config.read(name) KOJI_SERVER_URL = config.get('autocloud', 'koji_server_url') BASE_KOJI_TASK_URL = config.get('autocloud', 'base_koji_task_url') HOST = config.get('autocloud', 'host') or '127.0.0.1' PORT = int(config.get('autocloud', 'port')) or 5000 DEBUG = config.getboolean('autocloud', 'debug') SQLALCHEMY_URI = config.get('sqlalchemy', 'uri') VIRTUALBOX = config.getboolean('autocloud', 'virtualbox') <commit_msg>Fix config name error for autocloud service<commit_after># -*- coding: utf-8 -*- import ConfigParser import os PROJECT_ROOT = os.path.abspath(os.path.dirname(__name__)) name = '/etc/autocloud/autocloud.cfg' if not os.path.exists(name): raise Exception('Please add a proper cofig file under /etc/autocloud/') config = ConfigParser.RawConfigParser() config.read(name) KOJI_SERVER_URL = config.get('autocloud', 'koji_server_url') BASE_KOJI_TASK_URL = config.get('autocloud', 'base_koji_task_url') HOST = config.get('autocloud', 'host') or '127.0.0.1' PORT = int(config.get('autocloud', 'port')) or 5000 DEBUG = config.getboolean('autocloud', 'debug') SQLALCHEMY_URI = config.get('sqlalchemy', 'uri') VIRTUALBOX = config.getboolean('autocloud', 'virtualbox')
95139aaf8dc551a4a5d42c23e417520fa2d131ff
api_tests/utils.py
api_tests/utils.py
from blinker import ANY from urlparse import urlparse from contextlib import contextmanager from addons.osfstorage import settings as osfstorage_settings def create_test_file(node, user, filename='test_file', create_guid=True): osfstorage = node.get_addon('osfstorage') root_node = osfstorage.get_root() test_file = root_node.append_file(filename) if create_guid: test_file.get_guid(create=True) test_file.create_version(user, { 'object': '06d80e', 'service': 'cloud', osfstorage_settings.WATERBUTLER_RESOURCE: 'osf', }, { 'size': 1337, 'contentType': 'img/png' }).save() return test_file def urlparse_drop_netloc(url): url = urlparse(url) if url[4]: return url[2] + '?' + url[4] return url[2] @contextmanager def disconnected_from_listeners(signal): """Temporarily disconnect all listeners for a Blinker signal.""" listeners = list(signal.receivers_for(ANY)) for listener in listeners: signal.disconnect(listener) yield for listener in listeners: signal.connect(listener)
from blinker import ANY from urlparse import urlparse from contextlib import contextmanager from addons.osfstorage import settings as osfstorage_settings def create_test_file(target, user, filename='test_file', create_guid=True): osfstorage = target.get_addon('osfstorage') root_node = osfstorage.get_root() test_file = root_node.append_file(filename) if create_guid: test_file.get_guid(create=True) test_file.create_version(user, { 'object': '06d80e', 'service': 'cloud', osfstorage_settings.WATERBUTLER_RESOURCE: 'osf', }, { 'size': 1337, 'contentType': 'img/png' }).save() return test_file def urlparse_drop_netloc(url): url = urlparse(url) if url[4]: return url[2] + '?' + url[4] return url[2] @contextmanager def disconnected_from_listeners(signal): """Temporarily disconnect all listeners for a Blinker signal.""" listeners = list(signal.receivers_for(ANY)) for listener in listeners: signal.disconnect(listener) yield for listener in listeners: signal.connect(listener)
Update api test util to create files to use target name instead
Update api test util to create files to use target name instead
Python
apache-2.0
mfraezz/osf.io,cslzchen/osf.io,aaxelb/osf.io,HalcyonChimera/osf.io,brianjgeiger/osf.io,cslzchen/osf.io,CenterForOpenScience/osf.io,aaxelb/osf.io,mfraezz/osf.io,felliott/osf.io,saradbowman/osf.io,adlius/osf.io,brianjgeiger/osf.io,pattisdr/osf.io,Johnetordoff/osf.io,CenterForOpenScience/osf.io,baylee-d/osf.io,caseyrollins/osf.io,saradbowman/osf.io,felliott/osf.io,erinspace/osf.io,CenterForOpenScience/osf.io,caseyrollins/osf.io,HalcyonChimera/osf.io,HalcyonChimera/osf.io,brianjgeiger/osf.io,CenterForOpenScience/osf.io,pattisdr/osf.io,pattisdr/osf.io,cslzchen/osf.io,mfraezz/osf.io,aaxelb/osf.io,erinspace/osf.io,baylee-d/osf.io,brianjgeiger/osf.io,baylee-d/osf.io,Johnetordoff/osf.io,mattclark/osf.io,adlius/osf.io,caseyrollins/osf.io,felliott/osf.io,cslzchen/osf.io,aaxelb/osf.io,erinspace/osf.io,Johnetordoff/osf.io,adlius/osf.io,felliott/osf.io,HalcyonChimera/osf.io,mattclark/osf.io,mfraezz/osf.io,mattclark/osf.io,adlius/osf.io,Johnetordoff/osf.io
from blinker import ANY from urlparse import urlparse from contextlib import contextmanager from addons.osfstorage import settings as osfstorage_settings def create_test_file(node, user, filename='test_file', create_guid=True): osfstorage = node.get_addon('osfstorage') root_node = osfstorage.get_root() test_file = root_node.append_file(filename) if create_guid: test_file.get_guid(create=True) test_file.create_version(user, { 'object': '06d80e', 'service': 'cloud', osfstorage_settings.WATERBUTLER_RESOURCE: 'osf', }, { 'size': 1337, 'contentType': 'img/png' }).save() return test_file def urlparse_drop_netloc(url): url = urlparse(url) if url[4]: return url[2] + '?' + url[4] return url[2] @contextmanager def disconnected_from_listeners(signal): """Temporarily disconnect all listeners for a Blinker signal.""" listeners = list(signal.receivers_for(ANY)) for listener in listeners: signal.disconnect(listener) yield for listener in listeners: signal.connect(listener) Update api test util to create files to use target name instead
from blinker import ANY from urlparse import urlparse from contextlib import contextmanager from addons.osfstorage import settings as osfstorage_settings def create_test_file(target, user, filename='test_file', create_guid=True): osfstorage = target.get_addon('osfstorage') root_node = osfstorage.get_root() test_file = root_node.append_file(filename) if create_guid: test_file.get_guid(create=True) test_file.create_version(user, { 'object': '06d80e', 'service': 'cloud', osfstorage_settings.WATERBUTLER_RESOURCE: 'osf', }, { 'size': 1337, 'contentType': 'img/png' }).save() return test_file def urlparse_drop_netloc(url): url = urlparse(url) if url[4]: return url[2] + '?' + url[4] return url[2] @contextmanager def disconnected_from_listeners(signal): """Temporarily disconnect all listeners for a Blinker signal.""" listeners = list(signal.receivers_for(ANY)) for listener in listeners: signal.disconnect(listener) yield for listener in listeners: signal.connect(listener)
<commit_before>from blinker import ANY from urlparse import urlparse from contextlib import contextmanager from addons.osfstorage import settings as osfstorage_settings def create_test_file(node, user, filename='test_file', create_guid=True): osfstorage = node.get_addon('osfstorage') root_node = osfstorage.get_root() test_file = root_node.append_file(filename) if create_guid: test_file.get_guid(create=True) test_file.create_version(user, { 'object': '06d80e', 'service': 'cloud', osfstorage_settings.WATERBUTLER_RESOURCE: 'osf', }, { 'size': 1337, 'contentType': 'img/png' }).save() return test_file def urlparse_drop_netloc(url): url = urlparse(url) if url[4]: return url[2] + '?' + url[4] return url[2] @contextmanager def disconnected_from_listeners(signal): """Temporarily disconnect all listeners for a Blinker signal.""" listeners = list(signal.receivers_for(ANY)) for listener in listeners: signal.disconnect(listener) yield for listener in listeners: signal.connect(listener) <commit_msg>Update api test util to create files to use target name instead<commit_after>
from blinker import ANY from urlparse import urlparse from contextlib import contextmanager from addons.osfstorage import settings as osfstorage_settings def create_test_file(target, user, filename='test_file', create_guid=True): osfstorage = target.get_addon('osfstorage') root_node = osfstorage.get_root() test_file = root_node.append_file(filename) if create_guid: test_file.get_guid(create=True) test_file.create_version(user, { 'object': '06d80e', 'service': 'cloud', osfstorage_settings.WATERBUTLER_RESOURCE: 'osf', }, { 'size': 1337, 'contentType': 'img/png' }).save() return test_file def urlparse_drop_netloc(url): url = urlparse(url) if url[4]: return url[2] + '?' + url[4] return url[2] @contextmanager def disconnected_from_listeners(signal): """Temporarily disconnect all listeners for a Blinker signal.""" listeners = list(signal.receivers_for(ANY)) for listener in listeners: signal.disconnect(listener) yield for listener in listeners: signal.connect(listener)
from blinker import ANY from urlparse import urlparse from contextlib import contextmanager from addons.osfstorage import settings as osfstorage_settings def create_test_file(node, user, filename='test_file', create_guid=True): osfstorage = node.get_addon('osfstorage') root_node = osfstorage.get_root() test_file = root_node.append_file(filename) if create_guid: test_file.get_guid(create=True) test_file.create_version(user, { 'object': '06d80e', 'service': 'cloud', osfstorage_settings.WATERBUTLER_RESOURCE: 'osf', }, { 'size': 1337, 'contentType': 'img/png' }).save() return test_file def urlparse_drop_netloc(url): url = urlparse(url) if url[4]: return url[2] + '?' + url[4] return url[2] @contextmanager def disconnected_from_listeners(signal): """Temporarily disconnect all listeners for a Blinker signal.""" listeners = list(signal.receivers_for(ANY)) for listener in listeners: signal.disconnect(listener) yield for listener in listeners: signal.connect(listener) Update api test util to create files to use target name insteadfrom blinker import ANY from urlparse import urlparse from contextlib import contextmanager from addons.osfstorage import settings as osfstorage_settings def create_test_file(target, user, filename='test_file', create_guid=True): osfstorage = target.get_addon('osfstorage') root_node = osfstorage.get_root() test_file = root_node.append_file(filename) if create_guid: test_file.get_guid(create=True) test_file.create_version(user, { 'object': '06d80e', 'service': 'cloud', osfstorage_settings.WATERBUTLER_RESOURCE: 'osf', }, { 'size': 1337, 'contentType': 'img/png' }).save() return test_file def urlparse_drop_netloc(url): url = urlparse(url) if url[4]: return url[2] + '?' + url[4] return url[2] @contextmanager def disconnected_from_listeners(signal): """Temporarily disconnect all listeners for a Blinker signal.""" listeners = list(signal.receivers_for(ANY)) for listener in listeners: signal.disconnect(listener) yield for listener in listeners: signal.connect(listener)
<commit_before>from blinker import ANY from urlparse import urlparse from contextlib import contextmanager from addons.osfstorage import settings as osfstorage_settings def create_test_file(node, user, filename='test_file', create_guid=True): osfstorage = node.get_addon('osfstorage') root_node = osfstorage.get_root() test_file = root_node.append_file(filename) if create_guid: test_file.get_guid(create=True) test_file.create_version(user, { 'object': '06d80e', 'service': 'cloud', osfstorage_settings.WATERBUTLER_RESOURCE: 'osf', }, { 'size': 1337, 'contentType': 'img/png' }).save() return test_file def urlparse_drop_netloc(url): url = urlparse(url) if url[4]: return url[2] + '?' + url[4] return url[2] @contextmanager def disconnected_from_listeners(signal): """Temporarily disconnect all listeners for a Blinker signal.""" listeners = list(signal.receivers_for(ANY)) for listener in listeners: signal.disconnect(listener) yield for listener in listeners: signal.connect(listener) <commit_msg>Update api test util to create files to use target name instead<commit_after>from blinker import ANY from urlparse import urlparse from contextlib import contextmanager from addons.osfstorage import settings as osfstorage_settings def create_test_file(target, user, filename='test_file', create_guid=True): osfstorage = target.get_addon('osfstorage') root_node = osfstorage.get_root() test_file = root_node.append_file(filename) if create_guid: test_file.get_guid(create=True) test_file.create_version(user, { 'object': '06d80e', 'service': 'cloud', osfstorage_settings.WATERBUTLER_RESOURCE: 'osf', }, { 'size': 1337, 'contentType': 'img/png' }).save() return test_file def urlparse_drop_netloc(url): url = urlparse(url) if url[4]: return url[2] + '?' + url[4] return url[2] @contextmanager def disconnected_from_listeners(signal): """Temporarily disconnect all listeners for a Blinker signal.""" listeners = list(signal.receivers_for(ANY)) for listener in listeners: signal.disconnect(listener) yield for listener in listeners: signal.connect(listener)
037796d721cd0eec3ea779c2901ec8c62aaa5fc7
cmt/utils/run_dir.py
cmt/utils/run_dir.py
import os class RunDir(object): def __init__(self, dir, create=False): self._run_dir = dir self._create = create def __enter__(self): self._starting_dir = os.path.abspath(os.getcwd()) if self._create and not os.path.isdir(self._run_dir): os.makedirs(self._run_dir) os.chdir(self._run_dir) def __exit__(self, type, value, traceback): os.chdir(self._starting_dir) def open_run_dir(dir, **kwds): return RunDir(dir, **kwds)
import os class RunDir(object): def __init__(self, directory, create=False): self._run_dir = directory self._create = create def __enter__(self): self._starting_dir = os.path.abspath(os.getcwd()) if self._create and not os.path.isdir(self._run_dir): os.makedirs(self._run_dir) os.chdir(self._run_dir) def __exit__(self, exception_type, value, traceback): os.chdir(self._starting_dir) def open_run_dir(directory, **kwds): return RunDir(directory, **kwds)
Rename dir variable to directory.
Rename dir variable to directory.
Python
mit
csdms/coupling,csdms/coupling,csdms/pymt
import os class RunDir(object): def __init__(self, dir, create=False): self._run_dir = dir self._create = create def __enter__(self): self._starting_dir = os.path.abspath(os.getcwd()) if self._create and not os.path.isdir(self._run_dir): os.makedirs(self._run_dir) os.chdir(self._run_dir) def __exit__(self, type, value, traceback): os.chdir(self._starting_dir) def open_run_dir(dir, **kwds): return RunDir(dir, **kwds) Rename dir variable to directory.
import os class RunDir(object): def __init__(self, directory, create=False): self._run_dir = directory self._create = create def __enter__(self): self._starting_dir = os.path.abspath(os.getcwd()) if self._create and not os.path.isdir(self._run_dir): os.makedirs(self._run_dir) os.chdir(self._run_dir) def __exit__(self, exception_type, value, traceback): os.chdir(self._starting_dir) def open_run_dir(directory, **kwds): return RunDir(directory, **kwds)
<commit_before>import os class RunDir(object): def __init__(self, dir, create=False): self._run_dir = dir self._create = create def __enter__(self): self._starting_dir = os.path.abspath(os.getcwd()) if self._create and not os.path.isdir(self._run_dir): os.makedirs(self._run_dir) os.chdir(self._run_dir) def __exit__(self, type, value, traceback): os.chdir(self._starting_dir) def open_run_dir(dir, **kwds): return RunDir(dir, **kwds) <commit_msg>Rename dir variable to directory.<commit_after>
import os class RunDir(object): def __init__(self, directory, create=False): self._run_dir = directory self._create = create def __enter__(self): self._starting_dir = os.path.abspath(os.getcwd()) if self._create and not os.path.isdir(self._run_dir): os.makedirs(self._run_dir) os.chdir(self._run_dir) def __exit__(self, exception_type, value, traceback): os.chdir(self._starting_dir) def open_run_dir(directory, **kwds): return RunDir(directory, **kwds)
import os class RunDir(object): def __init__(self, dir, create=False): self._run_dir = dir self._create = create def __enter__(self): self._starting_dir = os.path.abspath(os.getcwd()) if self._create and not os.path.isdir(self._run_dir): os.makedirs(self._run_dir) os.chdir(self._run_dir) def __exit__(self, type, value, traceback): os.chdir(self._starting_dir) def open_run_dir(dir, **kwds): return RunDir(dir, **kwds) Rename dir variable to directory.import os class RunDir(object): def __init__(self, directory, create=False): self._run_dir = directory self._create = create def __enter__(self): self._starting_dir = os.path.abspath(os.getcwd()) if self._create and not os.path.isdir(self._run_dir): os.makedirs(self._run_dir) os.chdir(self._run_dir) def __exit__(self, exception_type, value, traceback): os.chdir(self._starting_dir) def open_run_dir(directory, **kwds): return RunDir(directory, **kwds)
<commit_before>import os class RunDir(object): def __init__(self, dir, create=False): self._run_dir = dir self._create = create def __enter__(self): self._starting_dir = os.path.abspath(os.getcwd()) if self._create and not os.path.isdir(self._run_dir): os.makedirs(self._run_dir) os.chdir(self._run_dir) def __exit__(self, type, value, traceback): os.chdir(self._starting_dir) def open_run_dir(dir, **kwds): return RunDir(dir, **kwds) <commit_msg>Rename dir variable to directory.<commit_after>import os class RunDir(object): def __init__(self, directory, create=False): self._run_dir = directory self._create = create def __enter__(self): self._starting_dir = os.path.abspath(os.getcwd()) if self._create and not os.path.isdir(self._run_dir): os.makedirs(self._run_dir) os.chdir(self._run_dir) def __exit__(self, exception_type, value, traceback): os.chdir(self._starting_dir) def open_run_dir(directory, **kwds): return RunDir(directory, **kwds)
c3a0b7f21d517b647250027c50e42954d573bfa1
src/qmenuview/__init__.py
src/qmenuview/__init__.py
__author__ = 'David Zuber' __email__ = 'zuber.david@gmx.de' __version__ = '0.1.0'
__author__ = 'David Zuber' __email__ = 'zuber.david@gmx.de' __version__ = '0.1.0'
Remove blank line in init
Remove blank line in init
Python
bsd-3-clause
storax/qmenuview
__author__ = 'David Zuber' __email__ = 'zuber.david@gmx.de' __version__ = '0.1.0' Remove blank line in init
__author__ = 'David Zuber' __email__ = 'zuber.david@gmx.de' __version__ = '0.1.0'
<commit_before>__author__ = 'David Zuber' __email__ = 'zuber.david@gmx.de' __version__ = '0.1.0' <commit_msg>Remove blank line in init<commit_after>
__author__ = 'David Zuber' __email__ = 'zuber.david@gmx.de' __version__ = '0.1.0'
__author__ = 'David Zuber' __email__ = 'zuber.david@gmx.de' __version__ = '0.1.0' Remove blank line in init__author__ = 'David Zuber' __email__ = 'zuber.david@gmx.de' __version__ = '0.1.0'
<commit_before>__author__ = 'David Zuber' __email__ = 'zuber.david@gmx.de' __version__ = '0.1.0' <commit_msg>Remove blank line in init<commit_after>__author__ = 'David Zuber' __email__ = 'zuber.david@gmx.de' __version__ = '0.1.0'
1f9bf33ba5c1594477cf47dd323ec62ac92cf8c1
clic/web/config.py
clic/web/config.py
SQLALCHEMY_DATABASE_URI = "postgresql://jdejoode:isabelle@localhost/annotation_dev" DEBUG = False # when testing = True, the login_required decorator is disabled. TESTING = False # FIXME not very secret here SECRET_KEY = "qdfmkqjfmqksjfdmk" MAIL_SERVER = 'smtp.qsdfqsdfqskjdfmlqsjdfmlkjjqsdf.com' MAIL_PORT = 465 MAIL_USE_SSL = True MAIL_USERNAME = 'username' MAIL_PASSWORD = 'password' # SECURITY_PASSWORD_HASH = "bcrypt" # SECURITY_PASSWORD_SALT = "AasdsSDLKJFDasdflasdlfjhLJKHDlsdfjkhLKJ" # https://pythonhosted.org/Flask-Security/models.html SECURITY_POST_LOGIN_VIEW = "/annotation" SECURITY_REGISTERABLE = False SECURITY_TRACKABLE = False SECURITY_RECOVERABLE = False SECURITY_CONFIRMABLE = False # TODO
SQLALCHEMY_DATABASE_URI = "postgresql://jdejoode:isabelle@localhost/annotation_dev" DEBUG = False DEBUG_TB_INTERCEPT_REDIRECTS = False # when testing = True, the login_required decorator is disabled. TESTING = False # FIXME not very secret here SECRET_KEY = "qdfmkqjfmqksjfdmk" MAIL_SERVER = 'smtp.qsdfqsdfqskjdfmlqsjdfmlkjjqsdf.com' MAIL_PORT = 465 MAIL_USE_SSL = True MAIL_USERNAME = 'username' MAIL_PASSWORD = 'password' # SECURITY_PASSWORD_HASH = "bcrypt" # SECURITY_PASSWORD_SALT = "AasdsSDLKJFDasdflasdlfjhLJKHDlsdfjkhLKJ" # https://pythonhosted.org/Flask-Security/models.html SECURITY_POST_LOGIN_VIEW = "/annotation" SECURITY_REGISTERABLE = False SECURITY_TRACKABLE = False SECURITY_RECOVERABLE = False SECURITY_CONFIRMABLE = False # TODO
Disable redirect interception in testing mode
Disable redirect interception in testing mode
Python
mit
CentreForCorpusResearch/clic,CentreForCorpusResearch/clic,CentreForResearchInAppliedLinguistics/clic,CentreForCorpusResearch/clic,CentreForResearchInAppliedLinguistics/clic,CentreForResearchInAppliedLinguistics/clic
SQLALCHEMY_DATABASE_URI = "postgresql://jdejoode:isabelle@localhost/annotation_dev" DEBUG = False # when testing = True, the login_required decorator is disabled. TESTING = False # FIXME not very secret here SECRET_KEY = "qdfmkqjfmqksjfdmk" MAIL_SERVER = 'smtp.qsdfqsdfqskjdfmlqsjdfmlkjjqsdf.com' MAIL_PORT = 465 MAIL_USE_SSL = True MAIL_USERNAME = 'username' MAIL_PASSWORD = 'password' # SECURITY_PASSWORD_HASH = "bcrypt" # SECURITY_PASSWORD_SALT = "AasdsSDLKJFDasdflasdlfjhLJKHDlsdfjkhLKJ" # https://pythonhosted.org/Flask-Security/models.html SECURITY_POST_LOGIN_VIEW = "/annotation" SECURITY_REGISTERABLE = False SECURITY_TRACKABLE = False SECURITY_RECOVERABLE = False SECURITY_CONFIRMABLE = False # TODO Disable redirect interception in testing mode
SQLALCHEMY_DATABASE_URI = "postgresql://jdejoode:isabelle@localhost/annotation_dev" DEBUG = False DEBUG_TB_INTERCEPT_REDIRECTS = False # when testing = True, the login_required decorator is disabled. TESTING = False # FIXME not very secret here SECRET_KEY = "qdfmkqjfmqksjfdmk" MAIL_SERVER = 'smtp.qsdfqsdfqskjdfmlqsjdfmlkjjqsdf.com' MAIL_PORT = 465 MAIL_USE_SSL = True MAIL_USERNAME = 'username' MAIL_PASSWORD = 'password' # SECURITY_PASSWORD_HASH = "bcrypt" # SECURITY_PASSWORD_SALT = "AasdsSDLKJFDasdflasdlfjhLJKHDlsdfjkhLKJ" # https://pythonhosted.org/Flask-Security/models.html SECURITY_POST_LOGIN_VIEW = "/annotation" SECURITY_REGISTERABLE = False SECURITY_TRACKABLE = False SECURITY_RECOVERABLE = False SECURITY_CONFIRMABLE = False # TODO
<commit_before>SQLALCHEMY_DATABASE_URI = "postgresql://jdejoode:isabelle@localhost/annotation_dev" DEBUG = False # when testing = True, the login_required decorator is disabled. TESTING = False # FIXME not very secret here SECRET_KEY = "qdfmkqjfmqksjfdmk" MAIL_SERVER = 'smtp.qsdfqsdfqskjdfmlqsjdfmlkjjqsdf.com' MAIL_PORT = 465 MAIL_USE_SSL = True MAIL_USERNAME = 'username' MAIL_PASSWORD = 'password' # SECURITY_PASSWORD_HASH = "bcrypt" # SECURITY_PASSWORD_SALT = "AasdsSDLKJFDasdflasdlfjhLJKHDlsdfjkhLKJ" # https://pythonhosted.org/Flask-Security/models.html SECURITY_POST_LOGIN_VIEW = "/annotation" SECURITY_REGISTERABLE = False SECURITY_TRACKABLE = False SECURITY_RECOVERABLE = False SECURITY_CONFIRMABLE = False # TODO <commit_msg>Disable redirect interception in testing mode<commit_after>
SQLALCHEMY_DATABASE_URI = "postgresql://jdejoode:isabelle@localhost/annotation_dev" DEBUG = False DEBUG_TB_INTERCEPT_REDIRECTS = False # when testing = True, the login_required decorator is disabled. TESTING = False # FIXME not very secret here SECRET_KEY = "qdfmkqjfmqksjfdmk" MAIL_SERVER = 'smtp.qsdfqsdfqskjdfmlqsjdfmlkjjqsdf.com' MAIL_PORT = 465 MAIL_USE_SSL = True MAIL_USERNAME = 'username' MAIL_PASSWORD = 'password' # SECURITY_PASSWORD_HASH = "bcrypt" # SECURITY_PASSWORD_SALT = "AasdsSDLKJFDasdflasdlfjhLJKHDlsdfjkhLKJ" # https://pythonhosted.org/Flask-Security/models.html SECURITY_POST_LOGIN_VIEW = "/annotation" SECURITY_REGISTERABLE = False SECURITY_TRACKABLE = False SECURITY_RECOVERABLE = False SECURITY_CONFIRMABLE = False # TODO
SQLALCHEMY_DATABASE_URI = "postgresql://jdejoode:isabelle@localhost/annotation_dev" DEBUG = False # when testing = True, the login_required decorator is disabled. TESTING = False # FIXME not very secret here SECRET_KEY = "qdfmkqjfmqksjfdmk" MAIL_SERVER = 'smtp.qsdfqsdfqskjdfmlqsjdfmlkjjqsdf.com' MAIL_PORT = 465 MAIL_USE_SSL = True MAIL_USERNAME = 'username' MAIL_PASSWORD = 'password' # SECURITY_PASSWORD_HASH = "bcrypt" # SECURITY_PASSWORD_SALT = "AasdsSDLKJFDasdflasdlfjhLJKHDlsdfjkhLKJ" # https://pythonhosted.org/Flask-Security/models.html SECURITY_POST_LOGIN_VIEW = "/annotation" SECURITY_REGISTERABLE = False SECURITY_TRACKABLE = False SECURITY_RECOVERABLE = False SECURITY_CONFIRMABLE = False # TODO Disable redirect interception in testing modeSQLALCHEMY_DATABASE_URI = "postgresql://jdejoode:isabelle@localhost/annotation_dev" DEBUG = False DEBUG_TB_INTERCEPT_REDIRECTS = False # when testing = True, the login_required decorator is disabled. TESTING = False # FIXME not very secret here SECRET_KEY = "qdfmkqjfmqksjfdmk" MAIL_SERVER = 'smtp.qsdfqsdfqskjdfmlqsjdfmlkjjqsdf.com' MAIL_PORT = 465 MAIL_USE_SSL = True MAIL_USERNAME = 'username' MAIL_PASSWORD = 'password' # SECURITY_PASSWORD_HASH = "bcrypt" # SECURITY_PASSWORD_SALT = "AasdsSDLKJFDasdflasdlfjhLJKHDlsdfjkhLKJ" # https://pythonhosted.org/Flask-Security/models.html SECURITY_POST_LOGIN_VIEW = "/annotation" SECURITY_REGISTERABLE = False SECURITY_TRACKABLE = False SECURITY_RECOVERABLE = False SECURITY_CONFIRMABLE = False # TODO
<commit_before>SQLALCHEMY_DATABASE_URI = "postgresql://jdejoode:isabelle@localhost/annotation_dev" DEBUG = False # when testing = True, the login_required decorator is disabled. TESTING = False # FIXME not very secret here SECRET_KEY = "qdfmkqjfmqksjfdmk" MAIL_SERVER = 'smtp.qsdfqsdfqskjdfmlqsjdfmlkjjqsdf.com' MAIL_PORT = 465 MAIL_USE_SSL = True MAIL_USERNAME = 'username' MAIL_PASSWORD = 'password' # SECURITY_PASSWORD_HASH = "bcrypt" # SECURITY_PASSWORD_SALT = "AasdsSDLKJFDasdflasdlfjhLJKHDlsdfjkhLKJ" # https://pythonhosted.org/Flask-Security/models.html SECURITY_POST_LOGIN_VIEW = "/annotation" SECURITY_REGISTERABLE = False SECURITY_TRACKABLE = False SECURITY_RECOVERABLE = False SECURITY_CONFIRMABLE = False # TODO <commit_msg>Disable redirect interception in testing mode<commit_after>SQLALCHEMY_DATABASE_URI = "postgresql://jdejoode:isabelle@localhost/annotation_dev" DEBUG = False DEBUG_TB_INTERCEPT_REDIRECTS = False # when testing = True, the login_required decorator is disabled. TESTING = False # FIXME not very secret here SECRET_KEY = "qdfmkqjfmqksjfdmk" MAIL_SERVER = 'smtp.qsdfqsdfqskjdfmlqsjdfmlkjjqsdf.com' MAIL_PORT = 465 MAIL_USE_SSL = True MAIL_USERNAME = 'username' MAIL_PASSWORD = 'password' # SECURITY_PASSWORD_HASH = "bcrypt" # SECURITY_PASSWORD_SALT = "AasdsSDLKJFDasdflasdlfjhLJKHDlsdfjkhLKJ" # https://pythonhosted.org/Flask-Security/models.html SECURITY_POST_LOGIN_VIEW = "/annotation" SECURITY_REGISTERABLE = False SECURITY_TRACKABLE = False SECURITY_RECOVERABLE = False SECURITY_CONFIRMABLE = False # TODO
fe4bc023d207f219e487badc668f81ce7485ba5a
sympy/utilities/source.py
sympy/utilities/source.py
""" This module adds several functions for interactive source code inspection. """ from __future__ import print_function, division import inspect def source(object): """ Prints the source code of a given object. """ print('In file: %s' % inspect.getsourcefile(object)) print(inspect.getsource(object)) def get_class(lookup_view): """ Convert a string version of a class name to the object. For example, get_class('sympy.core.Basic') will return class Basic located in module sympy.core """ if isinstance(lookup_view, str): lookup_view = lookup_view mod_name, func_name = get_mod_func(lookup_view) if func_name != '': lookup_view = getattr( __import__(mod_name, {}, {}, ['*']), func_name) if not callable(lookup_view): raise AttributeError( "'%s.%s' is not a callable." % (mod_name, func_name)) return lookup_view def get_mod_func(callback): """ splits the string path to a class into a string path to the module and the name of the class. For example: >>> from sympy.utilities.source import get_mod_func >>> get_mod_func('sympy.core.basic.Basic') ('sympy.core.basic', 'Basic') """ dot = callback.rfind('.') if dot == -1: return callback, '' return callback[:dot], callback[dot + 1:]
""" This module adds several functions for interactive source code inspection. """ from __future__ import print_function, division import inspect def source(object): """ Prints the source code of a given object. """ print('In file: %s' % inspect.getsourcefile(object)) print(inspect.getsource(object)) def get_class(lookup_view): """ Convert a string version of a class name to the object. For example, get_class('sympy.core.Basic') will return class Basic located in module sympy.core """ if isinstance(lookup_view, str): mod_name, func_name = get_mod_func(lookup_view) if func_name != '': lookup_view = getattr( __import__(mod_name, {}, {}, ['*']), func_name) if not callable(lookup_view): raise AttributeError( "'%s.%s' is not a callable." % (mod_name, func_name)) return lookup_view def get_mod_func(callback): """ splits the string path to a class into a string path to the module and the name of the class. For example: >>> from sympy.utilities.source import get_mod_func >>> get_mod_func('sympy.core.basic.Basic') ('sympy.core.basic', 'Basic') """ dot = callback.rfind('.') if dot == -1: return callback, '' return callback[:dot], callback[dot + 1:]
Remove a redundant line from get_class
Remove a redundant line from get_class
Python
bsd-3-clause
emon10005/sympy,ahhda/sympy,kaichogami/sympy,mafiya69/sympy,Designist/sympy,aktech/sympy,Titan-C/sympy,jerli/sympy,Davidjohnwilson/sympy,sampadsaha5/sympy,hargup/sympy,drufat/sympy,Vishluck/sympy,maniteja123/sympy,wanglongqi/sympy,jaimahajan1997/sympy,yukoba/sympy,AkademieOlympia/sympy,ChristinaZografou/sympy,Titan-C/sympy,souravsingh/sympy,yashsharan/sympy,kaushik94/sympy,VaibhavAgarwalVA/sympy,mcdaniel67/sympy,kevalds51/sympy,emon10005/sympy,rahuldan/sympy,Davidjohnwilson/sympy,AkademieOlympia/sympy,pandeyadarsh/sympy,ga7g08/sympy,Vishluck/sympy,cswiercz/sympy,jaimahajan1997/sympy,kevalds51/sympy,Vishluck/sympy,drufat/sympy,Designist/sympy,moble/sympy,lindsayad/sympy,postvakje/sympy,cswiercz/sympy,debugger22/sympy,mafiya69/sympy,debugger22/sympy,saurabhjn76/sympy,iamutkarshtiwari/sympy,yashsharan/sympy,Curious72/sympy,farhaanbukhsh/sympy,mcdaniel67/sympy,yukoba/sympy,abhiii5459/sympy,sahmed95/sympy,skidzo/sympy,atreyv/sympy,Curious72/sympy,maniteja123/sympy,ga7g08/sympy,shikil/sympy,atreyv/sympy,maniteja123/sympy,saurabhjn76/sympy,skidzo/sympy,ahhda/sympy,Shaswat27/sympy,oliverlee/sympy,Arafatk/sympy,sahmed95/sympy,jbbskinny/sympy,shikil/sympy,abhiii5459/sympy,ahhda/sympy,Titan-C/sympy,rahuldan/sympy,madan96/sympy,debugger22/sympy,Shaswat27/sympy,iamutkarshtiwari/sympy,kaushik94/sympy,kaichogami/sympy,jerli/sympy,mafiya69/sympy,MechCoder/sympy,moble/sympy,pandeyadarsh/sympy,abhiii5459/sympy,Davidjohnwilson/sympy,emon10005/sympy,wanglongqi/sympy,oliverlee/sympy,ga7g08/sympy,kevalds51/sympy,postvakje/sympy,oliverlee/sympy,postvakje/sympy,farhaanbukhsh/sympy,lindsayad/sympy,jaimahajan1997/sympy,yukoba/sympy,kaushik94/sympy,sampadsaha5/sympy,rahuldan/sympy,VaibhavAgarwalVA/sympy,sahmed95/sympy,chaffra/sympy,yashsharan/sympy,Designist/sympy,shikil/sympy,cswiercz/sympy,hargup/sympy,iamutkarshtiwari/sympy,farhaanbukhsh/sympy,mcdaniel67/sympy,pandeyadarsh/sympy,kaichogami/sympy,chaffra/sympy,MechCoder/sympy,atreyv/sympy,drufat/sympy,Arafatk/sympy,Curious72/sympy,aktech/sympy,Arafatk/sympy,wanglongqi/sympy,saurabhjn76/sympy,jbbskinny/sympy,Shaswat27/sympy,ChristinaZografou/sympy,aktech/sympy,jerli/sympy,madan96/sympy,VaibhavAgarwalVA/sympy,madan96/sympy,moble/sympy,chaffra/sympy,hargup/sympy,souravsingh/sympy,AkademieOlympia/sympy,souravsingh/sympy,MechCoder/sympy,lindsayad/sympy,sampadsaha5/sympy,jbbskinny/sympy,ChristinaZografou/sympy,skidzo/sympy
""" This module adds several functions for interactive source code inspection. """ from __future__ import print_function, division import inspect def source(object): """ Prints the source code of a given object. """ print('In file: %s' % inspect.getsourcefile(object)) print(inspect.getsource(object)) def get_class(lookup_view): """ Convert a string version of a class name to the object. For example, get_class('sympy.core.Basic') will return class Basic located in module sympy.core """ if isinstance(lookup_view, str): lookup_view = lookup_view mod_name, func_name = get_mod_func(lookup_view) if func_name != '': lookup_view = getattr( __import__(mod_name, {}, {}, ['*']), func_name) if not callable(lookup_view): raise AttributeError( "'%s.%s' is not a callable." % (mod_name, func_name)) return lookup_view def get_mod_func(callback): """ splits the string path to a class into a string path to the module and the name of the class. For example: >>> from sympy.utilities.source import get_mod_func >>> get_mod_func('sympy.core.basic.Basic') ('sympy.core.basic', 'Basic') """ dot = callback.rfind('.') if dot == -1: return callback, '' return callback[:dot], callback[dot + 1:] Remove a redundant line from get_class
""" This module adds several functions for interactive source code inspection. """ from __future__ import print_function, division import inspect def source(object): """ Prints the source code of a given object. """ print('In file: %s' % inspect.getsourcefile(object)) print(inspect.getsource(object)) def get_class(lookup_view): """ Convert a string version of a class name to the object. For example, get_class('sympy.core.Basic') will return class Basic located in module sympy.core """ if isinstance(lookup_view, str): mod_name, func_name = get_mod_func(lookup_view) if func_name != '': lookup_view = getattr( __import__(mod_name, {}, {}, ['*']), func_name) if not callable(lookup_view): raise AttributeError( "'%s.%s' is not a callable." % (mod_name, func_name)) return lookup_view def get_mod_func(callback): """ splits the string path to a class into a string path to the module and the name of the class. For example: >>> from sympy.utilities.source import get_mod_func >>> get_mod_func('sympy.core.basic.Basic') ('sympy.core.basic', 'Basic') """ dot = callback.rfind('.') if dot == -1: return callback, '' return callback[:dot], callback[dot + 1:]
<commit_before>""" This module adds several functions for interactive source code inspection. """ from __future__ import print_function, division import inspect def source(object): """ Prints the source code of a given object. """ print('In file: %s' % inspect.getsourcefile(object)) print(inspect.getsource(object)) def get_class(lookup_view): """ Convert a string version of a class name to the object. For example, get_class('sympy.core.Basic') will return class Basic located in module sympy.core """ if isinstance(lookup_view, str): lookup_view = lookup_view mod_name, func_name = get_mod_func(lookup_view) if func_name != '': lookup_view = getattr( __import__(mod_name, {}, {}, ['*']), func_name) if not callable(lookup_view): raise AttributeError( "'%s.%s' is not a callable." % (mod_name, func_name)) return lookup_view def get_mod_func(callback): """ splits the string path to a class into a string path to the module and the name of the class. For example: >>> from sympy.utilities.source import get_mod_func >>> get_mod_func('sympy.core.basic.Basic') ('sympy.core.basic', 'Basic') """ dot = callback.rfind('.') if dot == -1: return callback, '' return callback[:dot], callback[dot + 1:] <commit_msg>Remove a redundant line from get_class<commit_after>
""" This module adds several functions for interactive source code inspection. """ from __future__ import print_function, division import inspect def source(object): """ Prints the source code of a given object. """ print('In file: %s' % inspect.getsourcefile(object)) print(inspect.getsource(object)) def get_class(lookup_view): """ Convert a string version of a class name to the object. For example, get_class('sympy.core.Basic') will return class Basic located in module sympy.core """ if isinstance(lookup_view, str): mod_name, func_name = get_mod_func(lookup_view) if func_name != '': lookup_view = getattr( __import__(mod_name, {}, {}, ['*']), func_name) if not callable(lookup_view): raise AttributeError( "'%s.%s' is not a callable." % (mod_name, func_name)) return lookup_view def get_mod_func(callback): """ splits the string path to a class into a string path to the module and the name of the class. For example: >>> from sympy.utilities.source import get_mod_func >>> get_mod_func('sympy.core.basic.Basic') ('sympy.core.basic', 'Basic') """ dot = callback.rfind('.') if dot == -1: return callback, '' return callback[:dot], callback[dot + 1:]
""" This module adds several functions for interactive source code inspection. """ from __future__ import print_function, division import inspect def source(object): """ Prints the source code of a given object. """ print('In file: %s' % inspect.getsourcefile(object)) print(inspect.getsource(object)) def get_class(lookup_view): """ Convert a string version of a class name to the object. For example, get_class('sympy.core.Basic') will return class Basic located in module sympy.core """ if isinstance(lookup_view, str): lookup_view = lookup_view mod_name, func_name = get_mod_func(lookup_view) if func_name != '': lookup_view = getattr( __import__(mod_name, {}, {}, ['*']), func_name) if not callable(lookup_view): raise AttributeError( "'%s.%s' is not a callable." % (mod_name, func_name)) return lookup_view def get_mod_func(callback): """ splits the string path to a class into a string path to the module and the name of the class. For example: >>> from sympy.utilities.source import get_mod_func >>> get_mod_func('sympy.core.basic.Basic') ('sympy.core.basic', 'Basic') """ dot = callback.rfind('.') if dot == -1: return callback, '' return callback[:dot], callback[dot + 1:] Remove a redundant line from get_class""" This module adds several functions for interactive source code inspection. """ from __future__ import print_function, division import inspect def source(object): """ Prints the source code of a given object. """ print('In file: %s' % inspect.getsourcefile(object)) print(inspect.getsource(object)) def get_class(lookup_view): """ Convert a string version of a class name to the object. For example, get_class('sympy.core.Basic') will return class Basic located in module sympy.core """ if isinstance(lookup_view, str): mod_name, func_name = get_mod_func(lookup_view) if func_name != '': lookup_view = getattr( __import__(mod_name, {}, {}, ['*']), func_name) if not callable(lookup_view): raise AttributeError( "'%s.%s' is not a callable." % (mod_name, func_name)) return lookup_view def get_mod_func(callback): """ splits the string path to a class into a string path to the module and the name of the class. For example: >>> from sympy.utilities.source import get_mod_func >>> get_mod_func('sympy.core.basic.Basic') ('sympy.core.basic', 'Basic') """ dot = callback.rfind('.') if dot == -1: return callback, '' return callback[:dot], callback[dot + 1:]
<commit_before>""" This module adds several functions for interactive source code inspection. """ from __future__ import print_function, division import inspect def source(object): """ Prints the source code of a given object. """ print('In file: %s' % inspect.getsourcefile(object)) print(inspect.getsource(object)) def get_class(lookup_view): """ Convert a string version of a class name to the object. For example, get_class('sympy.core.Basic') will return class Basic located in module sympy.core """ if isinstance(lookup_view, str): lookup_view = lookup_view mod_name, func_name = get_mod_func(lookup_view) if func_name != '': lookup_view = getattr( __import__(mod_name, {}, {}, ['*']), func_name) if not callable(lookup_view): raise AttributeError( "'%s.%s' is not a callable." % (mod_name, func_name)) return lookup_view def get_mod_func(callback): """ splits the string path to a class into a string path to the module and the name of the class. For example: >>> from sympy.utilities.source import get_mod_func >>> get_mod_func('sympy.core.basic.Basic') ('sympy.core.basic', 'Basic') """ dot = callback.rfind('.') if dot == -1: return callback, '' return callback[:dot], callback[dot + 1:] <commit_msg>Remove a redundant line from get_class<commit_after>""" This module adds several functions for interactive source code inspection. """ from __future__ import print_function, division import inspect def source(object): """ Prints the source code of a given object. """ print('In file: %s' % inspect.getsourcefile(object)) print(inspect.getsource(object)) def get_class(lookup_view): """ Convert a string version of a class name to the object. For example, get_class('sympy.core.Basic') will return class Basic located in module sympy.core """ if isinstance(lookup_view, str): mod_name, func_name = get_mod_func(lookup_view) if func_name != '': lookup_view = getattr( __import__(mod_name, {}, {}, ['*']), func_name) if not callable(lookup_view): raise AttributeError( "'%s.%s' is not a callable." % (mod_name, func_name)) return lookup_view def get_mod_func(callback): """ splits the string path to a class into a string path to the module and the name of the class. For example: >>> from sympy.utilities.source import get_mod_func >>> get_mod_func('sympy.core.basic.Basic') ('sympy.core.basic', 'Basic') """ dot = callback.rfind('.') if dot == -1: return callback, '' return callback[:dot], callback[dot + 1:]
bb9e15a2415cba3dfcc871ea64aeaa14199fd293
plantcv/plantcv/color_palette.py
plantcv/plantcv/color_palette.py
# Color palette returns an array of colors (rainbow) from matplotlib import pyplot as plt import numpy as np from plantcv.plantcv import params def color_palette(num): """color_palette: Returns a list of colors length num Inputs: num = number of colors to return. Returns: colors = a list of color lists (RGB values) :param num: int :return colors: list """ # If a previous palette is saved, return it if params.saved_color_scale is not None: return params.saved_color_scale else: # Retrieve the matplotlib colormap cmap = plt.get_cmap(params.color_scale) # Get num evenly spaced colors colors = cmap(np.linspace(0, 1, num), bytes=True) colors = colors[:, 0:3].tolist() # colors are sequential, if params.color_sequence is random then shuffle the colors if params.color_sequence == "random": np.random.shuffle(colors) # Save the color scale for further use params.saved_color_scale = colors return colors
# Color palette returns an array of colors (rainbow) import numpy as np from plantcv.plantcv import params def color_palette(num): """color_palette: Returns a list of colors length num Inputs: num = number of colors to return. Returns: colors = a list of color lists (RGB values) :param num: int :return colors: list """ from matplotlib import pyplot as plt # If a previous palette is saved, return it if params.saved_color_scale is not None: return params.saved_color_scale else: # Retrieve the matplotlib colormap cmap = plt.get_cmap(params.color_scale) # Get num evenly spaced colors colors = cmap(np.linspace(0, 1, num), bytes=True) colors = colors[:, 0:3].tolist() # colors are sequential, if params.color_sequence is random then shuffle the colors if params.color_sequence == "random": np.random.shuffle(colors) # Save the color scale for further use params.saved_color_scale = colors return colors
Move matplotlib import into function
Move matplotlib import into function I think importing it at the top-level causes a conflict with our global matplotlib backend settings
Python
mit
stiphyMT/plantcv,danforthcenter/plantcv,danforthcenter/plantcv,stiphyMT/plantcv,stiphyMT/plantcv,danforthcenter/plantcv
# Color palette returns an array of colors (rainbow) from matplotlib import pyplot as plt import numpy as np from plantcv.plantcv import params def color_palette(num): """color_palette: Returns a list of colors length num Inputs: num = number of colors to return. Returns: colors = a list of color lists (RGB values) :param num: int :return colors: list """ # If a previous palette is saved, return it if params.saved_color_scale is not None: return params.saved_color_scale else: # Retrieve the matplotlib colormap cmap = plt.get_cmap(params.color_scale) # Get num evenly spaced colors colors = cmap(np.linspace(0, 1, num), bytes=True) colors = colors[:, 0:3].tolist() # colors are sequential, if params.color_sequence is random then shuffle the colors if params.color_sequence == "random": np.random.shuffle(colors) # Save the color scale for further use params.saved_color_scale = colors return colors Move matplotlib import into function I think importing it at the top-level causes a conflict with our global matplotlib backend settings
# Color palette returns an array of colors (rainbow) import numpy as np from plantcv.plantcv import params def color_palette(num): """color_palette: Returns a list of colors length num Inputs: num = number of colors to return. Returns: colors = a list of color lists (RGB values) :param num: int :return colors: list """ from matplotlib import pyplot as plt # If a previous palette is saved, return it if params.saved_color_scale is not None: return params.saved_color_scale else: # Retrieve the matplotlib colormap cmap = plt.get_cmap(params.color_scale) # Get num evenly spaced colors colors = cmap(np.linspace(0, 1, num), bytes=True) colors = colors[:, 0:3].tolist() # colors are sequential, if params.color_sequence is random then shuffle the colors if params.color_sequence == "random": np.random.shuffle(colors) # Save the color scale for further use params.saved_color_scale = colors return colors
<commit_before># Color palette returns an array of colors (rainbow) from matplotlib import pyplot as plt import numpy as np from plantcv.plantcv import params def color_palette(num): """color_palette: Returns a list of colors length num Inputs: num = number of colors to return. Returns: colors = a list of color lists (RGB values) :param num: int :return colors: list """ # If a previous palette is saved, return it if params.saved_color_scale is not None: return params.saved_color_scale else: # Retrieve the matplotlib colormap cmap = plt.get_cmap(params.color_scale) # Get num evenly spaced colors colors = cmap(np.linspace(0, 1, num), bytes=True) colors = colors[:, 0:3].tolist() # colors are sequential, if params.color_sequence is random then shuffle the colors if params.color_sequence == "random": np.random.shuffle(colors) # Save the color scale for further use params.saved_color_scale = colors return colors <commit_msg>Move matplotlib import into function I think importing it at the top-level causes a conflict with our global matplotlib backend settings<commit_after>
# Color palette returns an array of colors (rainbow) import numpy as np from plantcv.plantcv import params def color_palette(num): """color_palette: Returns a list of colors length num Inputs: num = number of colors to return. Returns: colors = a list of color lists (RGB values) :param num: int :return colors: list """ from matplotlib import pyplot as plt # If a previous palette is saved, return it if params.saved_color_scale is not None: return params.saved_color_scale else: # Retrieve the matplotlib colormap cmap = plt.get_cmap(params.color_scale) # Get num evenly spaced colors colors = cmap(np.linspace(0, 1, num), bytes=True) colors = colors[:, 0:3].tolist() # colors are sequential, if params.color_sequence is random then shuffle the colors if params.color_sequence == "random": np.random.shuffle(colors) # Save the color scale for further use params.saved_color_scale = colors return colors
# Color palette returns an array of colors (rainbow) from matplotlib import pyplot as plt import numpy as np from plantcv.plantcv import params def color_palette(num): """color_palette: Returns a list of colors length num Inputs: num = number of colors to return. Returns: colors = a list of color lists (RGB values) :param num: int :return colors: list """ # If a previous palette is saved, return it if params.saved_color_scale is not None: return params.saved_color_scale else: # Retrieve the matplotlib colormap cmap = plt.get_cmap(params.color_scale) # Get num evenly spaced colors colors = cmap(np.linspace(0, 1, num), bytes=True) colors = colors[:, 0:3].tolist() # colors are sequential, if params.color_sequence is random then shuffle the colors if params.color_sequence == "random": np.random.shuffle(colors) # Save the color scale for further use params.saved_color_scale = colors return colors Move matplotlib import into function I think importing it at the top-level causes a conflict with our global matplotlib backend settings# Color palette returns an array of colors (rainbow) import numpy as np from plantcv.plantcv import params def color_palette(num): """color_palette: Returns a list of colors length num Inputs: num = number of colors to return. Returns: colors = a list of color lists (RGB values) :param num: int :return colors: list """ from matplotlib import pyplot as plt # If a previous palette is saved, return it if params.saved_color_scale is not None: return params.saved_color_scale else: # Retrieve the matplotlib colormap cmap = plt.get_cmap(params.color_scale) # Get num evenly spaced colors colors = cmap(np.linspace(0, 1, num), bytes=True) colors = colors[:, 0:3].tolist() # colors are sequential, if params.color_sequence is random then shuffle the colors if params.color_sequence == "random": np.random.shuffle(colors) # Save the color scale for further use params.saved_color_scale = colors return colors
<commit_before># Color palette returns an array of colors (rainbow) from matplotlib import pyplot as plt import numpy as np from plantcv.plantcv import params def color_palette(num): """color_palette: Returns a list of colors length num Inputs: num = number of colors to return. Returns: colors = a list of color lists (RGB values) :param num: int :return colors: list """ # If a previous palette is saved, return it if params.saved_color_scale is not None: return params.saved_color_scale else: # Retrieve the matplotlib colormap cmap = plt.get_cmap(params.color_scale) # Get num evenly spaced colors colors = cmap(np.linspace(0, 1, num), bytes=True) colors = colors[:, 0:3].tolist() # colors are sequential, if params.color_sequence is random then shuffle the colors if params.color_sequence == "random": np.random.shuffle(colors) # Save the color scale for further use params.saved_color_scale = colors return colors <commit_msg>Move matplotlib import into function I think importing it at the top-level causes a conflict with our global matplotlib backend settings<commit_after># Color palette returns an array of colors (rainbow) import numpy as np from plantcv.plantcv import params def color_palette(num): """color_palette: Returns a list of colors length num Inputs: num = number of colors to return. Returns: colors = a list of color lists (RGB values) :param num: int :return colors: list """ from matplotlib import pyplot as plt # If a previous palette is saved, return it if params.saved_color_scale is not None: return params.saved_color_scale else: # Retrieve the matplotlib colormap cmap = plt.get_cmap(params.color_scale) # Get num evenly spaced colors colors = cmap(np.linspace(0, 1, num), bytes=True) colors = colors[:, 0:3].tolist() # colors are sequential, if params.color_sequence is random then shuffle the colors if params.color_sequence == "random": np.random.shuffle(colors) # Save the color scale for further use params.saved_color_scale = colors return colors
7a2132cfff0524bd5cefc579a4561e492c884955
wikked/wsgiutil.py
wikked/wsgiutil.py
import os import sys import logging import logging.handlers from wikked.wiki import WikiParameters def get_wsgi_app(wiki_root, log_file=None): os.chdir(wiki_root) logging.basicConfig(stream=sys.stderr) from wikked.web import app app.set_wiki_params(WikiParameters(wiki_root)) if log_file is not None: h = logging.handlers.RotatingFileHandler(log_file, maxBytes=4096) h.setLevel(logging.WARNING) app.logger.addHandler(h) return app
import os import sys import logging import logging.handlers from wikked.wiki import WikiParameters def get_wsgi_app(wiki_root, log_file=None, async_update=True): os.chdir(wiki_root) logging.basicConfig(stream=sys.stderr) if async_update: import wikked.settings wikked.settings.WIKI_ASYNC_UPDATE = True from wikked.web import app app.set_wiki_params(WikiParameters(wiki_root)) if log_file is not None: h = logging.handlers.RotatingFileHandler(log_file, maxBytes=4096) h.setLevel(logging.WARNING) app.logger.addHandler(h) return app
Enable async update by default when using a WSGI application.
Enable async update by default when using a WSGI application.
Python
apache-2.0
ludovicchabant/Wikked,ludovicchabant/Wikked,ludovicchabant/Wikked
import os import sys import logging import logging.handlers from wikked.wiki import WikiParameters def get_wsgi_app(wiki_root, log_file=None): os.chdir(wiki_root) logging.basicConfig(stream=sys.stderr) from wikked.web import app app.set_wiki_params(WikiParameters(wiki_root)) if log_file is not None: h = logging.handlers.RotatingFileHandler(log_file, maxBytes=4096) h.setLevel(logging.WARNING) app.logger.addHandler(h) return app Enable async update by default when using a WSGI application.
import os import sys import logging import logging.handlers from wikked.wiki import WikiParameters def get_wsgi_app(wiki_root, log_file=None, async_update=True): os.chdir(wiki_root) logging.basicConfig(stream=sys.stderr) if async_update: import wikked.settings wikked.settings.WIKI_ASYNC_UPDATE = True from wikked.web import app app.set_wiki_params(WikiParameters(wiki_root)) if log_file is not None: h = logging.handlers.RotatingFileHandler(log_file, maxBytes=4096) h.setLevel(logging.WARNING) app.logger.addHandler(h) return app
<commit_before>import os import sys import logging import logging.handlers from wikked.wiki import WikiParameters def get_wsgi_app(wiki_root, log_file=None): os.chdir(wiki_root) logging.basicConfig(stream=sys.stderr) from wikked.web import app app.set_wiki_params(WikiParameters(wiki_root)) if log_file is not None: h = logging.handlers.RotatingFileHandler(log_file, maxBytes=4096) h.setLevel(logging.WARNING) app.logger.addHandler(h) return app <commit_msg>Enable async update by default when using a WSGI application.<commit_after>
import os import sys import logging import logging.handlers from wikked.wiki import WikiParameters def get_wsgi_app(wiki_root, log_file=None, async_update=True): os.chdir(wiki_root) logging.basicConfig(stream=sys.stderr) if async_update: import wikked.settings wikked.settings.WIKI_ASYNC_UPDATE = True from wikked.web import app app.set_wiki_params(WikiParameters(wiki_root)) if log_file is not None: h = logging.handlers.RotatingFileHandler(log_file, maxBytes=4096) h.setLevel(logging.WARNING) app.logger.addHandler(h) return app
import os import sys import logging import logging.handlers from wikked.wiki import WikiParameters def get_wsgi_app(wiki_root, log_file=None): os.chdir(wiki_root) logging.basicConfig(stream=sys.stderr) from wikked.web import app app.set_wiki_params(WikiParameters(wiki_root)) if log_file is not None: h = logging.handlers.RotatingFileHandler(log_file, maxBytes=4096) h.setLevel(logging.WARNING) app.logger.addHandler(h) return app Enable async update by default when using a WSGI application.import os import sys import logging import logging.handlers from wikked.wiki import WikiParameters def get_wsgi_app(wiki_root, log_file=None, async_update=True): os.chdir(wiki_root) logging.basicConfig(stream=sys.stderr) if async_update: import wikked.settings wikked.settings.WIKI_ASYNC_UPDATE = True from wikked.web import app app.set_wiki_params(WikiParameters(wiki_root)) if log_file is not None: h = logging.handlers.RotatingFileHandler(log_file, maxBytes=4096) h.setLevel(logging.WARNING) app.logger.addHandler(h) return app
<commit_before>import os import sys import logging import logging.handlers from wikked.wiki import WikiParameters def get_wsgi_app(wiki_root, log_file=None): os.chdir(wiki_root) logging.basicConfig(stream=sys.stderr) from wikked.web import app app.set_wiki_params(WikiParameters(wiki_root)) if log_file is not None: h = logging.handlers.RotatingFileHandler(log_file, maxBytes=4096) h.setLevel(logging.WARNING) app.logger.addHandler(h) return app <commit_msg>Enable async update by default when using a WSGI application.<commit_after>import os import sys import logging import logging.handlers from wikked.wiki import WikiParameters def get_wsgi_app(wiki_root, log_file=None, async_update=True): os.chdir(wiki_root) logging.basicConfig(stream=sys.stderr) if async_update: import wikked.settings wikked.settings.WIKI_ASYNC_UPDATE = True from wikked.web import app app.set_wiki_params(WikiParameters(wiki_root)) if log_file is not None: h = logging.handlers.RotatingFileHandler(log_file, maxBytes=4096) h.setLevel(logging.WARNING) app.logger.addHandler(h) return app
b466e0c41629575e0661aff1ba37c7056a732e0a
magicbot/__init__.py
magicbot/__init__.py
from .magicrobot import MagicRobot from .magic_tunable import tunable from .magic_reset import will_reset_to from .state_machine import AutonomousStateMachine, StateMachine, state, timed_state
from .magicrobot import MagicRobot from .magic_tunable import tunable from .magic_reset import will_reset_to from .state_machine import AutonomousStateMachine, StateMachine, default_state, state, timed_state
Add default_state to the magicbot exports
Add default_state to the magicbot exports
Python
bsd-3-clause
Twinters007/robotpy-wpilib-utilities,Twinters007/robotpy-wpilib-utilities,robotpy/robotpy-wpilib-utilities,robotpy/robotpy-wpilib-utilities
from .magicrobot import MagicRobot from .magic_tunable import tunable from .magic_reset import will_reset_to from .state_machine import AutonomousStateMachine, StateMachine, state, timed_state Add default_state to the magicbot exports
from .magicrobot import MagicRobot from .magic_tunable import tunable from .magic_reset import will_reset_to from .state_machine import AutonomousStateMachine, StateMachine, default_state, state, timed_state
<commit_before> from .magicrobot import MagicRobot from .magic_tunable import tunable from .magic_reset import will_reset_to from .state_machine import AutonomousStateMachine, StateMachine, state, timed_state <commit_msg>Add default_state to the magicbot exports<commit_after>
from .magicrobot import MagicRobot from .magic_tunable import tunable from .magic_reset import will_reset_to from .state_machine import AutonomousStateMachine, StateMachine, default_state, state, timed_state
from .magicrobot import MagicRobot from .magic_tunable import tunable from .magic_reset import will_reset_to from .state_machine import AutonomousStateMachine, StateMachine, state, timed_state Add default_state to the magicbot exports from .magicrobot import MagicRobot from .magic_tunable import tunable from .magic_reset import will_reset_to from .state_machine import AutonomousStateMachine, StateMachine, default_state, state, timed_state
<commit_before> from .magicrobot import MagicRobot from .magic_tunable import tunable from .magic_reset import will_reset_to from .state_machine import AutonomousStateMachine, StateMachine, state, timed_state <commit_msg>Add default_state to the magicbot exports<commit_after> from .magicrobot import MagicRobot from .magic_tunable import tunable from .magic_reset import will_reset_to from .state_machine import AutonomousStateMachine, StateMachine, default_state, state, timed_state
f81909490eae5f4216cb3895f68261c4c2cab367
api/BucketListAPI.py
api/BucketListAPI.py
from flask import Flask, jsonify, request from modals.modals import User, Bucket, Item from api import create_app, db from validate_email import validate_email app = create_app('DevelopmentEnv') @app.route('/') def index(): response = jsonify({'Welcome Message': 'Hello'}) response.status_code = 201 return response @app.route('/auth/register', methods=['POST']) def register(): request.get_json(force=True) try: name = request.json['name'] email = request.json['email'] password = request.json['password'] if not name or not email or not password: response = jsonify({'Error': 'Missing Values'}) response.status_code = 400 return response if not validate_email(email): response = jsonify({'Error': 'Invalid Email'}) response.status_code = 400 return response except KeyError: response = jsonify({'Error': 'Invalid Keys detected'}) response.status_code = 500 return response if __name__ == '__main__': app.run()
from flask import Flask, jsonify, request from modals.modals import User, Bucket, Item from api import create_app, db from validate_email import validate_email app = create_app('DevelopmentEnv') @app.route('/') def index(): response = jsonify({'Welcome Message': 'Hello'}) response.status_code = 201 return response @app.route('/auth/register', methods=['POST']) def register(): request.get_json(force=True) try: name = request.json['name'] email = request.json['email'] password = request.json['password'] if not name or not email or not password: response = jsonify({'Error': 'Missing Values'}) response.status_code = 400 return response if not validate_email(email): response = jsonify({'Error': 'Invalid Email'}) response.status_code = 400 return response if len(password) < 6: response = jsonify({'Error': 'Password is short'}) response.status_code = 400 return response except KeyError: response = jsonify({'Error': 'Invalid Keys detected'}) response.status_code = 500 return response if __name__ == '__main__': app.run()
Add chech for short passwords
Add chech for short passwords
Python
mit
patlub/BucketListAPI,patlub/BucketListAPI
from flask import Flask, jsonify, request from modals.modals import User, Bucket, Item from api import create_app, db from validate_email import validate_email app = create_app('DevelopmentEnv') @app.route('/') def index(): response = jsonify({'Welcome Message': 'Hello'}) response.status_code = 201 return response @app.route('/auth/register', methods=['POST']) def register(): request.get_json(force=True) try: name = request.json['name'] email = request.json['email'] password = request.json['password'] if not name or not email or not password: response = jsonify({'Error': 'Missing Values'}) response.status_code = 400 return response if not validate_email(email): response = jsonify({'Error': 'Invalid Email'}) response.status_code = 400 return response except KeyError: response = jsonify({'Error': 'Invalid Keys detected'}) response.status_code = 500 return response if __name__ == '__main__': app.run() Add chech for short passwords
from flask import Flask, jsonify, request from modals.modals import User, Bucket, Item from api import create_app, db from validate_email import validate_email app = create_app('DevelopmentEnv') @app.route('/') def index(): response = jsonify({'Welcome Message': 'Hello'}) response.status_code = 201 return response @app.route('/auth/register', methods=['POST']) def register(): request.get_json(force=True) try: name = request.json['name'] email = request.json['email'] password = request.json['password'] if not name or not email or not password: response = jsonify({'Error': 'Missing Values'}) response.status_code = 400 return response if not validate_email(email): response = jsonify({'Error': 'Invalid Email'}) response.status_code = 400 return response if len(password) < 6: response = jsonify({'Error': 'Password is short'}) response.status_code = 400 return response except KeyError: response = jsonify({'Error': 'Invalid Keys detected'}) response.status_code = 500 return response if __name__ == '__main__': app.run()
<commit_before>from flask import Flask, jsonify, request from modals.modals import User, Bucket, Item from api import create_app, db from validate_email import validate_email app = create_app('DevelopmentEnv') @app.route('/') def index(): response = jsonify({'Welcome Message': 'Hello'}) response.status_code = 201 return response @app.route('/auth/register', methods=['POST']) def register(): request.get_json(force=True) try: name = request.json['name'] email = request.json['email'] password = request.json['password'] if not name or not email or not password: response = jsonify({'Error': 'Missing Values'}) response.status_code = 400 return response if not validate_email(email): response = jsonify({'Error': 'Invalid Email'}) response.status_code = 400 return response except KeyError: response = jsonify({'Error': 'Invalid Keys detected'}) response.status_code = 500 return response if __name__ == '__main__': app.run() <commit_msg>Add chech for short passwords<commit_after>
from flask import Flask, jsonify, request from modals.modals import User, Bucket, Item from api import create_app, db from validate_email import validate_email app = create_app('DevelopmentEnv') @app.route('/') def index(): response = jsonify({'Welcome Message': 'Hello'}) response.status_code = 201 return response @app.route('/auth/register', methods=['POST']) def register(): request.get_json(force=True) try: name = request.json['name'] email = request.json['email'] password = request.json['password'] if not name or not email or not password: response = jsonify({'Error': 'Missing Values'}) response.status_code = 400 return response if not validate_email(email): response = jsonify({'Error': 'Invalid Email'}) response.status_code = 400 return response if len(password) < 6: response = jsonify({'Error': 'Password is short'}) response.status_code = 400 return response except KeyError: response = jsonify({'Error': 'Invalid Keys detected'}) response.status_code = 500 return response if __name__ == '__main__': app.run()
from flask import Flask, jsonify, request from modals.modals import User, Bucket, Item from api import create_app, db from validate_email import validate_email app = create_app('DevelopmentEnv') @app.route('/') def index(): response = jsonify({'Welcome Message': 'Hello'}) response.status_code = 201 return response @app.route('/auth/register', methods=['POST']) def register(): request.get_json(force=True) try: name = request.json['name'] email = request.json['email'] password = request.json['password'] if not name or not email or not password: response = jsonify({'Error': 'Missing Values'}) response.status_code = 400 return response if not validate_email(email): response = jsonify({'Error': 'Invalid Email'}) response.status_code = 400 return response except KeyError: response = jsonify({'Error': 'Invalid Keys detected'}) response.status_code = 500 return response if __name__ == '__main__': app.run() Add chech for short passwordsfrom flask import Flask, jsonify, request from modals.modals import User, Bucket, Item from api import create_app, db from validate_email import validate_email app = create_app('DevelopmentEnv') @app.route('/') def index(): response = jsonify({'Welcome Message': 'Hello'}) response.status_code = 201 return response @app.route('/auth/register', methods=['POST']) def register(): request.get_json(force=True) try: name = request.json['name'] email = request.json['email'] password = request.json['password'] if not name or not email or not password: response = jsonify({'Error': 'Missing Values'}) response.status_code = 400 return response if not validate_email(email): response = jsonify({'Error': 'Invalid Email'}) response.status_code = 400 return response if len(password) < 6: response = jsonify({'Error': 'Password is short'}) response.status_code = 400 return response except KeyError: response = jsonify({'Error': 'Invalid Keys detected'}) response.status_code = 500 return response if __name__ == '__main__': app.run()
<commit_before>from flask import Flask, jsonify, request from modals.modals import User, Bucket, Item from api import create_app, db from validate_email import validate_email app = create_app('DevelopmentEnv') @app.route('/') def index(): response = jsonify({'Welcome Message': 'Hello'}) response.status_code = 201 return response @app.route('/auth/register', methods=['POST']) def register(): request.get_json(force=True) try: name = request.json['name'] email = request.json['email'] password = request.json['password'] if not name or not email or not password: response = jsonify({'Error': 'Missing Values'}) response.status_code = 400 return response if not validate_email(email): response = jsonify({'Error': 'Invalid Email'}) response.status_code = 400 return response except KeyError: response = jsonify({'Error': 'Invalid Keys detected'}) response.status_code = 500 return response if __name__ == '__main__': app.run() <commit_msg>Add chech for short passwords<commit_after>from flask import Flask, jsonify, request from modals.modals import User, Bucket, Item from api import create_app, db from validate_email import validate_email app = create_app('DevelopmentEnv') @app.route('/') def index(): response = jsonify({'Welcome Message': 'Hello'}) response.status_code = 201 return response @app.route('/auth/register', methods=['POST']) def register(): request.get_json(force=True) try: name = request.json['name'] email = request.json['email'] password = request.json['password'] if not name or not email or not password: response = jsonify({'Error': 'Missing Values'}) response.status_code = 400 return response if not validate_email(email): response = jsonify({'Error': 'Invalid Email'}) response.status_code = 400 return response if len(password) < 6: response = jsonify({'Error': 'Password is short'}) response.status_code = 400 return response except KeyError: response = jsonify({'Error': 'Invalid Keys detected'}) response.status_code = 500 return response if __name__ == '__main__': app.run()
3cf942c5cf7f791cbbd04bf1d092c2c8061b69ac
prjxray/site_type.py
prjxray/site_type.py
""" Description of a site type """ from collections import namedtuple import enum class SitePinDirection(enum.Enum): IN = "IN" OUT = "OUT" SiteTypePin = namedtuple('SiteTypePin', 'name direction') class SiteType(object): def __init__(self, site_type): self.type = site_type['type'] self.site_pins = {} for site_pin, site_pin_info in site_type['site_pins'].items(): self.site_pins[site_pin] = SiteTypePin( name=site_pin, direction=SitePinDirection(site_pin_info['direction']), ) def get_site_pins(self): return self.site_pins.keys() def get_site_pin(self, site_pin): return self.site_pins[site_pin]
""" Description of a site type """ from collections import namedtuple import enum class SitePinDirection(enum.Enum): IN = "IN" OUT = "OUT" INOUT = "INOUT" SiteTypePin = namedtuple('SiteTypePin', 'name direction') class SiteType(object): def __init__(self, site_type): self.type = site_type['type'] self.site_pins = {} for site_pin, site_pin_info in site_type['site_pins'].items(): self.site_pins[site_pin] = SiteTypePin( name=site_pin, direction=SitePinDirection(site_pin_info['direction']), ) def get_site_pins(self): return self.site_pins.keys() def get_site_pin(self, site_pin): return self.site_pins[site_pin]
Add INOUT to direction enum.
prjxray: Add INOUT to direction enum. INOUT is found on the PS7 interface on the Zynq. Signed-off-by: Tim 'mithro' Ansell <b1c1d8736f20db3fb6c1c66bb1455ed43909f0d8@mith.ro>
Python
isc
SymbiFlow/prjxray,SymbiFlow/prjxray,SymbiFlow/prjxray,SymbiFlow/prjxray,SymbiFlow/prjxray
""" Description of a site type """ from collections import namedtuple import enum class SitePinDirection(enum.Enum): IN = "IN" OUT = "OUT" SiteTypePin = namedtuple('SiteTypePin', 'name direction') class SiteType(object): def __init__(self, site_type): self.type = site_type['type'] self.site_pins = {} for site_pin, site_pin_info in site_type['site_pins'].items(): self.site_pins[site_pin] = SiteTypePin( name=site_pin, direction=SitePinDirection(site_pin_info['direction']), ) def get_site_pins(self): return self.site_pins.keys() def get_site_pin(self, site_pin): return self.site_pins[site_pin] prjxray: Add INOUT to direction enum. INOUT is found on the PS7 interface on the Zynq. Signed-off-by: Tim 'mithro' Ansell <b1c1d8736f20db3fb6c1c66bb1455ed43909f0d8@mith.ro>
""" Description of a site type """ from collections import namedtuple import enum class SitePinDirection(enum.Enum): IN = "IN" OUT = "OUT" INOUT = "INOUT" SiteTypePin = namedtuple('SiteTypePin', 'name direction') class SiteType(object): def __init__(self, site_type): self.type = site_type['type'] self.site_pins = {} for site_pin, site_pin_info in site_type['site_pins'].items(): self.site_pins[site_pin] = SiteTypePin( name=site_pin, direction=SitePinDirection(site_pin_info['direction']), ) def get_site_pins(self): return self.site_pins.keys() def get_site_pin(self, site_pin): return self.site_pins[site_pin]
<commit_before>""" Description of a site type """ from collections import namedtuple import enum class SitePinDirection(enum.Enum): IN = "IN" OUT = "OUT" SiteTypePin = namedtuple('SiteTypePin', 'name direction') class SiteType(object): def __init__(self, site_type): self.type = site_type['type'] self.site_pins = {} for site_pin, site_pin_info in site_type['site_pins'].items(): self.site_pins[site_pin] = SiteTypePin( name=site_pin, direction=SitePinDirection(site_pin_info['direction']), ) def get_site_pins(self): return self.site_pins.keys() def get_site_pin(self, site_pin): return self.site_pins[site_pin] <commit_msg>prjxray: Add INOUT to direction enum. INOUT is found on the PS7 interface on the Zynq. Signed-off-by: Tim 'mithro' Ansell <b1c1d8736f20db3fb6c1c66bb1455ed43909f0d8@mith.ro><commit_after>
""" Description of a site type """ from collections import namedtuple import enum class SitePinDirection(enum.Enum): IN = "IN" OUT = "OUT" INOUT = "INOUT" SiteTypePin = namedtuple('SiteTypePin', 'name direction') class SiteType(object): def __init__(self, site_type): self.type = site_type['type'] self.site_pins = {} for site_pin, site_pin_info in site_type['site_pins'].items(): self.site_pins[site_pin] = SiteTypePin( name=site_pin, direction=SitePinDirection(site_pin_info['direction']), ) def get_site_pins(self): return self.site_pins.keys() def get_site_pin(self, site_pin): return self.site_pins[site_pin]
""" Description of a site type """ from collections import namedtuple import enum class SitePinDirection(enum.Enum): IN = "IN" OUT = "OUT" SiteTypePin = namedtuple('SiteTypePin', 'name direction') class SiteType(object): def __init__(self, site_type): self.type = site_type['type'] self.site_pins = {} for site_pin, site_pin_info in site_type['site_pins'].items(): self.site_pins[site_pin] = SiteTypePin( name=site_pin, direction=SitePinDirection(site_pin_info['direction']), ) def get_site_pins(self): return self.site_pins.keys() def get_site_pin(self, site_pin): return self.site_pins[site_pin] prjxray: Add INOUT to direction enum. INOUT is found on the PS7 interface on the Zynq. Signed-off-by: Tim 'mithro' Ansell <b1c1d8736f20db3fb6c1c66bb1455ed43909f0d8@mith.ro>""" Description of a site type """ from collections import namedtuple import enum class SitePinDirection(enum.Enum): IN = "IN" OUT = "OUT" INOUT = "INOUT" SiteTypePin = namedtuple('SiteTypePin', 'name direction') class SiteType(object): def __init__(self, site_type): self.type = site_type['type'] self.site_pins = {} for site_pin, site_pin_info in site_type['site_pins'].items(): self.site_pins[site_pin] = SiteTypePin( name=site_pin, direction=SitePinDirection(site_pin_info['direction']), ) def get_site_pins(self): return self.site_pins.keys() def get_site_pin(self, site_pin): return self.site_pins[site_pin]
<commit_before>""" Description of a site type """ from collections import namedtuple import enum class SitePinDirection(enum.Enum): IN = "IN" OUT = "OUT" SiteTypePin = namedtuple('SiteTypePin', 'name direction') class SiteType(object): def __init__(self, site_type): self.type = site_type['type'] self.site_pins = {} for site_pin, site_pin_info in site_type['site_pins'].items(): self.site_pins[site_pin] = SiteTypePin( name=site_pin, direction=SitePinDirection(site_pin_info['direction']), ) def get_site_pins(self): return self.site_pins.keys() def get_site_pin(self, site_pin): return self.site_pins[site_pin] <commit_msg>prjxray: Add INOUT to direction enum. INOUT is found on the PS7 interface on the Zynq. Signed-off-by: Tim 'mithro' Ansell <b1c1d8736f20db3fb6c1c66bb1455ed43909f0d8@mith.ro><commit_after>""" Description of a site type """ from collections import namedtuple import enum class SitePinDirection(enum.Enum): IN = "IN" OUT = "OUT" INOUT = "INOUT" SiteTypePin = namedtuple('SiteTypePin', 'name direction') class SiteType(object): def __init__(self, site_type): self.type = site_type['type'] self.site_pins = {} for site_pin, site_pin_info in site_type['site_pins'].items(): self.site_pins[site_pin] = SiteTypePin( name=site_pin, direction=SitePinDirection(site_pin_info['direction']), ) def get_site_pins(self): return self.site_pins.keys() def get_site_pin(self, site_pin): return self.site_pins[site_pin]
8aea526176592511581ddbeb6f3bb96ce072cc91
wukong/__init__.py
wukong/__init__.py
# Set up a null roothandler for our logging system import logging try: # Python 2.7+ from logging import NullHandler except ImportError: class NullHandler(logging.Handler): def emit(self, record): pass logging.getLogger(__name__).addHandler(NullHandler())
# Set up a null roothandler for our logging system import logging from logging import NullHandler logging.getLogger(__name__).addHandler(NullHandler())
Remove the NullHandler patch because we don't support any python versions that need it
Remove the NullHandler patch because we don't support any python versions that need it
Python
mit
SurveyMonkey/wukong
# Set up a null roothandler for our logging system import logging try: # Python 2.7+ from logging import NullHandler except ImportError: class NullHandler(logging.Handler): def emit(self, record): pass logging.getLogger(__name__).addHandler(NullHandler()) Remove the NullHandler patch because we don't support any python versions that need it
# Set up a null roothandler for our logging system import logging from logging import NullHandler logging.getLogger(__name__).addHandler(NullHandler())
<commit_before># Set up a null roothandler for our logging system import logging try: # Python 2.7+ from logging import NullHandler except ImportError: class NullHandler(logging.Handler): def emit(self, record): pass logging.getLogger(__name__).addHandler(NullHandler()) <commit_msg>Remove the NullHandler patch because we don't support any python versions that need it<commit_after>
# Set up a null roothandler for our logging system import logging from logging import NullHandler logging.getLogger(__name__).addHandler(NullHandler())
# Set up a null roothandler for our logging system import logging try: # Python 2.7+ from logging import NullHandler except ImportError: class NullHandler(logging.Handler): def emit(self, record): pass logging.getLogger(__name__).addHandler(NullHandler()) Remove the NullHandler patch because we don't support any python versions that need it# Set up a null roothandler for our logging system import logging from logging import NullHandler logging.getLogger(__name__).addHandler(NullHandler())
<commit_before># Set up a null roothandler for our logging system import logging try: # Python 2.7+ from logging import NullHandler except ImportError: class NullHandler(logging.Handler): def emit(self, record): pass logging.getLogger(__name__).addHandler(NullHandler()) <commit_msg>Remove the NullHandler patch because we don't support any python versions that need it<commit_after># Set up a null roothandler for our logging system import logging from logging import NullHandler logging.getLogger(__name__).addHandler(NullHandler())
554cbefe43ce94af4f1858c534cdb0d1e5ba965c
floyd/cli/auth.py
floyd/cli/auth.py
import click import webbrowser import floyd from floyd.client.auth import AuthClient from floyd.manager.auth_config import AuthConfigManager from floyd.model.access_token import AccessToken from floyd.log import logger as floyd_logger @click.command() def login(): """ Log into Floyd via Auth0. """ cli_info_url = "{}/welcome".format(floyd.floyd_web_host) click.confirm('Authentication token page will now open in your browser. Continue?', abort=True, default=True) webbrowser.open(cli_info_url) access_code = click.prompt('Please copy and paste the token here', type=str, hide_input=True) user = AuthClient().get_user(access_code) access_token = AccessToken(username=user.username, token=access_code) AuthConfigManager.set_access_token(access_token) floyd_logger.info("Login Successful") @click.command() def logout(): """ Logout of Floyd. """ AuthConfigManager.purge_access_token()
import click import webbrowser import floyd from floyd.client.auth import AuthClient from floyd.manager.auth_config import AuthConfigManager from floyd.model.access_token import AccessToken from floyd.log import logger as floyd_logger @click.command() @click.option('--token', is_flag=True, default=False, help='Just enter token') def login(token): """ Log into Floyd via Auth0. """ if not token: cli_info_url = "{}/welcome".format(floyd.floyd_web_host) click.confirm('Authentication token page will now open in your browser. Continue?', abort=True, default=True) webbrowser.open(cli_info_url) access_code = click.prompt('Please copy and paste the token here', type=str, hide_input=True) user = AuthClient().get_user(access_code) access_token = AccessToken(username=user.username, token=access_code) AuthConfigManager.set_access_token(access_token) floyd_logger.info("Login Successful") @click.command() def logout(): """ Logout of Floyd. """ AuthConfigManager.purge_access_token()
Add support for --token in login command
Add support for --token in login command This can be used when you already have the token and do not want to open the browser.
Python
apache-2.0
mckayward/floyd-cli,mckayward/floyd-cli,houqp/floyd-cli,houqp/floyd-cli
import click import webbrowser import floyd from floyd.client.auth import AuthClient from floyd.manager.auth_config import AuthConfigManager from floyd.model.access_token import AccessToken from floyd.log import logger as floyd_logger @click.command() def login(): """ Log into Floyd via Auth0. """ cli_info_url = "{}/welcome".format(floyd.floyd_web_host) click.confirm('Authentication token page will now open in your browser. Continue?', abort=True, default=True) webbrowser.open(cli_info_url) access_code = click.prompt('Please copy and paste the token here', type=str, hide_input=True) user = AuthClient().get_user(access_code) access_token = AccessToken(username=user.username, token=access_code) AuthConfigManager.set_access_token(access_token) floyd_logger.info("Login Successful") @click.command() def logout(): """ Logout of Floyd. """ AuthConfigManager.purge_access_token() Add support for --token in login command This can be used when you already have the token and do not want to open the browser.
import click import webbrowser import floyd from floyd.client.auth import AuthClient from floyd.manager.auth_config import AuthConfigManager from floyd.model.access_token import AccessToken from floyd.log import logger as floyd_logger @click.command() @click.option('--token', is_flag=True, default=False, help='Just enter token') def login(token): """ Log into Floyd via Auth0. """ if not token: cli_info_url = "{}/welcome".format(floyd.floyd_web_host) click.confirm('Authentication token page will now open in your browser. Continue?', abort=True, default=True) webbrowser.open(cli_info_url) access_code = click.prompt('Please copy and paste the token here', type=str, hide_input=True) user = AuthClient().get_user(access_code) access_token = AccessToken(username=user.username, token=access_code) AuthConfigManager.set_access_token(access_token) floyd_logger.info("Login Successful") @click.command() def logout(): """ Logout of Floyd. """ AuthConfigManager.purge_access_token()
<commit_before>import click import webbrowser import floyd from floyd.client.auth import AuthClient from floyd.manager.auth_config import AuthConfigManager from floyd.model.access_token import AccessToken from floyd.log import logger as floyd_logger @click.command() def login(): """ Log into Floyd via Auth0. """ cli_info_url = "{}/welcome".format(floyd.floyd_web_host) click.confirm('Authentication token page will now open in your browser. Continue?', abort=True, default=True) webbrowser.open(cli_info_url) access_code = click.prompt('Please copy and paste the token here', type=str, hide_input=True) user = AuthClient().get_user(access_code) access_token = AccessToken(username=user.username, token=access_code) AuthConfigManager.set_access_token(access_token) floyd_logger.info("Login Successful") @click.command() def logout(): """ Logout of Floyd. """ AuthConfigManager.purge_access_token() <commit_msg>Add support for --token in login command This can be used when you already have the token and do not want to open the browser.<commit_after>
import click import webbrowser import floyd from floyd.client.auth import AuthClient from floyd.manager.auth_config import AuthConfigManager from floyd.model.access_token import AccessToken from floyd.log import logger as floyd_logger @click.command() @click.option('--token', is_flag=True, default=False, help='Just enter token') def login(token): """ Log into Floyd via Auth0. """ if not token: cli_info_url = "{}/welcome".format(floyd.floyd_web_host) click.confirm('Authentication token page will now open in your browser. Continue?', abort=True, default=True) webbrowser.open(cli_info_url) access_code = click.prompt('Please copy and paste the token here', type=str, hide_input=True) user = AuthClient().get_user(access_code) access_token = AccessToken(username=user.username, token=access_code) AuthConfigManager.set_access_token(access_token) floyd_logger.info("Login Successful") @click.command() def logout(): """ Logout of Floyd. """ AuthConfigManager.purge_access_token()
import click import webbrowser import floyd from floyd.client.auth import AuthClient from floyd.manager.auth_config import AuthConfigManager from floyd.model.access_token import AccessToken from floyd.log import logger as floyd_logger @click.command() def login(): """ Log into Floyd via Auth0. """ cli_info_url = "{}/welcome".format(floyd.floyd_web_host) click.confirm('Authentication token page will now open in your browser. Continue?', abort=True, default=True) webbrowser.open(cli_info_url) access_code = click.prompt('Please copy and paste the token here', type=str, hide_input=True) user = AuthClient().get_user(access_code) access_token = AccessToken(username=user.username, token=access_code) AuthConfigManager.set_access_token(access_token) floyd_logger.info("Login Successful") @click.command() def logout(): """ Logout of Floyd. """ AuthConfigManager.purge_access_token() Add support for --token in login command This can be used when you already have the token and do not want to open the browser.import click import webbrowser import floyd from floyd.client.auth import AuthClient from floyd.manager.auth_config import AuthConfigManager from floyd.model.access_token import AccessToken from floyd.log import logger as floyd_logger @click.command() @click.option('--token', is_flag=True, default=False, help='Just enter token') def login(token): """ Log into Floyd via Auth0. """ if not token: cli_info_url = "{}/welcome".format(floyd.floyd_web_host) click.confirm('Authentication token page will now open in your browser. Continue?', abort=True, default=True) webbrowser.open(cli_info_url) access_code = click.prompt('Please copy and paste the token here', type=str, hide_input=True) user = AuthClient().get_user(access_code) access_token = AccessToken(username=user.username, token=access_code) AuthConfigManager.set_access_token(access_token) floyd_logger.info("Login Successful") @click.command() def logout(): """ Logout of Floyd. """ AuthConfigManager.purge_access_token()
<commit_before>import click import webbrowser import floyd from floyd.client.auth import AuthClient from floyd.manager.auth_config import AuthConfigManager from floyd.model.access_token import AccessToken from floyd.log import logger as floyd_logger @click.command() def login(): """ Log into Floyd via Auth0. """ cli_info_url = "{}/welcome".format(floyd.floyd_web_host) click.confirm('Authentication token page will now open in your browser. Continue?', abort=True, default=True) webbrowser.open(cli_info_url) access_code = click.prompt('Please copy and paste the token here', type=str, hide_input=True) user = AuthClient().get_user(access_code) access_token = AccessToken(username=user.username, token=access_code) AuthConfigManager.set_access_token(access_token) floyd_logger.info("Login Successful") @click.command() def logout(): """ Logout of Floyd. """ AuthConfigManager.purge_access_token() <commit_msg>Add support for --token in login command This can be used when you already have the token and do not want to open the browser.<commit_after>import click import webbrowser import floyd from floyd.client.auth import AuthClient from floyd.manager.auth_config import AuthConfigManager from floyd.model.access_token import AccessToken from floyd.log import logger as floyd_logger @click.command() @click.option('--token', is_flag=True, default=False, help='Just enter token') def login(token): """ Log into Floyd via Auth0. """ if not token: cli_info_url = "{}/welcome".format(floyd.floyd_web_host) click.confirm('Authentication token page will now open in your browser. Continue?', abort=True, default=True) webbrowser.open(cli_info_url) access_code = click.prompt('Please copy and paste the token here', type=str, hide_input=True) user = AuthClient().get_user(access_code) access_token = AccessToken(username=user.username, token=access_code) AuthConfigManager.set_access_token(access_token) floyd_logger.info("Login Successful") @click.command() def logout(): """ Logout of Floyd. """ AuthConfigManager.purge_access_token()
0197521691b34ee102a97e72c589c2ce93e9255b
sparkback/__init__.py
sparkback/__init__.py
# -*- coding: utf-8 -*- from __future__ import division import argparse ticks = ('▁', '▂', '▃', '▄', '▅', '▆', '▇', '█') def scale_data(data): m = min(data) n = (max(data) - m) / (len(ticks) - 1) return [ ticks[int((t - m) / n)] for t in data ] def print_ansi_spark(d): print ''.join(d) if __name__ == "__main__": parser = argparse.ArgumentParser(description='Process some integers.') parser.add_argument('integers', metavar='N', type=int, nargs='+', help='an integer for the accumulator') args = parser.parse_args() print_ansi_spark(scale_data(args.integers))
# -*- coding: utf-8 -*- from __future__ import division import argparse ticks = ('▁', '▂', '▃', '▄', '▅', '▆', '▇', '█') def scale_data(data): m = min(data) n = (max(data) - m) / (len(ticks) - 1) # if every element is the same height return all lower ticks, else compute # the tick height if n == 0: return [ ticks[0] for t in data] else: return [ ticks[int((t - m) / n)] for t in data ] def print_ansi_spark(d): print ''.join(d) if __name__ == "__main__": parser = argparse.ArgumentParser(description='Process some integers.') parser.add_argument('integers', metavar='N', type=int, nargs='+', help='an integer for the accumulator') args = parser.parse_args() print_ansi_spark(scale_data(args.integers))
Fix bug where all data points are same height
Fix bug where all data points are same height
Python
mit
mmichie/sparkback
# -*- coding: utf-8 -*- from __future__ import division import argparse ticks = ('▁', '▂', '▃', '▄', '▅', '▆', '▇', '█') def scale_data(data): m = min(data) n = (max(data) - m) / (len(ticks) - 1) return [ ticks[int((t - m) / n)] for t in data ] def print_ansi_spark(d): print ''.join(d) if __name__ == "__main__": parser = argparse.ArgumentParser(description='Process some integers.') parser.add_argument('integers', metavar='N', type=int, nargs='+', help='an integer for the accumulator') args = parser.parse_args() print_ansi_spark(scale_data(args.integers)) Fix bug where all data points are same height
# -*- coding: utf-8 -*- from __future__ import division import argparse ticks = ('▁', '▂', '▃', '▄', '▅', '▆', '▇', '█') def scale_data(data): m = min(data) n = (max(data) - m) / (len(ticks) - 1) # if every element is the same height return all lower ticks, else compute # the tick height if n == 0: return [ ticks[0] for t in data] else: return [ ticks[int((t - m) / n)] for t in data ] def print_ansi_spark(d): print ''.join(d) if __name__ == "__main__": parser = argparse.ArgumentParser(description='Process some integers.') parser.add_argument('integers', metavar='N', type=int, nargs='+', help='an integer for the accumulator') args = parser.parse_args() print_ansi_spark(scale_data(args.integers))
<commit_before># -*- coding: utf-8 -*- from __future__ import division import argparse ticks = ('▁', '▂', '▃', '▄', '▅', '▆', '▇', '█') def scale_data(data): m = min(data) n = (max(data) - m) / (len(ticks) - 1) return [ ticks[int((t - m) / n)] for t in data ] def print_ansi_spark(d): print ''.join(d) if __name__ == "__main__": parser = argparse.ArgumentParser(description='Process some integers.') parser.add_argument('integers', metavar='N', type=int, nargs='+', help='an integer for the accumulator') args = parser.parse_args() print_ansi_spark(scale_data(args.integers)) <commit_msg>Fix bug where all data points are same height<commit_after>
# -*- coding: utf-8 -*- from __future__ import division import argparse ticks = ('▁', '▂', '▃', '▄', '▅', '▆', '▇', '█') def scale_data(data): m = min(data) n = (max(data) - m) / (len(ticks) - 1) # if every element is the same height return all lower ticks, else compute # the tick height if n == 0: return [ ticks[0] for t in data] else: return [ ticks[int((t - m) / n)] for t in data ] def print_ansi_spark(d): print ''.join(d) if __name__ == "__main__": parser = argparse.ArgumentParser(description='Process some integers.') parser.add_argument('integers', metavar='N', type=int, nargs='+', help='an integer for the accumulator') args = parser.parse_args() print_ansi_spark(scale_data(args.integers))
# -*- coding: utf-8 -*- from __future__ import division import argparse ticks = ('▁', '▂', '▃', '▄', '▅', '▆', '▇', '█') def scale_data(data): m = min(data) n = (max(data) - m) / (len(ticks) - 1) return [ ticks[int((t - m) / n)] for t in data ] def print_ansi_spark(d): print ''.join(d) if __name__ == "__main__": parser = argparse.ArgumentParser(description='Process some integers.') parser.add_argument('integers', metavar='N', type=int, nargs='+', help='an integer for the accumulator') args = parser.parse_args() print_ansi_spark(scale_data(args.integers)) Fix bug where all data points are same height# -*- coding: utf-8 -*- from __future__ import division import argparse ticks = ('▁', '▂', '▃', '▄', '▅', '▆', '▇', '█') def scale_data(data): m = min(data) n = (max(data) - m) / (len(ticks) - 1) # if every element is the same height return all lower ticks, else compute # the tick height if n == 0: return [ ticks[0] for t in data] else: return [ ticks[int((t - m) / n)] for t in data ] def print_ansi_spark(d): print ''.join(d) if __name__ == "__main__": parser = argparse.ArgumentParser(description='Process some integers.') parser.add_argument('integers', metavar='N', type=int, nargs='+', help='an integer for the accumulator') args = parser.parse_args() print_ansi_spark(scale_data(args.integers))
<commit_before># -*- coding: utf-8 -*- from __future__ import division import argparse ticks = ('▁', '▂', '▃', '▄', '▅', '▆', '▇', '█') def scale_data(data): m = min(data) n = (max(data) - m) / (len(ticks) - 1) return [ ticks[int((t - m) / n)] for t in data ] def print_ansi_spark(d): print ''.join(d) if __name__ == "__main__": parser = argparse.ArgumentParser(description='Process some integers.') parser.add_argument('integers', metavar='N', type=int, nargs='+', help='an integer for the accumulator') args = parser.parse_args() print_ansi_spark(scale_data(args.integers)) <commit_msg>Fix bug where all data points are same height<commit_after># -*- coding: utf-8 -*- from __future__ import division import argparse ticks = ('▁', '▂', '▃', '▄', '▅', '▆', '▇', '█') def scale_data(data): m = min(data) n = (max(data) - m) / (len(ticks) - 1) # if every element is the same height return all lower ticks, else compute # the tick height if n == 0: return [ ticks[0] for t in data] else: return [ ticks[int((t - m) / n)] for t in data ] def print_ansi_spark(d): print ''.join(d) if __name__ == "__main__": parser = argparse.ArgumentParser(description='Process some integers.') parser.add_argument('integers', metavar='N', type=int, nargs='+', help='an integer for the accumulator') args = parser.parse_args() print_ansi_spark(scale_data(args.integers))
8baa86cb381aaf52b16c7e0647a0b50cdbbd677a
st2common/st2common/util/db.py
st2common/st2common/util/db.py
# Copyright 2019 Extreme Networks, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from __future__ import absolute_import import mongoengine import six def mongodb_to_python_types(value): if isinstance(value, mongoengine.base.datastructures.BaseDict): value = dict(value) if isinstance(value, mongoengine.base.datastructures.BaseList): value = list(value) if isinstance(value, dict): value = {k: mongodb_to_python_types(v) for k, v in six.iteritems(value)} if isinstance(value, list): value = [mongodb_to_python_types(v) for v in value] return value
# Copyright 2019 Extreme Networks, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from __future__ import absolute_import import mongoengine import six def mongodb_to_python_types(value): # Convert MongoDB BaseDict and BaseList types to python dict and list types. if isinstance(value, mongoengine.base.datastructures.BaseDict): value = dict(value) elif isinstance(value, mongoengine.base.datastructures.BaseList): value = list(value) # Recursively traverse the dict and list to convert values. if isinstance(value, dict): value = {k: mongodb_to_python_types(v) for k, v in six.iteritems(value)} elif isinstance(value, list): value = [mongodb_to_python_types(v) for v in value] return value
Use if-elif instead of multiple if statements to check types
Use if-elif instead of multiple if statements to check types Use if-elif instead of multiple if statements to check types when converting from MongoDB BaseDict and BaseList to python dict and list types. Once the value is converted, use another if-elif block to recursively evaluate and convert the values of dict and list.
Python
apache-2.0
nzlosh/st2,nzlosh/st2,Plexxi/st2,StackStorm/st2,StackStorm/st2,Plexxi/st2,StackStorm/st2,nzlosh/st2,StackStorm/st2,Plexxi/st2,nzlosh/st2,Plexxi/st2
# Copyright 2019 Extreme Networks, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from __future__ import absolute_import import mongoengine import six def mongodb_to_python_types(value): if isinstance(value, mongoengine.base.datastructures.BaseDict): value = dict(value) if isinstance(value, mongoengine.base.datastructures.BaseList): value = list(value) if isinstance(value, dict): value = {k: mongodb_to_python_types(v) for k, v in six.iteritems(value)} if isinstance(value, list): value = [mongodb_to_python_types(v) for v in value] return value Use if-elif instead of multiple if statements to check types Use if-elif instead of multiple if statements to check types when converting from MongoDB BaseDict and BaseList to python dict and list types. Once the value is converted, use another if-elif block to recursively evaluate and convert the values of dict and list.
# Copyright 2019 Extreme Networks, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from __future__ import absolute_import import mongoengine import six def mongodb_to_python_types(value): # Convert MongoDB BaseDict and BaseList types to python dict and list types. if isinstance(value, mongoengine.base.datastructures.BaseDict): value = dict(value) elif isinstance(value, mongoengine.base.datastructures.BaseList): value = list(value) # Recursively traverse the dict and list to convert values. if isinstance(value, dict): value = {k: mongodb_to_python_types(v) for k, v in six.iteritems(value)} elif isinstance(value, list): value = [mongodb_to_python_types(v) for v in value] return value
<commit_before># Copyright 2019 Extreme Networks, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from __future__ import absolute_import import mongoengine import six def mongodb_to_python_types(value): if isinstance(value, mongoengine.base.datastructures.BaseDict): value = dict(value) if isinstance(value, mongoengine.base.datastructures.BaseList): value = list(value) if isinstance(value, dict): value = {k: mongodb_to_python_types(v) for k, v in six.iteritems(value)} if isinstance(value, list): value = [mongodb_to_python_types(v) for v in value] return value <commit_msg>Use if-elif instead of multiple if statements to check types Use if-elif instead of multiple if statements to check types when converting from MongoDB BaseDict and BaseList to python dict and list types. Once the value is converted, use another if-elif block to recursively evaluate and convert the values of dict and list.<commit_after>
# Copyright 2019 Extreme Networks, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from __future__ import absolute_import import mongoengine import six def mongodb_to_python_types(value): # Convert MongoDB BaseDict and BaseList types to python dict and list types. if isinstance(value, mongoengine.base.datastructures.BaseDict): value = dict(value) elif isinstance(value, mongoengine.base.datastructures.BaseList): value = list(value) # Recursively traverse the dict and list to convert values. if isinstance(value, dict): value = {k: mongodb_to_python_types(v) for k, v in six.iteritems(value)} elif isinstance(value, list): value = [mongodb_to_python_types(v) for v in value] return value
# Copyright 2019 Extreme Networks, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from __future__ import absolute_import import mongoengine import six def mongodb_to_python_types(value): if isinstance(value, mongoengine.base.datastructures.BaseDict): value = dict(value) if isinstance(value, mongoengine.base.datastructures.BaseList): value = list(value) if isinstance(value, dict): value = {k: mongodb_to_python_types(v) for k, v in six.iteritems(value)} if isinstance(value, list): value = [mongodb_to_python_types(v) for v in value] return value Use if-elif instead of multiple if statements to check types Use if-elif instead of multiple if statements to check types when converting from MongoDB BaseDict and BaseList to python dict and list types. Once the value is converted, use another if-elif block to recursively evaluate and convert the values of dict and list.# Copyright 2019 Extreme Networks, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from __future__ import absolute_import import mongoengine import six def mongodb_to_python_types(value): # Convert MongoDB BaseDict and BaseList types to python dict and list types. if isinstance(value, mongoengine.base.datastructures.BaseDict): value = dict(value) elif isinstance(value, mongoengine.base.datastructures.BaseList): value = list(value) # Recursively traverse the dict and list to convert values. if isinstance(value, dict): value = {k: mongodb_to_python_types(v) for k, v in six.iteritems(value)} elif isinstance(value, list): value = [mongodb_to_python_types(v) for v in value] return value
<commit_before># Copyright 2019 Extreme Networks, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from __future__ import absolute_import import mongoengine import six def mongodb_to_python_types(value): if isinstance(value, mongoengine.base.datastructures.BaseDict): value = dict(value) if isinstance(value, mongoengine.base.datastructures.BaseList): value = list(value) if isinstance(value, dict): value = {k: mongodb_to_python_types(v) for k, v in six.iteritems(value)} if isinstance(value, list): value = [mongodb_to_python_types(v) for v in value] return value <commit_msg>Use if-elif instead of multiple if statements to check types Use if-elif instead of multiple if statements to check types when converting from MongoDB BaseDict and BaseList to python dict and list types. Once the value is converted, use another if-elif block to recursively evaluate and convert the values of dict and list.<commit_after># Copyright 2019 Extreme Networks, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from __future__ import absolute_import import mongoengine import six def mongodb_to_python_types(value): # Convert MongoDB BaseDict and BaseList types to python dict and list types. if isinstance(value, mongoengine.base.datastructures.BaseDict): value = dict(value) elif isinstance(value, mongoengine.base.datastructures.BaseList): value = list(value) # Recursively traverse the dict and list to convert values. if isinstance(value, dict): value = {k: mongodb_to_python_types(v) for k, v in six.iteritems(value)} elif isinstance(value, list): value = [mongodb_to_python_types(v) for v in value] return value
238f497ffc783b200a925d16940cae84872cf396
firmant/__init__.py
firmant/__init__.py
# Copyright (c) 2010, Robert Escriva # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of Firmant nor the names of its contributors may be # used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Add license to Firmant package.
Add license to Firmant package.
Python
bsd-3-clause
rescrv/firmant
Add license to Firmant package.
# Copyright (c) 2010, Robert Escriva # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of Firmant nor the names of its contributors may be # used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<commit_before><commit_msg>Add license to Firmant package.<commit_after>
# Copyright (c) 2010, Robert Escriva # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of Firmant nor the names of its contributors may be # used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Add license to Firmant package.# Copyright (c) 2010, Robert Escriva # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of Firmant nor the names of its contributors may be # used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<commit_before><commit_msg>Add license to Firmant package.<commit_after># Copyright (c) 2010, Robert Escriva # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of Firmant nor the names of its contributors may be # used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
ce032e4bc64db2c19caf39d9f7c4e8dba7a3f4da
flask_aggregator.py
flask_aggregator.py
import json from flask import request, Response from werkzeug.exceptions import BadRequest from werkzeug.test import EnvironBuilder class Aggregator(object): def __init__(self, app=None, endpoint=None): self.url_map = {} self.endpoint = endpoint or "/aggregate" if app: self.init_app(app) def init_app(self, app): self.app = app self.app.add_url_rule(self.endpoint, view_func=self.post, methods=["POST"]) def get_response(self, route): query_string = "" if '?' in route: route, query_string = route.split('?', 1) builder = EnvironBuilder(path=route, query_string=query_string) self.app.request_context(builder.get_environ()).push() return self.app.dispatch_request() def post(self): try: data = request.data.decode('utf-8') routes = json.loads(data) if not isinstance(routes, list): raise TypeError except (ValueError, TypeError) as e: raise BadRequest("Can't get requests list.") def __generate(): data = None for route in routes: yield data + ', ' if data else '{' response = self.get_response(route) json_response = json.dumps(response) data = '"{}": {}'.format(route, json_response) yield data + '}' return Response(__generate(), mimetype='application/json')
import json from flask import request, Response from werkzeug.exceptions import BadRequest from werkzeug.test import EnvironBuilder class Aggregator(object): def __init__(self, app=None, endpoint=None): self.url_map = {} self.endpoint = endpoint or "/aggregate" if app: self.init_app(app) def init_app(self, app): app.add_url_rule(self.endpoint, view_func=self.post, methods=["POST"], defaults={"app": app}) def get_response(self, app, route): query_string = "" if '?' in route: route, query_string = route.split('?', 1) builder = EnvironBuilder(path=route, query_string=query_string) app.request_context(builder.get_environ()).push() return app.dispatch_request() def post(self, app): try: data = request.data.decode('utf-8') routes = json.loads(data) if not isinstance(routes, list): raise TypeError except (ValueError, TypeError) as e: raise BadRequest("Can't get requests list.") def __generate(): data = None for route in routes: yield data + ', ' if data else '{' response = self.get_response(app, route) json_response = json.dumps(response) data = '"{}": {}'.format(route, json_response) yield data + '}' return Response(__generate(), mimetype='application/json')
Support multiple Flask apps on the same Aggregator instance
Support multiple Flask apps on the same Aggregator instance
Python
mit
ramnes/flask-aggregator
import json from flask import request, Response from werkzeug.exceptions import BadRequest from werkzeug.test import EnvironBuilder class Aggregator(object): def __init__(self, app=None, endpoint=None): self.url_map = {} self.endpoint = endpoint or "/aggregate" if app: self.init_app(app) def init_app(self, app): self.app = app self.app.add_url_rule(self.endpoint, view_func=self.post, methods=["POST"]) def get_response(self, route): query_string = "" if '?' in route: route, query_string = route.split('?', 1) builder = EnvironBuilder(path=route, query_string=query_string) self.app.request_context(builder.get_environ()).push() return self.app.dispatch_request() def post(self): try: data = request.data.decode('utf-8') routes = json.loads(data) if not isinstance(routes, list): raise TypeError except (ValueError, TypeError) as e: raise BadRequest("Can't get requests list.") def __generate(): data = None for route in routes: yield data + ', ' if data else '{' response = self.get_response(route) json_response = json.dumps(response) data = '"{}": {}'.format(route, json_response) yield data + '}' return Response(__generate(), mimetype='application/json') Support multiple Flask apps on the same Aggregator instance
import json from flask import request, Response from werkzeug.exceptions import BadRequest from werkzeug.test import EnvironBuilder class Aggregator(object): def __init__(self, app=None, endpoint=None): self.url_map = {} self.endpoint = endpoint or "/aggregate" if app: self.init_app(app) def init_app(self, app): app.add_url_rule(self.endpoint, view_func=self.post, methods=["POST"], defaults={"app": app}) def get_response(self, app, route): query_string = "" if '?' in route: route, query_string = route.split('?', 1) builder = EnvironBuilder(path=route, query_string=query_string) app.request_context(builder.get_environ()).push() return app.dispatch_request() def post(self, app): try: data = request.data.decode('utf-8') routes = json.loads(data) if not isinstance(routes, list): raise TypeError except (ValueError, TypeError) as e: raise BadRequest("Can't get requests list.") def __generate(): data = None for route in routes: yield data + ', ' if data else '{' response = self.get_response(app, route) json_response = json.dumps(response) data = '"{}": {}'.format(route, json_response) yield data + '}' return Response(__generate(), mimetype='application/json')
<commit_before>import json from flask import request, Response from werkzeug.exceptions import BadRequest from werkzeug.test import EnvironBuilder class Aggregator(object): def __init__(self, app=None, endpoint=None): self.url_map = {} self.endpoint = endpoint or "/aggregate" if app: self.init_app(app) def init_app(self, app): self.app = app self.app.add_url_rule(self.endpoint, view_func=self.post, methods=["POST"]) def get_response(self, route): query_string = "" if '?' in route: route, query_string = route.split('?', 1) builder = EnvironBuilder(path=route, query_string=query_string) self.app.request_context(builder.get_environ()).push() return self.app.dispatch_request() def post(self): try: data = request.data.decode('utf-8') routes = json.loads(data) if not isinstance(routes, list): raise TypeError except (ValueError, TypeError) as e: raise BadRequest("Can't get requests list.") def __generate(): data = None for route in routes: yield data + ', ' if data else '{' response = self.get_response(route) json_response = json.dumps(response) data = '"{}": {}'.format(route, json_response) yield data + '}' return Response(__generate(), mimetype='application/json') <commit_msg>Support multiple Flask apps on the same Aggregator instance<commit_after>
import json from flask import request, Response from werkzeug.exceptions import BadRequest from werkzeug.test import EnvironBuilder class Aggregator(object): def __init__(self, app=None, endpoint=None): self.url_map = {} self.endpoint = endpoint or "/aggregate" if app: self.init_app(app) def init_app(self, app): app.add_url_rule(self.endpoint, view_func=self.post, methods=["POST"], defaults={"app": app}) def get_response(self, app, route): query_string = "" if '?' in route: route, query_string = route.split('?', 1) builder = EnvironBuilder(path=route, query_string=query_string) app.request_context(builder.get_environ()).push() return app.dispatch_request() def post(self, app): try: data = request.data.decode('utf-8') routes = json.loads(data) if not isinstance(routes, list): raise TypeError except (ValueError, TypeError) as e: raise BadRequest("Can't get requests list.") def __generate(): data = None for route in routes: yield data + ', ' if data else '{' response = self.get_response(app, route) json_response = json.dumps(response) data = '"{}": {}'.format(route, json_response) yield data + '}' return Response(__generate(), mimetype='application/json')
import json from flask import request, Response from werkzeug.exceptions import BadRequest from werkzeug.test import EnvironBuilder class Aggregator(object): def __init__(self, app=None, endpoint=None): self.url_map = {} self.endpoint = endpoint or "/aggregate" if app: self.init_app(app) def init_app(self, app): self.app = app self.app.add_url_rule(self.endpoint, view_func=self.post, methods=["POST"]) def get_response(self, route): query_string = "" if '?' in route: route, query_string = route.split('?', 1) builder = EnvironBuilder(path=route, query_string=query_string) self.app.request_context(builder.get_environ()).push() return self.app.dispatch_request() def post(self): try: data = request.data.decode('utf-8') routes = json.loads(data) if not isinstance(routes, list): raise TypeError except (ValueError, TypeError) as e: raise BadRequest("Can't get requests list.") def __generate(): data = None for route in routes: yield data + ', ' if data else '{' response = self.get_response(route) json_response = json.dumps(response) data = '"{}": {}'.format(route, json_response) yield data + '}' return Response(__generate(), mimetype='application/json') Support multiple Flask apps on the same Aggregator instanceimport json from flask import request, Response from werkzeug.exceptions import BadRequest from werkzeug.test import EnvironBuilder class Aggregator(object): def __init__(self, app=None, endpoint=None): self.url_map = {} self.endpoint = endpoint or "/aggregate" if app: self.init_app(app) def init_app(self, app): app.add_url_rule(self.endpoint, view_func=self.post, methods=["POST"], defaults={"app": app}) def get_response(self, app, route): query_string = "" if '?' in route: route, query_string = route.split('?', 1) builder = EnvironBuilder(path=route, query_string=query_string) app.request_context(builder.get_environ()).push() return app.dispatch_request() def post(self, app): try: data = request.data.decode('utf-8') routes = json.loads(data) if not isinstance(routes, list): raise TypeError except (ValueError, TypeError) as e: raise BadRequest("Can't get requests list.") def __generate(): data = None for route in routes: yield data + ', ' if data else '{' response = self.get_response(app, route) json_response = json.dumps(response) data = '"{}": {}'.format(route, json_response) yield data + '}' return Response(__generate(), mimetype='application/json')
<commit_before>import json from flask import request, Response from werkzeug.exceptions import BadRequest from werkzeug.test import EnvironBuilder class Aggregator(object): def __init__(self, app=None, endpoint=None): self.url_map = {} self.endpoint = endpoint or "/aggregate" if app: self.init_app(app) def init_app(self, app): self.app = app self.app.add_url_rule(self.endpoint, view_func=self.post, methods=["POST"]) def get_response(self, route): query_string = "" if '?' in route: route, query_string = route.split('?', 1) builder = EnvironBuilder(path=route, query_string=query_string) self.app.request_context(builder.get_environ()).push() return self.app.dispatch_request() def post(self): try: data = request.data.decode('utf-8') routes = json.loads(data) if not isinstance(routes, list): raise TypeError except (ValueError, TypeError) as e: raise BadRequest("Can't get requests list.") def __generate(): data = None for route in routes: yield data + ', ' if data else '{' response = self.get_response(route) json_response = json.dumps(response) data = '"{}": {}'.format(route, json_response) yield data + '}' return Response(__generate(), mimetype='application/json') <commit_msg>Support multiple Flask apps on the same Aggregator instance<commit_after>import json from flask import request, Response from werkzeug.exceptions import BadRequest from werkzeug.test import EnvironBuilder class Aggregator(object): def __init__(self, app=None, endpoint=None): self.url_map = {} self.endpoint = endpoint or "/aggregate" if app: self.init_app(app) def init_app(self, app): app.add_url_rule(self.endpoint, view_func=self.post, methods=["POST"], defaults={"app": app}) def get_response(self, app, route): query_string = "" if '?' in route: route, query_string = route.split('?', 1) builder = EnvironBuilder(path=route, query_string=query_string) app.request_context(builder.get_environ()).push() return app.dispatch_request() def post(self, app): try: data = request.data.decode('utf-8') routes = json.loads(data) if not isinstance(routes, list): raise TypeError except (ValueError, TypeError) as e: raise BadRequest("Can't get requests list.") def __generate(): data = None for route in routes: yield data + ', ' if data else '{' response = self.get_response(app, route) json_response = json.dumps(response) data = '"{}": {}'.format(route, json_response) yield data + '}' return Response(__generate(), mimetype='application/json')
fe007309b1c2e8f0cc594a1faec9d35076244108
troposphere/workspaces.py
troposphere/workspaces.py
# Copyright (c) 2015, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. from . import AWSObject, AWSProperty, Tags from .validators import boolean, integer class WorkspaceProperties(AWSProperty): props = { 'ComputeTypeName': (basestring, False), 'RootVolumeSizeGib': (integer, False), 'RunningMode': (basestring, False), 'RunningModeAutoStopTimeoutInMinutes': (integer, False), 'UserVolumeSizeGib': (integer, False), } class Workspace(AWSObject): resource_type = "AWS::WorkSpaces::Workspace" props = { 'BundleId': (basestring, True), 'DirectoryId': (basestring, True), 'UserName': (basestring, True), 'RootVolumeEncryptionEnabled': (boolean, False), 'Tags': (Tags, False), 'UserVolumeEncryptionEnabled': (boolean, False), 'VolumeEncryptionKey': (basestring, False), 'WorkspaceProperties': (WorkspaceProperties, False), }
# Copyright (c) 2012-2020, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. # # *** Do not modify - this file is autogenerated *** # Resource specification version: 18.6.0 from . import AWSObject from . import AWSProperty from troposphere import Tags from .validators import boolean from .validators import integer class ConnectionAlias(AWSObject): resource_type = "AWS::WorkSpaces::ConnectionAlias" props = { 'ConnectionString': (basestring, True), 'Tags': (Tags, False), } class WorkspaceProperties(AWSProperty): props = { 'ComputeTypeName': (basestring, False), 'RootVolumeSizeGib': (integer, False), 'RunningMode': (basestring, False), 'RunningModeAutoStopTimeoutInMinutes': (integer, False), 'UserVolumeSizeGib': (integer, False), } class Workspace(AWSObject): resource_type = "AWS::WorkSpaces::Workspace" props = { 'BundleId': (basestring, True), 'DirectoryId': (basestring, True), 'RootVolumeEncryptionEnabled': (boolean, False), 'Tags': (Tags, False), 'UserName': (basestring, True), 'UserVolumeEncryptionEnabled': (boolean, False), 'VolumeEncryptionKey': (basestring, False), 'WorkspaceProperties': (WorkspaceProperties, False), }
Add WorkSpaces::ConnectionAlias per 2020-10-01 changes
Add WorkSpaces::ConnectionAlias per 2020-10-01 changes
Python
bsd-2-clause
cloudtools/troposphere,cloudtools/troposphere
# Copyright (c) 2015, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. from . import AWSObject, AWSProperty, Tags from .validators import boolean, integer class WorkspaceProperties(AWSProperty): props = { 'ComputeTypeName': (basestring, False), 'RootVolumeSizeGib': (integer, False), 'RunningMode': (basestring, False), 'RunningModeAutoStopTimeoutInMinutes': (integer, False), 'UserVolumeSizeGib': (integer, False), } class Workspace(AWSObject): resource_type = "AWS::WorkSpaces::Workspace" props = { 'BundleId': (basestring, True), 'DirectoryId': (basestring, True), 'UserName': (basestring, True), 'RootVolumeEncryptionEnabled': (boolean, False), 'Tags': (Tags, False), 'UserVolumeEncryptionEnabled': (boolean, False), 'VolumeEncryptionKey': (basestring, False), 'WorkspaceProperties': (WorkspaceProperties, False), } Add WorkSpaces::ConnectionAlias per 2020-10-01 changes
# Copyright (c) 2012-2020, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. # # *** Do not modify - this file is autogenerated *** # Resource specification version: 18.6.0 from . import AWSObject from . import AWSProperty from troposphere import Tags from .validators import boolean from .validators import integer class ConnectionAlias(AWSObject): resource_type = "AWS::WorkSpaces::ConnectionAlias" props = { 'ConnectionString': (basestring, True), 'Tags': (Tags, False), } class WorkspaceProperties(AWSProperty): props = { 'ComputeTypeName': (basestring, False), 'RootVolumeSizeGib': (integer, False), 'RunningMode': (basestring, False), 'RunningModeAutoStopTimeoutInMinutes': (integer, False), 'UserVolumeSizeGib': (integer, False), } class Workspace(AWSObject): resource_type = "AWS::WorkSpaces::Workspace" props = { 'BundleId': (basestring, True), 'DirectoryId': (basestring, True), 'RootVolumeEncryptionEnabled': (boolean, False), 'Tags': (Tags, False), 'UserName': (basestring, True), 'UserVolumeEncryptionEnabled': (boolean, False), 'VolumeEncryptionKey': (basestring, False), 'WorkspaceProperties': (WorkspaceProperties, False), }
<commit_before># Copyright (c) 2015, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. from . import AWSObject, AWSProperty, Tags from .validators import boolean, integer class WorkspaceProperties(AWSProperty): props = { 'ComputeTypeName': (basestring, False), 'RootVolumeSizeGib': (integer, False), 'RunningMode': (basestring, False), 'RunningModeAutoStopTimeoutInMinutes': (integer, False), 'UserVolumeSizeGib': (integer, False), } class Workspace(AWSObject): resource_type = "AWS::WorkSpaces::Workspace" props = { 'BundleId': (basestring, True), 'DirectoryId': (basestring, True), 'UserName': (basestring, True), 'RootVolumeEncryptionEnabled': (boolean, False), 'Tags': (Tags, False), 'UserVolumeEncryptionEnabled': (boolean, False), 'VolumeEncryptionKey': (basestring, False), 'WorkspaceProperties': (WorkspaceProperties, False), } <commit_msg>Add WorkSpaces::ConnectionAlias per 2020-10-01 changes<commit_after>
# Copyright (c) 2012-2020, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. # # *** Do not modify - this file is autogenerated *** # Resource specification version: 18.6.0 from . import AWSObject from . import AWSProperty from troposphere import Tags from .validators import boolean from .validators import integer class ConnectionAlias(AWSObject): resource_type = "AWS::WorkSpaces::ConnectionAlias" props = { 'ConnectionString': (basestring, True), 'Tags': (Tags, False), } class WorkspaceProperties(AWSProperty): props = { 'ComputeTypeName': (basestring, False), 'RootVolumeSizeGib': (integer, False), 'RunningMode': (basestring, False), 'RunningModeAutoStopTimeoutInMinutes': (integer, False), 'UserVolumeSizeGib': (integer, False), } class Workspace(AWSObject): resource_type = "AWS::WorkSpaces::Workspace" props = { 'BundleId': (basestring, True), 'DirectoryId': (basestring, True), 'RootVolumeEncryptionEnabled': (boolean, False), 'Tags': (Tags, False), 'UserName': (basestring, True), 'UserVolumeEncryptionEnabled': (boolean, False), 'VolumeEncryptionKey': (basestring, False), 'WorkspaceProperties': (WorkspaceProperties, False), }
# Copyright (c) 2015, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. from . import AWSObject, AWSProperty, Tags from .validators import boolean, integer class WorkspaceProperties(AWSProperty): props = { 'ComputeTypeName': (basestring, False), 'RootVolumeSizeGib': (integer, False), 'RunningMode': (basestring, False), 'RunningModeAutoStopTimeoutInMinutes': (integer, False), 'UserVolumeSizeGib': (integer, False), } class Workspace(AWSObject): resource_type = "AWS::WorkSpaces::Workspace" props = { 'BundleId': (basestring, True), 'DirectoryId': (basestring, True), 'UserName': (basestring, True), 'RootVolumeEncryptionEnabled': (boolean, False), 'Tags': (Tags, False), 'UserVolumeEncryptionEnabled': (boolean, False), 'VolumeEncryptionKey': (basestring, False), 'WorkspaceProperties': (WorkspaceProperties, False), } Add WorkSpaces::ConnectionAlias per 2020-10-01 changes# Copyright (c) 2012-2020, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. # # *** Do not modify - this file is autogenerated *** # Resource specification version: 18.6.0 from . import AWSObject from . import AWSProperty from troposphere import Tags from .validators import boolean from .validators import integer class ConnectionAlias(AWSObject): resource_type = "AWS::WorkSpaces::ConnectionAlias" props = { 'ConnectionString': (basestring, True), 'Tags': (Tags, False), } class WorkspaceProperties(AWSProperty): props = { 'ComputeTypeName': (basestring, False), 'RootVolumeSizeGib': (integer, False), 'RunningMode': (basestring, False), 'RunningModeAutoStopTimeoutInMinutes': (integer, False), 'UserVolumeSizeGib': (integer, False), } class Workspace(AWSObject): resource_type = "AWS::WorkSpaces::Workspace" props = { 'BundleId': (basestring, True), 'DirectoryId': (basestring, True), 'RootVolumeEncryptionEnabled': (boolean, False), 'Tags': (Tags, False), 'UserName': (basestring, True), 'UserVolumeEncryptionEnabled': (boolean, False), 'VolumeEncryptionKey': (basestring, False), 'WorkspaceProperties': (WorkspaceProperties, False), }
<commit_before># Copyright (c) 2015, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. from . import AWSObject, AWSProperty, Tags from .validators import boolean, integer class WorkspaceProperties(AWSProperty): props = { 'ComputeTypeName': (basestring, False), 'RootVolumeSizeGib': (integer, False), 'RunningMode': (basestring, False), 'RunningModeAutoStopTimeoutInMinutes': (integer, False), 'UserVolumeSizeGib': (integer, False), } class Workspace(AWSObject): resource_type = "AWS::WorkSpaces::Workspace" props = { 'BundleId': (basestring, True), 'DirectoryId': (basestring, True), 'UserName': (basestring, True), 'RootVolumeEncryptionEnabled': (boolean, False), 'Tags': (Tags, False), 'UserVolumeEncryptionEnabled': (boolean, False), 'VolumeEncryptionKey': (basestring, False), 'WorkspaceProperties': (WorkspaceProperties, False), } <commit_msg>Add WorkSpaces::ConnectionAlias per 2020-10-01 changes<commit_after># Copyright (c) 2012-2020, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. # # *** Do not modify - this file is autogenerated *** # Resource specification version: 18.6.0 from . import AWSObject from . import AWSProperty from troposphere import Tags from .validators import boolean from .validators import integer class ConnectionAlias(AWSObject): resource_type = "AWS::WorkSpaces::ConnectionAlias" props = { 'ConnectionString': (basestring, True), 'Tags': (Tags, False), } class WorkspaceProperties(AWSProperty): props = { 'ComputeTypeName': (basestring, False), 'RootVolumeSizeGib': (integer, False), 'RunningMode': (basestring, False), 'RunningModeAutoStopTimeoutInMinutes': (integer, False), 'UserVolumeSizeGib': (integer, False), } class Workspace(AWSObject): resource_type = "AWS::WorkSpaces::Workspace" props = { 'BundleId': (basestring, True), 'DirectoryId': (basestring, True), 'RootVolumeEncryptionEnabled': (boolean, False), 'Tags': (Tags, False), 'UserName': (basestring, True), 'UserVolumeEncryptionEnabled': (boolean, False), 'VolumeEncryptionKey': (basestring, False), 'WorkspaceProperties': (WorkspaceProperties, False), }
229f8f22a71044dc2c39a52ff36458720958c5b9
cpnest/__init__.py
cpnest/__init__.py
from .cpnest import CPNest __version__ = '0.9.8' __all__ = ['model', 'NestedSampling', 'parameter', 'sampler', 'cpnest', 'nest2pos', 'proposal', 'plot']
import logging from .logger import CPNestLogger from .cpnest import CPNest logging.setLoggerClass(CPNestLogger) __version__ = '0.9.8' __all__ = ['model', 'NestedSampling', 'parameter', 'sampler', 'cpnest', 'nest2pos', 'proposal', 'plot', 'logger']
Set logger class in init
Set logger class in init
Python
mit
johnveitch/cpnest
from .cpnest import CPNest __version__ = '0.9.8' __all__ = ['model', 'NestedSampling', 'parameter', 'sampler', 'cpnest', 'nest2pos', 'proposal', 'plot'] Set logger class in init
import logging from .logger import CPNestLogger from .cpnest import CPNest logging.setLoggerClass(CPNestLogger) __version__ = '0.9.8' __all__ = ['model', 'NestedSampling', 'parameter', 'sampler', 'cpnest', 'nest2pos', 'proposal', 'plot', 'logger']
<commit_before>from .cpnest import CPNest __version__ = '0.9.8' __all__ = ['model', 'NestedSampling', 'parameter', 'sampler', 'cpnest', 'nest2pos', 'proposal', 'plot'] <commit_msg>Set logger class in init<commit_after>
import logging from .logger import CPNestLogger from .cpnest import CPNest logging.setLoggerClass(CPNestLogger) __version__ = '0.9.8' __all__ = ['model', 'NestedSampling', 'parameter', 'sampler', 'cpnest', 'nest2pos', 'proposal', 'plot', 'logger']
from .cpnest import CPNest __version__ = '0.9.8' __all__ = ['model', 'NestedSampling', 'parameter', 'sampler', 'cpnest', 'nest2pos', 'proposal', 'plot'] Set logger class in initimport logging from .logger import CPNestLogger from .cpnest import CPNest logging.setLoggerClass(CPNestLogger) __version__ = '0.9.8' __all__ = ['model', 'NestedSampling', 'parameter', 'sampler', 'cpnest', 'nest2pos', 'proposal', 'plot', 'logger']
<commit_before>from .cpnest import CPNest __version__ = '0.9.8' __all__ = ['model', 'NestedSampling', 'parameter', 'sampler', 'cpnest', 'nest2pos', 'proposal', 'plot'] <commit_msg>Set logger class in init<commit_after>import logging from .logger import CPNestLogger from .cpnest import CPNest logging.setLoggerClass(CPNestLogger) __version__ = '0.9.8' __all__ = ['model', 'NestedSampling', 'parameter', 'sampler', 'cpnest', 'nest2pos', 'proposal', 'plot', 'logger']
9ebaac20779d78bb0c276249ac5c578339ba95ee
py/maximum-binary-tree.py
py/maximum-binary-tree.py
# Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution(object): def constructMaximumBinaryTree(self, nums, start=None, end=None): """ :type nums: List[int] :rtype: TreeNode """ if start is None and end is None: start, end = 0, len(nums) if start == end: return None m, mi = nums[start], start for i in xrange(start, end): if nums[i] > m: m, mi = nums[i], i ret = TreeNode(m) ret.left = self.constructMaximumBinaryTree(nums, start, mi) ret.right = self.constructMaximumBinaryTree(nums, mi + 1, end) return ret
# Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution(object): def findMax(self, start, end): bit_length = (end - start).bit_length() - 1 d = 1 << bit_length return max(self.SparseTable[bit_length][start], self.SparseTable[bit_length][end - d]) def do_constructMaximumBinaryTree(self, start, end): if start == end: return None v, i = self.findMax(start, end) ret = TreeNode(v) ret.left = self.do_constructMaximumBinaryTree(start, i) ret.right = self.do_constructMaximumBinaryTree(i + 1, end) return ret def constructMaximumBinaryTree(self, nums): """ :type nums: List[int] :rtype: TreeNode """ self.SparseTable = [[(v, i) for i, v in enumerate(nums)]] l = len(nums) t = 1 while t * 2 < l: prevTable = self.SparseTable[-1] self.SparseTable.append([max(prevTable[i], prevTable[i + t]) for i in xrange(l - t * 2 + 1)]) t *= 2 return self.do_constructMaximumBinaryTree(0, l)
Add py solution for 654. Maximum Binary Tree
Add py solution for 654. Maximum Binary Tree 654. Maximum Binary Tree: https://leetcode.com/problems/maximum-binary-tree/ Approach 2: 1. Use [Sparse Table](https://wcipeg.com/wiki/Range_minimum_query#Sparse_table) to quickly lookup maximum and its index 2. However, approach 1 is already O(nlogn) (average case), approach 2 is much slower compared to approach 1
Python
apache-2.0
ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode
# Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution(object): def constructMaximumBinaryTree(self, nums, start=None, end=None): """ :type nums: List[int] :rtype: TreeNode """ if start is None and end is None: start, end = 0, len(nums) if start == end: return None m, mi = nums[start], start for i in xrange(start, end): if nums[i] > m: m, mi = nums[i], i ret = TreeNode(m) ret.left = self.constructMaximumBinaryTree(nums, start, mi) ret.right = self.constructMaximumBinaryTree(nums, mi + 1, end) return ret Add py solution for 654. Maximum Binary Tree 654. Maximum Binary Tree: https://leetcode.com/problems/maximum-binary-tree/ Approach 2: 1. Use [Sparse Table](https://wcipeg.com/wiki/Range_minimum_query#Sparse_table) to quickly lookup maximum and its index 2. However, approach 1 is already O(nlogn) (average case), approach 2 is much slower compared to approach 1
# Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution(object): def findMax(self, start, end): bit_length = (end - start).bit_length() - 1 d = 1 << bit_length return max(self.SparseTable[bit_length][start], self.SparseTable[bit_length][end - d]) def do_constructMaximumBinaryTree(self, start, end): if start == end: return None v, i = self.findMax(start, end) ret = TreeNode(v) ret.left = self.do_constructMaximumBinaryTree(start, i) ret.right = self.do_constructMaximumBinaryTree(i + 1, end) return ret def constructMaximumBinaryTree(self, nums): """ :type nums: List[int] :rtype: TreeNode """ self.SparseTable = [[(v, i) for i, v in enumerate(nums)]] l = len(nums) t = 1 while t * 2 < l: prevTable = self.SparseTable[-1] self.SparseTable.append([max(prevTable[i], prevTable[i + t]) for i in xrange(l - t * 2 + 1)]) t *= 2 return self.do_constructMaximumBinaryTree(0, l)
<commit_before># Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution(object): def constructMaximumBinaryTree(self, nums, start=None, end=None): """ :type nums: List[int] :rtype: TreeNode """ if start is None and end is None: start, end = 0, len(nums) if start == end: return None m, mi = nums[start], start for i in xrange(start, end): if nums[i] > m: m, mi = nums[i], i ret = TreeNode(m) ret.left = self.constructMaximumBinaryTree(nums, start, mi) ret.right = self.constructMaximumBinaryTree(nums, mi + 1, end) return ret <commit_msg>Add py solution for 654. Maximum Binary Tree 654. Maximum Binary Tree: https://leetcode.com/problems/maximum-binary-tree/ Approach 2: 1. Use [Sparse Table](https://wcipeg.com/wiki/Range_minimum_query#Sparse_table) to quickly lookup maximum and its index 2. However, approach 1 is already O(nlogn) (average case), approach 2 is much slower compared to approach 1<commit_after>
# Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution(object): def findMax(self, start, end): bit_length = (end - start).bit_length() - 1 d = 1 << bit_length return max(self.SparseTable[bit_length][start], self.SparseTable[bit_length][end - d]) def do_constructMaximumBinaryTree(self, start, end): if start == end: return None v, i = self.findMax(start, end) ret = TreeNode(v) ret.left = self.do_constructMaximumBinaryTree(start, i) ret.right = self.do_constructMaximumBinaryTree(i + 1, end) return ret def constructMaximumBinaryTree(self, nums): """ :type nums: List[int] :rtype: TreeNode """ self.SparseTable = [[(v, i) for i, v in enumerate(nums)]] l = len(nums) t = 1 while t * 2 < l: prevTable = self.SparseTable[-1] self.SparseTable.append([max(prevTable[i], prevTable[i + t]) for i in xrange(l - t * 2 + 1)]) t *= 2 return self.do_constructMaximumBinaryTree(0, l)
# Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution(object): def constructMaximumBinaryTree(self, nums, start=None, end=None): """ :type nums: List[int] :rtype: TreeNode """ if start is None and end is None: start, end = 0, len(nums) if start == end: return None m, mi = nums[start], start for i in xrange(start, end): if nums[i] > m: m, mi = nums[i], i ret = TreeNode(m) ret.left = self.constructMaximumBinaryTree(nums, start, mi) ret.right = self.constructMaximumBinaryTree(nums, mi + 1, end) return ret Add py solution for 654. Maximum Binary Tree 654. Maximum Binary Tree: https://leetcode.com/problems/maximum-binary-tree/ Approach 2: 1. Use [Sparse Table](https://wcipeg.com/wiki/Range_minimum_query#Sparse_table) to quickly lookup maximum and its index 2. However, approach 1 is already O(nlogn) (average case), approach 2 is much slower compared to approach 1# Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution(object): def findMax(self, start, end): bit_length = (end - start).bit_length() - 1 d = 1 << bit_length return max(self.SparseTable[bit_length][start], self.SparseTable[bit_length][end - d]) def do_constructMaximumBinaryTree(self, start, end): if start == end: return None v, i = self.findMax(start, end) ret = TreeNode(v) ret.left = self.do_constructMaximumBinaryTree(start, i) ret.right = self.do_constructMaximumBinaryTree(i + 1, end) return ret def constructMaximumBinaryTree(self, nums): """ :type nums: List[int] :rtype: TreeNode """ self.SparseTable = [[(v, i) for i, v in enumerate(nums)]] l = len(nums) t = 1 while t * 2 < l: prevTable = self.SparseTable[-1] self.SparseTable.append([max(prevTable[i], prevTable[i + t]) for i in xrange(l - t * 2 + 1)]) t *= 2 return self.do_constructMaximumBinaryTree(0, l)
<commit_before># Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution(object): def constructMaximumBinaryTree(self, nums, start=None, end=None): """ :type nums: List[int] :rtype: TreeNode """ if start is None and end is None: start, end = 0, len(nums) if start == end: return None m, mi = nums[start], start for i in xrange(start, end): if nums[i] > m: m, mi = nums[i], i ret = TreeNode(m) ret.left = self.constructMaximumBinaryTree(nums, start, mi) ret.right = self.constructMaximumBinaryTree(nums, mi + 1, end) return ret <commit_msg>Add py solution for 654. Maximum Binary Tree 654. Maximum Binary Tree: https://leetcode.com/problems/maximum-binary-tree/ Approach 2: 1. Use [Sparse Table](https://wcipeg.com/wiki/Range_minimum_query#Sparse_table) to quickly lookup maximum and its index 2. However, approach 1 is already O(nlogn) (average case), approach 2 is much slower compared to approach 1<commit_after># Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution(object): def findMax(self, start, end): bit_length = (end - start).bit_length() - 1 d = 1 << bit_length return max(self.SparseTable[bit_length][start], self.SparseTable[bit_length][end - d]) def do_constructMaximumBinaryTree(self, start, end): if start == end: return None v, i = self.findMax(start, end) ret = TreeNode(v) ret.left = self.do_constructMaximumBinaryTree(start, i) ret.right = self.do_constructMaximumBinaryTree(i + 1, end) return ret def constructMaximumBinaryTree(self, nums): """ :type nums: List[int] :rtype: TreeNode """ self.SparseTable = [[(v, i) for i, v in enumerate(nums)]] l = len(nums) t = 1 while t * 2 < l: prevTable = self.SparseTable[-1] self.SparseTable.append([max(prevTable[i], prevTable[i + t]) for i in xrange(l - t * 2 + 1)]) t *= 2 return self.do_constructMaximumBinaryTree(0, l)
d223205dd753783c7ebcbc4f46bd5533578ab82d
pyfr/backends/__init__.py
pyfr/backends/__init__.py
# -*- coding: utf-8 -*- from pyfr.backends.base import Backend as BaseBackend from pyfr.backends.cuda import CudaBackend from pyfr.util import subclass_map def get_backend(name, cfg): backend_map = subclass_map(BaseBackend, 'name') return backend_map[name](cfg)
# -*- coding: utf-8 -*- from pyfr.backends.base import Backend as BaseBackend from pyfr.backends.cuda import CudaBackend from pyfr.util import subclass_map def get_backend(name, cfg): backend_map = subclass_map(BaseBackend, 'name') return backend_map[name.lower()](cfg)
Make backend names more flexible.
Make backend names more flexible.
Python
bsd-3-clause
Aerojspark/PyFR,tjcorona/PyFR,tjcorona/PyFR,tjcorona/PyFR,iyer-arvind/PyFR,BrianVermeire/PyFR
# -*- coding: utf-8 -*- from pyfr.backends.base import Backend as BaseBackend from pyfr.backends.cuda import CudaBackend from pyfr.util import subclass_map def get_backend(name, cfg): backend_map = subclass_map(BaseBackend, 'name') return backend_map[name](cfg) Make backend names more flexible.
# -*- coding: utf-8 -*- from pyfr.backends.base import Backend as BaseBackend from pyfr.backends.cuda import CudaBackend from pyfr.util import subclass_map def get_backend(name, cfg): backend_map = subclass_map(BaseBackend, 'name') return backend_map[name.lower()](cfg)
<commit_before># -*- coding: utf-8 -*- from pyfr.backends.base import Backend as BaseBackend from pyfr.backends.cuda import CudaBackend from pyfr.util import subclass_map def get_backend(name, cfg): backend_map = subclass_map(BaseBackend, 'name') return backend_map[name](cfg) <commit_msg>Make backend names more flexible.<commit_after>
# -*- coding: utf-8 -*- from pyfr.backends.base import Backend as BaseBackend from pyfr.backends.cuda import CudaBackend from pyfr.util import subclass_map def get_backend(name, cfg): backend_map = subclass_map(BaseBackend, 'name') return backend_map[name.lower()](cfg)
# -*- coding: utf-8 -*- from pyfr.backends.base import Backend as BaseBackend from pyfr.backends.cuda import CudaBackend from pyfr.util import subclass_map def get_backend(name, cfg): backend_map = subclass_map(BaseBackend, 'name') return backend_map[name](cfg) Make backend names more flexible.# -*- coding: utf-8 -*- from pyfr.backends.base import Backend as BaseBackend from pyfr.backends.cuda import CudaBackend from pyfr.util import subclass_map def get_backend(name, cfg): backend_map = subclass_map(BaseBackend, 'name') return backend_map[name.lower()](cfg)
<commit_before># -*- coding: utf-8 -*- from pyfr.backends.base import Backend as BaseBackend from pyfr.backends.cuda import CudaBackend from pyfr.util import subclass_map def get_backend(name, cfg): backend_map = subclass_map(BaseBackend, 'name') return backend_map[name](cfg) <commit_msg>Make backend names more flexible.<commit_after># -*- coding: utf-8 -*- from pyfr.backends.base import Backend as BaseBackend from pyfr.backends.cuda import CudaBackend from pyfr.util import subclass_map def get_backend(name, cfg): backend_map = subclass_map(BaseBackend, 'name') return backend_map[name.lower()](cfg)
d6bff0a4e632f0bda9a143acede58c0765066ada
attest/tests/hook.py
attest/tests/hook.py
from attest import Tests, assert_hook from attest.hook import ExpressionEvaluator suite = Tests() @suite.test def eval(): value = 1 + 1 valgen = (v for v in [value]) samples = { 'isinstance(value, int)': 'True', 'value == int("2")': "(2 == 2)", 'value.denominator': '1', 'value == 5 - 3': '(2 == 2)', '{"value": value}': "{'value': 2}", '[valgen.next() for _ in [value]] == [v for v in [value]]': '([2] == [2])', } for expr, result in samples.iteritems(): ev = repr(ExpressionEvaluator(expr, globals(), locals())) assert ev == result assert bool(ev) is True
from attest import Tests, assert_hook from attest.hook import ExpressionEvaluator suite = Tests() @suite.test def eval(): value = 1 + 1 valgen = (v for v in [value]) samples = { 'isinstance(value, int)': 'True', 'value == int("2")': "(2 == 2)", 'type(value).__name__': "'int'", 'value == 5 - 3': '(2 == 2)', '{"value": value}': "{'value': 2}", '[valgen.next() for _ in [value]] == [v for v in [value]]': '([2] == [2])', } for expr, result in samples.iteritems(): ev = repr(ExpressionEvaluator(expr, globals(), locals())) assert ev == result assert bool(ev) is True
Fix tests for visit_Attribute on 2.5/PyPy
Fix tests for visit_Attribute on 2.5/PyPy
Python
bsd-2-clause
dag/attest
from attest import Tests, assert_hook from attest.hook import ExpressionEvaluator suite = Tests() @suite.test def eval(): value = 1 + 1 valgen = (v for v in [value]) samples = { 'isinstance(value, int)': 'True', 'value == int("2")': "(2 == 2)", 'value.denominator': '1', 'value == 5 - 3': '(2 == 2)', '{"value": value}': "{'value': 2}", '[valgen.next() for _ in [value]] == [v for v in [value]]': '([2] == [2])', } for expr, result in samples.iteritems(): ev = repr(ExpressionEvaluator(expr, globals(), locals())) assert ev == result assert bool(ev) is True Fix tests for visit_Attribute on 2.5/PyPy
from attest import Tests, assert_hook from attest.hook import ExpressionEvaluator suite = Tests() @suite.test def eval(): value = 1 + 1 valgen = (v for v in [value]) samples = { 'isinstance(value, int)': 'True', 'value == int("2")': "(2 == 2)", 'type(value).__name__': "'int'", 'value == 5 - 3': '(2 == 2)', '{"value": value}': "{'value': 2}", '[valgen.next() for _ in [value]] == [v for v in [value]]': '([2] == [2])', } for expr, result in samples.iteritems(): ev = repr(ExpressionEvaluator(expr, globals(), locals())) assert ev == result assert bool(ev) is True
<commit_before>from attest import Tests, assert_hook from attest.hook import ExpressionEvaluator suite = Tests() @suite.test def eval(): value = 1 + 1 valgen = (v for v in [value]) samples = { 'isinstance(value, int)': 'True', 'value == int("2")': "(2 == 2)", 'value.denominator': '1', 'value == 5 - 3': '(2 == 2)', '{"value": value}': "{'value': 2}", '[valgen.next() for _ in [value]] == [v for v in [value]]': '([2] == [2])', } for expr, result in samples.iteritems(): ev = repr(ExpressionEvaluator(expr, globals(), locals())) assert ev == result assert bool(ev) is True <commit_msg>Fix tests for visit_Attribute on 2.5/PyPy<commit_after>
from attest import Tests, assert_hook from attest.hook import ExpressionEvaluator suite = Tests() @suite.test def eval(): value = 1 + 1 valgen = (v for v in [value]) samples = { 'isinstance(value, int)': 'True', 'value == int("2")': "(2 == 2)", 'type(value).__name__': "'int'", 'value == 5 - 3': '(2 == 2)', '{"value": value}': "{'value': 2}", '[valgen.next() for _ in [value]] == [v for v in [value]]': '([2] == [2])', } for expr, result in samples.iteritems(): ev = repr(ExpressionEvaluator(expr, globals(), locals())) assert ev == result assert bool(ev) is True
from attest import Tests, assert_hook from attest.hook import ExpressionEvaluator suite = Tests() @suite.test def eval(): value = 1 + 1 valgen = (v for v in [value]) samples = { 'isinstance(value, int)': 'True', 'value == int("2")': "(2 == 2)", 'value.denominator': '1', 'value == 5 - 3': '(2 == 2)', '{"value": value}': "{'value': 2}", '[valgen.next() for _ in [value]] == [v for v in [value]]': '([2] == [2])', } for expr, result in samples.iteritems(): ev = repr(ExpressionEvaluator(expr, globals(), locals())) assert ev == result assert bool(ev) is True Fix tests for visit_Attribute on 2.5/PyPyfrom attest import Tests, assert_hook from attest.hook import ExpressionEvaluator suite = Tests() @suite.test def eval(): value = 1 + 1 valgen = (v for v in [value]) samples = { 'isinstance(value, int)': 'True', 'value == int("2")': "(2 == 2)", 'type(value).__name__': "'int'", 'value == 5 - 3': '(2 == 2)', '{"value": value}': "{'value': 2}", '[valgen.next() for _ in [value]] == [v for v in [value]]': '([2] == [2])', } for expr, result in samples.iteritems(): ev = repr(ExpressionEvaluator(expr, globals(), locals())) assert ev == result assert bool(ev) is True
<commit_before>from attest import Tests, assert_hook from attest.hook import ExpressionEvaluator suite = Tests() @suite.test def eval(): value = 1 + 1 valgen = (v for v in [value]) samples = { 'isinstance(value, int)': 'True', 'value == int("2")': "(2 == 2)", 'value.denominator': '1', 'value == 5 - 3': '(2 == 2)', '{"value": value}': "{'value': 2}", '[valgen.next() for _ in [value]] == [v for v in [value]]': '([2] == [2])', } for expr, result in samples.iteritems(): ev = repr(ExpressionEvaluator(expr, globals(), locals())) assert ev == result assert bool(ev) is True <commit_msg>Fix tests for visit_Attribute on 2.5/PyPy<commit_after>from attest import Tests, assert_hook from attest.hook import ExpressionEvaluator suite = Tests() @suite.test def eval(): value = 1 + 1 valgen = (v for v in [value]) samples = { 'isinstance(value, int)': 'True', 'value == int("2")': "(2 == 2)", 'type(value).__name__': "'int'", 'value == 5 - 3': '(2 == 2)', '{"value": value}': "{'value': 2}", '[valgen.next() for _ in [value]] == [v for v in [value]]': '([2] == [2])', } for expr, result in samples.iteritems(): ev = repr(ExpressionEvaluator(expr, globals(), locals())) assert ev == result assert bool(ev) is True
8c6ff33c8a034c2eecf5f2244811c86acf96120a
tools/apollo/list_organisms.py
tools/apollo/list_organisms.py
#!/usr/bin/env python from __future__ import print_function import argparse import json from webapollo import AssertUser, WAAuth, WebApolloInstance, accessible_organisms, PasswordGenerator if __name__ == '__main__': parser = argparse.ArgumentParser(description='List all organisms available in an Apollo instance') WAAuth(parser) parser.add_argument('email', help='User Email') args = parser.parse_args() wa = WebApolloInstance(args.apollo, args.username, args.password) try: gx_user = AssertUser(wa.users.loadUsers(email=args.email)) except Exception: returnData = wa.users.createUser(args.email, args.email, args.email, PasswordGenerator(12), role='user', addToHistory=True) gx_user = AssertUser(wa.users.loadUsers(email=args.email)) all_orgs = wa.organisms.findAllOrganisms() orgs = accessible_organisms(gx_user, all_orgs) print(json.dumps(orgs, indent=2))
#!/usr/bin/env python from __future__ import print_function import argparse import json from webapollo import AssertUser, WAAuth, WebApolloInstance, accessible_organisms, PasswordGenerator if __name__ == '__main__': parser = argparse.ArgumentParser(description='List all organisms available in an Apollo instance') WAAuth(parser) parser.add_argument('email', help='User Email') args = parser.parse_args() wa = WebApolloInstance(args.apollo, args.username, args.password) try: gx_user = AssertUser(wa.users.loadUsers(email=args.email)) except Exception: returnData = wa.users.createUser(args.email, args.email, args.email, PasswordGenerator(12), role='user', addToHistory=True) gx_user = AssertUser(wa.users.loadUsers(email=args.email)) all_orgs = wa.organisms.findAllOrganisms() try: orgs = accessible_organisms(gx_user, all_orgs) except Exception: orgs = [] print(json.dumps(orgs, indent=2))
Add try-catch if no organism allowed
Add try-catch if no organism allowed
Python
mit
galaxy-genome-annotation/galaxy-tools,galaxy-genome-annotation/galaxy-tools
#!/usr/bin/env python from __future__ import print_function import argparse import json from webapollo import AssertUser, WAAuth, WebApolloInstance, accessible_organisms, PasswordGenerator if __name__ == '__main__': parser = argparse.ArgumentParser(description='List all organisms available in an Apollo instance') WAAuth(parser) parser.add_argument('email', help='User Email') args = parser.parse_args() wa = WebApolloInstance(args.apollo, args.username, args.password) try: gx_user = AssertUser(wa.users.loadUsers(email=args.email)) except Exception: returnData = wa.users.createUser(args.email, args.email, args.email, PasswordGenerator(12), role='user', addToHistory=True) gx_user = AssertUser(wa.users.loadUsers(email=args.email)) all_orgs = wa.organisms.findAllOrganisms() orgs = accessible_organisms(gx_user, all_orgs) print(json.dumps(orgs, indent=2)) Add try-catch if no organism allowed
#!/usr/bin/env python from __future__ import print_function import argparse import json from webapollo import AssertUser, WAAuth, WebApolloInstance, accessible_organisms, PasswordGenerator if __name__ == '__main__': parser = argparse.ArgumentParser(description='List all organisms available in an Apollo instance') WAAuth(parser) parser.add_argument('email', help='User Email') args = parser.parse_args() wa = WebApolloInstance(args.apollo, args.username, args.password) try: gx_user = AssertUser(wa.users.loadUsers(email=args.email)) except Exception: returnData = wa.users.createUser(args.email, args.email, args.email, PasswordGenerator(12), role='user', addToHistory=True) gx_user = AssertUser(wa.users.loadUsers(email=args.email)) all_orgs = wa.organisms.findAllOrganisms() try: orgs = accessible_organisms(gx_user, all_orgs) except Exception: orgs = [] print(json.dumps(orgs, indent=2))
<commit_before>#!/usr/bin/env python from __future__ import print_function import argparse import json from webapollo import AssertUser, WAAuth, WebApolloInstance, accessible_organisms, PasswordGenerator if __name__ == '__main__': parser = argparse.ArgumentParser(description='List all organisms available in an Apollo instance') WAAuth(parser) parser.add_argument('email', help='User Email') args = parser.parse_args() wa = WebApolloInstance(args.apollo, args.username, args.password) try: gx_user = AssertUser(wa.users.loadUsers(email=args.email)) except Exception: returnData = wa.users.createUser(args.email, args.email, args.email, PasswordGenerator(12), role='user', addToHistory=True) gx_user = AssertUser(wa.users.loadUsers(email=args.email)) all_orgs = wa.organisms.findAllOrganisms() orgs = accessible_organisms(gx_user, all_orgs) print(json.dumps(orgs, indent=2)) <commit_msg>Add try-catch if no organism allowed<commit_after>
#!/usr/bin/env python from __future__ import print_function import argparse import json from webapollo import AssertUser, WAAuth, WebApolloInstance, accessible_organisms, PasswordGenerator if __name__ == '__main__': parser = argparse.ArgumentParser(description='List all organisms available in an Apollo instance') WAAuth(parser) parser.add_argument('email', help='User Email') args = parser.parse_args() wa = WebApolloInstance(args.apollo, args.username, args.password) try: gx_user = AssertUser(wa.users.loadUsers(email=args.email)) except Exception: returnData = wa.users.createUser(args.email, args.email, args.email, PasswordGenerator(12), role='user', addToHistory=True) gx_user = AssertUser(wa.users.loadUsers(email=args.email)) all_orgs = wa.organisms.findAllOrganisms() try: orgs = accessible_organisms(gx_user, all_orgs) except Exception: orgs = [] print(json.dumps(orgs, indent=2))
#!/usr/bin/env python from __future__ import print_function import argparse import json from webapollo import AssertUser, WAAuth, WebApolloInstance, accessible_organisms, PasswordGenerator if __name__ == '__main__': parser = argparse.ArgumentParser(description='List all organisms available in an Apollo instance') WAAuth(parser) parser.add_argument('email', help='User Email') args = parser.parse_args() wa = WebApolloInstance(args.apollo, args.username, args.password) try: gx_user = AssertUser(wa.users.loadUsers(email=args.email)) except Exception: returnData = wa.users.createUser(args.email, args.email, args.email, PasswordGenerator(12), role='user', addToHistory=True) gx_user = AssertUser(wa.users.loadUsers(email=args.email)) all_orgs = wa.organisms.findAllOrganisms() orgs = accessible_organisms(gx_user, all_orgs) print(json.dumps(orgs, indent=2)) Add try-catch if no organism allowed#!/usr/bin/env python from __future__ import print_function import argparse import json from webapollo import AssertUser, WAAuth, WebApolloInstance, accessible_organisms, PasswordGenerator if __name__ == '__main__': parser = argparse.ArgumentParser(description='List all organisms available in an Apollo instance') WAAuth(parser) parser.add_argument('email', help='User Email') args = parser.parse_args() wa = WebApolloInstance(args.apollo, args.username, args.password) try: gx_user = AssertUser(wa.users.loadUsers(email=args.email)) except Exception: returnData = wa.users.createUser(args.email, args.email, args.email, PasswordGenerator(12), role='user', addToHistory=True) gx_user = AssertUser(wa.users.loadUsers(email=args.email)) all_orgs = wa.organisms.findAllOrganisms() try: orgs = accessible_organisms(gx_user, all_orgs) except Exception: orgs = [] print(json.dumps(orgs, indent=2))
<commit_before>#!/usr/bin/env python from __future__ import print_function import argparse import json from webapollo import AssertUser, WAAuth, WebApolloInstance, accessible_organisms, PasswordGenerator if __name__ == '__main__': parser = argparse.ArgumentParser(description='List all organisms available in an Apollo instance') WAAuth(parser) parser.add_argument('email', help='User Email') args = parser.parse_args() wa = WebApolloInstance(args.apollo, args.username, args.password) try: gx_user = AssertUser(wa.users.loadUsers(email=args.email)) except Exception: returnData = wa.users.createUser(args.email, args.email, args.email, PasswordGenerator(12), role='user', addToHistory=True) gx_user = AssertUser(wa.users.loadUsers(email=args.email)) all_orgs = wa.organisms.findAllOrganisms() orgs = accessible_organisms(gx_user, all_orgs) print(json.dumps(orgs, indent=2)) <commit_msg>Add try-catch if no organism allowed<commit_after>#!/usr/bin/env python from __future__ import print_function import argparse import json from webapollo import AssertUser, WAAuth, WebApolloInstance, accessible_organisms, PasswordGenerator if __name__ == '__main__': parser = argparse.ArgumentParser(description='List all organisms available in an Apollo instance') WAAuth(parser) parser.add_argument('email', help='User Email') args = parser.parse_args() wa = WebApolloInstance(args.apollo, args.username, args.password) try: gx_user = AssertUser(wa.users.loadUsers(email=args.email)) except Exception: returnData = wa.users.createUser(args.email, args.email, args.email, PasswordGenerator(12), role='user', addToHistory=True) gx_user = AssertUser(wa.users.loadUsers(email=args.email)) all_orgs = wa.organisms.findAllOrganisms() try: orgs = accessible_organisms(gx_user, all_orgs) except Exception: orgs = [] print(json.dumps(orgs, indent=2))
dd0883aa6256e2296a1da1c3d906621483bd3707
tools/codegen/OCCI/Backends.py
tools/codegen/OCCI/Backends.py
class Backend(object): def __init__(self, plugin, params): self._plugin = plugin self._params = params self._categories = [] @property def plugin(self): return self._plugin @property def params(self): return self._params def add_category(self, category): self._categories.append(category)
class Backend(object): def __init__(self, plugin, params): self._plugin = plugin self._params = params self._categories = [] @property def plugin(self): return self._plugin @property def params(self): return self._params def add_category(self, category): self._categories.append(category)
Update parse so it doesn't return anything, just stores objects locally. Lots of tidying
Update parse so it doesn't return anything, just stores objects locally. Lots of tidying
Python
apache-2.0
compatibleone/accords-platform,compatibleone/accords-platform,compatibleone/accords-platform,compatibleone/accords-platform,compatibleone/accords-platform,compatibleone/accords-platform
class Backend(object): def __init__(self, plugin, params): self._plugin = plugin self._params = params self._categories = [] @property def plugin(self): return self._plugin @property def params(self): return self._params def add_category(self, category): self._categories.append(category) Update parse so it doesn't return anything, just stores objects locally. Lots of tidying
class Backend(object): def __init__(self, plugin, params): self._plugin = plugin self._params = params self._categories = [] @property def plugin(self): return self._plugin @property def params(self): return self._params def add_category(self, category): self._categories.append(category)
<commit_before>class Backend(object): def __init__(self, plugin, params): self._plugin = plugin self._params = params self._categories = [] @property def plugin(self): return self._plugin @property def params(self): return self._params def add_category(self, category): self._categories.append(category) <commit_msg>Update parse so it doesn't return anything, just stores objects locally. Lots of tidying<commit_after>
class Backend(object): def __init__(self, plugin, params): self._plugin = plugin self._params = params self._categories = [] @property def plugin(self): return self._plugin @property def params(self): return self._params def add_category(self, category): self._categories.append(category)
class Backend(object): def __init__(self, plugin, params): self._plugin = plugin self._params = params self._categories = [] @property def plugin(self): return self._plugin @property def params(self): return self._params def add_category(self, category): self._categories.append(category) Update parse so it doesn't return anything, just stores objects locally. Lots of tidyingclass Backend(object): def __init__(self, plugin, params): self._plugin = plugin self._params = params self._categories = [] @property def plugin(self): return self._plugin @property def params(self): return self._params def add_category(self, category): self._categories.append(category)
<commit_before>class Backend(object): def __init__(self, plugin, params): self._plugin = plugin self._params = params self._categories = [] @property def plugin(self): return self._plugin @property def params(self): return self._params def add_category(self, category): self._categories.append(category) <commit_msg>Update parse so it doesn't return anything, just stores objects locally. Lots of tidying<commit_after>class Backend(object): def __init__(self, plugin, params): self._plugin = plugin self._params = params self._categories = [] @property def plugin(self): return self._plugin @property def params(self): return self._params def add_category(self, category): self._categories.append(category)
724338c55d0af6d38a949b58a90ae200849247f4
cyinterval/test/test_interval_set.py
cyinterval/test/test_interval_set.py
from cyinterval.cyinterval import Interval, IntervalSet from nose.tools import assert_equal def test_interval_set_construction(): interval_set = IntervalSet(Interval(0.,1.), Interval(2.,3.)) assert_equal(interval_set.intervals[0], Interval(0.,1.)) assert_equal(interval_set.intervals[1], Interval(2.,3.)) if __name__ == '__main__': import sys import nose # This code will run the test in this file.' module_name = sys.modules[__name__].__file__ result = nose.run(argv=[sys.argv[0], module_name, '-s', '-v'])
from cyinterval.cyinterval import Interval, IntervalSet, FloatIntervalSet from nose.tools import assert_equal, assert_is def test_float_interval_set_construction(): interval_set = IntervalSet(Interval(0.,1.), Interval(2.,3.)) assert_equal(interval_set.intervals[0], Interval(0.,1.)) assert_equal(interval_set.intervals[1], Interval(2.,3.)) assert_is(type(interval_set), FloatIntervalSet) if __name__ == '__main__': import sys import nose # This code will run the test in this file.' module_name = sys.modules[__name__].__file__ result = nose.run(argv=[sys.argv[0], module_name, '-s', '-v'])
Test type of IntervalSet factory output
Test type of IntervalSet factory output
Python
mit
jcrudy/cyinterval
from cyinterval.cyinterval import Interval, IntervalSet from nose.tools import assert_equal def test_interval_set_construction(): interval_set = IntervalSet(Interval(0.,1.), Interval(2.,3.)) assert_equal(interval_set.intervals[0], Interval(0.,1.)) assert_equal(interval_set.intervals[1], Interval(2.,3.)) if __name__ == '__main__': import sys import nose # This code will run the test in this file.' module_name = sys.modules[__name__].__file__ result = nose.run(argv=[sys.argv[0], module_name, '-s', '-v']) Test type of IntervalSet factory output
from cyinterval.cyinterval import Interval, IntervalSet, FloatIntervalSet from nose.tools import assert_equal, assert_is def test_float_interval_set_construction(): interval_set = IntervalSet(Interval(0.,1.), Interval(2.,3.)) assert_equal(interval_set.intervals[0], Interval(0.,1.)) assert_equal(interval_set.intervals[1], Interval(2.,3.)) assert_is(type(interval_set), FloatIntervalSet) if __name__ == '__main__': import sys import nose # This code will run the test in this file.' module_name = sys.modules[__name__].__file__ result = nose.run(argv=[sys.argv[0], module_name, '-s', '-v'])
<commit_before>from cyinterval.cyinterval import Interval, IntervalSet from nose.tools import assert_equal def test_interval_set_construction(): interval_set = IntervalSet(Interval(0.,1.), Interval(2.,3.)) assert_equal(interval_set.intervals[0], Interval(0.,1.)) assert_equal(interval_set.intervals[1], Interval(2.,3.)) if __name__ == '__main__': import sys import nose # This code will run the test in this file.' module_name = sys.modules[__name__].__file__ result = nose.run(argv=[sys.argv[0], module_name, '-s', '-v']) <commit_msg>Test type of IntervalSet factory output<commit_after>
from cyinterval.cyinterval import Interval, IntervalSet, FloatIntervalSet from nose.tools import assert_equal, assert_is def test_float_interval_set_construction(): interval_set = IntervalSet(Interval(0.,1.), Interval(2.,3.)) assert_equal(interval_set.intervals[0], Interval(0.,1.)) assert_equal(interval_set.intervals[1], Interval(2.,3.)) assert_is(type(interval_set), FloatIntervalSet) if __name__ == '__main__': import sys import nose # This code will run the test in this file.' module_name = sys.modules[__name__].__file__ result = nose.run(argv=[sys.argv[0], module_name, '-s', '-v'])
from cyinterval.cyinterval import Interval, IntervalSet from nose.tools import assert_equal def test_interval_set_construction(): interval_set = IntervalSet(Interval(0.,1.), Interval(2.,3.)) assert_equal(interval_set.intervals[0], Interval(0.,1.)) assert_equal(interval_set.intervals[1], Interval(2.,3.)) if __name__ == '__main__': import sys import nose # This code will run the test in this file.' module_name = sys.modules[__name__].__file__ result = nose.run(argv=[sys.argv[0], module_name, '-s', '-v']) Test type of IntervalSet factory outputfrom cyinterval.cyinterval import Interval, IntervalSet, FloatIntervalSet from nose.tools import assert_equal, assert_is def test_float_interval_set_construction(): interval_set = IntervalSet(Interval(0.,1.), Interval(2.,3.)) assert_equal(interval_set.intervals[0], Interval(0.,1.)) assert_equal(interval_set.intervals[1], Interval(2.,3.)) assert_is(type(interval_set), FloatIntervalSet) if __name__ == '__main__': import sys import nose # This code will run the test in this file.' module_name = sys.modules[__name__].__file__ result = nose.run(argv=[sys.argv[0], module_name, '-s', '-v'])
<commit_before>from cyinterval.cyinterval import Interval, IntervalSet from nose.tools import assert_equal def test_interval_set_construction(): interval_set = IntervalSet(Interval(0.,1.), Interval(2.,3.)) assert_equal(interval_set.intervals[0], Interval(0.,1.)) assert_equal(interval_set.intervals[1], Interval(2.,3.)) if __name__ == '__main__': import sys import nose # This code will run the test in this file.' module_name = sys.modules[__name__].__file__ result = nose.run(argv=[sys.argv[0], module_name, '-s', '-v']) <commit_msg>Test type of IntervalSet factory output<commit_after>from cyinterval.cyinterval import Interval, IntervalSet, FloatIntervalSet from nose.tools import assert_equal, assert_is def test_float_interval_set_construction(): interval_set = IntervalSet(Interval(0.,1.), Interval(2.,3.)) assert_equal(interval_set.intervals[0], Interval(0.,1.)) assert_equal(interval_set.intervals[1], Interval(2.,3.)) assert_is(type(interval_set), FloatIntervalSet) if __name__ == '__main__': import sys import nose # This code will run the test in this file.' module_name = sys.modules[__name__].__file__ result = nose.run(argv=[sys.argv[0], module_name, '-s', '-v'])
eea3e63b832c4b1360ccd91f60732e65e8ead57e
geopandas/io/sql.py
geopandas/io/sql.py
import binascii from pandas import read_sql import shapely.wkb from geopandas import GeoSeries, GeoDataFrame def read_postgis(sql, con, geom_col='geom', crs=None, index_col=None, coerce_float=True, params=None): """ Returns a GeoDataFrame corresponding to the result of the query string, which must contain a geometry column. Examples: sql = "SELECT geom, kind FROM polygons;" df = geopandas.read_postgis(sql, con) Parameters ---------- sql: string con: DB connection object geom_col: string, default 'geom' column name to convert to shapely geometries crs: optional CRS to use for the returned GeoDataFrame See the documentation for pandas.read_sql for further explanation of the following parameters: index_col, coerce_float, params """ df = read_sql(sql, con, index_col=index_col, coerce_float=coerce_float, params=params) if geom_col not in df: raise ValueError("Query missing geometry column '{}'".format( geom_col)) wkb_geoms = df[geom_col] s = wkb_geoms.apply(lambda x: shapely.wkb.loads(binascii.unhexlify(x))) df[geom_col] = GeoSeries(s) return GeoDataFrame(df, crs=crs, geometry=geom_col)
import binascii from pandas import read_sql import shapely.wkb from geopandas import GeoSeries, GeoDataFrame def read_postgis(sql, con, geom_col='geom', crs=None, index_col=None, coerce_float=True, params=None): """ Returns a GeoDataFrame corresponding to the result of the query string, which must contain a geometry column. Examples: sql = "SELECT geom, kind FROM polygons;" df = geopandas.read_postgis(sql, con) Parameters ---------- sql: string con: DB connection object geom_col: string, default 'geom' column name to convert to shapely geometries crs: optional CRS to use for the returned GeoDataFrame See the documentation for pandas.read_sql for further explanation of the following parameters: index_col, coerce_float, params """ df = read_sql(sql, con, index_col=index_col, coerce_float=coerce_float, params=params) if geom_col not in df: raise ValueError("Query missing geometry column '{}'".format( geom_col)) wkb_geoms = df[geom_col] s = wkb_geoms.apply(lambda x: shapely.wkb.loads(binascii.unhexlify(x.encode()))) df[geom_col] = GeoSeries(s) return GeoDataFrame(df, crs=crs, geometry=geom_col)
Add encode() to ensure that python 3.2 gets bytes to unhexlify()
PY32: Add encode() to ensure that python 3.2 gets bytes to unhexlify()
Python
bsd-3-clause
koldunovn/geopandas,geopandas/geopandas,jdmcbr/geopandas,jorisvandenbossche/geopandas,geopandas/geopandas,ozak/geopandas,scw/geopandas,geopandas/geopandas,IamJeffG/geopandas,fonnesbeck/geopandas,jorisvandenbossche/geopandas,kwinkunks/geopandas,micahcochran/geopandas,urschrei/geopandas,ozak/geopandas,maxalbert/geopandas,perrygeo/geopandas,jorisvandenbossche/geopandas,jdmcbr/geopandas,micahcochran/geopandas,snario/geopandas
import binascii from pandas import read_sql import shapely.wkb from geopandas import GeoSeries, GeoDataFrame def read_postgis(sql, con, geom_col='geom', crs=None, index_col=None, coerce_float=True, params=None): """ Returns a GeoDataFrame corresponding to the result of the query string, which must contain a geometry column. Examples: sql = "SELECT geom, kind FROM polygons;" df = geopandas.read_postgis(sql, con) Parameters ---------- sql: string con: DB connection object geom_col: string, default 'geom' column name to convert to shapely geometries crs: optional CRS to use for the returned GeoDataFrame See the documentation for pandas.read_sql for further explanation of the following parameters: index_col, coerce_float, params """ df = read_sql(sql, con, index_col=index_col, coerce_float=coerce_float, params=params) if geom_col not in df: raise ValueError("Query missing geometry column '{}'".format( geom_col)) wkb_geoms = df[geom_col] s = wkb_geoms.apply(lambda x: shapely.wkb.loads(binascii.unhexlify(x))) df[geom_col] = GeoSeries(s) return GeoDataFrame(df, crs=crs, geometry=geom_col) PY32: Add encode() to ensure that python 3.2 gets bytes to unhexlify()
import binascii from pandas import read_sql import shapely.wkb from geopandas import GeoSeries, GeoDataFrame def read_postgis(sql, con, geom_col='geom', crs=None, index_col=None, coerce_float=True, params=None): """ Returns a GeoDataFrame corresponding to the result of the query string, which must contain a geometry column. Examples: sql = "SELECT geom, kind FROM polygons;" df = geopandas.read_postgis(sql, con) Parameters ---------- sql: string con: DB connection object geom_col: string, default 'geom' column name to convert to shapely geometries crs: optional CRS to use for the returned GeoDataFrame See the documentation for pandas.read_sql for further explanation of the following parameters: index_col, coerce_float, params """ df = read_sql(sql, con, index_col=index_col, coerce_float=coerce_float, params=params) if geom_col not in df: raise ValueError("Query missing geometry column '{}'".format( geom_col)) wkb_geoms = df[geom_col] s = wkb_geoms.apply(lambda x: shapely.wkb.loads(binascii.unhexlify(x.encode()))) df[geom_col] = GeoSeries(s) return GeoDataFrame(df, crs=crs, geometry=geom_col)
<commit_before>import binascii from pandas import read_sql import shapely.wkb from geopandas import GeoSeries, GeoDataFrame def read_postgis(sql, con, geom_col='geom', crs=None, index_col=None, coerce_float=True, params=None): """ Returns a GeoDataFrame corresponding to the result of the query string, which must contain a geometry column. Examples: sql = "SELECT geom, kind FROM polygons;" df = geopandas.read_postgis(sql, con) Parameters ---------- sql: string con: DB connection object geom_col: string, default 'geom' column name to convert to shapely geometries crs: optional CRS to use for the returned GeoDataFrame See the documentation for pandas.read_sql for further explanation of the following parameters: index_col, coerce_float, params """ df = read_sql(sql, con, index_col=index_col, coerce_float=coerce_float, params=params) if geom_col not in df: raise ValueError("Query missing geometry column '{}'".format( geom_col)) wkb_geoms = df[geom_col] s = wkb_geoms.apply(lambda x: shapely.wkb.loads(binascii.unhexlify(x))) df[geom_col] = GeoSeries(s) return GeoDataFrame(df, crs=crs, geometry=geom_col) <commit_msg>PY32: Add encode() to ensure that python 3.2 gets bytes to unhexlify()<commit_after>
import binascii from pandas import read_sql import shapely.wkb from geopandas import GeoSeries, GeoDataFrame def read_postgis(sql, con, geom_col='geom', crs=None, index_col=None, coerce_float=True, params=None): """ Returns a GeoDataFrame corresponding to the result of the query string, which must contain a geometry column. Examples: sql = "SELECT geom, kind FROM polygons;" df = geopandas.read_postgis(sql, con) Parameters ---------- sql: string con: DB connection object geom_col: string, default 'geom' column name to convert to shapely geometries crs: optional CRS to use for the returned GeoDataFrame See the documentation for pandas.read_sql for further explanation of the following parameters: index_col, coerce_float, params """ df = read_sql(sql, con, index_col=index_col, coerce_float=coerce_float, params=params) if geom_col not in df: raise ValueError("Query missing geometry column '{}'".format( geom_col)) wkb_geoms = df[geom_col] s = wkb_geoms.apply(lambda x: shapely.wkb.loads(binascii.unhexlify(x.encode()))) df[geom_col] = GeoSeries(s) return GeoDataFrame(df, crs=crs, geometry=geom_col)
import binascii from pandas import read_sql import shapely.wkb from geopandas import GeoSeries, GeoDataFrame def read_postgis(sql, con, geom_col='geom', crs=None, index_col=None, coerce_float=True, params=None): """ Returns a GeoDataFrame corresponding to the result of the query string, which must contain a geometry column. Examples: sql = "SELECT geom, kind FROM polygons;" df = geopandas.read_postgis(sql, con) Parameters ---------- sql: string con: DB connection object geom_col: string, default 'geom' column name to convert to shapely geometries crs: optional CRS to use for the returned GeoDataFrame See the documentation for pandas.read_sql for further explanation of the following parameters: index_col, coerce_float, params """ df = read_sql(sql, con, index_col=index_col, coerce_float=coerce_float, params=params) if geom_col not in df: raise ValueError("Query missing geometry column '{}'".format( geom_col)) wkb_geoms = df[geom_col] s = wkb_geoms.apply(lambda x: shapely.wkb.loads(binascii.unhexlify(x))) df[geom_col] = GeoSeries(s) return GeoDataFrame(df, crs=crs, geometry=geom_col) PY32: Add encode() to ensure that python 3.2 gets bytes to unhexlify()import binascii from pandas import read_sql import shapely.wkb from geopandas import GeoSeries, GeoDataFrame def read_postgis(sql, con, geom_col='geom', crs=None, index_col=None, coerce_float=True, params=None): """ Returns a GeoDataFrame corresponding to the result of the query string, which must contain a geometry column. Examples: sql = "SELECT geom, kind FROM polygons;" df = geopandas.read_postgis(sql, con) Parameters ---------- sql: string con: DB connection object geom_col: string, default 'geom' column name to convert to shapely geometries crs: optional CRS to use for the returned GeoDataFrame See the documentation for pandas.read_sql for further explanation of the following parameters: index_col, coerce_float, params """ df = read_sql(sql, con, index_col=index_col, coerce_float=coerce_float, params=params) if geom_col not in df: raise ValueError("Query missing geometry column '{}'".format( geom_col)) wkb_geoms = df[geom_col] s = wkb_geoms.apply(lambda x: shapely.wkb.loads(binascii.unhexlify(x.encode()))) df[geom_col] = GeoSeries(s) return GeoDataFrame(df, crs=crs, geometry=geom_col)
<commit_before>import binascii from pandas import read_sql import shapely.wkb from geopandas import GeoSeries, GeoDataFrame def read_postgis(sql, con, geom_col='geom', crs=None, index_col=None, coerce_float=True, params=None): """ Returns a GeoDataFrame corresponding to the result of the query string, which must contain a geometry column. Examples: sql = "SELECT geom, kind FROM polygons;" df = geopandas.read_postgis(sql, con) Parameters ---------- sql: string con: DB connection object geom_col: string, default 'geom' column name to convert to shapely geometries crs: optional CRS to use for the returned GeoDataFrame See the documentation for pandas.read_sql for further explanation of the following parameters: index_col, coerce_float, params """ df = read_sql(sql, con, index_col=index_col, coerce_float=coerce_float, params=params) if geom_col not in df: raise ValueError("Query missing geometry column '{}'".format( geom_col)) wkb_geoms = df[geom_col] s = wkb_geoms.apply(lambda x: shapely.wkb.loads(binascii.unhexlify(x))) df[geom_col] = GeoSeries(s) return GeoDataFrame(df, crs=crs, geometry=geom_col) <commit_msg>PY32: Add encode() to ensure that python 3.2 gets bytes to unhexlify()<commit_after>import binascii from pandas import read_sql import shapely.wkb from geopandas import GeoSeries, GeoDataFrame def read_postgis(sql, con, geom_col='geom', crs=None, index_col=None, coerce_float=True, params=None): """ Returns a GeoDataFrame corresponding to the result of the query string, which must contain a geometry column. Examples: sql = "SELECT geom, kind FROM polygons;" df = geopandas.read_postgis(sql, con) Parameters ---------- sql: string con: DB connection object geom_col: string, default 'geom' column name to convert to shapely geometries crs: optional CRS to use for the returned GeoDataFrame See the documentation for pandas.read_sql for further explanation of the following parameters: index_col, coerce_float, params """ df = read_sql(sql, con, index_col=index_col, coerce_float=coerce_float, params=params) if geom_col not in df: raise ValueError("Query missing geometry column '{}'".format( geom_col)) wkb_geoms = df[geom_col] s = wkb_geoms.apply(lambda x: shapely.wkb.loads(binascii.unhexlify(x.encode()))) df[geom_col] = GeoSeries(s) return GeoDataFrame(df, crs=crs, geometry=geom_col)
5fe7e1e1cdccd8b54d6db2a64509923d8596a5f4
test_connector/__manifest__.py
test_connector/__manifest__.py
# -*- coding: utf-8 -*- # Copyright 2017 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) {'name': 'Connector Tests', 'summary': 'Automated tests for Connector, do not install.', 'version': '10.0.1.0.0', 'author': 'Camptocamp,Odoo Community Association (OCA)', 'license': 'AGPL-3', 'category': 'Generic Modules', 'depends': ['connector', ], 'website': 'http://www.camptocamp.com', 'data': ['security/ir.model.access.csv', ], 'installable': True, }
# -*- coding: utf-8 -*- # Copyright 2017 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) {'name': 'Connector Tests', 'summary': 'Automated tests for Connector, do not install.', 'description': 'Automated tests for Connector, do not install.', 'version': '10.0.1.0.0', 'author': 'Camptocamp,Odoo Community Association (OCA)', 'license': 'AGPL-3', 'category': 'Hidden', 'depends': ['connector', ], 'website': 'https://www.camptocamp.com', 'data': ['security/ir.model.access.csv', ], 'installable': True, }
Add description in test addons to make pylint happier
Add description in test addons to make pylint happier
Python
agpl-3.0
OCA/connector,OCA/connector
# -*- coding: utf-8 -*- # Copyright 2017 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) {'name': 'Connector Tests', 'summary': 'Automated tests for Connector, do not install.', 'version': '10.0.1.0.0', 'author': 'Camptocamp,Odoo Community Association (OCA)', 'license': 'AGPL-3', 'category': 'Generic Modules', 'depends': ['connector', ], 'website': 'http://www.camptocamp.com', 'data': ['security/ir.model.access.csv', ], 'installable': True, } Add description in test addons to make pylint happier
# -*- coding: utf-8 -*- # Copyright 2017 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) {'name': 'Connector Tests', 'summary': 'Automated tests for Connector, do not install.', 'description': 'Automated tests for Connector, do not install.', 'version': '10.0.1.0.0', 'author': 'Camptocamp,Odoo Community Association (OCA)', 'license': 'AGPL-3', 'category': 'Hidden', 'depends': ['connector', ], 'website': 'https://www.camptocamp.com', 'data': ['security/ir.model.access.csv', ], 'installable': True, }
<commit_before># -*- coding: utf-8 -*- # Copyright 2017 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) {'name': 'Connector Tests', 'summary': 'Automated tests for Connector, do not install.', 'version': '10.0.1.0.0', 'author': 'Camptocamp,Odoo Community Association (OCA)', 'license': 'AGPL-3', 'category': 'Generic Modules', 'depends': ['connector', ], 'website': 'http://www.camptocamp.com', 'data': ['security/ir.model.access.csv', ], 'installable': True, } <commit_msg>Add description in test addons to make pylint happier<commit_after>
# -*- coding: utf-8 -*- # Copyright 2017 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) {'name': 'Connector Tests', 'summary': 'Automated tests for Connector, do not install.', 'description': 'Automated tests for Connector, do not install.', 'version': '10.0.1.0.0', 'author': 'Camptocamp,Odoo Community Association (OCA)', 'license': 'AGPL-3', 'category': 'Hidden', 'depends': ['connector', ], 'website': 'https://www.camptocamp.com', 'data': ['security/ir.model.access.csv', ], 'installable': True, }
# -*- coding: utf-8 -*- # Copyright 2017 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) {'name': 'Connector Tests', 'summary': 'Automated tests for Connector, do not install.', 'version': '10.0.1.0.0', 'author': 'Camptocamp,Odoo Community Association (OCA)', 'license': 'AGPL-3', 'category': 'Generic Modules', 'depends': ['connector', ], 'website': 'http://www.camptocamp.com', 'data': ['security/ir.model.access.csv', ], 'installable': True, } Add description in test addons to make pylint happier# -*- coding: utf-8 -*- # Copyright 2017 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) {'name': 'Connector Tests', 'summary': 'Automated tests for Connector, do not install.', 'description': 'Automated tests for Connector, do not install.', 'version': '10.0.1.0.0', 'author': 'Camptocamp,Odoo Community Association (OCA)', 'license': 'AGPL-3', 'category': 'Hidden', 'depends': ['connector', ], 'website': 'https://www.camptocamp.com', 'data': ['security/ir.model.access.csv', ], 'installable': True, }
<commit_before># -*- coding: utf-8 -*- # Copyright 2017 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) {'name': 'Connector Tests', 'summary': 'Automated tests for Connector, do not install.', 'version': '10.0.1.0.0', 'author': 'Camptocamp,Odoo Community Association (OCA)', 'license': 'AGPL-3', 'category': 'Generic Modules', 'depends': ['connector', ], 'website': 'http://www.camptocamp.com', 'data': ['security/ir.model.access.csv', ], 'installable': True, } <commit_msg>Add description in test addons to make pylint happier<commit_after># -*- coding: utf-8 -*- # Copyright 2017 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) {'name': 'Connector Tests', 'summary': 'Automated tests for Connector, do not install.', 'description': 'Automated tests for Connector, do not install.', 'version': '10.0.1.0.0', 'author': 'Camptocamp,Odoo Community Association (OCA)', 'license': 'AGPL-3', 'category': 'Hidden', 'depends': ['connector', ], 'website': 'https://www.camptocamp.com', 'data': ['security/ir.model.access.csv', ], 'installable': True, }
c4c726b004e500463cacc9571258dddd172d9b2c
ironic/api/acl.py
ironic/api/acl.py
# -*- encoding: utf-8 -*- # # Copyright © 2012 New Dream Network, LLC (DreamHost) # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """Access Control Lists (ACL's) control access the API server.""" from ironic.api.middleware import auth_token def install(app, conf, public_routes): """Install ACL check on application. :param app: A WSGI applicatin. :param conf: Settings. Dict'ified and passed to keystonemiddleware :param public_routes: The list of the routes which will be allowed to access without authentication. :return: The same WSGI application with ACL installed. """ return auth_token.AuthTokenMiddleware(app, conf=dict(conf), public_api_routes=public_routes)
# -*- encoding: utf-8 -*- # # Copyright © 2012 New Dream Network, LLC (DreamHost) # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """Access Control Lists (ACL's) control access the API server.""" from ironic.api.middleware import auth_token def install(app, conf, public_routes): """Install ACL check on application. :param app: A WSGI application. :param conf: Settings. Dict'ified and passed to keystonemiddleware :param public_routes: The list of the routes which will be allowed to access without authentication. :return: The same WSGI application with ACL installed. """ return auth_token.AuthTokenMiddleware(app, conf=dict(conf), public_api_routes=public_routes)
Fix misspelling from "applicatin" to "application".
Fix misspelling from "applicatin" to "application". Change-Id: I3c4e455a10deae0d719fdc8534049abf8faba954
Python
apache-2.0
bacaldwell/ironic,dims/ironic,NaohiroTamura/ironic,pshchelo/ironic,pshchelo/ironic,NaohiroTamura/ironic,ionutbalutoiu/ironic,SauloAislan/ironic,dims/ironic,bacaldwell/ironic,SauloAislan/ironic,openstack/ironic,ionutbalutoiu/ironic,openstack/ironic,devananda/ironic,hpproliant/ironic,naterh/ironic,redhat-openstack/ironic
# -*- encoding: utf-8 -*- # # Copyright © 2012 New Dream Network, LLC (DreamHost) # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """Access Control Lists (ACL's) control access the API server.""" from ironic.api.middleware import auth_token def install(app, conf, public_routes): """Install ACL check on application. :param app: A WSGI applicatin. :param conf: Settings. Dict'ified and passed to keystonemiddleware :param public_routes: The list of the routes which will be allowed to access without authentication. :return: The same WSGI application with ACL installed. """ return auth_token.AuthTokenMiddleware(app, conf=dict(conf), public_api_routes=public_routes) Fix misspelling from "applicatin" to "application". Change-Id: I3c4e455a10deae0d719fdc8534049abf8faba954
# -*- encoding: utf-8 -*- # # Copyright © 2012 New Dream Network, LLC (DreamHost) # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """Access Control Lists (ACL's) control access the API server.""" from ironic.api.middleware import auth_token def install(app, conf, public_routes): """Install ACL check on application. :param app: A WSGI application. :param conf: Settings. Dict'ified and passed to keystonemiddleware :param public_routes: The list of the routes which will be allowed to access without authentication. :return: The same WSGI application with ACL installed. """ return auth_token.AuthTokenMiddleware(app, conf=dict(conf), public_api_routes=public_routes)
<commit_before># -*- encoding: utf-8 -*- # # Copyright © 2012 New Dream Network, LLC (DreamHost) # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """Access Control Lists (ACL's) control access the API server.""" from ironic.api.middleware import auth_token def install(app, conf, public_routes): """Install ACL check on application. :param app: A WSGI applicatin. :param conf: Settings. Dict'ified and passed to keystonemiddleware :param public_routes: The list of the routes which will be allowed to access without authentication. :return: The same WSGI application with ACL installed. """ return auth_token.AuthTokenMiddleware(app, conf=dict(conf), public_api_routes=public_routes) <commit_msg>Fix misspelling from "applicatin" to "application". Change-Id: I3c4e455a10deae0d719fdc8534049abf8faba954<commit_after>
# -*- encoding: utf-8 -*- # # Copyright © 2012 New Dream Network, LLC (DreamHost) # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """Access Control Lists (ACL's) control access the API server.""" from ironic.api.middleware import auth_token def install(app, conf, public_routes): """Install ACL check on application. :param app: A WSGI application. :param conf: Settings. Dict'ified and passed to keystonemiddleware :param public_routes: The list of the routes which will be allowed to access without authentication. :return: The same WSGI application with ACL installed. """ return auth_token.AuthTokenMiddleware(app, conf=dict(conf), public_api_routes=public_routes)
# -*- encoding: utf-8 -*- # # Copyright © 2012 New Dream Network, LLC (DreamHost) # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """Access Control Lists (ACL's) control access the API server.""" from ironic.api.middleware import auth_token def install(app, conf, public_routes): """Install ACL check on application. :param app: A WSGI applicatin. :param conf: Settings. Dict'ified and passed to keystonemiddleware :param public_routes: The list of the routes which will be allowed to access without authentication. :return: The same WSGI application with ACL installed. """ return auth_token.AuthTokenMiddleware(app, conf=dict(conf), public_api_routes=public_routes) Fix misspelling from "applicatin" to "application". Change-Id: I3c4e455a10deae0d719fdc8534049abf8faba954# -*- encoding: utf-8 -*- # # Copyright © 2012 New Dream Network, LLC (DreamHost) # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """Access Control Lists (ACL's) control access the API server.""" from ironic.api.middleware import auth_token def install(app, conf, public_routes): """Install ACL check on application. :param app: A WSGI application. :param conf: Settings. Dict'ified and passed to keystonemiddleware :param public_routes: The list of the routes which will be allowed to access without authentication. :return: The same WSGI application with ACL installed. """ return auth_token.AuthTokenMiddleware(app, conf=dict(conf), public_api_routes=public_routes)
<commit_before># -*- encoding: utf-8 -*- # # Copyright © 2012 New Dream Network, LLC (DreamHost) # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """Access Control Lists (ACL's) control access the API server.""" from ironic.api.middleware import auth_token def install(app, conf, public_routes): """Install ACL check on application. :param app: A WSGI applicatin. :param conf: Settings. Dict'ified and passed to keystonemiddleware :param public_routes: The list of the routes which will be allowed to access without authentication. :return: The same WSGI application with ACL installed. """ return auth_token.AuthTokenMiddleware(app, conf=dict(conf), public_api_routes=public_routes) <commit_msg>Fix misspelling from "applicatin" to "application". Change-Id: I3c4e455a10deae0d719fdc8534049abf8faba954<commit_after># -*- encoding: utf-8 -*- # # Copyright © 2012 New Dream Network, LLC (DreamHost) # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """Access Control Lists (ACL's) control access the API server.""" from ironic.api.middleware import auth_token def install(app, conf, public_routes): """Install ACL check on application. :param app: A WSGI application. :param conf: Settings. Dict'ified and passed to keystonemiddleware :param public_routes: The list of the routes which will be allowed to access without authentication. :return: The same WSGI application with ACL installed. """ return auth_token.AuthTokenMiddleware(app, conf=dict(conf), public_api_routes=public_routes)
a21a4f46c79f6531f2a305f58dacce12f46d27fb
tests/languages/docker_test.py
tests/languages/docker_test.py
from __future__ import absolute_import from __future__ import unicode_literals import mock from pre_commit.languages import docker from pre_commit.util import CalledProcessError def test_docker_is_running_process_error(): with mock.patch( 'pre_commit.languages.docker.cmd_output', side_effect=CalledProcessError(*(None,) * 4), ): assert docker.docker_is_running() is False def test_docker_fallback_uid(): def invalid_attribute(): raise AttributeError with mock.patch('os.getuid', invalid_attribute): assert docker.getuid() == docker.FALLBACK_UID def test_docker_fallback_gid(): def invalid_attribute(): raise AttributeError with mock.patch('os.getgid', invalid_attribute): assert docker.getgid() == docker.FALLBACK_GID
from __future__ import absolute_import from __future__ import unicode_literals import mock from pre_commit.languages import docker from pre_commit.util import CalledProcessError def test_docker_is_running_process_error(): with mock.patch( 'pre_commit.languages.docker.cmd_output', side_effect=CalledProcessError(*(None,) * 4), ): assert docker.docker_is_running() is False def test_docker_fallback_uid(): def invalid_attribute(): raise AttributeError with mock.patch('os.getuid', invalid_attribute, create=True): assert docker.getuid() == docker.FALLBACK_UID def test_docker_fallback_gid(): def invalid_attribute(): raise AttributeError with mock.patch('os.getgid', invalid_attribute, create=True): assert docker.getgid() == docker.FALLBACK_GID
Fix missing create=True attribute in docker tests
Fix missing create=True attribute in docker tests
Python
mit
pre-commit/pre-commit,pre-commit/pre-commit,pre-commit/pre-commit,pre-commit/pre-commit,pre-commit/pre-commit,pre-commit/pre-commit,pre-commit/pre-commit,pre-commit/pre-commit,pre-commit/pre-commit,pre-commit/pre-commit,pre-commit/pre-commit
from __future__ import absolute_import from __future__ import unicode_literals import mock from pre_commit.languages import docker from pre_commit.util import CalledProcessError def test_docker_is_running_process_error(): with mock.patch( 'pre_commit.languages.docker.cmd_output', side_effect=CalledProcessError(*(None,) * 4), ): assert docker.docker_is_running() is False def test_docker_fallback_uid(): def invalid_attribute(): raise AttributeError with mock.patch('os.getuid', invalid_attribute): assert docker.getuid() == docker.FALLBACK_UID def test_docker_fallback_gid(): def invalid_attribute(): raise AttributeError with mock.patch('os.getgid', invalid_attribute): assert docker.getgid() == docker.FALLBACK_GID Fix missing create=True attribute in docker tests
from __future__ import absolute_import from __future__ import unicode_literals import mock from pre_commit.languages import docker from pre_commit.util import CalledProcessError def test_docker_is_running_process_error(): with mock.patch( 'pre_commit.languages.docker.cmd_output', side_effect=CalledProcessError(*(None,) * 4), ): assert docker.docker_is_running() is False def test_docker_fallback_uid(): def invalid_attribute(): raise AttributeError with mock.patch('os.getuid', invalid_attribute, create=True): assert docker.getuid() == docker.FALLBACK_UID def test_docker_fallback_gid(): def invalid_attribute(): raise AttributeError with mock.patch('os.getgid', invalid_attribute, create=True): assert docker.getgid() == docker.FALLBACK_GID
<commit_before>from __future__ import absolute_import from __future__ import unicode_literals import mock from pre_commit.languages import docker from pre_commit.util import CalledProcessError def test_docker_is_running_process_error(): with mock.patch( 'pre_commit.languages.docker.cmd_output', side_effect=CalledProcessError(*(None,) * 4), ): assert docker.docker_is_running() is False def test_docker_fallback_uid(): def invalid_attribute(): raise AttributeError with mock.patch('os.getuid', invalid_attribute): assert docker.getuid() == docker.FALLBACK_UID def test_docker_fallback_gid(): def invalid_attribute(): raise AttributeError with mock.patch('os.getgid', invalid_attribute): assert docker.getgid() == docker.FALLBACK_GID <commit_msg>Fix missing create=True attribute in docker tests<commit_after>
from __future__ import absolute_import from __future__ import unicode_literals import mock from pre_commit.languages import docker from pre_commit.util import CalledProcessError def test_docker_is_running_process_error(): with mock.patch( 'pre_commit.languages.docker.cmd_output', side_effect=CalledProcessError(*(None,) * 4), ): assert docker.docker_is_running() is False def test_docker_fallback_uid(): def invalid_attribute(): raise AttributeError with mock.patch('os.getuid', invalid_attribute, create=True): assert docker.getuid() == docker.FALLBACK_UID def test_docker_fallback_gid(): def invalid_attribute(): raise AttributeError with mock.patch('os.getgid', invalid_attribute, create=True): assert docker.getgid() == docker.FALLBACK_GID
from __future__ import absolute_import from __future__ import unicode_literals import mock from pre_commit.languages import docker from pre_commit.util import CalledProcessError def test_docker_is_running_process_error(): with mock.patch( 'pre_commit.languages.docker.cmd_output', side_effect=CalledProcessError(*(None,) * 4), ): assert docker.docker_is_running() is False def test_docker_fallback_uid(): def invalid_attribute(): raise AttributeError with mock.patch('os.getuid', invalid_attribute): assert docker.getuid() == docker.FALLBACK_UID def test_docker_fallback_gid(): def invalid_attribute(): raise AttributeError with mock.patch('os.getgid', invalid_attribute): assert docker.getgid() == docker.FALLBACK_GID Fix missing create=True attribute in docker testsfrom __future__ import absolute_import from __future__ import unicode_literals import mock from pre_commit.languages import docker from pre_commit.util import CalledProcessError def test_docker_is_running_process_error(): with mock.patch( 'pre_commit.languages.docker.cmd_output', side_effect=CalledProcessError(*(None,) * 4), ): assert docker.docker_is_running() is False def test_docker_fallback_uid(): def invalid_attribute(): raise AttributeError with mock.patch('os.getuid', invalid_attribute, create=True): assert docker.getuid() == docker.FALLBACK_UID def test_docker_fallback_gid(): def invalid_attribute(): raise AttributeError with mock.patch('os.getgid', invalid_attribute, create=True): assert docker.getgid() == docker.FALLBACK_GID
<commit_before>from __future__ import absolute_import from __future__ import unicode_literals import mock from pre_commit.languages import docker from pre_commit.util import CalledProcessError def test_docker_is_running_process_error(): with mock.patch( 'pre_commit.languages.docker.cmd_output', side_effect=CalledProcessError(*(None,) * 4), ): assert docker.docker_is_running() is False def test_docker_fallback_uid(): def invalid_attribute(): raise AttributeError with mock.patch('os.getuid', invalid_attribute): assert docker.getuid() == docker.FALLBACK_UID def test_docker_fallback_gid(): def invalid_attribute(): raise AttributeError with mock.patch('os.getgid', invalid_attribute): assert docker.getgid() == docker.FALLBACK_GID <commit_msg>Fix missing create=True attribute in docker tests<commit_after>from __future__ import absolute_import from __future__ import unicode_literals import mock from pre_commit.languages import docker from pre_commit.util import CalledProcessError def test_docker_is_running_process_error(): with mock.patch( 'pre_commit.languages.docker.cmd_output', side_effect=CalledProcessError(*(None,) * 4), ): assert docker.docker_is_running() is False def test_docker_fallback_uid(): def invalid_attribute(): raise AttributeError with mock.patch('os.getuid', invalid_attribute, create=True): assert docker.getuid() == docker.FALLBACK_UID def test_docker_fallback_gid(): def invalid_attribute(): raise AttributeError with mock.patch('os.getgid', invalid_attribute, create=True): assert docker.getgid() == docker.FALLBACK_GID
179c81952a4ce223d1db5b42676649b42972b8a6
setup.py
setup.py
from setuptools import setup, find_packages __author__ = "James King" __email__ = "james@agentultra.com" __version__ = "0.1.1" __license__ = "MIT" __description__ = """ A library of grids and other fine amusements. Contains a Grid and Grid-like data structures and optional modules for rendering them with pygame, creating cellular-automata simulations, games, and such things. """ setup( name="Horton", version=__version__, packages=find_packages(), install_requires = [ "sphinx_bootstrap_theme", # for docs ], extras_require = { 'pygame': ["pygame"], }, author=__author__, author_email=__email__, license=__license__, description=__description__, classifiers=[ "Development Status :: 3 - Alpha", "Inteded Audience :: Developers", "License :: OSI Approved :: MIT License", "Topic :: Artistic Software", "Topic :: Games/Entertainment", "Topic :: Software Development :: Libraries", ] )
from setuptools import setup, find_packages __author__ = "James King" __email__ = "james@agentultra.com" __version__ = "0.1.1" __license__ = "MIT" __description__ = """ A library of grids and other fine amusements. Contains a Grid and Grid-like data structures and optional modules for rendering them with pygame, creating cellular-automata simulations, games, and such things. """ setup( name="Horton", version=__version__, packages=find_packages(), install_requires = [ "sphinx_bootstrap_theme", # for docs ], extras_require = { 'pygame': ["pygame"], }, author=__author__, author_email=__email__, license=__license__, description=__description__, classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Topic :: Artistic Software", "Topic :: Games/Entertainment", "Topic :: Software Development :: Libraries", ] )
Fix typo in trove classifiers
Fix typo in trove classifiers
Python
mit
agentultra/Horton,agentultra/Horton
from setuptools import setup, find_packages __author__ = "James King" __email__ = "james@agentultra.com" __version__ = "0.1.1" __license__ = "MIT" __description__ = """ A library of grids and other fine amusements. Contains a Grid and Grid-like data structures and optional modules for rendering them with pygame, creating cellular-automata simulations, games, and such things. """ setup( name="Horton", version=__version__, packages=find_packages(), install_requires = [ "sphinx_bootstrap_theme", # for docs ], extras_require = { 'pygame': ["pygame"], }, author=__author__, author_email=__email__, license=__license__, description=__description__, classifiers=[ "Development Status :: 3 - Alpha", "Inteded Audience :: Developers", "License :: OSI Approved :: MIT License", "Topic :: Artistic Software", "Topic :: Games/Entertainment", "Topic :: Software Development :: Libraries", ] ) Fix typo in trove classifiers
from setuptools import setup, find_packages __author__ = "James King" __email__ = "james@agentultra.com" __version__ = "0.1.1" __license__ = "MIT" __description__ = """ A library of grids and other fine amusements. Contains a Grid and Grid-like data structures and optional modules for rendering them with pygame, creating cellular-automata simulations, games, and such things. """ setup( name="Horton", version=__version__, packages=find_packages(), install_requires = [ "sphinx_bootstrap_theme", # for docs ], extras_require = { 'pygame': ["pygame"], }, author=__author__, author_email=__email__, license=__license__, description=__description__, classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Topic :: Artistic Software", "Topic :: Games/Entertainment", "Topic :: Software Development :: Libraries", ] )
<commit_before>from setuptools import setup, find_packages __author__ = "James King" __email__ = "james@agentultra.com" __version__ = "0.1.1" __license__ = "MIT" __description__ = """ A library of grids and other fine amusements. Contains a Grid and Grid-like data structures and optional modules for rendering them with pygame, creating cellular-automata simulations, games, and such things. """ setup( name="Horton", version=__version__, packages=find_packages(), install_requires = [ "sphinx_bootstrap_theme", # for docs ], extras_require = { 'pygame': ["pygame"], }, author=__author__, author_email=__email__, license=__license__, description=__description__, classifiers=[ "Development Status :: 3 - Alpha", "Inteded Audience :: Developers", "License :: OSI Approved :: MIT License", "Topic :: Artistic Software", "Topic :: Games/Entertainment", "Topic :: Software Development :: Libraries", ] ) <commit_msg>Fix typo in trove classifiers<commit_after>
from setuptools import setup, find_packages __author__ = "James King" __email__ = "james@agentultra.com" __version__ = "0.1.1" __license__ = "MIT" __description__ = """ A library of grids and other fine amusements. Contains a Grid and Grid-like data structures and optional modules for rendering them with pygame, creating cellular-automata simulations, games, and such things. """ setup( name="Horton", version=__version__, packages=find_packages(), install_requires = [ "sphinx_bootstrap_theme", # for docs ], extras_require = { 'pygame': ["pygame"], }, author=__author__, author_email=__email__, license=__license__, description=__description__, classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Topic :: Artistic Software", "Topic :: Games/Entertainment", "Topic :: Software Development :: Libraries", ] )
from setuptools import setup, find_packages __author__ = "James King" __email__ = "james@agentultra.com" __version__ = "0.1.1" __license__ = "MIT" __description__ = """ A library of grids and other fine amusements. Contains a Grid and Grid-like data structures and optional modules for rendering them with pygame, creating cellular-automata simulations, games, and such things. """ setup( name="Horton", version=__version__, packages=find_packages(), install_requires = [ "sphinx_bootstrap_theme", # for docs ], extras_require = { 'pygame': ["pygame"], }, author=__author__, author_email=__email__, license=__license__, description=__description__, classifiers=[ "Development Status :: 3 - Alpha", "Inteded Audience :: Developers", "License :: OSI Approved :: MIT License", "Topic :: Artistic Software", "Topic :: Games/Entertainment", "Topic :: Software Development :: Libraries", ] ) Fix typo in trove classifiersfrom setuptools import setup, find_packages __author__ = "James King" __email__ = "james@agentultra.com" __version__ = "0.1.1" __license__ = "MIT" __description__ = """ A library of grids and other fine amusements. Contains a Grid and Grid-like data structures and optional modules for rendering them with pygame, creating cellular-automata simulations, games, and such things. """ setup( name="Horton", version=__version__, packages=find_packages(), install_requires = [ "sphinx_bootstrap_theme", # for docs ], extras_require = { 'pygame': ["pygame"], }, author=__author__, author_email=__email__, license=__license__, description=__description__, classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Topic :: Artistic Software", "Topic :: Games/Entertainment", "Topic :: Software Development :: Libraries", ] )
<commit_before>from setuptools import setup, find_packages __author__ = "James King" __email__ = "james@agentultra.com" __version__ = "0.1.1" __license__ = "MIT" __description__ = """ A library of grids and other fine amusements. Contains a Grid and Grid-like data structures and optional modules for rendering them with pygame, creating cellular-automata simulations, games, and such things. """ setup( name="Horton", version=__version__, packages=find_packages(), install_requires = [ "sphinx_bootstrap_theme", # for docs ], extras_require = { 'pygame': ["pygame"], }, author=__author__, author_email=__email__, license=__license__, description=__description__, classifiers=[ "Development Status :: 3 - Alpha", "Inteded Audience :: Developers", "License :: OSI Approved :: MIT License", "Topic :: Artistic Software", "Topic :: Games/Entertainment", "Topic :: Software Development :: Libraries", ] ) <commit_msg>Fix typo in trove classifiers<commit_after>from setuptools import setup, find_packages __author__ = "James King" __email__ = "james@agentultra.com" __version__ = "0.1.1" __license__ = "MIT" __description__ = """ A library of grids and other fine amusements. Contains a Grid and Grid-like data structures and optional modules for rendering them with pygame, creating cellular-automata simulations, games, and such things. """ setup( name="Horton", version=__version__, packages=find_packages(), install_requires = [ "sphinx_bootstrap_theme", # for docs ], extras_require = { 'pygame': ["pygame"], }, author=__author__, author_email=__email__, license=__license__, description=__description__, classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Topic :: Artistic Software", "Topic :: Games/Entertainment", "Topic :: Software Development :: Libraries", ] )
6d645d5b58043d0668721727bbfdcc7ee021b504
rwt/tests/test_scripts.py
rwt/tests/test_scripts.py
import textwrap import sys import subprocess def test_pkg_imported(tmpdir): """ Create a script that loads cython and ensure it runs. """ body = textwrap.dedent(""" import cython print("Successfully imported cython") """).lstrip() script_file = tmpdir / 'script' script_file.write_text(body, 'utf-8') pip_args = ['cython'] cmd = [sys.executable, '-m', 'rwt'] + pip_args + ['--', str(script_file)] out = subprocess.check_output(cmd, universal_newlines=True) assert 'Successfully imported cython' in out
from __future__ import unicode_literals import textwrap import sys import subprocess def test_pkg_imported(tmpdir): """ Create a script that loads cython and ensure it runs. """ body = textwrap.dedent(""" import cython print("Successfully imported cython") """).lstrip() script_file = tmpdir / 'script' script_file.write_text(body, 'utf-8') pip_args = ['cython'] cmd = [sys.executable, '-m', 'rwt'] + pip_args + ['--', str(script_file)] out = subprocess.check_output(cmd, universal_newlines=True) assert 'Successfully imported cython' in out
Add support for Python 2.7
Add support for Python 2.7
Python
mit
jaraco/rwt
import textwrap import sys import subprocess def test_pkg_imported(tmpdir): """ Create a script that loads cython and ensure it runs. """ body = textwrap.dedent(""" import cython print("Successfully imported cython") """).lstrip() script_file = tmpdir / 'script' script_file.write_text(body, 'utf-8') pip_args = ['cython'] cmd = [sys.executable, '-m', 'rwt'] + pip_args + ['--', str(script_file)] out = subprocess.check_output(cmd, universal_newlines=True) assert 'Successfully imported cython' in out Add support for Python 2.7
from __future__ import unicode_literals import textwrap import sys import subprocess def test_pkg_imported(tmpdir): """ Create a script that loads cython and ensure it runs. """ body = textwrap.dedent(""" import cython print("Successfully imported cython") """).lstrip() script_file = tmpdir / 'script' script_file.write_text(body, 'utf-8') pip_args = ['cython'] cmd = [sys.executable, '-m', 'rwt'] + pip_args + ['--', str(script_file)] out = subprocess.check_output(cmd, universal_newlines=True) assert 'Successfully imported cython' in out
<commit_before>import textwrap import sys import subprocess def test_pkg_imported(tmpdir): """ Create a script that loads cython and ensure it runs. """ body = textwrap.dedent(""" import cython print("Successfully imported cython") """).lstrip() script_file = tmpdir / 'script' script_file.write_text(body, 'utf-8') pip_args = ['cython'] cmd = [sys.executable, '-m', 'rwt'] + pip_args + ['--', str(script_file)] out = subprocess.check_output(cmd, universal_newlines=True) assert 'Successfully imported cython' in out <commit_msg>Add support for Python 2.7<commit_after>
from __future__ import unicode_literals import textwrap import sys import subprocess def test_pkg_imported(tmpdir): """ Create a script that loads cython and ensure it runs. """ body = textwrap.dedent(""" import cython print("Successfully imported cython") """).lstrip() script_file = tmpdir / 'script' script_file.write_text(body, 'utf-8') pip_args = ['cython'] cmd = [sys.executable, '-m', 'rwt'] + pip_args + ['--', str(script_file)] out = subprocess.check_output(cmd, universal_newlines=True) assert 'Successfully imported cython' in out
import textwrap import sys import subprocess def test_pkg_imported(tmpdir): """ Create a script that loads cython and ensure it runs. """ body = textwrap.dedent(""" import cython print("Successfully imported cython") """).lstrip() script_file = tmpdir / 'script' script_file.write_text(body, 'utf-8') pip_args = ['cython'] cmd = [sys.executable, '-m', 'rwt'] + pip_args + ['--', str(script_file)] out = subprocess.check_output(cmd, universal_newlines=True) assert 'Successfully imported cython' in out Add support for Python 2.7from __future__ import unicode_literals import textwrap import sys import subprocess def test_pkg_imported(tmpdir): """ Create a script that loads cython and ensure it runs. """ body = textwrap.dedent(""" import cython print("Successfully imported cython") """).lstrip() script_file = tmpdir / 'script' script_file.write_text(body, 'utf-8') pip_args = ['cython'] cmd = [sys.executable, '-m', 'rwt'] + pip_args + ['--', str(script_file)] out = subprocess.check_output(cmd, universal_newlines=True) assert 'Successfully imported cython' in out
<commit_before>import textwrap import sys import subprocess def test_pkg_imported(tmpdir): """ Create a script that loads cython and ensure it runs. """ body = textwrap.dedent(""" import cython print("Successfully imported cython") """).lstrip() script_file = tmpdir / 'script' script_file.write_text(body, 'utf-8') pip_args = ['cython'] cmd = [sys.executable, '-m', 'rwt'] + pip_args + ['--', str(script_file)] out = subprocess.check_output(cmd, universal_newlines=True) assert 'Successfully imported cython' in out <commit_msg>Add support for Python 2.7<commit_after>from __future__ import unicode_literals import textwrap import sys import subprocess def test_pkg_imported(tmpdir): """ Create a script that loads cython and ensure it runs. """ body = textwrap.dedent(""" import cython print("Successfully imported cython") """).lstrip() script_file = tmpdir / 'script' script_file.write_text(body, 'utf-8') pip_args = ['cython'] cmd = [sys.executable, '-m', 'rwt'] + pip_args + ['--', str(script_file)] out = subprocess.check_output(cmd, universal_newlines=True) assert 'Successfully imported cython' in out
822f62de129e08df7ff6802b18d531b15b33fec7
setup.py
setup.py
from setuptools import setup, find_packages setup( name='panoptes_client', url='https://github.com/zooniverse/panoptes-python-client', author='Adam McMaster', author_email='adam@zooniverse.org', version='1.3.0', packages=find_packages(), include_package_data=True, install_requires=[ 'requests>=2.4.2,<2.25', 'future>=0.16,<0.19', 'python-magic>=0.4,<0.5', 'redo>=1.7', 'six>=1.9', ], extras_require={ 'testing': [ 'mock>=2.0,<4.1', ], 'docs': [ 'sphinx', ], ':python_version == "2.7"': ['futures'], } )
from setuptools import setup, find_packages setup( name='panoptes_client', url='https://github.com/zooniverse/panoptes-python-client', author='Adam McMaster', author_email='adam@zooniverse.org', version='1.3.0', packages=find_packages(), include_package_data=True, install_requires=[ 'requests>=2.4.2,<2.26', 'future>=0.16,<0.19', 'python-magic>=0.4,<0.5', 'redo>=1.7', 'six>=1.9', ], extras_require={ 'testing': [ 'mock>=2.0,<4.1', ], 'docs': [ 'sphinx', ], ':python_version == "2.7"': ['futures'], } )
Update requests requirement from <2.25,>=2.4.2 to >=2.4.2,<2.26
Update requests requirement from <2.25,>=2.4.2 to >=2.4.2,<2.26 Updates the requirements on [requests](https://github.com/psf/requests) to permit the latest version. - [Release notes](https://github.com/psf/requests/releases) - [Changelog](https://github.com/psf/requests/blob/master/HISTORY.md) - [Commits](https://github.com/psf/requests/compare/v2.4.2...v2.25.0) Signed-off-by: dependabot-preview[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com>
Python
apache-2.0
zooniverse/panoptes-python-client
from setuptools import setup, find_packages setup( name='panoptes_client', url='https://github.com/zooniverse/panoptes-python-client', author='Adam McMaster', author_email='adam@zooniverse.org', version='1.3.0', packages=find_packages(), include_package_data=True, install_requires=[ 'requests>=2.4.2,<2.25', 'future>=0.16,<0.19', 'python-magic>=0.4,<0.5', 'redo>=1.7', 'six>=1.9', ], extras_require={ 'testing': [ 'mock>=2.0,<4.1', ], 'docs': [ 'sphinx', ], ':python_version == "2.7"': ['futures'], } ) Update requests requirement from <2.25,>=2.4.2 to >=2.4.2,<2.26 Updates the requirements on [requests](https://github.com/psf/requests) to permit the latest version. - [Release notes](https://github.com/psf/requests/releases) - [Changelog](https://github.com/psf/requests/blob/master/HISTORY.md) - [Commits](https://github.com/psf/requests/compare/v2.4.2...v2.25.0) Signed-off-by: dependabot-preview[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com>
from setuptools import setup, find_packages setup( name='panoptes_client', url='https://github.com/zooniverse/panoptes-python-client', author='Adam McMaster', author_email='adam@zooniverse.org', version='1.3.0', packages=find_packages(), include_package_data=True, install_requires=[ 'requests>=2.4.2,<2.26', 'future>=0.16,<0.19', 'python-magic>=0.4,<0.5', 'redo>=1.7', 'six>=1.9', ], extras_require={ 'testing': [ 'mock>=2.0,<4.1', ], 'docs': [ 'sphinx', ], ':python_version == "2.7"': ['futures'], } )
<commit_before>from setuptools import setup, find_packages setup( name='panoptes_client', url='https://github.com/zooniverse/panoptes-python-client', author='Adam McMaster', author_email='adam@zooniverse.org', version='1.3.0', packages=find_packages(), include_package_data=True, install_requires=[ 'requests>=2.4.2,<2.25', 'future>=0.16,<0.19', 'python-magic>=0.4,<0.5', 'redo>=1.7', 'six>=1.9', ], extras_require={ 'testing': [ 'mock>=2.0,<4.1', ], 'docs': [ 'sphinx', ], ':python_version == "2.7"': ['futures'], } ) <commit_msg>Update requests requirement from <2.25,>=2.4.2 to >=2.4.2,<2.26 Updates the requirements on [requests](https://github.com/psf/requests) to permit the latest version. - [Release notes](https://github.com/psf/requests/releases) - [Changelog](https://github.com/psf/requests/blob/master/HISTORY.md) - [Commits](https://github.com/psf/requests/compare/v2.4.2...v2.25.0) Signed-off-by: dependabot-preview[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com><commit_after>
from setuptools import setup, find_packages setup( name='panoptes_client', url='https://github.com/zooniverse/panoptes-python-client', author='Adam McMaster', author_email='adam@zooniverse.org', version='1.3.0', packages=find_packages(), include_package_data=True, install_requires=[ 'requests>=2.4.2,<2.26', 'future>=0.16,<0.19', 'python-magic>=0.4,<0.5', 'redo>=1.7', 'six>=1.9', ], extras_require={ 'testing': [ 'mock>=2.0,<4.1', ], 'docs': [ 'sphinx', ], ':python_version == "2.7"': ['futures'], } )
from setuptools import setup, find_packages setup( name='panoptes_client', url='https://github.com/zooniverse/panoptes-python-client', author='Adam McMaster', author_email='adam@zooniverse.org', version='1.3.0', packages=find_packages(), include_package_data=True, install_requires=[ 'requests>=2.4.2,<2.25', 'future>=0.16,<0.19', 'python-magic>=0.4,<0.5', 'redo>=1.7', 'six>=1.9', ], extras_require={ 'testing': [ 'mock>=2.0,<4.1', ], 'docs': [ 'sphinx', ], ':python_version == "2.7"': ['futures'], } ) Update requests requirement from <2.25,>=2.4.2 to >=2.4.2,<2.26 Updates the requirements on [requests](https://github.com/psf/requests) to permit the latest version. - [Release notes](https://github.com/psf/requests/releases) - [Changelog](https://github.com/psf/requests/blob/master/HISTORY.md) - [Commits](https://github.com/psf/requests/compare/v2.4.2...v2.25.0) Signed-off-by: dependabot-preview[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com>from setuptools import setup, find_packages setup( name='panoptes_client', url='https://github.com/zooniverse/panoptes-python-client', author='Adam McMaster', author_email='adam@zooniverse.org', version='1.3.0', packages=find_packages(), include_package_data=True, install_requires=[ 'requests>=2.4.2,<2.26', 'future>=0.16,<0.19', 'python-magic>=0.4,<0.5', 'redo>=1.7', 'six>=1.9', ], extras_require={ 'testing': [ 'mock>=2.0,<4.1', ], 'docs': [ 'sphinx', ], ':python_version == "2.7"': ['futures'], } )
<commit_before>from setuptools import setup, find_packages setup( name='panoptes_client', url='https://github.com/zooniverse/panoptes-python-client', author='Adam McMaster', author_email='adam@zooniverse.org', version='1.3.0', packages=find_packages(), include_package_data=True, install_requires=[ 'requests>=2.4.2,<2.25', 'future>=0.16,<0.19', 'python-magic>=0.4,<0.5', 'redo>=1.7', 'six>=1.9', ], extras_require={ 'testing': [ 'mock>=2.0,<4.1', ], 'docs': [ 'sphinx', ], ':python_version == "2.7"': ['futures'], } ) <commit_msg>Update requests requirement from <2.25,>=2.4.2 to >=2.4.2,<2.26 Updates the requirements on [requests](https://github.com/psf/requests) to permit the latest version. - [Release notes](https://github.com/psf/requests/releases) - [Changelog](https://github.com/psf/requests/blob/master/HISTORY.md) - [Commits](https://github.com/psf/requests/compare/v2.4.2...v2.25.0) Signed-off-by: dependabot-preview[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com><commit_after>from setuptools import setup, find_packages setup( name='panoptes_client', url='https://github.com/zooniverse/panoptes-python-client', author='Adam McMaster', author_email='adam@zooniverse.org', version='1.3.0', packages=find_packages(), include_package_data=True, install_requires=[ 'requests>=2.4.2,<2.26', 'future>=0.16,<0.19', 'python-magic>=0.4,<0.5', 'redo>=1.7', 'six>=1.9', ], extras_require={ 'testing': [ 'mock>=2.0,<4.1', ], 'docs': [ 'sphinx', ], ':python_version == "2.7"': ['futures'], } )
eabce27a7fc80a944a9d85ce43649125991116fb
setup.py
setup.py
from setuptools import setup, find_packages setup( name = "biofloat", version = "0.3.1", packages = find_packages(), requires = ['Python (>=2.7)'], install_requires = [ 'beautifulsoup4>=4.4', 'coverage>=4', 'geopandas>=0.1.1', 'jupyter>=1.0.0', 'matplotlib', 'numpy>=1.10', 'pandas>=0.17', 'Pydap', 'requests>=2.8', 'seawater>=3.3', 'simpletable>=0.2', 'statsmodels>=0.6.1', 'xray>=0.6' ], scripts = ['scripts/load_biofloat_cache.py', 'scripts/woa_calibration.py'], # metadata for upload to PyPI author = "Mike McCann", author_email = "mccann@mbari.org", description = "Software for working with data from Bio-Argo floats", license = "MIT", keywords = "Oceanography Argo Bio-Argo drifting buoys floats", url = "https://github.com/biofloat/biofloat", )
from setuptools import setup, find_packages setup( name = "biofloat", version = "0.3.2", packages = find_packages(), requires = ['Python (>=2.7)'], install_requires = [ 'beautifulsoup4>=4.4', 'coverage>=4', 'jupyter>=1.0.0', 'matplotlib', 'numpy>=1.10', 'pandas>=0.17', 'Pydap', 'requests>=2.8', 'seawater>=3.3', 'simpletable>=0.2', 'statsmodels>=0.6.1', 'xray>=0.6' ], scripts = ['scripts/load_biofloat_cache.py', 'scripts/woa_calibration.py'], # metadata for upload to PyPI author = "Mike McCann", author_email = "mccann@mbari.org", description = "Software for working with data from Bio-Argo floats", license = "MIT", keywords = "Oceanography Argo Bio-Argo drifting buoys floats", url = "https://github.com/biofloat/biofloat", )
Remove geopandas - installing geos.dll and gdal is too painful on Windows/Anaconda
Remove geopandas - installing geos.dll and gdal is too painful on Windows/Anaconda
Python
mit
MBARIMike/biofloat,biofloat/biofloat,MBARIMike/biofloat,biofloat/biofloat
from setuptools import setup, find_packages setup( name = "biofloat", version = "0.3.1", packages = find_packages(), requires = ['Python (>=2.7)'], install_requires = [ 'beautifulsoup4>=4.4', 'coverage>=4', 'geopandas>=0.1.1', 'jupyter>=1.0.0', 'matplotlib', 'numpy>=1.10', 'pandas>=0.17', 'Pydap', 'requests>=2.8', 'seawater>=3.3', 'simpletable>=0.2', 'statsmodels>=0.6.1', 'xray>=0.6' ], scripts = ['scripts/load_biofloat_cache.py', 'scripts/woa_calibration.py'], # metadata for upload to PyPI author = "Mike McCann", author_email = "mccann@mbari.org", description = "Software for working with data from Bio-Argo floats", license = "MIT", keywords = "Oceanography Argo Bio-Argo drifting buoys floats", url = "https://github.com/biofloat/biofloat", ) Remove geopandas - installing geos.dll and gdal is too painful on Windows/Anaconda
from setuptools import setup, find_packages setup( name = "biofloat", version = "0.3.2", packages = find_packages(), requires = ['Python (>=2.7)'], install_requires = [ 'beautifulsoup4>=4.4', 'coverage>=4', 'jupyter>=1.0.0', 'matplotlib', 'numpy>=1.10', 'pandas>=0.17', 'Pydap', 'requests>=2.8', 'seawater>=3.3', 'simpletable>=0.2', 'statsmodels>=0.6.1', 'xray>=0.6' ], scripts = ['scripts/load_biofloat_cache.py', 'scripts/woa_calibration.py'], # metadata for upload to PyPI author = "Mike McCann", author_email = "mccann@mbari.org", description = "Software for working with data from Bio-Argo floats", license = "MIT", keywords = "Oceanography Argo Bio-Argo drifting buoys floats", url = "https://github.com/biofloat/biofloat", )
<commit_before>from setuptools import setup, find_packages setup( name = "biofloat", version = "0.3.1", packages = find_packages(), requires = ['Python (>=2.7)'], install_requires = [ 'beautifulsoup4>=4.4', 'coverage>=4', 'geopandas>=0.1.1', 'jupyter>=1.0.0', 'matplotlib', 'numpy>=1.10', 'pandas>=0.17', 'Pydap', 'requests>=2.8', 'seawater>=3.3', 'simpletable>=0.2', 'statsmodels>=0.6.1', 'xray>=0.6' ], scripts = ['scripts/load_biofloat_cache.py', 'scripts/woa_calibration.py'], # metadata for upload to PyPI author = "Mike McCann", author_email = "mccann@mbari.org", description = "Software for working with data from Bio-Argo floats", license = "MIT", keywords = "Oceanography Argo Bio-Argo drifting buoys floats", url = "https://github.com/biofloat/biofloat", ) <commit_msg>Remove geopandas - installing geos.dll and gdal is too painful on Windows/Anaconda<commit_after>
from setuptools import setup, find_packages setup( name = "biofloat", version = "0.3.2", packages = find_packages(), requires = ['Python (>=2.7)'], install_requires = [ 'beautifulsoup4>=4.4', 'coverage>=4', 'jupyter>=1.0.0', 'matplotlib', 'numpy>=1.10', 'pandas>=0.17', 'Pydap', 'requests>=2.8', 'seawater>=3.3', 'simpletable>=0.2', 'statsmodels>=0.6.1', 'xray>=0.6' ], scripts = ['scripts/load_biofloat_cache.py', 'scripts/woa_calibration.py'], # metadata for upload to PyPI author = "Mike McCann", author_email = "mccann@mbari.org", description = "Software for working with data from Bio-Argo floats", license = "MIT", keywords = "Oceanography Argo Bio-Argo drifting buoys floats", url = "https://github.com/biofloat/biofloat", )
from setuptools import setup, find_packages setup( name = "biofloat", version = "0.3.1", packages = find_packages(), requires = ['Python (>=2.7)'], install_requires = [ 'beautifulsoup4>=4.4', 'coverage>=4', 'geopandas>=0.1.1', 'jupyter>=1.0.0', 'matplotlib', 'numpy>=1.10', 'pandas>=0.17', 'Pydap', 'requests>=2.8', 'seawater>=3.3', 'simpletable>=0.2', 'statsmodels>=0.6.1', 'xray>=0.6' ], scripts = ['scripts/load_biofloat_cache.py', 'scripts/woa_calibration.py'], # metadata for upload to PyPI author = "Mike McCann", author_email = "mccann@mbari.org", description = "Software for working with data from Bio-Argo floats", license = "MIT", keywords = "Oceanography Argo Bio-Argo drifting buoys floats", url = "https://github.com/biofloat/biofloat", ) Remove geopandas - installing geos.dll and gdal is too painful on Windows/Anacondafrom setuptools import setup, find_packages setup( name = "biofloat", version = "0.3.2", packages = find_packages(), requires = ['Python (>=2.7)'], install_requires = [ 'beautifulsoup4>=4.4', 'coverage>=4', 'jupyter>=1.0.0', 'matplotlib', 'numpy>=1.10', 'pandas>=0.17', 'Pydap', 'requests>=2.8', 'seawater>=3.3', 'simpletable>=0.2', 'statsmodels>=0.6.1', 'xray>=0.6' ], scripts = ['scripts/load_biofloat_cache.py', 'scripts/woa_calibration.py'], # metadata for upload to PyPI author = "Mike McCann", author_email = "mccann@mbari.org", description = "Software for working with data from Bio-Argo floats", license = "MIT", keywords = "Oceanography Argo Bio-Argo drifting buoys floats", url = "https://github.com/biofloat/biofloat", )
<commit_before>from setuptools import setup, find_packages setup( name = "biofloat", version = "0.3.1", packages = find_packages(), requires = ['Python (>=2.7)'], install_requires = [ 'beautifulsoup4>=4.4', 'coverage>=4', 'geopandas>=0.1.1', 'jupyter>=1.0.0', 'matplotlib', 'numpy>=1.10', 'pandas>=0.17', 'Pydap', 'requests>=2.8', 'seawater>=3.3', 'simpletable>=0.2', 'statsmodels>=0.6.1', 'xray>=0.6' ], scripts = ['scripts/load_biofloat_cache.py', 'scripts/woa_calibration.py'], # metadata for upload to PyPI author = "Mike McCann", author_email = "mccann@mbari.org", description = "Software for working with data from Bio-Argo floats", license = "MIT", keywords = "Oceanography Argo Bio-Argo drifting buoys floats", url = "https://github.com/biofloat/biofloat", ) <commit_msg>Remove geopandas - installing geos.dll and gdal is too painful on Windows/Anaconda<commit_after>from setuptools import setup, find_packages setup( name = "biofloat", version = "0.3.2", packages = find_packages(), requires = ['Python (>=2.7)'], install_requires = [ 'beautifulsoup4>=4.4', 'coverage>=4', 'jupyter>=1.0.0', 'matplotlib', 'numpy>=1.10', 'pandas>=0.17', 'Pydap', 'requests>=2.8', 'seawater>=3.3', 'simpletable>=0.2', 'statsmodels>=0.6.1', 'xray>=0.6' ], scripts = ['scripts/load_biofloat_cache.py', 'scripts/woa_calibration.py'], # metadata for upload to PyPI author = "Mike McCann", author_email = "mccann@mbari.org", description = "Software for working with data from Bio-Argo floats", license = "MIT", keywords = "Oceanography Argo Bio-Argo drifting buoys floats", url = "https://github.com/biofloat/biofloat", )
9d54e23d87c28fa22b6a537d198c0caa66803116
leagues/forms.py
leagues/forms.py
from django import forms class LeagueForm(forms.Form): league_name = forms.CharField(label = "Group name", max_length = 30) max_size = forms.IntegerField(label = "Maximum participants", min_value = 0, max_value = 9999) points_for_exact_guess = forms.IntegerField(label = "Points for exact guess", min_value = 0, max_value = 100) points_for_goal_difference = forms.IntegerField(label = "Points for correct outcome with goal difference", min_value = 0, max_value = 100) points_for_outcome = forms.IntegerField(label = "Points for outcome", min_value = 0, max_value = 100) points_for_number_of_goals = forms.IntegerField(label = "Points for number of goals", min_value = 0, max_value = 100) points_for_exact_home_goals = forms.IntegerField(label = "Points for exact home goals", min_value = 0, max_value = 100) points_for_exact_away_goals = forms.IntegerField(label = "Points for exact away goals", min_value = 0, max_value = 100) is_private = forms.BooleanField(label = "Private")
from django import forms class LeagueForm(forms.Form): league_name = forms.CharField(label = "Group name", max_length = 30) max_size = forms.IntegerField(label = "Maximum participants", min_value = 0, max_value = 9999) points_for_exact_guess = forms.IntegerField(label = "Points for exact guess", min_value = 0, max_value = 100) points_for_goal_difference = forms.IntegerField(label = "Points for correct outcome with goal difference", min_value = 0, max_value = 100) points_for_outcome = forms.IntegerField(label = "Points for outcome", min_value = 0, max_value = 100) points_for_number_of_goals = forms.IntegerField(label = "Points for number of goals", min_value = 0, max_value = 100) points_for_exact_home_goals = forms.IntegerField(label = "Points for exact home goals", min_value = 0, max_value = 100) points_for_exact_away_goals = forms.IntegerField(label = "Points for exact away goals", min_value = 0, max_value = 100) is_private = forms.BooleanField(label = "Private", required=False, initial = False)
Make private checkbox not required
Make private checkbox not required
Python
mit
leventebakos/football-ech,leventebakos/football-ech
from django import forms class LeagueForm(forms.Form): league_name = forms.CharField(label = "Group name", max_length = 30) max_size = forms.IntegerField(label = "Maximum participants", min_value = 0, max_value = 9999) points_for_exact_guess = forms.IntegerField(label = "Points for exact guess", min_value = 0, max_value = 100) points_for_goal_difference = forms.IntegerField(label = "Points for correct outcome with goal difference", min_value = 0, max_value = 100) points_for_outcome = forms.IntegerField(label = "Points for outcome", min_value = 0, max_value = 100) points_for_number_of_goals = forms.IntegerField(label = "Points for number of goals", min_value = 0, max_value = 100) points_for_exact_home_goals = forms.IntegerField(label = "Points for exact home goals", min_value = 0, max_value = 100) points_for_exact_away_goals = forms.IntegerField(label = "Points for exact away goals", min_value = 0, max_value = 100) is_private = forms.BooleanField(label = "Private")Make private checkbox not required
from django import forms class LeagueForm(forms.Form): league_name = forms.CharField(label = "Group name", max_length = 30) max_size = forms.IntegerField(label = "Maximum participants", min_value = 0, max_value = 9999) points_for_exact_guess = forms.IntegerField(label = "Points for exact guess", min_value = 0, max_value = 100) points_for_goal_difference = forms.IntegerField(label = "Points for correct outcome with goal difference", min_value = 0, max_value = 100) points_for_outcome = forms.IntegerField(label = "Points for outcome", min_value = 0, max_value = 100) points_for_number_of_goals = forms.IntegerField(label = "Points for number of goals", min_value = 0, max_value = 100) points_for_exact_home_goals = forms.IntegerField(label = "Points for exact home goals", min_value = 0, max_value = 100) points_for_exact_away_goals = forms.IntegerField(label = "Points for exact away goals", min_value = 0, max_value = 100) is_private = forms.BooleanField(label = "Private", required=False, initial = False)
<commit_before>from django import forms class LeagueForm(forms.Form): league_name = forms.CharField(label = "Group name", max_length = 30) max_size = forms.IntegerField(label = "Maximum participants", min_value = 0, max_value = 9999) points_for_exact_guess = forms.IntegerField(label = "Points for exact guess", min_value = 0, max_value = 100) points_for_goal_difference = forms.IntegerField(label = "Points for correct outcome with goal difference", min_value = 0, max_value = 100) points_for_outcome = forms.IntegerField(label = "Points for outcome", min_value = 0, max_value = 100) points_for_number_of_goals = forms.IntegerField(label = "Points for number of goals", min_value = 0, max_value = 100) points_for_exact_home_goals = forms.IntegerField(label = "Points for exact home goals", min_value = 0, max_value = 100) points_for_exact_away_goals = forms.IntegerField(label = "Points for exact away goals", min_value = 0, max_value = 100) is_private = forms.BooleanField(label = "Private")<commit_msg>Make private checkbox not required<commit_after>
from django import forms class LeagueForm(forms.Form): league_name = forms.CharField(label = "Group name", max_length = 30) max_size = forms.IntegerField(label = "Maximum participants", min_value = 0, max_value = 9999) points_for_exact_guess = forms.IntegerField(label = "Points for exact guess", min_value = 0, max_value = 100) points_for_goal_difference = forms.IntegerField(label = "Points for correct outcome with goal difference", min_value = 0, max_value = 100) points_for_outcome = forms.IntegerField(label = "Points for outcome", min_value = 0, max_value = 100) points_for_number_of_goals = forms.IntegerField(label = "Points for number of goals", min_value = 0, max_value = 100) points_for_exact_home_goals = forms.IntegerField(label = "Points for exact home goals", min_value = 0, max_value = 100) points_for_exact_away_goals = forms.IntegerField(label = "Points for exact away goals", min_value = 0, max_value = 100) is_private = forms.BooleanField(label = "Private", required=False, initial = False)
from django import forms class LeagueForm(forms.Form): league_name = forms.CharField(label = "Group name", max_length = 30) max_size = forms.IntegerField(label = "Maximum participants", min_value = 0, max_value = 9999) points_for_exact_guess = forms.IntegerField(label = "Points for exact guess", min_value = 0, max_value = 100) points_for_goal_difference = forms.IntegerField(label = "Points for correct outcome with goal difference", min_value = 0, max_value = 100) points_for_outcome = forms.IntegerField(label = "Points for outcome", min_value = 0, max_value = 100) points_for_number_of_goals = forms.IntegerField(label = "Points for number of goals", min_value = 0, max_value = 100) points_for_exact_home_goals = forms.IntegerField(label = "Points for exact home goals", min_value = 0, max_value = 100) points_for_exact_away_goals = forms.IntegerField(label = "Points for exact away goals", min_value = 0, max_value = 100) is_private = forms.BooleanField(label = "Private")Make private checkbox not requiredfrom django import forms class LeagueForm(forms.Form): league_name = forms.CharField(label = "Group name", max_length = 30) max_size = forms.IntegerField(label = "Maximum participants", min_value = 0, max_value = 9999) points_for_exact_guess = forms.IntegerField(label = "Points for exact guess", min_value = 0, max_value = 100) points_for_goal_difference = forms.IntegerField(label = "Points for correct outcome with goal difference", min_value = 0, max_value = 100) points_for_outcome = forms.IntegerField(label = "Points for outcome", min_value = 0, max_value = 100) points_for_number_of_goals = forms.IntegerField(label = "Points for number of goals", min_value = 0, max_value = 100) points_for_exact_home_goals = forms.IntegerField(label = "Points for exact home goals", min_value = 0, max_value = 100) points_for_exact_away_goals = forms.IntegerField(label = "Points for exact away goals", min_value = 0, max_value = 100) is_private = forms.BooleanField(label = "Private", required=False, initial = False)
<commit_before>from django import forms class LeagueForm(forms.Form): league_name = forms.CharField(label = "Group name", max_length = 30) max_size = forms.IntegerField(label = "Maximum participants", min_value = 0, max_value = 9999) points_for_exact_guess = forms.IntegerField(label = "Points for exact guess", min_value = 0, max_value = 100) points_for_goal_difference = forms.IntegerField(label = "Points for correct outcome with goal difference", min_value = 0, max_value = 100) points_for_outcome = forms.IntegerField(label = "Points for outcome", min_value = 0, max_value = 100) points_for_number_of_goals = forms.IntegerField(label = "Points for number of goals", min_value = 0, max_value = 100) points_for_exact_home_goals = forms.IntegerField(label = "Points for exact home goals", min_value = 0, max_value = 100) points_for_exact_away_goals = forms.IntegerField(label = "Points for exact away goals", min_value = 0, max_value = 100) is_private = forms.BooleanField(label = "Private")<commit_msg>Make private checkbox not required<commit_after>from django import forms class LeagueForm(forms.Form): league_name = forms.CharField(label = "Group name", max_length = 30) max_size = forms.IntegerField(label = "Maximum participants", min_value = 0, max_value = 9999) points_for_exact_guess = forms.IntegerField(label = "Points for exact guess", min_value = 0, max_value = 100) points_for_goal_difference = forms.IntegerField(label = "Points for correct outcome with goal difference", min_value = 0, max_value = 100) points_for_outcome = forms.IntegerField(label = "Points for outcome", min_value = 0, max_value = 100) points_for_number_of_goals = forms.IntegerField(label = "Points for number of goals", min_value = 0, max_value = 100) points_for_exact_home_goals = forms.IntegerField(label = "Points for exact home goals", min_value = 0, max_value = 100) points_for_exact_away_goals = forms.IntegerField(label = "Points for exact away goals", min_value = 0, max_value = 100) is_private = forms.BooleanField(label = "Private", required=False, initial = False)
1a71d16e472df3005cedfeba60dd578dbfb4c0b5
setup.py
setup.py
from setuptools import setup from wsinfo import __version__ with open("README.rst", "r") as f: long_description = f.read() setup(name="wsinfo", packages=["wsinfo"], version=__version__, description="Python package for simply retrieving information about a specific website.", long_description=long_description, author="Linus Groh", license="MIT", author_email="mail@linusgroh.de", url="https://github.com/linusg/wsinfo", download_url="https://pypi.python.org/pypi/wsinfo", keywords=["website", "http", "url", "internet", "online", "information"], classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.1", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Internet", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules"], )
from setuptools import setup from wsinfo import __version__ with open("README.rst", "r") as f: long_description = f.read() long_description += "\n" with open("CHANGES", "r") as f: long_description += f.read() setup(name="wsinfo", packages=["wsinfo"], version=__version__, description="Python package for simply retrieving information about a specific website.", long_description=long_description, author="Linus Groh", license="MIT", author_email="mail@linusgroh.de", url="https://github.com/linusg/wsinfo", download_url="https://pypi.python.org/pypi/wsinfo", keywords=["website", "http", "url", "internet", "online", "information"], classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.1", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Internet", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules"], )
Write CHANGES at the end of README in PyPI
Add: Write CHANGES at the end of README in PyPI
Python
mit
linusg/wsinfo
from setuptools import setup from wsinfo import __version__ with open("README.rst", "r") as f: long_description = f.read() setup(name="wsinfo", packages=["wsinfo"], version=__version__, description="Python package for simply retrieving information about a specific website.", long_description=long_description, author="Linus Groh", license="MIT", author_email="mail@linusgroh.de", url="https://github.com/linusg/wsinfo", download_url="https://pypi.python.org/pypi/wsinfo", keywords=["website", "http", "url", "internet", "online", "information"], classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.1", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Internet", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules"], ) Add: Write CHANGES at the end of README in PyPI
from setuptools import setup from wsinfo import __version__ with open("README.rst", "r") as f: long_description = f.read() long_description += "\n" with open("CHANGES", "r") as f: long_description += f.read() setup(name="wsinfo", packages=["wsinfo"], version=__version__, description="Python package for simply retrieving information about a specific website.", long_description=long_description, author="Linus Groh", license="MIT", author_email="mail@linusgroh.de", url="https://github.com/linusg/wsinfo", download_url="https://pypi.python.org/pypi/wsinfo", keywords=["website", "http", "url", "internet", "online", "information"], classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.1", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Internet", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules"], )
<commit_before>from setuptools import setup from wsinfo import __version__ with open("README.rst", "r") as f: long_description = f.read() setup(name="wsinfo", packages=["wsinfo"], version=__version__, description="Python package for simply retrieving information about a specific website.", long_description=long_description, author="Linus Groh", license="MIT", author_email="mail@linusgroh.de", url="https://github.com/linusg/wsinfo", download_url="https://pypi.python.org/pypi/wsinfo", keywords=["website", "http", "url", "internet", "online", "information"], classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.1", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Internet", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules"], ) <commit_msg>Add: Write CHANGES at the end of README in PyPI<commit_after>
from setuptools import setup from wsinfo import __version__ with open("README.rst", "r") as f: long_description = f.read() long_description += "\n" with open("CHANGES", "r") as f: long_description += f.read() setup(name="wsinfo", packages=["wsinfo"], version=__version__, description="Python package for simply retrieving information about a specific website.", long_description=long_description, author="Linus Groh", license="MIT", author_email="mail@linusgroh.de", url="https://github.com/linusg/wsinfo", download_url="https://pypi.python.org/pypi/wsinfo", keywords=["website", "http", "url", "internet", "online", "information"], classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.1", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Internet", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules"], )
from setuptools import setup from wsinfo import __version__ with open("README.rst", "r") as f: long_description = f.read() setup(name="wsinfo", packages=["wsinfo"], version=__version__, description="Python package for simply retrieving information about a specific website.", long_description=long_description, author="Linus Groh", license="MIT", author_email="mail@linusgroh.de", url="https://github.com/linusg/wsinfo", download_url="https://pypi.python.org/pypi/wsinfo", keywords=["website", "http", "url", "internet", "online", "information"], classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.1", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Internet", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules"], ) Add: Write CHANGES at the end of README in PyPIfrom setuptools import setup from wsinfo import __version__ with open("README.rst", "r") as f: long_description = f.read() long_description += "\n" with open("CHANGES", "r") as f: long_description += f.read() setup(name="wsinfo", packages=["wsinfo"], version=__version__, description="Python package for simply retrieving information about a specific website.", long_description=long_description, author="Linus Groh", license="MIT", author_email="mail@linusgroh.de", url="https://github.com/linusg/wsinfo", download_url="https://pypi.python.org/pypi/wsinfo", keywords=["website", "http", "url", "internet", "online", "information"], classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.1", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Internet", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules"], )
<commit_before>from setuptools import setup from wsinfo import __version__ with open("README.rst", "r") as f: long_description = f.read() setup(name="wsinfo", packages=["wsinfo"], version=__version__, description="Python package for simply retrieving information about a specific website.", long_description=long_description, author="Linus Groh", license="MIT", author_email="mail@linusgroh.de", url="https://github.com/linusg/wsinfo", download_url="https://pypi.python.org/pypi/wsinfo", keywords=["website", "http", "url", "internet", "online", "information"], classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.1", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Internet", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules"], ) <commit_msg>Add: Write CHANGES at the end of README in PyPI<commit_after>from setuptools import setup from wsinfo import __version__ with open("README.rst", "r") as f: long_description = f.read() long_description += "\n" with open("CHANGES", "r") as f: long_description += f.read() setup(name="wsinfo", packages=["wsinfo"], version=__version__, description="Python package for simply retrieving information about a specific website.", long_description=long_description, author="Linus Groh", license="MIT", author_email="mail@linusgroh.de", url="https://github.com/linusg/wsinfo", download_url="https://pypi.python.org/pypi/wsinfo", keywords=["website", "http", "url", "internet", "online", "information"], classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.1", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Internet", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules"], )
8c23ad1877a0af91e1b9a8512aa7476852de205c
kombu_fernet/serializers/__init__.py
kombu_fernet/serializers/__init__.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import import os from cryptography.fernet import Fernet, InvalidToken fernet = Fernet(os.environ['KOMBU_FERNET_KEY']) fallback_fernet = None try: fallback_fernet = Fernet(os.environ['OLD_KOMBU_FERNET_KEY']) except KeyError: pass def fernet_encode(func): def inner(message): return fernet.encrypt(func(message)) return inner def fernet_decode(func): def inner(encoded_message): if isinstance(encoded_message, unicode): encoded_message = encoded_message.encode('utf-8') try: message = fernet.decrypt(encoded_message) except InvalidToken: message = fallback_fernet.decrypt(encoded_message) return func(message) return inner
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import import os from cryptography.fernet import Fernet, MultiFernet fernet = Fernet(os.environ['KOMBU_FERNET_KEY']) fallback_fernet = None try: fallback_fernet = Fernet(os.environ['OLD_KOMBU_FERNET_KEY']) except KeyError: pass else: fernet = MultiFernet([fernet, fallback_fernet]) def fernet_encode(func): def inner(message): return fernet.encrypt(func(message)) return inner def fernet_decode(func): def inner(encoded_message): if isinstance(encoded_message, unicode): encoded_message = encoded_message.encode('utf-8') message = fernet.decrypt(encoded_message) return func(message) return inner
Use MultiFernet provided by cryptography lib
Use MultiFernet provided by cryptography lib Closes #9
Python
mit
heroku/kombu-fernet-serializers
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import import os from cryptography.fernet import Fernet, InvalidToken fernet = Fernet(os.environ['KOMBU_FERNET_KEY']) fallback_fernet = None try: fallback_fernet = Fernet(os.environ['OLD_KOMBU_FERNET_KEY']) except KeyError: pass def fernet_encode(func): def inner(message): return fernet.encrypt(func(message)) return inner def fernet_decode(func): def inner(encoded_message): if isinstance(encoded_message, unicode): encoded_message = encoded_message.encode('utf-8') try: message = fernet.decrypt(encoded_message) except InvalidToken: message = fallback_fernet.decrypt(encoded_message) return func(message) return inner Use MultiFernet provided by cryptography lib Closes #9
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import import os from cryptography.fernet import Fernet, MultiFernet fernet = Fernet(os.environ['KOMBU_FERNET_KEY']) fallback_fernet = None try: fallback_fernet = Fernet(os.environ['OLD_KOMBU_FERNET_KEY']) except KeyError: pass else: fernet = MultiFernet([fernet, fallback_fernet]) def fernet_encode(func): def inner(message): return fernet.encrypt(func(message)) return inner def fernet_decode(func): def inner(encoded_message): if isinstance(encoded_message, unicode): encoded_message = encoded_message.encode('utf-8') message = fernet.decrypt(encoded_message) return func(message) return inner
<commit_before># -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import import os from cryptography.fernet import Fernet, InvalidToken fernet = Fernet(os.environ['KOMBU_FERNET_KEY']) fallback_fernet = None try: fallback_fernet = Fernet(os.environ['OLD_KOMBU_FERNET_KEY']) except KeyError: pass def fernet_encode(func): def inner(message): return fernet.encrypt(func(message)) return inner def fernet_decode(func): def inner(encoded_message): if isinstance(encoded_message, unicode): encoded_message = encoded_message.encode('utf-8') try: message = fernet.decrypt(encoded_message) except InvalidToken: message = fallback_fernet.decrypt(encoded_message) return func(message) return inner <commit_msg>Use MultiFernet provided by cryptography lib Closes #9<commit_after>
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import import os from cryptography.fernet import Fernet, MultiFernet fernet = Fernet(os.environ['KOMBU_FERNET_KEY']) fallback_fernet = None try: fallback_fernet = Fernet(os.environ['OLD_KOMBU_FERNET_KEY']) except KeyError: pass else: fernet = MultiFernet([fernet, fallback_fernet]) def fernet_encode(func): def inner(message): return fernet.encrypt(func(message)) return inner def fernet_decode(func): def inner(encoded_message): if isinstance(encoded_message, unicode): encoded_message = encoded_message.encode('utf-8') message = fernet.decrypt(encoded_message) return func(message) return inner
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import import os from cryptography.fernet import Fernet, InvalidToken fernet = Fernet(os.environ['KOMBU_FERNET_KEY']) fallback_fernet = None try: fallback_fernet = Fernet(os.environ['OLD_KOMBU_FERNET_KEY']) except KeyError: pass def fernet_encode(func): def inner(message): return fernet.encrypt(func(message)) return inner def fernet_decode(func): def inner(encoded_message): if isinstance(encoded_message, unicode): encoded_message = encoded_message.encode('utf-8') try: message = fernet.decrypt(encoded_message) except InvalidToken: message = fallback_fernet.decrypt(encoded_message) return func(message) return inner Use MultiFernet provided by cryptography lib Closes #9# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import import os from cryptography.fernet import Fernet, MultiFernet fernet = Fernet(os.environ['KOMBU_FERNET_KEY']) fallback_fernet = None try: fallback_fernet = Fernet(os.environ['OLD_KOMBU_FERNET_KEY']) except KeyError: pass else: fernet = MultiFernet([fernet, fallback_fernet]) def fernet_encode(func): def inner(message): return fernet.encrypt(func(message)) return inner def fernet_decode(func): def inner(encoded_message): if isinstance(encoded_message, unicode): encoded_message = encoded_message.encode('utf-8') message = fernet.decrypt(encoded_message) return func(message) return inner
<commit_before># -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import import os from cryptography.fernet import Fernet, InvalidToken fernet = Fernet(os.environ['KOMBU_FERNET_KEY']) fallback_fernet = None try: fallback_fernet = Fernet(os.environ['OLD_KOMBU_FERNET_KEY']) except KeyError: pass def fernet_encode(func): def inner(message): return fernet.encrypt(func(message)) return inner def fernet_decode(func): def inner(encoded_message): if isinstance(encoded_message, unicode): encoded_message = encoded_message.encode('utf-8') try: message = fernet.decrypt(encoded_message) except InvalidToken: message = fallback_fernet.decrypt(encoded_message) return func(message) return inner <commit_msg>Use MultiFernet provided by cryptography lib Closes #9<commit_after># -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import import os from cryptography.fernet import Fernet, MultiFernet fernet = Fernet(os.environ['KOMBU_FERNET_KEY']) fallback_fernet = None try: fallback_fernet = Fernet(os.environ['OLD_KOMBU_FERNET_KEY']) except KeyError: pass else: fernet = MultiFernet([fernet, fallback_fernet]) def fernet_encode(func): def inner(message): return fernet.encrypt(func(message)) return inner def fernet_decode(func): def inner(encoded_message): if isinstance(encoded_message, unicode): encoded_message = encoded_message.encode('utf-8') message = fernet.decrypt(encoded_message) return func(message) return inner
0b8b438a0c8b204d05bab41dbe0d493a409cb809
examples/flask_example/manage.py
examples/flask_example/manage.py
#!/usr/bin/env python from flask.ext.script import Server, Manager, Shell from flask.ext.evolution import Evolution from example import app, db, models evolution = Evolution(app) manager = Manager(app) manager.add_command('runserver', Server()) manager.add_command('shell', Shell(make_context=lambda: { 'app': app, 'db': db, 'models': models })) @manager.command def migrate(action): with app.app_context(): evolution.manager(action) if __name__ == '__main__': manager.run()
#!/usr/bin/env python from flask.ext.script import Server, Manager, Shell from flask.ext.evolution import Evolution from example import app, db, models evolution = Evolution(app) manager = Manager(app) manager.add_command('runserver', Server()) manager.add_command('shell', Shell(make_context=lambda: { 'app': app, 'db': db, 'models': models })) @manager.command def migrate(action): # ./manage.py migrate run with app.app_context(): evolution.manager(action) if __name__ == '__main__': manager.run()
Comment on how to run migrations
Comment on how to run migrations
Python
bsd-3-clause
python-social-auth/social-storage-sqlalchemy,mathspace/python-social-auth,clef/python-social-auth,falcon1kr/python-social-auth,fearlessspider/python-social-auth,imsparsh/python-social-auth,mark-adams/python-social-auth,mathspace/python-social-auth,python-social-auth/social-core,duoduo369/python-social-auth,mark-adams/python-social-auth,VishvajitP/python-social-auth,degs098/python-social-auth,henocdz/python-social-auth,mrwags/python-social-auth,drxos/python-social-auth,merutak/python-social-auth,bjorand/python-social-auth,webjunkie/python-social-auth,joelstanner/python-social-auth,yprez/python-social-auth,lawrence34/python-social-auth,clef/python-social-auth,iruga090/python-social-auth,iruga090/python-social-auth,ariestiyansyah/python-social-auth,rsteca/python-social-auth,mchdks/python-social-auth,barseghyanartur/python-social-auth,daniula/python-social-auth,noodle-learns-programming/python-social-auth,merutak/python-social-auth,degs098/python-social-auth,S01780/python-social-auth,JerzySpendel/python-social-auth,lamby/python-social-auth,san-mate/python-social-auth,DhiaEddineSaidi/python-social-auth,mchdks/python-social-auth,hsr-ba-fs15-dat/python-social-auth,firstjob/python-social-auth,nirmalvp/python-social-auth,frankier/python-social-auth,jneves/python-social-auth,michael-borisov/python-social-auth,jameslittle/python-social-auth,lneoe/python-social-auth,san-mate/python-social-auth,yprez/python-social-auth,S01780/python-social-auth,daniula/python-social-auth,muhammad-ammar/python-social-auth,henocdz/python-social-auth,duoduo369/python-social-auth,ariestiyansyah/python-social-auth,tutumcloud/python-social-auth,ononeor12/python-social-auth,mrwags/python-social-auth,tkajtoch/python-social-auth,nirmalvp/python-social-auth,drxos/python-social-auth,bjorand/python-social-auth,firstjob/python-social-auth,mchdks/python-social-auth,bjorand/python-social-auth,tutumcloud/python-social-auth,san-mate/python-social-auth,msampathkumar/python-social-auth,lneoe/python-social-auth,webjunkie/python-social-auth,jeyraof/python-social-auth,robbiet480/python-social-auth,wildtetris/python-social-auth,rsteca/python-social-auth,michael-borisov/python-social-auth,Andygmb/python-social-auth,degs098/python-social-auth,falcon1kr/python-social-auth,cmichal/python-social-auth,tkajtoch/python-social-auth,contracode/python-social-auth,msampathkumar/python-social-auth,msampathkumar/python-social-auth,jeyraof/python-social-auth,lneoe/python-social-auth,joelstanner/python-social-auth,noodle-learns-programming/python-social-auth,mark-adams/python-social-auth,ByteInternet/python-social-auth,alrusdi/python-social-auth,python-social-auth/social-app-django,Andygmb/python-social-auth,nvbn/python-social-auth,MSOpenTech/python-social-auth,cjltsod/python-social-auth,robbiet480/python-social-auth,JJediny/python-social-auth,barseghyanartur/python-social-auth,ByteInternet/python-social-auth,garrett-schlesinger/python-social-auth,JJediny/python-social-auth,merutak/python-social-auth,henocdz/python-social-auth,imsparsh/python-social-auth,mathspace/python-social-auth,MSOpenTech/python-social-auth,barseghyanartur/python-social-auth,VishvajitP/python-social-auth,python-social-auth/social-docs,drxos/python-social-auth,webjunkie/python-social-auth,frankier/python-social-auth,chandolia/python-social-auth,rsalmaso/python-social-auth,alrusdi/python-social-auth,clef/python-social-auth,python-social-auth/social-core,robbiet480/python-social-auth,firstjob/python-social-auth,fearlessspider/python-social-auth,tkajtoch/python-social-auth,chandolia/python-social-auth,daniula/python-social-auth,rsalmaso/python-social-auth,muhammad-ammar/python-social-auth,noodle-learns-programming/python-social-auth,michael-borisov/python-social-auth,ariestiyansyah/python-social-auth,chandolia/python-social-auth,lamby/python-social-auth,alrusdi/python-social-auth,MSOpenTech/python-social-auth,SeanHayes/python-social-auth,fearlessspider/python-social-auth,Andygmb/python-social-auth,rsteca/python-social-auth,python-social-auth/social-app-cherrypy,iruga090/python-social-auth,jeyraof/python-social-auth,ByteInternet/python-social-auth,VishvajitP/python-social-auth,nirmalvp/python-social-auth,falcon1kr/python-social-auth,wildtetris/python-social-auth,jameslittle/python-social-auth,garrett-schlesinger/python-social-auth,tobias47n9e/social-core,contracode/python-social-auth,hsr-ba-fs15-dat/python-social-auth,JJediny/python-social-auth,jneves/python-social-auth,DhiaEddineSaidi/python-social-auth,lawrence34/python-social-auth,python-social-auth/social-app-django,S01780/python-social-auth,JerzySpendel/python-social-auth,cjltsod/python-social-auth,nvbn/python-social-auth,SeanHayes/python-social-auth,ononeor12/python-social-auth,yprez/python-social-auth,cmichal/python-social-auth,hsr-ba-fs15-dat/python-social-auth,cmichal/python-social-auth,muhammad-ammar/python-social-auth,mrwags/python-social-auth,joelstanner/python-social-auth,wildtetris/python-social-auth,lawrence34/python-social-auth,jneves/python-social-auth,imsparsh/python-social-auth,lamby/python-social-auth,python-social-auth/social-app-django,contracode/python-social-auth,ononeor12/python-social-auth,JerzySpendel/python-social-auth,jameslittle/python-social-auth,DhiaEddineSaidi/python-social-auth
#!/usr/bin/env python from flask.ext.script import Server, Manager, Shell from flask.ext.evolution import Evolution from example import app, db, models evolution = Evolution(app) manager = Manager(app) manager.add_command('runserver', Server()) manager.add_command('shell', Shell(make_context=lambda: { 'app': app, 'db': db, 'models': models })) @manager.command def migrate(action): with app.app_context(): evolution.manager(action) if __name__ == '__main__': manager.run() Comment on how to run migrations
#!/usr/bin/env python from flask.ext.script import Server, Manager, Shell from flask.ext.evolution import Evolution from example import app, db, models evolution = Evolution(app) manager = Manager(app) manager.add_command('runserver', Server()) manager.add_command('shell', Shell(make_context=lambda: { 'app': app, 'db': db, 'models': models })) @manager.command def migrate(action): # ./manage.py migrate run with app.app_context(): evolution.manager(action) if __name__ == '__main__': manager.run()
<commit_before>#!/usr/bin/env python from flask.ext.script import Server, Manager, Shell from flask.ext.evolution import Evolution from example import app, db, models evolution = Evolution(app) manager = Manager(app) manager.add_command('runserver', Server()) manager.add_command('shell', Shell(make_context=lambda: { 'app': app, 'db': db, 'models': models })) @manager.command def migrate(action): with app.app_context(): evolution.manager(action) if __name__ == '__main__': manager.run() <commit_msg>Comment on how to run migrations<commit_after>
#!/usr/bin/env python from flask.ext.script import Server, Manager, Shell from flask.ext.evolution import Evolution from example import app, db, models evolution = Evolution(app) manager = Manager(app) manager.add_command('runserver', Server()) manager.add_command('shell', Shell(make_context=lambda: { 'app': app, 'db': db, 'models': models })) @manager.command def migrate(action): # ./manage.py migrate run with app.app_context(): evolution.manager(action) if __name__ == '__main__': manager.run()
#!/usr/bin/env python from flask.ext.script import Server, Manager, Shell from flask.ext.evolution import Evolution from example import app, db, models evolution = Evolution(app) manager = Manager(app) manager.add_command('runserver', Server()) manager.add_command('shell', Shell(make_context=lambda: { 'app': app, 'db': db, 'models': models })) @manager.command def migrate(action): with app.app_context(): evolution.manager(action) if __name__ == '__main__': manager.run() Comment on how to run migrations#!/usr/bin/env python from flask.ext.script import Server, Manager, Shell from flask.ext.evolution import Evolution from example import app, db, models evolution = Evolution(app) manager = Manager(app) manager.add_command('runserver', Server()) manager.add_command('shell', Shell(make_context=lambda: { 'app': app, 'db': db, 'models': models })) @manager.command def migrate(action): # ./manage.py migrate run with app.app_context(): evolution.manager(action) if __name__ == '__main__': manager.run()
<commit_before>#!/usr/bin/env python from flask.ext.script import Server, Manager, Shell from flask.ext.evolution import Evolution from example import app, db, models evolution = Evolution(app) manager = Manager(app) manager.add_command('runserver', Server()) manager.add_command('shell', Shell(make_context=lambda: { 'app': app, 'db': db, 'models': models })) @manager.command def migrate(action): with app.app_context(): evolution.manager(action) if __name__ == '__main__': manager.run() <commit_msg>Comment on how to run migrations<commit_after>#!/usr/bin/env python from flask.ext.script import Server, Manager, Shell from flask.ext.evolution import Evolution from example import app, db, models evolution = Evolution(app) manager = Manager(app) manager.add_command('runserver', Server()) manager.add_command('shell', Shell(make_context=lambda: { 'app': app, 'db': db, 'models': models })) @manager.command def migrate(action): # ./manage.py migrate run with app.app_context(): evolution.manager(action) if __name__ == '__main__': manager.run()
e094def7ae5f7b59ef630c8952235782795e7803
setup.py
setup.py
# -*- coding: utf-8 -*- from setuptools import setup setup( name='Weitersager', version='0.1', description='A proxy to forward messages received via HTTP to to IRC', author='Jochen Kupperschmidt', author_email='homework@nwsnet.de', url='http://homework.nwsnet.de/', )
# -*- coding: utf-8 -*- import codecs from setuptools import setup with codecs.open('README.rst', encoding='utf-8') as f: long_description = f.read() setup( name='Weitersager', version='0.1', description='A proxy to forward messages received via HTTP to to IRC', long_description=long_description, author='Jochen Kupperschmidt', author_email='homework@nwsnet.de', url='http://homework.nwsnet.de/', )
Include README as long description.
Include README as long description.
Python
mit
homeworkprod/weitersager
# -*- coding: utf-8 -*- from setuptools import setup setup( name='Weitersager', version='0.1', description='A proxy to forward messages received via HTTP to to IRC', author='Jochen Kupperschmidt', author_email='homework@nwsnet.de', url='http://homework.nwsnet.de/', ) Include README as long description.
# -*- coding: utf-8 -*- import codecs from setuptools import setup with codecs.open('README.rst', encoding='utf-8') as f: long_description = f.read() setup( name='Weitersager', version='0.1', description='A proxy to forward messages received via HTTP to to IRC', long_description=long_description, author='Jochen Kupperschmidt', author_email='homework@nwsnet.de', url='http://homework.nwsnet.de/', )
<commit_before># -*- coding: utf-8 -*- from setuptools import setup setup( name='Weitersager', version='0.1', description='A proxy to forward messages received via HTTP to to IRC', author='Jochen Kupperschmidt', author_email='homework@nwsnet.de', url='http://homework.nwsnet.de/', ) <commit_msg>Include README as long description.<commit_after>
# -*- coding: utf-8 -*- import codecs from setuptools import setup with codecs.open('README.rst', encoding='utf-8') as f: long_description = f.read() setup( name='Weitersager', version='0.1', description='A proxy to forward messages received via HTTP to to IRC', long_description=long_description, author='Jochen Kupperschmidt', author_email='homework@nwsnet.de', url='http://homework.nwsnet.de/', )
# -*- coding: utf-8 -*- from setuptools import setup setup( name='Weitersager', version='0.1', description='A proxy to forward messages received via HTTP to to IRC', author='Jochen Kupperschmidt', author_email='homework@nwsnet.de', url='http://homework.nwsnet.de/', ) Include README as long description.# -*- coding: utf-8 -*- import codecs from setuptools import setup with codecs.open('README.rst', encoding='utf-8') as f: long_description = f.read() setup( name='Weitersager', version='0.1', description='A proxy to forward messages received via HTTP to to IRC', long_description=long_description, author='Jochen Kupperschmidt', author_email='homework@nwsnet.de', url='http://homework.nwsnet.de/', )
<commit_before># -*- coding: utf-8 -*- from setuptools import setup setup( name='Weitersager', version='0.1', description='A proxy to forward messages received via HTTP to to IRC', author='Jochen Kupperschmidt', author_email='homework@nwsnet.de', url='http://homework.nwsnet.de/', ) <commit_msg>Include README as long description.<commit_after># -*- coding: utf-8 -*- import codecs from setuptools import setup with codecs.open('README.rst', encoding='utf-8') as f: long_description = f.read() setup( name='Weitersager', version='0.1', description='A proxy to forward messages received via HTTP to to IRC', long_description=long_description, author='Jochen Kupperschmidt', author_email='homework@nwsnet.de', url='http://homework.nwsnet.de/', )
82e2f670a7b109bac5e843b2beea6b010317ba54
setup.py
setup.py
from setuptools import setup REPO_URL = 'http://github.com/datasciencebr/serenata-toolbox' setup( author='Serenata de Amor', author_email='op.serenatadeamor@gmail.com', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 3.5', 'Topic :: Utilities', ], description='Toolbox for Serenata de Amor project', zip_safe=False, install_requires=[ 'aiofiles', 'aiohttp', 'boto3', 'beautifulsoup4>=4.4', 'lxml>=3.6', 'pandas>=0.18', 'tqdm' ], keywords='serenata de amor, data science, brazil, corruption', license='MIT', long_description='Check `Serenata Toolbox at GitHub <{}>`_.'.format(REPO_URL), name='serenata-toolbox', packages=[ 'serenata_toolbox.federal_senate', 'serenata_toolbox.chamber_of_deputies', 'serenata_toolbox.datasets' ], url=REPO_URL, version='12.3.0' )
from setuptools import setup REPO_URL = 'http://github.com/datasciencebr/serenata-toolbox' setup( author='Serenata de Amor', author_email='op.serenatadeamor@gmail.com', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 3.5', 'Topic :: Utilities', ], description='Toolbox for Serenata de Amor project', zip_safe=False, install_requires=[ 'aiofiles', 'aiohttp', 'boto3', 'beautifulsoup4>=4.4', 'lxml>=3.6', 'pandas>=0.18', 'tqdm' ], keywords='serenata de amor, data science, brazil, corruption', license='MIT', long_description='Check `Serenata Toolbox at GitHub <{}>`_.'.format(REPO_URL), name='serenata-toolbox', packages=[ 'serenata_toolbox', 'serenata_toolbox.federal_senate', 'serenata_toolbox.chamber_of_deputies', 'serenata_toolbox.datasets' ], url=REPO_URL, version='12.4.2' )
Add serenata_toolbox module to packages
Add serenata_toolbox module to packages
Python
mit
datasciencebr/serenata-toolbox
from setuptools import setup REPO_URL = 'http://github.com/datasciencebr/serenata-toolbox' setup( author='Serenata de Amor', author_email='op.serenatadeamor@gmail.com', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 3.5', 'Topic :: Utilities', ], description='Toolbox for Serenata de Amor project', zip_safe=False, install_requires=[ 'aiofiles', 'aiohttp', 'boto3', 'beautifulsoup4>=4.4', 'lxml>=3.6', 'pandas>=0.18', 'tqdm' ], keywords='serenata de amor, data science, brazil, corruption', license='MIT', long_description='Check `Serenata Toolbox at GitHub <{}>`_.'.format(REPO_URL), name='serenata-toolbox', packages=[ 'serenata_toolbox.federal_senate', 'serenata_toolbox.chamber_of_deputies', 'serenata_toolbox.datasets' ], url=REPO_URL, version='12.3.0' ) Add serenata_toolbox module to packages
from setuptools import setup REPO_URL = 'http://github.com/datasciencebr/serenata-toolbox' setup( author='Serenata de Amor', author_email='op.serenatadeamor@gmail.com', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 3.5', 'Topic :: Utilities', ], description='Toolbox for Serenata de Amor project', zip_safe=False, install_requires=[ 'aiofiles', 'aiohttp', 'boto3', 'beautifulsoup4>=4.4', 'lxml>=3.6', 'pandas>=0.18', 'tqdm' ], keywords='serenata de amor, data science, brazil, corruption', license='MIT', long_description='Check `Serenata Toolbox at GitHub <{}>`_.'.format(REPO_URL), name='serenata-toolbox', packages=[ 'serenata_toolbox', 'serenata_toolbox.federal_senate', 'serenata_toolbox.chamber_of_deputies', 'serenata_toolbox.datasets' ], url=REPO_URL, version='12.4.2' )
<commit_before>from setuptools import setup REPO_URL = 'http://github.com/datasciencebr/serenata-toolbox' setup( author='Serenata de Amor', author_email='op.serenatadeamor@gmail.com', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 3.5', 'Topic :: Utilities', ], description='Toolbox for Serenata de Amor project', zip_safe=False, install_requires=[ 'aiofiles', 'aiohttp', 'boto3', 'beautifulsoup4>=4.4', 'lxml>=3.6', 'pandas>=0.18', 'tqdm' ], keywords='serenata de amor, data science, brazil, corruption', license='MIT', long_description='Check `Serenata Toolbox at GitHub <{}>`_.'.format(REPO_URL), name='serenata-toolbox', packages=[ 'serenata_toolbox.federal_senate', 'serenata_toolbox.chamber_of_deputies', 'serenata_toolbox.datasets' ], url=REPO_URL, version='12.3.0' ) <commit_msg>Add serenata_toolbox module to packages<commit_after>
from setuptools import setup REPO_URL = 'http://github.com/datasciencebr/serenata-toolbox' setup( author='Serenata de Amor', author_email='op.serenatadeamor@gmail.com', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 3.5', 'Topic :: Utilities', ], description='Toolbox for Serenata de Amor project', zip_safe=False, install_requires=[ 'aiofiles', 'aiohttp', 'boto3', 'beautifulsoup4>=4.4', 'lxml>=3.6', 'pandas>=0.18', 'tqdm' ], keywords='serenata de amor, data science, brazil, corruption', license='MIT', long_description='Check `Serenata Toolbox at GitHub <{}>`_.'.format(REPO_URL), name='serenata-toolbox', packages=[ 'serenata_toolbox', 'serenata_toolbox.federal_senate', 'serenata_toolbox.chamber_of_deputies', 'serenata_toolbox.datasets' ], url=REPO_URL, version='12.4.2' )
from setuptools import setup REPO_URL = 'http://github.com/datasciencebr/serenata-toolbox' setup( author='Serenata de Amor', author_email='op.serenatadeamor@gmail.com', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 3.5', 'Topic :: Utilities', ], description='Toolbox for Serenata de Amor project', zip_safe=False, install_requires=[ 'aiofiles', 'aiohttp', 'boto3', 'beautifulsoup4>=4.4', 'lxml>=3.6', 'pandas>=0.18', 'tqdm' ], keywords='serenata de amor, data science, brazil, corruption', license='MIT', long_description='Check `Serenata Toolbox at GitHub <{}>`_.'.format(REPO_URL), name='serenata-toolbox', packages=[ 'serenata_toolbox.federal_senate', 'serenata_toolbox.chamber_of_deputies', 'serenata_toolbox.datasets' ], url=REPO_URL, version='12.3.0' ) Add serenata_toolbox module to packagesfrom setuptools import setup REPO_URL = 'http://github.com/datasciencebr/serenata-toolbox' setup( author='Serenata de Amor', author_email='op.serenatadeamor@gmail.com', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 3.5', 'Topic :: Utilities', ], description='Toolbox for Serenata de Amor project', zip_safe=False, install_requires=[ 'aiofiles', 'aiohttp', 'boto3', 'beautifulsoup4>=4.4', 'lxml>=3.6', 'pandas>=0.18', 'tqdm' ], keywords='serenata de amor, data science, brazil, corruption', license='MIT', long_description='Check `Serenata Toolbox at GitHub <{}>`_.'.format(REPO_URL), name='serenata-toolbox', packages=[ 'serenata_toolbox', 'serenata_toolbox.federal_senate', 'serenata_toolbox.chamber_of_deputies', 'serenata_toolbox.datasets' ], url=REPO_URL, version='12.4.2' )
<commit_before>from setuptools import setup REPO_URL = 'http://github.com/datasciencebr/serenata-toolbox' setup( author='Serenata de Amor', author_email='op.serenatadeamor@gmail.com', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 3.5', 'Topic :: Utilities', ], description='Toolbox for Serenata de Amor project', zip_safe=False, install_requires=[ 'aiofiles', 'aiohttp', 'boto3', 'beautifulsoup4>=4.4', 'lxml>=3.6', 'pandas>=0.18', 'tqdm' ], keywords='serenata de amor, data science, brazil, corruption', license='MIT', long_description='Check `Serenata Toolbox at GitHub <{}>`_.'.format(REPO_URL), name='serenata-toolbox', packages=[ 'serenata_toolbox.federal_senate', 'serenata_toolbox.chamber_of_deputies', 'serenata_toolbox.datasets' ], url=REPO_URL, version='12.3.0' ) <commit_msg>Add serenata_toolbox module to packages<commit_after>from setuptools import setup REPO_URL = 'http://github.com/datasciencebr/serenata-toolbox' setup( author='Serenata de Amor', author_email='op.serenatadeamor@gmail.com', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 3.5', 'Topic :: Utilities', ], description='Toolbox for Serenata de Amor project', zip_safe=False, install_requires=[ 'aiofiles', 'aiohttp', 'boto3', 'beautifulsoup4>=4.4', 'lxml>=3.6', 'pandas>=0.18', 'tqdm' ], keywords='serenata de amor, data science, brazil, corruption', license='MIT', long_description='Check `Serenata Toolbox at GitHub <{}>`_.'.format(REPO_URL), name='serenata-toolbox', packages=[ 'serenata_toolbox', 'serenata_toolbox.federal_senate', 'serenata_toolbox.chamber_of_deputies', 'serenata_toolbox.datasets' ], url=REPO_URL, version='12.4.2' )
f0ac78b3bfc0f81f142e66030e1e822dacfafe14
setup.py
setup.py
#!/usr/bin/env python from distutils.core import setup setup(name='ansi', version='0.3.0', description='ANSI cursor movement and graphics', author='Wijnand Modderman-Lenstra', author_email='maze@pyth0n.org', url='https://github.com/tehmaze/ansi/', packages = ['ansi', 'ansi.colour'], long_description=''' ANSI ==== Various ANSI escape codes, used in moving the cursor in a text console or rendering coloured text. Example ------- Print something in bold yellow on a red background:: >>> from ansi.colour import fg, bg, reset >>> print map(str, [bg.red, fg.yellow, 'Hello world!', reset]) ... If you like syntactic sugar, you may also do:: >>> print bg.red(fg.yellow('Hello world!')) ... Also, 256 RGB colors are supported:: >>> from ansi.colour import rgb, reset >>> print rgb(0xff, 0x80, 0x00) + 'hello world' + reset ... If you prefer to use American English in stead:: >>> from ansi.color import ... ''')
#!/usr/bin/env python from distutils.core import setup setup(name='ansi', version='0.3.0', description='ANSI cursor movement and graphics', author='Wijnand Modderman-Lenstra', author_email='maze@pyth0n.org', url='https://github.com/tehmaze/ansi/', packages = ['ansi', 'ansi.colour'], package_data = {'ansi': ['py.typed']}, long_description=''' ANSI ==== Various ANSI escape codes, used in moving the cursor in a text console or rendering coloured text. Example ------- Print something in bold yellow on a red background:: >>> from ansi.colour import fg, bg, reset >>> print map(str, [bg.red, fg.yellow, 'Hello world!', reset]) ... If you like syntactic sugar, you may also do:: >>> print bg.red(fg.yellow('Hello world!')) ... Also, 256 RGB colors are supported:: >>> from ansi.colour import rgb, reset >>> print rgb(0xff, 0x80, 0x00) + 'hello world' + reset ... If you prefer to use American English in stead:: >>> from ansi.color import ... ''')
Include py.typed marker in package
Include py.typed marker in package
Python
mit
tehmaze/ansi
#!/usr/bin/env python from distutils.core import setup setup(name='ansi', version='0.3.0', description='ANSI cursor movement and graphics', author='Wijnand Modderman-Lenstra', author_email='maze@pyth0n.org', url='https://github.com/tehmaze/ansi/', packages = ['ansi', 'ansi.colour'], long_description=''' ANSI ==== Various ANSI escape codes, used in moving the cursor in a text console or rendering coloured text. Example ------- Print something in bold yellow on a red background:: >>> from ansi.colour import fg, bg, reset >>> print map(str, [bg.red, fg.yellow, 'Hello world!', reset]) ... If you like syntactic sugar, you may also do:: >>> print bg.red(fg.yellow('Hello world!')) ... Also, 256 RGB colors are supported:: >>> from ansi.colour import rgb, reset >>> print rgb(0xff, 0x80, 0x00) + 'hello world' + reset ... If you prefer to use American English in stead:: >>> from ansi.color import ... ''') Include py.typed marker in package
#!/usr/bin/env python from distutils.core import setup setup(name='ansi', version='0.3.0', description='ANSI cursor movement and graphics', author='Wijnand Modderman-Lenstra', author_email='maze@pyth0n.org', url='https://github.com/tehmaze/ansi/', packages = ['ansi', 'ansi.colour'], package_data = {'ansi': ['py.typed']}, long_description=''' ANSI ==== Various ANSI escape codes, used in moving the cursor in a text console or rendering coloured text. Example ------- Print something in bold yellow on a red background:: >>> from ansi.colour import fg, bg, reset >>> print map(str, [bg.red, fg.yellow, 'Hello world!', reset]) ... If you like syntactic sugar, you may also do:: >>> print bg.red(fg.yellow('Hello world!')) ... Also, 256 RGB colors are supported:: >>> from ansi.colour import rgb, reset >>> print rgb(0xff, 0x80, 0x00) + 'hello world' + reset ... If you prefer to use American English in stead:: >>> from ansi.color import ... ''')
<commit_before>#!/usr/bin/env python from distutils.core import setup setup(name='ansi', version='0.3.0', description='ANSI cursor movement and graphics', author='Wijnand Modderman-Lenstra', author_email='maze@pyth0n.org', url='https://github.com/tehmaze/ansi/', packages = ['ansi', 'ansi.colour'], long_description=''' ANSI ==== Various ANSI escape codes, used in moving the cursor in a text console or rendering coloured text. Example ------- Print something in bold yellow on a red background:: >>> from ansi.colour import fg, bg, reset >>> print map(str, [bg.red, fg.yellow, 'Hello world!', reset]) ... If you like syntactic sugar, you may also do:: >>> print bg.red(fg.yellow('Hello world!')) ... Also, 256 RGB colors are supported:: >>> from ansi.colour import rgb, reset >>> print rgb(0xff, 0x80, 0x00) + 'hello world' + reset ... If you prefer to use American English in stead:: >>> from ansi.color import ... ''') <commit_msg>Include py.typed marker in package<commit_after>
#!/usr/bin/env python from distutils.core import setup setup(name='ansi', version='0.3.0', description='ANSI cursor movement and graphics', author='Wijnand Modderman-Lenstra', author_email='maze@pyth0n.org', url='https://github.com/tehmaze/ansi/', packages = ['ansi', 'ansi.colour'], package_data = {'ansi': ['py.typed']}, long_description=''' ANSI ==== Various ANSI escape codes, used in moving the cursor in a text console or rendering coloured text. Example ------- Print something in bold yellow on a red background:: >>> from ansi.colour import fg, bg, reset >>> print map(str, [bg.red, fg.yellow, 'Hello world!', reset]) ... If you like syntactic sugar, you may also do:: >>> print bg.red(fg.yellow('Hello world!')) ... Also, 256 RGB colors are supported:: >>> from ansi.colour import rgb, reset >>> print rgb(0xff, 0x80, 0x00) + 'hello world' + reset ... If you prefer to use American English in stead:: >>> from ansi.color import ... ''')
#!/usr/bin/env python from distutils.core import setup setup(name='ansi', version='0.3.0', description='ANSI cursor movement and graphics', author='Wijnand Modderman-Lenstra', author_email='maze@pyth0n.org', url='https://github.com/tehmaze/ansi/', packages = ['ansi', 'ansi.colour'], long_description=''' ANSI ==== Various ANSI escape codes, used in moving the cursor in a text console or rendering coloured text. Example ------- Print something in bold yellow on a red background:: >>> from ansi.colour import fg, bg, reset >>> print map(str, [bg.red, fg.yellow, 'Hello world!', reset]) ... If you like syntactic sugar, you may also do:: >>> print bg.red(fg.yellow('Hello world!')) ... Also, 256 RGB colors are supported:: >>> from ansi.colour import rgb, reset >>> print rgb(0xff, 0x80, 0x00) + 'hello world' + reset ... If you prefer to use American English in stead:: >>> from ansi.color import ... ''') Include py.typed marker in package#!/usr/bin/env python from distutils.core import setup setup(name='ansi', version='0.3.0', description='ANSI cursor movement and graphics', author='Wijnand Modderman-Lenstra', author_email='maze@pyth0n.org', url='https://github.com/tehmaze/ansi/', packages = ['ansi', 'ansi.colour'], package_data = {'ansi': ['py.typed']}, long_description=''' ANSI ==== Various ANSI escape codes, used in moving the cursor in a text console or rendering coloured text. Example ------- Print something in bold yellow on a red background:: >>> from ansi.colour import fg, bg, reset >>> print map(str, [bg.red, fg.yellow, 'Hello world!', reset]) ... If you like syntactic sugar, you may also do:: >>> print bg.red(fg.yellow('Hello world!')) ... Also, 256 RGB colors are supported:: >>> from ansi.colour import rgb, reset >>> print rgb(0xff, 0x80, 0x00) + 'hello world' + reset ... If you prefer to use American English in stead:: >>> from ansi.color import ... ''')
<commit_before>#!/usr/bin/env python from distutils.core import setup setup(name='ansi', version='0.3.0', description='ANSI cursor movement and graphics', author='Wijnand Modderman-Lenstra', author_email='maze@pyth0n.org', url='https://github.com/tehmaze/ansi/', packages = ['ansi', 'ansi.colour'], long_description=''' ANSI ==== Various ANSI escape codes, used in moving the cursor in a text console or rendering coloured text. Example ------- Print something in bold yellow on a red background:: >>> from ansi.colour import fg, bg, reset >>> print map(str, [bg.red, fg.yellow, 'Hello world!', reset]) ... If you like syntactic sugar, you may also do:: >>> print bg.red(fg.yellow('Hello world!')) ... Also, 256 RGB colors are supported:: >>> from ansi.colour import rgb, reset >>> print rgb(0xff, 0x80, 0x00) + 'hello world' + reset ... If you prefer to use American English in stead:: >>> from ansi.color import ... ''') <commit_msg>Include py.typed marker in package<commit_after>#!/usr/bin/env python from distutils.core import setup setup(name='ansi', version='0.3.0', description='ANSI cursor movement and graphics', author='Wijnand Modderman-Lenstra', author_email='maze@pyth0n.org', url='https://github.com/tehmaze/ansi/', packages = ['ansi', 'ansi.colour'], package_data = {'ansi': ['py.typed']}, long_description=''' ANSI ==== Various ANSI escape codes, used in moving the cursor in a text console or rendering coloured text. Example ------- Print something in bold yellow on a red background:: >>> from ansi.colour import fg, bg, reset >>> print map(str, [bg.red, fg.yellow, 'Hello world!', reset]) ... If you like syntactic sugar, you may also do:: >>> print bg.red(fg.yellow('Hello world!')) ... Also, 256 RGB colors are supported:: >>> from ansi.colour import rgb, reset >>> print rgb(0xff, 0x80, 0x00) + 'hello world' + reset ... If you prefer to use American English in stead:: >>> from ansi.color import ... ''')
35f41aa03285180e380274ba95e882906f4cbbc8
setup.py
setup.py
import os import sys import re from setuptools import setup, find_packages v = open(os.path.join(os.path.dirname(__file__), 'dogpile', 'cache', '__init__.py')) VERSION = re.compile(r".*__version__ = '(.*?)'", re.S).match(v.read()).group(1) v.close() readme = os.path.join(os.path.dirname(__file__), 'README.rst') setup(name='dogpile.cache', version=VERSION, description="A caching front-end based on the Dogpile lock.", long_description=open(readme).read(), classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python', 'Programming Language :: Python :: 3', ], keywords='caching', author='Mike Bayer', author_email='mike_mp@zzzcomputing.com', url='http://bitbucket.org/zzzeek/dogpile.cache', license='BSD', packages=find_packages('.', exclude=['ez_setup', 'tests*']), namespace_packages=['dogpile'], entry_points=""" [mako.cache] dogpile.cache = dogpile.cache.plugins.mako_cache:MakoPlugin """, zip_safe=False, install_requires=['dogpile.core>=0.4.1'], test_suite='nose.collector', tests_require=['nose', 'mock'], )
import os import sys import re from setuptools import setup, find_packages v = open(os.path.join(os.path.dirname(__file__), 'dogpile', 'cache', '__init__.py')) VERSION = re.compile(r".*__version__ = '(.*?)'", re.S).match(v.read()).group(1) v.close() readme = os.path.join(os.path.dirname(__file__), 'README.rst') setup(name='dogpile.cache', version=VERSION, description="A caching front-end based on the Dogpile lock.", long_description=open(readme).read(), classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python', 'Programming Language :: Python :: 3', ], keywords='caching', author='Mike Bayer', author_email='mike_mp@zzzcomputing.com', url='http://bitbucket.org/zzzeek/dogpile.cache', license='BSD', packages=find_packages('.', exclude=['ez_setup', 'tests*']), namespace_packages=['dogpile'], entry_points=""" [mako.cache] dogpile.cache = dogpile.cache.plugins.mako_cache:MakoPlugin """, zip_safe=False, install_requires=['dogpile.core>=0.4.1'], test_suite='nose.collector', tests_require=['nose', 'mock', 'Mako'], )
Add missing test Mako test dependency.
Add missing test Mako test dependency.
Python
bsd-3-clause
thruflo/dogpile.cache,thruflo/dogpile.cache
import os import sys import re from setuptools import setup, find_packages v = open(os.path.join(os.path.dirname(__file__), 'dogpile', 'cache', '__init__.py')) VERSION = re.compile(r".*__version__ = '(.*?)'", re.S).match(v.read()).group(1) v.close() readme = os.path.join(os.path.dirname(__file__), 'README.rst') setup(name='dogpile.cache', version=VERSION, description="A caching front-end based on the Dogpile lock.", long_description=open(readme).read(), classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python', 'Programming Language :: Python :: 3', ], keywords='caching', author='Mike Bayer', author_email='mike_mp@zzzcomputing.com', url='http://bitbucket.org/zzzeek/dogpile.cache', license='BSD', packages=find_packages('.', exclude=['ez_setup', 'tests*']), namespace_packages=['dogpile'], entry_points=""" [mako.cache] dogpile.cache = dogpile.cache.plugins.mako_cache:MakoPlugin """, zip_safe=False, install_requires=['dogpile.core>=0.4.1'], test_suite='nose.collector', tests_require=['nose', 'mock'], ) Add missing test Mako test dependency.
import os import sys import re from setuptools import setup, find_packages v = open(os.path.join(os.path.dirname(__file__), 'dogpile', 'cache', '__init__.py')) VERSION = re.compile(r".*__version__ = '(.*?)'", re.S).match(v.read()).group(1) v.close() readme = os.path.join(os.path.dirname(__file__), 'README.rst') setup(name='dogpile.cache', version=VERSION, description="A caching front-end based on the Dogpile lock.", long_description=open(readme).read(), classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python', 'Programming Language :: Python :: 3', ], keywords='caching', author='Mike Bayer', author_email='mike_mp@zzzcomputing.com', url='http://bitbucket.org/zzzeek/dogpile.cache', license='BSD', packages=find_packages('.', exclude=['ez_setup', 'tests*']), namespace_packages=['dogpile'], entry_points=""" [mako.cache] dogpile.cache = dogpile.cache.plugins.mako_cache:MakoPlugin """, zip_safe=False, install_requires=['dogpile.core>=0.4.1'], test_suite='nose.collector', tests_require=['nose', 'mock', 'Mako'], )
<commit_before>import os import sys import re from setuptools import setup, find_packages v = open(os.path.join(os.path.dirname(__file__), 'dogpile', 'cache', '__init__.py')) VERSION = re.compile(r".*__version__ = '(.*?)'", re.S).match(v.read()).group(1) v.close() readme = os.path.join(os.path.dirname(__file__), 'README.rst') setup(name='dogpile.cache', version=VERSION, description="A caching front-end based on the Dogpile lock.", long_description=open(readme).read(), classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python', 'Programming Language :: Python :: 3', ], keywords='caching', author='Mike Bayer', author_email='mike_mp@zzzcomputing.com', url='http://bitbucket.org/zzzeek/dogpile.cache', license='BSD', packages=find_packages('.', exclude=['ez_setup', 'tests*']), namespace_packages=['dogpile'], entry_points=""" [mako.cache] dogpile.cache = dogpile.cache.plugins.mako_cache:MakoPlugin """, zip_safe=False, install_requires=['dogpile.core>=0.4.1'], test_suite='nose.collector', tests_require=['nose', 'mock'], ) <commit_msg>Add missing test Mako test dependency.<commit_after>
import os import sys import re from setuptools import setup, find_packages v = open(os.path.join(os.path.dirname(__file__), 'dogpile', 'cache', '__init__.py')) VERSION = re.compile(r".*__version__ = '(.*?)'", re.S).match(v.read()).group(1) v.close() readme = os.path.join(os.path.dirname(__file__), 'README.rst') setup(name='dogpile.cache', version=VERSION, description="A caching front-end based on the Dogpile lock.", long_description=open(readme).read(), classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python', 'Programming Language :: Python :: 3', ], keywords='caching', author='Mike Bayer', author_email='mike_mp@zzzcomputing.com', url='http://bitbucket.org/zzzeek/dogpile.cache', license='BSD', packages=find_packages('.', exclude=['ez_setup', 'tests*']), namespace_packages=['dogpile'], entry_points=""" [mako.cache] dogpile.cache = dogpile.cache.plugins.mako_cache:MakoPlugin """, zip_safe=False, install_requires=['dogpile.core>=0.4.1'], test_suite='nose.collector', tests_require=['nose', 'mock', 'Mako'], )
import os import sys import re from setuptools import setup, find_packages v = open(os.path.join(os.path.dirname(__file__), 'dogpile', 'cache', '__init__.py')) VERSION = re.compile(r".*__version__ = '(.*?)'", re.S).match(v.read()).group(1) v.close() readme = os.path.join(os.path.dirname(__file__), 'README.rst') setup(name='dogpile.cache', version=VERSION, description="A caching front-end based on the Dogpile lock.", long_description=open(readme).read(), classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python', 'Programming Language :: Python :: 3', ], keywords='caching', author='Mike Bayer', author_email='mike_mp@zzzcomputing.com', url='http://bitbucket.org/zzzeek/dogpile.cache', license='BSD', packages=find_packages('.', exclude=['ez_setup', 'tests*']), namespace_packages=['dogpile'], entry_points=""" [mako.cache] dogpile.cache = dogpile.cache.plugins.mako_cache:MakoPlugin """, zip_safe=False, install_requires=['dogpile.core>=0.4.1'], test_suite='nose.collector', tests_require=['nose', 'mock'], ) Add missing test Mako test dependency.import os import sys import re from setuptools import setup, find_packages v = open(os.path.join(os.path.dirname(__file__), 'dogpile', 'cache', '__init__.py')) VERSION = re.compile(r".*__version__ = '(.*?)'", re.S).match(v.read()).group(1) v.close() readme = os.path.join(os.path.dirname(__file__), 'README.rst') setup(name='dogpile.cache', version=VERSION, description="A caching front-end based on the Dogpile lock.", long_description=open(readme).read(), classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python', 'Programming Language :: Python :: 3', ], keywords='caching', author='Mike Bayer', author_email='mike_mp@zzzcomputing.com', url='http://bitbucket.org/zzzeek/dogpile.cache', license='BSD', packages=find_packages('.', exclude=['ez_setup', 'tests*']), namespace_packages=['dogpile'], entry_points=""" [mako.cache] dogpile.cache = dogpile.cache.plugins.mako_cache:MakoPlugin """, zip_safe=False, install_requires=['dogpile.core>=0.4.1'], test_suite='nose.collector', tests_require=['nose', 'mock', 'Mako'], )
<commit_before>import os import sys import re from setuptools import setup, find_packages v = open(os.path.join(os.path.dirname(__file__), 'dogpile', 'cache', '__init__.py')) VERSION = re.compile(r".*__version__ = '(.*?)'", re.S).match(v.read()).group(1) v.close() readme = os.path.join(os.path.dirname(__file__), 'README.rst') setup(name='dogpile.cache', version=VERSION, description="A caching front-end based on the Dogpile lock.", long_description=open(readme).read(), classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python', 'Programming Language :: Python :: 3', ], keywords='caching', author='Mike Bayer', author_email='mike_mp@zzzcomputing.com', url='http://bitbucket.org/zzzeek/dogpile.cache', license='BSD', packages=find_packages('.', exclude=['ez_setup', 'tests*']), namespace_packages=['dogpile'], entry_points=""" [mako.cache] dogpile.cache = dogpile.cache.plugins.mako_cache:MakoPlugin """, zip_safe=False, install_requires=['dogpile.core>=0.4.1'], test_suite='nose.collector', tests_require=['nose', 'mock'], ) <commit_msg>Add missing test Mako test dependency.<commit_after>import os import sys import re from setuptools import setup, find_packages v = open(os.path.join(os.path.dirname(__file__), 'dogpile', 'cache', '__init__.py')) VERSION = re.compile(r".*__version__ = '(.*?)'", re.S).match(v.read()).group(1) v.close() readme = os.path.join(os.path.dirname(__file__), 'README.rst') setup(name='dogpile.cache', version=VERSION, description="A caching front-end based on the Dogpile lock.", long_description=open(readme).read(), classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python', 'Programming Language :: Python :: 3', ], keywords='caching', author='Mike Bayer', author_email='mike_mp@zzzcomputing.com', url='http://bitbucket.org/zzzeek/dogpile.cache', license='BSD', packages=find_packages('.', exclude=['ez_setup', 'tests*']), namespace_packages=['dogpile'], entry_points=""" [mako.cache] dogpile.cache = dogpile.cache.plugins.mako_cache:MakoPlugin """, zip_safe=False, install_requires=['dogpile.core>=0.4.1'], test_suite='nose.collector', tests_require=['nose', 'mock', 'Mako'], )
c46b7bb5d933ddcf9faa4028f1ea6b93399b516e
setup.py
setup.py
from setuptools import setup, find_packages import os here = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(here, 'README.rst')).read() NEWS = open(os.path.join(here, 'NEWS.txt')).read() version = '0.7' install_requires = [ "Sphinx >= 1.2", "six", ] setup(name='hieroglyph', version=version, description="", long_description=README + '\n\n' + NEWS, classifiers=[ 'License :: OSI Approved :: BSD License', 'Topic :: Documentation', 'Topic :: Text Processing', "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", ], keywords='', author='Nathan Yergler', author_email='nathan@yergler.net', url='https://github.com/nyergler/hieroglyph', license='BSD', packages=find_packages('src'), package_dir={'': 'src'}, include_package_data=True, zip_safe=False, install_requires=install_requires, entry_points={ 'console_scripts': [ 'hieroglyph=hieroglyph.quickstart:main', 'hieroglyph-quickstart=hieroglyph.quickstart:compatibility', ], }, test_suite='hieroglyph.tests', tests_require=[ 'beautifulsoup4', 'mock', ], )
from setuptools import setup, find_packages import os here = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(here, 'README.rst')).read() NEWS = open(os.path.join(here, 'NEWS.txt')).read() version = '0.7' install_requires = [ "Sphinx >= 1.1", "six", ] setup(name='hieroglyph', version=version, description="", long_description=README + '\n\n' + NEWS, classifiers=[ 'License :: OSI Approved :: BSD License', 'Topic :: Documentation', 'Topic :: Text Processing', "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", ], keywords='', author='Nathan Yergler', author_email='nathan@yergler.net', url='https://github.com/nyergler/hieroglyph', license='BSD', packages=find_packages('src'), package_dir={'': 'src'}, include_package_data=True, zip_safe=False, install_requires=install_requires, entry_points={ 'console_scripts': [ 'hieroglyph=hieroglyph.quickstart:main', 'hieroglyph-quickstart=hieroglyph.quickstart:compatibility', ], }, test_suite='hieroglyph.tests', tests_require=[ 'beautifulsoup4', 'mock', ], )
Change Sphinx dependency to 1.1
Change Sphinx dependency to 1.1 According to @nyergler 1.1 should be sufficient, I hadn't thought to check travis or tox's conf files for the information.
Python
bsd-3-clause
nyergler/hieroglyph,nyergler/hieroglyph,nyergler/hieroglyph,attakei/hieroglyph,nyergler/hieroglyph,attakei/hieroglyph,attakei/hieroglyph,attakei/hieroglyph
from setuptools import setup, find_packages import os here = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(here, 'README.rst')).read() NEWS = open(os.path.join(here, 'NEWS.txt')).read() version = '0.7' install_requires = [ "Sphinx >= 1.2", "six", ] setup(name='hieroglyph', version=version, description="", long_description=README + '\n\n' + NEWS, classifiers=[ 'License :: OSI Approved :: BSD License', 'Topic :: Documentation', 'Topic :: Text Processing', "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", ], keywords='', author='Nathan Yergler', author_email='nathan@yergler.net', url='https://github.com/nyergler/hieroglyph', license='BSD', packages=find_packages('src'), package_dir={'': 'src'}, include_package_data=True, zip_safe=False, install_requires=install_requires, entry_points={ 'console_scripts': [ 'hieroglyph=hieroglyph.quickstart:main', 'hieroglyph-quickstart=hieroglyph.quickstart:compatibility', ], }, test_suite='hieroglyph.tests', tests_require=[ 'beautifulsoup4', 'mock', ], ) Change Sphinx dependency to 1.1 According to @nyergler 1.1 should be sufficient, I hadn't thought to check travis or tox's conf files for the information.
from setuptools import setup, find_packages import os here = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(here, 'README.rst')).read() NEWS = open(os.path.join(here, 'NEWS.txt')).read() version = '0.7' install_requires = [ "Sphinx >= 1.1", "six", ] setup(name='hieroglyph', version=version, description="", long_description=README + '\n\n' + NEWS, classifiers=[ 'License :: OSI Approved :: BSD License', 'Topic :: Documentation', 'Topic :: Text Processing', "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", ], keywords='', author='Nathan Yergler', author_email='nathan@yergler.net', url='https://github.com/nyergler/hieroglyph', license='BSD', packages=find_packages('src'), package_dir={'': 'src'}, include_package_data=True, zip_safe=False, install_requires=install_requires, entry_points={ 'console_scripts': [ 'hieroglyph=hieroglyph.quickstart:main', 'hieroglyph-quickstart=hieroglyph.quickstart:compatibility', ], }, test_suite='hieroglyph.tests', tests_require=[ 'beautifulsoup4', 'mock', ], )
<commit_before>from setuptools import setup, find_packages import os here = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(here, 'README.rst')).read() NEWS = open(os.path.join(here, 'NEWS.txt')).read() version = '0.7' install_requires = [ "Sphinx >= 1.2", "six", ] setup(name='hieroglyph', version=version, description="", long_description=README + '\n\n' + NEWS, classifiers=[ 'License :: OSI Approved :: BSD License', 'Topic :: Documentation', 'Topic :: Text Processing', "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", ], keywords='', author='Nathan Yergler', author_email='nathan@yergler.net', url='https://github.com/nyergler/hieroglyph', license='BSD', packages=find_packages('src'), package_dir={'': 'src'}, include_package_data=True, zip_safe=False, install_requires=install_requires, entry_points={ 'console_scripts': [ 'hieroglyph=hieroglyph.quickstart:main', 'hieroglyph-quickstart=hieroglyph.quickstart:compatibility', ], }, test_suite='hieroglyph.tests', tests_require=[ 'beautifulsoup4', 'mock', ], ) <commit_msg>Change Sphinx dependency to 1.1 According to @nyergler 1.1 should be sufficient, I hadn't thought to check travis or tox's conf files for the information.<commit_after>
from setuptools import setup, find_packages import os here = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(here, 'README.rst')).read() NEWS = open(os.path.join(here, 'NEWS.txt')).read() version = '0.7' install_requires = [ "Sphinx >= 1.1", "six", ] setup(name='hieroglyph', version=version, description="", long_description=README + '\n\n' + NEWS, classifiers=[ 'License :: OSI Approved :: BSD License', 'Topic :: Documentation', 'Topic :: Text Processing', "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", ], keywords='', author='Nathan Yergler', author_email='nathan@yergler.net', url='https://github.com/nyergler/hieroglyph', license='BSD', packages=find_packages('src'), package_dir={'': 'src'}, include_package_data=True, zip_safe=False, install_requires=install_requires, entry_points={ 'console_scripts': [ 'hieroglyph=hieroglyph.quickstart:main', 'hieroglyph-quickstart=hieroglyph.quickstart:compatibility', ], }, test_suite='hieroglyph.tests', tests_require=[ 'beautifulsoup4', 'mock', ], )
from setuptools import setup, find_packages import os here = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(here, 'README.rst')).read() NEWS = open(os.path.join(here, 'NEWS.txt')).read() version = '0.7' install_requires = [ "Sphinx >= 1.2", "six", ] setup(name='hieroglyph', version=version, description="", long_description=README + '\n\n' + NEWS, classifiers=[ 'License :: OSI Approved :: BSD License', 'Topic :: Documentation', 'Topic :: Text Processing', "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", ], keywords='', author='Nathan Yergler', author_email='nathan@yergler.net', url='https://github.com/nyergler/hieroglyph', license='BSD', packages=find_packages('src'), package_dir={'': 'src'}, include_package_data=True, zip_safe=False, install_requires=install_requires, entry_points={ 'console_scripts': [ 'hieroglyph=hieroglyph.quickstart:main', 'hieroglyph-quickstart=hieroglyph.quickstart:compatibility', ], }, test_suite='hieroglyph.tests', tests_require=[ 'beautifulsoup4', 'mock', ], ) Change Sphinx dependency to 1.1 According to @nyergler 1.1 should be sufficient, I hadn't thought to check travis or tox's conf files for the information.from setuptools import setup, find_packages import os here = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(here, 'README.rst')).read() NEWS = open(os.path.join(here, 'NEWS.txt')).read() version = '0.7' install_requires = [ "Sphinx >= 1.1", "six", ] setup(name='hieroglyph', version=version, description="", long_description=README + '\n\n' + NEWS, classifiers=[ 'License :: OSI Approved :: BSD License', 'Topic :: Documentation', 'Topic :: Text Processing', "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", ], keywords='', author='Nathan Yergler', author_email='nathan@yergler.net', url='https://github.com/nyergler/hieroglyph', license='BSD', packages=find_packages('src'), package_dir={'': 'src'}, include_package_data=True, zip_safe=False, install_requires=install_requires, entry_points={ 'console_scripts': [ 'hieroglyph=hieroglyph.quickstart:main', 'hieroglyph-quickstart=hieroglyph.quickstart:compatibility', ], }, test_suite='hieroglyph.tests', tests_require=[ 'beautifulsoup4', 'mock', ], )
<commit_before>from setuptools import setup, find_packages import os here = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(here, 'README.rst')).read() NEWS = open(os.path.join(here, 'NEWS.txt')).read() version = '0.7' install_requires = [ "Sphinx >= 1.2", "six", ] setup(name='hieroglyph', version=version, description="", long_description=README + '\n\n' + NEWS, classifiers=[ 'License :: OSI Approved :: BSD License', 'Topic :: Documentation', 'Topic :: Text Processing', "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", ], keywords='', author='Nathan Yergler', author_email='nathan@yergler.net', url='https://github.com/nyergler/hieroglyph', license='BSD', packages=find_packages('src'), package_dir={'': 'src'}, include_package_data=True, zip_safe=False, install_requires=install_requires, entry_points={ 'console_scripts': [ 'hieroglyph=hieroglyph.quickstart:main', 'hieroglyph-quickstart=hieroglyph.quickstart:compatibility', ], }, test_suite='hieroglyph.tests', tests_require=[ 'beautifulsoup4', 'mock', ], ) <commit_msg>Change Sphinx dependency to 1.1 According to @nyergler 1.1 should be sufficient, I hadn't thought to check travis or tox's conf files for the information.<commit_after>from setuptools import setup, find_packages import os here = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(here, 'README.rst')).read() NEWS = open(os.path.join(here, 'NEWS.txt')).read() version = '0.7' install_requires = [ "Sphinx >= 1.1", "six", ] setup(name='hieroglyph', version=version, description="", long_description=README + '\n\n' + NEWS, classifiers=[ 'License :: OSI Approved :: BSD License', 'Topic :: Documentation', 'Topic :: Text Processing', "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", ], keywords='', author='Nathan Yergler', author_email='nathan@yergler.net', url='https://github.com/nyergler/hieroglyph', license='BSD', packages=find_packages('src'), package_dir={'': 'src'}, include_package_data=True, zip_safe=False, install_requires=install_requires, entry_points={ 'console_scripts': [ 'hieroglyph=hieroglyph.quickstart:main', 'hieroglyph-quickstart=hieroglyph.quickstart:compatibility', ], }, test_suite='hieroglyph.tests', tests_require=[ 'beautifulsoup4', 'mock', ], )
dd5276a3cf434267b6a94647c07b55065efd37b0
setup.py
setup.py
from setuptools import setup import sys sys.path.insert(0, 'src') from rosdep2 import __version__ setup(name='rosdep', version= __version__, packages=['rosdep2', 'rosdep2.platforms'], package_dir = {'':'src'}, # data_files=[('man/man1', ['doc/man/rosdep.1'])], install_requires = ['rospkg'], scripts = [ 'scripts/rosdep', 'scripts/rosdep-gbp-brew', 'scripts/rosdep-source', ], author = "Tully Foote, Ken Conley", author_email = "foote@willowgarage.com, kwc@willowgarage.com", url = "http://www.ros.org/wiki/rosdep", download_url = "http://pr.willowgarage.com/downloads/rosdep/", keywords = ["ROS"], classifiers = [ "Programming Language :: Python", "License :: OSI Approved :: BSD License" ], description = "rosdep system dependency installation tool", long_description = """\ Command-line tool for installing system dependencies on a variety of platforms. """, license = "BSD" )
from setuptools import setup import sys sys.path.insert(0, 'src') from rosdep2 import __version__ setup(name='rosdep', version= __version__, packages=['rosdep2', 'rosdep2.platforms'], package_dir = {'':'src'}, # data_files=[('man/man1', ['doc/man/rosdep.1'])], install_requires = ['rospkg'], setup_requires = ['nose>=1.0'], test_suite = 'nose.collector', test_requires = ['mock'], scripts = [ 'scripts/rosdep', 'scripts/rosdep-gbp-brew', 'scripts/rosdep-source', ], author = "Tully Foote, Ken Conley", author_email = "foote@willowgarage.com, kwc@willowgarage.com", url = "http://www.ros.org/wiki/rosdep", download_url = "http://pr.willowgarage.com/downloads/rosdep/", keywords = ["ROS"], classifiers = [ "Programming Language :: Python", "License :: OSI Approved :: BSD License" ], description = "rosdep system dependency installation tool", long_description = """\ Command-line tool for installing system dependencies on a variety of platforms. """, license = "BSD" )
Add test deps on nose, mock.
Add test deps on nose, mock.
Python
bsd-3-clause
alessandro-aglietti/rosdep,spaghetti-/rosdep,georgepar/rosdep,alessandro-aglietti/rosdep,wkentaro/rosdep,spaghetti-/rosdep,ros-infrastructure/rosdep,allenh1/rosdep,ros-infrastructure/rosdep,sorki/rosdep,georgepar/rosdep,sorki/rosdep,wkentaro/rosdep,aymanim/rosdep,allenh1/rosdep,aymanim/rosdep
from setuptools import setup import sys sys.path.insert(0, 'src') from rosdep2 import __version__ setup(name='rosdep', version= __version__, packages=['rosdep2', 'rosdep2.platforms'], package_dir = {'':'src'}, # data_files=[('man/man1', ['doc/man/rosdep.1'])], install_requires = ['rospkg'], scripts = [ 'scripts/rosdep', 'scripts/rosdep-gbp-brew', 'scripts/rosdep-source', ], author = "Tully Foote, Ken Conley", author_email = "foote@willowgarage.com, kwc@willowgarage.com", url = "http://www.ros.org/wiki/rosdep", download_url = "http://pr.willowgarage.com/downloads/rosdep/", keywords = ["ROS"], classifiers = [ "Programming Language :: Python", "License :: OSI Approved :: BSD License" ], description = "rosdep system dependency installation tool", long_description = """\ Command-line tool for installing system dependencies on a variety of platforms. """, license = "BSD" ) Add test deps on nose, mock.
from setuptools import setup import sys sys.path.insert(0, 'src') from rosdep2 import __version__ setup(name='rosdep', version= __version__, packages=['rosdep2', 'rosdep2.platforms'], package_dir = {'':'src'}, # data_files=[('man/man1', ['doc/man/rosdep.1'])], install_requires = ['rospkg'], setup_requires = ['nose>=1.0'], test_suite = 'nose.collector', test_requires = ['mock'], scripts = [ 'scripts/rosdep', 'scripts/rosdep-gbp-brew', 'scripts/rosdep-source', ], author = "Tully Foote, Ken Conley", author_email = "foote@willowgarage.com, kwc@willowgarage.com", url = "http://www.ros.org/wiki/rosdep", download_url = "http://pr.willowgarage.com/downloads/rosdep/", keywords = ["ROS"], classifiers = [ "Programming Language :: Python", "License :: OSI Approved :: BSD License" ], description = "rosdep system dependency installation tool", long_description = """\ Command-line tool for installing system dependencies on a variety of platforms. """, license = "BSD" )
<commit_before>from setuptools import setup import sys sys.path.insert(0, 'src') from rosdep2 import __version__ setup(name='rosdep', version= __version__, packages=['rosdep2', 'rosdep2.platforms'], package_dir = {'':'src'}, # data_files=[('man/man1', ['doc/man/rosdep.1'])], install_requires = ['rospkg'], scripts = [ 'scripts/rosdep', 'scripts/rosdep-gbp-brew', 'scripts/rosdep-source', ], author = "Tully Foote, Ken Conley", author_email = "foote@willowgarage.com, kwc@willowgarage.com", url = "http://www.ros.org/wiki/rosdep", download_url = "http://pr.willowgarage.com/downloads/rosdep/", keywords = ["ROS"], classifiers = [ "Programming Language :: Python", "License :: OSI Approved :: BSD License" ], description = "rosdep system dependency installation tool", long_description = """\ Command-line tool for installing system dependencies on a variety of platforms. """, license = "BSD" ) <commit_msg>Add test deps on nose, mock.<commit_after>
from setuptools import setup import sys sys.path.insert(0, 'src') from rosdep2 import __version__ setup(name='rosdep', version= __version__, packages=['rosdep2', 'rosdep2.platforms'], package_dir = {'':'src'}, # data_files=[('man/man1', ['doc/man/rosdep.1'])], install_requires = ['rospkg'], setup_requires = ['nose>=1.0'], test_suite = 'nose.collector', test_requires = ['mock'], scripts = [ 'scripts/rosdep', 'scripts/rosdep-gbp-brew', 'scripts/rosdep-source', ], author = "Tully Foote, Ken Conley", author_email = "foote@willowgarage.com, kwc@willowgarage.com", url = "http://www.ros.org/wiki/rosdep", download_url = "http://pr.willowgarage.com/downloads/rosdep/", keywords = ["ROS"], classifiers = [ "Programming Language :: Python", "License :: OSI Approved :: BSD License" ], description = "rosdep system dependency installation tool", long_description = """\ Command-line tool for installing system dependencies on a variety of platforms. """, license = "BSD" )
from setuptools import setup import sys sys.path.insert(0, 'src') from rosdep2 import __version__ setup(name='rosdep', version= __version__, packages=['rosdep2', 'rosdep2.platforms'], package_dir = {'':'src'}, # data_files=[('man/man1', ['doc/man/rosdep.1'])], install_requires = ['rospkg'], scripts = [ 'scripts/rosdep', 'scripts/rosdep-gbp-brew', 'scripts/rosdep-source', ], author = "Tully Foote, Ken Conley", author_email = "foote@willowgarage.com, kwc@willowgarage.com", url = "http://www.ros.org/wiki/rosdep", download_url = "http://pr.willowgarage.com/downloads/rosdep/", keywords = ["ROS"], classifiers = [ "Programming Language :: Python", "License :: OSI Approved :: BSD License" ], description = "rosdep system dependency installation tool", long_description = """\ Command-line tool for installing system dependencies on a variety of platforms. """, license = "BSD" ) Add test deps on nose, mock.from setuptools import setup import sys sys.path.insert(0, 'src') from rosdep2 import __version__ setup(name='rosdep', version= __version__, packages=['rosdep2', 'rosdep2.platforms'], package_dir = {'':'src'}, # data_files=[('man/man1', ['doc/man/rosdep.1'])], install_requires = ['rospkg'], setup_requires = ['nose>=1.0'], test_suite = 'nose.collector', test_requires = ['mock'], scripts = [ 'scripts/rosdep', 'scripts/rosdep-gbp-brew', 'scripts/rosdep-source', ], author = "Tully Foote, Ken Conley", author_email = "foote@willowgarage.com, kwc@willowgarage.com", url = "http://www.ros.org/wiki/rosdep", download_url = "http://pr.willowgarage.com/downloads/rosdep/", keywords = ["ROS"], classifiers = [ "Programming Language :: Python", "License :: OSI Approved :: BSD License" ], description = "rosdep system dependency installation tool", long_description = """\ Command-line tool for installing system dependencies on a variety of platforms. """, license = "BSD" )
<commit_before>from setuptools import setup import sys sys.path.insert(0, 'src') from rosdep2 import __version__ setup(name='rosdep', version= __version__, packages=['rosdep2', 'rosdep2.platforms'], package_dir = {'':'src'}, # data_files=[('man/man1', ['doc/man/rosdep.1'])], install_requires = ['rospkg'], scripts = [ 'scripts/rosdep', 'scripts/rosdep-gbp-brew', 'scripts/rosdep-source', ], author = "Tully Foote, Ken Conley", author_email = "foote@willowgarage.com, kwc@willowgarage.com", url = "http://www.ros.org/wiki/rosdep", download_url = "http://pr.willowgarage.com/downloads/rosdep/", keywords = ["ROS"], classifiers = [ "Programming Language :: Python", "License :: OSI Approved :: BSD License" ], description = "rosdep system dependency installation tool", long_description = """\ Command-line tool for installing system dependencies on a variety of platforms. """, license = "BSD" ) <commit_msg>Add test deps on nose, mock.<commit_after>from setuptools import setup import sys sys.path.insert(0, 'src') from rosdep2 import __version__ setup(name='rosdep', version= __version__, packages=['rosdep2', 'rosdep2.platforms'], package_dir = {'':'src'}, # data_files=[('man/man1', ['doc/man/rosdep.1'])], install_requires = ['rospkg'], setup_requires = ['nose>=1.0'], test_suite = 'nose.collector', test_requires = ['mock'], scripts = [ 'scripts/rosdep', 'scripts/rosdep-gbp-brew', 'scripts/rosdep-source', ], author = "Tully Foote, Ken Conley", author_email = "foote@willowgarage.com, kwc@willowgarage.com", url = "http://www.ros.org/wiki/rosdep", download_url = "http://pr.willowgarage.com/downloads/rosdep/", keywords = ["ROS"], classifiers = [ "Programming Language :: Python", "License :: OSI Approved :: BSD License" ], description = "rosdep system dependency installation tool", long_description = """\ Command-line tool for installing system dependencies on a variety of platforms. """, license = "BSD" )
fc6a0edca3ae42cb3570ddf62c841282bb0229aa
integration/util.py
integration/util.py
from fabric.api import env class Integration(object): def setup(self): env.host_string = "127.0.0.1"
from fabric.api import env class Integration(object): def setup(self): if not env.host_string: # Allow runtime selection env.host_string = "127.0.0.1"
Allow easy local exec of integration suite via eg -H
Allow easy local exec of integration suite via eg -H
Python
bsd-2-clause
kmonsoor/fabric,haridsv/fabric,kxxoling/fabric,cgvarela/fabric,rane-hs/fabric-py3,tolbkni/fabric,jaraco/fabric,TarasRudnyk/fabric,cmattoon/fabric,raimon49/fabric,itoed/fabric,pashinin/fabric,ploxiln/fabric,elijah513/fabric,opavader/fabric,xLegoz/fabric,rbramwell/fabric,qinrong/fabric,bspink/fabric,hrubi/fabric,StackStorm/fabric,tekapo/fabric,askulkarni2/fabric,mathiasertl/fabric,SamuelMarks/fabric,rodrigc/fabric,bitprophet/fabric,amaniak/fabric,sdelements/fabric,pgroudas/fabric,fernandezcuesta/fabric,bitmonk/fabric,MjAbuz/fabric,likesxuqiang/fabric,getsentry/fabric
from fabric.api import env class Integration(object): def setup(self): env.host_string = "127.0.0.1" Allow easy local exec of integration suite via eg -H
from fabric.api import env class Integration(object): def setup(self): if not env.host_string: # Allow runtime selection env.host_string = "127.0.0.1"
<commit_before>from fabric.api import env class Integration(object): def setup(self): env.host_string = "127.0.0.1" <commit_msg>Allow easy local exec of integration suite via eg -H<commit_after>
from fabric.api import env class Integration(object): def setup(self): if not env.host_string: # Allow runtime selection env.host_string = "127.0.0.1"
from fabric.api import env class Integration(object): def setup(self): env.host_string = "127.0.0.1" Allow easy local exec of integration suite via eg -Hfrom fabric.api import env class Integration(object): def setup(self): if not env.host_string: # Allow runtime selection env.host_string = "127.0.0.1"
<commit_before>from fabric.api import env class Integration(object): def setup(self): env.host_string = "127.0.0.1" <commit_msg>Allow easy local exec of integration suite via eg -H<commit_after>from fabric.api import env class Integration(object): def setup(self): if not env.host_string: # Allow runtime selection env.host_string = "127.0.0.1"
78bb3ecb5fe36b2964223a17e927d208b2087777
setup.py
setup.py
#!/usr/bin/env python from distutils.core import setup setup( name='vertigo', version='0.1.2', license='BSD', author="Daniel Lepage", author_email="dplepage@gmail.com", packages=['vertigo',], long_description=open('README.rst').read(), url='https://github.com/dplepage/vertigo', classifiers=[ "Development Status :: 3 - Alpha", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", ] )
#!/usr/bin/env python from distutils.core import setup setup( name='vertigo', version='0.1.2', license='BSD', author="Daniel Lepage", author_email="dplepage@gmail.com", packages=['vertigo',], long_description=""" ========================================= Vertigo: Some really simple graph tools ========================================= Vertigo is a small collection of classes and functions for building and working with graphs with labeled edges. This is useful because dictionaries are just graphs with labeled edges, and objects in Python are just dictionaries, so really this applies to pretty much all objects. See README.rst for more info """, url='https://github.com/dplepage/vertigo', classifiers=[ "Development Status :: 3 - Alpha", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", ] )
Add pypi description that's shorter than README.rst.
Add pypi description that's shorter than README.rst.
Python
bsd-3-clause
dplepage/vertigo
#!/usr/bin/env python from distutils.core import setup setup( name='vertigo', version='0.1.2', license='BSD', author="Daniel Lepage", author_email="dplepage@gmail.com", packages=['vertigo',], long_description=open('README.rst').read(), url='https://github.com/dplepage/vertigo', classifiers=[ "Development Status :: 3 - Alpha", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", ] )Add pypi description that's shorter than README.rst.
#!/usr/bin/env python from distutils.core import setup setup( name='vertigo', version='0.1.2', license='BSD', author="Daniel Lepage", author_email="dplepage@gmail.com", packages=['vertigo',], long_description=""" ========================================= Vertigo: Some really simple graph tools ========================================= Vertigo is a small collection of classes and functions for building and working with graphs with labeled edges. This is useful because dictionaries are just graphs with labeled edges, and objects in Python are just dictionaries, so really this applies to pretty much all objects. See README.rst for more info """, url='https://github.com/dplepage/vertigo', classifiers=[ "Development Status :: 3 - Alpha", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", ] )
<commit_before>#!/usr/bin/env python from distutils.core import setup setup( name='vertigo', version='0.1.2', license='BSD', author="Daniel Lepage", author_email="dplepage@gmail.com", packages=['vertigo',], long_description=open('README.rst').read(), url='https://github.com/dplepage/vertigo', classifiers=[ "Development Status :: 3 - Alpha", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", ] )<commit_msg>Add pypi description that's shorter than README.rst.<commit_after>
#!/usr/bin/env python from distutils.core import setup setup( name='vertigo', version='0.1.2', license='BSD', author="Daniel Lepage", author_email="dplepage@gmail.com", packages=['vertigo',], long_description=""" ========================================= Vertigo: Some really simple graph tools ========================================= Vertigo is a small collection of classes and functions for building and working with graphs with labeled edges. This is useful because dictionaries are just graphs with labeled edges, and objects in Python are just dictionaries, so really this applies to pretty much all objects. See README.rst for more info """, url='https://github.com/dplepage/vertigo', classifiers=[ "Development Status :: 3 - Alpha", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", ] )
#!/usr/bin/env python from distutils.core import setup setup( name='vertigo', version='0.1.2', license='BSD', author="Daniel Lepage", author_email="dplepage@gmail.com", packages=['vertigo',], long_description=open('README.rst').read(), url='https://github.com/dplepage/vertigo', classifiers=[ "Development Status :: 3 - Alpha", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", ] )Add pypi description that's shorter than README.rst.#!/usr/bin/env python from distutils.core import setup setup( name='vertigo', version='0.1.2', license='BSD', author="Daniel Lepage", author_email="dplepage@gmail.com", packages=['vertigo',], long_description=""" ========================================= Vertigo: Some really simple graph tools ========================================= Vertigo is a small collection of classes and functions for building and working with graphs with labeled edges. This is useful because dictionaries are just graphs with labeled edges, and objects in Python are just dictionaries, so really this applies to pretty much all objects. See README.rst for more info """, url='https://github.com/dplepage/vertigo', classifiers=[ "Development Status :: 3 - Alpha", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", ] )
<commit_before>#!/usr/bin/env python from distutils.core import setup setup( name='vertigo', version='0.1.2', license='BSD', author="Daniel Lepage", author_email="dplepage@gmail.com", packages=['vertigo',], long_description=open('README.rst').read(), url='https://github.com/dplepage/vertigo', classifiers=[ "Development Status :: 3 - Alpha", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", ] )<commit_msg>Add pypi description that's shorter than README.rst.<commit_after>#!/usr/bin/env python from distutils.core import setup setup( name='vertigo', version='0.1.2', license='BSD', author="Daniel Lepage", author_email="dplepage@gmail.com", packages=['vertigo',], long_description=""" ========================================= Vertigo: Some really simple graph tools ========================================= Vertigo is a small collection of classes and functions for building and working with graphs with labeled edges. This is useful because dictionaries are just graphs with labeled edges, and objects in Python are just dictionaries, so really this applies to pretty much all objects. See README.rst for more info """, url='https://github.com/dplepage/vertigo', classifiers=[ "Development Status :: 3 - Alpha", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", ] )
ca2506cea843be7f8a48929d4d177a982ab6f693
setup.py
setup.py
import os from setuptools import setup def read(name): return open(os.path.join(os.path.dirname(__file__), name), 'r').read() setup( name="kitsu.http", version="0.0.7", description="Low-level HTTP library for Python", long_description=read('README'), author="Alexey Borzenkov", author_email="snaury@gmail.com", url="http://git.kitsu.ru/mine/kitsu-http.git", license="MIT License", platforms=['any'], namespace_packages=['kitsu', 'kitsu.http'], packages=['kitsu', 'kitsu.http'], test_suite='tests.test_suite', classifiers=[ 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python', 'Operating System :: OS Independent', 'Topic :: Internet', 'Topic :: Software Development :: Libraries :: Python Modules', ], )
import os from setuptools import setup def read(name): return open(os.path.join(os.path.dirname(__file__), name), 'r').read() setup( name="kitsu.http", version="0.0.7", description="Low-level HTTP library for Python", long_description=read('README'), author="Alexey Borzenkov", author_email="snaury@gmail.com", url="https://github.com/snaury/kitsu.http", license="MIT License", platforms=['any'], namespace_packages=['kitsu', 'kitsu.http'], packages=['kitsu', 'kitsu.http'], test_suite='tests.test_suite', classifiers=[ 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python', 'Operating System :: OS Independent', 'Topic :: Internet', 'Topic :: Software Development :: Libraries :: Python Modules', ], )
Change url to point to github
Change url to point to github
Python
mit
snaury/kitsu.http,snaury/kitsu.http
import os from setuptools import setup def read(name): return open(os.path.join(os.path.dirname(__file__), name), 'r').read() setup( name="kitsu.http", version="0.0.7", description="Low-level HTTP library for Python", long_description=read('README'), author="Alexey Borzenkov", author_email="snaury@gmail.com", url="http://git.kitsu.ru/mine/kitsu-http.git", license="MIT License", platforms=['any'], namespace_packages=['kitsu', 'kitsu.http'], packages=['kitsu', 'kitsu.http'], test_suite='tests.test_suite', classifiers=[ 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python', 'Operating System :: OS Independent', 'Topic :: Internet', 'Topic :: Software Development :: Libraries :: Python Modules', ], ) Change url to point to github
import os from setuptools import setup def read(name): return open(os.path.join(os.path.dirname(__file__), name), 'r').read() setup( name="kitsu.http", version="0.0.7", description="Low-level HTTP library for Python", long_description=read('README'), author="Alexey Borzenkov", author_email="snaury@gmail.com", url="https://github.com/snaury/kitsu.http", license="MIT License", platforms=['any'], namespace_packages=['kitsu', 'kitsu.http'], packages=['kitsu', 'kitsu.http'], test_suite='tests.test_suite', classifiers=[ 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python', 'Operating System :: OS Independent', 'Topic :: Internet', 'Topic :: Software Development :: Libraries :: Python Modules', ], )
<commit_before>import os from setuptools import setup def read(name): return open(os.path.join(os.path.dirname(__file__), name), 'r').read() setup( name="kitsu.http", version="0.0.7", description="Low-level HTTP library for Python", long_description=read('README'), author="Alexey Borzenkov", author_email="snaury@gmail.com", url="http://git.kitsu.ru/mine/kitsu-http.git", license="MIT License", platforms=['any'], namespace_packages=['kitsu', 'kitsu.http'], packages=['kitsu', 'kitsu.http'], test_suite='tests.test_suite', classifiers=[ 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python', 'Operating System :: OS Independent', 'Topic :: Internet', 'Topic :: Software Development :: Libraries :: Python Modules', ], ) <commit_msg>Change url to point to github<commit_after>
import os from setuptools import setup def read(name): return open(os.path.join(os.path.dirname(__file__), name), 'r').read() setup( name="kitsu.http", version="0.0.7", description="Low-level HTTP library for Python", long_description=read('README'), author="Alexey Borzenkov", author_email="snaury@gmail.com", url="https://github.com/snaury/kitsu.http", license="MIT License", platforms=['any'], namespace_packages=['kitsu', 'kitsu.http'], packages=['kitsu', 'kitsu.http'], test_suite='tests.test_suite', classifiers=[ 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python', 'Operating System :: OS Independent', 'Topic :: Internet', 'Topic :: Software Development :: Libraries :: Python Modules', ], )
import os from setuptools import setup def read(name): return open(os.path.join(os.path.dirname(__file__), name), 'r').read() setup( name="kitsu.http", version="0.0.7", description="Low-level HTTP library for Python", long_description=read('README'), author="Alexey Borzenkov", author_email="snaury@gmail.com", url="http://git.kitsu.ru/mine/kitsu-http.git", license="MIT License", platforms=['any'], namespace_packages=['kitsu', 'kitsu.http'], packages=['kitsu', 'kitsu.http'], test_suite='tests.test_suite', classifiers=[ 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python', 'Operating System :: OS Independent', 'Topic :: Internet', 'Topic :: Software Development :: Libraries :: Python Modules', ], ) Change url to point to githubimport os from setuptools import setup def read(name): return open(os.path.join(os.path.dirname(__file__), name), 'r').read() setup( name="kitsu.http", version="0.0.7", description="Low-level HTTP library for Python", long_description=read('README'), author="Alexey Borzenkov", author_email="snaury@gmail.com", url="https://github.com/snaury/kitsu.http", license="MIT License", platforms=['any'], namespace_packages=['kitsu', 'kitsu.http'], packages=['kitsu', 'kitsu.http'], test_suite='tests.test_suite', classifiers=[ 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python', 'Operating System :: OS Independent', 'Topic :: Internet', 'Topic :: Software Development :: Libraries :: Python Modules', ], )
<commit_before>import os from setuptools import setup def read(name): return open(os.path.join(os.path.dirname(__file__), name), 'r').read() setup( name="kitsu.http", version="0.0.7", description="Low-level HTTP library for Python", long_description=read('README'), author="Alexey Borzenkov", author_email="snaury@gmail.com", url="http://git.kitsu.ru/mine/kitsu-http.git", license="MIT License", platforms=['any'], namespace_packages=['kitsu', 'kitsu.http'], packages=['kitsu', 'kitsu.http'], test_suite='tests.test_suite', classifiers=[ 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python', 'Operating System :: OS Independent', 'Topic :: Internet', 'Topic :: Software Development :: Libraries :: Python Modules', ], ) <commit_msg>Change url to point to github<commit_after>import os from setuptools import setup def read(name): return open(os.path.join(os.path.dirname(__file__), name), 'r').read() setup( name="kitsu.http", version="0.0.7", description="Low-level HTTP library for Python", long_description=read('README'), author="Alexey Borzenkov", author_email="snaury@gmail.com", url="https://github.com/snaury/kitsu.http", license="MIT License", platforms=['any'], namespace_packages=['kitsu', 'kitsu.http'], packages=['kitsu', 'kitsu.http'], test_suite='tests.test_suite', classifiers=[ 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python', 'Operating System :: OS Independent', 'Topic :: Internet', 'Topic :: Software Development :: Libraries :: Python Modules', ], )
3d6185f8080906fbb19314bca634071be506292b
setup.py
setup.py
from setuptools import setup, find_packages setup( name='pycalico', # Don't need a version until we publish to PIP or other forum. # version='0.0.0', description='A Python API to Calico', # The project's main homepage. url='https://github.com/projectcalico/libcalico/', # Author details author='Project Calico', author_email='calico-tech@lists.projectcalico.org', # Choose your license license='Apache 2.0', # See https://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Operating System :: POSIX :: Linux', 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Topic :: System :: Networking', ], # What does your project relate to? keywords='calico docker etcd mesos kubernetes rkt openstack', package_dir={"": "calico_containers"}, packages=["pycalico"], # List run-time dependencies here. These will be installed by pip when # your project is installed. For an analysis of "install_requires" vs pip's # requirements files see: # https://packaging.python.org/en/latest/requirements.html install_requires=['netaddr', 'python-etcd'], )
from setuptools import setup, find_packages setup( name='pycalico', # Don't need a version until we publish to PIP or other forum. # version='0.0.0', description='A Python API to Calico', # The project's main homepage. url='https://github.com/projectcalico/libcalico/', # Author details author='Project Calico', author_email='calico-tech@lists.projectcalico.org', # Choose your license license='Apache 2.0', # See https://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Operating System :: POSIX :: Linux', 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Topic :: System :: Networking', ], # What does your project relate to? keywords='calico docker etcd mesos kubernetes rkt openstack', package_dir={"": "calico_containers"}, packages=["pycalico"], # List run-time dependencies here. These will be installed by pip when # your project is installed. For an analysis of "install_requires" vs pip's # requirements files see: # https://packaging.python.org/en/latest/requirements.html install_requires=['netaddr', 'python-etcd', 'subprocess32'], )
Add subprocess32 as package dependency
Add subprocess32 as package dependency
Python
apache-2.0
L-MA/libcalico,alexhersh/libcalico,TrimBiggs/libcalico,projectcalico/libcalico,insequent/libcalico,tomdee/libcalico,djosborne/libcalico,caseydavenport/libcalico,plwhite/libcalico,Symmetric/libcalico
from setuptools import setup, find_packages setup( name='pycalico', # Don't need a version until we publish to PIP or other forum. # version='0.0.0', description='A Python API to Calico', # The project's main homepage. url='https://github.com/projectcalico/libcalico/', # Author details author='Project Calico', author_email='calico-tech@lists.projectcalico.org', # Choose your license license='Apache 2.0', # See https://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Operating System :: POSIX :: Linux', 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Topic :: System :: Networking', ], # What does your project relate to? keywords='calico docker etcd mesos kubernetes rkt openstack', package_dir={"": "calico_containers"}, packages=["pycalico"], # List run-time dependencies here. These will be installed by pip when # your project is installed. For an analysis of "install_requires" vs pip's # requirements files see: # https://packaging.python.org/en/latest/requirements.html install_requires=['netaddr', 'python-etcd'], ) Add subprocess32 as package dependency
from setuptools import setup, find_packages setup( name='pycalico', # Don't need a version until we publish to PIP or other forum. # version='0.0.0', description='A Python API to Calico', # The project's main homepage. url='https://github.com/projectcalico/libcalico/', # Author details author='Project Calico', author_email='calico-tech@lists.projectcalico.org', # Choose your license license='Apache 2.0', # See https://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Operating System :: POSIX :: Linux', 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Topic :: System :: Networking', ], # What does your project relate to? keywords='calico docker etcd mesos kubernetes rkt openstack', package_dir={"": "calico_containers"}, packages=["pycalico"], # List run-time dependencies here. These will be installed by pip when # your project is installed. For an analysis of "install_requires" vs pip's # requirements files see: # https://packaging.python.org/en/latest/requirements.html install_requires=['netaddr', 'python-etcd', 'subprocess32'], )
<commit_before>from setuptools import setup, find_packages setup( name='pycalico', # Don't need a version until we publish to PIP or other forum. # version='0.0.0', description='A Python API to Calico', # The project's main homepage. url='https://github.com/projectcalico/libcalico/', # Author details author='Project Calico', author_email='calico-tech@lists.projectcalico.org', # Choose your license license='Apache 2.0', # See https://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Operating System :: POSIX :: Linux', 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Topic :: System :: Networking', ], # What does your project relate to? keywords='calico docker etcd mesos kubernetes rkt openstack', package_dir={"": "calico_containers"}, packages=["pycalico"], # List run-time dependencies here. These will be installed by pip when # your project is installed. For an analysis of "install_requires" vs pip's # requirements files see: # https://packaging.python.org/en/latest/requirements.html install_requires=['netaddr', 'python-etcd'], ) <commit_msg>Add subprocess32 as package dependency<commit_after>
from setuptools import setup, find_packages setup( name='pycalico', # Don't need a version until we publish to PIP or other forum. # version='0.0.0', description='A Python API to Calico', # The project's main homepage. url='https://github.com/projectcalico/libcalico/', # Author details author='Project Calico', author_email='calico-tech@lists.projectcalico.org', # Choose your license license='Apache 2.0', # See https://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Operating System :: POSIX :: Linux', 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Topic :: System :: Networking', ], # What does your project relate to? keywords='calico docker etcd mesos kubernetes rkt openstack', package_dir={"": "calico_containers"}, packages=["pycalico"], # List run-time dependencies here. These will be installed by pip when # your project is installed. For an analysis of "install_requires" vs pip's # requirements files see: # https://packaging.python.org/en/latest/requirements.html install_requires=['netaddr', 'python-etcd', 'subprocess32'], )
from setuptools import setup, find_packages setup( name='pycalico', # Don't need a version until we publish to PIP or other forum. # version='0.0.0', description='A Python API to Calico', # The project's main homepage. url='https://github.com/projectcalico/libcalico/', # Author details author='Project Calico', author_email='calico-tech@lists.projectcalico.org', # Choose your license license='Apache 2.0', # See https://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Operating System :: POSIX :: Linux', 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Topic :: System :: Networking', ], # What does your project relate to? keywords='calico docker etcd mesos kubernetes rkt openstack', package_dir={"": "calico_containers"}, packages=["pycalico"], # List run-time dependencies here. These will be installed by pip when # your project is installed. For an analysis of "install_requires" vs pip's # requirements files see: # https://packaging.python.org/en/latest/requirements.html install_requires=['netaddr', 'python-etcd'], ) Add subprocess32 as package dependencyfrom setuptools import setup, find_packages setup( name='pycalico', # Don't need a version until we publish to PIP or other forum. # version='0.0.0', description='A Python API to Calico', # The project's main homepage. url='https://github.com/projectcalico/libcalico/', # Author details author='Project Calico', author_email='calico-tech@lists.projectcalico.org', # Choose your license license='Apache 2.0', # See https://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Operating System :: POSIX :: Linux', 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Topic :: System :: Networking', ], # What does your project relate to? keywords='calico docker etcd mesos kubernetes rkt openstack', package_dir={"": "calico_containers"}, packages=["pycalico"], # List run-time dependencies here. These will be installed by pip when # your project is installed. For an analysis of "install_requires" vs pip's # requirements files see: # https://packaging.python.org/en/latest/requirements.html install_requires=['netaddr', 'python-etcd', 'subprocess32'], )
<commit_before>from setuptools import setup, find_packages setup( name='pycalico', # Don't need a version until we publish to PIP or other forum. # version='0.0.0', description='A Python API to Calico', # The project's main homepage. url='https://github.com/projectcalico/libcalico/', # Author details author='Project Calico', author_email='calico-tech@lists.projectcalico.org', # Choose your license license='Apache 2.0', # See https://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Operating System :: POSIX :: Linux', 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Topic :: System :: Networking', ], # What does your project relate to? keywords='calico docker etcd mesos kubernetes rkt openstack', package_dir={"": "calico_containers"}, packages=["pycalico"], # List run-time dependencies here. These will be installed by pip when # your project is installed. For an analysis of "install_requires" vs pip's # requirements files see: # https://packaging.python.org/en/latest/requirements.html install_requires=['netaddr', 'python-etcd'], ) <commit_msg>Add subprocess32 as package dependency<commit_after>from setuptools import setup, find_packages setup( name='pycalico', # Don't need a version until we publish to PIP or other forum. # version='0.0.0', description='A Python API to Calico', # The project's main homepage. url='https://github.com/projectcalico/libcalico/', # Author details author='Project Calico', author_email='calico-tech@lists.projectcalico.org', # Choose your license license='Apache 2.0', # See https://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Operating System :: POSIX :: Linux', 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Topic :: System :: Networking', ], # What does your project relate to? keywords='calico docker etcd mesos kubernetes rkt openstack', package_dir={"": "calico_containers"}, packages=["pycalico"], # List run-time dependencies here. These will be installed by pip when # your project is installed. For an analysis of "install_requires" vs pip's # requirements files see: # https://packaging.python.org/en/latest/requirements.html install_requires=['netaddr', 'python-etcd', 'subprocess32'], )
189bf34b3e769181d82430f48b401c8900a9d99f
setup.py
setup.py
# -*- coding: utf-8 -*- from setuptools import setup, find_packages from aldryn_categories import __version__ # git tag '[version]' # git push --tags origin master # python setup.py sdist upload # python setup.py bdist_wheel upload setup( name='aldryn-categories', version=__version__, url='https://github.com/aldryn/aldryn-categories', license='BSD License', description='Hierarchical categories/taxonomies for your Django project', author='Divio AG', author_email='info@divio.ch', package_data={}, packages=find_packages(), platforms=['OS Independent'], classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', 'Topic :: Software Development', 'Topic :: Software Development :: Libraries', ], install_requires=[ 'django>=1.6,<1.9', 'django-parler>=1.2.1', 'django-treebeard>=2.0', ], include_package_data=True, zip_safe=False )
# -*- coding: utf-8 -*- from setuptools import setup, find_packages from aldryn_categories import __version__ # git tag '[version]' # git push --tags origin master # python setup.py sdist upload # python setup.py bdist_wheel upload setup( name='aldryn-categories', version=__version__, url='https://github.com/aldryn/aldryn-categories', license='BSD License', description='Hierarchical categories/taxonomies for your Django project', author='Divio AG', author_email='info@divio.ch', package_data={}, packages=find_packages(), platforms=['OS Independent'], classifiers=[ # https://pypi.python.org/pypi?%3Aaction=list_classifiers 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', 'Topic :: Software Development', 'Topic :: Software Development :: Libraries', ], install_requires=[ 'django>=1.6,<1.9', 'django-parler>=1.2.1', 'django-treebeard>=2.0', ], include_package_data=True, zip_safe=False )
Update Development Status -> Stable
Update Development Status -> Stable
Python
bsd-3-clause
aldryn/aldryn-categories,aldryn/aldryn-categories
# -*- coding: utf-8 -*- from setuptools import setup, find_packages from aldryn_categories import __version__ # git tag '[version]' # git push --tags origin master # python setup.py sdist upload # python setup.py bdist_wheel upload setup( name='aldryn-categories', version=__version__, url='https://github.com/aldryn/aldryn-categories', license='BSD License', description='Hierarchical categories/taxonomies for your Django project', author='Divio AG', author_email='info@divio.ch', package_data={}, packages=find_packages(), platforms=['OS Independent'], classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', 'Topic :: Software Development', 'Topic :: Software Development :: Libraries', ], install_requires=[ 'django>=1.6,<1.9', 'django-parler>=1.2.1', 'django-treebeard>=2.0', ], include_package_data=True, zip_safe=False ) Update Development Status -> Stable
# -*- coding: utf-8 -*- from setuptools import setup, find_packages from aldryn_categories import __version__ # git tag '[version]' # git push --tags origin master # python setup.py sdist upload # python setup.py bdist_wheel upload setup( name='aldryn-categories', version=__version__, url='https://github.com/aldryn/aldryn-categories', license='BSD License', description='Hierarchical categories/taxonomies for your Django project', author='Divio AG', author_email='info@divio.ch', package_data={}, packages=find_packages(), platforms=['OS Independent'], classifiers=[ # https://pypi.python.org/pypi?%3Aaction=list_classifiers 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', 'Topic :: Software Development', 'Topic :: Software Development :: Libraries', ], install_requires=[ 'django>=1.6,<1.9', 'django-parler>=1.2.1', 'django-treebeard>=2.0', ], include_package_data=True, zip_safe=False )
<commit_before># -*- coding: utf-8 -*- from setuptools import setup, find_packages from aldryn_categories import __version__ # git tag '[version]' # git push --tags origin master # python setup.py sdist upload # python setup.py bdist_wheel upload setup( name='aldryn-categories', version=__version__, url='https://github.com/aldryn/aldryn-categories', license='BSD License', description='Hierarchical categories/taxonomies for your Django project', author='Divio AG', author_email='info@divio.ch', package_data={}, packages=find_packages(), platforms=['OS Independent'], classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', 'Topic :: Software Development', 'Topic :: Software Development :: Libraries', ], install_requires=[ 'django>=1.6,<1.9', 'django-parler>=1.2.1', 'django-treebeard>=2.0', ], include_package_data=True, zip_safe=False ) <commit_msg>Update Development Status -> Stable<commit_after>
# -*- coding: utf-8 -*- from setuptools import setup, find_packages from aldryn_categories import __version__ # git tag '[version]' # git push --tags origin master # python setup.py sdist upload # python setup.py bdist_wheel upload setup( name='aldryn-categories', version=__version__, url='https://github.com/aldryn/aldryn-categories', license='BSD License', description='Hierarchical categories/taxonomies for your Django project', author='Divio AG', author_email='info@divio.ch', package_data={}, packages=find_packages(), platforms=['OS Independent'], classifiers=[ # https://pypi.python.org/pypi?%3Aaction=list_classifiers 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', 'Topic :: Software Development', 'Topic :: Software Development :: Libraries', ], install_requires=[ 'django>=1.6,<1.9', 'django-parler>=1.2.1', 'django-treebeard>=2.0', ], include_package_data=True, zip_safe=False )
# -*- coding: utf-8 -*- from setuptools import setup, find_packages from aldryn_categories import __version__ # git tag '[version]' # git push --tags origin master # python setup.py sdist upload # python setup.py bdist_wheel upload setup( name='aldryn-categories', version=__version__, url='https://github.com/aldryn/aldryn-categories', license='BSD License', description='Hierarchical categories/taxonomies for your Django project', author='Divio AG', author_email='info@divio.ch', package_data={}, packages=find_packages(), platforms=['OS Independent'], classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', 'Topic :: Software Development', 'Topic :: Software Development :: Libraries', ], install_requires=[ 'django>=1.6,<1.9', 'django-parler>=1.2.1', 'django-treebeard>=2.0', ], include_package_data=True, zip_safe=False ) Update Development Status -> Stable# -*- coding: utf-8 -*- from setuptools import setup, find_packages from aldryn_categories import __version__ # git tag '[version]' # git push --tags origin master # python setup.py sdist upload # python setup.py bdist_wheel upload setup( name='aldryn-categories', version=__version__, url='https://github.com/aldryn/aldryn-categories', license='BSD License', description='Hierarchical categories/taxonomies for your Django project', author='Divio AG', author_email='info@divio.ch', package_data={}, packages=find_packages(), platforms=['OS Independent'], classifiers=[ # https://pypi.python.org/pypi?%3Aaction=list_classifiers 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', 'Topic :: Software Development', 'Topic :: Software Development :: Libraries', ], install_requires=[ 'django>=1.6,<1.9', 'django-parler>=1.2.1', 'django-treebeard>=2.0', ], include_package_data=True, zip_safe=False )
<commit_before># -*- coding: utf-8 -*- from setuptools import setup, find_packages from aldryn_categories import __version__ # git tag '[version]' # git push --tags origin master # python setup.py sdist upload # python setup.py bdist_wheel upload setup( name='aldryn-categories', version=__version__, url='https://github.com/aldryn/aldryn-categories', license='BSD License', description='Hierarchical categories/taxonomies for your Django project', author='Divio AG', author_email='info@divio.ch', package_data={}, packages=find_packages(), platforms=['OS Independent'], classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', 'Topic :: Software Development', 'Topic :: Software Development :: Libraries', ], install_requires=[ 'django>=1.6,<1.9', 'django-parler>=1.2.1', 'django-treebeard>=2.0', ], include_package_data=True, zip_safe=False ) <commit_msg>Update Development Status -> Stable<commit_after># -*- coding: utf-8 -*- from setuptools import setup, find_packages from aldryn_categories import __version__ # git tag '[version]' # git push --tags origin master # python setup.py sdist upload # python setup.py bdist_wheel upload setup( name='aldryn-categories', version=__version__, url='https://github.com/aldryn/aldryn-categories', license='BSD License', description='Hierarchical categories/taxonomies for your Django project', author='Divio AG', author_email='info@divio.ch', package_data={}, packages=find_packages(), platforms=['OS Independent'], classifiers=[ # https://pypi.python.org/pypi?%3Aaction=list_classifiers 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', 'Topic :: Software Development', 'Topic :: Software Development :: Libraries', ], install_requires=[ 'django>=1.6,<1.9', 'django-parler>=1.2.1', 'django-treebeard>=2.0', ], include_package_data=True, zip_safe=False )