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
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0ff0ca626c7f1e313fafdb034db77933424fe7ca
|
setup.py
|
setup.py
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
readme = open('README.rst').read()
history = open('HISTORY.rst').read().replace('.. :changelog:', '')
requirements = [
# TODO: put package requirements here
]
test_requirements = [
# TODO: put package test requirements here
]
setup(
name='generalwords',
version='0.1.0',
description='Python Boilerplate contains all the boilerplate you need to create a Python package.',
long_description=readme + '\n\n' + history,
author='Christopher Petrilli',
author_email='petrilli@amber.org',
url='https://github.com/petrilli/generalwords',
packages=[
'generalwords',
],
package_dir={'generalwords':
'generalwords'},
include_package_data=True,
install_requires=requirements,
license="BSD",
zip_safe=False,
keywords='generalwords',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
"Programming Language :: Python :: 2",
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
],
test_suite='tests',
tests_require=test_requirements
)
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
readme = open('README.rst').read()
history = open('HISTORY.rst').read().replace('.. :changelog:', '')
requirements = [
# None
]
test_requirements = [
'tox',
]
setup(
name='generalwords',
version='0.1.0',
description='A somewhat curated collection of words to use in nonce generation.',
long_description=readme + '\n\n' + history,
author='Christopher Petrilli',
author_email='petrilli@amber.org',
url='https://github.com/petrilli/generalwords',
packages=[
'generalwords',
],
package_dir={'generalwords':
'generalwords'},
include_package_data=True,
install_requires=requirements,
license="BSD",
zip_safe=False,
keywords='generalwords',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
"Programming Language :: Python :: 2",
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
],
test_suite='tests',
tests_require=test_requirements
)
|
Update description and add 'tox' as a testing dependency.
|
Update description and add 'tox' as a testing dependency.
|
Python
|
bsd-3-clause
|
petrilli/generalwords
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
readme = open('README.rst').read()
history = open('HISTORY.rst').read().replace('.. :changelog:', '')
requirements = [
# TODO: put package requirements here
]
test_requirements = [
# TODO: put package test requirements here
]
setup(
name='generalwords',
version='0.1.0',
description='Python Boilerplate contains all the boilerplate you need to create a Python package.',
long_description=readme + '\n\n' + history,
author='Christopher Petrilli',
author_email='petrilli@amber.org',
url='https://github.com/petrilli/generalwords',
packages=[
'generalwords',
],
package_dir={'generalwords':
'generalwords'},
include_package_data=True,
install_requires=requirements,
license="BSD",
zip_safe=False,
keywords='generalwords',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
"Programming Language :: Python :: 2",
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
],
test_suite='tests',
tests_require=test_requirements
)
Update description and add 'tox' as a testing dependency.
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
readme = open('README.rst').read()
history = open('HISTORY.rst').read().replace('.. :changelog:', '')
requirements = [
# None
]
test_requirements = [
'tox',
]
setup(
name='generalwords',
version='0.1.0',
description='A somewhat curated collection of words to use in nonce generation.',
long_description=readme + '\n\n' + history,
author='Christopher Petrilli',
author_email='petrilli@amber.org',
url='https://github.com/petrilli/generalwords',
packages=[
'generalwords',
],
package_dir={'generalwords':
'generalwords'},
include_package_data=True,
install_requires=requirements,
license="BSD",
zip_safe=False,
keywords='generalwords',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
"Programming Language :: Python :: 2",
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
],
test_suite='tests',
tests_require=test_requirements
)
|
<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
readme = open('README.rst').read()
history = open('HISTORY.rst').read().replace('.. :changelog:', '')
requirements = [
# TODO: put package requirements here
]
test_requirements = [
# TODO: put package test requirements here
]
setup(
name='generalwords',
version='0.1.0',
description='Python Boilerplate contains all the boilerplate you need to create a Python package.',
long_description=readme + '\n\n' + history,
author='Christopher Petrilli',
author_email='petrilli@amber.org',
url='https://github.com/petrilli/generalwords',
packages=[
'generalwords',
],
package_dir={'generalwords':
'generalwords'},
include_package_data=True,
install_requires=requirements,
license="BSD",
zip_safe=False,
keywords='generalwords',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
"Programming Language :: Python :: 2",
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
],
test_suite='tests',
tests_require=test_requirements
)
<commit_msg>Update description and add 'tox' as a testing dependency.<commit_after>
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
readme = open('README.rst').read()
history = open('HISTORY.rst').read().replace('.. :changelog:', '')
requirements = [
# None
]
test_requirements = [
'tox',
]
setup(
name='generalwords',
version='0.1.0',
description='A somewhat curated collection of words to use in nonce generation.',
long_description=readme + '\n\n' + history,
author='Christopher Petrilli',
author_email='petrilli@amber.org',
url='https://github.com/petrilli/generalwords',
packages=[
'generalwords',
],
package_dir={'generalwords':
'generalwords'},
include_package_data=True,
install_requires=requirements,
license="BSD",
zip_safe=False,
keywords='generalwords',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
"Programming Language :: Python :: 2",
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
],
test_suite='tests',
tests_require=test_requirements
)
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
readme = open('README.rst').read()
history = open('HISTORY.rst').read().replace('.. :changelog:', '')
requirements = [
# TODO: put package requirements here
]
test_requirements = [
# TODO: put package test requirements here
]
setup(
name='generalwords',
version='0.1.0',
description='Python Boilerplate contains all the boilerplate you need to create a Python package.',
long_description=readme + '\n\n' + history,
author='Christopher Petrilli',
author_email='petrilli@amber.org',
url='https://github.com/petrilli/generalwords',
packages=[
'generalwords',
],
package_dir={'generalwords':
'generalwords'},
include_package_data=True,
install_requires=requirements,
license="BSD",
zip_safe=False,
keywords='generalwords',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
"Programming Language :: Python :: 2",
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
],
test_suite='tests',
tests_require=test_requirements
)
Update description and add 'tox' as a testing dependency.#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
readme = open('README.rst').read()
history = open('HISTORY.rst').read().replace('.. :changelog:', '')
requirements = [
# None
]
test_requirements = [
'tox',
]
setup(
name='generalwords',
version='0.1.0',
description='A somewhat curated collection of words to use in nonce generation.',
long_description=readme + '\n\n' + history,
author='Christopher Petrilli',
author_email='petrilli@amber.org',
url='https://github.com/petrilli/generalwords',
packages=[
'generalwords',
],
package_dir={'generalwords':
'generalwords'},
include_package_data=True,
install_requires=requirements,
license="BSD",
zip_safe=False,
keywords='generalwords',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
"Programming Language :: Python :: 2",
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
],
test_suite='tests',
tests_require=test_requirements
)
|
<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
readme = open('README.rst').read()
history = open('HISTORY.rst').read().replace('.. :changelog:', '')
requirements = [
# TODO: put package requirements here
]
test_requirements = [
# TODO: put package test requirements here
]
setup(
name='generalwords',
version='0.1.0',
description='Python Boilerplate contains all the boilerplate you need to create a Python package.',
long_description=readme + '\n\n' + history,
author='Christopher Petrilli',
author_email='petrilli@amber.org',
url='https://github.com/petrilli/generalwords',
packages=[
'generalwords',
],
package_dir={'generalwords':
'generalwords'},
include_package_data=True,
install_requires=requirements,
license="BSD",
zip_safe=False,
keywords='generalwords',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
"Programming Language :: Python :: 2",
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
],
test_suite='tests',
tests_require=test_requirements
)
<commit_msg>Update description and add 'tox' as a testing dependency.<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
readme = open('README.rst').read()
history = open('HISTORY.rst').read().replace('.. :changelog:', '')
requirements = [
# None
]
test_requirements = [
'tox',
]
setup(
name='generalwords',
version='0.1.0',
description='A somewhat curated collection of words to use in nonce generation.',
long_description=readme + '\n\n' + history,
author='Christopher Petrilli',
author_email='petrilli@amber.org',
url='https://github.com/petrilli/generalwords',
packages=[
'generalwords',
],
package_dir={'generalwords':
'generalwords'},
include_package_data=True,
install_requires=requirements,
license="BSD",
zip_safe=False,
keywords='generalwords',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
"Programming Language :: Python :: 2",
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
],
test_suite='tests',
tests_require=test_requirements
)
|
7aaaeef4cbcd1c3010bb633599770fab39031822
|
setup.py
|
setup.py
|
from setuptools import setup, find_packages
setup(
name='zeit.content.infobox',
version='1.23.6dev',
author='gocept',
author_email='mail@gocept.com',
url='https://svn.gocept.com/repos/gocept-int/zeit.cms',
description="ZEIT infobox",
packages=find_packages('src'),
package_dir = {'': 'src'},
include_package_data = True,
zip_safe=False,
license='gocept proprietary',
namespace_packages = ['zeit', 'zeit.content'],
install_requires=[
'gocept.form',
'mock',
'setuptools',
'zeit.cms>1.40.3',
'zeit.wysiwyg',
'zope.app.appsetup',
'zope.app.testing',
'zope.component',
'zope.formlib',
'zope.interface',
'zope.publisher',
'zope.security',
'zope.testing',
],
)
|
from setuptools import setup, find_packages
setup(
name='zeit.content.infobox',
version='1.23.6dev',
author='gocept',
author_email='mail@gocept.com',
url='https://svn.gocept.com/repos/gocept-int/zeit.cms',
description="ZEIT infobox",
packages=find_packages('src'),
package_dir = {'': 'src'},
include_package_data = True,
zip_safe=False,
license='gocept proprietary',
namespace_packages = ['zeit', 'zeit.content'],
install_requires=[
'gocept.form',
'mock',
'setuptools',
'zeit.cms>=1.53.0.dev',
'zeit.wysiwyg',
'zope.app.appsetup',
'zope.app.testing',
'zope.component',
'zope.formlib',
'zope.interface',
'zope.publisher',
'zope.security',
'zope.testing',
],
)
|
Declare required version of zeit.cms
|
Declare required version of zeit.cms
|
Python
|
bsd-3-clause
|
ZeitOnline/zeit.content.infobox
|
from setuptools import setup, find_packages
setup(
name='zeit.content.infobox',
version='1.23.6dev',
author='gocept',
author_email='mail@gocept.com',
url='https://svn.gocept.com/repos/gocept-int/zeit.cms',
description="ZEIT infobox",
packages=find_packages('src'),
package_dir = {'': 'src'},
include_package_data = True,
zip_safe=False,
license='gocept proprietary',
namespace_packages = ['zeit', 'zeit.content'],
install_requires=[
'gocept.form',
'mock',
'setuptools',
'zeit.cms>1.40.3',
'zeit.wysiwyg',
'zope.app.appsetup',
'zope.app.testing',
'zope.component',
'zope.formlib',
'zope.interface',
'zope.publisher',
'zope.security',
'zope.testing',
],
)
Declare required version of zeit.cms
|
from setuptools import setup, find_packages
setup(
name='zeit.content.infobox',
version='1.23.6dev',
author='gocept',
author_email='mail@gocept.com',
url='https://svn.gocept.com/repos/gocept-int/zeit.cms',
description="ZEIT infobox",
packages=find_packages('src'),
package_dir = {'': 'src'},
include_package_data = True,
zip_safe=False,
license='gocept proprietary',
namespace_packages = ['zeit', 'zeit.content'],
install_requires=[
'gocept.form',
'mock',
'setuptools',
'zeit.cms>=1.53.0.dev',
'zeit.wysiwyg',
'zope.app.appsetup',
'zope.app.testing',
'zope.component',
'zope.formlib',
'zope.interface',
'zope.publisher',
'zope.security',
'zope.testing',
],
)
|
<commit_before>from setuptools import setup, find_packages
setup(
name='zeit.content.infobox',
version='1.23.6dev',
author='gocept',
author_email='mail@gocept.com',
url='https://svn.gocept.com/repos/gocept-int/zeit.cms',
description="ZEIT infobox",
packages=find_packages('src'),
package_dir = {'': 'src'},
include_package_data = True,
zip_safe=False,
license='gocept proprietary',
namespace_packages = ['zeit', 'zeit.content'],
install_requires=[
'gocept.form',
'mock',
'setuptools',
'zeit.cms>1.40.3',
'zeit.wysiwyg',
'zope.app.appsetup',
'zope.app.testing',
'zope.component',
'zope.formlib',
'zope.interface',
'zope.publisher',
'zope.security',
'zope.testing',
],
)
<commit_msg>Declare required version of zeit.cms<commit_after>
|
from setuptools import setup, find_packages
setup(
name='zeit.content.infobox',
version='1.23.6dev',
author='gocept',
author_email='mail@gocept.com',
url='https://svn.gocept.com/repos/gocept-int/zeit.cms',
description="ZEIT infobox",
packages=find_packages('src'),
package_dir = {'': 'src'},
include_package_data = True,
zip_safe=False,
license='gocept proprietary',
namespace_packages = ['zeit', 'zeit.content'],
install_requires=[
'gocept.form',
'mock',
'setuptools',
'zeit.cms>=1.53.0.dev',
'zeit.wysiwyg',
'zope.app.appsetup',
'zope.app.testing',
'zope.component',
'zope.formlib',
'zope.interface',
'zope.publisher',
'zope.security',
'zope.testing',
],
)
|
from setuptools import setup, find_packages
setup(
name='zeit.content.infobox',
version='1.23.6dev',
author='gocept',
author_email='mail@gocept.com',
url='https://svn.gocept.com/repos/gocept-int/zeit.cms',
description="ZEIT infobox",
packages=find_packages('src'),
package_dir = {'': 'src'},
include_package_data = True,
zip_safe=False,
license='gocept proprietary',
namespace_packages = ['zeit', 'zeit.content'],
install_requires=[
'gocept.form',
'mock',
'setuptools',
'zeit.cms>1.40.3',
'zeit.wysiwyg',
'zope.app.appsetup',
'zope.app.testing',
'zope.component',
'zope.formlib',
'zope.interface',
'zope.publisher',
'zope.security',
'zope.testing',
],
)
Declare required version of zeit.cmsfrom setuptools import setup, find_packages
setup(
name='zeit.content.infobox',
version='1.23.6dev',
author='gocept',
author_email='mail@gocept.com',
url='https://svn.gocept.com/repos/gocept-int/zeit.cms',
description="ZEIT infobox",
packages=find_packages('src'),
package_dir = {'': 'src'},
include_package_data = True,
zip_safe=False,
license='gocept proprietary',
namespace_packages = ['zeit', 'zeit.content'],
install_requires=[
'gocept.form',
'mock',
'setuptools',
'zeit.cms>=1.53.0.dev',
'zeit.wysiwyg',
'zope.app.appsetup',
'zope.app.testing',
'zope.component',
'zope.formlib',
'zope.interface',
'zope.publisher',
'zope.security',
'zope.testing',
],
)
|
<commit_before>from setuptools import setup, find_packages
setup(
name='zeit.content.infobox',
version='1.23.6dev',
author='gocept',
author_email='mail@gocept.com',
url='https://svn.gocept.com/repos/gocept-int/zeit.cms',
description="ZEIT infobox",
packages=find_packages('src'),
package_dir = {'': 'src'},
include_package_data = True,
zip_safe=False,
license='gocept proprietary',
namespace_packages = ['zeit', 'zeit.content'],
install_requires=[
'gocept.form',
'mock',
'setuptools',
'zeit.cms>1.40.3',
'zeit.wysiwyg',
'zope.app.appsetup',
'zope.app.testing',
'zope.component',
'zope.formlib',
'zope.interface',
'zope.publisher',
'zope.security',
'zope.testing',
],
)
<commit_msg>Declare required version of zeit.cms<commit_after>from setuptools import setup, find_packages
setup(
name='zeit.content.infobox',
version='1.23.6dev',
author='gocept',
author_email='mail@gocept.com',
url='https://svn.gocept.com/repos/gocept-int/zeit.cms',
description="ZEIT infobox",
packages=find_packages('src'),
package_dir = {'': 'src'},
include_package_data = True,
zip_safe=False,
license='gocept proprietary',
namespace_packages = ['zeit', 'zeit.content'],
install_requires=[
'gocept.form',
'mock',
'setuptools',
'zeit.cms>=1.53.0.dev',
'zeit.wysiwyg',
'zope.app.appsetup',
'zope.app.testing',
'zope.component',
'zope.formlib',
'zope.interface',
'zope.publisher',
'zope.security',
'zope.testing',
],
)
|
f22cb6c576d167bd20658e35f6b28066871a80a2
|
setup.py
|
setup.py
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
'pyjwt',
'requests',
'requests_oauthlib',
'money',
'babel',
'six',
]
setup(
name='fulfil_client',
version='0.13.2',
description="Fulfil REST API Client in Python",
long_description=readme + '\n\n' + history,
author="Fulfil.IO Inc.",
author_email='hello@fulfil.io',
url='https://github.com/fulfilio/fulfil-python-api',
packages=[
'fulfil_client',
],
package_dir={
'fulfil_client': 'fulfil_client'
},
include_package_data=True,
install_requires=requirements,
license="ISCL",
zip_safe=False,
keywords='fulfil_client',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: ISC License (ISCL)',
'Natural Language :: English',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
],
setup_requires=['pytest-runner'],
tests_require=['pytest', 'redis'],
)
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
'pyjwt',
'requests',
'requests_oauthlib',
'money',
'babel',
'six',
]
setup(
name='fulfil_client',
version='0.13.2',
description="Fulfil REST API Client in Python",
long_description=readme + '\n\n' + history,
author="Fulfil.IO Inc.",
author_email='hello@fulfil.io',
url='https://github.com/fulfilio/fulfil-python-api',
packages=[
'fulfil_client',
'fulfil_client.contrib',
],
package_dir={
'fulfil_client': 'fulfil_client',
'fulfil_client.contrib': 'fulfil_client/contrib'
},
include_package_data=True,
install_requires=requirements,
license="ISCL",
zip_safe=False,
keywords='fulfil_client',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: ISC License (ISCL)',
'Natural Language :: English',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
],
setup_requires=['pytest-runner'],
tests_require=['pytest', 'redis'],
)
|
Add contrib package to deployment
|
Add contrib package to deployment
|
Python
|
isc
|
sharoonthomas/fulfil-python-api,fulfilio/fulfil-python-api
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
'pyjwt',
'requests',
'requests_oauthlib',
'money',
'babel',
'six',
]
setup(
name='fulfil_client',
version='0.13.2',
description="Fulfil REST API Client in Python",
long_description=readme + '\n\n' + history,
author="Fulfil.IO Inc.",
author_email='hello@fulfil.io',
url='https://github.com/fulfilio/fulfil-python-api',
packages=[
'fulfil_client',
],
package_dir={
'fulfil_client': 'fulfil_client'
},
include_package_data=True,
install_requires=requirements,
license="ISCL",
zip_safe=False,
keywords='fulfil_client',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: ISC License (ISCL)',
'Natural Language :: English',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
],
setup_requires=['pytest-runner'],
tests_require=['pytest', 'redis'],
)
Add contrib package to deployment
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
'pyjwt',
'requests',
'requests_oauthlib',
'money',
'babel',
'six',
]
setup(
name='fulfil_client',
version='0.13.2',
description="Fulfil REST API Client in Python",
long_description=readme + '\n\n' + history,
author="Fulfil.IO Inc.",
author_email='hello@fulfil.io',
url='https://github.com/fulfilio/fulfil-python-api',
packages=[
'fulfil_client',
'fulfil_client.contrib',
],
package_dir={
'fulfil_client': 'fulfil_client',
'fulfil_client.contrib': 'fulfil_client/contrib'
},
include_package_data=True,
install_requires=requirements,
license="ISCL",
zip_safe=False,
keywords='fulfil_client',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: ISC License (ISCL)',
'Natural Language :: English',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
],
setup_requires=['pytest-runner'],
tests_require=['pytest', 'redis'],
)
|
<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
'pyjwt',
'requests',
'requests_oauthlib',
'money',
'babel',
'six',
]
setup(
name='fulfil_client',
version='0.13.2',
description="Fulfil REST API Client in Python",
long_description=readme + '\n\n' + history,
author="Fulfil.IO Inc.",
author_email='hello@fulfil.io',
url='https://github.com/fulfilio/fulfil-python-api',
packages=[
'fulfil_client',
],
package_dir={
'fulfil_client': 'fulfil_client'
},
include_package_data=True,
install_requires=requirements,
license="ISCL",
zip_safe=False,
keywords='fulfil_client',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: ISC License (ISCL)',
'Natural Language :: English',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
],
setup_requires=['pytest-runner'],
tests_require=['pytest', 'redis'],
)
<commit_msg>Add contrib package to deployment<commit_after>
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
'pyjwt',
'requests',
'requests_oauthlib',
'money',
'babel',
'six',
]
setup(
name='fulfil_client',
version='0.13.2',
description="Fulfil REST API Client in Python",
long_description=readme + '\n\n' + history,
author="Fulfil.IO Inc.",
author_email='hello@fulfil.io',
url='https://github.com/fulfilio/fulfil-python-api',
packages=[
'fulfil_client',
'fulfil_client.contrib',
],
package_dir={
'fulfil_client': 'fulfil_client',
'fulfil_client.contrib': 'fulfil_client/contrib'
},
include_package_data=True,
install_requires=requirements,
license="ISCL",
zip_safe=False,
keywords='fulfil_client',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: ISC License (ISCL)',
'Natural Language :: English',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
],
setup_requires=['pytest-runner'],
tests_require=['pytest', 'redis'],
)
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
'pyjwt',
'requests',
'requests_oauthlib',
'money',
'babel',
'six',
]
setup(
name='fulfil_client',
version='0.13.2',
description="Fulfil REST API Client in Python",
long_description=readme + '\n\n' + history,
author="Fulfil.IO Inc.",
author_email='hello@fulfil.io',
url='https://github.com/fulfilio/fulfil-python-api',
packages=[
'fulfil_client',
],
package_dir={
'fulfil_client': 'fulfil_client'
},
include_package_data=True,
install_requires=requirements,
license="ISCL",
zip_safe=False,
keywords='fulfil_client',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: ISC License (ISCL)',
'Natural Language :: English',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
],
setup_requires=['pytest-runner'],
tests_require=['pytest', 'redis'],
)
Add contrib package to deployment#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
'pyjwt',
'requests',
'requests_oauthlib',
'money',
'babel',
'six',
]
setup(
name='fulfil_client',
version='0.13.2',
description="Fulfil REST API Client in Python",
long_description=readme + '\n\n' + history,
author="Fulfil.IO Inc.",
author_email='hello@fulfil.io',
url='https://github.com/fulfilio/fulfil-python-api',
packages=[
'fulfil_client',
'fulfil_client.contrib',
],
package_dir={
'fulfil_client': 'fulfil_client',
'fulfil_client.contrib': 'fulfil_client/contrib'
},
include_package_data=True,
install_requires=requirements,
license="ISCL",
zip_safe=False,
keywords='fulfil_client',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: ISC License (ISCL)',
'Natural Language :: English',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
],
setup_requires=['pytest-runner'],
tests_require=['pytest', 'redis'],
)
|
<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
'pyjwt',
'requests',
'requests_oauthlib',
'money',
'babel',
'six',
]
setup(
name='fulfil_client',
version='0.13.2',
description="Fulfil REST API Client in Python",
long_description=readme + '\n\n' + history,
author="Fulfil.IO Inc.",
author_email='hello@fulfil.io',
url='https://github.com/fulfilio/fulfil-python-api',
packages=[
'fulfil_client',
],
package_dir={
'fulfil_client': 'fulfil_client'
},
include_package_data=True,
install_requires=requirements,
license="ISCL",
zip_safe=False,
keywords='fulfil_client',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: ISC License (ISCL)',
'Natural Language :: English',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
],
setup_requires=['pytest-runner'],
tests_require=['pytest', 'redis'],
)
<commit_msg>Add contrib package to deployment<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
'pyjwt',
'requests',
'requests_oauthlib',
'money',
'babel',
'six',
]
setup(
name='fulfil_client',
version='0.13.2',
description="Fulfil REST API Client in Python",
long_description=readme + '\n\n' + history,
author="Fulfil.IO Inc.",
author_email='hello@fulfil.io',
url='https://github.com/fulfilio/fulfil-python-api',
packages=[
'fulfil_client',
'fulfil_client.contrib',
],
package_dir={
'fulfil_client': 'fulfil_client',
'fulfil_client.contrib': 'fulfil_client/contrib'
},
include_package_data=True,
install_requires=requirements,
license="ISCL",
zip_safe=False,
keywords='fulfil_client',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: ISC License (ISCL)',
'Natural Language :: English',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
],
setup_requires=['pytest-runner'],
tests_require=['pytest', 'redis'],
)
|
a10caabf5a8ece0ba05fac2d9166a6a85ac39b38
|
setup.py
|
setup.py
|
#!/usr/bin/env python
"""Package setup script; requires setuptools (or Python >=3.4 which
bundles it)."""
from setuptools import setup
setup(name='Treepace',
version='0.2',
description='Tree Transformation Language',
author='Matúš Sulír',
url='https://github.com/sulir/treepace',
packages=['treepace', 'treepace.examples'],
test_suite='tests',
install_requires=['parsimonious==0.5'],
extras_require={
'ipython': ['ipython>=1.0.0']
},
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Topic :: Software Development :: Libraries',
]
)
|
#!/usr/bin/env python
"""Package setup script; requires setuptools (or Python >=3.4 which
bundles it)."""
from setuptools import setup
setup(name='Treepace',
version='0.3',
description='Tree Transformation Language',
author='Matúš Sulír',
url='https://github.com/sulir/treepace',
packages=['treepace', 'treepace.examples'],
test_suite='tests',
install_requires=['parsimonious>=0.5'],
extras_require={
'ipython': ['ipython>=2.0.0']
},
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Topic :: Software Development :: Libraries',
]
)
|
Change version because of an important bugfix
|
Change version because of an important bugfix
|
Python
|
mit
|
sulir/treepace
|
#!/usr/bin/env python
"""Package setup script; requires setuptools (or Python >=3.4 which
bundles it)."""
from setuptools import setup
setup(name='Treepace',
version='0.2',
description='Tree Transformation Language',
author='Matúš Sulír',
url='https://github.com/sulir/treepace',
packages=['treepace', 'treepace.examples'],
test_suite='tests',
install_requires=['parsimonious==0.5'],
extras_require={
'ipython': ['ipython>=1.0.0']
},
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Topic :: Software Development :: Libraries',
]
)
Change version because of an important bugfix
|
#!/usr/bin/env python
"""Package setup script; requires setuptools (or Python >=3.4 which
bundles it)."""
from setuptools import setup
setup(name='Treepace',
version='0.3',
description='Tree Transformation Language',
author='Matúš Sulír',
url='https://github.com/sulir/treepace',
packages=['treepace', 'treepace.examples'],
test_suite='tests',
install_requires=['parsimonious>=0.5'],
extras_require={
'ipython': ['ipython>=2.0.0']
},
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Topic :: Software Development :: Libraries',
]
)
|
<commit_before>#!/usr/bin/env python
"""Package setup script; requires setuptools (or Python >=3.4 which
bundles it)."""
from setuptools import setup
setup(name='Treepace',
version='0.2',
description='Tree Transformation Language',
author='Matúš Sulír',
url='https://github.com/sulir/treepace',
packages=['treepace', 'treepace.examples'],
test_suite='tests',
install_requires=['parsimonious==0.5'],
extras_require={
'ipython': ['ipython>=1.0.0']
},
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Topic :: Software Development :: Libraries',
]
)
<commit_msg>Change version because of an important bugfix<commit_after>
|
#!/usr/bin/env python
"""Package setup script; requires setuptools (or Python >=3.4 which
bundles it)."""
from setuptools import setup
setup(name='Treepace',
version='0.3',
description='Tree Transformation Language',
author='Matúš Sulír',
url='https://github.com/sulir/treepace',
packages=['treepace', 'treepace.examples'],
test_suite='tests',
install_requires=['parsimonious>=0.5'],
extras_require={
'ipython': ['ipython>=2.0.0']
},
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Topic :: Software Development :: Libraries',
]
)
|
#!/usr/bin/env python
"""Package setup script; requires setuptools (or Python >=3.4 which
bundles it)."""
from setuptools import setup
setup(name='Treepace',
version='0.2',
description='Tree Transformation Language',
author='Matúš Sulír',
url='https://github.com/sulir/treepace',
packages=['treepace', 'treepace.examples'],
test_suite='tests',
install_requires=['parsimonious==0.5'],
extras_require={
'ipython': ['ipython>=1.0.0']
},
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Topic :: Software Development :: Libraries',
]
)
Change version because of an important bugfix#!/usr/bin/env python
"""Package setup script; requires setuptools (or Python >=3.4 which
bundles it)."""
from setuptools import setup
setup(name='Treepace',
version='0.3',
description='Tree Transformation Language',
author='Matúš Sulír',
url='https://github.com/sulir/treepace',
packages=['treepace', 'treepace.examples'],
test_suite='tests',
install_requires=['parsimonious>=0.5'],
extras_require={
'ipython': ['ipython>=2.0.0']
},
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Topic :: Software Development :: Libraries',
]
)
|
<commit_before>#!/usr/bin/env python
"""Package setup script; requires setuptools (or Python >=3.4 which
bundles it)."""
from setuptools import setup
setup(name='Treepace',
version='0.2',
description='Tree Transformation Language',
author='Matúš Sulír',
url='https://github.com/sulir/treepace',
packages=['treepace', 'treepace.examples'],
test_suite='tests',
install_requires=['parsimonious==0.5'],
extras_require={
'ipython': ['ipython>=1.0.0']
},
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Topic :: Software Development :: Libraries',
]
)
<commit_msg>Change version because of an important bugfix<commit_after>#!/usr/bin/env python
"""Package setup script; requires setuptools (or Python >=3.4 which
bundles it)."""
from setuptools import setup
setup(name='Treepace',
version='0.3',
description='Tree Transformation Language',
author='Matúš Sulír',
url='https://github.com/sulir/treepace',
packages=['treepace', 'treepace.examples'],
test_suite='tests',
install_requires=['parsimonious>=0.5'],
extras_require={
'ipython': ['ipython>=2.0.0']
},
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Topic :: Software Development :: Libraries',
]
)
|
aafd9f66610dc801a197e634cc98c7e855670d35
|
setup.py
|
setup.py
|
#!/usr/bin/env python
import setuptools
import sys
if not ((sys.version_info.major >= 3 and sys.version_info.minor >= 5)
or sys.version_info.major > 3):
exit("Sorry, Python's version must be later than 3.5.")
import shakyo
setuptools.setup(
name=shakyo.__name__,
version=shakyo.__version__,
description="a tool to learn about something just by copying it by hand",
license="Public Domain",
author="raviqqe",
author_email="raviqqe@gmail.com",
url="http://github.com/raviqqe/shakyo/",
py_modules=[shakyo.__name__],
entry_points={"console_scripts" : ["shakyo=shakyo:main"]},
install_requires=["text_unidecode", "validators"],
classifiers=[
"Development Status :: 3 - Alpha",
"Environment :: Console :: Curses",
"Intended Audience :: Developers",
"Intended Audience :: End Users/Desktop",
"License :: Public Domain",
"Operating System :: POSIX",
"Topic :: Education :: Computer Aided Instruction (CAI)",
"Topic :: Games/Entertainment",
],
)
|
#!/usr/bin/env python
import setuptools
import sys
if not ((sys.version_info.major >= 3 and sys.version_info.minor >= 5)
or sys.version_info.major > 3):
exit("Sorry, Python's version must be later than 3.5.")
import shakyo
setuptools.setup(
name=shakyo.__name__,
version=shakyo.__version__,
description="a tool to learn about something just by copying it by hand",
license="Public Domain",
author="raviqqe",
author_email="raviqqe@gmail.com",
url="http://github.com/raviqqe/shakyo/",
py_modules=[shakyo.__name__],
entry_points={"console_scripts" : ["shakyo=shakyo:main"]},
install_requires=["text_unidecode", "validators"],
classifiers=[
"Development Status :: 3 - Alpha",
"Environment :: Console :: Curses",
"Intended Audience :: Developers",
"Intended Audience :: End Users/Desktop",
"License :: Public Domain",
"Operating System :: POSIX",
"Programming Language :: Python :: 3.5",
"Topic :: Education :: Computer Aided Instruction (CAI)",
"Topic :: Games/Entertainment",
],
)
|
Add another PyPI package classifier of Python 3.5 programming language
|
Add another PyPI package classifier of Python 3.5 programming language
|
Python
|
unlicense
|
raviqqe/shakyo
|
#!/usr/bin/env python
import setuptools
import sys
if not ((sys.version_info.major >= 3 and sys.version_info.minor >= 5)
or sys.version_info.major > 3):
exit("Sorry, Python's version must be later than 3.5.")
import shakyo
setuptools.setup(
name=shakyo.__name__,
version=shakyo.__version__,
description="a tool to learn about something just by copying it by hand",
license="Public Domain",
author="raviqqe",
author_email="raviqqe@gmail.com",
url="http://github.com/raviqqe/shakyo/",
py_modules=[shakyo.__name__],
entry_points={"console_scripts" : ["shakyo=shakyo:main"]},
install_requires=["text_unidecode", "validators"],
classifiers=[
"Development Status :: 3 - Alpha",
"Environment :: Console :: Curses",
"Intended Audience :: Developers",
"Intended Audience :: End Users/Desktop",
"License :: Public Domain",
"Operating System :: POSIX",
"Topic :: Education :: Computer Aided Instruction (CAI)",
"Topic :: Games/Entertainment",
],
)
Add another PyPI package classifier of Python 3.5 programming language
|
#!/usr/bin/env python
import setuptools
import sys
if not ((sys.version_info.major >= 3 and sys.version_info.minor >= 5)
or sys.version_info.major > 3):
exit("Sorry, Python's version must be later than 3.5.")
import shakyo
setuptools.setup(
name=shakyo.__name__,
version=shakyo.__version__,
description="a tool to learn about something just by copying it by hand",
license="Public Domain",
author="raviqqe",
author_email="raviqqe@gmail.com",
url="http://github.com/raviqqe/shakyo/",
py_modules=[shakyo.__name__],
entry_points={"console_scripts" : ["shakyo=shakyo:main"]},
install_requires=["text_unidecode", "validators"],
classifiers=[
"Development Status :: 3 - Alpha",
"Environment :: Console :: Curses",
"Intended Audience :: Developers",
"Intended Audience :: End Users/Desktop",
"License :: Public Domain",
"Operating System :: POSIX",
"Programming Language :: Python :: 3.5",
"Topic :: Education :: Computer Aided Instruction (CAI)",
"Topic :: Games/Entertainment",
],
)
|
<commit_before>#!/usr/bin/env python
import setuptools
import sys
if not ((sys.version_info.major >= 3 and sys.version_info.minor >= 5)
or sys.version_info.major > 3):
exit("Sorry, Python's version must be later than 3.5.")
import shakyo
setuptools.setup(
name=shakyo.__name__,
version=shakyo.__version__,
description="a tool to learn about something just by copying it by hand",
license="Public Domain",
author="raviqqe",
author_email="raviqqe@gmail.com",
url="http://github.com/raviqqe/shakyo/",
py_modules=[shakyo.__name__],
entry_points={"console_scripts" : ["shakyo=shakyo:main"]},
install_requires=["text_unidecode", "validators"],
classifiers=[
"Development Status :: 3 - Alpha",
"Environment :: Console :: Curses",
"Intended Audience :: Developers",
"Intended Audience :: End Users/Desktop",
"License :: Public Domain",
"Operating System :: POSIX",
"Topic :: Education :: Computer Aided Instruction (CAI)",
"Topic :: Games/Entertainment",
],
)
<commit_msg>Add another PyPI package classifier of Python 3.5 programming language<commit_after>
|
#!/usr/bin/env python
import setuptools
import sys
if not ((sys.version_info.major >= 3 and sys.version_info.minor >= 5)
or sys.version_info.major > 3):
exit("Sorry, Python's version must be later than 3.5.")
import shakyo
setuptools.setup(
name=shakyo.__name__,
version=shakyo.__version__,
description="a tool to learn about something just by copying it by hand",
license="Public Domain",
author="raviqqe",
author_email="raviqqe@gmail.com",
url="http://github.com/raviqqe/shakyo/",
py_modules=[shakyo.__name__],
entry_points={"console_scripts" : ["shakyo=shakyo:main"]},
install_requires=["text_unidecode", "validators"],
classifiers=[
"Development Status :: 3 - Alpha",
"Environment :: Console :: Curses",
"Intended Audience :: Developers",
"Intended Audience :: End Users/Desktop",
"License :: Public Domain",
"Operating System :: POSIX",
"Programming Language :: Python :: 3.5",
"Topic :: Education :: Computer Aided Instruction (CAI)",
"Topic :: Games/Entertainment",
],
)
|
#!/usr/bin/env python
import setuptools
import sys
if not ((sys.version_info.major >= 3 and sys.version_info.minor >= 5)
or sys.version_info.major > 3):
exit("Sorry, Python's version must be later than 3.5.")
import shakyo
setuptools.setup(
name=shakyo.__name__,
version=shakyo.__version__,
description="a tool to learn about something just by copying it by hand",
license="Public Domain",
author="raviqqe",
author_email="raviqqe@gmail.com",
url="http://github.com/raviqqe/shakyo/",
py_modules=[shakyo.__name__],
entry_points={"console_scripts" : ["shakyo=shakyo:main"]},
install_requires=["text_unidecode", "validators"],
classifiers=[
"Development Status :: 3 - Alpha",
"Environment :: Console :: Curses",
"Intended Audience :: Developers",
"Intended Audience :: End Users/Desktop",
"License :: Public Domain",
"Operating System :: POSIX",
"Topic :: Education :: Computer Aided Instruction (CAI)",
"Topic :: Games/Entertainment",
],
)
Add another PyPI package classifier of Python 3.5 programming language#!/usr/bin/env python
import setuptools
import sys
if not ((sys.version_info.major >= 3 and sys.version_info.minor >= 5)
or sys.version_info.major > 3):
exit("Sorry, Python's version must be later than 3.5.")
import shakyo
setuptools.setup(
name=shakyo.__name__,
version=shakyo.__version__,
description="a tool to learn about something just by copying it by hand",
license="Public Domain",
author="raviqqe",
author_email="raviqqe@gmail.com",
url="http://github.com/raviqqe/shakyo/",
py_modules=[shakyo.__name__],
entry_points={"console_scripts" : ["shakyo=shakyo:main"]},
install_requires=["text_unidecode", "validators"],
classifiers=[
"Development Status :: 3 - Alpha",
"Environment :: Console :: Curses",
"Intended Audience :: Developers",
"Intended Audience :: End Users/Desktop",
"License :: Public Domain",
"Operating System :: POSIX",
"Programming Language :: Python :: 3.5",
"Topic :: Education :: Computer Aided Instruction (CAI)",
"Topic :: Games/Entertainment",
],
)
|
<commit_before>#!/usr/bin/env python
import setuptools
import sys
if not ((sys.version_info.major >= 3 and sys.version_info.minor >= 5)
or sys.version_info.major > 3):
exit("Sorry, Python's version must be later than 3.5.")
import shakyo
setuptools.setup(
name=shakyo.__name__,
version=shakyo.__version__,
description="a tool to learn about something just by copying it by hand",
license="Public Domain",
author="raviqqe",
author_email="raviqqe@gmail.com",
url="http://github.com/raviqqe/shakyo/",
py_modules=[shakyo.__name__],
entry_points={"console_scripts" : ["shakyo=shakyo:main"]},
install_requires=["text_unidecode", "validators"],
classifiers=[
"Development Status :: 3 - Alpha",
"Environment :: Console :: Curses",
"Intended Audience :: Developers",
"Intended Audience :: End Users/Desktop",
"License :: Public Domain",
"Operating System :: POSIX",
"Topic :: Education :: Computer Aided Instruction (CAI)",
"Topic :: Games/Entertainment",
],
)
<commit_msg>Add another PyPI package classifier of Python 3.5 programming language<commit_after>#!/usr/bin/env python
import setuptools
import sys
if not ((sys.version_info.major >= 3 and sys.version_info.minor >= 5)
or sys.version_info.major > 3):
exit("Sorry, Python's version must be later than 3.5.")
import shakyo
setuptools.setup(
name=shakyo.__name__,
version=shakyo.__version__,
description="a tool to learn about something just by copying it by hand",
license="Public Domain",
author="raviqqe",
author_email="raviqqe@gmail.com",
url="http://github.com/raviqqe/shakyo/",
py_modules=[shakyo.__name__],
entry_points={"console_scripts" : ["shakyo=shakyo:main"]},
install_requires=["text_unidecode", "validators"],
classifiers=[
"Development Status :: 3 - Alpha",
"Environment :: Console :: Curses",
"Intended Audience :: Developers",
"Intended Audience :: End Users/Desktop",
"License :: Public Domain",
"Operating System :: POSIX",
"Programming Language :: Python :: 3.5",
"Topic :: Education :: Computer Aided Instruction (CAI)",
"Topic :: Games/Entertainment",
],
)
|
b91e458c0250b090de8a7327f5dee1cd4f105f56
|
setup.py
|
setup.py
|
#!/usr/bin/env python3
"""Setup module."""
from setuptools import setup, find_packages
import os
def read(fname):
"""Read and return the contents of a file."""
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='macmond',
version='0.0.1',
description='MACMond - MAC address Monitoring daemon.',
long_description=read('README'),
author='Kalman Olah',
author_email='hello@kalmanolah.net',
url='https://github.io/kalmanolah/macmond',
license='MIT',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Environment :: Console',
'Environment :: No Input/Output (Daemon)',
'Intended Audience :: System Administrators',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
],
packages=find_packages(),
entry_points={
'console_scripts': [
'macmond = macmond:macmond',
],
},
install_requires=[
'scapy-python3',
'python-daemon',
'netifaces',
'click'
],
dependency_links=[
],
)
|
#!/usr/bin/env python3
"""Setup module."""
from setuptools import setup, find_packages
import os
def read(fname):
"""Read and return the contents of a file."""
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='macmond',
version='0.0.1',
description='MACMond - MAC address Monitoring daemon.',
long_description=read('README'),
author='Kalman Olah',
author_email='hello@kalmanolah.net',
url='https://github.com/kalmanolah/macmond',
license='MIT',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Environment :: Console',
'Environment :: No Input/Output (Daemon)',
'Intended Audience :: System Administrators',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
],
packages=find_packages(),
entry_points={
'console_scripts': [
'macmond = macmond:macmond',
],
},
install_requires=[
'scapy-python3',
'python-daemon',
'netifaces',
'click'
],
dependency_links=[
],
)
|
Fix a typo in the project URL
|
Fix a typo in the project URL
Signed-off-by: Kalman Olah <aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d@kalmanolah.net>
|
Python
|
mit
|
kalmanolah/macmond
|
#!/usr/bin/env python3
"""Setup module."""
from setuptools import setup, find_packages
import os
def read(fname):
"""Read and return the contents of a file."""
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='macmond',
version='0.0.1',
description='MACMond - MAC address Monitoring daemon.',
long_description=read('README'),
author='Kalman Olah',
author_email='hello@kalmanolah.net',
url='https://github.io/kalmanolah/macmond',
license='MIT',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Environment :: Console',
'Environment :: No Input/Output (Daemon)',
'Intended Audience :: System Administrators',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
],
packages=find_packages(),
entry_points={
'console_scripts': [
'macmond = macmond:macmond',
],
},
install_requires=[
'scapy-python3',
'python-daemon',
'netifaces',
'click'
],
dependency_links=[
],
)
Fix a typo in the project URL
Signed-off-by: Kalman Olah <aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d@kalmanolah.net>
|
#!/usr/bin/env python3
"""Setup module."""
from setuptools import setup, find_packages
import os
def read(fname):
"""Read and return the contents of a file."""
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='macmond',
version='0.0.1',
description='MACMond - MAC address Monitoring daemon.',
long_description=read('README'),
author='Kalman Olah',
author_email='hello@kalmanolah.net',
url='https://github.com/kalmanolah/macmond',
license='MIT',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Environment :: Console',
'Environment :: No Input/Output (Daemon)',
'Intended Audience :: System Administrators',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
],
packages=find_packages(),
entry_points={
'console_scripts': [
'macmond = macmond:macmond',
],
},
install_requires=[
'scapy-python3',
'python-daemon',
'netifaces',
'click'
],
dependency_links=[
],
)
|
<commit_before>#!/usr/bin/env python3
"""Setup module."""
from setuptools import setup, find_packages
import os
def read(fname):
"""Read and return the contents of a file."""
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='macmond',
version='0.0.1',
description='MACMond - MAC address Monitoring daemon.',
long_description=read('README'),
author='Kalman Olah',
author_email='hello@kalmanolah.net',
url='https://github.io/kalmanolah/macmond',
license='MIT',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Environment :: Console',
'Environment :: No Input/Output (Daemon)',
'Intended Audience :: System Administrators',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
],
packages=find_packages(),
entry_points={
'console_scripts': [
'macmond = macmond:macmond',
],
},
install_requires=[
'scapy-python3',
'python-daemon',
'netifaces',
'click'
],
dependency_links=[
],
)
<commit_msg>Fix a typo in the project URL
Signed-off-by: Kalman Olah <aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d@kalmanolah.net><commit_after>
|
#!/usr/bin/env python3
"""Setup module."""
from setuptools import setup, find_packages
import os
def read(fname):
"""Read and return the contents of a file."""
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='macmond',
version='0.0.1',
description='MACMond - MAC address Monitoring daemon.',
long_description=read('README'),
author='Kalman Olah',
author_email='hello@kalmanolah.net',
url='https://github.com/kalmanolah/macmond',
license='MIT',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Environment :: Console',
'Environment :: No Input/Output (Daemon)',
'Intended Audience :: System Administrators',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
],
packages=find_packages(),
entry_points={
'console_scripts': [
'macmond = macmond:macmond',
],
},
install_requires=[
'scapy-python3',
'python-daemon',
'netifaces',
'click'
],
dependency_links=[
],
)
|
#!/usr/bin/env python3
"""Setup module."""
from setuptools import setup, find_packages
import os
def read(fname):
"""Read and return the contents of a file."""
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='macmond',
version='0.0.1',
description='MACMond - MAC address Monitoring daemon.',
long_description=read('README'),
author='Kalman Olah',
author_email='hello@kalmanolah.net',
url='https://github.io/kalmanolah/macmond',
license='MIT',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Environment :: Console',
'Environment :: No Input/Output (Daemon)',
'Intended Audience :: System Administrators',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
],
packages=find_packages(),
entry_points={
'console_scripts': [
'macmond = macmond:macmond',
],
},
install_requires=[
'scapy-python3',
'python-daemon',
'netifaces',
'click'
],
dependency_links=[
],
)
Fix a typo in the project URL
Signed-off-by: Kalman Olah <aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d@kalmanolah.net>#!/usr/bin/env python3
"""Setup module."""
from setuptools import setup, find_packages
import os
def read(fname):
"""Read and return the contents of a file."""
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='macmond',
version='0.0.1',
description='MACMond - MAC address Monitoring daemon.',
long_description=read('README'),
author='Kalman Olah',
author_email='hello@kalmanolah.net',
url='https://github.com/kalmanolah/macmond',
license='MIT',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Environment :: Console',
'Environment :: No Input/Output (Daemon)',
'Intended Audience :: System Administrators',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
],
packages=find_packages(),
entry_points={
'console_scripts': [
'macmond = macmond:macmond',
],
},
install_requires=[
'scapy-python3',
'python-daemon',
'netifaces',
'click'
],
dependency_links=[
],
)
|
<commit_before>#!/usr/bin/env python3
"""Setup module."""
from setuptools import setup, find_packages
import os
def read(fname):
"""Read and return the contents of a file."""
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='macmond',
version='0.0.1',
description='MACMond - MAC address Monitoring daemon.',
long_description=read('README'),
author='Kalman Olah',
author_email='hello@kalmanolah.net',
url='https://github.io/kalmanolah/macmond',
license='MIT',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Environment :: Console',
'Environment :: No Input/Output (Daemon)',
'Intended Audience :: System Administrators',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
],
packages=find_packages(),
entry_points={
'console_scripts': [
'macmond = macmond:macmond',
],
},
install_requires=[
'scapy-python3',
'python-daemon',
'netifaces',
'click'
],
dependency_links=[
],
)
<commit_msg>Fix a typo in the project URL
Signed-off-by: Kalman Olah <aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d@kalmanolah.net><commit_after>#!/usr/bin/env python3
"""Setup module."""
from setuptools import setup, find_packages
import os
def read(fname):
"""Read and return the contents of a file."""
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='macmond',
version='0.0.1',
description='MACMond - MAC address Monitoring daemon.',
long_description=read('README'),
author='Kalman Olah',
author_email='hello@kalmanolah.net',
url='https://github.com/kalmanolah/macmond',
license='MIT',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Environment :: Console',
'Environment :: No Input/Output (Daemon)',
'Intended Audience :: System Administrators',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
],
packages=find_packages(),
entry_points={
'console_scripts': [
'macmond = macmond:macmond',
],
},
install_requires=[
'scapy-python3',
'python-daemon',
'netifaces',
'click'
],
dependency_links=[
],
)
|
40c4ffd480f291e35ffa69c3145d240146dbcd6c
|
setup.py
|
setup.py
|
# -*- coding: utf-8 -*-
from distribute_setup import use_setuptools
use_setuptools()
from setuptools import setup
setup(
name='cotede',
version='0.1.2',
author='Guilherme Castelão',
author_email='guilherme@castelao.net',
packages=['cotede'],
url='http://cotede.castelao.net',
license='See LICENSE.txt',
description='Quality Control of CTD profiles',
long_description=open('README.rst').read(),
classifiers=[
'Development Status :: 1 - Planning',
'Programming Language :: Python :: 2',
],
keywords='CTD SeaBird QualityControl Oceanography Hydrography',
#package_dir = {'': './'},
include_package_data=True,
)
|
# -*- coding: utf-8 -*-
from distribute_setup import use_setuptools
use_setuptools()
from setuptools import setup
setup(
name='cotede',
version='0.2.0',
author='Guilherme Castelão',
author_email='guilherme@castelao.net',
packages=['cotede'],
url='http://cotede.castelao.net',
license='See LICENSE.txt',
description='Quality Control of CTD profiles',
long_description=open('README.rst').read(),
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Programming Language :: Python :: 2',
],
keywords='CTD SeaBird QualityControl Oceanography Hydrography',
#package_dir = {'': './'},
include_package_data=True,
)
|
Update to 0.2, pre-alpha. Fundamental tests are working.
|
Update to 0.2, pre-alpha. Fundamental tests are working.
|
Python
|
bsd-3-clause
|
castelao/CoTeDe
|
# -*- coding: utf-8 -*-
from distribute_setup import use_setuptools
use_setuptools()
from setuptools import setup
setup(
name='cotede',
version='0.1.2',
author='Guilherme Castelão',
author_email='guilherme@castelao.net',
packages=['cotede'],
url='http://cotede.castelao.net',
license='See LICENSE.txt',
description='Quality Control of CTD profiles',
long_description=open('README.rst').read(),
classifiers=[
'Development Status :: 1 - Planning',
'Programming Language :: Python :: 2',
],
keywords='CTD SeaBird QualityControl Oceanography Hydrography',
#package_dir = {'': './'},
include_package_data=True,
)
Update to 0.2, pre-alpha. Fundamental tests are working.
|
# -*- coding: utf-8 -*-
from distribute_setup import use_setuptools
use_setuptools()
from setuptools import setup
setup(
name='cotede',
version='0.2.0',
author='Guilherme Castelão',
author_email='guilherme@castelao.net',
packages=['cotede'],
url='http://cotede.castelao.net',
license='See LICENSE.txt',
description='Quality Control of CTD profiles',
long_description=open('README.rst').read(),
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Programming Language :: Python :: 2',
],
keywords='CTD SeaBird QualityControl Oceanography Hydrography',
#package_dir = {'': './'},
include_package_data=True,
)
|
<commit_before># -*- coding: utf-8 -*-
from distribute_setup import use_setuptools
use_setuptools()
from setuptools import setup
setup(
name='cotede',
version='0.1.2',
author='Guilherme Castelão',
author_email='guilherme@castelao.net',
packages=['cotede'],
url='http://cotede.castelao.net',
license='See LICENSE.txt',
description='Quality Control of CTD profiles',
long_description=open('README.rst').read(),
classifiers=[
'Development Status :: 1 - Planning',
'Programming Language :: Python :: 2',
],
keywords='CTD SeaBird QualityControl Oceanography Hydrography',
#package_dir = {'': './'},
include_package_data=True,
)
<commit_msg>Update to 0.2, pre-alpha. Fundamental tests are working.<commit_after>
|
# -*- coding: utf-8 -*-
from distribute_setup import use_setuptools
use_setuptools()
from setuptools import setup
setup(
name='cotede',
version='0.2.0',
author='Guilherme Castelão',
author_email='guilherme@castelao.net',
packages=['cotede'],
url='http://cotede.castelao.net',
license='See LICENSE.txt',
description='Quality Control of CTD profiles',
long_description=open('README.rst').read(),
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Programming Language :: Python :: 2',
],
keywords='CTD SeaBird QualityControl Oceanography Hydrography',
#package_dir = {'': './'},
include_package_data=True,
)
|
# -*- coding: utf-8 -*-
from distribute_setup import use_setuptools
use_setuptools()
from setuptools import setup
setup(
name='cotede',
version='0.1.2',
author='Guilherme Castelão',
author_email='guilherme@castelao.net',
packages=['cotede'],
url='http://cotede.castelao.net',
license='See LICENSE.txt',
description='Quality Control of CTD profiles',
long_description=open('README.rst').read(),
classifiers=[
'Development Status :: 1 - Planning',
'Programming Language :: Python :: 2',
],
keywords='CTD SeaBird QualityControl Oceanography Hydrography',
#package_dir = {'': './'},
include_package_data=True,
)
Update to 0.2, pre-alpha. Fundamental tests are working.# -*- coding: utf-8 -*-
from distribute_setup import use_setuptools
use_setuptools()
from setuptools import setup
setup(
name='cotede',
version='0.2.0',
author='Guilherme Castelão',
author_email='guilherme@castelao.net',
packages=['cotede'],
url='http://cotede.castelao.net',
license='See LICENSE.txt',
description='Quality Control of CTD profiles',
long_description=open('README.rst').read(),
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Programming Language :: Python :: 2',
],
keywords='CTD SeaBird QualityControl Oceanography Hydrography',
#package_dir = {'': './'},
include_package_data=True,
)
|
<commit_before># -*- coding: utf-8 -*-
from distribute_setup import use_setuptools
use_setuptools()
from setuptools import setup
setup(
name='cotede',
version='0.1.2',
author='Guilherme Castelão',
author_email='guilherme@castelao.net',
packages=['cotede'],
url='http://cotede.castelao.net',
license='See LICENSE.txt',
description='Quality Control of CTD profiles',
long_description=open('README.rst').read(),
classifiers=[
'Development Status :: 1 - Planning',
'Programming Language :: Python :: 2',
],
keywords='CTD SeaBird QualityControl Oceanography Hydrography',
#package_dir = {'': './'},
include_package_data=True,
)
<commit_msg>Update to 0.2, pre-alpha. Fundamental tests are working.<commit_after># -*- coding: utf-8 -*-
from distribute_setup import use_setuptools
use_setuptools()
from setuptools import setup
setup(
name='cotede',
version='0.2.0',
author='Guilherme Castelão',
author_email='guilherme@castelao.net',
packages=['cotede'],
url='http://cotede.castelao.net',
license='See LICENSE.txt',
description='Quality Control of CTD profiles',
long_description=open('README.rst').read(),
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Programming Language :: Python :: 2',
],
keywords='CTD SeaBird QualityControl Oceanography Hydrography',
#package_dir = {'': './'},
include_package_data=True,
)
|
75c1e7ffbc938a4543094360df4ddc1e0262ce5f
|
setup.py
|
setup.py
|
version = '0.1.0'
with open('requirements.txt', 'r') as f:
install_requires = [x.strip() for x in f.readlines()]
from setuptools import setup, find_packages
setup(
name='bodylabs-rigger',
version=version,
author='Body Labs',
author_email='david.smith@bodylabs.com',
description="Utilities for rigging a mesh from Body Labs' BodyKit API.",
url='https://github.com/bodylabs/rigger',
license='BSD',
packages=find_packages(),
install_requires=install_requires,
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules'
]
)
|
version = '0.1.0'
with open('requirements.txt', 'r') as f:
install_requires = [x.strip() for x in f.readlines()]
from setuptools import setup, find_packages
setup(
name='bodylabs-rigger',
version=version,
author='Body Labs',
author_email='david.smith@bodylabs.com',
description="Utilities for rigging a mesh from Body Labs' BodyKit API.",
url='https://github.com/bodylabs/rigger',
license='BSD',
packages=find_packages(),
package_data={
'bodylabs_rigger.static': ['rig_assets.json']
},
install_requires=install_requires,
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules'
]
)
|
Add rig_assets.json as package data.
|
Add rig_assets.json as package data.
|
Python
|
bsd-2-clause
|
bodylabs/rigger,kaiserk/rigger
|
version = '0.1.0'
with open('requirements.txt', 'r') as f:
install_requires = [x.strip() for x in f.readlines()]
from setuptools import setup, find_packages
setup(
name='bodylabs-rigger',
version=version,
author='Body Labs',
author_email='david.smith@bodylabs.com',
description="Utilities for rigging a mesh from Body Labs' BodyKit API.",
url='https://github.com/bodylabs/rigger',
license='BSD',
packages=find_packages(),
install_requires=install_requires,
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules'
]
)
Add rig_assets.json as package data.
|
version = '0.1.0'
with open('requirements.txt', 'r') as f:
install_requires = [x.strip() for x in f.readlines()]
from setuptools import setup, find_packages
setup(
name='bodylabs-rigger',
version=version,
author='Body Labs',
author_email='david.smith@bodylabs.com',
description="Utilities for rigging a mesh from Body Labs' BodyKit API.",
url='https://github.com/bodylabs/rigger',
license='BSD',
packages=find_packages(),
package_data={
'bodylabs_rigger.static': ['rig_assets.json']
},
install_requires=install_requires,
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules'
]
)
|
<commit_before>version = '0.1.0'
with open('requirements.txt', 'r') as f:
install_requires = [x.strip() for x in f.readlines()]
from setuptools import setup, find_packages
setup(
name='bodylabs-rigger',
version=version,
author='Body Labs',
author_email='david.smith@bodylabs.com',
description="Utilities for rigging a mesh from Body Labs' BodyKit API.",
url='https://github.com/bodylabs/rigger',
license='BSD',
packages=find_packages(),
install_requires=install_requires,
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules'
]
)
<commit_msg>Add rig_assets.json as package data.<commit_after>
|
version = '0.1.0'
with open('requirements.txt', 'r') as f:
install_requires = [x.strip() for x in f.readlines()]
from setuptools import setup, find_packages
setup(
name='bodylabs-rigger',
version=version,
author='Body Labs',
author_email='david.smith@bodylabs.com',
description="Utilities for rigging a mesh from Body Labs' BodyKit API.",
url='https://github.com/bodylabs/rigger',
license='BSD',
packages=find_packages(),
package_data={
'bodylabs_rigger.static': ['rig_assets.json']
},
install_requires=install_requires,
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules'
]
)
|
version = '0.1.0'
with open('requirements.txt', 'r') as f:
install_requires = [x.strip() for x in f.readlines()]
from setuptools import setup, find_packages
setup(
name='bodylabs-rigger',
version=version,
author='Body Labs',
author_email='david.smith@bodylabs.com',
description="Utilities for rigging a mesh from Body Labs' BodyKit API.",
url='https://github.com/bodylabs/rigger',
license='BSD',
packages=find_packages(),
install_requires=install_requires,
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules'
]
)
Add rig_assets.json as package data.version = '0.1.0'
with open('requirements.txt', 'r') as f:
install_requires = [x.strip() for x in f.readlines()]
from setuptools import setup, find_packages
setup(
name='bodylabs-rigger',
version=version,
author='Body Labs',
author_email='david.smith@bodylabs.com',
description="Utilities for rigging a mesh from Body Labs' BodyKit API.",
url='https://github.com/bodylabs/rigger',
license='BSD',
packages=find_packages(),
package_data={
'bodylabs_rigger.static': ['rig_assets.json']
},
install_requires=install_requires,
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules'
]
)
|
<commit_before>version = '0.1.0'
with open('requirements.txt', 'r') as f:
install_requires = [x.strip() for x in f.readlines()]
from setuptools import setup, find_packages
setup(
name='bodylabs-rigger',
version=version,
author='Body Labs',
author_email='david.smith@bodylabs.com',
description="Utilities for rigging a mesh from Body Labs' BodyKit API.",
url='https://github.com/bodylabs/rigger',
license='BSD',
packages=find_packages(),
install_requires=install_requires,
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules'
]
)
<commit_msg>Add rig_assets.json as package data.<commit_after>version = '0.1.0'
with open('requirements.txt', 'r') as f:
install_requires = [x.strip() for x in f.readlines()]
from setuptools import setup, find_packages
setup(
name='bodylabs-rigger',
version=version,
author='Body Labs',
author_email='david.smith@bodylabs.com',
description="Utilities for rigging a mesh from Body Labs' BodyKit API.",
url='https://github.com/bodylabs/rigger',
license='BSD',
packages=find_packages(),
package_data={
'bodylabs_rigger.static': ['rig_assets.json']
},
install_requires=install_requires,
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules'
]
)
|
4dc51fbc78800db0c3ba750ee92bac1ed49a944d
|
setup.py
|
setup.py
|
"""
setup.py
"""
from setuptools import setup, find_packages
setup(
name='SATOSA',
version='3.4.8',
description='Protocol proxy (SAML/OIDC).',
author='DIRG',
author_email='satosa-dev@lists.sunet.se',
license='Apache 2.0',
url='https://github.com/SUNET/SATOSA',
packages=find_packages('src/'),
package_dir={'': 'src'},
install_requires=[
"pyop",
"pysaml2==4.5.0",
"pycryptodomex",
"requests",
"PyYAML",
"gunicorn",
"Werkzeug",
"click",
"pystache"
],
extras_require={
"ldap": ["ldap3"]
},
zip_safe=False,
classifiers=[
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.4",
],
entry_points={
"console_scripts": ["satosa-saml-metadata=satosa.scripts.satosa_saml_metadata:construct_saml_metadata"]
}
)
|
"""
setup.py
"""
from setuptools import setup, find_packages
setup(
name='SATOSA',
version='3.4.8',
description='Protocol proxy (SAML/OIDC).',
author='DIRG',
author_email='satosa-dev@lists.sunet.se',
license='Apache 2.0',
url='https://github.com/SUNET/SATOSA',
packages=find_packages('src/'),
package_dir={'': 'src'},
install_requires=[
"pyop",
"pysaml2>=4.6.1",
"pycryptodomex",
"requests",
"PyYAML",
"gunicorn",
"Werkzeug",
"click",
"pystache"
],
extras_require={
"ldap": ["ldap3"]
},
zip_safe=False,
classifiers=[
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.4",
],
entry_points={
"console_scripts": ["satosa-saml-metadata=satosa.scripts.satosa_saml_metadata:construct_saml_metadata"]
}
)
|
Support optional NameID element in SAML response
|
Support optional NameID element in SAML response
Prior to pysaml2 v4.6.1 an exception is thrown when parsing a SAML
response with no NameID element.
satosa.exception.SATOSAAuthenticationError: Failed to parse authn request
pysaml2 v4.6.1 onwards supports SAML responses with no NameID element.
Signed-off-by: Ivan Kanakarakis <f60d6943d72436645c4304926eeeac2718a1142c@gmail.com>
|
Python
|
apache-2.0
|
SUNET/SATOSA,its-dirg/SATOSA,irtnog/SATOSA,SUNET/SATOSA,irtnog/SATOSA
|
"""
setup.py
"""
from setuptools import setup, find_packages
setup(
name='SATOSA',
version='3.4.8',
description='Protocol proxy (SAML/OIDC).',
author='DIRG',
author_email='satosa-dev@lists.sunet.se',
license='Apache 2.0',
url='https://github.com/SUNET/SATOSA',
packages=find_packages('src/'),
package_dir={'': 'src'},
install_requires=[
"pyop",
"pysaml2==4.5.0",
"pycryptodomex",
"requests",
"PyYAML",
"gunicorn",
"Werkzeug",
"click",
"pystache"
],
extras_require={
"ldap": ["ldap3"]
},
zip_safe=False,
classifiers=[
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.4",
],
entry_points={
"console_scripts": ["satosa-saml-metadata=satosa.scripts.satosa_saml_metadata:construct_saml_metadata"]
}
)
Support optional NameID element in SAML response
Prior to pysaml2 v4.6.1 an exception is thrown when parsing a SAML
response with no NameID element.
satosa.exception.SATOSAAuthenticationError: Failed to parse authn request
pysaml2 v4.6.1 onwards supports SAML responses with no NameID element.
Signed-off-by: Ivan Kanakarakis <f60d6943d72436645c4304926eeeac2718a1142c@gmail.com>
|
"""
setup.py
"""
from setuptools import setup, find_packages
setup(
name='SATOSA',
version='3.4.8',
description='Protocol proxy (SAML/OIDC).',
author='DIRG',
author_email='satosa-dev@lists.sunet.se',
license='Apache 2.0',
url='https://github.com/SUNET/SATOSA',
packages=find_packages('src/'),
package_dir={'': 'src'},
install_requires=[
"pyop",
"pysaml2>=4.6.1",
"pycryptodomex",
"requests",
"PyYAML",
"gunicorn",
"Werkzeug",
"click",
"pystache"
],
extras_require={
"ldap": ["ldap3"]
},
zip_safe=False,
classifiers=[
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.4",
],
entry_points={
"console_scripts": ["satosa-saml-metadata=satosa.scripts.satosa_saml_metadata:construct_saml_metadata"]
}
)
|
<commit_before>"""
setup.py
"""
from setuptools import setup, find_packages
setup(
name='SATOSA',
version='3.4.8',
description='Protocol proxy (SAML/OIDC).',
author='DIRG',
author_email='satosa-dev@lists.sunet.se',
license='Apache 2.0',
url='https://github.com/SUNET/SATOSA',
packages=find_packages('src/'),
package_dir={'': 'src'},
install_requires=[
"pyop",
"pysaml2==4.5.0",
"pycryptodomex",
"requests",
"PyYAML",
"gunicorn",
"Werkzeug",
"click",
"pystache"
],
extras_require={
"ldap": ["ldap3"]
},
zip_safe=False,
classifiers=[
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.4",
],
entry_points={
"console_scripts": ["satosa-saml-metadata=satosa.scripts.satosa_saml_metadata:construct_saml_metadata"]
}
)
<commit_msg>Support optional NameID element in SAML response
Prior to pysaml2 v4.6.1 an exception is thrown when parsing a SAML
response with no NameID element.
satosa.exception.SATOSAAuthenticationError: Failed to parse authn request
pysaml2 v4.6.1 onwards supports SAML responses with no NameID element.
Signed-off-by: Ivan Kanakarakis <f60d6943d72436645c4304926eeeac2718a1142c@gmail.com><commit_after>
|
"""
setup.py
"""
from setuptools import setup, find_packages
setup(
name='SATOSA',
version='3.4.8',
description='Protocol proxy (SAML/OIDC).',
author='DIRG',
author_email='satosa-dev@lists.sunet.se',
license='Apache 2.0',
url='https://github.com/SUNET/SATOSA',
packages=find_packages('src/'),
package_dir={'': 'src'},
install_requires=[
"pyop",
"pysaml2>=4.6.1",
"pycryptodomex",
"requests",
"PyYAML",
"gunicorn",
"Werkzeug",
"click",
"pystache"
],
extras_require={
"ldap": ["ldap3"]
},
zip_safe=False,
classifiers=[
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.4",
],
entry_points={
"console_scripts": ["satosa-saml-metadata=satosa.scripts.satosa_saml_metadata:construct_saml_metadata"]
}
)
|
"""
setup.py
"""
from setuptools import setup, find_packages
setup(
name='SATOSA',
version='3.4.8',
description='Protocol proxy (SAML/OIDC).',
author='DIRG',
author_email='satosa-dev@lists.sunet.se',
license='Apache 2.0',
url='https://github.com/SUNET/SATOSA',
packages=find_packages('src/'),
package_dir={'': 'src'},
install_requires=[
"pyop",
"pysaml2==4.5.0",
"pycryptodomex",
"requests",
"PyYAML",
"gunicorn",
"Werkzeug",
"click",
"pystache"
],
extras_require={
"ldap": ["ldap3"]
},
zip_safe=False,
classifiers=[
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.4",
],
entry_points={
"console_scripts": ["satosa-saml-metadata=satosa.scripts.satosa_saml_metadata:construct_saml_metadata"]
}
)
Support optional NameID element in SAML response
Prior to pysaml2 v4.6.1 an exception is thrown when parsing a SAML
response with no NameID element.
satosa.exception.SATOSAAuthenticationError: Failed to parse authn request
pysaml2 v4.6.1 onwards supports SAML responses with no NameID element.
Signed-off-by: Ivan Kanakarakis <f60d6943d72436645c4304926eeeac2718a1142c@gmail.com>"""
setup.py
"""
from setuptools import setup, find_packages
setup(
name='SATOSA',
version='3.4.8',
description='Protocol proxy (SAML/OIDC).',
author='DIRG',
author_email='satosa-dev@lists.sunet.se',
license='Apache 2.0',
url='https://github.com/SUNET/SATOSA',
packages=find_packages('src/'),
package_dir={'': 'src'},
install_requires=[
"pyop",
"pysaml2>=4.6.1",
"pycryptodomex",
"requests",
"PyYAML",
"gunicorn",
"Werkzeug",
"click",
"pystache"
],
extras_require={
"ldap": ["ldap3"]
},
zip_safe=False,
classifiers=[
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.4",
],
entry_points={
"console_scripts": ["satosa-saml-metadata=satosa.scripts.satosa_saml_metadata:construct_saml_metadata"]
}
)
|
<commit_before>"""
setup.py
"""
from setuptools import setup, find_packages
setup(
name='SATOSA',
version='3.4.8',
description='Protocol proxy (SAML/OIDC).',
author='DIRG',
author_email='satosa-dev@lists.sunet.se',
license='Apache 2.0',
url='https://github.com/SUNET/SATOSA',
packages=find_packages('src/'),
package_dir={'': 'src'},
install_requires=[
"pyop",
"pysaml2==4.5.0",
"pycryptodomex",
"requests",
"PyYAML",
"gunicorn",
"Werkzeug",
"click",
"pystache"
],
extras_require={
"ldap": ["ldap3"]
},
zip_safe=False,
classifiers=[
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.4",
],
entry_points={
"console_scripts": ["satosa-saml-metadata=satosa.scripts.satosa_saml_metadata:construct_saml_metadata"]
}
)
<commit_msg>Support optional NameID element in SAML response
Prior to pysaml2 v4.6.1 an exception is thrown when parsing a SAML
response with no NameID element.
satosa.exception.SATOSAAuthenticationError: Failed to parse authn request
pysaml2 v4.6.1 onwards supports SAML responses with no NameID element.
Signed-off-by: Ivan Kanakarakis <f60d6943d72436645c4304926eeeac2718a1142c@gmail.com><commit_after>"""
setup.py
"""
from setuptools import setup, find_packages
setup(
name='SATOSA',
version='3.4.8',
description='Protocol proxy (SAML/OIDC).',
author='DIRG',
author_email='satosa-dev@lists.sunet.se',
license='Apache 2.0',
url='https://github.com/SUNET/SATOSA',
packages=find_packages('src/'),
package_dir={'': 'src'},
install_requires=[
"pyop",
"pysaml2>=4.6.1",
"pycryptodomex",
"requests",
"PyYAML",
"gunicorn",
"Werkzeug",
"click",
"pystache"
],
extras_require={
"ldap": ["ldap3"]
},
zip_safe=False,
classifiers=[
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.4",
],
entry_points={
"console_scripts": ["satosa-saml-metadata=satosa.scripts.satosa_saml_metadata:construct_saml_metadata"]
}
)
|
09f5d2997408ba338edf83101834fd15151e135e
|
setup.py
|
setup.py
|
from setuptools import setup, find_packages
setup(
name='weaveserver',
version='0.8',
author='Srivatsan Iyer',
author_email='supersaiyanmode.rox@gmail.com',
packages=find_packages(),
license='MIT',
description='Library to interact with Weave Server',
long_description=open('README.md').read(),
install_requires=[
'weavelib',
'eventlet!=0.22',
'GitPython',
'redis',
],
entry_points={
'console_scripts': [
'weave-app = app:handle_launch'
]
}
)
|
from setuptools import setup, find_packages
setup(
name='weaveserver',
version='0.8',
author='Srivatsan Iyer',
author_email='supersaiyanmode.rox@gmail.com',
packages=find_packages(),
license='MIT',
description='Library to interact with Weave Server',
long_description=open('README.md').read(),
install_requires=[
'weavelib',
'eventlet!=0.22',
'bottle',
'GitPython',
'redis',
],
entry_points={
'console_scripts': [
'weave-app = app:handle_launch'
]
}
)
|
Use bottle to serve HTTP.
|
Use bottle to serve HTTP.
|
Python
|
mit
|
supersaiyanmode/HomePiServer,supersaiyanmode/HomePiServer,supersaiyanmode/HomePiServer
|
from setuptools import setup, find_packages
setup(
name='weaveserver',
version='0.8',
author='Srivatsan Iyer',
author_email='supersaiyanmode.rox@gmail.com',
packages=find_packages(),
license='MIT',
description='Library to interact with Weave Server',
long_description=open('README.md').read(),
install_requires=[
'weavelib',
'eventlet!=0.22',
'GitPython',
'redis',
],
entry_points={
'console_scripts': [
'weave-app = app:handle_launch'
]
}
)
Use bottle to serve HTTP.
|
from setuptools import setup, find_packages
setup(
name='weaveserver',
version='0.8',
author='Srivatsan Iyer',
author_email='supersaiyanmode.rox@gmail.com',
packages=find_packages(),
license='MIT',
description='Library to interact with Weave Server',
long_description=open('README.md').read(),
install_requires=[
'weavelib',
'eventlet!=0.22',
'bottle',
'GitPython',
'redis',
],
entry_points={
'console_scripts': [
'weave-app = app:handle_launch'
]
}
)
|
<commit_before>from setuptools import setup, find_packages
setup(
name='weaveserver',
version='0.8',
author='Srivatsan Iyer',
author_email='supersaiyanmode.rox@gmail.com',
packages=find_packages(),
license='MIT',
description='Library to interact with Weave Server',
long_description=open('README.md').read(),
install_requires=[
'weavelib',
'eventlet!=0.22',
'GitPython',
'redis',
],
entry_points={
'console_scripts': [
'weave-app = app:handle_launch'
]
}
)
<commit_msg>Use bottle to serve HTTP.<commit_after>
|
from setuptools import setup, find_packages
setup(
name='weaveserver',
version='0.8',
author='Srivatsan Iyer',
author_email='supersaiyanmode.rox@gmail.com',
packages=find_packages(),
license='MIT',
description='Library to interact with Weave Server',
long_description=open('README.md').read(),
install_requires=[
'weavelib',
'eventlet!=0.22',
'bottle',
'GitPython',
'redis',
],
entry_points={
'console_scripts': [
'weave-app = app:handle_launch'
]
}
)
|
from setuptools import setup, find_packages
setup(
name='weaveserver',
version='0.8',
author='Srivatsan Iyer',
author_email='supersaiyanmode.rox@gmail.com',
packages=find_packages(),
license='MIT',
description='Library to interact with Weave Server',
long_description=open('README.md').read(),
install_requires=[
'weavelib',
'eventlet!=0.22',
'GitPython',
'redis',
],
entry_points={
'console_scripts': [
'weave-app = app:handle_launch'
]
}
)
Use bottle to serve HTTP.from setuptools import setup, find_packages
setup(
name='weaveserver',
version='0.8',
author='Srivatsan Iyer',
author_email='supersaiyanmode.rox@gmail.com',
packages=find_packages(),
license='MIT',
description='Library to interact with Weave Server',
long_description=open('README.md').read(),
install_requires=[
'weavelib',
'eventlet!=0.22',
'bottle',
'GitPython',
'redis',
],
entry_points={
'console_scripts': [
'weave-app = app:handle_launch'
]
}
)
|
<commit_before>from setuptools import setup, find_packages
setup(
name='weaveserver',
version='0.8',
author='Srivatsan Iyer',
author_email='supersaiyanmode.rox@gmail.com',
packages=find_packages(),
license='MIT',
description='Library to interact with Weave Server',
long_description=open('README.md').read(),
install_requires=[
'weavelib',
'eventlet!=0.22',
'GitPython',
'redis',
],
entry_points={
'console_scripts': [
'weave-app = app:handle_launch'
]
}
)
<commit_msg>Use bottle to serve HTTP.<commit_after>from setuptools import setup, find_packages
setup(
name='weaveserver',
version='0.8',
author='Srivatsan Iyer',
author_email='supersaiyanmode.rox@gmail.com',
packages=find_packages(),
license='MIT',
description='Library to interact with Weave Server',
long_description=open('README.md').read(),
install_requires=[
'weavelib',
'eventlet!=0.22',
'bottle',
'GitPython',
'redis',
],
entry_points={
'console_scripts': [
'weave-app = app:handle_launch'
]
}
)
|
0b8c12fba3f6819616edf9b02d5207c129635688
|
setup.py
|
setup.py
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from os import path
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
readme_file = path.join(path.dirname(path.abspath(__file__)), 'README.rst')
with open(readme_file) as readme_file:
readme = readme_file.read()
setup(
name='syncer',
version='1.0.2',
description='Async to sync converter',
long_description=readme,
author='Hiroyuki Takagi',
author_email='miyako.dev@gmail.com',
url='https://github.com/miyakogi/syncer',
py_modules=['syncer'],
include_package_data=True,
license="MIT",
zip_safe=False,
keywords='syncer',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
],
test_suite='test_syncer',
)
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from os import path
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
readme_file = path.join(path.dirname(path.abspath(__file__)), 'README.rst')
with open(readme_file) as readme_file:
readme = readme_file.read()
setup(
name='syncer',
version='1.0.2',
description='Async to sync converter',
long_description=readme,
author='Hiroyuki Takagi',
author_email='miyako.dev@gmail.com',
url='https://github.com/miyakogi/syncer',
py_modules=['syncer'],
include_package_data=True,
license="MIT",
zip_safe=False,
keywords='syncer',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.5',
],
test_suite='test_syncer',
)
|
Add python3 :: Only classifier
|
Add python3 :: Only classifier
|
Python
|
mit
|
miyakogi/syncer
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from os import path
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
readme_file = path.join(path.dirname(path.abspath(__file__)), 'README.rst')
with open(readme_file) as readme_file:
readme = readme_file.read()
setup(
name='syncer',
version='1.0.2',
description='Async to sync converter',
long_description=readme,
author='Hiroyuki Takagi',
author_email='miyako.dev@gmail.com',
url='https://github.com/miyakogi/syncer',
py_modules=['syncer'],
include_package_data=True,
license="MIT",
zip_safe=False,
keywords='syncer',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
],
test_suite='test_syncer',
)
Add python3 :: Only classifier
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from os import path
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
readme_file = path.join(path.dirname(path.abspath(__file__)), 'README.rst')
with open(readme_file) as readme_file:
readme = readme_file.read()
setup(
name='syncer',
version='1.0.2',
description='Async to sync converter',
long_description=readme,
author='Hiroyuki Takagi',
author_email='miyako.dev@gmail.com',
url='https://github.com/miyakogi/syncer',
py_modules=['syncer'],
include_package_data=True,
license="MIT",
zip_safe=False,
keywords='syncer',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.5',
],
test_suite='test_syncer',
)
|
<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from os import path
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
readme_file = path.join(path.dirname(path.abspath(__file__)), 'README.rst')
with open(readme_file) as readme_file:
readme = readme_file.read()
setup(
name='syncer',
version='1.0.2',
description='Async to sync converter',
long_description=readme,
author='Hiroyuki Takagi',
author_email='miyako.dev@gmail.com',
url='https://github.com/miyakogi/syncer',
py_modules=['syncer'],
include_package_data=True,
license="MIT",
zip_safe=False,
keywords='syncer',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
],
test_suite='test_syncer',
)
<commit_msg>Add python3 :: Only classifier<commit_after>
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from os import path
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
readme_file = path.join(path.dirname(path.abspath(__file__)), 'README.rst')
with open(readme_file) as readme_file:
readme = readme_file.read()
setup(
name='syncer',
version='1.0.2',
description='Async to sync converter',
long_description=readme,
author='Hiroyuki Takagi',
author_email='miyako.dev@gmail.com',
url='https://github.com/miyakogi/syncer',
py_modules=['syncer'],
include_package_data=True,
license="MIT",
zip_safe=False,
keywords='syncer',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.5',
],
test_suite='test_syncer',
)
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from os import path
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
readme_file = path.join(path.dirname(path.abspath(__file__)), 'README.rst')
with open(readme_file) as readme_file:
readme = readme_file.read()
setup(
name='syncer',
version='1.0.2',
description='Async to sync converter',
long_description=readme,
author='Hiroyuki Takagi',
author_email='miyako.dev@gmail.com',
url='https://github.com/miyakogi/syncer',
py_modules=['syncer'],
include_package_data=True,
license="MIT",
zip_safe=False,
keywords='syncer',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
],
test_suite='test_syncer',
)
Add python3 :: Only classifier#!/usr/bin/env python
# -*- coding: utf-8 -*-
from os import path
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
readme_file = path.join(path.dirname(path.abspath(__file__)), 'README.rst')
with open(readme_file) as readme_file:
readme = readme_file.read()
setup(
name='syncer',
version='1.0.2',
description='Async to sync converter',
long_description=readme,
author='Hiroyuki Takagi',
author_email='miyako.dev@gmail.com',
url='https://github.com/miyakogi/syncer',
py_modules=['syncer'],
include_package_data=True,
license="MIT",
zip_safe=False,
keywords='syncer',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.5',
],
test_suite='test_syncer',
)
|
<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from os import path
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
readme_file = path.join(path.dirname(path.abspath(__file__)), 'README.rst')
with open(readme_file) as readme_file:
readme = readme_file.read()
setup(
name='syncer',
version='1.0.2',
description='Async to sync converter',
long_description=readme,
author='Hiroyuki Takagi',
author_email='miyako.dev@gmail.com',
url='https://github.com/miyakogi/syncer',
py_modules=['syncer'],
include_package_data=True,
license="MIT",
zip_safe=False,
keywords='syncer',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
],
test_suite='test_syncer',
)
<commit_msg>Add python3 :: Only classifier<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from os import path
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
readme_file = path.join(path.dirname(path.abspath(__file__)), 'README.rst')
with open(readme_file) as readme_file:
readme = readme_file.read()
setup(
name='syncer',
version='1.0.2',
description='Async to sync converter',
long_description=readme,
author='Hiroyuki Takagi',
author_email='miyako.dev@gmail.com',
url='https://github.com/miyakogi/syncer',
py_modules=['syncer'],
include_package_data=True,
license="MIT",
zip_safe=False,
keywords='syncer',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.5',
],
test_suite='test_syncer',
)
|
35870f0243e58c1b4c141499e39af54aea468d2c
|
setup.py
|
setup.py
|
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
config = {
'description': 'Collect xUnit xml files and upload them to bob-bench.org',
'author': 'Holger Hans Peter Freyther',
'url': 'http://www.bob-bench.org',
'download_url': 'http://www.bob-bench.org',
'author_email': 'help@bob-bench.org',
'version': '5',
'install_requires': [
'requests',
],
'license': 'AGPLv3+',
'packages': ['benchupload'],
'scripts': [],
'entry_points': {'console_scripts': ['benchupload=benchupload.__main__:main']},
'name': 'benchupload'
}
setup(**config)
|
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
config = {
'description': 'Collect xUnit xml files and upload them to bob-bench.org',
'author': 'Holger Hans Peter Freyther',
'url': 'http://www.bob-bench.org',
'download_url': 'http://www.bob-bench.org',
'author_email': 'help@bob-bench.org',
'version': '6',
'install_requires': [
'requests',
],
'license': 'AGPLv3+',
'packages': ['benchupload'],
'scripts': [],
'entry_points': {'console_scripts': ['benchupload=benchupload.__main__:main']},
'name': 'benchupload'
}
setup(**config)
|
Make a new release with circleci detection
|
Make a new release with circleci detection
|
Python
|
agpl-3.0
|
bob-bench/benchupload,bob-bench/benchupload
|
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
config = {
'description': 'Collect xUnit xml files and upload them to bob-bench.org',
'author': 'Holger Hans Peter Freyther',
'url': 'http://www.bob-bench.org',
'download_url': 'http://www.bob-bench.org',
'author_email': 'help@bob-bench.org',
'version': '5',
'install_requires': [
'requests',
],
'license': 'AGPLv3+',
'packages': ['benchupload'],
'scripts': [],
'entry_points': {'console_scripts': ['benchupload=benchupload.__main__:main']},
'name': 'benchupload'
}
setup(**config)
Make a new release with circleci detection
|
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
config = {
'description': 'Collect xUnit xml files and upload them to bob-bench.org',
'author': 'Holger Hans Peter Freyther',
'url': 'http://www.bob-bench.org',
'download_url': 'http://www.bob-bench.org',
'author_email': 'help@bob-bench.org',
'version': '6',
'install_requires': [
'requests',
],
'license': 'AGPLv3+',
'packages': ['benchupload'],
'scripts': [],
'entry_points': {'console_scripts': ['benchupload=benchupload.__main__:main']},
'name': 'benchupload'
}
setup(**config)
|
<commit_before>try:
from setuptools import setup
except ImportError:
from distutils.core import setup
config = {
'description': 'Collect xUnit xml files and upload them to bob-bench.org',
'author': 'Holger Hans Peter Freyther',
'url': 'http://www.bob-bench.org',
'download_url': 'http://www.bob-bench.org',
'author_email': 'help@bob-bench.org',
'version': '5',
'install_requires': [
'requests',
],
'license': 'AGPLv3+',
'packages': ['benchupload'],
'scripts': [],
'entry_points': {'console_scripts': ['benchupload=benchupload.__main__:main']},
'name': 'benchupload'
}
setup(**config)
<commit_msg>Make a new release with circleci detection<commit_after>
|
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
config = {
'description': 'Collect xUnit xml files and upload them to bob-bench.org',
'author': 'Holger Hans Peter Freyther',
'url': 'http://www.bob-bench.org',
'download_url': 'http://www.bob-bench.org',
'author_email': 'help@bob-bench.org',
'version': '6',
'install_requires': [
'requests',
],
'license': 'AGPLv3+',
'packages': ['benchupload'],
'scripts': [],
'entry_points': {'console_scripts': ['benchupload=benchupload.__main__:main']},
'name': 'benchupload'
}
setup(**config)
|
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
config = {
'description': 'Collect xUnit xml files and upload them to bob-bench.org',
'author': 'Holger Hans Peter Freyther',
'url': 'http://www.bob-bench.org',
'download_url': 'http://www.bob-bench.org',
'author_email': 'help@bob-bench.org',
'version': '5',
'install_requires': [
'requests',
],
'license': 'AGPLv3+',
'packages': ['benchupload'],
'scripts': [],
'entry_points': {'console_scripts': ['benchupload=benchupload.__main__:main']},
'name': 'benchupload'
}
setup(**config)
Make a new release with circleci detectiontry:
from setuptools import setup
except ImportError:
from distutils.core import setup
config = {
'description': 'Collect xUnit xml files and upload them to bob-bench.org',
'author': 'Holger Hans Peter Freyther',
'url': 'http://www.bob-bench.org',
'download_url': 'http://www.bob-bench.org',
'author_email': 'help@bob-bench.org',
'version': '6',
'install_requires': [
'requests',
],
'license': 'AGPLv3+',
'packages': ['benchupload'],
'scripts': [],
'entry_points': {'console_scripts': ['benchupload=benchupload.__main__:main']},
'name': 'benchupload'
}
setup(**config)
|
<commit_before>try:
from setuptools import setup
except ImportError:
from distutils.core import setup
config = {
'description': 'Collect xUnit xml files and upload them to bob-bench.org',
'author': 'Holger Hans Peter Freyther',
'url': 'http://www.bob-bench.org',
'download_url': 'http://www.bob-bench.org',
'author_email': 'help@bob-bench.org',
'version': '5',
'install_requires': [
'requests',
],
'license': 'AGPLv3+',
'packages': ['benchupload'],
'scripts': [],
'entry_points': {'console_scripts': ['benchupload=benchupload.__main__:main']},
'name': 'benchupload'
}
setup(**config)
<commit_msg>Make a new release with circleci detection<commit_after>try:
from setuptools import setup
except ImportError:
from distutils.core import setup
config = {
'description': 'Collect xUnit xml files and upload them to bob-bench.org',
'author': 'Holger Hans Peter Freyther',
'url': 'http://www.bob-bench.org',
'download_url': 'http://www.bob-bench.org',
'author_email': 'help@bob-bench.org',
'version': '6',
'install_requires': [
'requests',
],
'license': 'AGPLv3+',
'packages': ['benchupload'],
'scripts': [],
'entry_points': {'console_scripts': ['benchupload=benchupload.__main__:main']},
'name': 'benchupload'
}
setup(**config)
|
3a4ff183940f3af7e3ec7cfe491f7d60409f5fea
|
setup.py
|
setup.py
|
from setuptools import setup, find_packages
import wsgiservice
setup(
name='WsgiService',
version=wsgiservice.__version__,
description="A lean WSGI framework for easy creation of REST services",
author=", ".join(wsgiservice.__author__),
url='http://github.com/pneff/wsgiservice/tree/master',
download_url='http://pypi.python.org/pypi/WsgiService',
packages=find_packages(),
install_requires=[
'decorator',
'webob >= 0.9.7',
],
tests_require=[
'nose',
'mox',
],
test_suite='nose.collector',
license='BSD',
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 2.6',
'Topic :: Internet :: WWW/HTTP :: WSGI :: Application',
]
)
|
from setuptools import setup, find_packages
import wsgiservice
setup(
name='WsgiService',
version=wsgiservice.__version__,
description="A lean WSGI framework for easy creation of REST services",
long_description=open('README').read(),
author=", ".join(wsgiservice.__author__),
url='http://github.com/pneff/wsgiservice/tree/master',
download_url='http://pypi.python.org/pypi/WsgiService',
packages=find_packages(),
install_requires=[
'decorator',
'webob >= 0.9.7',
],
tests_require=[
'nose',
'mox',
],
test_suite='nose.collector',
license='BSD',
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 2.6',
'Topic :: Internet :: WWW/HTTP :: WSGI :: Application',
]
)
|
Add the README as the long description to the package.
|
Add the README as the long description to the package.
|
Python
|
bsd-2-clause
|
pneff/wsgiservice,beekpr/wsgiservice
|
from setuptools import setup, find_packages
import wsgiservice
setup(
name='WsgiService',
version=wsgiservice.__version__,
description="A lean WSGI framework for easy creation of REST services",
author=", ".join(wsgiservice.__author__),
url='http://github.com/pneff/wsgiservice/tree/master',
download_url='http://pypi.python.org/pypi/WsgiService',
packages=find_packages(),
install_requires=[
'decorator',
'webob >= 0.9.7',
],
tests_require=[
'nose',
'mox',
],
test_suite='nose.collector',
license='BSD',
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 2.6',
'Topic :: Internet :: WWW/HTTP :: WSGI :: Application',
]
)
Add the README as the long description to the package.
|
from setuptools import setup, find_packages
import wsgiservice
setup(
name='WsgiService',
version=wsgiservice.__version__,
description="A lean WSGI framework for easy creation of REST services",
long_description=open('README').read(),
author=", ".join(wsgiservice.__author__),
url='http://github.com/pneff/wsgiservice/tree/master',
download_url='http://pypi.python.org/pypi/WsgiService',
packages=find_packages(),
install_requires=[
'decorator',
'webob >= 0.9.7',
],
tests_require=[
'nose',
'mox',
],
test_suite='nose.collector',
license='BSD',
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 2.6',
'Topic :: Internet :: WWW/HTTP :: WSGI :: Application',
]
)
|
<commit_before>from setuptools import setup, find_packages
import wsgiservice
setup(
name='WsgiService',
version=wsgiservice.__version__,
description="A lean WSGI framework for easy creation of REST services",
author=", ".join(wsgiservice.__author__),
url='http://github.com/pneff/wsgiservice/tree/master',
download_url='http://pypi.python.org/pypi/WsgiService',
packages=find_packages(),
install_requires=[
'decorator',
'webob >= 0.9.7',
],
tests_require=[
'nose',
'mox',
],
test_suite='nose.collector',
license='BSD',
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 2.6',
'Topic :: Internet :: WWW/HTTP :: WSGI :: Application',
]
)
<commit_msg>Add the README as the long description to the package.<commit_after>
|
from setuptools import setup, find_packages
import wsgiservice
setup(
name='WsgiService',
version=wsgiservice.__version__,
description="A lean WSGI framework for easy creation of REST services",
long_description=open('README').read(),
author=", ".join(wsgiservice.__author__),
url='http://github.com/pneff/wsgiservice/tree/master',
download_url='http://pypi.python.org/pypi/WsgiService',
packages=find_packages(),
install_requires=[
'decorator',
'webob >= 0.9.7',
],
tests_require=[
'nose',
'mox',
],
test_suite='nose.collector',
license='BSD',
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 2.6',
'Topic :: Internet :: WWW/HTTP :: WSGI :: Application',
]
)
|
from setuptools import setup, find_packages
import wsgiservice
setup(
name='WsgiService',
version=wsgiservice.__version__,
description="A lean WSGI framework for easy creation of REST services",
author=", ".join(wsgiservice.__author__),
url='http://github.com/pneff/wsgiservice/tree/master',
download_url='http://pypi.python.org/pypi/WsgiService',
packages=find_packages(),
install_requires=[
'decorator',
'webob >= 0.9.7',
],
tests_require=[
'nose',
'mox',
],
test_suite='nose.collector',
license='BSD',
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 2.6',
'Topic :: Internet :: WWW/HTTP :: WSGI :: Application',
]
)
Add the README as the long description to the package.from setuptools import setup, find_packages
import wsgiservice
setup(
name='WsgiService',
version=wsgiservice.__version__,
description="A lean WSGI framework for easy creation of REST services",
long_description=open('README').read(),
author=", ".join(wsgiservice.__author__),
url='http://github.com/pneff/wsgiservice/tree/master',
download_url='http://pypi.python.org/pypi/WsgiService',
packages=find_packages(),
install_requires=[
'decorator',
'webob >= 0.9.7',
],
tests_require=[
'nose',
'mox',
],
test_suite='nose.collector',
license='BSD',
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 2.6',
'Topic :: Internet :: WWW/HTTP :: WSGI :: Application',
]
)
|
<commit_before>from setuptools import setup, find_packages
import wsgiservice
setup(
name='WsgiService',
version=wsgiservice.__version__,
description="A lean WSGI framework for easy creation of REST services",
author=", ".join(wsgiservice.__author__),
url='http://github.com/pneff/wsgiservice/tree/master',
download_url='http://pypi.python.org/pypi/WsgiService',
packages=find_packages(),
install_requires=[
'decorator',
'webob >= 0.9.7',
],
tests_require=[
'nose',
'mox',
],
test_suite='nose.collector',
license='BSD',
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 2.6',
'Topic :: Internet :: WWW/HTTP :: WSGI :: Application',
]
)
<commit_msg>Add the README as the long description to the package.<commit_after>from setuptools import setup, find_packages
import wsgiservice
setup(
name='WsgiService',
version=wsgiservice.__version__,
description="A lean WSGI framework for easy creation of REST services",
long_description=open('README').read(),
author=", ".join(wsgiservice.__author__),
url='http://github.com/pneff/wsgiservice/tree/master',
download_url='http://pypi.python.org/pypi/WsgiService',
packages=find_packages(),
install_requires=[
'decorator',
'webob >= 0.9.7',
],
tests_require=[
'nose',
'mox',
],
test_suite='nose.collector',
license='BSD',
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 2.6',
'Topic :: Internet :: WWW/HTTP :: WSGI :: Application',
]
)
|
270d58388effc5777dea7a186d9578116bd0afb4
|
setup.py
|
setup.py
|
from setuptools import setup
setup(
name = 'PyFVCOM',
packages = ['PyFVCOM'],
version = '1.3.4',
description = ("PyFVCOM is a collection of various tools and utilities which can be used to extract, analyse and plot input and output files from FVCOM."),
author = 'Pierre Cazenave',
author_email = 'pica@pml.ac.uk',
url = 'https://gitlab.ecosystem-modelling.pml.ac.uk/fvcom/PyFVCOM',
download_url = 'http://gitlab.em.pml.ac.uk/fvcom/PyFVCOM/repository/archive.tar.gz?ref=1.2.1',
keywords = ['fvcom', 'unstructured grid', 'mesh'],
license = 'MIT',
platforms = 'any',
install_requires = ['pyshp', 'jdcal', 'scipy', 'numpy', 'matplotlib', 'netCDF4', 'lxml', 'sqlite3', 'matplotlib'],
classifiers = []
)
|
from setuptools import setup
setup(
name = 'PyFVCOM',
packages = ['PyFVCOM'],
version = '1.3.4',
description = ("PyFVCOM is a collection of various tools and utilities which can be used to extract, analyse and plot input and output files from FVCOM."),
author = 'Pierre Cazenave',
author_email = 'pica@pml.ac.uk',
url = 'https://gitlab.ecosystem-modelling.pml.ac.uk/fvcom/PyFVCOM',
download_url = 'http://gitlab.em.pml.ac.uk/fvcom/PyFVCOM/repository/archive.tar.gz?ref=1.2.1',
keywords = ['fvcom', 'unstructured grid', 'mesh'],
license = 'MIT',
platforms = 'any',
install_requires = ['pyshp', 'jdcal', 'scipy', 'numpy', 'matplotlib', 'netCDF4', 'lxml', 'matplotlib'],
classifiers = []
)
|
Remove sqlite3 (part of the standard library) from the list of requirements.
|
Remove sqlite3 (part of the standard library) from the list of requirements.
|
Python
|
mit
|
pwcazenave/PyFVCOM
|
from setuptools import setup
setup(
name = 'PyFVCOM',
packages = ['PyFVCOM'],
version = '1.3.4',
description = ("PyFVCOM is a collection of various tools and utilities which can be used to extract, analyse and plot input and output files from FVCOM."),
author = 'Pierre Cazenave',
author_email = 'pica@pml.ac.uk',
url = 'https://gitlab.ecosystem-modelling.pml.ac.uk/fvcom/PyFVCOM',
download_url = 'http://gitlab.em.pml.ac.uk/fvcom/PyFVCOM/repository/archive.tar.gz?ref=1.2.1',
keywords = ['fvcom', 'unstructured grid', 'mesh'],
license = 'MIT',
platforms = 'any',
install_requires = ['pyshp', 'jdcal', 'scipy', 'numpy', 'matplotlib', 'netCDF4', 'lxml', 'sqlite3', 'matplotlib'],
classifiers = []
)
Remove sqlite3 (part of the standard library) from the list of requirements.
|
from setuptools import setup
setup(
name = 'PyFVCOM',
packages = ['PyFVCOM'],
version = '1.3.4',
description = ("PyFVCOM is a collection of various tools and utilities which can be used to extract, analyse and plot input and output files from FVCOM."),
author = 'Pierre Cazenave',
author_email = 'pica@pml.ac.uk',
url = 'https://gitlab.ecosystem-modelling.pml.ac.uk/fvcom/PyFVCOM',
download_url = 'http://gitlab.em.pml.ac.uk/fvcom/PyFVCOM/repository/archive.tar.gz?ref=1.2.1',
keywords = ['fvcom', 'unstructured grid', 'mesh'],
license = 'MIT',
platforms = 'any',
install_requires = ['pyshp', 'jdcal', 'scipy', 'numpy', 'matplotlib', 'netCDF4', 'lxml', 'matplotlib'],
classifiers = []
)
|
<commit_before>from setuptools import setup
setup(
name = 'PyFVCOM',
packages = ['PyFVCOM'],
version = '1.3.4',
description = ("PyFVCOM is a collection of various tools and utilities which can be used to extract, analyse and plot input and output files from FVCOM."),
author = 'Pierre Cazenave',
author_email = 'pica@pml.ac.uk',
url = 'https://gitlab.ecosystem-modelling.pml.ac.uk/fvcom/PyFVCOM',
download_url = 'http://gitlab.em.pml.ac.uk/fvcom/PyFVCOM/repository/archive.tar.gz?ref=1.2.1',
keywords = ['fvcom', 'unstructured grid', 'mesh'],
license = 'MIT',
platforms = 'any',
install_requires = ['pyshp', 'jdcal', 'scipy', 'numpy', 'matplotlib', 'netCDF4', 'lxml', 'sqlite3', 'matplotlib'],
classifiers = []
)
<commit_msg>Remove sqlite3 (part of the standard library) from the list of requirements.<commit_after>
|
from setuptools import setup
setup(
name = 'PyFVCOM',
packages = ['PyFVCOM'],
version = '1.3.4',
description = ("PyFVCOM is a collection of various tools and utilities which can be used to extract, analyse and plot input and output files from FVCOM."),
author = 'Pierre Cazenave',
author_email = 'pica@pml.ac.uk',
url = 'https://gitlab.ecosystem-modelling.pml.ac.uk/fvcom/PyFVCOM',
download_url = 'http://gitlab.em.pml.ac.uk/fvcom/PyFVCOM/repository/archive.tar.gz?ref=1.2.1',
keywords = ['fvcom', 'unstructured grid', 'mesh'],
license = 'MIT',
platforms = 'any',
install_requires = ['pyshp', 'jdcal', 'scipy', 'numpy', 'matplotlib', 'netCDF4', 'lxml', 'matplotlib'],
classifiers = []
)
|
from setuptools import setup
setup(
name = 'PyFVCOM',
packages = ['PyFVCOM'],
version = '1.3.4',
description = ("PyFVCOM is a collection of various tools and utilities which can be used to extract, analyse and plot input and output files from FVCOM."),
author = 'Pierre Cazenave',
author_email = 'pica@pml.ac.uk',
url = 'https://gitlab.ecosystem-modelling.pml.ac.uk/fvcom/PyFVCOM',
download_url = 'http://gitlab.em.pml.ac.uk/fvcom/PyFVCOM/repository/archive.tar.gz?ref=1.2.1',
keywords = ['fvcom', 'unstructured grid', 'mesh'],
license = 'MIT',
platforms = 'any',
install_requires = ['pyshp', 'jdcal', 'scipy', 'numpy', 'matplotlib', 'netCDF4', 'lxml', 'sqlite3', 'matplotlib'],
classifiers = []
)
Remove sqlite3 (part of the standard library) from the list of requirements.from setuptools import setup
setup(
name = 'PyFVCOM',
packages = ['PyFVCOM'],
version = '1.3.4',
description = ("PyFVCOM is a collection of various tools and utilities which can be used to extract, analyse and plot input and output files from FVCOM."),
author = 'Pierre Cazenave',
author_email = 'pica@pml.ac.uk',
url = 'https://gitlab.ecosystem-modelling.pml.ac.uk/fvcom/PyFVCOM',
download_url = 'http://gitlab.em.pml.ac.uk/fvcom/PyFVCOM/repository/archive.tar.gz?ref=1.2.1',
keywords = ['fvcom', 'unstructured grid', 'mesh'],
license = 'MIT',
platforms = 'any',
install_requires = ['pyshp', 'jdcal', 'scipy', 'numpy', 'matplotlib', 'netCDF4', 'lxml', 'matplotlib'],
classifiers = []
)
|
<commit_before>from setuptools import setup
setup(
name = 'PyFVCOM',
packages = ['PyFVCOM'],
version = '1.3.4',
description = ("PyFVCOM is a collection of various tools and utilities which can be used to extract, analyse and plot input and output files from FVCOM."),
author = 'Pierre Cazenave',
author_email = 'pica@pml.ac.uk',
url = 'https://gitlab.ecosystem-modelling.pml.ac.uk/fvcom/PyFVCOM',
download_url = 'http://gitlab.em.pml.ac.uk/fvcom/PyFVCOM/repository/archive.tar.gz?ref=1.2.1',
keywords = ['fvcom', 'unstructured grid', 'mesh'],
license = 'MIT',
platforms = 'any',
install_requires = ['pyshp', 'jdcal', 'scipy', 'numpy', 'matplotlib', 'netCDF4', 'lxml', 'sqlite3', 'matplotlib'],
classifiers = []
)
<commit_msg>Remove sqlite3 (part of the standard library) from the list of requirements.<commit_after>from setuptools import setup
setup(
name = 'PyFVCOM',
packages = ['PyFVCOM'],
version = '1.3.4',
description = ("PyFVCOM is a collection of various tools and utilities which can be used to extract, analyse and plot input and output files from FVCOM."),
author = 'Pierre Cazenave',
author_email = 'pica@pml.ac.uk',
url = 'https://gitlab.ecosystem-modelling.pml.ac.uk/fvcom/PyFVCOM',
download_url = 'http://gitlab.em.pml.ac.uk/fvcom/PyFVCOM/repository/archive.tar.gz?ref=1.2.1',
keywords = ['fvcom', 'unstructured grid', 'mesh'],
license = 'MIT',
platforms = 'any',
install_requires = ['pyshp', 'jdcal', 'scipy', 'numpy', 'matplotlib', 'netCDF4', 'lxml', 'matplotlib'],
classifiers = []
)
|
d1537c9111a3834de07a330953ab0c1a31240ec4
|
setup.py
|
setup.py
|
#! /usr/bin/env python3
from distutils.core import setup
setup(
description = 'File downloader for danbooru',
author = 'Todd Gaunt',
url = 'https://www.github.com/toddgaunt/danboorsync',
download_url = 'https://www.github.com/toddgaunt/danboorsync',
author_email = 'toddgaunt@protonmail.ch',
version = '1.0',
packages = ['danboorsync'],
package_dir = {'danboorsync':'src'},
# Change these per distribution
data_files = [('/usr/share/man/man1', ['doc/danboorsync.1']),
('/usr/share/licenses/danboorsync/LICENSE', ['doc/LICENSE'])],
scripts = ['/bin/danboorsync'],
name = 'danboorsync'
)
|
#! /usr/bin/env python3
from distutils.core import setup
setup(
description = 'File downloader for danbooru',
author = 'Todd Gaunt',
url = 'https://www.github.com/toddgaunt/danboorsync',
download_url = 'https://www.github.com/toddgaunt/danboorsync',
author_email = 'toddgaunt@protonmail.ch',
version = '1.0',
packages = ['danboorsync'],
package_dir = {'danboorsync':'src'},
# Change these per distribution
data_files = [('/usr/share/man/man1', ['doc/danboorsync.1']),
('/usr/share/licenses/danboorsync/LICENSE', ['doc/LICENSE'])],
scripts = ['bin/danboorsync'],
name = 'danboorsync'
)
|
Remove / from script path to make it search bin rather than /bin
|
Remove / from script path to make it search bin rather than /bin
|
Python
|
isc
|
toddgaunt/imgfetch
|
#! /usr/bin/env python3
from distutils.core import setup
setup(
description = 'File downloader for danbooru',
author = 'Todd Gaunt',
url = 'https://www.github.com/toddgaunt/danboorsync',
download_url = 'https://www.github.com/toddgaunt/danboorsync',
author_email = 'toddgaunt@protonmail.ch',
version = '1.0',
packages = ['danboorsync'],
package_dir = {'danboorsync':'src'},
# Change these per distribution
data_files = [('/usr/share/man/man1', ['doc/danboorsync.1']),
('/usr/share/licenses/danboorsync/LICENSE', ['doc/LICENSE'])],
scripts = ['/bin/danboorsync'],
name = 'danboorsync'
)
Remove / from script path to make it search bin rather than /bin
|
#! /usr/bin/env python3
from distutils.core import setup
setup(
description = 'File downloader for danbooru',
author = 'Todd Gaunt',
url = 'https://www.github.com/toddgaunt/danboorsync',
download_url = 'https://www.github.com/toddgaunt/danboorsync',
author_email = 'toddgaunt@protonmail.ch',
version = '1.0',
packages = ['danboorsync'],
package_dir = {'danboorsync':'src'},
# Change these per distribution
data_files = [('/usr/share/man/man1', ['doc/danboorsync.1']),
('/usr/share/licenses/danboorsync/LICENSE', ['doc/LICENSE'])],
scripts = ['bin/danboorsync'],
name = 'danboorsync'
)
|
<commit_before>#! /usr/bin/env python3
from distutils.core import setup
setup(
description = 'File downloader for danbooru',
author = 'Todd Gaunt',
url = 'https://www.github.com/toddgaunt/danboorsync',
download_url = 'https://www.github.com/toddgaunt/danboorsync',
author_email = 'toddgaunt@protonmail.ch',
version = '1.0',
packages = ['danboorsync'],
package_dir = {'danboorsync':'src'},
# Change these per distribution
data_files = [('/usr/share/man/man1', ['doc/danboorsync.1']),
('/usr/share/licenses/danboorsync/LICENSE', ['doc/LICENSE'])],
scripts = ['/bin/danboorsync'],
name = 'danboorsync'
)
<commit_msg>Remove / from script path to make it search bin rather than /bin<commit_after>
|
#! /usr/bin/env python3
from distutils.core import setup
setup(
description = 'File downloader for danbooru',
author = 'Todd Gaunt',
url = 'https://www.github.com/toddgaunt/danboorsync',
download_url = 'https://www.github.com/toddgaunt/danboorsync',
author_email = 'toddgaunt@protonmail.ch',
version = '1.0',
packages = ['danboorsync'],
package_dir = {'danboorsync':'src'},
# Change these per distribution
data_files = [('/usr/share/man/man1', ['doc/danboorsync.1']),
('/usr/share/licenses/danboorsync/LICENSE', ['doc/LICENSE'])],
scripts = ['bin/danboorsync'],
name = 'danboorsync'
)
|
#! /usr/bin/env python3
from distutils.core import setup
setup(
description = 'File downloader for danbooru',
author = 'Todd Gaunt',
url = 'https://www.github.com/toddgaunt/danboorsync',
download_url = 'https://www.github.com/toddgaunt/danboorsync',
author_email = 'toddgaunt@protonmail.ch',
version = '1.0',
packages = ['danboorsync'],
package_dir = {'danboorsync':'src'},
# Change these per distribution
data_files = [('/usr/share/man/man1', ['doc/danboorsync.1']),
('/usr/share/licenses/danboorsync/LICENSE', ['doc/LICENSE'])],
scripts = ['/bin/danboorsync'],
name = 'danboorsync'
)
Remove / from script path to make it search bin rather than /bin#! /usr/bin/env python3
from distutils.core import setup
setup(
description = 'File downloader for danbooru',
author = 'Todd Gaunt',
url = 'https://www.github.com/toddgaunt/danboorsync',
download_url = 'https://www.github.com/toddgaunt/danboorsync',
author_email = 'toddgaunt@protonmail.ch',
version = '1.0',
packages = ['danboorsync'],
package_dir = {'danboorsync':'src'},
# Change these per distribution
data_files = [('/usr/share/man/man1', ['doc/danboorsync.1']),
('/usr/share/licenses/danboorsync/LICENSE', ['doc/LICENSE'])],
scripts = ['bin/danboorsync'],
name = 'danboorsync'
)
|
<commit_before>#! /usr/bin/env python3
from distutils.core import setup
setup(
description = 'File downloader for danbooru',
author = 'Todd Gaunt',
url = 'https://www.github.com/toddgaunt/danboorsync',
download_url = 'https://www.github.com/toddgaunt/danboorsync',
author_email = 'toddgaunt@protonmail.ch',
version = '1.0',
packages = ['danboorsync'],
package_dir = {'danboorsync':'src'},
# Change these per distribution
data_files = [('/usr/share/man/man1', ['doc/danboorsync.1']),
('/usr/share/licenses/danboorsync/LICENSE', ['doc/LICENSE'])],
scripts = ['/bin/danboorsync'],
name = 'danboorsync'
)
<commit_msg>Remove / from script path to make it search bin rather than /bin<commit_after>#! /usr/bin/env python3
from distutils.core import setup
setup(
description = 'File downloader for danbooru',
author = 'Todd Gaunt',
url = 'https://www.github.com/toddgaunt/danboorsync',
download_url = 'https://www.github.com/toddgaunt/danboorsync',
author_email = 'toddgaunt@protonmail.ch',
version = '1.0',
packages = ['danboorsync'],
package_dir = {'danboorsync':'src'},
# Change these per distribution
data_files = [('/usr/share/man/man1', ['doc/danboorsync.1']),
('/usr/share/licenses/danboorsync/LICENSE', ['doc/LICENSE'])],
scripts = ['bin/danboorsync'],
name = 'danboorsync'
)
|
aea05ee76193ac0abe2f6673910917bf13a3b339
|
setup.py
|
setup.py
|
from distutils.core import setup
setup(
name='simplecrypto',
version=open('CHANGES.txt').read().split()[0],
author='Lucas Boppre Niehues',
author_email='lucasboppre@gmail.com',
packages=['simplecrypto'],
url='http://pypi.python.org/pypi/simplecrypto/',
license='LICENSE.txt',
description='simplecrypto',
long_description=open('README.md').read(),
install_requires=[
'PyCrypto',
],
classifiers=[
'Development Status :: 3 - Alpha',
'Topic :: Security :: Cryptography',
'License :: OSI Approved :: MIT License',
],
)
|
from distutils.core import setup
setup(
name='simplecrypto',
version=open('CHANGES.txt').read().split()[0],
author='Lucas Boppre Niehues',
author_email='lucasboppre@gmail.com',
packages=['simplecrypto'],
url='https://github.com/boppreh/simplecrypto',
license='LICENSE.txt',
description='simplecrypto',
long_description=open('README.md').read(),
install_requires=[
'PyCrypto',
],
classifiers=[
'Development Status :: 3 - Alpha',
'Topic :: Security :: Cryptography',
'License :: OSI Approved :: MIT License',
],
)
|
Change homepage to github URL
|
Change homepage to github URL
|
Python
|
mit
|
boppreh/simplecrypto
|
from distutils.core import setup
setup(
name='simplecrypto',
version=open('CHANGES.txt').read().split()[0],
author='Lucas Boppre Niehues',
author_email='lucasboppre@gmail.com',
packages=['simplecrypto'],
url='http://pypi.python.org/pypi/simplecrypto/',
license='LICENSE.txt',
description='simplecrypto',
long_description=open('README.md').read(),
install_requires=[
'PyCrypto',
],
classifiers=[
'Development Status :: 3 - Alpha',
'Topic :: Security :: Cryptography',
'License :: OSI Approved :: MIT License',
],
)
Change homepage to github URL
|
from distutils.core import setup
setup(
name='simplecrypto',
version=open('CHANGES.txt').read().split()[0],
author='Lucas Boppre Niehues',
author_email='lucasboppre@gmail.com',
packages=['simplecrypto'],
url='https://github.com/boppreh/simplecrypto',
license='LICENSE.txt',
description='simplecrypto',
long_description=open('README.md').read(),
install_requires=[
'PyCrypto',
],
classifiers=[
'Development Status :: 3 - Alpha',
'Topic :: Security :: Cryptography',
'License :: OSI Approved :: MIT License',
],
)
|
<commit_before>from distutils.core import setup
setup(
name='simplecrypto',
version=open('CHANGES.txt').read().split()[0],
author='Lucas Boppre Niehues',
author_email='lucasboppre@gmail.com',
packages=['simplecrypto'],
url='http://pypi.python.org/pypi/simplecrypto/',
license='LICENSE.txt',
description='simplecrypto',
long_description=open('README.md').read(),
install_requires=[
'PyCrypto',
],
classifiers=[
'Development Status :: 3 - Alpha',
'Topic :: Security :: Cryptography',
'License :: OSI Approved :: MIT License',
],
)
<commit_msg>Change homepage to github URL<commit_after>
|
from distutils.core import setup
setup(
name='simplecrypto',
version=open('CHANGES.txt').read().split()[0],
author='Lucas Boppre Niehues',
author_email='lucasboppre@gmail.com',
packages=['simplecrypto'],
url='https://github.com/boppreh/simplecrypto',
license='LICENSE.txt',
description='simplecrypto',
long_description=open('README.md').read(),
install_requires=[
'PyCrypto',
],
classifiers=[
'Development Status :: 3 - Alpha',
'Topic :: Security :: Cryptography',
'License :: OSI Approved :: MIT License',
],
)
|
from distutils.core import setup
setup(
name='simplecrypto',
version=open('CHANGES.txt').read().split()[0],
author='Lucas Boppre Niehues',
author_email='lucasboppre@gmail.com',
packages=['simplecrypto'],
url='http://pypi.python.org/pypi/simplecrypto/',
license='LICENSE.txt',
description='simplecrypto',
long_description=open('README.md').read(),
install_requires=[
'PyCrypto',
],
classifiers=[
'Development Status :: 3 - Alpha',
'Topic :: Security :: Cryptography',
'License :: OSI Approved :: MIT License',
],
)
Change homepage to github URLfrom distutils.core import setup
setup(
name='simplecrypto',
version=open('CHANGES.txt').read().split()[0],
author='Lucas Boppre Niehues',
author_email='lucasboppre@gmail.com',
packages=['simplecrypto'],
url='https://github.com/boppreh/simplecrypto',
license='LICENSE.txt',
description='simplecrypto',
long_description=open('README.md').read(),
install_requires=[
'PyCrypto',
],
classifiers=[
'Development Status :: 3 - Alpha',
'Topic :: Security :: Cryptography',
'License :: OSI Approved :: MIT License',
],
)
|
<commit_before>from distutils.core import setup
setup(
name='simplecrypto',
version=open('CHANGES.txt').read().split()[0],
author='Lucas Boppre Niehues',
author_email='lucasboppre@gmail.com',
packages=['simplecrypto'],
url='http://pypi.python.org/pypi/simplecrypto/',
license='LICENSE.txt',
description='simplecrypto',
long_description=open('README.md').read(),
install_requires=[
'PyCrypto',
],
classifiers=[
'Development Status :: 3 - Alpha',
'Topic :: Security :: Cryptography',
'License :: OSI Approved :: MIT License',
],
)
<commit_msg>Change homepage to github URL<commit_after>from distutils.core import setup
setup(
name='simplecrypto',
version=open('CHANGES.txt').read().split()[0],
author='Lucas Boppre Niehues',
author_email='lucasboppre@gmail.com',
packages=['simplecrypto'],
url='https://github.com/boppreh/simplecrypto',
license='LICENSE.txt',
description='simplecrypto',
long_description=open('README.md').read(),
install_requires=[
'PyCrypto',
],
classifiers=[
'Development Status :: 3 - Alpha',
'Topic :: Security :: Cryptography',
'License :: OSI Approved :: MIT License',
],
)
|
ebe9d80277b2b03a50b0fe69836bf28a13edbbd9
|
setup.py
|
setup.py
|
#!/usr/bin/env python
# coding=utf8
import os
import sys
from setuptools import setup
if sys.version_info < (2, 7):
tests_require = ['unittest2', 'mock']
test_suite = 'unittest2.collector'
else:
tests_require = ['mock']
test_suite = 'unittest.collector'
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='simplekv',
version='0.4dev',
description='A simple key-value storage for binary data.',
long_description=read('README.rst'),
keywords='key-value-store storage key-value db database',
author='Marc Brinkmann',
author_email='git@marcbrinkmann.de',
url='http://github.com/mbr/simplekv',
license='MIT',
packages=['simplekv'],
py_modules=[],
tests_require=tests_require,
test_suite='unittest2.collector',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Topic :: Database',
'Topic :: Software Development :: Libraries',
]
)
|
#!/usr/bin/env python
# coding=utf8
import os
import sys
from setuptools import setup, find_packages
if sys.version_info < (2, 7):
tests_require = ['unittest2', 'mock']
test_suite = 'unittest2.collector'
else:
tests_require = ['mock']
test_suite = 'unittest.collector'
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='simplekv',
version='0.4dev',
description='A simple key-value storage for binary data.',
long_description=read('README.rst'),
keywords='key-value-store storage key-value db database',
author='Marc Brinkmann',
author_email='git@marcbrinkmann.de',
url='http://github.com/mbr/simplekv',
license='MIT',
packages=find_packages(exclude=['test']),
py_modules=[],
tests_require=tests_require,
test_suite='unittest2.collector',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Topic :: Database',
'Topic :: Software Development :: Libraries',
]
)
|
Use find_packages to discover packages.
|
Use find_packages to discover packages.
|
Python
|
mit
|
karteek/simplekv,fmarczin/simplekv,mbr/simplekv,karteek/simplekv,mbr/simplekv,fmarczin/simplekv
|
#!/usr/bin/env python
# coding=utf8
import os
import sys
from setuptools import setup
if sys.version_info < (2, 7):
tests_require = ['unittest2', 'mock']
test_suite = 'unittest2.collector'
else:
tests_require = ['mock']
test_suite = 'unittest.collector'
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='simplekv',
version='0.4dev',
description='A simple key-value storage for binary data.',
long_description=read('README.rst'),
keywords='key-value-store storage key-value db database',
author='Marc Brinkmann',
author_email='git@marcbrinkmann.de',
url='http://github.com/mbr/simplekv',
license='MIT',
packages=['simplekv'],
py_modules=[],
tests_require=tests_require,
test_suite='unittest2.collector',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Topic :: Database',
'Topic :: Software Development :: Libraries',
]
)
Use find_packages to discover packages.
|
#!/usr/bin/env python
# coding=utf8
import os
import sys
from setuptools import setup, find_packages
if sys.version_info < (2, 7):
tests_require = ['unittest2', 'mock']
test_suite = 'unittest2.collector'
else:
tests_require = ['mock']
test_suite = 'unittest.collector'
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='simplekv',
version='0.4dev',
description='A simple key-value storage for binary data.',
long_description=read('README.rst'),
keywords='key-value-store storage key-value db database',
author='Marc Brinkmann',
author_email='git@marcbrinkmann.de',
url='http://github.com/mbr/simplekv',
license='MIT',
packages=find_packages(exclude=['test']),
py_modules=[],
tests_require=tests_require,
test_suite='unittest2.collector',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Topic :: Database',
'Topic :: Software Development :: Libraries',
]
)
|
<commit_before>#!/usr/bin/env python
# coding=utf8
import os
import sys
from setuptools import setup
if sys.version_info < (2, 7):
tests_require = ['unittest2', 'mock']
test_suite = 'unittest2.collector'
else:
tests_require = ['mock']
test_suite = 'unittest.collector'
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='simplekv',
version='0.4dev',
description='A simple key-value storage for binary data.',
long_description=read('README.rst'),
keywords='key-value-store storage key-value db database',
author='Marc Brinkmann',
author_email='git@marcbrinkmann.de',
url='http://github.com/mbr/simplekv',
license='MIT',
packages=['simplekv'],
py_modules=[],
tests_require=tests_require,
test_suite='unittest2.collector',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Topic :: Database',
'Topic :: Software Development :: Libraries',
]
)
<commit_msg>Use find_packages to discover packages.<commit_after>
|
#!/usr/bin/env python
# coding=utf8
import os
import sys
from setuptools import setup, find_packages
if sys.version_info < (2, 7):
tests_require = ['unittest2', 'mock']
test_suite = 'unittest2.collector'
else:
tests_require = ['mock']
test_suite = 'unittest.collector'
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='simplekv',
version='0.4dev',
description='A simple key-value storage for binary data.',
long_description=read('README.rst'),
keywords='key-value-store storage key-value db database',
author='Marc Brinkmann',
author_email='git@marcbrinkmann.de',
url='http://github.com/mbr/simplekv',
license='MIT',
packages=find_packages(exclude=['test']),
py_modules=[],
tests_require=tests_require,
test_suite='unittest2.collector',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Topic :: Database',
'Topic :: Software Development :: Libraries',
]
)
|
#!/usr/bin/env python
# coding=utf8
import os
import sys
from setuptools import setup
if sys.version_info < (2, 7):
tests_require = ['unittest2', 'mock']
test_suite = 'unittest2.collector'
else:
tests_require = ['mock']
test_suite = 'unittest.collector'
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='simplekv',
version='0.4dev',
description='A simple key-value storage for binary data.',
long_description=read('README.rst'),
keywords='key-value-store storage key-value db database',
author='Marc Brinkmann',
author_email='git@marcbrinkmann.de',
url='http://github.com/mbr/simplekv',
license='MIT',
packages=['simplekv'],
py_modules=[],
tests_require=tests_require,
test_suite='unittest2.collector',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Topic :: Database',
'Topic :: Software Development :: Libraries',
]
)
Use find_packages to discover packages.#!/usr/bin/env python
# coding=utf8
import os
import sys
from setuptools import setup, find_packages
if sys.version_info < (2, 7):
tests_require = ['unittest2', 'mock']
test_suite = 'unittest2.collector'
else:
tests_require = ['mock']
test_suite = 'unittest.collector'
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='simplekv',
version='0.4dev',
description='A simple key-value storage for binary data.',
long_description=read('README.rst'),
keywords='key-value-store storage key-value db database',
author='Marc Brinkmann',
author_email='git@marcbrinkmann.de',
url='http://github.com/mbr/simplekv',
license='MIT',
packages=find_packages(exclude=['test']),
py_modules=[],
tests_require=tests_require,
test_suite='unittest2.collector',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Topic :: Database',
'Topic :: Software Development :: Libraries',
]
)
|
<commit_before>#!/usr/bin/env python
# coding=utf8
import os
import sys
from setuptools import setup
if sys.version_info < (2, 7):
tests_require = ['unittest2', 'mock']
test_suite = 'unittest2.collector'
else:
tests_require = ['mock']
test_suite = 'unittest.collector'
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='simplekv',
version='0.4dev',
description='A simple key-value storage for binary data.',
long_description=read('README.rst'),
keywords='key-value-store storage key-value db database',
author='Marc Brinkmann',
author_email='git@marcbrinkmann.de',
url='http://github.com/mbr/simplekv',
license='MIT',
packages=['simplekv'],
py_modules=[],
tests_require=tests_require,
test_suite='unittest2.collector',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Topic :: Database',
'Topic :: Software Development :: Libraries',
]
)
<commit_msg>Use find_packages to discover packages.<commit_after>#!/usr/bin/env python
# coding=utf8
import os
import sys
from setuptools import setup, find_packages
if sys.version_info < (2, 7):
tests_require = ['unittest2', 'mock']
test_suite = 'unittest2.collector'
else:
tests_require = ['mock']
test_suite = 'unittest.collector'
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='simplekv',
version='0.4dev',
description='A simple key-value storage for binary data.',
long_description=read('README.rst'),
keywords='key-value-store storage key-value db database',
author='Marc Brinkmann',
author_email='git@marcbrinkmann.de',
url='http://github.com/mbr/simplekv',
license='MIT',
packages=find_packages(exclude=['test']),
py_modules=[],
tests_require=tests_require,
test_suite='unittest2.collector',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Topic :: Database',
'Topic :: Software Development :: Libraries',
]
)
|
69c14597c676236b64398dc3cbe83d42ec4e3a9b
|
setup.py
|
setup.py
|
import os
import sys
from setuptools import setup
INSTALL_REQUIRES = ['requests >=1.0.3', 'boto >=2.1.1', 'six >=1.2.0', 'urllib3 >= 1.0.2']
if sys.version_info < (2, 7, 0):
INSTALL_REQUIRES.append('argparse>=1.1')
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name="qds_sdk",
version="1.3.4",
author="Qubole",
author_email="dev@qubole.com",
description=("Python SDK for coding to the Qubole Data Service API"),
keywords="qubole sdk api",
url="https://github.com/qubole/qds-sdk-py",
packages=['qds_sdk'],
scripts=['bin/qds.py'],
install_requires=INSTALL_REQUIRES,
long_description=read('README.rst'),
classifiers=[
"Environment :: Console",
"Intended Audience :: Developers",
"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.3",
"Programming Language :: Python :: 3.4"
]
)
|
import os
import sys
from setuptools import setup
INSTALL_REQUIRES = ['requests >=1.0.3', 'boto >=2.1.1', 'six >=1.2.0', 'urllib3 >= 1.0.2']
if sys.version_info < (2, 7, 0):
INSTALL_REQUIRES.append('argparse>=1.1')
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name="qds_sdk",
version="1.3.4",
author="Qubole",
author_email="dev@qubole.com",
description=("Python SDK for coding to the Qubole Data Service API"),
keywords="qubole sdk api",
url="https://github.com/qubole/qds-sdk-py",
packages=['qds_sdk'],
scripts=['bin/qds.py'],
install_requires=INSTALL_REQUIRES,
long_description=read('README.rst'),
classifiers=[
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"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.3",
"Programming Language :: Python :: 3.4"
]
)
|
Update trove classifiers with Apache License.
|
Update trove classifiers with Apache License.
|
Python
|
apache-2.0
|
tanishgupta1/qds-sdk-py-1,prakharjain09/qds-sdk-py,adeshr/qds-sdk-py,msumit/qds-sdk-py,rohitpruthi95/qds-sdk-py,vrajat/qds-sdk-py,qubole/qds-sdk-py,jainavi/qds-sdk-py,yogesh2021/qds-sdk-py
|
import os
import sys
from setuptools import setup
INSTALL_REQUIRES = ['requests >=1.0.3', 'boto >=2.1.1', 'six >=1.2.0', 'urllib3 >= 1.0.2']
if sys.version_info < (2, 7, 0):
INSTALL_REQUIRES.append('argparse>=1.1')
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name="qds_sdk",
version="1.3.4",
author="Qubole",
author_email="dev@qubole.com",
description=("Python SDK for coding to the Qubole Data Service API"),
keywords="qubole sdk api",
url="https://github.com/qubole/qds-sdk-py",
packages=['qds_sdk'],
scripts=['bin/qds.py'],
install_requires=INSTALL_REQUIRES,
long_description=read('README.rst'),
classifiers=[
"Environment :: Console",
"Intended Audience :: Developers",
"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.3",
"Programming Language :: Python :: 3.4"
]
)
Update trove classifiers with Apache License.
|
import os
import sys
from setuptools import setup
INSTALL_REQUIRES = ['requests >=1.0.3', 'boto >=2.1.1', 'six >=1.2.0', 'urllib3 >= 1.0.2']
if sys.version_info < (2, 7, 0):
INSTALL_REQUIRES.append('argparse>=1.1')
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name="qds_sdk",
version="1.3.4",
author="Qubole",
author_email="dev@qubole.com",
description=("Python SDK for coding to the Qubole Data Service API"),
keywords="qubole sdk api",
url="https://github.com/qubole/qds-sdk-py",
packages=['qds_sdk'],
scripts=['bin/qds.py'],
install_requires=INSTALL_REQUIRES,
long_description=read('README.rst'),
classifiers=[
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"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.3",
"Programming Language :: Python :: 3.4"
]
)
|
<commit_before>import os
import sys
from setuptools import setup
INSTALL_REQUIRES = ['requests >=1.0.3', 'boto >=2.1.1', 'six >=1.2.0', 'urllib3 >= 1.0.2']
if sys.version_info < (2, 7, 0):
INSTALL_REQUIRES.append('argparse>=1.1')
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name="qds_sdk",
version="1.3.4",
author="Qubole",
author_email="dev@qubole.com",
description=("Python SDK for coding to the Qubole Data Service API"),
keywords="qubole sdk api",
url="https://github.com/qubole/qds-sdk-py",
packages=['qds_sdk'],
scripts=['bin/qds.py'],
install_requires=INSTALL_REQUIRES,
long_description=read('README.rst'),
classifiers=[
"Environment :: Console",
"Intended Audience :: Developers",
"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.3",
"Programming Language :: Python :: 3.4"
]
)
<commit_msg>Update trove classifiers with Apache License.<commit_after>
|
import os
import sys
from setuptools import setup
INSTALL_REQUIRES = ['requests >=1.0.3', 'boto >=2.1.1', 'six >=1.2.0', 'urllib3 >= 1.0.2']
if sys.version_info < (2, 7, 0):
INSTALL_REQUIRES.append('argparse>=1.1')
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name="qds_sdk",
version="1.3.4",
author="Qubole",
author_email="dev@qubole.com",
description=("Python SDK for coding to the Qubole Data Service API"),
keywords="qubole sdk api",
url="https://github.com/qubole/qds-sdk-py",
packages=['qds_sdk'],
scripts=['bin/qds.py'],
install_requires=INSTALL_REQUIRES,
long_description=read('README.rst'),
classifiers=[
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"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.3",
"Programming Language :: Python :: 3.4"
]
)
|
import os
import sys
from setuptools import setup
INSTALL_REQUIRES = ['requests >=1.0.3', 'boto >=2.1.1', 'six >=1.2.0', 'urllib3 >= 1.0.2']
if sys.version_info < (2, 7, 0):
INSTALL_REQUIRES.append('argparse>=1.1')
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name="qds_sdk",
version="1.3.4",
author="Qubole",
author_email="dev@qubole.com",
description=("Python SDK for coding to the Qubole Data Service API"),
keywords="qubole sdk api",
url="https://github.com/qubole/qds-sdk-py",
packages=['qds_sdk'],
scripts=['bin/qds.py'],
install_requires=INSTALL_REQUIRES,
long_description=read('README.rst'),
classifiers=[
"Environment :: Console",
"Intended Audience :: Developers",
"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.3",
"Programming Language :: Python :: 3.4"
]
)
Update trove classifiers with Apache License.import os
import sys
from setuptools import setup
INSTALL_REQUIRES = ['requests >=1.0.3', 'boto >=2.1.1', 'six >=1.2.0', 'urllib3 >= 1.0.2']
if sys.version_info < (2, 7, 0):
INSTALL_REQUIRES.append('argparse>=1.1')
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name="qds_sdk",
version="1.3.4",
author="Qubole",
author_email="dev@qubole.com",
description=("Python SDK for coding to the Qubole Data Service API"),
keywords="qubole sdk api",
url="https://github.com/qubole/qds-sdk-py",
packages=['qds_sdk'],
scripts=['bin/qds.py'],
install_requires=INSTALL_REQUIRES,
long_description=read('README.rst'),
classifiers=[
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"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.3",
"Programming Language :: Python :: 3.4"
]
)
|
<commit_before>import os
import sys
from setuptools import setup
INSTALL_REQUIRES = ['requests >=1.0.3', 'boto >=2.1.1', 'six >=1.2.0', 'urllib3 >= 1.0.2']
if sys.version_info < (2, 7, 0):
INSTALL_REQUIRES.append('argparse>=1.1')
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name="qds_sdk",
version="1.3.4",
author="Qubole",
author_email="dev@qubole.com",
description=("Python SDK for coding to the Qubole Data Service API"),
keywords="qubole sdk api",
url="https://github.com/qubole/qds-sdk-py",
packages=['qds_sdk'],
scripts=['bin/qds.py'],
install_requires=INSTALL_REQUIRES,
long_description=read('README.rst'),
classifiers=[
"Environment :: Console",
"Intended Audience :: Developers",
"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.3",
"Programming Language :: Python :: 3.4"
]
)
<commit_msg>Update trove classifiers with Apache License.<commit_after>import os
import sys
from setuptools import setup
INSTALL_REQUIRES = ['requests >=1.0.3', 'boto >=2.1.1', 'six >=1.2.0', 'urllib3 >= 1.0.2']
if sys.version_info < (2, 7, 0):
INSTALL_REQUIRES.append('argparse>=1.1')
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name="qds_sdk",
version="1.3.4",
author="Qubole",
author_email="dev@qubole.com",
description=("Python SDK for coding to the Qubole Data Service API"),
keywords="qubole sdk api",
url="https://github.com/qubole/qds-sdk-py",
packages=['qds_sdk'],
scripts=['bin/qds.py'],
install_requires=INSTALL_REQUIRES,
long_description=read('README.rst'),
classifiers=[
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"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.3",
"Programming Language :: Python :: 3.4"
]
)
|
612b9244560afd0d5eb4d7b1bf27464c4b2946d4
|
setup.py
|
setup.py
|
from setuptools import setup, find_packages
from os.path import join, dirname
version = 0.1
short_description = "Git cherry pick tracking."
long_description = open(join(dirname(__file__), "README.txt"), "r").read()
setup(name = "git_origin",
version = version,
description = short_description,
long_description = long_description,
classifiers = [], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
keywords = "",
author = "Chris Larson",
author_email = "clarson@kergoth.com",
url = "",
license = "GPL v2",
packages = find_packages("src"),
package_dir = {"": "src"},
namespace_packages = ["git_origin"],
include_package_data = True,
zip_safe = False,
install_requires = [
"setuptools",
"GitPython",
],
)
|
from setuptools import setup, find_packages
from os.path import join, dirname
version = 0.1
short_description = "Git cherry pick tracking."
long_description = open(join(dirname(__file__), "README.txt"), "r").read()
setup(name = "git_origin",
version = version,
description = short_description,
long_description = long_description,
classifiers = [], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
keywords = "",
author = "Chris Larson",
author_email = "clarson@kergoth.com",
url = "",
license = "GPL v2",
packages = find_packages("src"),
package_dir = {"": "src"},
namespace_packages = ["git_origin"],
include_package_data = True,
zip_safe = False,
install_requires = [
"setuptools",
"GitPython",
],
entry_points = {
"console_scripts": [
"git-origin = git_origin.cmd:origin",
],
},
)
|
Add missing console_scripts entry point.
|
Add missing console_scripts entry point.
Signed-off-by: Chris Larson <8cf06b7089d5169434d5def8b2d1c9c9c95f6e71@mvista.com>
|
Python
|
mit
|
kergoth/git-origin
|
from setuptools import setup, find_packages
from os.path import join, dirname
version = 0.1
short_description = "Git cherry pick tracking."
long_description = open(join(dirname(__file__), "README.txt"), "r").read()
setup(name = "git_origin",
version = version,
description = short_description,
long_description = long_description,
classifiers = [], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
keywords = "",
author = "Chris Larson",
author_email = "clarson@kergoth.com",
url = "",
license = "GPL v2",
packages = find_packages("src"),
package_dir = {"": "src"},
namespace_packages = ["git_origin"],
include_package_data = True,
zip_safe = False,
install_requires = [
"setuptools",
"GitPython",
],
)
Add missing console_scripts entry point.
Signed-off-by: Chris Larson <8cf06b7089d5169434d5def8b2d1c9c9c95f6e71@mvista.com>
|
from setuptools import setup, find_packages
from os.path import join, dirname
version = 0.1
short_description = "Git cherry pick tracking."
long_description = open(join(dirname(__file__), "README.txt"), "r").read()
setup(name = "git_origin",
version = version,
description = short_description,
long_description = long_description,
classifiers = [], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
keywords = "",
author = "Chris Larson",
author_email = "clarson@kergoth.com",
url = "",
license = "GPL v2",
packages = find_packages("src"),
package_dir = {"": "src"},
namespace_packages = ["git_origin"],
include_package_data = True,
zip_safe = False,
install_requires = [
"setuptools",
"GitPython",
],
entry_points = {
"console_scripts": [
"git-origin = git_origin.cmd:origin",
],
},
)
|
<commit_before>from setuptools import setup, find_packages
from os.path import join, dirname
version = 0.1
short_description = "Git cherry pick tracking."
long_description = open(join(dirname(__file__), "README.txt"), "r").read()
setup(name = "git_origin",
version = version,
description = short_description,
long_description = long_description,
classifiers = [], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
keywords = "",
author = "Chris Larson",
author_email = "clarson@kergoth.com",
url = "",
license = "GPL v2",
packages = find_packages("src"),
package_dir = {"": "src"},
namespace_packages = ["git_origin"],
include_package_data = True,
zip_safe = False,
install_requires = [
"setuptools",
"GitPython",
],
)
<commit_msg>Add missing console_scripts entry point.
Signed-off-by: Chris Larson <8cf06b7089d5169434d5def8b2d1c9c9c95f6e71@mvista.com><commit_after>
|
from setuptools import setup, find_packages
from os.path import join, dirname
version = 0.1
short_description = "Git cherry pick tracking."
long_description = open(join(dirname(__file__), "README.txt"), "r").read()
setup(name = "git_origin",
version = version,
description = short_description,
long_description = long_description,
classifiers = [], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
keywords = "",
author = "Chris Larson",
author_email = "clarson@kergoth.com",
url = "",
license = "GPL v2",
packages = find_packages("src"),
package_dir = {"": "src"},
namespace_packages = ["git_origin"],
include_package_data = True,
zip_safe = False,
install_requires = [
"setuptools",
"GitPython",
],
entry_points = {
"console_scripts": [
"git-origin = git_origin.cmd:origin",
],
},
)
|
from setuptools import setup, find_packages
from os.path import join, dirname
version = 0.1
short_description = "Git cherry pick tracking."
long_description = open(join(dirname(__file__), "README.txt"), "r").read()
setup(name = "git_origin",
version = version,
description = short_description,
long_description = long_description,
classifiers = [], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
keywords = "",
author = "Chris Larson",
author_email = "clarson@kergoth.com",
url = "",
license = "GPL v2",
packages = find_packages("src"),
package_dir = {"": "src"},
namespace_packages = ["git_origin"],
include_package_data = True,
zip_safe = False,
install_requires = [
"setuptools",
"GitPython",
],
)
Add missing console_scripts entry point.
Signed-off-by: Chris Larson <8cf06b7089d5169434d5def8b2d1c9c9c95f6e71@mvista.com>from setuptools import setup, find_packages
from os.path import join, dirname
version = 0.1
short_description = "Git cherry pick tracking."
long_description = open(join(dirname(__file__), "README.txt"), "r").read()
setup(name = "git_origin",
version = version,
description = short_description,
long_description = long_description,
classifiers = [], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
keywords = "",
author = "Chris Larson",
author_email = "clarson@kergoth.com",
url = "",
license = "GPL v2",
packages = find_packages("src"),
package_dir = {"": "src"},
namespace_packages = ["git_origin"],
include_package_data = True,
zip_safe = False,
install_requires = [
"setuptools",
"GitPython",
],
entry_points = {
"console_scripts": [
"git-origin = git_origin.cmd:origin",
],
},
)
|
<commit_before>from setuptools import setup, find_packages
from os.path import join, dirname
version = 0.1
short_description = "Git cherry pick tracking."
long_description = open(join(dirname(__file__), "README.txt"), "r").read()
setup(name = "git_origin",
version = version,
description = short_description,
long_description = long_description,
classifiers = [], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
keywords = "",
author = "Chris Larson",
author_email = "clarson@kergoth.com",
url = "",
license = "GPL v2",
packages = find_packages("src"),
package_dir = {"": "src"},
namespace_packages = ["git_origin"],
include_package_data = True,
zip_safe = False,
install_requires = [
"setuptools",
"GitPython",
],
)
<commit_msg>Add missing console_scripts entry point.
Signed-off-by: Chris Larson <8cf06b7089d5169434d5def8b2d1c9c9c95f6e71@mvista.com><commit_after>from setuptools import setup, find_packages
from os.path import join, dirname
version = 0.1
short_description = "Git cherry pick tracking."
long_description = open(join(dirname(__file__), "README.txt"), "r").read()
setup(name = "git_origin",
version = version,
description = short_description,
long_description = long_description,
classifiers = [], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
keywords = "",
author = "Chris Larson",
author_email = "clarson@kergoth.com",
url = "",
license = "GPL v2",
packages = find_packages("src"),
package_dir = {"": "src"},
namespace_packages = ["git_origin"],
include_package_data = True,
zip_safe = False,
install_requires = [
"setuptools",
"GitPython",
],
entry_points = {
"console_scripts": [
"git-origin = git_origin.cmd:origin",
],
},
)
|
888cdf6797690fe202b03ac0fc2ba46d5df3c6d5
|
setup.py
|
setup.py
|
from setuptools import setup
setup(
name='property-caching',
version='1.0.1',
description='Property caching',
author='Yola',
author_email='engineers@yola.com',
license='MIT (Expat)',
url='https://github.com/yola/property-caching',
packages=['property_caching'],
test_suite='tests'
)
|
from setuptools import setup
setup(
name='property-caching',
version='1.0.1',
description='Property caching',
author='Yola',
author_email='engineers@yola.com',
license='MIT (Expat)',
url='https://github.com/yola/property-caching',
packages=['property_caching'],
test_suite='tests',
classifiers=[
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: MIT License',
]
)
|
Add classifiers for python 2 and 3 support
|
Add classifiers for python 2 and 3 support
|
Python
|
mit
|
yola/property-caching
|
from setuptools import setup
setup(
name='property-caching',
version='1.0.1',
description='Property caching',
author='Yola',
author_email='engineers@yola.com',
license='MIT (Expat)',
url='https://github.com/yola/property-caching',
packages=['property_caching'],
test_suite='tests'
)
Add classifiers for python 2 and 3 support
|
from setuptools import setup
setup(
name='property-caching',
version='1.0.1',
description='Property caching',
author='Yola',
author_email='engineers@yola.com',
license='MIT (Expat)',
url='https://github.com/yola/property-caching',
packages=['property_caching'],
test_suite='tests',
classifiers=[
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: MIT License',
]
)
|
<commit_before>from setuptools import setup
setup(
name='property-caching',
version='1.0.1',
description='Property caching',
author='Yola',
author_email='engineers@yola.com',
license='MIT (Expat)',
url='https://github.com/yola/property-caching',
packages=['property_caching'],
test_suite='tests'
)
<commit_msg>Add classifiers for python 2 and 3 support<commit_after>
|
from setuptools import setup
setup(
name='property-caching',
version='1.0.1',
description='Property caching',
author='Yola',
author_email='engineers@yola.com',
license='MIT (Expat)',
url='https://github.com/yola/property-caching',
packages=['property_caching'],
test_suite='tests',
classifiers=[
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: MIT License',
]
)
|
from setuptools import setup
setup(
name='property-caching',
version='1.0.1',
description='Property caching',
author='Yola',
author_email='engineers@yola.com',
license='MIT (Expat)',
url='https://github.com/yola/property-caching',
packages=['property_caching'],
test_suite='tests'
)
Add classifiers for python 2 and 3 supportfrom setuptools import setup
setup(
name='property-caching',
version='1.0.1',
description='Property caching',
author='Yola',
author_email='engineers@yola.com',
license='MIT (Expat)',
url='https://github.com/yola/property-caching',
packages=['property_caching'],
test_suite='tests',
classifiers=[
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: MIT License',
]
)
|
<commit_before>from setuptools import setup
setup(
name='property-caching',
version='1.0.1',
description='Property caching',
author='Yola',
author_email='engineers@yola.com',
license='MIT (Expat)',
url='https://github.com/yola/property-caching',
packages=['property_caching'],
test_suite='tests'
)
<commit_msg>Add classifiers for python 2 and 3 support<commit_after>from setuptools import setup
setup(
name='property-caching',
version='1.0.1',
description='Property caching',
author='Yola',
author_email='engineers@yola.com',
license='MIT (Expat)',
url='https://github.com/yola/property-caching',
packages=['property_caching'],
test_suite='tests',
classifiers=[
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: MIT License',
]
)
|
5bb90727efb62525995caad3b52fd588d8b08298
|
pregnancy/urls.py
|
pregnancy/urls.py
|
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
import contractions.views
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'pregnancy.views.home', name='home'),
# url(r'^pregnancy/', include('pregnancy.foo.urls')),
url(r'^contractions/$', contractions.views.ContractionList.as_view(), name='ContractionList'),
url(r'^update_intensity/(?P<pk>\d+)/$', contractions.views.UpdateIntensity.as_view(), name='UpdateIntensity'),
url(r'^update_intensity2/(?P<pk>\d+)/$', contractions.views.UpdateIntensity2.as_view(), name='UpdateIntensity2'),
url(r'^ContractionListTable/$', contractions.views.ContractionListTable.as_view(), name='ContractionListTable'),
url(r'^StartContraction/$', contractions.views.StartContraction.as_view(), name='StartContraction'),
url(r'^StopContraction/(?P<pk>\d+)/$', contractions.views.StopContraction.as_view(), name='StopContraction'),
# Uncomment the admin/doc line below to enable admin documentation:
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
url(r'^admin/', include(admin.site.urls)),
)
|
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
import contractions.views
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'pregnancy.views.home', name='home'),
# url(r'^pregnancy/', include('pregnancy.foo.urls')),
url(r'^$', contractions.views.ContractionList.as_view(), name='ContractionList'),
url(r'^contractions/$', contractions.views.ContractionList.as_view(), name='ContractionList'),
url(r'^update_intensity/(?P<pk>\d+)/$', contractions.views.UpdateIntensity.as_view(), name='UpdateIntensity'),
url(r'^update_intensity2/(?P<pk>\d+)/$', contractions.views.UpdateIntensity2.as_view(), name='UpdateIntensity2'),
url(r'^ContractionListTable/$', contractions.views.ContractionListTable.as_view(), name='ContractionListTable'),
url(r'^StartContraction/$', contractions.views.StartContraction.as_view(), name='StartContraction'),
url(r'^StopContraction/(?P<pk>\d+)/$', contractions.views.StopContraction.as_view(), name='StopContraction'),
# Uncomment the admin/doc line below to enable admin documentation:
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
url(r'^admin/', include(admin.site.urls)),
)
|
Update url to point / to the contractions app
|
Update url to point / to the contractions app
|
Python
|
bsd-2-clause
|
dreinhold/pregnancy,dreinhold/pregnancy,dreinhold/pregnancy
|
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
import contractions.views
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'pregnancy.views.home', name='home'),
# url(r'^pregnancy/', include('pregnancy.foo.urls')),
url(r'^contractions/$', contractions.views.ContractionList.as_view(), name='ContractionList'),
url(r'^update_intensity/(?P<pk>\d+)/$', contractions.views.UpdateIntensity.as_view(), name='UpdateIntensity'),
url(r'^update_intensity2/(?P<pk>\d+)/$', contractions.views.UpdateIntensity2.as_view(), name='UpdateIntensity2'),
url(r'^ContractionListTable/$', contractions.views.ContractionListTable.as_view(), name='ContractionListTable'),
url(r'^StartContraction/$', contractions.views.StartContraction.as_view(), name='StartContraction'),
url(r'^StopContraction/(?P<pk>\d+)/$', contractions.views.StopContraction.as_view(), name='StopContraction'),
# Uncomment the admin/doc line below to enable admin documentation:
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
url(r'^admin/', include(admin.site.urls)),
)
Update url to point / to the contractions app
|
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
import contractions.views
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'pregnancy.views.home', name='home'),
# url(r'^pregnancy/', include('pregnancy.foo.urls')),
url(r'^$', contractions.views.ContractionList.as_view(), name='ContractionList'),
url(r'^contractions/$', contractions.views.ContractionList.as_view(), name='ContractionList'),
url(r'^update_intensity/(?P<pk>\d+)/$', contractions.views.UpdateIntensity.as_view(), name='UpdateIntensity'),
url(r'^update_intensity2/(?P<pk>\d+)/$', contractions.views.UpdateIntensity2.as_view(), name='UpdateIntensity2'),
url(r'^ContractionListTable/$', contractions.views.ContractionListTable.as_view(), name='ContractionListTable'),
url(r'^StartContraction/$', contractions.views.StartContraction.as_view(), name='StartContraction'),
url(r'^StopContraction/(?P<pk>\d+)/$', contractions.views.StopContraction.as_view(), name='StopContraction'),
# Uncomment the admin/doc line below to enable admin documentation:
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
url(r'^admin/', include(admin.site.urls)),
)
|
<commit_before>from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
import contractions.views
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'pregnancy.views.home', name='home'),
# url(r'^pregnancy/', include('pregnancy.foo.urls')),
url(r'^contractions/$', contractions.views.ContractionList.as_view(), name='ContractionList'),
url(r'^update_intensity/(?P<pk>\d+)/$', contractions.views.UpdateIntensity.as_view(), name='UpdateIntensity'),
url(r'^update_intensity2/(?P<pk>\d+)/$', contractions.views.UpdateIntensity2.as_view(), name='UpdateIntensity2'),
url(r'^ContractionListTable/$', contractions.views.ContractionListTable.as_view(), name='ContractionListTable'),
url(r'^StartContraction/$', contractions.views.StartContraction.as_view(), name='StartContraction'),
url(r'^StopContraction/(?P<pk>\d+)/$', contractions.views.StopContraction.as_view(), name='StopContraction'),
# Uncomment the admin/doc line below to enable admin documentation:
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
url(r'^admin/', include(admin.site.urls)),
)
<commit_msg>Update url to point / to the contractions app<commit_after>
|
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
import contractions.views
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'pregnancy.views.home', name='home'),
# url(r'^pregnancy/', include('pregnancy.foo.urls')),
url(r'^$', contractions.views.ContractionList.as_view(), name='ContractionList'),
url(r'^contractions/$', contractions.views.ContractionList.as_view(), name='ContractionList'),
url(r'^update_intensity/(?P<pk>\d+)/$', contractions.views.UpdateIntensity.as_view(), name='UpdateIntensity'),
url(r'^update_intensity2/(?P<pk>\d+)/$', contractions.views.UpdateIntensity2.as_view(), name='UpdateIntensity2'),
url(r'^ContractionListTable/$', contractions.views.ContractionListTable.as_view(), name='ContractionListTable'),
url(r'^StartContraction/$', contractions.views.StartContraction.as_view(), name='StartContraction'),
url(r'^StopContraction/(?P<pk>\d+)/$', contractions.views.StopContraction.as_view(), name='StopContraction'),
# Uncomment the admin/doc line below to enable admin documentation:
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
url(r'^admin/', include(admin.site.urls)),
)
|
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
import contractions.views
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'pregnancy.views.home', name='home'),
# url(r'^pregnancy/', include('pregnancy.foo.urls')),
url(r'^contractions/$', contractions.views.ContractionList.as_view(), name='ContractionList'),
url(r'^update_intensity/(?P<pk>\d+)/$', contractions.views.UpdateIntensity.as_view(), name='UpdateIntensity'),
url(r'^update_intensity2/(?P<pk>\d+)/$', contractions.views.UpdateIntensity2.as_view(), name='UpdateIntensity2'),
url(r'^ContractionListTable/$', contractions.views.ContractionListTable.as_view(), name='ContractionListTable'),
url(r'^StartContraction/$', contractions.views.StartContraction.as_view(), name='StartContraction'),
url(r'^StopContraction/(?P<pk>\d+)/$', contractions.views.StopContraction.as_view(), name='StopContraction'),
# Uncomment the admin/doc line below to enable admin documentation:
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
url(r'^admin/', include(admin.site.urls)),
)
Update url to point / to the contractions appfrom django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
import contractions.views
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'pregnancy.views.home', name='home'),
# url(r'^pregnancy/', include('pregnancy.foo.urls')),
url(r'^$', contractions.views.ContractionList.as_view(), name='ContractionList'),
url(r'^contractions/$', contractions.views.ContractionList.as_view(), name='ContractionList'),
url(r'^update_intensity/(?P<pk>\d+)/$', contractions.views.UpdateIntensity.as_view(), name='UpdateIntensity'),
url(r'^update_intensity2/(?P<pk>\d+)/$', contractions.views.UpdateIntensity2.as_view(), name='UpdateIntensity2'),
url(r'^ContractionListTable/$', contractions.views.ContractionListTable.as_view(), name='ContractionListTable'),
url(r'^StartContraction/$', contractions.views.StartContraction.as_view(), name='StartContraction'),
url(r'^StopContraction/(?P<pk>\d+)/$', contractions.views.StopContraction.as_view(), name='StopContraction'),
# Uncomment the admin/doc line below to enable admin documentation:
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
url(r'^admin/', include(admin.site.urls)),
)
|
<commit_before>from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
import contractions.views
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'pregnancy.views.home', name='home'),
# url(r'^pregnancy/', include('pregnancy.foo.urls')),
url(r'^contractions/$', contractions.views.ContractionList.as_view(), name='ContractionList'),
url(r'^update_intensity/(?P<pk>\d+)/$', contractions.views.UpdateIntensity.as_view(), name='UpdateIntensity'),
url(r'^update_intensity2/(?P<pk>\d+)/$', contractions.views.UpdateIntensity2.as_view(), name='UpdateIntensity2'),
url(r'^ContractionListTable/$', contractions.views.ContractionListTable.as_view(), name='ContractionListTable'),
url(r'^StartContraction/$', contractions.views.StartContraction.as_view(), name='StartContraction'),
url(r'^StopContraction/(?P<pk>\d+)/$', contractions.views.StopContraction.as_view(), name='StopContraction'),
# Uncomment the admin/doc line below to enable admin documentation:
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
url(r'^admin/', include(admin.site.urls)),
)
<commit_msg>Update url to point / to the contractions app<commit_after>from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
import contractions.views
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'pregnancy.views.home', name='home'),
# url(r'^pregnancy/', include('pregnancy.foo.urls')),
url(r'^$', contractions.views.ContractionList.as_view(), name='ContractionList'),
url(r'^contractions/$', contractions.views.ContractionList.as_view(), name='ContractionList'),
url(r'^update_intensity/(?P<pk>\d+)/$', contractions.views.UpdateIntensity.as_view(), name='UpdateIntensity'),
url(r'^update_intensity2/(?P<pk>\d+)/$', contractions.views.UpdateIntensity2.as_view(), name='UpdateIntensity2'),
url(r'^ContractionListTable/$', contractions.views.ContractionListTable.as_view(), name='ContractionListTable'),
url(r'^StartContraction/$', contractions.views.StartContraction.as_view(), name='StartContraction'),
url(r'^StopContraction/(?P<pk>\d+)/$', contractions.views.StopContraction.as_view(), name='StopContraction'),
# Uncomment the admin/doc line below to enable admin documentation:
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
url(r'^admin/', include(admin.site.urls)),
)
|
9fa76b8e9d7fb9309a49d46b9bbd43e9b65418ad
|
pytest_cookies.py
|
pytest_cookies.py
|
# -*- coding: utf-8 -*-
import pytest
def pytest_addoption(parser):
group = parser.getgroup('cookies')
group.addoption(
'--foo',
action='store',
dest='dest_foo',
default=2015,
help='Set the value for the fixture "bar".'
)
parser.addini('HELLO', 'Dummy pytest.ini setting')
@pytest.fixture
def bar(request):
return request.config.option.dest_foo
|
# -*- coding: utf-8 -*-
import pytest
from cookiecutter.main import cookiecutter
class Cookies(object):
"""Class to provide convenient access to the cookiecutter API."""
error = None
project = None
def __init__(self, template, output_dir):
self._template = template
self._output_dir = output_dir
def bake(self, extra_context=None):
try:
project_dir = cookiecutter(
self._template,
no_input=True,
extra_context=extra_context,
output_dir=self._output_dir
)
except Exception as e:
self.error = e
else:
self.project = project_dir
@pytest.fixture
def cookies(request, tmpdir):
output_dir = request.config.option.output_dir
if not output_dir:
output_dir = str(tmpdir.mkdir('cookies_output'))
_cookies = Cookies('.', output_dir)
return _cookies
def pytest_addoption(parser):
group = parser.getgroup('cookies')
group.addoption(
'--output-dir',
action='store',
dest='output_dir',
help='Set the output directory for Cookiecutter'
)
parser.addini('HELLO', 'Dummy pytest.ini setting')
|
Implement cookies fixture along with Helper class
|
Implement cookies fixture along with Helper class
|
Python
|
mit
|
hackebrot/pytest-cookies
|
# -*- coding: utf-8 -*-
import pytest
def pytest_addoption(parser):
group = parser.getgroup('cookies')
group.addoption(
'--foo',
action='store',
dest='dest_foo',
default=2015,
help='Set the value for the fixture "bar".'
)
parser.addini('HELLO', 'Dummy pytest.ini setting')
@pytest.fixture
def bar(request):
return request.config.option.dest_foo
Implement cookies fixture along with Helper class
|
# -*- coding: utf-8 -*-
import pytest
from cookiecutter.main import cookiecutter
class Cookies(object):
"""Class to provide convenient access to the cookiecutter API."""
error = None
project = None
def __init__(self, template, output_dir):
self._template = template
self._output_dir = output_dir
def bake(self, extra_context=None):
try:
project_dir = cookiecutter(
self._template,
no_input=True,
extra_context=extra_context,
output_dir=self._output_dir
)
except Exception as e:
self.error = e
else:
self.project = project_dir
@pytest.fixture
def cookies(request, tmpdir):
output_dir = request.config.option.output_dir
if not output_dir:
output_dir = str(tmpdir.mkdir('cookies_output'))
_cookies = Cookies('.', output_dir)
return _cookies
def pytest_addoption(parser):
group = parser.getgroup('cookies')
group.addoption(
'--output-dir',
action='store',
dest='output_dir',
help='Set the output directory for Cookiecutter'
)
parser.addini('HELLO', 'Dummy pytest.ini setting')
|
<commit_before># -*- coding: utf-8 -*-
import pytest
def pytest_addoption(parser):
group = parser.getgroup('cookies')
group.addoption(
'--foo',
action='store',
dest='dest_foo',
default=2015,
help='Set the value for the fixture "bar".'
)
parser.addini('HELLO', 'Dummy pytest.ini setting')
@pytest.fixture
def bar(request):
return request.config.option.dest_foo
<commit_msg>Implement cookies fixture along with Helper class<commit_after>
|
# -*- coding: utf-8 -*-
import pytest
from cookiecutter.main import cookiecutter
class Cookies(object):
"""Class to provide convenient access to the cookiecutter API."""
error = None
project = None
def __init__(self, template, output_dir):
self._template = template
self._output_dir = output_dir
def bake(self, extra_context=None):
try:
project_dir = cookiecutter(
self._template,
no_input=True,
extra_context=extra_context,
output_dir=self._output_dir
)
except Exception as e:
self.error = e
else:
self.project = project_dir
@pytest.fixture
def cookies(request, tmpdir):
output_dir = request.config.option.output_dir
if not output_dir:
output_dir = str(tmpdir.mkdir('cookies_output'))
_cookies = Cookies('.', output_dir)
return _cookies
def pytest_addoption(parser):
group = parser.getgroup('cookies')
group.addoption(
'--output-dir',
action='store',
dest='output_dir',
help='Set the output directory for Cookiecutter'
)
parser.addini('HELLO', 'Dummy pytest.ini setting')
|
# -*- coding: utf-8 -*-
import pytest
def pytest_addoption(parser):
group = parser.getgroup('cookies')
group.addoption(
'--foo',
action='store',
dest='dest_foo',
default=2015,
help='Set the value for the fixture "bar".'
)
parser.addini('HELLO', 'Dummy pytest.ini setting')
@pytest.fixture
def bar(request):
return request.config.option.dest_foo
Implement cookies fixture along with Helper class# -*- coding: utf-8 -*-
import pytest
from cookiecutter.main import cookiecutter
class Cookies(object):
"""Class to provide convenient access to the cookiecutter API."""
error = None
project = None
def __init__(self, template, output_dir):
self._template = template
self._output_dir = output_dir
def bake(self, extra_context=None):
try:
project_dir = cookiecutter(
self._template,
no_input=True,
extra_context=extra_context,
output_dir=self._output_dir
)
except Exception as e:
self.error = e
else:
self.project = project_dir
@pytest.fixture
def cookies(request, tmpdir):
output_dir = request.config.option.output_dir
if not output_dir:
output_dir = str(tmpdir.mkdir('cookies_output'))
_cookies = Cookies('.', output_dir)
return _cookies
def pytest_addoption(parser):
group = parser.getgroup('cookies')
group.addoption(
'--output-dir',
action='store',
dest='output_dir',
help='Set the output directory for Cookiecutter'
)
parser.addini('HELLO', 'Dummy pytest.ini setting')
|
<commit_before># -*- coding: utf-8 -*-
import pytest
def pytest_addoption(parser):
group = parser.getgroup('cookies')
group.addoption(
'--foo',
action='store',
dest='dest_foo',
default=2015,
help='Set the value for the fixture "bar".'
)
parser.addini('HELLO', 'Dummy pytest.ini setting')
@pytest.fixture
def bar(request):
return request.config.option.dest_foo
<commit_msg>Implement cookies fixture along with Helper class<commit_after># -*- coding: utf-8 -*-
import pytest
from cookiecutter.main import cookiecutter
class Cookies(object):
"""Class to provide convenient access to the cookiecutter API."""
error = None
project = None
def __init__(self, template, output_dir):
self._template = template
self._output_dir = output_dir
def bake(self, extra_context=None):
try:
project_dir = cookiecutter(
self._template,
no_input=True,
extra_context=extra_context,
output_dir=self._output_dir
)
except Exception as e:
self.error = e
else:
self.project = project_dir
@pytest.fixture
def cookies(request, tmpdir):
output_dir = request.config.option.output_dir
if not output_dir:
output_dir = str(tmpdir.mkdir('cookies_output'))
_cookies = Cookies('.', output_dir)
return _cookies
def pytest_addoption(parser):
group = parser.getgroup('cookies')
group.addoption(
'--output-dir',
action='store',
dest='output_dir',
help='Set the output directory for Cookiecutter'
)
parser.addini('HELLO', 'Dummy pytest.ini setting')
|
eec004dd34ffc977e29481c94345e20cae867238
|
views.py
|
views.py
|
from django.conf import settings
from django.http import HttpResponse
from django.utils.importlib import import_module
def warmup(request):
"""
Provides default procedure for handling warmup requests on App Engine.
Just add this view to your main urls.py.
"""
for app in settings.INSTALLED_APPS:
for name in ('urls', 'views'):
try:
import_module('%s.%s' % (app, name))
except ImportError:
pass
content_type = 'text/plain; charset=%s' % settings.DEFAULT_CHARSET
return HttpResponse('Warmup done', content_type=content_type)
|
from django.conf import settings
from django.http import HttpResponse
from django.utils.importlib import import_module
def warmup(request):
"""
Provides default procedure for handling warmup requests on App Engine.
Just add this view to your main urls.py.
"""
for app in settings.INSTALLED_APPS:
for name in ('urls', 'views', 'models'):
try:
import_module('%s.%s' % (app, name))
except ImportError:
pass
content_type = 'text/plain; charset=%s' % settings.DEFAULT_CHARSET
return HttpResponse('Warmup done', content_type=content_type)
|
Expand pre loading on warmup
|
Expand pre loading on warmup
|
Python
|
bsd-3-clause
|
adieu/djangoappengine
|
from django.conf import settings
from django.http import HttpResponse
from django.utils.importlib import import_module
def warmup(request):
"""
Provides default procedure for handling warmup requests on App Engine.
Just add this view to your main urls.py.
"""
for app in settings.INSTALLED_APPS:
for name in ('urls', 'views'):
try:
import_module('%s.%s' % (app, name))
except ImportError:
pass
content_type = 'text/plain; charset=%s' % settings.DEFAULT_CHARSET
return HttpResponse('Warmup done', content_type=content_type)
Expand pre loading on warmup
|
from django.conf import settings
from django.http import HttpResponse
from django.utils.importlib import import_module
def warmup(request):
"""
Provides default procedure for handling warmup requests on App Engine.
Just add this view to your main urls.py.
"""
for app in settings.INSTALLED_APPS:
for name in ('urls', 'views', 'models'):
try:
import_module('%s.%s' % (app, name))
except ImportError:
pass
content_type = 'text/plain; charset=%s' % settings.DEFAULT_CHARSET
return HttpResponse('Warmup done', content_type=content_type)
|
<commit_before>from django.conf import settings
from django.http import HttpResponse
from django.utils.importlib import import_module
def warmup(request):
"""
Provides default procedure for handling warmup requests on App Engine.
Just add this view to your main urls.py.
"""
for app in settings.INSTALLED_APPS:
for name in ('urls', 'views'):
try:
import_module('%s.%s' % (app, name))
except ImportError:
pass
content_type = 'text/plain; charset=%s' % settings.DEFAULT_CHARSET
return HttpResponse('Warmup done', content_type=content_type)
<commit_msg>Expand pre loading on warmup<commit_after>
|
from django.conf import settings
from django.http import HttpResponse
from django.utils.importlib import import_module
def warmup(request):
"""
Provides default procedure for handling warmup requests on App Engine.
Just add this view to your main urls.py.
"""
for app in settings.INSTALLED_APPS:
for name in ('urls', 'views', 'models'):
try:
import_module('%s.%s' % (app, name))
except ImportError:
pass
content_type = 'text/plain; charset=%s' % settings.DEFAULT_CHARSET
return HttpResponse('Warmup done', content_type=content_type)
|
from django.conf import settings
from django.http import HttpResponse
from django.utils.importlib import import_module
def warmup(request):
"""
Provides default procedure for handling warmup requests on App Engine.
Just add this view to your main urls.py.
"""
for app in settings.INSTALLED_APPS:
for name in ('urls', 'views'):
try:
import_module('%s.%s' % (app, name))
except ImportError:
pass
content_type = 'text/plain; charset=%s' % settings.DEFAULT_CHARSET
return HttpResponse('Warmup done', content_type=content_type)
Expand pre loading on warmupfrom django.conf import settings
from django.http import HttpResponse
from django.utils.importlib import import_module
def warmup(request):
"""
Provides default procedure for handling warmup requests on App Engine.
Just add this view to your main urls.py.
"""
for app in settings.INSTALLED_APPS:
for name in ('urls', 'views', 'models'):
try:
import_module('%s.%s' % (app, name))
except ImportError:
pass
content_type = 'text/plain; charset=%s' % settings.DEFAULT_CHARSET
return HttpResponse('Warmup done', content_type=content_type)
|
<commit_before>from django.conf import settings
from django.http import HttpResponse
from django.utils.importlib import import_module
def warmup(request):
"""
Provides default procedure for handling warmup requests on App Engine.
Just add this view to your main urls.py.
"""
for app in settings.INSTALLED_APPS:
for name in ('urls', 'views'):
try:
import_module('%s.%s' % (app, name))
except ImportError:
pass
content_type = 'text/plain; charset=%s' % settings.DEFAULT_CHARSET
return HttpResponse('Warmup done', content_type=content_type)
<commit_msg>Expand pre loading on warmup<commit_after>from django.conf import settings
from django.http import HttpResponse
from django.utils.importlib import import_module
def warmup(request):
"""
Provides default procedure for handling warmup requests on App Engine.
Just add this view to your main urls.py.
"""
for app in settings.INSTALLED_APPS:
for name in ('urls', 'views', 'models'):
try:
import_module('%s.%s' % (app, name))
except ImportError:
pass
content_type = 'text/plain; charset=%s' % settings.DEFAULT_CHARSET
return HttpResponse('Warmup done', content_type=content_type)
|
ba1bfc262e023a01d6e201d48d234640a443ed96
|
raven/__init__.py
|
raven/__init__.py
|
"""
raven
~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
__all__ = ('VERSION', 'Client', 'load')
try:
VERSION = __import__('pkg_resources') \
.get_distribution('raven').version
except Exception, e:
VERSION = 'unknown'
from base import *
from conf import *
|
"""
raven
~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
__all__ = ('VERSION', 'Client', 'load')
try:
VERSION = __import__('pkg_resources') \
.get_distribution('raven').version
except Exception, e:
VERSION = 'unknown'
from raven.base import *
from raven.conf import *
|
Use absolute imports, not relative ones.
|
Use absolute imports, not relative ones.
|
Python
|
bsd-3-clause
|
hzy/raven-python,akheron/raven-python,akalipetis/raven-python,nikolas/raven-python,arthurlogilab/raven-python,inspirehep/raven-python,recht/raven-python,akheron/raven-python,arthurlogilab/raven-python,arthurlogilab/raven-python,lepture/raven-python,percipient/raven-python,collective/mr.poe,Goldmund-Wyldebeast-Wunderliebe/raven-python,someonehan/raven-python,recht/raven-python,inspirehep/raven-python,jbarbuto/raven-python,johansteffner/raven-python,recht/raven-python,icereval/raven-python,lepture/raven-python,smarkets/raven-python,hzy/raven-python,arthurlogilab/raven-python,jmp0xf/raven-python,ronaldevers/raven-python,inspirehep/raven-python,ewdurbin/raven-python,jbarbuto/raven-python,nikolas/raven-python,jmagnusson/raven-python,akheron/raven-python,nikolas/raven-python,Photonomie/raven-python,dbravender/raven-python,akalipetis/raven-python,getsentry/raven-python,Goldmund-Wyldebeast-Wunderliebe/raven-python,smarkets/raven-python,ronaldevers/raven-python,danriti/raven-python,Goldmund-Wyldebeast-Wunderliebe/raven-python,percipient/raven-python,jmagnusson/raven-python,someonehan/raven-python,jmp0xf/raven-python,lepture/raven-python,danriti/raven-python,smarkets/raven-python,smarkets/raven-python,danriti/raven-python,someonehan/raven-python,getsentry/raven-python,jmp0xf/raven-python,hzy/raven-python,icereval/raven-python,getsentry/raven-python,nikolas/raven-python,percipient/raven-python,inspirehep/raven-python,jbarbuto/raven-python,jmagnusson/raven-python,akalipetis/raven-python,dbravender/raven-python,Photonomie/raven-python,dbravender/raven-python,ewdurbin/raven-python,ronaldevers/raven-python,Goldmund-Wyldebeast-Wunderliebe/raven-python,jbarbuto/raven-python,johansteffner/raven-python,johansteffner/raven-python,icereval/raven-python,Photonomie/raven-python,icereval/raven-python,ewdurbin/raven-python
|
"""
raven
~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
__all__ = ('VERSION', 'Client', 'load')
try:
VERSION = __import__('pkg_resources') \
.get_distribution('raven').version
except Exception, e:
VERSION = 'unknown'
from base import *
from conf import *
Use absolute imports, not relative ones.
|
"""
raven
~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
__all__ = ('VERSION', 'Client', 'load')
try:
VERSION = __import__('pkg_resources') \
.get_distribution('raven').version
except Exception, e:
VERSION = 'unknown'
from raven.base import *
from raven.conf import *
|
<commit_before>"""
raven
~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
__all__ = ('VERSION', 'Client', 'load')
try:
VERSION = __import__('pkg_resources') \
.get_distribution('raven').version
except Exception, e:
VERSION = 'unknown'
from base import *
from conf import *
<commit_msg>Use absolute imports, not relative ones.<commit_after>
|
"""
raven
~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
__all__ = ('VERSION', 'Client', 'load')
try:
VERSION = __import__('pkg_resources') \
.get_distribution('raven').version
except Exception, e:
VERSION = 'unknown'
from raven.base import *
from raven.conf import *
|
"""
raven
~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
__all__ = ('VERSION', 'Client', 'load')
try:
VERSION = __import__('pkg_resources') \
.get_distribution('raven').version
except Exception, e:
VERSION = 'unknown'
from base import *
from conf import *
Use absolute imports, not relative ones."""
raven
~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
__all__ = ('VERSION', 'Client', 'load')
try:
VERSION = __import__('pkg_resources') \
.get_distribution('raven').version
except Exception, e:
VERSION = 'unknown'
from raven.base import *
from raven.conf import *
|
<commit_before>"""
raven
~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
__all__ = ('VERSION', 'Client', 'load')
try:
VERSION = __import__('pkg_resources') \
.get_distribution('raven').version
except Exception, e:
VERSION = 'unknown'
from base import *
from conf import *
<commit_msg>Use absolute imports, not relative ones.<commit_after>"""
raven
~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
__all__ = ('VERSION', 'Client', 'load')
try:
VERSION = __import__('pkg_resources') \
.get_distribution('raven').version
except Exception, e:
VERSION = 'unknown'
from raven.base import *
from raven.conf import *
|
a3b22d074ace7d44ee9c863c56f0c24354bc6a99
|
snake/launcher.py
|
snake/launcher.py
|
from .game_manager import GameManager
from .robot_controller import RobotController
from .snake_board import SnakeBoard
from .snake_robot import SnakeRobot
from .snake_beacon import SnakeBeacon
def launch_robot(robot_module, myrobot, board_size=(8,16)):
'''
Creates a robot controller, a board, and sets things up
'''
game_manager = GameManager()
# create the robot controller
controller = RobotController(robot_module, myrobot)
# add it to the manager
game_manager.add_robot(controller)
# create the robot
snake_robot = SnakeRobot(controller)
snake_beacon = SnakeBeacon(controller, snake_robot)
# start the robot controller (does not block)
controller.run()
# create the board
snake_board = SnakeBoard(game_manager, board_size)
snake_board.add_game_element(snake_robot)
snake_board.add_game_element(snake_beacon)
# launch the board last (blocks until game is over)
snake_board.run()
# once it has finished, try to shut the robot down
# -> if it can't, then the user messed up
if not controller.stop():
print('Error: could not stop the robot code! Check your code')
|
from .game_manager import GameManager
from .robot_controller import RobotController
from .snake_board import SnakeBoard
from .snake_robot import SnakeRobot
from .snake_beacon import SnakeBeacon
def launch_robot(robot_module, myrobot, board_size=(8,16)):
'''
Creates a robot controller, a board, and sets things up
'''
game_manager = GameManager()
# create the robot controller
controller = RobotController(robot_module, myrobot)
# add it to the manager
game_manager.add_robot(controller)
# create the robot
snake_robot = SnakeRobot(controller)
#snake_beacon = SnakeBeacon(controller, snake_robot)
# start the robot controller (does not block)
controller.run()
# create the board
snake_board = SnakeBoard(game_manager, board_size)
snake_board.add_game_element(snake_robot)
#snake_board.add_game_element(snake_beacon)
# launch the board last (blocks until game is over)
snake_board.run()
# once it has finished, try to shut the robot down
# -> if it can't, then the user messed up
if not controller.stop():
print('Error: could not stop the robot code! Check your code')
|
Remove the beacon for now
|
Remove the beacon for now
|
Python
|
mit
|
virtuald/RobotSnake,virtuald/RobotSnake
|
from .game_manager import GameManager
from .robot_controller import RobotController
from .snake_board import SnakeBoard
from .snake_robot import SnakeRobot
from .snake_beacon import SnakeBeacon
def launch_robot(robot_module, myrobot, board_size=(8,16)):
'''
Creates a robot controller, a board, and sets things up
'''
game_manager = GameManager()
# create the robot controller
controller = RobotController(robot_module, myrobot)
# add it to the manager
game_manager.add_robot(controller)
# create the robot
snake_robot = SnakeRobot(controller)
snake_beacon = SnakeBeacon(controller, snake_robot)
# start the robot controller (does not block)
controller.run()
# create the board
snake_board = SnakeBoard(game_manager, board_size)
snake_board.add_game_element(snake_robot)
snake_board.add_game_element(snake_beacon)
# launch the board last (blocks until game is over)
snake_board.run()
# once it has finished, try to shut the robot down
# -> if it can't, then the user messed up
if not controller.stop():
print('Error: could not stop the robot code! Check your code')Remove the beacon for now
|
from .game_manager import GameManager
from .robot_controller import RobotController
from .snake_board import SnakeBoard
from .snake_robot import SnakeRobot
from .snake_beacon import SnakeBeacon
def launch_robot(robot_module, myrobot, board_size=(8,16)):
'''
Creates a robot controller, a board, and sets things up
'''
game_manager = GameManager()
# create the robot controller
controller = RobotController(robot_module, myrobot)
# add it to the manager
game_manager.add_robot(controller)
# create the robot
snake_robot = SnakeRobot(controller)
#snake_beacon = SnakeBeacon(controller, snake_robot)
# start the robot controller (does not block)
controller.run()
# create the board
snake_board = SnakeBoard(game_manager, board_size)
snake_board.add_game_element(snake_robot)
#snake_board.add_game_element(snake_beacon)
# launch the board last (blocks until game is over)
snake_board.run()
# once it has finished, try to shut the robot down
# -> if it can't, then the user messed up
if not controller.stop():
print('Error: could not stop the robot code! Check your code')
|
<commit_before>
from .game_manager import GameManager
from .robot_controller import RobotController
from .snake_board import SnakeBoard
from .snake_robot import SnakeRobot
from .snake_beacon import SnakeBeacon
def launch_robot(robot_module, myrobot, board_size=(8,16)):
'''
Creates a robot controller, a board, and sets things up
'''
game_manager = GameManager()
# create the robot controller
controller = RobotController(robot_module, myrobot)
# add it to the manager
game_manager.add_robot(controller)
# create the robot
snake_robot = SnakeRobot(controller)
snake_beacon = SnakeBeacon(controller, snake_robot)
# start the robot controller (does not block)
controller.run()
# create the board
snake_board = SnakeBoard(game_manager, board_size)
snake_board.add_game_element(snake_robot)
snake_board.add_game_element(snake_beacon)
# launch the board last (blocks until game is over)
snake_board.run()
# once it has finished, try to shut the robot down
# -> if it can't, then the user messed up
if not controller.stop():
print('Error: could not stop the robot code! Check your code')<commit_msg>Remove the beacon for now<commit_after>
|
from .game_manager import GameManager
from .robot_controller import RobotController
from .snake_board import SnakeBoard
from .snake_robot import SnakeRobot
from .snake_beacon import SnakeBeacon
def launch_robot(robot_module, myrobot, board_size=(8,16)):
'''
Creates a robot controller, a board, and sets things up
'''
game_manager = GameManager()
# create the robot controller
controller = RobotController(robot_module, myrobot)
# add it to the manager
game_manager.add_robot(controller)
# create the robot
snake_robot = SnakeRobot(controller)
#snake_beacon = SnakeBeacon(controller, snake_robot)
# start the robot controller (does not block)
controller.run()
# create the board
snake_board = SnakeBoard(game_manager, board_size)
snake_board.add_game_element(snake_robot)
#snake_board.add_game_element(snake_beacon)
# launch the board last (blocks until game is over)
snake_board.run()
# once it has finished, try to shut the robot down
# -> if it can't, then the user messed up
if not controller.stop():
print('Error: could not stop the robot code! Check your code')
|
from .game_manager import GameManager
from .robot_controller import RobotController
from .snake_board import SnakeBoard
from .snake_robot import SnakeRobot
from .snake_beacon import SnakeBeacon
def launch_robot(robot_module, myrobot, board_size=(8,16)):
'''
Creates a robot controller, a board, and sets things up
'''
game_manager = GameManager()
# create the robot controller
controller = RobotController(robot_module, myrobot)
# add it to the manager
game_manager.add_robot(controller)
# create the robot
snake_robot = SnakeRobot(controller)
snake_beacon = SnakeBeacon(controller, snake_robot)
# start the robot controller (does not block)
controller.run()
# create the board
snake_board = SnakeBoard(game_manager, board_size)
snake_board.add_game_element(snake_robot)
snake_board.add_game_element(snake_beacon)
# launch the board last (blocks until game is over)
snake_board.run()
# once it has finished, try to shut the robot down
# -> if it can't, then the user messed up
if not controller.stop():
print('Error: could not stop the robot code! Check your code')Remove the beacon for now
from .game_manager import GameManager
from .robot_controller import RobotController
from .snake_board import SnakeBoard
from .snake_robot import SnakeRobot
from .snake_beacon import SnakeBeacon
def launch_robot(robot_module, myrobot, board_size=(8,16)):
'''
Creates a robot controller, a board, and sets things up
'''
game_manager = GameManager()
# create the robot controller
controller = RobotController(robot_module, myrobot)
# add it to the manager
game_manager.add_robot(controller)
# create the robot
snake_robot = SnakeRobot(controller)
#snake_beacon = SnakeBeacon(controller, snake_robot)
# start the robot controller (does not block)
controller.run()
# create the board
snake_board = SnakeBoard(game_manager, board_size)
snake_board.add_game_element(snake_robot)
#snake_board.add_game_element(snake_beacon)
# launch the board last (blocks until game is over)
snake_board.run()
# once it has finished, try to shut the robot down
# -> if it can't, then the user messed up
if not controller.stop():
print('Error: could not stop the robot code! Check your code')
|
<commit_before>
from .game_manager import GameManager
from .robot_controller import RobotController
from .snake_board import SnakeBoard
from .snake_robot import SnakeRobot
from .snake_beacon import SnakeBeacon
def launch_robot(robot_module, myrobot, board_size=(8,16)):
'''
Creates a robot controller, a board, and sets things up
'''
game_manager = GameManager()
# create the robot controller
controller = RobotController(robot_module, myrobot)
# add it to the manager
game_manager.add_robot(controller)
# create the robot
snake_robot = SnakeRobot(controller)
snake_beacon = SnakeBeacon(controller, snake_robot)
# start the robot controller (does not block)
controller.run()
# create the board
snake_board = SnakeBoard(game_manager, board_size)
snake_board.add_game_element(snake_robot)
snake_board.add_game_element(snake_beacon)
# launch the board last (blocks until game is over)
snake_board.run()
# once it has finished, try to shut the robot down
# -> if it can't, then the user messed up
if not controller.stop():
print('Error: could not stop the robot code! Check your code')<commit_msg>Remove the beacon for now<commit_after>
from .game_manager import GameManager
from .robot_controller import RobotController
from .snake_board import SnakeBoard
from .snake_robot import SnakeRobot
from .snake_beacon import SnakeBeacon
def launch_robot(robot_module, myrobot, board_size=(8,16)):
'''
Creates a robot controller, a board, and sets things up
'''
game_manager = GameManager()
# create the robot controller
controller = RobotController(robot_module, myrobot)
# add it to the manager
game_manager.add_robot(controller)
# create the robot
snake_robot = SnakeRobot(controller)
#snake_beacon = SnakeBeacon(controller, snake_robot)
# start the robot controller (does not block)
controller.run()
# create the board
snake_board = SnakeBoard(game_manager, board_size)
snake_board.add_game_element(snake_robot)
#snake_board.add_game_element(snake_beacon)
# launch the board last (blocks until game is over)
snake_board.run()
# once it has finished, try to shut the robot down
# -> if it can't, then the user messed up
if not controller.stop():
print('Error: could not stop the robot code! Check your code')
|
ee0c852d494a0952d51b7f5ddde77ec2b46deca3
|
lambdas/update_ecs_service_size.py
|
lambdas/update_ecs_service_size.py
|
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Change the size of an ECS service.
This is used to schedule our service applications: by setting the desired
size to 0/greater-than-0, Amazon will do the work of spinning up or scaling
down the tasks.
The script is triggered by notifications to an SNS topic, in which the
message should be a JSON string that includes "cluster", "service" and
"desired_count" as attributes.
"""
import json
import boto3
def change_desired_count(cluster, service, desired_count):
"""
Given an ECS cluster, service name and desired instance count, change
the instance count on AWS.
"""
ecs = boto3.client('ecs')
resp = ecs.update_service(
cluster=cluster,
service=service,
desiredCount=desired_count
)
print('ECS response: %r' % resp)
assert resp['ResponseMetadata']['HTTPStatusCode'] == 200
def main(event, _):
print('Received event: %r' % event)
message = event['Message']
message_data = json.loads(message)
change_desired_count(
cluster=message_data['cluster'],
service=message_data['service'],
desired_count=message_data['desired_count']
)
|
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Change the size of an ECS service.
This is used to schedule our service applications: by setting the desired
size to 0/greater-than-0, Amazon will do the work of spinning up or scaling
down the tasks.
The script is triggered by notifications to an SNS topic, in which the
message should be a JSON string that includes "cluster", "service" and
"desired_count" as attributes.
"""
import json
import boto3
def change_desired_count(cluster, service, desired_count):
"""
Given an ECS cluster, service name and desired instance count, change
the instance count on AWS.
"""
ecs = boto3.client('ecs')
resp = ecs.update_service(
cluster=cluster,
service=service,
desiredCount=desired_count
)
print('ECS response: %r' % resp)
assert resp['ResponseMetadata']['HTTPStatusCode'] == 200
def main(event, _):
print('Received event: %r' % event)
message = event['Records'][0]['Sns']['Message']
message_data = json.loads(message)
change_desired_count(
cluster=message_data['cluster'],
service=message_data['service'],
desired_count=message_data['desired_count']
)
|
Fix the Update ECS Service size Lambda
|
Fix the Update ECS Service size Lambda
|
Python
|
mit
|
wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api
|
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Change the size of an ECS service.
This is used to schedule our service applications: by setting the desired
size to 0/greater-than-0, Amazon will do the work of spinning up or scaling
down the tasks.
The script is triggered by notifications to an SNS topic, in which the
message should be a JSON string that includes "cluster", "service" and
"desired_count" as attributes.
"""
import json
import boto3
def change_desired_count(cluster, service, desired_count):
"""
Given an ECS cluster, service name and desired instance count, change
the instance count on AWS.
"""
ecs = boto3.client('ecs')
resp = ecs.update_service(
cluster=cluster,
service=service,
desiredCount=desired_count
)
print('ECS response: %r' % resp)
assert resp['ResponseMetadata']['HTTPStatusCode'] == 200
def main(event, _):
print('Received event: %r' % event)
message = event['Message']
message_data = json.loads(message)
change_desired_count(
cluster=message_data['cluster'],
service=message_data['service'],
desired_count=message_data['desired_count']
)
Fix the Update ECS Service size Lambda
|
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Change the size of an ECS service.
This is used to schedule our service applications: by setting the desired
size to 0/greater-than-0, Amazon will do the work of spinning up or scaling
down the tasks.
The script is triggered by notifications to an SNS topic, in which the
message should be a JSON string that includes "cluster", "service" and
"desired_count" as attributes.
"""
import json
import boto3
def change_desired_count(cluster, service, desired_count):
"""
Given an ECS cluster, service name and desired instance count, change
the instance count on AWS.
"""
ecs = boto3.client('ecs')
resp = ecs.update_service(
cluster=cluster,
service=service,
desiredCount=desired_count
)
print('ECS response: %r' % resp)
assert resp['ResponseMetadata']['HTTPStatusCode'] == 200
def main(event, _):
print('Received event: %r' % event)
message = event['Records'][0]['Sns']['Message']
message_data = json.loads(message)
change_desired_count(
cluster=message_data['cluster'],
service=message_data['service'],
desired_count=message_data['desired_count']
)
|
<commit_before>#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Change the size of an ECS service.
This is used to schedule our service applications: by setting the desired
size to 0/greater-than-0, Amazon will do the work of spinning up or scaling
down the tasks.
The script is triggered by notifications to an SNS topic, in which the
message should be a JSON string that includes "cluster", "service" and
"desired_count" as attributes.
"""
import json
import boto3
def change_desired_count(cluster, service, desired_count):
"""
Given an ECS cluster, service name and desired instance count, change
the instance count on AWS.
"""
ecs = boto3.client('ecs')
resp = ecs.update_service(
cluster=cluster,
service=service,
desiredCount=desired_count
)
print('ECS response: %r' % resp)
assert resp['ResponseMetadata']['HTTPStatusCode'] == 200
def main(event, _):
print('Received event: %r' % event)
message = event['Message']
message_data = json.loads(message)
change_desired_count(
cluster=message_data['cluster'],
service=message_data['service'],
desired_count=message_data['desired_count']
)
<commit_msg>Fix the Update ECS Service size Lambda<commit_after>
|
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Change the size of an ECS service.
This is used to schedule our service applications: by setting the desired
size to 0/greater-than-0, Amazon will do the work of spinning up or scaling
down the tasks.
The script is triggered by notifications to an SNS topic, in which the
message should be a JSON string that includes "cluster", "service" and
"desired_count" as attributes.
"""
import json
import boto3
def change_desired_count(cluster, service, desired_count):
"""
Given an ECS cluster, service name and desired instance count, change
the instance count on AWS.
"""
ecs = boto3.client('ecs')
resp = ecs.update_service(
cluster=cluster,
service=service,
desiredCount=desired_count
)
print('ECS response: %r' % resp)
assert resp['ResponseMetadata']['HTTPStatusCode'] == 200
def main(event, _):
print('Received event: %r' % event)
message = event['Records'][0]['Sns']['Message']
message_data = json.loads(message)
change_desired_count(
cluster=message_data['cluster'],
service=message_data['service'],
desired_count=message_data['desired_count']
)
|
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Change the size of an ECS service.
This is used to schedule our service applications: by setting the desired
size to 0/greater-than-0, Amazon will do the work of spinning up or scaling
down the tasks.
The script is triggered by notifications to an SNS topic, in which the
message should be a JSON string that includes "cluster", "service" and
"desired_count" as attributes.
"""
import json
import boto3
def change_desired_count(cluster, service, desired_count):
"""
Given an ECS cluster, service name and desired instance count, change
the instance count on AWS.
"""
ecs = boto3.client('ecs')
resp = ecs.update_service(
cluster=cluster,
service=service,
desiredCount=desired_count
)
print('ECS response: %r' % resp)
assert resp['ResponseMetadata']['HTTPStatusCode'] == 200
def main(event, _):
print('Received event: %r' % event)
message = event['Message']
message_data = json.loads(message)
change_desired_count(
cluster=message_data['cluster'],
service=message_data['service'],
desired_count=message_data['desired_count']
)
Fix the Update ECS Service size Lambda#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Change the size of an ECS service.
This is used to schedule our service applications: by setting the desired
size to 0/greater-than-0, Amazon will do the work of spinning up or scaling
down the tasks.
The script is triggered by notifications to an SNS topic, in which the
message should be a JSON string that includes "cluster", "service" and
"desired_count" as attributes.
"""
import json
import boto3
def change_desired_count(cluster, service, desired_count):
"""
Given an ECS cluster, service name and desired instance count, change
the instance count on AWS.
"""
ecs = boto3.client('ecs')
resp = ecs.update_service(
cluster=cluster,
service=service,
desiredCount=desired_count
)
print('ECS response: %r' % resp)
assert resp['ResponseMetadata']['HTTPStatusCode'] == 200
def main(event, _):
print('Received event: %r' % event)
message = event['Records'][0]['Sns']['Message']
message_data = json.loads(message)
change_desired_count(
cluster=message_data['cluster'],
service=message_data['service'],
desired_count=message_data['desired_count']
)
|
<commit_before>#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Change the size of an ECS service.
This is used to schedule our service applications: by setting the desired
size to 0/greater-than-0, Amazon will do the work of spinning up or scaling
down the tasks.
The script is triggered by notifications to an SNS topic, in which the
message should be a JSON string that includes "cluster", "service" and
"desired_count" as attributes.
"""
import json
import boto3
def change_desired_count(cluster, service, desired_count):
"""
Given an ECS cluster, service name and desired instance count, change
the instance count on AWS.
"""
ecs = boto3.client('ecs')
resp = ecs.update_service(
cluster=cluster,
service=service,
desiredCount=desired_count
)
print('ECS response: %r' % resp)
assert resp['ResponseMetadata']['HTTPStatusCode'] == 200
def main(event, _):
print('Received event: %r' % event)
message = event['Message']
message_data = json.loads(message)
change_desired_count(
cluster=message_data['cluster'],
service=message_data['service'],
desired_count=message_data['desired_count']
)
<commit_msg>Fix the Update ECS Service size Lambda<commit_after>#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Change the size of an ECS service.
This is used to schedule our service applications: by setting the desired
size to 0/greater-than-0, Amazon will do the work of spinning up or scaling
down the tasks.
The script is triggered by notifications to an SNS topic, in which the
message should be a JSON string that includes "cluster", "service" and
"desired_count" as attributes.
"""
import json
import boto3
def change_desired_count(cluster, service, desired_count):
"""
Given an ECS cluster, service name and desired instance count, change
the instance count on AWS.
"""
ecs = boto3.client('ecs')
resp = ecs.update_service(
cluster=cluster,
service=service,
desiredCount=desired_count
)
print('ECS response: %r' % resp)
assert resp['ResponseMetadata']['HTTPStatusCode'] == 200
def main(event, _):
print('Received event: %r' % event)
message = event['Records'][0]['Sns']['Message']
message_data = json.loads(message)
change_desired_count(
cluster=message_data['cluster'],
service=message_data['service'],
desired_count=message_data['desired_count']
)
|
dfe84075109620481cac493c1d0dba69d9ca19df
|
vesper/tests/test_case_mixin.py
|
vesper/tests/test_case_mixin.py
|
"""
Unit test test case mixin class.
This mixin class is intended for use with a subclass of either
`unittest.TestCase` or `django.test.TestCase`. It includes several
convenience `_assert...` methods.
"""
import vesper.util.numpy_utils as numpy_utils
class TestCaseMixin:
def assert_raises(self, exception_class, function, *args, **kwargs):
self.assertRaises(exception_class, function, *args, **kwargs)
try:
function(*args, **kwargs)
except exception_class as e:
pass
# print(str(e))
def assert_arrays_equal(self, x, y):
self.assertTrue(numpy_utils.arrays_equal(x, y))
def assert_arrays_close(self, x, y):
self.assertTrue(numpy_utils.arrays_close(x, y))
|
"""
Unit test test case mixin class.
This mixin class is intended for use with a subclass of either
`unittest.TestCase` or `django.test.TestCase`. It includes several
convenience `_assert...` methods.
"""
import vesper.util.numpy_utils as numpy_utils
SHOW_EXCEPTION_MESSAGES = False
class TestCaseMixin:
def assert_raises(self, exception_class, function, *args, **kwargs):
try:
function(*args, **kwargs)
except exception_class as e:
if SHOW_EXCEPTION_MESSAGES:
print(str(e))
else:
raise AssertionError(
f'{exception_class.__name__} not raised by '
f'{function.__name__}')
async def assert_raises_async(
self, exception_class, function, *args, **kwargs):
try:
await function(*args, **kwargs)
except exception_class as e:
if SHOW_EXCEPTION_MESSAGES:
print(str(e))
else:
raise AssertionError(
f'{exception_class.__name__} not raised by '
f'{function.__name__}')
def assert_arrays_equal(self, x, y):
self.assertTrue(numpy_utils.arrays_equal(x, y))
def assert_arrays_close(self, x, y):
self.assertTrue(numpy_utils.arrays_close(x, y))
|
Add method for testing async function errors.
|
Add method for testing async function errors.
|
Python
|
mit
|
HaroldMills/Vesper,HaroldMills/Vesper,HaroldMills/Vesper,HaroldMills/Vesper,HaroldMills/Vesper
|
"""
Unit test test case mixin class.
This mixin class is intended for use with a subclass of either
`unittest.TestCase` or `django.test.TestCase`. It includes several
convenience `_assert...` methods.
"""
import vesper.util.numpy_utils as numpy_utils
class TestCaseMixin:
def assert_raises(self, exception_class, function, *args, **kwargs):
self.assertRaises(exception_class, function, *args, **kwargs)
try:
function(*args, **kwargs)
except exception_class as e:
pass
# print(str(e))
def assert_arrays_equal(self, x, y):
self.assertTrue(numpy_utils.arrays_equal(x, y))
def assert_arrays_close(self, x, y):
self.assertTrue(numpy_utils.arrays_close(x, y))
Add method for testing async function errors.
|
"""
Unit test test case mixin class.
This mixin class is intended for use with a subclass of either
`unittest.TestCase` or `django.test.TestCase`. It includes several
convenience `_assert...` methods.
"""
import vesper.util.numpy_utils as numpy_utils
SHOW_EXCEPTION_MESSAGES = False
class TestCaseMixin:
def assert_raises(self, exception_class, function, *args, **kwargs):
try:
function(*args, **kwargs)
except exception_class as e:
if SHOW_EXCEPTION_MESSAGES:
print(str(e))
else:
raise AssertionError(
f'{exception_class.__name__} not raised by '
f'{function.__name__}')
async def assert_raises_async(
self, exception_class, function, *args, **kwargs):
try:
await function(*args, **kwargs)
except exception_class as e:
if SHOW_EXCEPTION_MESSAGES:
print(str(e))
else:
raise AssertionError(
f'{exception_class.__name__} not raised by '
f'{function.__name__}')
def assert_arrays_equal(self, x, y):
self.assertTrue(numpy_utils.arrays_equal(x, y))
def assert_arrays_close(self, x, y):
self.assertTrue(numpy_utils.arrays_close(x, y))
|
<commit_before>"""
Unit test test case mixin class.
This mixin class is intended for use with a subclass of either
`unittest.TestCase` or `django.test.TestCase`. It includes several
convenience `_assert...` methods.
"""
import vesper.util.numpy_utils as numpy_utils
class TestCaseMixin:
def assert_raises(self, exception_class, function, *args, **kwargs):
self.assertRaises(exception_class, function, *args, **kwargs)
try:
function(*args, **kwargs)
except exception_class as e:
pass
# print(str(e))
def assert_arrays_equal(self, x, y):
self.assertTrue(numpy_utils.arrays_equal(x, y))
def assert_arrays_close(self, x, y):
self.assertTrue(numpy_utils.arrays_close(x, y))
<commit_msg>Add method for testing async function errors.<commit_after>
|
"""
Unit test test case mixin class.
This mixin class is intended for use with a subclass of either
`unittest.TestCase` or `django.test.TestCase`. It includes several
convenience `_assert...` methods.
"""
import vesper.util.numpy_utils as numpy_utils
SHOW_EXCEPTION_MESSAGES = False
class TestCaseMixin:
def assert_raises(self, exception_class, function, *args, **kwargs):
try:
function(*args, **kwargs)
except exception_class as e:
if SHOW_EXCEPTION_MESSAGES:
print(str(e))
else:
raise AssertionError(
f'{exception_class.__name__} not raised by '
f'{function.__name__}')
async def assert_raises_async(
self, exception_class, function, *args, **kwargs):
try:
await function(*args, **kwargs)
except exception_class as e:
if SHOW_EXCEPTION_MESSAGES:
print(str(e))
else:
raise AssertionError(
f'{exception_class.__name__} not raised by '
f'{function.__name__}')
def assert_arrays_equal(self, x, y):
self.assertTrue(numpy_utils.arrays_equal(x, y))
def assert_arrays_close(self, x, y):
self.assertTrue(numpy_utils.arrays_close(x, y))
|
"""
Unit test test case mixin class.
This mixin class is intended for use with a subclass of either
`unittest.TestCase` or `django.test.TestCase`. It includes several
convenience `_assert...` methods.
"""
import vesper.util.numpy_utils as numpy_utils
class TestCaseMixin:
def assert_raises(self, exception_class, function, *args, **kwargs):
self.assertRaises(exception_class, function, *args, **kwargs)
try:
function(*args, **kwargs)
except exception_class as e:
pass
# print(str(e))
def assert_arrays_equal(self, x, y):
self.assertTrue(numpy_utils.arrays_equal(x, y))
def assert_arrays_close(self, x, y):
self.assertTrue(numpy_utils.arrays_close(x, y))
Add method for testing async function errors."""
Unit test test case mixin class.
This mixin class is intended for use with a subclass of either
`unittest.TestCase` or `django.test.TestCase`. It includes several
convenience `_assert...` methods.
"""
import vesper.util.numpy_utils as numpy_utils
SHOW_EXCEPTION_MESSAGES = False
class TestCaseMixin:
def assert_raises(self, exception_class, function, *args, **kwargs):
try:
function(*args, **kwargs)
except exception_class as e:
if SHOW_EXCEPTION_MESSAGES:
print(str(e))
else:
raise AssertionError(
f'{exception_class.__name__} not raised by '
f'{function.__name__}')
async def assert_raises_async(
self, exception_class, function, *args, **kwargs):
try:
await function(*args, **kwargs)
except exception_class as e:
if SHOW_EXCEPTION_MESSAGES:
print(str(e))
else:
raise AssertionError(
f'{exception_class.__name__} not raised by '
f'{function.__name__}')
def assert_arrays_equal(self, x, y):
self.assertTrue(numpy_utils.arrays_equal(x, y))
def assert_arrays_close(self, x, y):
self.assertTrue(numpy_utils.arrays_close(x, y))
|
<commit_before>"""
Unit test test case mixin class.
This mixin class is intended for use with a subclass of either
`unittest.TestCase` or `django.test.TestCase`. It includes several
convenience `_assert...` methods.
"""
import vesper.util.numpy_utils as numpy_utils
class TestCaseMixin:
def assert_raises(self, exception_class, function, *args, **kwargs):
self.assertRaises(exception_class, function, *args, **kwargs)
try:
function(*args, **kwargs)
except exception_class as e:
pass
# print(str(e))
def assert_arrays_equal(self, x, y):
self.assertTrue(numpy_utils.arrays_equal(x, y))
def assert_arrays_close(self, x, y):
self.assertTrue(numpy_utils.arrays_close(x, y))
<commit_msg>Add method for testing async function errors.<commit_after>"""
Unit test test case mixin class.
This mixin class is intended for use with a subclass of either
`unittest.TestCase` or `django.test.TestCase`. It includes several
convenience `_assert...` methods.
"""
import vesper.util.numpy_utils as numpy_utils
SHOW_EXCEPTION_MESSAGES = False
class TestCaseMixin:
def assert_raises(self, exception_class, function, *args, **kwargs):
try:
function(*args, **kwargs)
except exception_class as e:
if SHOW_EXCEPTION_MESSAGES:
print(str(e))
else:
raise AssertionError(
f'{exception_class.__name__} not raised by '
f'{function.__name__}')
async def assert_raises_async(
self, exception_class, function, *args, **kwargs):
try:
await function(*args, **kwargs)
except exception_class as e:
if SHOW_EXCEPTION_MESSAGES:
print(str(e))
else:
raise AssertionError(
f'{exception_class.__name__} not raised by '
f'{function.__name__}')
def assert_arrays_equal(self, x, y):
self.assertTrue(numpy_utils.arrays_equal(x, y))
def assert_arrays_close(self, x, y):
self.assertTrue(numpy_utils.arrays_close(x, y))
|
2082a4ba334a14bf95e9ad9deecc2c703e0f1aa5
|
rotostitch/__init__.py
|
rotostitch/__init__.py
|
import os
import sys
__version__ = "1.0.0"
packageDir = os.path.dirname(__file__)
RESOURCE_DIR = os.path.join(os.path.abspath(packageDir), "resources")
if not os.path.isdir(RESOURCE_DIR):
RESOURCE_DIR = os.path.join(os.path.dirname(sys.argv[0]), "resources")
|
import os
import sys
__version__ = "1.1.0"
packageDir = os.path.dirname(__file__)
RESOURCE_DIR = os.path.join(os.path.abspath(packageDir), "resources")
if not os.path.isdir(RESOURCE_DIR):
RESOURCE_DIR = os.path.join(os.path.dirname(sys.argv[0]), "resources")
|
Increment version number to 1.1.0
|
Increment version number to 1.1.0
|
Python
|
mit
|
AWFeldick/Rotostitch
|
import os
import sys
__version__ = "1.0.0"
packageDir = os.path.dirname(__file__)
RESOURCE_DIR = os.path.join(os.path.abspath(packageDir), "resources")
if not os.path.isdir(RESOURCE_DIR):
RESOURCE_DIR = os.path.join(os.path.dirname(sys.argv[0]), "resources")
Increment version number to 1.1.0
|
import os
import sys
__version__ = "1.1.0"
packageDir = os.path.dirname(__file__)
RESOURCE_DIR = os.path.join(os.path.abspath(packageDir), "resources")
if not os.path.isdir(RESOURCE_DIR):
RESOURCE_DIR = os.path.join(os.path.dirname(sys.argv[0]), "resources")
|
<commit_before>import os
import sys
__version__ = "1.0.0"
packageDir = os.path.dirname(__file__)
RESOURCE_DIR = os.path.join(os.path.abspath(packageDir), "resources")
if not os.path.isdir(RESOURCE_DIR):
RESOURCE_DIR = os.path.join(os.path.dirname(sys.argv[0]), "resources")
<commit_msg>Increment version number to 1.1.0<commit_after>
|
import os
import sys
__version__ = "1.1.0"
packageDir = os.path.dirname(__file__)
RESOURCE_DIR = os.path.join(os.path.abspath(packageDir), "resources")
if not os.path.isdir(RESOURCE_DIR):
RESOURCE_DIR = os.path.join(os.path.dirname(sys.argv[0]), "resources")
|
import os
import sys
__version__ = "1.0.0"
packageDir = os.path.dirname(__file__)
RESOURCE_DIR = os.path.join(os.path.abspath(packageDir), "resources")
if not os.path.isdir(RESOURCE_DIR):
RESOURCE_DIR = os.path.join(os.path.dirname(sys.argv[0]), "resources")
Increment version number to 1.1.0import os
import sys
__version__ = "1.1.0"
packageDir = os.path.dirname(__file__)
RESOURCE_DIR = os.path.join(os.path.abspath(packageDir), "resources")
if not os.path.isdir(RESOURCE_DIR):
RESOURCE_DIR = os.path.join(os.path.dirname(sys.argv[0]), "resources")
|
<commit_before>import os
import sys
__version__ = "1.0.0"
packageDir = os.path.dirname(__file__)
RESOURCE_DIR = os.path.join(os.path.abspath(packageDir), "resources")
if not os.path.isdir(RESOURCE_DIR):
RESOURCE_DIR = os.path.join(os.path.dirname(sys.argv[0]), "resources")
<commit_msg>Increment version number to 1.1.0<commit_after>import os
import sys
__version__ = "1.1.0"
packageDir = os.path.dirname(__file__)
RESOURCE_DIR = os.path.join(os.path.abspath(packageDir), "resources")
if not os.path.isdir(RESOURCE_DIR):
RESOURCE_DIR = os.path.join(os.path.dirname(sys.argv[0]), "resources")
|
33ba6400768b759180d7602c14e6f947d1c8e771
|
djangosaml2/templatetags/idplist.py
|
djangosaml2/templatetags/idplist.py
|
# Copyright (C) 2011 Yaco Sistemas (http://www.yaco.es)
#
# 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 django import template
from djangosaml2.conf import config_settings_loader
register = template.Library()
class IdPListNode(template.Node):
def __init__(self, variable_name):
self.variable_name = variable_name
self.conf = config_settings_loader()
def render(self, context):
context[self.variable_name] = self.conf.get_available_idps()
return ''
@register.tag
def idplist(parser, token):
try:
tag_name, as_part, variable = token.split_contents()
except ValueError:
raise template.TemplateSyntaxError(
'%r tag requires two arguments' % token.contents.split()[0])
if not as_part == 'as':
raise template.TemplateSyntaxError(
'%r tag first argument must be the literal "as"' % tag_name)
return IdPListNode(variable)
|
# Copyright (C) 2011 Yaco Sistemas (http://www.yaco.es)
#
# 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 django import template
from djangosaml2.conf import config_settings_loader
register = template.Library()
class IdPListNode(template.Node):
def __init__(self, variable_name):
self.variable_name = variable_name
def render(self, context):
conf = config_settings_loader()
context[self.variable_name] = conf.get_available_idps()
return ''
@register.tag
def idplist(parser, token):
try:
tag_name, as_part, variable = token.split_contents()
except ValueError:
raise template.TemplateSyntaxError(
'%r tag requires two arguments' % token.contents.split()[0])
if not as_part == 'as':
raise template.TemplateSyntaxError(
'%r tag first argument must be the literal "as"' % tag_name)
return IdPListNode(variable)
|
Load the config as late as possible to avoid crashing when the configuration is not ready yet. Also this code is more reentrant
|
Load the config as late as possible to avoid crashing when the configuration is not ready yet. Also this code is more reentrant
|
Python
|
apache-2.0
|
WiserTogether/djangosaml2,sdelements/djangosaml2,kradalby/djangosaml2,kradalby/djangosaml2,WiserTogether/djangosaml2
|
# Copyright (C) 2011 Yaco Sistemas (http://www.yaco.es)
#
# 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 django import template
from djangosaml2.conf import config_settings_loader
register = template.Library()
class IdPListNode(template.Node):
def __init__(self, variable_name):
self.variable_name = variable_name
self.conf = config_settings_loader()
def render(self, context):
context[self.variable_name] = self.conf.get_available_idps()
return ''
@register.tag
def idplist(parser, token):
try:
tag_name, as_part, variable = token.split_contents()
except ValueError:
raise template.TemplateSyntaxError(
'%r tag requires two arguments' % token.contents.split()[0])
if not as_part == 'as':
raise template.TemplateSyntaxError(
'%r tag first argument must be the literal "as"' % tag_name)
return IdPListNode(variable)
Load the config as late as possible to avoid crashing when the configuration is not ready yet. Also this code is more reentrant
|
# Copyright (C) 2011 Yaco Sistemas (http://www.yaco.es)
#
# 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 django import template
from djangosaml2.conf import config_settings_loader
register = template.Library()
class IdPListNode(template.Node):
def __init__(self, variable_name):
self.variable_name = variable_name
def render(self, context):
conf = config_settings_loader()
context[self.variable_name] = conf.get_available_idps()
return ''
@register.tag
def idplist(parser, token):
try:
tag_name, as_part, variable = token.split_contents()
except ValueError:
raise template.TemplateSyntaxError(
'%r tag requires two arguments' % token.contents.split()[0])
if not as_part == 'as':
raise template.TemplateSyntaxError(
'%r tag first argument must be the literal "as"' % tag_name)
return IdPListNode(variable)
|
<commit_before># Copyright (C) 2011 Yaco Sistemas (http://www.yaco.es)
#
# 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 django import template
from djangosaml2.conf import config_settings_loader
register = template.Library()
class IdPListNode(template.Node):
def __init__(self, variable_name):
self.variable_name = variable_name
self.conf = config_settings_loader()
def render(self, context):
context[self.variable_name] = self.conf.get_available_idps()
return ''
@register.tag
def idplist(parser, token):
try:
tag_name, as_part, variable = token.split_contents()
except ValueError:
raise template.TemplateSyntaxError(
'%r tag requires two arguments' % token.contents.split()[0])
if not as_part == 'as':
raise template.TemplateSyntaxError(
'%r tag first argument must be the literal "as"' % tag_name)
return IdPListNode(variable)
<commit_msg>Load the config as late as possible to avoid crashing when the configuration is not ready yet. Also this code is more reentrant<commit_after>
|
# Copyright (C) 2011 Yaco Sistemas (http://www.yaco.es)
#
# 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 django import template
from djangosaml2.conf import config_settings_loader
register = template.Library()
class IdPListNode(template.Node):
def __init__(self, variable_name):
self.variable_name = variable_name
def render(self, context):
conf = config_settings_loader()
context[self.variable_name] = conf.get_available_idps()
return ''
@register.tag
def idplist(parser, token):
try:
tag_name, as_part, variable = token.split_contents()
except ValueError:
raise template.TemplateSyntaxError(
'%r tag requires two arguments' % token.contents.split()[0])
if not as_part == 'as':
raise template.TemplateSyntaxError(
'%r tag first argument must be the literal "as"' % tag_name)
return IdPListNode(variable)
|
# Copyright (C) 2011 Yaco Sistemas (http://www.yaco.es)
#
# 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 django import template
from djangosaml2.conf import config_settings_loader
register = template.Library()
class IdPListNode(template.Node):
def __init__(self, variable_name):
self.variable_name = variable_name
self.conf = config_settings_loader()
def render(self, context):
context[self.variable_name] = self.conf.get_available_idps()
return ''
@register.tag
def idplist(parser, token):
try:
tag_name, as_part, variable = token.split_contents()
except ValueError:
raise template.TemplateSyntaxError(
'%r tag requires two arguments' % token.contents.split()[0])
if not as_part == 'as':
raise template.TemplateSyntaxError(
'%r tag first argument must be the literal "as"' % tag_name)
return IdPListNode(variable)
Load the config as late as possible to avoid crashing when the configuration is not ready yet. Also this code is more reentrant# Copyright (C) 2011 Yaco Sistemas (http://www.yaco.es)
#
# 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 django import template
from djangosaml2.conf import config_settings_loader
register = template.Library()
class IdPListNode(template.Node):
def __init__(self, variable_name):
self.variable_name = variable_name
def render(self, context):
conf = config_settings_loader()
context[self.variable_name] = conf.get_available_idps()
return ''
@register.tag
def idplist(parser, token):
try:
tag_name, as_part, variable = token.split_contents()
except ValueError:
raise template.TemplateSyntaxError(
'%r tag requires two arguments' % token.contents.split()[0])
if not as_part == 'as':
raise template.TemplateSyntaxError(
'%r tag first argument must be the literal "as"' % tag_name)
return IdPListNode(variable)
|
<commit_before># Copyright (C) 2011 Yaco Sistemas (http://www.yaco.es)
#
# 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 django import template
from djangosaml2.conf import config_settings_loader
register = template.Library()
class IdPListNode(template.Node):
def __init__(self, variable_name):
self.variable_name = variable_name
self.conf = config_settings_loader()
def render(self, context):
context[self.variable_name] = self.conf.get_available_idps()
return ''
@register.tag
def idplist(parser, token):
try:
tag_name, as_part, variable = token.split_contents()
except ValueError:
raise template.TemplateSyntaxError(
'%r tag requires two arguments' % token.contents.split()[0])
if not as_part == 'as':
raise template.TemplateSyntaxError(
'%r tag first argument must be the literal "as"' % tag_name)
return IdPListNode(variable)
<commit_msg>Load the config as late as possible to avoid crashing when the configuration is not ready yet. Also this code is more reentrant<commit_after># Copyright (C) 2011 Yaco Sistemas (http://www.yaco.es)
#
# 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 django import template
from djangosaml2.conf import config_settings_loader
register = template.Library()
class IdPListNode(template.Node):
def __init__(self, variable_name):
self.variable_name = variable_name
def render(self, context):
conf = config_settings_loader()
context[self.variable_name] = conf.get_available_idps()
return ''
@register.tag
def idplist(parser, token):
try:
tag_name, as_part, variable = token.split_contents()
except ValueError:
raise template.TemplateSyntaxError(
'%r tag requires two arguments' % token.contents.split()[0])
if not as_part == 'as':
raise template.TemplateSyntaxError(
'%r tag first argument must be the literal "as"' % tag_name)
return IdPListNode(variable)
|
d83ed858dab0991e4829a7f249260ae1f1140b41
|
rave/main.py
|
rave/main.py
|
import rave.events
import rave.modularity
import rave.backends
import rave.resources
import rave.rendering
def init_game(game):
rave.events.emit('game.init', game)
with game.env:
rave.modularity.load_all()
rave.backends.select_all()
def run_game(game):
running = True
# Stop the event loop when a stop event was caught.
def stop(event):
nonlocal running
running = False
game.events.hook('game.stop', stop)
rave.events.emit('game.start', game)
with game.env:
# Typical handle events -> update game state -> render loop.
while running:
with game.active_lock:
# Suspend main loop while lock is active: useful for when the OS requests an application suspend.
pass
rave.backends.handle_events(game)
if game.mixer:
game.mixer.render(None)
if game.window:
game.window.render(None)
|
import rave.events
import rave.modularity
import rave.backends
import rave.resources
import rave.rendering
def init_game(game):
rave.modularity.load_all()
rave.events.emit('game.init', game)
with game.env:
rave.backends.select_all()
def run_game(game):
running = True
# Stop the event loop when a stop event was caught.
def stop(event):
nonlocal running
running = False
game.events.hook('game.stop', stop)
rave.events.emit('game.start', game)
with game.env:
# Typical handle events -> update game state -> render loop.
while running:
with game.active_lock:
# Suspend main loop while lock is active: useful for when the OS requests an application suspend.
pass
rave.backends.handle_events(game)
if game.mixer:
game.mixer.render(None)
if game.window:
game.window.render(None)
|
Load modules in engine context.
|
core: Load modules in engine context.
|
Python
|
bsd-2-clause
|
rave-engine/rave
|
import rave.events
import rave.modularity
import rave.backends
import rave.resources
import rave.rendering
def init_game(game):
rave.events.emit('game.init', game)
with game.env:
rave.modularity.load_all()
rave.backends.select_all()
def run_game(game):
running = True
# Stop the event loop when a stop event was caught.
def stop(event):
nonlocal running
running = False
game.events.hook('game.stop', stop)
rave.events.emit('game.start', game)
with game.env:
# Typical handle events -> update game state -> render loop.
while running:
with game.active_lock:
# Suspend main loop while lock is active: useful for when the OS requests an application suspend.
pass
rave.backends.handle_events(game)
if game.mixer:
game.mixer.render(None)
if game.window:
game.window.render(None)
core: Load modules in engine context.
|
import rave.events
import rave.modularity
import rave.backends
import rave.resources
import rave.rendering
def init_game(game):
rave.modularity.load_all()
rave.events.emit('game.init', game)
with game.env:
rave.backends.select_all()
def run_game(game):
running = True
# Stop the event loop when a stop event was caught.
def stop(event):
nonlocal running
running = False
game.events.hook('game.stop', stop)
rave.events.emit('game.start', game)
with game.env:
# Typical handle events -> update game state -> render loop.
while running:
with game.active_lock:
# Suspend main loop while lock is active: useful for when the OS requests an application suspend.
pass
rave.backends.handle_events(game)
if game.mixer:
game.mixer.render(None)
if game.window:
game.window.render(None)
|
<commit_before>import rave.events
import rave.modularity
import rave.backends
import rave.resources
import rave.rendering
def init_game(game):
rave.events.emit('game.init', game)
with game.env:
rave.modularity.load_all()
rave.backends.select_all()
def run_game(game):
running = True
# Stop the event loop when a stop event was caught.
def stop(event):
nonlocal running
running = False
game.events.hook('game.stop', stop)
rave.events.emit('game.start', game)
with game.env:
# Typical handle events -> update game state -> render loop.
while running:
with game.active_lock:
# Suspend main loop while lock is active: useful for when the OS requests an application suspend.
pass
rave.backends.handle_events(game)
if game.mixer:
game.mixer.render(None)
if game.window:
game.window.render(None)
<commit_msg>core: Load modules in engine context.<commit_after>
|
import rave.events
import rave.modularity
import rave.backends
import rave.resources
import rave.rendering
def init_game(game):
rave.modularity.load_all()
rave.events.emit('game.init', game)
with game.env:
rave.backends.select_all()
def run_game(game):
running = True
# Stop the event loop when a stop event was caught.
def stop(event):
nonlocal running
running = False
game.events.hook('game.stop', stop)
rave.events.emit('game.start', game)
with game.env:
# Typical handle events -> update game state -> render loop.
while running:
with game.active_lock:
# Suspend main loop while lock is active: useful for when the OS requests an application suspend.
pass
rave.backends.handle_events(game)
if game.mixer:
game.mixer.render(None)
if game.window:
game.window.render(None)
|
import rave.events
import rave.modularity
import rave.backends
import rave.resources
import rave.rendering
def init_game(game):
rave.events.emit('game.init', game)
with game.env:
rave.modularity.load_all()
rave.backends.select_all()
def run_game(game):
running = True
# Stop the event loop when a stop event was caught.
def stop(event):
nonlocal running
running = False
game.events.hook('game.stop', stop)
rave.events.emit('game.start', game)
with game.env:
# Typical handle events -> update game state -> render loop.
while running:
with game.active_lock:
# Suspend main loop while lock is active: useful for when the OS requests an application suspend.
pass
rave.backends.handle_events(game)
if game.mixer:
game.mixer.render(None)
if game.window:
game.window.render(None)
core: Load modules in engine context.import rave.events
import rave.modularity
import rave.backends
import rave.resources
import rave.rendering
def init_game(game):
rave.modularity.load_all()
rave.events.emit('game.init', game)
with game.env:
rave.backends.select_all()
def run_game(game):
running = True
# Stop the event loop when a stop event was caught.
def stop(event):
nonlocal running
running = False
game.events.hook('game.stop', stop)
rave.events.emit('game.start', game)
with game.env:
# Typical handle events -> update game state -> render loop.
while running:
with game.active_lock:
# Suspend main loop while lock is active: useful for when the OS requests an application suspend.
pass
rave.backends.handle_events(game)
if game.mixer:
game.mixer.render(None)
if game.window:
game.window.render(None)
|
<commit_before>import rave.events
import rave.modularity
import rave.backends
import rave.resources
import rave.rendering
def init_game(game):
rave.events.emit('game.init', game)
with game.env:
rave.modularity.load_all()
rave.backends.select_all()
def run_game(game):
running = True
# Stop the event loop when a stop event was caught.
def stop(event):
nonlocal running
running = False
game.events.hook('game.stop', stop)
rave.events.emit('game.start', game)
with game.env:
# Typical handle events -> update game state -> render loop.
while running:
with game.active_lock:
# Suspend main loop while lock is active: useful for when the OS requests an application suspend.
pass
rave.backends.handle_events(game)
if game.mixer:
game.mixer.render(None)
if game.window:
game.window.render(None)
<commit_msg>core: Load modules in engine context.<commit_after>import rave.events
import rave.modularity
import rave.backends
import rave.resources
import rave.rendering
def init_game(game):
rave.modularity.load_all()
rave.events.emit('game.init', game)
with game.env:
rave.backends.select_all()
def run_game(game):
running = True
# Stop the event loop when a stop event was caught.
def stop(event):
nonlocal running
running = False
game.events.hook('game.stop', stop)
rave.events.emit('game.start', game)
with game.env:
# Typical handle events -> update game state -> render loop.
while running:
with game.active_lock:
# Suspend main loop while lock is active: useful for when the OS requests an application suspend.
pass
rave.backends.handle_events(game)
if game.mixer:
game.mixer.render(None)
if game.window:
game.window.render(None)
|
a37ef5af5a28207d21b11f08990e233a34afa768
|
acme/utils/loggers/__init__.py
|
acme/utils/loggers/__init__.py
|
# python3
# Copyright 2018 DeepMind Technologies Limited. All rights reserved.
#
# 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.
"""Acme loggers."""
from acme.utils.loggers.aggregators import Dispatcher
from acme.utils.loggers.asynchronous import AsyncLogger
from acme.utils.loggers.base import Logger
from acme.utils.loggers.base import to_numpy
from acme.utils.loggers.csv import CSVLogger
from acme.utils.loggers.filters import NoneFilter
from acme.utils.loggers.filters import TimeFilter
from acme.utils.loggers.default import make_default_logger # pylint: disable=g-bad-import-order
from acme.utils.loggers.terminal import TerminalLogger
|
# python3
# Copyright 2018 DeepMind Technologies Limited. All rights reserved.
#
# 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.
"""Acme loggers."""
from acme.utils.loggers.aggregators import Dispatcher
from acme.utils.loggers.asynchronous import AsyncLogger
from acme.utils.loggers.base import Logger
from acme.utils.loggers.base import LoggingData
from acme.utils.loggers.base import to_numpy
from acme.utils.loggers.csv import CSVLogger
from acme.utils.loggers.filters import NoneFilter
from acme.utils.loggers.filters import TimeFilter
from acme.utils.loggers.default import make_default_logger # pylint: disable=g-bad-import-order
from acme.utils.loggers.terminal import TerminalLogger
|
Add LoggingData annotation to Logger base import so users can type-annotate Logger subclasses properly.
|
Add LoggingData annotation to Logger base import so users can type-annotate Logger subclasses properly.
PiperOrigin-RevId: 315308368
Change-Id: I608c9f6f5f4b9edbbf504ec321fc4c8e90ed8193
|
Python
|
apache-2.0
|
deepmind/acme,deepmind/acme
|
# python3
# Copyright 2018 DeepMind Technologies Limited. All rights reserved.
#
# 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.
"""Acme loggers."""
from acme.utils.loggers.aggregators import Dispatcher
from acme.utils.loggers.asynchronous import AsyncLogger
from acme.utils.loggers.base import Logger
from acme.utils.loggers.base import to_numpy
from acme.utils.loggers.csv import CSVLogger
from acme.utils.loggers.filters import NoneFilter
from acme.utils.loggers.filters import TimeFilter
from acme.utils.loggers.default import make_default_logger # pylint: disable=g-bad-import-order
from acme.utils.loggers.terminal import TerminalLogger
Add LoggingData annotation to Logger base import so users can type-annotate Logger subclasses properly.
PiperOrigin-RevId: 315308368
Change-Id: I608c9f6f5f4b9edbbf504ec321fc4c8e90ed8193
|
# python3
# Copyright 2018 DeepMind Technologies Limited. All rights reserved.
#
# 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.
"""Acme loggers."""
from acme.utils.loggers.aggregators import Dispatcher
from acme.utils.loggers.asynchronous import AsyncLogger
from acme.utils.loggers.base import Logger
from acme.utils.loggers.base import LoggingData
from acme.utils.loggers.base import to_numpy
from acme.utils.loggers.csv import CSVLogger
from acme.utils.loggers.filters import NoneFilter
from acme.utils.loggers.filters import TimeFilter
from acme.utils.loggers.default import make_default_logger # pylint: disable=g-bad-import-order
from acme.utils.loggers.terminal import TerminalLogger
|
<commit_before># python3
# Copyright 2018 DeepMind Technologies Limited. All rights reserved.
#
# 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.
"""Acme loggers."""
from acme.utils.loggers.aggregators import Dispatcher
from acme.utils.loggers.asynchronous import AsyncLogger
from acme.utils.loggers.base import Logger
from acme.utils.loggers.base import to_numpy
from acme.utils.loggers.csv import CSVLogger
from acme.utils.loggers.filters import NoneFilter
from acme.utils.loggers.filters import TimeFilter
from acme.utils.loggers.default import make_default_logger # pylint: disable=g-bad-import-order
from acme.utils.loggers.terminal import TerminalLogger
<commit_msg>Add LoggingData annotation to Logger base import so users can type-annotate Logger subclasses properly.
PiperOrigin-RevId: 315308368
Change-Id: I608c9f6f5f4b9edbbf504ec321fc4c8e90ed8193<commit_after>
|
# python3
# Copyright 2018 DeepMind Technologies Limited. All rights reserved.
#
# 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.
"""Acme loggers."""
from acme.utils.loggers.aggregators import Dispatcher
from acme.utils.loggers.asynchronous import AsyncLogger
from acme.utils.loggers.base import Logger
from acme.utils.loggers.base import LoggingData
from acme.utils.loggers.base import to_numpy
from acme.utils.loggers.csv import CSVLogger
from acme.utils.loggers.filters import NoneFilter
from acme.utils.loggers.filters import TimeFilter
from acme.utils.loggers.default import make_default_logger # pylint: disable=g-bad-import-order
from acme.utils.loggers.terminal import TerminalLogger
|
# python3
# Copyright 2018 DeepMind Technologies Limited. All rights reserved.
#
# 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.
"""Acme loggers."""
from acme.utils.loggers.aggregators import Dispatcher
from acme.utils.loggers.asynchronous import AsyncLogger
from acme.utils.loggers.base import Logger
from acme.utils.loggers.base import to_numpy
from acme.utils.loggers.csv import CSVLogger
from acme.utils.loggers.filters import NoneFilter
from acme.utils.loggers.filters import TimeFilter
from acme.utils.loggers.default import make_default_logger # pylint: disable=g-bad-import-order
from acme.utils.loggers.terminal import TerminalLogger
Add LoggingData annotation to Logger base import so users can type-annotate Logger subclasses properly.
PiperOrigin-RevId: 315308368
Change-Id: I608c9f6f5f4b9edbbf504ec321fc4c8e90ed8193# python3
# Copyright 2018 DeepMind Technologies Limited. All rights reserved.
#
# 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.
"""Acme loggers."""
from acme.utils.loggers.aggregators import Dispatcher
from acme.utils.loggers.asynchronous import AsyncLogger
from acme.utils.loggers.base import Logger
from acme.utils.loggers.base import LoggingData
from acme.utils.loggers.base import to_numpy
from acme.utils.loggers.csv import CSVLogger
from acme.utils.loggers.filters import NoneFilter
from acme.utils.loggers.filters import TimeFilter
from acme.utils.loggers.default import make_default_logger # pylint: disable=g-bad-import-order
from acme.utils.loggers.terminal import TerminalLogger
|
<commit_before># python3
# Copyright 2018 DeepMind Technologies Limited. All rights reserved.
#
# 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.
"""Acme loggers."""
from acme.utils.loggers.aggregators import Dispatcher
from acme.utils.loggers.asynchronous import AsyncLogger
from acme.utils.loggers.base import Logger
from acme.utils.loggers.base import to_numpy
from acme.utils.loggers.csv import CSVLogger
from acme.utils.loggers.filters import NoneFilter
from acme.utils.loggers.filters import TimeFilter
from acme.utils.loggers.default import make_default_logger # pylint: disable=g-bad-import-order
from acme.utils.loggers.terminal import TerminalLogger
<commit_msg>Add LoggingData annotation to Logger base import so users can type-annotate Logger subclasses properly.
PiperOrigin-RevId: 315308368
Change-Id: I608c9f6f5f4b9edbbf504ec321fc4c8e90ed8193<commit_after># python3
# Copyright 2018 DeepMind Technologies Limited. All rights reserved.
#
# 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.
"""Acme loggers."""
from acme.utils.loggers.aggregators import Dispatcher
from acme.utils.loggers.asynchronous import AsyncLogger
from acme.utils.loggers.base import Logger
from acme.utils.loggers.base import LoggingData
from acme.utils.loggers.base import to_numpy
from acme.utils.loggers.csv import CSVLogger
from acme.utils.loggers.filters import NoneFilter
from acme.utils.loggers.filters import TimeFilter
from acme.utils.loggers.default import make_default_logger # pylint: disable=g-bad-import-order
from acme.utils.loggers.terminal import TerminalLogger
|
7014bfb976524e95b6e13eb44cf62401568bff1a
|
examples/web_demo/exifutil.py
|
examples/web_demo/exifutil.py
|
"""
This script handles the skimage exif problem.
"""
from PIL import Image
import numpy as np
ORIENTATIONS = { # used in apply_orientation
2: (Image.FLIP_LEFT_RIGHT,),
3: (Image.ROTATE_180,),
4: (Image.FLIP_TOP_BOTTOM,),
5: (Image.FLIP_LEFT_RIGHT, Image.ROTATE_90),
6: (Image.ROTATE_270,),
7: (Image.FLIP_LEFT_RIGHT, Image.ROTATE_270),
8: (Image.ROTATE_90,)
}
def open_oriented_im(im_path):
im = Image.open(im_path)
if hasattr(im, '_getexif'):
exif = im._getexif()
if exif is not None and 274 in exif:
orientation = exif[274]
im = apply_orientation(im, orientation)
return np.asarray(im).astype(np.float32) / 255.
def apply_orientation(im, orientation):
if orientation in ORIENTATIONS:
for method in ORIENTATIONS[orientation]:
im = im.transpose(method)
return im
|
"""
This script handles the skimage exif problem.
"""
from PIL import Image
import numpy as np
ORIENTATIONS = { # used in apply_orientation
2: (Image.FLIP_LEFT_RIGHT,),
3: (Image.ROTATE_180,),
4: (Image.FLIP_TOP_BOTTOM,),
5: (Image.FLIP_LEFT_RIGHT, Image.ROTATE_90),
6: (Image.ROTATE_270,),
7: (Image.FLIP_LEFT_RIGHT, Image.ROTATE_270),
8: (Image.ROTATE_90,)
}
def open_oriented_im(im_path):
im = Image.open(im_path)
if hasattr(im, '_getexif'):
exif = im._getexif()
if exif is not None and 274 in exif:
orientation = exif[274]
im = apply_orientation(im, orientation)
img = np.asarray(im).astype(np.float32) / 255.
if img.ndim == 2:
img = img[:, :, np.newaxis]
img = np.tile(img, (1, 1, 3))
elif img.shape[2] == 4:
img = img[:, :, :3]
return img
def apply_orientation(im, orientation):
if orientation in ORIENTATIONS:
for method in ORIENTATIONS[orientation]:
im = im.transpose(method)
return im
|
FIX web_demo upload was not processing grayscale correctly
|
FIX web_demo upload was not processing grayscale correctly
|
Python
|
agpl-3.0
|
tackgeun/caffe,CZCV/s-dilation-caffe,longjon/caffe,gnina/gnina,CZCV/s-dilation-caffe,tackgeun/caffe,gnina/gnina,gnina/gnina,gogartom/caffe-textmaps,CZCV/s-dilation-caffe,gogartom/caffe-textmaps,wangg12/caffe,tackgeun/caffe,wangg12/caffe,gnina/gnina,gnina/gnina,gogartom/caffe-textmaps,CZCV/s-dilation-caffe,longjon/caffe,wangg12/caffe,longjon/caffe,longjon/caffe,gogartom/caffe-textmaps,wangg12/caffe,gnina/gnina,tackgeun/caffe
|
"""
This script handles the skimage exif problem.
"""
from PIL import Image
import numpy as np
ORIENTATIONS = { # used in apply_orientation
2: (Image.FLIP_LEFT_RIGHT,),
3: (Image.ROTATE_180,),
4: (Image.FLIP_TOP_BOTTOM,),
5: (Image.FLIP_LEFT_RIGHT, Image.ROTATE_90),
6: (Image.ROTATE_270,),
7: (Image.FLIP_LEFT_RIGHT, Image.ROTATE_270),
8: (Image.ROTATE_90,)
}
def open_oriented_im(im_path):
im = Image.open(im_path)
if hasattr(im, '_getexif'):
exif = im._getexif()
if exif is not None and 274 in exif:
orientation = exif[274]
im = apply_orientation(im, orientation)
return np.asarray(im).astype(np.float32) / 255.
def apply_orientation(im, orientation):
if orientation in ORIENTATIONS:
for method in ORIENTATIONS[orientation]:
im = im.transpose(method)
return im
FIX web_demo upload was not processing grayscale correctly
|
"""
This script handles the skimage exif problem.
"""
from PIL import Image
import numpy as np
ORIENTATIONS = { # used in apply_orientation
2: (Image.FLIP_LEFT_RIGHT,),
3: (Image.ROTATE_180,),
4: (Image.FLIP_TOP_BOTTOM,),
5: (Image.FLIP_LEFT_RIGHT, Image.ROTATE_90),
6: (Image.ROTATE_270,),
7: (Image.FLIP_LEFT_RIGHT, Image.ROTATE_270),
8: (Image.ROTATE_90,)
}
def open_oriented_im(im_path):
im = Image.open(im_path)
if hasattr(im, '_getexif'):
exif = im._getexif()
if exif is not None and 274 in exif:
orientation = exif[274]
im = apply_orientation(im, orientation)
img = np.asarray(im).astype(np.float32) / 255.
if img.ndim == 2:
img = img[:, :, np.newaxis]
img = np.tile(img, (1, 1, 3))
elif img.shape[2] == 4:
img = img[:, :, :3]
return img
def apply_orientation(im, orientation):
if orientation in ORIENTATIONS:
for method in ORIENTATIONS[orientation]:
im = im.transpose(method)
return im
|
<commit_before>"""
This script handles the skimage exif problem.
"""
from PIL import Image
import numpy as np
ORIENTATIONS = { # used in apply_orientation
2: (Image.FLIP_LEFT_RIGHT,),
3: (Image.ROTATE_180,),
4: (Image.FLIP_TOP_BOTTOM,),
5: (Image.FLIP_LEFT_RIGHT, Image.ROTATE_90),
6: (Image.ROTATE_270,),
7: (Image.FLIP_LEFT_RIGHT, Image.ROTATE_270),
8: (Image.ROTATE_90,)
}
def open_oriented_im(im_path):
im = Image.open(im_path)
if hasattr(im, '_getexif'):
exif = im._getexif()
if exif is not None and 274 in exif:
orientation = exif[274]
im = apply_orientation(im, orientation)
return np.asarray(im).astype(np.float32) / 255.
def apply_orientation(im, orientation):
if orientation in ORIENTATIONS:
for method in ORIENTATIONS[orientation]:
im = im.transpose(method)
return im
<commit_msg>FIX web_demo upload was not processing grayscale correctly<commit_after>
|
"""
This script handles the skimage exif problem.
"""
from PIL import Image
import numpy as np
ORIENTATIONS = { # used in apply_orientation
2: (Image.FLIP_LEFT_RIGHT,),
3: (Image.ROTATE_180,),
4: (Image.FLIP_TOP_BOTTOM,),
5: (Image.FLIP_LEFT_RIGHT, Image.ROTATE_90),
6: (Image.ROTATE_270,),
7: (Image.FLIP_LEFT_RIGHT, Image.ROTATE_270),
8: (Image.ROTATE_90,)
}
def open_oriented_im(im_path):
im = Image.open(im_path)
if hasattr(im, '_getexif'):
exif = im._getexif()
if exif is not None and 274 in exif:
orientation = exif[274]
im = apply_orientation(im, orientation)
img = np.asarray(im).astype(np.float32) / 255.
if img.ndim == 2:
img = img[:, :, np.newaxis]
img = np.tile(img, (1, 1, 3))
elif img.shape[2] == 4:
img = img[:, :, :3]
return img
def apply_orientation(im, orientation):
if orientation in ORIENTATIONS:
for method in ORIENTATIONS[orientation]:
im = im.transpose(method)
return im
|
"""
This script handles the skimage exif problem.
"""
from PIL import Image
import numpy as np
ORIENTATIONS = { # used in apply_orientation
2: (Image.FLIP_LEFT_RIGHT,),
3: (Image.ROTATE_180,),
4: (Image.FLIP_TOP_BOTTOM,),
5: (Image.FLIP_LEFT_RIGHT, Image.ROTATE_90),
6: (Image.ROTATE_270,),
7: (Image.FLIP_LEFT_RIGHT, Image.ROTATE_270),
8: (Image.ROTATE_90,)
}
def open_oriented_im(im_path):
im = Image.open(im_path)
if hasattr(im, '_getexif'):
exif = im._getexif()
if exif is not None and 274 in exif:
orientation = exif[274]
im = apply_orientation(im, orientation)
return np.asarray(im).astype(np.float32) / 255.
def apply_orientation(im, orientation):
if orientation in ORIENTATIONS:
for method in ORIENTATIONS[orientation]:
im = im.transpose(method)
return im
FIX web_demo upload was not processing grayscale correctly"""
This script handles the skimage exif problem.
"""
from PIL import Image
import numpy as np
ORIENTATIONS = { # used in apply_orientation
2: (Image.FLIP_LEFT_RIGHT,),
3: (Image.ROTATE_180,),
4: (Image.FLIP_TOP_BOTTOM,),
5: (Image.FLIP_LEFT_RIGHT, Image.ROTATE_90),
6: (Image.ROTATE_270,),
7: (Image.FLIP_LEFT_RIGHT, Image.ROTATE_270),
8: (Image.ROTATE_90,)
}
def open_oriented_im(im_path):
im = Image.open(im_path)
if hasattr(im, '_getexif'):
exif = im._getexif()
if exif is not None and 274 in exif:
orientation = exif[274]
im = apply_orientation(im, orientation)
img = np.asarray(im).astype(np.float32) / 255.
if img.ndim == 2:
img = img[:, :, np.newaxis]
img = np.tile(img, (1, 1, 3))
elif img.shape[2] == 4:
img = img[:, :, :3]
return img
def apply_orientation(im, orientation):
if orientation in ORIENTATIONS:
for method in ORIENTATIONS[orientation]:
im = im.transpose(method)
return im
|
<commit_before>"""
This script handles the skimage exif problem.
"""
from PIL import Image
import numpy as np
ORIENTATIONS = { # used in apply_orientation
2: (Image.FLIP_LEFT_RIGHT,),
3: (Image.ROTATE_180,),
4: (Image.FLIP_TOP_BOTTOM,),
5: (Image.FLIP_LEFT_RIGHT, Image.ROTATE_90),
6: (Image.ROTATE_270,),
7: (Image.FLIP_LEFT_RIGHT, Image.ROTATE_270),
8: (Image.ROTATE_90,)
}
def open_oriented_im(im_path):
im = Image.open(im_path)
if hasattr(im, '_getexif'):
exif = im._getexif()
if exif is not None and 274 in exif:
orientation = exif[274]
im = apply_orientation(im, orientation)
return np.asarray(im).astype(np.float32) / 255.
def apply_orientation(im, orientation):
if orientation in ORIENTATIONS:
for method in ORIENTATIONS[orientation]:
im = im.transpose(method)
return im
<commit_msg>FIX web_demo upload was not processing grayscale correctly<commit_after>"""
This script handles the skimage exif problem.
"""
from PIL import Image
import numpy as np
ORIENTATIONS = { # used in apply_orientation
2: (Image.FLIP_LEFT_RIGHT,),
3: (Image.ROTATE_180,),
4: (Image.FLIP_TOP_BOTTOM,),
5: (Image.FLIP_LEFT_RIGHT, Image.ROTATE_90),
6: (Image.ROTATE_270,),
7: (Image.FLIP_LEFT_RIGHT, Image.ROTATE_270),
8: (Image.ROTATE_90,)
}
def open_oriented_im(im_path):
im = Image.open(im_path)
if hasattr(im, '_getexif'):
exif = im._getexif()
if exif is not None and 274 in exif:
orientation = exif[274]
im = apply_orientation(im, orientation)
img = np.asarray(im).astype(np.float32) / 255.
if img.ndim == 2:
img = img[:, :, np.newaxis]
img = np.tile(img, (1, 1, 3))
elif img.shape[2] == 4:
img = img[:, :, :3]
return img
def apply_orientation(im, orientation):
if orientation in ORIENTATIONS:
for method in ORIENTATIONS[orientation]:
im = im.transpose(method)
return im
|
527c414da01dd40425086253dec2007c54e30675
|
send_reminders.py
|
send_reminders.py
|
from twilio.rest import TwilioRestClient
import project.utils.reminders
ACCOUNT_SID = "AC6a9746370384b26236aae71013aa35b2"
AUTH_TOKEN = "38b0bcc37788e553978c840929d54aa2"
def send_reminder(text, phone):
client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN)
client.messages.create(to=phone, from_="+15713646776", body=text)
def send_all_reminders():
x = project.utils.reminders.get_needed_reminders()
for i in x:
send_reminder(i.text, i.phone)
send_all_reminders()
|
from twilio.rest import TwilioRestClient
import project.utils.reminders
ACCOUNT_SID = "ayylmao"
AUTH_TOKEN = "ayylmao"
def send_reminder(text, phone):
client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN)
client.messages.create(to=phone, from_="+15172194225", body=text)
def send_all_reminders():
x = project.utils.reminders.get_needed_reminders()
for i in x:
send_reminder(i.text, i.phone)
send_all_reminders()
|
Update API keys and phone number
|
Update API keys and phone number
|
Python
|
apache-2.0
|
tjcsl/mhacksiv
|
from twilio.rest import TwilioRestClient
import project.utils.reminders
ACCOUNT_SID = "AC6a9746370384b26236aae71013aa35b2"
AUTH_TOKEN = "38b0bcc37788e553978c840929d54aa2"
def send_reminder(text, phone):
client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN)
client.messages.create(to=phone, from_="+15713646776", body=text)
def send_all_reminders():
x = project.utils.reminders.get_needed_reminders()
for i in x:
send_reminder(i.text, i.phone)
send_all_reminders()
Update API keys and phone number
|
from twilio.rest import TwilioRestClient
import project.utils.reminders
ACCOUNT_SID = "ayylmao"
AUTH_TOKEN = "ayylmao"
def send_reminder(text, phone):
client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN)
client.messages.create(to=phone, from_="+15172194225", body=text)
def send_all_reminders():
x = project.utils.reminders.get_needed_reminders()
for i in x:
send_reminder(i.text, i.phone)
send_all_reminders()
|
<commit_before>from twilio.rest import TwilioRestClient
import project.utils.reminders
ACCOUNT_SID = "AC6a9746370384b26236aae71013aa35b2"
AUTH_TOKEN = "38b0bcc37788e553978c840929d54aa2"
def send_reminder(text, phone):
client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN)
client.messages.create(to=phone, from_="+15713646776", body=text)
def send_all_reminders():
x = project.utils.reminders.get_needed_reminders()
for i in x:
send_reminder(i.text, i.phone)
send_all_reminders()
<commit_msg>Update API keys and phone number<commit_after>
|
from twilio.rest import TwilioRestClient
import project.utils.reminders
ACCOUNT_SID = "ayylmao"
AUTH_TOKEN = "ayylmao"
def send_reminder(text, phone):
client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN)
client.messages.create(to=phone, from_="+15172194225", body=text)
def send_all_reminders():
x = project.utils.reminders.get_needed_reminders()
for i in x:
send_reminder(i.text, i.phone)
send_all_reminders()
|
from twilio.rest import TwilioRestClient
import project.utils.reminders
ACCOUNT_SID = "AC6a9746370384b26236aae71013aa35b2"
AUTH_TOKEN = "38b0bcc37788e553978c840929d54aa2"
def send_reminder(text, phone):
client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN)
client.messages.create(to=phone, from_="+15713646776", body=text)
def send_all_reminders():
x = project.utils.reminders.get_needed_reminders()
for i in x:
send_reminder(i.text, i.phone)
send_all_reminders()
Update API keys and phone numberfrom twilio.rest import TwilioRestClient
import project.utils.reminders
ACCOUNT_SID = "ayylmao"
AUTH_TOKEN = "ayylmao"
def send_reminder(text, phone):
client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN)
client.messages.create(to=phone, from_="+15172194225", body=text)
def send_all_reminders():
x = project.utils.reminders.get_needed_reminders()
for i in x:
send_reminder(i.text, i.phone)
send_all_reminders()
|
<commit_before>from twilio.rest import TwilioRestClient
import project.utils.reminders
ACCOUNT_SID = "AC6a9746370384b26236aae71013aa35b2"
AUTH_TOKEN = "38b0bcc37788e553978c840929d54aa2"
def send_reminder(text, phone):
client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN)
client.messages.create(to=phone, from_="+15713646776", body=text)
def send_all_reminders():
x = project.utils.reminders.get_needed_reminders()
for i in x:
send_reminder(i.text, i.phone)
send_all_reminders()
<commit_msg>Update API keys and phone number<commit_after>from twilio.rest import TwilioRestClient
import project.utils.reminders
ACCOUNT_SID = "ayylmao"
AUTH_TOKEN = "ayylmao"
def send_reminder(text, phone):
client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN)
client.messages.create(to=phone, from_="+15172194225", body=text)
def send_all_reminders():
x = project.utils.reminders.get_needed_reminders()
for i in x:
send_reminder(i.text, i.phone)
send_all_reminders()
|
e7865a22eb2e7433f3c36cd571aae3ac65436423
|
signage/models.py
|
signage/models.py
|
from __future__ import unicode_literals
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from model_utils.models import TimeFramedModel
from taggit.managers import TaggableManager
@python_2_unicode_compatible
class Slide(TimeFramedModel):
"""
"""
name = models.CharField(
max_length=255,
)
description = models.TextField(
blank=True,
)
image = models.ImageField(
upload_to='slides/',
)
duration = models.PositiveIntegerField(
default=7,
)
weight = models.SmallIntegerField(
default=0,
)
tags = TaggableManager()
def __str__(self):
return self.name
def get_absolute_url(self):
return reverse('signage:slide_update', args=[self.pk])
def get_displays(self):
return Display.objects.filter(tags__name__in=self.tags.names()).distinct()
@python_2_unicode_compatible
class Display(models.Model):
"""
"""
name = models.CharField(
max_length=255,
)
description = models.TextField(
blank=True,
)
tags = TaggableManager()
def __str__(self):
return self.name
def get_absolute_url(self):
return reverse('signage:display_update', args=[self.pk])
def get_slides(self):
return Slide.objects.filter(tags__name__in=self.tags.names()).distinct()
|
from __future__ import unicode_literals
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from model_utils.models import TimeFramedModel
from taggit.managers import TaggableManager
@python_2_unicode_compatible
class Slide(TimeFramedModel):
"""
"""
name = models.CharField(
max_length=255,
)
description = models.TextField(
blank=True,
)
image = models.ImageField(
upload_to='slides/',
)
duration = models.PositiveIntegerField(
default=7,
)
weight = models.SmallIntegerField(
default=0,
)
tags = TaggableManager()
def __str__(self):
return self.name
def get_absolute_url(self):
return reverse('signage:slide_update', args=[self.pk])
def get_displays(self):
return Display.objects.filter(tags__name__in=self.tags.names()).distinct()
@python_2_unicode_compatible
class Display(models.Model):
"""
"""
name = models.CharField(
max_length=255,
)
description = models.TextField(
blank=True,
)
tags = TaggableManager()
def __str__(self):
return self.name
def get_absolute_url(self):
return reverse('signage:display_update', args=[self.pk])
def get_slides(self):
return Slide.objects.filter(tags__name__in=self.tags.names()).order_by('weight').distinct()
|
Order displayed slides by weight
|
Order displayed slides by weight
|
Python
|
bsd-3-clause
|
jbittel/django-signage,jbittel/django-signage,jbittel/django-signage
|
from __future__ import unicode_literals
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from model_utils.models import TimeFramedModel
from taggit.managers import TaggableManager
@python_2_unicode_compatible
class Slide(TimeFramedModel):
"""
"""
name = models.CharField(
max_length=255,
)
description = models.TextField(
blank=True,
)
image = models.ImageField(
upload_to='slides/',
)
duration = models.PositiveIntegerField(
default=7,
)
weight = models.SmallIntegerField(
default=0,
)
tags = TaggableManager()
def __str__(self):
return self.name
def get_absolute_url(self):
return reverse('signage:slide_update', args=[self.pk])
def get_displays(self):
return Display.objects.filter(tags__name__in=self.tags.names()).distinct()
@python_2_unicode_compatible
class Display(models.Model):
"""
"""
name = models.CharField(
max_length=255,
)
description = models.TextField(
blank=True,
)
tags = TaggableManager()
def __str__(self):
return self.name
def get_absolute_url(self):
return reverse('signage:display_update', args=[self.pk])
def get_slides(self):
return Slide.objects.filter(tags__name__in=self.tags.names()).distinct()
Order displayed slides by weight
|
from __future__ import unicode_literals
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from model_utils.models import TimeFramedModel
from taggit.managers import TaggableManager
@python_2_unicode_compatible
class Slide(TimeFramedModel):
"""
"""
name = models.CharField(
max_length=255,
)
description = models.TextField(
blank=True,
)
image = models.ImageField(
upload_to='slides/',
)
duration = models.PositiveIntegerField(
default=7,
)
weight = models.SmallIntegerField(
default=0,
)
tags = TaggableManager()
def __str__(self):
return self.name
def get_absolute_url(self):
return reverse('signage:slide_update', args=[self.pk])
def get_displays(self):
return Display.objects.filter(tags__name__in=self.tags.names()).distinct()
@python_2_unicode_compatible
class Display(models.Model):
"""
"""
name = models.CharField(
max_length=255,
)
description = models.TextField(
blank=True,
)
tags = TaggableManager()
def __str__(self):
return self.name
def get_absolute_url(self):
return reverse('signage:display_update', args=[self.pk])
def get_slides(self):
return Slide.objects.filter(tags__name__in=self.tags.names()).order_by('weight').distinct()
|
<commit_before>from __future__ import unicode_literals
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from model_utils.models import TimeFramedModel
from taggit.managers import TaggableManager
@python_2_unicode_compatible
class Slide(TimeFramedModel):
"""
"""
name = models.CharField(
max_length=255,
)
description = models.TextField(
blank=True,
)
image = models.ImageField(
upload_to='slides/',
)
duration = models.PositiveIntegerField(
default=7,
)
weight = models.SmallIntegerField(
default=0,
)
tags = TaggableManager()
def __str__(self):
return self.name
def get_absolute_url(self):
return reverse('signage:slide_update', args=[self.pk])
def get_displays(self):
return Display.objects.filter(tags__name__in=self.tags.names()).distinct()
@python_2_unicode_compatible
class Display(models.Model):
"""
"""
name = models.CharField(
max_length=255,
)
description = models.TextField(
blank=True,
)
tags = TaggableManager()
def __str__(self):
return self.name
def get_absolute_url(self):
return reverse('signage:display_update', args=[self.pk])
def get_slides(self):
return Slide.objects.filter(tags__name__in=self.tags.names()).distinct()
<commit_msg>Order displayed slides by weight<commit_after>
|
from __future__ import unicode_literals
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from model_utils.models import TimeFramedModel
from taggit.managers import TaggableManager
@python_2_unicode_compatible
class Slide(TimeFramedModel):
"""
"""
name = models.CharField(
max_length=255,
)
description = models.TextField(
blank=True,
)
image = models.ImageField(
upload_to='slides/',
)
duration = models.PositiveIntegerField(
default=7,
)
weight = models.SmallIntegerField(
default=0,
)
tags = TaggableManager()
def __str__(self):
return self.name
def get_absolute_url(self):
return reverse('signage:slide_update', args=[self.pk])
def get_displays(self):
return Display.objects.filter(tags__name__in=self.tags.names()).distinct()
@python_2_unicode_compatible
class Display(models.Model):
"""
"""
name = models.CharField(
max_length=255,
)
description = models.TextField(
blank=True,
)
tags = TaggableManager()
def __str__(self):
return self.name
def get_absolute_url(self):
return reverse('signage:display_update', args=[self.pk])
def get_slides(self):
return Slide.objects.filter(tags__name__in=self.tags.names()).order_by('weight').distinct()
|
from __future__ import unicode_literals
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from model_utils.models import TimeFramedModel
from taggit.managers import TaggableManager
@python_2_unicode_compatible
class Slide(TimeFramedModel):
"""
"""
name = models.CharField(
max_length=255,
)
description = models.TextField(
blank=True,
)
image = models.ImageField(
upload_to='slides/',
)
duration = models.PositiveIntegerField(
default=7,
)
weight = models.SmallIntegerField(
default=0,
)
tags = TaggableManager()
def __str__(self):
return self.name
def get_absolute_url(self):
return reverse('signage:slide_update', args=[self.pk])
def get_displays(self):
return Display.objects.filter(tags__name__in=self.tags.names()).distinct()
@python_2_unicode_compatible
class Display(models.Model):
"""
"""
name = models.CharField(
max_length=255,
)
description = models.TextField(
blank=True,
)
tags = TaggableManager()
def __str__(self):
return self.name
def get_absolute_url(self):
return reverse('signage:display_update', args=[self.pk])
def get_slides(self):
return Slide.objects.filter(tags__name__in=self.tags.names()).distinct()
Order displayed slides by weightfrom __future__ import unicode_literals
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from model_utils.models import TimeFramedModel
from taggit.managers import TaggableManager
@python_2_unicode_compatible
class Slide(TimeFramedModel):
"""
"""
name = models.CharField(
max_length=255,
)
description = models.TextField(
blank=True,
)
image = models.ImageField(
upload_to='slides/',
)
duration = models.PositiveIntegerField(
default=7,
)
weight = models.SmallIntegerField(
default=0,
)
tags = TaggableManager()
def __str__(self):
return self.name
def get_absolute_url(self):
return reverse('signage:slide_update', args=[self.pk])
def get_displays(self):
return Display.objects.filter(tags__name__in=self.tags.names()).distinct()
@python_2_unicode_compatible
class Display(models.Model):
"""
"""
name = models.CharField(
max_length=255,
)
description = models.TextField(
blank=True,
)
tags = TaggableManager()
def __str__(self):
return self.name
def get_absolute_url(self):
return reverse('signage:display_update', args=[self.pk])
def get_slides(self):
return Slide.objects.filter(tags__name__in=self.tags.names()).order_by('weight').distinct()
|
<commit_before>from __future__ import unicode_literals
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from model_utils.models import TimeFramedModel
from taggit.managers import TaggableManager
@python_2_unicode_compatible
class Slide(TimeFramedModel):
"""
"""
name = models.CharField(
max_length=255,
)
description = models.TextField(
blank=True,
)
image = models.ImageField(
upload_to='slides/',
)
duration = models.PositiveIntegerField(
default=7,
)
weight = models.SmallIntegerField(
default=0,
)
tags = TaggableManager()
def __str__(self):
return self.name
def get_absolute_url(self):
return reverse('signage:slide_update', args=[self.pk])
def get_displays(self):
return Display.objects.filter(tags__name__in=self.tags.names()).distinct()
@python_2_unicode_compatible
class Display(models.Model):
"""
"""
name = models.CharField(
max_length=255,
)
description = models.TextField(
blank=True,
)
tags = TaggableManager()
def __str__(self):
return self.name
def get_absolute_url(self):
return reverse('signage:display_update', args=[self.pk])
def get_slides(self):
return Slide.objects.filter(tags__name__in=self.tags.names()).distinct()
<commit_msg>Order displayed slides by weight<commit_after>from __future__ import unicode_literals
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from model_utils.models import TimeFramedModel
from taggit.managers import TaggableManager
@python_2_unicode_compatible
class Slide(TimeFramedModel):
"""
"""
name = models.CharField(
max_length=255,
)
description = models.TextField(
blank=True,
)
image = models.ImageField(
upload_to='slides/',
)
duration = models.PositiveIntegerField(
default=7,
)
weight = models.SmallIntegerField(
default=0,
)
tags = TaggableManager()
def __str__(self):
return self.name
def get_absolute_url(self):
return reverse('signage:slide_update', args=[self.pk])
def get_displays(self):
return Display.objects.filter(tags__name__in=self.tags.names()).distinct()
@python_2_unicode_compatible
class Display(models.Model):
"""
"""
name = models.CharField(
max_length=255,
)
description = models.TextField(
blank=True,
)
tags = TaggableManager()
def __str__(self):
return self.name
def get_absolute_url(self):
return reverse('signage:display_update', args=[self.pk])
def get_slides(self):
return Slide.objects.filter(tags__name__in=self.tags.names()).order_by('weight').distinct()
|
cf52a7c83e1479a99e95ab2125958a67febfccf5
|
dataviews/__init__.py
|
dataviews/__init__.py
|
import sys, os
# Add param submodule to sys.path
cwd = os.path.abspath(os.path.split(__file__)[0])
sys.path.insert(0, os.path.join(cwd, '..', 'param'))
from .views import * # pyflakes:ignore (API import)
from .dataviews import * # pyflakes:ignore (API import)
from .sheetviews import * # pyflakes:ignore (API import)
from .ndmapping import * # pyflakes:ignore (API import)
def public(obj):
if not isinstance(obj, type): return False
baseclasses = [NdMapping, View, Dimension]
return any([issubclass(obj, bc) for bc in baseclasses])
_public = list(set([_k for _k, _v in locals().items() if public(_v)]))
__all__ = _public + ["boundingregion", "ipython", "plots", "sheetcoords" ]
|
import sys, os
# Add param submodule to sys.path
cwd = os.path.abspath(os.path.split(__file__)[0])
sys.path.insert(0, os.path.join(cwd, '..', 'param'))
import param
__version__ = param.Version(release=(0,7), fpath=__file__)
from .views import * # pyflakes:ignore (API import)
from .dataviews import * # pyflakes:ignore (API import)
from .sheetviews import * # pyflakes:ignore (API import)
from .ndmapping import * # pyflakes:ignore (API import)
def public(obj):
if not isinstance(obj, type): return False
baseclasses = [NdMapping, View, Dimension]
return any([issubclass(obj, bc) for bc in baseclasses])
_public = list(set([_k for _k, _v in locals().items() if public(_v)]))
__all__ = _public + ["boundingregion", "ipython", "plots", "sheetcoords" ]
|
Set __version__ using param.Version (commit tagged as 'v0.7')
|
Set __version__ using param.Version (commit tagged as 'v0.7')
|
Python
|
bsd-3-clause
|
mjabri/holoviews,basnijholt/holoviews,ioam/holoviews,mjabri/holoviews,ioam/holoviews,vascotenner/holoviews,vascotenner/holoviews,ioam/holoviews,basnijholt/holoviews,basnijholt/holoviews,vascotenner/holoviews,mjabri/holoviews
|
import sys, os
# Add param submodule to sys.path
cwd = os.path.abspath(os.path.split(__file__)[0])
sys.path.insert(0, os.path.join(cwd, '..', 'param'))
from .views import * # pyflakes:ignore (API import)
from .dataviews import * # pyflakes:ignore (API import)
from .sheetviews import * # pyflakes:ignore (API import)
from .ndmapping import * # pyflakes:ignore (API import)
def public(obj):
if not isinstance(obj, type): return False
baseclasses = [NdMapping, View, Dimension]
return any([issubclass(obj, bc) for bc in baseclasses])
_public = list(set([_k for _k, _v in locals().items() if public(_v)]))
__all__ = _public + ["boundingregion", "ipython", "plots", "sheetcoords" ]
Set __version__ using param.Version (commit tagged as 'v0.7')
|
import sys, os
# Add param submodule to sys.path
cwd = os.path.abspath(os.path.split(__file__)[0])
sys.path.insert(0, os.path.join(cwd, '..', 'param'))
import param
__version__ = param.Version(release=(0,7), fpath=__file__)
from .views import * # pyflakes:ignore (API import)
from .dataviews import * # pyflakes:ignore (API import)
from .sheetviews import * # pyflakes:ignore (API import)
from .ndmapping import * # pyflakes:ignore (API import)
def public(obj):
if not isinstance(obj, type): return False
baseclasses = [NdMapping, View, Dimension]
return any([issubclass(obj, bc) for bc in baseclasses])
_public = list(set([_k for _k, _v in locals().items() if public(_v)]))
__all__ = _public + ["boundingregion", "ipython", "plots", "sheetcoords" ]
|
<commit_before>import sys, os
# Add param submodule to sys.path
cwd = os.path.abspath(os.path.split(__file__)[0])
sys.path.insert(0, os.path.join(cwd, '..', 'param'))
from .views import * # pyflakes:ignore (API import)
from .dataviews import * # pyflakes:ignore (API import)
from .sheetviews import * # pyflakes:ignore (API import)
from .ndmapping import * # pyflakes:ignore (API import)
def public(obj):
if not isinstance(obj, type): return False
baseclasses = [NdMapping, View, Dimension]
return any([issubclass(obj, bc) for bc in baseclasses])
_public = list(set([_k for _k, _v in locals().items() if public(_v)]))
__all__ = _public + ["boundingregion", "ipython", "plots", "sheetcoords" ]
<commit_msg>Set __version__ using param.Version (commit tagged as 'v0.7')<commit_after>
|
import sys, os
# Add param submodule to sys.path
cwd = os.path.abspath(os.path.split(__file__)[0])
sys.path.insert(0, os.path.join(cwd, '..', 'param'))
import param
__version__ = param.Version(release=(0,7), fpath=__file__)
from .views import * # pyflakes:ignore (API import)
from .dataviews import * # pyflakes:ignore (API import)
from .sheetviews import * # pyflakes:ignore (API import)
from .ndmapping import * # pyflakes:ignore (API import)
def public(obj):
if not isinstance(obj, type): return False
baseclasses = [NdMapping, View, Dimension]
return any([issubclass(obj, bc) for bc in baseclasses])
_public = list(set([_k for _k, _v in locals().items() if public(_v)]))
__all__ = _public + ["boundingregion", "ipython", "plots", "sheetcoords" ]
|
import sys, os
# Add param submodule to sys.path
cwd = os.path.abspath(os.path.split(__file__)[0])
sys.path.insert(0, os.path.join(cwd, '..', 'param'))
from .views import * # pyflakes:ignore (API import)
from .dataviews import * # pyflakes:ignore (API import)
from .sheetviews import * # pyflakes:ignore (API import)
from .ndmapping import * # pyflakes:ignore (API import)
def public(obj):
if not isinstance(obj, type): return False
baseclasses = [NdMapping, View, Dimension]
return any([issubclass(obj, bc) for bc in baseclasses])
_public = list(set([_k for _k, _v in locals().items() if public(_v)]))
__all__ = _public + ["boundingregion", "ipython", "plots", "sheetcoords" ]
Set __version__ using param.Version (commit tagged as 'v0.7')import sys, os
# Add param submodule to sys.path
cwd = os.path.abspath(os.path.split(__file__)[0])
sys.path.insert(0, os.path.join(cwd, '..', 'param'))
import param
__version__ = param.Version(release=(0,7), fpath=__file__)
from .views import * # pyflakes:ignore (API import)
from .dataviews import * # pyflakes:ignore (API import)
from .sheetviews import * # pyflakes:ignore (API import)
from .ndmapping import * # pyflakes:ignore (API import)
def public(obj):
if not isinstance(obj, type): return False
baseclasses = [NdMapping, View, Dimension]
return any([issubclass(obj, bc) for bc in baseclasses])
_public = list(set([_k for _k, _v in locals().items() if public(_v)]))
__all__ = _public + ["boundingregion", "ipython", "plots", "sheetcoords" ]
|
<commit_before>import sys, os
# Add param submodule to sys.path
cwd = os.path.abspath(os.path.split(__file__)[0])
sys.path.insert(0, os.path.join(cwd, '..', 'param'))
from .views import * # pyflakes:ignore (API import)
from .dataviews import * # pyflakes:ignore (API import)
from .sheetviews import * # pyflakes:ignore (API import)
from .ndmapping import * # pyflakes:ignore (API import)
def public(obj):
if not isinstance(obj, type): return False
baseclasses = [NdMapping, View, Dimension]
return any([issubclass(obj, bc) for bc in baseclasses])
_public = list(set([_k for _k, _v in locals().items() if public(_v)]))
__all__ = _public + ["boundingregion", "ipython", "plots", "sheetcoords" ]
<commit_msg>Set __version__ using param.Version (commit tagged as 'v0.7')<commit_after>import sys, os
# Add param submodule to sys.path
cwd = os.path.abspath(os.path.split(__file__)[0])
sys.path.insert(0, os.path.join(cwd, '..', 'param'))
import param
__version__ = param.Version(release=(0,7), fpath=__file__)
from .views import * # pyflakes:ignore (API import)
from .dataviews import * # pyflakes:ignore (API import)
from .sheetviews import * # pyflakes:ignore (API import)
from .ndmapping import * # pyflakes:ignore (API import)
def public(obj):
if not isinstance(obj, type): return False
baseclasses = [NdMapping, View, Dimension]
return any([issubclass(obj, bc) for bc in baseclasses])
_public = list(set([_k for _k, _v in locals().items() if public(_v)]))
__all__ = _public + ["boundingregion", "ipython", "plots", "sheetcoords" ]
|
0236ad9090f7b218fc7515fdc8d919b2fc048a72
|
simple_counter.py
|
simple_counter.py
|
# Copyright 2008 Google 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.
#
"""A module implementing a simple sharded counter."""
import random
from google.appengine.ext import ndb
NUM_SHARDS = 20
class SimpleCounterShard(ndb.Model):
"""Shards for the counter"""
count = ndb.IntegerProperty(required=True, default=0)
def get_count():
"""Retrieve the value for a given sharded counter."""
total = 0
for counter in SimpleCounterShard.query():
total += counter.count
return total
@ndb.transactional
def increment():
"""Increment the value for a given sharded counter."""
shard_index = random.randint(0, NUM_SHARDS - 1)
counter = SimpleCounterShard.get_by_id(shard_index)
if counter is None:
counter = SimpleCounterShard(id=shard_index)
counter.count += 1
counter.put()
|
# Copyright 2008 Google 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.
#
"""A module implementing a simple sharded counter."""
import random
from google.appengine.ext import ndb
NUM_SHARDS = 20
class SimpleCounterShard(ndb.Model):
"""Shards for the counter"""
count = ndb.IntegerProperty(required=True, default=0)
def get_count():
"""Retrieve the value for a given sharded counter."""
total = 0
for counter in SimpleCounterShard.query():
total += counter.count
return total
@ndb.transactional
def increment():
"""Increment the value for a given sharded counter."""
shard_index = random.randint(0, NUM_SHARDS - 1)
counter = SimpleCounterShard.get_by_id(shard_index)
if counter is None:
counter = SimpleCounterShard(id=shard_index)
counter.count += 1
counter.put()
|
Indent only (PEP8) commit of simple counter.
|
Indent only (PEP8) commit of simple counter.
|
Python
|
apache-2.0
|
GoogleCloudPlatform/appengine-sharded-counters-python
|
# Copyright 2008 Google 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.
#
"""A module implementing a simple sharded counter."""
import random
from google.appengine.ext import ndb
NUM_SHARDS = 20
class SimpleCounterShard(ndb.Model):
"""Shards for the counter"""
count = ndb.IntegerProperty(required=True, default=0)
def get_count():
"""Retrieve the value for a given sharded counter."""
total = 0
for counter in SimpleCounterShard.query():
total += counter.count
return total
@ndb.transactional
def increment():
"""Increment the value for a given sharded counter."""
shard_index = random.randint(0, NUM_SHARDS - 1)
counter = SimpleCounterShard.get_by_id(shard_index)
if counter is None:
counter = SimpleCounterShard(id=shard_index)
counter.count += 1
counter.put()
Indent only (PEP8) commit of simple counter.
|
# Copyright 2008 Google 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.
#
"""A module implementing a simple sharded counter."""
import random
from google.appengine.ext import ndb
NUM_SHARDS = 20
class SimpleCounterShard(ndb.Model):
"""Shards for the counter"""
count = ndb.IntegerProperty(required=True, default=0)
def get_count():
"""Retrieve the value for a given sharded counter."""
total = 0
for counter in SimpleCounterShard.query():
total += counter.count
return total
@ndb.transactional
def increment():
"""Increment the value for a given sharded counter."""
shard_index = random.randint(0, NUM_SHARDS - 1)
counter = SimpleCounterShard.get_by_id(shard_index)
if counter is None:
counter = SimpleCounterShard(id=shard_index)
counter.count += 1
counter.put()
|
<commit_before># Copyright 2008 Google 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.
#
"""A module implementing a simple sharded counter."""
import random
from google.appengine.ext import ndb
NUM_SHARDS = 20
class SimpleCounterShard(ndb.Model):
"""Shards for the counter"""
count = ndb.IntegerProperty(required=True, default=0)
def get_count():
"""Retrieve the value for a given sharded counter."""
total = 0
for counter in SimpleCounterShard.query():
total += counter.count
return total
@ndb.transactional
def increment():
"""Increment the value for a given sharded counter."""
shard_index = random.randint(0, NUM_SHARDS - 1)
counter = SimpleCounterShard.get_by_id(shard_index)
if counter is None:
counter = SimpleCounterShard(id=shard_index)
counter.count += 1
counter.put()
<commit_msg>Indent only (PEP8) commit of simple counter.<commit_after>
|
# Copyright 2008 Google 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.
#
"""A module implementing a simple sharded counter."""
import random
from google.appengine.ext import ndb
NUM_SHARDS = 20
class SimpleCounterShard(ndb.Model):
"""Shards for the counter"""
count = ndb.IntegerProperty(required=True, default=0)
def get_count():
"""Retrieve the value for a given sharded counter."""
total = 0
for counter in SimpleCounterShard.query():
total += counter.count
return total
@ndb.transactional
def increment():
"""Increment the value for a given sharded counter."""
shard_index = random.randint(0, NUM_SHARDS - 1)
counter = SimpleCounterShard.get_by_id(shard_index)
if counter is None:
counter = SimpleCounterShard(id=shard_index)
counter.count += 1
counter.put()
|
# Copyright 2008 Google 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.
#
"""A module implementing a simple sharded counter."""
import random
from google.appengine.ext import ndb
NUM_SHARDS = 20
class SimpleCounterShard(ndb.Model):
"""Shards for the counter"""
count = ndb.IntegerProperty(required=True, default=0)
def get_count():
"""Retrieve the value for a given sharded counter."""
total = 0
for counter in SimpleCounterShard.query():
total += counter.count
return total
@ndb.transactional
def increment():
"""Increment the value for a given sharded counter."""
shard_index = random.randint(0, NUM_SHARDS - 1)
counter = SimpleCounterShard.get_by_id(shard_index)
if counter is None:
counter = SimpleCounterShard(id=shard_index)
counter.count += 1
counter.put()
Indent only (PEP8) commit of simple counter.# Copyright 2008 Google 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.
#
"""A module implementing a simple sharded counter."""
import random
from google.appengine.ext import ndb
NUM_SHARDS = 20
class SimpleCounterShard(ndb.Model):
"""Shards for the counter"""
count = ndb.IntegerProperty(required=True, default=0)
def get_count():
"""Retrieve the value for a given sharded counter."""
total = 0
for counter in SimpleCounterShard.query():
total += counter.count
return total
@ndb.transactional
def increment():
"""Increment the value for a given sharded counter."""
shard_index = random.randint(0, NUM_SHARDS - 1)
counter = SimpleCounterShard.get_by_id(shard_index)
if counter is None:
counter = SimpleCounterShard(id=shard_index)
counter.count += 1
counter.put()
|
<commit_before># Copyright 2008 Google 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.
#
"""A module implementing a simple sharded counter."""
import random
from google.appengine.ext import ndb
NUM_SHARDS = 20
class SimpleCounterShard(ndb.Model):
"""Shards for the counter"""
count = ndb.IntegerProperty(required=True, default=0)
def get_count():
"""Retrieve the value for a given sharded counter."""
total = 0
for counter in SimpleCounterShard.query():
total += counter.count
return total
@ndb.transactional
def increment():
"""Increment the value for a given sharded counter."""
shard_index = random.randint(0, NUM_SHARDS - 1)
counter = SimpleCounterShard.get_by_id(shard_index)
if counter is None:
counter = SimpleCounterShard(id=shard_index)
counter.count += 1
counter.put()
<commit_msg>Indent only (PEP8) commit of simple counter.<commit_after># Copyright 2008 Google 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.
#
"""A module implementing a simple sharded counter."""
import random
from google.appengine.ext import ndb
NUM_SHARDS = 20
class SimpleCounterShard(ndb.Model):
"""Shards for the counter"""
count = ndb.IntegerProperty(required=True, default=0)
def get_count():
"""Retrieve the value for a given sharded counter."""
total = 0
for counter in SimpleCounterShard.query():
total += counter.count
return total
@ndb.transactional
def increment():
"""Increment the value for a given sharded counter."""
shard_index = random.randint(0, NUM_SHARDS - 1)
counter = SimpleCounterShard.get_by_id(shard_index)
if counter is None:
counter = SimpleCounterShard(id=shard_index)
counter.count += 1
counter.put()
|
da93d78d141e0e07581b2a00cd6a4fb4058dcf56
|
scikits/learn/setup.py
|
scikits/learn/setup.py
|
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('learn',parent_package,top_path)
config.add_subpackage('datasets')
config.add_subpackage('common')
config.add_subpackage('machine')
config.add_subpackage('utils')
return config
if __name__ == '__main__':
from numpy.distutils.core import setup
setup(**configuration(top_path='').todict())
|
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('learn',parent_package,top_path)
config.add_subpackage('datasets')
config.add_subpackage('machine')
config.add_subpackage('utils')
return config
if __name__ == '__main__':
from numpy.distutils.core import setup
setup(**configuration(top_path='').todict())
|
Remove references to deleted submodule common/
|
Remove references to deleted submodule common/
From: Fabian Pedregosa <fabian.pedregosa@inria.fr>
git-svn-id: a2d1b0e147e530765aaf3e1662d4a98e2f63c719@384 22fbfee3-77ab-4535-9bad-27d1bd3bc7d8
|
Python
|
bsd-3-clause
|
jayflo/scikit-learn,toastedcornflakes/scikit-learn,Aasmi/scikit-learn,kjung/scikit-learn,macks22/scikit-learn,trungnt13/scikit-learn,sgenoud/scikit-learn,ldirer/scikit-learn,aetilley/scikit-learn,elkingtonmcb/scikit-learn,IshankGulati/scikit-learn,zhenv5/scikit-learn,fzalkow/scikit-learn,petosegan/scikit-learn,mojoboss/scikit-learn,belltailjp/scikit-learn,jseabold/scikit-learn,terkkila/scikit-learn,BiaDarkia/scikit-learn,ominux/scikit-learn,fyffyt/scikit-learn,glouppe/scikit-learn,MohammedWasim/scikit-learn,aewhatley/scikit-learn,cauchycui/scikit-learn,fyffyt/scikit-learn,MatthieuBizien/scikit-learn,altairpearl/scikit-learn,zuku1985/scikit-learn,Djabbz/scikit-learn,shusenl/scikit-learn,bnaul/scikit-learn,Windy-Ground/scikit-learn,liberatorqjw/scikit-learn,ltiao/scikit-learn,yanlend/scikit-learn,Nyker510/scikit-learn,trankmichael/scikit-learn,sanketloke/scikit-learn,DonBeo/scikit-learn,akionakamura/scikit-learn,xubenben/scikit-learn,0x0all/scikit-learn,mlyundin/scikit-learn,zaxtax/scikit-learn,icdishb/scikit-learn,wazeerzulfikar/scikit-learn,rajat1994/scikit-learn,sonnyhu/scikit-learn,espg/scikit-learn,abimannans/scikit-learn,jmetzen/scikit-learn,vshtanko/scikit-learn,ningchi/scikit-learn,0x0all/scikit-learn,Garrett-R/scikit-learn,fzalkow/scikit-learn,saiwing-yeung/scikit-learn,ky822/scikit-learn,imaculate/scikit-learn,TomDLT/scikit-learn,jjx02230808/project0223,marcocaccin/scikit-learn,schets/scikit-learn,LiaoPan/scikit-learn,gotomypc/scikit-learn,stylianos-kampakis/scikit-learn,voxlol/scikit-learn,michigraber/scikit-learn,aewhatley/scikit-learn,hlin117/scikit-learn,ZENGXH/scikit-learn,ogrisel/scikit-learn,frank-tancf/scikit-learn,rishikksh20/scikit-learn,luo66/scikit-learn,ldirer/scikit-learn,mikebenfield/scikit-learn,hainm/scikit-learn,procoder317/scikit-learn,OshynSong/scikit-learn,huzq/scikit-learn,0x0all/scikit-learn,jpautom/scikit-learn,alvarofierroclavero/scikit-learn,sgenoud/scikit-learn,nikitasingh981/scikit-learn,JsNoNo/scikit-learn,rrohan/scikit-learn,jorge2703/scikit-learn,JPFrancoia/scikit-learn,betatim/scikit-learn,henrykironde/scikit-learn,AlexanderFabisch/scikit-learn,rahul-c1/scikit-learn,pianomania/scikit-learn,costypetrisor/scikit-learn,ssaeger/scikit-learn,ssaeger/scikit-learn,PrashntS/scikit-learn,samzhang111/scikit-learn,eg-zhang/scikit-learn,JosmanPS/scikit-learn,russel1237/scikit-learn,krez13/scikit-learn,wzbozon/scikit-learn,nrhine1/scikit-learn,Fireblend/scikit-learn,q1ang/scikit-learn,massmutual/scikit-learn,yask123/scikit-learn,nelson-liu/scikit-learn,nvoron23/scikit-learn,adamgreenhall/scikit-learn,nvoron23/scikit-learn,voxlol/scikit-learn,bthirion/scikit-learn,aabadie/scikit-learn,shahankhatch/scikit-learn,yonglehou/scikit-learn,MechCoder/scikit-learn,OshynSong/scikit-learn,cdegroc/scikit-learn,pompiduskus/scikit-learn,lucidfrontier45/scikit-learn,yunfeilu/scikit-learn,mfjb/scikit-learn,arjoly/scikit-learn,amueller/scikit-learn,etkirsch/scikit-learn,zorroblue/scikit-learn,jorge2703/scikit-learn,waterponey/scikit-learn,gclenaghan/scikit-learn,potash/scikit-learn,devanshdalal/scikit-learn,ilo10/scikit-learn,JeanKossaifi/scikit-learn,vivekmishra1991/scikit-learn,hugobowne/scikit-learn,anurag313/scikit-learn,pythonvietnam/scikit-learn,phdowling/scikit-learn,andaag/scikit-learn,AlexanderFabisch/scikit-learn,HolgerPeters/scikit-learn,procoder317/scikit-learn,MatthieuBizien/scikit-learn,hdmetor/scikit-learn,ClimbsRocks/scikit-learn,TomDLT/scikit-learn,yask123/scikit-learn,devanshdalal/scikit-learn,IssamLaradji/scikit-learn,AlexanderFabisch/scikit-learn,saiwing-yeung/scikit-learn,tawsifkhan/scikit-learn,qifeigit/scikit-learn,fzalkow/scikit-learn,olologin/scikit-learn,btabibian/scikit-learn,cdegroc/scikit-learn,qifeigit/scikit-learn,sinhrks/scikit-learn,amueller/scikit-learn,Lawrence-Liu/scikit-learn,rohanp/scikit-learn,yask123/scikit-learn,xubenben/scikit-learn,arabenjamin/scikit-learn,vivekmishra1991/scikit-learn,abhishekkrthakur/scikit-learn,joshloyal/scikit-learn,pompiduskus/scikit-learn,Aasmi/scikit-learn,glouppe/scikit-learn,mjudsp/Tsallis,raghavrv/scikit-learn,ElDeveloper/scikit-learn,walterreade/scikit-learn,abhishekgahlot/scikit-learn,luo66/scikit-learn,hsiaoyi0504/scikit-learn,rahuldhote/scikit-learn,rvraghav93/scikit-learn,mattgiguere/scikit-learn,pv/scikit-learn,depet/scikit-learn,sergeyf/scikit-learn,jayflo/scikit-learn,ky822/scikit-learn,andrewnc/scikit-learn,imaculate/scikit-learn,jpautom/scikit-learn,cl4rke/scikit-learn,jkarnows/scikit-learn,0asa/scikit-learn,ilyes14/scikit-learn,tosolveit/scikit-learn,ChanderG/scikit-learn,cdegroc/scikit-learn,jorik041/scikit-learn,B3AU/waveTree,CforED/Machine-Learning,marcocaccin/scikit-learn,thientu/scikit-learn,yonglehou/scikit-learn,JosmanPS/scikit-learn,jaidevd/scikit-learn,russel1237/scikit-learn,vermouthmjl/scikit-learn,bhargav/scikit-learn,dingocuster/scikit-learn,lin-credible/scikit-learn,PrashntS/scikit-learn,cauchycui/scikit-learn,ivannz/scikit-learn,vortex-ape/scikit-learn,IshankGulati/scikit-learn,rrohan/scikit-learn,betatim/scikit-learn,ephes/scikit-learn,bikong2/scikit-learn,mrshu/scikit-learn,f3r/scikit-learn,RachitKansal/scikit-learn,BiaDarkia/scikit-learn,ndingwall/scikit-learn,huobaowangxi/scikit-learn,DSLituiev/scikit-learn,fbagirov/scikit-learn,simon-pepin/scikit-learn,abhishekgahlot/scikit-learn,zhenv5/scikit-learn,vybstat/scikit-learn,RachitKansal/scikit-learn,iismd17/scikit-learn,loli/sklearn-ensembletrees,michigraber/scikit-learn,Jimmy-Morzaria/scikit-learn,huobaowangxi/scikit-learn,q1ang/scikit-learn,murali-munna/scikit-learn,OshynSong/scikit-learn,IndraVikas/scikit-learn,bikong2/scikit-learn,ankurankan/scikit-learn,JsNoNo/scikit-learn,MartinDelzant/scikit-learn,kylerbrown/scikit-learn,466152112/scikit-learn,IshankGulati/scikit-learn,nmayorov/scikit-learn,UNR-AERIAL/scikit-learn,mfjb/scikit-learn,rexshihaoren/scikit-learn,espg/scikit-learn,adamgreenhall/scikit-learn,joernhees/scikit-learn,carrillo/scikit-learn,abimannans/scikit-learn,xavierwu/scikit-learn,davidgbe/scikit-learn,bhargav/scikit-learn,ashhher3/scikit-learn,ominux/scikit-learn,mattilyra/scikit-learn,cainiaocome/scikit-learn,plissonf/scikit-learn,depet/scikit-learn,hdmetor/scikit-learn,hdmetor/scikit-learn,Nyker510/scikit-learn,pompiduskus/scikit-learn,eickenberg/scikit-learn,xuewei4d/scikit-learn,hrjn/scikit-learn,ningchi/scikit-learn,ishanic/scikit-learn,tmhm/scikit-learn,walterreade/scikit-learn,waterponey/scikit-learn,murali-munna/scikit-learn,vivekmishra1991/scikit-learn,JeanKossaifi/scikit-learn,luo66/scikit-learn,ycaihua/scikit-learn,nomadcube/scikit-learn,mwv/scikit-learn,xzh86/scikit-learn,ogrisel/scikit-learn,petosegan/scikit-learn,mblondel/scikit-learn,xiaoxiamii/scikit-learn,kaichogami/scikit-learn,NelisVerhoef/scikit-learn,hugobowne/scikit-learn,wlamond/scikit-learn,dsquareindia/scikit-learn,rahul-c1/scikit-learn,ZENGXH/scikit-learn,mblondel/scikit-learn,YinongLong/scikit-learn,lucidfrontier45/scikit-learn,huzq/scikit-learn,DonBeo/scikit-learn,hitszxp/scikit-learn,hlin117/scikit-learn,jzt5132/scikit-learn,bhargav/scikit-learn,jzt5132/scikit-learn,khkaminska/scikit-learn,tmhm/scikit-learn,equialgo/scikit-learn,kevin-intel/scikit-learn,dsquareindia/scikit-learn,nhejazi/scikit-learn,pratapvardhan/scikit-learn,kagayakidan/scikit-learn,kashif/scikit-learn,beepee14/scikit-learn,yunfeilu/scikit-learn,vortex-ape/scikit-learn,Vimos/scikit-learn,aflaxman/scikit-learn,schets/scikit-learn,dsullivan7/scikit-learn,btabibian/scikit-learn,LiaoPan/scikit-learn,deepesch/scikit-learn,clemkoa/scikit-learn,rohanp/scikit-learn,pv/scikit-learn,billy-inn/scikit-learn,466152112/scikit-learn,equialgo/scikit-learn,kagayakidan/scikit-learn,abimannans/scikit-learn,hdmetor/scikit-learn,siutanwong/scikit-learn,rahul-c1/scikit-learn,huobaowangxi/scikit-learn,B3AU/waveTree,murali-munna/scikit-learn,vibhorag/scikit-learn,dhruv13J/scikit-learn,UNR-AERIAL/scikit-learn,pnedunuri/scikit-learn,kmike/scikit-learn,fbagirov/scikit-learn,manashmndl/scikit-learn,betatim/scikit-learn,fabioticconi/scikit-learn,mojoboss/scikit-learn,shangwuhencc/scikit-learn,khkaminska/scikit-learn,yask123/scikit-learn,rohanp/scikit-learn,vinayak-mehta/scikit-learn,aminert/scikit-learn,djgagne/scikit-learn,heli522/scikit-learn,hlin117/scikit-learn,f3r/scikit-learn,cwu2011/scikit-learn,mjudsp/Tsallis,lenovor/scikit-learn,cybernet14/scikit-learn,ChanChiChoi/scikit-learn,thilbern/scikit-learn,themrmax/scikit-learn,elkingtonmcb/scikit-learn,fabianp/scikit-learn,IndraVikas/scikit-learn,mojoboss/scikit-learn,mlyundin/scikit-learn,nhejazi/scikit-learn,xzh86/scikit-learn,anntzer/scikit-learn,mhue/scikit-learn,lucidfrontier45/scikit-learn,ZenDevelopmentSystems/scikit-learn,zorroblue/scikit-learn,Titan-C/scikit-learn,justincassidy/scikit-learn,shikhardb/scikit-learn,fabioticconi/scikit-learn,smartscheduling/scikit-learn-categorical-tree,carrillo/scikit-learn,cwu2011/scikit-learn,AnasGhrab/scikit-learn,IssamLaradji/scikit-learn,loli/semisupervisedforests,hsiaoyi0504/scikit-learn,vinayak-mehta/scikit-learn,bthirion/scikit-learn,AIML/scikit-learn,murali-munna/scikit-learn,cdegroc/scikit-learn,mhdella/scikit-learn,liangz0707/scikit-learn,terkkila/scikit-learn,Garrett-R/scikit-learn,bigdataelephants/scikit-learn,ndingwall/scikit-learn,mattilyra/scikit-learn,arahuja/scikit-learn,mehdidc/scikit-learn,madjelan/scikit-learn,loli/semisupervisedforests,samzhang111/scikit-learn,mfjb/scikit-learn,rvraghav93/scikit-learn,arabenjamin/scikit-learn,frank-tancf/scikit-learn,jmschrei/scikit-learn,rsivapr/scikit-learn,samuel1208/scikit-learn,henrykironde/scikit-learn,zuku1985/scikit-learn,jakobworldpeace/scikit-learn,jblackburne/scikit-learn,rvraghav93/scikit-learn,maheshakya/scikit-learn,ankurankan/scikit-learn,fengzhyuan/scikit-learn,AlexandreAbraham/scikit-learn,herilalaina/scikit-learn,hainm/scikit-learn,aabadie/scikit-learn,icdishb/scikit-learn,theoryno3/scikit-learn,jpautom/scikit-learn,andrewnc/scikit-learn,cainiaocome/scikit-learn,fabianp/scikit-learn,xubenben/scikit-learn,kylerbrown/scikit-learn,chrsrds/scikit-learn,treycausey/scikit-learn,bigdataelephants/scikit-learn,djgagne/scikit-learn,nesterione/scikit-learn,untom/scikit-learn,elkingtonmcb/scikit-learn,shahankhatch/scikit-learn,russel1237/scikit-learn,AlexandreAbraham/scikit-learn,zaxtax/scikit-learn,mjudsp/Tsallis,anurag313/scikit-learn,walterreade/scikit-learn,pythonvietnam/scikit-learn,lbishal/scikit-learn,Sentient07/scikit-learn,jjx02230808/project0223,RomainBrault/scikit-learn,tdhopper/scikit-learn,ldirer/scikit-learn,BiaDarkia/scikit-learn,Achuth17/scikit-learn,jakirkham/scikit-learn,Sentient07/scikit-learn,untom/scikit-learn,bnaul/scikit-learn,glemaitre/scikit-learn,victorbergelin/scikit-learn,massmutual/scikit-learn,shikhardb/scikit-learn,B3AU/waveTree,nrhine1/scikit-learn,fyffyt/scikit-learn,fredhusser/scikit-learn,NunoEdgarGub1/scikit-learn,TomDLT/scikit-learn,maheshakya/scikit-learn,AlexRobson/scikit-learn,shahankhatch/scikit-learn,Nyker510/scikit-learn,ngoix/OCRF,PatrickChrist/scikit-learn,pypot/scikit-learn,kmike/scikit-learn,scikit-learn/scikit-learn,MartinDelzant/scikit-learn,UNR-AERIAL/scikit-learn,nmayorov/scikit-learn,dsullivan7/scikit-learn,ahoyosid/scikit-learn,trungnt13/scikit-learn,anurag313/scikit-learn,arjoly/scikit-learn,rishikksh20/scikit-learn,lbishal/scikit-learn,Adai0808/scikit-learn,larsmans/scikit-learn,q1ang/scikit-learn,MartinSavc/scikit-learn,ltiao/scikit-learn,0asa/scikit-learn,zorojean/scikit-learn,robin-lai/scikit-learn,alexeyum/scikit-learn,IshankGulati/scikit-learn,scikit-learn/scikit-learn,akionakamura/scikit-learn,pkruskal/scikit-learn,dsullivan7/scikit-learn,clemkoa/scikit-learn,simon-pepin/scikit-learn,evgchz/scikit-learn,Aasmi/scikit-learn,robin-lai/scikit-learn,clemkoa/scikit-learn,LohithBlaze/scikit-learn,kevin-intel/scikit-learn,chrsrds/scikit-learn,xzh86/scikit-learn,kjung/scikit-learn,wazeerzulfikar/scikit-learn,macks22/scikit-learn,cwu2011/scikit-learn,pnedunuri/scikit-learn,dhruv13J/scikit-learn,dingocuster/scikit-learn,h2educ/scikit-learn,MohammedWasim/scikit-learn,ogrisel/scikit-learn,etkirsch/scikit-learn,kashif/scikit-learn,Nyker510/scikit-learn,Barmaley-exe/scikit-learn,ClimbsRocks/scikit-learn,harshaneelhg/scikit-learn,eg-zhang/scikit-learn,zorojean/scikit-learn,dhruv13J/scikit-learn,anirudhjayaraman/scikit-learn,herilalaina/scikit-learn,pkruskal/scikit-learn,Obus/scikit-learn,lin-credible/scikit-learn,ycaihua/scikit-learn,potash/scikit-learn,robbymeals/scikit-learn,vshtanko/scikit-learn,AnasGhrab/scikit-learn,olologin/scikit-learn,LohithBlaze/scikit-learn,terkkila/scikit-learn,kagayakidan/scikit-learn,maheshakya/scikit-learn,themrmax/scikit-learn,shangwuhencc/scikit-learn,elkingtonmcb/scikit-learn,jorik041/scikit-learn,marcocaccin/scikit-learn,idlead/scikit-learn,justincassidy/scikit-learn,pnedunuri/scikit-learn,ashhher3/scikit-learn,Titan-C/scikit-learn,lbishal/scikit-learn,liberatorqjw/scikit-learn,rrohan/scikit-learn,ChanderG/scikit-learn,ilyes14/scikit-learn,poryfly/scikit-learn,fbagirov/scikit-learn,raghavrv/scikit-learn,Djabbz/scikit-learn,nelson-liu/scikit-learn,zuku1985/scikit-learn,jereze/scikit-learn,ChanderG/scikit-learn,jayflo/scikit-learn,mjgrav2001/scikit-learn,AIML/scikit-learn,yunfeilu/scikit-learn,Djabbz/scikit-learn,robin-lai/scikit-learn,smartscheduling/scikit-learn-categorical-tree,raghavrv/scikit-learn,florian-f/sklearn,CVML/scikit-learn,mattilyra/scikit-learn,liyu1990/sklearn,massmutual/scikit-learn,anntzer/scikit-learn,zhenv5/scikit-learn,chrisburr/scikit-learn,procoder317/scikit-learn,mayblue9/scikit-learn,CforED/Machine-Learning,tosolveit/scikit-learn,fredhusser/scikit-learn,heli522/scikit-learn,q1ang/scikit-learn,khkaminska/scikit-learn,AIML/scikit-learn,h2educ/scikit-learn,TomDLT/scikit-learn,DSLituiev/scikit-learn,jmschrei/scikit-learn,untom/scikit-learn,mxjl620/scikit-learn,pianomania/scikit-learn,yyjiang/scikit-learn,yyjiang/scikit-learn,mwv/scikit-learn,mattilyra/scikit-learn,theoryno3/scikit-learn,nomadcube/scikit-learn,vermouthmjl/scikit-learn,Obus/scikit-learn,JosmanPS/scikit-learn,DonBeo/scikit-learn,f3r/scikit-learn,toastedcornflakes/scikit-learn,Obus/scikit-learn,nvoron23/scikit-learn,vshtanko/scikit-learn,florian-f/sklearn,beepee14/scikit-learn,fabioticconi/scikit-learn,joshloyal/scikit-learn,wlamond/scikit-learn,wanggang3333/scikit-learn,sarahgrogan/scikit-learn,alexsavio/scikit-learn,loli/sklearn-ensembletrees,PatrickOReilly/scikit-learn,aabadie/scikit-learn,qifeigit/scikit-learn,xuewei4d/scikit-learn,eickenberg/scikit-learn,zorojean/scikit-learn,jaidevd/scikit-learn,Adai0808/scikit-learn,CforED/Machine-Learning,manashmndl/scikit-learn,schets/scikit-learn,tomlof/scikit-learn,poryfly/scikit-learn,scikit-learn/scikit-learn,kmike/scikit-learn,LohithBlaze/scikit-learn,ephes/scikit-learn,herilalaina/scikit-learn,rohanp/scikit-learn,wlamond/scikit-learn,tomlof/scikit-learn,ClimbsRocks/scikit-learn,ngoix/OCRF,mhue/scikit-learn,ltiao/scikit-learn,appapantula/scikit-learn,krez13/scikit-learn,AnasGhrab/scikit-learn,PrashntS/scikit-learn,eickenberg/scikit-learn,vortex-ape/scikit-learn,macks22/scikit-learn,r-mart/scikit-learn,hsiaoyi0504/scikit-learn,wanggang3333/scikit-learn,dsullivan7/scikit-learn,Akshay0724/scikit-learn,huzq/scikit-learn,xyguo/scikit-learn,poryfly/scikit-learn,Akshay0724/scikit-learn,shusenl/scikit-learn,altairpearl/scikit-learn,AlexRobson/scikit-learn,sanketloke/scikit-learn,ivannz/scikit-learn,jjx02230808/project0223,xavierwu/scikit-learn,alexeyum/scikit-learn,0x0all/scikit-learn,mfjb/scikit-learn,lin-credible/scikit-learn,ahoyosid/scikit-learn,lbishal/scikit-learn,ZENGXH/scikit-learn,tosolveit/scikit-learn,hitszxp/scikit-learn,fzalkow/scikit-learn,jblackburne/scikit-learn,treycausey/scikit-learn,justincassidy/scikit-learn,rvraghav93/scikit-learn,adamgreenhall/scikit-learn,quheng/scikit-learn,xwolf12/scikit-learn,jmschrei/scikit-learn,ngoix/OCRF,PatrickOReilly/scikit-learn,carrillo/scikit-learn,mhdella/scikit-learn,glennq/scikit-learn,mblondel/scikit-learn,cybernet14/scikit-learn,NunoEdgarGub1/scikit-learn,billy-inn/scikit-learn,belltailjp/scikit-learn,krez13/scikit-learn,jlegendary/scikit-learn,jakirkham/scikit-learn,abhishekgahlot/scikit-learn,liyu1990/sklearn,andaag/scikit-learn,cainiaocome/scikit-learn,tomlof/scikit-learn,jorge2703/scikit-learn,rsivapr/scikit-learn,jlegendary/scikit-learn,f3r/scikit-learn,ivannz/scikit-learn,vybstat/scikit-learn,tdhopper/scikit-learn,OshynSong/scikit-learn,Lawrence-Liu/scikit-learn,aewhatley/scikit-learn,zorroblue/scikit-learn,aabadie/scikit-learn,ngoix/OCRF,florian-f/sklearn,sinhrks/scikit-learn,rexshihaoren/scikit-learn,shyamalschandra/scikit-learn,JsNoNo/scikit-learn,jmetzen/scikit-learn,trungnt13/scikit-learn,HolgerPeters/scikit-learn,kmike/scikit-learn,luo66/scikit-learn,nvoron23/scikit-learn,yanlend/scikit-learn,olologin/scikit-learn,Obus/scikit-learn,xavierwu/scikit-learn,jereze/scikit-learn,jseabold/scikit-learn,nmayorov/scikit-learn,dingocuster/scikit-learn,LiaoPan/scikit-learn,hsuantien/scikit-learn,loli/sklearn-ensembletrees,manhhomienbienthuy/scikit-learn,mwv/scikit-learn,mrshu/scikit-learn,saiwing-yeung/scikit-learn,shenzebang/scikit-learn,chrsrds/scikit-learn,voxlol/scikit-learn,belltailjp/scikit-learn,pkruskal/scikit-learn,sanketloke/scikit-learn,Achuth17/scikit-learn,rahul-c1/scikit-learn,michigraber/scikit-learn,massmutual/scikit-learn,0asa/scikit-learn,jpautom/scikit-learn,sarahgrogan/scikit-learn,depet/scikit-learn,ishanic/scikit-learn,nikitasingh981/scikit-learn,mhue/scikit-learn,walterreade/scikit-learn,costypetrisor/scikit-learn,jmschrei/scikit-learn,rajat1994/scikit-learn,glennq/scikit-learn,joshloyal/scikit-learn,MartinDelzant/scikit-learn,samzhang111/scikit-learn,arjoly/scikit-learn,samuel1208/scikit-learn,xuewei4d/scikit-learn,phdowling/scikit-learn,ky822/scikit-learn,xyguo/scikit-learn,terkkila/scikit-learn,Jimmy-Morzaria/scikit-learn,zihua/scikit-learn,RachitKansal/scikit-learn,abhishekgahlot/scikit-learn,untom/scikit-learn,carrillo/scikit-learn,liberatorqjw/scikit-learn,giorgiop/scikit-learn,ogrisel/scikit-learn,siutanwong/scikit-learn,plissonf/scikit-learn,tmhm/scikit-learn,PrashntS/scikit-learn,NunoEdgarGub1/scikit-learn,shenzebang/scikit-learn,Titan-C/scikit-learn,shenzebang/scikit-learn,beepee14/scikit-learn,r-mart/scikit-learn,billy-inn/scikit-learn,ycaihua/scikit-learn,kashif/scikit-learn,manashmndl/scikit-learn,spallavolu/scikit-learn,alvarofierroclavero/scikit-learn,Barmaley-exe/scikit-learn,procoder317/scikit-learn,meduz/scikit-learn,kevin-intel/scikit-learn,jseabold/scikit-learn,AlexRobson/scikit-learn,jjx02230808/project0223,depet/scikit-learn,fengzhyuan/scikit-learn,ChanChiChoi/scikit-learn,nhejazi/scikit-learn,RayMick/scikit-learn,meduz/scikit-learn,potash/scikit-learn,henridwyer/scikit-learn,shyamalschandra/scikit-learn,beepee14/scikit-learn,alexsavio/scikit-learn,dingocuster/scikit-learn,ndingwall/scikit-learn,RomainBrault/scikit-learn,lazywei/scikit-learn,plissonf/scikit-learn,Fireblend/scikit-learn,deepesch/scikit-learn,rahuldhote/scikit-learn,RayMick/scikit-learn,vigilv/scikit-learn,YinongLong/scikit-learn,ashhher3/scikit-learn,iismd17/scikit-learn,henridwyer/scikit-learn,equialgo/scikit-learn,jakobworldpeace/scikit-learn,rishikksh20/scikit-learn,ilyes14/scikit-learn,maheshakya/scikit-learn,larsmans/scikit-learn,jakobworldpeace/scikit-learn,Fireblend/scikit-learn,qifeigit/scikit-learn,lucidfrontier45/scikit-learn,hainm/scikit-learn,nesterione/scikit-learn,fredhusser/scikit-learn,moutai/scikit-learn,ycaihua/scikit-learn,trankmichael/scikit-learn,lazywei/scikit-learn,hugobowne/scikit-learn,fbagirov/scikit-learn,466152112/scikit-learn,vigilv/scikit-learn,aetilley/scikit-learn,hsiaoyi0504/scikit-learn,krez13/scikit-learn,roxyboy/scikit-learn,ZenDevelopmentSystems/scikit-learn,rahuldhote/scikit-learn,petosegan/scikit-learn,bthirion/scikit-learn,rrohan/scikit-learn,IndraVikas/scikit-learn,anirudhjayaraman/scikit-learn,IssamLaradji/scikit-learn,altairpearl/scikit-learn,mattgiguere/scikit-learn,giorgiop/scikit-learn,smartscheduling/scikit-learn-categorical-tree,mayblue9/scikit-learn,BiaDarkia/scikit-learn,davidgbe/scikit-learn,xiaoxiamii/scikit-learn,mayblue9/scikit-learn,mugizico/scikit-learn,IndraVikas/scikit-learn,bigdataelephants/scikit-learn,simon-pepin/scikit-learn,mlyundin/scikit-learn,Srisai85/scikit-learn,mjudsp/Tsallis,Myasuka/scikit-learn,jaidevd/scikit-learn,mhdella/scikit-learn,eg-zhang/scikit-learn,pypot/scikit-learn,ngoix/OCRF,Barmaley-exe/scikit-learn,AlexanderFabisch/scikit-learn,victorbergelin/scikit-learn,harshaneelhg/scikit-learn,mugizico/scikit-learn,Sentient07/scikit-learn,shikhardb/scikit-learn,liberatorqjw/scikit-learn,RomainBrault/scikit-learn,sonnyhu/scikit-learn,michigraber/scikit-learn,theoryno3/scikit-learn,dhruv13J/scikit-learn,lenovor/scikit-learn,pratapvardhan/scikit-learn,manhhomienbienthuy/scikit-learn,aewhatley/scikit-learn,mojoboss/scikit-learn,icdishb/scikit-learn,wlamond/scikit-learn,jlegendary/scikit-learn,andrewnc/scikit-learn,AIML/scikit-learn,MatthieuBizien/scikit-learn,lesteve/scikit-learn,rexshihaoren/scikit-learn,larsmans/scikit-learn,giorgiop/scikit-learn,ilo10/scikit-learn,PatrickChrist/scikit-learn,MartinDelzant/scikit-learn,hrjn/scikit-learn,xyguo/scikit-learn,jakirkham/scikit-learn,loli/semisupervisedforests,pianomania/scikit-learn,belltailjp/scikit-learn,yanlend/scikit-learn,thilbern/scikit-learn,henrykironde/scikit-learn,shangwuhencc/scikit-learn,siutanwong/scikit-learn,nikitasingh981/scikit-learn,betatim/scikit-learn,aminert/scikit-learn,espg/scikit-learn,devanshdalal/scikit-learn,Srisai85/scikit-learn,ZenDevelopmentSystems/scikit-learn,LohithBlaze/scikit-learn,treycausey/scikit-learn,liangz0707/scikit-learn,Adai0808/scikit-learn,Sentient07/scikit-learn,Myasuka/scikit-learn,3manuek/scikit-learn,glemaitre/scikit-learn,Barmaley-exe/scikit-learn,ltiao/scikit-learn,gclenaghan/scikit-learn,mehdidc/scikit-learn,cwu2011/scikit-learn,bthirion/scikit-learn,vinayak-mehta/scikit-learn,eg-zhang/scikit-learn,fengzhyuan/scikit-learn,NelisVerhoef/scikit-learn,ssaeger/scikit-learn,sarahgrogan/scikit-learn,abimannans/scikit-learn,quheng/scikit-learn,rajat1994/scikit-learn,stylianos-kampakis/scikit-learn,ngoix/OCRF,mayblue9/scikit-learn,andaag/scikit-learn,ephes/scikit-learn,jakirkham/scikit-learn,pv/scikit-learn,spallavolu/scikit-learn,ephes/scikit-learn,wzbozon/scikit-learn,larsmans/scikit-learn,nelson-liu/scikit-learn,JeanKossaifi/scikit-learn,Djabbz/scikit-learn,henridwyer/scikit-learn,xwolf12/scikit-learn,h2educ/scikit-learn,phdowling/scikit-learn,mjgrav2001/scikit-learn,RomainBrault/scikit-learn,mxjl620/scikit-learn,mhue/scikit-learn,mblondel/scikit-learn,zihua/scikit-learn,treycausey/scikit-learn,sgenoud/scikit-learn,pythonvietnam/scikit-learn,andrewnc/scikit-learn,shikhardb/scikit-learn,anntzer/scikit-learn,marcocaccin/scikit-learn,wzbozon/scikit-learn,mjgrav2001/scikit-learn,thilbern/scikit-learn,cainiaocome/scikit-learn,robbymeals/scikit-learn,iismd17/scikit-learn,ElDeveloper/scikit-learn,jkarnows/scikit-learn,alvarofierroclavero/scikit-learn,ChanChiChoi/scikit-learn,poryfly/scikit-learn,vermouthmjl/scikit-learn,jkarnows/scikit-learn,nomadcube/scikit-learn,jayflo/scikit-learn,hainm/scikit-learn,ChanChiChoi/scikit-learn,heli522/scikit-learn,mrshu/scikit-learn,quheng/scikit-learn,xubenben/scikit-learn,simon-pepin/scikit-learn,ankurankan/scikit-learn,arabenjamin/scikit-learn,kjung/scikit-learn,davidgbe/scikit-learn,icdishb/scikit-learn,MatthieuBizien/scikit-learn,hrjn/scikit-learn,anirudhjayaraman/scikit-learn,lenovor/scikit-learn,Windy-Ground/scikit-learn,arahuja/scikit-learn,sumspr/scikit-learn,thilbern/scikit-learn,hsuantien/scikit-learn,zhenv5/scikit-learn,ahoyosid/scikit-learn,thientu/scikit-learn,Vimos/scikit-learn,mlyundin/scikit-learn,alvarofierroclavero/scikit-learn,jkarnows/scikit-learn,dsquareindia/scikit-learn,Myasuka/scikit-learn,vinayak-mehta/scikit-learn,trankmichael/scikit-learn,liyu1990/sklearn,smartscheduling/scikit-learn-categorical-tree,justincassidy/scikit-learn,466152112/scikit-learn,meduz/scikit-learn,alexsavio/scikit-learn,voxlol/scikit-learn,ilo10/scikit-learn,ndingwall/scikit-learn,jm-begon/scikit-learn,appapantula/scikit-learn,nesterione/scikit-learn,B3AU/waveTree,MohammedWasim/scikit-learn,roxyboy/scikit-learn,robin-lai/scikit-learn,zorojean/scikit-learn,thientu/scikit-learn,vshtanko/scikit-learn,jakobworldpeace/scikit-learn,tmhm/scikit-learn,imaculate/scikit-learn,Akshay0724/scikit-learn,MechCoder/scikit-learn,AlexRobson/scikit-learn,B3AU/waveTree,3manuek/scikit-learn,JsNoNo/scikit-learn,jblackburne/scikit-learn,wazeerzulfikar/scikit-learn,costypetrisor/scikit-learn,DonBeo/scikit-learn,Jimmy-Morzaria/scikit-learn,tawsifkhan/scikit-learn,aminert/scikit-learn,kylerbrown/scikit-learn,Achuth17/scikit-learn,ankurankan/scikit-learn,LiaoPan/scikit-learn,kmike/scikit-learn,btabibian/scikit-learn,vibhorag/scikit-learn,schets/scikit-learn,kaichogami/scikit-learn,pianomania/scikit-learn,nesterione/scikit-learn,YinongLong/scikit-learn,Vimos/scikit-learn,h2educ/scikit-learn,nelson-liu/scikit-learn,Fireblend/scikit-learn,tawsifkhan/scikit-learn,giorgiop/scikit-learn,mhdella/scikit-learn,florian-f/sklearn,glouppe/scikit-learn,ilyes14/scikit-learn,samuel1208/scikit-learn,kagayakidan/scikit-learn,abhishekkrthakur/scikit-learn,loli/sklearn-ensembletrees,tdhopper/scikit-learn,vigilv/scikit-learn,mjudsp/Tsallis,samuel1208/scikit-learn,glemaitre/scikit-learn,vigilv/scikit-learn,shahankhatch/scikit-learn,sumspr/scikit-learn,vermouthmjl/scikit-learn,ominux/scikit-learn,gclenaghan/scikit-learn,wanggang3333/scikit-learn,vybstat/scikit-learn,yonglehou/scikit-learn,themrmax/scikit-learn,roxyboy/scikit-learn,gotomypc/scikit-learn,Garrett-R/scikit-learn,xuewei4d/scikit-learn,harshaneelhg/scikit-learn,iismd17/scikit-learn,liangz0707/scikit-learn,Clyde-fare/scikit-learn,arahuja/scikit-learn,joshloyal/scikit-learn,pypot/scikit-learn,arahuja/scikit-learn,mattgiguere/scikit-learn,chrisburr/scikit-learn,hlin117/scikit-learn,PatrickChrist/scikit-learn,MechCoder/scikit-learn,yunfeilu/scikit-learn,ChanderG/scikit-learn,bigdataelephants/scikit-learn,waterponey/scikit-learn,JPFrancoia/scikit-learn,amueller/scikit-learn,jereze/scikit-learn,0x0all/scikit-learn,mikebenfield/scikit-learn,Achuth17/scikit-learn,zuku1985/scikit-learn,RayMick/scikit-learn,lazywei/scikit-learn,sanketloke/scikit-learn,3manuek/scikit-learn,sinhrks/scikit-learn,sergeyf/scikit-learn,plissonf/scikit-learn,YinongLong/scikit-learn,sonnyhu/scikit-learn,chrisburr/scikit-learn,larsmans/scikit-learn,3manuek/scikit-learn,pv/scikit-learn,yyjiang/scikit-learn,NelisVerhoef/scikit-learn,russel1237/scikit-learn,nrhine1/scikit-learn,fyffyt/scikit-learn,rexshihaoren/scikit-learn,moutai/scikit-learn,evgchz/scikit-learn,manhhomienbienthuy/scikit-learn,Clyde-fare/scikit-learn,lucidfrontier45/scikit-learn,shusenl/scikit-learn,andaag/scikit-learn,manhhomienbienthuy/scikit-learn,arabenjamin/scikit-learn,cauchycui/scikit-learn,CVML/scikit-learn,espg/scikit-learn,eickenberg/scikit-learn,zaxtax/scikit-learn,scikit-learn/scikit-learn,ningchi/scikit-learn,xiaoxiamii/scikit-learn,ominux/scikit-learn,bikong2/scikit-learn,lenovor/scikit-learn,NunoEdgarGub1/scikit-learn,shusenl/scikit-learn,ankurankan/scikit-learn,yyjiang/scikit-learn,jorge2703/scikit-learn,jmetzen/scikit-learn,mattilyra/scikit-learn,MartinSavc/scikit-learn,lesteve/scikit-learn,kaichogami/scikit-learn,cl4rke/scikit-learn,sarahgrogan/scikit-learn,vibhorag/scikit-learn,kevin-intel/scikit-learn,btabibian/scikit-learn,Titan-C/scikit-learn,ElDeveloper/scikit-learn,hsuantien/scikit-learn,arjoly/scikit-learn,bikong2/scikit-learn,RPGOne/scikit-learn,wzbozon/scikit-learn,hsuantien/scikit-learn,NelisVerhoef/scikit-learn,yonglehou/scikit-learn,UNR-AERIAL/scikit-learn,devanshdalal/scikit-learn,Windy-Ground/scikit-learn,hugobowne/scikit-learn,jzt5132/scikit-learn,aetilley/scikit-learn,stylianos-kampakis/scikit-learn,mrshu/scikit-learn,sergeyf/scikit-learn,fabianp/scikit-learn,AlexandreAbraham/scikit-learn,hitszxp/scikit-learn,HolgerPeters/scikit-learn,Aasmi/scikit-learn,CforED/Machine-Learning,etkirsch/scikit-learn,aetilley/scikit-learn,hitszxp/scikit-learn,RPGOne/scikit-learn,adamgreenhall/scikit-learn,spallavolu/scikit-learn,theoryno3/scikit-learn,chrsrds/scikit-learn,ZENGXH/scikit-learn,vivekmishra1991/scikit-learn,amueller/scikit-learn,fabioticconi/scikit-learn,AlexandreAbraham/scikit-learn,idlead/scikit-learn,Jimmy-Morzaria/scikit-learn,altairpearl/scikit-learn,robbymeals/scikit-learn,spallavolu/scikit-learn,sinhrks/scikit-learn,ivannz/scikit-learn,nikitasingh981/scikit-learn,xwolf12/scikit-learn,fredhusser/scikit-learn,mikebenfield/scikit-learn,alexsavio/scikit-learn,shyamalschandra/scikit-learn,ssaeger/scikit-learn,r-mart/scikit-learn,shyamalschandra/scikit-learn,khkaminska/scikit-learn,jorik041/scikit-learn,loli/sklearn-ensembletrees,trankmichael/scikit-learn,kashif/scikit-learn,deepesch/scikit-learn,huzq/scikit-learn,mattgiguere/scikit-learn,toastedcornflakes/scikit-learn,bhargav/scikit-learn,MohammedWasim/scikit-learn,jseabold/scikit-learn,fabianp/scikit-learn,xzh86/scikit-learn,cybernet14/scikit-learn,costypetrisor/scikit-learn,mikebenfield/scikit-learn,macks22/scikit-learn,loli/semisupervisedforests,phdowling/scikit-learn,anntzer/scikit-learn,maheshakya/scikit-learn,saiwing-yeung/scikit-learn,ldirer/scikit-learn,lesteve/scikit-learn,ElDeveloper/scikit-learn,deepesch/scikit-learn,RPGOne/scikit-learn,jzt5132/scikit-learn,ky822/scikit-learn,xyguo/scikit-learn,vibhorag/scikit-learn,gclenaghan/scikit-learn,nmayorov/scikit-learn,Windy-Ground/scikit-learn,treycausey/scikit-learn,herilalaina/scikit-learn,manashmndl/scikit-learn,Adai0808/scikit-learn,heli522/scikit-learn,zihua/scikit-learn,jmetzen/scikit-learn,shangwuhencc/scikit-learn,glouppe/scikit-learn,mwv/scikit-learn,xavierwu/scikit-learn,rishikksh20/scikit-learn,IssamLaradji/scikit-learn,jm-begon/scikit-learn,DSLituiev/scikit-learn,victorbergelin/scikit-learn,sonnyhu/scikit-learn,pypot/scikit-learn,akionakamura/scikit-learn,ashhher3/scikit-learn,bnaul/scikit-learn,PatrickChrist/scikit-learn,MechCoder/scikit-learn,lazywei/scikit-learn,robbymeals/scikit-learn,hrjn/scikit-learn,ningchi/scikit-learn,RayMick/scikit-learn,zorroblue/scikit-learn,dsquareindia/scikit-learn,tdhopper/scikit-learn,Srisai85/scikit-learn,madjelan/scikit-learn,JPFrancoia/scikit-learn,glennq/scikit-learn,raghavrv/scikit-learn,alexeyum/scikit-learn,sgenoud/scikit-learn,evgchz/scikit-learn,pkruskal/scikit-learn,CVML/scikit-learn,joernhees/scikit-learn,toastedcornflakes/scikit-learn,vortex-ape/scikit-learn,henrykironde/scikit-learn,mehdidc/scikit-learn,chrisburr/scikit-learn,etkirsch/scikit-learn,ClimbsRocks/scikit-learn,wanggang3333/scikit-learn,idlead/scikit-learn,yanlend/scikit-learn,xiaoxiamii/scikit-learn,waterponey/scikit-learn,aflaxman/scikit-learn,tosolveit/scikit-learn,kjung/scikit-learn,ishanic/scikit-learn,appapantula/scikit-learn,sumspr/scikit-learn,Lawrence-Liu/scikit-learn,olologin/scikit-learn,liyu1990/sklearn,aminert/scikit-learn,madjelan/scikit-learn,akionakamura/scikit-learn,jm-begon/scikit-learn,JeanKossaifi/scikit-learn,Myasuka/scikit-learn,nhejazi/scikit-learn,rsivapr/scikit-learn,anurag313/scikit-learn,djgagne/scikit-learn,wazeerzulfikar/scikit-learn,kaichogami/scikit-learn,tomlof/scikit-learn,evgchz/scikit-learn,joernhees/scikit-learn,petosegan/scikit-learn,mugizico/scikit-learn,lesteve/scikit-learn,fengzhyuan/scikit-learn,quheng/scikit-learn,tawsifkhan/scikit-learn,MartinSavc/scikit-learn,stylianos-kampakis/scikit-learn,glennq/scikit-learn,mugizico/scikit-learn,glemaitre/scikit-learn,florian-f/sklearn,cl4rke/scikit-learn,evgchz/scikit-learn,cl4rke/scikit-learn,davidgbe/scikit-learn,frank-tancf/scikit-learn,mxjl620/scikit-learn,PatrickOReilly/scikit-learn,anirudhjayaraman/scikit-learn,Garrett-R/scikit-learn,jaidevd/scikit-learn,mjgrav2001/scikit-learn,DSLituiev/scikit-learn,victorbergelin/scikit-learn,trungnt13/scikit-learn,0asa/scikit-learn,vybstat/scikit-learn,rajat1994/scikit-learn,rahuldhote/scikit-learn,pratapvardhan/scikit-learn,henridwyer/scikit-learn,appapantula/scikit-learn,gotomypc/scikit-learn,meduz/scikit-learn,mehdidc/scikit-learn,jlegendary/scikit-learn,moutai/scikit-learn,lin-credible/scikit-learn,ycaihua/scikit-learn,equialgo/scikit-learn,Garrett-R/scikit-learn,pratapvardhan/scikit-learn,HolgerPeters/scikit-learn,jereze/scikit-learn,siutanwong/scikit-learn,alexeyum/scikit-learn,roxyboy/scikit-learn,Srisai85/scikit-learn,ilo10/scikit-learn,thientu/scikit-learn,djgagne/scikit-learn,billy-inn/scikit-learn,zihua/scikit-learn,clemkoa/scikit-learn,0asa/scikit-learn,JosmanPS/scikit-learn,xwolf12/scikit-learn,rsivapr/scikit-learn,liangz0707/scikit-learn,nrhine1/scikit-learn,MartinSavc/scikit-learn,joernhees/scikit-learn,jorik041/scikit-learn,hitszxp/scikit-learn,nomadcube/scikit-learn,jblackburne/scikit-learn,sgenoud/scikit-learn,sergeyf/scikit-learn,sumspr/scikit-learn,AnasGhrab/scikit-learn,Lawrence-Liu/scikit-learn,jm-begon/scikit-learn,RPGOne/scikit-learn,themrmax/scikit-learn,aflaxman/scikit-learn,depet/scikit-learn,pnedunuri/scikit-learn,eickenberg/scikit-learn,PatrickOReilly/scikit-learn,bnaul/scikit-learn,abhishekkrthakur/scikit-learn,RachitKansal/scikit-learn,cauchycui/scikit-learn,harshaneelhg/scikit-learn,aflaxman/scikit-learn,ZenDevelopmentSystems/scikit-learn,Vimos/scikit-learn,JPFrancoia/scikit-learn,ishanic/scikit-learn,samzhang111/scikit-learn,zaxtax/scikit-learn,abhishekkrthakur/scikit-learn,mrshu/scikit-learn,imaculate/scikit-learn,huobaowangxi/scikit-learn,potash/scikit-learn,CVML/scikit-learn,pythonvietnam/scikit-learn,Akshay0724/scikit-learn,abhishekgahlot/scikit-learn,ahoyosid/scikit-learn,pompiduskus/scikit-learn,r-mart/scikit-learn,shenzebang/scikit-learn,cybernet14/scikit-learn,frank-tancf/scikit-learn,gotomypc/scikit-learn,Clyde-fare/scikit-learn,kylerbrown/scikit-learn,rsivapr/scikit-learn,Clyde-fare/scikit-learn,mxjl620/scikit-learn,madjelan/scikit-learn,idlead/scikit-learn,moutai/scikit-learn
|
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('learn',parent_package,top_path)
config.add_subpackage('datasets')
config.add_subpackage('common')
config.add_subpackage('machine')
config.add_subpackage('utils')
return config
if __name__ == '__main__':
from numpy.distutils.core import setup
setup(**configuration(top_path='').todict())
Remove references to deleted submodule common/
From: Fabian Pedregosa <fabian.pedregosa@inria.fr>
git-svn-id: a2d1b0e147e530765aaf3e1662d4a98e2f63c719@384 22fbfee3-77ab-4535-9bad-27d1bd3bc7d8
|
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('learn',parent_package,top_path)
config.add_subpackage('datasets')
config.add_subpackage('machine')
config.add_subpackage('utils')
return config
if __name__ == '__main__':
from numpy.distutils.core import setup
setup(**configuration(top_path='').todict())
|
<commit_before>def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('learn',parent_package,top_path)
config.add_subpackage('datasets')
config.add_subpackage('common')
config.add_subpackage('machine')
config.add_subpackage('utils')
return config
if __name__ == '__main__':
from numpy.distutils.core import setup
setup(**configuration(top_path='').todict())
<commit_msg>Remove references to deleted submodule common/
From: Fabian Pedregosa <fabian.pedregosa@inria.fr>
git-svn-id: a2d1b0e147e530765aaf3e1662d4a98e2f63c719@384 22fbfee3-77ab-4535-9bad-27d1bd3bc7d8<commit_after>
|
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('learn',parent_package,top_path)
config.add_subpackage('datasets')
config.add_subpackage('machine')
config.add_subpackage('utils')
return config
if __name__ == '__main__':
from numpy.distutils.core import setup
setup(**configuration(top_path='').todict())
|
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('learn',parent_package,top_path)
config.add_subpackage('datasets')
config.add_subpackage('common')
config.add_subpackage('machine')
config.add_subpackage('utils')
return config
if __name__ == '__main__':
from numpy.distutils.core import setup
setup(**configuration(top_path='').todict())
Remove references to deleted submodule common/
From: Fabian Pedregosa <fabian.pedregosa@inria.fr>
git-svn-id: a2d1b0e147e530765aaf3e1662d4a98e2f63c719@384 22fbfee3-77ab-4535-9bad-27d1bd3bc7d8def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('learn',parent_package,top_path)
config.add_subpackage('datasets')
config.add_subpackage('machine')
config.add_subpackage('utils')
return config
if __name__ == '__main__':
from numpy.distutils.core import setup
setup(**configuration(top_path='').todict())
|
<commit_before>def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('learn',parent_package,top_path)
config.add_subpackage('datasets')
config.add_subpackage('common')
config.add_subpackage('machine')
config.add_subpackage('utils')
return config
if __name__ == '__main__':
from numpy.distutils.core import setup
setup(**configuration(top_path='').todict())
<commit_msg>Remove references to deleted submodule common/
From: Fabian Pedregosa <fabian.pedregosa@inria.fr>
git-svn-id: a2d1b0e147e530765aaf3e1662d4a98e2f63c719@384 22fbfee3-77ab-4535-9bad-27d1bd3bc7d8<commit_after>def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('learn',parent_package,top_path)
config.add_subpackage('datasets')
config.add_subpackage('machine')
config.add_subpackage('utils')
return config
if __name__ == '__main__':
from numpy.distutils.core import setup
setup(**configuration(top_path='').todict())
|
6d09970db6a10a156977687612c0d8b65456c559
|
mysite/deployment_settings.py
|
mysite/deployment_settings.py
|
from settings import *
OHLOH_API_KEY='SXvLaGPJFaKXQC0VOocAg'
DEBUG=False
ADMINS=[
('Everybody at OpenHatch', 'all@openhatch.org'),
]
INVITE_MODE=False # Suckas, invite codes are disabled everywarez
INVITATIONS_PER_USER=20
TEMPLATE_DEBUG=False
EMAIL_SUBJECT_PREFIX='[Kaboom@OH] '
SEND_BROKEN_LINK_EMAILS=True
MANAGERS=ADMINS
SERVER_EMAIL='mr_website@linode.openhatch.org'
CACHE_BACKEND = "memcached://127.0.0.1:11211/?timeout=1"
POSTFIX_FORWARDER_TABLE_PATH = '/etc/postfix/virtual_alias_maps'
CELERY_ALWAYS_EAGER = False # srsly
CARROT_BACKEND = 'amqp'
## Django search via Haystack
HAYSTACK_SITECONF='mysite.haystack_configuration'
HAYSTACK_SEARCH_ENGINE='solr'
HAYSTACK_SOLR_URL='http://173.230.128.217:8983/solr/'
try:
from deployment_settings_secret_keys import GOOGLE_ANALYTICS_CODE
except ImportError:
pass
|
from settings import *
OHLOH_API_KEY='SXvLaGPJFaKXQC0VOocAg'
DEBUG=False
ADMINS=[
('Everybody at OpenHatch', 'all@openhatch.org'),
]
INVITE_MODE=False # Suckas, invite codes are disabled everywarez
INVITATIONS_PER_USER=20
TEMPLATE_DEBUG=False
EMAIL_SUBJECT_PREFIX='[Kaboom@OH] '
SEND_BROKEN_LINK_EMAILS=True
MANAGERS=ADMINS
SERVER_EMAIL='mr_website@linode.openhatch.org'
CACHE_BACKEND = "memcached://127.0.0.1:11211/?timeout=1"
POSTFIX_FORWARDER_TABLE_PATH = '/etc/postfix/virtual_alias_maps'
CELERY_ALWAYS_EAGER = False # srsly
CARROT_BACKEND = 'amqp'
## Django search via Haystack
HAYSTACK_SITECONF='mysite.haystack_configuration'
HAYSTACK_SEARCH_ENGINE='solr'
HAYSTACK_SOLR_URL='http://173.230.128.217:8983/solr'
try:
from deployment_settings_secret_keys import GOOGLE_ANALYTICS_CODE
except ImportError:
pass
|
Remove trailing slash that was causing problems.
|
Remove trailing slash that was causing problems.
|
Python
|
agpl-3.0
|
eeshangarg/oh-mainline,sudheesh001/oh-mainline,willingc/oh-mainline,SnappleCap/oh-mainline,moijes12/oh-mainline,mzdaniel/oh-mainline,SnappleCap/oh-mainline,ehashman/oh-mainline,openhatch/oh-mainline,moijes12/oh-mainline,Changaco/oh-mainline,ojengwa/oh-mainline,vipul-sharma20/oh-mainline,vipul-sharma20/oh-mainline,onceuponatimeforever/oh-mainline,ehashman/oh-mainline,campbe13/openhatch,mzdaniel/oh-mainline,nirmeshk/oh-mainline,nirmeshk/oh-mainline,waseem18/oh-mainline,vipul-sharma20/oh-mainline,waseem18/oh-mainline,mzdaniel/oh-mainline,moijes12/oh-mainline,ojengwa/oh-mainline,campbe13/openhatch,heeraj123/oh-mainline,ojengwa/oh-mainline,moijes12/oh-mainline,ehashman/oh-mainline,vipul-sharma20/oh-mainline,moijes12/oh-mainline,willingc/oh-mainline,heeraj123/oh-mainline,sudheesh001/oh-mainline,ojengwa/oh-mainline,ojengwa/oh-mainline,onceuponatimeforever/oh-mainline,SnappleCap/oh-mainline,eeshangarg/oh-mainline,willingc/oh-mainline,vipul-sharma20/oh-mainline,ehashman/oh-mainline,openhatch/oh-mainline,openhatch/oh-mainline,jledbetter/openhatch,sudheesh001/oh-mainline,nirmeshk/oh-mainline,waseem18/oh-mainline,mzdaniel/oh-mainline,onceuponatimeforever/oh-mainline,jledbetter/openhatch,Changaco/oh-mainline,heeraj123/oh-mainline,heeraj123/oh-mainline,mzdaniel/oh-mainline,mzdaniel/oh-mainline,campbe13/openhatch,sudheesh001/oh-mainline,waseem18/oh-mainline,campbe13/openhatch,jledbetter/openhatch,openhatch/oh-mainline,eeshangarg/oh-mainline,heeraj123/oh-mainline,sudheesh001/oh-mainline,onceuponatimeforever/oh-mainline,eeshangarg/oh-mainline,jledbetter/openhatch,campbe13/openhatch,Changaco/oh-mainline,ehashman/oh-mainline,SnappleCap/oh-mainline,Changaco/oh-mainline,waseem18/oh-mainline,SnappleCap/oh-mainline,onceuponatimeforever/oh-mainline,openhatch/oh-mainline,willingc/oh-mainline,eeshangarg/oh-mainline,nirmeshk/oh-mainline,mzdaniel/oh-mainline,nirmeshk/oh-mainline,willingc/oh-mainline,jledbetter/openhatch,Changaco/oh-mainline
|
from settings import *
OHLOH_API_KEY='SXvLaGPJFaKXQC0VOocAg'
DEBUG=False
ADMINS=[
('Everybody at OpenHatch', 'all@openhatch.org'),
]
INVITE_MODE=False # Suckas, invite codes are disabled everywarez
INVITATIONS_PER_USER=20
TEMPLATE_DEBUG=False
EMAIL_SUBJECT_PREFIX='[Kaboom@OH] '
SEND_BROKEN_LINK_EMAILS=True
MANAGERS=ADMINS
SERVER_EMAIL='mr_website@linode.openhatch.org'
CACHE_BACKEND = "memcached://127.0.0.1:11211/?timeout=1"
POSTFIX_FORWARDER_TABLE_PATH = '/etc/postfix/virtual_alias_maps'
CELERY_ALWAYS_EAGER = False # srsly
CARROT_BACKEND = 'amqp'
## Django search via Haystack
HAYSTACK_SITECONF='mysite.haystack_configuration'
HAYSTACK_SEARCH_ENGINE='solr'
HAYSTACK_SOLR_URL='http://173.230.128.217:8983/solr/'
try:
from deployment_settings_secret_keys import GOOGLE_ANALYTICS_CODE
except ImportError:
pass
Remove trailing slash that was causing problems.
|
from settings import *
OHLOH_API_KEY='SXvLaGPJFaKXQC0VOocAg'
DEBUG=False
ADMINS=[
('Everybody at OpenHatch', 'all@openhatch.org'),
]
INVITE_MODE=False # Suckas, invite codes are disabled everywarez
INVITATIONS_PER_USER=20
TEMPLATE_DEBUG=False
EMAIL_SUBJECT_PREFIX='[Kaboom@OH] '
SEND_BROKEN_LINK_EMAILS=True
MANAGERS=ADMINS
SERVER_EMAIL='mr_website@linode.openhatch.org'
CACHE_BACKEND = "memcached://127.0.0.1:11211/?timeout=1"
POSTFIX_FORWARDER_TABLE_PATH = '/etc/postfix/virtual_alias_maps'
CELERY_ALWAYS_EAGER = False # srsly
CARROT_BACKEND = 'amqp'
## Django search via Haystack
HAYSTACK_SITECONF='mysite.haystack_configuration'
HAYSTACK_SEARCH_ENGINE='solr'
HAYSTACK_SOLR_URL='http://173.230.128.217:8983/solr'
try:
from deployment_settings_secret_keys import GOOGLE_ANALYTICS_CODE
except ImportError:
pass
|
<commit_before>from settings import *
OHLOH_API_KEY='SXvLaGPJFaKXQC0VOocAg'
DEBUG=False
ADMINS=[
('Everybody at OpenHatch', 'all@openhatch.org'),
]
INVITE_MODE=False # Suckas, invite codes are disabled everywarez
INVITATIONS_PER_USER=20
TEMPLATE_DEBUG=False
EMAIL_SUBJECT_PREFIX='[Kaboom@OH] '
SEND_BROKEN_LINK_EMAILS=True
MANAGERS=ADMINS
SERVER_EMAIL='mr_website@linode.openhatch.org'
CACHE_BACKEND = "memcached://127.0.0.1:11211/?timeout=1"
POSTFIX_FORWARDER_TABLE_PATH = '/etc/postfix/virtual_alias_maps'
CELERY_ALWAYS_EAGER = False # srsly
CARROT_BACKEND = 'amqp'
## Django search via Haystack
HAYSTACK_SITECONF='mysite.haystack_configuration'
HAYSTACK_SEARCH_ENGINE='solr'
HAYSTACK_SOLR_URL='http://173.230.128.217:8983/solr/'
try:
from deployment_settings_secret_keys import GOOGLE_ANALYTICS_CODE
except ImportError:
pass
<commit_msg>Remove trailing slash that was causing problems.<commit_after>
|
from settings import *
OHLOH_API_KEY='SXvLaGPJFaKXQC0VOocAg'
DEBUG=False
ADMINS=[
('Everybody at OpenHatch', 'all@openhatch.org'),
]
INVITE_MODE=False # Suckas, invite codes are disabled everywarez
INVITATIONS_PER_USER=20
TEMPLATE_DEBUG=False
EMAIL_SUBJECT_PREFIX='[Kaboom@OH] '
SEND_BROKEN_LINK_EMAILS=True
MANAGERS=ADMINS
SERVER_EMAIL='mr_website@linode.openhatch.org'
CACHE_BACKEND = "memcached://127.0.0.1:11211/?timeout=1"
POSTFIX_FORWARDER_TABLE_PATH = '/etc/postfix/virtual_alias_maps'
CELERY_ALWAYS_EAGER = False # srsly
CARROT_BACKEND = 'amqp'
## Django search via Haystack
HAYSTACK_SITECONF='mysite.haystack_configuration'
HAYSTACK_SEARCH_ENGINE='solr'
HAYSTACK_SOLR_URL='http://173.230.128.217:8983/solr'
try:
from deployment_settings_secret_keys import GOOGLE_ANALYTICS_CODE
except ImportError:
pass
|
from settings import *
OHLOH_API_KEY='SXvLaGPJFaKXQC0VOocAg'
DEBUG=False
ADMINS=[
('Everybody at OpenHatch', 'all@openhatch.org'),
]
INVITE_MODE=False # Suckas, invite codes are disabled everywarez
INVITATIONS_PER_USER=20
TEMPLATE_DEBUG=False
EMAIL_SUBJECT_PREFIX='[Kaboom@OH] '
SEND_BROKEN_LINK_EMAILS=True
MANAGERS=ADMINS
SERVER_EMAIL='mr_website@linode.openhatch.org'
CACHE_BACKEND = "memcached://127.0.0.1:11211/?timeout=1"
POSTFIX_FORWARDER_TABLE_PATH = '/etc/postfix/virtual_alias_maps'
CELERY_ALWAYS_EAGER = False # srsly
CARROT_BACKEND = 'amqp'
## Django search via Haystack
HAYSTACK_SITECONF='mysite.haystack_configuration'
HAYSTACK_SEARCH_ENGINE='solr'
HAYSTACK_SOLR_URL='http://173.230.128.217:8983/solr/'
try:
from deployment_settings_secret_keys import GOOGLE_ANALYTICS_CODE
except ImportError:
pass
Remove trailing slash that was causing problems.from settings import *
OHLOH_API_KEY='SXvLaGPJFaKXQC0VOocAg'
DEBUG=False
ADMINS=[
('Everybody at OpenHatch', 'all@openhatch.org'),
]
INVITE_MODE=False # Suckas, invite codes are disabled everywarez
INVITATIONS_PER_USER=20
TEMPLATE_DEBUG=False
EMAIL_SUBJECT_PREFIX='[Kaboom@OH] '
SEND_BROKEN_LINK_EMAILS=True
MANAGERS=ADMINS
SERVER_EMAIL='mr_website@linode.openhatch.org'
CACHE_BACKEND = "memcached://127.0.0.1:11211/?timeout=1"
POSTFIX_FORWARDER_TABLE_PATH = '/etc/postfix/virtual_alias_maps'
CELERY_ALWAYS_EAGER = False # srsly
CARROT_BACKEND = 'amqp'
## Django search via Haystack
HAYSTACK_SITECONF='mysite.haystack_configuration'
HAYSTACK_SEARCH_ENGINE='solr'
HAYSTACK_SOLR_URL='http://173.230.128.217:8983/solr'
try:
from deployment_settings_secret_keys import GOOGLE_ANALYTICS_CODE
except ImportError:
pass
|
<commit_before>from settings import *
OHLOH_API_KEY='SXvLaGPJFaKXQC0VOocAg'
DEBUG=False
ADMINS=[
('Everybody at OpenHatch', 'all@openhatch.org'),
]
INVITE_MODE=False # Suckas, invite codes are disabled everywarez
INVITATIONS_PER_USER=20
TEMPLATE_DEBUG=False
EMAIL_SUBJECT_PREFIX='[Kaboom@OH] '
SEND_BROKEN_LINK_EMAILS=True
MANAGERS=ADMINS
SERVER_EMAIL='mr_website@linode.openhatch.org'
CACHE_BACKEND = "memcached://127.0.0.1:11211/?timeout=1"
POSTFIX_FORWARDER_TABLE_PATH = '/etc/postfix/virtual_alias_maps'
CELERY_ALWAYS_EAGER = False # srsly
CARROT_BACKEND = 'amqp'
## Django search via Haystack
HAYSTACK_SITECONF='mysite.haystack_configuration'
HAYSTACK_SEARCH_ENGINE='solr'
HAYSTACK_SOLR_URL='http://173.230.128.217:8983/solr/'
try:
from deployment_settings_secret_keys import GOOGLE_ANALYTICS_CODE
except ImportError:
pass
<commit_msg>Remove trailing slash that was causing problems.<commit_after>from settings import *
OHLOH_API_KEY='SXvLaGPJFaKXQC0VOocAg'
DEBUG=False
ADMINS=[
('Everybody at OpenHatch', 'all@openhatch.org'),
]
INVITE_MODE=False # Suckas, invite codes are disabled everywarez
INVITATIONS_PER_USER=20
TEMPLATE_DEBUG=False
EMAIL_SUBJECT_PREFIX='[Kaboom@OH] '
SEND_BROKEN_LINK_EMAILS=True
MANAGERS=ADMINS
SERVER_EMAIL='mr_website@linode.openhatch.org'
CACHE_BACKEND = "memcached://127.0.0.1:11211/?timeout=1"
POSTFIX_FORWARDER_TABLE_PATH = '/etc/postfix/virtual_alias_maps'
CELERY_ALWAYS_EAGER = False # srsly
CARROT_BACKEND = 'amqp'
## Django search via Haystack
HAYSTACK_SITECONF='mysite.haystack_configuration'
HAYSTACK_SEARCH_ENGINE='solr'
HAYSTACK_SOLR_URL='http://173.230.128.217:8983/solr'
try:
from deployment_settings_secret_keys import GOOGLE_ANALYTICS_CODE
except ImportError:
pass
|
c3520c1c1802f903af829da5470fa14d1a1d5354
|
src/c2w2c.py
|
src/c2w2c.py
|
from models import C2W, LanguageModel, W2C
from util import load_training_data
from keras.models import Model
from keras.layers import TimeDistributed, Input, Activation
N_batch = 50
N_ctx = 10
d_C = 150
d_W = 50
d_Wi = 150
training_data = load_training_data('data/training.txt')
V_C = training_data.V_C
V_W = training_data.V_W
# The actual C2W2C model
input = Input(shape=(None, V_W.dim[1]), dtype='int32')
W_ctx = TimeDistributed(C2W(V_C=V_C, V_W=V_W, d_C=d_C, d_W=d_W, d_Wi=d_Wi))(input)
w_np1 = LanguageModel(d_W, state_seq=False)(W_ctx)
output = W2C(V_C=V_C, V_W=V_W, d_W=d_W, d_C=d_C)(w_np1)
c2w2c = Model(input=input, output=Activation('softmax')(output))
print 'Compiling model...'
c2w2c.compile(optimizer='adam', loss='categorical_crossentropy')
print 'Compiled'
try:
print 'Training model...'
c2w2c.fit_generator(generator=training_data.as_generator(N_ctx, N_batch),
samples_per_epoch=training_data.get_num_samples(N_ctx),
nb_epoch=1,
verbose=1)
print 'Training complete'
except KeyboardInterrupt:
print 'Training interrupted. Bye'
|
Build the actual C2W2C model
|
Build the actual C2W2C model
|
Python
|
mit
|
milankinen/c2w2c,milankinen/c2w2c
|
Build the actual C2W2C model
|
from models import C2W, LanguageModel, W2C
from util import load_training_data
from keras.models import Model
from keras.layers import TimeDistributed, Input, Activation
N_batch = 50
N_ctx = 10
d_C = 150
d_W = 50
d_Wi = 150
training_data = load_training_data('data/training.txt')
V_C = training_data.V_C
V_W = training_data.V_W
# The actual C2W2C model
input = Input(shape=(None, V_W.dim[1]), dtype='int32')
W_ctx = TimeDistributed(C2W(V_C=V_C, V_W=V_W, d_C=d_C, d_W=d_W, d_Wi=d_Wi))(input)
w_np1 = LanguageModel(d_W, state_seq=False)(W_ctx)
output = W2C(V_C=V_C, V_W=V_W, d_W=d_W, d_C=d_C)(w_np1)
c2w2c = Model(input=input, output=Activation('softmax')(output))
print 'Compiling model...'
c2w2c.compile(optimizer='adam', loss='categorical_crossentropy')
print 'Compiled'
try:
print 'Training model...'
c2w2c.fit_generator(generator=training_data.as_generator(N_ctx, N_batch),
samples_per_epoch=training_data.get_num_samples(N_ctx),
nb_epoch=1,
verbose=1)
print 'Training complete'
except KeyboardInterrupt:
print 'Training interrupted. Bye'
|
<commit_before>
<commit_msg>Build the actual C2W2C model<commit_after>
|
from models import C2W, LanguageModel, W2C
from util import load_training_data
from keras.models import Model
from keras.layers import TimeDistributed, Input, Activation
N_batch = 50
N_ctx = 10
d_C = 150
d_W = 50
d_Wi = 150
training_data = load_training_data('data/training.txt')
V_C = training_data.V_C
V_W = training_data.V_W
# The actual C2W2C model
input = Input(shape=(None, V_W.dim[1]), dtype='int32')
W_ctx = TimeDistributed(C2W(V_C=V_C, V_W=V_W, d_C=d_C, d_W=d_W, d_Wi=d_Wi))(input)
w_np1 = LanguageModel(d_W, state_seq=False)(W_ctx)
output = W2C(V_C=V_C, V_W=V_W, d_W=d_W, d_C=d_C)(w_np1)
c2w2c = Model(input=input, output=Activation('softmax')(output))
print 'Compiling model...'
c2w2c.compile(optimizer='adam', loss='categorical_crossentropy')
print 'Compiled'
try:
print 'Training model...'
c2w2c.fit_generator(generator=training_data.as_generator(N_ctx, N_batch),
samples_per_epoch=training_data.get_num_samples(N_ctx),
nb_epoch=1,
verbose=1)
print 'Training complete'
except KeyboardInterrupt:
print 'Training interrupted. Bye'
|
Build the actual C2W2C model
from models import C2W, LanguageModel, W2C
from util import load_training_data
from keras.models import Model
from keras.layers import TimeDistributed, Input, Activation
N_batch = 50
N_ctx = 10
d_C = 150
d_W = 50
d_Wi = 150
training_data = load_training_data('data/training.txt')
V_C = training_data.V_C
V_W = training_data.V_W
# The actual C2W2C model
input = Input(shape=(None, V_W.dim[1]), dtype='int32')
W_ctx = TimeDistributed(C2W(V_C=V_C, V_W=V_W, d_C=d_C, d_W=d_W, d_Wi=d_Wi))(input)
w_np1 = LanguageModel(d_W, state_seq=False)(W_ctx)
output = W2C(V_C=V_C, V_W=V_W, d_W=d_W, d_C=d_C)(w_np1)
c2w2c = Model(input=input, output=Activation('softmax')(output))
print 'Compiling model...'
c2w2c.compile(optimizer='adam', loss='categorical_crossentropy')
print 'Compiled'
try:
print 'Training model...'
c2w2c.fit_generator(generator=training_data.as_generator(N_ctx, N_batch),
samples_per_epoch=training_data.get_num_samples(N_ctx),
nb_epoch=1,
verbose=1)
print 'Training complete'
except KeyboardInterrupt:
print 'Training interrupted. Bye'
|
<commit_before>
<commit_msg>Build the actual C2W2C model<commit_after>
from models import C2W, LanguageModel, W2C
from util import load_training_data
from keras.models import Model
from keras.layers import TimeDistributed, Input, Activation
N_batch = 50
N_ctx = 10
d_C = 150
d_W = 50
d_Wi = 150
training_data = load_training_data('data/training.txt')
V_C = training_data.V_C
V_W = training_data.V_W
# The actual C2W2C model
input = Input(shape=(None, V_W.dim[1]), dtype='int32')
W_ctx = TimeDistributed(C2W(V_C=V_C, V_W=V_W, d_C=d_C, d_W=d_W, d_Wi=d_Wi))(input)
w_np1 = LanguageModel(d_W, state_seq=False)(W_ctx)
output = W2C(V_C=V_C, V_W=V_W, d_W=d_W, d_C=d_C)(w_np1)
c2w2c = Model(input=input, output=Activation('softmax')(output))
print 'Compiling model...'
c2w2c.compile(optimizer='adam', loss='categorical_crossentropy')
print 'Compiled'
try:
print 'Training model...'
c2w2c.fit_generator(generator=training_data.as_generator(N_ctx, N_batch),
samples_per_epoch=training_data.get_num_samples(N_ctx),
nb_epoch=1,
verbose=1)
print 'Training complete'
except KeyboardInterrupt:
print 'Training interrupted. Bye'
|
|
1ef1d7a973ce44943fc59315d1f962ed59f06e33
|
seacucumber/backend.py
|
seacucumber/backend.py
|
"""
This module contains the SESBackend class, which is what you'll want to set in
your settings.py::
EMAIL_BACKEND = 'seacucumber.backend.SESBackend'
"""
from django.core.mail.backends.base import BaseEmailBackend
from seacucumber.tasks import SendEmailTask
class SESBackend(BaseEmailBackend):
"""
A Django Email backend that uses Amazon's Simple Email Service.
"""
def send_messages(self, email_messages):
"""
Sends one or more EmailMessage objects and returns the number of
email messages sent.
:param EmailMessage email_messages: A list of Django's EmailMessage
object instances.
:rtype: int
:returns: The number of EmailMessage objects that were successfully
queued up. Note that these are not in a state where we can
guarantee delivery just yet.
"""
num_sent = 0
for message in email_messages:
# Hand this off to a celery task.
SendEmailTask.delay(
message.from_email,
message.recipients(),
message.message().as_string(),
)
num_sent += 1
return num_sent
|
"""
This module contains the SESBackend class, which is what you'll want to set in
your settings.py::
EMAIL_BACKEND = 'seacucumber.backend.SESBackend'
"""
from django.core.mail.backends.base import BaseEmailBackend
from seacucumber.tasks import SendEmailTask
class SESBackend(BaseEmailBackend):
"""
A Django Email backend that uses Amazon's Simple Email Service.
"""
def send_messages(self, email_messages):
"""
Sends one or more EmailMessage objects and returns the number of
email messages sent.
:param EmailMessage email_messages: A list of Django's EmailMessage
object instances.
:rtype: int
:returns: The number of EmailMessage objects that were successfully
queued up. Note that these are not in a state where we can
guarantee delivery just yet.
"""
num_sent = 0
for message in email_messages:
# Hand this off to a celery task.
SendEmailTask.delay(
message.from_email,
message.recipients(),
message.message().as_string().decode('utf8'),
)
num_sent += 1
return num_sent
|
Patch to send mails with UTF8 encoding
|
Patch to send mails with UTF8 encoding
Just a temp fix
|
Python
|
mit
|
makielab/sea-cucumber,duointeractive/sea-cucumber
|
"""
This module contains the SESBackend class, which is what you'll want to set in
your settings.py::
EMAIL_BACKEND = 'seacucumber.backend.SESBackend'
"""
from django.core.mail.backends.base import BaseEmailBackend
from seacucumber.tasks import SendEmailTask
class SESBackend(BaseEmailBackend):
"""
A Django Email backend that uses Amazon's Simple Email Service.
"""
def send_messages(self, email_messages):
"""
Sends one or more EmailMessage objects and returns the number of
email messages sent.
:param EmailMessage email_messages: A list of Django's EmailMessage
object instances.
:rtype: int
:returns: The number of EmailMessage objects that were successfully
queued up. Note that these are not in a state where we can
guarantee delivery just yet.
"""
num_sent = 0
for message in email_messages:
# Hand this off to a celery task.
SendEmailTask.delay(
message.from_email,
message.recipients(),
message.message().as_string(),
)
num_sent += 1
return num_sent
Patch to send mails with UTF8 encoding
Just a temp fix
|
"""
This module contains the SESBackend class, which is what you'll want to set in
your settings.py::
EMAIL_BACKEND = 'seacucumber.backend.SESBackend'
"""
from django.core.mail.backends.base import BaseEmailBackend
from seacucumber.tasks import SendEmailTask
class SESBackend(BaseEmailBackend):
"""
A Django Email backend that uses Amazon's Simple Email Service.
"""
def send_messages(self, email_messages):
"""
Sends one or more EmailMessage objects and returns the number of
email messages sent.
:param EmailMessage email_messages: A list of Django's EmailMessage
object instances.
:rtype: int
:returns: The number of EmailMessage objects that were successfully
queued up. Note that these are not in a state where we can
guarantee delivery just yet.
"""
num_sent = 0
for message in email_messages:
# Hand this off to a celery task.
SendEmailTask.delay(
message.from_email,
message.recipients(),
message.message().as_string().decode('utf8'),
)
num_sent += 1
return num_sent
|
<commit_before>"""
This module contains the SESBackend class, which is what you'll want to set in
your settings.py::
EMAIL_BACKEND = 'seacucumber.backend.SESBackend'
"""
from django.core.mail.backends.base import BaseEmailBackend
from seacucumber.tasks import SendEmailTask
class SESBackend(BaseEmailBackend):
"""
A Django Email backend that uses Amazon's Simple Email Service.
"""
def send_messages(self, email_messages):
"""
Sends one or more EmailMessage objects and returns the number of
email messages sent.
:param EmailMessage email_messages: A list of Django's EmailMessage
object instances.
:rtype: int
:returns: The number of EmailMessage objects that were successfully
queued up. Note that these are not in a state where we can
guarantee delivery just yet.
"""
num_sent = 0
for message in email_messages:
# Hand this off to a celery task.
SendEmailTask.delay(
message.from_email,
message.recipients(),
message.message().as_string(),
)
num_sent += 1
return num_sent
<commit_msg>Patch to send mails with UTF8 encoding
Just a temp fix<commit_after>
|
"""
This module contains the SESBackend class, which is what you'll want to set in
your settings.py::
EMAIL_BACKEND = 'seacucumber.backend.SESBackend'
"""
from django.core.mail.backends.base import BaseEmailBackend
from seacucumber.tasks import SendEmailTask
class SESBackend(BaseEmailBackend):
"""
A Django Email backend that uses Amazon's Simple Email Service.
"""
def send_messages(self, email_messages):
"""
Sends one or more EmailMessage objects and returns the number of
email messages sent.
:param EmailMessage email_messages: A list of Django's EmailMessage
object instances.
:rtype: int
:returns: The number of EmailMessage objects that were successfully
queued up. Note that these are not in a state where we can
guarantee delivery just yet.
"""
num_sent = 0
for message in email_messages:
# Hand this off to a celery task.
SendEmailTask.delay(
message.from_email,
message.recipients(),
message.message().as_string().decode('utf8'),
)
num_sent += 1
return num_sent
|
"""
This module contains the SESBackend class, which is what you'll want to set in
your settings.py::
EMAIL_BACKEND = 'seacucumber.backend.SESBackend'
"""
from django.core.mail.backends.base import BaseEmailBackend
from seacucumber.tasks import SendEmailTask
class SESBackend(BaseEmailBackend):
"""
A Django Email backend that uses Amazon's Simple Email Service.
"""
def send_messages(self, email_messages):
"""
Sends one or more EmailMessage objects and returns the number of
email messages sent.
:param EmailMessage email_messages: A list of Django's EmailMessage
object instances.
:rtype: int
:returns: The number of EmailMessage objects that were successfully
queued up. Note that these are not in a state where we can
guarantee delivery just yet.
"""
num_sent = 0
for message in email_messages:
# Hand this off to a celery task.
SendEmailTask.delay(
message.from_email,
message.recipients(),
message.message().as_string(),
)
num_sent += 1
return num_sent
Patch to send mails with UTF8 encoding
Just a temp fix"""
This module contains the SESBackend class, which is what you'll want to set in
your settings.py::
EMAIL_BACKEND = 'seacucumber.backend.SESBackend'
"""
from django.core.mail.backends.base import BaseEmailBackend
from seacucumber.tasks import SendEmailTask
class SESBackend(BaseEmailBackend):
"""
A Django Email backend that uses Amazon's Simple Email Service.
"""
def send_messages(self, email_messages):
"""
Sends one or more EmailMessage objects and returns the number of
email messages sent.
:param EmailMessage email_messages: A list of Django's EmailMessage
object instances.
:rtype: int
:returns: The number of EmailMessage objects that were successfully
queued up. Note that these are not in a state where we can
guarantee delivery just yet.
"""
num_sent = 0
for message in email_messages:
# Hand this off to a celery task.
SendEmailTask.delay(
message.from_email,
message.recipients(),
message.message().as_string().decode('utf8'),
)
num_sent += 1
return num_sent
|
<commit_before>"""
This module contains the SESBackend class, which is what you'll want to set in
your settings.py::
EMAIL_BACKEND = 'seacucumber.backend.SESBackend'
"""
from django.core.mail.backends.base import BaseEmailBackend
from seacucumber.tasks import SendEmailTask
class SESBackend(BaseEmailBackend):
"""
A Django Email backend that uses Amazon's Simple Email Service.
"""
def send_messages(self, email_messages):
"""
Sends one or more EmailMessage objects and returns the number of
email messages sent.
:param EmailMessage email_messages: A list of Django's EmailMessage
object instances.
:rtype: int
:returns: The number of EmailMessage objects that were successfully
queued up. Note that these are not in a state where we can
guarantee delivery just yet.
"""
num_sent = 0
for message in email_messages:
# Hand this off to a celery task.
SendEmailTask.delay(
message.from_email,
message.recipients(),
message.message().as_string(),
)
num_sent += 1
return num_sent
<commit_msg>Patch to send mails with UTF8 encoding
Just a temp fix<commit_after>"""
This module contains the SESBackend class, which is what you'll want to set in
your settings.py::
EMAIL_BACKEND = 'seacucumber.backend.SESBackend'
"""
from django.core.mail.backends.base import BaseEmailBackend
from seacucumber.tasks import SendEmailTask
class SESBackend(BaseEmailBackend):
"""
A Django Email backend that uses Amazon's Simple Email Service.
"""
def send_messages(self, email_messages):
"""
Sends one or more EmailMessage objects and returns the number of
email messages sent.
:param EmailMessage email_messages: A list of Django's EmailMessage
object instances.
:rtype: int
:returns: The number of EmailMessage objects that were successfully
queued up. Note that these are not in a state where we can
guarantee delivery just yet.
"""
num_sent = 0
for message in email_messages:
# Hand this off to a celery task.
SendEmailTask.delay(
message.from_email,
message.recipients(),
message.message().as_string().decode('utf8'),
)
num_sent += 1
return num_sent
|
a9b56fe98a0df71881c41a2524bdb5abc4b0de50
|
services/imu-logger.py
|
services/imu-logger.py
|
#!/usr/bin/env python3
from sense_hat import SenseHat
from pymongo import MongoClient
import time
DELAY = 1 # in seconds
sense = SenseHat()
client = MongoClient("mongodb://10.0.1.25:27017")
db = client.g2x
while True:
orientation = sense.get_orientation_degrees()
print(orientation)
acceleration = sense.get_accelerometer()
compass = sense.get_compass()
temperature_from_humidity = sense.get_temperature()
temperature_from_pressure = sense.get_temperature_from_pressure()
db.gyroscope.insert_one({
"pitch": orientation["pitch"],
"roll": orientation["roll"],
"yaw": orientation["yaw"]
})
db.accelerometer.insert_one({
"pitch": acceleration["pitch"],
"roll": acceleration["roll"],
"yaw": acceleration["yaw"]
})
db.compass.insert_one({"angle": compass})
db.temperature.insert_one({
"from_humidity": temperature_from_humidity,
"from_pressure": temperature_from_pressure
})
time.sleep(DELAY)
|
#!/usr/bin/env python3
from sense_hat import SenseHat
from pymongo import MongoClient
from datetime import datetime
sense = SenseHat()
client = MongoClient("mongodb://10.0.1.25:27017")
db = client.g2x
last_time = datetime.utcnow()
sample_count = 0
while True:
current_time = datetime.utcnow()
elapsed_time = current_time - last_time
orientation = sense.get_orientation()
gyroscope = sense.get_gyroscope()
acceleration = sense.get_accelerometer()
compass = sense.get_compass()
temperature_from_humidity = sense.get_temperature()
temperature_from_pressure = sense.get_temperature_from_pressure()
sample_count += 1
if elapsed_time.seconds >= 1:
last_time = current_time
print("sample per second =", sample_count)
print("orientation =", orientation)
print("gyroscope =", gyroscope)
print("acceleration =", acceleration)
print("compass =", compass)
print("temperature_from_humidity =", temperature_from_humidity)
print("temperature_from_pressure =", temperature_from_pressure)
sample_count = 0
db.orientation.insert_one({
"pitch": orientation["pitch"],
"roll": orientation["roll"],
"yaw": orientation["yaw"]
})
db.gyroscope.insert_one({
"pitch": gyroscope["pitch"],
"roll": gyroscope["roll"],
"yaw": gyroscope["yaw"]
})
db.accelerometer.insert_one({
"pitch": acceleration["pitch"],
"roll": acceleration["roll"],
"yaw": acceleration["yaw"]
})
db.compass.insert_one({"angle": compass})
db.temperature.insert_one({
"from_humidity": temperature_from_humidity,
"from_pressure": temperature_from_pressure
})
|
Read samples faster but log only once a second
|
Read samples faster but log only once a second
|
Python
|
bsd-3-clause
|
gizmo-cda/g2x-submarine-v2,gizmo-cda/g2x-submarine-v2,gizmo-cda/g2x-submarine-v2,gizmo-cda/g2x-submarine-v2
|
#!/usr/bin/env python3
from sense_hat import SenseHat
from pymongo import MongoClient
import time
DELAY = 1 # in seconds
sense = SenseHat()
client = MongoClient("mongodb://10.0.1.25:27017")
db = client.g2x
while True:
orientation = sense.get_orientation_degrees()
print(orientation)
acceleration = sense.get_accelerometer()
compass = sense.get_compass()
temperature_from_humidity = sense.get_temperature()
temperature_from_pressure = sense.get_temperature_from_pressure()
db.gyroscope.insert_one({
"pitch": orientation["pitch"],
"roll": orientation["roll"],
"yaw": orientation["yaw"]
})
db.accelerometer.insert_one({
"pitch": acceleration["pitch"],
"roll": acceleration["roll"],
"yaw": acceleration["yaw"]
})
db.compass.insert_one({"angle": compass})
db.temperature.insert_one({
"from_humidity": temperature_from_humidity,
"from_pressure": temperature_from_pressure
})
time.sleep(DELAY)
Read samples faster but log only once a second
|
#!/usr/bin/env python3
from sense_hat import SenseHat
from pymongo import MongoClient
from datetime import datetime
sense = SenseHat()
client = MongoClient("mongodb://10.0.1.25:27017")
db = client.g2x
last_time = datetime.utcnow()
sample_count = 0
while True:
current_time = datetime.utcnow()
elapsed_time = current_time - last_time
orientation = sense.get_orientation()
gyroscope = sense.get_gyroscope()
acceleration = sense.get_accelerometer()
compass = sense.get_compass()
temperature_from_humidity = sense.get_temperature()
temperature_from_pressure = sense.get_temperature_from_pressure()
sample_count += 1
if elapsed_time.seconds >= 1:
last_time = current_time
print("sample per second =", sample_count)
print("orientation =", orientation)
print("gyroscope =", gyroscope)
print("acceleration =", acceleration)
print("compass =", compass)
print("temperature_from_humidity =", temperature_from_humidity)
print("temperature_from_pressure =", temperature_from_pressure)
sample_count = 0
db.orientation.insert_one({
"pitch": orientation["pitch"],
"roll": orientation["roll"],
"yaw": orientation["yaw"]
})
db.gyroscope.insert_one({
"pitch": gyroscope["pitch"],
"roll": gyroscope["roll"],
"yaw": gyroscope["yaw"]
})
db.accelerometer.insert_one({
"pitch": acceleration["pitch"],
"roll": acceleration["roll"],
"yaw": acceleration["yaw"]
})
db.compass.insert_one({"angle": compass})
db.temperature.insert_one({
"from_humidity": temperature_from_humidity,
"from_pressure": temperature_from_pressure
})
|
<commit_before>#!/usr/bin/env python3
from sense_hat import SenseHat
from pymongo import MongoClient
import time
DELAY = 1 # in seconds
sense = SenseHat()
client = MongoClient("mongodb://10.0.1.25:27017")
db = client.g2x
while True:
orientation = sense.get_orientation_degrees()
print(orientation)
acceleration = sense.get_accelerometer()
compass = sense.get_compass()
temperature_from_humidity = sense.get_temperature()
temperature_from_pressure = sense.get_temperature_from_pressure()
db.gyroscope.insert_one({
"pitch": orientation["pitch"],
"roll": orientation["roll"],
"yaw": orientation["yaw"]
})
db.accelerometer.insert_one({
"pitch": acceleration["pitch"],
"roll": acceleration["roll"],
"yaw": acceleration["yaw"]
})
db.compass.insert_one({"angle": compass})
db.temperature.insert_one({
"from_humidity": temperature_from_humidity,
"from_pressure": temperature_from_pressure
})
time.sleep(DELAY)
<commit_msg>Read samples faster but log only once a second<commit_after>
|
#!/usr/bin/env python3
from sense_hat import SenseHat
from pymongo import MongoClient
from datetime import datetime
sense = SenseHat()
client = MongoClient("mongodb://10.0.1.25:27017")
db = client.g2x
last_time = datetime.utcnow()
sample_count = 0
while True:
current_time = datetime.utcnow()
elapsed_time = current_time - last_time
orientation = sense.get_orientation()
gyroscope = sense.get_gyroscope()
acceleration = sense.get_accelerometer()
compass = sense.get_compass()
temperature_from_humidity = sense.get_temperature()
temperature_from_pressure = sense.get_temperature_from_pressure()
sample_count += 1
if elapsed_time.seconds >= 1:
last_time = current_time
print("sample per second =", sample_count)
print("orientation =", orientation)
print("gyroscope =", gyroscope)
print("acceleration =", acceleration)
print("compass =", compass)
print("temperature_from_humidity =", temperature_from_humidity)
print("temperature_from_pressure =", temperature_from_pressure)
sample_count = 0
db.orientation.insert_one({
"pitch": orientation["pitch"],
"roll": orientation["roll"],
"yaw": orientation["yaw"]
})
db.gyroscope.insert_one({
"pitch": gyroscope["pitch"],
"roll": gyroscope["roll"],
"yaw": gyroscope["yaw"]
})
db.accelerometer.insert_one({
"pitch": acceleration["pitch"],
"roll": acceleration["roll"],
"yaw": acceleration["yaw"]
})
db.compass.insert_one({"angle": compass})
db.temperature.insert_one({
"from_humidity": temperature_from_humidity,
"from_pressure": temperature_from_pressure
})
|
#!/usr/bin/env python3
from sense_hat import SenseHat
from pymongo import MongoClient
import time
DELAY = 1 # in seconds
sense = SenseHat()
client = MongoClient("mongodb://10.0.1.25:27017")
db = client.g2x
while True:
orientation = sense.get_orientation_degrees()
print(orientation)
acceleration = sense.get_accelerometer()
compass = sense.get_compass()
temperature_from_humidity = sense.get_temperature()
temperature_from_pressure = sense.get_temperature_from_pressure()
db.gyroscope.insert_one({
"pitch": orientation["pitch"],
"roll": orientation["roll"],
"yaw": orientation["yaw"]
})
db.accelerometer.insert_one({
"pitch": acceleration["pitch"],
"roll": acceleration["roll"],
"yaw": acceleration["yaw"]
})
db.compass.insert_one({"angle": compass})
db.temperature.insert_one({
"from_humidity": temperature_from_humidity,
"from_pressure": temperature_from_pressure
})
time.sleep(DELAY)
Read samples faster but log only once a second#!/usr/bin/env python3
from sense_hat import SenseHat
from pymongo import MongoClient
from datetime import datetime
sense = SenseHat()
client = MongoClient("mongodb://10.0.1.25:27017")
db = client.g2x
last_time = datetime.utcnow()
sample_count = 0
while True:
current_time = datetime.utcnow()
elapsed_time = current_time - last_time
orientation = sense.get_orientation()
gyroscope = sense.get_gyroscope()
acceleration = sense.get_accelerometer()
compass = sense.get_compass()
temperature_from_humidity = sense.get_temperature()
temperature_from_pressure = sense.get_temperature_from_pressure()
sample_count += 1
if elapsed_time.seconds >= 1:
last_time = current_time
print("sample per second =", sample_count)
print("orientation =", orientation)
print("gyroscope =", gyroscope)
print("acceleration =", acceleration)
print("compass =", compass)
print("temperature_from_humidity =", temperature_from_humidity)
print("temperature_from_pressure =", temperature_from_pressure)
sample_count = 0
db.orientation.insert_one({
"pitch": orientation["pitch"],
"roll": orientation["roll"],
"yaw": orientation["yaw"]
})
db.gyroscope.insert_one({
"pitch": gyroscope["pitch"],
"roll": gyroscope["roll"],
"yaw": gyroscope["yaw"]
})
db.accelerometer.insert_one({
"pitch": acceleration["pitch"],
"roll": acceleration["roll"],
"yaw": acceleration["yaw"]
})
db.compass.insert_one({"angle": compass})
db.temperature.insert_one({
"from_humidity": temperature_from_humidity,
"from_pressure": temperature_from_pressure
})
|
<commit_before>#!/usr/bin/env python3
from sense_hat import SenseHat
from pymongo import MongoClient
import time
DELAY = 1 # in seconds
sense = SenseHat()
client = MongoClient("mongodb://10.0.1.25:27017")
db = client.g2x
while True:
orientation = sense.get_orientation_degrees()
print(orientation)
acceleration = sense.get_accelerometer()
compass = sense.get_compass()
temperature_from_humidity = sense.get_temperature()
temperature_from_pressure = sense.get_temperature_from_pressure()
db.gyroscope.insert_one({
"pitch": orientation["pitch"],
"roll": orientation["roll"],
"yaw": orientation["yaw"]
})
db.accelerometer.insert_one({
"pitch": acceleration["pitch"],
"roll": acceleration["roll"],
"yaw": acceleration["yaw"]
})
db.compass.insert_one({"angle": compass})
db.temperature.insert_one({
"from_humidity": temperature_from_humidity,
"from_pressure": temperature_from_pressure
})
time.sleep(DELAY)
<commit_msg>Read samples faster but log only once a second<commit_after>#!/usr/bin/env python3
from sense_hat import SenseHat
from pymongo import MongoClient
from datetime import datetime
sense = SenseHat()
client = MongoClient("mongodb://10.0.1.25:27017")
db = client.g2x
last_time = datetime.utcnow()
sample_count = 0
while True:
current_time = datetime.utcnow()
elapsed_time = current_time - last_time
orientation = sense.get_orientation()
gyroscope = sense.get_gyroscope()
acceleration = sense.get_accelerometer()
compass = sense.get_compass()
temperature_from_humidity = sense.get_temperature()
temperature_from_pressure = sense.get_temperature_from_pressure()
sample_count += 1
if elapsed_time.seconds >= 1:
last_time = current_time
print("sample per second =", sample_count)
print("orientation =", orientation)
print("gyroscope =", gyroscope)
print("acceleration =", acceleration)
print("compass =", compass)
print("temperature_from_humidity =", temperature_from_humidity)
print("temperature_from_pressure =", temperature_from_pressure)
sample_count = 0
db.orientation.insert_one({
"pitch": orientation["pitch"],
"roll": orientation["roll"],
"yaw": orientation["yaw"]
})
db.gyroscope.insert_one({
"pitch": gyroscope["pitch"],
"roll": gyroscope["roll"],
"yaw": gyroscope["yaw"]
})
db.accelerometer.insert_one({
"pitch": acceleration["pitch"],
"roll": acceleration["roll"],
"yaw": acceleration["yaw"]
})
db.compass.insert_one({"angle": compass})
db.temperature.insert_one({
"from_humidity": temperature_from_humidity,
"from_pressure": temperature_from_pressure
})
|
b7b1ae11378b37350a3fcd9d989be58f655ec986
|
calexicon/helpers.py
|
calexicon/helpers.py
|
from datetime import date as vanilla_date
def ordinal(n):
suffix = "th"
if n % 10 == 1:
suffix = "st"
if n % 10 == 2:
suffix = "nd"
if n % 10 == 3:
suffix = "rd"
if 10 < n % 100 < 20:
suffix = "th"
return "%d%s" % (n, suffix)
def month_string(n):
d = vanilla_date(1995, n, 1)
return d.strftime("%B")
|
from datetime import date as vanilla_date
def ordinal(n):
suffix = "th"
if n % 10 in [1, 2, 3]:
suffix = [None, 'st', 'nd', 'rd'][n % 10]
if 10 < n % 100 < 20:
suffix = "th"
return "%d%s" % (n, suffix)
def month_string(n):
d = vanilla_date(1995, n, 1)
return d.strftime("%B")
|
Make this part of the function simpler.
|
Make this part of the function simpler.
|
Python
|
apache-2.0
|
jwg4/qual,jwg4/calexicon
|
from datetime import date as vanilla_date
def ordinal(n):
suffix = "th"
if n % 10 == 1:
suffix = "st"
if n % 10 == 2:
suffix = "nd"
if n % 10 == 3:
suffix = "rd"
if 10 < n % 100 < 20:
suffix = "th"
return "%d%s" % (n, suffix)
def month_string(n):
d = vanilla_date(1995, n, 1)
return d.strftime("%B")
Make this part of the function simpler.
|
from datetime import date as vanilla_date
def ordinal(n):
suffix = "th"
if n % 10 in [1, 2, 3]:
suffix = [None, 'st', 'nd', 'rd'][n % 10]
if 10 < n % 100 < 20:
suffix = "th"
return "%d%s" % (n, suffix)
def month_string(n):
d = vanilla_date(1995, n, 1)
return d.strftime("%B")
|
<commit_before>from datetime import date as vanilla_date
def ordinal(n):
suffix = "th"
if n % 10 == 1:
suffix = "st"
if n % 10 == 2:
suffix = "nd"
if n % 10 == 3:
suffix = "rd"
if 10 < n % 100 < 20:
suffix = "th"
return "%d%s" % (n, suffix)
def month_string(n):
d = vanilla_date(1995, n, 1)
return d.strftime("%B")
<commit_msg>Make this part of the function simpler.<commit_after>
|
from datetime import date as vanilla_date
def ordinal(n):
suffix = "th"
if n % 10 in [1, 2, 3]:
suffix = [None, 'st', 'nd', 'rd'][n % 10]
if 10 < n % 100 < 20:
suffix = "th"
return "%d%s" % (n, suffix)
def month_string(n):
d = vanilla_date(1995, n, 1)
return d.strftime("%B")
|
from datetime import date as vanilla_date
def ordinal(n):
suffix = "th"
if n % 10 == 1:
suffix = "st"
if n % 10 == 2:
suffix = "nd"
if n % 10 == 3:
suffix = "rd"
if 10 < n % 100 < 20:
suffix = "th"
return "%d%s" % (n, suffix)
def month_string(n):
d = vanilla_date(1995, n, 1)
return d.strftime("%B")
Make this part of the function simpler.from datetime import date as vanilla_date
def ordinal(n):
suffix = "th"
if n % 10 in [1, 2, 3]:
suffix = [None, 'st', 'nd', 'rd'][n % 10]
if 10 < n % 100 < 20:
suffix = "th"
return "%d%s" % (n, suffix)
def month_string(n):
d = vanilla_date(1995, n, 1)
return d.strftime("%B")
|
<commit_before>from datetime import date as vanilla_date
def ordinal(n):
suffix = "th"
if n % 10 == 1:
suffix = "st"
if n % 10 == 2:
suffix = "nd"
if n % 10 == 3:
suffix = "rd"
if 10 < n % 100 < 20:
suffix = "th"
return "%d%s" % (n, suffix)
def month_string(n):
d = vanilla_date(1995, n, 1)
return d.strftime("%B")
<commit_msg>Make this part of the function simpler.<commit_after>from datetime import date as vanilla_date
def ordinal(n):
suffix = "th"
if n % 10 in [1, 2, 3]:
suffix = [None, 'st', 'nd', 'rd'][n % 10]
if 10 < n % 100 < 20:
suffix = "th"
return "%d%s" % (n, suffix)
def month_string(n):
d = vanilla_date(1995, n, 1)
return d.strftime("%B")
|
8be4829832bab01b0508c59114f924c5945878b1
|
executor/opensubmitexec/compiler.py
|
executor/opensubmitexec/compiler.py
|
'''
Functions dealing with the compilation of code.
'''
from .exceptions import ValidatorBrokenException
import logging
logger = logging.getLogger('opensubmitexec')
GCC = ['gcc', '-o', '{output}', '{inputs}']
GPP = ['g++', '-o', '{output}', '{inputs}']
def compiler_cmdline(compiler=GCC, output=None, inputs=None):
cmdline = []
for element in compiler:
if element == '{output}':
if output:
cmdline.append(output)
else:
logger.error('Compiler output name is needed, but not given.')
raise ValidatorBrokenException("You need to declare the output name for this compiler.")
elif element == '{inputs}':
if inputs:
for fname in inputs:
if compiler in [GCC, GPP] and fname.endswith('.h'):
logger.debug('Omitting {0} in the compiler call.'.format(fname))
else:
cmdline.append(fname)
else:
logger.error('Input file names for compiler are not given.')
raise ValidatorBrokenException('You need to declare input files for this compiler.')
else:
cmdline.append(element)
return cmdline[0], cmdline[1:]
|
'''
Functions dealing with the compilation of code.
'''
from .exceptions import ValidatorBrokenException
import logging
logger = logging.getLogger('opensubmitexec')
GCC = ['gcc', '-o', '{output}', '{inputs}']
GPP = ['g++', '-pthread', '-o', '{output}', '{inputs}']
def compiler_cmdline(compiler=GCC, output=None, inputs=None):
cmdline = []
for element in compiler:
if element == '{output}':
if output:
cmdline.append(output)
else:
logger.error('Compiler output name is needed, but not given.')
raise ValidatorBrokenException("You need to declare the output name for this compiler.")
elif element == '{inputs}':
if inputs:
for fname in inputs:
if compiler in [GCC, GPP] and fname.endswith('.h'):
logger.debug('Omitting {0} in the compiler call.'.format(fname))
else:
cmdline.append(fname)
else:
logger.error('Input file names for compiler are not given.')
raise ValidatorBrokenException('You need to declare input files for this compiler.')
else:
cmdline.append(element)
return cmdline[0], cmdline[1:]
|
Fix CPP problem on Linux
|
Fix CPP problem on Linux
|
Python
|
agpl-3.0
|
troeger/opensubmit,troeger/opensubmit,troeger/opensubmit,troeger/opensubmit,troeger/opensubmit
|
'''
Functions dealing with the compilation of code.
'''
from .exceptions import ValidatorBrokenException
import logging
logger = logging.getLogger('opensubmitexec')
GCC = ['gcc', '-o', '{output}', '{inputs}']
GPP = ['g++', '-o', '{output}', '{inputs}']
def compiler_cmdline(compiler=GCC, output=None, inputs=None):
cmdline = []
for element in compiler:
if element == '{output}':
if output:
cmdline.append(output)
else:
logger.error('Compiler output name is needed, but not given.')
raise ValidatorBrokenException("You need to declare the output name for this compiler.")
elif element == '{inputs}':
if inputs:
for fname in inputs:
if compiler in [GCC, GPP] and fname.endswith('.h'):
logger.debug('Omitting {0} in the compiler call.'.format(fname))
else:
cmdline.append(fname)
else:
logger.error('Input file names for compiler are not given.')
raise ValidatorBrokenException('You need to declare input files for this compiler.')
else:
cmdline.append(element)
return cmdline[0], cmdline[1:]
Fix CPP problem on Linux
|
'''
Functions dealing with the compilation of code.
'''
from .exceptions import ValidatorBrokenException
import logging
logger = logging.getLogger('opensubmitexec')
GCC = ['gcc', '-o', '{output}', '{inputs}']
GPP = ['g++', '-pthread', '-o', '{output}', '{inputs}']
def compiler_cmdline(compiler=GCC, output=None, inputs=None):
cmdline = []
for element in compiler:
if element == '{output}':
if output:
cmdline.append(output)
else:
logger.error('Compiler output name is needed, but not given.')
raise ValidatorBrokenException("You need to declare the output name for this compiler.")
elif element == '{inputs}':
if inputs:
for fname in inputs:
if compiler in [GCC, GPP] and fname.endswith('.h'):
logger.debug('Omitting {0} in the compiler call.'.format(fname))
else:
cmdline.append(fname)
else:
logger.error('Input file names for compiler are not given.')
raise ValidatorBrokenException('You need to declare input files for this compiler.')
else:
cmdline.append(element)
return cmdline[0], cmdline[1:]
|
<commit_before>'''
Functions dealing with the compilation of code.
'''
from .exceptions import ValidatorBrokenException
import logging
logger = logging.getLogger('opensubmitexec')
GCC = ['gcc', '-o', '{output}', '{inputs}']
GPP = ['g++', '-o', '{output}', '{inputs}']
def compiler_cmdline(compiler=GCC, output=None, inputs=None):
cmdline = []
for element in compiler:
if element == '{output}':
if output:
cmdline.append(output)
else:
logger.error('Compiler output name is needed, but not given.')
raise ValidatorBrokenException("You need to declare the output name for this compiler.")
elif element == '{inputs}':
if inputs:
for fname in inputs:
if compiler in [GCC, GPP] and fname.endswith('.h'):
logger.debug('Omitting {0} in the compiler call.'.format(fname))
else:
cmdline.append(fname)
else:
logger.error('Input file names for compiler are not given.')
raise ValidatorBrokenException('You need to declare input files for this compiler.')
else:
cmdline.append(element)
return cmdline[0], cmdline[1:]
<commit_msg>Fix CPP problem on Linux<commit_after>
|
'''
Functions dealing with the compilation of code.
'''
from .exceptions import ValidatorBrokenException
import logging
logger = logging.getLogger('opensubmitexec')
GCC = ['gcc', '-o', '{output}', '{inputs}']
GPP = ['g++', '-pthread', '-o', '{output}', '{inputs}']
def compiler_cmdline(compiler=GCC, output=None, inputs=None):
cmdline = []
for element in compiler:
if element == '{output}':
if output:
cmdline.append(output)
else:
logger.error('Compiler output name is needed, but not given.')
raise ValidatorBrokenException("You need to declare the output name for this compiler.")
elif element == '{inputs}':
if inputs:
for fname in inputs:
if compiler in [GCC, GPP] and fname.endswith('.h'):
logger.debug('Omitting {0} in the compiler call.'.format(fname))
else:
cmdline.append(fname)
else:
logger.error('Input file names for compiler are not given.')
raise ValidatorBrokenException('You need to declare input files for this compiler.')
else:
cmdline.append(element)
return cmdline[0], cmdline[1:]
|
'''
Functions dealing with the compilation of code.
'''
from .exceptions import ValidatorBrokenException
import logging
logger = logging.getLogger('opensubmitexec')
GCC = ['gcc', '-o', '{output}', '{inputs}']
GPP = ['g++', '-o', '{output}', '{inputs}']
def compiler_cmdline(compiler=GCC, output=None, inputs=None):
cmdline = []
for element in compiler:
if element == '{output}':
if output:
cmdline.append(output)
else:
logger.error('Compiler output name is needed, but not given.')
raise ValidatorBrokenException("You need to declare the output name for this compiler.")
elif element == '{inputs}':
if inputs:
for fname in inputs:
if compiler in [GCC, GPP] and fname.endswith('.h'):
logger.debug('Omitting {0} in the compiler call.'.format(fname))
else:
cmdline.append(fname)
else:
logger.error('Input file names for compiler are not given.')
raise ValidatorBrokenException('You need to declare input files for this compiler.')
else:
cmdline.append(element)
return cmdline[0], cmdline[1:]
Fix CPP problem on Linux'''
Functions dealing with the compilation of code.
'''
from .exceptions import ValidatorBrokenException
import logging
logger = logging.getLogger('opensubmitexec')
GCC = ['gcc', '-o', '{output}', '{inputs}']
GPP = ['g++', '-pthread', '-o', '{output}', '{inputs}']
def compiler_cmdline(compiler=GCC, output=None, inputs=None):
cmdline = []
for element in compiler:
if element == '{output}':
if output:
cmdline.append(output)
else:
logger.error('Compiler output name is needed, but not given.')
raise ValidatorBrokenException("You need to declare the output name for this compiler.")
elif element == '{inputs}':
if inputs:
for fname in inputs:
if compiler in [GCC, GPP] and fname.endswith('.h'):
logger.debug('Omitting {0} in the compiler call.'.format(fname))
else:
cmdline.append(fname)
else:
logger.error('Input file names for compiler are not given.')
raise ValidatorBrokenException('You need to declare input files for this compiler.')
else:
cmdline.append(element)
return cmdline[0], cmdline[1:]
|
<commit_before>'''
Functions dealing with the compilation of code.
'''
from .exceptions import ValidatorBrokenException
import logging
logger = logging.getLogger('opensubmitexec')
GCC = ['gcc', '-o', '{output}', '{inputs}']
GPP = ['g++', '-o', '{output}', '{inputs}']
def compiler_cmdline(compiler=GCC, output=None, inputs=None):
cmdline = []
for element in compiler:
if element == '{output}':
if output:
cmdline.append(output)
else:
logger.error('Compiler output name is needed, but not given.')
raise ValidatorBrokenException("You need to declare the output name for this compiler.")
elif element == '{inputs}':
if inputs:
for fname in inputs:
if compiler in [GCC, GPP] and fname.endswith('.h'):
logger.debug('Omitting {0} in the compiler call.'.format(fname))
else:
cmdline.append(fname)
else:
logger.error('Input file names for compiler are not given.')
raise ValidatorBrokenException('You need to declare input files for this compiler.')
else:
cmdline.append(element)
return cmdline[0], cmdline[1:]
<commit_msg>Fix CPP problem on Linux<commit_after>'''
Functions dealing with the compilation of code.
'''
from .exceptions import ValidatorBrokenException
import logging
logger = logging.getLogger('opensubmitexec')
GCC = ['gcc', '-o', '{output}', '{inputs}']
GPP = ['g++', '-pthread', '-o', '{output}', '{inputs}']
def compiler_cmdline(compiler=GCC, output=None, inputs=None):
cmdline = []
for element in compiler:
if element == '{output}':
if output:
cmdline.append(output)
else:
logger.error('Compiler output name is needed, but not given.')
raise ValidatorBrokenException("You need to declare the output name for this compiler.")
elif element == '{inputs}':
if inputs:
for fname in inputs:
if compiler in [GCC, GPP] and fname.endswith('.h'):
logger.debug('Omitting {0} in the compiler call.'.format(fname))
else:
cmdline.append(fname)
else:
logger.error('Input file names for compiler are not given.')
raise ValidatorBrokenException('You need to declare input files for this compiler.')
else:
cmdline.append(element)
return cmdline[0], cmdline[1:]
|
4c987cd45080cb6a1a449fa708a567c40ba8c94f
|
examples/pax_mininet_node.py
|
examples/pax_mininet_node.py
|
# coding: latin-1
"""
pax_mininet_node.py: Defines PaxNode which allows Pax to behave as the sole packet hander on a node.
"""
from mininet.node import Node
from mininet.log import info, warn
class PaxNode( Node ):
"PaxNode: A node which allows Pax to behave as the sole packet hander on that node."
def __init__(self, name, **params):
super(PaxNode, self).__init__(name, **params)
def config(self, **params):
super(PaxNode, self).config(**params)
# Setup iptable rules to drop incoming packets on each interface:
# Because Pax only sniffs packets (it doesn't steal them), we need to drop the packets
# to prevent the OS from handling them and responding.
for intf in self.intfList():
self.cmd("iptables -A INPUT -p tcp -i %s -j DROP" % intf.name)
# Disable ip_forward because otherwise this still happens, even with the above iptables rules
self.cmd("sysctl -w net.ipv4.ip_forward=0")
def terminate(self):
# Remove iptables rules
for intf in self.intfList():
self.cmd("iptables -D INPUT -p tcp -i %s -j DROP" % intf.name)
super(PaxNode, self).terminate()
|
# coding: latin-1
"""
pax_mininet_node.py: Defines PaxNode which allows Pax to behave as the sole packet hander on a node.
"""
from mininet.node import Node
from mininet.log import info, warn
class PaxNode( Node ):
"PaxNode: A node which allows Pax to behave as the sole packet hander on that node."
def __init__(self, name, **params):
super(PaxNode, self).__init__(name, **params)
def config(self, **params):
super(PaxNode, self).config(**params)
# Setup iptable rules to drop incoming packets on each interface:
# Because Pax only sniffs packets (it doesn't steal them), we need to drop the packets
# to prevent the OS from handling them and responding.
for intf in self.intfList():
self.cmd("iptables -A INPUT -p tcp -i %s -j DROP" % intf.name)
# Disable ip_forward because otherwise, even with the above iptables rules, the OS
# will still forward packets that have a different IP on the other interfaces, which
# is not the behaviour we want from an ideal node that only processes packets through Pax.
self.cmd("sysctl -w net.ipv4.ip_forward=0")
def terminate(self):
# Remove iptables rules
for intf in self.intfList():
self.cmd("iptables -D INPUT -p tcp -i %s -j DROP" % intf.name)
super(PaxNode, self).terminate()
|
Add comment explaining why we disable ip_forward
|
Add comment explaining why we disable ip_forward
|
Python
|
apache-2.0
|
niksu/pax,TMVector/pax,niksu/pax,niksu/pax,TMVector/pax
|
# coding: latin-1
"""
pax_mininet_node.py: Defines PaxNode which allows Pax to behave as the sole packet hander on a node.
"""
from mininet.node import Node
from mininet.log import info, warn
class PaxNode( Node ):
"PaxNode: A node which allows Pax to behave as the sole packet hander on that node."
def __init__(self, name, **params):
super(PaxNode, self).__init__(name, **params)
def config(self, **params):
super(PaxNode, self).config(**params)
# Setup iptable rules to drop incoming packets on each interface:
# Because Pax only sniffs packets (it doesn't steal them), we need to drop the packets
# to prevent the OS from handling them and responding.
for intf in self.intfList():
self.cmd("iptables -A INPUT -p tcp -i %s -j DROP" % intf.name)
# Disable ip_forward because otherwise this still happens, even with the above iptables rules
self.cmd("sysctl -w net.ipv4.ip_forward=0")
def terminate(self):
# Remove iptables rules
for intf in self.intfList():
self.cmd("iptables -D INPUT -p tcp -i %s -j DROP" % intf.name)
super(PaxNode, self).terminate()
Add comment explaining why we disable ip_forward
|
# coding: latin-1
"""
pax_mininet_node.py: Defines PaxNode which allows Pax to behave as the sole packet hander on a node.
"""
from mininet.node import Node
from mininet.log import info, warn
class PaxNode( Node ):
"PaxNode: A node which allows Pax to behave as the sole packet hander on that node."
def __init__(self, name, **params):
super(PaxNode, self).__init__(name, **params)
def config(self, **params):
super(PaxNode, self).config(**params)
# Setup iptable rules to drop incoming packets on each interface:
# Because Pax only sniffs packets (it doesn't steal them), we need to drop the packets
# to prevent the OS from handling them and responding.
for intf in self.intfList():
self.cmd("iptables -A INPUT -p tcp -i %s -j DROP" % intf.name)
# Disable ip_forward because otherwise, even with the above iptables rules, the OS
# will still forward packets that have a different IP on the other interfaces, which
# is not the behaviour we want from an ideal node that only processes packets through Pax.
self.cmd("sysctl -w net.ipv4.ip_forward=0")
def terminate(self):
# Remove iptables rules
for intf in self.intfList():
self.cmd("iptables -D INPUT -p tcp -i %s -j DROP" % intf.name)
super(PaxNode, self).terminate()
|
<commit_before># coding: latin-1
"""
pax_mininet_node.py: Defines PaxNode which allows Pax to behave as the sole packet hander on a node.
"""
from mininet.node import Node
from mininet.log import info, warn
class PaxNode( Node ):
"PaxNode: A node which allows Pax to behave as the sole packet hander on that node."
def __init__(self, name, **params):
super(PaxNode, self).__init__(name, **params)
def config(self, **params):
super(PaxNode, self).config(**params)
# Setup iptable rules to drop incoming packets on each interface:
# Because Pax only sniffs packets (it doesn't steal them), we need to drop the packets
# to prevent the OS from handling them and responding.
for intf in self.intfList():
self.cmd("iptables -A INPUT -p tcp -i %s -j DROP" % intf.name)
# Disable ip_forward because otherwise this still happens, even with the above iptables rules
self.cmd("sysctl -w net.ipv4.ip_forward=0")
def terminate(self):
# Remove iptables rules
for intf in self.intfList():
self.cmd("iptables -D INPUT -p tcp -i %s -j DROP" % intf.name)
super(PaxNode, self).terminate()
<commit_msg>Add comment explaining why we disable ip_forward<commit_after>
|
# coding: latin-1
"""
pax_mininet_node.py: Defines PaxNode which allows Pax to behave as the sole packet hander on a node.
"""
from mininet.node import Node
from mininet.log import info, warn
class PaxNode( Node ):
"PaxNode: A node which allows Pax to behave as the sole packet hander on that node."
def __init__(self, name, **params):
super(PaxNode, self).__init__(name, **params)
def config(self, **params):
super(PaxNode, self).config(**params)
# Setup iptable rules to drop incoming packets on each interface:
# Because Pax only sniffs packets (it doesn't steal them), we need to drop the packets
# to prevent the OS from handling them and responding.
for intf in self.intfList():
self.cmd("iptables -A INPUT -p tcp -i %s -j DROP" % intf.name)
# Disable ip_forward because otherwise, even with the above iptables rules, the OS
# will still forward packets that have a different IP on the other interfaces, which
# is not the behaviour we want from an ideal node that only processes packets through Pax.
self.cmd("sysctl -w net.ipv4.ip_forward=0")
def terminate(self):
# Remove iptables rules
for intf in self.intfList():
self.cmd("iptables -D INPUT -p tcp -i %s -j DROP" % intf.name)
super(PaxNode, self).terminate()
|
# coding: latin-1
"""
pax_mininet_node.py: Defines PaxNode which allows Pax to behave as the sole packet hander on a node.
"""
from mininet.node import Node
from mininet.log import info, warn
class PaxNode( Node ):
"PaxNode: A node which allows Pax to behave as the sole packet hander on that node."
def __init__(self, name, **params):
super(PaxNode, self).__init__(name, **params)
def config(self, **params):
super(PaxNode, self).config(**params)
# Setup iptable rules to drop incoming packets on each interface:
# Because Pax only sniffs packets (it doesn't steal them), we need to drop the packets
# to prevent the OS from handling them and responding.
for intf in self.intfList():
self.cmd("iptables -A INPUT -p tcp -i %s -j DROP" % intf.name)
# Disable ip_forward because otherwise this still happens, even with the above iptables rules
self.cmd("sysctl -w net.ipv4.ip_forward=0")
def terminate(self):
# Remove iptables rules
for intf in self.intfList():
self.cmd("iptables -D INPUT -p tcp -i %s -j DROP" % intf.name)
super(PaxNode, self).terminate()
Add comment explaining why we disable ip_forward# coding: latin-1
"""
pax_mininet_node.py: Defines PaxNode which allows Pax to behave as the sole packet hander on a node.
"""
from mininet.node import Node
from mininet.log import info, warn
class PaxNode( Node ):
"PaxNode: A node which allows Pax to behave as the sole packet hander on that node."
def __init__(self, name, **params):
super(PaxNode, self).__init__(name, **params)
def config(self, **params):
super(PaxNode, self).config(**params)
# Setup iptable rules to drop incoming packets on each interface:
# Because Pax only sniffs packets (it doesn't steal them), we need to drop the packets
# to prevent the OS from handling them and responding.
for intf in self.intfList():
self.cmd("iptables -A INPUT -p tcp -i %s -j DROP" % intf.name)
# Disable ip_forward because otherwise, even with the above iptables rules, the OS
# will still forward packets that have a different IP on the other interfaces, which
# is not the behaviour we want from an ideal node that only processes packets through Pax.
self.cmd("sysctl -w net.ipv4.ip_forward=0")
def terminate(self):
# Remove iptables rules
for intf in self.intfList():
self.cmd("iptables -D INPUT -p tcp -i %s -j DROP" % intf.name)
super(PaxNode, self).terminate()
|
<commit_before># coding: latin-1
"""
pax_mininet_node.py: Defines PaxNode which allows Pax to behave as the sole packet hander on a node.
"""
from mininet.node import Node
from mininet.log import info, warn
class PaxNode( Node ):
"PaxNode: A node which allows Pax to behave as the sole packet hander on that node."
def __init__(self, name, **params):
super(PaxNode, self).__init__(name, **params)
def config(self, **params):
super(PaxNode, self).config(**params)
# Setup iptable rules to drop incoming packets on each interface:
# Because Pax only sniffs packets (it doesn't steal them), we need to drop the packets
# to prevent the OS from handling them and responding.
for intf in self.intfList():
self.cmd("iptables -A INPUT -p tcp -i %s -j DROP" % intf.name)
# Disable ip_forward because otherwise this still happens, even with the above iptables rules
self.cmd("sysctl -w net.ipv4.ip_forward=0")
def terminate(self):
# Remove iptables rules
for intf in self.intfList():
self.cmd("iptables -D INPUT -p tcp -i %s -j DROP" % intf.name)
super(PaxNode, self).terminate()
<commit_msg>Add comment explaining why we disable ip_forward<commit_after># coding: latin-1
"""
pax_mininet_node.py: Defines PaxNode which allows Pax to behave as the sole packet hander on a node.
"""
from mininet.node import Node
from mininet.log import info, warn
class PaxNode( Node ):
"PaxNode: A node which allows Pax to behave as the sole packet hander on that node."
def __init__(self, name, **params):
super(PaxNode, self).__init__(name, **params)
def config(self, **params):
super(PaxNode, self).config(**params)
# Setup iptable rules to drop incoming packets on each interface:
# Because Pax only sniffs packets (it doesn't steal them), we need to drop the packets
# to prevent the OS from handling them and responding.
for intf in self.intfList():
self.cmd("iptables -A INPUT -p tcp -i %s -j DROP" % intf.name)
# Disable ip_forward because otherwise, even with the above iptables rules, the OS
# will still forward packets that have a different IP on the other interfaces, which
# is not the behaviour we want from an ideal node that only processes packets through Pax.
self.cmd("sysctl -w net.ipv4.ip_forward=0")
def terminate(self):
# Remove iptables rules
for intf in self.intfList():
self.cmd("iptables -D INPUT -p tcp -i %s -j DROP" % intf.name)
super(PaxNode, self).terminate()
|
3252a1e0f5b2991179d3fabe66f34a19f7cd85c9
|
src/DecodeTest.py
|
src/DecodeTest.py
|
import unittest
from Decode import Decoder
import Frames
class TestDecoder(unittest.TestCase):
"""
"""
def setUp(self):
self.decoder = Decoder()
def test_decoder_get_frame_class(self):
command = 'SEND'
self.assertEquals(self.decoder.get_frame_class(command), Frames.SEND)
def test_decoder_invalid_frame_class(self):
command = '---'
self.assertRaises(Exception, self.decoder.get_frame_class, command)
def test_decoder_decode_connect(self):
testFrame = Frames.CONNECT(**{"accept-version":"1.2", "host":"localhost"})
msg = "CONNECT\naccept-version:1.2\nhost:localhost\n\n\x00"
self.assertEquals(self.decoder.decode(msg).__dict__, testFrame.__dict__)
def test_decoder_decode_send(self):
testFrame = Frames.CONNECT(**{"accept-version":"1.2", "host":"localhost", "msg":"hello queue a"})
msg = "SEND\naccept-version:1.2\nhost:localhost\n\nhello queue a\x00"
self.assertEquals(self.decoder.decode(msg).__dict__, testFrame.__dict__)
if __name__ == '__main__':
unittest.main()
|
import unittest
from Decode import Decoder
import Frames
class TestDecoder(unittest.TestCase):
"""
"""
def setUp(self):
self.decoder = Decoder()
def test_decoder_get_frame_class(self):
command = 'SEND'
self.assertEquals(self.decoder.get_frame_class(command), Frames.SEND)
def test_decoder_invalid_frame_class(self):
command = '---'
self.assertRaises(Exception, self.decoder.get_frame_class, command)
def test_decoder_decode_connect(self):
testFrame = Frames.CONNECT(**{"accept-version":"1.2", "host":"localhost"})
msg = "CONNECT\naccept-version:1.2\nhost:localhost\n\n\x00"
self.assertEquals(self.decoder.decode(msg).__dict__, testFrame.__dict__)
def test_decoder_decode_connect_missing_req_header(self):
msg = "CONNECT\nhost:localhost\n\n\x00"
self.assertRaises(Exception, self.decoder.decode(msg))
def test_decoder_decode_send(self):
testFrame = Frames.SEND(**{"destination":"/queue/a", "msg":"hello queue a"})
msg = "SEND\ndestination:/queue/a\n\nhello queue a\x00"
self.assertEquals(self.decoder.decode(msg).__dict__, testFrame.__dict__)
def test_decoder_decode_send_missing_req_header(self):
msg = "SEND\n\nhello queue a\x00"
self.assertRaises(Exception, self.decoder.decode(msg))
if __name__ == '__main__':
unittest.main()
|
Send and Connect frame tests
|
Send and Connect frame tests
|
Python
|
mit
|
phan91/STOMP_agilis
|
import unittest
from Decode import Decoder
import Frames
class TestDecoder(unittest.TestCase):
"""
"""
def setUp(self):
self.decoder = Decoder()
def test_decoder_get_frame_class(self):
command = 'SEND'
self.assertEquals(self.decoder.get_frame_class(command), Frames.SEND)
def test_decoder_invalid_frame_class(self):
command = '---'
self.assertRaises(Exception, self.decoder.get_frame_class, command)
def test_decoder_decode_connect(self):
testFrame = Frames.CONNECT(**{"accept-version":"1.2", "host":"localhost"})
msg = "CONNECT\naccept-version:1.2\nhost:localhost\n\n\x00"
self.assertEquals(self.decoder.decode(msg).__dict__, testFrame.__dict__)
def test_decoder_decode_send(self):
testFrame = Frames.CONNECT(**{"accept-version":"1.2", "host":"localhost", "msg":"hello queue a"})
msg = "SEND\naccept-version:1.2\nhost:localhost\n\nhello queue a\x00"
self.assertEquals(self.decoder.decode(msg).__dict__, testFrame.__dict__)
if __name__ == '__main__':
unittest.main()Send and Connect frame tests
|
import unittest
from Decode import Decoder
import Frames
class TestDecoder(unittest.TestCase):
"""
"""
def setUp(self):
self.decoder = Decoder()
def test_decoder_get_frame_class(self):
command = 'SEND'
self.assertEquals(self.decoder.get_frame_class(command), Frames.SEND)
def test_decoder_invalid_frame_class(self):
command = '---'
self.assertRaises(Exception, self.decoder.get_frame_class, command)
def test_decoder_decode_connect(self):
testFrame = Frames.CONNECT(**{"accept-version":"1.2", "host":"localhost"})
msg = "CONNECT\naccept-version:1.2\nhost:localhost\n\n\x00"
self.assertEquals(self.decoder.decode(msg).__dict__, testFrame.__dict__)
def test_decoder_decode_connect_missing_req_header(self):
msg = "CONNECT\nhost:localhost\n\n\x00"
self.assertRaises(Exception, self.decoder.decode(msg))
def test_decoder_decode_send(self):
testFrame = Frames.SEND(**{"destination":"/queue/a", "msg":"hello queue a"})
msg = "SEND\ndestination:/queue/a\n\nhello queue a\x00"
self.assertEquals(self.decoder.decode(msg).__dict__, testFrame.__dict__)
def test_decoder_decode_send_missing_req_header(self):
msg = "SEND\n\nhello queue a\x00"
self.assertRaises(Exception, self.decoder.decode(msg))
if __name__ == '__main__':
unittest.main()
|
<commit_before>import unittest
from Decode import Decoder
import Frames
class TestDecoder(unittest.TestCase):
"""
"""
def setUp(self):
self.decoder = Decoder()
def test_decoder_get_frame_class(self):
command = 'SEND'
self.assertEquals(self.decoder.get_frame_class(command), Frames.SEND)
def test_decoder_invalid_frame_class(self):
command = '---'
self.assertRaises(Exception, self.decoder.get_frame_class, command)
def test_decoder_decode_connect(self):
testFrame = Frames.CONNECT(**{"accept-version":"1.2", "host":"localhost"})
msg = "CONNECT\naccept-version:1.2\nhost:localhost\n\n\x00"
self.assertEquals(self.decoder.decode(msg).__dict__, testFrame.__dict__)
def test_decoder_decode_send(self):
testFrame = Frames.CONNECT(**{"accept-version":"1.2", "host":"localhost", "msg":"hello queue a"})
msg = "SEND\naccept-version:1.2\nhost:localhost\n\nhello queue a\x00"
self.assertEquals(self.decoder.decode(msg).__dict__, testFrame.__dict__)
if __name__ == '__main__':
unittest.main()<commit_msg>Send and Connect frame tests<commit_after>
|
import unittest
from Decode import Decoder
import Frames
class TestDecoder(unittest.TestCase):
"""
"""
def setUp(self):
self.decoder = Decoder()
def test_decoder_get_frame_class(self):
command = 'SEND'
self.assertEquals(self.decoder.get_frame_class(command), Frames.SEND)
def test_decoder_invalid_frame_class(self):
command = '---'
self.assertRaises(Exception, self.decoder.get_frame_class, command)
def test_decoder_decode_connect(self):
testFrame = Frames.CONNECT(**{"accept-version":"1.2", "host":"localhost"})
msg = "CONNECT\naccept-version:1.2\nhost:localhost\n\n\x00"
self.assertEquals(self.decoder.decode(msg).__dict__, testFrame.__dict__)
def test_decoder_decode_connect_missing_req_header(self):
msg = "CONNECT\nhost:localhost\n\n\x00"
self.assertRaises(Exception, self.decoder.decode(msg))
def test_decoder_decode_send(self):
testFrame = Frames.SEND(**{"destination":"/queue/a", "msg":"hello queue a"})
msg = "SEND\ndestination:/queue/a\n\nhello queue a\x00"
self.assertEquals(self.decoder.decode(msg).__dict__, testFrame.__dict__)
def test_decoder_decode_send_missing_req_header(self):
msg = "SEND\n\nhello queue a\x00"
self.assertRaises(Exception, self.decoder.decode(msg))
if __name__ == '__main__':
unittest.main()
|
import unittest
from Decode import Decoder
import Frames
class TestDecoder(unittest.TestCase):
"""
"""
def setUp(self):
self.decoder = Decoder()
def test_decoder_get_frame_class(self):
command = 'SEND'
self.assertEquals(self.decoder.get_frame_class(command), Frames.SEND)
def test_decoder_invalid_frame_class(self):
command = '---'
self.assertRaises(Exception, self.decoder.get_frame_class, command)
def test_decoder_decode_connect(self):
testFrame = Frames.CONNECT(**{"accept-version":"1.2", "host":"localhost"})
msg = "CONNECT\naccept-version:1.2\nhost:localhost\n\n\x00"
self.assertEquals(self.decoder.decode(msg).__dict__, testFrame.__dict__)
def test_decoder_decode_send(self):
testFrame = Frames.CONNECT(**{"accept-version":"1.2", "host":"localhost", "msg":"hello queue a"})
msg = "SEND\naccept-version:1.2\nhost:localhost\n\nhello queue a\x00"
self.assertEquals(self.decoder.decode(msg).__dict__, testFrame.__dict__)
if __name__ == '__main__':
unittest.main()Send and Connect frame testsimport unittest
from Decode import Decoder
import Frames
class TestDecoder(unittest.TestCase):
"""
"""
def setUp(self):
self.decoder = Decoder()
def test_decoder_get_frame_class(self):
command = 'SEND'
self.assertEquals(self.decoder.get_frame_class(command), Frames.SEND)
def test_decoder_invalid_frame_class(self):
command = '---'
self.assertRaises(Exception, self.decoder.get_frame_class, command)
def test_decoder_decode_connect(self):
testFrame = Frames.CONNECT(**{"accept-version":"1.2", "host":"localhost"})
msg = "CONNECT\naccept-version:1.2\nhost:localhost\n\n\x00"
self.assertEquals(self.decoder.decode(msg).__dict__, testFrame.__dict__)
def test_decoder_decode_connect_missing_req_header(self):
msg = "CONNECT\nhost:localhost\n\n\x00"
self.assertRaises(Exception, self.decoder.decode(msg))
def test_decoder_decode_send(self):
testFrame = Frames.SEND(**{"destination":"/queue/a", "msg":"hello queue a"})
msg = "SEND\ndestination:/queue/a\n\nhello queue a\x00"
self.assertEquals(self.decoder.decode(msg).__dict__, testFrame.__dict__)
def test_decoder_decode_send_missing_req_header(self):
msg = "SEND\n\nhello queue a\x00"
self.assertRaises(Exception, self.decoder.decode(msg))
if __name__ == '__main__':
unittest.main()
|
<commit_before>import unittest
from Decode import Decoder
import Frames
class TestDecoder(unittest.TestCase):
"""
"""
def setUp(self):
self.decoder = Decoder()
def test_decoder_get_frame_class(self):
command = 'SEND'
self.assertEquals(self.decoder.get_frame_class(command), Frames.SEND)
def test_decoder_invalid_frame_class(self):
command = '---'
self.assertRaises(Exception, self.decoder.get_frame_class, command)
def test_decoder_decode_connect(self):
testFrame = Frames.CONNECT(**{"accept-version":"1.2", "host":"localhost"})
msg = "CONNECT\naccept-version:1.2\nhost:localhost\n\n\x00"
self.assertEquals(self.decoder.decode(msg).__dict__, testFrame.__dict__)
def test_decoder_decode_send(self):
testFrame = Frames.CONNECT(**{"accept-version":"1.2", "host":"localhost", "msg":"hello queue a"})
msg = "SEND\naccept-version:1.2\nhost:localhost\n\nhello queue a\x00"
self.assertEquals(self.decoder.decode(msg).__dict__, testFrame.__dict__)
if __name__ == '__main__':
unittest.main()<commit_msg>Send and Connect frame tests<commit_after>import unittest
from Decode import Decoder
import Frames
class TestDecoder(unittest.TestCase):
"""
"""
def setUp(self):
self.decoder = Decoder()
def test_decoder_get_frame_class(self):
command = 'SEND'
self.assertEquals(self.decoder.get_frame_class(command), Frames.SEND)
def test_decoder_invalid_frame_class(self):
command = '---'
self.assertRaises(Exception, self.decoder.get_frame_class, command)
def test_decoder_decode_connect(self):
testFrame = Frames.CONNECT(**{"accept-version":"1.2", "host":"localhost"})
msg = "CONNECT\naccept-version:1.2\nhost:localhost\n\n\x00"
self.assertEquals(self.decoder.decode(msg).__dict__, testFrame.__dict__)
def test_decoder_decode_connect_missing_req_header(self):
msg = "CONNECT\nhost:localhost\n\n\x00"
self.assertRaises(Exception, self.decoder.decode(msg))
def test_decoder_decode_send(self):
testFrame = Frames.SEND(**{"destination":"/queue/a", "msg":"hello queue a"})
msg = "SEND\ndestination:/queue/a\n\nhello queue a\x00"
self.assertEquals(self.decoder.decode(msg).__dict__, testFrame.__dict__)
def test_decoder_decode_send_missing_req_header(self):
msg = "SEND\n\nhello queue a\x00"
self.assertRaises(Exception, self.decoder.decode(msg))
if __name__ == '__main__':
unittest.main()
|
fb0b129216bd98a90cdee623157df5c7e4a742fb
|
blinkenlights/blinkenlights.py
|
blinkenlights/blinkenlights.py
|
#!/usr/bin/python3
import asyncio, signal, os
from blink import blink
import ipc.coordinator
loop = asyncio.get_event_loop()
def my_interrupt_handler():
print('Stopping')
for task in asyncio.Task.all_tasks():
task.cancel()
loop.stop()
loop.add_signal_handler(signal.SIGINT, my_interrupt_handler)
blink.start()
ipc.coordinator.start(loop)
try:
loop.run_forever()
except KeyboardInterrupt:
pass
except asyncio.CancelledError:
print('Tasks has been canceled')
finally:
ipc.coordinator.stop()
loop.close()
|
#!/usr/bin/python3
import asyncio, signal, os
from blink import blink
import ipc.coordinator
loop = asyncio.get_event_loop()
def my_interrupt_handler():
print('Stopping')
for task in asyncio.Task.all_tasks():
task.cancel()
loop.stop()
loop.add_signal_handler(signal.SIGINT, my_interrupt_handler)
blink.start()
ipc.coordinator.start(loop)
try:
loop.run_forever()
except KeyboardInterrupt:
pass
except asyncio.CancelledError:
print('Tasks has been canceled')
finally:
ipc.coordinator.stop()
os.remove('/tmp/coord.socket')
loop.close()
|
Clean up socket file on exiting
|
Clean up socket file on exiting
Change-Id: I34391c64408b5a35386913bd7be01d81feed61b6
|
Python
|
mit
|
fayoh/KSP-Control
|
#!/usr/bin/python3
import asyncio, signal, os
from blink import blink
import ipc.coordinator
loop = asyncio.get_event_loop()
def my_interrupt_handler():
print('Stopping')
for task in asyncio.Task.all_tasks():
task.cancel()
loop.stop()
loop.add_signal_handler(signal.SIGINT, my_interrupt_handler)
blink.start()
ipc.coordinator.start(loop)
try:
loop.run_forever()
except KeyboardInterrupt:
pass
except asyncio.CancelledError:
print('Tasks has been canceled')
finally:
ipc.coordinator.stop()
loop.close()
Clean up socket file on exiting
Change-Id: I34391c64408b5a35386913bd7be01d81feed61b6
|
#!/usr/bin/python3
import asyncio, signal, os
from blink import blink
import ipc.coordinator
loop = asyncio.get_event_loop()
def my_interrupt_handler():
print('Stopping')
for task in asyncio.Task.all_tasks():
task.cancel()
loop.stop()
loop.add_signal_handler(signal.SIGINT, my_interrupt_handler)
blink.start()
ipc.coordinator.start(loop)
try:
loop.run_forever()
except KeyboardInterrupt:
pass
except asyncio.CancelledError:
print('Tasks has been canceled')
finally:
ipc.coordinator.stop()
os.remove('/tmp/coord.socket')
loop.close()
|
<commit_before>#!/usr/bin/python3
import asyncio, signal, os
from blink import blink
import ipc.coordinator
loop = asyncio.get_event_loop()
def my_interrupt_handler():
print('Stopping')
for task in asyncio.Task.all_tasks():
task.cancel()
loop.stop()
loop.add_signal_handler(signal.SIGINT, my_interrupt_handler)
blink.start()
ipc.coordinator.start(loop)
try:
loop.run_forever()
except KeyboardInterrupt:
pass
except asyncio.CancelledError:
print('Tasks has been canceled')
finally:
ipc.coordinator.stop()
loop.close()
<commit_msg>Clean up socket file on exiting
Change-Id: I34391c64408b5a35386913bd7be01d81feed61b6<commit_after>
|
#!/usr/bin/python3
import asyncio, signal, os
from blink import blink
import ipc.coordinator
loop = asyncio.get_event_loop()
def my_interrupt_handler():
print('Stopping')
for task in asyncio.Task.all_tasks():
task.cancel()
loop.stop()
loop.add_signal_handler(signal.SIGINT, my_interrupt_handler)
blink.start()
ipc.coordinator.start(loop)
try:
loop.run_forever()
except KeyboardInterrupt:
pass
except asyncio.CancelledError:
print('Tasks has been canceled')
finally:
ipc.coordinator.stop()
os.remove('/tmp/coord.socket')
loop.close()
|
#!/usr/bin/python3
import asyncio, signal, os
from blink import blink
import ipc.coordinator
loop = asyncio.get_event_loop()
def my_interrupt_handler():
print('Stopping')
for task in asyncio.Task.all_tasks():
task.cancel()
loop.stop()
loop.add_signal_handler(signal.SIGINT, my_interrupt_handler)
blink.start()
ipc.coordinator.start(loop)
try:
loop.run_forever()
except KeyboardInterrupt:
pass
except asyncio.CancelledError:
print('Tasks has been canceled')
finally:
ipc.coordinator.stop()
loop.close()
Clean up socket file on exiting
Change-Id: I34391c64408b5a35386913bd7be01d81feed61b6#!/usr/bin/python3
import asyncio, signal, os
from blink import blink
import ipc.coordinator
loop = asyncio.get_event_loop()
def my_interrupt_handler():
print('Stopping')
for task in asyncio.Task.all_tasks():
task.cancel()
loop.stop()
loop.add_signal_handler(signal.SIGINT, my_interrupt_handler)
blink.start()
ipc.coordinator.start(loop)
try:
loop.run_forever()
except KeyboardInterrupt:
pass
except asyncio.CancelledError:
print('Tasks has been canceled')
finally:
ipc.coordinator.stop()
os.remove('/tmp/coord.socket')
loop.close()
|
<commit_before>#!/usr/bin/python3
import asyncio, signal, os
from blink import blink
import ipc.coordinator
loop = asyncio.get_event_loop()
def my_interrupt_handler():
print('Stopping')
for task in asyncio.Task.all_tasks():
task.cancel()
loop.stop()
loop.add_signal_handler(signal.SIGINT, my_interrupt_handler)
blink.start()
ipc.coordinator.start(loop)
try:
loop.run_forever()
except KeyboardInterrupt:
pass
except asyncio.CancelledError:
print('Tasks has been canceled')
finally:
ipc.coordinator.stop()
loop.close()
<commit_msg>Clean up socket file on exiting
Change-Id: I34391c64408b5a35386913bd7be01d81feed61b6<commit_after>#!/usr/bin/python3
import asyncio, signal, os
from blink import blink
import ipc.coordinator
loop = asyncio.get_event_loop()
def my_interrupt_handler():
print('Stopping')
for task in asyncio.Task.all_tasks():
task.cancel()
loop.stop()
loop.add_signal_handler(signal.SIGINT, my_interrupt_handler)
blink.start()
ipc.coordinator.start(loop)
try:
loop.run_forever()
except KeyboardInterrupt:
pass
except asyncio.CancelledError:
print('Tasks has been canceled')
finally:
ipc.coordinator.stop()
os.remove('/tmp/coord.socket')
loop.close()
|
3ccaf18243232d756ed139d9f84a6b3903af15f7
|
exploratory_analysis/author_scan.py
|
exploratory_analysis/author_scan.py
|
import os
from utils import Reader
import code
import sys
author_dict = dict()
def extract_authors(tweets):
# code.interact(local=dict(globals(), **locals()))
for t in tweets:
if t.is_post():
actor = t.actor()
create_key(actor['id'])
increment_author(actor, t.is_post())
elif t.is_share():
original_tweet = t.data['object']
actor = original_tweet['actor']
create_key(actor['id'])
increment_author(actor, t.is_post())
else:
print 'Neither post nor share:', t.id()
def increment_author(actor, is_post):
dict_value = author_dict[actor['id']]
dict_value[0] = actor['link']
dict_value[1] = actor['preferredUsername']
dict_value[2] = actor['displayName']
if is_post:
dict_value[3] += 1
else:
dict_value[4] += 1
def create_key(actor_id):
if actor_id not in author_dict.keys():
# link, username, display_name, post, post that gotten shared
default_value = ['', '', '', 0, 0]
author_dict[actor_id] = default_value
def print_all():
for k in author_dict.keys():
value = author_dict[k]
print '"{}","{}","{}","{}",{},{}'.format(k, value[0], value[1], value[2], value[3], value[4])
if __name__ == '__main__':
# coding=utf-8
reload(sys)
sys.setdefaultencoding('utf-8')
working_directory = os.getcwd()
files = Reader.read_directory(working_directory)
for f in files:
extract_authors(Reader.read_file(f))
print_all()
# code.interact(local=dict(globals(), **locals()))
|
import os
from utils import Reader
import code
import sys
def extract_authors(tweets):
for t in tweets:
if t.is_post():
actor = t.actor()
print '"{}","{}","{}","{}",{},{}'.format(actor['id'],
actor['link'],
actor['preferredUsername'],
actor['displayName'], 1, 0)
elif t.is_share():
original_tweet = t.data['object']
actor = original_tweet['actor']
print '"{}","{}","{}","{}",{},{}'.format(actor['id'],
actor['link'],
actor['preferredUsername'],
actor['displayName'], 0, 1)
else:
print 'Neither post nor share:', t.id()
if __name__ == '__main__':
# coding=utf-8
reload(sys)
sys.setdefaultencoding('utf-8')
working_directory = os.getcwd()
files = Reader.read_directory(working_directory)
for f in files:
extract_authors(Reader.read_file(f))
# code.interact(local=dict(globals(), **locals()))
|
Print everything out in csv and use tableau to do calculation
|
Print everything out in csv and use tableau to do calculation
|
Python
|
apache-2.0
|
chuajiesheng/twitter-sentiment-analysis
|
import os
from utils import Reader
import code
import sys
author_dict = dict()
def extract_authors(tweets):
# code.interact(local=dict(globals(), **locals()))
for t in tweets:
if t.is_post():
actor = t.actor()
create_key(actor['id'])
increment_author(actor, t.is_post())
elif t.is_share():
original_tweet = t.data['object']
actor = original_tweet['actor']
create_key(actor['id'])
increment_author(actor, t.is_post())
else:
print 'Neither post nor share:', t.id()
def increment_author(actor, is_post):
dict_value = author_dict[actor['id']]
dict_value[0] = actor['link']
dict_value[1] = actor['preferredUsername']
dict_value[2] = actor['displayName']
if is_post:
dict_value[3] += 1
else:
dict_value[4] += 1
def create_key(actor_id):
if actor_id not in author_dict.keys():
# link, username, display_name, post, post that gotten shared
default_value = ['', '', '', 0, 0]
author_dict[actor_id] = default_value
def print_all():
for k in author_dict.keys():
value = author_dict[k]
print '"{}","{}","{}","{}",{},{}'.format(k, value[0], value[1], value[2], value[3], value[4])
if __name__ == '__main__':
# coding=utf-8
reload(sys)
sys.setdefaultencoding('utf-8')
working_directory = os.getcwd()
files = Reader.read_directory(working_directory)
for f in files:
extract_authors(Reader.read_file(f))
print_all()
# code.interact(local=dict(globals(), **locals()))
Print everything out in csv and use tableau to do calculation
|
import os
from utils import Reader
import code
import sys
def extract_authors(tweets):
for t in tweets:
if t.is_post():
actor = t.actor()
print '"{}","{}","{}","{}",{},{}'.format(actor['id'],
actor['link'],
actor['preferredUsername'],
actor['displayName'], 1, 0)
elif t.is_share():
original_tweet = t.data['object']
actor = original_tweet['actor']
print '"{}","{}","{}","{}",{},{}'.format(actor['id'],
actor['link'],
actor['preferredUsername'],
actor['displayName'], 0, 1)
else:
print 'Neither post nor share:', t.id()
if __name__ == '__main__':
# coding=utf-8
reload(sys)
sys.setdefaultencoding('utf-8')
working_directory = os.getcwd()
files = Reader.read_directory(working_directory)
for f in files:
extract_authors(Reader.read_file(f))
# code.interact(local=dict(globals(), **locals()))
|
<commit_before>import os
from utils import Reader
import code
import sys
author_dict = dict()
def extract_authors(tweets):
# code.interact(local=dict(globals(), **locals()))
for t in tweets:
if t.is_post():
actor = t.actor()
create_key(actor['id'])
increment_author(actor, t.is_post())
elif t.is_share():
original_tweet = t.data['object']
actor = original_tweet['actor']
create_key(actor['id'])
increment_author(actor, t.is_post())
else:
print 'Neither post nor share:', t.id()
def increment_author(actor, is_post):
dict_value = author_dict[actor['id']]
dict_value[0] = actor['link']
dict_value[1] = actor['preferredUsername']
dict_value[2] = actor['displayName']
if is_post:
dict_value[3] += 1
else:
dict_value[4] += 1
def create_key(actor_id):
if actor_id not in author_dict.keys():
# link, username, display_name, post, post that gotten shared
default_value = ['', '', '', 0, 0]
author_dict[actor_id] = default_value
def print_all():
for k in author_dict.keys():
value = author_dict[k]
print '"{}","{}","{}","{}",{},{}'.format(k, value[0], value[1], value[2], value[3], value[4])
if __name__ == '__main__':
# coding=utf-8
reload(sys)
sys.setdefaultencoding('utf-8')
working_directory = os.getcwd()
files = Reader.read_directory(working_directory)
for f in files:
extract_authors(Reader.read_file(f))
print_all()
# code.interact(local=dict(globals(), **locals()))
<commit_msg>Print everything out in csv and use tableau to do calculation<commit_after>
|
import os
from utils import Reader
import code
import sys
def extract_authors(tweets):
for t in tweets:
if t.is_post():
actor = t.actor()
print '"{}","{}","{}","{}",{},{}'.format(actor['id'],
actor['link'],
actor['preferredUsername'],
actor['displayName'], 1, 0)
elif t.is_share():
original_tweet = t.data['object']
actor = original_tweet['actor']
print '"{}","{}","{}","{}",{},{}'.format(actor['id'],
actor['link'],
actor['preferredUsername'],
actor['displayName'], 0, 1)
else:
print 'Neither post nor share:', t.id()
if __name__ == '__main__':
# coding=utf-8
reload(sys)
sys.setdefaultencoding('utf-8')
working_directory = os.getcwd()
files = Reader.read_directory(working_directory)
for f in files:
extract_authors(Reader.read_file(f))
# code.interact(local=dict(globals(), **locals()))
|
import os
from utils import Reader
import code
import sys
author_dict = dict()
def extract_authors(tweets):
# code.interact(local=dict(globals(), **locals()))
for t in tweets:
if t.is_post():
actor = t.actor()
create_key(actor['id'])
increment_author(actor, t.is_post())
elif t.is_share():
original_tweet = t.data['object']
actor = original_tweet['actor']
create_key(actor['id'])
increment_author(actor, t.is_post())
else:
print 'Neither post nor share:', t.id()
def increment_author(actor, is_post):
dict_value = author_dict[actor['id']]
dict_value[0] = actor['link']
dict_value[1] = actor['preferredUsername']
dict_value[2] = actor['displayName']
if is_post:
dict_value[3] += 1
else:
dict_value[4] += 1
def create_key(actor_id):
if actor_id not in author_dict.keys():
# link, username, display_name, post, post that gotten shared
default_value = ['', '', '', 0, 0]
author_dict[actor_id] = default_value
def print_all():
for k in author_dict.keys():
value = author_dict[k]
print '"{}","{}","{}","{}",{},{}'.format(k, value[0], value[1], value[2], value[3], value[4])
if __name__ == '__main__':
# coding=utf-8
reload(sys)
sys.setdefaultencoding('utf-8')
working_directory = os.getcwd()
files = Reader.read_directory(working_directory)
for f in files:
extract_authors(Reader.read_file(f))
print_all()
# code.interact(local=dict(globals(), **locals()))
Print everything out in csv and use tableau to do calculationimport os
from utils import Reader
import code
import sys
def extract_authors(tweets):
for t in tweets:
if t.is_post():
actor = t.actor()
print '"{}","{}","{}","{}",{},{}'.format(actor['id'],
actor['link'],
actor['preferredUsername'],
actor['displayName'], 1, 0)
elif t.is_share():
original_tweet = t.data['object']
actor = original_tweet['actor']
print '"{}","{}","{}","{}",{},{}'.format(actor['id'],
actor['link'],
actor['preferredUsername'],
actor['displayName'], 0, 1)
else:
print 'Neither post nor share:', t.id()
if __name__ == '__main__':
# coding=utf-8
reload(sys)
sys.setdefaultencoding('utf-8')
working_directory = os.getcwd()
files = Reader.read_directory(working_directory)
for f in files:
extract_authors(Reader.read_file(f))
# code.interact(local=dict(globals(), **locals()))
|
<commit_before>import os
from utils import Reader
import code
import sys
author_dict = dict()
def extract_authors(tweets):
# code.interact(local=dict(globals(), **locals()))
for t in tweets:
if t.is_post():
actor = t.actor()
create_key(actor['id'])
increment_author(actor, t.is_post())
elif t.is_share():
original_tweet = t.data['object']
actor = original_tweet['actor']
create_key(actor['id'])
increment_author(actor, t.is_post())
else:
print 'Neither post nor share:', t.id()
def increment_author(actor, is_post):
dict_value = author_dict[actor['id']]
dict_value[0] = actor['link']
dict_value[1] = actor['preferredUsername']
dict_value[2] = actor['displayName']
if is_post:
dict_value[3] += 1
else:
dict_value[4] += 1
def create_key(actor_id):
if actor_id not in author_dict.keys():
# link, username, display_name, post, post that gotten shared
default_value = ['', '', '', 0, 0]
author_dict[actor_id] = default_value
def print_all():
for k in author_dict.keys():
value = author_dict[k]
print '"{}","{}","{}","{}",{},{}'.format(k, value[0], value[1], value[2], value[3], value[4])
if __name__ == '__main__':
# coding=utf-8
reload(sys)
sys.setdefaultencoding('utf-8')
working_directory = os.getcwd()
files = Reader.read_directory(working_directory)
for f in files:
extract_authors(Reader.read_file(f))
print_all()
# code.interact(local=dict(globals(), **locals()))
<commit_msg>Print everything out in csv and use tableau to do calculation<commit_after>import os
from utils import Reader
import code
import sys
def extract_authors(tweets):
for t in tweets:
if t.is_post():
actor = t.actor()
print '"{}","{}","{}","{}",{},{}'.format(actor['id'],
actor['link'],
actor['preferredUsername'],
actor['displayName'], 1, 0)
elif t.is_share():
original_tweet = t.data['object']
actor = original_tweet['actor']
print '"{}","{}","{}","{}",{},{}'.format(actor['id'],
actor['link'],
actor['preferredUsername'],
actor['displayName'], 0, 1)
else:
print 'Neither post nor share:', t.id()
if __name__ == '__main__':
# coding=utf-8
reload(sys)
sys.setdefaultencoding('utf-8')
working_directory = os.getcwd()
files = Reader.read_directory(working_directory)
for f in files:
extract_authors(Reader.read_file(f))
# code.interact(local=dict(globals(), **locals()))
|
9d651a1cdb92d7d8ba039fce97a11de085b54990
|
polymorphic/formsets/utils.py
|
polymorphic/formsets/utils.py
|
"""
Internal utils
"""
import django
def add_media(dest, media):
"""
Optimized version of django.forms.Media.__add__() that doesn't create new objects.
Only required for Django < 2.0
"""
if django.VERSION >= (2, 0):
dest += media
else:
dest.add_css(media._css)
dest.add_js(media._js)
|
"""
Internal utils
"""
import django
def add_media(dest, media):
"""
Optimized version of django.forms.Media.__add__() that doesn't create new objects.
Only required for Django < 2.0
"""
if django.VERSION >= (2, 0):
combined = dest + media
dest._css = combined._css
dest._js = combined._js
else:
dest.add_css(media._css)
dest.add_js(media._js)
|
Fix the add_media() hack for Django 2.0
|
Fix the add_media() hack for Django 2.0
|
Python
|
bsd-3-clause
|
chrisglass/django_polymorphic,chrisglass/django_polymorphic
|
"""
Internal utils
"""
import django
def add_media(dest, media):
"""
Optimized version of django.forms.Media.__add__() that doesn't create new objects.
Only required for Django < 2.0
"""
if django.VERSION >= (2, 0):
dest += media
else:
dest.add_css(media._css)
dest.add_js(media._js)
Fix the add_media() hack for Django 2.0
|
"""
Internal utils
"""
import django
def add_media(dest, media):
"""
Optimized version of django.forms.Media.__add__() that doesn't create new objects.
Only required for Django < 2.0
"""
if django.VERSION >= (2, 0):
combined = dest + media
dest._css = combined._css
dest._js = combined._js
else:
dest.add_css(media._css)
dest.add_js(media._js)
|
<commit_before>"""
Internal utils
"""
import django
def add_media(dest, media):
"""
Optimized version of django.forms.Media.__add__() that doesn't create new objects.
Only required for Django < 2.0
"""
if django.VERSION >= (2, 0):
dest += media
else:
dest.add_css(media._css)
dest.add_js(media._js)
<commit_msg>Fix the add_media() hack for Django 2.0<commit_after>
|
"""
Internal utils
"""
import django
def add_media(dest, media):
"""
Optimized version of django.forms.Media.__add__() that doesn't create new objects.
Only required for Django < 2.0
"""
if django.VERSION >= (2, 0):
combined = dest + media
dest._css = combined._css
dest._js = combined._js
else:
dest.add_css(media._css)
dest.add_js(media._js)
|
"""
Internal utils
"""
import django
def add_media(dest, media):
"""
Optimized version of django.forms.Media.__add__() that doesn't create new objects.
Only required for Django < 2.0
"""
if django.VERSION >= (2, 0):
dest += media
else:
dest.add_css(media._css)
dest.add_js(media._js)
Fix the add_media() hack for Django 2.0"""
Internal utils
"""
import django
def add_media(dest, media):
"""
Optimized version of django.forms.Media.__add__() that doesn't create new objects.
Only required for Django < 2.0
"""
if django.VERSION >= (2, 0):
combined = dest + media
dest._css = combined._css
dest._js = combined._js
else:
dest.add_css(media._css)
dest.add_js(media._js)
|
<commit_before>"""
Internal utils
"""
import django
def add_media(dest, media):
"""
Optimized version of django.forms.Media.__add__() that doesn't create new objects.
Only required for Django < 2.0
"""
if django.VERSION >= (2, 0):
dest += media
else:
dest.add_css(media._css)
dest.add_js(media._js)
<commit_msg>Fix the add_media() hack for Django 2.0<commit_after>"""
Internal utils
"""
import django
def add_media(dest, media):
"""
Optimized version of django.forms.Media.__add__() that doesn't create new objects.
Only required for Django < 2.0
"""
if django.VERSION >= (2, 0):
combined = dest + media
dest._css = combined._css
dest._js = combined._js
else:
dest.add_css(media._css)
dest.add_js(media._js)
|
94e3572a4049b0eb0ff0d762a3bce5248a5bd507
|
src/sas/sasgui/perspectives/file_converter/file_converter.py
|
src/sas/sasgui/perspectives/file_converter/file_converter.py
|
"""
File Converter Plugin
"""
import logging
from sas.sasgui.guiframe.plugin_base import PluginBase
from sas.sasgui.perspectives.file_converter.converter_panel import ConverterWindow
logger = logging.getLogger(__name__)
class Plugin(PluginBase):
"""
This class defines the interface for a Plugin class
for File Converter perspective
"""
def __init__(self):
PluginBase.__init__(self, name="File Converter")
logger.info("File Converter plug-in started")
self._sub_menu = "Tool"
self.converter_frame = None
def get_tools(self):
"""
Returns a set of menu entries
"""
help_txt = "Convert single column ASCII data to CanSAS format"
return [("File Converter", help_txt, self.on_file_converter)]
def on_file_converter(self, event):
if self.converter_frame is None:
frame = ConverterWindow(parent=self.parent, base=self.parent,
manager=self)
self.put_icon(frame)
self.converter_frame = frame
else:
self.converter_frame.Show(False)
self.converter_frame.Show(True)
def put_icon(self, frame):
"""
Put icon in the frame title bar
"""
if hasattr(frame, "IsIconized"):
if not frame.IsIconized():
try:
icon = self.parent.GetIcon()
frame.SetIcon(icon)
except:
pass
|
"""
File Converter Plugin
"""
import logging
from sas.sasgui.guiframe.plugin_base import PluginBase
from sas.sasgui.perspectives.file_converter.converter_panel import ConverterWindow
logger = logging.getLogger(__name__)
class Plugin(PluginBase):
"""
This class defines the interface for a Plugin class
for File Converter perspective
"""
def __init__(self):
PluginBase.__init__(self, name="File Converter")
logger.info("File Converter plug-in started")
self._sub_menu = "Tool"
self.converter_frame = None
def get_tools(self):
"""
Returns a set of menu entries
"""
help_txt = "Convert ASCII or BSL/OTOKO data to CanSAS or NXcanSAS formats"
return [("File Converter", help_txt, self.on_file_converter)]
def on_file_converter(self, event):
if self.converter_frame is None:
frame = ConverterWindow(parent=self.parent, base=self.parent,
manager=self)
self.put_icon(frame)
self.converter_frame = frame
else:
self.converter_frame.Show(False)
self.converter_frame.Show(True)
def put_icon(self, frame):
"""
Put icon in the frame title bar
"""
if hasattr(frame, "IsIconized"):
if not frame.IsIconized():
try:
icon = self.parent.GetIcon()
frame.SetIcon(icon)
except:
pass
|
Update file converter tooltip in tools menu
|
Update file converter tooltip in tools menu
|
Python
|
bsd-3-clause
|
SasView/sasview,SasView/sasview,lewisodriscoll/sasview,SasView/sasview,SasView/sasview,SasView/sasview,lewisodriscoll/sasview,lewisodriscoll/sasview,SasView/sasview,lewisodriscoll/sasview,lewisodriscoll/sasview
|
"""
File Converter Plugin
"""
import logging
from sas.sasgui.guiframe.plugin_base import PluginBase
from sas.sasgui.perspectives.file_converter.converter_panel import ConverterWindow
logger = logging.getLogger(__name__)
class Plugin(PluginBase):
"""
This class defines the interface for a Plugin class
for File Converter perspective
"""
def __init__(self):
PluginBase.__init__(self, name="File Converter")
logger.info("File Converter plug-in started")
self._sub_menu = "Tool"
self.converter_frame = None
def get_tools(self):
"""
Returns a set of menu entries
"""
help_txt = "Convert single column ASCII data to CanSAS format"
return [("File Converter", help_txt, self.on_file_converter)]
def on_file_converter(self, event):
if self.converter_frame is None:
frame = ConverterWindow(parent=self.parent, base=self.parent,
manager=self)
self.put_icon(frame)
self.converter_frame = frame
else:
self.converter_frame.Show(False)
self.converter_frame.Show(True)
def put_icon(self, frame):
"""
Put icon in the frame title bar
"""
if hasattr(frame, "IsIconized"):
if not frame.IsIconized():
try:
icon = self.parent.GetIcon()
frame.SetIcon(icon)
except:
pass
Update file converter tooltip in tools menu
|
"""
File Converter Plugin
"""
import logging
from sas.sasgui.guiframe.plugin_base import PluginBase
from sas.sasgui.perspectives.file_converter.converter_panel import ConverterWindow
logger = logging.getLogger(__name__)
class Plugin(PluginBase):
"""
This class defines the interface for a Plugin class
for File Converter perspective
"""
def __init__(self):
PluginBase.__init__(self, name="File Converter")
logger.info("File Converter plug-in started")
self._sub_menu = "Tool"
self.converter_frame = None
def get_tools(self):
"""
Returns a set of menu entries
"""
help_txt = "Convert ASCII or BSL/OTOKO data to CanSAS or NXcanSAS formats"
return [("File Converter", help_txt, self.on_file_converter)]
def on_file_converter(self, event):
if self.converter_frame is None:
frame = ConverterWindow(parent=self.parent, base=self.parent,
manager=self)
self.put_icon(frame)
self.converter_frame = frame
else:
self.converter_frame.Show(False)
self.converter_frame.Show(True)
def put_icon(self, frame):
"""
Put icon in the frame title bar
"""
if hasattr(frame, "IsIconized"):
if not frame.IsIconized():
try:
icon = self.parent.GetIcon()
frame.SetIcon(icon)
except:
pass
|
<commit_before>"""
File Converter Plugin
"""
import logging
from sas.sasgui.guiframe.plugin_base import PluginBase
from sas.sasgui.perspectives.file_converter.converter_panel import ConverterWindow
logger = logging.getLogger(__name__)
class Plugin(PluginBase):
"""
This class defines the interface for a Plugin class
for File Converter perspective
"""
def __init__(self):
PluginBase.__init__(self, name="File Converter")
logger.info("File Converter plug-in started")
self._sub_menu = "Tool"
self.converter_frame = None
def get_tools(self):
"""
Returns a set of menu entries
"""
help_txt = "Convert single column ASCII data to CanSAS format"
return [("File Converter", help_txt, self.on_file_converter)]
def on_file_converter(self, event):
if self.converter_frame is None:
frame = ConverterWindow(parent=self.parent, base=self.parent,
manager=self)
self.put_icon(frame)
self.converter_frame = frame
else:
self.converter_frame.Show(False)
self.converter_frame.Show(True)
def put_icon(self, frame):
"""
Put icon in the frame title bar
"""
if hasattr(frame, "IsIconized"):
if not frame.IsIconized():
try:
icon = self.parent.GetIcon()
frame.SetIcon(icon)
except:
pass
<commit_msg>Update file converter tooltip in tools menu<commit_after>
|
"""
File Converter Plugin
"""
import logging
from sas.sasgui.guiframe.plugin_base import PluginBase
from sas.sasgui.perspectives.file_converter.converter_panel import ConverterWindow
logger = logging.getLogger(__name__)
class Plugin(PluginBase):
"""
This class defines the interface for a Plugin class
for File Converter perspective
"""
def __init__(self):
PluginBase.__init__(self, name="File Converter")
logger.info("File Converter plug-in started")
self._sub_menu = "Tool"
self.converter_frame = None
def get_tools(self):
"""
Returns a set of menu entries
"""
help_txt = "Convert ASCII or BSL/OTOKO data to CanSAS or NXcanSAS formats"
return [("File Converter", help_txt, self.on_file_converter)]
def on_file_converter(self, event):
if self.converter_frame is None:
frame = ConverterWindow(parent=self.parent, base=self.parent,
manager=self)
self.put_icon(frame)
self.converter_frame = frame
else:
self.converter_frame.Show(False)
self.converter_frame.Show(True)
def put_icon(self, frame):
"""
Put icon in the frame title bar
"""
if hasattr(frame, "IsIconized"):
if not frame.IsIconized():
try:
icon = self.parent.GetIcon()
frame.SetIcon(icon)
except:
pass
|
"""
File Converter Plugin
"""
import logging
from sas.sasgui.guiframe.plugin_base import PluginBase
from sas.sasgui.perspectives.file_converter.converter_panel import ConverterWindow
logger = logging.getLogger(__name__)
class Plugin(PluginBase):
"""
This class defines the interface for a Plugin class
for File Converter perspective
"""
def __init__(self):
PluginBase.__init__(self, name="File Converter")
logger.info("File Converter plug-in started")
self._sub_menu = "Tool"
self.converter_frame = None
def get_tools(self):
"""
Returns a set of menu entries
"""
help_txt = "Convert single column ASCII data to CanSAS format"
return [("File Converter", help_txt, self.on_file_converter)]
def on_file_converter(self, event):
if self.converter_frame is None:
frame = ConverterWindow(parent=self.parent, base=self.parent,
manager=self)
self.put_icon(frame)
self.converter_frame = frame
else:
self.converter_frame.Show(False)
self.converter_frame.Show(True)
def put_icon(self, frame):
"""
Put icon in the frame title bar
"""
if hasattr(frame, "IsIconized"):
if not frame.IsIconized():
try:
icon = self.parent.GetIcon()
frame.SetIcon(icon)
except:
pass
Update file converter tooltip in tools menu"""
File Converter Plugin
"""
import logging
from sas.sasgui.guiframe.plugin_base import PluginBase
from sas.sasgui.perspectives.file_converter.converter_panel import ConverterWindow
logger = logging.getLogger(__name__)
class Plugin(PluginBase):
"""
This class defines the interface for a Plugin class
for File Converter perspective
"""
def __init__(self):
PluginBase.__init__(self, name="File Converter")
logger.info("File Converter plug-in started")
self._sub_menu = "Tool"
self.converter_frame = None
def get_tools(self):
"""
Returns a set of menu entries
"""
help_txt = "Convert ASCII or BSL/OTOKO data to CanSAS or NXcanSAS formats"
return [("File Converter", help_txt, self.on_file_converter)]
def on_file_converter(self, event):
if self.converter_frame is None:
frame = ConverterWindow(parent=self.parent, base=self.parent,
manager=self)
self.put_icon(frame)
self.converter_frame = frame
else:
self.converter_frame.Show(False)
self.converter_frame.Show(True)
def put_icon(self, frame):
"""
Put icon in the frame title bar
"""
if hasattr(frame, "IsIconized"):
if not frame.IsIconized():
try:
icon = self.parent.GetIcon()
frame.SetIcon(icon)
except:
pass
|
<commit_before>"""
File Converter Plugin
"""
import logging
from sas.sasgui.guiframe.plugin_base import PluginBase
from sas.sasgui.perspectives.file_converter.converter_panel import ConverterWindow
logger = logging.getLogger(__name__)
class Plugin(PluginBase):
"""
This class defines the interface for a Plugin class
for File Converter perspective
"""
def __init__(self):
PluginBase.__init__(self, name="File Converter")
logger.info("File Converter plug-in started")
self._sub_menu = "Tool"
self.converter_frame = None
def get_tools(self):
"""
Returns a set of menu entries
"""
help_txt = "Convert single column ASCII data to CanSAS format"
return [("File Converter", help_txt, self.on_file_converter)]
def on_file_converter(self, event):
if self.converter_frame is None:
frame = ConverterWindow(parent=self.parent, base=self.parent,
manager=self)
self.put_icon(frame)
self.converter_frame = frame
else:
self.converter_frame.Show(False)
self.converter_frame.Show(True)
def put_icon(self, frame):
"""
Put icon in the frame title bar
"""
if hasattr(frame, "IsIconized"):
if not frame.IsIconized():
try:
icon = self.parent.GetIcon()
frame.SetIcon(icon)
except:
pass
<commit_msg>Update file converter tooltip in tools menu<commit_after>"""
File Converter Plugin
"""
import logging
from sas.sasgui.guiframe.plugin_base import PluginBase
from sas.sasgui.perspectives.file_converter.converter_panel import ConverterWindow
logger = logging.getLogger(__name__)
class Plugin(PluginBase):
"""
This class defines the interface for a Plugin class
for File Converter perspective
"""
def __init__(self):
PluginBase.__init__(self, name="File Converter")
logger.info("File Converter plug-in started")
self._sub_menu = "Tool"
self.converter_frame = None
def get_tools(self):
"""
Returns a set of menu entries
"""
help_txt = "Convert ASCII or BSL/OTOKO data to CanSAS or NXcanSAS formats"
return [("File Converter", help_txt, self.on_file_converter)]
def on_file_converter(self, event):
if self.converter_frame is None:
frame = ConverterWindow(parent=self.parent, base=self.parent,
manager=self)
self.put_icon(frame)
self.converter_frame = frame
else:
self.converter_frame.Show(False)
self.converter_frame.Show(True)
def put_icon(self, frame):
"""
Put icon in the frame title bar
"""
if hasattr(frame, "IsIconized"):
if not frame.IsIconized():
try:
icon = self.parent.GetIcon()
frame.SetIcon(icon)
except:
pass
|
4712e870bec7c678f88af3d7b54fcf7c8b040795
|
salt/modules/http.py
|
salt/modules/http.py
|
# -*- coding: utf-8 -*-
'''
Module for making various web calls. Primarily designed for webhooks and the
like, but also useful for basic http testing.
'''
from __future__ import absolute_import
# Import salt libs
import salt.utils.http
def query(url, **kwargs):
'''
Query a resource, and decode the return data
CLI Example:
.. code-block:: bash
salt '*' http.query http://somelink.com/
salt '*' http.query http://somelink.com/ method=POST \
params='key1=val1&key2=val2'
salt '*' http.query http://somelink.com/ method=POST \
data='<xml>somecontent</xml>'
'''
return salt.utils.http.query(url=url, opts=__opts__, **kwargs)
|
# -*- coding: utf-8 -*-
'''
Module for making various web calls. Primarily designed for webhooks and the
like, but also useful for basic http testing.
'''
from __future__ import absolute_import
# Import salt libs
import salt.utils.http
def query(url, **kwargs):
'''
Query a resource, and decode the return data
CLI Example:
.. code-block:: bash
salt '*' http.query http://somelink.com/
salt '*' http.query http://somelink.com/ method=POST \
params='key1=val1&key2=val2'
salt '*' http.query http://somelink.com/ method=POST \
data='<xml>somecontent</xml>'
'''
return salt.utils.http.query(url=url, opts=__opts__, **kwargs)
def update_ca_bundle(target=None, source=None, merge_files=None):
'''
Update the local CA bundle file from a URL
CLI Example:
.. code-block:: bash
salt '*' http.update_ca_bundle
salt '*' http.update_ca_bundle target=/path/to/cacerts.pem
salt '*' http.update_ca_bundle source=https://example.com/cacerts.pem
If the ``target`` is not specified, it will be pulled from the ``ca_cert``
configuration variable available to the minion. If it cannot be found there,
it will be placed at ``<<FILE_ROOTS>>/cacerts.pem``.
If the ``source`` is not specified, it will be pulled from the
``ca_cert_url`` configuration variable available to the minion. If it cannot
be found, it will be downloaded from the cURL website, using an http (not
https) URL. USING THE DEFAULT URL SHOULD BE AVOIDED!
``merge_files`` may also be specified, which includes a string or list of
strings representing a file or files to be appended to the end of the CA
bundle, once it is downloaded.
CLI Example:
.. code-block:: bash
salt '*' http.update_ca_bundle merge_files=/path/to/mycert.pem
'''
if target is None:
target = __salt__['config.get']('ca_bundle', None)
if source is None:
source = __salt__['config.get']('ca_bundle_url', None)
return salt.utils.http.update_ca_bundle(
target, source, __opts__, merge_files
)
|
Allow execution module to update_ca_bundle
|
Allow execution module to update_ca_bundle
|
Python
|
apache-2.0
|
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
|
# -*- coding: utf-8 -*-
'''
Module for making various web calls. Primarily designed for webhooks and the
like, but also useful for basic http testing.
'''
from __future__ import absolute_import
# Import salt libs
import salt.utils.http
def query(url, **kwargs):
'''
Query a resource, and decode the return data
CLI Example:
.. code-block:: bash
salt '*' http.query http://somelink.com/
salt '*' http.query http://somelink.com/ method=POST \
params='key1=val1&key2=val2'
salt '*' http.query http://somelink.com/ method=POST \
data='<xml>somecontent</xml>'
'''
return salt.utils.http.query(url=url, opts=__opts__, **kwargs)
Allow execution module to update_ca_bundle
|
# -*- coding: utf-8 -*-
'''
Module for making various web calls. Primarily designed for webhooks and the
like, but also useful for basic http testing.
'''
from __future__ import absolute_import
# Import salt libs
import salt.utils.http
def query(url, **kwargs):
'''
Query a resource, and decode the return data
CLI Example:
.. code-block:: bash
salt '*' http.query http://somelink.com/
salt '*' http.query http://somelink.com/ method=POST \
params='key1=val1&key2=val2'
salt '*' http.query http://somelink.com/ method=POST \
data='<xml>somecontent</xml>'
'''
return salt.utils.http.query(url=url, opts=__opts__, **kwargs)
def update_ca_bundle(target=None, source=None, merge_files=None):
'''
Update the local CA bundle file from a URL
CLI Example:
.. code-block:: bash
salt '*' http.update_ca_bundle
salt '*' http.update_ca_bundle target=/path/to/cacerts.pem
salt '*' http.update_ca_bundle source=https://example.com/cacerts.pem
If the ``target`` is not specified, it will be pulled from the ``ca_cert``
configuration variable available to the minion. If it cannot be found there,
it will be placed at ``<<FILE_ROOTS>>/cacerts.pem``.
If the ``source`` is not specified, it will be pulled from the
``ca_cert_url`` configuration variable available to the minion. If it cannot
be found, it will be downloaded from the cURL website, using an http (not
https) URL. USING THE DEFAULT URL SHOULD BE AVOIDED!
``merge_files`` may also be specified, which includes a string or list of
strings representing a file or files to be appended to the end of the CA
bundle, once it is downloaded.
CLI Example:
.. code-block:: bash
salt '*' http.update_ca_bundle merge_files=/path/to/mycert.pem
'''
if target is None:
target = __salt__['config.get']('ca_bundle', None)
if source is None:
source = __salt__['config.get']('ca_bundle_url', None)
return salt.utils.http.update_ca_bundle(
target, source, __opts__, merge_files
)
|
<commit_before># -*- coding: utf-8 -*-
'''
Module for making various web calls. Primarily designed for webhooks and the
like, but also useful for basic http testing.
'''
from __future__ import absolute_import
# Import salt libs
import salt.utils.http
def query(url, **kwargs):
'''
Query a resource, and decode the return data
CLI Example:
.. code-block:: bash
salt '*' http.query http://somelink.com/
salt '*' http.query http://somelink.com/ method=POST \
params='key1=val1&key2=val2'
salt '*' http.query http://somelink.com/ method=POST \
data='<xml>somecontent</xml>'
'''
return salt.utils.http.query(url=url, opts=__opts__, **kwargs)
<commit_msg>Allow execution module to update_ca_bundle<commit_after>
|
# -*- coding: utf-8 -*-
'''
Module for making various web calls. Primarily designed for webhooks and the
like, but also useful for basic http testing.
'''
from __future__ import absolute_import
# Import salt libs
import salt.utils.http
def query(url, **kwargs):
'''
Query a resource, and decode the return data
CLI Example:
.. code-block:: bash
salt '*' http.query http://somelink.com/
salt '*' http.query http://somelink.com/ method=POST \
params='key1=val1&key2=val2'
salt '*' http.query http://somelink.com/ method=POST \
data='<xml>somecontent</xml>'
'''
return salt.utils.http.query(url=url, opts=__opts__, **kwargs)
def update_ca_bundle(target=None, source=None, merge_files=None):
'''
Update the local CA bundle file from a URL
CLI Example:
.. code-block:: bash
salt '*' http.update_ca_bundle
salt '*' http.update_ca_bundle target=/path/to/cacerts.pem
salt '*' http.update_ca_bundle source=https://example.com/cacerts.pem
If the ``target`` is not specified, it will be pulled from the ``ca_cert``
configuration variable available to the minion. If it cannot be found there,
it will be placed at ``<<FILE_ROOTS>>/cacerts.pem``.
If the ``source`` is not specified, it will be pulled from the
``ca_cert_url`` configuration variable available to the minion. If it cannot
be found, it will be downloaded from the cURL website, using an http (not
https) URL. USING THE DEFAULT URL SHOULD BE AVOIDED!
``merge_files`` may also be specified, which includes a string or list of
strings representing a file or files to be appended to the end of the CA
bundle, once it is downloaded.
CLI Example:
.. code-block:: bash
salt '*' http.update_ca_bundle merge_files=/path/to/mycert.pem
'''
if target is None:
target = __salt__['config.get']('ca_bundle', None)
if source is None:
source = __salt__['config.get']('ca_bundle_url', None)
return salt.utils.http.update_ca_bundle(
target, source, __opts__, merge_files
)
|
# -*- coding: utf-8 -*-
'''
Module for making various web calls. Primarily designed for webhooks and the
like, but also useful for basic http testing.
'''
from __future__ import absolute_import
# Import salt libs
import salt.utils.http
def query(url, **kwargs):
'''
Query a resource, and decode the return data
CLI Example:
.. code-block:: bash
salt '*' http.query http://somelink.com/
salt '*' http.query http://somelink.com/ method=POST \
params='key1=val1&key2=val2'
salt '*' http.query http://somelink.com/ method=POST \
data='<xml>somecontent</xml>'
'''
return salt.utils.http.query(url=url, opts=__opts__, **kwargs)
Allow execution module to update_ca_bundle# -*- coding: utf-8 -*-
'''
Module for making various web calls. Primarily designed for webhooks and the
like, but also useful for basic http testing.
'''
from __future__ import absolute_import
# Import salt libs
import salt.utils.http
def query(url, **kwargs):
'''
Query a resource, and decode the return data
CLI Example:
.. code-block:: bash
salt '*' http.query http://somelink.com/
salt '*' http.query http://somelink.com/ method=POST \
params='key1=val1&key2=val2'
salt '*' http.query http://somelink.com/ method=POST \
data='<xml>somecontent</xml>'
'''
return salt.utils.http.query(url=url, opts=__opts__, **kwargs)
def update_ca_bundle(target=None, source=None, merge_files=None):
'''
Update the local CA bundle file from a URL
CLI Example:
.. code-block:: bash
salt '*' http.update_ca_bundle
salt '*' http.update_ca_bundle target=/path/to/cacerts.pem
salt '*' http.update_ca_bundle source=https://example.com/cacerts.pem
If the ``target`` is not specified, it will be pulled from the ``ca_cert``
configuration variable available to the minion. If it cannot be found there,
it will be placed at ``<<FILE_ROOTS>>/cacerts.pem``.
If the ``source`` is not specified, it will be pulled from the
``ca_cert_url`` configuration variable available to the minion. If it cannot
be found, it will be downloaded from the cURL website, using an http (not
https) URL. USING THE DEFAULT URL SHOULD BE AVOIDED!
``merge_files`` may also be specified, which includes a string or list of
strings representing a file or files to be appended to the end of the CA
bundle, once it is downloaded.
CLI Example:
.. code-block:: bash
salt '*' http.update_ca_bundle merge_files=/path/to/mycert.pem
'''
if target is None:
target = __salt__['config.get']('ca_bundle', None)
if source is None:
source = __salt__['config.get']('ca_bundle_url', None)
return salt.utils.http.update_ca_bundle(
target, source, __opts__, merge_files
)
|
<commit_before># -*- coding: utf-8 -*-
'''
Module for making various web calls. Primarily designed for webhooks and the
like, but also useful for basic http testing.
'''
from __future__ import absolute_import
# Import salt libs
import salt.utils.http
def query(url, **kwargs):
'''
Query a resource, and decode the return data
CLI Example:
.. code-block:: bash
salt '*' http.query http://somelink.com/
salt '*' http.query http://somelink.com/ method=POST \
params='key1=val1&key2=val2'
salt '*' http.query http://somelink.com/ method=POST \
data='<xml>somecontent</xml>'
'''
return salt.utils.http.query(url=url, opts=__opts__, **kwargs)
<commit_msg>Allow execution module to update_ca_bundle<commit_after># -*- coding: utf-8 -*-
'''
Module for making various web calls. Primarily designed for webhooks and the
like, but also useful for basic http testing.
'''
from __future__ import absolute_import
# Import salt libs
import salt.utils.http
def query(url, **kwargs):
'''
Query a resource, and decode the return data
CLI Example:
.. code-block:: bash
salt '*' http.query http://somelink.com/
salt '*' http.query http://somelink.com/ method=POST \
params='key1=val1&key2=val2'
salt '*' http.query http://somelink.com/ method=POST \
data='<xml>somecontent</xml>'
'''
return salt.utils.http.query(url=url, opts=__opts__, **kwargs)
def update_ca_bundle(target=None, source=None, merge_files=None):
'''
Update the local CA bundle file from a URL
CLI Example:
.. code-block:: bash
salt '*' http.update_ca_bundle
salt '*' http.update_ca_bundle target=/path/to/cacerts.pem
salt '*' http.update_ca_bundle source=https://example.com/cacerts.pem
If the ``target`` is not specified, it will be pulled from the ``ca_cert``
configuration variable available to the minion. If it cannot be found there,
it will be placed at ``<<FILE_ROOTS>>/cacerts.pem``.
If the ``source`` is not specified, it will be pulled from the
``ca_cert_url`` configuration variable available to the minion. If it cannot
be found, it will be downloaded from the cURL website, using an http (not
https) URL. USING THE DEFAULT URL SHOULD BE AVOIDED!
``merge_files`` may also be specified, which includes a string or list of
strings representing a file or files to be appended to the end of the CA
bundle, once it is downloaded.
CLI Example:
.. code-block:: bash
salt '*' http.update_ca_bundle merge_files=/path/to/mycert.pem
'''
if target is None:
target = __salt__['config.get']('ca_bundle', None)
if source is None:
source = __salt__['config.get']('ca_bundle_url', None)
return salt.utils.http.update_ca_bundle(
target, source, __opts__, merge_files
)
|
edd534103ca404bdeadf3225ea381acc8c555ced
|
polyaxon/polyaxon/config_settings/rest.py
|
polyaxon/polyaxon/config_settings/rest.py
|
REST_FRAMEWORK = {
'DEFAULT_RENDERER_CLASSES': (
# 'djangorestframework_camel_case.render.CamelCaseJSONRenderer', # Any other renders,
'rest_framework.renderers.JSONRenderer',
# 'rest_framework.renderers.BrowsableAPIRenderer',
),
# 'DEFAULT_PARSER_CLASSES': (
# 'djangorestframework_camel_case.parser.CamelCaseJSONParser', # Any other parsers
# ),
'DEFAULT_VERSIONING_CLASS': 'rest_framework.versioning.NamespaceVersioning',
'DEFAULT_THROTTLE_CLASSES': (
'rest_framework.throttling.AnonRateThrottle',
'rest_framework.throttling.ScopedRateThrottle',
'rest_framework.throttling.UserRateThrottle'
),
'DEFAULT_THROTTLE_RATES': {
'user': '120/min',
'admin': '100/min',
'anon': '30/min',
'health': '10/min',
},
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.SessionAuthentication',
'rest_framework.authentication.TokenAuthentication',
),
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
'PAGE_SIZE': 30
}
|
REST_FRAMEWORK = {
'DEFAULT_RENDERER_CLASSES': (
# 'djangorestframework_camel_case.render.CamelCaseJSONRenderer', # Any other renders,
'rest_framework.renderers.JSONRenderer',
# 'rest_framework.renderers.BrowsableAPIRenderer',
),
# 'DEFAULT_PARSER_CLASSES': (
# 'djangorestframework_camel_case.parser.CamelCaseJSONParser', # Any other parsers
# ),
'DEFAULT_VERSIONING_CLASS': 'rest_framework.versioning.NamespaceVersioning',
'DEFAULT_THROTTLE_CLASSES': (
'rest_framework.throttling.AnonRateThrottle',
'rest_framework.throttling.ScopedRateThrottle',
'rest_framework.throttling.UserRateThrottle'
),
'DEFAULT_THROTTLE_RATES': {
'user': '120/min',
'admin': '100/min',
'anon': '30/min',
'health': '10/min',
},
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.SessionAuthentication',
'rest_framework.authentication.TokenAuthentication',
),
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
'PAGE_SIZE': 20
}
|
Use 20 as default page size
|
Use 20 as default page size
|
Python
|
apache-2.0
|
polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon
|
REST_FRAMEWORK = {
'DEFAULT_RENDERER_CLASSES': (
# 'djangorestframework_camel_case.render.CamelCaseJSONRenderer', # Any other renders,
'rest_framework.renderers.JSONRenderer',
# 'rest_framework.renderers.BrowsableAPIRenderer',
),
# 'DEFAULT_PARSER_CLASSES': (
# 'djangorestframework_camel_case.parser.CamelCaseJSONParser', # Any other parsers
# ),
'DEFAULT_VERSIONING_CLASS': 'rest_framework.versioning.NamespaceVersioning',
'DEFAULT_THROTTLE_CLASSES': (
'rest_framework.throttling.AnonRateThrottle',
'rest_framework.throttling.ScopedRateThrottle',
'rest_framework.throttling.UserRateThrottle'
),
'DEFAULT_THROTTLE_RATES': {
'user': '120/min',
'admin': '100/min',
'anon': '30/min',
'health': '10/min',
},
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.SessionAuthentication',
'rest_framework.authentication.TokenAuthentication',
),
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
'PAGE_SIZE': 30
}
Use 20 as default page size
|
REST_FRAMEWORK = {
'DEFAULT_RENDERER_CLASSES': (
# 'djangorestframework_camel_case.render.CamelCaseJSONRenderer', # Any other renders,
'rest_framework.renderers.JSONRenderer',
# 'rest_framework.renderers.BrowsableAPIRenderer',
),
# 'DEFAULT_PARSER_CLASSES': (
# 'djangorestframework_camel_case.parser.CamelCaseJSONParser', # Any other parsers
# ),
'DEFAULT_VERSIONING_CLASS': 'rest_framework.versioning.NamespaceVersioning',
'DEFAULT_THROTTLE_CLASSES': (
'rest_framework.throttling.AnonRateThrottle',
'rest_framework.throttling.ScopedRateThrottle',
'rest_framework.throttling.UserRateThrottle'
),
'DEFAULT_THROTTLE_RATES': {
'user': '120/min',
'admin': '100/min',
'anon': '30/min',
'health': '10/min',
},
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.SessionAuthentication',
'rest_framework.authentication.TokenAuthentication',
),
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
'PAGE_SIZE': 20
}
|
<commit_before>REST_FRAMEWORK = {
'DEFAULT_RENDERER_CLASSES': (
# 'djangorestframework_camel_case.render.CamelCaseJSONRenderer', # Any other renders,
'rest_framework.renderers.JSONRenderer',
# 'rest_framework.renderers.BrowsableAPIRenderer',
),
# 'DEFAULT_PARSER_CLASSES': (
# 'djangorestframework_camel_case.parser.CamelCaseJSONParser', # Any other parsers
# ),
'DEFAULT_VERSIONING_CLASS': 'rest_framework.versioning.NamespaceVersioning',
'DEFAULT_THROTTLE_CLASSES': (
'rest_framework.throttling.AnonRateThrottle',
'rest_framework.throttling.ScopedRateThrottle',
'rest_framework.throttling.UserRateThrottle'
),
'DEFAULT_THROTTLE_RATES': {
'user': '120/min',
'admin': '100/min',
'anon': '30/min',
'health': '10/min',
},
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.SessionAuthentication',
'rest_framework.authentication.TokenAuthentication',
),
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
'PAGE_SIZE': 30
}
<commit_msg>Use 20 as default page size<commit_after>
|
REST_FRAMEWORK = {
'DEFAULT_RENDERER_CLASSES': (
# 'djangorestframework_camel_case.render.CamelCaseJSONRenderer', # Any other renders,
'rest_framework.renderers.JSONRenderer',
# 'rest_framework.renderers.BrowsableAPIRenderer',
),
# 'DEFAULT_PARSER_CLASSES': (
# 'djangorestframework_camel_case.parser.CamelCaseJSONParser', # Any other parsers
# ),
'DEFAULT_VERSIONING_CLASS': 'rest_framework.versioning.NamespaceVersioning',
'DEFAULT_THROTTLE_CLASSES': (
'rest_framework.throttling.AnonRateThrottle',
'rest_framework.throttling.ScopedRateThrottle',
'rest_framework.throttling.UserRateThrottle'
),
'DEFAULT_THROTTLE_RATES': {
'user': '120/min',
'admin': '100/min',
'anon': '30/min',
'health': '10/min',
},
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.SessionAuthentication',
'rest_framework.authentication.TokenAuthentication',
),
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
'PAGE_SIZE': 20
}
|
REST_FRAMEWORK = {
'DEFAULT_RENDERER_CLASSES': (
# 'djangorestframework_camel_case.render.CamelCaseJSONRenderer', # Any other renders,
'rest_framework.renderers.JSONRenderer',
# 'rest_framework.renderers.BrowsableAPIRenderer',
),
# 'DEFAULT_PARSER_CLASSES': (
# 'djangorestframework_camel_case.parser.CamelCaseJSONParser', # Any other parsers
# ),
'DEFAULT_VERSIONING_CLASS': 'rest_framework.versioning.NamespaceVersioning',
'DEFAULT_THROTTLE_CLASSES': (
'rest_framework.throttling.AnonRateThrottle',
'rest_framework.throttling.ScopedRateThrottle',
'rest_framework.throttling.UserRateThrottle'
),
'DEFAULT_THROTTLE_RATES': {
'user': '120/min',
'admin': '100/min',
'anon': '30/min',
'health': '10/min',
},
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.SessionAuthentication',
'rest_framework.authentication.TokenAuthentication',
),
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
'PAGE_SIZE': 30
}
Use 20 as default page sizeREST_FRAMEWORK = {
'DEFAULT_RENDERER_CLASSES': (
# 'djangorestframework_camel_case.render.CamelCaseJSONRenderer', # Any other renders,
'rest_framework.renderers.JSONRenderer',
# 'rest_framework.renderers.BrowsableAPIRenderer',
),
# 'DEFAULT_PARSER_CLASSES': (
# 'djangorestframework_camel_case.parser.CamelCaseJSONParser', # Any other parsers
# ),
'DEFAULT_VERSIONING_CLASS': 'rest_framework.versioning.NamespaceVersioning',
'DEFAULT_THROTTLE_CLASSES': (
'rest_framework.throttling.AnonRateThrottle',
'rest_framework.throttling.ScopedRateThrottle',
'rest_framework.throttling.UserRateThrottle'
),
'DEFAULT_THROTTLE_RATES': {
'user': '120/min',
'admin': '100/min',
'anon': '30/min',
'health': '10/min',
},
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.SessionAuthentication',
'rest_framework.authentication.TokenAuthentication',
),
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
'PAGE_SIZE': 20
}
|
<commit_before>REST_FRAMEWORK = {
'DEFAULT_RENDERER_CLASSES': (
# 'djangorestframework_camel_case.render.CamelCaseJSONRenderer', # Any other renders,
'rest_framework.renderers.JSONRenderer',
# 'rest_framework.renderers.BrowsableAPIRenderer',
),
# 'DEFAULT_PARSER_CLASSES': (
# 'djangorestframework_camel_case.parser.CamelCaseJSONParser', # Any other parsers
# ),
'DEFAULT_VERSIONING_CLASS': 'rest_framework.versioning.NamespaceVersioning',
'DEFAULT_THROTTLE_CLASSES': (
'rest_framework.throttling.AnonRateThrottle',
'rest_framework.throttling.ScopedRateThrottle',
'rest_framework.throttling.UserRateThrottle'
),
'DEFAULT_THROTTLE_RATES': {
'user': '120/min',
'admin': '100/min',
'anon': '30/min',
'health': '10/min',
},
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.SessionAuthentication',
'rest_framework.authentication.TokenAuthentication',
),
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
'PAGE_SIZE': 30
}
<commit_msg>Use 20 as default page size<commit_after>REST_FRAMEWORK = {
'DEFAULT_RENDERER_CLASSES': (
# 'djangorestframework_camel_case.render.CamelCaseJSONRenderer', # Any other renders,
'rest_framework.renderers.JSONRenderer',
# 'rest_framework.renderers.BrowsableAPIRenderer',
),
# 'DEFAULT_PARSER_CLASSES': (
# 'djangorestframework_camel_case.parser.CamelCaseJSONParser', # Any other parsers
# ),
'DEFAULT_VERSIONING_CLASS': 'rest_framework.versioning.NamespaceVersioning',
'DEFAULT_THROTTLE_CLASSES': (
'rest_framework.throttling.AnonRateThrottle',
'rest_framework.throttling.ScopedRateThrottle',
'rest_framework.throttling.UserRateThrottle'
),
'DEFAULT_THROTTLE_RATES': {
'user': '120/min',
'admin': '100/min',
'anon': '30/min',
'health': '10/min',
},
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.SessionAuthentication',
'rest_framework.authentication.TokenAuthentication',
),
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
'PAGE_SIZE': 20
}
|
dadbcf91eab36b67ba9f0db77076651c04d1e85d
|
packages/Python/lldbsuite/test/lang/cpp/char8_t/TestCxxChar8_t.py
|
packages/Python/lldbsuite/test/lang/cpp/char8_t/TestCxxChar8_t.py
|
# coding=utf8
"""
Test that C++ supports char8_t correctly.
"""
from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
class CxxChar8_tTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@skipIf(compiler="clang", compiler_version=['<', '7.0'])
def test(self):
"""Test that C++ supports char8_t correctly."""
self.build()
exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
# FIXME: We should be able to test this with target variable, but the
# data formatter output is broken.
lldbutil.run_break_set_by_symbol(self, 'main')
self.runCmd("run", RUN_SUCCEEDED)
self.expect(
"frame variable a", substrs=["(char8_t) ::a = 0x61 u8'a'"])
self.expect(
"frame variable ab", substrs=['(const char8_t *) ::ab', 'u8"你好"'])
self.expect(
"frame variable abc", substrs=['(char8_t [9]) ::abc = u8"你好"'])
|
# coding=utf8
"""
Test that C++ supports char8_t correctly.
"""
from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
class CxxChar8_tTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@skipIf(compiler="clang", compiler_version=['<', '7.0'])
def test(self):
"""Test that C++ supports char8_t correctly."""
self.build()
exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
# FIXME: We should be able to test this with target variable, but the
# data formatter output is broken.
lldbutil.run_break_set_by_symbol(self, 'main')
self.runCmd("run", RUN_SUCCEEDED)
self.expect(
"frame variable a", substrs=["(char8_t)", "0x61 u8'a'"])
self.expect(
"frame variable ab", substrs=['(const char8_t *)' , 'u8"你好"'])
self.expect(
"frame variable abc", substrs=['(char8_t [9])', 'u8"你好"'])
|
Update test so it matches the Windows output
|
[test] Update test so it matches the Windows output
git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@369595 91177308-0d34-0410-b5e6-96231b3b80d8
|
Python
|
apache-2.0
|
llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb
|
# coding=utf8
"""
Test that C++ supports char8_t correctly.
"""
from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
class CxxChar8_tTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@skipIf(compiler="clang", compiler_version=['<', '7.0'])
def test(self):
"""Test that C++ supports char8_t correctly."""
self.build()
exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
# FIXME: We should be able to test this with target variable, but the
# data formatter output is broken.
lldbutil.run_break_set_by_symbol(self, 'main')
self.runCmd("run", RUN_SUCCEEDED)
self.expect(
"frame variable a", substrs=["(char8_t) ::a = 0x61 u8'a'"])
self.expect(
"frame variable ab", substrs=['(const char8_t *) ::ab', 'u8"你好"'])
self.expect(
"frame variable abc", substrs=['(char8_t [9]) ::abc = u8"你好"'])
[test] Update test so it matches the Windows output
git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@369595 91177308-0d34-0410-b5e6-96231b3b80d8
|
# coding=utf8
"""
Test that C++ supports char8_t correctly.
"""
from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
class CxxChar8_tTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@skipIf(compiler="clang", compiler_version=['<', '7.0'])
def test(self):
"""Test that C++ supports char8_t correctly."""
self.build()
exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
# FIXME: We should be able to test this with target variable, but the
# data formatter output is broken.
lldbutil.run_break_set_by_symbol(self, 'main')
self.runCmd("run", RUN_SUCCEEDED)
self.expect(
"frame variable a", substrs=["(char8_t)", "0x61 u8'a'"])
self.expect(
"frame variable ab", substrs=['(const char8_t *)' , 'u8"你好"'])
self.expect(
"frame variable abc", substrs=['(char8_t [9])', 'u8"你好"'])
|
<commit_before># coding=utf8
"""
Test that C++ supports char8_t correctly.
"""
from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
class CxxChar8_tTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@skipIf(compiler="clang", compiler_version=['<', '7.0'])
def test(self):
"""Test that C++ supports char8_t correctly."""
self.build()
exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
# FIXME: We should be able to test this with target variable, but the
# data formatter output is broken.
lldbutil.run_break_set_by_symbol(self, 'main')
self.runCmd("run", RUN_SUCCEEDED)
self.expect(
"frame variable a", substrs=["(char8_t) ::a = 0x61 u8'a'"])
self.expect(
"frame variable ab", substrs=['(const char8_t *) ::ab', 'u8"你好"'])
self.expect(
"frame variable abc", substrs=['(char8_t [9]) ::abc = u8"你好"'])
<commit_msg>[test] Update test so it matches the Windows output
git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@369595 91177308-0d34-0410-b5e6-96231b3b80d8<commit_after>
|
# coding=utf8
"""
Test that C++ supports char8_t correctly.
"""
from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
class CxxChar8_tTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@skipIf(compiler="clang", compiler_version=['<', '7.0'])
def test(self):
"""Test that C++ supports char8_t correctly."""
self.build()
exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
# FIXME: We should be able to test this with target variable, but the
# data formatter output is broken.
lldbutil.run_break_set_by_symbol(self, 'main')
self.runCmd("run", RUN_SUCCEEDED)
self.expect(
"frame variable a", substrs=["(char8_t)", "0x61 u8'a'"])
self.expect(
"frame variable ab", substrs=['(const char8_t *)' , 'u8"你好"'])
self.expect(
"frame variable abc", substrs=['(char8_t [9])', 'u8"你好"'])
|
# coding=utf8
"""
Test that C++ supports char8_t correctly.
"""
from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
class CxxChar8_tTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@skipIf(compiler="clang", compiler_version=['<', '7.0'])
def test(self):
"""Test that C++ supports char8_t correctly."""
self.build()
exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
# FIXME: We should be able to test this with target variable, but the
# data formatter output is broken.
lldbutil.run_break_set_by_symbol(self, 'main')
self.runCmd("run", RUN_SUCCEEDED)
self.expect(
"frame variable a", substrs=["(char8_t) ::a = 0x61 u8'a'"])
self.expect(
"frame variable ab", substrs=['(const char8_t *) ::ab', 'u8"你好"'])
self.expect(
"frame variable abc", substrs=['(char8_t [9]) ::abc = u8"你好"'])
[test] Update test so it matches the Windows output
git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@369595 91177308-0d34-0410-b5e6-96231b3b80d8# coding=utf8
"""
Test that C++ supports char8_t correctly.
"""
from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
class CxxChar8_tTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@skipIf(compiler="clang", compiler_version=['<', '7.0'])
def test(self):
"""Test that C++ supports char8_t correctly."""
self.build()
exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
# FIXME: We should be able to test this with target variable, but the
# data formatter output is broken.
lldbutil.run_break_set_by_symbol(self, 'main')
self.runCmd("run", RUN_SUCCEEDED)
self.expect(
"frame variable a", substrs=["(char8_t)", "0x61 u8'a'"])
self.expect(
"frame variable ab", substrs=['(const char8_t *)' , 'u8"你好"'])
self.expect(
"frame variable abc", substrs=['(char8_t [9])', 'u8"你好"'])
|
<commit_before># coding=utf8
"""
Test that C++ supports char8_t correctly.
"""
from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
class CxxChar8_tTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@skipIf(compiler="clang", compiler_version=['<', '7.0'])
def test(self):
"""Test that C++ supports char8_t correctly."""
self.build()
exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
# FIXME: We should be able to test this with target variable, but the
# data formatter output is broken.
lldbutil.run_break_set_by_symbol(self, 'main')
self.runCmd("run", RUN_SUCCEEDED)
self.expect(
"frame variable a", substrs=["(char8_t) ::a = 0x61 u8'a'"])
self.expect(
"frame variable ab", substrs=['(const char8_t *) ::ab', 'u8"你好"'])
self.expect(
"frame variable abc", substrs=['(char8_t [9]) ::abc = u8"你好"'])
<commit_msg>[test] Update test so it matches the Windows output
git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@369595 91177308-0d34-0410-b5e6-96231b3b80d8<commit_after># coding=utf8
"""
Test that C++ supports char8_t correctly.
"""
from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
class CxxChar8_tTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@skipIf(compiler="clang", compiler_version=['<', '7.0'])
def test(self):
"""Test that C++ supports char8_t correctly."""
self.build()
exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
# FIXME: We should be able to test this with target variable, but the
# data formatter output is broken.
lldbutil.run_break_set_by_symbol(self, 'main')
self.runCmd("run", RUN_SUCCEEDED)
self.expect(
"frame variable a", substrs=["(char8_t)", "0x61 u8'a'"])
self.expect(
"frame variable ab", substrs=['(const char8_t *)' , 'u8"你好"'])
self.expect(
"frame variable abc", substrs=['(char8_t [9])', 'u8"你好"'])
|
25e5b38b09a21cd6e6fbf4ba141bc35bb34cb77e
|
Core/views.py
|
Core/views.py
|
from django.shortcuts import render
# Create your views here.
|
from django.http import HttpResponse, HttpResponseNotFound, Http404
from django.shortcuts import render, redirect
from django.middleware.csrf import get_token
from models import *
class view():
request = ''
template = ''
isSecuredArea = True
isUserAuthenticated = False
#Normal Overridable methods
@abstractmethod
def getView():
pass
@abstractmethod
def getTemplate():
pass
def isPageSecured(): #Override to unsecure page
self.isSecuredArea = True
#Request Life Cycle Methods
def handleRequest(request):
self.setUpView(request)
if securityFails():
return self.handleAuthenticationFailue()
self.getTemplate()
content = getView()
return returnView(content)
def setUpView(request):
self.request = request
self.isSecuredArea = isPageSecured()
self.isUserAuthenticated = request.user.is_authenticated()
def returnView(parameters={}):
if self.template != '':
return render(self.request, self.template, {'csrfmiddlewaretoken':get_token(request), 'room':room, 'links': links})
else :
raise Http404
#Security Methods
def securityFails():
if not self.isUserAuthenticated and self.isSecuredArea:
return True
else:
return False
def handleAuthenticationFailue():
return redirect('/Login?next=%s' % request.path)
#Get Room Method
def getCurrentRoom():
roomString = self.request.GET.get('room', 'All')
if roomString != 'All':
return Rooms.object.filter(id=roomString)
else return null;
#Sidebar Methods
def getSideBar():
currentRoom = getCurrentRoom()
links = [{'title': 'All Rooms', 'address': '?', 'active': getSideBarActiveState(null, currentRoom)}]
for room in Rooms.objects.all():
address = '?room=' + room.Name
sidebarItem = {'title': room.Name.replace("_", " ") , 'address': address , 'active':getSideBarActiveState(room, currentRoom)}
links.append(sidebarItem)
return links
def getSideBarActiveState(sidebarItem, currentPage):
if sidebarItem == currentPage:
return 'active'
else:
return ''
|
Add core view hangler class
|
Add core view hangler class
|
Python
|
mit
|
Tomcuzz/OctaHomeAutomation,Tomcuzz/OctaHomeAutomation,Tomcuzz/OctaHomeAutomation,Tomcuzz/OctaHomeAutomation
|
from django.shortcuts import render
# Create your views here.
Add core view hangler class
|
from django.http import HttpResponse, HttpResponseNotFound, Http404
from django.shortcuts import render, redirect
from django.middleware.csrf import get_token
from models import *
class view():
request = ''
template = ''
isSecuredArea = True
isUserAuthenticated = False
#Normal Overridable methods
@abstractmethod
def getView():
pass
@abstractmethod
def getTemplate():
pass
def isPageSecured(): #Override to unsecure page
self.isSecuredArea = True
#Request Life Cycle Methods
def handleRequest(request):
self.setUpView(request)
if securityFails():
return self.handleAuthenticationFailue()
self.getTemplate()
content = getView()
return returnView(content)
def setUpView(request):
self.request = request
self.isSecuredArea = isPageSecured()
self.isUserAuthenticated = request.user.is_authenticated()
def returnView(parameters={}):
if self.template != '':
return render(self.request, self.template, {'csrfmiddlewaretoken':get_token(request), 'room':room, 'links': links})
else :
raise Http404
#Security Methods
def securityFails():
if not self.isUserAuthenticated and self.isSecuredArea:
return True
else:
return False
def handleAuthenticationFailue():
return redirect('/Login?next=%s' % request.path)
#Get Room Method
def getCurrentRoom():
roomString = self.request.GET.get('room', 'All')
if roomString != 'All':
return Rooms.object.filter(id=roomString)
else return null;
#Sidebar Methods
def getSideBar():
currentRoom = getCurrentRoom()
links = [{'title': 'All Rooms', 'address': '?', 'active': getSideBarActiveState(null, currentRoom)}]
for room in Rooms.objects.all():
address = '?room=' + room.Name
sidebarItem = {'title': room.Name.replace("_", " ") , 'address': address , 'active':getSideBarActiveState(room, currentRoom)}
links.append(sidebarItem)
return links
def getSideBarActiveState(sidebarItem, currentPage):
if sidebarItem == currentPage:
return 'active'
else:
return ''
|
<commit_before>from django.shortcuts import render
# Create your views here.
<commit_msg>Add core view hangler class<commit_after>
|
from django.http import HttpResponse, HttpResponseNotFound, Http404
from django.shortcuts import render, redirect
from django.middleware.csrf import get_token
from models import *
class view():
request = ''
template = ''
isSecuredArea = True
isUserAuthenticated = False
#Normal Overridable methods
@abstractmethod
def getView():
pass
@abstractmethod
def getTemplate():
pass
def isPageSecured(): #Override to unsecure page
self.isSecuredArea = True
#Request Life Cycle Methods
def handleRequest(request):
self.setUpView(request)
if securityFails():
return self.handleAuthenticationFailue()
self.getTemplate()
content = getView()
return returnView(content)
def setUpView(request):
self.request = request
self.isSecuredArea = isPageSecured()
self.isUserAuthenticated = request.user.is_authenticated()
def returnView(parameters={}):
if self.template != '':
return render(self.request, self.template, {'csrfmiddlewaretoken':get_token(request), 'room':room, 'links': links})
else :
raise Http404
#Security Methods
def securityFails():
if not self.isUserAuthenticated and self.isSecuredArea:
return True
else:
return False
def handleAuthenticationFailue():
return redirect('/Login?next=%s' % request.path)
#Get Room Method
def getCurrentRoom():
roomString = self.request.GET.get('room', 'All')
if roomString != 'All':
return Rooms.object.filter(id=roomString)
else return null;
#Sidebar Methods
def getSideBar():
currentRoom = getCurrentRoom()
links = [{'title': 'All Rooms', 'address': '?', 'active': getSideBarActiveState(null, currentRoom)}]
for room in Rooms.objects.all():
address = '?room=' + room.Name
sidebarItem = {'title': room.Name.replace("_", " ") , 'address': address , 'active':getSideBarActiveState(room, currentRoom)}
links.append(sidebarItem)
return links
def getSideBarActiveState(sidebarItem, currentPage):
if sidebarItem == currentPage:
return 'active'
else:
return ''
|
from django.shortcuts import render
# Create your views here.
Add core view hangler classfrom django.http import HttpResponse, HttpResponseNotFound, Http404
from django.shortcuts import render, redirect
from django.middleware.csrf import get_token
from models import *
class view():
request = ''
template = ''
isSecuredArea = True
isUserAuthenticated = False
#Normal Overridable methods
@abstractmethod
def getView():
pass
@abstractmethod
def getTemplate():
pass
def isPageSecured(): #Override to unsecure page
self.isSecuredArea = True
#Request Life Cycle Methods
def handleRequest(request):
self.setUpView(request)
if securityFails():
return self.handleAuthenticationFailue()
self.getTemplate()
content = getView()
return returnView(content)
def setUpView(request):
self.request = request
self.isSecuredArea = isPageSecured()
self.isUserAuthenticated = request.user.is_authenticated()
def returnView(parameters={}):
if self.template != '':
return render(self.request, self.template, {'csrfmiddlewaretoken':get_token(request), 'room':room, 'links': links})
else :
raise Http404
#Security Methods
def securityFails():
if not self.isUserAuthenticated and self.isSecuredArea:
return True
else:
return False
def handleAuthenticationFailue():
return redirect('/Login?next=%s' % request.path)
#Get Room Method
def getCurrentRoom():
roomString = self.request.GET.get('room', 'All')
if roomString != 'All':
return Rooms.object.filter(id=roomString)
else return null;
#Sidebar Methods
def getSideBar():
currentRoom = getCurrentRoom()
links = [{'title': 'All Rooms', 'address': '?', 'active': getSideBarActiveState(null, currentRoom)}]
for room in Rooms.objects.all():
address = '?room=' + room.Name
sidebarItem = {'title': room.Name.replace("_", " ") , 'address': address , 'active':getSideBarActiveState(room, currentRoom)}
links.append(sidebarItem)
return links
def getSideBarActiveState(sidebarItem, currentPage):
if sidebarItem == currentPage:
return 'active'
else:
return ''
|
<commit_before>from django.shortcuts import render
# Create your views here.
<commit_msg>Add core view hangler class<commit_after>from django.http import HttpResponse, HttpResponseNotFound, Http404
from django.shortcuts import render, redirect
from django.middleware.csrf import get_token
from models import *
class view():
request = ''
template = ''
isSecuredArea = True
isUserAuthenticated = False
#Normal Overridable methods
@abstractmethod
def getView():
pass
@abstractmethod
def getTemplate():
pass
def isPageSecured(): #Override to unsecure page
self.isSecuredArea = True
#Request Life Cycle Methods
def handleRequest(request):
self.setUpView(request)
if securityFails():
return self.handleAuthenticationFailue()
self.getTemplate()
content = getView()
return returnView(content)
def setUpView(request):
self.request = request
self.isSecuredArea = isPageSecured()
self.isUserAuthenticated = request.user.is_authenticated()
def returnView(parameters={}):
if self.template != '':
return render(self.request, self.template, {'csrfmiddlewaretoken':get_token(request), 'room':room, 'links': links})
else :
raise Http404
#Security Methods
def securityFails():
if not self.isUserAuthenticated and self.isSecuredArea:
return True
else:
return False
def handleAuthenticationFailue():
return redirect('/Login?next=%s' % request.path)
#Get Room Method
def getCurrentRoom():
roomString = self.request.GET.get('room', 'All')
if roomString != 'All':
return Rooms.object.filter(id=roomString)
else return null;
#Sidebar Methods
def getSideBar():
currentRoom = getCurrentRoom()
links = [{'title': 'All Rooms', 'address': '?', 'active': getSideBarActiveState(null, currentRoom)}]
for room in Rooms.objects.all():
address = '?room=' + room.Name
sidebarItem = {'title': room.Name.replace("_", " ") , 'address': address , 'active':getSideBarActiveState(room, currentRoom)}
links.append(sidebarItem)
return links
def getSideBarActiveState(sidebarItem, currentPage):
if sidebarItem == currentPage:
return 'active'
else:
return ''
|
9f9357bc46f813cd8a26a5f14bba5364aa4a4c10
|
rx/core/operators/contains.py
|
rx/core/operators/contains.py
|
from typing import Callable, Optional, TypeVar
from rx import operators as ops
from rx.core import Observable, pipe, typing
from rx.internal.basic import default_comparer
_T = TypeVar("_T")
def contains_(
value: _T, comparer: Optional[typing.Comparer[_T]] = None
) -> Callable[[Observable[_T]], Observable[bool]]:
comparer_ = comparer or default_comparer
filtering = ops.filter(lambda v: comparer_(v, value))
something = ops.some()
return pipe(filtering, something)
__all__ = ["contains_"]
|
from typing import Callable, Optional, TypeVar
from rx import operators as ops
from rx.core import Observable, pipe, typing
from rx.internal.basic import default_comparer
_T = TypeVar("_T")
def contains_(
value: _T, comparer: Optional[typing.Comparer[_T]] = None
) -> Callable[[Observable[_T]], Observable[bool]]:
comparer_ = comparer or default_comparer
def predicate(v: _T) -> bool:
return comparer_(v, value)
filtering = ops.filter(predicate)
something = ops.some()
return pipe(filtering, something)
__all__ = ["contains_"]
|
Use typed function instead of lambda
|
Use typed function instead of lambda
|
Python
|
mit
|
ReactiveX/RxPY,ReactiveX/RxPY
|
from typing import Callable, Optional, TypeVar
from rx import operators as ops
from rx.core import Observable, pipe, typing
from rx.internal.basic import default_comparer
_T = TypeVar("_T")
def contains_(
value: _T, comparer: Optional[typing.Comparer[_T]] = None
) -> Callable[[Observable[_T]], Observable[bool]]:
comparer_ = comparer or default_comparer
filtering = ops.filter(lambda v: comparer_(v, value))
something = ops.some()
return pipe(filtering, something)
__all__ = ["contains_"]
Use typed function instead of lambda
|
from typing import Callable, Optional, TypeVar
from rx import operators as ops
from rx.core import Observable, pipe, typing
from rx.internal.basic import default_comparer
_T = TypeVar("_T")
def contains_(
value: _T, comparer: Optional[typing.Comparer[_T]] = None
) -> Callable[[Observable[_T]], Observable[bool]]:
comparer_ = comparer or default_comparer
def predicate(v: _T) -> bool:
return comparer_(v, value)
filtering = ops.filter(predicate)
something = ops.some()
return pipe(filtering, something)
__all__ = ["contains_"]
|
<commit_before>from typing import Callable, Optional, TypeVar
from rx import operators as ops
from rx.core import Observable, pipe, typing
from rx.internal.basic import default_comparer
_T = TypeVar("_T")
def contains_(
value: _T, comparer: Optional[typing.Comparer[_T]] = None
) -> Callable[[Observable[_T]], Observable[bool]]:
comparer_ = comparer or default_comparer
filtering = ops.filter(lambda v: comparer_(v, value))
something = ops.some()
return pipe(filtering, something)
__all__ = ["contains_"]
<commit_msg>Use typed function instead of lambda<commit_after>
|
from typing import Callable, Optional, TypeVar
from rx import operators as ops
from rx.core import Observable, pipe, typing
from rx.internal.basic import default_comparer
_T = TypeVar("_T")
def contains_(
value: _T, comparer: Optional[typing.Comparer[_T]] = None
) -> Callable[[Observable[_T]], Observable[bool]]:
comparer_ = comparer or default_comparer
def predicate(v: _T) -> bool:
return comparer_(v, value)
filtering = ops.filter(predicate)
something = ops.some()
return pipe(filtering, something)
__all__ = ["contains_"]
|
from typing import Callable, Optional, TypeVar
from rx import operators as ops
from rx.core import Observable, pipe, typing
from rx.internal.basic import default_comparer
_T = TypeVar("_T")
def contains_(
value: _T, comparer: Optional[typing.Comparer[_T]] = None
) -> Callable[[Observable[_T]], Observable[bool]]:
comparer_ = comparer or default_comparer
filtering = ops.filter(lambda v: comparer_(v, value))
something = ops.some()
return pipe(filtering, something)
__all__ = ["contains_"]
Use typed function instead of lambdafrom typing import Callable, Optional, TypeVar
from rx import operators as ops
from rx.core import Observable, pipe, typing
from rx.internal.basic import default_comparer
_T = TypeVar("_T")
def contains_(
value: _T, comparer: Optional[typing.Comparer[_T]] = None
) -> Callable[[Observable[_T]], Observable[bool]]:
comparer_ = comparer or default_comparer
def predicate(v: _T) -> bool:
return comparer_(v, value)
filtering = ops.filter(predicate)
something = ops.some()
return pipe(filtering, something)
__all__ = ["contains_"]
|
<commit_before>from typing import Callable, Optional, TypeVar
from rx import operators as ops
from rx.core import Observable, pipe, typing
from rx.internal.basic import default_comparer
_T = TypeVar("_T")
def contains_(
value: _T, comparer: Optional[typing.Comparer[_T]] = None
) -> Callable[[Observable[_T]], Observable[bool]]:
comparer_ = comparer or default_comparer
filtering = ops.filter(lambda v: comparer_(v, value))
something = ops.some()
return pipe(filtering, something)
__all__ = ["contains_"]
<commit_msg>Use typed function instead of lambda<commit_after>from typing import Callable, Optional, TypeVar
from rx import operators as ops
from rx.core import Observable, pipe, typing
from rx.internal.basic import default_comparer
_T = TypeVar("_T")
def contains_(
value: _T, comparer: Optional[typing.Comparer[_T]] = None
) -> Callable[[Observable[_T]], Observable[bool]]:
comparer_ = comparer or default_comparer
def predicate(v: _T) -> bool:
return comparer_(v, value)
filtering = ops.filter(predicate)
something = ops.some()
return pipe(filtering, something)
__all__ = ["contains_"]
|
2883d803609554e38f96f920f1ef41b54b6ec4c2
|
fabfile.py
|
fabfile.py
|
import os
from fabric.api import local, settings, abort, run, cd, env, put, sudo
from fabric.contrib.console import confirm
import time
DEPLOY_WAIT_TIME = 15
timestamp="release-%s" % int(time.time() * 1000)
env.user = 'deploy' # Special group with limited sudo
env.hosts = ['104.236.224.252']
code_dir = '/home/liza/scribeAPI'
def deploy():
deploy_app()
def deploy_app():
with cd(code_dir):
run('git pull origin master')
run('rake project:load["label_this","workflows","content"]')
stop_host()
time.sleep(DEPLOY_WAIT_TIME) # Wait for the process to die
start_shot()
print "Done deploying"
def stop_host():
sudo('service unicorn_labelthis stop', shell=False)
def start_host():
sudo('service unicorn_labelthis start', shell=False)
|
import os
from fabric.api import local, settings, abort, run, cd, env, put, sudo
from fabric.contrib.console import confirm
import time
DEPLOY_WAIT_TIME = 15
timestamp="release-%s" % int(time.time() * 1000)
env.user = 'deploy' # Special group with limited sudo
env.hosts = ['104.236.224.252']
code_dir = '/home/liza/scribeAPI'
def deploy():
deploy_app()
def deploy_app():
with cd(code_dir):
run('git pull origin master')
run('rake project:load["label_this","workflows","content"]')
stop_host()
time.sleep(DEPLOY_WAIT_TIME) # Wait for the process to die
start_host()
print "Done deploying"
def stop_host():
sudo('service unicorn_labelthis stop', shell=False)
def start_host():
sudo('service unicorn_labelthis start', shell=False)
|
Remove the noise default broken image
|
Remove the noise default broken image
|
Python
|
mit
|
UCDavisLibrary/scribeAPI,UCDavisLibrary/scribeAPI,UCDavisLibrary/scribeAPI,UCDavisLibrary/scribeAPI,UCDavisLibrary/scribeAPI
|
import os
from fabric.api import local, settings, abort, run, cd, env, put, sudo
from fabric.contrib.console import confirm
import time
DEPLOY_WAIT_TIME = 15
timestamp="release-%s" % int(time.time() * 1000)
env.user = 'deploy' # Special group with limited sudo
env.hosts = ['104.236.224.252']
code_dir = '/home/liza/scribeAPI'
def deploy():
deploy_app()
def deploy_app():
with cd(code_dir):
run('git pull origin master')
run('rake project:load["label_this","workflows","content"]')
stop_host()
time.sleep(DEPLOY_WAIT_TIME) # Wait for the process to die
start_shot()
print "Done deploying"
def stop_host():
sudo('service unicorn_labelthis stop', shell=False)
def start_host():
sudo('service unicorn_labelthis start', shell=False)
Remove the noise default broken image
|
import os
from fabric.api import local, settings, abort, run, cd, env, put, sudo
from fabric.contrib.console import confirm
import time
DEPLOY_WAIT_TIME = 15
timestamp="release-%s" % int(time.time() * 1000)
env.user = 'deploy' # Special group with limited sudo
env.hosts = ['104.236.224.252']
code_dir = '/home/liza/scribeAPI'
def deploy():
deploy_app()
def deploy_app():
with cd(code_dir):
run('git pull origin master')
run('rake project:load["label_this","workflows","content"]')
stop_host()
time.sleep(DEPLOY_WAIT_TIME) # Wait for the process to die
start_host()
print "Done deploying"
def stop_host():
sudo('service unicorn_labelthis stop', shell=False)
def start_host():
sudo('service unicorn_labelthis start', shell=False)
|
<commit_before>import os
from fabric.api import local, settings, abort, run, cd, env, put, sudo
from fabric.contrib.console import confirm
import time
DEPLOY_WAIT_TIME = 15
timestamp="release-%s" % int(time.time() * 1000)
env.user = 'deploy' # Special group with limited sudo
env.hosts = ['104.236.224.252']
code_dir = '/home/liza/scribeAPI'
def deploy():
deploy_app()
def deploy_app():
with cd(code_dir):
run('git pull origin master')
run('rake project:load["label_this","workflows","content"]')
stop_host()
time.sleep(DEPLOY_WAIT_TIME) # Wait for the process to die
start_shot()
print "Done deploying"
def stop_host():
sudo('service unicorn_labelthis stop', shell=False)
def start_host():
sudo('service unicorn_labelthis start', shell=False)
<commit_msg>Remove the noise default broken image<commit_after>
|
import os
from fabric.api import local, settings, abort, run, cd, env, put, sudo
from fabric.contrib.console import confirm
import time
DEPLOY_WAIT_TIME = 15
timestamp="release-%s" % int(time.time() * 1000)
env.user = 'deploy' # Special group with limited sudo
env.hosts = ['104.236.224.252']
code_dir = '/home/liza/scribeAPI'
def deploy():
deploy_app()
def deploy_app():
with cd(code_dir):
run('git pull origin master')
run('rake project:load["label_this","workflows","content"]')
stop_host()
time.sleep(DEPLOY_WAIT_TIME) # Wait for the process to die
start_host()
print "Done deploying"
def stop_host():
sudo('service unicorn_labelthis stop', shell=False)
def start_host():
sudo('service unicorn_labelthis start', shell=False)
|
import os
from fabric.api import local, settings, abort, run, cd, env, put, sudo
from fabric.contrib.console import confirm
import time
DEPLOY_WAIT_TIME = 15
timestamp="release-%s" % int(time.time() * 1000)
env.user = 'deploy' # Special group with limited sudo
env.hosts = ['104.236.224.252']
code_dir = '/home/liza/scribeAPI'
def deploy():
deploy_app()
def deploy_app():
with cd(code_dir):
run('git pull origin master')
run('rake project:load["label_this","workflows","content"]')
stop_host()
time.sleep(DEPLOY_WAIT_TIME) # Wait for the process to die
start_shot()
print "Done deploying"
def stop_host():
sudo('service unicorn_labelthis stop', shell=False)
def start_host():
sudo('service unicorn_labelthis start', shell=False)
Remove the noise default broken imageimport os
from fabric.api import local, settings, abort, run, cd, env, put, sudo
from fabric.contrib.console import confirm
import time
DEPLOY_WAIT_TIME = 15
timestamp="release-%s" % int(time.time() * 1000)
env.user = 'deploy' # Special group with limited sudo
env.hosts = ['104.236.224.252']
code_dir = '/home/liza/scribeAPI'
def deploy():
deploy_app()
def deploy_app():
with cd(code_dir):
run('git pull origin master')
run('rake project:load["label_this","workflows","content"]')
stop_host()
time.sleep(DEPLOY_WAIT_TIME) # Wait for the process to die
start_host()
print "Done deploying"
def stop_host():
sudo('service unicorn_labelthis stop', shell=False)
def start_host():
sudo('service unicorn_labelthis start', shell=False)
|
<commit_before>import os
from fabric.api import local, settings, abort, run, cd, env, put, sudo
from fabric.contrib.console import confirm
import time
DEPLOY_WAIT_TIME = 15
timestamp="release-%s" % int(time.time() * 1000)
env.user = 'deploy' # Special group with limited sudo
env.hosts = ['104.236.224.252']
code_dir = '/home/liza/scribeAPI'
def deploy():
deploy_app()
def deploy_app():
with cd(code_dir):
run('git pull origin master')
run('rake project:load["label_this","workflows","content"]')
stop_host()
time.sleep(DEPLOY_WAIT_TIME) # Wait for the process to die
start_shot()
print "Done deploying"
def stop_host():
sudo('service unicorn_labelthis stop', shell=False)
def start_host():
sudo('service unicorn_labelthis start', shell=False)
<commit_msg>Remove the noise default broken image<commit_after>import os
from fabric.api import local, settings, abort, run, cd, env, put, sudo
from fabric.contrib.console import confirm
import time
DEPLOY_WAIT_TIME = 15
timestamp="release-%s" % int(time.time() * 1000)
env.user = 'deploy' # Special group with limited sudo
env.hosts = ['104.236.224.252']
code_dir = '/home/liza/scribeAPI'
def deploy():
deploy_app()
def deploy_app():
with cd(code_dir):
run('git pull origin master')
run('rake project:load["label_this","workflows","content"]')
stop_host()
time.sleep(DEPLOY_WAIT_TIME) # Wait for the process to die
start_host()
print "Done deploying"
def stop_host():
sudo('service unicorn_labelthis stop', shell=False)
def start_host():
sudo('service unicorn_labelthis start', shell=False)
|
86c106fc95946e4558fabfae57bbd039b248a70c
|
mindbender/maya/plugins/validate_single_shape.py
|
mindbender/maya/plugins/validate_single_shape.py
|
import pyblish.api
class ValidateMindbenderSingleShape(pyblish.api.InstancePlugin):
"""One mesh per transform"""
label = "Validate Single Shape"
order = pyblish.api.ValidatorOrder
hosts = ["maya"]
active = False
optional = True
families = [
"mindbender.model",
"mindbender.lookdev"
]
def process(self, instance):
from maya import cmds
has_multiple_shapes = list()
for node in instance:
children = cmds.listRelatives(node, allDescendents=True) or list()
shapes = cmds.listRelatives(node, shapes=True) or list()
# Ensure there is only one child; there could be many,
# including other transform nodes.
has_single_shape = len(children) == 1
# Ensure the one child is a shape
has_single_child = len(shapes) == 1
# Ensure the one child is of type "mesh"
has_single_mesh = cmds.nodeType(shapes[0]) == "mesh"
if not all([has_single_child,
has_single_shape,
has_single_mesh]):
has_multiple_shapes.append(node)
assert not has_multiple_shapes, (
"\"%s\" has transforms with multiple shapes: %s" % (
instance, ", ".join(
"\"" + member + "\"" for member in has_multiple_shapes))
)
|
import pyblish.api
class ValidateMindbenderSingleShape(pyblish.api.InstancePlugin):
"""Transforms with a mesh must ever only contain a single mesh
This ensures models only contain a single shape node.
"""
label = "Validate Single Shape"
order = pyblish.api.ValidatorOrder
hosts = ["maya"]
families = [
"mindbender.model",
]
def process(self, instance):
from maya import cmds
has_multiple_shapes = list()
# Consider entire hierarchy of nodes included in an Instance
hierarchy = cmds.listRelatives(instance, allDescendents=True)
# Consider only nodes of type="mesh"
meshes = cmds.ls(hierarchy, type="mesh", long=True)
transforms = cmds.listRelatives(meshes, parent=True)
for transform in set(transforms):
shapes = cmds.listRelatives(transform, shapes=True) or list()
# Ensure the one child is a shape
has_single_shape = len(shapes) == 1
self.log.info("has single shape: %s" % has_single_shape)
# Ensure the one shape is of type "mesh"
has_single_mesh = (
has_single_shape and
cmds.nodeType(shapes[0]) == "mesh"
)
self.log.info("has single mesh: %s" % has_single_mesh)
if not all([has_single_shape, has_single_mesh]):
has_multiple_shapes.append(transform)
assert not has_multiple_shapes, (
"\"%s\" has transforms with multiple shapes: %s" % (
instance, ", ".join(
"\"" + member + "\"" for member in has_multiple_shapes))
)
|
Repair validate single shape validator
|
Repair validate single shape validator
|
Python
|
mit
|
mindbender-studio/core,MoonShineVFX/core,getavalon/core,MoonShineVFX/core,mindbender-studio/core,getavalon/core
|
import pyblish.api
class ValidateMindbenderSingleShape(pyblish.api.InstancePlugin):
"""One mesh per transform"""
label = "Validate Single Shape"
order = pyblish.api.ValidatorOrder
hosts = ["maya"]
active = False
optional = True
families = [
"mindbender.model",
"mindbender.lookdev"
]
def process(self, instance):
from maya import cmds
has_multiple_shapes = list()
for node in instance:
children = cmds.listRelatives(node, allDescendents=True) or list()
shapes = cmds.listRelatives(node, shapes=True) or list()
# Ensure there is only one child; there could be many,
# including other transform nodes.
has_single_shape = len(children) == 1
# Ensure the one child is a shape
has_single_child = len(shapes) == 1
# Ensure the one child is of type "mesh"
has_single_mesh = cmds.nodeType(shapes[0]) == "mesh"
if not all([has_single_child,
has_single_shape,
has_single_mesh]):
has_multiple_shapes.append(node)
assert not has_multiple_shapes, (
"\"%s\" has transforms with multiple shapes: %s" % (
instance, ", ".join(
"\"" + member + "\"" for member in has_multiple_shapes))
)
Repair validate single shape validator
|
import pyblish.api
class ValidateMindbenderSingleShape(pyblish.api.InstancePlugin):
"""Transforms with a mesh must ever only contain a single mesh
This ensures models only contain a single shape node.
"""
label = "Validate Single Shape"
order = pyblish.api.ValidatorOrder
hosts = ["maya"]
families = [
"mindbender.model",
]
def process(self, instance):
from maya import cmds
has_multiple_shapes = list()
# Consider entire hierarchy of nodes included in an Instance
hierarchy = cmds.listRelatives(instance, allDescendents=True)
# Consider only nodes of type="mesh"
meshes = cmds.ls(hierarchy, type="mesh", long=True)
transforms = cmds.listRelatives(meshes, parent=True)
for transform in set(transforms):
shapes = cmds.listRelatives(transform, shapes=True) or list()
# Ensure the one child is a shape
has_single_shape = len(shapes) == 1
self.log.info("has single shape: %s" % has_single_shape)
# Ensure the one shape is of type "mesh"
has_single_mesh = (
has_single_shape and
cmds.nodeType(shapes[0]) == "mesh"
)
self.log.info("has single mesh: %s" % has_single_mesh)
if not all([has_single_shape, has_single_mesh]):
has_multiple_shapes.append(transform)
assert not has_multiple_shapes, (
"\"%s\" has transforms with multiple shapes: %s" % (
instance, ", ".join(
"\"" + member + "\"" for member in has_multiple_shapes))
)
|
<commit_before>import pyblish.api
class ValidateMindbenderSingleShape(pyblish.api.InstancePlugin):
"""One mesh per transform"""
label = "Validate Single Shape"
order = pyblish.api.ValidatorOrder
hosts = ["maya"]
active = False
optional = True
families = [
"mindbender.model",
"mindbender.lookdev"
]
def process(self, instance):
from maya import cmds
has_multiple_shapes = list()
for node in instance:
children = cmds.listRelatives(node, allDescendents=True) or list()
shapes = cmds.listRelatives(node, shapes=True) or list()
# Ensure there is only one child; there could be many,
# including other transform nodes.
has_single_shape = len(children) == 1
# Ensure the one child is a shape
has_single_child = len(shapes) == 1
# Ensure the one child is of type "mesh"
has_single_mesh = cmds.nodeType(shapes[0]) == "mesh"
if not all([has_single_child,
has_single_shape,
has_single_mesh]):
has_multiple_shapes.append(node)
assert not has_multiple_shapes, (
"\"%s\" has transforms with multiple shapes: %s" % (
instance, ", ".join(
"\"" + member + "\"" for member in has_multiple_shapes))
)
<commit_msg>Repair validate single shape validator<commit_after>
|
import pyblish.api
class ValidateMindbenderSingleShape(pyblish.api.InstancePlugin):
"""Transforms with a mesh must ever only contain a single mesh
This ensures models only contain a single shape node.
"""
label = "Validate Single Shape"
order = pyblish.api.ValidatorOrder
hosts = ["maya"]
families = [
"mindbender.model",
]
def process(self, instance):
from maya import cmds
has_multiple_shapes = list()
# Consider entire hierarchy of nodes included in an Instance
hierarchy = cmds.listRelatives(instance, allDescendents=True)
# Consider only nodes of type="mesh"
meshes = cmds.ls(hierarchy, type="mesh", long=True)
transforms = cmds.listRelatives(meshes, parent=True)
for transform in set(transforms):
shapes = cmds.listRelatives(transform, shapes=True) or list()
# Ensure the one child is a shape
has_single_shape = len(shapes) == 1
self.log.info("has single shape: %s" % has_single_shape)
# Ensure the one shape is of type "mesh"
has_single_mesh = (
has_single_shape and
cmds.nodeType(shapes[0]) == "mesh"
)
self.log.info("has single mesh: %s" % has_single_mesh)
if not all([has_single_shape, has_single_mesh]):
has_multiple_shapes.append(transform)
assert not has_multiple_shapes, (
"\"%s\" has transforms with multiple shapes: %s" % (
instance, ", ".join(
"\"" + member + "\"" for member in has_multiple_shapes))
)
|
import pyblish.api
class ValidateMindbenderSingleShape(pyblish.api.InstancePlugin):
"""One mesh per transform"""
label = "Validate Single Shape"
order = pyblish.api.ValidatorOrder
hosts = ["maya"]
active = False
optional = True
families = [
"mindbender.model",
"mindbender.lookdev"
]
def process(self, instance):
from maya import cmds
has_multiple_shapes = list()
for node in instance:
children = cmds.listRelatives(node, allDescendents=True) or list()
shapes = cmds.listRelatives(node, shapes=True) or list()
# Ensure there is only one child; there could be many,
# including other transform nodes.
has_single_shape = len(children) == 1
# Ensure the one child is a shape
has_single_child = len(shapes) == 1
# Ensure the one child is of type "mesh"
has_single_mesh = cmds.nodeType(shapes[0]) == "mesh"
if not all([has_single_child,
has_single_shape,
has_single_mesh]):
has_multiple_shapes.append(node)
assert not has_multiple_shapes, (
"\"%s\" has transforms with multiple shapes: %s" % (
instance, ", ".join(
"\"" + member + "\"" for member in has_multiple_shapes))
)
Repair validate single shape validatorimport pyblish.api
class ValidateMindbenderSingleShape(pyblish.api.InstancePlugin):
"""Transforms with a mesh must ever only contain a single mesh
This ensures models only contain a single shape node.
"""
label = "Validate Single Shape"
order = pyblish.api.ValidatorOrder
hosts = ["maya"]
families = [
"mindbender.model",
]
def process(self, instance):
from maya import cmds
has_multiple_shapes = list()
# Consider entire hierarchy of nodes included in an Instance
hierarchy = cmds.listRelatives(instance, allDescendents=True)
# Consider only nodes of type="mesh"
meshes = cmds.ls(hierarchy, type="mesh", long=True)
transforms = cmds.listRelatives(meshes, parent=True)
for transform in set(transforms):
shapes = cmds.listRelatives(transform, shapes=True) or list()
# Ensure the one child is a shape
has_single_shape = len(shapes) == 1
self.log.info("has single shape: %s" % has_single_shape)
# Ensure the one shape is of type "mesh"
has_single_mesh = (
has_single_shape and
cmds.nodeType(shapes[0]) == "mesh"
)
self.log.info("has single mesh: %s" % has_single_mesh)
if not all([has_single_shape, has_single_mesh]):
has_multiple_shapes.append(transform)
assert not has_multiple_shapes, (
"\"%s\" has transforms with multiple shapes: %s" % (
instance, ", ".join(
"\"" + member + "\"" for member in has_multiple_shapes))
)
|
<commit_before>import pyblish.api
class ValidateMindbenderSingleShape(pyblish.api.InstancePlugin):
"""One mesh per transform"""
label = "Validate Single Shape"
order = pyblish.api.ValidatorOrder
hosts = ["maya"]
active = False
optional = True
families = [
"mindbender.model",
"mindbender.lookdev"
]
def process(self, instance):
from maya import cmds
has_multiple_shapes = list()
for node in instance:
children = cmds.listRelatives(node, allDescendents=True) or list()
shapes = cmds.listRelatives(node, shapes=True) or list()
# Ensure there is only one child; there could be many,
# including other transform nodes.
has_single_shape = len(children) == 1
# Ensure the one child is a shape
has_single_child = len(shapes) == 1
# Ensure the one child is of type "mesh"
has_single_mesh = cmds.nodeType(shapes[0]) == "mesh"
if not all([has_single_child,
has_single_shape,
has_single_mesh]):
has_multiple_shapes.append(node)
assert not has_multiple_shapes, (
"\"%s\" has transforms with multiple shapes: %s" % (
instance, ", ".join(
"\"" + member + "\"" for member in has_multiple_shapes))
)
<commit_msg>Repair validate single shape validator<commit_after>import pyblish.api
class ValidateMindbenderSingleShape(pyblish.api.InstancePlugin):
"""Transforms with a mesh must ever only contain a single mesh
This ensures models only contain a single shape node.
"""
label = "Validate Single Shape"
order = pyblish.api.ValidatorOrder
hosts = ["maya"]
families = [
"mindbender.model",
]
def process(self, instance):
from maya import cmds
has_multiple_shapes = list()
# Consider entire hierarchy of nodes included in an Instance
hierarchy = cmds.listRelatives(instance, allDescendents=True)
# Consider only nodes of type="mesh"
meshes = cmds.ls(hierarchy, type="mesh", long=True)
transforms = cmds.listRelatives(meshes, parent=True)
for transform in set(transforms):
shapes = cmds.listRelatives(transform, shapes=True) or list()
# Ensure the one child is a shape
has_single_shape = len(shapes) == 1
self.log.info("has single shape: %s" % has_single_shape)
# Ensure the one shape is of type "mesh"
has_single_mesh = (
has_single_shape and
cmds.nodeType(shapes[0]) == "mesh"
)
self.log.info("has single mesh: %s" % has_single_mesh)
if not all([has_single_shape, has_single_mesh]):
has_multiple_shapes.append(transform)
assert not has_multiple_shapes, (
"\"%s\" has transforms with multiple shapes: %s" % (
instance, ", ".join(
"\"" + member + "\"" for member in has_multiple_shapes))
)
|
d57e4993ece29da34c370a96732c820798c5048b
|
fake-service/features/environment.py
|
fake-service/features/environment.py
|
#
# Copyright (c) 2014 ThoughtWorks, Inc.
#
# Pixelated 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.
#
# Pixelated 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 Pixelated. If not, see <http://www.gnu.org/licenses/>.
from selenium import webdriver
def before_feature(context, feature):
#context.browser = webdriver.Firefox()
context.browser = webdriver.PhantomJS()
context.browser.set_window_size(1280, 1024)
context.browser.implicitly_wait(10)
context.browser.set_page_load_timeout(120) # wait for data
context.browser.get('http://localhost:4567/')
def after_feature(context, feature):
context.browser.quit()
def take_screenshot(context):
context.browser.save_screenshot('/tmp/screenshot.jpeg')
def save_source(context):
with open('/tmp/source.html', 'w') as out:
out.write(context.browser.page_source.encode('utf8'))
|
#
# Copyright (c) 2014 ThoughtWorks, Inc.
#
# Pixelated 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.
#
# Pixelated 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 Pixelated. If not, see <http://www.gnu.org/licenses/>.
from selenium import webdriver
def before_feature(context, feature):
#context.browser = webdriver.Firefox()
context.browser = webdriver.PhantomJS()
context.browser.set_window_size(1280, 1024)
context.browser.implicitly_wait(5)
context.browser.set_page_load_timeout(60) # wait for data
context.browser.get('http://localhost:4567/')
def after_feature(context, feature):
context.browser.quit()
def take_screenshot(context):
context.browser.save_screenshot('/tmp/screenshot.jpeg')
def save_source(context):
with open('/tmp/source.html', 'w') as out:
out.write(context.browser.page_source.encode('utf8'))
|
Revert "increasing webdriver timeout on fake-service"
|
Revert "increasing webdriver timeout on fake-service"
This reverts commit a39a4b40a947db655c84af6eb62d5870cfd8b32c.
|
Python
|
agpl-3.0
|
alabeduarte/pixelated-user-agent,phazel/pixelated-user-agent,pixelated-project/pixelated-user-agent,sw00/pixelated-user-agent,SamuelToh/pixelated-user-agent,SamuelToh/pixelated-user-agent,PuZZleDucK/pixelated-user-agent,sw00/pixelated-user-agent,SamuelToh/pixelated-user-agent,phazel/pixelated-user-agent,pixelated/pixelated-user-agent,PuZZleDucK/pixelated-user-agent,sw00/pixelated-user-agent,torquemad/pixelated-user-agent,SamuelToh/pixelated-user-agent,torquemad/pixelated-user-agent,PuZZleDucK/pixelated-user-agent,sw00/pixelated-user-agent,PuZZleDucK/pixelated-user-agent,sw00/pixelated-user-agent,torquemad/pixelated-user-agent,pixelated/pixelated-user-agent,kaeff/pixelated-user-agent,alabeduarte/pixelated-user-agent,rdoh/pixelated-user-agent,rdoh/pixelated-user-agent,kaeff/pixelated-user-agent,kaeff/pixelated-user-agent,pixelated-project/pixelated-user-agent,pixelated/pixelated-user-agent,alabeduarte/pixelated-user-agent,pixelated-project/pixelated-user-agent,pixelated/pixelated-user-agent,rdoh/pixelated-user-agent,pixelated/pixelated-user-agent,torquemad/pixelated-user-agent,pixelated-project/pixelated-user-agent,phazel/pixelated-user-agent,phazel/pixelated-user-agent,rdoh/pixelated-user-agent,alabeduarte/pixelated-user-agent,phazel/pixelated-user-agent,alabeduarte/pixelated-user-agent,torquemad/pixelated-user-agent,pixelated-project/pixelated-user-agent,kaeff/pixelated-user-agent,rdoh/pixelated-user-agent,kaeff/pixelated-user-agent,PuZZleDucK/pixelated-user-agent,SamuelToh/pixelated-user-agent
|
#
# Copyright (c) 2014 ThoughtWorks, Inc.
#
# Pixelated 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.
#
# Pixelated 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 Pixelated. If not, see <http://www.gnu.org/licenses/>.
from selenium import webdriver
def before_feature(context, feature):
#context.browser = webdriver.Firefox()
context.browser = webdriver.PhantomJS()
context.browser.set_window_size(1280, 1024)
context.browser.implicitly_wait(10)
context.browser.set_page_load_timeout(120) # wait for data
context.browser.get('http://localhost:4567/')
def after_feature(context, feature):
context.browser.quit()
def take_screenshot(context):
context.browser.save_screenshot('/tmp/screenshot.jpeg')
def save_source(context):
with open('/tmp/source.html', 'w') as out:
out.write(context.browser.page_source.encode('utf8'))
Revert "increasing webdriver timeout on fake-service"
This reverts commit a39a4b40a947db655c84af6eb62d5870cfd8b32c.
|
#
# Copyright (c) 2014 ThoughtWorks, Inc.
#
# Pixelated 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.
#
# Pixelated 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 Pixelated. If not, see <http://www.gnu.org/licenses/>.
from selenium import webdriver
def before_feature(context, feature):
#context.browser = webdriver.Firefox()
context.browser = webdriver.PhantomJS()
context.browser.set_window_size(1280, 1024)
context.browser.implicitly_wait(5)
context.browser.set_page_load_timeout(60) # wait for data
context.browser.get('http://localhost:4567/')
def after_feature(context, feature):
context.browser.quit()
def take_screenshot(context):
context.browser.save_screenshot('/tmp/screenshot.jpeg')
def save_source(context):
with open('/tmp/source.html', 'w') as out:
out.write(context.browser.page_source.encode('utf8'))
|
<commit_before>#
# Copyright (c) 2014 ThoughtWorks, Inc.
#
# Pixelated 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.
#
# Pixelated 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 Pixelated. If not, see <http://www.gnu.org/licenses/>.
from selenium import webdriver
def before_feature(context, feature):
#context.browser = webdriver.Firefox()
context.browser = webdriver.PhantomJS()
context.browser.set_window_size(1280, 1024)
context.browser.implicitly_wait(10)
context.browser.set_page_load_timeout(120) # wait for data
context.browser.get('http://localhost:4567/')
def after_feature(context, feature):
context.browser.quit()
def take_screenshot(context):
context.browser.save_screenshot('/tmp/screenshot.jpeg')
def save_source(context):
with open('/tmp/source.html', 'w') as out:
out.write(context.browser.page_source.encode('utf8'))
<commit_msg>Revert "increasing webdriver timeout on fake-service"
This reverts commit a39a4b40a947db655c84af6eb62d5870cfd8b32c.<commit_after>
|
#
# Copyright (c) 2014 ThoughtWorks, Inc.
#
# Pixelated 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.
#
# Pixelated 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 Pixelated. If not, see <http://www.gnu.org/licenses/>.
from selenium import webdriver
def before_feature(context, feature):
#context.browser = webdriver.Firefox()
context.browser = webdriver.PhantomJS()
context.browser.set_window_size(1280, 1024)
context.browser.implicitly_wait(5)
context.browser.set_page_load_timeout(60) # wait for data
context.browser.get('http://localhost:4567/')
def after_feature(context, feature):
context.browser.quit()
def take_screenshot(context):
context.browser.save_screenshot('/tmp/screenshot.jpeg')
def save_source(context):
with open('/tmp/source.html', 'w') as out:
out.write(context.browser.page_source.encode('utf8'))
|
#
# Copyright (c) 2014 ThoughtWorks, Inc.
#
# Pixelated 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.
#
# Pixelated 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 Pixelated. If not, see <http://www.gnu.org/licenses/>.
from selenium import webdriver
def before_feature(context, feature):
#context.browser = webdriver.Firefox()
context.browser = webdriver.PhantomJS()
context.browser.set_window_size(1280, 1024)
context.browser.implicitly_wait(10)
context.browser.set_page_load_timeout(120) # wait for data
context.browser.get('http://localhost:4567/')
def after_feature(context, feature):
context.browser.quit()
def take_screenshot(context):
context.browser.save_screenshot('/tmp/screenshot.jpeg')
def save_source(context):
with open('/tmp/source.html', 'w') as out:
out.write(context.browser.page_source.encode('utf8'))
Revert "increasing webdriver timeout on fake-service"
This reverts commit a39a4b40a947db655c84af6eb62d5870cfd8b32c.#
# Copyright (c) 2014 ThoughtWorks, Inc.
#
# Pixelated 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.
#
# Pixelated 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 Pixelated. If not, see <http://www.gnu.org/licenses/>.
from selenium import webdriver
def before_feature(context, feature):
#context.browser = webdriver.Firefox()
context.browser = webdriver.PhantomJS()
context.browser.set_window_size(1280, 1024)
context.browser.implicitly_wait(5)
context.browser.set_page_load_timeout(60) # wait for data
context.browser.get('http://localhost:4567/')
def after_feature(context, feature):
context.browser.quit()
def take_screenshot(context):
context.browser.save_screenshot('/tmp/screenshot.jpeg')
def save_source(context):
with open('/tmp/source.html', 'w') as out:
out.write(context.browser.page_source.encode('utf8'))
|
<commit_before>#
# Copyright (c) 2014 ThoughtWorks, Inc.
#
# Pixelated 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.
#
# Pixelated 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 Pixelated. If not, see <http://www.gnu.org/licenses/>.
from selenium import webdriver
def before_feature(context, feature):
#context.browser = webdriver.Firefox()
context.browser = webdriver.PhantomJS()
context.browser.set_window_size(1280, 1024)
context.browser.implicitly_wait(10)
context.browser.set_page_load_timeout(120) # wait for data
context.browser.get('http://localhost:4567/')
def after_feature(context, feature):
context.browser.quit()
def take_screenshot(context):
context.browser.save_screenshot('/tmp/screenshot.jpeg')
def save_source(context):
with open('/tmp/source.html', 'w') as out:
out.write(context.browser.page_source.encode('utf8'))
<commit_msg>Revert "increasing webdriver timeout on fake-service"
This reverts commit a39a4b40a947db655c84af6eb62d5870cfd8b32c.<commit_after>#
# Copyright (c) 2014 ThoughtWorks, Inc.
#
# Pixelated 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.
#
# Pixelated 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 Pixelated. If not, see <http://www.gnu.org/licenses/>.
from selenium import webdriver
def before_feature(context, feature):
#context.browser = webdriver.Firefox()
context.browser = webdriver.PhantomJS()
context.browser.set_window_size(1280, 1024)
context.browser.implicitly_wait(5)
context.browser.set_page_load_timeout(60) # wait for data
context.browser.get('http://localhost:4567/')
def after_feature(context, feature):
context.browser.quit()
def take_screenshot(context):
context.browser.save_screenshot('/tmp/screenshot.jpeg')
def save_source(context):
with open('/tmp/source.html', 'w') as out:
out.write(context.browser.page_source.encode('utf8'))
|
e994aa4c4389177aedca8192a41d27bdbb81458e
|
tests/conftest.py
|
tests/conftest.py
|
from distutils import dir_util
import pytest
import os
@pytest.fixture(scope="class")
def datadir(tmpdir_factory, request):
"""
Fixture responsible for searching a folder with the same name of test
module and, if available, moving all contents to a temporary directory so
tests can use them freely.
Adapted from http://stackoverflow.com/a/29631801/2043465
"""
filename = request.module.__file__
test_dir, _ = os.path.splitext(filename)
if os.path.isdir(test_dir):
tmpdir = tmpdir_factory.mktemp("data")
dir_util.copy_tree(test_dir, str(tmpdir))
tmpdir.chdir()
return tmpdir
|
from distutils import dir_util
import pytest
import os
@pytest.fixture(scope="function")
def datadir(tmpdir_factory, request):
"""
Fixture responsible for searching a folder with the same name of test
module and, if available, moving all contents to a temporary directory so
tests can use them freely.
Adapted from http://stackoverflow.com/a/29631801/2043465
"""
filename = request.module.__file__
test_dir, _ = os.path.splitext(filename)
if os.path.isdir(test_dir):
tmpdir = tmpdir_factory.mktemp("data")
dir_util.copy_tree(test_dir, str(tmpdir))
tmpdir.chdir()
return tmpdir
|
Change scope of datadir fixture to function-level
|
Change scope of datadir fixture to function-level
|
Python
|
mit
|
ZedThree/fort_depend.py,ZedThree/fort_depend.py
|
from distutils import dir_util
import pytest
import os
@pytest.fixture(scope="class")
def datadir(tmpdir_factory, request):
"""
Fixture responsible for searching a folder with the same name of test
module and, if available, moving all contents to a temporary directory so
tests can use them freely.
Adapted from http://stackoverflow.com/a/29631801/2043465
"""
filename = request.module.__file__
test_dir, _ = os.path.splitext(filename)
if os.path.isdir(test_dir):
tmpdir = tmpdir_factory.mktemp("data")
dir_util.copy_tree(test_dir, str(tmpdir))
tmpdir.chdir()
return tmpdir
Change scope of datadir fixture to function-level
|
from distutils import dir_util
import pytest
import os
@pytest.fixture(scope="function")
def datadir(tmpdir_factory, request):
"""
Fixture responsible for searching a folder with the same name of test
module and, if available, moving all contents to a temporary directory so
tests can use them freely.
Adapted from http://stackoverflow.com/a/29631801/2043465
"""
filename = request.module.__file__
test_dir, _ = os.path.splitext(filename)
if os.path.isdir(test_dir):
tmpdir = tmpdir_factory.mktemp("data")
dir_util.copy_tree(test_dir, str(tmpdir))
tmpdir.chdir()
return tmpdir
|
<commit_before>from distutils import dir_util
import pytest
import os
@pytest.fixture(scope="class")
def datadir(tmpdir_factory, request):
"""
Fixture responsible for searching a folder with the same name of test
module and, if available, moving all contents to a temporary directory so
tests can use them freely.
Adapted from http://stackoverflow.com/a/29631801/2043465
"""
filename = request.module.__file__
test_dir, _ = os.path.splitext(filename)
if os.path.isdir(test_dir):
tmpdir = tmpdir_factory.mktemp("data")
dir_util.copy_tree(test_dir, str(tmpdir))
tmpdir.chdir()
return tmpdir
<commit_msg>Change scope of datadir fixture to function-level<commit_after>
|
from distutils import dir_util
import pytest
import os
@pytest.fixture(scope="function")
def datadir(tmpdir_factory, request):
"""
Fixture responsible for searching a folder with the same name of test
module and, if available, moving all contents to a temporary directory so
tests can use them freely.
Adapted from http://stackoverflow.com/a/29631801/2043465
"""
filename = request.module.__file__
test_dir, _ = os.path.splitext(filename)
if os.path.isdir(test_dir):
tmpdir = tmpdir_factory.mktemp("data")
dir_util.copy_tree(test_dir, str(tmpdir))
tmpdir.chdir()
return tmpdir
|
from distutils import dir_util
import pytest
import os
@pytest.fixture(scope="class")
def datadir(tmpdir_factory, request):
"""
Fixture responsible for searching a folder with the same name of test
module and, if available, moving all contents to a temporary directory so
tests can use them freely.
Adapted from http://stackoverflow.com/a/29631801/2043465
"""
filename = request.module.__file__
test_dir, _ = os.path.splitext(filename)
if os.path.isdir(test_dir):
tmpdir = tmpdir_factory.mktemp("data")
dir_util.copy_tree(test_dir, str(tmpdir))
tmpdir.chdir()
return tmpdir
Change scope of datadir fixture to function-levelfrom distutils import dir_util
import pytest
import os
@pytest.fixture(scope="function")
def datadir(tmpdir_factory, request):
"""
Fixture responsible for searching a folder with the same name of test
module and, if available, moving all contents to a temporary directory so
tests can use them freely.
Adapted from http://stackoverflow.com/a/29631801/2043465
"""
filename = request.module.__file__
test_dir, _ = os.path.splitext(filename)
if os.path.isdir(test_dir):
tmpdir = tmpdir_factory.mktemp("data")
dir_util.copy_tree(test_dir, str(tmpdir))
tmpdir.chdir()
return tmpdir
|
<commit_before>from distutils import dir_util
import pytest
import os
@pytest.fixture(scope="class")
def datadir(tmpdir_factory, request):
"""
Fixture responsible for searching a folder with the same name of test
module and, if available, moving all contents to a temporary directory so
tests can use them freely.
Adapted from http://stackoverflow.com/a/29631801/2043465
"""
filename = request.module.__file__
test_dir, _ = os.path.splitext(filename)
if os.path.isdir(test_dir):
tmpdir = tmpdir_factory.mktemp("data")
dir_util.copy_tree(test_dir, str(tmpdir))
tmpdir.chdir()
return tmpdir
<commit_msg>Change scope of datadir fixture to function-level<commit_after>from distutils import dir_util
import pytest
import os
@pytest.fixture(scope="function")
def datadir(tmpdir_factory, request):
"""
Fixture responsible for searching a folder with the same name of test
module and, if available, moving all contents to a temporary directory so
tests can use them freely.
Adapted from http://stackoverflow.com/a/29631801/2043465
"""
filename = request.module.__file__
test_dir, _ = os.path.splitext(filename)
if os.path.isdir(test_dir):
tmpdir = tmpdir_factory.mktemp("data")
dir_util.copy_tree(test_dir, str(tmpdir))
tmpdir.chdir()
return tmpdir
|
2e0585a59e7c3c60b8bf7e0a8d5e377b7f2f9cd5
|
grammar/entities/adjectives/deff.py
|
grammar/entities/adjectives/deff.py
|
from pyparsing import *
from ...constants.math.deff import NUM, FULLNUM
from ...constants.zones.deff import TOP, BOTTOM
from ...constants.verbs.deff import *
from ...mana.deff import color
from ...types.deff import nontype, supertype
from ...functions.deff import delimitedListAnd, delimitedListOr
from decl import *
topnum << (TOP|BOTTOM) + (NUM|FULLNUM)
attacking << ATTACK
blocking << BLOCK
tapped << TAP
untapped << UNTAP
enchanted << ENCHANT
equipped << EQUIP
exiled << EXILE
sacrificed << SACRIFICE
haunted << HAUNT
adjective << (
color
| nontype
| supertype
| topnum
| attacking
| blocking
| tapped
| untapped
| enchanted
| equipped
| exiled
| sacrificed
| haunted
)
andadjectives << delimitedListAnd(adjective)
oradjectives << delimitedListOr(adjective)
adjectives << OneOrMore(andadjectives ^ oradjectives)
|
from pyparsing import *
from ...constants.math.deff import NUM, FULLNUM
from ...constants.zones.deff import TOP, BOTTOM
from ...constants.verbs.deff import *
from ...mana.deff import color
from ...types.deff import nontype, supertype
from ...functions.deff import delimitedListAnd, delimitedListOr
from decl import *
topnum << (TOP|BOTTOM) + (NUM|FULLNUM)
attacking << ATTACK
blocking << BLOCK
tapped << TAP
untapped << UNTAP
enchanted << ENCHANT
equipped << EQUIP
exiled << EXILE
sacrificed << SACRIFICE
haunted << HAUNT
adjective << (
color
| nontype
| supertype
| topnum
| attacking
| blocking
| tapped
| untapped
| enchanted
| equipped
| exiled
| sacrificed
| haunted
)
# 'and' captures both 'legendary creature' (juxtaposed) and 'black and red' (joined)
# 'or' will capture explicit disjunctions 'black or red'
# but since it will come after the ^, not juxtapositions (taken by 'and')
# so the 'one or more' allows 'legendary black or red'
# to be correctly interpreted as (A and (B or C))
# it's non-intuitive, but it works
# at the same time, it forces us to use ^ instead of |
# or "target artifact, enchantment or land"
# becomes ((A and B) or C)
andadjectives << delimitedListAnd(adjective)
oradjectives << delimitedListOr(adjective)
adjectives << OneOrMore(andadjectives ^ oradjectives)
|
Add commentary explaining and/or lists
|
Add commentary explaining and/or lists
|
Python
|
mit
|
jrgdiz/cardwalker,jrgdiz/cardwalker
|
from pyparsing import *
from ...constants.math.deff import NUM, FULLNUM
from ...constants.zones.deff import TOP, BOTTOM
from ...constants.verbs.deff import *
from ...mana.deff import color
from ...types.deff import nontype, supertype
from ...functions.deff import delimitedListAnd, delimitedListOr
from decl import *
topnum << (TOP|BOTTOM) + (NUM|FULLNUM)
attacking << ATTACK
blocking << BLOCK
tapped << TAP
untapped << UNTAP
enchanted << ENCHANT
equipped << EQUIP
exiled << EXILE
sacrificed << SACRIFICE
haunted << HAUNT
adjective << (
color
| nontype
| supertype
| topnum
| attacking
| blocking
| tapped
| untapped
| enchanted
| equipped
| exiled
| sacrificed
| haunted
)
andadjectives << delimitedListAnd(adjective)
oradjectives << delimitedListOr(adjective)
adjectives << OneOrMore(andadjectives ^ oradjectives)Add commentary explaining and/or lists
|
from pyparsing import *
from ...constants.math.deff import NUM, FULLNUM
from ...constants.zones.deff import TOP, BOTTOM
from ...constants.verbs.deff import *
from ...mana.deff import color
from ...types.deff import nontype, supertype
from ...functions.deff import delimitedListAnd, delimitedListOr
from decl import *
topnum << (TOP|BOTTOM) + (NUM|FULLNUM)
attacking << ATTACK
blocking << BLOCK
tapped << TAP
untapped << UNTAP
enchanted << ENCHANT
equipped << EQUIP
exiled << EXILE
sacrificed << SACRIFICE
haunted << HAUNT
adjective << (
color
| nontype
| supertype
| topnum
| attacking
| blocking
| tapped
| untapped
| enchanted
| equipped
| exiled
| sacrificed
| haunted
)
# 'and' captures both 'legendary creature' (juxtaposed) and 'black and red' (joined)
# 'or' will capture explicit disjunctions 'black or red'
# but since it will come after the ^, not juxtapositions (taken by 'and')
# so the 'one or more' allows 'legendary black or red'
# to be correctly interpreted as (A and (B or C))
# it's non-intuitive, but it works
# at the same time, it forces us to use ^ instead of |
# or "target artifact, enchantment or land"
# becomes ((A and B) or C)
andadjectives << delimitedListAnd(adjective)
oradjectives << delimitedListOr(adjective)
adjectives << OneOrMore(andadjectives ^ oradjectives)
|
<commit_before>from pyparsing import *
from ...constants.math.deff import NUM, FULLNUM
from ...constants.zones.deff import TOP, BOTTOM
from ...constants.verbs.deff import *
from ...mana.deff import color
from ...types.deff import nontype, supertype
from ...functions.deff import delimitedListAnd, delimitedListOr
from decl import *
topnum << (TOP|BOTTOM) + (NUM|FULLNUM)
attacking << ATTACK
blocking << BLOCK
tapped << TAP
untapped << UNTAP
enchanted << ENCHANT
equipped << EQUIP
exiled << EXILE
sacrificed << SACRIFICE
haunted << HAUNT
adjective << (
color
| nontype
| supertype
| topnum
| attacking
| blocking
| tapped
| untapped
| enchanted
| equipped
| exiled
| sacrificed
| haunted
)
andadjectives << delimitedListAnd(adjective)
oradjectives << delimitedListOr(adjective)
adjectives << OneOrMore(andadjectives ^ oradjectives)<commit_msg>Add commentary explaining and/or lists<commit_after>
|
from pyparsing import *
from ...constants.math.deff import NUM, FULLNUM
from ...constants.zones.deff import TOP, BOTTOM
from ...constants.verbs.deff import *
from ...mana.deff import color
from ...types.deff import nontype, supertype
from ...functions.deff import delimitedListAnd, delimitedListOr
from decl import *
topnum << (TOP|BOTTOM) + (NUM|FULLNUM)
attacking << ATTACK
blocking << BLOCK
tapped << TAP
untapped << UNTAP
enchanted << ENCHANT
equipped << EQUIP
exiled << EXILE
sacrificed << SACRIFICE
haunted << HAUNT
adjective << (
color
| nontype
| supertype
| topnum
| attacking
| blocking
| tapped
| untapped
| enchanted
| equipped
| exiled
| sacrificed
| haunted
)
# 'and' captures both 'legendary creature' (juxtaposed) and 'black and red' (joined)
# 'or' will capture explicit disjunctions 'black or red'
# but since it will come after the ^, not juxtapositions (taken by 'and')
# so the 'one or more' allows 'legendary black or red'
# to be correctly interpreted as (A and (B or C))
# it's non-intuitive, but it works
# at the same time, it forces us to use ^ instead of |
# or "target artifact, enchantment or land"
# becomes ((A and B) or C)
andadjectives << delimitedListAnd(adjective)
oradjectives << delimitedListOr(adjective)
adjectives << OneOrMore(andadjectives ^ oradjectives)
|
from pyparsing import *
from ...constants.math.deff import NUM, FULLNUM
from ...constants.zones.deff import TOP, BOTTOM
from ...constants.verbs.deff import *
from ...mana.deff import color
from ...types.deff import nontype, supertype
from ...functions.deff import delimitedListAnd, delimitedListOr
from decl import *
topnum << (TOP|BOTTOM) + (NUM|FULLNUM)
attacking << ATTACK
blocking << BLOCK
tapped << TAP
untapped << UNTAP
enchanted << ENCHANT
equipped << EQUIP
exiled << EXILE
sacrificed << SACRIFICE
haunted << HAUNT
adjective << (
color
| nontype
| supertype
| topnum
| attacking
| blocking
| tapped
| untapped
| enchanted
| equipped
| exiled
| sacrificed
| haunted
)
andadjectives << delimitedListAnd(adjective)
oradjectives << delimitedListOr(adjective)
adjectives << OneOrMore(andadjectives ^ oradjectives)Add commentary explaining and/or listsfrom pyparsing import *
from ...constants.math.deff import NUM, FULLNUM
from ...constants.zones.deff import TOP, BOTTOM
from ...constants.verbs.deff import *
from ...mana.deff import color
from ...types.deff import nontype, supertype
from ...functions.deff import delimitedListAnd, delimitedListOr
from decl import *
topnum << (TOP|BOTTOM) + (NUM|FULLNUM)
attacking << ATTACK
blocking << BLOCK
tapped << TAP
untapped << UNTAP
enchanted << ENCHANT
equipped << EQUIP
exiled << EXILE
sacrificed << SACRIFICE
haunted << HAUNT
adjective << (
color
| nontype
| supertype
| topnum
| attacking
| blocking
| tapped
| untapped
| enchanted
| equipped
| exiled
| sacrificed
| haunted
)
# 'and' captures both 'legendary creature' (juxtaposed) and 'black and red' (joined)
# 'or' will capture explicit disjunctions 'black or red'
# but since it will come after the ^, not juxtapositions (taken by 'and')
# so the 'one or more' allows 'legendary black or red'
# to be correctly interpreted as (A and (B or C))
# it's non-intuitive, but it works
# at the same time, it forces us to use ^ instead of |
# or "target artifact, enchantment or land"
# becomes ((A and B) or C)
andadjectives << delimitedListAnd(adjective)
oradjectives << delimitedListOr(adjective)
adjectives << OneOrMore(andadjectives ^ oradjectives)
|
<commit_before>from pyparsing import *
from ...constants.math.deff import NUM, FULLNUM
from ...constants.zones.deff import TOP, BOTTOM
from ...constants.verbs.deff import *
from ...mana.deff import color
from ...types.deff import nontype, supertype
from ...functions.deff import delimitedListAnd, delimitedListOr
from decl import *
topnum << (TOP|BOTTOM) + (NUM|FULLNUM)
attacking << ATTACK
blocking << BLOCK
tapped << TAP
untapped << UNTAP
enchanted << ENCHANT
equipped << EQUIP
exiled << EXILE
sacrificed << SACRIFICE
haunted << HAUNT
adjective << (
color
| nontype
| supertype
| topnum
| attacking
| blocking
| tapped
| untapped
| enchanted
| equipped
| exiled
| sacrificed
| haunted
)
andadjectives << delimitedListAnd(adjective)
oradjectives << delimitedListOr(adjective)
adjectives << OneOrMore(andadjectives ^ oradjectives)<commit_msg>Add commentary explaining and/or lists<commit_after>from pyparsing import *
from ...constants.math.deff import NUM, FULLNUM
from ...constants.zones.deff import TOP, BOTTOM
from ...constants.verbs.deff import *
from ...mana.deff import color
from ...types.deff import nontype, supertype
from ...functions.deff import delimitedListAnd, delimitedListOr
from decl import *
topnum << (TOP|BOTTOM) + (NUM|FULLNUM)
attacking << ATTACK
blocking << BLOCK
tapped << TAP
untapped << UNTAP
enchanted << ENCHANT
equipped << EQUIP
exiled << EXILE
sacrificed << SACRIFICE
haunted << HAUNT
adjective << (
color
| nontype
| supertype
| topnum
| attacking
| blocking
| tapped
| untapped
| enchanted
| equipped
| exiled
| sacrificed
| haunted
)
# 'and' captures both 'legendary creature' (juxtaposed) and 'black and red' (joined)
# 'or' will capture explicit disjunctions 'black or red'
# but since it will come after the ^, not juxtapositions (taken by 'and')
# so the 'one or more' allows 'legendary black or red'
# to be correctly interpreted as (A and (B or C))
# it's non-intuitive, but it works
# at the same time, it forces us to use ^ instead of |
# or "target artifact, enchantment or land"
# becomes ((A and B) or C)
andadjectives << delimitedListAnd(adjective)
oradjectives << delimitedListOr(adjective)
adjectives << OneOrMore(andadjectives ^ oradjectives)
|
400027592a131872da5754306ee5e0ec2eba61cf
|
tests/test_err.py
|
tests/test_err.py
|
# Testing use of cpl_errs
import pytest
import rasterio
from rasterio.errors import RasterioIOError
def test_io_error(tmpdir):
with pytest.raises(RasterioIOError) as exc_info:
rasterio.open(str(tmpdir.join('foo.tif')))
msg, = exc_info.value.args
assert msg.startswith("'{0}'".format(tmpdir.join('foo.tif')))
assert ("does not exist in the file system, and is not recognised as a "
"supported dataset name.") in msg
def test_io_error_env(tmpdir):
with rasterio.drivers() as env:
drivers_start = env.drivers()
with pytest.raises(RasterioIOError):
rasterio.open(str(tmpdir.join('foo.tif')))
assert env.drivers() == drivers_start
def test_bogus_band_error():
with rasterio.open('tests/data/RGB.byte.tif') as src:
assert src._has_band(4) is False
|
# Testing use of cpl_errs
import pytest
import rasterio
from rasterio.errors import RasterioIOError
def test_io_error(tmpdir):
"""RasterioIOError is raised when a disk file can't be opened.
Newlines are removed from GDAL error messages."""
with pytest.raises(RasterioIOError) as exc_info:
rasterio.open(str(tmpdir.join('foo.tif')))
msg, = exc_info.value.args
assert "\n" not in msg
def test_io_error_env(tmpdir):
with rasterio.drivers() as env:
drivers_start = env.drivers()
with pytest.raises(RasterioIOError):
rasterio.open(str(tmpdir.join('foo.tif')))
assert env.drivers() == drivers_start
def test_bogus_band_error():
with rasterio.open('tests/data/RGB.byte.tif') as src:
assert src._has_band(4) is False
|
Check msg in a way that passes for all GDAL versions
|
Check msg in a way that passes for all GDAL versions
|
Python
|
bsd-3-clause
|
kapadia/rasterio,brendan-ward/rasterio,kapadia/rasterio,kapadia/rasterio,brendan-ward/rasterio,brendan-ward/rasterio
|
# Testing use of cpl_errs
import pytest
import rasterio
from rasterio.errors import RasterioIOError
def test_io_error(tmpdir):
with pytest.raises(RasterioIOError) as exc_info:
rasterio.open(str(tmpdir.join('foo.tif')))
msg, = exc_info.value.args
assert msg.startswith("'{0}'".format(tmpdir.join('foo.tif')))
assert ("does not exist in the file system, and is not recognised as a "
"supported dataset name.") in msg
def test_io_error_env(tmpdir):
with rasterio.drivers() as env:
drivers_start = env.drivers()
with pytest.raises(RasterioIOError):
rasterio.open(str(tmpdir.join('foo.tif')))
assert env.drivers() == drivers_start
def test_bogus_band_error():
with rasterio.open('tests/data/RGB.byte.tif') as src:
assert src._has_band(4) is False
Check msg in a way that passes for all GDAL versions
|
# Testing use of cpl_errs
import pytest
import rasterio
from rasterio.errors import RasterioIOError
def test_io_error(tmpdir):
"""RasterioIOError is raised when a disk file can't be opened.
Newlines are removed from GDAL error messages."""
with pytest.raises(RasterioIOError) as exc_info:
rasterio.open(str(tmpdir.join('foo.tif')))
msg, = exc_info.value.args
assert "\n" not in msg
def test_io_error_env(tmpdir):
with rasterio.drivers() as env:
drivers_start = env.drivers()
with pytest.raises(RasterioIOError):
rasterio.open(str(tmpdir.join('foo.tif')))
assert env.drivers() == drivers_start
def test_bogus_band_error():
with rasterio.open('tests/data/RGB.byte.tif') as src:
assert src._has_band(4) is False
|
<commit_before># Testing use of cpl_errs
import pytest
import rasterio
from rasterio.errors import RasterioIOError
def test_io_error(tmpdir):
with pytest.raises(RasterioIOError) as exc_info:
rasterio.open(str(tmpdir.join('foo.tif')))
msg, = exc_info.value.args
assert msg.startswith("'{0}'".format(tmpdir.join('foo.tif')))
assert ("does not exist in the file system, and is not recognised as a "
"supported dataset name.") in msg
def test_io_error_env(tmpdir):
with rasterio.drivers() as env:
drivers_start = env.drivers()
with pytest.raises(RasterioIOError):
rasterio.open(str(tmpdir.join('foo.tif')))
assert env.drivers() == drivers_start
def test_bogus_band_error():
with rasterio.open('tests/data/RGB.byte.tif') as src:
assert src._has_band(4) is False
<commit_msg>Check msg in a way that passes for all GDAL versions<commit_after>
|
# Testing use of cpl_errs
import pytest
import rasterio
from rasterio.errors import RasterioIOError
def test_io_error(tmpdir):
"""RasterioIOError is raised when a disk file can't be opened.
Newlines are removed from GDAL error messages."""
with pytest.raises(RasterioIOError) as exc_info:
rasterio.open(str(tmpdir.join('foo.tif')))
msg, = exc_info.value.args
assert "\n" not in msg
def test_io_error_env(tmpdir):
with rasterio.drivers() as env:
drivers_start = env.drivers()
with pytest.raises(RasterioIOError):
rasterio.open(str(tmpdir.join('foo.tif')))
assert env.drivers() == drivers_start
def test_bogus_band_error():
with rasterio.open('tests/data/RGB.byte.tif') as src:
assert src._has_band(4) is False
|
# Testing use of cpl_errs
import pytest
import rasterio
from rasterio.errors import RasterioIOError
def test_io_error(tmpdir):
with pytest.raises(RasterioIOError) as exc_info:
rasterio.open(str(tmpdir.join('foo.tif')))
msg, = exc_info.value.args
assert msg.startswith("'{0}'".format(tmpdir.join('foo.tif')))
assert ("does not exist in the file system, and is not recognised as a "
"supported dataset name.") in msg
def test_io_error_env(tmpdir):
with rasterio.drivers() as env:
drivers_start = env.drivers()
with pytest.raises(RasterioIOError):
rasterio.open(str(tmpdir.join('foo.tif')))
assert env.drivers() == drivers_start
def test_bogus_band_error():
with rasterio.open('tests/data/RGB.byte.tif') as src:
assert src._has_band(4) is False
Check msg in a way that passes for all GDAL versions# Testing use of cpl_errs
import pytest
import rasterio
from rasterio.errors import RasterioIOError
def test_io_error(tmpdir):
"""RasterioIOError is raised when a disk file can't be opened.
Newlines are removed from GDAL error messages."""
with pytest.raises(RasterioIOError) as exc_info:
rasterio.open(str(tmpdir.join('foo.tif')))
msg, = exc_info.value.args
assert "\n" not in msg
def test_io_error_env(tmpdir):
with rasterio.drivers() as env:
drivers_start = env.drivers()
with pytest.raises(RasterioIOError):
rasterio.open(str(tmpdir.join('foo.tif')))
assert env.drivers() == drivers_start
def test_bogus_band_error():
with rasterio.open('tests/data/RGB.byte.tif') as src:
assert src._has_band(4) is False
|
<commit_before># Testing use of cpl_errs
import pytest
import rasterio
from rasterio.errors import RasterioIOError
def test_io_error(tmpdir):
with pytest.raises(RasterioIOError) as exc_info:
rasterio.open(str(tmpdir.join('foo.tif')))
msg, = exc_info.value.args
assert msg.startswith("'{0}'".format(tmpdir.join('foo.tif')))
assert ("does not exist in the file system, and is not recognised as a "
"supported dataset name.") in msg
def test_io_error_env(tmpdir):
with rasterio.drivers() as env:
drivers_start = env.drivers()
with pytest.raises(RasterioIOError):
rasterio.open(str(tmpdir.join('foo.tif')))
assert env.drivers() == drivers_start
def test_bogus_band_error():
with rasterio.open('tests/data/RGB.byte.tif') as src:
assert src._has_band(4) is False
<commit_msg>Check msg in a way that passes for all GDAL versions<commit_after># Testing use of cpl_errs
import pytest
import rasterio
from rasterio.errors import RasterioIOError
def test_io_error(tmpdir):
"""RasterioIOError is raised when a disk file can't be opened.
Newlines are removed from GDAL error messages."""
with pytest.raises(RasterioIOError) as exc_info:
rasterio.open(str(tmpdir.join('foo.tif')))
msg, = exc_info.value.args
assert "\n" not in msg
def test_io_error_env(tmpdir):
with rasterio.drivers() as env:
drivers_start = env.drivers()
with pytest.raises(RasterioIOError):
rasterio.open(str(tmpdir.join('foo.tif')))
assert env.drivers() == drivers_start
def test_bogus_band_error():
with rasterio.open('tests/data/RGB.byte.tif') as src:
assert src._has_band(4) is False
|
1bd57b89cb0deed5081540e5b29f7531215fa121
|
polyaxon_client/transport/socket_transport.py
|
polyaxon_client/transport/socket_transport.py
|
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import json
import websocket
from polyaxon_client.logger import logger
class SocketTransportMixin(object):
"""Socket operations transport."""
def socket(self, url, message_handler, headers=None):
webs = websocket.WebSocketApp(
url,
on_message=lambda ws, message: self._on_message(message_handler, message),
on_error=self._on_error,
on_close=self._on_close,
header=self._get_headers(headers)
)
return webs
def stream(self, url, message_handler, headers=None):
webs = self.socket(url=url, message_handler=message_handler, headers=headers)
webs.run_forever(ping_interval=30, ping_timeout=10)
def _on_message(self, message_handler, message):
if message_handler and message:
message_handler(json.loads(message.decode('utf-8')))
@staticmethod
def _on_error(ws, error):
if isinstance(error, (KeyboardInterrupt, SystemExit)):
logger.info('Quitting... The session will be running in the background.')
else:
logger.debug('Termination cause: %s', error)
logger.debug('Session disconnected.')
@staticmethod
def _on_close(ws):
logger.info('Session ended')
|
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import json
import six
import websocket
from polyaxon_client.logger import logger
class SocketTransportMixin(object):
"""Socket operations transport."""
def socket(self, url, message_handler, headers=None):
webs = websocket.WebSocketApp(
url,
on_message=lambda ws, message: self._on_message(message_handler, message),
on_error=self._on_error,
on_close=self._on_close,
header=self._get_headers(headers)
)
return webs
def stream(self, url, message_handler, headers=None):
webs = self.socket(url=url, message_handler=message_handler, headers=headers)
webs.run_forever(ping_interval=30, ping_timeout=10)
def _on_message(self, message_handler, message):
if message_handler and message:
if not isinstance(message, six.string_types):
message = message.decode('utf-8')
message_handler(json.loads(message))
@staticmethod
def _on_error(ws, error):
if isinstance(error, (KeyboardInterrupt, SystemExit)):
logger.info('Quitting... The session will be running in the background.')
else:
logger.debug('Termination cause: %s', error)
logger.debug('Session disconnected.')
@staticmethod
def _on_close(ws):
logger.info('Session ended')
|
Check if string before decoding
|
Check if string before decoding
|
Python
|
apache-2.0
|
polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon
|
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import json
import websocket
from polyaxon_client.logger import logger
class SocketTransportMixin(object):
"""Socket operations transport."""
def socket(self, url, message_handler, headers=None):
webs = websocket.WebSocketApp(
url,
on_message=lambda ws, message: self._on_message(message_handler, message),
on_error=self._on_error,
on_close=self._on_close,
header=self._get_headers(headers)
)
return webs
def stream(self, url, message_handler, headers=None):
webs = self.socket(url=url, message_handler=message_handler, headers=headers)
webs.run_forever(ping_interval=30, ping_timeout=10)
def _on_message(self, message_handler, message):
if message_handler and message:
message_handler(json.loads(message.decode('utf-8')))
@staticmethod
def _on_error(ws, error):
if isinstance(error, (KeyboardInterrupt, SystemExit)):
logger.info('Quitting... The session will be running in the background.')
else:
logger.debug('Termination cause: %s', error)
logger.debug('Session disconnected.')
@staticmethod
def _on_close(ws):
logger.info('Session ended')
Check if string before decoding
|
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import json
import six
import websocket
from polyaxon_client.logger import logger
class SocketTransportMixin(object):
"""Socket operations transport."""
def socket(self, url, message_handler, headers=None):
webs = websocket.WebSocketApp(
url,
on_message=lambda ws, message: self._on_message(message_handler, message),
on_error=self._on_error,
on_close=self._on_close,
header=self._get_headers(headers)
)
return webs
def stream(self, url, message_handler, headers=None):
webs = self.socket(url=url, message_handler=message_handler, headers=headers)
webs.run_forever(ping_interval=30, ping_timeout=10)
def _on_message(self, message_handler, message):
if message_handler and message:
if not isinstance(message, six.string_types):
message = message.decode('utf-8')
message_handler(json.loads(message))
@staticmethod
def _on_error(ws, error):
if isinstance(error, (KeyboardInterrupt, SystemExit)):
logger.info('Quitting... The session will be running in the background.')
else:
logger.debug('Termination cause: %s', error)
logger.debug('Session disconnected.')
@staticmethod
def _on_close(ws):
logger.info('Session ended')
|
<commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import json
import websocket
from polyaxon_client.logger import logger
class SocketTransportMixin(object):
"""Socket operations transport."""
def socket(self, url, message_handler, headers=None):
webs = websocket.WebSocketApp(
url,
on_message=lambda ws, message: self._on_message(message_handler, message),
on_error=self._on_error,
on_close=self._on_close,
header=self._get_headers(headers)
)
return webs
def stream(self, url, message_handler, headers=None):
webs = self.socket(url=url, message_handler=message_handler, headers=headers)
webs.run_forever(ping_interval=30, ping_timeout=10)
def _on_message(self, message_handler, message):
if message_handler and message:
message_handler(json.loads(message.decode('utf-8')))
@staticmethod
def _on_error(ws, error):
if isinstance(error, (KeyboardInterrupt, SystemExit)):
logger.info('Quitting... The session will be running in the background.')
else:
logger.debug('Termination cause: %s', error)
logger.debug('Session disconnected.')
@staticmethod
def _on_close(ws):
logger.info('Session ended')
<commit_msg>Check if string before decoding<commit_after>
|
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import json
import six
import websocket
from polyaxon_client.logger import logger
class SocketTransportMixin(object):
"""Socket operations transport."""
def socket(self, url, message_handler, headers=None):
webs = websocket.WebSocketApp(
url,
on_message=lambda ws, message: self._on_message(message_handler, message),
on_error=self._on_error,
on_close=self._on_close,
header=self._get_headers(headers)
)
return webs
def stream(self, url, message_handler, headers=None):
webs = self.socket(url=url, message_handler=message_handler, headers=headers)
webs.run_forever(ping_interval=30, ping_timeout=10)
def _on_message(self, message_handler, message):
if message_handler and message:
if not isinstance(message, six.string_types):
message = message.decode('utf-8')
message_handler(json.loads(message))
@staticmethod
def _on_error(ws, error):
if isinstance(error, (KeyboardInterrupt, SystemExit)):
logger.info('Quitting... The session will be running in the background.')
else:
logger.debug('Termination cause: %s', error)
logger.debug('Session disconnected.')
@staticmethod
def _on_close(ws):
logger.info('Session ended')
|
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import json
import websocket
from polyaxon_client.logger import logger
class SocketTransportMixin(object):
"""Socket operations transport."""
def socket(self, url, message_handler, headers=None):
webs = websocket.WebSocketApp(
url,
on_message=lambda ws, message: self._on_message(message_handler, message),
on_error=self._on_error,
on_close=self._on_close,
header=self._get_headers(headers)
)
return webs
def stream(self, url, message_handler, headers=None):
webs = self.socket(url=url, message_handler=message_handler, headers=headers)
webs.run_forever(ping_interval=30, ping_timeout=10)
def _on_message(self, message_handler, message):
if message_handler and message:
message_handler(json.loads(message.decode('utf-8')))
@staticmethod
def _on_error(ws, error):
if isinstance(error, (KeyboardInterrupt, SystemExit)):
logger.info('Quitting... The session will be running in the background.')
else:
logger.debug('Termination cause: %s', error)
logger.debug('Session disconnected.')
@staticmethod
def _on_close(ws):
logger.info('Session ended')
Check if string before decoding# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import json
import six
import websocket
from polyaxon_client.logger import logger
class SocketTransportMixin(object):
"""Socket operations transport."""
def socket(self, url, message_handler, headers=None):
webs = websocket.WebSocketApp(
url,
on_message=lambda ws, message: self._on_message(message_handler, message),
on_error=self._on_error,
on_close=self._on_close,
header=self._get_headers(headers)
)
return webs
def stream(self, url, message_handler, headers=None):
webs = self.socket(url=url, message_handler=message_handler, headers=headers)
webs.run_forever(ping_interval=30, ping_timeout=10)
def _on_message(self, message_handler, message):
if message_handler and message:
if not isinstance(message, six.string_types):
message = message.decode('utf-8')
message_handler(json.loads(message))
@staticmethod
def _on_error(ws, error):
if isinstance(error, (KeyboardInterrupt, SystemExit)):
logger.info('Quitting... The session will be running in the background.')
else:
logger.debug('Termination cause: %s', error)
logger.debug('Session disconnected.')
@staticmethod
def _on_close(ws):
logger.info('Session ended')
|
<commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import json
import websocket
from polyaxon_client.logger import logger
class SocketTransportMixin(object):
"""Socket operations transport."""
def socket(self, url, message_handler, headers=None):
webs = websocket.WebSocketApp(
url,
on_message=lambda ws, message: self._on_message(message_handler, message),
on_error=self._on_error,
on_close=self._on_close,
header=self._get_headers(headers)
)
return webs
def stream(self, url, message_handler, headers=None):
webs = self.socket(url=url, message_handler=message_handler, headers=headers)
webs.run_forever(ping_interval=30, ping_timeout=10)
def _on_message(self, message_handler, message):
if message_handler and message:
message_handler(json.loads(message.decode('utf-8')))
@staticmethod
def _on_error(ws, error):
if isinstance(error, (KeyboardInterrupt, SystemExit)):
logger.info('Quitting... The session will be running in the background.')
else:
logger.debug('Termination cause: %s', error)
logger.debug('Session disconnected.')
@staticmethod
def _on_close(ws):
logger.info('Session ended')
<commit_msg>Check if string before decoding<commit_after># -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import json
import six
import websocket
from polyaxon_client.logger import logger
class SocketTransportMixin(object):
"""Socket operations transport."""
def socket(self, url, message_handler, headers=None):
webs = websocket.WebSocketApp(
url,
on_message=lambda ws, message: self._on_message(message_handler, message),
on_error=self._on_error,
on_close=self._on_close,
header=self._get_headers(headers)
)
return webs
def stream(self, url, message_handler, headers=None):
webs = self.socket(url=url, message_handler=message_handler, headers=headers)
webs.run_forever(ping_interval=30, ping_timeout=10)
def _on_message(self, message_handler, message):
if message_handler and message:
if not isinstance(message, six.string_types):
message = message.decode('utf-8')
message_handler(json.loads(message))
@staticmethod
def _on_error(ws, error):
if isinstance(error, (KeyboardInterrupt, SystemExit)):
logger.info('Quitting... The session will be running in the background.')
else:
logger.debug('Termination cause: %s', error)
logger.debug('Session disconnected.')
@staticmethod
def _on_close(ws):
logger.info('Session ended')
|
2717a35a78f5982f96d57e258dfedd308cb6ffa8
|
hoomd/typeparam.py
|
hoomd/typeparam.py
|
from hoomd.parameterdicts import AttachedTypeParameterDict
class TypeParameter:
def __init__(self, name, type_kind, param_dict):
self.name = name
self.type_kind = type_kind
self.param_dict = param_dict
def __getitem__(self, key):
return self.param_dict[key]
def __setitem__(self, key, value):
self.param_dict[key] = value
@property
def default(self):
return self.param_dict.default
@default.setter
def default(self, value):
self.param_dict.default = value
def attach(self, cpp_obj, sim):
self.param_dict = AttachedTypeParameterDict(cpp_obj,
self.name,
self.type_kind,
self.param_dict,
sim)
return self
def detach(self):
self.param_dict = self.param_dict.to_dettached()
return self
def to_dict(self):
return self.param_dict.to_dict()
|
from hoomd.parameterdicts import AttachedTypeParameterDict
class TypeParameter:
def __init__(self, name, type_kind, param_dict):
self.name = name
self.type_kind = type_kind
self.param_dict = param_dict
def __getitem__(self, key):
return self.param_dict[key]
def __setitem__(self, key, value):
self.param_dict[key] = value
@property
def default(self):
return self.param_dict.default
@default.setter
def default(self, value):
self.param_dict.default = value
def attach(self, cpp_obj, sim):
self.param_dict = AttachedTypeParameterDict(cpp_obj,
self.name,
self.type_kind,
self.param_dict,
sim)
return self
def detach(self):
self.param_dict = self.param_dict.to_dettached()
return self
def to_dict(self):
return self.param_dict.to_dict()
def keys(self):
yield from self.param_dict.keys()
|
Add keys iterator for ``TypeParameter``
|
Add keys iterator for ``TypeParameter``
|
Python
|
bsd-3-clause
|
joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue
|
from hoomd.parameterdicts import AttachedTypeParameterDict
class TypeParameter:
def __init__(self, name, type_kind, param_dict):
self.name = name
self.type_kind = type_kind
self.param_dict = param_dict
def __getitem__(self, key):
return self.param_dict[key]
def __setitem__(self, key, value):
self.param_dict[key] = value
@property
def default(self):
return self.param_dict.default
@default.setter
def default(self, value):
self.param_dict.default = value
def attach(self, cpp_obj, sim):
self.param_dict = AttachedTypeParameterDict(cpp_obj,
self.name,
self.type_kind,
self.param_dict,
sim)
return self
def detach(self):
self.param_dict = self.param_dict.to_dettached()
return self
def to_dict(self):
return self.param_dict.to_dict()
Add keys iterator for ``TypeParameter``
|
from hoomd.parameterdicts import AttachedTypeParameterDict
class TypeParameter:
def __init__(self, name, type_kind, param_dict):
self.name = name
self.type_kind = type_kind
self.param_dict = param_dict
def __getitem__(self, key):
return self.param_dict[key]
def __setitem__(self, key, value):
self.param_dict[key] = value
@property
def default(self):
return self.param_dict.default
@default.setter
def default(self, value):
self.param_dict.default = value
def attach(self, cpp_obj, sim):
self.param_dict = AttachedTypeParameterDict(cpp_obj,
self.name,
self.type_kind,
self.param_dict,
sim)
return self
def detach(self):
self.param_dict = self.param_dict.to_dettached()
return self
def to_dict(self):
return self.param_dict.to_dict()
def keys(self):
yield from self.param_dict.keys()
|
<commit_before>from hoomd.parameterdicts import AttachedTypeParameterDict
class TypeParameter:
def __init__(self, name, type_kind, param_dict):
self.name = name
self.type_kind = type_kind
self.param_dict = param_dict
def __getitem__(self, key):
return self.param_dict[key]
def __setitem__(self, key, value):
self.param_dict[key] = value
@property
def default(self):
return self.param_dict.default
@default.setter
def default(self, value):
self.param_dict.default = value
def attach(self, cpp_obj, sim):
self.param_dict = AttachedTypeParameterDict(cpp_obj,
self.name,
self.type_kind,
self.param_dict,
sim)
return self
def detach(self):
self.param_dict = self.param_dict.to_dettached()
return self
def to_dict(self):
return self.param_dict.to_dict()
<commit_msg>Add keys iterator for ``TypeParameter``<commit_after>
|
from hoomd.parameterdicts import AttachedTypeParameterDict
class TypeParameter:
def __init__(self, name, type_kind, param_dict):
self.name = name
self.type_kind = type_kind
self.param_dict = param_dict
def __getitem__(self, key):
return self.param_dict[key]
def __setitem__(self, key, value):
self.param_dict[key] = value
@property
def default(self):
return self.param_dict.default
@default.setter
def default(self, value):
self.param_dict.default = value
def attach(self, cpp_obj, sim):
self.param_dict = AttachedTypeParameterDict(cpp_obj,
self.name,
self.type_kind,
self.param_dict,
sim)
return self
def detach(self):
self.param_dict = self.param_dict.to_dettached()
return self
def to_dict(self):
return self.param_dict.to_dict()
def keys(self):
yield from self.param_dict.keys()
|
from hoomd.parameterdicts import AttachedTypeParameterDict
class TypeParameter:
def __init__(self, name, type_kind, param_dict):
self.name = name
self.type_kind = type_kind
self.param_dict = param_dict
def __getitem__(self, key):
return self.param_dict[key]
def __setitem__(self, key, value):
self.param_dict[key] = value
@property
def default(self):
return self.param_dict.default
@default.setter
def default(self, value):
self.param_dict.default = value
def attach(self, cpp_obj, sim):
self.param_dict = AttachedTypeParameterDict(cpp_obj,
self.name,
self.type_kind,
self.param_dict,
sim)
return self
def detach(self):
self.param_dict = self.param_dict.to_dettached()
return self
def to_dict(self):
return self.param_dict.to_dict()
Add keys iterator for ``TypeParameter``from hoomd.parameterdicts import AttachedTypeParameterDict
class TypeParameter:
def __init__(self, name, type_kind, param_dict):
self.name = name
self.type_kind = type_kind
self.param_dict = param_dict
def __getitem__(self, key):
return self.param_dict[key]
def __setitem__(self, key, value):
self.param_dict[key] = value
@property
def default(self):
return self.param_dict.default
@default.setter
def default(self, value):
self.param_dict.default = value
def attach(self, cpp_obj, sim):
self.param_dict = AttachedTypeParameterDict(cpp_obj,
self.name,
self.type_kind,
self.param_dict,
sim)
return self
def detach(self):
self.param_dict = self.param_dict.to_dettached()
return self
def to_dict(self):
return self.param_dict.to_dict()
def keys(self):
yield from self.param_dict.keys()
|
<commit_before>from hoomd.parameterdicts import AttachedTypeParameterDict
class TypeParameter:
def __init__(self, name, type_kind, param_dict):
self.name = name
self.type_kind = type_kind
self.param_dict = param_dict
def __getitem__(self, key):
return self.param_dict[key]
def __setitem__(self, key, value):
self.param_dict[key] = value
@property
def default(self):
return self.param_dict.default
@default.setter
def default(self, value):
self.param_dict.default = value
def attach(self, cpp_obj, sim):
self.param_dict = AttachedTypeParameterDict(cpp_obj,
self.name,
self.type_kind,
self.param_dict,
sim)
return self
def detach(self):
self.param_dict = self.param_dict.to_dettached()
return self
def to_dict(self):
return self.param_dict.to_dict()
<commit_msg>Add keys iterator for ``TypeParameter``<commit_after>from hoomd.parameterdicts import AttachedTypeParameterDict
class TypeParameter:
def __init__(self, name, type_kind, param_dict):
self.name = name
self.type_kind = type_kind
self.param_dict = param_dict
def __getitem__(self, key):
return self.param_dict[key]
def __setitem__(self, key, value):
self.param_dict[key] = value
@property
def default(self):
return self.param_dict.default
@default.setter
def default(self, value):
self.param_dict.default = value
def attach(self, cpp_obj, sim):
self.param_dict = AttachedTypeParameterDict(cpp_obj,
self.name,
self.type_kind,
self.param_dict,
sim)
return self
def detach(self):
self.param_dict = self.param_dict.to_dettached()
return self
def to_dict(self):
return self.param_dict.to_dict()
def keys(self):
yield from self.param_dict.keys()
|
fcb80afe4703c7a031778ef573a3b839484d8c24
|
mpld3/test_plots/test_ticklabels.py
|
mpld3/test_plots/test_ticklabels.py
|
"""Plot to test date axis"""
import matplotlib.pyplot as plt
import matplotlib
import mpld3
def create_plot():
fig, ax = plt.subplots()
ax.plot([2000, 2050], [1, 2])
ax.set_title('Tick label test', size=14)
return fig
def test_date():
fig = create_plot()
_ = mpld3.fig_to_html(fig)
plt.close(fig)
if __name__ == "__main__":
mpld3.show(create_plot())
|
"""
Plot to test date axis
TODO (@vladh): This test is misleading and needs to be updated. It should test
dates, but it only plots numbers in [2000, 2050], which will of course get
thousands separators automatically added.
"""
import matplotlib.pyplot as plt
import matplotlib
import mpld3
def create_plot():
fig, ax = plt.subplots()
ax.plot([2000, 2050], [1, 2])
ax.set_title('Tick label test', size=14)
return fig
def test_date():
fig = create_plot()
_ = mpld3.fig_to_html(fig)
plt.close(fig)
if __name__ == "__main__":
mpld3.show(create_plot())
|
Add note for misleading test
|
Add note for misleading test
|
Python
|
bsd-3-clause
|
jakevdp/mpld3,mpld3/mpld3,mpld3/mpld3,jakevdp/mpld3
|
"""Plot to test date axis"""
import matplotlib.pyplot as plt
import matplotlib
import mpld3
def create_plot():
fig, ax = plt.subplots()
ax.plot([2000, 2050], [1, 2])
ax.set_title('Tick label test', size=14)
return fig
def test_date():
fig = create_plot()
_ = mpld3.fig_to_html(fig)
plt.close(fig)
if __name__ == "__main__":
mpld3.show(create_plot())
Add note for misleading test
|
"""
Plot to test date axis
TODO (@vladh): This test is misleading and needs to be updated. It should test
dates, but it only plots numbers in [2000, 2050], which will of course get
thousands separators automatically added.
"""
import matplotlib.pyplot as plt
import matplotlib
import mpld3
def create_plot():
fig, ax = plt.subplots()
ax.plot([2000, 2050], [1, 2])
ax.set_title('Tick label test', size=14)
return fig
def test_date():
fig = create_plot()
_ = mpld3.fig_to_html(fig)
plt.close(fig)
if __name__ == "__main__":
mpld3.show(create_plot())
|
<commit_before>"""Plot to test date axis"""
import matplotlib.pyplot as plt
import matplotlib
import mpld3
def create_plot():
fig, ax = plt.subplots()
ax.plot([2000, 2050], [1, 2])
ax.set_title('Tick label test', size=14)
return fig
def test_date():
fig = create_plot()
_ = mpld3.fig_to_html(fig)
plt.close(fig)
if __name__ == "__main__":
mpld3.show(create_plot())
<commit_msg>Add note for misleading test<commit_after>
|
"""
Plot to test date axis
TODO (@vladh): This test is misleading and needs to be updated. It should test
dates, but it only plots numbers in [2000, 2050], which will of course get
thousands separators automatically added.
"""
import matplotlib.pyplot as plt
import matplotlib
import mpld3
def create_plot():
fig, ax = plt.subplots()
ax.plot([2000, 2050], [1, 2])
ax.set_title('Tick label test', size=14)
return fig
def test_date():
fig = create_plot()
_ = mpld3.fig_to_html(fig)
plt.close(fig)
if __name__ == "__main__":
mpld3.show(create_plot())
|
"""Plot to test date axis"""
import matplotlib.pyplot as plt
import matplotlib
import mpld3
def create_plot():
fig, ax = plt.subplots()
ax.plot([2000, 2050], [1, 2])
ax.set_title('Tick label test', size=14)
return fig
def test_date():
fig = create_plot()
_ = mpld3.fig_to_html(fig)
plt.close(fig)
if __name__ == "__main__":
mpld3.show(create_plot())
Add note for misleading test"""
Plot to test date axis
TODO (@vladh): This test is misleading and needs to be updated. It should test
dates, but it only plots numbers in [2000, 2050], which will of course get
thousands separators automatically added.
"""
import matplotlib.pyplot as plt
import matplotlib
import mpld3
def create_plot():
fig, ax = plt.subplots()
ax.plot([2000, 2050], [1, 2])
ax.set_title('Tick label test', size=14)
return fig
def test_date():
fig = create_plot()
_ = mpld3.fig_to_html(fig)
plt.close(fig)
if __name__ == "__main__":
mpld3.show(create_plot())
|
<commit_before>"""Plot to test date axis"""
import matplotlib.pyplot as plt
import matplotlib
import mpld3
def create_plot():
fig, ax = plt.subplots()
ax.plot([2000, 2050], [1, 2])
ax.set_title('Tick label test', size=14)
return fig
def test_date():
fig = create_plot()
_ = mpld3.fig_to_html(fig)
plt.close(fig)
if __name__ == "__main__":
mpld3.show(create_plot())
<commit_msg>Add note for misleading test<commit_after>"""
Plot to test date axis
TODO (@vladh): This test is misleading and needs to be updated. It should test
dates, but it only plots numbers in [2000, 2050], which will of course get
thousands separators automatically added.
"""
import matplotlib.pyplot as plt
import matplotlib
import mpld3
def create_plot():
fig, ax = plt.subplots()
ax.plot([2000, 2050], [1, 2])
ax.set_title('Tick label test', size=14)
return fig
def test_date():
fig = create_plot()
_ = mpld3.fig_to_html(fig)
plt.close(fig)
if __name__ == "__main__":
mpld3.show(create_plot())
|
398937e4ca759de8e1f88db7245280c72eddb88d
|
devicehive/transports/base_transport.py
|
devicehive/transports/base_transport.py
|
class BaseTransport(object):
"""Base transport class."""
def __init__(self, name, data_format_class, data_format_options,
handler_class, handler_options):
self._name = name
self._data_format = data_format_class(**data_format_options)
self._data_type = self._data_format.data_type
self._handler = handler_class(self, **handler_options)
self._connected = False
def _assert_not_connected(self):
assert not self._connected, 'transport connection already created'
def _assert_connected(self):
assert self._connected, 'transport connection has not created'
def _encode_obj(self, obj):
return self._data_format.encode(obj)
def _decode_data(self, data):
return self._data_format.decode(data)
def _call_handler_method(self, name, *args):
getattr(self._handler, name)(*args)
def is_connected(self):
return self._connected
def connect(self, url, **options):
raise NotImplementedError
def request(self, action, request_object, **params):
raise NotImplementedError
def close(self):
raise NotImplementedError
def join(self, timeout=None):
raise NotImplementedError
|
class BaseTransport(object):
"""Base transport class."""
def __init__(self, name, data_format_class, data_format_options,
handler_class, handler_options):
self.name = name
self._data_format = data_format_class(**data_format_options)
self._data_type = self._data_format.data_type
self._handler = handler_class(self, **handler_options)
self._connected = False
def _assert_not_connected(self):
assert not self._connected, 'transport connection already created'
def _assert_connected(self):
assert self._connected, 'transport connection has not created'
def _encode_obj(self, obj):
return self._data_format.encode(obj)
def _decode_data(self, data):
return self._data_format.decode(data)
def _call_handler_method(self, name, *args):
getattr(self._handler, name)(*args)
def is_connected(self):
return self._connected
def connect(self, url, **options):
raise NotImplementedError
def request(self, action, request_object, **params):
raise NotImplementedError
def close(self):
raise NotImplementedError
def join(self, timeout=None):
raise NotImplementedError
|
Set transport name as public
|
Set transport name as public
|
Python
|
apache-2.0
|
devicehive/devicehive-python
|
class BaseTransport(object):
"""Base transport class."""
def __init__(self, name, data_format_class, data_format_options,
handler_class, handler_options):
self._name = name
self._data_format = data_format_class(**data_format_options)
self._data_type = self._data_format.data_type
self._handler = handler_class(self, **handler_options)
self._connected = False
def _assert_not_connected(self):
assert not self._connected, 'transport connection already created'
def _assert_connected(self):
assert self._connected, 'transport connection has not created'
def _encode_obj(self, obj):
return self._data_format.encode(obj)
def _decode_data(self, data):
return self._data_format.decode(data)
def _call_handler_method(self, name, *args):
getattr(self._handler, name)(*args)
def is_connected(self):
return self._connected
def connect(self, url, **options):
raise NotImplementedError
def request(self, action, request_object, **params):
raise NotImplementedError
def close(self):
raise NotImplementedError
def join(self, timeout=None):
raise NotImplementedError
Set transport name as public
|
class BaseTransport(object):
"""Base transport class."""
def __init__(self, name, data_format_class, data_format_options,
handler_class, handler_options):
self.name = name
self._data_format = data_format_class(**data_format_options)
self._data_type = self._data_format.data_type
self._handler = handler_class(self, **handler_options)
self._connected = False
def _assert_not_connected(self):
assert not self._connected, 'transport connection already created'
def _assert_connected(self):
assert self._connected, 'transport connection has not created'
def _encode_obj(self, obj):
return self._data_format.encode(obj)
def _decode_data(self, data):
return self._data_format.decode(data)
def _call_handler_method(self, name, *args):
getattr(self._handler, name)(*args)
def is_connected(self):
return self._connected
def connect(self, url, **options):
raise NotImplementedError
def request(self, action, request_object, **params):
raise NotImplementedError
def close(self):
raise NotImplementedError
def join(self, timeout=None):
raise NotImplementedError
|
<commit_before>class BaseTransport(object):
"""Base transport class."""
def __init__(self, name, data_format_class, data_format_options,
handler_class, handler_options):
self._name = name
self._data_format = data_format_class(**data_format_options)
self._data_type = self._data_format.data_type
self._handler = handler_class(self, **handler_options)
self._connected = False
def _assert_not_connected(self):
assert not self._connected, 'transport connection already created'
def _assert_connected(self):
assert self._connected, 'transport connection has not created'
def _encode_obj(self, obj):
return self._data_format.encode(obj)
def _decode_data(self, data):
return self._data_format.decode(data)
def _call_handler_method(self, name, *args):
getattr(self._handler, name)(*args)
def is_connected(self):
return self._connected
def connect(self, url, **options):
raise NotImplementedError
def request(self, action, request_object, **params):
raise NotImplementedError
def close(self):
raise NotImplementedError
def join(self, timeout=None):
raise NotImplementedError
<commit_msg>Set transport name as public<commit_after>
|
class BaseTransport(object):
"""Base transport class."""
def __init__(self, name, data_format_class, data_format_options,
handler_class, handler_options):
self.name = name
self._data_format = data_format_class(**data_format_options)
self._data_type = self._data_format.data_type
self._handler = handler_class(self, **handler_options)
self._connected = False
def _assert_not_connected(self):
assert not self._connected, 'transport connection already created'
def _assert_connected(self):
assert self._connected, 'transport connection has not created'
def _encode_obj(self, obj):
return self._data_format.encode(obj)
def _decode_data(self, data):
return self._data_format.decode(data)
def _call_handler_method(self, name, *args):
getattr(self._handler, name)(*args)
def is_connected(self):
return self._connected
def connect(self, url, **options):
raise NotImplementedError
def request(self, action, request_object, **params):
raise NotImplementedError
def close(self):
raise NotImplementedError
def join(self, timeout=None):
raise NotImplementedError
|
class BaseTransport(object):
"""Base transport class."""
def __init__(self, name, data_format_class, data_format_options,
handler_class, handler_options):
self._name = name
self._data_format = data_format_class(**data_format_options)
self._data_type = self._data_format.data_type
self._handler = handler_class(self, **handler_options)
self._connected = False
def _assert_not_connected(self):
assert not self._connected, 'transport connection already created'
def _assert_connected(self):
assert self._connected, 'transport connection has not created'
def _encode_obj(self, obj):
return self._data_format.encode(obj)
def _decode_data(self, data):
return self._data_format.decode(data)
def _call_handler_method(self, name, *args):
getattr(self._handler, name)(*args)
def is_connected(self):
return self._connected
def connect(self, url, **options):
raise NotImplementedError
def request(self, action, request_object, **params):
raise NotImplementedError
def close(self):
raise NotImplementedError
def join(self, timeout=None):
raise NotImplementedError
Set transport name as publicclass BaseTransport(object):
"""Base transport class."""
def __init__(self, name, data_format_class, data_format_options,
handler_class, handler_options):
self.name = name
self._data_format = data_format_class(**data_format_options)
self._data_type = self._data_format.data_type
self._handler = handler_class(self, **handler_options)
self._connected = False
def _assert_not_connected(self):
assert not self._connected, 'transport connection already created'
def _assert_connected(self):
assert self._connected, 'transport connection has not created'
def _encode_obj(self, obj):
return self._data_format.encode(obj)
def _decode_data(self, data):
return self._data_format.decode(data)
def _call_handler_method(self, name, *args):
getattr(self._handler, name)(*args)
def is_connected(self):
return self._connected
def connect(self, url, **options):
raise NotImplementedError
def request(self, action, request_object, **params):
raise NotImplementedError
def close(self):
raise NotImplementedError
def join(self, timeout=None):
raise NotImplementedError
|
<commit_before>class BaseTransport(object):
"""Base transport class."""
def __init__(self, name, data_format_class, data_format_options,
handler_class, handler_options):
self._name = name
self._data_format = data_format_class(**data_format_options)
self._data_type = self._data_format.data_type
self._handler = handler_class(self, **handler_options)
self._connected = False
def _assert_not_connected(self):
assert not self._connected, 'transport connection already created'
def _assert_connected(self):
assert self._connected, 'transport connection has not created'
def _encode_obj(self, obj):
return self._data_format.encode(obj)
def _decode_data(self, data):
return self._data_format.decode(data)
def _call_handler_method(self, name, *args):
getattr(self._handler, name)(*args)
def is_connected(self):
return self._connected
def connect(self, url, **options):
raise NotImplementedError
def request(self, action, request_object, **params):
raise NotImplementedError
def close(self):
raise NotImplementedError
def join(self, timeout=None):
raise NotImplementedError
<commit_msg>Set transport name as public<commit_after>class BaseTransport(object):
"""Base transport class."""
def __init__(self, name, data_format_class, data_format_options,
handler_class, handler_options):
self.name = name
self._data_format = data_format_class(**data_format_options)
self._data_type = self._data_format.data_type
self._handler = handler_class(self, **handler_options)
self._connected = False
def _assert_not_connected(self):
assert not self._connected, 'transport connection already created'
def _assert_connected(self):
assert self._connected, 'transport connection has not created'
def _encode_obj(self, obj):
return self._data_format.encode(obj)
def _decode_data(self, data):
return self._data_format.decode(data)
def _call_handler_method(self, name, *args):
getattr(self._handler, name)(*args)
def is_connected(self):
return self._connected
def connect(self, url, **options):
raise NotImplementedError
def request(self, action, request_object, **params):
raise NotImplementedError
def close(self):
raise NotImplementedError
def join(self, timeout=None):
raise NotImplementedError
|
d2250ac74b0797d1662c054d2357573578caa251
|
core/tasks.py
|
core/tasks.py
|
import os
import gzip
import urllib.request
from celery import shared_task
from django.core.mail import EmailMessage
from celery.task import periodic_task
from celery.schedules import crontab
@shared_task(name='deliver_email')
def deliver_email(subject=None, body=None, recipients=None):
#print("Entering core.tasks.deliver_email for ...", recipients)
if recipients:
for recipient in recipients:
#print("sending email to recipient: ", recipient)
email = EmailMessage(subject, body, to=[recipient])
email.send()
@periodic_task(bind=True, run_every=crontab(0, 0, day_of_month='7'))
def update_geolocation(self):
# Establish desired paths and directories
current_directory = os.path.dirname(__file__)
compressed_filepath = os.path.join(current_directory, 'GeoLite2-City.mmdb.gz')
uncompressed_filepath = os.path.join(current_directory, 'GeoLite2-City.mmdb')
# Pull down current database file
url = "http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz"
urllib.request.urlretrieve(url, compressed_filepath)
# Read and unzip compressed file to current directory
zipped = gzip.open(compressed_filepath, "rb")
uncompressed = open(uncompressed_filepath, "wb")
uncompressed.write(zipped.read())
zipped.close()
uncompressed.close()
# Remove zipped file
os.remove(compressed_filepath)
|
import os
import gzip
import urllib.request
from celery import shared_task
from django.core.mail import EmailMessage
from celery.task import periodic_task
from celery.schedules import crontab
@shared_task(name='deliver_email')
def deliver_email(subject=None, body=None, recipients=None):
if recipients:
for recipient in recipients:
email = EmailMessage(subject, body, to=[recipient])
email.send()
@periodic_task(bind=True, run_every=crontab(0, 0, day_of_month='7'))
def update_geolocation(self):
# Establish desired paths and directories
current_directory = os.path.dirname(__file__)
compressed_filepath = os.path.join(current_directory, 'GeoLite2-City.mmdb.gz')
uncompressed_filepath = os.path.join(current_directory, 'GeoLite2-City.mmdb')
# Pull down current database file
url = "http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz"
urllib.request.urlretrieve(url, compressed_filepath)
# Read and unzip compressed file to current directory
zipped = gzip.open(compressed_filepath, "rb")
uncompressed = open(uncompressed_filepath, "wb")
uncompressed.write(zipped.read())
zipped.close()
uncompressed.close()
# Remove zipped file
os.remove(compressed_filepath)
|
Clean up code and remove print statements
|
Clean up code and remove print statements
|
Python
|
mit
|
LindaTNguyen/RAPID,gdit-cnd/RAPID,LindaTNguyen/RAPID,gdit-cnd/RAPID,LindaTNguyen/RAPID,gdit-cnd/RAPID,gdit-cnd/RAPID,gdit-cnd/RAPID,LindaTNguyen/RAPID,LindaTNguyen/RAPID
|
import os
import gzip
import urllib.request
from celery import shared_task
from django.core.mail import EmailMessage
from celery.task import periodic_task
from celery.schedules import crontab
@shared_task(name='deliver_email')
def deliver_email(subject=None, body=None, recipients=None):
#print("Entering core.tasks.deliver_email for ...", recipients)
if recipients:
for recipient in recipients:
#print("sending email to recipient: ", recipient)
email = EmailMessage(subject, body, to=[recipient])
email.send()
@periodic_task(bind=True, run_every=crontab(0, 0, day_of_month='7'))
def update_geolocation(self):
# Establish desired paths and directories
current_directory = os.path.dirname(__file__)
compressed_filepath = os.path.join(current_directory, 'GeoLite2-City.mmdb.gz')
uncompressed_filepath = os.path.join(current_directory, 'GeoLite2-City.mmdb')
# Pull down current database file
url = "http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz"
urllib.request.urlretrieve(url, compressed_filepath)
# Read and unzip compressed file to current directory
zipped = gzip.open(compressed_filepath, "rb")
uncompressed = open(uncompressed_filepath, "wb")
uncompressed.write(zipped.read())
zipped.close()
uncompressed.close()
# Remove zipped file
os.remove(compressed_filepath)
Clean up code and remove print statements
|
import os
import gzip
import urllib.request
from celery import shared_task
from django.core.mail import EmailMessage
from celery.task import periodic_task
from celery.schedules import crontab
@shared_task(name='deliver_email')
def deliver_email(subject=None, body=None, recipients=None):
if recipients:
for recipient in recipients:
email = EmailMessage(subject, body, to=[recipient])
email.send()
@periodic_task(bind=True, run_every=crontab(0, 0, day_of_month='7'))
def update_geolocation(self):
# Establish desired paths and directories
current_directory = os.path.dirname(__file__)
compressed_filepath = os.path.join(current_directory, 'GeoLite2-City.mmdb.gz')
uncompressed_filepath = os.path.join(current_directory, 'GeoLite2-City.mmdb')
# Pull down current database file
url = "http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz"
urllib.request.urlretrieve(url, compressed_filepath)
# Read and unzip compressed file to current directory
zipped = gzip.open(compressed_filepath, "rb")
uncompressed = open(uncompressed_filepath, "wb")
uncompressed.write(zipped.read())
zipped.close()
uncompressed.close()
# Remove zipped file
os.remove(compressed_filepath)
|
<commit_before>import os
import gzip
import urllib.request
from celery import shared_task
from django.core.mail import EmailMessage
from celery.task import periodic_task
from celery.schedules import crontab
@shared_task(name='deliver_email')
def deliver_email(subject=None, body=None, recipients=None):
#print("Entering core.tasks.deliver_email for ...", recipients)
if recipients:
for recipient in recipients:
#print("sending email to recipient: ", recipient)
email = EmailMessage(subject, body, to=[recipient])
email.send()
@periodic_task(bind=True, run_every=crontab(0, 0, day_of_month='7'))
def update_geolocation(self):
# Establish desired paths and directories
current_directory = os.path.dirname(__file__)
compressed_filepath = os.path.join(current_directory, 'GeoLite2-City.mmdb.gz')
uncompressed_filepath = os.path.join(current_directory, 'GeoLite2-City.mmdb')
# Pull down current database file
url = "http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz"
urllib.request.urlretrieve(url, compressed_filepath)
# Read and unzip compressed file to current directory
zipped = gzip.open(compressed_filepath, "rb")
uncompressed = open(uncompressed_filepath, "wb")
uncompressed.write(zipped.read())
zipped.close()
uncompressed.close()
# Remove zipped file
os.remove(compressed_filepath)
<commit_msg>Clean up code and remove print statements<commit_after>
|
import os
import gzip
import urllib.request
from celery import shared_task
from django.core.mail import EmailMessage
from celery.task import periodic_task
from celery.schedules import crontab
@shared_task(name='deliver_email')
def deliver_email(subject=None, body=None, recipients=None):
if recipients:
for recipient in recipients:
email = EmailMessage(subject, body, to=[recipient])
email.send()
@periodic_task(bind=True, run_every=crontab(0, 0, day_of_month='7'))
def update_geolocation(self):
# Establish desired paths and directories
current_directory = os.path.dirname(__file__)
compressed_filepath = os.path.join(current_directory, 'GeoLite2-City.mmdb.gz')
uncompressed_filepath = os.path.join(current_directory, 'GeoLite2-City.mmdb')
# Pull down current database file
url = "http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz"
urllib.request.urlretrieve(url, compressed_filepath)
# Read and unzip compressed file to current directory
zipped = gzip.open(compressed_filepath, "rb")
uncompressed = open(uncompressed_filepath, "wb")
uncompressed.write(zipped.read())
zipped.close()
uncompressed.close()
# Remove zipped file
os.remove(compressed_filepath)
|
import os
import gzip
import urllib.request
from celery import shared_task
from django.core.mail import EmailMessage
from celery.task import periodic_task
from celery.schedules import crontab
@shared_task(name='deliver_email')
def deliver_email(subject=None, body=None, recipients=None):
#print("Entering core.tasks.deliver_email for ...", recipients)
if recipients:
for recipient in recipients:
#print("sending email to recipient: ", recipient)
email = EmailMessage(subject, body, to=[recipient])
email.send()
@periodic_task(bind=True, run_every=crontab(0, 0, day_of_month='7'))
def update_geolocation(self):
# Establish desired paths and directories
current_directory = os.path.dirname(__file__)
compressed_filepath = os.path.join(current_directory, 'GeoLite2-City.mmdb.gz')
uncompressed_filepath = os.path.join(current_directory, 'GeoLite2-City.mmdb')
# Pull down current database file
url = "http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz"
urllib.request.urlretrieve(url, compressed_filepath)
# Read and unzip compressed file to current directory
zipped = gzip.open(compressed_filepath, "rb")
uncompressed = open(uncompressed_filepath, "wb")
uncompressed.write(zipped.read())
zipped.close()
uncompressed.close()
# Remove zipped file
os.remove(compressed_filepath)
Clean up code and remove print statementsimport os
import gzip
import urllib.request
from celery import shared_task
from django.core.mail import EmailMessage
from celery.task import periodic_task
from celery.schedules import crontab
@shared_task(name='deliver_email')
def deliver_email(subject=None, body=None, recipients=None):
if recipients:
for recipient in recipients:
email = EmailMessage(subject, body, to=[recipient])
email.send()
@periodic_task(bind=True, run_every=crontab(0, 0, day_of_month='7'))
def update_geolocation(self):
# Establish desired paths and directories
current_directory = os.path.dirname(__file__)
compressed_filepath = os.path.join(current_directory, 'GeoLite2-City.mmdb.gz')
uncompressed_filepath = os.path.join(current_directory, 'GeoLite2-City.mmdb')
# Pull down current database file
url = "http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz"
urllib.request.urlretrieve(url, compressed_filepath)
# Read and unzip compressed file to current directory
zipped = gzip.open(compressed_filepath, "rb")
uncompressed = open(uncompressed_filepath, "wb")
uncompressed.write(zipped.read())
zipped.close()
uncompressed.close()
# Remove zipped file
os.remove(compressed_filepath)
|
<commit_before>import os
import gzip
import urllib.request
from celery import shared_task
from django.core.mail import EmailMessage
from celery.task import periodic_task
from celery.schedules import crontab
@shared_task(name='deliver_email')
def deliver_email(subject=None, body=None, recipients=None):
#print("Entering core.tasks.deliver_email for ...", recipients)
if recipients:
for recipient in recipients:
#print("sending email to recipient: ", recipient)
email = EmailMessage(subject, body, to=[recipient])
email.send()
@periodic_task(bind=True, run_every=crontab(0, 0, day_of_month='7'))
def update_geolocation(self):
# Establish desired paths and directories
current_directory = os.path.dirname(__file__)
compressed_filepath = os.path.join(current_directory, 'GeoLite2-City.mmdb.gz')
uncompressed_filepath = os.path.join(current_directory, 'GeoLite2-City.mmdb')
# Pull down current database file
url = "http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz"
urllib.request.urlretrieve(url, compressed_filepath)
# Read and unzip compressed file to current directory
zipped = gzip.open(compressed_filepath, "rb")
uncompressed = open(uncompressed_filepath, "wb")
uncompressed.write(zipped.read())
zipped.close()
uncompressed.close()
# Remove zipped file
os.remove(compressed_filepath)
<commit_msg>Clean up code and remove print statements<commit_after>import os
import gzip
import urllib.request
from celery import shared_task
from django.core.mail import EmailMessage
from celery.task import periodic_task
from celery.schedules import crontab
@shared_task(name='deliver_email')
def deliver_email(subject=None, body=None, recipients=None):
if recipients:
for recipient in recipients:
email = EmailMessage(subject, body, to=[recipient])
email.send()
@periodic_task(bind=True, run_every=crontab(0, 0, day_of_month='7'))
def update_geolocation(self):
# Establish desired paths and directories
current_directory = os.path.dirname(__file__)
compressed_filepath = os.path.join(current_directory, 'GeoLite2-City.mmdb.gz')
uncompressed_filepath = os.path.join(current_directory, 'GeoLite2-City.mmdb')
# Pull down current database file
url = "http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz"
urllib.request.urlretrieve(url, compressed_filepath)
# Read and unzip compressed file to current directory
zipped = gzip.open(compressed_filepath, "rb")
uncompressed = open(uncompressed_filepath, "wb")
uncompressed.write(zipped.read())
zipped.close()
uncompressed.close()
# Remove zipped file
os.remove(compressed_filepath)
|
116432001ca2b8eb1716add4455dfb1e2562f29a
|
nodeconductor/quotas/admin.py
|
nodeconductor/quotas/admin.py
|
from django.contrib import admin
from django.contrib.contenttypes import models as ct_models, generic
from nodeconductor.quotas import models, utils
class QuotaScopeClassListFilter(admin.SimpleListFilter):
# Human-readable title
title = 'Scope class'
# Parameter for the filter that will be used in the URL query
parameter_name = 'scope_class'
def lookups(self, request, model_admin):
models = utils.get_models_with_quotas()
return [(ct_models.ContentType.objects.get_for_model(m).id, m.__name__) for m in models]
def queryset(self, request, queryset):
content_type_id = self.value()
if content_type_id:
return queryset.filter(content_type_id=content_type_id)
return queryset
class QuotaAdmin(admin.ModelAdmin):
list_display = ['scope', 'name', 'limit', 'usage']
list_filter = ['name', QuotaScopeClassListFilter]
class QuotaInline(generic.GenericStackedInline):
model = models.Quota
fields = ('name', 'limit', 'usage')
readonly_fields = ('name',)
extra = 0
can_delete = False
admin.site.register(models.Quota, QuotaAdmin)
|
from django.contrib import admin
from django.contrib.contenttypes import models as ct_models, generic
from nodeconductor.quotas import models, utils
class QuotaScopeClassListFilter(admin.SimpleListFilter):
# Human-readable title
title = 'Scope class'
# Parameter for the filter that will be used in the URL query
parameter_name = 'scope_class'
def lookups(self, request, model_admin):
models = utils.get_models_with_quotas()
return [(ct_models.ContentType.objects.get_for_model(m).id, m.__name__) for m in models]
def queryset(self, request, queryset):
content_type_id = self.value()
if content_type_id:
return queryset.filter(content_type_id=content_type_id)
return queryset
class QuotaAdmin(admin.ModelAdmin):
list_display = ['scope', 'name', 'limit', 'usage']
list_filter = ['name', QuotaScopeClassListFilter]
class QuotaInline(generic.GenericTabularInline):
model = models.Quota
fields = ('name', 'limit', 'usage')
readonly_fields = ('name',)
extra = 0
can_delete = False
admin.site.register(models.Quota, QuotaAdmin)
|
Change quota inline display style (nc-417)
|
Change quota inline display style (nc-417)
|
Python
|
mit
|
opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor
|
from django.contrib import admin
from django.contrib.contenttypes import models as ct_models, generic
from nodeconductor.quotas import models, utils
class QuotaScopeClassListFilter(admin.SimpleListFilter):
# Human-readable title
title = 'Scope class'
# Parameter for the filter that will be used in the URL query
parameter_name = 'scope_class'
def lookups(self, request, model_admin):
models = utils.get_models_with_quotas()
return [(ct_models.ContentType.objects.get_for_model(m).id, m.__name__) for m in models]
def queryset(self, request, queryset):
content_type_id = self.value()
if content_type_id:
return queryset.filter(content_type_id=content_type_id)
return queryset
class QuotaAdmin(admin.ModelAdmin):
list_display = ['scope', 'name', 'limit', 'usage']
list_filter = ['name', QuotaScopeClassListFilter]
class QuotaInline(generic.GenericStackedInline):
model = models.Quota
fields = ('name', 'limit', 'usage')
readonly_fields = ('name',)
extra = 0
can_delete = False
admin.site.register(models.Quota, QuotaAdmin)
Change quota inline display style (nc-417)
|
from django.contrib import admin
from django.contrib.contenttypes import models as ct_models, generic
from nodeconductor.quotas import models, utils
class QuotaScopeClassListFilter(admin.SimpleListFilter):
# Human-readable title
title = 'Scope class'
# Parameter for the filter that will be used in the URL query
parameter_name = 'scope_class'
def lookups(self, request, model_admin):
models = utils.get_models_with_quotas()
return [(ct_models.ContentType.objects.get_for_model(m).id, m.__name__) for m in models]
def queryset(self, request, queryset):
content_type_id = self.value()
if content_type_id:
return queryset.filter(content_type_id=content_type_id)
return queryset
class QuotaAdmin(admin.ModelAdmin):
list_display = ['scope', 'name', 'limit', 'usage']
list_filter = ['name', QuotaScopeClassListFilter]
class QuotaInline(generic.GenericTabularInline):
model = models.Quota
fields = ('name', 'limit', 'usage')
readonly_fields = ('name',)
extra = 0
can_delete = False
admin.site.register(models.Quota, QuotaAdmin)
|
<commit_before>from django.contrib import admin
from django.contrib.contenttypes import models as ct_models, generic
from nodeconductor.quotas import models, utils
class QuotaScopeClassListFilter(admin.SimpleListFilter):
# Human-readable title
title = 'Scope class'
# Parameter for the filter that will be used in the URL query
parameter_name = 'scope_class'
def lookups(self, request, model_admin):
models = utils.get_models_with_quotas()
return [(ct_models.ContentType.objects.get_for_model(m).id, m.__name__) for m in models]
def queryset(self, request, queryset):
content_type_id = self.value()
if content_type_id:
return queryset.filter(content_type_id=content_type_id)
return queryset
class QuotaAdmin(admin.ModelAdmin):
list_display = ['scope', 'name', 'limit', 'usage']
list_filter = ['name', QuotaScopeClassListFilter]
class QuotaInline(generic.GenericStackedInline):
model = models.Quota
fields = ('name', 'limit', 'usage')
readonly_fields = ('name',)
extra = 0
can_delete = False
admin.site.register(models.Quota, QuotaAdmin)
<commit_msg>Change quota inline display style (nc-417)<commit_after>
|
from django.contrib import admin
from django.contrib.contenttypes import models as ct_models, generic
from nodeconductor.quotas import models, utils
class QuotaScopeClassListFilter(admin.SimpleListFilter):
# Human-readable title
title = 'Scope class'
# Parameter for the filter that will be used in the URL query
parameter_name = 'scope_class'
def lookups(self, request, model_admin):
models = utils.get_models_with_quotas()
return [(ct_models.ContentType.objects.get_for_model(m).id, m.__name__) for m in models]
def queryset(self, request, queryset):
content_type_id = self.value()
if content_type_id:
return queryset.filter(content_type_id=content_type_id)
return queryset
class QuotaAdmin(admin.ModelAdmin):
list_display = ['scope', 'name', 'limit', 'usage']
list_filter = ['name', QuotaScopeClassListFilter]
class QuotaInline(generic.GenericTabularInline):
model = models.Quota
fields = ('name', 'limit', 'usage')
readonly_fields = ('name',)
extra = 0
can_delete = False
admin.site.register(models.Quota, QuotaAdmin)
|
from django.contrib import admin
from django.contrib.contenttypes import models as ct_models, generic
from nodeconductor.quotas import models, utils
class QuotaScopeClassListFilter(admin.SimpleListFilter):
# Human-readable title
title = 'Scope class'
# Parameter for the filter that will be used in the URL query
parameter_name = 'scope_class'
def lookups(self, request, model_admin):
models = utils.get_models_with_quotas()
return [(ct_models.ContentType.objects.get_for_model(m).id, m.__name__) for m in models]
def queryset(self, request, queryset):
content_type_id = self.value()
if content_type_id:
return queryset.filter(content_type_id=content_type_id)
return queryset
class QuotaAdmin(admin.ModelAdmin):
list_display = ['scope', 'name', 'limit', 'usage']
list_filter = ['name', QuotaScopeClassListFilter]
class QuotaInline(generic.GenericStackedInline):
model = models.Quota
fields = ('name', 'limit', 'usage')
readonly_fields = ('name',)
extra = 0
can_delete = False
admin.site.register(models.Quota, QuotaAdmin)
Change quota inline display style (nc-417)from django.contrib import admin
from django.contrib.contenttypes import models as ct_models, generic
from nodeconductor.quotas import models, utils
class QuotaScopeClassListFilter(admin.SimpleListFilter):
# Human-readable title
title = 'Scope class'
# Parameter for the filter that will be used in the URL query
parameter_name = 'scope_class'
def lookups(self, request, model_admin):
models = utils.get_models_with_quotas()
return [(ct_models.ContentType.objects.get_for_model(m).id, m.__name__) for m in models]
def queryset(self, request, queryset):
content_type_id = self.value()
if content_type_id:
return queryset.filter(content_type_id=content_type_id)
return queryset
class QuotaAdmin(admin.ModelAdmin):
list_display = ['scope', 'name', 'limit', 'usage']
list_filter = ['name', QuotaScopeClassListFilter]
class QuotaInline(generic.GenericTabularInline):
model = models.Quota
fields = ('name', 'limit', 'usage')
readonly_fields = ('name',)
extra = 0
can_delete = False
admin.site.register(models.Quota, QuotaAdmin)
|
<commit_before>from django.contrib import admin
from django.contrib.contenttypes import models as ct_models, generic
from nodeconductor.quotas import models, utils
class QuotaScopeClassListFilter(admin.SimpleListFilter):
# Human-readable title
title = 'Scope class'
# Parameter for the filter that will be used in the URL query
parameter_name = 'scope_class'
def lookups(self, request, model_admin):
models = utils.get_models_with_quotas()
return [(ct_models.ContentType.objects.get_for_model(m).id, m.__name__) for m in models]
def queryset(self, request, queryset):
content_type_id = self.value()
if content_type_id:
return queryset.filter(content_type_id=content_type_id)
return queryset
class QuotaAdmin(admin.ModelAdmin):
list_display = ['scope', 'name', 'limit', 'usage']
list_filter = ['name', QuotaScopeClassListFilter]
class QuotaInline(generic.GenericStackedInline):
model = models.Quota
fields = ('name', 'limit', 'usage')
readonly_fields = ('name',)
extra = 0
can_delete = False
admin.site.register(models.Quota, QuotaAdmin)
<commit_msg>Change quota inline display style (nc-417)<commit_after>from django.contrib import admin
from django.contrib.contenttypes import models as ct_models, generic
from nodeconductor.quotas import models, utils
class QuotaScopeClassListFilter(admin.SimpleListFilter):
# Human-readable title
title = 'Scope class'
# Parameter for the filter that will be used in the URL query
parameter_name = 'scope_class'
def lookups(self, request, model_admin):
models = utils.get_models_with_quotas()
return [(ct_models.ContentType.objects.get_for_model(m).id, m.__name__) for m in models]
def queryset(self, request, queryset):
content_type_id = self.value()
if content_type_id:
return queryset.filter(content_type_id=content_type_id)
return queryset
class QuotaAdmin(admin.ModelAdmin):
list_display = ['scope', 'name', 'limit', 'usage']
list_filter = ['name', QuotaScopeClassListFilter]
class QuotaInline(generic.GenericTabularInline):
model = models.Quota
fields = ('name', 'limit', 'usage')
readonly_fields = ('name',)
extra = 0
can_delete = False
admin.site.register(models.Quota, QuotaAdmin)
|
96aa6271a4dab8c4e222c4161ab9ad06472b4f19
|
orges/test/integration/test_main.py
|
orges/test/integration/test_main.py
|
from __future__ import division, print_function, with_statement
from nose.tools import eq_
from orges.main import optimize
from orges.optimizer.gridsearch import GridSearchOptimizer
from orges.test.util.one_param_sleep_and_negate_f import f
def test_optimize_running_too_long_aborts():
optimizer = GridSearchOptimizer()
val = optimize(f, timeout=1, optimizer=optimizer)
# f(a=0) is 0, f(a=1) is -1. Because of the timeout we never see a=1, hence
# we except the minimum before the timeout to be 0.
eq_(str(val), "(a=0,)")
if __name__ == '__main__':
import nose
nose.runmodule()
|
from __future__ import division, print_function, with_statement
from nose.tools import eq_
from orges.main import optimize
from orges.optimizer.gridsearch import GridSearchOptimizer
from orges.test.util.one_param_sleep_and_negate_f import f
def test_optimize_running_too_long_aborts():
optimizer = GridSearchOptimizer()
result = optimize(f, timeout=1, optimizer=optimizer)
# f(a=0) is 0, f(a=1) is -1. Because of the timeout we never see a=1, hence
# we except the minimum before the timeout to be 0.
eq_(result[0].value, 0)
if __name__ == '__main__':
import nose
nose.runmodule()
|
Fix test for optimize method
|
Fix test for optimize method
|
Python
|
bsd-3-clause
|
cigroup-ol/metaopt,cigroup-ol/metaopt,cigroup-ol/metaopt
|
from __future__ import division, print_function, with_statement
from nose.tools import eq_
from orges.main import optimize
from orges.optimizer.gridsearch import GridSearchOptimizer
from orges.test.util.one_param_sleep_and_negate_f import f
def test_optimize_running_too_long_aborts():
optimizer = GridSearchOptimizer()
val = optimize(f, timeout=1, optimizer=optimizer)
# f(a=0) is 0, f(a=1) is -1. Because of the timeout we never see a=1, hence
# we except the minimum before the timeout to be 0.
eq_(str(val), "(a=0,)")
if __name__ == '__main__':
import nose
nose.runmodule()
Fix test for optimize method
|
from __future__ import division, print_function, with_statement
from nose.tools import eq_
from orges.main import optimize
from orges.optimizer.gridsearch import GridSearchOptimizer
from orges.test.util.one_param_sleep_and_negate_f import f
def test_optimize_running_too_long_aborts():
optimizer = GridSearchOptimizer()
result = optimize(f, timeout=1, optimizer=optimizer)
# f(a=0) is 0, f(a=1) is -1. Because of the timeout we never see a=1, hence
# we except the minimum before the timeout to be 0.
eq_(result[0].value, 0)
if __name__ == '__main__':
import nose
nose.runmodule()
|
<commit_before>from __future__ import division, print_function, with_statement
from nose.tools import eq_
from orges.main import optimize
from orges.optimizer.gridsearch import GridSearchOptimizer
from orges.test.util.one_param_sleep_and_negate_f import f
def test_optimize_running_too_long_aborts():
optimizer = GridSearchOptimizer()
val = optimize(f, timeout=1, optimizer=optimizer)
# f(a=0) is 0, f(a=1) is -1. Because of the timeout we never see a=1, hence
# we except the minimum before the timeout to be 0.
eq_(str(val), "(a=0,)")
if __name__ == '__main__':
import nose
nose.runmodule()
<commit_msg>Fix test for optimize method<commit_after>
|
from __future__ import division, print_function, with_statement
from nose.tools import eq_
from orges.main import optimize
from orges.optimizer.gridsearch import GridSearchOptimizer
from orges.test.util.one_param_sleep_and_negate_f import f
def test_optimize_running_too_long_aborts():
optimizer = GridSearchOptimizer()
result = optimize(f, timeout=1, optimizer=optimizer)
# f(a=0) is 0, f(a=1) is -1. Because of the timeout we never see a=1, hence
# we except the minimum before the timeout to be 0.
eq_(result[0].value, 0)
if __name__ == '__main__':
import nose
nose.runmodule()
|
from __future__ import division, print_function, with_statement
from nose.tools import eq_
from orges.main import optimize
from orges.optimizer.gridsearch import GridSearchOptimizer
from orges.test.util.one_param_sleep_and_negate_f import f
def test_optimize_running_too_long_aborts():
optimizer = GridSearchOptimizer()
val = optimize(f, timeout=1, optimizer=optimizer)
# f(a=0) is 0, f(a=1) is -1. Because of the timeout we never see a=1, hence
# we except the minimum before the timeout to be 0.
eq_(str(val), "(a=0,)")
if __name__ == '__main__':
import nose
nose.runmodule()
Fix test for optimize methodfrom __future__ import division, print_function, with_statement
from nose.tools import eq_
from orges.main import optimize
from orges.optimizer.gridsearch import GridSearchOptimizer
from orges.test.util.one_param_sleep_and_negate_f import f
def test_optimize_running_too_long_aborts():
optimizer = GridSearchOptimizer()
result = optimize(f, timeout=1, optimizer=optimizer)
# f(a=0) is 0, f(a=1) is -1. Because of the timeout we never see a=1, hence
# we except the minimum before the timeout to be 0.
eq_(result[0].value, 0)
if __name__ == '__main__':
import nose
nose.runmodule()
|
<commit_before>from __future__ import division, print_function, with_statement
from nose.tools import eq_
from orges.main import optimize
from orges.optimizer.gridsearch import GridSearchOptimizer
from orges.test.util.one_param_sleep_and_negate_f import f
def test_optimize_running_too_long_aborts():
optimizer = GridSearchOptimizer()
val = optimize(f, timeout=1, optimizer=optimizer)
# f(a=0) is 0, f(a=1) is -1. Because of the timeout we never see a=1, hence
# we except the minimum before the timeout to be 0.
eq_(str(val), "(a=0,)")
if __name__ == '__main__':
import nose
nose.runmodule()
<commit_msg>Fix test for optimize method<commit_after>from __future__ import division, print_function, with_statement
from nose.tools import eq_
from orges.main import optimize
from orges.optimizer.gridsearch import GridSearchOptimizer
from orges.test.util.one_param_sleep_and_negate_f import f
def test_optimize_running_too_long_aborts():
optimizer = GridSearchOptimizer()
result = optimize(f, timeout=1, optimizer=optimizer)
# f(a=0) is 0, f(a=1) is -1. Because of the timeout we never see a=1, hence
# we except the minimum before the timeout to be 0.
eq_(result[0].value, 0)
if __name__ == '__main__':
import nose
nose.runmodule()
|
7f83888c957b892e6cc9d2e92f49a2737a9eabfe
|
logstash_handler/__init__.py
|
logstash_handler/__init__.py
|
from logging.handlers import SocketHandler
import ssl
class LogstashHandler(SocketHandler):
"""
Sends output to an optionally encrypted streaming logstash TCP listener.
"""
def __init__(self, host, port, keyfile=None, certfile=None, ssl=True):
SocketHandler.__init__(self, host, port)
self.keyfile = keyfile
self.certfile = certfile
self.ssl = ssl
def makeSocket(self, timeout=1):
s = SocketHandler.makeSocket(self, timeout)
if self.ssl:
return ssl.wrap_socket(s, keyfile=self.keyfile, certfile=self.certfile)
return s
def makePickle(self, record):
"""
Just format the record according to the formatter. A new line is appended to
support streaming listeners.
"""
return self.format(record) + "\n"
|
from logging.handlers import SocketHandler
import ssl
class LogstashHandler(SocketHandler):
"""
Sends output to an optionally encrypted streaming logstash TCP listener.
"""
def __init__(self, host, port, keyfile=None, certfile=None, ca_certs=None, ssl=True):
SocketHandler.__init__(self, host, port)
self.keyfile = keyfile
self.certfile = certfile
self.ca_certs = ca_certs
self.ssl = ssl
def makeSocket(self, timeout=1):
s = SocketHandler.makeSocket(self, timeout)
if self.ssl:
return ssl.wrap_socket(s, keyfile=self.keyfile, certfile=self.certfile, ca_certs=self.ca_certs)
return s
def makePickle(self, record):
"""
Just format the record according to the formatter. A new line is appended to
support streaming listeners.
"""
return self.format(record) + "\n"
|
Add support for CA certificates
|
Add support for CA certificates
better SSL support
|
Python
|
mit
|
klynch/python-logstash-handler
|
from logging.handlers import SocketHandler
import ssl
class LogstashHandler(SocketHandler):
"""
Sends output to an optionally encrypted streaming logstash TCP listener.
"""
def __init__(self, host, port, keyfile=None, certfile=None, ssl=True):
SocketHandler.__init__(self, host, port)
self.keyfile = keyfile
self.certfile = certfile
self.ssl = ssl
def makeSocket(self, timeout=1):
s = SocketHandler.makeSocket(self, timeout)
if self.ssl:
return ssl.wrap_socket(s, keyfile=self.keyfile, certfile=self.certfile)
return s
def makePickle(self, record):
"""
Just format the record according to the formatter. A new line is appended to
support streaming listeners.
"""
return self.format(record) + "\n"
Add support for CA certificates
better SSL support
|
from logging.handlers import SocketHandler
import ssl
class LogstashHandler(SocketHandler):
"""
Sends output to an optionally encrypted streaming logstash TCP listener.
"""
def __init__(self, host, port, keyfile=None, certfile=None, ca_certs=None, ssl=True):
SocketHandler.__init__(self, host, port)
self.keyfile = keyfile
self.certfile = certfile
self.ca_certs = ca_certs
self.ssl = ssl
def makeSocket(self, timeout=1):
s = SocketHandler.makeSocket(self, timeout)
if self.ssl:
return ssl.wrap_socket(s, keyfile=self.keyfile, certfile=self.certfile, ca_certs=self.ca_certs)
return s
def makePickle(self, record):
"""
Just format the record according to the formatter. A new line is appended to
support streaming listeners.
"""
return self.format(record) + "\n"
|
<commit_before>from logging.handlers import SocketHandler
import ssl
class LogstashHandler(SocketHandler):
"""
Sends output to an optionally encrypted streaming logstash TCP listener.
"""
def __init__(self, host, port, keyfile=None, certfile=None, ssl=True):
SocketHandler.__init__(self, host, port)
self.keyfile = keyfile
self.certfile = certfile
self.ssl = ssl
def makeSocket(self, timeout=1):
s = SocketHandler.makeSocket(self, timeout)
if self.ssl:
return ssl.wrap_socket(s, keyfile=self.keyfile, certfile=self.certfile)
return s
def makePickle(self, record):
"""
Just format the record according to the formatter. A new line is appended to
support streaming listeners.
"""
return self.format(record) + "\n"
<commit_msg>Add support for CA certificates
better SSL support<commit_after>
|
from logging.handlers import SocketHandler
import ssl
class LogstashHandler(SocketHandler):
"""
Sends output to an optionally encrypted streaming logstash TCP listener.
"""
def __init__(self, host, port, keyfile=None, certfile=None, ca_certs=None, ssl=True):
SocketHandler.__init__(self, host, port)
self.keyfile = keyfile
self.certfile = certfile
self.ca_certs = ca_certs
self.ssl = ssl
def makeSocket(self, timeout=1):
s = SocketHandler.makeSocket(self, timeout)
if self.ssl:
return ssl.wrap_socket(s, keyfile=self.keyfile, certfile=self.certfile, ca_certs=self.ca_certs)
return s
def makePickle(self, record):
"""
Just format the record according to the formatter. A new line is appended to
support streaming listeners.
"""
return self.format(record) + "\n"
|
from logging.handlers import SocketHandler
import ssl
class LogstashHandler(SocketHandler):
"""
Sends output to an optionally encrypted streaming logstash TCP listener.
"""
def __init__(self, host, port, keyfile=None, certfile=None, ssl=True):
SocketHandler.__init__(self, host, port)
self.keyfile = keyfile
self.certfile = certfile
self.ssl = ssl
def makeSocket(self, timeout=1):
s = SocketHandler.makeSocket(self, timeout)
if self.ssl:
return ssl.wrap_socket(s, keyfile=self.keyfile, certfile=self.certfile)
return s
def makePickle(self, record):
"""
Just format the record according to the formatter. A new line is appended to
support streaming listeners.
"""
return self.format(record) + "\n"
Add support for CA certificates
better SSL supportfrom logging.handlers import SocketHandler
import ssl
class LogstashHandler(SocketHandler):
"""
Sends output to an optionally encrypted streaming logstash TCP listener.
"""
def __init__(self, host, port, keyfile=None, certfile=None, ca_certs=None, ssl=True):
SocketHandler.__init__(self, host, port)
self.keyfile = keyfile
self.certfile = certfile
self.ca_certs = ca_certs
self.ssl = ssl
def makeSocket(self, timeout=1):
s = SocketHandler.makeSocket(self, timeout)
if self.ssl:
return ssl.wrap_socket(s, keyfile=self.keyfile, certfile=self.certfile, ca_certs=self.ca_certs)
return s
def makePickle(self, record):
"""
Just format the record according to the formatter. A new line is appended to
support streaming listeners.
"""
return self.format(record) + "\n"
|
<commit_before>from logging.handlers import SocketHandler
import ssl
class LogstashHandler(SocketHandler):
"""
Sends output to an optionally encrypted streaming logstash TCP listener.
"""
def __init__(self, host, port, keyfile=None, certfile=None, ssl=True):
SocketHandler.__init__(self, host, port)
self.keyfile = keyfile
self.certfile = certfile
self.ssl = ssl
def makeSocket(self, timeout=1):
s = SocketHandler.makeSocket(self, timeout)
if self.ssl:
return ssl.wrap_socket(s, keyfile=self.keyfile, certfile=self.certfile)
return s
def makePickle(self, record):
"""
Just format the record according to the formatter. A new line is appended to
support streaming listeners.
"""
return self.format(record) + "\n"
<commit_msg>Add support for CA certificates
better SSL support<commit_after>from logging.handlers import SocketHandler
import ssl
class LogstashHandler(SocketHandler):
"""
Sends output to an optionally encrypted streaming logstash TCP listener.
"""
def __init__(self, host, port, keyfile=None, certfile=None, ca_certs=None, ssl=True):
SocketHandler.__init__(self, host, port)
self.keyfile = keyfile
self.certfile = certfile
self.ca_certs = ca_certs
self.ssl = ssl
def makeSocket(self, timeout=1):
s = SocketHandler.makeSocket(self, timeout)
if self.ssl:
return ssl.wrap_socket(s, keyfile=self.keyfile, certfile=self.certfile, ca_certs=self.ca_certs)
return s
def makePickle(self, record):
"""
Just format the record according to the formatter. A new line is appended to
support streaming listeners.
"""
return self.format(record) + "\n"
|
09fa1e01c6de9dffc99c7726607d64c843b564ba
|
osgtest/tests/test_53_gums.py
|
osgtest/tests/test_53_gums.py
|
import os
import pwd
import unittest
import osgtest.library.core as core
import osgtest.library.files as files
import osgtest.library.tomcat as tomcat
import osgtest.library.osgunittest as osgunittest
class TestGUMS(osgunittest.OSGTestCase):
def test_01_map_user(self):
core.skip_ok_unless_installed('gums-service')
host_dn, _ = core.certificate_info(core.config['certs.hostcert'])
pwd_entry = pwd.getpwnam(core.options.username)
cert_path = os.path.join(pwd_entry.pw_dir, '.globus', 'usercert.pem')
user_dn, _ = core.certificate_info(cert_path)
command = ('gums-host', 'mapUser', user_dn)
core.check_system(command, 'Map GUMS user')
|
import os
import pwd
import unittest
import osgtest.library.core as core
import osgtest.library.files as files
import osgtest.library.tomcat as tomcat
import osgtest.library.osgunittest as osgunittest
class TestGUMS(osgunittest.OSGTestCase):
def test_01_map_user(self):
core.skip_ok_unless_installed('gums-service')
host_dn, _ = core.certificate_info(core.config['certs.hostcert'])
pwd_entry = pwd.getpwnam(core.options.username)
cert_path = os.path.join(pwd_entry.pw_dir, '.globus', 'usercert.pem')
user_dn, _ = core.certificate_info(cert_path)
command = ('gums', 'mapUser', '--serv', host_dn, user_dn)
core.check_system(command, 'Map GUMS user')
|
Revert accidental gums test change from previous commit.
|
Revert accidental gums test change from previous commit.
git-svn-id: 884a03e47e2adb735d896e55bb5ad6bc3421ba19@17355 4e558342-562e-0410-864c-e07659590f8c
|
Python
|
apache-2.0
|
efajardo/osg-test,efajardo/osg-test
|
import os
import pwd
import unittest
import osgtest.library.core as core
import osgtest.library.files as files
import osgtest.library.tomcat as tomcat
import osgtest.library.osgunittest as osgunittest
class TestGUMS(osgunittest.OSGTestCase):
def test_01_map_user(self):
core.skip_ok_unless_installed('gums-service')
host_dn, _ = core.certificate_info(core.config['certs.hostcert'])
pwd_entry = pwd.getpwnam(core.options.username)
cert_path = os.path.join(pwd_entry.pw_dir, '.globus', 'usercert.pem')
user_dn, _ = core.certificate_info(cert_path)
command = ('gums-host', 'mapUser', user_dn)
core.check_system(command, 'Map GUMS user')
Revert accidental gums test change from previous commit.
git-svn-id: 884a03e47e2adb735d896e55bb5ad6bc3421ba19@17355 4e558342-562e-0410-864c-e07659590f8c
|
import os
import pwd
import unittest
import osgtest.library.core as core
import osgtest.library.files as files
import osgtest.library.tomcat as tomcat
import osgtest.library.osgunittest as osgunittest
class TestGUMS(osgunittest.OSGTestCase):
def test_01_map_user(self):
core.skip_ok_unless_installed('gums-service')
host_dn, _ = core.certificate_info(core.config['certs.hostcert'])
pwd_entry = pwd.getpwnam(core.options.username)
cert_path = os.path.join(pwd_entry.pw_dir, '.globus', 'usercert.pem')
user_dn, _ = core.certificate_info(cert_path)
command = ('gums', 'mapUser', '--serv', host_dn, user_dn)
core.check_system(command, 'Map GUMS user')
|
<commit_before>import os
import pwd
import unittest
import osgtest.library.core as core
import osgtest.library.files as files
import osgtest.library.tomcat as tomcat
import osgtest.library.osgunittest as osgunittest
class TestGUMS(osgunittest.OSGTestCase):
def test_01_map_user(self):
core.skip_ok_unless_installed('gums-service')
host_dn, _ = core.certificate_info(core.config['certs.hostcert'])
pwd_entry = pwd.getpwnam(core.options.username)
cert_path = os.path.join(pwd_entry.pw_dir, '.globus', 'usercert.pem')
user_dn, _ = core.certificate_info(cert_path)
command = ('gums-host', 'mapUser', user_dn)
core.check_system(command, 'Map GUMS user')
<commit_msg>Revert accidental gums test change from previous commit.
git-svn-id: 884a03e47e2adb735d896e55bb5ad6bc3421ba19@17355 4e558342-562e-0410-864c-e07659590f8c<commit_after>
|
import os
import pwd
import unittest
import osgtest.library.core as core
import osgtest.library.files as files
import osgtest.library.tomcat as tomcat
import osgtest.library.osgunittest as osgunittest
class TestGUMS(osgunittest.OSGTestCase):
def test_01_map_user(self):
core.skip_ok_unless_installed('gums-service')
host_dn, _ = core.certificate_info(core.config['certs.hostcert'])
pwd_entry = pwd.getpwnam(core.options.username)
cert_path = os.path.join(pwd_entry.pw_dir, '.globus', 'usercert.pem')
user_dn, _ = core.certificate_info(cert_path)
command = ('gums', 'mapUser', '--serv', host_dn, user_dn)
core.check_system(command, 'Map GUMS user')
|
import os
import pwd
import unittest
import osgtest.library.core as core
import osgtest.library.files as files
import osgtest.library.tomcat as tomcat
import osgtest.library.osgunittest as osgunittest
class TestGUMS(osgunittest.OSGTestCase):
def test_01_map_user(self):
core.skip_ok_unless_installed('gums-service')
host_dn, _ = core.certificate_info(core.config['certs.hostcert'])
pwd_entry = pwd.getpwnam(core.options.username)
cert_path = os.path.join(pwd_entry.pw_dir, '.globus', 'usercert.pem')
user_dn, _ = core.certificate_info(cert_path)
command = ('gums-host', 'mapUser', user_dn)
core.check_system(command, 'Map GUMS user')
Revert accidental gums test change from previous commit.
git-svn-id: 884a03e47e2adb735d896e55bb5ad6bc3421ba19@17355 4e558342-562e-0410-864c-e07659590f8cimport os
import pwd
import unittest
import osgtest.library.core as core
import osgtest.library.files as files
import osgtest.library.tomcat as tomcat
import osgtest.library.osgunittest as osgunittest
class TestGUMS(osgunittest.OSGTestCase):
def test_01_map_user(self):
core.skip_ok_unless_installed('gums-service')
host_dn, _ = core.certificate_info(core.config['certs.hostcert'])
pwd_entry = pwd.getpwnam(core.options.username)
cert_path = os.path.join(pwd_entry.pw_dir, '.globus', 'usercert.pem')
user_dn, _ = core.certificate_info(cert_path)
command = ('gums', 'mapUser', '--serv', host_dn, user_dn)
core.check_system(command, 'Map GUMS user')
|
<commit_before>import os
import pwd
import unittest
import osgtest.library.core as core
import osgtest.library.files as files
import osgtest.library.tomcat as tomcat
import osgtest.library.osgunittest as osgunittest
class TestGUMS(osgunittest.OSGTestCase):
def test_01_map_user(self):
core.skip_ok_unless_installed('gums-service')
host_dn, _ = core.certificate_info(core.config['certs.hostcert'])
pwd_entry = pwd.getpwnam(core.options.username)
cert_path = os.path.join(pwd_entry.pw_dir, '.globus', 'usercert.pem')
user_dn, _ = core.certificate_info(cert_path)
command = ('gums-host', 'mapUser', user_dn)
core.check_system(command, 'Map GUMS user')
<commit_msg>Revert accidental gums test change from previous commit.
git-svn-id: 884a03e47e2adb735d896e55bb5ad6bc3421ba19@17355 4e558342-562e-0410-864c-e07659590f8c<commit_after>import os
import pwd
import unittest
import osgtest.library.core as core
import osgtest.library.files as files
import osgtest.library.tomcat as tomcat
import osgtest.library.osgunittest as osgunittest
class TestGUMS(osgunittest.OSGTestCase):
def test_01_map_user(self):
core.skip_ok_unless_installed('gums-service')
host_dn, _ = core.certificate_info(core.config['certs.hostcert'])
pwd_entry = pwd.getpwnam(core.options.username)
cert_path = os.path.join(pwd_entry.pw_dir, '.globus', 'usercert.pem')
user_dn, _ = core.certificate_info(cert_path)
command = ('gums', 'mapUser', '--serv', host_dn, user_dn)
core.check_system(command, 'Map GUMS user')
|
256a86b9cfbf2f78fc913b87997dd89673d177c5
|
custom/icds_reports/migrations/0070_ccsrecordmonthly_closed.py
|
custom/icds_reports/migrations/0070_ccsrecordmonthly_closed.py
|
# -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-09-11 14:35
from __future__ import unicode_literals
from __future__ import absolute_import
from django.db import migrations, models
from corehq.sql_db.operations import RawSQLMigration
from custom.icds_reports.utils.migrations import get_view_migrations
migrator = RawSQLMigration(('custom', 'icds_reports', 'migrations', 'sql_templates'))
class Migration(migrations.Migration):
dependencies = [
('icds_reports', '0069_valid_visits'),
]
operations = [
migrations.AddField(
model_name='CcsRecordMonthlyView',
name='open_in_month',
field=models.SmallIntegerField(blank=True, null=True),
),
]
operations.extend(get_view_migrations())
|
# -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-09-11 14:35
from __future__ import unicode_literals
from __future__ import absolute_import
from django.db import migrations, models
from corehq.sql_db.operations import RawSQLMigration
from custom.icds_reports.utils.migrations import get_view_migrations
migrator = RawSQLMigration(('custom', 'icds_reports', 'migrations', 'sql_templates'))
class Migration(migrations.Migration):
dependencies = [
('icds_reports', '0069_valid_visits'),
]
operations = [
]
operations.extend(get_view_migrations())
|
Remove adding field to View model
|
Remove adding field to View model
|
Python
|
bsd-3-clause
|
dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq
|
# -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-09-11 14:35
from __future__ import unicode_literals
from __future__ import absolute_import
from django.db import migrations, models
from corehq.sql_db.operations import RawSQLMigration
from custom.icds_reports.utils.migrations import get_view_migrations
migrator = RawSQLMigration(('custom', 'icds_reports', 'migrations', 'sql_templates'))
class Migration(migrations.Migration):
dependencies = [
('icds_reports', '0069_valid_visits'),
]
operations = [
migrations.AddField(
model_name='CcsRecordMonthlyView',
name='open_in_month',
field=models.SmallIntegerField(blank=True, null=True),
),
]
operations.extend(get_view_migrations())
Remove adding field to View model
|
# -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-09-11 14:35
from __future__ import unicode_literals
from __future__ import absolute_import
from django.db import migrations, models
from corehq.sql_db.operations import RawSQLMigration
from custom.icds_reports.utils.migrations import get_view_migrations
migrator = RawSQLMigration(('custom', 'icds_reports', 'migrations', 'sql_templates'))
class Migration(migrations.Migration):
dependencies = [
('icds_reports', '0069_valid_visits'),
]
operations = [
]
operations.extend(get_view_migrations())
|
<commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-09-11 14:35
from __future__ import unicode_literals
from __future__ import absolute_import
from django.db import migrations, models
from corehq.sql_db.operations import RawSQLMigration
from custom.icds_reports.utils.migrations import get_view_migrations
migrator = RawSQLMigration(('custom', 'icds_reports', 'migrations', 'sql_templates'))
class Migration(migrations.Migration):
dependencies = [
('icds_reports', '0069_valid_visits'),
]
operations = [
migrations.AddField(
model_name='CcsRecordMonthlyView',
name='open_in_month',
field=models.SmallIntegerField(blank=True, null=True),
),
]
operations.extend(get_view_migrations())
<commit_msg>Remove adding field to View model<commit_after>
|
# -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-09-11 14:35
from __future__ import unicode_literals
from __future__ import absolute_import
from django.db import migrations, models
from corehq.sql_db.operations import RawSQLMigration
from custom.icds_reports.utils.migrations import get_view_migrations
migrator = RawSQLMigration(('custom', 'icds_reports', 'migrations', 'sql_templates'))
class Migration(migrations.Migration):
dependencies = [
('icds_reports', '0069_valid_visits'),
]
operations = [
]
operations.extend(get_view_migrations())
|
# -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-09-11 14:35
from __future__ import unicode_literals
from __future__ import absolute_import
from django.db import migrations, models
from corehq.sql_db.operations import RawSQLMigration
from custom.icds_reports.utils.migrations import get_view_migrations
migrator = RawSQLMigration(('custom', 'icds_reports', 'migrations', 'sql_templates'))
class Migration(migrations.Migration):
dependencies = [
('icds_reports', '0069_valid_visits'),
]
operations = [
migrations.AddField(
model_name='CcsRecordMonthlyView',
name='open_in_month',
field=models.SmallIntegerField(blank=True, null=True),
),
]
operations.extend(get_view_migrations())
Remove adding field to View model# -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-09-11 14:35
from __future__ import unicode_literals
from __future__ import absolute_import
from django.db import migrations, models
from corehq.sql_db.operations import RawSQLMigration
from custom.icds_reports.utils.migrations import get_view_migrations
migrator = RawSQLMigration(('custom', 'icds_reports', 'migrations', 'sql_templates'))
class Migration(migrations.Migration):
dependencies = [
('icds_reports', '0069_valid_visits'),
]
operations = [
]
operations.extend(get_view_migrations())
|
<commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-09-11 14:35
from __future__ import unicode_literals
from __future__ import absolute_import
from django.db import migrations, models
from corehq.sql_db.operations import RawSQLMigration
from custom.icds_reports.utils.migrations import get_view_migrations
migrator = RawSQLMigration(('custom', 'icds_reports', 'migrations', 'sql_templates'))
class Migration(migrations.Migration):
dependencies = [
('icds_reports', '0069_valid_visits'),
]
operations = [
migrations.AddField(
model_name='CcsRecordMonthlyView',
name='open_in_month',
field=models.SmallIntegerField(blank=True, null=True),
),
]
operations.extend(get_view_migrations())
<commit_msg>Remove adding field to View model<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-09-11 14:35
from __future__ import unicode_literals
from __future__ import absolute_import
from django.db import migrations, models
from corehq.sql_db.operations import RawSQLMigration
from custom.icds_reports.utils.migrations import get_view_migrations
migrator = RawSQLMigration(('custom', 'icds_reports', 'migrations', 'sql_templates'))
class Migration(migrations.Migration):
dependencies = [
('icds_reports', '0069_valid_visits'),
]
operations = [
]
operations.extend(get_view_migrations())
|
49c00236569d48f651bd8f2226907d5c784cbe77
|
json262/json262.py
|
json262/json262.py
|
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
"""
Serialize data to/from JSON
Inspired by https://github.com/django/django/blob/master/django/core/serializers/json.py
"""
# Avoid shadowing the standard library json module
from __future__ import absolute_import
from __future__ import unicode_literals
import datetime
import decimal
import json
class JSON262Encoder(json.JSONEncoder):
"""
JSON encoder aiming to be fully compliant with ECMA-262.
"""
def default(self, o):
# See "Date Time String Format" in the ECMA-262 specification.
if isinstance(o, datetime.datetime):
r = o.isoformat()
if o.microsecond:
r = r[:23] + r[26:]
if r.endswith('+00:00'):
r = r[:-6] + 'Z'
return r
elif isinstance(o, datetime.date):
return o.isoformat()
elif isinstance(o, datetime.time):
r = o.isoformat()
if o.microsecond:
r = r[:12]
if r.endswith('+00:00'):
r = r[:-6] + 'Z'
return r
elif isinstance(o, decimal.Decimal):
return str(o)
else:
return super(JSON262Encoder, self).default(o)
|
Bring in encoder from webhooks.
|
Bring in encoder from webhooks.
|
Python
|
bsd-3-clause
|
audreyr/standardjson,audreyr/standardjson
|
# -*- coding: utf-8 -*-Bring in encoder from webhooks.
|
# -*- coding: utf-8 -*-
"""
Serialize data to/from JSON
Inspired by https://github.com/django/django/blob/master/django/core/serializers/json.py
"""
# Avoid shadowing the standard library json module
from __future__ import absolute_import
from __future__ import unicode_literals
import datetime
import decimal
import json
class JSON262Encoder(json.JSONEncoder):
"""
JSON encoder aiming to be fully compliant with ECMA-262.
"""
def default(self, o):
# See "Date Time String Format" in the ECMA-262 specification.
if isinstance(o, datetime.datetime):
r = o.isoformat()
if o.microsecond:
r = r[:23] + r[26:]
if r.endswith('+00:00'):
r = r[:-6] + 'Z'
return r
elif isinstance(o, datetime.date):
return o.isoformat()
elif isinstance(o, datetime.time):
r = o.isoformat()
if o.microsecond:
r = r[:12]
if r.endswith('+00:00'):
r = r[:-6] + 'Z'
return r
elif isinstance(o, decimal.Decimal):
return str(o)
else:
return super(JSON262Encoder, self).default(o)
|
<commit_before># -*- coding: utf-8 -*-<commit_msg>Bring in encoder from webhooks.<commit_after>
|
# -*- coding: utf-8 -*-
"""
Serialize data to/from JSON
Inspired by https://github.com/django/django/blob/master/django/core/serializers/json.py
"""
# Avoid shadowing the standard library json module
from __future__ import absolute_import
from __future__ import unicode_literals
import datetime
import decimal
import json
class JSON262Encoder(json.JSONEncoder):
"""
JSON encoder aiming to be fully compliant with ECMA-262.
"""
def default(self, o):
# See "Date Time String Format" in the ECMA-262 specification.
if isinstance(o, datetime.datetime):
r = o.isoformat()
if o.microsecond:
r = r[:23] + r[26:]
if r.endswith('+00:00'):
r = r[:-6] + 'Z'
return r
elif isinstance(o, datetime.date):
return o.isoformat()
elif isinstance(o, datetime.time):
r = o.isoformat()
if o.microsecond:
r = r[:12]
if r.endswith('+00:00'):
r = r[:-6] + 'Z'
return r
elif isinstance(o, decimal.Decimal):
return str(o)
else:
return super(JSON262Encoder, self).default(o)
|
# -*- coding: utf-8 -*-Bring in encoder from webhooks.# -*- coding: utf-8 -*-
"""
Serialize data to/from JSON
Inspired by https://github.com/django/django/blob/master/django/core/serializers/json.py
"""
# Avoid shadowing the standard library json module
from __future__ import absolute_import
from __future__ import unicode_literals
import datetime
import decimal
import json
class JSON262Encoder(json.JSONEncoder):
"""
JSON encoder aiming to be fully compliant with ECMA-262.
"""
def default(self, o):
# See "Date Time String Format" in the ECMA-262 specification.
if isinstance(o, datetime.datetime):
r = o.isoformat()
if o.microsecond:
r = r[:23] + r[26:]
if r.endswith('+00:00'):
r = r[:-6] + 'Z'
return r
elif isinstance(o, datetime.date):
return o.isoformat()
elif isinstance(o, datetime.time):
r = o.isoformat()
if o.microsecond:
r = r[:12]
if r.endswith('+00:00'):
r = r[:-6] + 'Z'
return r
elif isinstance(o, decimal.Decimal):
return str(o)
else:
return super(JSON262Encoder, self).default(o)
|
<commit_before># -*- coding: utf-8 -*-<commit_msg>Bring in encoder from webhooks.<commit_after># -*- coding: utf-8 -*-
"""
Serialize data to/from JSON
Inspired by https://github.com/django/django/blob/master/django/core/serializers/json.py
"""
# Avoid shadowing the standard library json module
from __future__ import absolute_import
from __future__ import unicode_literals
import datetime
import decimal
import json
class JSON262Encoder(json.JSONEncoder):
"""
JSON encoder aiming to be fully compliant with ECMA-262.
"""
def default(self, o):
# See "Date Time String Format" in the ECMA-262 specification.
if isinstance(o, datetime.datetime):
r = o.isoformat()
if o.microsecond:
r = r[:23] + r[26:]
if r.endswith('+00:00'):
r = r[:-6] + 'Z'
return r
elif isinstance(o, datetime.date):
return o.isoformat()
elif isinstance(o, datetime.time):
r = o.isoformat()
if o.microsecond:
r = r[:12]
if r.endswith('+00:00'):
r = r[:-6] + 'Z'
return r
elif isinstance(o, decimal.Decimal):
return str(o)
else:
return super(JSON262Encoder, self).default(o)
|
94b716142a575e73d906f332fda84d68b549d5cd
|
trove/tests/unittests/util/util.py
|
trove/tests/unittests/util/util.py
|
# Copyright 2012 OpenStack Foundation
#
# 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.
DB_SETUP = None
def init_db():
global DB_SETUP
if DB_SETUP:
return
from trove.common import cfg
from trove.db import get_db_api
from trove.db.sqlalchemy import session
CONF = cfg.CONF
db_api = get_db_api()
db_api.db_sync(CONF)
session.configure_db(CONF)
DB_SETUP = True
|
# Copyright 2012 OpenStack Foundation
#
# 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.
import threading
from trove.common import cfg
from trove.db import get_db_api
from trove.db.sqlalchemy import session
CONF = cfg.CONF
DB_SETUP = None
LOCK = threading.Lock()
def init_db():
with LOCK:
global DB_SETUP
if not DB_SETUP:
db_api = get_db_api()
db_api.db_sync(CONF)
session.configure_db(CONF)
DB_SETUP = True
|
Fix concurrency issue with Python 3.4 test
|
Fix concurrency issue with Python 3.4 test
We have been seeing failures in parallel Py34
tests caused by the test database being set up more
than once.
The existing mechanism is not thread-safe.
Add a lock around the database setup to ensure
the it is ever executed by only one thread.
Partially implements: blueprint trove-python3
Change-Id: I68aba50d60b912384080911a6f78283f027c4ee3
|
Python
|
apache-2.0
|
zhangg/trove,zhangg/trove,hplustree/trove,openstack/trove,openstack/trove,hplustree/trove
|
# Copyright 2012 OpenStack Foundation
#
# 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.
DB_SETUP = None
def init_db():
global DB_SETUP
if DB_SETUP:
return
from trove.common import cfg
from trove.db import get_db_api
from trove.db.sqlalchemy import session
CONF = cfg.CONF
db_api = get_db_api()
db_api.db_sync(CONF)
session.configure_db(CONF)
DB_SETUP = True
Fix concurrency issue with Python 3.4 test
We have been seeing failures in parallel Py34
tests caused by the test database being set up more
than once.
The existing mechanism is not thread-safe.
Add a lock around the database setup to ensure
the it is ever executed by only one thread.
Partially implements: blueprint trove-python3
Change-Id: I68aba50d60b912384080911a6f78283f027c4ee3
|
# Copyright 2012 OpenStack Foundation
#
# 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.
import threading
from trove.common import cfg
from trove.db import get_db_api
from trove.db.sqlalchemy import session
CONF = cfg.CONF
DB_SETUP = None
LOCK = threading.Lock()
def init_db():
with LOCK:
global DB_SETUP
if not DB_SETUP:
db_api = get_db_api()
db_api.db_sync(CONF)
session.configure_db(CONF)
DB_SETUP = True
|
<commit_before># Copyright 2012 OpenStack Foundation
#
# 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.
DB_SETUP = None
def init_db():
global DB_SETUP
if DB_SETUP:
return
from trove.common import cfg
from trove.db import get_db_api
from trove.db.sqlalchemy import session
CONF = cfg.CONF
db_api = get_db_api()
db_api.db_sync(CONF)
session.configure_db(CONF)
DB_SETUP = True
<commit_msg>Fix concurrency issue with Python 3.4 test
We have been seeing failures in parallel Py34
tests caused by the test database being set up more
than once.
The existing mechanism is not thread-safe.
Add a lock around the database setup to ensure
the it is ever executed by only one thread.
Partially implements: blueprint trove-python3
Change-Id: I68aba50d60b912384080911a6f78283f027c4ee3<commit_after>
|
# Copyright 2012 OpenStack Foundation
#
# 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.
import threading
from trove.common import cfg
from trove.db import get_db_api
from trove.db.sqlalchemy import session
CONF = cfg.CONF
DB_SETUP = None
LOCK = threading.Lock()
def init_db():
with LOCK:
global DB_SETUP
if not DB_SETUP:
db_api = get_db_api()
db_api.db_sync(CONF)
session.configure_db(CONF)
DB_SETUP = True
|
# Copyright 2012 OpenStack Foundation
#
# 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.
DB_SETUP = None
def init_db():
global DB_SETUP
if DB_SETUP:
return
from trove.common import cfg
from trove.db import get_db_api
from trove.db.sqlalchemy import session
CONF = cfg.CONF
db_api = get_db_api()
db_api.db_sync(CONF)
session.configure_db(CONF)
DB_SETUP = True
Fix concurrency issue with Python 3.4 test
We have been seeing failures in parallel Py34
tests caused by the test database being set up more
than once.
The existing mechanism is not thread-safe.
Add a lock around the database setup to ensure
the it is ever executed by only one thread.
Partially implements: blueprint trove-python3
Change-Id: I68aba50d60b912384080911a6f78283f027c4ee3# Copyright 2012 OpenStack Foundation
#
# 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.
import threading
from trove.common import cfg
from trove.db import get_db_api
from trove.db.sqlalchemy import session
CONF = cfg.CONF
DB_SETUP = None
LOCK = threading.Lock()
def init_db():
with LOCK:
global DB_SETUP
if not DB_SETUP:
db_api = get_db_api()
db_api.db_sync(CONF)
session.configure_db(CONF)
DB_SETUP = True
|
<commit_before># Copyright 2012 OpenStack Foundation
#
# 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.
DB_SETUP = None
def init_db():
global DB_SETUP
if DB_SETUP:
return
from trove.common import cfg
from trove.db import get_db_api
from trove.db.sqlalchemy import session
CONF = cfg.CONF
db_api = get_db_api()
db_api.db_sync(CONF)
session.configure_db(CONF)
DB_SETUP = True
<commit_msg>Fix concurrency issue with Python 3.4 test
We have been seeing failures in parallel Py34
tests caused by the test database being set up more
than once.
The existing mechanism is not thread-safe.
Add a lock around the database setup to ensure
the it is ever executed by only one thread.
Partially implements: blueprint trove-python3
Change-Id: I68aba50d60b912384080911a6f78283f027c4ee3<commit_after># Copyright 2012 OpenStack Foundation
#
# 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.
import threading
from trove.common import cfg
from trove.db import get_db_api
from trove.db.sqlalchemy import session
CONF = cfg.CONF
DB_SETUP = None
LOCK = threading.Lock()
def init_db():
with LOCK:
global DB_SETUP
if not DB_SETUP:
db_api = get_db_api()
db_api.db_sync(CONF)
session.configure_db(CONF)
DB_SETUP = True
|
a44c71cf25672606bd866014982b18836acc46ef
|
string/reverse.py
|
string/reverse.py
|
# Reverse each word in a sentence
def reverse_sentence(string, separator):
# string_list = string.split()
# flipped_list = string_list[::-1]
flipped_list = (string.split())[::-1] # split string into list and then reverse order of elements in list
output = separator.join(flipped_list)
print output
|
# Reverse each word in a sentence
def reverse_sentence(string):
string_list = string.split() # split string by word into list
output = ' '.join([word[::-1] for word in string_list]) # reverse each element/word in list and consolidate into single string
print output
# test cases
test = "Hey dude!"
reverse_sentence(test)
test2 = "dude"
reverse_sentence(test2)
|
Debug method and add test cases
|
Debug method and add test cases
|
Python
|
mit
|
derekmpham/interview-prep,derekmpham/interview-prep
|
# Reverse each word in a sentence
def reverse_sentence(string, separator):
# string_list = string.split()
# flipped_list = string_list[::-1]
flipped_list = (string.split())[::-1] # split string into list and then reverse order of elements in list
output = separator.join(flipped_list)
print output
Debug method and add test cases
|
# Reverse each word in a sentence
def reverse_sentence(string):
string_list = string.split() # split string by word into list
output = ' '.join([word[::-1] for word in string_list]) # reverse each element/word in list and consolidate into single string
print output
# test cases
test = "Hey dude!"
reverse_sentence(test)
test2 = "dude"
reverse_sentence(test2)
|
<commit_before># Reverse each word in a sentence
def reverse_sentence(string, separator):
# string_list = string.split()
# flipped_list = string_list[::-1]
flipped_list = (string.split())[::-1] # split string into list and then reverse order of elements in list
output = separator.join(flipped_list)
print output
<commit_msg>Debug method and add test cases<commit_after>
|
# Reverse each word in a sentence
def reverse_sentence(string):
string_list = string.split() # split string by word into list
output = ' '.join([word[::-1] for word in string_list]) # reverse each element/word in list and consolidate into single string
print output
# test cases
test = "Hey dude!"
reverse_sentence(test)
test2 = "dude"
reverse_sentence(test2)
|
# Reverse each word in a sentence
def reverse_sentence(string, separator):
# string_list = string.split()
# flipped_list = string_list[::-1]
flipped_list = (string.split())[::-1] # split string into list and then reverse order of elements in list
output = separator.join(flipped_list)
print output
Debug method and add test cases# Reverse each word in a sentence
def reverse_sentence(string):
string_list = string.split() # split string by word into list
output = ' '.join([word[::-1] for word in string_list]) # reverse each element/word in list and consolidate into single string
print output
# test cases
test = "Hey dude!"
reverse_sentence(test)
test2 = "dude"
reverse_sentence(test2)
|
<commit_before># Reverse each word in a sentence
def reverse_sentence(string, separator):
# string_list = string.split()
# flipped_list = string_list[::-1]
flipped_list = (string.split())[::-1] # split string into list and then reverse order of elements in list
output = separator.join(flipped_list)
print output
<commit_msg>Debug method and add test cases<commit_after># Reverse each word in a sentence
def reverse_sentence(string):
string_list = string.split() # split string by word into list
output = ' '.join([word[::-1] for word in string_list]) # reverse each element/word in list and consolidate into single string
print output
# test cases
test = "Hey dude!"
reverse_sentence(test)
test2 = "dude"
reverse_sentence(test2)
|
641b1e0c78da6459a43516fc23c5dc388fe2d273
|
swift/__init__.py
|
swift/__init__.py
|
import gettext
class Version(object):
def __init__(self, canonical_version, final):
self.canonical_version = canonical_version
self.final = final
@property
def pretty_version(self):
if self.final:
return self.canonical_version
else:
return '%s-dev' % (self.canonical_version,)
_version = Version('1.4.10', False)
__version__ = _version.pretty_version
__canonical_version__ = _version.canonical_version
gettext.install('swift')
|
import gettext
class Version(object):
def __init__(self, canonical_version, final):
self.canonical_version = canonical_version
self.final = final
@property
def pretty_version(self):
if self.final:
return self.canonical_version
else:
return '%s-dev' % (self.canonical_version,)
_version = Version('1.4.9', False)
__version__ = _version.pretty_version
__canonical_version__ = _version.canonical_version
gettext.install('swift')
|
Revert "version bump to 1.4.10"
|
Revert "version bump to 1.4.10"
This reverts commit e4ab8f004c0c4a8b631d0de77b72d85d5fdba221.
Change-Id: Id8262405acec0f13314f27fbac02bd3cded60789
|
Python
|
apache-2.0
|
eatbyte/Swift,prashanthpai/swift,notmyname/swift,matthewoliver/swift,Seagate/swift,bkolli/swift,prashanthpai/swift,smerritt/swift,Akanoa/swift,matthewoliver/swift,notmyname/swift,citrix-openstack-build/swift,dpgoetz/swift,larsbutler/swift,clayg/swift,iostackproject/IO-Bandwidth-Differentiation,mjzmjz/swift,daasbank/swift,JioCloud/swift,bkolli/swift,hurricanerix/swift,notmyname/swift,williamthegrey/swift,redbo/swift,bouncestorage/swift,openstack/swift,openstack/swift,bradleypj823/swift,xiaoguoai/ec-dev-swift,JioCloud/swift,psachin/swift,Triv90/SwiftUml,zackmdavis/swift,clayg/swift,maginatics/swift,hbhdytf/mac,Mirantis/swift-encrypt,levythu/swift,hbhdytf/mac2,anishnarang/gswift,tipabu/swift,Akanoa/swift,hurricanerix/swift,scality/ScalitySproxydSwift,NeCTAR-RC/swift,VictorLowther/swift,daasbank/swift,larsbutler/swift,openstack/swift,Seagate/swift,Em-Pan/swift,dencaval/swift,NewpTone/StackLab-swift,smerritt/swift,maginatics/swift,bouncestorage/swift,dpgoetz/swift,swiftstack/swift,psachin/swift,hbhdytf/mac2,smerritt/swift,levythu/swift,xiaoguoai/ec-dev-swift,IPVL/swift-kilo,anishnarang/gswift,takeshineshiro/swift,wenhuizhang/swift,bradleypj823/swift,AfonsoFGarcia/swift,Triv90/SwiftUml,hbhdytf/mac,redhat-openstack/swift,thiagodasilva/swift,nadeemsyed/swift,nadeemsyed/swift,clayg/swift,swiftstack/swift,sarvesh-ranjan/swift,AfonsoFGarcia/swift,NewpTone/StackLab-swift,psachin/swift,hurricanerix/swift,openstack/swift,citrix-openstack/build-swift,dencaval/swift,tsli/test,NeCTAR-RC/swift,orion/swift-config,shibaniahegde/OpenStak_swift,revoer/keystone-8.0.0,iostackproject/IO-Bandwidth-Differentiation,matthewoliver/swift,orion/swift-config,gold3bear/swift,Mirantis/swift-encrypt,Em-Pan/swift,wenhuizhang/swift,takeshineshiro/swift,redbo/swift,tipabu/swift,williamthegrey/swift,gold3bear/swift,hbhdytf/mac2,eatbyte/Swift,hurricanerix/swift,aerwin3/swift,thiagodasilva/swift,zackmdavis/swift,sarvesh-ranjan/swift,Khushbu27/Tutorial,mjwtom/swift,nadeemsyed/swift,zaitcev/swift-lfs,notmyname/swift,citrix-openstack-build/swift,IPVL/swift-kilo,psachin/swift,tipabu/swift,VictorLowther/swift,aerwin3/swift,redhat-openstack/swift,rackerlabs/swift,Khushbu27/Tutorial,swiftstack/swift,clayg/swift,revoer/keystone-8.0.0,mjwtom/swift,tsli/test,nadeemsyed/swift,smerritt/swift,mjzmjz/swift,rackerlabs/swift,citrix-openstack/build-swift,zaitcev/swift-lfs,matthewoliver/swift,shibaniahegde/OpenStak_swift,scality/ScalitySproxydSwift,tipabu/swift,hbhdytf/mac2
|
import gettext
class Version(object):
def __init__(self, canonical_version, final):
self.canonical_version = canonical_version
self.final = final
@property
def pretty_version(self):
if self.final:
return self.canonical_version
else:
return '%s-dev' % (self.canonical_version,)
_version = Version('1.4.10', False)
__version__ = _version.pretty_version
__canonical_version__ = _version.canonical_version
gettext.install('swift')
Revert "version bump to 1.4.10"
This reverts commit e4ab8f004c0c4a8b631d0de77b72d85d5fdba221.
Change-Id: Id8262405acec0f13314f27fbac02bd3cded60789
|
import gettext
class Version(object):
def __init__(self, canonical_version, final):
self.canonical_version = canonical_version
self.final = final
@property
def pretty_version(self):
if self.final:
return self.canonical_version
else:
return '%s-dev' % (self.canonical_version,)
_version = Version('1.4.9', False)
__version__ = _version.pretty_version
__canonical_version__ = _version.canonical_version
gettext.install('swift')
|
<commit_before>import gettext
class Version(object):
def __init__(self, canonical_version, final):
self.canonical_version = canonical_version
self.final = final
@property
def pretty_version(self):
if self.final:
return self.canonical_version
else:
return '%s-dev' % (self.canonical_version,)
_version = Version('1.4.10', False)
__version__ = _version.pretty_version
__canonical_version__ = _version.canonical_version
gettext.install('swift')
<commit_msg>Revert "version bump to 1.4.10"
This reverts commit e4ab8f004c0c4a8b631d0de77b72d85d5fdba221.
Change-Id: Id8262405acec0f13314f27fbac02bd3cded60789<commit_after>
|
import gettext
class Version(object):
def __init__(self, canonical_version, final):
self.canonical_version = canonical_version
self.final = final
@property
def pretty_version(self):
if self.final:
return self.canonical_version
else:
return '%s-dev' % (self.canonical_version,)
_version = Version('1.4.9', False)
__version__ = _version.pretty_version
__canonical_version__ = _version.canonical_version
gettext.install('swift')
|
import gettext
class Version(object):
def __init__(self, canonical_version, final):
self.canonical_version = canonical_version
self.final = final
@property
def pretty_version(self):
if self.final:
return self.canonical_version
else:
return '%s-dev' % (self.canonical_version,)
_version = Version('1.4.10', False)
__version__ = _version.pretty_version
__canonical_version__ = _version.canonical_version
gettext.install('swift')
Revert "version bump to 1.4.10"
This reverts commit e4ab8f004c0c4a8b631d0de77b72d85d5fdba221.
Change-Id: Id8262405acec0f13314f27fbac02bd3cded60789import gettext
class Version(object):
def __init__(self, canonical_version, final):
self.canonical_version = canonical_version
self.final = final
@property
def pretty_version(self):
if self.final:
return self.canonical_version
else:
return '%s-dev' % (self.canonical_version,)
_version = Version('1.4.9', False)
__version__ = _version.pretty_version
__canonical_version__ = _version.canonical_version
gettext.install('swift')
|
<commit_before>import gettext
class Version(object):
def __init__(self, canonical_version, final):
self.canonical_version = canonical_version
self.final = final
@property
def pretty_version(self):
if self.final:
return self.canonical_version
else:
return '%s-dev' % (self.canonical_version,)
_version = Version('1.4.10', False)
__version__ = _version.pretty_version
__canonical_version__ = _version.canonical_version
gettext.install('swift')
<commit_msg>Revert "version bump to 1.4.10"
This reverts commit e4ab8f004c0c4a8b631d0de77b72d85d5fdba221.
Change-Id: Id8262405acec0f13314f27fbac02bd3cded60789<commit_after>import gettext
class Version(object):
def __init__(self, canonical_version, final):
self.canonical_version = canonical_version
self.final = final
@property
def pretty_version(self):
if self.final:
return self.canonical_version
else:
return '%s-dev' % (self.canonical_version,)
_version = Version('1.4.9', False)
__version__ = _version.pretty_version
__canonical_version__ = _version.canonical_version
gettext.install('swift')
|
d029c67f59ce65f9ad651b2e261e7f29ef8c2ca2
|
sync_scheduler.py
|
sync_scheduler.py
|
from tapiriik.database import db
from tapiriik.messagequeue import mq
import kombu
from datetime import datetime
import time
channel = mq.channel()
exchange = kombu.Exchange("tapiriik-users", type="direct")(channel)
exchange.declare()
producer = kombu.Producer(channel, exchange)
while True:
queueing_at = datetime.utcnow()
users = db.users.find(
{
"NextSynchronization": {"$lte": datetime.utcnow()}
},
{
"_id": True,
"SynchronizationHostRestriction": True
}
).sort("NextSynchronization")
scheduled_ids = set()
for user in users:
producer.publish(str(user["_id"]), routing_key=user["SynchronizationHostRestriction"] if "SynchronizationHostRestriction" in user and user["SynchronizationHostRestriction"] else "")
scheduled_ids.add(user["_id"])
print("Scheduled %d users at %s" % (len(scheduled_ids), datetime.utcnow()))
db.users.update({"_id": {"$in": list(scheduled_ids)}}, {"$set": {"QueuedAt": queueing_at}, "$unset": {"NextSynchronization": True}}, multi=True)
time.sleep(1)
|
from tapiriik.database import db
from tapiriik.messagequeue import mq
from tapiriik.sync import Sync
import kombu
from datetime import datetime
import time
Sync.InitializeWorkerBindings()
producer = kombu.Producer(Sync._channel, Sync._exchange)
while True:
queueing_at = datetime.utcnow()
users = db.users.find(
{
"NextSynchronization": {"$lte": datetime.utcnow()}
},
{
"_id": True,
"SynchronizationHostRestriction": True
}
).sort("NextSynchronization")
scheduled_ids = set()
for user in users:
producer.publish(str(user["_id"]), routing_key=user["SynchronizationHostRestriction"] if "SynchronizationHostRestriction" in user and user["SynchronizationHostRestriction"] else "")
scheduled_ids.add(user["_id"])
print("Scheduled %d users at %s" % (len(scheduled_ids), datetime.utcnow()))
db.users.update({"_id": {"$in": list(scheduled_ids)}}, {"$set": {"QueuedAt": queueing_at}, "$unset": {"NextSynchronization": True}}, multi=True)
time.sleep(1)
|
Declare relevant queues in sync scheduler
|
Declare relevant queues in sync scheduler
|
Python
|
apache-2.0
|
campbellr/tapiriik,niosus/tapiriik,dlenski/tapiriik,niosus/tapiriik,cmgrote/tapiriik,gavioto/tapiriik,cpfair/tapiriik,cpfair/tapiriik,abhijit86k/tapiriik,cheatos101/tapiriik,abhijit86k/tapiriik,niosus/tapiriik,cmgrote/tapiriik,dmschreiber/tapiriik,brunoflores/tapiriik,marxin/tapiriik,campbellr/tapiriik,cgourlay/tapiriik,abs0/tapiriik,brunoflores/tapiriik,campbellr/tapiriik,mjnbike/tapiriik,cgourlay/tapiriik,cheatos101/tapiriik,cmgrote/tapiriik,brunoflores/tapiriik,dlenski/tapiriik,cheatos101/tapiriik,mjnbike/tapiriik,mduggan/tapiriik,campbellr/tapiriik,cgourlay/tapiriik,cmgrote/tapiriik,brunoflores/tapiriik,dmschreiber/tapiriik,niosus/tapiriik,cgourlay/tapiriik,olamy/tapiriik,dlenski/tapiriik,mduggan/tapiriik,mjnbike/tapiriik,abhijit86k/tapiriik,olamy/tapiriik,olamy/tapiriik,gavioto/tapiriik,gavioto/tapiriik,cpfair/tapiriik,marxin/tapiriik,cpfair/tapiriik,abs0/tapiriik,abhijit86k/tapiriik,cheatos101/tapiriik,olamy/tapiriik,mduggan/tapiriik,dmschreiber/tapiriik,abs0/tapiriik,dlenski/tapiriik,gavioto/tapiriik,mduggan/tapiriik,mjnbike/tapiriik,marxin/tapiriik,marxin/tapiriik,abs0/tapiriik,dmschreiber/tapiriik
|
from tapiriik.database import db
from tapiriik.messagequeue import mq
import kombu
from datetime import datetime
import time
channel = mq.channel()
exchange = kombu.Exchange("tapiriik-users", type="direct")(channel)
exchange.declare()
producer = kombu.Producer(channel, exchange)
while True:
queueing_at = datetime.utcnow()
users = db.users.find(
{
"NextSynchronization": {"$lte": datetime.utcnow()}
},
{
"_id": True,
"SynchronizationHostRestriction": True
}
).sort("NextSynchronization")
scheduled_ids = set()
for user in users:
producer.publish(str(user["_id"]), routing_key=user["SynchronizationHostRestriction"] if "SynchronizationHostRestriction" in user and user["SynchronizationHostRestriction"] else "")
scheduled_ids.add(user["_id"])
print("Scheduled %d users at %s" % (len(scheduled_ids), datetime.utcnow()))
db.users.update({"_id": {"$in": list(scheduled_ids)}}, {"$set": {"QueuedAt": queueing_at}, "$unset": {"NextSynchronization": True}}, multi=True)
time.sleep(1)
Declare relevant queues in sync scheduler
|
from tapiriik.database import db
from tapiriik.messagequeue import mq
from tapiriik.sync import Sync
import kombu
from datetime import datetime
import time
Sync.InitializeWorkerBindings()
producer = kombu.Producer(Sync._channel, Sync._exchange)
while True:
queueing_at = datetime.utcnow()
users = db.users.find(
{
"NextSynchronization": {"$lte": datetime.utcnow()}
},
{
"_id": True,
"SynchronizationHostRestriction": True
}
).sort("NextSynchronization")
scheduled_ids = set()
for user in users:
producer.publish(str(user["_id"]), routing_key=user["SynchronizationHostRestriction"] if "SynchronizationHostRestriction" in user and user["SynchronizationHostRestriction"] else "")
scheduled_ids.add(user["_id"])
print("Scheduled %d users at %s" % (len(scheduled_ids), datetime.utcnow()))
db.users.update({"_id": {"$in": list(scheduled_ids)}}, {"$set": {"QueuedAt": queueing_at}, "$unset": {"NextSynchronization": True}}, multi=True)
time.sleep(1)
|
<commit_before>from tapiriik.database import db
from tapiriik.messagequeue import mq
import kombu
from datetime import datetime
import time
channel = mq.channel()
exchange = kombu.Exchange("tapiriik-users", type="direct")(channel)
exchange.declare()
producer = kombu.Producer(channel, exchange)
while True:
queueing_at = datetime.utcnow()
users = db.users.find(
{
"NextSynchronization": {"$lte": datetime.utcnow()}
},
{
"_id": True,
"SynchronizationHostRestriction": True
}
).sort("NextSynchronization")
scheduled_ids = set()
for user in users:
producer.publish(str(user["_id"]), routing_key=user["SynchronizationHostRestriction"] if "SynchronizationHostRestriction" in user and user["SynchronizationHostRestriction"] else "")
scheduled_ids.add(user["_id"])
print("Scheduled %d users at %s" % (len(scheduled_ids), datetime.utcnow()))
db.users.update({"_id": {"$in": list(scheduled_ids)}}, {"$set": {"QueuedAt": queueing_at}, "$unset": {"NextSynchronization": True}}, multi=True)
time.sleep(1)
<commit_msg>Declare relevant queues in sync scheduler<commit_after>
|
from tapiriik.database import db
from tapiriik.messagequeue import mq
from tapiriik.sync import Sync
import kombu
from datetime import datetime
import time
Sync.InitializeWorkerBindings()
producer = kombu.Producer(Sync._channel, Sync._exchange)
while True:
queueing_at = datetime.utcnow()
users = db.users.find(
{
"NextSynchronization": {"$lte": datetime.utcnow()}
},
{
"_id": True,
"SynchronizationHostRestriction": True
}
).sort("NextSynchronization")
scheduled_ids = set()
for user in users:
producer.publish(str(user["_id"]), routing_key=user["SynchronizationHostRestriction"] if "SynchronizationHostRestriction" in user and user["SynchronizationHostRestriction"] else "")
scheduled_ids.add(user["_id"])
print("Scheduled %d users at %s" % (len(scheduled_ids), datetime.utcnow()))
db.users.update({"_id": {"$in": list(scheduled_ids)}}, {"$set": {"QueuedAt": queueing_at}, "$unset": {"NextSynchronization": True}}, multi=True)
time.sleep(1)
|
from tapiriik.database import db
from tapiriik.messagequeue import mq
import kombu
from datetime import datetime
import time
channel = mq.channel()
exchange = kombu.Exchange("tapiriik-users", type="direct")(channel)
exchange.declare()
producer = kombu.Producer(channel, exchange)
while True:
queueing_at = datetime.utcnow()
users = db.users.find(
{
"NextSynchronization": {"$lte": datetime.utcnow()}
},
{
"_id": True,
"SynchronizationHostRestriction": True
}
).sort("NextSynchronization")
scheduled_ids = set()
for user in users:
producer.publish(str(user["_id"]), routing_key=user["SynchronizationHostRestriction"] if "SynchronizationHostRestriction" in user and user["SynchronizationHostRestriction"] else "")
scheduled_ids.add(user["_id"])
print("Scheduled %d users at %s" % (len(scheduled_ids), datetime.utcnow()))
db.users.update({"_id": {"$in": list(scheduled_ids)}}, {"$set": {"QueuedAt": queueing_at}, "$unset": {"NextSynchronization": True}}, multi=True)
time.sleep(1)
Declare relevant queues in sync schedulerfrom tapiriik.database import db
from tapiriik.messagequeue import mq
from tapiriik.sync import Sync
import kombu
from datetime import datetime
import time
Sync.InitializeWorkerBindings()
producer = kombu.Producer(Sync._channel, Sync._exchange)
while True:
queueing_at = datetime.utcnow()
users = db.users.find(
{
"NextSynchronization": {"$lte": datetime.utcnow()}
},
{
"_id": True,
"SynchronizationHostRestriction": True
}
).sort("NextSynchronization")
scheduled_ids = set()
for user in users:
producer.publish(str(user["_id"]), routing_key=user["SynchronizationHostRestriction"] if "SynchronizationHostRestriction" in user and user["SynchronizationHostRestriction"] else "")
scheduled_ids.add(user["_id"])
print("Scheduled %d users at %s" % (len(scheduled_ids), datetime.utcnow()))
db.users.update({"_id": {"$in": list(scheduled_ids)}}, {"$set": {"QueuedAt": queueing_at}, "$unset": {"NextSynchronization": True}}, multi=True)
time.sleep(1)
|
<commit_before>from tapiriik.database import db
from tapiriik.messagequeue import mq
import kombu
from datetime import datetime
import time
channel = mq.channel()
exchange = kombu.Exchange("tapiriik-users", type="direct")(channel)
exchange.declare()
producer = kombu.Producer(channel, exchange)
while True:
queueing_at = datetime.utcnow()
users = db.users.find(
{
"NextSynchronization": {"$lte": datetime.utcnow()}
},
{
"_id": True,
"SynchronizationHostRestriction": True
}
).sort("NextSynchronization")
scheduled_ids = set()
for user in users:
producer.publish(str(user["_id"]), routing_key=user["SynchronizationHostRestriction"] if "SynchronizationHostRestriction" in user and user["SynchronizationHostRestriction"] else "")
scheduled_ids.add(user["_id"])
print("Scheduled %d users at %s" % (len(scheduled_ids), datetime.utcnow()))
db.users.update({"_id": {"$in": list(scheduled_ids)}}, {"$set": {"QueuedAt": queueing_at}, "$unset": {"NextSynchronization": True}}, multi=True)
time.sleep(1)
<commit_msg>Declare relevant queues in sync scheduler<commit_after>from tapiriik.database import db
from tapiriik.messagequeue import mq
from tapiriik.sync import Sync
import kombu
from datetime import datetime
import time
Sync.InitializeWorkerBindings()
producer = kombu.Producer(Sync._channel, Sync._exchange)
while True:
queueing_at = datetime.utcnow()
users = db.users.find(
{
"NextSynchronization": {"$lte": datetime.utcnow()}
},
{
"_id": True,
"SynchronizationHostRestriction": True
}
).sort("NextSynchronization")
scheduled_ids = set()
for user in users:
producer.publish(str(user["_id"]), routing_key=user["SynchronizationHostRestriction"] if "SynchronizationHostRestriction" in user and user["SynchronizationHostRestriction"] else "")
scheduled_ids.add(user["_id"])
print("Scheduled %d users at %s" % (len(scheduled_ids), datetime.utcnow()))
db.users.update({"_id": {"$in": list(scheduled_ids)}}, {"$set": {"QueuedAt": queueing_at}, "$unset": {"NextSynchronization": True}}, multi=True)
time.sleep(1)
|
8322c776fe989d65f83beaefff5089716d0286e7
|
test/test_pydh.py
|
test/test_pydh.py
|
import pyDH
def test_pydh_keygen():
d1 = pyDH.DiffieHellman()
d2 = pyDH.DiffieHellman()
d1_pubkey = d1.gen_public_key()
d2_pubkey = d2.gen_public_key()
d1_sharedkey = d1.gen_shared_key(d2_pubkey)
d2_sharedkey = d2.gen_shared_key(d1_pubkey)
assert d1_sharedkey == d2_sharedkey
|
import sys
sys.path.append('.')
import pyDH
def test_pydh_keygen():
d1 = pyDH.DiffieHellman()
d2 = pyDH.DiffieHellman()
d1_pubkey = d1.gen_public_key()
d2_pubkey = d2.gen_public_key()
d1_sharedkey = d1.gen_shared_key(d2_pubkey)
d2_sharedkey = d2.gen_shared_key(d1_pubkey)
assert d1_sharedkey == d2_sharedkey
|
Add current dir to Python path
|
Add current dir to Python path
|
Python
|
apache-2.0
|
amiralis/pyDH
|
import pyDH
def test_pydh_keygen():
d1 = pyDH.DiffieHellman()
d2 = pyDH.DiffieHellman()
d1_pubkey = d1.gen_public_key()
d2_pubkey = d2.gen_public_key()
d1_sharedkey = d1.gen_shared_key(d2_pubkey)
d2_sharedkey = d2.gen_shared_key(d1_pubkey)
assert d1_sharedkey == d2_sharedkeyAdd current dir to Python path
|
import sys
sys.path.append('.')
import pyDH
def test_pydh_keygen():
d1 = pyDH.DiffieHellman()
d2 = pyDH.DiffieHellman()
d1_pubkey = d1.gen_public_key()
d2_pubkey = d2.gen_public_key()
d1_sharedkey = d1.gen_shared_key(d2_pubkey)
d2_sharedkey = d2.gen_shared_key(d1_pubkey)
assert d1_sharedkey == d2_sharedkey
|
<commit_before>import pyDH
def test_pydh_keygen():
d1 = pyDH.DiffieHellman()
d2 = pyDH.DiffieHellman()
d1_pubkey = d1.gen_public_key()
d2_pubkey = d2.gen_public_key()
d1_sharedkey = d1.gen_shared_key(d2_pubkey)
d2_sharedkey = d2.gen_shared_key(d1_pubkey)
assert d1_sharedkey == d2_sharedkey<commit_msg>Add current dir to Python path<commit_after>
|
import sys
sys.path.append('.')
import pyDH
def test_pydh_keygen():
d1 = pyDH.DiffieHellman()
d2 = pyDH.DiffieHellman()
d1_pubkey = d1.gen_public_key()
d2_pubkey = d2.gen_public_key()
d1_sharedkey = d1.gen_shared_key(d2_pubkey)
d2_sharedkey = d2.gen_shared_key(d1_pubkey)
assert d1_sharedkey == d2_sharedkey
|
import pyDH
def test_pydh_keygen():
d1 = pyDH.DiffieHellman()
d2 = pyDH.DiffieHellman()
d1_pubkey = d1.gen_public_key()
d2_pubkey = d2.gen_public_key()
d1_sharedkey = d1.gen_shared_key(d2_pubkey)
d2_sharedkey = d2.gen_shared_key(d1_pubkey)
assert d1_sharedkey == d2_sharedkeyAdd current dir to Python pathimport sys
sys.path.append('.')
import pyDH
def test_pydh_keygen():
d1 = pyDH.DiffieHellman()
d2 = pyDH.DiffieHellman()
d1_pubkey = d1.gen_public_key()
d2_pubkey = d2.gen_public_key()
d1_sharedkey = d1.gen_shared_key(d2_pubkey)
d2_sharedkey = d2.gen_shared_key(d1_pubkey)
assert d1_sharedkey == d2_sharedkey
|
<commit_before>import pyDH
def test_pydh_keygen():
d1 = pyDH.DiffieHellman()
d2 = pyDH.DiffieHellman()
d1_pubkey = d1.gen_public_key()
d2_pubkey = d2.gen_public_key()
d1_sharedkey = d1.gen_shared_key(d2_pubkey)
d2_sharedkey = d2.gen_shared_key(d1_pubkey)
assert d1_sharedkey == d2_sharedkey<commit_msg>Add current dir to Python path<commit_after>import sys
sys.path.append('.')
import pyDH
def test_pydh_keygen():
d1 = pyDH.DiffieHellman()
d2 = pyDH.DiffieHellman()
d1_pubkey = d1.gen_public_key()
d2_pubkey = d2.gen_public_key()
d1_sharedkey = d1.gen_shared_key(d2_pubkey)
d2_sharedkey = d2.gen_shared_key(d1_pubkey)
assert d1_sharedkey == d2_sharedkey
|
3b127af586ccfeb785a16ef432af8ce52c08a7e4
|
web3/apps/request/urls.py
|
web3/apps/request/urls.py
|
from django.conf.urls import url
from . import views
urlpatterns = [
url("^$", views.request_view, name="request_site"),
url("^approve$", views.approve_view, name="approve_site"),
url("^admin$", views.approve_admin_view, name="admin_site")
]
|
from django.conf.urls import url
from . import views
urlpatterns = [
url(r"^$", views.request_view, name="request_site"),
url(r"^approve$", views.approve_view, name="approve_site"),
url(r"^admin$", views.approve_admin_view, name="admin_site")
]
|
Use r-strings for URL regexes
|
Use r-strings for URL regexes
|
Python
|
mit
|
tjcsl/director,tjcsl/director,tjcsl/director,tjcsl/director
|
from django.conf.urls import url
from . import views
urlpatterns = [
url("^$", views.request_view, name="request_site"),
url("^approve$", views.approve_view, name="approve_site"),
url("^admin$", views.approve_admin_view, name="admin_site")
]
Use r-strings for URL regexes
|
from django.conf.urls import url
from . import views
urlpatterns = [
url(r"^$", views.request_view, name="request_site"),
url(r"^approve$", views.approve_view, name="approve_site"),
url(r"^admin$", views.approve_admin_view, name="admin_site")
]
|
<commit_before>from django.conf.urls import url
from . import views
urlpatterns = [
url("^$", views.request_view, name="request_site"),
url("^approve$", views.approve_view, name="approve_site"),
url("^admin$", views.approve_admin_view, name="admin_site")
]
<commit_msg>Use r-strings for URL regexes<commit_after>
|
from django.conf.urls import url
from . import views
urlpatterns = [
url(r"^$", views.request_view, name="request_site"),
url(r"^approve$", views.approve_view, name="approve_site"),
url(r"^admin$", views.approve_admin_view, name="admin_site")
]
|
from django.conf.urls import url
from . import views
urlpatterns = [
url("^$", views.request_view, name="request_site"),
url("^approve$", views.approve_view, name="approve_site"),
url("^admin$", views.approve_admin_view, name="admin_site")
]
Use r-strings for URL regexesfrom django.conf.urls import url
from . import views
urlpatterns = [
url(r"^$", views.request_view, name="request_site"),
url(r"^approve$", views.approve_view, name="approve_site"),
url(r"^admin$", views.approve_admin_view, name="admin_site")
]
|
<commit_before>from django.conf.urls import url
from . import views
urlpatterns = [
url("^$", views.request_view, name="request_site"),
url("^approve$", views.approve_view, name="approve_site"),
url("^admin$", views.approve_admin_view, name="admin_site")
]
<commit_msg>Use r-strings for URL regexes<commit_after>from django.conf.urls import url
from . import views
urlpatterns = [
url(r"^$", views.request_view, name="request_site"),
url(r"^approve$", views.approve_view, name="approve_site"),
url(r"^admin$", views.approve_admin_view, name="admin_site")
]
|
4e309e7f70760e400dc7150b34e7f86c4c5643b4
|
golddust/packages.py
|
golddust/packages.py
|
# Copyright 2015-2017 John "LuaMilkshake" Marion
#
# 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.
"""GoldDust Packages Classes/Utilities
"""
class Package:
"""A package managed by GoldDust"""
def __init__(self):
self.name = ""
self.version = ""
@property
def tarball(self):
"""The tarball file name for this package."""
return "{}-{}.tar.bz2".format(self.name, self.version)
@property
def sig_file(self):
"""The detached signature file name for this package."""
return "{}.sig".format(self.tarball)
class InstallScript:
"""Package pre/post install action script.
"""
def pre_install(self):
"""Called before any files are installed.
"""
pass
def post_install(self):
"""Called after files are installed.
"""
pass
|
# Copyright 2015-2017 John "LuaMilkshake" Marion
#
# 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.
"""GoldDust Packages Classes/Utilities
"""
class Package:
"""A package managed by GoldDust"""
def __init__(self):
self.name = ""
self.version = ""
@property
def tarball(self):
"""The tarball file name for this package."""
return "{}-{}.tar.bz2".format(self.name, self.version)
@property
def sig_file(self):
"""The detached signature file name for this package."""
return "{}.sig".format(self.tarball)
class InstallScript:
"""Package pre/post install action script.
These functions are used to perform extra work beyond extracting
files.
Note that JAR modification should only be done using the `munge_jar`
function. This lets GoldDust know that you're modifying the JAR so it
can properly handle other JAR mod packages as well.
"""
def pre_install(self):
"""Called before any files are installed.
"""
pass
def munge_jar(self, jar):
"""Modify the Minecraft JAR file.
"""
pass
def post_install(self):
"""Called after files are installed.
"""
pass
|
Add munge_jar stub for InstallScript
|
Add munge_jar stub for InstallScript
|
Python
|
apache-2.0
|
Packeteers/GoldDust
|
# Copyright 2015-2017 John "LuaMilkshake" Marion
#
# 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.
"""GoldDust Packages Classes/Utilities
"""
class Package:
"""A package managed by GoldDust"""
def __init__(self):
self.name = ""
self.version = ""
@property
def tarball(self):
"""The tarball file name for this package."""
return "{}-{}.tar.bz2".format(self.name, self.version)
@property
def sig_file(self):
"""The detached signature file name for this package."""
return "{}.sig".format(self.tarball)
class InstallScript:
"""Package pre/post install action script.
"""
def pre_install(self):
"""Called before any files are installed.
"""
pass
def post_install(self):
"""Called after files are installed.
"""
pass
Add munge_jar stub for InstallScript
|
# Copyright 2015-2017 John "LuaMilkshake" Marion
#
# 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.
"""GoldDust Packages Classes/Utilities
"""
class Package:
"""A package managed by GoldDust"""
def __init__(self):
self.name = ""
self.version = ""
@property
def tarball(self):
"""The tarball file name for this package."""
return "{}-{}.tar.bz2".format(self.name, self.version)
@property
def sig_file(self):
"""The detached signature file name for this package."""
return "{}.sig".format(self.tarball)
class InstallScript:
"""Package pre/post install action script.
These functions are used to perform extra work beyond extracting
files.
Note that JAR modification should only be done using the `munge_jar`
function. This lets GoldDust know that you're modifying the JAR so it
can properly handle other JAR mod packages as well.
"""
def pre_install(self):
"""Called before any files are installed.
"""
pass
def munge_jar(self, jar):
"""Modify the Minecraft JAR file.
"""
pass
def post_install(self):
"""Called after files are installed.
"""
pass
|
<commit_before># Copyright 2015-2017 John "LuaMilkshake" Marion
#
# 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.
"""GoldDust Packages Classes/Utilities
"""
class Package:
"""A package managed by GoldDust"""
def __init__(self):
self.name = ""
self.version = ""
@property
def tarball(self):
"""The tarball file name for this package."""
return "{}-{}.tar.bz2".format(self.name, self.version)
@property
def sig_file(self):
"""The detached signature file name for this package."""
return "{}.sig".format(self.tarball)
class InstallScript:
"""Package pre/post install action script.
"""
def pre_install(self):
"""Called before any files are installed.
"""
pass
def post_install(self):
"""Called after files are installed.
"""
pass
<commit_msg>Add munge_jar stub for InstallScript<commit_after>
|
# Copyright 2015-2017 John "LuaMilkshake" Marion
#
# 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.
"""GoldDust Packages Classes/Utilities
"""
class Package:
"""A package managed by GoldDust"""
def __init__(self):
self.name = ""
self.version = ""
@property
def tarball(self):
"""The tarball file name for this package."""
return "{}-{}.tar.bz2".format(self.name, self.version)
@property
def sig_file(self):
"""The detached signature file name for this package."""
return "{}.sig".format(self.tarball)
class InstallScript:
"""Package pre/post install action script.
These functions are used to perform extra work beyond extracting
files.
Note that JAR modification should only be done using the `munge_jar`
function. This lets GoldDust know that you're modifying the JAR so it
can properly handle other JAR mod packages as well.
"""
def pre_install(self):
"""Called before any files are installed.
"""
pass
def munge_jar(self, jar):
"""Modify the Minecraft JAR file.
"""
pass
def post_install(self):
"""Called after files are installed.
"""
pass
|
# Copyright 2015-2017 John "LuaMilkshake" Marion
#
# 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.
"""GoldDust Packages Classes/Utilities
"""
class Package:
"""A package managed by GoldDust"""
def __init__(self):
self.name = ""
self.version = ""
@property
def tarball(self):
"""The tarball file name for this package."""
return "{}-{}.tar.bz2".format(self.name, self.version)
@property
def sig_file(self):
"""The detached signature file name for this package."""
return "{}.sig".format(self.tarball)
class InstallScript:
"""Package pre/post install action script.
"""
def pre_install(self):
"""Called before any files are installed.
"""
pass
def post_install(self):
"""Called after files are installed.
"""
pass
Add munge_jar stub for InstallScript# Copyright 2015-2017 John "LuaMilkshake" Marion
#
# 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.
"""GoldDust Packages Classes/Utilities
"""
class Package:
"""A package managed by GoldDust"""
def __init__(self):
self.name = ""
self.version = ""
@property
def tarball(self):
"""The tarball file name for this package."""
return "{}-{}.tar.bz2".format(self.name, self.version)
@property
def sig_file(self):
"""The detached signature file name for this package."""
return "{}.sig".format(self.tarball)
class InstallScript:
"""Package pre/post install action script.
These functions are used to perform extra work beyond extracting
files.
Note that JAR modification should only be done using the `munge_jar`
function. This lets GoldDust know that you're modifying the JAR so it
can properly handle other JAR mod packages as well.
"""
def pre_install(self):
"""Called before any files are installed.
"""
pass
def munge_jar(self, jar):
"""Modify the Minecraft JAR file.
"""
pass
def post_install(self):
"""Called after files are installed.
"""
pass
|
<commit_before># Copyright 2015-2017 John "LuaMilkshake" Marion
#
# 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.
"""GoldDust Packages Classes/Utilities
"""
class Package:
"""A package managed by GoldDust"""
def __init__(self):
self.name = ""
self.version = ""
@property
def tarball(self):
"""The tarball file name for this package."""
return "{}-{}.tar.bz2".format(self.name, self.version)
@property
def sig_file(self):
"""The detached signature file name for this package."""
return "{}.sig".format(self.tarball)
class InstallScript:
"""Package pre/post install action script.
"""
def pre_install(self):
"""Called before any files are installed.
"""
pass
def post_install(self):
"""Called after files are installed.
"""
pass
<commit_msg>Add munge_jar stub for InstallScript<commit_after># Copyright 2015-2017 John "LuaMilkshake" Marion
#
# 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.
"""GoldDust Packages Classes/Utilities
"""
class Package:
"""A package managed by GoldDust"""
def __init__(self):
self.name = ""
self.version = ""
@property
def tarball(self):
"""The tarball file name for this package."""
return "{}-{}.tar.bz2".format(self.name, self.version)
@property
def sig_file(self):
"""The detached signature file name for this package."""
return "{}.sig".format(self.tarball)
class InstallScript:
"""Package pre/post install action script.
These functions are used to perform extra work beyond extracting
files.
Note that JAR modification should only be done using the `munge_jar`
function. This lets GoldDust know that you're modifying the JAR so it
can properly handle other JAR mod packages as well.
"""
def pre_install(self):
"""Called before any files are installed.
"""
pass
def munge_jar(self, jar):
"""Modify the Minecraft JAR file.
"""
pass
def post_install(self):
"""Called after files are installed.
"""
pass
|
4fb3ff629f88935a6dcd905f9268eb953b6ad7fb
|
src/syft/grid/client/request_api/group_api.py
|
src/syft/grid/client/request_api/group_api.py
|
# stdlib
from typing import Any
from typing import Dict
# third party
from pandas import DataFrame
# syft relative
from ...messages.group_messages import CreateGroupMessage
from ...messages.group_messages import DeleteGroupMessage
from ...messages.group_messages import GetGroupMessage
from ...messages.group_messages import GetGroupsMessage
from ...messages.group_messages import UpdateGroupMessage
from .request_api import GridRequestAPI
class GroupRequestAPI(GridRequestAPI):
response_key = "group"
def __init__(self, send):
super().__init__(
create_msg=CreateGroupMessage,
get_msg=GetGroupMessage,
get_all_msg=GetGroupsMessage,
update_msg=UpdateGroupMessage,
delete_msg=DeleteGroupMessage,
send=send,
response_key=GroupRequestAPI.response_key,
)
def __getitem__(self, key):
return self.get(group_id=key)
def __delitem__(self, key):
self.delete(group_id=key)
|
# stdlib
from typing import Any
from typing import Callable
# syft relative
from ...messages.group_messages import CreateGroupMessage
from ...messages.group_messages import DeleteGroupMessage
from ...messages.group_messages import GetGroupMessage
from ...messages.group_messages import GetGroupsMessage
from ...messages.group_messages import UpdateGroupMessage
from .request_api import GridRequestAPI
class GroupRequestAPI(GridRequestAPI):
response_key = "group"
def __init__(self, send: Callable):
super().__init__(
create_msg=CreateGroupMessage,
get_msg=GetGroupMessage,
get_all_msg=GetGroupsMessage,
update_msg=UpdateGroupMessage,
delete_msg=DeleteGroupMessage,
send=send,
response_key=GroupRequestAPI.response_key,
)
def __getitem__(self, key: int) -> Any:
return self.get(group_id=key)
def __delitem__(self, key: int) -> Any:
self.delete(group_id=key)
|
Update Group API - ADD type hints - Remove unused imports
|
Update Group API
- ADD type hints
- Remove unused imports
|
Python
|
apache-2.0
|
OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft
|
# stdlib
from typing import Any
from typing import Dict
# third party
from pandas import DataFrame
# syft relative
from ...messages.group_messages import CreateGroupMessage
from ...messages.group_messages import DeleteGroupMessage
from ...messages.group_messages import GetGroupMessage
from ...messages.group_messages import GetGroupsMessage
from ...messages.group_messages import UpdateGroupMessage
from .request_api import GridRequestAPI
class GroupRequestAPI(GridRequestAPI):
response_key = "group"
def __init__(self, send):
super().__init__(
create_msg=CreateGroupMessage,
get_msg=GetGroupMessage,
get_all_msg=GetGroupsMessage,
update_msg=UpdateGroupMessage,
delete_msg=DeleteGroupMessage,
send=send,
response_key=GroupRequestAPI.response_key,
)
def __getitem__(self, key):
return self.get(group_id=key)
def __delitem__(self, key):
self.delete(group_id=key)
Update Group API
- ADD type hints
- Remove unused imports
|
# stdlib
from typing import Any
from typing import Callable
# syft relative
from ...messages.group_messages import CreateGroupMessage
from ...messages.group_messages import DeleteGroupMessage
from ...messages.group_messages import GetGroupMessage
from ...messages.group_messages import GetGroupsMessage
from ...messages.group_messages import UpdateGroupMessage
from .request_api import GridRequestAPI
class GroupRequestAPI(GridRequestAPI):
response_key = "group"
def __init__(self, send: Callable):
super().__init__(
create_msg=CreateGroupMessage,
get_msg=GetGroupMessage,
get_all_msg=GetGroupsMessage,
update_msg=UpdateGroupMessage,
delete_msg=DeleteGroupMessage,
send=send,
response_key=GroupRequestAPI.response_key,
)
def __getitem__(self, key: int) -> Any:
return self.get(group_id=key)
def __delitem__(self, key: int) -> Any:
self.delete(group_id=key)
|
<commit_before># stdlib
from typing import Any
from typing import Dict
# third party
from pandas import DataFrame
# syft relative
from ...messages.group_messages import CreateGroupMessage
from ...messages.group_messages import DeleteGroupMessage
from ...messages.group_messages import GetGroupMessage
from ...messages.group_messages import GetGroupsMessage
from ...messages.group_messages import UpdateGroupMessage
from .request_api import GridRequestAPI
class GroupRequestAPI(GridRequestAPI):
response_key = "group"
def __init__(self, send):
super().__init__(
create_msg=CreateGroupMessage,
get_msg=GetGroupMessage,
get_all_msg=GetGroupsMessage,
update_msg=UpdateGroupMessage,
delete_msg=DeleteGroupMessage,
send=send,
response_key=GroupRequestAPI.response_key,
)
def __getitem__(self, key):
return self.get(group_id=key)
def __delitem__(self, key):
self.delete(group_id=key)
<commit_msg>Update Group API
- ADD type hints
- Remove unused imports<commit_after>
|
# stdlib
from typing import Any
from typing import Callable
# syft relative
from ...messages.group_messages import CreateGroupMessage
from ...messages.group_messages import DeleteGroupMessage
from ...messages.group_messages import GetGroupMessage
from ...messages.group_messages import GetGroupsMessage
from ...messages.group_messages import UpdateGroupMessage
from .request_api import GridRequestAPI
class GroupRequestAPI(GridRequestAPI):
response_key = "group"
def __init__(self, send: Callable):
super().__init__(
create_msg=CreateGroupMessage,
get_msg=GetGroupMessage,
get_all_msg=GetGroupsMessage,
update_msg=UpdateGroupMessage,
delete_msg=DeleteGroupMessage,
send=send,
response_key=GroupRequestAPI.response_key,
)
def __getitem__(self, key: int) -> Any:
return self.get(group_id=key)
def __delitem__(self, key: int) -> Any:
self.delete(group_id=key)
|
# stdlib
from typing import Any
from typing import Dict
# third party
from pandas import DataFrame
# syft relative
from ...messages.group_messages import CreateGroupMessage
from ...messages.group_messages import DeleteGroupMessage
from ...messages.group_messages import GetGroupMessage
from ...messages.group_messages import GetGroupsMessage
from ...messages.group_messages import UpdateGroupMessage
from .request_api import GridRequestAPI
class GroupRequestAPI(GridRequestAPI):
response_key = "group"
def __init__(self, send):
super().__init__(
create_msg=CreateGroupMessage,
get_msg=GetGroupMessage,
get_all_msg=GetGroupsMessage,
update_msg=UpdateGroupMessage,
delete_msg=DeleteGroupMessage,
send=send,
response_key=GroupRequestAPI.response_key,
)
def __getitem__(self, key):
return self.get(group_id=key)
def __delitem__(self, key):
self.delete(group_id=key)
Update Group API
- ADD type hints
- Remove unused imports# stdlib
from typing import Any
from typing import Callable
# syft relative
from ...messages.group_messages import CreateGroupMessage
from ...messages.group_messages import DeleteGroupMessage
from ...messages.group_messages import GetGroupMessage
from ...messages.group_messages import GetGroupsMessage
from ...messages.group_messages import UpdateGroupMessage
from .request_api import GridRequestAPI
class GroupRequestAPI(GridRequestAPI):
response_key = "group"
def __init__(self, send: Callable):
super().__init__(
create_msg=CreateGroupMessage,
get_msg=GetGroupMessage,
get_all_msg=GetGroupsMessage,
update_msg=UpdateGroupMessage,
delete_msg=DeleteGroupMessage,
send=send,
response_key=GroupRequestAPI.response_key,
)
def __getitem__(self, key: int) -> Any:
return self.get(group_id=key)
def __delitem__(self, key: int) -> Any:
self.delete(group_id=key)
|
<commit_before># stdlib
from typing import Any
from typing import Dict
# third party
from pandas import DataFrame
# syft relative
from ...messages.group_messages import CreateGroupMessage
from ...messages.group_messages import DeleteGroupMessage
from ...messages.group_messages import GetGroupMessage
from ...messages.group_messages import GetGroupsMessage
from ...messages.group_messages import UpdateGroupMessage
from .request_api import GridRequestAPI
class GroupRequestAPI(GridRequestAPI):
response_key = "group"
def __init__(self, send):
super().__init__(
create_msg=CreateGroupMessage,
get_msg=GetGroupMessage,
get_all_msg=GetGroupsMessage,
update_msg=UpdateGroupMessage,
delete_msg=DeleteGroupMessage,
send=send,
response_key=GroupRequestAPI.response_key,
)
def __getitem__(self, key):
return self.get(group_id=key)
def __delitem__(self, key):
self.delete(group_id=key)
<commit_msg>Update Group API
- ADD type hints
- Remove unused imports<commit_after># stdlib
from typing import Any
from typing import Callable
# syft relative
from ...messages.group_messages import CreateGroupMessage
from ...messages.group_messages import DeleteGroupMessage
from ...messages.group_messages import GetGroupMessage
from ...messages.group_messages import GetGroupsMessage
from ...messages.group_messages import UpdateGroupMessage
from .request_api import GridRequestAPI
class GroupRequestAPI(GridRequestAPI):
response_key = "group"
def __init__(self, send: Callable):
super().__init__(
create_msg=CreateGroupMessage,
get_msg=GetGroupMessage,
get_all_msg=GetGroupsMessage,
update_msg=UpdateGroupMessage,
delete_msg=DeleteGroupMessage,
send=send,
response_key=GroupRequestAPI.response_key,
)
def __getitem__(self, key: int) -> Any:
return self.get(group_id=key)
def __delitem__(self, key: int) -> Any:
self.delete(group_id=key)
|
599760942e556c5d23deb0904beafcdf11235595
|
stoneridge_reporter.py
|
stoneridge_reporter.py
|
#!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at http://mozilla.org/MPL/2.0/.
import glob
import os
import requests
import stoneridge
class StoneRidgeReporter(object):
def __init__(self):
self.rootdir = stoneridge.get_config('server', 'directory')
self.pattern = os.path.join(self.rootdir, '*.json')
self.url = stoneridge.get_config('report', 'url')
def run(self):
files = glob.glob(self.pattern)
for fpath in files:
fname = os.path.basename(f)
unlink_ok = False
with file(fpath, 'rb') as f:
try:
requests.post(self.url, files={fname: f})
unlink_ok = True
except:
pass
if unlink_ok:
os.unlink(fpath)
@stoneridge.main
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--config', dest='config', required=True)
args = parser.parse_args()
stoneridge._conffile = args.config
reporter = StoneRidgeReporter()
reporter.run()
|
#!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at http://mozilla.org/MPL/2.0/.
import argparse
import glob
import os
import requests
import stoneridge
class StoneRidgeReporter(object):
def __init__(self):
self.rootdir = stoneridge.get_config('server', 'directory')
self.pattern = os.path.join(self.rootdir, '*.json')
self.url = stoneridge.get_config('report', 'url')
def run(self):
files = glob.glob(self.pattern)
for fpath in files:
fname = os.path.basename(fpath)
unlink_ok = False
with file(fpath, 'rb') as f:
try:
post_data = 'data=%s' % (f.read(),)
r = requests.post(self.url, data=post_data)
unlink_ok = True
except Exception, e:
pass
if unlink_ok:
os.unlink(fpath)
@stoneridge.main
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--config', dest='config', required=True)
args = parser.parse_args()
stoneridge._conffile = args.config
reporter = StoneRidgeReporter()
reporter.run()
|
Make reporter succeed in talking to the graph server
|
Make reporter succeed in talking to the graph server
|
Python
|
mpl-2.0
|
mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge,mozilla/stoneridge
|
#!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at http://mozilla.org/MPL/2.0/.
import glob
import os
import requests
import stoneridge
class StoneRidgeReporter(object):
def __init__(self):
self.rootdir = stoneridge.get_config('server', 'directory')
self.pattern = os.path.join(self.rootdir, '*.json')
self.url = stoneridge.get_config('report', 'url')
def run(self):
files = glob.glob(self.pattern)
for fpath in files:
fname = os.path.basename(f)
unlink_ok = False
with file(fpath, 'rb') as f:
try:
requests.post(self.url, files={fname: f})
unlink_ok = True
except:
pass
if unlink_ok:
os.unlink(fpath)
@stoneridge.main
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--config', dest='config', required=True)
args = parser.parse_args()
stoneridge._conffile = args.config
reporter = StoneRidgeReporter()
reporter.run()
Make reporter succeed in talking to the graph server
|
#!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at http://mozilla.org/MPL/2.0/.
import argparse
import glob
import os
import requests
import stoneridge
class StoneRidgeReporter(object):
def __init__(self):
self.rootdir = stoneridge.get_config('server', 'directory')
self.pattern = os.path.join(self.rootdir, '*.json')
self.url = stoneridge.get_config('report', 'url')
def run(self):
files = glob.glob(self.pattern)
for fpath in files:
fname = os.path.basename(fpath)
unlink_ok = False
with file(fpath, 'rb') as f:
try:
post_data = 'data=%s' % (f.read(),)
r = requests.post(self.url, data=post_data)
unlink_ok = True
except Exception, e:
pass
if unlink_ok:
os.unlink(fpath)
@stoneridge.main
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--config', dest='config', required=True)
args = parser.parse_args()
stoneridge._conffile = args.config
reporter = StoneRidgeReporter()
reporter.run()
|
<commit_before>#!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at http://mozilla.org/MPL/2.0/.
import glob
import os
import requests
import stoneridge
class StoneRidgeReporter(object):
def __init__(self):
self.rootdir = stoneridge.get_config('server', 'directory')
self.pattern = os.path.join(self.rootdir, '*.json')
self.url = stoneridge.get_config('report', 'url')
def run(self):
files = glob.glob(self.pattern)
for fpath in files:
fname = os.path.basename(f)
unlink_ok = False
with file(fpath, 'rb') as f:
try:
requests.post(self.url, files={fname: f})
unlink_ok = True
except:
pass
if unlink_ok:
os.unlink(fpath)
@stoneridge.main
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--config', dest='config', required=True)
args = parser.parse_args()
stoneridge._conffile = args.config
reporter = StoneRidgeReporter()
reporter.run()
<commit_msg>Make reporter succeed in talking to the graph server<commit_after>
|
#!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at http://mozilla.org/MPL/2.0/.
import argparse
import glob
import os
import requests
import stoneridge
class StoneRidgeReporter(object):
def __init__(self):
self.rootdir = stoneridge.get_config('server', 'directory')
self.pattern = os.path.join(self.rootdir, '*.json')
self.url = stoneridge.get_config('report', 'url')
def run(self):
files = glob.glob(self.pattern)
for fpath in files:
fname = os.path.basename(fpath)
unlink_ok = False
with file(fpath, 'rb') as f:
try:
post_data = 'data=%s' % (f.read(),)
r = requests.post(self.url, data=post_data)
unlink_ok = True
except Exception, e:
pass
if unlink_ok:
os.unlink(fpath)
@stoneridge.main
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--config', dest='config', required=True)
args = parser.parse_args()
stoneridge._conffile = args.config
reporter = StoneRidgeReporter()
reporter.run()
|
#!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at http://mozilla.org/MPL/2.0/.
import glob
import os
import requests
import stoneridge
class StoneRidgeReporter(object):
def __init__(self):
self.rootdir = stoneridge.get_config('server', 'directory')
self.pattern = os.path.join(self.rootdir, '*.json')
self.url = stoneridge.get_config('report', 'url')
def run(self):
files = glob.glob(self.pattern)
for fpath in files:
fname = os.path.basename(f)
unlink_ok = False
with file(fpath, 'rb') as f:
try:
requests.post(self.url, files={fname: f})
unlink_ok = True
except:
pass
if unlink_ok:
os.unlink(fpath)
@stoneridge.main
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--config', dest='config', required=True)
args = parser.parse_args()
stoneridge._conffile = args.config
reporter = StoneRidgeReporter()
reporter.run()
Make reporter succeed in talking to the graph server#!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at http://mozilla.org/MPL/2.0/.
import argparse
import glob
import os
import requests
import stoneridge
class StoneRidgeReporter(object):
def __init__(self):
self.rootdir = stoneridge.get_config('server', 'directory')
self.pattern = os.path.join(self.rootdir, '*.json')
self.url = stoneridge.get_config('report', 'url')
def run(self):
files = glob.glob(self.pattern)
for fpath in files:
fname = os.path.basename(fpath)
unlink_ok = False
with file(fpath, 'rb') as f:
try:
post_data = 'data=%s' % (f.read(),)
r = requests.post(self.url, data=post_data)
unlink_ok = True
except Exception, e:
pass
if unlink_ok:
os.unlink(fpath)
@stoneridge.main
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--config', dest='config', required=True)
args = parser.parse_args()
stoneridge._conffile = args.config
reporter = StoneRidgeReporter()
reporter.run()
|
<commit_before>#!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at http://mozilla.org/MPL/2.0/.
import glob
import os
import requests
import stoneridge
class StoneRidgeReporter(object):
def __init__(self):
self.rootdir = stoneridge.get_config('server', 'directory')
self.pattern = os.path.join(self.rootdir, '*.json')
self.url = stoneridge.get_config('report', 'url')
def run(self):
files = glob.glob(self.pattern)
for fpath in files:
fname = os.path.basename(f)
unlink_ok = False
with file(fpath, 'rb') as f:
try:
requests.post(self.url, files={fname: f})
unlink_ok = True
except:
pass
if unlink_ok:
os.unlink(fpath)
@stoneridge.main
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--config', dest='config', required=True)
args = parser.parse_args()
stoneridge._conffile = args.config
reporter = StoneRidgeReporter()
reporter.run()
<commit_msg>Make reporter succeed in talking to the graph server<commit_after>#!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at http://mozilla.org/MPL/2.0/.
import argparse
import glob
import os
import requests
import stoneridge
class StoneRidgeReporter(object):
def __init__(self):
self.rootdir = stoneridge.get_config('server', 'directory')
self.pattern = os.path.join(self.rootdir, '*.json')
self.url = stoneridge.get_config('report', 'url')
def run(self):
files = glob.glob(self.pattern)
for fpath in files:
fname = os.path.basename(fpath)
unlink_ok = False
with file(fpath, 'rb') as f:
try:
post_data = 'data=%s' % (f.read(),)
r = requests.post(self.url, data=post_data)
unlink_ok = True
except Exception, e:
pass
if unlink_ok:
os.unlink(fpath)
@stoneridge.main
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--config', dest='config', required=True)
args = parser.parse_args()
stoneridge._conffile = args.config
reporter = StoneRidgeReporter()
reporter.run()
|
101e50f1e668169836a5f253c938420f3675fb16
|
jesusmtnez/python/kata/game.py
|
jesusmtnez/python/kata/game.py
|
class Game():
def __init__(self):
self._score = 0
def roll(self, pins):
self._score += pins
def score(self):
return self._score
|
class Game():
def __init__(self):
self._rolls = [0] * 21
self._current_roll = 0
def roll(self, pins):
self._rolls[self._current_roll] += pins
self._current_roll += 1
def score(self):
score = 0
for frame in range(0, 20, 2):
if self._is_spare(frame):
score += 10 + self._rolls[frame + 2]
else:
score += self._frame_score(frame)
return score
def _is_spare(self, frame):
return self._rolls[frame] + self._rolls[frame + 1] == 10
def _frame_score(self, frame):
return self._rolls[frame] + self._rolls[frame + 1]
|
Add 'spare' support in when calculating scores
|
[Python] Add 'spare' support in when calculating scores
|
Python
|
mit
|
JesusMtnez/devexperto-challenge,JesusMtnez/devexperto-challenge
|
class Game():
def __init__(self):
self._score = 0
def roll(self, pins):
self._score += pins
def score(self):
return self._score
[Python] Add 'spare' support in when calculating scores
|
class Game():
def __init__(self):
self._rolls = [0] * 21
self._current_roll = 0
def roll(self, pins):
self._rolls[self._current_roll] += pins
self._current_roll += 1
def score(self):
score = 0
for frame in range(0, 20, 2):
if self._is_spare(frame):
score += 10 + self._rolls[frame + 2]
else:
score += self._frame_score(frame)
return score
def _is_spare(self, frame):
return self._rolls[frame] + self._rolls[frame + 1] == 10
def _frame_score(self, frame):
return self._rolls[frame] + self._rolls[frame + 1]
|
<commit_before>class Game():
def __init__(self):
self._score = 0
def roll(self, pins):
self._score += pins
def score(self):
return self._score
<commit_msg>[Python] Add 'spare' support in when calculating scores<commit_after>
|
class Game():
def __init__(self):
self._rolls = [0] * 21
self._current_roll = 0
def roll(self, pins):
self._rolls[self._current_roll] += pins
self._current_roll += 1
def score(self):
score = 0
for frame in range(0, 20, 2):
if self._is_spare(frame):
score += 10 + self._rolls[frame + 2]
else:
score += self._frame_score(frame)
return score
def _is_spare(self, frame):
return self._rolls[frame] + self._rolls[frame + 1] == 10
def _frame_score(self, frame):
return self._rolls[frame] + self._rolls[frame + 1]
|
class Game():
def __init__(self):
self._score = 0
def roll(self, pins):
self._score += pins
def score(self):
return self._score
[Python] Add 'spare' support in when calculating scoresclass Game():
def __init__(self):
self._rolls = [0] * 21
self._current_roll = 0
def roll(self, pins):
self._rolls[self._current_roll] += pins
self._current_roll += 1
def score(self):
score = 0
for frame in range(0, 20, 2):
if self._is_spare(frame):
score += 10 + self._rolls[frame + 2]
else:
score += self._frame_score(frame)
return score
def _is_spare(self, frame):
return self._rolls[frame] + self._rolls[frame + 1] == 10
def _frame_score(self, frame):
return self._rolls[frame] + self._rolls[frame + 1]
|
<commit_before>class Game():
def __init__(self):
self._score = 0
def roll(self, pins):
self._score += pins
def score(self):
return self._score
<commit_msg>[Python] Add 'spare' support in when calculating scores<commit_after>class Game():
def __init__(self):
self._rolls = [0] * 21
self._current_roll = 0
def roll(self, pins):
self._rolls[self._current_roll] += pins
self._current_roll += 1
def score(self):
score = 0
for frame in range(0, 20, 2):
if self._is_spare(frame):
score += 10 + self._rolls[frame + 2]
else:
score += self._frame_score(frame)
return score
def _is_spare(self, frame):
return self._rolls[frame] + self._rolls[frame + 1] == 10
def _frame_score(self, frame):
return self._rolls[frame] + self._rolls[frame + 1]
|
2060cf215d851f86ae8c2766b4a2985c9a37cfae
|
temba/flows/migrations/0056_indexes_update.py
|
temba/flows/migrations/0056_indexes_update.py
|
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
INDEX_SQL = """
CREATE INDEX flows_flowrun_org_modified_id
ON flows_flowrun (org_id, modified_on DESC, id DESC);
DROP INDEX IF EXISTS flows_flowrun_org_id_modified_on;
CREATE INDEX flows_flowrun_org_responded_modified_id
ON flows_flowrun (org_id, responded, modified_on DESC, id DESC);
DROP INDEX IF EXISTS flows_flowrun_org_id_modified_on_responded;
CREATE INDEX flows_flowrun_flow_modified_id
ON flows_flowrun (flow_id, modified_on DESC, id DESC);
DROP INDEX IF EXISTS flows_flowrun_flow_id_modified_on;
CREATE INDEX flows_flowrun_flow_responded_modified_id
ON flows_flowrun (flow_id, responded, modified_on DESC, id DESC);
DROP INDEX IF EXISTS flows_flowrun_flow_id_modified_on_responded;
"""
class Migration(migrations.Migration):
dependencies = [
('flows', '0055_populate_step_broadcasts'),
]
operations = [
migrations.RunSQL(INDEX_SQL)
]
|
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
INDEX_SQL = """
CREATE INDEX flows_flowrun_org_modified_id
ON flows_flowrun (org_id, modified_on DESC, id DESC);
DROP INDEX IF EXISTS flows_flowrun_org_id_modified_on;
CREATE INDEX flows_flowrun_org_modified_id_where_responded
ON flows_flowrun (org_id, modified_on DESC, id DESC)
WHERE responded = TRUE;
DROP INDEX IF EXISTS flows_flowrun_org_id_modified_on_responded;
CREATE INDEX flows_flowrun_flow_modified_id
ON flows_flowrun (flow_id, modified_on DESC, id DESC);
DROP INDEX IF EXISTS flows_flowrun_flow_id_modified_on;
CREATE INDEX flows_flowrun_flow_modified_id_where_responded
ON flows_flowrun (flow_id, modified_on DESC, id DESC)
WHERE responded = TRUE;
DROP INDEX IF EXISTS flows_flowrun_flow_id_modified_on_responded;
"""
class Migration(migrations.Migration):
dependencies = [
('flows', '0055_populate_step_broadcasts'),
]
operations = [
migrations.RunSQL(INDEX_SQL)
]
|
Revert "index on flow run responded field as well"
|
Revert "index on flow run responded field as well"
This reverts commit cbbac0f0f23f6e0ad3ce15a784aad30a82a2fe5a.
|
Python
|
agpl-3.0
|
ewheeler/rapidpro,tsotetsi/textily-web,tsotetsi/textily-web,pulilab/rapidpro,tsotetsi/textily-web,tsotetsi/textily-web,tsotetsi/textily-web,pulilab/rapidpro,ewheeler/rapidpro,pulilab/rapidpro,pulilab/rapidpro,ewheeler/rapidpro,pulilab/rapidpro,ewheeler/rapidpro
|
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
INDEX_SQL = """
CREATE INDEX flows_flowrun_org_modified_id
ON flows_flowrun (org_id, modified_on DESC, id DESC);
DROP INDEX IF EXISTS flows_flowrun_org_id_modified_on;
CREATE INDEX flows_flowrun_org_responded_modified_id
ON flows_flowrun (org_id, responded, modified_on DESC, id DESC);
DROP INDEX IF EXISTS flows_flowrun_org_id_modified_on_responded;
CREATE INDEX flows_flowrun_flow_modified_id
ON flows_flowrun (flow_id, modified_on DESC, id DESC);
DROP INDEX IF EXISTS flows_flowrun_flow_id_modified_on;
CREATE INDEX flows_flowrun_flow_responded_modified_id
ON flows_flowrun (flow_id, responded, modified_on DESC, id DESC);
DROP INDEX IF EXISTS flows_flowrun_flow_id_modified_on_responded;
"""
class Migration(migrations.Migration):
dependencies = [
('flows', '0055_populate_step_broadcasts'),
]
operations = [
migrations.RunSQL(INDEX_SQL)
]
Revert "index on flow run responded field as well"
This reverts commit cbbac0f0f23f6e0ad3ce15a784aad30a82a2fe5a.
|
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
INDEX_SQL = """
CREATE INDEX flows_flowrun_org_modified_id
ON flows_flowrun (org_id, modified_on DESC, id DESC);
DROP INDEX IF EXISTS flows_flowrun_org_id_modified_on;
CREATE INDEX flows_flowrun_org_modified_id_where_responded
ON flows_flowrun (org_id, modified_on DESC, id DESC)
WHERE responded = TRUE;
DROP INDEX IF EXISTS flows_flowrun_org_id_modified_on_responded;
CREATE INDEX flows_flowrun_flow_modified_id
ON flows_flowrun (flow_id, modified_on DESC, id DESC);
DROP INDEX IF EXISTS flows_flowrun_flow_id_modified_on;
CREATE INDEX flows_flowrun_flow_modified_id_where_responded
ON flows_flowrun (flow_id, modified_on DESC, id DESC)
WHERE responded = TRUE;
DROP INDEX IF EXISTS flows_flowrun_flow_id_modified_on_responded;
"""
class Migration(migrations.Migration):
dependencies = [
('flows', '0055_populate_step_broadcasts'),
]
operations = [
migrations.RunSQL(INDEX_SQL)
]
|
<commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
INDEX_SQL = """
CREATE INDEX flows_flowrun_org_modified_id
ON flows_flowrun (org_id, modified_on DESC, id DESC);
DROP INDEX IF EXISTS flows_flowrun_org_id_modified_on;
CREATE INDEX flows_flowrun_org_responded_modified_id
ON flows_flowrun (org_id, responded, modified_on DESC, id DESC);
DROP INDEX IF EXISTS flows_flowrun_org_id_modified_on_responded;
CREATE INDEX flows_flowrun_flow_modified_id
ON flows_flowrun (flow_id, modified_on DESC, id DESC);
DROP INDEX IF EXISTS flows_flowrun_flow_id_modified_on;
CREATE INDEX flows_flowrun_flow_responded_modified_id
ON flows_flowrun (flow_id, responded, modified_on DESC, id DESC);
DROP INDEX IF EXISTS flows_flowrun_flow_id_modified_on_responded;
"""
class Migration(migrations.Migration):
dependencies = [
('flows', '0055_populate_step_broadcasts'),
]
operations = [
migrations.RunSQL(INDEX_SQL)
]
<commit_msg>Revert "index on flow run responded field as well"
This reverts commit cbbac0f0f23f6e0ad3ce15a784aad30a82a2fe5a.<commit_after>
|
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
INDEX_SQL = """
CREATE INDEX flows_flowrun_org_modified_id
ON flows_flowrun (org_id, modified_on DESC, id DESC);
DROP INDEX IF EXISTS flows_flowrun_org_id_modified_on;
CREATE INDEX flows_flowrun_org_modified_id_where_responded
ON flows_flowrun (org_id, modified_on DESC, id DESC)
WHERE responded = TRUE;
DROP INDEX IF EXISTS flows_flowrun_org_id_modified_on_responded;
CREATE INDEX flows_flowrun_flow_modified_id
ON flows_flowrun (flow_id, modified_on DESC, id DESC);
DROP INDEX IF EXISTS flows_flowrun_flow_id_modified_on;
CREATE INDEX flows_flowrun_flow_modified_id_where_responded
ON flows_flowrun (flow_id, modified_on DESC, id DESC)
WHERE responded = TRUE;
DROP INDEX IF EXISTS flows_flowrun_flow_id_modified_on_responded;
"""
class Migration(migrations.Migration):
dependencies = [
('flows', '0055_populate_step_broadcasts'),
]
operations = [
migrations.RunSQL(INDEX_SQL)
]
|
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
INDEX_SQL = """
CREATE INDEX flows_flowrun_org_modified_id
ON flows_flowrun (org_id, modified_on DESC, id DESC);
DROP INDEX IF EXISTS flows_flowrun_org_id_modified_on;
CREATE INDEX flows_flowrun_org_responded_modified_id
ON flows_flowrun (org_id, responded, modified_on DESC, id DESC);
DROP INDEX IF EXISTS flows_flowrun_org_id_modified_on_responded;
CREATE INDEX flows_flowrun_flow_modified_id
ON flows_flowrun (flow_id, modified_on DESC, id DESC);
DROP INDEX IF EXISTS flows_flowrun_flow_id_modified_on;
CREATE INDEX flows_flowrun_flow_responded_modified_id
ON flows_flowrun (flow_id, responded, modified_on DESC, id DESC);
DROP INDEX IF EXISTS flows_flowrun_flow_id_modified_on_responded;
"""
class Migration(migrations.Migration):
dependencies = [
('flows', '0055_populate_step_broadcasts'),
]
operations = [
migrations.RunSQL(INDEX_SQL)
]
Revert "index on flow run responded field as well"
This reverts commit cbbac0f0f23f6e0ad3ce15a784aad30a82a2fe5a.# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
INDEX_SQL = """
CREATE INDEX flows_flowrun_org_modified_id
ON flows_flowrun (org_id, modified_on DESC, id DESC);
DROP INDEX IF EXISTS flows_flowrun_org_id_modified_on;
CREATE INDEX flows_flowrun_org_modified_id_where_responded
ON flows_flowrun (org_id, modified_on DESC, id DESC)
WHERE responded = TRUE;
DROP INDEX IF EXISTS flows_flowrun_org_id_modified_on_responded;
CREATE INDEX flows_flowrun_flow_modified_id
ON flows_flowrun (flow_id, modified_on DESC, id DESC);
DROP INDEX IF EXISTS flows_flowrun_flow_id_modified_on;
CREATE INDEX flows_flowrun_flow_modified_id_where_responded
ON flows_flowrun (flow_id, modified_on DESC, id DESC)
WHERE responded = TRUE;
DROP INDEX IF EXISTS flows_flowrun_flow_id_modified_on_responded;
"""
class Migration(migrations.Migration):
dependencies = [
('flows', '0055_populate_step_broadcasts'),
]
operations = [
migrations.RunSQL(INDEX_SQL)
]
|
<commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
INDEX_SQL = """
CREATE INDEX flows_flowrun_org_modified_id
ON flows_flowrun (org_id, modified_on DESC, id DESC);
DROP INDEX IF EXISTS flows_flowrun_org_id_modified_on;
CREATE INDEX flows_flowrun_org_responded_modified_id
ON flows_flowrun (org_id, responded, modified_on DESC, id DESC);
DROP INDEX IF EXISTS flows_flowrun_org_id_modified_on_responded;
CREATE INDEX flows_flowrun_flow_modified_id
ON flows_flowrun (flow_id, modified_on DESC, id DESC);
DROP INDEX IF EXISTS flows_flowrun_flow_id_modified_on;
CREATE INDEX flows_flowrun_flow_responded_modified_id
ON flows_flowrun (flow_id, responded, modified_on DESC, id DESC);
DROP INDEX IF EXISTS flows_flowrun_flow_id_modified_on_responded;
"""
class Migration(migrations.Migration):
dependencies = [
('flows', '0055_populate_step_broadcasts'),
]
operations = [
migrations.RunSQL(INDEX_SQL)
]
<commit_msg>Revert "index on flow run responded field as well"
This reverts commit cbbac0f0f23f6e0ad3ce15a784aad30a82a2fe5a.<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
INDEX_SQL = """
CREATE INDEX flows_flowrun_org_modified_id
ON flows_flowrun (org_id, modified_on DESC, id DESC);
DROP INDEX IF EXISTS flows_flowrun_org_id_modified_on;
CREATE INDEX flows_flowrun_org_modified_id_where_responded
ON flows_flowrun (org_id, modified_on DESC, id DESC)
WHERE responded = TRUE;
DROP INDEX IF EXISTS flows_flowrun_org_id_modified_on_responded;
CREATE INDEX flows_flowrun_flow_modified_id
ON flows_flowrun (flow_id, modified_on DESC, id DESC);
DROP INDEX IF EXISTS flows_flowrun_flow_id_modified_on;
CREATE INDEX flows_flowrun_flow_modified_id_where_responded
ON flows_flowrun (flow_id, modified_on DESC, id DESC)
WHERE responded = TRUE;
DROP INDEX IF EXISTS flows_flowrun_flow_id_modified_on_responded;
"""
class Migration(migrations.Migration):
dependencies = [
('flows', '0055_populate_step_broadcasts'),
]
operations = [
migrations.RunSQL(INDEX_SQL)
]
|
1f5d52f18df2fba70b53acd681ebb381f532adff
|
tests/conftest.py
|
tests/conftest.py
|
""" Fixtures in this file are available to all files automatically, no
importing required. Only put general purpose fixtures here!
"""
import pytest
import os
from shutil import rmtree
TEST_CONFIG = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
'config.cfg')
@pytest.fixture(scope='session', autouse=True)
def config():
from inbox.server.config import load_config, config
load_config(filename=TEST_CONFIG)
return config
# XXX is this the right scope for this? This will remove log/ at the end of
# the test session.
@pytest.fixture(scope='session')
def log(request, config):
""" Returns root server logger. For others loggers, use this fixture
for setup but then call inbox.server.log.get_logger().
"""
from inbox.server.log import configure_general_logging
def remove_logs():
rmtree(config['LOGDIR'], ignore_errors=True)
request.addfinalizer(remove_logs)
return configure_general_logging()
|
""" Fixtures in this file are available to all files automatically, no
importing required. Only put general purpose fixtures here!
"""
import pytest
import os
from shutil import rmtree
TEST_CONFIG = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
'config.cfg')
@pytest.fixture(scope='session', autouse=True)
def config():
from inbox.server.config import load_config, config
load_config(filename=TEST_CONFIG)
return config
@pytest.fixture(scope='session')
def log(request, config):
""" Returns root server logger. For others loggers, use this fixture
for setup but then call inbox.server.log.get_logger().
Testing log directory is removed at the end of the test run!
"""
from inbox.server.log import configure_general_logging
def remove_logs():
rmtree(config['LOGDIR'], ignore_errors=True)
request.addfinalizer(remove_logs)
return configure_general_logging()
|
Document expected behaviour instead of leaving XXX comment
|
Document expected behaviour instead of leaving XXX comment
|
Python
|
agpl-3.0
|
wakermahmud/sync-engine,ErinCall/sync-engine,nylas/sync-engine,Eagles2F/sync-engine,EthanBlackburn/sync-engine,closeio/nylas,nylas/sync-engine,PriviPK/privipk-sync-engine,ErinCall/sync-engine,ErinCall/sync-engine,Eagles2F/sync-engine,gale320/sync-engine,EthanBlackburn/sync-engine,ErinCall/sync-engine,EthanBlackburn/sync-engine,jobscore/sync-engine,gale320/sync-engine,wakermahmud/sync-engine,PriviPK/privipk-sync-engine,Eagles2F/sync-engine,jobscore/sync-engine,PriviPK/privipk-sync-engine,rmasters/inbox,rmasters/inbox,Eagles2F/sync-engine,wakermahmud/sync-engine,PriviPK/privipk-sync-engine,nylas/sync-engine,ErinCall/sync-engine,closeio/nylas,jobscore/sync-engine,gale320/sync-engine,gale320/sync-engine,EthanBlackburn/sync-engine,Eagles2F/sync-engine,PriviPK/privipk-sync-engine,closeio/nylas,wakermahmud/sync-engine,EthanBlackburn/sync-engine,closeio/nylas,nylas/sync-engine,rmasters/inbox,wakermahmud/sync-engine,jobscore/sync-engine,gale320/sync-engine,rmasters/inbox
|
""" Fixtures in this file are available to all files automatically, no
importing required. Only put general purpose fixtures here!
"""
import pytest
import os
from shutil import rmtree
TEST_CONFIG = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
'config.cfg')
@pytest.fixture(scope='session', autouse=True)
def config():
from inbox.server.config import load_config, config
load_config(filename=TEST_CONFIG)
return config
# XXX is this the right scope for this? This will remove log/ at the end of
# the test session.
@pytest.fixture(scope='session')
def log(request, config):
""" Returns root server logger. For others loggers, use this fixture
for setup but then call inbox.server.log.get_logger().
"""
from inbox.server.log import configure_general_logging
def remove_logs():
rmtree(config['LOGDIR'], ignore_errors=True)
request.addfinalizer(remove_logs)
return configure_general_logging()
Document expected behaviour instead of leaving XXX comment
|
""" Fixtures in this file are available to all files automatically, no
importing required. Only put general purpose fixtures here!
"""
import pytest
import os
from shutil import rmtree
TEST_CONFIG = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
'config.cfg')
@pytest.fixture(scope='session', autouse=True)
def config():
from inbox.server.config import load_config, config
load_config(filename=TEST_CONFIG)
return config
@pytest.fixture(scope='session')
def log(request, config):
""" Returns root server logger. For others loggers, use this fixture
for setup but then call inbox.server.log.get_logger().
Testing log directory is removed at the end of the test run!
"""
from inbox.server.log import configure_general_logging
def remove_logs():
rmtree(config['LOGDIR'], ignore_errors=True)
request.addfinalizer(remove_logs)
return configure_general_logging()
|
<commit_before>""" Fixtures in this file are available to all files automatically, no
importing required. Only put general purpose fixtures here!
"""
import pytest
import os
from shutil import rmtree
TEST_CONFIG = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
'config.cfg')
@pytest.fixture(scope='session', autouse=True)
def config():
from inbox.server.config import load_config, config
load_config(filename=TEST_CONFIG)
return config
# XXX is this the right scope for this? This will remove log/ at the end of
# the test session.
@pytest.fixture(scope='session')
def log(request, config):
""" Returns root server logger. For others loggers, use this fixture
for setup but then call inbox.server.log.get_logger().
"""
from inbox.server.log import configure_general_logging
def remove_logs():
rmtree(config['LOGDIR'], ignore_errors=True)
request.addfinalizer(remove_logs)
return configure_general_logging()
<commit_msg>Document expected behaviour instead of leaving XXX comment<commit_after>
|
""" Fixtures in this file are available to all files automatically, no
importing required. Only put general purpose fixtures here!
"""
import pytest
import os
from shutil import rmtree
TEST_CONFIG = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
'config.cfg')
@pytest.fixture(scope='session', autouse=True)
def config():
from inbox.server.config import load_config, config
load_config(filename=TEST_CONFIG)
return config
@pytest.fixture(scope='session')
def log(request, config):
""" Returns root server logger. For others loggers, use this fixture
for setup but then call inbox.server.log.get_logger().
Testing log directory is removed at the end of the test run!
"""
from inbox.server.log import configure_general_logging
def remove_logs():
rmtree(config['LOGDIR'], ignore_errors=True)
request.addfinalizer(remove_logs)
return configure_general_logging()
|
""" Fixtures in this file are available to all files automatically, no
importing required. Only put general purpose fixtures here!
"""
import pytest
import os
from shutil import rmtree
TEST_CONFIG = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
'config.cfg')
@pytest.fixture(scope='session', autouse=True)
def config():
from inbox.server.config import load_config, config
load_config(filename=TEST_CONFIG)
return config
# XXX is this the right scope for this? This will remove log/ at the end of
# the test session.
@pytest.fixture(scope='session')
def log(request, config):
""" Returns root server logger. For others loggers, use this fixture
for setup but then call inbox.server.log.get_logger().
"""
from inbox.server.log import configure_general_logging
def remove_logs():
rmtree(config['LOGDIR'], ignore_errors=True)
request.addfinalizer(remove_logs)
return configure_general_logging()
Document expected behaviour instead of leaving XXX comment""" Fixtures in this file are available to all files automatically, no
importing required. Only put general purpose fixtures here!
"""
import pytest
import os
from shutil import rmtree
TEST_CONFIG = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
'config.cfg')
@pytest.fixture(scope='session', autouse=True)
def config():
from inbox.server.config import load_config, config
load_config(filename=TEST_CONFIG)
return config
@pytest.fixture(scope='session')
def log(request, config):
""" Returns root server logger. For others loggers, use this fixture
for setup but then call inbox.server.log.get_logger().
Testing log directory is removed at the end of the test run!
"""
from inbox.server.log import configure_general_logging
def remove_logs():
rmtree(config['LOGDIR'], ignore_errors=True)
request.addfinalizer(remove_logs)
return configure_general_logging()
|
<commit_before>""" Fixtures in this file are available to all files automatically, no
importing required. Only put general purpose fixtures here!
"""
import pytest
import os
from shutil import rmtree
TEST_CONFIG = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
'config.cfg')
@pytest.fixture(scope='session', autouse=True)
def config():
from inbox.server.config import load_config, config
load_config(filename=TEST_CONFIG)
return config
# XXX is this the right scope for this? This will remove log/ at the end of
# the test session.
@pytest.fixture(scope='session')
def log(request, config):
""" Returns root server logger. For others loggers, use this fixture
for setup but then call inbox.server.log.get_logger().
"""
from inbox.server.log import configure_general_logging
def remove_logs():
rmtree(config['LOGDIR'], ignore_errors=True)
request.addfinalizer(remove_logs)
return configure_general_logging()
<commit_msg>Document expected behaviour instead of leaving XXX comment<commit_after>""" Fixtures in this file are available to all files automatically, no
importing required. Only put general purpose fixtures here!
"""
import pytest
import os
from shutil import rmtree
TEST_CONFIG = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
'config.cfg')
@pytest.fixture(scope='session', autouse=True)
def config():
from inbox.server.config import load_config, config
load_config(filename=TEST_CONFIG)
return config
@pytest.fixture(scope='session')
def log(request, config):
""" Returns root server logger. For others loggers, use this fixture
for setup but then call inbox.server.log.get_logger().
Testing log directory is removed at the end of the test run!
"""
from inbox.server.log import configure_general_logging
def remove_logs():
rmtree(config['LOGDIR'], ignore_errors=True)
request.addfinalizer(remove_logs)
return configure_general_logging()
|
f17611b39c9cc3ec6815093db2eb85cb6b30b5ba
|
lwr/lwr_client/transport/standard.py
|
lwr/lwr_client/transport/standard.py
|
"""
LWR HTTP Client layer based on Python Standard Library (urllib2)
"""
from __future__ import with_statement
from os.path import getsize
import mmap
try:
from urllib2 import urlopen
except ImportError:
from urllib.request import urlopen
try:
from urllib2 import Request
except ImportError:
from urllib.request import Request
class Urllib2Transport(object):
def _url_open(self, request, data):
return urlopen(request, data)
def execute(self, url, data=None, input_path=None, output_path=None):
request = Request(url=url, data=data)
input = None
try:
if input_path:
input = open(input_path, 'rb')
if getsize(input_path):
input = open(input_path, 'rb')
data = mmap.mmap(input.fileno(), 0, access=mmap.ACCESS_READ)
else:
data = b""
response = self._url_open(request, data)
finally:
if input:
input.close()
if output_path:
with open(output_path, 'wb') as output:
while True:
buffer = response.read(1024)
if not buffer:
break
output.write(buffer)
return response
else:
return response.read()
|
"""
LWR HTTP Client layer based on Python Standard Library (urllib2)
"""
from __future__ import with_statement
from os.path import getsize
import mmap
try:
from urllib2 import urlopen
except ImportError:
from urllib.request import urlopen
try:
from urllib2 import Request
except ImportError:
from urllib.request import Request
class Urllib2Transport(object):
def _url_open(self, request, data):
return urlopen(request, data)
def execute(self, url, data=None, input_path=None, output_path=None):
request = Request(url=url, data=data)
input = None
try:
if input_path:
if getsize(input_path):
input = open(input_path, 'rb')
data = mmap.mmap(input.fileno(), 0, access=mmap.ACCESS_READ)
else:
data = b""
response = self._url_open(request, data)
finally:
if input:
input.close()
if output_path:
with open(output_path, 'wb') as output:
while True:
buffer = response.read(1024)
if not buffer:
break
output.write(buffer)
return response
else:
return response.read()
|
Fix small bug introduced in 0b8e5d428e60.
|
Fix small bug introduced in 0b8e5d428e60.
Opening file twice.
|
Python
|
apache-2.0
|
jmchilton/pulsar,natefoo/pulsar,ssorgatem/pulsar,jmchilton/lwr,galaxyproject/pulsar,jmchilton/pulsar,ssorgatem/pulsar,galaxyproject/pulsar,natefoo/pulsar,jmchilton/lwr
|
"""
LWR HTTP Client layer based on Python Standard Library (urllib2)
"""
from __future__ import with_statement
from os.path import getsize
import mmap
try:
from urllib2 import urlopen
except ImportError:
from urllib.request import urlopen
try:
from urllib2 import Request
except ImportError:
from urllib.request import Request
class Urllib2Transport(object):
def _url_open(self, request, data):
return urlopen(request, data)
def execute(self, url, data=None, input_path=None, output_path=None):
request = Request(url=url, data=data)
input = None
try:
if input_path:
input = open(input_path, 'rb')
if getsize(input_path):
input = open(input_path, 'rb')
data = mmap.mmap(input.fileno(), 0, access=mmap.ACCESS_READ)
else:
data = b""
response = self._url_open(request, data)
finally:
if input:
input.close()
if output_path:
with open(output_path, 'wb') as output:
while True:
buffer = response.read(1024)
if not buffer:
break
output.write(buffer)
return response
else:
return response.read()
Fix small bug introduced in 0b8e5d428e60.
Opening file twice.
|
"""
LWR HTTP Client layer based on Python Standard Library (urllib2)
"""
from __future__ import with_statement
from os.path import getsize
import mmap
try:
from urllib2 import urlopen
except ImportError:
from urllib.request import urlopen
try:
from urllib2 import Request
except ImportError:
from urllib.request import Request
class Urllib2Transport(object):
def _url_open(self, request, data):
return urlopen(request, data)
def execute(self, url, data=None, input_path=None, output_path=None):
request = Request(url=url, data=data)
input = None
try:
if input_path:
if getsize(input_path):
input = open(input_path, 'rb')
data = mmap.mmap(input.fileno(), 0, access=mmap.ACCESS_READ)
else:
data = b""
response = self._url_open(request, data)
finally:
if input:
input.close()
if output_path:
with open(output_path, 'wb') as output:
while True:
buffer = response.read(1024)
if not buffer:
break
output.write(buffer)
return response
else:
return response.read()
|
<commit_before>"""
LWR HTTP Client layer based on Python Standard Library (urllib2)
"""
from __future__ import with_statement
from os.path import getsize
import mmap
try:
from urllib2 import urlopen
except ImportError:
from urllib.request import urlopen
try:
from urllib2 import Request
except ImportError:
from urllib.request import Request
class Urllib2Transport(object):
def _url_open(self, request, data):
return urlopen(request, data)
def execute(self, url, data=None, input_path=None, output_path=None):
request = Request(url=url, data=data)
input = None
try:
if input_path:
input = open(input_path, 'rb')
if getsize(input_path):
input = open(input_path, 'rb')
data = mmap.mmap(input.fileno(), 0, access=mmap.ACCESS_READ)
else:
data = b""
response = self._url_open(request, data)
finally:
if input:
input.close()
if output_path:
with open(output_path, 'wb') as output:
while True:
buffer = response.read(1024)
if not buffer:
break
output.write(buffer)
return response
else:
return response.read()
<commit_msg>Fix small bug introduced in 0b8e5d428e60.
Opening file twice.<commit_after>
|
"""
LWR HTTP Client layer based on Python Standard Library (urllib2)
"""
from __future__ import with_statement
from os.path import getsize
import mmap
try:
from urllib2 import urlopen
except ImportError:
from urllib.request import urlopen
try:
from urllib2 import Request
except ImportError:
from urllib.request import Request
class Urllib2Transport(object):
def _url_open(self, request, data):
return urlopen(request, data)
def execute(self, url, data=None, input_path=None, output_path=None):
request = Request(url=url, data=data)
input = None
try:
if input_path:
if getsize(input_path):
input = open(input_path, 'rb')
data = mmap.mmap(input.fileno(), 0, access=mmap.ACCESS_READ)
else:
data = b""
response = self._url_open(request, data)
finally:
if input:
input.close()
if output_path:
with open(output_path, 'wb') as output:
while True:
buffer = response.read(1024)
if not buffer:
break
output.write(buffer)
return response
else:
return response.read()
|
"""
LWR HTTP Client layer based on Python Standard Library (urllib2)
"""
from __future__ import with_statement
from os.path import getsize
import mmap
try:
from urllib2 import urlopen
except ImportError:
from urllib.request import urlopen
try:
from urllib2 import Request
except ImportError:
from urllib.request import Request
class Urllib2Transport(object):
def _url_open(self, request, data):
return urlopen(request, data)
def execute(self, url, data=None, input_path=None, output_path=None):
request = Request(url=url, data=data)
input = None
try:
if input_path:
input = open(input_path, 'rb')
if getsize(input_path):
input = open(input_path, 'rb')
data = mmap.mmap(input.fileno(), 0, access=mmap.ACCESS_READ)
else:
data = b""
response = self._url_open(request, data)
finally:
if input:
input.close()
if output_path:
with open(output_path, 'wb') as output:
while True:
buffer = response.read(1024)
if not buffer:
break
output.write(buffer)
return response
else:
return response.read()
Fix small bug introduced in 0b8e5d428e60.
Opening file twice."""
LWR HTTP Client layer based on Python Standard Library (urllib2)
"""
from __future__ import with_statement
from os.path import getsize
import mmap
try:
from urllib2 import urlopen
except ImportError:
from urllib.request import urlopen
try:
from urllib2 import Request
except ImportError:
from urllib.request import Request
class Urllib2Transport(object):
def _url_open(self, request, data):
return urlopen(request, data)
def execute(self, url, data=None, input_path=None, output_path=None):
request = Request(url=url, data=data)
input = None
try:
if input_path:
if getsize(input_path):
input = open(input_path, 'rb')
data = mmap.mmap(input.fileno(), 0, access=mmap.ACCESS_READ)
else:
data = b""
response = self._url_open(request, data)
finally:
if input:
input.close()
if output_path:
with open(output_path, 'wb') as output:
while True:
buffer = response.read(1024)
if not buffer:
break
output.write(buffer)
return response
else:
return response.read()
|
<commit_before>"""
LWR HTTP Client layer based on Python Standard Library (urllib2)
"""
from __future__ import with_statement
from os.path import getsize
import mmap
try:
from urllib2 import urlopen
except ImportError:
from urllib.request import urlopen
try:
from urllib2 import Request
except ImportError:
from urllib.request import Request
class Urllib2Transport(object):
def _url_open(self, request, data):
return urlopen(request, data)
def execute(self, url, data=None, input_path=None, output_path=None):
request = Request(url=url, data=data)
input = None
try:
if input_path:
input = open(input_path, 'rb')
if getsize(input_path):
input = open(input_path, 'rb')
data = mmap.mmap(input.fileno(), 0, access=mmap.ACCESS_READ)
else:
data = b""
response = self._url_open(request, data)
finally:
if input:
input.close()
if output_path:
with open(output_path, 'wb') as output:
while True:
buffer = response.read(1024)
if not buffer:
break
output.write(buffer)
return response
else:
return response.read()
<commit_msg>Fix small bug introduced in 0b8e5d428e60.
Opening file twice.<commit_after>"""
LWR HTTP Client layer based on Python Standard Library (urllib2)
"""
from __future__ import with_statement
from os.path import getsize
import mmap
try:
from urllib2 import urlopen
except ImportError:
from urllib.request import urlopen
try:
from urllib2 import Request
except ImportError:
from urllib.request import Request
class Urllib2Transport(object):
def _url_open(self, request, data):
return urlopen(request, data)
def execute(self, url, data=None, input_path=None, output_path=None):
request = Request(url=url, data=data)
input = None
try:
if input_path:
if getsize(input_path):
input = open(input_path, 'rb')
data = mmap.mmap(input.fileno(), 0, access=mmap.ACCESS_READ)
else:
data = b""
response = self._url_open(request, data)
finally:
if input:
input.close()
if output_path:
with open(output_path, 'wb') as output:
while True:
buffer = response.read(1024)
if not buffer:
break
output.write(buffer)
return response
else:
return response.read()
|
0858cd463d4e6179e3bf4abbfa94cc54fb0600db
|
test/integration/test_node_propagation.py
|
test/integration/test_node_propagation.py
|
class TestPropagation(object):
def test_node_propagation(self):
"""
Tests that check node propagation
1) Spin up four servers.
2) Make the first one send a sync request to all three others.
3) Count the numbers of requests made.
4) Check databases to see that they all know each other.
"""
pass
|
from kitten.server import KittenServer
from gevent.pool import Group
from mock import MagicMock
class TestPropagation(object):
def setup_method(self, method):
self.servers = Group()
for port in range(4):
ns = MagicMock()
ns.port = 9812 + port
server = KittenServer(ns)
self.servers.spawn(server.listen_forever)
def test_node_propagation(self):
"""
Tests that check node propagation
1) Spin up four servers.
2) Make the first one send a sync request to all three others.
3) Count the numbers of requests made.
4) Check databases to see that they all know each other.
"""
pass
|
Add setup to first integration test
|
Add setup to first integration test
|
Python
|
mit
|
thiderman/network-kitten
|
class TestPropagation(object):
def test_node_propagation(self):
"""
Tests that check node propagation
1) Spin up four servers.
2) Make the first one send a sync request to all three others.
3) Count the numbers of requests made.
4) Check databases to see that they all know each other.
"""
pass
Add setup to first integration test
|
from kitten.server import KittenServer
from gevent.pool import Group
from mock import MagicMock
class TestPropagation(object):
def setup_method(self, method):
self.servers = Group()
for port in range(4):
ns = MagicMock()
ns.port = 9812 + port
server = KittenServer(ns)
self.servers.spawn(server.listen_forever)
def test_node_propagation(self):
"""
Tests that check node propagation
1) Spin up four servers.
2) Make the first one send a sync request to all three others.
3) Count the numbers of requests made.
4) Check databases to see that they all know each other.
"""
pass
|
<commit_before>class TestPropagation(object):
def test_node_propagation(self):
"""
Tests that check node propagation
1) Spin up four servers.
2) Make the first one send a sync request to all three others.
3) Count the numbers of requests made.
4) Check databases to see that they all know each other.
"""
pass
<commit_msg>Add setup to first integration test<commit_after>
|
from kitten.server import KittenServer
from gevent.pool import Group
from mock import MagicMock
class TestPropagation(object):
def setup_method(self, method):
self.servers = Group()
for port in range(4):
ns = MagicMock()
ns.port = 9812 + port
server = KittenServer(ns)
self.servers.spawn(server.listen_forever)
def test_node_propagation(self):
"""
Tests that check node propagation
1) Spin up four servers.
2) Make the first one send a sync request to all three others.
3) Count the numbers of requests made.
4) Check databases to see that they all know each other.
"""
pass
|
class TestPropagation(object):
def test_node_propagation(self):
"""
Tests that check node propagation
1) Spin up four servers.
2) Make the first one send a sync request to all three others.
3) Count the numbers of requests made.
4) Check databases to see that they all know each other.
"""
pass
Add setup to first integration testfrom kitten.server import KittenServer
from gevent.pool import Group
from mock import MagicMock
class TestPropagation(object):
def setup_method(self, method):
self.servers = Group()
for port in range(4):
ns = MagicMock()
ns.port = 9812 + port
server = KittenServer(ns)
self.servers.spawn(server.listen_forever)
def test_node_propagation(self):
"""
Tests that check node propagation
1) Spin up four servers.
2) Make the first one send a sync request to all three others.
3) Count the numbers of requests made.
4) Check databases to see that they all know each other.
"""
pass
|
<commit_before>class TestPropagation(object):
def test_node_propagation(self):
"""
Tests that check node propagation
1) Spin up four servers.
2) Make the first one send a sync request to all three others.
3) Count the numbers of requests made.
4) Check databases to see that they all know each other.
"""
pass
<commit_msg>Add setup to first integration test<commit_after>from kitten.server import KittenServer
from gevent.pool import Group
from mock import MagicMock
class TestPropagation(object):
def setup_method(self, method):
self.servers = Group()
for port in range(4):
ns = MagicMock()
ns.port = 9812 + port
server = KittenServer(ns)
self.servers.spawn(server.listen_forever)
def test_node_propagation(self):
"""
Tests that check node propagation
1) Spin up four servers.
2) Make the first one send a sync request to all three others.
3) Count the numbers of requests made.
4) Check databases to see that they all know each other.
"""
pass
|
4c655c31bf9625fe426c8b481afba41fe328494d
|
metaci/api/renderers/csv_renderer.py
|
metaci/api/renderers/csv_renderer.py
|
# I started here: https://www.django-rest-framework.org/api-guide/renderers/#example
from rest_framework import renderers
import unicodecsv as csv
import io
import logging
logger = logging.getLogger(__name__)
class SimpleCSVRenderer(renderers.BaseRenderer):
"""Renders simple 1-level-deep data as csv"""
media_type = "text/plain" # should we use text/csv instead?
format = "csv"
def render(self, data, media_type=None, renderer_context={}):
if "results" not in data:
logger.warning(f"no results in data: {str(data)}")
# Is this the right thing to do?
detail = data.get("detail", "unexpected error")
return detail
table_data = self.to_table(data["results"])
csv_buffer = io.BytesIO()
writer = csv.writer(csv_buffer)
for row in table_data:
writer.writerow(row)
return csv_buffer.getvalue()
def to_table(self, data, fields=None):
"""Generator to stream the data as a series of rows"""
if data:
if fields is None:
fields = data[0].keys()
yield fields
for item in data:
row = [item.get(key, None) for key in fields]
yield row
|
# I started here: https://www.django-rest-framework.org/api-guide/renderers/#example
import csv
import io
import logging
from rest_framework import renderers
logger = logging.getLogger(__name__)
class SimpleCSVRenderer(renderers.BaseRenderer):
"""Renders simple 1-level-deep data as csv"""
media_type = "text/plain" # should we use text/csv instead?
format = "csv"
def render(self, data, media_type=None, renderer_context={}):
if "results" not in data:
logger.warning(f"no results in data: {str(data)}")
# Is this the right thing to do?
detail = data.get("detail", "unexpected error")
return detail
table_data = self.to_table(data["results"])
csv_buffer = io.StringIO()
writer = csv.writer(csv_buffer)
for row in table_data:
writer.writerow(row)
return csv_buffer.getvalue().encode("utf-8")
def to_table(self, data, fields=None):
"""Generator to stream the data as a series of rows"""
if data:
if fields is None:
fields = data[0].keys()
yield fields
for item in data:
row = [item.get(key, None) for key in fields]
yield row
|
Remove dependency on unicodecsv module
|
Remove dependency on unicodecsv module
|
Python
|
bsd-3-clause
|
SalesforceFoundation/mrbelvedereci,SalesforceFoundation/mrbelvedereci,SalesforceFoundation/mrbelvedereci,SalesforceFoundation/mrbelvedereci
|
# I started here: https://www.django-rest-framework.org/api-guide/renderers/#example
from rest_framework import renderers
import unicodecsv as csv
import io
import logging
logger = logging.getLogger(__name__)
class SimpleCSVRenderer(renderers.BaseRenderer):
"""Renders simple 1-level-deep data as csv"""
media_type = "text/plain" # should we use text/csv instead?
format = "csv"
def render(self, data, media_type=None, renderer_context={}):
if "results" not in data:
logger.warning(f"no results in data: {str(data)}")
# Is this the right thing to do?
detail = data.get("detail", "unexpected error")
return detail
table_data = self.to_table(data["results"])
csv_buffer = io.BytesIO()
writer = csv.writer(csv_buffer)
for row in table_data:
writer.writerow(row)
return csv_buffer.getvalue()
def to_table(self, data, fields=None):
"""Generator to stream the data as a series of rows"""
if data:
if fields is None:
fields = data[0].keys()
yield fields
for item in data:
row = [item.get(key, None) for key in fields]
yield row
Remove dependency on unicodecsv module
|
# I started here: https://www.django-rest-framework.org/api-guide/renderers/#example
import csv
import io
import logging
from rest_framework import renderers
logger = logging.getLogger(__name__)
class SimpleCSVRenderer(renderers.BaseRenderer):
"""Renders simple 1-level-deep data as csv"""
media_type = "text/plain" # should we use text/csv instead?
format = "csv"
def render(self, data, media_type=None, renderer_context={}):
if "results" not in data:
logger.warning(f"no results in data: {str(data)}")
# Is this the right thing to do?
detail = data.get("detail", "unexpected error")
return detail
table_data = self.to_table(data["results"])
csv_buffer = io.StringIO()
writer = csv.writer(csv_buffer)
for row in table_data:
writer.writerow(row)
return csv_buffer.getvalue().encode("utf-8")
def to_table(self, data, fields=None):
"""Generator to stream the data as a series of rows"""
if data:
if fields is None:
fields = data[0].keys()
yield fields
for item in data:
row = [item.get(key, None) for key in fields]
yield row
|
<commit_before># I started here: https://www.django-rest-framework.org/api-guide/renderers/#example
from rest_framework import renderers
import unicodecsv as csv
import io
import logging
logger = logging.getLogger(__name__)
class SimpleCSVRenderer(renderers.BaseRenderer):
"""Renders simple 1-level-deep data as csv"""
media_type = "text/plain" # should we use text/csv instead?
format = "csv"
def render(self, data, media_type=None, renderer_context={}):
if "results" not in data:
logger.warning(f"no results in data: {str(data)}")
# Is this the right thing to do?
detail = data.get("detail", "unexpected error")
return detail
table_data = self.to_table(data["results"])
csv_buffer = io.BytesIO()
writer = csv.writer(csv_buffer)
for row in table_data:
writer.writerow(row)
return csv_buffer.getvalue()
def to_table(self, data, fields=None):
"""Generator to stream the data as a series of rows"""
if data:
if fields is None:
fields = data[0].keys()
yield fields
for item in data:
row = [item.get(key, None) for key in fields]
yield row
<commit_msg>Remove dependency on unicodecsv module<commit_after>
|
# I started here: https://www.django-rest-framework.org/api-guide/renderers/#example
import csv
import io
import logging
from rest_framework import renderers
logger = logging.getLogger(__name__)
class SimpleCSVRenderer(renderers.BaseRenderer):
"""Renders simple 1-level-deep data as csv"""
media_type = "text/plain" # should we use text/csv instead?
format = "csv"
def render(self, data, media_type=None, renderer_context={}):
if "results" not in data:
logger.warning(f"no results in data: {str(data)}")
# Is this the right thing to do?
detail = data.get("detail", "unexpected error")
return detail
table_data = self.to_table(data["results"])
csv_buffer = io.StringIO()
writer = csv.writer(csv_buffer)
for row in table_data:
writer.writerow(row)
return csv_buffer.getvalue().encode("utf-8")
def to_table(self, data, fields=None):
"""Generator to stream the data as a series of rows"""
if data:
if fields is None:
fields = data[0].keys()
yield fields
for item in data:
row = [item.get(key, None) for key in fields]
yield row
|
# I started here: https://www.django-rest-framework.org/api-guide/renderers/#example
from rest_framework import renderers
import unicodecsv as csv
import io
import logging
logger = logging.getLogger(__name__)
class SimpleCSVRenderer(renderers.BaseRenderer):
"""Renders simple 1-level-deep data as csv"""
media_type = "text/plain" # should we use text/csv instead?
format = "csv"
def render(self, data, media_type=None, renderer_context={}):
if "results" not in data:
logger.warning(f"no results in data: {str(data)}")
# Is this the right thing to do?
detail = data.get("detail", "unexpected error")
return detail
table_data = self.to_table(data["results"])
csv_buffer = io.BytesIO()
writer = csv.writer(csv_buffer)
for row in table_data:
writer.writerow(row)
return csv_buffer.getvalue()
def to_table(self, data, fields=None):
"""Generator to stream the data as a series of rows"""
if data:
if fields is None:
fields = data[0].keys()
yield fields
for item in data:
row = [item.get(key, None) for key in fields]
yield row
Remove dependency on unicodecsv module# I started here: https://www.django-rest-framework.org/api-guide/renderers/#example
import csv
import io
import logging
from rest_framework import renderers
logger = logging.getLogger(__name__)
class SimpleCSVRenderer(renderers.BaseRenderer):
"""Renders simple 1-level-deep data as csv"""
media_type = "text/plain" # should we use text/csv instead?
format = "csv"
def render(self, data, media_type=None, renderer_context={}):
if "results" not in data:
logger.warning(f"no results in data: {str(data)}")
# Is this the right thing to do?
detail = data.get("detail", "unexpected error")
return detail
table_data = self.to_table(data["results"])
csv_buffer = io.StringIO()
writer = csv.writer(csv_buffer)
for row in table_data:
writer.writerow(row)
return csv_buffer.getvalue().encode("utf-8")
def to_table(self, data, fields=None):
"""Generator to stream the data as a series of rows"""
if data:
if fields is None:
fields = data[0].keys()
yield fields
for item in data:
row = [item.get(key, None) for key in fields]
yield row
|
<commit_before># I started here: https://www.django-rest-framework.org/api-guide/renderers/#example
from rest_framework import renderers
import unicodecsv as csv
import io
import logging
logger = logging.getLogger(__name__)
class SimpleCSVRenderer(renderers.BaseRenderer):
"""Renders simple 1-level-deep data as csv"""
media_type = "text/plain" # should we use text/csv instead?
format = "csv"
def render(self, data, media_type=None, renderer_context={}):
if "results" not in data:
logger.warning(f"no results in data: {str(data)}")
# Is this the right thing to do?
detail = data.get("detail", "unexpected error")
return detail
table_data = self.to_table(data["results"])
csv_buffer = io.BytesIO()
writer = csv.writer(csv_buffer)
for row in table_data:
writer.writerow(row)
return csv_buffer.getvalue()
def to_table(self, data, fields=None):
"""Generator to stream the data as a series of rows"""
if data:
if fields is None:
fields = data[0].keys()
yield fields
for item in data:
row = [item.get(key, None) for key in fields]
yield row
<commit_msg>Remove dependency on unicodecsv module<commit_after># I started here: https://www.django-rest-framework.org/api-guide/renderers/#example
import csv
import io
import logging
from rest_framework import renderers
logger = logging.getLogger(__name__)
class SimpleCSVRenderer(renderers.BaseRenderer):
"""Renders simple 1-level-deep data as csv"""
media_type = "text/plain" # should we use text/csv instead?
format = "csv"
def render(self, data, media_type=None, renderer_context={}):
if "results" not in data:
logger.warning(f"no results in data: {str(data)}")
# Is this the right thing to do?
detail = data.get("detail", "unexpected error")
return detail
table_data = self.to_table(data["results"])
csv_buffer = io.StringIO()
writer = csv.writer(csv_buffer)
for row in table_data:
writer.writerow(row)
return csv_buffer.getvalue().encode("utf-8")
def to_table(self, data, fields=None):
"""Generator to stream the data as a series of rows"""
if data:
if fields is None:
fields = data[0].keys()
yield fields
for item in data:
row = [item.get(key, None) for key in fields]
yield row
|
b87da7d5666fc5dc3654d9f58779b8f58a3e6e9f
|
sft/sim/SimplePathWorldGenerator.py
|
sft/sim/SimplePathWorldGenerator.py
|
from sim.PathWorldGenerator import PathWorldGenerator
class SimplePathWorldGenerator(PathWorldGenerator):
def __init__(self, logger, view_size, world_size, sampler, path_in_init_view=False,
target_not_in_init_view=False):
# enforce simple paths consisting of one step, i.e. straight lines
super(SimplePathWorldGenerator, self).__init__(logger, view_size, world_size, sampler,
path_length_min=1, path_length_max=1,
path_step_length_min=max(world_size.tuple()) / 3,
path_in_init_view=path_in_init_view,
target_not_in_init_view=target_not_in_init_view)
|
from sft.sim.PathWorldGenerator import PathWorldGenerator
class SimplePathWorldGenerator(PathWorldGenerator):
def __init__(self, logger, view_size, world_size, sampler, path_in_init_view=False,
target_not_in_init_view=False):
# enforce simple paths consisting of one step, i.e. straight lines
super(SimplePathWorldGenerator, self).__init__(logger, view_size, world_size, sampler,
path_length_min=1, path_length_max=1,
path_step_length_min=max(world_size.tuple()) / 3,
path_in_init_view=path_in_init_view,
target_not_in_init_view=target_not_in_init_view)
|
Improve trainer logging and print every logged message to console
|
Improve trainer logging and print every logged message to console
|
Python
|
mit
|
kevinkepp/search-for-this
|
from sim.PathWorldGenerator import PathWorldGenerator
class SimplePathWorldGenerator(PathWorldGenerator):
def __init__(self, logger, view_size, world_size, sampler, path_in_init_view=False,
target_not_in_init_view=False):
# enforce simple paths consisting of one step, i.e. straight lines
super(SimplePathWorldGenerator, self).__init__(logger, view_size, world_size, sampler,
path_length_min=1, path_length_max=1,
path_step_length_min=max(world_size.tuple()) / 3,
path_in_init_view=path_in_init_view,
target_not_in_init_view=target_not_in_init_view)
Improve trainer logging and print every logged message to console
|
from sft.sim.PathWorldGenerator import PathWorldGenerator
class SimplePathWorldGenerator(PathWorldGenerator):
def __init__(self, logger, view_size, world_size, sampler, path_in_init_view=False,
target_not_in_init_view=False):
# enforce simple paths consisting of one step, i.e. straight lines
super(SimplePathWorldGenerator, self).__init__(logger, view_size, world_size, sampler,
path_length_min=1, path_length_max=1,
path_step_length_min=max(world_size.tuple()) / 3,
path_in_init_view=path_in_init_view,
target_not_in_init_view=target_not_in_init_view)
|
<commit_before>from sim.PathWorldGenerator import PathWorldGenerator
class SimplePathWorldGenerator(PathWorldGenerator):
def __init__(self, logger, view_size, world_size, sampler, path_in_init_view=False,
target_not_in_init_view=False):
# enforce simple paths consisting of one step, i.e. straight lines
super(SimplePathWorldGenerator, self).__init__(logger, view_size, world_size, sampler,
path_length_min=1, path_length_max=1,
path_step_length_min=max(world_size.tuple()) / 3,
path_in_init_view=path_in_init_view,
target_not_in_init_view=target_not_in_init_view)
<commit_msg>Improve trainer logging and print every logged message to console<commit_after>
|
from sft.sim.PathWorldGenerator import PathWorldGenerator
class SimplePathWorldGenerator(PathWorldGenerator):
def __init__(self, logger, view_size, world_size, sampler, path_in_init_view=False,
target_not_in_init_view=False):
# enforce simple paths consisting of one step, i.e. straight lines
super(SimplePathWorldGenerator, self).__init__(logger, view_size, world_size, sampler,
path_length_min=1, path_length_max=1,
path_step_length_min=max(world_size.tuple()) / 3,
path_in_init_view=path_in_init_view,
target_not_in_init_view=target_not_in_init_view)
|
from sim.PathWorldGenerator import PathWorldGenerator
class SimplePathWorldGenerator(PathWorldGenerator):
def __init__(self, logger, view_size, world_size, sampler, path_in_init_view=False,
target_not_in_init_view=False):
# enforce simple paths consisting of one step, i.e. straight lines
super(SimplePathWorldGenerator, self).__init__(logger, view_size, world_size, sampler,
path_length_min=1, path_length_max=1,
path_step_length_min=max(world_size.tuple()) / 3,
path_in_init_view=path_in_init_view,
target_not_in_init_view=target_not_in_init_view)
Improve trainer logging and print every logged message to consolefrom sft.sim.PathWorldGenerator import PathWorldGenerator
class SimplePathWorldGenerator(PathWorldGenerator):
def __init__(self, logger, view_size, world_size, sampler, path_in_init_view=False,
target_not_in_init_view=False):
# enforce simple paths consisting of one step, i.e. straight lines
super(SimplePathWorldGenerator, self).__init__(logger, view_size, world_size, sampler,
path_length_min=1, path_length_max=1,
path_step_length_min=max(world_size.tuple()) / 3,
path_in_init_view=path_in_init_view,
target_not_in_init_view=target_not_in_init_view)
|
<commit_before>from sim.PathWorldGenerator import PathWorldGenerator
class SimplePathWorldGenerator(PathWorldGenerator):
def __init__(self, logger, view_size, world_size, sampler, path_in_init_view=False,
target_not_in_init_view=False):
# enforce simple paths consisting of one step, i.e. straight lines
super(SimplePathWorldGenerator, self).__init__(logger, view_size, world_size, sampler,
path_length_min=1, path_length_max=1,
path_step_length_min=max(world_size.tuple()) / 3,
path_in_init_view=path_in_init_view,
target_not_in_init_view=target_not_in_init_view)
<commit_msg>Improve trainer logging and print every logged message to console<commit_after>from sft.sim.PathWorldGenerator import PathWorldGenerator
class SimplePathWorldGenerator(PathWorldGenerator):
def __init__(self, logger, view_size, world_size, sampler, path_in_init_view=False,
target_not_in_init_view=False):
# enforce simple paths consisting of one step, i.e. straight lines
super(SimplePathWorldGenerator, self).__init__(logger, view_size, world_size, sampler,
path_length_min=1, path_length_max=1,
path_step_length_min=max(world_size.tuple()) / 3,
path_in_init_view=path_in_init_view,
target_not_in_init_view=target_not_in_init_view)
|
5694209065b707e2529b7c8b97b1c82a3990c938
|
lithium/ximport.py
|
lithium/ximport.py
|
import os
import sys
def importRelativeOrAbsolute(f):
# maybe there's a way to do this more sanely with the |imp| module...
if f.endswith(".py"):
f = f[:-3]
if f.endswith(".pyc"):
f = f[:-4]
p, f = os.path.split(f)
if p:
# Add the path part of the given filename to the import path
sys.path.append(p)
else:
# Add working directory to the import path
sys.path.append(".")
try:
module = __import__(f)
except ImportError as e:
print "Failed to import: " + f
print "From: " + __file__
print str(e)
raise
sys.path.pop()
return module
|
import os
import sys
def importRelativeOrAbsolute(f):
# maybe there's a way to do this more sanely with the |imp| module...
if f.endswith(".py"):
f = f[:-3]
if f.endswith(".pyc"):
f = f[:-4]
p, f = os.path.split(f)
if p:
# Add the path part of the given filename to the import path
sys.path.append(p)
else:
# Add working directory to the import path
sys.path.append(".")
try:
module = __import__(f)
except ImportError, e:
print "Failed to import: " + f
print "From: " + __file__
print str(e)
raise
sys.path.pop()
return module
|
Make it work in Python < 2.6
|
Make it work in Python < 2.6
|
Python
|
mpl-2.0
|
nth10sd/lithium,MozillaSecurity/lithium,MozillaSecurity/lithium,nth10sd/lithium
|
import os
import sys
def importRelativeOrAbsolute(f):
# maybe there's a way to do this more sanely with the |imp| module...
if f.endswith(".py"):
f = f[:-3]
if f.endswith(".pyc"):
f = f[:-4]
p, f = os.path.split(f)
if p:
# Add the path part of the given filename to the import path
sys.path.append(p)
else:
# Add working directory to the import path
sys.path.append(".")
try:
module = __import__(f)
except ImportError as e:
print "Failed to import: " + f
print "From: " + __file__
print str(e)
raise
sys.path.pop()
return module
Make it work in Python < 2.6
|
import os
import sys
def importRelativeOrAbsolute(f):
# maybe there's a way to do this more sanely with the |imp| module...
if f.endswith(".py"):
f = f[:-3]
if f.endswith(".pyc"):
f = f[:-4]
p, f = os.path.split(f)
if p:
# Add the path part of the given filename to the import path
sys.path.append(p)
else:
# Add working directory to the import path
sys.path.append(".")
try:
module = __import__(f)
except ImportError, e:
print "Failed to import: " + f
print "From: " + __file__
print str(e)
raise
sys.path.pop()
return module
|
<commit_before>import os
import sys
def importRelativeOrAbsolute(f):
# maybe there's a way to do this more sanely with the |imp| module...
if f.endswith(".py"):
f = f[:-3]
if f.endswith(".pyc"):
f = f[:-4]
p, f = os.path.split(f)
if p:
# Add the path part of the given filename to the import path
sys.path.append(p)
else:
# Add working directory to the import path
sys.path.append(".")
try:
module = __import__(f)
except ImportError as e:
print "Failed to import: " + f
print "From: " + __file__
print str(e)
raise
sys.path.pop()
return module
<commit_msg>Make it work in Python < 2.6<commit_after>
|
import os
import sys
def importRelativeOrAbsolute(f):
# maybe there's a way to do this more sanely with the |imp| module...
if f.endswith(".py"):
f = f[:-3]
if f.endswith(".pyc"):
f = f[:-4]
p, f = os.path.split(f)
if p:
# Add the path part of the given filename to the import path
sys.path.append(p)
else:
# Add working directory to the import path
sys.path.append(".")
try:
module = __import__(f)
except ImportError, e:
print "Failed to import: " + f
print "From: " + __file__
print str(e)
raise
sys.path.pop()
return module
|
import os
import sys
def importRelativeOrAbsolute(f):
# maybe there's a way to do this more sanely with the |imp| module...
if f.endswith(".py"):
f = f[:-3]
if f.endswith(".pyc"):
f = f[:-4]
p, f = os.path.split(f)
if p:
# Add the path part of the given filename to the import path
sys.path.append(p)
else:
# Add working directory to the import path
sys.path.append(".")
try:
module = __import__(f)
except ImportError as e:
print "Failed to import: " + f
print "From: " + __file__
print str(e)
raise
sys.path.pop()
return module
Make it work in Python < 2.6import os
import sys
def importRelativeOrAbsolute(f):
# maybe there's a way to do this more sanely with the |imp| module...
if f.endswith(".py"):
f = f[:-3]
if f.endswith(".pyc"):
f = f[:-4]
p, f = os.path.split(f)
if p:
# Add the path part of the given filename to the import path
sys.path.append(p)
else:
# Add working directory to the import path
sys.path.append(".")
try:
module = __import__(f)
except ImportError, e:
print "Failed to import: " + f
print "From: " + __file__
print str(e)
raise
sys.path.pop()
return module
|
<commit_before>import os
import sys
def importRelativeOrAbsolute(f):
# maybe there's a way to do this more sanely with the |imp| module...
if f.endswith(".py"):
f = f[:-3]
if f.endswith(".pyc"):
f = f[:-4]
p, f = os.path.split(f)
if p:
# Add the path part of the given filename to the import path
sys.path.append(p)
else:
# Add working directory to the import path
sys.path.append(".")
try:
module = __import__(f)
except ImportError as e:
print "Failed to import: " + f
print "From: " + __file__
print str(e)
raise
sys.path.pop()
return module
<commit_msg>Make it work in Python < 2.6<commit_after>import os
import sys
def importRelativeOrAbsolute(f):
# maybe there's a way to do this more sanely with the |imp| module...
if f.endswith(".py"):
f = f[:-3]
if f.endswith(".pyc"):
f = f[:-4]
p, f = os.path.split(f)
if p:
# Add the path part of the given filename to the import path
sys.path.append(p)
else:
# Add working directory to the import path
sys.path.append(".")
try:
module = __import__(f)
except ImportError, e:
print "Failed to import: " + f
print "From: " + __file__
print str(e)
raise
sys.path.pop()
return module
|
f1f18b6b996d2bcf108bf7b594d0fdf4dab23057
|
timpani/themes.py
|
timpani/themes.py
|
import os
import os.path
from . import database
THEME_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "../themes"))
def getCurrentTheme():
databaseConnection = database.ConnectionManager.getConnection("main")
query = (databaseConnection.session
.query(database.tables.Setting)
.filter(database.tables.Setting.name == "theme"))
if query.count() > 0:
themeName = query.first().value
themes = os.listdir(THEME_PATH)
folderName = None
try:
folderName = next(theme for theme in themes if theme.lower() == themeName.lower())
except StopIteration:
return None
themeFile = open(
os.path.join(THEME_PATH, folderName, "theme.css"), "r")
theme = themeFile.read()
themeFile.close()
templateFile = open(
os.path.join(THEME_PATH, folderName, "template.html"), "r")
template = templatefile.read()
templateFile.close()
return {"template": template, "theme": theme}
def getAvailableThemes():
files = os.listdir(THEME_PATH)
for item in files:
path = os.path.join(THEME_PATH, item)
if not os.path.isdir(path):
files.remove(item)
return files
|
import os
import os.path
from . import database
THEME_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "../themes"))
def getCurrentTheme():
databaseConnection = database.ConnectionManager.getConnection("main")
query = (databaseConnection.session
.query(database.tables.Setting)
.filter(database.tables.Setting.name == "theme"))
if query.count() > 0:
themeName = query.first().value
themes = os.listdir(THEME_PATH)
folderName = None
try:
folderName = next(theme for theme in themes if theme.lower() == themeName.lower())
except StopIteration:
return None
themePath = os.path.join(THEME_PATH, folderName, "theme.css")
theme = "" #No CSS
if os.path.isfile(themePath):
themeFile = open(themePath, "r")
theme = themeFile.read()
themeFile.close()
templatePath = os.path.join(THEME_PATH, folderName, "template.html")
template = None #If this is None, the default template can be used.
if os.path.isfile(templatePath):
templateFile = open(templatePath, "r")
template = templatefile.read()
templateFile.close()
return {"template": template, "theme": theme}
def getAvailableThemes():
files = os.listdir(THEME_PATH)
for item in files:
path = os.path.join(THEME_PATH, item)
if not os.path.isdir(path):
files.remove(item)
return files
|
Add cases for either CSS or template not existing
|
Add cases for either CSS or template not existing
|
Python
|
mit
|
ollien/Timpani,ollien/Timpani,ollien/Timpani
|
import os
import os.path
from . import database
THEME_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "../themes"))
def getCurrentTheme():
databaseConnection = database.ConnectionManager.getConnection("main")
query = (databaseConnection.session
.query(database.tables.Setting)
.filter(database.tables.Setting.name == "theme"))
if query.count() > 0:
themeName = query.first().value
themes = os.listdir(THEME_PATH)
folderName = None
try:
folderName = next(theme for theme in themes if theme.lower() == themeName.lower())
except StopIteration:
return None
themeFile = open(
os.path.join(THEME_PATH, folderName, "theme.css"), "r")
theme = themeFile.read()
themeFile.close()
templateFile = open(
os.path.join(THEME_PATH, folderName, "template.html"), "r")
template = templatefile.read()
templateFile.close()
return {"template": template, "theme": theme}
def getAvailableThemes():
files = os.listdir(THEME_PATH)
for item in files:
path = os.path.join(THEME_PATH, item)
if not os.path.isdir(path):
files.remove(item)
return files
Add cases for either CSS or template not existing
|
import os
import os.path
from . import database
THEME_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "../themes"))
def getCurrentTheme():
databaseConnection = database.ConnectionManager.getConnection("main")
query = (databaseConnection.session
.query(database.tables.Setting)
.filter(database.tables.Setting.name == "theme"))
if query.count() > 0:
themeName = query.first().value
themes = os.listdir(THEME_PATH)
folderName = None
try:
folderName = next(theme for theme in themes if theme.lower() == themeName.lower())
except StopIteration:
return None
themePath = os.path.join(THEME_PATH, folderName, "theme.css")
theme = "" #No CSS
if os.path.isfile(themePath):
themeFile = open(themePath, "r")
theme = themeFile.read()
themeFile.close()
templatePath = os.path.join(THEME_PATH, folderName, "template.html")
template = None #If this is None, the default template can be used.
if os.path.isfile(templatePath):
templateFile = open(templatePath, "r")
template = templatefile.read()
templateFile.close()
return {"template": template, "theme": theme}
def getAvailableThemes():
files = os.listdir(THEME_PATH)
for item in files:
path = os.path.join(THEME_PATH, item)
if not os.path.isdir(path):
files.remove(item)
return files
|
<commit_before>import os
import os.path
from . import database
THEME_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "../themes"))
def getCurrentTheme():
databaseConnection = database.ConnectionManager.getConnection("main")
query = (databaseConnection.session
.query(database.tables.Setting)
.filter(database.tables.Setting.name == "theme"))
if query.count() > 0:
themeName = query.first().value
themes = os.listdir(THEME_PATH)
folderName = None
try:
folderName = next(theme for theme in themes if theme.lower() == themeName.lower())
except StopIteration:
return None
themeFile = open(
os.path.join(THEME_PATH, folderName, "theme.css"), "r")
theme = themeFile.read()
themeFile.close()
templateFile = open(
os.path.join(THEME_PATH, folderName, "template.html"), "r")
template = templatefile.read()
templateFile.close()
return {"template": template, "theme": theme}
def getAvailableThemes():
files = os.listdir(THEME_PATH)
for item in files:
path = os.path.join(THEME_PATH, item)
if not os.path.isdir(path):
files.remove(item)
return files
<commit_msg>Add cases for either CSS or template not existing<commit_after>
|
import os
import os.path
from . import database
THEME_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "../themes"))
def getCurrentTheme():
databaseConnection = database.ConnectionManager.getConnection("main")
query = (databaseConnection.session
.query(database.tables.Setting)
.filter(database.tables.Setting.name == "theme"))
if query.count() > 0:
themeName = query.first().value
themes = os.listdir(THEME_PATH)
folderName = None
try:
folderName = next(theme for theme in themes if theme.lower() == themeName.lower())
except StopIteration:
return None
themePath = os.path.join(THEME_PATH, folderName, "theme.css")
theme = "" #No CSS
if os.path.isfile(themePath):
themeFile = open(themePath, "r")
theme = themeFile.read()
themeFile.close()
templatePath = os.path.join(THEME_PATH, folderName, "template.html")
template = None #If this is None, the default template can be used.
if os.path.isfile(templatePath):
templateFile = open(templatePath, "r")
template = templatefile.read()
templateFile.close()
return {"template": template, "theme": theme}
def getAvailableThemes():
files = os.listdir(THEME_PATH)
for item in files:
path = os.path.join(THEME_PATH, item)
if not os.path.isdir(path):
files.remove(item)
return files
|
import os
import os.path
from . import database
THEME_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "../themes"))
def getCurrentTheme():
databaseConnection = database.ConnectionManager.getConnection("main")
query = (databaseConnection.session
.query(database.tables.Setting)
.filter(database.tables.Setting.name == "theme"))
if query.count() > 0:
themeName = query.first().value
themes = os.listdir(THEME_PATH)
folderName = None
try:
folderName = next(theme for theme in themes if theme.lower() == themeName.lower())
except StopIteration:
return None
themeFile = open(
os.path.join(THEME_PATH, folderName, "theme.css"), "r")
theme = themeFile.read()
themeFile.close()
templateFile = open(
os.path.join(THEME_PATH, folderName, "template.html"), "r")
template = templatefile.read()
templateFile.close()
return {"template": template, "theme": theme}
def getAvailableThemes():
files = os.listdir(THEME_PATH)
for item in files:
path = os.path.join(THEME_PATH, item)
if not os.path.isdir(path):
files.remove(item)
return files
Add cases for either CSS or template not existingimport os
import os.path
from . import database
THEME_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "../themes"))
def getCurrentTheme():
databaseConnection = database.ConnectionManager.getConnection("main")
query = (databaseConnection.session
.query(database.tables.Setting)
.filter(database.tables.Setting.name == "theme"))
if query.count() > 0:
themeName = query.first().value
themes = os.listdir(THEME_PATH)
folderName = None
try:
folderName = next(theme for theme in themes if theme.lower() == themeName.lower())
except StopIteration:
return None
themePath = os.path.join(THEME_PATH, folderName, "theme.css")
theme = "" #No CSS
if os.path.isfile(themePath):
themeFile = open(themePath, "r")
theme = themeFile.read()
themeFile.close()
templatePath = os.path.join(THEME_PATH, folderName, "template.html")
template = None #If this is None, the default template can be used.
if os.path.isfile(templatePath):
templateFile = open(templatePath, "r")
template = templatefile.read()
templateFile.close()
return {"template": template, "theme": theme}
def getAvailableThemes():
files = os.listdir(THEME_PATH)
for item in files:
path = os.path.join(THEME_PATH, item)
if not os.path.isdir(path):
files.remove(item)
return files
|
<commit_before>import os
import os.path
from . import database
THEME_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "../themes"))
def getCurrentTheme():
databaseConnection = database.ConnectionManager.getConnection("main")
query = (databaseConnection.session
.query(database.tables.Setting)
.filter(database.tables.Setting.name == "theme"))
if query.count() > 0:
themeName = query.first().value
themes = os.listdir(THEME_PATH)
folderName = None
try:
folderName = next(theme for theme in themes if theme.lower() == themeName.lower())
except StopIteration:
return None
themeFile = open(
os.path.join(THEME_PATH, folderName, "theme.css"), "r")
theme = themeFile.read()
themeFile.close()
templateFile = open(
os.path.join(THEME_PATH, folderName, "template.html"), "r")
template = templatefile.read()
templateFile.close()
return {"template": template, "theme": theme}
def getAvailableThemes():
files = os.listdir(THEME_PATH)
for item in files:
path = os.path.join(THEME_PATH, item)
if not os.path.isdir(path):
files.remove(item)
return files
<commit_msg>Add cases for either CSS or template not existing<commit_after>import os
import os.path
from . import database
THEME_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "../themes"))
def getCurrentTheme():
databaseConnection = database.ConnectionManager.getConnection("main")
query = (databaseConnection.session
.query(database.tables.Setting)
.filter(database.tables.Setting.name == "theme"))
if query.count() > 0:
themeName = query.first().value
themes = os.listdir(THEME_PATH)
folderName = None
try:
folderName = next(theme for theme in themes if theme.lower() == themeName.lower())
except StopIteration:
return None
themePath = os.path.join(THEME_PATH, folderName, "theme.css")
theme = "" #No CSS
if os.path.isfile(themePath):
themeFile = open(themePath, "r")
theme = themeFile.read()
themeFile.close()
templatePath = os.path.join(THEME_PATH, folderName, "template.html")
template = None #If this is None, the default template can be used.
if os.path.isfile(templatePath):
templateFile = open(templatePath, "r")
template = templatefile.read()
templateFile.close()
return {"template": template, "theme": theme}
def getAvailableThemes():
files = os.listdir(THEME_PATH)
for item in files:
path = os.path.join(THEME_PATH, item)
if not os.path.isdir(path):
files.remove(item)
return files
|
f5aa51a57e3d161c12d8b8390e6e6aab7609b459
|
readthedocs/projects/feeds.py
|
readthedocs/projects/feeds.py
|
from django.contrib.syndication.views import Feed
from django.db.models import Max
from projects.models import Project
class LatestProjectsFeed(Feed):
title = "Recently updated documentation"
link = "http://readthedocs.org"
description = "Recently updated documentation on Read the Docs"
def items(self):
return Project.objects.filter(builds__isnull=False).annotate(max_date=Max('builds__date')).order_by('-max_date')[:10]
def item_title(self, item):
return item.name
def item_description(self, item):
return item.get_latest_build()
class NewProjectsFeed(Feed):
title = "Newest documentation"
link = "http://readthedocs.org"
description = "Recently created documentation on Read the Docs"
def items(self):
return Project.objects.all().order_by('-pk')[:10]
def item_title(self, item):
return item.name
def item_description(self, item):
return item.get_latest_build()
|
from django.contrib.syndication.views import Feed
from django.db.models import Max
from projects.models import Project
class LatestProjectsFeed(Feed):
title = "Recently updated documentation"
link = "http://readthedocs.org"
description = "Recently updated documentation on Read the Docs"
def items(self):
return Project.objects.order_by('-modified_date')[:10]
def item_title(self, item):
return item.name
def item_description(self, item):
return item.get_latest_build()
class NewProjectsFeed(Feed):
title = "Newest documentation"
link = "http://readthedocs.org"
description = "Recently created documentation on Read the Docs"
def items(self):
return Project.objects.all().order_by('-pk')[:10]
def item_title(self, item):
return item.name
def item_description(self, item):
return item.get_latest_build()
|
Make the RSS feed not slow.
|
Make the RSS feed not slow.
|
Python
|
mit
|
VishvajitP/readthedocs.org,soulshake/readthedocs.org,agjohnson/readthedocs.org,attakei/readthedocs-oauth,nikolas/readthedocs.org,pombredanne/readthedocs.org,michaelmcandrew/readthedocs.org,laplaceliu/readthedocs.org,takluyver/readthedocs.org,atsuyim/readthedocs.org,mrshoki/readthedocs.org,d0ugal/readthedocs.org,asampat3090/readthedocs.org,wanghaven/readthedocs.org,techtonik/readthedocs.org,sunnyzwh/readthedocs.org,SteveViss/readthedocs.org,gjtorikian/readthedocs.org,sils1297/readthedocs.org,KamranMackey/readthedocs.org,KamranMackey/readthedocs.org,laplaceliu/readthedocs.org,stevepiercy/readthedocs.org,kdkeyser/readthedocs.org,raven47git/readthedocs.org,jerel/readthedocs.org,dirn/readthedocs.org,agjohnson/readthedocs.org,GovReady/readthedocs.org,raven47git/readthedocs.org,attakei/readthedocs-oauth,hach-que/readthedocs.org,tddv/readthedocs.org,titiushko/readthedocs.org,agjohnson/readthedocs.org,espdev/readthedocs.org,emawind84/readthedocs.org,jerel/readthedocs.org,techtonik/readthedocs.org,stevepiercy/readthedocs.org,takluyver/readthedocs.org,GovReady/readthedocs.org,safwanrahman/readthedocs.org,techtonik/readthedocs.org,laplaceliu/readthedocs.org,kenwang76/readthedocs.org,johncosta/private-readthedocs.org,Carreau/readthedocs.org,Tazer/readthedocs.org,atsuyim/readthedocs.org,kdkeyser/readthedocs.org,royalwang/readthedocs.org,emawind84/readthedocs.org,cgourlay/readthedocs.org,CedarLogic/readthedocs.org,clarkperkins/readthedocs.org,singingwolfboy/readthedocs.org,KamranMackey/readthedocs.org,soulshake/readthedocs.org,sunnyzwh/readthedocs.org,tddv/readthedocs.org,kenwang76/readthedocs.org,espdev/readthedocs.org,atsuyim/readthedocs.org,Carreau/readthedocs.org,singingwolfboy/readthedocs.org,takluyver/readthedocs.org,Tazer/readthedocs.org,nikolas/readthedocs.org,royalwang/readthedocs.org,sunnyzwh/readthedocs.org,clarkperkins/readthedocs.org,kdkeyser/readthedocs.org,nyergler/pythonslides,gjtorikian/readthedocs.org,sid-kap/readthedocs.org,clarkperkins/readthedocs.org,istresearch/readthedocs.org,raven47git/readthedocs.org,johncosta/private-readthedocs.org,johncosta/private-readthedocs.org,LukasBoersma/readthedocs.org,hach-que/readthedocs.org,d0ugal/readthedocs.org,dirn/readthedocs.org,cgourlay/readthedocs.org,d0ugal/readthedocs.org,VishvajitP/readthedocs.org,agjohnson/readthedocs.org,nyergler/pythonslides,rtfd/readthedocs.org,sils1297/readthedocs.org,jerel/readthedocs.org,rtfd/readthedocs.org,sid-kap/readthedocs.org,gjtorikian/readthedocs.org,gjtorikian/readthedocs.org,LukasBoersma/readthedocs.org,espdev/readthedocs.org,emawind84/readthedocs.org,CedarLogic/readthedocs.org,wijerasa/readthedocs.org,mhils/readthedocs.org,stevepiercy/readthedocs.org,KamranMackey/readthedocs.org,VishvajitP/readthedocs.org,sid-kap/readthedocs.org,rtfd/readthedocs.org,Carreau/readthedocs.org,kenwang76/readthedocs.org,jerel/readthedocs.org,raven47git/readthedocs.org,mhils/readthedocs.org,LukasBoersma/readthedocs.org,ojii/readthedocs.org,nikolas/readthedocs.org,hach-que/readthedocs.org,d0ugal/readthedocs.org,atsuyim/readthedocs.org,nyergler/pythonslides,espdev/readthedocs.org,royalwang/readthedocs.org,attakei/readthedocs-oauth,pombredanne/readthedocs.org,kenshinthebattosai/readthedocs.org,singingwolfboy/readthedocs.org,sils1297/readthedocs.org,SteveViss/readthedocs.org,dirn/readthedocs.org,michaelmcandrew/readthedocs.org,cgourlay/readthedocs.org,soulshake/readthedocs.org,fujita-shintaro/readthedocs.org,kenshinthebattosai/readthedocs.org,Tazer/readthedocs.org,soulshake/readthedocs.org,kenshinthebattosai/readthedocs.org,safwanrahman/readthedocs.org,davidfischer/readthedocs.org,titiushko/readthedocs.org,CedarLogic/readthedocs.org,LukasBoersma/readthedocs.org,SteveViss/readthedocs.org,asampat3090/readthedocs.org,SteveViss/readthedocs.org,titiushko/readthedocs.org,clarkperkins/readthedocs.org,mhils/readthedocs.org,tddv/readthedocs.org,singingwolfboy/readthedocs.org,kenshinthebattosai/readthedocs.org,istresearch/readthedocs.org,stevepiercy/readthedocs.org,fujita-shintaro/readthedocs.org,istresearch/readthedocs.org,mrshoki/readthedocs.org,nyergler/pythonslides,ojii/readthedocs.org,safwanrahman/readthedocs.org,kdkeyser/readthedocs.org,wijerasa/readthedocs.org,davidfischer/readthedocs.org,wanghaven/readthedocs.org,cgourlay/readthedocs.org,sunnyzwh/readthedocs.org,istresearch/readthedocs.org,attakei/readthedocs-oauth,asampat3090/readthedocs.org,wijerasa/readthedocs.org,wanghaven/readthedocs.org,GovReady/readthedocs.org,davidfischer/readthedocs.org,pombredanne/readthedocs.org,dirn/readthedocs.org,Tazer/readthedocs.org,asampat3090/readthedocs.org,ojii/readthedocs.org,rtfd/readthedocs.org,mrshoki/readthedocs.org,mrshoki/readthedocs.org,espdev/readthedocs.org,michaelmcandrew/readthedocs.org,Carreau/readthedocs.org,hach-que/readthedocs.org,emawind84/readthedocs.org,safwanrahman/readthedocs.org,techtonik/readthedocs.org,royalwang/readthedocs.org,kenwang76/readthedocs.org,VishvajitP/readthedocs.org,mhils/readthedocs.org,sid-kap/readthedocs.org,nikolas/readthedocs.org,GovReady/readthedocs.org,fujita-shintaro/readthedocs.org,laplaceliu/readthedocs.org,davidfischer/readthedocs.org,michaelmcandrew/readthedocs.org,wanghaven/readthedocs.org,fujita-shintaro/readthedocs.org,titiushko/readthedocs.org,sils1297/readthedocs.org,takluyver/readthedocs.org,CedarLogic/readthedocs.org,wijerasa/readthedocs.org,ojii/readthedocs.org
|
from django.contrib.syndication.views import Feed
from django.db.models import Max
from projects.models import Project
class LatestProjectsFeed(Feed):
title = "Recently updated documentation"
link = "http://readthedocs.org"
description = "Recently updated documentation on Read the Docs"
def items(self):
return Project.objects.filter(builds__isnull=False).annotate(max_date=Max('builds__date')).order_by('-max_date')[:10]
def item_title(self, item):
return item.name
def item_description(self, item):
return item.get_latest_build()
class NewProjectsFeed(Feed):
title = "Newest documentation"
link = "http://readthedocs.org"
description = "Recently created documentation on Read the Docs"
def items(self):
return Project.objects.all().order_by('-pk')[:10]
def item_title(self, item):
return item.name
def item_description(self, item):
return item.get_latest_build()
Make the RSS feed not slow.
|
from django.contrib.syndication.views import Feed
from django.db.models import Max
from projects.models import Project
class LatestProjectsFeed(Feed):
title = "Recently updated documentation"
link = "http://readthedocs.org"
description = "Recently updated documentation on Read the Docs"
def items(self):
return Project.objects.order_by('-modified_date')[:10]
def item_title(self, item):
return item.name
def item_description(self, item):
return item.get_latest_build()
class NewProjectsFeed(Feed):
title = "Newest documentation"
link = "http://readthedocs.org"
description = "Recently created documentation on Read the Docs"
def items(self):
return Project.objects.all().order_by('-pk')[:10]
def item_title(self, item):
return item.name
def item_description(self, item):
return item.get_latest_build()
|
<commit_before>from django.contrib.syndication.views import Feed
from django.db.models import Max
from projects.models import Project
class LatestProjectsFeed(Feed):
title = "Recently updated documentation"
link = "http://readthedocs.org"
description = "Recently updated documentation on Read the Docs"
def items(self):
return Project.objects.filter(builds__isnull=False).annotate(max_date=Max('builds__date')).order_by('-max_date')[:10]
def item_title(self, item):
return item.name
def item_description(self, item):
return item.get_latest_build()
class NewProjectsFeed(Feed):
title = "Newest documentation"
link = "http://readthedocs.org"
description = "Recently created documentation on Read the Docs"
def items(self):
return Project.objects.all().order_by('-pk')[:10]
def item_title(self, item):
return item.name
def item_description(self, item):
return item.get_latest_build()
<commit_msg>Make the RSS feed not slow.<commit_after>
|
from django.contrib.syndication.views import Feed
from django.db.models import Max
from projects.models import Project
class LatestProjectsFeed(Feed):
title = "Recently updated documentation"
link = "http://readthedocs.org"
description = "Recently updated documentation on Read the Docs"
def items(self):
return Project.objects.order_by('-modified_date')[:10]
def item_title(self, item):
return item.name
def item_description(self, item):
return item.get_latest_build()
class NewProjectsFeed(Feed):
title = "Newest documentation"
link = "http://readthedocs.org"
description = "Recently created documentation on Read the Docs"
def items(self):
return Project.objects.all().order_by('-pk')[:10]
def item_title(self, item):
return item.name
def item_description(self, item):
return item.get_latest_build()
|
from django.contrib.syndication.views import Feed
from django.db.models import Max
from projects.models import Project
class LatestProjectsFeed(Feed):
title = "Recently updated documentation"
link = "http://readthedocs.org"
description = "Recently updated documentation on Read the Docs"
def items(self):
return Project.objects.filter(builds__isnull=False).annotate(max_date=Max('builds__date')).order_by('-max_date')[:10]
def item_title(self, item):
return item.name
def item_description(self, item):
return item.get_latest_build()
class NewProjectsFeed(Feed):
title = "Newest documentation"
link = "http://readthedocs.org"
description = "Recently created documentation on Read the Docs"
def items(self):
return Project.objects.all().order_by('-pk')[:10]
def item_title(self, item):
return item.name
def item_description(self, item):
return item.get_latest_build()
Make the RSS feed not slow.from django.contrib.syndication.views import Feed
from django.db.models import Max
from projects.models import Project
class LatestProjectsFeed(Feed):
title = "Recently updated documentation"
link = "http://readthedocs.org"
description = "Recently updated documentation on Read the Docs"
def items(self):
return Project.objects.order_by('-modified_date')[:10]
def item_title(self, item):
return item.name
def item_description(self, item):
return item.get_latest_build()
class NewProjectsFeed(Feed):
title = "Newest documentation"
link = "http://readthedocs.org"
description = "Recently created documentation on Read the Docs"
def items(self):
return Project.objects.all().order_by('-pk')[:10]
def item_title(self, item):
return item.name
def item_description(self, item):
return item.get_latest_build()
|
<commit_before>from django.contrib.syndication.views import Feed
from django.db.models import Max
from projects.models import Project
class LatestProjectsFeed(Feed):
title = "Recently updated documentation"
link = "http://readthedocs.org"
description = "Recently updated documentation on Read the Docs"
def items(self):
return Project.objects.filter(builds__isnull=False).annotate(max_date=Max('builds__date')).order_by('-max_date')[:10]
def item_title(self, item):
return item.name
def item_description(self, item):
return item.get_latest_build()
class NewProjectsFeed(Feed):
title = "Newest documentation"
link = "http://readthedocs.org"
description = "Recently created documentation on Read the Docs"
def items(self):
return Project.objects.all().order_by('-pk')[:10]
def item_title(self, item):
return item.name
def item_description(self, item):
return item.get_latest_build()
<commit_msg>Make the RSS feed not slow.<commit_after>from django.contrib.syndication.views import Feed
from django.db.models import Max
from projects.models import Project
class LatestProjectsFeed(Feed):
title = "Recently updated documentation"
link = "http://readthedocs.org"
description = "Recently updated documentation on Read the Docs"
def items(self):
return Project.objects.order_by('-modified_date')[:10]
def item_title(self, item):
return item.name
def item_description(self, item):
return item.get_latest_build()
class NewProjectsFeed(Feed):
title = "Newest documentation"
link = "http://readthedocs.org"
description = "Recently created documentation on Read the Docs"
def items(self):
return Project.objects.all().order_by('-pk')[:10]
def item_title(self, item):
return item.name
def item_description(self, item):
return item.get_latest_build()
|
29316060fb422a881833e411350e0149575bf1c4
|
update-database/stackdoc/namespaces/python.py
|
update-database/stackdoc/namespaces/python.py
|
import re
import urllib
############### Functions called by stackdoc
def get_version():
return 1
def get_ids(title, body, tags):
ids = []
if "http://docs.python.org/" in body:
urls = re.findall(r'<a href="([^"]+)"', body)
for url in urls:
m = re.match("http://docs.python.org/(?:release/)?(?:dev/)?(?:[0-9](?:\.[0-9]/)+)?(?:py3k/)?library/([.a-z0-9]+)(?:-examples)?\.html", url)
if m:
ids.append(m.group(1))
return ids
def get_tags():
return [
"python"
]
|
import re
import urllib
############### Functions called by stackdoc
def get_version():
return 2
def get_ids(title, body, tags):
ids = []
if "http://docs.python.org/" in body or "http://www.python.org/doc/" in body:
urls = re.findall(r'<a href="([^"]+)"', body)
for url in urls:
docsm = re.match("http://docs.python.org/(?:release/)?(?:dev/)?(?:[0-9](?:\.[0-9]/)+)?(?:py3k/)?library/([.a-z0-9]+)(?:-examples)?\.html", url)
if docsm:
ids.append(docsm.group(1))
olddocsm = re.match("http://www.python.org/doc/(?:[0-9](?:\.[0-9]/)+)/lib/module-([.a-z0-9]+)\.html", url)
if olddocsm:
ids.append(olddocsm.group(1))
return ids
def get_tags():
return [
"python"
]
|
Support old style Python doc links.
|
Support old style Python doc links.
|
Python
|
bsd-3-clause
|
alnorth/stackdoc,alnorth/stackdoc,alnorth/stackdoc
|
import re
import urllib
############### Functions called by stackdoc
def get_version():
return 1
def get_ids(title, body, tags):
ids = []
if "http://docs.python.org/" in body:
urls = re.findall(r'<a href="([^"]+)"', body)
for url in urls:
m = re.match("http://docs.python.org/(?:release/)?(?:dev/)?(?:[0-9](?:\.[0-9]/)+)?(?:py3k/)?library/([.a-z0-9]+)(?:-examples)?\.html", url)
if m:
ids.append(m.group(1))
return ids
def get_tags():
return [
"python"
]
Support old style Python doc links.
|
import re
import urllib
############### Functions called by stackdoc
def get_version():
return 2
def get_ids(title, body, tags):
ids = []
if "http://docs.python.org/" in body or "http://www.python.org/doc/" in body:
urls = re.findall(r'<a href="([^"]+)"', body)
for url in urls:
docsm = re.match("http://docs.python.org/(?:release/)?(?:dev/)?(?:[0-9](?:\.[0-9]/)+)?(?:py3k/)?library/([.a-z0-9]+)(?:-examples)?\.html", url)
if docsm:
ids.append(docsm.group(1))
olddocsm = re.match("http://www.python.org/doc/(?:[0-9](?:\.[0-9]/)+)/lib/module-([.a-z0-9]+)\.html", url)
if olddocsm:
ids.append(olddocsm.group(1))
return ids
def get_tags():
return [
"python"
]
|
<commit_before>import re
import urllib
############### Functions called by stackdoc
def get_version():
return 1
def get_ids(title, body, tags):
ids = []
if "http://docs.python.org/" in body:
urls = re.findall(r'<a href="([^"]+)"', body)
for url in urls:
m = re.match("http://docs.python.org/(?:release/)?(?:dev/)?(?:[0-9](?:\.[0-9]/)+)?(?:py3k/)?library/([.a-z0-9]+)(?:-examples)?\.html", url)
if m:
ids.append(m.group(1))
return ids
def get_tags():
return [
"python"
]
<commit_msg>Support old style Python doc links.<commit_after>
|
import re
import urllib
############### Functions called by stackdoc
def get_version():
return 2
def get_ids(title, body, tags):
ids = []
if "http://docs.python.org/" in body or "http://www.python.org/doc/" in body:
urls = re.findall(r'<a href="([^"]+)"', body)
for url in urls:
docsm = re.match("http://docs.python.org/(?:release/)?(?:dev/)?(?:[0-9](?:\.[0-9]/)+)?(?:py3k/)?library/([.a-z0-9]+)(?:-examples)?\.html", url)
if docsm:
ids.append(docsm.group(1))
olddocsm = re.match("http://www.python.org/doc/(?:[0-9](?:\.[0-9]/)+)/lib/module-([.a-z0-9]+)\.html", url)
if olddocsm:
ids.append(olddocsm.group(1))
return ids
def get_tags():
return [
"python"
]
|
import re
import urllib
############### Functions called by stackdoc
def get_version():
return 1
def get_ids(title, body, tags):
ids = []
if "http://docs.python.org/" in body:
urls = re.findall(r'<a href="([^"]+)"', body)
for url in urls:
m = re.match("http://docs.python.org/(?:release/)?(?:dev/)?(?:[0-9](?:\.[0-9]/)+)?(?:py3k/)?library/([.a-z0-9]+)(?:-examples)?\.html", url)
if m:
ids.append(m.group(1))
return ids
def get_tags():
return [
"python"
]
Support old style Python doc links.import re
import urllib
############### Functions called by stackdoc
def get_version():
return 2
def get_ids(title, body, tags):
ids = []
if "http://docs.python.org/" in body or "http://www.python.org/doc/" in body:
urls = re.findall(r'<a href="([^"]+)"', body)
for url in urls:
docsm = re.match("http://docs.python.org/(?:release/)?(?:dev/)?(?:[0-9](?:\.[0-9]/)+)?(?:py3k/)?library/([.a-z0-9]+)(?:-examples)?\.html", url)
if docsm:
ids.append(docsm.group(1))
olddocsm = re.match("http://www.python.org/doc/(?:[0-9](?:\.[0-9]/)+)/lib/module-([.a-z0-9]+)\.html", url)
if olddocsm:
ids.append(olddocsm.group(1))
return ids
def get_tags():
return [
"python"
]
|
<commit_before>import re
import urllib
############### Functions called by stackdoc
def get_version():
return 1
def get_ids(title, body, tags):
ids = []
if "http://docs.python.org/" in body:
urls = re.findall(r'<a href="([^"]+)"', body)
for url in urls:
m = re.match("http://docs.python.org/(?:release/)?(?:dev/)?(?:[0-9](?:\.[0-9]/)+)?(?:py3k/)?library/([.a-z0-9]+)(?:-examples)?\.html", url)
if m:
ids.append(m.group(1))
return ids
def get_tags():
return [
"python"
]
<commit_msg>Support old style Python doc links.<commit_after>import re
import urllib
############### Functions called by stackdoc
def get_version():
return 2
def get_ids(title, body, tags):
ids = []
if "http://docs.python.org/" in body or "http://www.python.org/doc/" in body:
urls = re.findall(r'<a href="([^"]+)"', body)
for url in urls:
docsm = re.match("http://docs.python.org/(?:release/)?(?:dev/)?(?:[0-9](?:\.[0-9]/)+)?(?:py3k/)?library/([.a-z0-9]+)(?:-examples)?\.html", url)
if docsm:
ids.append(docsm.group(1))
olddocsm = re.match("http://www.python.org/doc/(?:[0-9](?:\.[0-9]/)+)/lib/module-([.a-z0-9]+)\.html", url)
if olddocsm:
ids.append(olddocsm.group(1))
return ids
def get_tags():
return [
"python"
]
|
f19d4eaec9681192eb761758b1506638b78a5e15
|
tests/__init__.py
|
tests/__init__.py
|
import inspect
import os
# Get testdata absolute path.
abs_path = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
path = abs_path + "/testdata"
|
import inspect
import os
# Get testdata absolute path.
abs_path = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
#path = abs_path + "/testdata"
path = "./testdata"
|
Change the testdata path to relative path.
|
Change the testdata path to relative path.
|
Python
|
mit
|
PytLab/VASPy,PytLab/VASPy
|
import inspect
import os
# Get testdata absolute path.
abs_path = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
path = abs_path + "/testdata"
Change the testdata path to relative path.
|
import inspect
import os
# Get testdata absolute path.
abs_path = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
#path = abs_path + "/testdata"
path = "./testdata"
|
<commit_before>import inspect
import os
# Get testdata absolute path.
abs_path = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
path = abs_path + "/testdata"
<commit_msg>Change the testdata path to relative path.<commit_after>
|
import inspect
import os
# Get testdata absolute path.
abs_path = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
#path = abs_path + "/testdata"
path = "./testdata"
|
import inspect
import os
# Get testdata absolute path.
abs_path = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
path = abs_path + "/testdata"
Change the testdata path to relative path.import inspect
import os
# Get testdata absolute path.
abs_path = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
#path = abs_path + "/testdata"
path = "./testdata"
|
<commit_before>import inspect
import os
# Get testdata absolute path.
abs_path = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
path = abs_path + "/testdata"
<commit_msg>Change the testdata path to relative path.<commit_after>import inspect
import os
# Get testdata absolute path.
abs_path = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
#path = abs_path + "/testdata"
path = "./testdata"
|
4ce674ea3a672c2819112b5237319000e33f22c5
|
marten/__init__.py
|
marten/__init__.py
|
"""Stupid simple Python configuration environments"""
from __future__ import absolute_import
import os as _os
__version__ = '0.6.0'
_os.environ.setdefault('MARTEN_ENV', 'default')
try:
from .util import get_config_from_env as _get_config
except ImportError:
config = None
else:
config = _get_config()
|
"""Stupid simple Python configuration environments"""
from __future__ import absolute_import
from marten import loaded_configs
import os as _os
__version__ = '0.6.1'
_os.environ.setdefault('MARTEN_ENV', 'default')
try:
from .util import get_config_from_env as _get_config
except ImportError:
config = None
else:
config = _get_config()
|
Add explicit import for loaded_configs namespace to fix RuntimeWarning
|
Add explicit import for loaded_configs namespace to fix RuntimeWarning
|
Python
|
mit
|
nick-allen/marten
|
"""Stupid simple Python configuration environments"""
from __future__ import absolute_import
import os as _os
__version__ = '0.6.0'
_os.environ.setdefault('MARTEN_ENV', 'default')
try:
from .util import get_config_from_env as _get_config
except ImportError:
config = None
else:
config = _get_config()
Add explicit import for loaded_configs namespace to fix RuntimeWarning
|
"""Stupid simple Python configuration environments"""
from __future__ import absolute_import
from marten import loaded_configs
import os as _os
__version__ = '0.6.1'
_os.environ.setdefault('MARTEN_ENV', 'default')
try:
from .util import get_config_from_env as _get_config
except ImportError:
config = None
else:
config = _get_config()
|
<commit_before>"""Stupid simple Python configuration environments"""
from __future__ import absolute_import
import os as _os
__version__ = '0.6.0'
_os.environ.setdefault('MARTEN_ENV', 'default')
try:
from .util import get_config_from_env as _get_config
except ImportError:
config = None
else:
config = _get_config()
<commit_msg>Add explicit import for loaded_configs namespace to fix RuntimeWarning<commit_after>
|
"""Stupid simple Python configuration environments"""
from __future__ import absolute_import
from marten import loaded_configs
import os as _os
__version__ = '0.6.1'
_os.environ.setdefault('MARTEN_ENV', 'default')
try:
from .util import get_config_from_env as _get_config
except ImportError:
config = None
else:
config = _get_config()
|
"""Stupid simple Python configuration environments"""
from __future__ import absolute_import
import os as _os
__version__ = '0.6.0'
_os.environ.setdefault('MARTEN_ENV', 'default')
try:
from .util import get_config_from_env as _get_config
except ImportError:
config = None
else:
config = _get_config()
Add explicit import for loaded_configs namespace to fix RuntimeWarning"""Stupid simple Python configuration environments"""
from __future__ import absolute_import
from marten import loaded_configs
import os as _os
__version__ = '0.6.1'
_os.environ.setdefault('MARTEN_ENV', 'default')
try:
from .util import get_config_from_env as _get_config
except ImportError:
config = None
else:
config = _get_config()
|
<commit_before>"""Stupid simple Python configuration environments"""
from __future__ import absolute_import
import os as _os
__version__ = '0.6.0'
_os.environ.setdefault('MARTEN_ENV', 'default')
try:
from .util import get_config_from_env as _get_config
except ImportError:
config = None
else:
config = _get_config()
<commit_msg>Add explicit import for loaded_configs namespace to fix RuntimeWarning<commit_after>"""Stupid simple Python configuration environments"""
from __future__ import absolute_import
from marten import loaded_configs
import os as _os
__version__ = '0.6.1'
_os.environ.setdefault('MARTEN_ENV', 'default')
try:
from .util import get_config_from_env as _get_config
except ImportError:
config = None
else:
config = _get_config()
|
0dac29f30853498f6e9d82c8b791ced5ec21667c
|
models/00_settings.py
|
models/00_settings.py
|
import os
import logging
import json
from logging.config import dictConfig
from gluon.storage import Storage
from gluon.contrib.appconfig import AppConfig
# app_config use to cache values in production
app_config = AppConfig(reload=True)
# settings is used to avoid cached values in production
settings = Storage()
# LOGGING CONFIGURATIONS
settings.logging_config = dict(main=os.path.join(request.folder,
'logging.json'),
scheduler=os.path.join(request.folder,
'logging-scheduler.json'))
# INITIALIZE LOGGING
if os.path.exists(settings.logging_config['main']):
try:
config = json.loads(open(settings.logging_config['main']).read())
logging.config.dictConfig(config)
except ValueError as e:
pass
logger = logging.getLogger(settings.app_name)
# DATABASE CONFIGURATION
# Check whether POSTGRES_ENABLED env var is set to True or not.
# If so, generate connection string.
if os.environ['POSTGRES_ENABLED'] == 'True':
settings.db_uri = 'postgres://{u}:{p}@{h}:{po}/{db}'.format(
u=app_config.get('postgres.username'),
p=app_config.get('postgres.password'),
h=app_config.get('postgres.hostname'),
po=app_config.get('postgres.port'),
db=app_config.get('postgres.database'))
else:
settings.db_uri = app_config.get('db.uri')
|
import os
import logging
import json
from logging.config import dictConfig
from gluon.storage import Storage
from gluon.contrib.appconfig import AppConfig
# app_config use to cache values in production
app_config = AppConfig(reload=True)
# settings is used to avoid cached values in production
settings = Storage()
# LOGGING CONFIGURATIONS
settings.logging_config = dict(main=os.path.join(request.folder,
'logging.json'),
scheduler=os.path.join(request.folder,
'logging-scheduler.json'))
# INITIALIZE LOGGING
if os.path.exists(settings.logging_config['main']):
try:
config = json.loads(open(settings.logging_config['main']).read())
logging.config.dictConfig(config)
except ValueError as e:
pass
logger = logging.getLogger(settings.app_name)
# DATABASE CONFIGURATION
# Check whether POSTGRES_ENABLED env var is set to True or not.
# If so, generate connection string.
if app_config.has_key('postgres'):
settings.db_uri = 'postgres://{u}:{p}@{h}:{po}/{db}'.format(
u=app_config.get('postgres.username'),
p=app_config.get('postgres.password'),
h=app_config.get('postgres.hostname'),
po=app_config.get('postgres.port'),
db=app_config.get('postgres.database'))
else:
settings.db_uri = app_config.get('db.uri')
|
Check configuration file rather than env variable
|
Check configuration file rather than env variable
|
Python
|
apache-2.0
|
wefner/w2pfooty,wefner/w2pfooty,wefner/w2pfooty
|
import os
import logging
import json
from logging.config import dictConfig
from gluon.storage import Storage
from gluon.contrib.appconfig import AppConfig
# app_config use to cache values in production
app_config = AppConfig(reload=True)
# settings is used to avoid cached values in production
settings = Storage()
# LOGGING CONFIGURATIONS
settings.logging_config = dict(main=os.path.join(request.folder,
'logging.json'),
scheduler=os.path.join(request.folder,
'logging-scheduler.json'))
# INITIALIZE LOGGING
if os.path.exists(settings.logging_config['main']):
try:
config = json.loads(open(settings.logging_config['main']).read())
logging.config.dictConfig(config)
except ValueError as e:
pass
logger = logging.getLogger(settings.app_name)
# DATABASE CONFIGURATION
# Check whether POSTGRES_ENABLED env var is set to True or not.
# If so, generate connection string.
if os.environ['POSTGRES_ENABLED'] == 'True':
settings.db_uri = 'postgres://{u}:{p}@{h}:{po}/{db}'.format(
u=app_config.get('postgres.username'),
p=app_config.get('postgres.password'),
h=app_config.get('postgres.hostname'),
po=app_config.get('postgres.port'),
db=app_config.get('postgres.database'))
else:
settings.db_uri = app_config.get('db.uri')
Check configuration file rather than env variable
|
import os
import logging
import json
from logging.config import dictConfig
from gluon.storage import Storage
from gluon.contrib.appconfig import AppConfig
# app_config use to cache values in production
app_config = AppConfig(reload=True)
# settings is used to avoid cached values in production
settings = Storage()
# LOGGING CONFIGURATIONS
settings.logging_config = dict(main=os.path.join(request.folder,
'logging.json'),
scheduler=os.path.join(request.folder,
'logging-scheduler.json'))
# INITIALIZE LOGGING
if os.path.exists(settings.logging_config['main']):
try:
config = json.loads(open(settings.logging_config['main']).read())
logging.config.dictConfig(config)
except ValueError as e:
pass
logger = logging.getLogger(settings.app_name)
# DATABASE CONFIGURATION
# Check whether POSTGRES_ENABLED env var is set to True or not.
# If so, generate connection string.
if app_config.has_key('postgres'):
settings.db_uri = 'postgres://{u}:{p}@{h}:{po}/{db}'.format(
u=app_config.get('postgres.username'),
p=app_config.get('postgres.password'),
h=app_config.get('postgres.hostname'),
po=app_config.get('postgres.port'),
db=app_config.get('postgres.database'))
else:
settings.db_uri = app_config.get('db.uri')
|
<commit_before>import os
import logging
import json
from logging.config import dictConfig
from gluon.storage import Storage
from gluon.contrib.appconfig import AppConfig
# app_config use to cache values in production
app_config = AppConfig(reload=True)
# settings is used to avoid cached values in production
settings = Storage()
# LOGGING CONFIGURATIONS
settings.logging_config = dict(main=os.path.join(request.folder,
'logging.json'),
scheduler=os.path.join(request.folder,
'logging-scheduler.json'))
# INITIALIZE LOGGING
if os.path.exists(settings.logging_config['main']):
try:
config = json.loads(open(settings.logging_config['main']).read())
logging.config.dictConfig(config)
except ValueError as e:
pass
logger = logging.getLogger(settings.app_name)
# DATABASE CONFIGURATION
# Check whether POSTGRES_ENABLED env var is set to True or not.
# If so, generate connection string.
if os.environ['POSTGRES_ENABLED'] == 'True':
settings.db_uri = 'postgres://{u}:{p}@{h}:{po}/{db}'.format(
u=app_config.get('postgres.username'),
p=app_config.get('postgres.password'),
h=app_config.get('postgres.hostname'),
po=app_config.get('postgres.port'),
db=app_config.get('postgres.database'))
else:
settings.db_uri = app_config.get('db.uri')
<commit_msg>Check configuration file rather than env variable<commit_after>
|
import os
import logging
import json
from logging.config import dictConfig
from gluon.storage import Storage
from gluon.contrib.appconfig import AppConfig
# app_config use to cache values in production
app_config = AppConfig(reload=True)
# settings is used to avoid cached values in production
settings = Storage()
# LOGGING CONFIGURATIONS
settings.logging_config = dict(main=os.path.join(request.folder,
'logging.json'),
scheduler=os.path.join(request.folder,
'logging-scheduler.json'))
# INITIALIZE LOGGING
if os.path.exists(settings.logging_config['main']):
try:
config = json.loads(open(settings.logging_config['main']).read())
logging.config.dictConfig(config)
except ValueError as e:
pass
logger = logging.getLogger(settings.app_name)
# DATABASE CONFIGURATION
# Check whether POSTGRES_ENABLED env var is set to True or not.
# If so, generate connection string.
if app_config.has_key('postgres'):
settings.db_uri = 'postgres://{u}:{p}@{h}:{po}/{db}'.format(
u=app_config.get('postgres.username'),
p=app_config.get('postgres.password'),
h=app_config.get('postgres.hostname'),
po=app_config.get('postgres.port'),
db=app_config.get('postgres.database'))
else:
settings.db_uri = app_config.get('db.uri')
|
import os
import logging
import json
from logging.config import dictConfig
from gluon.storage import Storage
from gluon.contrib.appconfig import AppConfig
# app_config use to cache values in production
app_config = AppConfig(reload=True)
# settings is used to avoid cached values in production
settings = Storage()
# LOGGING CONFIGURATIONS
settings.logging_config = dict(main=os.path.join(request.folder,
'logging.json'),
scheduler=os.path.join(request.folder,
'logging-scheduler.json'))
# INITIALIZE LOGGING
if os.path.exists(settings.logging_config['main']):
try:
config = json.loads(open(settings.logging_config['main']).read())
logging.config.dictConfig(config)
except ValueError as e:
pass
logger = logging.getLogger(settings.app_name)
# DATABASE CONFIGURATION
# Check whether POSTGRES_ENABLED env var is set to True or not.
# If so, generate connection string.
if os.environ['POSTGRES_ENABLED'] == 'True':
settings.db_uri = 'postgres://{u}:{p}@{h}:{po}/{db}'.format(
u=app_config.get('postgres.username'),
p=app_config.get('postgres.password'),
h=app_config.get('postgres.hostname'),
po=app_config.get('postgres.port'),
db=app_config.get('postgres.database'))
else:
settings.db_uri = app_config.get('db.uri')
Check configuration file rather than env variableimport os
import logging
import json
from logging.config import dictConfig
from gluon.storage import Storage
from gluon.contrib.appconfig import AppConfig
# app_config use to cache values in production
app_config = AppConfig(reload=True)
# settings is used to avoid cached values in production
settings = Storage()
# LOGGING CONFIGURATIONS
settings.logging_config = dict(main=os.path.join(request.folder,
'logging.json'),
scheduler=os.path.join(request.folder,
'logging-scheduler.json'))
# INITIALIZE LOGGING
if os.path.exists(settings.logging_config['main']):
try:
config = json.loads(open(settings.logging_config['main']).read())
logging.config.dictConfig(config)
except ValueError as e:
pass
logger = logging.getLogger(settings.app_name)
# DATABASE CONFIGURATION
# Check whether POSTGRES_ENABLED env var is set to True or not.
# If so, generate connection string.
if app_config.has_key('postgres'):
settings.db_uri = 'postgres://{u}:{p}@{h}:{po}/{db}'.format(
u=app_config.get('postgres.username'),
p=app_config.get('postgres.password'),
h=app_config.get('postgres.hostname'),
po=app_config.get('postgres.port'),
db=app_config.get('postgres.database'))
else:
settings.db_uri = app_config.get('db.uri')
|
<commit_before>import os
import logging
import json
from logging.config import dictConfig
from gluon.storage import Storage
from gluon.contrib.appconfig import AppConfig
# app_config use to cache values in production
app_config = AppConfig(reload=True)
# settings is used to avoid cached values in production
settings = Storage()
# LOGGING CONFIGURATIONS
settings.logging_config = dict(main=os.path.join(request.folder,
'logging.json'),
scheduler=os.path.join(request.folder,
'logging-scheduler.json'))
# INITIALIZE LOGGING
if os.path.exists(settings.logging_config['main']):
try:
config = json.loads(open(settings.logging_config['main']).read())
logging.config.dictConfig(config)
except ValueError as e:
pass
logger = logging.getLogger(settings.app_name)
# DATABASE CONFIGURATION
# Check whether POSTGRES_ENABLED env var is set to True or not.
# If so, generate connection string.
if os.environ['POSTGRES_ENABLED'] == 'True':
settings.db_uri = 'postgres://{u}:{p}@{h}:{po}/{db}'.format(
u=app_config.get('postgres.username'),
p=app_config.get('postgres.password'),
h=app_config.get('postgres.hostname'),
po=app_config.get('postgres.port'),
db=app_config.get('postgres.database'))
else:
settings.db_uri = app_config.get('db.uri')
<commit_msg>Check configuration file rather than env variable<commit_after>import os
import logging
import json
from logging.config import dictConfig
from gluon.storage import Storage
from gluon.contrib.appconfig import AppConfig
# app_config use to cache values in production
app_config = AppConfig(reload=True)
# settings is used to avoid cached values in production
settings = Storage()
# LOGGING CONFIGURATIONS
settings.logging_config = dict(main=os.path.join(request.folder,
'logging.json'),
scheduler=os.path.join(request.folder,
'logging-scheduler.json'))
# INITIALIZE LOGGING
if os.path.exists(settings.logging_config['main']):
try:
config = json.loads(open(settings.logging_config['main']).read())
logging.config.dictConfig(config)
except ValueError as e:
pass
logger = logging.getLogger(settings.app_name)
# DATABASE CONFIGURATION
# Check whether POSTGRES_ENABLED env var is set to True or not.
# If so, generate connection string.
if app_config.has_key('postgres'):
settings.db_uri = 'postgres://{u}:{p}@{h}:{po}/{db}'.format(
u=app_config.get('postgres.username'),
p=app_config.get('postgres.password'),
h=app_config.get('postgres.hostname'),
po=app_config.get('postgres.port'),
db=app_config.get('postgres.database'))
else:
settings.db_uri = app_config.get('db.uri')
|
6c0c05c523043abd4fb35ee53daf1a216346a94d
|
tests/runtests.py
|
tests/runtests.py
|
#!/usr/bin/env python
'''
Discover all instances of unittest.TestCase in this directory.
'''
# Import python libs
import os
# Import salt libs
import saltunittest
from integration import TestDaemon
TEST_DIR = os.path.dirname(os.path.normpath(os.path.abspath(__file__)))
def run_integration_tests():
with TestDaemon():
loader = saltunittest.TestLoader()
tests = loader.discover(os.path.join(TEST_DIR, 'integration', 'modules'), '*.py')
saltunittest.TextTestRunner(verbosity=1).run(tests)
def run_unit_tests():
loader = saltunittest.TestLoader()
tests = loader.discover(os.path.join(TEST_DIR, 'unit', 'templates'), '*.py')
saltunittest.TextTestRunner(verbosity=1).run(tests)
if __name__ == "__main__":
run_integration_tests()
run_unit_tests()
|
#!/usr/bin/env python
'''
Discover all instances of unittest.TestCase in this directory.
'''
# Import python libs
import os
# Import salt libs
import saltunittest
from integration import TestDaemon
TEST_DIR = os.path.dirname(os.path.normpath(os.path.abspath(__file__)))
def run_integration_tests():
with TestDaemon():
moduleloader = saltunittest.TestLoader()
moduletests = moduleloader.discover(os.path.join(TEST_DIR, 'integration', 'modules'), '*.py')
saltunittest.TextTestRunner(verbosity=1).run(moduletests)
clientloader = saltunittest.TestLoader()
clienttests = clientloader.discover(os.path.join(TEST_DIR, 'integration', 'client'), '*.py')
saltunittest.TextTestRunner(verbosity=1).run(clienttests)
def run_unit_tests():
loader = saltunittest.TestLoader()
tests = loader.discover(os.path.join(TEST_DIR, 'unit', 'templates'), '*.py')
saltunittest.TextTestRunner(verbosity=1).run(tests)
if __name__ == "__main__":
run_integration_tests()
run_unit_tests()
|
Add support for a dir of client tests
|
Add support for a dir of client tests
|
Python
|
apache-2.0
|
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
|
#!/usr/bin/env python
'''
Discover all instances of unittest.TestCase in this directory.
'''
# Import python libs
import os
# Import salt libs
import saltunittest
from integration import TestDaemon
TEST_DIR = os.path.dirname(os.path.normpath(os.path.abspath(__file__)))
def run_integration_tests():
with TestDaemon():
loader = saltunittest.TestLoader()
tests = loader.discover(os.path.join(TEST_DIR, 'integration', 'modules'), '*.py')
saltunittest.TextTestRunner(verbosity=1).run(tests)
def run_unit_tests():
loader = saltunittest.TestLoader()
tests = loader.discover(os.path.join(TEST_DIR, 'unit', 'templates'), '*.py')
saltunittest.TextTestRunner(verbosity=1).run(tests)
if __name__ == "__main__":
run_integration_tests()
run_unit_tests()
Add support for a dir of client tests
|
#!/usr/bin/env python
'''
Discover all instances of unittest.TestCase in this directory.
'''
# Import python libs
import os
# Import salt libs
import saltunittest
from integration import TestDaemon
TEST_DIR = os.path.dirname(os.path.normpath(os.path.abspath(__file__)))
def run_integration_tests():
with TestDaemon():
moduleloader = saltunittest.TestLoader()
moduletests = moduleloader.discover(os.path.join(TEST_DIR, 'integration', 'modules'), '*.py')
saltunittest.TextTestRunner(verbosity=1).run(moduletests)
clientloader = saltunittest.TestLoader()
clienttests = clientloader.discover(os.path.join(TEST_DIR, 'integration', 'client'), '*.py')
saltunittest.TextTestRunner(verbosity=1).run(clienttests)
def run_unit_tests():
loader = saltunittest.TestLoader()
tests = loader.discover(os.path.join(TEST_DIR, 'unit', 'templates'), '*.py')
saltunittest.TextTestRunner(verbosity=1).run(tests)
if __name__ == "__main__":
run_integration_tests()
run_unit_tests()
|
<commit_before>#!/usr/bin/env python
'''
Discover all instances of unittest.TestCase in this directory.
'''
# Import python libs
import os
# Import salt libs
import saltunittest
from integration import TestDaemon
TEST_DIR = os.path.dirname(os.path.normpath(os.path.abspath(__file__)))
def run_integration_tests():
with TestDaemon():
loader = saltunittest.TestLoader()
tests = loader.discover(os.path.join(TEST_DIR, 'integration', 'modules'), '*.py')
saltunittest.TextTestRunner(verbosity=1).run(tests)
def run_unit_tests():
loader = saltunittest.TestLoader()
tests = loader.discover(os.path.join(TEST_DIR, 'unit', 'templates'), '*.py')
saltunittest.TextTestRunner(verbosity=1).run(tests)
if __name__ == "__main__":
run_integration_tests()
run_unit_tests()
<commit_msg>Add support for a dir of client tests<commit_after>
|
#!/usr/bin/env python
'''
Discover all instances of unittest.TestCase in this directory.
'''
# Import python libs
import os
# Import salt libs
import saltunittest
from integration import TestDaemon
TEST_DIR = os.path.dirname(os.path.normpath(os.path.abspath(__file__)))
def run_integration_tests():
with TestDaemon():
moduleloader = saltunittest.TestLoader()
moduletests = moduleloader.discover(os.path.join(TEST_DIR, 'integration', 'modules'), '*.py')
saltunittest.TextTestRunner(verbosity=1).run(moduletests)
clientloader = saltunittest.TestLoader()
clienttests = clientloader.discover(os.path.join(TEST_DIR, 'integration', 'client'), '*.py')
saltunittest.TextTestRunner(verbosity=1).run(clienttests)
def run_unit_tests():
loader = saltunittest.TestLoader()
tests = loader.discover(os.path.join(TEST_DIR, 'unit', 'templates'), '*.py')
saltunittest.TextTestRunner(verbosity=1).run(tests)
if __name__ == "__main__":
run_integration_tests()
run_unit_tests()
|
#!/usr/bin/env python
'''
Discover all instances of unittest.TestCase in this directory.
'''
# Import python libs
import os
# Import salt libs
import saltunittest
from integration import TestDaemon
TEST_DIR = os.path.dirname(os.path.normpath(os.path.abspath(__file__)))
def run_integration_tests():
with TestDaemon():
loader = saltunittest.TestLoader()
tests = loader.discover(os.path.join(TEST_DIR, 'integration', 'modules'), '*.py')
saltunittest.TextTestRunner(verbosity=1).run(tests)
def run_unit_tests():
loader = saltunittest.TestLoader()
tests = loader.discover(os.path.join(TEST_DIR, 'unit', 'templates'), '*.py')
saltunittest.TextTestRunner(verbosity=1).run(tests)
if __name__ == "__main__":
run_integration_tests()
run_unit_tests()
Add support for a dir of client tests#!/usr/bin/env python
'''
Discover all instances of unittest.TestCase in this directory.
'''
# Import python libs
import os
# Import salt libs
import saltunittest
from integration import TestDaemon
TEST_DIR = os.path.dirname(os.path.normpath(os.path.abspath(__file__)))
def run_integration_tests():
with TestDaemon():
moduleloader = saltunittest.TestLoader()
moduletests = moduleloader.discover(os.path.join(TEST_DIR, 'integration', 'modules'), '*.py')
saltunittest.TextTestRunner(verbosity=1).run(moduletests)
clientloader = saltunittest.TestLoader()
clienttests = clientloader.discover(os.path.join(TEST_DIR, 'integration', 'client'), '*.py')
saltunittest.TextTestRunner(verbosity=1).run(clienttests)
def run_unit_tests():
loader = saltunittest.TestLoader()
tests = loader.discover(os.path.join(TEST_DIR, 'unit', 'templates'), '*.py')
saltunittest.TextTestRunner(verbosity=1).run(tests)
if __name__ == "__main__":
run_integration_tests()
run_unit_tests()
|
<commit_before>#!/usr/bin/env python
'''
Discover all instances of unittest.TestCase in this directory.
'''
# Import python libs
import os
# Import salt libs
import saltunittest
from integration import TestDaemon
TEST_DIR = os.path.dirname(os.path.normpath(os.path.abspath(__file__)))
def run_integration_tests():
with TestDaemon():
loader = saltunittest.TestLoader()
tests = loader.discover(os.path.join(TEST_DIR, 'integration', 'modules'), '*.py')
saltunittest.TextTestRunner(verbosity=1).run(tests)
def run_unit_tests():
loader = saltunittest.TestLoader()
tests = loader.discover(os.path.join(TEST_DIR, 'unit', 'templates'), '*.py')
saltunittest.TextTestRunner(verbosity=1).run(tests)
if __name__ == "__main__":
run_integration_tests()
run_unit_tests()
<commit_msg>Add support for a dir of client tests<commit_after>#!/usr/bin/env python
'''
Discover all instances of unittest.TestCase in this directory.
'''
# Import python libs
import os
# Import salt libs
import saltunittest
from integration import TestDaemon
TEST_DIR = os.path.dirname(os.path.normpath(os.path.abspath(__file__)))
def run_integration_tests():
with TestDaemon():
moduleloader = saltunittest.TestLoader()
moduletests = moduleloader.discover(os.path.join(TEST_DIR, 'integration', 'modules'), '*.py')
saltunittest.TextTestRunner(verbosity=1).run(moduletests)
clientloader = saltunittest.TestLoader()
clienttests = clientloader.discover(os.path.join(TEST_DIR, 'integration', 'client'), '*.py')
saltunittest.TextTestRunner(verbosity=1).run(clienttests)
def run_unit_tests():
loader = saltunittest.TestLoader()
tests = loader.discover(os.path.join(TEST_DIR, 'unit', 'templates'), '*.py')
saltunittest.TextTestRunner(verbosity=1).run(tests)
if __name__ == "__main__":
run_integration_tests()
run_unit_tests()
|
6c2d73b0d387eb49e38b0432318733b56d2deb96
|
tests/settings.py
|
tests/settings.py
|
SECRET_KEY = 'not-anymore'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
}
INSTALLED_APPS = [
'tests',
]
|
SECRET_KEY = 'not-anymore'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
}
INSTALLED_APPS = [
'tests',
]
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
|
Add support for Django 4.0.
|
Add support for Django 4.0.
|
Python
|
mit
|
gintas/django-picklefield
|
SECRET_KEY = 'not-anymore'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
}
INSTALLED_APPS = [
'tests',
]
Add support for Django 4.0.
|
SECRET_KEY = 'not-anymore'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
}
INSTALLED_APPS = [
'tests',
]
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
|
<commit_before>SECRET_KEY = 'not-anymore'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
}
INSTALLED_APPS = [
'tests',
]
<commit_msg>Add support for Django 4.0.<commit_after>
|
SECRET_KEY = 'not-anymore'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
}
INSTALLED_APPS = [
'tests',
]
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
|
SECRET_KEY = 'not-anymore'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
}
INSTALLED_APPS = [
'tests',
]
Add support for Django 4.0.SECRET_KEY = 'not-anymore'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
}
INSTALLED_APPS = [
'tests',
]
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
|
<commit_before>SECRET_KEY = 'not-anymore'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
}
INSTALLED_APPS = [
'tests',
]
<commit_msg>Add support for Django 4.0.<commit_after>SECRET_KEY = 'not-anymore'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
}
INSTALLED_APPS = [
'tests',
]
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
|
8d7862a7045fbb52ce3a2499766ffa1ffef284af
|
tests/settings.py
|
tests/settings.py
|
"""
Settings for tests.
"""
from moztrap.settings.default import *
DEFAULT_FILE_STORAGE = "tests.storage.MemoryStorage"
ALLOW_ANONYMOUS_ACCESS = False
SITE_URL = "http://localhost:80"
USE_BROWSERID = True
|
"""
Settings for tests.
"""
from moztrap.settings.default import *
DEFAULT_FILE_STORAGE = "tests.storage.MemoryStorage"
ALLOW_ANONYMOUS_ACCESS = False
SITE_URL = "http://localhost:80"
USE_BROWSERID = True
PASSWORD_HASHERS = ['django.contrib.auth.hashers.UnsaltedMD5PasswordHasher']
|
Use faster password hashing in tests.
|
Use faster password hashing in tests.
|
Python
|
bsd-2-clause
|
mccarrmb/moztrap,bobsilverberg/moztrap,mozilla/moztrap,mccarrmb/moztrap,shinglyu/moztrap,mccarrmb/moztrap,shinglyu/moztrap,mccarrmb/moztrap,shinglyu/moztrap,mccarrmb/moztrap,bobsilverberg/moztrap,mozilla/moztrap,bobsilverberg/moztrap,shinglyu/moztrap,mozilla/moztrap,shinglyu/moztrap,bobsilverberg/moztrap,mozilla/moztrap,mozilla/moztrap
|
"""
Settings for tests.
"""
from moztrap.settings.default import *
DEFAULT_FILE_STORAGE = "tests.storage.MemoryStorage"
ALLOW_ANONYMOUS_ACCESS = False
SITE_URL = "http://localhost:80"
USE_BROWSERID = True
Use faster password hashing in tests.
|
"""
Settings for tests.
"""
from moztrap.settings.default import *
DEFAULT_FILE_STORAGE = "tests.storage.MemoryStorage"
ALLOW_ANONYMOUS_ACCESS = False
SITE_URL = "http://localhost:80"
USE_BROWSERID = True
PASSWORD_HASHERS = ['django.contrib.auth.hashers.UnsaltedMD5PasswordHasher']
|
<commit_before>"""
Settings for tests.
"""
from moztrap.settings.default import *
DEFAULT_FILE_STORAGE = "tests.storage.MemoryStorage"
ALLOW_ANONYMOUS_ACCESS = False
SITE_URL = "http://localhost:80"
USE_BROWSERID = True
<commit_msg>Use faster password hashing in tests.<commit_after>
|
"""
Settings for tests.
"""
from moztrap.settings.default import *
DEFAULT_FILE_STORAGE = "tests.storage.MemoryStorage"
ALLOW_ANONYMOUS_ACCESS = False
SITE_URL = "http://localhost:80"
USE_BROWSERID = True
PASSWORD_HASHERS = ['django.contrib.auth.hashers.UnsaltedMD5PasswordHasher']
|
"""
Settings for tests.
"""
from moztrap.settings.default import *
DEFAULT_FILE_STORAGE = "tests.storage.MemoryStorage"
ALLOW_ANONYMOUS_ACCESS = False
SITE_URL = "http://localhost:80"
USE_BROWSERID = True
Use faster password hashing in tests."""
Settings for tests.
"""
from moztrap.settings.default import *
DEFAULT_FILE_STORAGE = "tests.storage.MemoryStorage"
ALLOW_ANONYMOUS_ACCESS = False
SITE_URL = "http://localhost:80"
USE_BROWSERID = True
PASSWORD_HASHERS = ['django.contrib.auth.hashers.UnsaltedMD5PasswordHasher']
|
<commit_before>"""
Settings for tests.
"""
from moztrap.settings.default import *
DEFAULT_FILE_STORAGE = "tests.storage.MemoryStorage"
ALLOW_ANONYMOUS_ACCESS = False
SITE_URL = "http://localhost:80"
USE_BROWSERID = True
<commit_msg>Use faster password hashing in tests.<commit_after>"""
Settings for tests.
"""
from moztrap.settings.default import *
DEFAULT_FILE_STORAGE = "tests.storage.MemoryStorage"
ALLOW_ANONYMOUS_ACCESS = False
SITE_URL = "http://localhost:80"
USE_BROWSERID = True
PASSWORD_HASHERS = ['django.contrib.auth.hashers.UnsaltedMD5PasswordHasher']
|
cd599444433fd32f989fa4f61a3b19f773b12f0e
|
readthedocs/profiles/urls/public.py
|
readthedocs/profiles/urls/public.py
|
from django.conf.urls import *
from profiles import views
urlpatterns = patterns('',
url(r'^(?P<username>[\w.-]+)/$',
views.profile_detail,
{'template_name': 'profiles/public/profile_detail.html'},
name='profiles_profile_detail'),
)
|
from django.conf.urls import *
from profiles import views
urlpatterns = patterns('',
url(r'^(?P<username>[\w@.-]+)/$',
views.profile_detail,
{'template_name': 'profiles/public/profile_detail.html'},
name='profiles_profile_detail'),
)
|
Allow email in profile urls
|
Allow email in profile urls
|
Python
|
mit
|
techtonik/readthedocs.org,sid-kap/readthedocs.org,agjohnson/readthedocs.org,asampat3090/readthedocs.org,CedarLogic/readthedocs.org,soulshake/readthedocs.org,LukasBoersma/readthedocs.org,VishvajitP/readthedocs.org,KamranMackey/readthedocs.org,nikolas/readthedocs.org,VishvajitP/readthedocs.org,wanghaven/readthedocs.org,safwanrahman/readthedocs.org,pombredanne/readthedocs.org,laplaceliu/readthedocs.org,fujita-shintaro/readthedocs.org,takluyver/readthedocs.org,sid-kap/readthedocs.org,pombredanne/readthedocs.org,kdkeyser/readthedocs.org,singingwolfboy/readthedocs.org,espdev/readthedocs.org,nikolas/readthedocs.org,kdkeyser/readthedocs.org,dirn/readthedocs.org,mrshoki/readthedocs.org,wanghaven/readthedocs.org,espdev/readthedocs.org,SteveViss/readthedocs.org,wijerasa/readthedocs.org,hach-que/readthedocs.org,mhils/readthedocs.org,michaelmcandrew/readthedocs.org,dirn/readthedocs.org,Carreau/readthedocs.org,Tazer/readthedocs.org,hach-que/readthedocs.org,clarkperkins/readthedocs.org,kenwang76/readthedocs.org,pombredanne/readthedocs.org,Carreau/readthedocs.org,raven47git/readthedocs.org,atsuyim/readthedocs.org,cgourlay/readthedocs.org,clarkperkins/readthedocs.org,emawind84/readthedocs.org,fujita-shintaro/readthedocs.org,hach-que/readthedocs.org,davidfischer/readthedocs.org,michaelmcandrew/readthedocs.org,istresearch/readthedocs.org,Carreau/readthedocs.org,techtonik/readthedocs.org,GovReady/readthedocs.org,kenshinthebattosai/readthedocs.org,sils1297/readthedocs.org,rtfd/readthedocs.org,sid-kap/readthedocs.org,royalwang/readthedocs.org,tddv/readthedocs.org,asampat3090/readthedocs.org,KamranMackey/readthedocs.org,techtonik/readthedocs.org,takluyver/readthedocs.org,sils1297/readthedocs.org,sid-kap/readthedocs.org,royalwang/readthedocs.org,SteveViss/readthedocs.org,soulshake/readthedocs.org,Tazer/readthedocs.org,kenwang76/readthedocs.org,nikolas/readthedocs.org,michaelmcandrew/readthedocs.org,emawind84/readthedocs.org,VishvajitP/readthedocs.org,cgourlay/readthedocs.org,LukasBoersma/readthedocs.org,davidfischer/readthedocs.org,singingwolfboy/readthedocs.org,laplaceliu/readthedocs.org,titiushko/readthedocs.org,CedarLogic/readthedocs.org,safwanrahman/readthedocs.org,gjtorikian/readthedocs.org,raven47git/readthedocs.org,attakei/readthedocs-oauth,KamranMackey/readthedocs.org,davidfischer/readthedocs.org,Tazer/readthedocs.org,espdev/readthedocs.org,titiushko/readthedocs.org,asampat3090/readthedocs.org,istresearch/readthedocs.org,espdev/readthedocs.org,d0ugal/readthedocs.org,wijerasa/readthedocs.org,tddv/readthedocs.org,kenshinthebattosai/readthedocs.org,rtfd/readthedocs.org,davidfischer/readthedocs.org,wanghaven/readthedocs.org,soulshake/readthedocs.org,mrshoki/readthedocs.org,stevepiercy/readthedocs.org,Tazer/readthedocs.org,sunnyzwh/readthedocs.org,safwanrahman/readthedocs.org,emawind84/readthedocs.org,d0ugal/readthedocs.org,fujita-shintaro/readthedocs.org,laplaceliu/readthedocs.org,SteveViss/readthedocs.org,sunnyzwh/readthedocs.org,gjtorikian/readthedocs.org,singingwolfboy/readthedocs.org,wanghaven/readthedocs.org,mhils/readthedocs.org,michaelmcandrew/readthedocs.org,d0ugal/readthedocs.org,agjohnson/readthedocs.org,gjtorikian/readthedocs.org,cgourlay/readthedocs.org,clarkperkins/readthedocs.org,attakei/readthedocs-oauth,asampat3090/readthedocs.org,SteveViss/readthedocs.org,d0ugal/readthedocs.org,wijerasa/readthedocs.org,istresearch/readthedocs.org,laplaceliu/readthedocs.org,LukasBoersma/readthedocs.org,VishvajitP/readthedocs.org,rtfd/readthedocs.org,raven47git/readthedocs.org,kenshinthebattosai/readthedocs.org,dirn/readthedocs.org,clarkperkins/readthedocs.org,jerel/readthedocs.org,sils1297/readthedocs.org,GovReady/readthedocs.org,atsuyim/readthedocs.org,mrshoki/readthedocs.org,singingwolfboy/readthedocs.org,gjtorikian/readthedocs.org,mrshoki/readthedocs.org,attakei/readthedocs-oauth,sils1297/readthedocs.org,jerel/readthedocs.org,LukasBoersma/readthedocs.org,fujita-shintaro/readthedocs.org,raven47git/readthedocs.org,agjohnson/readthedocs.org,safwanrahman/readthedocs.org,kdkeyser/readthedocs.org,royalwang/readthedocs.org,sunnyzwh/readthedocs.org,nikolas/readthedocs.org,titiushko/readthedocs.org,sunnyzwh/readthedocs.org,stevepiercy/readthedocs.org,KamranMackey/readthedocs.org,stevepiercy/readthedocs.org,soulshake/readthedocs.org,espdev/readthedocs.org,dirn/readthedocs.org,CedarLogic/readthedocs.org,royalwang/readthedocs.org,jerel/readthedocs.org,atsuyim/readthedocs.org,kdkeyser/readthedocs.org,techtonik/readthedocs.org,agjohnson/readthedocs.org,takluyver/readthedocs.org,atsuyim/readthedocs.org,kenwang76/readthedocs.org,GovReady/readthedocs.org,cgourlay/readthedocs.org,Carreau/readthedocs.org,mhils/readthedocs.org,takluyver/readthedocs.org,rtfd/readthedocs.org,stevepiercy/readthedocs.org,attakei/readthedocs-oauth,wijerasa/readthedocs.org,emawind84/readthedocs.org,tddv/readthedocs.org,istresearch/readthedocs.org,hach-que/readthedocs.org,CedarLogic/readthedocs.org,GovReady/readthedocs.org,jerel/readthedocs.org,titiushko/readthedocs.org,kenshinthebattosai/readthedocs.org,mhils/readthedocs.org,kenwang76/readthedocs.org
|
from django.conf.urls import *
from profiles import views
urlpatterns = patterns('',
url(r'^(?P<username>[\w.-]+)/$',
views.profile_detail,
{'template_name': 'profiles/public/profile_detail.html'},
name='profiles_profile_detail'),
)
Allow email in profile urls
|
from django.conf.urls import *
from profiles import views
urlpatterns = patterns('',
url(r'^(?P<username>[\w@.-]+)/$',
views.profile_detail,
{'template_name': 'profiles/public/profile_detail.html'},
name='profiles_profile_detail'),
)
|
<commit_before>from django.conf.urls import *
from profiles import views
urlpatterns = patterns('',
url(r'^(?P<username>[\w.-]+)/$',
views.profile_detail,
{'template_name': 'profiles/public/profile_detail.html'},
name='profiles_profile_detail'),
)
<commit_msg>Allow email in profile urls<commit_after>
|
from django.conf.urls import *
from profiles import views
urlpatterns = patterns('',
url(r'^(?P<username>[\w@.-]+)/$',
views.profile_detail,
{'template_name': 'profiles/public/profile_detail.html'},
name='profiles_profile_detail'),
)
|
from django.conf.urls import *
from profiles import views
urlpatterns = patterns('',
url(r'^(?P<username>[\w.-]+)/$',
views.profile_detail,
{'template_name': 'profiles/public/profile_detail.html'},
name='profiles_profile_detail'),
)
Allow email in profile urlsfrom django.conf.urls import *
from profiles import views
urlpatterns = patterns('',
url(r'^(?P<username>[\w@.-]+)/$',
views.profile_detail,
{'template_name': 'profiles/public/profile_detail.html'},
name='profiles_profile_detail'),
)
|
<commit_before>from django.conf.urls import *
from profiles import views
urlpatterns = patterns('',
url(r'^(?P<username>[\w.-]+)/$',
views.profile_detail,
{'template_name': 'profiles/public/profile_detail.html'},
name='profiles_profile_detail'),
)
<commit_msg>Allow email in profile urls<commit_after>from django.conf.urls import *
from profiles import views
urlpatterns = patterns('',
url(r'^(?P<username>[\w@.-]+)/$',
views.profile_detail,
{'template_name': 'profiles/public/profile_detail.html'},
name='profiles_profile_detail'),
)
|
81215120afffe54b17be3f38bbc2ac292452c0c4
|
addons/mail/models/ir_attachment.py
|
addons/mail/models/ir_attachment.py
|
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class IrAttachment(models.Model):
_inherit = 'ir.attachment'
@api.multi
def _post_add_create(self):
""" Overrides behaviour when the attachment is created through the controller
"""
super(IrAttachment, self)._post_add_create()
for record in self:
record.register_as_main_attachment(force=False)
@api.multi
def unlink(self):
self.remove_as_main_attachment()
super(IrAttachment, self).unlink()
@api.multi
def remove_as_main_attachment(self):
for attachment in self:
related_record = self.env[attachment.res_model].browse(attachment.res_id)
if related_record and hasattr(related_record, 'message_main_attachment_id'):
if related_record.message_main_attachment_id == attachment:
related_record.message_main_attachment_id = False
def register_as_main_attachment(self, force=True):
""" Registers this attachment as the main one of the model it is
attached to.
"""
self.ensure_one()
related_record = self.env[self.res_model].browse(self.res_id)
# message_main_attachment_id field can be empty, that's why we compare to False;
# we are just checking that it exists on the model before writing it
if related_record and hasattr(related_record, 'message_main_attachment_id'):
if force or not related_record.message_main_attachment_id:
related_record.message_main_attachment_id = self
|
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class IrAttachment(models.Model):
_inherit = 'ir.attachment'
@api.multi
def _post_add_create(self):
""" Overrides behaviour when the attachment is created through the controller
"""
super(IrAttachment, self)._post_add_create()
for record in self:
record.register_as_main_attachment(force=False)
def register_as_main_attachment(self, force=True):
""" Registers this attachment as the main one of the model it is
attached to.
"""
self.ensure_one()
related_record = self.env[self.res_model].browse(self.res_id)
# message_main_attachment_id field can be empty, that's why we compare to False;
# we are just checking that it exists on the model before writing it
if related_record and hasattr(related_record, 'message_main_attachment_id'):
if force or not related_record.message_main_attachment_id:
related_record.message_main_attachment_id = self
|
Revert "[FIX] mail: remove attachment as main at unlink"
|
Revert "[FIX] mail: remove attachment as main at unlink"
This reverts commit abc45b1
Since by default the ondelete attribute of a many2one is `set null`,
this was completely unnecessary to begin with.
Bug caused by this commit:
Unlink a record that has some attachments.
The unlink first removes the record, then its related attachments.
It calls remove_as_main_attachment, which reads the attachment res_model and
res_id. This triggers a check that the related record can be read.
However the related record has already been removed, an exception is raised.
It is thus impossible to unlink a record.
Closes #32563
closes odoo/odoo#32572
Signed-off-by: Raphael Collet (rco) <fcee45b878db1f337818c5c606c1542797080a40@openerp.com>
|
Python
|
agpl-3.0
|
ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo
|
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class IrAttachment(models.Model):
_inherit = 'ir.attachment'
@api.multi
def _post_add_create(self):
""" Overrides behaviour when the attachment is created through the controller
"""
super(IrAttachment, self)._post_add_create()
for record in self:
record.register_as_main_attachment(force=False)
@api.multi
def unlink(self):
self.remove_as_main_attachment()
super(IrAttachment, self).unlink()
@api.multi
def remove_as_main_attachment(self):
for attachment in self:
related_record = self.env[attachment.res_model].browse(attachment.res_id)
if related_record and hasattr(related_record, 'message_main_attachment_id'):
if related_record.message_main_attachment_id == attachment:
related_record.message_main_attachment_id = False
def register_as_main_attachment(self, force=True):
""" Registers this attachment as the main one of the model it is
attached to.
"""
self.ensure_one()
related_record = self.env[self.res_model].browse(self.res_id)
# message_main_attachment_id field can be empty, that's why we compare to False;
# we are just checking that it exists on the model before writing it
if related_record and hasattr(related_record, 'message_main_attachment_id'):
if force or not related_record.message_main_attachment_id:
related_record.message_main_attachment_id = self
Revert "[FIX] mail: remove attachment as main at unlink"
This reverts commit abc45b1
Since by default the ondelete attribute of a many2one is `set null`,
this was completely unnecessary to begin with.
Bug caused by this commit:
Unlink a record that has some attachments.
The unlink first removes the record, then its related attachments.
It calls remove_as_main_attachment, which reads the attachment res_model and
res_id. This triggers a check that the related record can be read.
However the related record has already been removed, an exception is raised.
It is thus impossible to unlink a record.
Closes #32563
closes odoo/odoo#32572
Signed-off-by: Raphael Collet (rco) <fcee45b878db1f337818c5c606c1542797080a40@openerp.com>
|
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class IrAttachment(models.Model):
_inherit = 'ir.attachment'
@api.multi
def _post_add_create(self):
""" Overrides behaviour when the attachment is created through the controller
"""
super(IrAttachment, self)._post_add_create()
for record in self:
record.register_as_main_attachment(force=False)
def register_as_main_attachment(self, force=True):
""" Registers this attachment as the main one of the model it is
attached to.
"""
self.ensure_one()
related_record = self.env[self.res_model].browse(self.res_id)
# message_main_attachment_id field can be empty, that's why we compare to False;
# we are just checking that it exists on the model before writing it
if related_record and hasattr(related_record, 'message_main_attachment_id'):
if force or not related_record.message_main_attachment_id:
related_record.message_main_attachment_id = self
|
<commit_before># -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class IrAttachment(models.Model):
_inherit = 'ir.attachment'
@api.multi
def _post_add_create(self):
""" Overrides behaviour when the attachment is created through the controller
"""
super(IrAttachment, self)._post_add_create()
for record in self:
record.register_as_main_attachment(force=False)
@api.multi
def unlink(self):
self.remove_as_main_attachment()
super(IrAttachment, self).unlink()
@api.multi
def remove_as_main_attachment(self):
for attachment in self:
related_record = self.env[attachment.res_model].browse(attachment.res_id)
if related_record and hasattr(related_record, 'message_main_attachment_id'):
if related_record.message_main_attachment_id == attachment:
related_record.message_main_attachment_id = False
def register_as_main_attachment(self, force=True):
""" Registers this attachment as the main one of the model it is
attached to.
"""
self.ensure_one()
related_record = self.env[self.res_model].browse(self.res_id)
# message_main_attachment_id field can be empty, that's why we compare to False;
# we are just checking that it exists on the model before writing it
if related_record and hasattr(related_record, 'message_main_attachment_id'):
if force or not related_record.message_main_attachment_id:
related_record.message_main_attachment_id = self
<commit_msg>Revert "[FIX] mail: remove attachment as main at unlink"
This reverts commit abc45b1
Since by default the ondelete attribute of a many2one is `set null`,
this was completely unnecessary to begin with.
Bug caused by this commit:
Unlink a record that has some attachments.
The unlink first removes the record, then its related attachments.
It calls remove_as_main_attachment, which reads the attachment res_model and
res_id. This triggers a check that the related record can be read.
However the related record has already been removed, an exception is raised.
It is thus impossible to unlink a record.
Closes #32563
closes odoo/odoo#32572
Signed-off-by: Raphael Collet (rco) <fcee45b878db1f337818c5c606c1542797080a40@openerp.com><commit_after>
|
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class IrAttachment(models.Model):
_inherit = 'ir.attachment'
@api.multi
def _post_add_create(self):
""" Overrides behaviour when the attachment is created through the controller
"""
super(IrAttachment, self)._post_add_create()
for record in self:
record.register_as_main_attachment(force=False)
def register_as_main_attachment(self, force=True):
""" Registers this attachment as the main one of the model it is
attached to.
"""
self.ensure_one()
related_record = self.env[self.res_model].browse(self.res_id)
# message_main_attachment_id field can be empty, that's why we compare to False;
# we are just checking that it exists on the model before writing it
if related_record and hasattr(related_record, 'message_main_attachment_id'):
if force or not related_record.message_main_attachment_id:
related_record.message_main_attachment_id = self
|
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class IrAttachment(models.Model):
_inherit = 'ir.attachment'
@api.multi
def _post_add_create(self):
""" Overrides behaviour when the attachment is created through the controller
"""
super(IrAttachment, self)._post_add_create()
for record in self:
record.register_as_main_attachment(force=False)
@api.multi
def unlink(self):
self.remove_as_main_attachment()
super(IrAttachment, self).unlink()
@api.multi
def remove_as_main_attachment(self):
for attachment in self:
related_record = self.env[attachment.res_model].browse(attachment.res_id)
if related_record and hasattr(related_record, 'message_main_attachment_id'):
if related_record.message_main_attachment_id == attachment:
related_record.message_main_attachment_id = False
def register_as_main_attachment(self, force=True):
""" Registers this attachment as the main one of the model it is
attached to.
"""
self.ensure_one()
related_record = self.env[self.res_model].browse(self.res_id)
# message_main_attachment_id field can be empty, that's why we compare to False;
# we are just checking that it exists on the model before writing it
if related_record and hasattr(related_record, 'message_main_attachment_id'):
if force or not related_record.message_main_attachment_id:
related_record.message_main_attachment_id = self
Revert "[FIX] mail: remove attachment as main at unlink"
This reverts commit abc45b1
Since by default the ondelete attribute of a many2one is `set null`,
this was completely unnecessary to begin with.
Bug caused by this commit:
Unlink a record that has some attachments.
The unlink first removes the record, then its related attachments.
It calls remove_as_main_attachment, which reads the attachment res_model and
res_id. This triggers a check that the related record can be read.
However the related record has already been removed, an exception is raised.
It is thus impossible to unlink a record.
Closes #32563
closes odoo/odoo#32572
Signed-off-by: Raphael Collet (rco) <fcee45b878db1f337818c5c606c1542797080a40@openerp.com># -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class IrAttachment(models.Model):
_inherit = 'ir.attachment'
@api.multi
def _post_add_create(self):
""" Overrides behaviour when the attachment is created through the controller
"""
super(IrAttachment, self)._post_add_create()
for record in self:
record.register_as_main_attachment(force=False)
def register_as_main_attachment(self, force=True):
""" Registers this attachment as the main one of the model it is
attached to.
"""
self.ensure_one()
related_record = self.env[self.res_model].browse(self.res_id)
# message_main_attachment_id field can be empty, that's why we compare to False;
# we are just checking that it exists on the model before writing it
if related_record and hasattr(related_record, 'message_main_attachment_id'):
if force or not related_record.message_main_attachment_id:
related_record.message_main_attachment_id = self
|
<commit_before># -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class IrAttachment(models.Model):
_inherit = 'ir.attachment'
@api.multi
def _post_add_create(self):
""" Overrides behaviour when the attachment is created through the controller
"""
super(IrAttachment, self)._post_add_create()
for record in self:
record.register_as_main_attachment(force=False)
@api.multi
def unlink(self):
self.remove_as_main_attachment()
super(IrAttachment, self).unlink()
@api.multi
def remove_as_main_attachment(self):
for attachment in self:
related_record = self.env[attachment.res_model].browse(attachment.res_id)
if related_record and hasattr(related_record, 'message_main_attachment_id'):
if related_record.message_main_attachment_id == attachment:
related_record.message_main_attachment_id = False
def register_as_main_attachment(self, force=True):
""" Registers this attachment as the main one of the model it is
attached to.
"""
self.ensure_one()
related_record = self.env[self.res_model].browse(self.res_id)
# message_main_attachment_id field can be empty, that's why we compare to False;
# we are just checking that it exists on the model before writing it
if related_record and hasattr(related_record, 'message_main_attachment_id'):
if force or not related_record.message_main_attachment_id:
related_record.message_main_attachment_id = self
<commit_msg>Revert "[FIX] mail: remove attachment as main at unlink"
This reverts commit abc45b1
Since by default the ondelete attribute of a many2one is `set null`,
this was completely unnecessary to begin with.
Bug caused by this commit:
Unlink a record that has some attachments.
The unlink first removes the record, then its related attachments.
It calls remove_as_main_attachment, which reads the attachment res_model and
res_id. This triggers a check that the related record can be read.
However the related record has already been removed, an exception is raised.
It is thus impossible to unlink a record.
Closes #32563
closes odoo/odoo#32572
Signed-off-by: Raphael Collet (rco) <fcee45b878db1f337818c5c606c1542797080a40@openerp.com><commit_after># -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class IrAttachment(models.Model):
_inherit = 'ir.attachment'
@api.multi
def _post_add_create(self):
""" Overrides behaviour when the attachment is created through the controller
"""
super(IrAttachment, self)._post_add_create()
for record in self:
record.register_as_main_attachment(force=False)
def register_as_main_attachment(self, force=True):
""" Registers this attachment as the main one of the model it is
attached to.
"""
self.ensure_one()
related_record = self.env[self.res_model].browse(self.res_id)
# message_main_attachment_id field can be empty, that's why we compare to False;
# we are just checking that it exists on the model before writing it
if related_record and hasattr(related_record, 'message_main_attachment_id'):
if force or not related_record.message_main_attachment_id:
related_record.message_main_attachment_id = self
|
da3e6b3c59e2c0d94f165e526daefd33fc9d8d79
|
napper_kittydar.py
|
napper_kittydar.py
|
import sys, socket, time, logging
import shlex, subprocess
from hdfs import *
logging.basicConfig()
if len(sys.argv) < 4:
print "usage: napper_kittydar <job name> <worker ID> <executable>"
sys.exit(1)
job_name = sys.argv[1]
worker_id = int(sys.argv[2])
kittydar_path = " ".join(sys.argv[3:])
# fetch inputs from HDFS if necessary
hdfs_fetch_file("/input/kittys/CAT_0%d" % (worker_id), os.environ['FLAGS_task_data_dir'])
# execute program
command = "nodejs %s --dir %s/CAT_0%d" % (kittydar_path, os.environ['FLAGS_task_data_dir'], worker_id)
print "RUNNING: %s" % (command)
subprocess.call(shlex.split(command))
print "Deleting scratch data..."
del_command = "rm -rf %s" % (os.environ['FLAGS_task_data_dir'])
subprocess.call(shlex.split(del_command))
print "All done -- goodbye from Napper!"
sys.exit(0)
|
import sys, socket, time, logging
import shlex, subprocess
from hdfs import *
logging.basicConfig()
if len(sys.argv) < 4:
print "usage: napper_kittydar <job name> <worker ID> <executable>"
sys.exit(1)
job_name = sys.argv[1]
worker_id = int(sys.argv[2])
kittydar_path = " ".join(sys.argv[3:])
# fetch inputs from HDFS if necessary
hdfs_fetch_file("/input/kittys/CAT_0%d" % (worker_id), os.environ['FLAGS_task_data_dir'])
# execute program
command = "nodejs %s --dir %s/CAT_0%d/" % (kittydar_path, os.environ['FLAGS_task_data_dir'], worker_id)
print "RUNNING: %s" % (command)
subprocess.call(shlex.split(command))
print "Deleting scratch data..."
del_command = "rm -rf %s" % (os.environ['FLAGS_task_data_dir'])
subprocess.call(shlex.split(del_command))
print "All done -- goodbye from Napper!"
sys.exit(0)
|
Add missing trailing slash required by kittydar.
|
Add missing trailing slash required by kittydar.
|
Python
|
mit
|
ms705/napper
|
import sys, socket, time, logging
import shlex, subprocess
from hdfs import *
logging.basicConfig()
if len(sys.argv) < 4:
print "usage: napper_kittydar <job name> <worker ID> <executable>"
sys.exit(1)
job_name = sys.argv[1]
worker_id = int(sys.argv[2])
kittydar_path = " ".join(sys.argv[3:])
# fetch inputs from HDFS if necessary
hdfs_fetch_file("/input/kittys/CAT_0%d" % (worker_id), os.environ['FLAGS_task_data_dir'])
# execute program
command = "nodejs %s --dir %s/CAT_0%d" % (kittydar_path, os.environ['FLAGS_task_data_dir'], worker_id)
print "RUNNING: %s" % (command)
subprocess.call(shlex.split(command))
print "Deleting scratch data..."
del_command = "rm -rf %s" % (os.environ['FLAGS_task_data_dir'])
subprocess.call(shlex.split(del_command))
print "All done -- goodbye from Napper!"
sys.exit(0)
Add missing trailing slash required by kittydar.
|
import sys, socket, time, logging
import shlex, subprocess
from hdfs import *
logging.basicConfig()
if len(sys.argv) < 4:
print "usage: napper_kittydar <job name> <worker ID> <executable>"
sys.exit(1)
job_name = sys.argv[1]
worker_id = int(sys.argv[2])
kittydar_path = " ".join(sys.argv[3:])
# fetch inputs from HDFS if necessary
hdfs_fetch_file("/input/kittys/CAT_0%d" % (worker_id), os.environ['FLAGS_task_data_dir'])
# execute program
command = "nodejs %s --dir %s/CAT_0%d/" % (kittydar_path, os.environ['FLAGS_task_data_dir'], worker_id)
print "RUNNING: %s" % (command)
subprocess.call(shlex.split(command))
print "Deleting scratch data..."
del_command = "rm -rf %s" % (os.environ['FLAGS_task_data_dir'])
subprocess.call(shlex.split(del_command))
print "All done -- goodbye from Napper!"
sys.exit(0)
|
<commit_before>import sys, socket, time, logging
import shlex, subprocess
from hdfs import *
logging.basicConfig()
if len(sys.argv) < 4:
print "usage: napper_kittydar <job name> <worker ID> <executable>"
sys.exit(1)
job_name = sys.argv[1]
worker_id = int(sys.argv[2])
kittydar_path = " ".join(sys.argv[3:])
# fetch inputs from HDFS if necessary
hdfs_fetch_file("/input/kittys/CAT_0%d" % (worker_id), os.environ['FLAGS_task_data_dir'])
# execute program
command = "nodejs %s --dir %s/CAT_0%d" % (kittydar_path, os.environ['FLAGS_task_data_dir'], worker_id)
print "RUNNING: %s" % (command)
subprocess.call(shlex.split(command))
print "Deleting scratch data..."
del_command = "rm -rf %s" % (os.environ['FLAGS_task_data_dir'])
subprocess.call(shlex.split(del_command))
print "All done -- goodbye from Napper!"
sys.exit(0)
<commit_msg>Add missing trailing slash required by kittydar.<commit_after>
|
import sys, socket, time, logging
import shlex, subprocess
from hdfs import *
logging.basicConfig()
if len(sys.argv) < 4:
print "usage: napper_kittydar <job name> <worker ID> <executable>"
sys.exit(1)
job_name = sys.argv[1]
worker_id = int(sys.argv[2])
kittydar_path = " ".join(sys.argv[3:])
# fetch inputs from HDFS if necessary
hdfs_fetch_file("/input/kittys/CAT_0%d" % (worker_id), os.environ['FLAGS_task_data_dir'])
# execute program
command = "nodejs %s --dir %s/CAT_0%d/" % (kittydar_path, os.environ['FLAGS_task_data_dir'], worker_id)
print "RUNNING: %s" % (command)
subprocess.call(shlex.split(command))
print "Deleting scratch data..."
del_command = "rm -rf %s" % (os.environ['FLAGS_task_data_dir'])
subprocess.call(shlex.split(del_command))
print "All done -- goodbye from Napper!"
sys.exit(0)
|
import sys, socket, time, logging
import shlex, subprocess
from hdfs import *
logging.basicConfig()
if len(sys.argv) < 4:
print "usage: napper_kittydar <job name> <worker ID> <executable>"
sys.exit(1)
job_name = sys.argv[1]
worker_id = int(sys.argv[2])
kittydar_path = " ".join(sys.argv[3:])
# fetch inputs from HDFS if necessary
hdfs_fetch_file("/input/kittys/CAT_0%d" % (worker_id), os.environ['FLAGS_task_data_dir'])
# execute program
command = "nodejs %s --dir %s/CAT_0%d" % (kittydar_path, os.environ['FLAGS_task_data_dir'], worker_id)
print "RUNNING: %s" % (command)
subprocess.call(shlex.split(command))
print "Deleting scratch data..."
del_command = "rm -rf %s" % (os.environ['FLAGS_task_data_dir'])
subprocess.call(shlex.split(del_command))
print "All done -- goodbye from Napper!"
sys.exit(0)
Add missing trailing slash required by kittydar.import sys, socket, time, logging
import shlex, subprocess
from hdfs import *
logging.basicConfig()
if len(sys.argv) < 4:
print "usage: napper_kittydar <job name> <worker ID> <executable>"
sys.exit(1)
job_name = sys.argv[1]
worker_id = int(sys.argv[2])
kittydar_path = " ".join(sys.argv[3:])
# fetch inputs from HDFS if necessary
hdfs_fetch_file("/input/kittys/CAT_0%d" % (worker_id), os.environ['FLAGS_task_data_dir'])
# execute program
command = "nodejs %s --dir %s/CAT_0%d/" % (kittydar_path, os.environ['FLAGS_task_data_dir'], worker_id)
print "RUNNING: %s" % (command)
subprocess.call(shlex.split(command))
print "Deleting scratch data..."
del_command = "rm -rf %s" % (os.environ['FLAGS_task_data_dir'])
subprocess.call(shlex.split(del_command))
print "All done -- goodbye from Napper!"
sys.exit(0)
|
<commit_before>import sys, socket, time, logging
import shlex, subprocess
from hdfs import *
logging.basicConfig()
if len(sys.argv) < 4:
print "usage: napper_kittydar <job name> <worker ID> <executable>"
sys.exit(1)
job_name = sys.argv[1]
worker_id = int(sys.argv[2])
kittydar_path = " ".join(sys.argv[3:])
# fetch inputs from HDFS if necessary
hdfs_fetch_file("/input/kittys/CAT_0%d" % (worker_id), os.environ['FLAGS_task_data_dir'])
# execute program
command = "nodejs %s --dir %s/CAT_0%d" % (kittydar_path, os.environ['FLAGS_task_data_dir'], worker_id)
print "RUNNING: %s" % (command)
subprocess.call(shlex.split(command))
print "Deleting scratch data..."
del_command = "rm -rf %s" % (os.environ['FLAGS_task_data_dir'])
subprocess.call(shlex.split(del_command))
print "All done -- goodbye from Napper!"
sys.exit(0)
<commit_msg>Add missing trailing slash required by kittydar.<commit_after>import sys, socket, time, logging
import shlex, subprocess
from hdfs import *
logging.basicConfig()
if len(sys.argv) < 4:
print "usage: napper_kittydar <job name> <worker ID> <executable>"
sys.exit(1)
job_name = sys.argv[1]
worker_id = int(sys.argv[2])
kittydar_path = " ".join(sys.argv[3:])
# fetch inputs from HDFS if necessary
hdfs_fetch_file("/input/kittys/CAT_0%d" % (worker_id), os.environ['FLAGS_task_data_dir'])
# execute program
command = "nodejs %s --dir %s/CAT_0%d/" % (kittydar_path, os.environ['FLAGS_task_data_dir'], worker_id)
print "RUNNING: %s" % (command)
subprocess.call(shlex.split(command))
print "Deleting scratch data..."
del_command = "rm -rf %s" % (os.environ['FLAGS_task_data_dir'])
subprocess.call(shlex.split(del_command))
print "All done -- goodbye from Napper!"
sys.exit(0)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.