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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b3889bbdab80fb502c74b99b61cf36bae112ce2c | node/node.py | node/node.py | from configparser import ConfigParser
from driver import BTRFSDriver
class Node:
"""
# Dummy config example
[bk1-z3.presslabs.net]
ssd = True
"""
def __init__(self, context):
self._conf_path = context['node']['conf_path']
self._driver = BTRFSDriver(context['volume_path'])
self._name, self._labels = '', {}
config = ConfigParser()
config.read(self._conf_path)
try:
self._name = config.sections()[0]
for label, value in config[self._name].iteritems():
self._labels[label] = value
except IndexError:
pass
def get_subvolumes(self):
return self._driver.get_all()
def name(self):
return self._name
def labels(self):
return self._labels
| from configparser import ConfigParser
from driver import BTRFSDriver
class Node:
"""
# Dummy config example
[bk1-z3.presslabs.net]
ssd = True
"""
def __init__(self, context):
self._conf_path = context['node']['conf_path']
self._driver = BTRFSDriver(context['volume_path'])
self._name, self._labels = '', {}
config = ConfigParser()
config.read(self._conf_path)
try:
self._name = config.sections()[0]
for label, value in config[self._name].iteritems():
self._labels[label] = value
except IndexError:
pass
def get_subvolumes(self):
return self._driver.get_all()
@property
def name(self):
return self._name
@property
def labels(self):
return self._labels
| Add property decorator to getters | Add property decorator to getters
| Python | apache-2.0 | PressLabs/cobalt,PressLabs/cobalt | from configparser import ConfigParser
from driver import BTRFSDriver
class Node:
"""
# Dummy config example
[bk1-z3.presslabs.net]
ssd = True
"""
def __init__(self, context):
self._conf_path = context['node']['conf_path']
self._driver = BTRFSDriver(context['volume_path'])
self._name, self._labels = '', {}
config = ConfigParser()
config.read(self._conf_path)
try:
self._name = config.sections()[0]
for label, value in config[self._name].iteritems():
self._labels[label] = value
except IndexError:
pass
def get_subvolumes(self):
return self._driver.get_all()
def name(self):
return self._name
def labels(self):
return self._labels
Add property decorator to getters | from configparser import ConfigParser
from driver import BTRFSDriver
class Node:
"""
# Dummy config example
[bk1-z3.presslabs.net]
ssd = True
"""
def __init__(self, context):
self._conf_path = context['node']['conf_path']
self._driver = BTRFSDriver(context['volume_path'])
self._name, self._labels = '', {}
config = ConfigParser()
config.read(self._conf_path)
try:
self._name = config.sections()[0]
for label, value in config[self._name].iteritems():
self._labels[label] = value
except IndexError:
pass
def get_subvolumes(self):
return self._driver.get_all()
@property
def name(self):
return self._name
@property
def labels(self):
return self._labels
| <commit_before>from configparser import ConfigParser
from driver import BTRFSDriver
class Node:
"""
# Dummy config example
[bk1-z3.presslabs.net]
ssd = True
"""
def __init__(self, context):
self._conf_path = context['node']['conf_path']
self._driver = BTRFSDriver(context['volume_path'])
self._name, self._labels = '', {}
config = ConfigParser()
config.read(self._conf_path)
try:
self._name = config.sections()[0]
for label, value in config[self._name].iteritems():
self._labels[label] = value
except IndexError:
pass
def get_subvolumes(self):
return self._driver.get_all()
def name(self):
return self._name
def labels(self):
return self._labels
<commit_msg>Add property decorator to getters<commit_after> | from configparser import ConfigParser
from driver import BTRFSDriver
class Node:
"""
# Dummy config example
[bk1-z3.presslabs.net]
ssd = True
"""
def __init__(self, context):
self._conf_path = context['node']['conf_path']
self._driver = BTRFSDriver(context['volume_path'])
self._name, self._labels = '', {}
config = ConfigParser()
config.read(self._conf_path)
try:
self._name = config.sections()[0]
for label, value in config[self._name].iteritems():
self._labels[label] = value
except IndexError:
pass
def get_subvolumes(self):
return self._driver.get_all()
@property
def name(self):
return self._name
@property
def labels(self):
return self._labels
| from configparser import ConfigParser
from driver import BTRFSDriver
class Node:
"""
# Dummy config example
[bk1-z3.presslabs.net]
ssd = True
"""
def __init__(self, context):
self._conf_path = context['node']['conf_path']
self._driver = BTRFSDriver(context['volume_path'])
self._name, self._labels = '', {}
config = ConfigParser()
config.read(self._conf_path)
try:
self._name = config.sections()[0]
for label, value in config[self._name].iteritems():
self._labels[label] = value
except IndexError:
pass
def get_subvolumes(self):
return self._driver.get_all()
def name(self):
return self._name
def labels(self):
return self._labels
Add property decorator to gettersfrom configparser import ConfigParser
from driver import BTRFSDriver
class Node:
"""
# Dummy config example
[bk1-z3.presslabs.net]
ssd = True
"""
def __init__(self, context):
self._conf_path = context['node']['conf_path']
self._driver = BTRFSDriver(context['volume_path'])
self._name, self._labels = '', {}
config = ConfigParser()
config.read(self._conf_path)
try:
self._name = config.sections()[0]
for label, value in config[self._name].iteritems():
self._labels[label] = value
except IndexError:
pass
def get_subvolumes(self):
return self._driver.get_all()
@property
def name(self):
return self._name
@property
def labels(self):
return self._labels
| <commit_before>from configparser import ConfigParser
from driver import BTRFSDriver
class Node:
"""
# Dummy config example
[bk1-z3.presslabs.net]
ssd = True
"""
def __init__(self, context):
self._conf_path = context['node']['conf_path']
self._driver = BTRFSDriver(context['volume_path'])
self._name, self._labels = '', {}
config = ConfigParser()
config.read(self._conf_path)
try:
self._name = config.sections()[0]
for label, value in config[self._name].iteritems():
self._labels[label] = value
except IndexError:
pass
def get_subvolumes(self):
return self._driver.get_all()
def name(self):
return self._name
def labels(self):
return self._labels
<commit_msg>Add property decorator to getters<commit_after>from configparser import ConfigParser
from driver import BTRFSDriver
class Node:
"""
# Dummy config example
[bk1-z3.presslabs.net]
ssd = True
"""
def __init__(self, context):
self._conf_path = context['node']['conf_path']
self._driver = BTRFSDriver(context['volume_path'])
self._name, self._labels = '', {}
config = ConfigParser()
config.read(self._conf_path)
try:
self._name = config.sections()[0]
for label, value in config[self._name].iteritems():
self._labels[label] = value
except IndexError:
pass
def get_subvolumes(self):
return self._driver.get_all()
@property
def name(self):
return self._name
@property
def labels(self):
return self._labels
|
493637ace6881defedee22971f3bc39fe9a5bd0a | freesas/test/__init__.py | freesas/test/__init__.py | #!usr/bin/env python
# coding: utf-8
__author__ = "Jérôme Kieffer"
__license__ = "MIT"
__date__ = "05/09/2017"
__copyright__ = "2015, ESRF"
import unittest
from .test_all import suite
def run():
runner = unittest.TextTestRunner()
return runner.run(suite())
if __name__ == '__main__':
run()
| #!usr/bin/env python
# coding: utf-8
__author__ = "Jérôme Kieffer"
__license__ = "MIT"
__date__ = "15/01/2021"
__copyright__ = "2015-2021, ESRF"
import sys
import unittest
from .test_all import suite
def run_tests():
"""Run test complete test_suite"""
mysuite = suite()
runner = unittest.TextTestRunner()
if not runner.run(mysuite).wasSuccessful():
print("Test suite failed")
return 1
else:
print("Test suite succeeded")
return 0
run = run_tests
if __name__ == '__main__':
sys.exit(run_tests())
| Make it compatible with Bob | Make it compatible with Bob | Python | mit | kif/freesas,kif/freesas,kif/freesas | #!usr/bin/env python
# coding: utf-8
__author__ = "Jérôme Kieffer"
__license__ = "MIT"
__date__ = "05/09/2017"
__copyright__ = "2015, ESRF"
import unittest
from .test_all import suite
def run():
runner = unittest.TextTestRunner()
return runner.run(suite())
if __name__ == '__main__':
run()
Make it compatible with Bob | #!usr/bin/env python
# coding: utf-8
__author__ = "Jérôme Kieffer"
__license__ = "MIT"
__date__ = "15/01/2021"
__copyright__ = "2015-2021, ESRF"
import sys
import unittest
from .test_all import suite
def run_tests():
"""Run test complete test_suite"""
mysuite = suite()
runner = unittest.TextTestRunner()
if not runner.run(mysuite).wasSuccessful():
print("Test suite failed")
return 1
else:
print("Test suite succeeded")
return 0
run = run_tests
if __name__ == '__main__':
sys.exit(run_tests())
| <commit_before>#!usr/bin/env python
# coding: utf-8
__author__ = "Jérôme Kieffer"
__license__ = "MIT"
__date__ = "05/09/2017"
__copyright__ = "2015, ESRF"
import unittest
from .test_all import suite
def run():
runner = unittest.TextTestRunner()
return runner.run(suite())
if __name__ == '__main__':
run()
<commit_msg>Make it compatible with Bob<commit_after> | #!usr/bin/env python
# coding: utf-8
__author__ = "Jérôme Kieffer"
__license__ = "MIT"
__date__ = "15/01/2021"
__copyright__ = "2015-2021, ESRF"
import sys
import unittest
from .test_all import suite
def run_tests():
"""Run test complete test_suite"""
mysuite = suite()
runner = unittest.TextTestRunner()
if not runner.run(mysuite).wasSuccessful():
print("Test suite failed")
return 1
else:
print("Test suite succeeded")
return 0
run = run_tests
if __name__ == '__main__':
sys.exit(run_tests())
| #!usr/bin/env python
# coding: utf-8
__author__ = "Jérôme Kieffer"
__license__ = "MIT"
__date__ = "05/09/2017"
__copyright__ = "2015, ESRF"
import unittest
from .test_all import suite
def run():
runner = unittest.TextTestRunner()
return runner.run(suite())
if __name__ == '__main__':
run()
Make it compatible with Bob#!usr/bin/env python
# coding: utf-8
__author__ = "Jérôme Kieffer"
__license__ = "MIT"
__date__ = "15/01/2021"
__copyright__ = "2015-2021, ESRF"
import sys
import unittest
from .test_all import suite
def run_tests():
"""Run test complete test_suite"""
mysuite = suite()
runner = unittest.TextTestRunner()
if not runner.run(mysuite).wasSuccessful():
print("Test suite failed")
return 1
else:
print("Test suite succeeded")
return 0
run = run_tests
if __name__ == '__main__':
sys.exit(run_tests())
| <commit_before>#!usr/bin/env python
# coding: utf-8
__author__ = "Jérôme Kieffer"
__license__ = "MIT"
__date__ = "05/09/2017"
__copyright__ = "2015, ESRF"
import unittest
from .test_all import suite
def run():
runner = unittest.TextTestRunner()
return runner.run(suite())
if __name__ == '__main__':
run()
<commit_msg>Make it compatible with Bob<commit_after>#!usr/bin/env python
# coding: utf-8
__author__ = "Jérôme Kieffer"
__license__ = "MIT"
__date__ = "15/01/2021"
__copyright__ = "2015-2021, ESRF"
import sys
import unittest
from .test_all import suite
def run_tests():
"""Run test complete test_suite"""
mysuite = suite()
runner = unittest.TextTestRunner()
if not runner.run(mysuite).wasSuccessful():
print("Test suite failed")
return 1
else:
print("Test suite succeeded")
return 0
run = run_tests
if __name__ == '__main__':
sys.exit(run_tests())
|
ef03541b2b25ab9cf34deec554a19a32dad7fbec | tools/python/odin_data/meta_writer/__init__.py | tools/python/odin_data/meta_writer/__init__.py | from pkg_resources import require
require('pygelf==0.3.1')
require("h5py==2.8.0")
require('pyzmq==16.0.2') | from pkg_resources import require
require('pygelf==0.3.1')
require("h5py==2.8.0")
require('pyzmq==16.0.2')
| Add new line to end of init file for Meta Writer application | Add new line to end of init file for Meta Writer application | Python | apache-2.0 | percival-detector/odin-data,odin-detector/odin-data,percival-detector/odin-data,odin-detector/odin-data,odin-detector/odin-data,percival-detector/odin-data,percival-detector/odin-data,odin-detector/odin-data,odin-detector/odin-data,odin-detector/odin-data,percival-detector/odin-data,odin-detector/odin-data,percival-detector/odin-data,percival-detector/odin-data | from pkg_resources import require
require('pygelf==0.3.1')
require("h5py==2.8.0")
require('pyzmq==16.0.2')Add new line to end of init file for Meta Writer application | from pkg_resources import require
require('pygelf==0.3.1')
require("h5py==2.8.0")
require('pyzmq==16.0.2')
| <commit_before>from pkg_resources import require
require('pygelf==0.3.1')
require("h5py==2.8.0")
require('pyzmq==16.0.2')<commit_msg>Add new line to end of init file for Meta Writer application<commit_after> | from pkg_resources import require
require('pygelf==0.3.1')
require("h5py==2.8.0")
require('pyzmq==16.0.2')
| from pkg_resources import require
require('pygelf==0.3.1')
require("h5py==2.8.0")
require('pyzmq==16.0.2')Add new line to end of init file for Meta Writer applicationfrom pkg_resources import require
require('pygelf==0.3.1')
require("h5py==2.8.0")
require('pyzmq==16.0.2')
| <commit_before>from pkg_resources import require
require('pygelf==0.3.1')
require("h5py==2.8.0")
require('pyzmq==16.0.2')<commit_msg>Add new line to end of init file for Meta Writer application<commit_after>from pkg_resources import require
require('pygelf==0.3.1')
require("h5py==2.8.0")
require('pyzmq==16.0.2')
|
eaae2a1e88572e224621e242be1d15e92065f15e | mopidy_nad/__init__.py | mopidy_nad/__init__.py | from __future__ import unicode_literals
import os
import pygst
pygst.require('0.10')
import gst
import gobject
from mopidy import config, ext
__version__ = '1.0.0'
class Extension(ext.Extension):
dist_name = 'Mopidy-NAD'
ext_name = 'nad'
version = __version__
def get_default_config(self):
conf_file = os.path.join(os.path.dirname(__file__), 'ext.conf')
return config.read(conf_file)
def register_gstreamer_elements(self):
from .mixer import NadMixer
gobject.type_register(NadMixer)
gst.element_register(NadMixer, 'nadmixer', gst.RANK_MARGINAL)
| from __future__ import unicode_literals
import os
import pygst
pygst.require('0.10')
import gst
import gobject
from mopidy import config, ext
__version__ = '1.0.0'
class Extension(ext.Extension):
dist_name = 'Mopidy-NAD'
ext_name = 'nad'
version = __version__
def get_default_config(self):
conf_file = os.path.join(os.path.dirname(__file__), 'ext.conf')
return config.read(conf_file)
def setup(self, registry):
from .mixer import NadMixer
gobject.type_register(NadMixer)
gst.element_register(NadMixer, 'nadmixer', gst.RANK_MARGINAL)
| Use new extension setup() API | Use new extension setup() API
| Python | apache-2.0 | ZenithDK/mopidy-primare,mopidy/mopidy-nad | from __future__ import unicode_literals
import os
import pygst
pygst.require('0.10')
import gst
import gobject
from mopidy import config, ext
__version__ = '1.0.0'
class Extension(ext.Extension):
dist_name = 'Mopidy-NAD'
ext_name = 'nad'
version = __version__
def get_default_config(self):
conf_file = os.path.join(os.path.dirname(__file__), 'ext.conf')
return config.read(conf_file)
def register_gstreamer_elements(self):
from .mixer import NadMixer
gobject.type_register(NadMixer)
gst.element_register(NadMixer, 'nadmixer', gst.RANK_MARGINAL)
Use new extension setup() API | from __future__ import unicode_literals
import os
import pygst
pygst.require('0.10')
import gst
import gobject
from mopidy import config, ext
__version__ = '1.0.0'
class Extension(ext.Extension):
dist_name = 'Mopidy-NAD'
ext_name = 'nad'
version = __version__
def get_default_config(self):
conf_file = os.path.join(os.path.dirname(__file__), 'ext.conf')
return config.read(conf_file)
def setup(self, registry):
from .mixer import NadMixer
gobject.type_register(NadMixer)
gst.element_register(NadMixer, 'nadmixer', gst.RANK_MARGINAL)
| <commit_before>from __future__ import unicode_literals
import os
import pygst
pygst.require('0.10')
import gst
import gobject
from mopidy import config, ext
__version__ = '1.0.0'
class Extension(ext.Extension):
dist_name = 'Mopidy-NAD'
ext_name = 'nad'
version = __version__
def get_default_config(self):
conf_file = os.path.join(os.path.dirname(__file__), 'ext.conf')
return config.read(conf_file)
def register_gstreamer_elements(self):
from .mixer import NadMixer
gobject.type_register(NadMixer)
gst.element_register(NadMixer, 'nadmixer', gst.RANK_MARGINAL)
<commit_msg>Use new extension setup() API<commit_after> | from __future__ import unicode_literals
import os
import pygst
pygst.require('0.10')
import gst
import gobject
from mopidy import config, ext
__version__ = '1.0.0'
class Extension(ext.Extension):
dist_name = 'Mopidy-NAD'
ext_name = 'nad'
version = __version__
def get_default_config(self):
conf_file = os.path.join(os.path.dirname(__file__), 'ext.conf')
return config.read(conf_file)
def setup(self, registry):
from .mixer import NadMixer
gobject.type_register(NadMixer)
gst.element_register(NadMixer, 'nadmixer', gst.RANK_MARGINAL)
| from __future__ import unicode_literals
import os
import pygst
pygst.require('0.10')
import gst
import gobject
from mopidy import config, ext
__version__ = '1.0.0'
class Extension(ext.Extension):
dist_name = 'Mopidy-NAD'
ext_name = 'nad'
version = __version__
def get_default_config(self):
conf_file = os.path.join(os.path.dirname(__file__), 'ext.conf')
return config.read(conf_file)
def register_gstreamer_elements(self):
from .mixer import NadMixer
gobject.type_register(NadMixer)
gst.element_register(NadMixer, 'nadmixer', gst.RANK_MARGINAL)
Use new extension setup() APIfrom __future__ import unicode_literals
import os
import pygst
pygst.require('0.10')
import gst
import gobject
from mopidy import config, ext
__version__ = '1.0.0'
class Extension(ext.Extension):
dist_name = 'Mopidy-NAD'
ext_name = 'nad'
version = __version__
def get_default_config(self):
conf_file = os.path.join(os.path.dirname(__file__), 'ext.conf')
return config.read(conf_file)
def setup(self, registry):
from .mixer import NadMixer
gobject.type_register(NadMixer)
gst.element_register(NadMixer, 'nadmixer', gst.RANK_MARGINAL)
| <commit_before>from __future__ import unicode_literals
import os
import pygst
pygst.require('0.10')
import gst
import gobject
from mopidy import config, ext
__version__ = '1.0.0'
class Extension(ext.Extension):
dist_name = 'Mopidy-NAD'
ext_name = 'nad'
version = __version__
def get_default_config(self):
conf_file = os.path.join(os.path.dirname(__file__), 'ext.conf')
return config.read(conf_file)
def register_gstreamer_elements(self):
from .mixer import NadMixer
gobject.type_register(NadMixer)
gst.element_register(NadMixer, 'nadmixer', gst.RANK_MARGINAL)
<commit_msg>Use new extension setup() API<commit_after>from __future__ import unicode_literals
import os
import pygst
pygst.require('0.10')
import gst
import gobject
from mopidy import config, ext
__version__ = '1.0.0'
class Extension(ext.Extension):
dist_name = 'Mopidy-NAD'
ext_name = 'nad'
version = __version__
def get_default_config(self):
conf_file = os.path.join(os.path.dirname(__file__), 'ext.conf')
return config.read(conf_file)
def setup(self, registry):
from .mixer import NadMixer
gobject.type_register(NadMixer)
gst.element_register(NadMixer, 'nadmixer', gst.RANK_MARGINAL)
|
42f74f304d0ac404f17d6489033b6140816cb194 | fireplace/cards/gvg/neutral_common.py | fireplace/cards/gvg/neutral_common.py | from ..utils import *
##
# Minions
# Explosive Sheep
class GVG_076:
def deathrattle(self):
for target in self.game.board:
self.hit(target, 2)
# Clockwork Gnome
class GVG_082:
deathrattle = giveSparePart
# Micro Machine
class GVG_103:
def TURN_BEGIN(self, player):
# That card ID is not a mistake
self.buff(self, "GVG_076a")
# Pistons
class GVG_076a:
Atk = 1
| from ..utils import *
##
# Minions
# Stonesplinter Trogg
class GVG_067:
def CARD_PLAYED(self, player, card):
if player is not self.controller and card.type == CardType.SPELL:
self.buff("GVG_067a")
class GVG_067a:
Atk = 1
# Burly Rockjaw Trogg
class GVG_068:
def CARD_PLAYED(self, player, card):
if player is not self.controller and card.type == CardType.SPELL:
self.buff("GVG_068a")
class GVG_068a:
Atk = 2
# Ship's Cannon
class GVG_075:
def OWN_MINION_SUMMONED(self, minion):
if minion.race == Race.PIRATE:
targets = self.controller.getTargets(TARGET_ENEMY_CHARACTERS)
self.hit(random.choice(targets), 2)
# Explosive Sheep
class GVG_076:
def deathrattle(self):
for target in self.game.board:
self.hit(target, 2)
# Clockwork Gnome
class GVG_082:
deathrattle = giveSparePart
# Micro Machine
class GVG_103:
def TURN_BEGIN(self, player):
# That card ID is not a mistake
self.buff(self, "GVG_076a")
# Pistons
class GVG_076a:
Atk = 1
| Implement Stonesplinter Trogg, Burly Rockjaw Trogg, Ship's Cannon | Implement Stonesplinter Trogg, Burly Rockjaw Trogg, Ship's Cannon
| Python | agpl-3.0 | Ragowit/fireplace,NightKev/fireplace,jleclanche/fireplace,smallnamespace/fireplace,smallnamespace/fireplace,amw2104/fireplace,beheh/fireplace,Meerkov/fireplace,amw2104/fireplace,oftc-ftw/fireplace,butozerca/fireplace,liujimj/fireplace,oftc-ftw/fireplace,Meerkov/fireplace,butozerca/fireplace,Ragowit/fireplace,liujimj/fireplace | from ..utils import *
##
# Minions
# Explosive Sheep
class GVG_076:
def deathrattle(self):
for target in self.game.board:
self.hit(target, 2)
# Clockwork Gnome
class GVG_082:
deathrattle = giveSparePart
# Micro Machine
class GVG_103:
def TURN_BEGIN(self, player):
# That card ID is not a mistake
self.buff(self, "GVG_076a")
# Pistons
class GVG_076a:
Atk = 1
Implement Stonesplinter Trogg, Burly Rockjaw Trogg, Ship's Cannon | from ..utils import *
##
# Minions
# Stonesplinter Trogg
class GVG_067:
def CARD_PLAYED(self, player, card):
if player is not self.controller and card.type == CardType.SPELL:
self.buff("GVG_067a")
class GVG_067a:
Atk = 1
# Burly Rockjaw Trogg
class GVG_068:
def CARD_PLAYED(self, player, card):
if player is not self.controller and card.type == CardType.SPELL:
self.buff("GVG_068a")
class GVG_068a:
Atk = 2
# Ship's Cannon
class GVG_075:
def OWN_MINION_SUMMONED(self, minion):
if minion.race == Race.PIRATE:
targets = self.controller.getTargets(TARGET_ENEMY_CHARACTERS)
self.hit(random.choice(targets), 2)
# Explosive Sheep
class GVG_076:
def deathrattle(self):
for target in self.game.board:
self.hit(target, 2)
# Clockwork Gnome
class GVG_082:
deathrattle = giveSparePart
# Micro Machine
class GVG_103:
def TURN_BEGIN(self, player):
# That card ID is not a mistake
self.buff(self, "GVG_076a")
# Pistons
class GVG_076a:
Atk = 1
| <commit_before>from ..utils import *
##
# Minions
# Explosive Sheep
class GVG_076:
def deathrattle(self):
for target in self.game.board:
self.hit(target, 2)
# Clockwork Gnome
class GVG_082:
deathrattle = giveSparePart
# Micro Machine
class GVG_103:
def TURN_BEGIN(self, player):
# That card ID is not a mistake
self.buff(self, "GVG_076a")
# Pistons
class GVG_076a:
Atk = 1
<commit_msg>Implement Stonesplinter Trogg, Burly Rockjaw Trogg, Ship's Cannon<commit_after> | from ..utils import *
##
# Minions
# Stonesplinter Trogg
class GVG_067:
def CARD_PLAYED(self, player, card):
if player is not self.controller and card.type == CardType.SPELL:
self.buff("GVG_067a")
class GVG_067a:
Atk = 1
# Burly Rockjaw Trogg
class GVG_068:
def CARD_PLAYED(self, player, card):
if player is not self.controller and card.type == CardType.SPELL:
self.buff("GVG_068a")
class GVG_068a:
Atk = 2
# Ship's Cannon
class GVG_075:
def OWN_MINION_SUMMONED(self, minion):
if minion.race == Race.PIRATE:
targets = self.controller.getTargets(TARGET_ENEMY_CHARACTERS)
self.hit(random.choice(targets), 2)
# Explosive Sheep
class GVG_076:
def deathrattle(self):
for target in self.game.board:
self.hit(target, 2)
# Clockwork Gnome
class GVG_082:
deathrattle = giveSparePart
# Micro Machine
class GVG_103:
def TURN_BEGIN(self, player):
# That card ID is not a mistake
self.buff(self, "GVG_076a")
# Pistons
class GVG_076a:
Atk = 1
| from ..utils import *
##
# Minions
# Explosive Sheep
class GVG_076:
def deathrattle(self):
for target in self.game.board:
self.hit(target, 2)
# Clockwork Gnome
class GVG_082:
deathrattle = giveSparePart
# Micro Machine
class GVG_103:
def TURN_BEGIN(self, player):
# That card ID is not a mistake
self.buff(self, "GVG_076a")
# Pistons
class GVG_076a:
Atk = 1
Implement Stonesplinter Trogg, Burly Rockjaw Trogg, Ship's Cannonfrom ..utils import *
##
# Minions
# Stonesplinter Trogg
class GVG_067:
def CARD_PLAYED(self, player, card):
if player is not self.controller and card.type == CardType.SPELL:
self.buff("GVG_067a")
class GVG_067a:
Atk = 1
# Burly Rockjaw Trogg
class GVG_068:
def CARD_PLAYED(self, player, card):
if player is not self.controller and card.type == CardType.SPELL:
self.buff("GVG_068a")
class GVG_068a:
Atk = 2
# Ship's Cannon
class GVG_075:
def OWN_MINION_SUMMONED(self, minion):
if minion.race == Race.PIRATE:
targets = self.controller.getTargets(TARGET_ENEMY_CHARACTERS)
self.hit(random.choice(targets), 2)
# Explosive Sheep
class GVG_076:
def deathrattle(self):
for target in self.game.board:
self.hit(target, 2)
# Clockwork Gnome
class GVG_082:
deathrattle = giveSparePart
# Micro Machine
class GVG_103:
def TURN_BEGIN(self, player):
# That card ID is not a mistake
self.buff(self, "GVG_076a")
# Pistons
class GVG_076a:
Atk = 1
| <commit_before>from ..utils import *
##
# Minions
# Explosive Sheep
class GVG_076:
def deathrattle(self):
for target in self.game.board:
self.hit(target, 2)
# Clockwork Gnome
class GVG_082:
deathrattle = giveSparePart
# Micro Machine
class GVG_103:
def TURN_BEGIN(self, player):
# That card ID is not a mistake
self.buff(self, "GVG_076a")
# Pistons
class GVG_076a:
Atk = 1
<commit_msg>Implement Stonesplinter Trogg, Burly Rockjaw Trogg, Ship's Cannon<commit_after>from ..utils import *
##
# Minions
# Stonesplinter Trogg
class GVG_067:
def CARD_PLAYED(self, player, card):
if player is not self.controller and card.type == CardType.SPELL:
self.buff("GVG_067a")
class GVG_067a:
Atk = 1
# Burly Rockjaw Trogg
class GVG_068:
def CARD_PLAYED(self, player, card):
if player is not self.controller and card.type == CardType.SPELL:
self.buff("GVG_068a")
class GVG_068a:
Atk = 2
# Ship's Cannon
class GVG_075:
def OWN_MINION_SUMMONED(self, minion):
if minion.race == Race.PIRATE:
targets = self.controller.getTargets(TARGET_ENEMY_CHARACTERS)
self.hit(random.choice(targets), 2)
# Explosive Sheep
class GVG_076:
def deathrattle(self):
for target in self.game.board:
self.hit(target, 2)
# Clockwork Gnome
class GVG_082:
deathrattle = giveSparePart
# Micro Machine
class GVG_103:
def TURN_BEGIN(self, player):
# That card ID is not a mistake
self.buff(self, "GVG_076a")
# Pistons
class GVG_076a:
Atk = 1
|
7d1463fc732cdc6aef3299c6d2bbe916418e6d6e | hkisaml/api.py | hkisaml/api.py | from django.contrib.auth.models import User
from rest_framework import permissions, routers, serializers, generics, mixins
from oauth2_provider.ext.rest_framework import TokenHasReadWriteScope
class UserSerializer(serializers.ModelSerializer):
def to_representation(self, obj):
ret = super(UserSerializer, self).to_representation(obj)
if hasattr(obj, 'profile'):
ret['department_name'] = obj.profile.department_name
return ret
class Meta:
fields = [
'last_login', 'username', 'email', 'date_joined',
'first_name', 'last_name'
]
model = User
# ViewSets define the view behavior.
class UserView(generics.RetrieveAPIView,
mixins.RetrieveModelMixin):
def get_queryset(self):
user = self.request.user
if user.is_superuser:
return self.queryset
else:
return self.queryset.filter(id=user.id)
def get_object(self):
username = self.kwargs.get('username', None)
if username:
qs = self.get_queryset()
obj = generics.get_object_or_404(qs, username=username)
else:
obj = self.request.user
return obj
permission_classes = [permissions.IsAuthenticated, TokenHasReadWriteScope]
queryset = User.objects.all()
serializer_class = UserSerializer
#router = routers.DefaultRouter()
#router.register(r'users', UserViewSet)
| from django.contrib.auth.models import User
from rest_framework import permissions, serializers, generics, mixins
from oauth2_provider.ext.rest_framework import TokenHasReadWriteScope
class UserSerializer(serializers.ModelSerializer):
def to_representation(self, obj):
ret = super(UserSerializer, self).to_representation(obj)
if hasattr(obj, 'profile'):
ret['department_name'] = obj.profile.department_name
if obj.first_name and obj.last_name:
ret['full_name'] = '%s %s' % (obj.first_name, obj.last_name)
return ret
class Meta:
fields = [
'last_login', 'username', 'email', 'date_joined',
'first_name', 'last_name'
]
model = User
# ViewSets define the view behavior.
class UserView(generics.RetrieveAPIView,
mixins.RetrieveModelMixin):
def get_queryset(self):
user = self.request.user
if user.is_superuser:
return self.queryset
else:
return self.queryset.filter(id=user.id)
def get_object(self):
username = self.kwargs.get('username', None)
if username:
qs = self.get_queryset()
obj = generics.get_object_or_404(qs, username=username)
else:
obj = self.request.user
return obj
permission_classes = [permissions.IsAuthenticated, TokenHasReadWriteScope]
queryset = User.objects.all()
serializer_class = UserSerializer
#router = routers.DefaultRouter()
#router.register(r'users', UserViewSet)
| Add full_name field to API | Add full_name field to API
| Python | mit | mikkokeskinen/tunnistamo,mikkokeskinen/tunnistamo | from django.contrib.auth.models import User
from rest_framework import permissions, routers, serializers, generics, mixins
from oauth2_provider.ext.rest_framework import TokenHasReadWriteScope
class UserSerializer(serializers.ModelSerializer):
def to_representation(self, obj):
ret = super(UserSerializer, self).to_representation(obj)
if hasattr(obj, 'profile'):
ret['department_name'] = obj.profile.department_name
return ret
class Meta:
fields = [
'last_login', 'username', 'email', 'date_joined',
'first_name', 'last_name'
]
model = User
# ViewSets define the view behavior.
class UserView(generics.RetrieveAPIView,
mixins.RetrieveModelMixin):
def get_queryset(self):
user = self.request.user
if user.is_superuser:
return self.queryset
else:
return self.queryset.filter(id=user.id)
def get_object(self):
username = self.kwargs.get('username', None)
if username:
qs = self.get_queryset()
obj = generics.get_object_or_404(qs, username=username)
else:
obj = self.request.user
return obj
permission_classes = [permissions.IsAuthenticated, TokenHasReadWriteScope]
queryset = User.objects.all()
serializer_class = UserSerializer
#router = routers.DefaultRouter()
#router.register(r'users', UserViewSet)
Add full_name field to API | from django.contrib.auth.models import User
from rest_framework import permissions, serializers, generics, mixins
from oauth2_provider.ext.rest_framework import TokenHasReadWriteScope
class UserSerializer(serializers.ModelSerializer):
def to_representation(self, obj):
ret = super(UserSerializer, self).to_representation(obj)
if hasattr(obj, 'profile'):
ret['department_name'] = obj.profile.department_name
if obj.first_name and obj.last_name:
ret['full_name'] = '%s %s' % (obj.first_name, obj.last_name)
return ret
class Meta:
fields = [
'last_login', 'username', 'email', 'date_joined',
'first_name', 'last_name'
]
model = User
# ViewSets define the view behavior.
class UserView(generics.RetrieveAPIView,
mixins.RetrieveModelMixin):
def get_queryset(self):
user = self.request.user
if user.is_superuser:
return self.queryset
else:
return self.queryset.filter(id=user.id)
def get_object(self):
username = self.kwargs.get('username', None)
if username:
qs = self.get_queryset()
obj = generics.get_object_or_404(qs, username=username)
else:
obj = self.request.user
return obj
permission_classes = [permissions.IsAuthenticated, TokenHasReadWriteScope]
queryset = User.objects.all()
serializer_class = UserSerializer
#router = routers.DefaultRouter()
#router.register(r'users', UserViewSet)
| <commit_before>from django.contrib.auth.models import User
from rest_framework import permissions, routers, serializers, generics, mixins
from oauth2_provider.ext.rest_framework import TokenHasReadWriteScope
class UserSerializer(serializers.ModelSerializer):
def to_representation(self, obj):
ret = super(UserSerializer, self).to_representation(obj)
if hasattr(obj, 'profile'):
ret['department_name'] = obj.profile.department_name
return ret
class Meta:
fields = [
'last_login', 'username', 'email', 'date_joined',
'first_name', 'last_name'
]
model = User
# ViewSets define the view behavior.
class UserView(generics.RetrieveAPIView,
mixins.RetrieveModelMixin):
def get_queryset(self):
user = self.request.user
if user.is_superuser:
return self.queryset
else:
return self.queryset.filter(id=user.id)
def get_object(self):
username = self.kwargs.get('username', None)
if username:
qs = self.get_queryset()
obj = generics.get_object_or_404(qs, username=username)
else:
obj = self.request.user
return obj
permission_classes = [permissions.IsAuthenticated, TokenHasReadWriteScope]
queryset = User.objects.all()
serializer_class = UserSerializer
#router = routers.DefaultRouter()
#router.register(r'users', UserViewSet)
<commit_msg>Add full_name field to API<commit_after> | from django.contrib.auth.models import User
from rest_framework import permissions, serializers, generics, mixins
from oauth2_provider.ext.rest_framework import TokenHasReadWriteScope
class UserSerializer(serializers.ModelSerializer):
def to_representation(self, obj):
ret = super(UserSerializer, self).to_representation(obj)
if hasattr(obj, 'profile'):
ret['department_name'] = obj.profile.department_name
if obj.first_name and obj.last_name:
ret['full_name'] = '%s %s' % (obj.first_name, obj.last_name)
return ret
class Meta:
fields = [
'last_login', 'username', 'email', 'date_joined',
'first_name', 'last_name'
]
model = User
# ViewSets define the view behavior.
class UserView(generics.RetrieveAPIView,
mixins.RetrieveModelMixin):
def get_queryset(self):
user = self.request.user
if user.is_superuser:
return self.queryset
else:
return self.queryset.filter(id=user.id)
def get_object(self):
username = self.kwargs.get('username', None)
if username:
qs = self.get_queryset()
obj = generics.get_object_or_404(qs, username=username)
else:
obj = self.request.user
return obj
permission_classes = [permissions.IsAuthenticated, TokenHasReadWriteScope]
queryset = User.objects.all()
serializer_class = UserSerializer
#router = routers.DefaultRouter()
#router.register(r'users', UserViewSet)
| from django.contrib.auth.models import User
from rest_framework import permissions, routers, serializers, generics, mixins
from oauth2_provider.ext.rest_framework import TokenHasReadWriteScope
class UserSerializer(serializers.ModelSerializer):
def to_representation(self, obj):
ret = super(UserSerializer, self).to_representation(obj)
if hasattr(obj, 'profile'):
ret['department_name'] = obj.profile.department_name
return ret
class Meta:
fields = [
'last_login', 'username', 'email', 'date_joined',
'first_name', 'last_name'
]
model = User
# ViewSets define the view behavior.
class UserView(generics.RetrieveAPIView,
mixins.RetrieveModelMixin):
def get_queryset(self):
user = self.request.user
if user.is_superuser:
return self.queryset
else:
return self.queryset.filter(id=user.id)
def get_object(self):
username = self.kwargs.get('username', None)
if username:
qs = self.get_queryset()
obj = generics.get_object_or_404(qs, username=username)
else:
obj = self.request.user
return obj
permission_classes = [permissions.IsAuthenticated, TokenHasReadWriteScope]
queryset = User.objects.all()
serializer_class = UserSerializer
#router = routers.DefaultRouter()
#router.register(r'users', UserViewSet)
Add full_name field to APIfrom django.contrib.auth.models import User
from rest_framework import permissions, serializers, generics, mixins
from oauth2_provider.ext.rest_framework import TokenHasReadWriteScope
class UserSerializer(serializers.ModelSerializer):
def to_representation(self, obj):
ret = super(UserSerializer, self).to_representation(obj)
if hasattr(obj, 'profile'):
ret['department_name'] = obj.profile.department_name
if obj.first_name and obj.last_name:
ret['full_name'] = '%s %s' % (obj.first_name, obj.last_name)
return ret
class Meta:
fields = [
'last_login', 'username', 'email', 'date_joined',
'first_name', 'last_name'
]
model = User
# ViewSets define the view behavior.
class UserView(generics.RetrieveAPIView,
mixins.RetrieveModelMixin):
def get_queryset(self):
user = self.request.user
if user.is_superuser:
return self.queryset
else:
return self.queryset.filter(id=user.id)
def get_object(self):
username = self.kwargs.get('username', None)
if username:
qs = self.get_queryset()
obj = generics.get_object_or_404(qs, username=username)
else:
obj = self.request.user
return obj
permission_classes = [permissions.IsAuthenticated, TokenHasReadWriteScope]
queryset = User.objects.all()
serializer_class = UserSerializer
#router = routers.DefaultRouter()
#router.register(r'users', UserViewSet)
| <commit_before>from django.contrib.auth.models import User
from rest_framework import permissions, routers, serializers, generics, mixins
from oauth2_provider.ext.rest_framework import TokenHasReadWriteScope
class UserSerializer(serializers.ModelSerializer):
def to_representation(self, obj):
ret = super(UserSerializer, self).to_representation(obj)
if hasattr(obj, 'profile'):
ret['department_name'] = obj.profile.department_name
return ret
class Meta:
fields = [
'last_login', 'username', 'email', 'date_joined',
'first_name', 'last_name'
]
model = User
# ViewSets define the view behavior.
class UserView(generics.RetrieveAPIView,
mixins.RetrieveModelMixin):
def get_queryset(self):
user = self.request.user
if user.is_superuser:
return self.queryset
else:
return self.queryset.filter(id=user.id)
def get_object(self):
username = self.kwargs.get('username', None)
if username:
qs = self.get_queryset()
obj = generics.get_object_or_404(qs, username=username)
else:
obj = self.request.user
return obj
permission_classes = [permissions.IsAuthenticated, TokenHasReadWriteScope]
queryset = User.objects.all()
serializer_class = UserSerializer
#router = routers.DefaultRouter()
#router.register(r'users', UserViewSet)
<commit_msg>Add full_name field to API<commit_after>from django.contrib.auth.models import User
from rest_framework import permissions, serializers, generics, mixins
from oauth2_provider.ext.rest_framework import TokenHasReadWriteScope
class UserSerializer(serializers.ModelSerializer):
def to_representation(self, obj):
ret = super(UserSerializer, self).to_representation(obj)
if hasattr(obj, 'profile'):
ret['department_name'] = obj.profile.department_name
if obj.first_name and obj.last_name:
ret['full_name'] = '%s %s' % (obj.first_name, obj.last_name)
return ret
class Meta:
fields = [
'last_login', 'username', 'email', 'date_joined',
'first_name', 'last_name'
]
model = User
# ViewSets define the view behavior.
class UserView(generics.RetrieveAPIView,
mixins.RetrieveModelMixin):
def get_queryset(self):
user = self.request.user
if user.is_superuser:
return self.queryset
else:
return self.queryset.filter(id=user.id)
def get_object(self):
username = self.kwargs.get('username', None)
if username:
qs = self.get_queryset()
obj = generics.get_object_or_404(qs, username=username)
else:
obj = self.request.user
return obj
permission_classes = [permissions.IsAuthenticated, TokenHasReadWriteScope]
queryset = User.objects.all()
serializer_class = UserSerializer
#router = routers.DefaultRouter()
#router.register(r'users', UserViewSet)
|
15f22d7c0ac9ddce6cb14cb0cbb35c4d630605d2 | api/ud_helper.py | api/ud_helper.py | import re
from ufal.udpipe import Model, Pipeline, ProcessingError
class Parser:
MODELS = {
"swe": "data/swedish-ud-2.0-170801.udpipe",
}
def __init__(self, language):
model_path = self.MODELS.get(language, None)
if not model_path:
raise ParserException("Cannot find model for language '%s'" % language)
model = Model.load(model_path)
if not model:
raise ParserException("Cannot load model from file '%s'\n" % model_path)
self.model = model
def parse(self, text):
text = text.strip()
last_character = text.strip()[-1]
if re.match(r"\w", last_character, flags=re.UNICODE):
text += "."
pipeline = Pipeline(
self.model,
"tokenize",
Pipeline.DEFAULT,
Pipeline.DEFAULT,
"conllu"
)
error = ProcessingError()
processed = pipeline.process(text, error)
if error.occurred():
raise ParserException(error.message)
return processed
class ParserException(Exception):
pass
| import re
from ufal.udpipe import Model, Pipeline, ProcessingError
class Parser:
MODELS = {
"swe": "data/swedish-ud-2.0-170801.udpipe",
}
def __init__(self, language):
model_path = self.MODELS.get(language, None)
if not model_path:
raise ParserException("Cannot find model for language '%s'" % language)
model = Model.load(model_path)
if not model:
raise ParserException("Cannot load model from file '%s'\n" % model_path)
self.model = model
def parse(self, text):
text = text.strip()
# Adding a period improves detection on especially short sentences
period_added = False
last_character = text.strip()[-1]
if re.match(r"\w", last_character, flags=re.UNICODE):
text += "."
period_added = True
pipeline = Pipeline(
self.model,
"tokenize",
Pipeline.DEFAULT,
Pipeline.DEFAULT,
"conllu"
)
error = ProcessingError()
processed = pipeline.process(text, error)
if error.occurred():
raise ParserException(error.message)
# Remove the period to make sure input corresponds to output
if period_added:
processed = "\n".join(processed.rstrip().split("\n")[:-1]) + "\n\n"
return processed
class ParserException(Exception):
pass
| Remove period so input corresponds to output. | Remove period so input corresponds to output.
Former-commit-id: ec6debb1637304407715441ae8319787fe7f0945 | Python | mit | EmilStenstrom/json-tagger,EmilStenstrom/json-tagger,EmilStenstrom/json-tagger,EmilStenstrom/json-tagger,EmilStenstrom/json-tagger | import re
from ufal.udpipe import Model, Pipeline, ProcessingError
class Parser:
MODELS = {
"swe": "data/swedish-ud-2.0-170801.udpipe",
}
def __init__(self, language):
model_path = self.MODELS.get(language, None)
if not model_path:
raise ParserException("Cannot find model for language '%s'" % language)
model = Model.load(model_path)
if not model:
raise ParserException("Cannot load model from file '%s'\n" % model_path)
self.model = model
def parse(self, text):
text = text.strip()
last_character = text.strip()[-1]
if re.match(r"\w", last_character, flags=re.UNICODE):
text += "."
pipeline = Pipeline(
self.model,
"tokenize",
Pipeline.DEFAULT,
Pipeline.DEFAULT,
"conllu"
)
error = ProcessingError()
processed = pipeline.process(text, error)
if error.occurred():
raise ParserException(error.message)
return processed
class ParserException(Exception):
pass
Remove period so input corresponds to output.
Former-commit-id: ec6debb1637304407715441ae8319787fe7f0945 | import re
from ufal.udpipe import Model, Pipeline, ProcessingError
class Parser:
MODELS = {
"swe": "data/swedish-ud-2.0-170801.udpipe",
}
def __init__(self, language):
model_path = self.MODELS.get(language, None)
if not model_path:
raise ParserException("Cannot find model for language '%s'" % language)
model = Model.load(model_path)
if not model:
raise ParserException("Cannot load model from file '%s'\n" % model_path)
self.model = model
def parse(self, text):
text = text.strip()
# Adding a period improves detection on especially short sentences
period_added = False
last_character = text.strip()[-1]
if re.match(r"\w", last_character, flags=re.UNICODE):
text += "."
period_added = True
pipeline = Pipeline(
self.model,
"tokenize",
Pipeline.DEFAULT,
Pipeline.DEFAULT,
"conllu"
)
error = ProcessingError()
processed = pipeline.process(text, error)
if error.occurred():
raise ParserException(error.message)
# Remove the period to make sure input corresponds to output
if period_added:
processed = "\n".join(processed.rstrip().split("\n")[:-1]) + "\n\n"
return processed
class ParserException(Exception):
pass
| <commit_before>import re
from ufal.udpipe import Model, Pipeline, ProcessingError
class Parser:
MODELS = {
"swe": "data/swedish-ud-2.0-170801.udpipe",
}
def __init__(self, language):
model_path = self.MODELS.get(language, None)
if not model_path:
raise ParserException("Cannot find model for language '%s'" % language)
model = Model.load(model_path)
if not model:
raise ParserException("Cannot load model from file '%s'\n" % model_path)
self.model = model
def parse(self, text):
text = text.strip()
last_character = text.strip()[-1]
if re.match(r"\w", last_character, flags=re.UNICODE):
text += "."
pipeline = Pipeline(
self.model,
"tokenize",
Pipeline.DEFAULT,
Pipeline.DEFAULT,
"conllu"
)
error = ProcessingError()
processed = pipeline.process(text, error)
if error.occurred():
raise ParserException(error.message)
return processed
class ParserException(Exception):
pass
<commit_msg>Remove period so input corresponds to output.
Former-commit-id: ec6debb1637304407715441ae8319787fe7f0945<commit_after> | import re
from ufal.udpipe import Model, Pipeline, ProcessingError
class Parser:
MODELS = {
"swe": "data/swedish-ud-2.0-170801.udpipe",
}
def __init__(self, language):
model_path = self.MODELS.get(language, None)
if not model_path:
raise ParserException("Cannot find model for language '%s'" % language)
model = Model.load(model_path)
if not model:
raise ParserException("Cannot load model from file '%s'\n" % model_path)
self.model = model
def parse(self, text):
text = text.strip()
# Adding a period improves detection on especially short sentences
period_added = False
last_character = text.strip()[-1]
if re.match(r"\w", last_character, flags=re.UNICODE):
text += "."
period_added = True
pipeline = Pipeline(
self.model,
"tokenize",
Pipeline.DEFAULT,
Pipeline.DEFAULT,
"conllu"
)
error = ProcessingError()
processed = pipeline.process(text, error)
if error.occurred():
raise ParserException(error.message)
# Remove the period to make sure input corresponds to output
if period_added:
processed = "\n".join(processed.rstrip().split("\n")[:-1]) + "\n\n"
return processed
class ParserException(Exception):
pass
| import re
from ufal.udpipe import Model, Pipeline, ProcessingError
class Parser:
MODELS = {
"swe": "data/swedish-ud-2.0-170801.udpipe",
}
def __init__(self, language):
model_path = self.MODELS.get(language, None)
if not model_path:
raise ParserException("Cannot find model for language '%s'" % language)
model = Model.load(model_path)
if not model:
raise ParserException("Cannot load model from file '%s'\n" % model_path)
self.model = model
def parse(self, text):
text = text.strip()
last_character = text.strip()[-1]
if re.match(r"\w", last_character, flags=re.UNICODE):
text += "."
pipeline = Pipeline(
self.model,
"tokenize",
Pipeline.DEFAULT,
Pipeline.DEFAULT,
"conllu"
)
error = ProcessingError()
processed = pipeline.process(text, error)
if error.occurred():
raise ParserException(error.message)
return processed
class ParserException(Exception):
pass
Remove period so input corresponds to output.
Former-commit-id: ec6debb1637304407715441ae8319787fe7f0945import re
from ufal.udpipe import Model, Pipeline, ProcessingError
class Parser:
MODELS = {
"swe": "data/swedish-ud-2.0-170801.udpipe",
}
def __init__(self, language):
model_path = self.MODELS.get(language, None)
if not model_path:
raise ParserException("Cannot find model for language '%s'" % language)
model = Model.load(model_path)
if not model:
raise ParserException("Cannot load model from file '%s'\n" % model_path)
self.model = model
def parse(self, text):
text = text.strip()
# Adding a period improves detection on especially short sentences
period_added = False
last_character = text.strip()[-1]
if re.match(r"\w", last_character, flags=re.UNICODE):
text += "."
period_added = True
pipeline = Pipeline(
self.model,
"tokenize",
Pipeline.DEFAULT,
Pipeline.DEFAULT,
"conllu"
)
error = ProcessingError()
processed = pipeline.process(text, error)
if error.occurred():
raise ParserException(error.message)
# Remove the period to make sure input corresponds to output
if period_added:
processed = "\n".join(processed.rstrip().split("\n")[:-1]) + "\n\n"
return processed
class ParserException(Exception):
pass
| <commit_before>import re
from ufal.udpipe import Model, Pipeline, ProcessingError
class Parser:
MODELS = {
"swe": "data/swedish-ud-2.0-170801.udpipe",
}
def __init__(self, language):
model_path = self.MODELS.get(language, None)
if not model_path:
raise ParserException("Cannot find model for language '%s'" % language)
model = Model.load(model_path)
if not model:
raise ParserException("Cannot load model from file '%s'\n" % model_path)
self.model = model
def parse(self, text):
text = text.strip()
last_character = text.strip()[-1]
if re.match(r"\w", last_character, flags=re.UNICODE):
text += "."
pipeline = Pipeline(
self.model,
"tokenize",
Pipeline.DEFAULT,
Pipeline.DEFAULT,
"conllu"
)
error = ProcessingError()
processed = pipeline.process(text, error)
if error.occurred():
raise ParserException(error.message)
return processed
class ParserException(Exception):
pass
<commit_msg>Remove period so input corresponds to output.
Former-commit-id: ec6debb1637304407715441ae8319787fe7f0945<commit_after>import re
from ufal.udpipe import Model, Pipeline, ProcessingError
class Parser:
MODELS = {
"swe": "data/swedish-ud-2.0-170801.udpipe",
}
def __init__(self, language):
model_path = self.MODELS.get(language, None)
if not model_path:
raise ParserException("Cannot find model for language '%s'" % language)
model = Model.load(model_path)
if not model:
raise ParserException("Cannot load model from file '%s'\n" % model_path)
self.model = model
def parse(self, text):
text = text.strip()
# Adding a period improves detection on especially short sentences
period_added = False
last_character = text.strip()[-1]
if re.match(r"\w", last_character, flags=re.UNICODE):
text += "."
period_added = True
pipeline = Pipeline(
self.model,
"tokenize",
Pipeline.DEFAULT,
Pipeline.DEFAULT,
"conllu"
)
error = ProcessingError()
processed = pipeline.process(text, error)
if error.occurred():
raise ParserException(error.message)
# Remove the period to make sure input corresponds to output
if period_added:
processed = "\n".join(processed.rstrip().split("\n")[:-1]) + "\n\n"
return processed
class ParserException(Exception):
pass
|
f5de027e14e50ff5085ac1765bdfd2ee7646cabb | extras/sublime_mdown.py | extras/sublime_mdown.py | import sublime
import sublime_plugin
from os.path import basename, dirname
import subprocess
def parse_file_name(file_name):
if file_name is None:
title = "Untitled"
basepath = None
else:
title = basename(file_name)
basepath = dirname(file_name)
return title, basepath
class MdownPreviewCommand(sublime_plugin.TextCommand):
def run(self, edit):
title, basepath = parse_file_name(self.view.file_name())
self.convert(title, basepath)
def convert(self, title, basepath):
binary = sublime.load_settings("mdown.sublime-settings").get("binary", None)
if binary is not None:
cmd = [binary, "-t", title, "-s", "-p"]
if basepath is not None:
cmd += ["-b", basepath]
p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
for line in self.view.lines(sublime.Region(0, self.view.size())):
p.stdin.write((self.view.substr(line) + '\n').encode('utf-8'))
print(p.communicate()[0].decode("utf-8"))
| import sublime
import sublime_plugin
from os.path import basename, dirname
import subprocess
def parse_file_name(file_name):
if file_name is None:
title = "Untitled"
basepath = None
else:
title = basename(file_name)
basepath = dirname(file_name)
return title, basepath
class MdownPreviewCommand(sublime_plugin.TextCommand):
def run(self, edit):
title, basepath = parse_file_name(self.view.file_name())
self.convert(title, basepath)
def convert(self, title, basepath):
binary = sublime.load_settings("mdown.sublime-settings").get("binary", None)
if binary is not None:
cmd = [binary, "-T", title, "-s", "-p"]
if basepath is not None:
cmd += ["-b", basepath]
p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
for line in self.view.lines(sublime.Region(0, self.view.size())):
p.stdin.write((self.view.substr(line) + '\n').encode('utf-8'))
print(p.communicate()[0].decode("utf-8"))
| Adjust extras sublime plugin to follow new changes | Adjust extras sublime plugin to follow new changes
| Python | mit | facelessuser/PyMdown,facelessuser/PyMdown,facelessuser/PyMdown | import sublime
import sublime_plugin
from os.path import basename, dirname
import subprocess
def parse_file_name(file_name):
if file_name is None:
title = "Untitled"
basepath = None
else:
title = basename(file_name)
basepath = dirname(file_name)
return title, basepath
class MdownPreviewCommand(sublime_plugin.TextCommand):
def run(self, edit):
title, basepath = parse_file_name(self.view.file_name())
self.convert(title, basepath)
def convert(self, title, basepath):
binary = sublime.load_settings("mdown.sublime-settings").get("binary", None)
if binary is not None:
cmd = [binary, "-t", title, "-s", "-p"]
if basepath is not None:
cmd += ["-b", basepath]
p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
for line in self.view.lines(sublime.Region(0, self.view.size())):
p.stdin.write((self.view.substr(line) + '\n').encode('utf-8'))
print(p.communicate()[0].decode("utf-8"))
Adjust extras sublime plugin to follow new changes | import sublime
import sublime_plugin
from os.path import basename, dirname
import subprocess
def parse_file_name(file_name):
if file_name is None:
title = "Untitled"
basepath = None
else:
title = basename(file_name)
basepath = dirname(file_name)
return title, basepath
class MdownPreviewCommand(sublime_plugin.TextCommand):
def run(self, edit):
title, basepath = parse_file_name(self.view.file_name())
self.convert(title, basepath)
def convert(self, title, basepath):
binary = sublime.load_settings("mdown.sublime-settings").get("binary", None)
if binary is not None:
cmd = [binary, "-T", title, "-s", "-p"]
if basepath is not None:
cmd += ["-b", basepath]
p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
for line in self.view.lines(sublime.Region(0, self.view.size())):
p.stdin.write((self.view.substr(line) + '\n').encode('utf-8'))
print(p.communicate()[0].decode("utf-8"))
| <commit_before>import sublime
import sublime_plugin
from os.path import basename, dirname
import subprocess
def parse_file_name(file_name):
if file_name is None:
title = "Untitled"
basepath = None
else:
title = basename(file_name)
basepath = dirname(file_name)
return title, basepath
class MdownPreviewCommand(sublime_plugin.TextCommand):
def run(self, edit):
title, basepath = parse_file_name(self.view.file_name())
self.convert(title, basepath)
def convert(self, title, basepath):
binary = sublime.load_settings("mdown.sublime-settings").get("binary", None)
if binary is not None:
cmd = [binary, "-t", title, "-s", "-p"]
if basepath is not None:
cmd += ["-b", basepath]
p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
for line in self.view.lines(sublime.Region(0, self.view.size())):
p.stdin.write((self.view.substr(line) + '\n').encode('utf-8'))
print(p.communicate()[0].decode("utf-8"))
<commit_msg>Adjust extras sublime plugin to follow new changes<commit_after> | import sublime
import sublime_plugin
from os.path import basename, dirname
import subprocess
def parse_file_name(file_name):
if file_name is None:
title = "Untitled"
basepath = None
else:
title = basename(file_name)
basepath = dirname(file_name)
return title, basepath
class MdownPreviewCommand(sublime_plugin.TextCommand):
def run(self, edit):
title, basepath = parse_file_name(self.view.file_name())
self.convert(title, basepath)
def convert(self, title, basepath):
binary = sublime.load_settings("mdown.sublime-settings").get("binary", None)
if binary is not None:
cmd = [binary, "-T", title, "-s", "-p"]
if basepath is not None:
cmd += ["-b", basepath]
p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
for line in self.view.lines(sublime.Region(0, self.view.size())):
p.stdin.write((self.view.substr(line) + '\n').encode('utf-8'))
print(p.communicate()[0].decode("utf-8"))
| import sublime
import sublime_plugin
from os.path import basename, dirname
import subprocess
def parse_file_name(file_name):
if file_name is None:
title = "Untitled"
basepath = None
else:
title = basename(file_name)
basepath = dirname(file_name)
return title, basepath
class MdownPreviewCommand(sublime_plugin.TextCommand):
def run(self, edit):
title, basepath = parse_file_name(self.view.file_name())
self.convert(title, basepath)
def convert(self, title, basepath):
binary = sublime.load_settings("mdown.sublime-settings").get("binary", None)
if binary is not None:
cmd = [binary, "-t", title, "-s", "-p"]
if basepath is not None:
cmd += ["-b", basepath]
p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
for line in self.view.lines(sublime.Region(0, self.view.size())):
p.stdin.write((self.view.substr(line) + '\n').encode('utf-8'))
print(p.communicate()[0].decode("utf-8"))
Adjust extras sublime plugin to follow new changesimport sublime
import sublime_plugin
from os.path import basename, dirname
import subprocess
def parse_file_name(file_name):
if file_name is None:
title = "Untitled"
basepath = None
else:
title = basename(file_name)
basepath = dirname(file_name)
return title, basepath
class MdownPreviewCommand(sublime_plugin.TextCommand):
def run(self, edit):
title, basepath = parse_file_name(self.view.file_name())
self.convert(title, basepath)
def convert(self, title, basepath):
binary = sublime.load_settings("mdown.sublime-settings").get("binary", None)
if binary is not None:
cmd = [binary, "-T", title, "-s", "-p"]
if basepath is not None:
cmd += ["-b", basepath]
p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
for line in self.view.lines(sublime.Region(0, self.view.size())):
p.stdin.write((self.view.substr(line) + '\n').encode('utf-8'))
print(p.communicate()[0].decode("utf-8"))
| <commit_before>import sublime
import sublime_plugin
from os.path import basename, dirname
import subprocess
def parse_file_name(file_name):
if file_name is None:
title = "Untitled"
basepath = None
else:
title = basename(file_name)
basepath = dirname(file_name)
return title, basepath
class MdownPreviewCommand(sublime_plugin.TextCommand):
def run(self, edit):
title, basepath = parse_file_name(self.view.file_name())
self.convert(title, basepath)
def convert(self, title, basepath):
binary = sublime.load_settings("mdown.sublime-settings").get("binary", None)
if binary is not None:
cmd = [binary, "-t", title, "-s", "-p"]
if basepath is not None:
cmd += ["-b", basepath]
p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
for line in self.view.lines(sublime.Region(0, self.view.size())):
p.stdin.write((self.view.substr(line) + '\n').encode('utf-8'))
print(p.communicate()[0].decode("utf-8"))
<commit_msg>Adjust extras sublime plugin to follow new changes<commit_after>import sublime
import sublime_plugin
from os.path import basename, dirname
import subprocess
def parse_file_name(file_name):
if file_name is None:
title = "Untitled"
basepath = None
else:
title = basename(file_name)
basepath = dirname(file_name)
return title, basepath
class MdownPreviewCommand(sublime_plugin.TextCommand):
def run(self, edit):
title, basepath = parse_file_name(self.view.file_name())
self.convert(title, basepath)
def convert(self, title, basepath):
binary = sublime.load_settings("mdown.sublime-settings").get("binary", None)
if binary is not None:
cmd = [binary, "-T", title, "-s", "-p"]
if basepath is not None:
cmd += ["-b", basepath]
p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
for line in self.view.lines(sublime.Region(0, self.view.size())):
p.stdin.write((self.view.substr(line) + '\n').encode('utf-8'))
print(p.communicate()[0].decode("utf-8"))
|
ba5edd102ddd53f2e95da8b673bf14bdd72dc012 | pw_cli/py/pw_cli/argument_types.py | pw_cli/py/pw_cli/argument_types.py | # Copyright 2021 The Pigweed Authors
#
# 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
#
# https://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.
"""Defines argument types for use with argparse."""
import argparse
import logging
from pathlib import Path
def directory(arg: str) -> Path:
path = Path(arg)
if path.is_dir():
return path.resolve()
raise argparse.ArgumentTypeError(f'{path} is not a directory')
def log_level(arg: str) -> int:
try:
return getattr(logging, arg.upper())
except AttributeError:
raise argparse.ArgumentTypeError(
f'{arg.upper()} is not a valid log level')
| # Copyright 2021 The Pigweed Authors
#
# 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
#
# https://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.
"""Defines argument types for use with argparse."""
import argparse
import logging
from pathlib import Path
def directory(arg: str) -> Path:
path = Path(arg)
if path.is_dir():
return path.resolve()
raise argparse.ArgumentTypeError(f'"{path}" is not a directory')
def log_level(arg: str) -> int:
try:
return getattr(logging, arg.upper())
except AttributeError:
raise argparse.ArgumentTypeError(
f'"{arg.upper()}" is not a valid log level')
| Add quotes around user-provided values | pw_cli: Add quotes around user-provided values
Change-Id: Ifc5fafeefef0dea65cb3aba90b985e6be31fa0bd
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/81980
Reviewed-by: Joe Ethier <f5eb8cb2f5310c7fa9df6f16eabccb4436f47999@google.com>
Commit-Queue: RJ Ascani <4734195edb8e393f72741de86b813743e1460cb1@google.com>
| Python | apache-2.0 | google/pigweed,google/pigweed,google/pigweed,google/pigweed,google/pigweed,google/pigweed,google/pigweed,google/pigweed,google/pigweed,google/pigweed | # Copyright 2021 The Pigweed Authors
#
# 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
#
# https://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.
"""Defines argument types for use with argparse."""
import argparse
import logging
from pathlib import Path
def directory(arg: str) -> Path:
path = Path(arg)
if path.is_dir():
return path.resolve()
raise argparse.ArgumentTypeError(f'{path} is not a directory')
def log_level(arg: str) -> int:
try:
return getattr(logging, arg.upper())
except AttributeError:
raise argparse.ArgumentTypeError(
f'{arg.upper()} is not a valid log level')
pw_cli: Add quotes around user-provided values
Change-Id: Ifc5fafeefef0dea65cb3aba90b985e6be31fa0bd
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/81980
Reviewed-by: Joe Ethier <f5eb8cb2f5310c7fa9df6f16eabccb4436f47999@google.com>
Commit-Queue: RJ Ascani <4734195edb8e393f72741de86b813743e1460cb1@google.com> | # Copyright 2021 The Pigweed Authors
#
# 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
#
# https://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.
"""Defines argument types for use with argparse."""
import argparse
import logging
from pathlib import Path
def directory(arg: str) -> Path:
path = Path(arg)
if path.is_dir():
return path.resolve()
raise argparse.ArgumentTypeError(f'"{path}" is not a directory')
def log_level(arg: str) -> int:
try:
return getattr(logging, arg.upper())
except AttributeError:
raise argparse.ArgumentTypeError(
f'"{arg.upper()}" is not a valid log level')
| <commit_before># Copyright 2021 The Pigweed Authors
#
# 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
#
# https://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.
"""Defines argument types for use with argparse."""
import argparse
import logging
from pathlib import Path
def directory(arg: str) -> Path:
path = Path(arg)
if path.is_dir():
return path.resolve()
raise argparse.ArgumentTypeError(f'{path} is not a directory')
def log_level(arg: str) -> int:
try:
return getattr(logging, arg.upper())
except AttributeError:
raise argparse.ArgumentTypeError(
f'{arg.upper()} is not a valid log level')
<commit_msg>pw_cli: Add quotes around user-provided values
Change-Id: Ifc5fafeefef0dea65cb3aba90b985e6be31fa0bd
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/81980
Reviewed-by: Joe Ethier <f5eb8cb2f5310c7fa9df6f16eabccb4436f47999@google.com>
Commit-Queue: RJ Ascani <4734195edb8e393f72741de86b813743e1460cb1@google.com><commit_after> | # Copyright 2021 The Pigweed Authors
#
# 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
#
# https://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.
"""Defines argument types for use with argparse."""
import argparse
import logging
from pathlib import Path
def directory(arg: str) -> Path:
path = Path(arg)
if path.is_dir():
return path.resolve()
raise argparse.ArgumentTypeError(f'"{path}" is not a directory')
def log_level(arg: str) -> int:
try:
return getattr(logging, arg.upper())
except AttributeError:
raise argparse.ArgumentTypeError(
f'"{arg.upper()}" is not a valid log level')
| # Copyright 2021 The Pigweed Authors
#
# 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
#
# https://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.
"""Defines argument types for use with argparse."""
import argparse
import logging
from pathlib import Path
def directory(arg: str) -> Path:
path = Path(arg)
if path.is_dir():
return path.resolve()
raise argparse.ArgumentTypeError(f'{path} is not a directory')
def log_level(arg: str) -> int:
try:
return getattr(logging, arg.upper())
except AttributeError:
raise argparse.ArgumentTypeError(
f'{arg.upper()} is not a valid log level')
pw_cli: Add quotes around user-provided values
Change-Id: Ifc5fafeefef0dea65cb3aba90b985e6be31fa0bd
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/81980
Reviewed-by: Joe Ethier <f5eb8cb2f5310c7fa9df6f16eabccb4436f47999@google.com>
Commit-Queue: RJ Ascani <4734195edb8e393f72741de86b813743e1460cb1@google.com># Copyright 2021 The Pigweed Authors
#
# 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
#
# https://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.
"""Defines argument types for use with argparse."""
import argparse
import logging
from pathlib import Path
def directory(arg: str) -> Path:
path = Path(arg)
if path.is_dir():
return path.resolve()
raise argparse.ArgumentTypeError(f'"{path}" is not a directory')
def log_level(arg: str) -> int:
try:
return getattr(logging, arg.upper())
except AttributeError:
raise argparse.ArgumentTypeError(
f'"{arg.upper()}" is not a valid log level')
| <commit_before># Copyright 2021 The Pigweed Authors
#
# 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
#
# https://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.
"""Defines argument types for use with argparse."""
import argparse
import logging
from pathlib import Path
def directory(arg: str) -> Path:
path = Path(arg)
if path.is_dir():
return path.resolve()
raise argparse.ArgumentTypeError(f'{path} is not a directory')
def log_level(arg: str) -> int:
try:
return getattr(logging, arg.upper())
except AttributeError:
raise argparse.ArgumentTypeError(
f'{arg.upper()} is not a valid log level')
<commit_msg>pw_cli: Add quotes around user-provided values
Change-Id: Ifc5fafeefef0dea65cb3aba90b985e6be31fa0bd
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/81980
Reviewed-by: Joe Ethier <f5eb8cb2f5310c7fa9df6f16eabccb4436f47999@google.com>
Commit-Queue: RJ Ascani <4734195edb8e393f72741de86b813743e1460cb1@google.com><commit_after># Copyright 2021 The Pigweed Authors
#
# 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
#
# https://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.
"""Defines argument types for use with argparse."""
import argparse
import logging
from pathlib import Path
def directory(arg: str) -> Path:
path = Path(arg)
if path.is_dir():
return path.resolve()
raise argparse.ArgumentTypeError(f'"{path}" is not a directory')
def log_level(arg: str) -> int:
try:
return getattr(logging, arg.upper())
except AttributeError:
raise argparse.ArgumentTypeError(
f'"{arg.upper()}" is not a valid log level')
|
9783844b1597598fad833794b4b291fce49438d4 | app/hr/tasks.py | app/hr/tasks.py | from django.conf import settings
import logging
from datetime import datetime, timedelta
from celery.decorators import task
from hr.utils import blacklist_values
from django.contrib.auth.models import User
from django.core.mail import send_mail
@task(ignore_result=True)
def blacklist_check():
log = blacklist_check.get_logger()
users = User.objects.filter(is_active=True)
for u in users:
if u.groups.count() > 0:
# Has groups
val = blacklist_values(u)
if len(val) > 0:
# Report possible issue
log.warning("Suspect User: %s, %s entries found: %s" % (u.username, len(val), val))
blstr = ""
for i in val:
blstr = "%s%s - %s - %s\n" % (blstr, i.get_type_display(), i.value, i.reason)
msg = "Suspect User found: %s\nGroups: %s\nBlacklist Items:\n\n%s" % (u.username, ", ".join(u.groups.all().values_list('name', flat=True)), blstr)
send_mail('Automated blacklist checker alert - %s' % u.username, msg, 'blacklist@pleaseignore.com', ['abuse@pleaseignore.com'])
| from django.conf import settings
import logging
from datetime import datetime, timedelta
from celery.decorators import task
from hr.utils import blacklist_values
from django.contrib.auth.models import User
from django.core.mail import send_mail
@task(ignore_result=True)
def blacklist_check():
log = blacklist_check.get_logger()
users = User.objects.filter(is_active=True)
alerts = 0
msg = ""
for u in users:
if u.groups.count() > 0:
# Has groups
val = blacklist_values(u)
if len(val) > 0:
alerts += 1
# Report possible issue
log.warning("Suspect User: %s, %s entries found: %s" % (u.username, len(val), val))
blstr = ""
for i in val:
blstr = "%s%s - %s - %s\n" % (blstr, i.get_type_display(), i.value, i.reason)
msg += "\n\n-----\n\n"
msg += "Suspect User found: %s\nGroups: %s\nBlacklist Items:\n\n%s" % (u.username, ", ".join(u.groups.all().values_list('name', flat=True)), blstr)
if alerts:
send_mail('Automated blacklist checker alerts', msg, 'blacklist@pleaseignore.com', ['abuse@pleaseignore.com'])
| Send alerts as one mail | Send alerts as one mail
| Python | bsd-3-clause | nikdoof/test-auth | from django.conf import settings
import logging
from datetime import datetime, timedelta
from celery.decorators import task
from hr.utils import blacklist_values
from django.contrib.auth.models import User
from django.core.mail import send_mail
@task(ignore_result=True)
def blacklist_check():
log = blacklist_check.get_logger()
users = User.objects.filter(is_active=True)
for u in users:
if u.groups.count() > 0:
# Has groups
val = blacklist_values(u)
if len(val) > 0:
# Report possible issue
log.warning("Suspect User: %s, %s entries found: %s" % (u.username, len(val), val))
blstr = ""
for i in val:
blstr = "%s%s - %s - %s\n" % (blstr, i.get_type_display(), i.value, i.reason)
msg = "Suspect User found: %s\nGroups: %s\nBlacklist Items:\n\n%s" % (u.username, ", ".join(u.groups.all().values_list('name', flat=True)), blstr)
send_mail('Automated blacklist checker alert - %s' % u.username, msg, 'blacklist@pleaseignore.com', ['abuse@pleaseignore.com'])
Send alerts as one mail | from django.conf import settings
import logging
from datetime import datetime, timedelta
from celery.decorators import task
from hr.utils import blacklist_values
from django.contrib.auth.models import User
from django.core.mail import send_mail
@task(ignore_result=True)
def blacklist_check():
log = blacklist_check.get_logger()
users = User.objects.filter(is_active=True)
alerts = 0
msg = ""
for u in users:
if u.groups.count() > 0:
# Has groups
val = blacklist_values(u)
if len(val) > 0:
alerts += 1
# Report possible issue
log.warning("Suspect User: %s, %s entries found: %s" % (u.username, len(val), val))
blstr = ""
for i in val:
blstr = "%s%s - %s - %s\n" % (blstr, i.get_type_display(), i.value, i.reason)
msg += "\n\n-----\n\n"
msg += "Suspect User found: %s\nGroups: %s\nBlacklist Items:\n\n%s" % (u.username, ", ".join(u.groups.all().values_list('name', flat=True)), blstr)
if alerts:
send_mail('Automated blacklist checker alerts', msg, 'blacklist@pleaseignore.com', ['abuse@pleaseignore.com'])
| <commit_before>from django.conf import settings
import logging
from datetime import datetime, timedelta
from celery.decorators import task
from hr.utils import blacklist_values
from django.contrib.auth.models import User
from django.core.mail import send_mail
@task(ignore_result=True)
def blacklist_check():
log = blacklist_check.get_logger()
users = User.objects.filter(is_active=True)
for u in users:
if u.groups.count() > 0:
# Has groups
val = blacklist_values(u)
if len(val) > 0:
# Report possible issue
log.warning("Suspect User: %s, %s entries found: %s" % (u.username, len(val), val))
blstr = ""
for i in val:
blstr = "%s%s - %s - %s\n" % (blstr, i.get_type_display(), i.value, i.reason)
msg = "Suspect User found: %s\nGroups: %s\nBlacklist Items:\n\n%s" % (u.username, ", ".join(u.groups.all().values_list('name', flat=True)), blstr)
send_mail('Automated blacklist checker alert - %s' % u.username, msg, 'blacklist@pleaseignore.com', ['abuse@pleaseignore.com'])
<commit_msg>Send alerts as one mail<commit_after> | from django.conf import settings
import logging
from datetime import datetime, timedelta
from celery.decorators import task
from hr.utils import blacklist_values
from django.contrib.auth.models import User
from django.core.mail import send_mail
@task(ignore_result=True)
def blacklist_check():
log = blacklist_check.get_logger()
users = User.objects.filter(is_active=True)
alerts = 0
msg = ""
for u in users:
if u.groups.count() > 0:
# Has groups
val = blacklist_values(u)
if len(val) > 0:
alerts += 1
# Report possible issue
log.warning("Suspect User: %s, %s entries found: %s" % (u.username, len(val), val))
blstr = ""
for i in val:
blstr = "%s%s - %s - %s\n" % (blstr, i.get_type_display(), i.value, i.reason)
msg += "\n\n-----\n\n"
msg += "Suspect User found: %s\nGroups: %s\nBlacklist Items:\n\n%s" % (u.username, ", ".join(u.groups.all().values_list('name', flat=True)), blstr)
if alerts:
send_mail('Automated blacklist checker alerts', msg, 'blacklist@pleaseignore.com', ['abuse@pleaseignore.com'])
| from django.conf import settings
import logging
from datetime import datetime, timedelta
from celery.decorators import task
from hr.utils import blacklist_values
from django.contrib.auth.models import User
from django.core.mail import send_mail
@task(ignore_result=True)
def blacklist_check():
log = blacklist_check.get_logger()
users = User.objects.filter(is_active=True)
for u in users:
if u.groups.count() > 0:
# Has groups
val = blacklist_values(u)
if len(val) > 0:
# Report possible issue
log.warning("Suspect User: %s, %s entries found: %s" % (u.username, len(val), val))
blstr = ""
for i in val:
blstr = "%s%s - %s - %s\n" % (blstr, i.get_type_display(), i.value, i.reason)
msg = "Suspect User found: %s\nGroups: %s\nBlacklist Items:\n\n%s" % (u.username, ", ".join(u.groups.all().values_list('name', flat=True)), blstr)
send_mail('Automated blacklist checker alert - %s' % u.username, msg, 'blacklist@pleaseignore.com', ['abuse@pleaseignore.com'])
Send alerts as one mailfrom django.conf import settings
import logging
from datetime import datetime, timedelta
from celery.decorators import task
from hr.utils import blacklist_values
from django.contrib.auth.models import User
from django.core.mail import send_mail
@task(ignore_result=True)
def blacklist_check():
log = blacklist_check.get_logger()
users = User.objects.filter(is_active=True)
alerts = 0
msg = ""
for u in users:
if u.groups.count() > 0:
# Has groups
val = blacklist_values(u)
if len(val) > 0:
alerts += 1
# Report possible issue
log.warning("Suspect User: %s, %s entries found: %s" % (u.username, len(val), val))
blstr = ""
for i in val:
blstr = "%s%s - %s - %s\n" % (blstr, i.get_type_display(), i.value, i.reason)
msg += "\n\n-----\n\n"
msg += "Suspect User found: %s\nGroups: %s\nBlacklist Items:\n\n%s" % (u.username, ", ".join(u.groups.all().values_list('name', flat=True)), blstr)
if alerts:
send_mail('Automated blacklist checker alerts', msg, 'blacklist@pleaseignore.com', ['abuse@pleaseignore.com'])
| <commit_before>from django.conf import settings
import logging
from datetime import datetime, timedelta
from celery.decorators import task
from hr.utils import blacklist_values
from django.contrib.auth.models import User
from django.core.mail import send_mail
@task(ignore_result=True)
def blacklist_check():
log = blacklist_check.get_logger()
users = User.objects.filter(is_active=True)
for u in users:
if u.groups.count() > 0:
# Has groups
val = blacklist_values(u)
if len(val) > 0:
# Report possible issue
log.warning("Suspect User: %s, %s entries found: %s" % (u.username, len(val), val))
blstr = ""
for i in val:
blstr = "%s%s - %s - %s\n" % (blstr, i.get_type_display(), i.value, i.reason)
msg = "Suspect User found: %s\nGroups: %s\nBlacklist Items:\n\n%s" % (u.username, ", ".join(u.groups.all().values_list('name', flat=True)), blstr)
send_mail('Automated blacklist checker alert - %s' % u.username, msg, 'blacklist@pleaseignore.com', ['abuse@pleaseignore.com'])
<commit_msg>Send alerts as one mail<commit_after>from django.conf import settings
import logging
from datetime import datetime, timedelta
from celery.decorators import task
from hr.utils import blacklist_values
from django.contrib.auth.models import User
from django.core.mail import send_mail
@task(ignore_result=True)
def blacklist_check():
log = blacklist_check.get_logger()
users = User.objects.filter(is_active=True)
alerts = 0
msg = ""
for u in users:
if u.groups.count() > 0:
# Has groups
val = blacklist_values(u)
if len(val) > 0:
alerts += 1
# Report possible issue
log.warning("Suspect User: %s, %s entries found: %s" % (u.username, len(val), val))
blstr = ""
for i in val:
blstr = "%s%s - %s - %s\n" % (blstr, i.get_type_display(), i.value, i.reason)
msg += "\n\n-----\n\n"
msg += "Suspect User found: %s\nGroups: %s\nBlacklist Items:\n\n%s" % (u.username, ", ".join(u.groups.all().values_list('name', flat=True)), blstr)
if alerts:
send_mail('Automated blacklist checker alerts', msg, 'blacklist@pleaseignore.com', ['abuse@pleaseignore.com'])
|
7fb89e4dbe2cbed4ef37e13073d4fa3f2a650049 | InvenTree/part/apps.py | InvenTree/part/apps.py | from __future__ import unicode_literals
from django.apps import AppConfig
class PartConfig(AppConfig):
name = 'part'
| from __future__ import unicode_literals
import os
from django.db.utils import OperationalError, ProgrammingError
from django.apps import AppConfig
from django.conf import settings
class PartConfig(AppConfig):
name = 'part'
def ready(self):
"""
This function is called whenever the Part app is loaded.
"""
self.generate_part_thumbnails()
def generate_part_thumbnails(self):
from .models import Part
print("Checking Part image thumbnails")
try:
for part in Part.objects.all():
if part.image:
url = part.image.thumbnail.name
#if url.startswith('/'):
# url = url[1:]
loc = os.path.join(settings.MEDIA_ROOT, url)
if not os.path.exists(loc):
print("InvenTree: Generating thumbnail for Part '{p}'".format(p=part.name))
part.image.render_variations(replace=False)
except (OperationalError, ProgrammingError):
print("Could not generate Part thumbnails")
| Check for missing part thumbnails when the server first runs | Check for missing part thumbnails when the server first runs
| Python | mit | inventree/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree | from __future__ import unicode_literals
from django.apps import AppConfig
class PartConfig(AppConfig):
name = 'part'
Check for missing part thumbnails when the server first runs | from __future__ import unicode_literals
import os
from django.db.utils import OperationalError, ProgrammingError
from django.apps import AppConfig
from django.conf import settings
class PartConfig(AppConfig):
name = 'part'
def ready(self):
"""
This function is called whenever the Part app is loaded.
"""
self.generate_part_thumbnails()
def generate_part_thumbnails(self):
from .models import Part
print("Checking Part image thumbnails")
try:
for part in Part.objects.all():
if part.image:
url = part.image.thumbnail.name
#if url.startswith('/'):
# url = url[1:]
loc = os.path.join(settings.MEDIA_ROOT, url)
if not os.path.exists(loc):
print("InvenTree: Generating thumbnail for Part '{p}'".format(p=part.name))
part.image.render_variations(replace=False)
except (OperationalError, ProgrammingError):
print("Could not generate Part thumbnails")
| <commit_before>from __future__ import unicode_literals
from django.apps import AppConfig
class PartConfig(AppConfig):
name = 'part'
<commit_msg>Check for missing part thumbnails when the server first runs<commit_after> | from __future__ import unicode_literals
import os
from django.db.utils import OperationalError, ProgrammingError
from django.apps import AppConfig
from django.conf import settings
class PartConfig(AppConfig):
name = 'part'
def ready(self):
"""
This function is called whenever the Part app is loaded.
"""
self.generate_part_thumbnails()
def generate_part_thumbnails(self):
from .models import Part
print("Checking Part image thumbnails")
try:
for part in Part.objects.all():
if part.image:
url = part.image.thumbnail.name
#if url.startswith('/'):
# url = url[1:]
loc = os.path.join(settings.MEDIA_ROOT, url)
if not os.path.exists(loc):
print("InvenTree: Generating thumbnail for Part '{p}'".format(p=part.name))
part.image.render_variations(replace=False)
except (OperationalError, ProgrammingError):
print("Could not generate Part thumbnails")
| from __future__ import unicode_literals
from django.apps import AppConfig
class PartConfig(AppConfig):
name = 'part'
Check for missing part thumbnails when the server first runsfrom __future__ import unicode_literals
import os
from django.db.utils import OperationalError, ProgrammingError
from django.apps import AppConfig
from django.conf import settings
class PartConfig(AppConfig):
name = 'part'
def ready(self):
"""
This function is called whenever the Part app is loaded.
"""
self.generate_part_thumbnails()
def generate_part_thumbnails(self):
from .models import Part
print("Checking Part image thumbnails")
try:
for part in Part.objects.all():
if part.image:
url = part.image.thumbnail.name
#if url.startswith('/'):
# url = url[1:]
loc = os.path.join(settings.MEDIA_ROOT, url)
if not os.path.exists(loc):
print("InvenTree: Generating thumbnail for Part '{p}'".format(p=part.name))
part.image.render_variations(replace=False)
except (OperationalError, ProgrammingError):
print("Could not generate Part thumbnails")
| <commit_before>from __future__ import unicode_literals
from django.apps import AppConfig
class PartConfig(AppConfig):
name = 'part'
<commit_msg>Check for missing part thumbnails when the server first runs<commit_after>from __future__ import unicode_literals
import os
from django.db.utils import OperationalError, ProgrammingError
from django.apps import AppConfig
from django.conf import settings
class PartConfig(AppConfig):
name = 'part'
def ready(self):
"""
This function is called whenever the Part app is loaded.
"""
self.generate_part_thumbnails()
def generate_part_thumbnails(self):
from .models import Part
print("Checking Part image thumbnails")
try:
for part in Part.objects.all():
if part.image:
url = part.image.thumbnail.name
#if url.startswith('/'):
# url = url[1:]
loc = os.path.join(settings.MEDIA_ROOT, url)
if not os.path.exists(loc):
print("InvenTree: Generating thumbnail for Part '{p}'".format(p=part.name))
part.image.render_variations(replace=False)
except (OperationalError, ProgrammingError):
print("Could not generate Part thumbnails")
|
e6e0d96790d71caccb3f00487bfeeddccdc78139 | app/raw/tasks.py | app/raw/tasks.py | from __future__ import absolute_import
from celery import shared_task
from twisted.internet import reactor
from scrapy.crawler import Crawler
from scrapy import log, signals
from scrapy.utils.project import get_project_settings
import os
from raw.scraper.spiders.legco_library import LibraryAgendaSpider
from raw.scraper.spiders.members import LibraryMemberSpider
@shared_task
def run_scraper():
output_name = 'foo.jl'
spider = LibraryAgendaSpider()
settings = get_project_settings()
url_path = os.path.join(settings.get('DATA_DIR_BASE'), 'scrapes', output_name)
settings.overrides['FEED_URI'] = url_path
crawler = Crawler(settings)
crawler.signals.connect(reactor.stop, signal=signals.spider_closed)
crawler.configure()
crawler.crawl(spider)
crawler.start()
log.start(loglevel=log.INFO, logstdout=True)
reactor.run()
return output_name
| from __future__ import absolute_import
from celery import shared_task
from twisted.internet import reactor
from scrapy.crawler import Crawler
from scrapy import log, signals
from scrapy.utils.project import get_project_settings
import os
from raw.scraper.spiders.legco_library import LibraryAgendaSpider
from raw.scraper.spiders.members import LibraryMemberSpider
@shared_task
def run_scraper():
output_name = 'foo.jl'
spider = LibraryAgendaSpider()
settings = get_project_settings()
output_path = os.path.join(settings.get('DATA_DIR_BASE'), 'scrapes', output_name)
settings.overrides['FEED_URI'] = output_path
crawler = Crawler(settings)
crawler.signals.connect(reactor.stop, signal=signals.spider_closed)
crawler.configure()
crawler.crawl(spider)
crawler.start()
log.start(loglevel=log.INFO, logstdout=True)
reactor.run()
return output_path
| Fix variable and return value | Fix variable and return value
| Python | mit | legco-watch/legco-watch,comsaint/legco-watch,comsaint/legco-watch,legco-watch/legco-watch,comsaint/legco-watch,legco-watch/legco-watch,comsaint/legco-watch,legco-watch/legco-watch | from __future__ import absolute_import
from celery import shared_task
from twisted.internet import reactor
from scrapy.crawler import Crawler
from scrapy import log, signals
from scrapy.utils.project import get_project_settings
import os
from raw.scraper.spiders.legco_library import LibraryAgendaSpider
from raw.scraper.spiders.members import LibraryMemberSpider
@shared_task
def run_scraper():
output_name = 'foo.jl'
spider = LibraryAgendaSpider()
settings = get_project_settings()
url_path = os.path.join(settings.get('DATA_DIR_BASE'), 'scrapes', output_name)
settings.overrides['FEED_URI'] = url_path
crawler = Crawler(settings)
crawler.signals.connect(reactor.stop, signal=signals.spider_closed)
crawler.configure()
crawler.crawl(spider)
crawler.start()
log.start(loglevel=log.INFO, logstdout=True)
reactor.run()
return output_name
Fix variable and return value | from __future__ import absolute_import
from celery import shared_task
from twisted.internet import reactor
from scrapy.crawler import Crawler
from scrapy import log, signals
from scrapy.utils.project import get_project_settings
import os
from raw.scraper.spiders.legco_library import LibraryAgendaSpider
from raw.scraper.spiders.members import LibraryMemberSpider
@shared_task
def run_scraper():
output_name = 'foo.jl'
spider = LibraryAgendaSpider()
settings = get_project_settings()
output_path = os.path.join(settings.get('DATA_DIR_BASE'), 'scrapes', output_name)
settings.overrides['FEED_URI'] = output_path
crawler = Crawler(settings)
crawler.signals.connect(reactor.stop, signal=signals.spider_closed)
crawler.configure()
crawler.crawl(spider)
crawler.start()
log.start(loglevel=log.INFO, logstdout=True)
reactor.run()
return output_path
| <commit_before>from __future__ import absolute_import
from celery import shared_task
from twisted.internet import reactor
from scrapy.crawler import Crawler
from scrapy import log, signals
from scrapy.utils.project import get_project_settings
import os
from raw.scraper.spiders.legco_library import LibraryAgendaSpider
from raw.scraper.spiders.members import LibraryMemberSpider
@shared_task
def run_scraper():
output_name = 'foo.jl'
spider = LibraryAgendaSpider()
settings = get_project_settings()
url_path = os.path.join(settings.get('DATA_DIR_BASE'), 'scrapes', output_name)
settings.overrides['FEED_URI'] = url_path
crawler = Crawler(settings)
crawler.signals.connect(reactor.stop, signal=signals.spider_closed)
crawler.configure()
crawler.crawl(spider)
crawler.start()
log.start(loglevel=log.INFO, logstdout=True)
reactor.run()
return output_name
<commit_msg>Fix variable and return value<commit_after> | from __future__ import absolute_import
from celery import shared_task
from twisted.internet import reactor
from scrapy.crawler import Crawler
from scrapy import log, signals
from scrapy.utils.project import get_project_settings
import os
from raw.scraper.spiders.legco_library import LibraryAgendaSpider
from raw.scraper.spiders.members import LibraryMemberSpider
@shared_task
def run_scraper():
output_name = 'foo.jl'
spider = LibraryAgendaSpider()
settings = get_project_settings()
output_path = os.path.join(settings.get('DATA_DIR_BASE'), 'scrapes', output_name)
settings.overrides['FEED_URI'] = output_path
crawler = Crawler(settings)
crawler.signals.connect(reactor.stop, signal=signals.spider_closed)
crawler.configure()
crawler.crawl(spider)
crawler.start()
log.start(loglevel=log.INFO, logstdout=True)
reactor.run()
return output_path
| from __future__ import absolute_import
from celery import shared_task
from twisted.internet import reactor
from scrapy.crawler import Crawler
from scrapy import log, signals
from scrapy.utils.project import get_project_settings
import os
from raw.scraper.spiders.legco_library import LibraryAgendaSpider
from raw.scraper.spiders.members import LibraryMemberSpider
@shared_task
def run_scraper():
output_name = 'foo.jl'
spider = LibraryAgendaSpider()
settings = get_project_settings()
url_path = os.path.join(settings.get('DATA_DIR_BASE'), 'scrapes', output_name)
settings.overrides['FEED_URI'] = url_path
crawler = Crawler(settings)
crawler.signals.connect(reactor.stop, signal=signals.spider_closed)
crawler.configure()
crawler.crawl(spider)
crawler.start()
log.start(loglevel=log.INFO, logstdout=True)
reactor.run()
return output_name
Fix variable and return valuefrom __future__ import absolute_import
from celery import shared_task
from twisted.internet import reactor
from scrapy.crawler import Crawler
from scrapy import log, signals
from scrapy.utils.project import get_project_settings
import os
from raw.scraper.spiders.legco_library import LibraryAgendaSpider
from raw.scraper.spiders.members import LibraryMemberSpider
@shared_task
def run_scraper():
output_name = 'foo.jl'
spider = LibraryAgendaSpider()
settings = get_project_settings()
output_path = os.path.join(settings.get('DATA_DIR_BASE'), 'scrapes', output_name)
settings.overrides['FEED_URI'] = output_path
crawler = Crawler(settings)
crawler.signals.connect(reactor.stop, signal=signals.spider_closed)
crawler.configure()
crawler.crawl(spider)
crawler.start()
log.start(loglevel=log.INFO, logstdout=True)
reactor.run()
return output_path
| <commit_before>from __future__ import absolute_import
from celery import shared_task
from twisted.internet import reactor
from scrapy.crawler import Crawler
from scrapy import log, signals
from scrapy.utils.project import get_project_settings
import os
from raw.scraper.spiders.legco_library import LibraryAgendaSpider
from raw.scraper.spiders.members import LibraryMemberSpider
@shared_task
def run_scraper():
output_name = 'foo.jl'
spider = LibraryAgendaSpider()
settings = get_project_settings()
url_path = os.path.join(settings.get('DATA_DIR_BASE'), 'scrapes', output_name)
settings.overrides['FEED_URI'] = url_path
crawler = Crawler(settings)
crawler.signals.connect(reactor.stop, signal=signals.spider_closed)
crawler.configure()
crawler.crawl(spider)
crawler.start()
log.start(loglevel=log.INFO, logstdout=True)
reactor.run()
return output_name
<commit_msg>Fix variable and return value<commit_after>from __future__ import absolute_import
from celery import shared_task
from twisted.internet import reactor
from scrapy.crawler import Crawler
from scrapy import log, signals
from scrapy.utils.project import get_project_settings
import os
from raw.scraper.spiders.legco_library import LibraryAgendaSpider
from raw.scraper.spiders.members import LibraryMemberSpider
@shared_task
def run_scraper():
output_name = 'foo.jl'
spider = LibraryAgendaSpider()
settings = get_project_settings()
output_path = os.path.join(settings.get('DATA_DIR_BASE'), 'scrapes', output_name)
settings.overrides['FEED_URI'] = output_path
crawler = Crawler(settings)
crawler.signals.connect(reactor.stop, signal=signals.spider_closed)
crawler.configure()
crawler.crawl(spider)
crawler.start()
log.start(loglevel=log.INFO, logstdout=True)
reactor.run()
return output_path
|
e71870736959efcde2188bdcbd89838b67ca8582 | pathvalidate/__init__.py | pathvalidate/__init__.py | """
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from .__version__ import __author__, __copyright__, __email__, __license__, __version__
from ._common import (
Platform,
ascii_symbols,
normalize_platform,
replace_ansi_escape,
replace_unprintable_char,
unprintable_ascii_chars,
validate_null_string,
validate_pathtype,
)
from ._filename import FileNameSanitizer, is_valid_filename, sanitize_filename, validate_filename
from ._filepath import (
FilePathSanitizer,
is_valid_filepath,
sanitize_file_path,
sanitize_filepath,
validate_file_path,
validate_filepath,
)
from ._ltsv import sanitize_ltsv_label, validate_ltsv_label
from ._symbol import replace_symbol, validate_symbol
from .error import (
ErrorReason,
InvalidCharError,
InvalidLengthError,
InvalidReservedNameError,
NullNameError,
ReservedNameError,
ValidationError,
ValidReservedNameError,
)
| """
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from .__version__ import __author__, __copyright__, __email__, __license__, __version__
from ._base import AbstractSanitizer, AbstractValidator
from ._common import (
Platform,
ascii_symbols,
normalize_platform,
replace_ansi_escape,
replace_unprintable_char,
unprintable_ascii_chars,
validate_null_string,
validate_pathtype,
)
from ._filename import FileNameSanitizer, is_valid_filename, sanitize_filename, validate_filename
from ._filepath import (
FilePathSanitizer,
is_valid_filepath,
sanitize_file_path,
sanitize_filepath,
validate_file_path,
validate_filepath,
)
from ._ltsv import sanitize_ltsv_label, validate_ltsv_label
from ._symbol import replace_symbol, validate_symbol
from .error import (
ErrorReason,
InvalidCharError,
InvalidLengthError,
InvalidReservedNameError,
NullNameError,
ReservedNameError,
ValidationError,
ValidReservedNameError,
)
| Add AbstractSanitizer/AbstractValidator class to import path | Add AbstractSanitizer/AbstractValidator class to import path
| Python | mit | thombashi/pathvalidate | """
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from .__version__ import __author__, __copyright__, __email__, __license__, __version__
from ._common import (
Platform,
ascii_symbols,
normalize_platform,
replace_ansi_escape,
replace_unprintable_char,
unprintable_ascii_chars,
validate_null_string,
validate_pathtype,
)
from ._filename import FileNameSanitizer, is_valid_filename, sanitize_filename, validate_filename
from ._filepath import (
FilePathSanitizer,
is_valid_filepath,
sanitize_file_path,
sanitize_filepath,
validate_file_path,
validate_filepath,
)
from ._ltsv import sanitize_ltsv_label, validate_ltsv_label
from ._symbol import replace_symbol, validate_symbol
from .error import (
ErrorReason,
InvalidCharError,
InvalidLengthError,
InvalidReservedNameError,
NullNameError,
ReservedNameError,
ValidationError,
ValidReservedNameError,
)
Add AbstractSanitizer/AbstractValidator class to import path | """
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from .__version__ import __author__, __copyright__, __email__, __license__, __version__
from ._base import AbstractSanitizer, AbstractValidator
from ._common import (
Platform,
ascii_symbols,
normalize_platform,
replace_ansi_escape,
replace_unprintable_char,
unprintable_ascii_chars,
validate_null_string,
validate_pathtype,
)
from ._filename import FileNameSanitizer, is_valid_filename, sanitize_filename, validate_filename
from ._filepath import (
FilePathSanitizer,
is_valid_filepath,
sanitize_file_path,
sanitize_filepath,
validate_file_path,
validate_filepath,
)
from ._ltsv import sanitize_ltsv_label, validate_ltsv_label
from ._symbol import replace_symbol, validate_symbol
from .error import (
ErrorReason,
InvalidCharError,
InvalidLengthError,
InvalidReservedNameError,
NullNameError,
ReservedNameError,
ValidationError,
ValidReservedNameError,
)
| <commit_before>"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from .__version__ import __author__, __copyright__, __email__, __license__, __version__
from ._common import (
Platform,
ascii_symbols,
normalize_platform,
replace_ansi_escape,
replace_unprintable_char,
unprintable_ascii_chars,
validate_null_string,
validate_pathtype,
)
from ._filename import FileNameSanitizer, is_valid_filename, sanitize_filename, validate_filename
from ._filepath import (
FilePathSanitizer,
is_valid_filepath,
sanitize_file_path,
sanitize_filepath,
validate_file_path,
validate_filepath,
)
from ._ltsv import sanitize_ltsv_label, validate_ltsv_label
from ._symbol import replace_symbol, validate_symbol
from .error import (
ErrorReason,
InvalidCharError,
InvalidLengthError,
InvalidReservedNameError,
NullNameError,
ReservedNameError,
ValidationError,
ValidReservedNameError,
)
<commit_msg>Add AbstractSanitizer/AbstractValidator class to import path<commit_after> | """
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from .__version__ import __author__, __copyright__, __email__, __license__, __version__
from ._base import AbstractSanitizer, AbstractValidator
from ._common import (
Platform,
ascii_symbols,
normalize_platform,
replace_ansi_escape,
replace_unprintable_char,
unprintable_ascii_chars,
validate_null_string,
validate_pathtype,
)
from ._filename import FileNameSanitizer, is_valid_filename, sanitize_filename, validate_filename
from ._filepath import (
FilePathSanitizer,
is_valid_filepath,
sanitize_file_path,
sanitize_filepath,
validate_file_path,
validate_filepath,
)
from ._ltsv import sanitize_ltsv_label, validate_ltsv_label
from ._symbol import replace_symbol, validate_symbol
from .error import (
ErrorReason,
InvalidCharError,
InvalidLengthError,
InvalidReservedNameError,
NullNameError,
ReservedNameError,
ValidationError,
ValidReservedNameError,
)
| """
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from .__version__ import __author__, __copyright__, __email__, __license__, __version__
from ._common import (
Platform,
ascii_symbols,
normalize_platform,
replace_ansi_escape,
replace_unprintable_char,
unprintable_ascii_chars,
validate_null_string,
validate_pathtype,
)
from ._filename import FileNameSanitizer, is_valid_filename, sanitize_filename, validate_filename
from ._filepath import (
FilePathSanitizer,
is_valid_filepath,
sanitize_file_path,
sanitize_filepath,
validate_file_path,
validate_filepath,
)
from ._ltsv import sanitize_ltsv_label, validate_ltsv_label
from ._symbol import replace_symbol, validate_symbol
from .error import (
ErrorReason,
InvalidCharError,
InvalidLengthError,
InvalidReservedNameError,
NullNameError,
ReservedNameError,
ValidationError,
ValidReservedNameError,
)
Add AbstractSanitizer/AbstractValidator class to import path"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from .__version__ import __author__, __copyright__, __email__, __license__, __version__
from ._base import AbstractSanitizer, AbstractValidator
from ._common import (
Platform,
ascii_symbols,
normalize_platform,
replace_ansi_escape,
replace_unprintable_char,
unprintable_ascii_chars,
validate_null_string,
validate_pathtype,
)
from ._filename import FileNameSanitizer, is_valid_filename, sanitize_filename, validate_filename
from ._filepath import (
FilePathSanitizer,
is_valid_filepath,
sanitize_file_path,
sanitize_filepath,
validate_file_path,
validate_filepath,
)
from ._ltsv import sanitize_ltsv_label, validate_ltsv_label
from ._symbol import replace_symbol, validate_symbol
from .error import (
ErrorReason,
InvalidCharError,
InvalidLengthError,
InvalidReservedNameError,
NullNameError,
ReservedNameError,
ValidationError,
ValidReservedNameError,
)
| <commit_before>"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from .__version__ import __author__, __copyright__, __email__, __license__, __version__
from ._common import (
Platform,
ascii_symbols,
normalize_platform,
replace_ansi_escape,
replace_unprintable_char,
unprintable_ascii_chars,
validate_null_string,
validate_pathtype,
)
from ._filename import FileNameSanitizer, is_valid_filename, sanitize_filename, validate_filename
from ._filepath import (
FilePathSanitizer,
is_valid_filepath,
sanitize_file_path,
sanitize_filepath,
validate_file_path,
validate_filepath,
)
from ._ltsv import sanitize_ltsv_label, validate_ltsv_label
from ._symbol import replace_symbol, validate_symbol
from .error import (
ErrorReason,
InvalidCharError,
InvalidLengthError,
InvalidReservedNameError,
NullNameError,
ReservedNameError,
ValidationError,
ValidReservedNameError,
)
<commit_msg>Add AbstractSanitizer/AbstractValidator class to import path<commit_after>"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from .__version__ import __author__, __copyright__, __email__, __license__, __version__
from ._base import AbstractSanitizer, AbstractValidator
from ._common import (
Platform,
ascii_symbols,
normalize_platform,
replace_ansi_escape,
replace_unprintable_char,
unprintable_ascii_chars,
validate_null_string,
validate_pathtype,
)
from ._filename import FileNameSanitizer, is_valid_filename, sanitize_filename, validate_filename
from ._filepath import (
FilePathSanitizer,
is_valid_filepath,
sanitize_file_path,
sanitize_filepath,
validate_file_path,
validate_filepath,
)
from ._ltsv import sanitize_ltsv_label, validate_ltsv_label
from ._symbol import replace_symbol, validate_symbol
from .error import (
ErrorReason,
InvalidCharError,
InvalidLengthError,
InvalidReservedNameError,
NullNameError,
ReservedNameError,
ValidationError,
ValidReservedNameError,
)
|
99818f02ebc46debe349a6c1b6bba70be6e04968 | skimage/io/_plugins/null_plugin.py | skimage/io/_plugins/null_plugin.py | __all__ = ['imshow', 'imread', 'imsave', '_app_show']
import warnings
message = '''\
No plugin has been loaded. Please refer to
skimage.io.plugins()
for a list of available plugins.'''
def imshow(*args, **kwargs):
warnings.warn(RuntimeWarning(message))
def imread(*args, **kwargs):
warnings.warn(RuntimeWarning(message))
def imsave(*args, **kwargs):
warnings.warn(RuntimeWarning(message))
_app_show = imshow
| __all__ = ['imshow', 'imread', 'imsave', '_app_show']
import warnings
message = '''\
No plugin has been loaded. Please refer to the docstring for ``skimage.io``
for a list of available plugins. You may specify a plugin explicitly as
an argument to ``imread``, e.g. ``imread("image.jpg", plugin='pil')``.
'''
def imshow(*args, **kwargs):
warnings.warn(RuntimeWarning(message))
def imread(*args, **kwargs):
warnings.warn(RuntimeWarning(message))
def imsave(*args, **kwargs):
warnings.warn(RuntimeWarning(message))
_app_show = imshow
| Update error message for no plugins | Update error message for no plugins
| Python | bsd-3-clause | oew1v07/scikit-image,robintw/scikit-image,rjeli/scikit-image,vighneshbirodkar/scikit-image,Hiyorimi/scikit-image,paalge/scikit-image,juliusbierk/scikit-image,ofgulban/scikit-image,bennlich/scikit-image,bsipocz/scikit-image,chriscrosscutler/scikit-image,vighneshbirodkar/scikit-image,keflavich/scikit-image,oew1v07/scikit-image,jwiggins/scikit-image,pratapvardhan/scikit-image,paalge/scikit-image,WarrenWeckesser/scikits-image,ajaybhat/scikit-image,ajaybhat/scikit-image,chriscrosscutler/scikit-image,newville/scikit-image,blink1073/scikit-image,Britefury/scikit-image,juliusbierk/scikit-image,keflavich/scikit-image,GaZ3ll3/scikit-image,jwiggins/scikit-image,dpshelio/scikit-image,michaelpacer/scikit-image,emon10005/scikit-image,youprofit/scikit-image,ClinicalGraphics/scikit-image,ofgulban/scikit-image,newville/scikit-image,Britefury/scikit-image,robintw/scikit-image,michaelaye/scikit-image,blink1073/scikit-image,vighneshbirodkar/scikit-image,ofgulban/scikit-image,bennlich/scikit-image,paalge/scikit-image,emon10005/scikit-image,GaZ3ll3/scikit-image,michaelaye/scikit-image,Hiyorimi/scikit-image,ClinicalGraphics/scikit-image,dpshelio/scikit-image,bsipocz/scikit-image,WarrenWeckesser/scikits-image,Midafi/scikit-image,Midafi/scikit-image,warmspringwinds/scikit-image,rjeli/scikit-image,pratapvardhan/scikit-image,youprofit/scikit-image,rjeli/scikit-image,warmspringwinds/scikit-image,michaelpacer/scikit-image | __all__ = ['imshow', 'imread', 'imsave', '_app_show']
import warnings
message = '''\
No plugin has been loaded. Please refer to
skimage.io.plugins()
for a list of available plugins.'''
def imshow(*args, **kwargs):
warnings.warn(RuntimeWarning(message))
def imread(*args, **kwargs):
warnings.warn(RuntimeWarning(message))
def imsave(*args, **kwargs):
warnings.warn(RuntimeWarning(message))
_app_show = imshow
Update error message for no plugins | __all__ = ['imshow', 'imread', 'imsave', '_app_show']
import warnings
message = '''\
No plugin has been loaded. Please refer to the docstring for ``skimage.io``
for a list of available plugins. You may specify a plugin explicitly as
an argument to ``imread``, e.g. ``imread("image.jpg", plugin='pil')``.
'''
def imshow(*args, **kwargs):
warnings.warn(RuntimeWarning(message))
def imread(*args, **kwargs):
warnings.warn(RuntimeWarning(message))
def imsave(*args, **kwargs):
warnings.warn(RuntimeWarning(message))
_app_show = imshow
| <commit_before>__all__ = ['imshow', 'imread', 'imsave', '_app_show']
import warnings
message = '''\
No plugin has been loaded. Please refer to
skimage.io.plugins()
for a list of available plugins.'''
def imshow(*args, **kwargs):
warnings.warn(RuntimeWarning(message))
def imread(*args, **kwargs):
warnings.warn(RuntimeWarning(message))
def imsave(*args, **kwargs):
warnings.warn(RuntimeWarning(message))
_app_show = imshow
<commit_msg>Update error message for no plugins<commit_after> | __all__ = ['imshow', 'imread', 'imsave', '_app_show']
import warnings
message = '''\
No plugin has been loaded. Please refer to the docstring for ``skimage.io``
for a list of available plugins. You may specify a plugin explicitly as
an argument to ``imread``, e.g. ``imread("image.jpg", plugin='pil')``.
'''
def imshow(*args, **kwargs):
warnings.warn(RuntimeWarning(message))
def imread(*args, **kwargs):
warnings.warn(RuntimeWarning(message))
def imsave(*args, **kwargs):
warnings.warn(RuntimeWarning(message))
_app_show = imshow
| __all__ = ['imshow', 'imread', 'imsave', '_app_show']
import warnings
message = '''\
No plugin has been loaded. Please refer to
skimage.io.plugins()
for a list of available plugins.'''
def imshow(*args, **kwargs):
warnings.warn(RuntimeWarning(message))
def imread(*args, **kwargs):
warnings.warn(RuntimeWarning(message))
def imsave(*args, **kwargs):
warnings.warn(RuntimeWarning(message))
_app_show = imshow
Update error message for no plugins__all__ = ['imshow', 'imread', 'imsave', '_app_show']
import warnings
message = '''\
No plugin has been loaded. Please refer to the docstring for ``skimage.io``
for a list of available plugins. You may specify a plugin explicitly as
an argument to ``imread``, e.g. ``imread("image.jpg", plugin='pil')``.
'''
def imshow(*args, **kwargs):
warnings.warn(RuntimeWarning(message))
def imread(*args, **kwargs):
warnings.warn(RuntimeWarning(message))
def imsave(*args, **kwargs):
warnings.warn(RuntimeWarning(message))
_app_show = imshow
| <commit_before>__all__ = ['imshow', 'imread', 'imsave', '_app_show']
import warnings
message = '''\
No plugin has been loaded. Please refer to
skimage.io.plugins()
for a list of available plugins.'''
def imshow(*args, **kwargs):
warnings.warn(RuntimeWarning(message))
def imread(*args, **kwargs):
warnings.warn(RuntimeWarning(message))
def imsave(*args, **kwargs):
warnings.warn(RuntimeWarning(message))
_app_show = imshow
<commit_msg>Update error message for no plugins<commit_after>__all__ = ['imshow', 'imread', 'imsave', '_app_show']
import warnings
message = '''\
No plugin has been loaded. Please refer to the docstring for ``skimage.io``
for a list of available plugins. You may specify a plugin explicitly as
an argument to ``imread``, e.g. ``imread("image.jpg", plugin='pil')``.
'''
def imshow(*args, **kwargs):
warnings.warn(RuntimeWarning(message))
def imread(*args, **kwargs):
warnings.warn(RuntimeWarning(message))
def imsave(*args, **kwargs):
warnings.warn(RuntimeWarning(message))
_app_show = imshow
|
9ee9ba34e447e99c868fcb43d40ce905cebf5fb9 | noah/noah.py | noah/noah.py | import json
class Noah(object):
pass | import json
class Noah(object):
def __init__(self, dictionary_file):
self.dictionary = json.load(dictionary_file)
def list(self):
return '\n'.join([entry['word'] for entry in self.dictionary])
def define(self, word):
entry = next((x for x in self.dictionary if x['word'] == word), None)
if not entry is None:
return '%s (%s)' % (entry['word'], entry['part_of_speech'])
def main():
with open('../dictionaries/english.json') as dictionary:
n = Noah(dictionary)
print n.list()
print n.define('aardvark')
if __name__ == '__main__':
main() | Add list and define functions. | Add list and define functions.
| Python | mit | maxdeviant/noah | import json
class Noah(object):
passAdd list and define functions. | import json
class Noah(object):
def __init__(self, dictionary_file):
self.dictionary = json.load(dictionary_file)
def list(self):
return '\n'.join([entry['word'] for entry in self.dictionary])
def define(self, word):
entry = next((x for x in self.dictionary if x['word'] == word), None)
if not entry is None:
return '%s (%s)' % (entry['word'], entry['part_of_speech'])
def main():
with open('../dictionaries/english.json') as dictionary:
n = Noah(dictionary)
print n.list()
print n.define('aardvark')
if __name__ == '__main__':
main() | <commit_before>import json
class Noah(object):
pass<commit_msg>Add list and define functions.<commit_after> | import json
class Noah(object):
def __init__(self, dictionary_file):
self.dictionary = json.load(dictionary_file)
def list(self):
return '\n'.join([entry['word'] for entry in self.dictionary])
def define(self, word):
entry = next((x for x in self.dictionary if x['word'] == word), None)
if not entry is None:
return '%s (%s)' % (entry['word'], entry['part_of_speech'])
def main():
with open('../dictionaries/english.json') as dictionary:
n = Noah(dictionary)
print n.list()
print n.define('aardvark')
if __name__ == '__main__':
main() | import json
class Noah(object):
passAdd list and define functions.import json
class Noah(object):
def __init__(self, dictionary_file):
self.dictionary = json.load(dictionary_file)
def list(self):
return '\n'.join([entry['word'] for entry in self.dictionary])
def define(self, word):
entry = next((x for x in self.dictionary if x['word'] == word), None)
if not entry is None:
return '%s (%s)' % (entry['word'], entry['part_of_speech'])
def main():
with open('../dictionaries/english.json') as dictionary:
n = Noah(dictionary)
print n.list()
print n.define('aardvark')
if __name__ == '__main__':
main() | <commit_before>import json
class Noah(object):
pass<commit_msg>Add list and define functions.<commit_after>import json
class Noah(object):
def __init__(self, dictionary_file):
self.dictionary = json.load(dictionary_file)
def list(self):
return '\n'.join([entry['word'] for entry in self.dictionary])
def define(self, word):
entry = next((x for x in self.dictionary if x['word'] == word), None)
if not entry is None:
return '%s (%s)' % (entry['word'], entry['part_of_speech'])
def main():
with open('../dictionaries/english.json') as dictionary:
n = Noah(dictionary)
print n.list()
print n.define('aardvark')
if __name__ == '__main__':
main() |
55983401814bc0e7158d213885ebdfdbc7e02e9b | DeployUtil/authentication.py | DeployUtil/authentication.py | import urllib.request
import http.cookiejar
import DeployUtil.toolsession as session
#TODO: give an indicator of success
#TODO: handle errors a bit better.
def do_pair(ip, pin, **_args):
# IF YOU DON'T DO THIS OVER HTTPS YOU WILL GET 308s to goto HTTPS
scheme = 'https://'
port = ''
api = '/api/authorize/pair?pin={pin}&persistent=0'
verb = 'POST'
request_url = scheme + ip + port + api.format_map({'pin':pin})
https_handler = session.create_toolsess_httpsHandler()
request = urllib.request.Request(url=request_url, method=verb)
cookies = urllib.request.HTTPCookieProcessor(http.cookiejar.MozillaCookieJar("deployUtil.cookies"))
opener = urllib.request.build_opener(https_handler, cookies)
resp = opener.open(request)
cookies.cookiejar.save(ignore_discard=True)
| import requests
import json
#TODO: give an indicator of success
#TODO: handle errors a bit better.
def do_pair(ip, pin, **_args):
# IF YOU DON'T DO THIS OVER HTTPS YOU WILL GET 308s to goto HTTPS
# But we cannot verify our HTTPS cert yet because we cannot get it off
# of all devices.
# If the tooling gets smarter about what its talking to, then we can
# make an educated choice.
scheme = 'https://'
port = ''
api = '/api/authorize/pair?pin={pin}&persistent=0'
request_url = scheme + ip + port + api.format_map({'pin':pin})
with requests.Session() as session:
response = session.post(request_url, verify=False)
cookie_filename = 'deployUtil.cookies'
cookies = requests.utils.dict_from_cookiejar(response.cookies)
with open(cookie_filename,'w') as cookie_file:
json.dump(cookies, cookie_file)
| Add dependency on the requests module and refactor | Add dependency on the requests module and refactor
Since I didn't want to have to write my own Multipart POST handler when I start
writing the install command, I started doing research on the options and came
across "requests". I added the dependency and tried it out by reimplementing
the pair command using that library instead of urllib.request and its
supporting types.
On the good side, the library is very easy to use. On the other hand, I have
picked up a nice warning telling to verify my certificate chains which isn't
possible yet for all the devices the WDP runs on.
| Python | mit | loarabia/DeployUtil | import urllib.request
import http.cookiejar
import DeployUtil.toolsession as session
#TODO: give an indicator of success
#TODO: handle errors a bit better.
def do_pair(ip, pin, **_args):
# IF YOU DON'T DO THIS OVER HTTPS YOU WILL GET 308s to goto HTTPS
scheme = 'https://'
port = ''
api = '/api/authorize/pair?pin={pin}&persistent=0'
verb = 'POST'
request_url = scheme + ip + port + api.format_map({'pin':pin})
https_handler = session.create_toolsess_httpsHandler()
request = urllib.request.Request(url=request_url, method=verb)
cookies = urllib.request.HTTPCookieProcessor(http.cookiejar.MozillaCookieJar("deployUtil.cookies"))
opener = urllib.request.build_opener(https_handler, cookies)
resp = opener.open(request)
cookies.cookiejar.save(ignore_discard=True)
Add dependency on the requests module and refactor
Since I didn't want to have to write my own Multipart POST handler when I start
writing the install command, I started doing research on the options and came
across "requests". I added the dependency and tried it out by reimplementing
the pair command using that library instead of urllib.request and its
supporting types.
On the good side, the library is very easy to use. On the other hand, I have
picked up a nice warning telling to verify my certificate chains which isn't
possible yet for all the devices the WDP runs on. | import requests
import json
#TODO: give an indicator of success
#TODO: handle errors a bit better.
def do_pair(ip, pin, **_args):
# IF YOU DON'T DO THIS OVER HTTPS YOU WILL GET 308s to goto HTTPS
# But we cannot verify our HTTPS cert yet because we cannot get it off
# of all devices.
# If the tooling gets smarter about what its talking to, then we can
# make an educated choice.
scheme = 'https://'
port = ''
api = '/api/authorize/pair?pin={pin}&persistent=0'
request_url = scheme + ip + port + api.format_map({'pin':pin})
with requests.Session() as session:
response = session.post(request_url, verify=False)
cookie_filename = 'deployUtil.cookies'
cookies = requests.utils.dict_from_cookiejar(response.cookies)
with open(cookie_filename,'w') as cookie_file:
json.dump(cookies, cookie_file)
| <commit_before>import urllib.request
import http.cookiejar
import DeployUtil.toolsession as session
#TODO: give an indicator of success
#TODO: handle errors a bit better.
def do_pair(ip, pin, **_args):
# IF YOU DON'T DO THIS OVER HTTPS YOU WILL GET 308s to goto HTTPS
scheme = 'https://'
port = ''
api = '/api/authorize/pair?pin={pin}&persistent=0'
verb = 'POST'
request_url = scheme + ip + port + api.format_map({'pin':pin})
https_handler = session.create_toolsess_httpsHandler()
request = urllib.request.Request(url=request_url, method=verb)
cookies = urllib.request.HTTPCookieProcessor(http.cookiejar.MozillaCookieJar("deployUtil.cookies"))
opener = urllib.request.build_opener(https_handler, cookies)
resp = opener.open(request)
cookies.cookiejar.save(ignore_discard=True)
<commit_msg>Add dependency on the requests module and refactor
Since I didn't want to have to write my own Multipart POST handler when I start
writing the install command, I started doing research on the options and came
across "requests". I added the dependency and tried it out by reimplementing
the pair command using that library instead of urllib.request and its
supporting types.
On the good side, the library is very easy to use. On the other hand, I have
picked up a nice warning telling to verify my certificate chains which isn't
possible yet for all the devices the WDP runs on.<commit_after> | import requests
import json
#TODO: give an indicator of success
#TODO: handle errors a bit better.
def do_pair(ip, pin, **_args):
# IF YOU DON'T DO THIS OVER HTTPS YOU WILL GET 308s to goto HTTPS
# But we cannot verify our HTTPS cert yet because we cannot get it off
# of all devices.
# If the tooling gets smarter about what its talking to, then we can
# make an educated choice.
scheme = 'https://'
port = ''
api = '/api/authorize/pair?pin={pin}&persistent=0'
request_url = scheme + ip + port + api.format_map({'pin':pin})
with requests.Session() as session:
response = session.post(request_url, verify=False)
cookie_filename = 'deployUtil.cookies'
cookies = requests.utils.dict_from_cookiejar(response.cookies)
with open(cookie_filename,'w') as cookie_file:
json.dump(cookies, cookie_file)
| import urllib.request
import http.cookiejar
import DeployUtil.toolsession as session
#TODO: give an indicator of success
#TODO: handle errors a bit better.
def do_pair(ip, pin, **_args):
# IF YOU DON'T DO THIS OVER HTTPS YOU WILL GET 308s to goto HTTPS
scheme = 'https://'
port = ''
api = '/api/authorize/pair?pin={pin}&persistent=0'
verb = 'POST'
request_url = scheme + ip + port + api.format_map({'pin':pin})
https_handler = session.create_toolsess_httpsHandler()
request = urllib.request.Request(url=request_url, method=verb)
cookies = urllib.request.HTTPCookieProcessor(http.cookiejar.MozillaCookieJar("deployUtil.cookies"))
opener = urllib.request.build_opener(https_handler, cookies)
resp = opener.open(request)
cookies.cookiejar.save(ignore_discard=True)
Add dependency on the requests module and refactor
Since I didn't want to have to write my own Multipart POST handler when I start
writing the install command, I started doing research on the options and came
across "requests". I added the dependency and tried it out by reimplementing
the pair command using that library instead of urllib.request and its
supporting types.
On the good side, the library is very easy to use. On the other hand, I have
picked up a nice warning telling to verify my certificate chains which isn't
possible yet for all the devices the WDP runs on.import requests
import json
#TODO: give an indicator of success
#TODO: handle errors a bit better.
def do_pair(ip, pin, **_args):
# IF YOU DON'T DO THIS OVER HTTPS YOU WILL GET 308s to goto HTTPS
# But we cannot verify our HTTPS cert yet because we cannot get it off
# of all devices.
# If the tooling gets smarter about what its talking to, then we can
# make an educated choice.
scheme = 'https://'
port = ''
api = '/api/authorize/pair?pin={pin}&persistent=0'
request_url = scheme + ip + port + api.format_map({'pin':pin})
with requests.Session() as session:
response = session.post(request_url, verify=False)
cookie_filename = 'deployUtil.cookies'
cookies = requests.utils.dict_from_cookiejar(response.cookies)
with open(cookie_filename,'w') as cookie_file:
json.dump(cookies, cookie_file)
| <commit_before>import urllib.request
import http.cookiejar
import DeployUtil.toolsession as session
#TODO: give an indicator of success
#TODO: handle errors a bit better.
def do_pair(ip, pin, **_args):
# IF YOU DON'T DO THIS OVER HTTPS YOU WILL GET 308s to goto HTTPS
scheme = 'https://'
port = ''
api = '/api/authorize/pair?pin={pin}&persistent=0'
verb = 'POST'
request_url = scheme + ip + port + api.format_map({'pin':pin})
https_handler = session.create_toolsess_httpsHandler()
request = urllib.request.Request(url=request_url, method=verb)
cookies = urllib.request.HTTPCookieProcessor(http.cookiejar.MozillaCookieJar("deployUtil.cookies"))
opener = urllib.request.build_opener(https_handler, cookies)
resp = opener.open(request)
cookies.cookiejar.save(ignore_discard=True)
<commit_msg>Add dependency on the requests module and refactor
Since I didn't want to have to write my own Multipart POST handler when I start
writing the install command, I started doing research on the options and came
across "requests". I added the dependency and tried it out by reimplementing
the pair command using that library instead of urllib.request and its
supporting types.
On the good side, the library is very easy to use. On the other hand, I have
picked up a nice warning telling to verify my certificate chains which isn't
possible yet for all the devices the WDP runs on.<commit_after>import requests
import json
#TODO: give an indicator of success
#TODO: handle errors a bit better.
def do_pair(ip, pin, **_args):
# IF YOU DON'T DO THIS OVER HTTPS YOU WILL GET 308s to goto HTTPS
# But we cannot verify our HTTPS cert yet because we cannot get it off
# of all devices.
# If the tooling gets smarter about what its talking to, then we can
# make an educated choice.
scheme = 'https://'
port = ''
api = '/api/authorize/pair?pin={pin}&persistent=0'
request_url = scheme + ip + port + api.format_map({'pin':pin})
with requests.Session() as session:
response = session.post(request_url, verify=False)
cookie_filename = 'deployUtil.cookies'
cookies = requests.utils.dict_from_cookiejar(response.cookies)
with open(cookie_filename,'w') as cookie_file:
json.dump(cookies, cookie_file)
|
da5a05c27f1c19c69ce23f5cd6cd0f09edb9d7f7 | paranuara_api/views.py | paranuara_api/views.py | from rest_framework import viewsets
from paranuara_api.models import Company, Person
from paranuara_api.serializers import (
CompanySerializer, CompanyListSerializer, PersonListSerializer,
PersonSerializer
)
class CompanyViewSet(viewsets.ReadOnlyModelViewSet):
queryset = Company.objects.all()
lookup_field = 'index'
serializers = {
'list': CompanyListSerializer,
'retrieve': CompanySerializer,
}
def get_serializer_class(self):
return self.serializers[self.action]
class PersonViewSet(viewsets.ReadOnlyModelViewSet):
queryset = Person.objects.all()
lookup_field = 'index'
serializers = {
'list': PersonListSerializer,
'retrieve': PersonSerializer,
}
def get_serializer_class(self):
return self.serializers[self.action]
| from rest_framework import viewsets
from paranuara_api.models import Company, Person
from paranuara_api.serializers import (
CompanySerializer, CompanyListSerializer, PersonListSerializer,
PersonSerializer
)
class MultiSerializerMixin(object):
def get_serializer_class(self):
return self.serializers[self.action]
class CompanyViewSet(MultiSerializerMixin, viewsets.ReadOnlyModelViewSet):
queryset = Company.objects.all()
lookup_field = 'index'
serializers = {
'list': CompanyListSerializer,
'retrieve': CompanySerializer,
}
class PersonViewSet(MultiSerializerMixin, viewsets.ReadOnlyModelViewSet):
queryset = Person.objects.all()
lookup_field = 'index'
serializers = {
'list': PersonListSerializer,
'retrieve': PersonSerializer,
}
| Refactor common serializer selection code. | Refactor common serializer selection code.
| Python | bsd-3-clause | jarvis-cochrane/paranuara | from rest_framework import viewsets
from paranuara_api.models import Company, Person
from paranuara_api.serializers import (
CompanySerializer, CompanyListSerializer, PersonListSerializer,
PersonSerializer
)
class CompanyViewSet(viewsets.ReadOnlyModelViewSet):
queryset = Company.objects.all()
lookup_field = 'index'
serializers = {
'list': CompanyListSerializer,
'retrieve': CompanySerializer,
}
def get_serializer_class(self):
return self.serializers[self.action]
class PersonViewSet(viewsets.ReadOnlyModelViewSet):
queryset = Person.objects.all()
lookup_field = 'index'
serializers = {
'list': PersonListSerializer,
'retrieve': PersonSerializer,
}
def get_serializer_class(self):
return self.serializers[self.action]
Refactor common serializer selection code. | from rest_framework import viewsets
from paranuara_api.models import Company, Person
from paranuara_api.serializers import (
CompanySerializer, CompanyListSerializer, PersonListSerializer,
PersonSerializer
)
class MultiSerializerMixin(object):
def get_serializer_class(self):
return self.serializers[self.action]
class CompanyViewSet(MultiSerializerMixin, viewsets.ReadOnlyModelViewSet):
queryset = Company.objects.all()
lookup_field = 'index'
serializers = {
'list': CompanyListSerializer,
'retrieve': CompanySerializer,
}
class PersonViewSet(MultiSerializerMixin, viewsets.ReadOnlyModelViewSet):
queryset = Person.objects.all()
lookup_field = 'index'
serializers = {
'list': PersonListSerializer,
'retrieve': PersonSerializer,
}
| <commit_before>from rest_framework import viewsets
from paranuara_api.models import Company, Person
from paranuara_api.serializers import (
CompanySerializer, CompanyListSerializer, PersonListSerializer,
PersonSerializer
)
class CompanyViewSet(viewsets.ReadOnlyModelViewSet):
queryset = Company.objects.all()
lookup_field = 'index'
serializers = {
'list': CompanyListSerializer,
'retrieve': CompanySerializer,
}
def get_serializer_class(self):
return self.serializers[self.action]
class PersonViewSet(viewsets.ReadOnlyModelViewSet):
queryset = Person.objects.all()
lookup_field = 'index'
serializers = {
'list': PersonListSerializer,
'retrieve': PersonSerializer,
}
def get_serializer_class(self):
return self.serializers[self.action]
<commit_msg>Refactor common serializer selection code.<commit_after> | from rest_framework import viewsets
from paranuara_api.models import Company, Person
from paranuara_api.serializers import (
CompanySerializer, CompanyListSerializer, PersonListSerializer,
PersonSerializer
)
class MultiSerializerMixin(object):
def get_serializer_class(self):
return self.serializers[self.action]
class CompanyViewSet(MultiSerializerMixin, viewsets.ReadOnlyModelViewSet):
queryset = Company.objects.all()
lookup_field = 'index'
serializers = {
'list': CompanyListSerializer,
'retrieve': CompanySerializer,
}
class PersonViewSet(MultiSerializerMixin, viewsets.ReadOnlyModelViewSet):
queryset = Person.objects.all()
lookup_field = 'index'
serializers = {
'list': PersonListSerializer,
'retrieve': PersonSerializer,
}
| from rest_framework import viewsets
from paranuara_api.models import Company, Person
from paranuara_api.serializers import (
CompanySerializer, CompanyListSerializer, PersonListSerializer,
PersonSerializer
)
class CompanyViewSet(viewsets.ReadOnlyModelViewSet):
queryset = Company.objects.all()
lookup_field = 'index'
serializers = {
'list': CompanyListSerializer,
'retrieve': CompanySerializer,
}
def get_serializer_class(self):
return self.serializers[self.action]
class PersonViewSet(viewsets.ReadOnlyModelViewSet):
queryset = Person.objects.all()
lookup_field = 'index'
serializers = {
'list': PersonListSerializer,
'retrieve': PersonSerializer,
}
def get_serializer_class(self):
return self.serializers[self.action]
Refactor common serializer selection code.from rest_framework import viewsets
from paranuara_api.models import Company, Person
from paranuara_api.serializers import (
CompanySerializer, CompanyListSerializer, PersonListSerializer,
PersonSerializer
)
class MultiSerializerMixin(object):
def get_serializer_class(self):
return self.serializers[self.action]
class CompanyViewSet(MultiSerializerMixin, viewsets.ReadOnlyModelViewSet):
queryset = Company.objects.all()
lookup_field = 'index'
serializers = {
'list': CompanyListSerializer,
'retrieve': CompanySerializer,
}
class PersonViewSet(MultiSerializerMixin, viewsets.ReadOnlyModelViewSet):
queryset = Person.objects.all()
lookup_field = 'index'
serializers = {
'list': PersonListSerializer,
'retrieve': PersonSerializer,
}
| <commit_before>from rest_framework import viewsets
from paranuara_api.models import Company, Person
from paranuara_api.serializers import (
CompanySerializer, CompanyListSerializer, PersonListSerializer,
PersonSerializer
)
class CompanyViewSet(viewsets.ReadOnlyModelViewSet):
queryset = Company.objects.all()
lookup_field = 'index'
serializers = {
'list': CompanyListSerializer,
'retrieve': CompanySerializer,
}
def get_serializer_class(self):
return self.serializers[self.action]
class PersonViewSet(viewsets.ReadOnlyModelViewSet):
queryset = Person.objects.all()
lookup_field = 'index'
serializers = {
'list': PersonListSerializer,
'retrieve': PersonSerializer,
}
def get_serializer_class(self):
return self.serializers[self.action]
<commit_msg>Refactor common serializer selection code.<commit_after>from rest_framework import viewsets
from paranuara_api.models import Company, Person
from paranuara_api.serializers import (
CompanySerializer, CompanyListSerializer, PersonListSerializer,
PersonSerializer
)
class MultiSerializerMixin(object):
def get_serializer_class(self):
return self.serializers[self.action]
class CompanyViewSet(MultiSerializerMixin, viewsets.ReadOnlyModelViewSet):
queryset = Company.objects.all()
lookup_field = 'index'
serializers = {
'list': CompanyListSerializer,
'retrieve': CompanySerializer,
}
class PersonViewSet(MultiSerializerMixin, viewsets.ReadOnlyModelViewSet):
queryset = Person.objects.all()
lookup_field = 'index'
serializers = {
'list': PersonListSerializer,
'retrieve': PersonSerializer,
}
|
d36e17e3823af74b5a6f75191f141ec98fdf281f | plugins/irc/irc.py | plugins/irc/irc.py | from p1tr.helpers import clean_string
from p1tr.plugin import *
@meta_plugin
class Irc(Plugin):
"""Provides commands for basic IRC operations."""
@command
@require_master
def nick(self, server, channel, nick, params):
"""Usage: nick NEW_NICKNAME - changes the bot's nickname."""
if len(params) < 1:
return clean_string(self.nick.__doc__)
self.bot.client.send('NICK', params[0])
@command
@require_master
def join(self, server, channel, nick, params):
"""
Usage: join #CHANNEL [PASSWORD] - the bot will enter the specified
channel. A password may be provided optionally, if it is required.
"""
if len(params) < 1:
return clean_string(self.join.__doc__)
password = ''
if len(params) > 1:
password = params[0]
self.bot.client.send('JOIN', params[0], password)
@command
@require_op
def part(self, server, channel, nick, params):
"""
Usage: part [#CHANNEL] - asks the bot to leave the current channel.
Optionally, a channel may be specified if it should be left instead of
the current one.
"""
if len(params) > 0:
channel = params[0]
self.bot.client.send('PART', channel)
@command
@require_master
def quit(self, server, channel, nick, params):
self.blot.intended_disconnect = True
| from p1tr.helpers import clean_string
from p1tr.plugin import *
@meta_plugin
class Irc(Plugin):
"""Provides commands for basic IRC operations."""
@command
@require_master
def nick(self, server, channel, nick, params):
"""Usage: nick NEW_NICKNAME - changes the bot's nickname."""
if len(params) < 1:
return clean_string(self.nick.__doc__)
self.bot.client.send('NICK', params[0])
@command
@require_master
def join(self, server, channel, nick, params):
"""
Usage: join #CHANNEL [PASSWORD] - the bot will enter the specified
channel. A password may be provided optionally, if it is required.
"""
if len(params) < 1:
return clean_string(self.join.__doc__)
password = ''
if len(params) > 1:
password = params[0]
self.bot.client.send('JOIN', params[0], password)
@command
@require_op
def part(self, server, channel, nick, params):
"""
Usage: part [#CHANNEL] - asks the bot to leave the current channel.
Optionally, a channel may be specified if it should be left instead of
the current one.
"""
if len(params) > 0:
channel = params[0]
self.bot.client.send('PART', channel)
@command
@require_master
def quit(self, server, channel, nick, params):
"""
Usage: quit - Tell the bot to disconnect from the server.
"""
self.bot.intended_disconnect = True
self.bot.exit()
| Fix failing reconnects; add quit IRC command | Fix failing reconnects; add quit IRC command
| Python | mit | howard/p1tr-tng,howard/p1tr-tng | from p1tr.helpers import clean_string
from p1tr.plugin import *
@meta_plugin
class Irc(Plugin):
"""Provides commands for basic IRC operations."""
@command
@require_master
def nick(self, server, channel, nick, params):
"""Usage: nick NEW_NICKNAME - changes the bot's nickname."""
if len(params) < 1:
return clean_string(self.nick.__doc__)
self.bot.client.send('NICK', params[0])
@command
@require_master
def join(self, server, channel, nick, params):
"""
Usage: join #CHANNEL [PASSWORD] - the bot will enter the specified
channel. A password may be provided optionally, if it is required.
"""
if len(params) < 1:
return clean_string(self.join.__doc__)
password = ''
if len(params) > 1:
password = params[0]
self.bot.client.send('JOIN', params[0], password)
@command
@require_op
def part(self, server, channel, nick, params):
"""
Usage: part [#CHANNEL] - asks the bot to leave the current channel.
Optionally, a channel may be specified if it should be left instead of
the current one.
"""
if len(params) > 0:
channel = params[0]
self.bot.client.send('PART', channel)
@command
@require_master
def quit(self, server, channel, nick, params):
self.blot.intended_disconnect = True
Fix failing reconnects; add quit IRC command | from p1tr.helpers import clean_string
from p1tr.plugin import *
@meta_plugin
class Irc(Plugin):
"""Provides commands for basic IRC operations."""
@command
@require_master
def nick(self, server, channel, nick, params):
"""Usage: nick NEW_NICKNAME - changes the bot's nickname."""
if len(params) < 1:
return clean_string(self.nick.__doc__)
self.bot.client.send('NICK', params[0])
@command
@require_master
def join(self, server, channel, nick, params):
"""
Usage: join #CHANNEL [PASSWORD] - the bot will enter the specified
channel. A password may be provided optionally, if it is required.
"""
if len(params) < 1:
return clean_string(self.join.__doc__)
password = ''
if len(params) > 1:
password = params[0]
self.bot.client.send('JOIN', params[0], password)
@command
@require_op
def part(self, server, channel, nick, params):
"""
Usage: part [#CHANNEL] - asks the bot to leave the current channel.
Optionally, a channel may be specified if it should be left instead of
the current one.
"""
if len(params) > 0:
channel = params[0]
self.bot.client.send('PART', channel)
@command
@require_master
def quit(self, server, channel, nick, params):
"""
Usage: quit - Tell the bot to disconnect from the server.
"""
self.bot.intended_disconnect = True
self.bot.exit()
| <commit_before>from p1tr.helpers import clean_string
from p1tr.plugin import *
@meta_plugin
class Irc(Plugin):
"""Provides commands for basic IRC operations."""
@command
@require_master
def nick(self, server, channel, nick, params):
"""Usage: nick NEW_NICKNAME - changes the bot's nickname."""
if len(params) < 1:
return clean_string(self.nick.__doc__)
self.bot.client.send('NICK', params[0])
@command
@require_master
def join(self, server, channel, nick, params):
"""
Usage: join #CHANNEL [PASSWORD] - the bot will enter the specified
channel. A password may be provided optionally, if it is required.
"""
if len(params) < 1:
return clean_string(self.join.__doc__)
password = ''
if len(params) > 1:
password = params[0]
self.bot.client.send('JOIN', params[0], password)
@command
@require_op
def part(self, server, channel, nick, params):
"""
Usage: part [#CHANNEL] - asks the bot to leave the current channel.
Optionally, a channel may be specified if it should be left instead of
the current one.
"""
if len(params) > 0:
channel = params[0]
self.bot.client.send('PART', channel)
@command
@require_master
def quit(self, server, channel, nick, params):
self.blot.intended_disconnect = True
<commit_msg>Fix failing reconnects; add quit IRC command<commit_after> | from p1tr.helpers import clean_string
from p1tr.plugin import *
@meta_plugin
class Irc(Plugin):
"""Provides commands for basic IRC operations."""
@command
@require_master
def nick(self, server, channel, nick, params):
"""Usage: nick NEW_NICKNAME - changes the bot's nickname."""
if len(params) < 1:
return clean_string(self.nick.__doc__)
self.bot.client.send('NICK', params[0])
@command
@require_master
def join(self, server, channel, nick, params):
"""
Usage: join #CHANNEL [PASSWORD] - the bot will enter the specified
channel. A password may be provided optionally, if it is required.
"""
if len(params) < 1:
return clean_string(self.join.__doc__)
password = ''
if len(params) > 1:
password = params[0]
self.bot.client.send('JOIN', params[0], password)
@command
@require_op
def part(self, server, channel, nick, params):
"""
Usage: part [#CHANNEL] - asks the bot to leave the current channel.
Optionally, a channel may be specified if it should be left instead of
the current one.
"""
if len(params) > 0:
channel = params[0]
self.bot.client.send('PART', channel)
@command
@require_master
def quit(self, server, channel, nick, params):
"""
Usage: quit - Tell the bot to disconnect from the server.
"""
self.bot.intended_disconnect = True
self.bot.exit()
| from p1tr.helpers import clean_string
from p1tr.plugin import *
@meta_plugin
class Irc(Plugin):
"""Provides commands for basic IRC operations."""
@command
@require_master
def nick(self, server, channel, nick, params):
"""Usage: nick NEW_NICKNAME - changes the bot's nickname."""
if len(params) < 1:
return clean_string(self.nick.__doc__)
self.bot.client.send('NICK', params[0])
@command
@require_master
def join(self, server, channel, nick, params):
"""
Usage: join #CHANNEL [PASSWORD] - the bot will enter the specified
channel. A password may be provided optionally, if it is required.
"""
if len(params) < 1:
return clean_string(self.join.__doc__)
password = ''
if len(params) > 1:
password = params[0]
self.bot.client.send('JOIN', params[0], password)
@command
@require_op
def part(self, server, channel, nick, params):
"""
Usage: part [#CHANNEL] - asks the bot to leave the current channel.
Optionally, a channel may be specified if it should be left instead of
the current one.
"""
if len(params) > 0:
channel = params[0]
self.bot.client.send('PART', channel)
@command
@require_master
def quit(self, server, channel, nick, params):
self.blot.intended_disconnect = True
Fix failing reconnects; add quit IRC commandfrom p1tr.helpers import clean_string
from p1tr.plugin import *
@meta_plugin
class Irc(Plugin):
"""Provides commands for basic IRC operations."""
@command
@require_master
def nick(self, server, channel, nick, params):
"""Usage: nick NEW_NICKNAME - changes the bot's nickname."""
if len(params) < 1:
return clean_string(self.nick.__doc__)
self.bot.client.send('NICK', params[0])
@command
@require_master
def join(self, server, channel, nick, params):
"""
Usage: join #CHANNEL [PASSWORD] - the bot will enter the specified
channel. A password may be provided optionally, if it is required.
"""
if len(params) < 1:
return clean_string(self.join.__doc__)
password = ''
if len(params) > 1:
password = params[0]
self.bot.client.send('JOIN', params[0], password)
@command
@require_op
def part(self, server, channel, nick, params):
"""
Usage: part [#CHANNEL] - asks the bot to leave the current channel.
Optionally, a channel may be specified if it should be left instead of
the current one.
"""
if len(params) > 0:
channel = params[0]
self.bot.client.send('PART', channel)
@command
@require_master
def quit(self, server, channel, nick, params):
"""
Usage: quit - Tell the bot to disconnect from the server.
"""
self.bot.intended_disconnect = True
self.bot.exit()
| <commit_before>from p1tr.helpers import clean_string
from p1tr.plugin import *
@meta_plugin
class Irc(Plugin):
"""Provides commands for basic IRC operations."""
@command
@require_master
def nick(self, server, channel, nick, params):
"""Usage: nick NEW_NICKNAME - changes the bot's nickname."""
if len(params) < 1:
return clean_string(self.nick.__doc__)
self.bot.client.send('NICK', params[0])
@command
@require_master
def join(self, server, channel, nick, params):
"""
Usage: join #CHANNEL [PASSWORD] - the bot will enter the specified
channel. A password may be provided optionally, if it is required.
"""
if len(params) < 1:
return clean_string(self.join.__doc__)
password = ''
if len(params) > 1:
password = params[0]
self.bot.client.send('JOIN', params[0], password)
@command
@require_op
def part(self, server, channel, nick, params):
"""
Usage: part [#CHANNEL] - asks the bot to leave the current channel.
Optionally, a channel may be specified if it should be left instead of
the current one.
"""
if len(params) > 0:
channel = params[0]
self.bot.client.send('PART', channel)
@command
@require_master
def quit(self, server, channel, nick, params):
self.blot.intended_disconnect = True
<commit_msg>Fix failing reconnects; add quit IRC command<commit_after>from p1tr.helpers import clean_string
from p1tr.plugin import *
@meta_plugin
class Irc(Plugin):
"""Provides commands for basic IRC operations."""
@command
@require_master
def nick(self, server, channel, nick, params):
"""Usage: nick NEW_NICKNAME - changes the bot's nickname."""
if len(params) < 1:
return clean_string(self.nick.__doc__)
self.bot.client.send('NICK', params[0])
@command
@require_master
def join(self, server, channel, nick, params):
"""
Usage: join #CHANNEL [PASSWORD] - the bot will enter the specified
channel. A password may be provided optionally, if it is required.
"""
if len(params) < 1:
return clean_string(self.join.__doc__)
password = ''
if len(params) > 1:
password = params[0]
self.bot.client.send('JOIN', params[0], password)
@command
@require_op
def part(self, server, channel, nick, params):
"""
Usage: part [#CHANNEL] - asks the bot to leave the current channel.
Optionally, a channel may be specified if it should be left instead of
the current one.
"""
if len(params) > 0:
channel = params[0]
self.bot.client.send('PART', channel)
@command
@require_master
def quit(self, server, channel, nick, params):
"""
Usage: quit - Tell the bot to disconnect from the server.
"""
self.bot.intended_disconnect = True
self.bot.exit()
|
d8e0109e4c697f4a920ff4993c491eb5b0d38d55 | setup.py | setup.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2010-2018 OneLogin, Inc.
# MIT License
from setuptools import setup
setup(
name='python-saml',
version='2.4.1',
description='Onelogin Python Toolkit. Add SAML support to your Python software using this library',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
],
author='OneLogin',
author_email='support@onelogin.com',
license='MIT',
url='https://github.com/onelogin/python-saml',
packages=['onelogin', 'onelogin/saml2'],
include_package_data=True,
package_data={
'onelogin/saml2/schemas': ['*.xsd'],
},
package_dir={
'': 'src',
},
test_suite='tests',
install_requires=[
'dm.xmlsec.binding==1.3.3',
'isodate>=0.5.0',
'defusedxml>=0.4.1',
],
extras_require={
'test': (
'coverage>=3.6',
'freezegun==0.3.5',
'pylint==1.3.1',
'pep8==1.5.7',
'pyflakes==0.8.1',
'coveralls==1.1',
),
},
keywords='saml saml2 xmlsec django flask',
)
| #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2010-2018 OneLogin, Inc.
# MIT License
from setuptools import setup
setup(
name='python-saml',
version='2.4.1',
description='Onelogin Python Toolkit. Add SAML support to your Python software using this library',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
],
author='OneLogin',
author_email='support@onelogin.com',
license='MIT',
url='https://github.com/onelogin/python-saml',
packages=['onelogin', 'onelogin/saml2'],
include_package_data=True,
package_data={
'onelogin/saml2/schemas': ['*.xsd'],
},
package_dir={
'': 'src',
},
test_suite='tests',
install_requires=[
'dm.xmlsec.binding==1.3.3',
'isodate>=0.5.0',
'defusedxml>=0.4.1',
],
extras_require={
'test': (
'coverage>=3.6',
'freezegun==0.3.5',
'pylint==1.9.1',
'pep8==1.5.7',
'pyflakes==0.8.1',
'coveralls==1.1',
),
},
keywords='saml saml2 xmlsec django flask',
)
| Update pylint dependency to 1.9.1 | Update pylint dependency to 1.9.1
| Python | mit | onelogin/python-saml,onelogin/python-saml | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2010-2018 OneLogin, Inc.
# MIT License
from setuptools import setup
setup(
name='python-saml',
version='2.4.1',
description='Onelogin Python Toolkit. Add SAML support to your Python software using this library',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
],
author='OneLogin',
author_email='support@onelogin.com',
license='MIT',
url='https://github.com/onelogin/python-saml',
packages=['onelogin', 'onelogin/saml2'],
include_package_data=True,
package_data={
'onelogin/saml2/schemas': ['*.xsd'],
},
package_dir={
'': 'src',
},
test_suite='tests',
install_requires=[
'dm.xmlsec.binding==1.3.3',
'isodate>=0.5.0',
'defusedxml>=0.4.1',
],
extras_require={
'test': (
'coverage>=3.6',
'freezegun==0.3.5',
'pylint==1.3.1',
'pep8==1.5.7',
'pyflakes==0.8.1',
'coveralls==1.1',
),
},
keywords='saml saml2 xmlsec django flask',
)
Update pylint dependency to 1.9.1 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2010-2018 OneLogin, Inc.
# MIT License
from setuptools import setup
setup(
name='python-saml',
version='2.4.1',
description='Onelogin Python Toolkit. Add SAML support to your Python software using this library',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
],
author='OneLogin',
author_email='support@onelogin.com',
license='MIT',
url='https://github.com/onelogin/python-saml',
packages=['onelogin', 'onelogin/saml2'],
include_package_data=True,
package_data={
'onelogin/saml2/schemas': ['*.xsd'],
},
package_dir={
'': 'src',
},
test_suite='tests',
install_requires=[
'dm.xmlsec.binding==1.3.3',
'isodate>=0.5.0',
'defusedxml>=0.4.1',
],
extras_require={
'test': (
'coverage>=3.6',
'freezegun==0.3.5',
'pylint==1.9.1',
'pep8==1.5.7',
'pyflakes==0.8.1',
'coveralls==1.1',
),
},
keywords='saml saml2 xmlsec django flask',
)
| <commit_before>#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2010-2018 OneLogin, Inc.
# MIT License
from setuptools import setup
setup(
name='python-saml',
version='2.4.1',
description='Onelogin Python Toolkit. Add SAML support to your Python software using this library',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
],
author='OneLogin',
author_email='support@onelogin.com',
license='MIT',
url='https://github.com/onelogin/python-saml',
packages=['onelogin', 'onelogin/saml2'],
include_package_data=True,
package_data={
'onelogin/saml2/schemas': ['*.xsd'],
},
package_dir={
'': 'src',
},
test_suite='tests',
install_requires=[
'dm.xmlsec.binding==1.3.3',
'isodate>=0.5.0',
'defusedxml>=0.4.1',
],
extras_require={
'test': (
'coverage>=3.6',
'freezegun==0.3.5',
'pylint==1.3.1',
'pep8==1.5.7',
'pyflakes==0.8.1',
'coveralls==1.1',
),
},
keywords='saml saml2 xmlsec django flask',
)
<commit_msg>Update pylint dependency to 1.9.1<commit_after> | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2010-2018 OneLogin, Inc.
# MIT License
from setuptools import setup
setup(
name='python-saml',
version='2.4.1',
description='Onelogin Python Toolkit. Add SAML support to your Python software using this library',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
],
author='OneLogin',
author_email='support@onelogin.com',
license='MIT',
url='https://github.com/onelogin/python-saml',
packages=['onelogin', 'onelogin/saml2'],
include_package_data=True,
package_data={
'onelogin/saml2/schemas': ['*.xsd'],
},
package_dir={
'': 'src',
},
test_suite='tests',
install_requires=[
'dm.xmlsec.binding==1.3.3',
'isodate>=0.5.0',
'defusedxml>=0.4.1',
],
extras_require={
'test': (
'coverage>=3.6',
'freezegun==0.3.5',
'pylint==1.9.1',
'pep8==1.5.7',
'pyflakes==0.8.1',
'coveralls==1.1',
),
},
keywords='saml saml2 xmlsec django flask',
)
| #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2010-2018 OneLogin, Inc.
# MIT License
from setuptools import setup
setup(
name='python-saml',
version='2.4.1',
description='Onelogin Python Toolkit. Add SAML support to your Python software using this library',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
],
author='OneLogin',
author_email='support@onelogin.com',
license='MIT',
url='https://github.com/onelogin/python-saml',
packages=['onelogin', 'onelogin/saml2'],
include_package_data=True,
package_data={
'onelogin/saml2/schemas': ['*.xsd'],
},
package_dir={
'': 'src',
},
test_suite='tests',
install_requires=[
'dm.xmlsec.binding==1.3.3',
'isodate>=0.5.0',
'defusedxml>=0.4.1',
],
extras_require={
'test': (
'coverage>=3.6',
'freezegun==0.3.5',
'pylint==1.3.1',
'pep8==1.5.7',
'pyflakes==0.8.1',
'coveralls==1.1',
),
},
keywords='saml saml2 xmlsec django flask',
)
Update pylint dependency to 1.9.1#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2010-2018 OneLogin, Inc.
# MIT License
from setuptools import setup
setup(
name='python-saml',
version='2.4.1',
description='Onelogin Python Toolkit. Add SAML support to your Python software using this library',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
],
author='OneLogin',
author_email='support@onelogin.com',
license='MIT',
url='https://github.com/onelogin/python-saml',
packages=['onelogin', 'onelogin/saml2'],
include_package_data=True,
package_data={
'onelogin/saml2/schemas': ['*.xsd'],
},
package_dir={
'': 'src',
},
test_suite='tests',
install_requires=[
'dm.xmlsec.binding==1.3.3',
'isodate>=0.5.0',
'defusedxml>=0.4.1',
],
extras_require={
'test': (
'coverage>=3.6',
'freezegun==0.3.5',
'pylint==1.9.1',
'pep8==1.5.7',
'pyflakes==0.8.1',
'coveralls==1.1',
),
},
keywords='saml saml2 xmlsec django flask',
)
| <commit_before>#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2010-2018 OneLogin, Inc.
# MIT License
from setuptools import setup
setup(
name='python-saml',
version='2.4.1',
description='Onelogin Python Toolkit. Add SAML support to your Python software using this library',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
],
author='OneLogin',
author_email='support@onelogin.com',
license='MIT',
url='https://github.com/onelogin/python-saml',
packages=['onelogin', 'onelogin/saml2'],
include_package_data=True,
package_data={
'onelogin/saml2/schemas': ['*.xsd'],
},
package_dir={
'': 'src',
},
test_suite='tests',
install_requires=[
'dm.xmlsec.binding==1.3.3',
'isodate>=0.5.0',
'defusedxml>=0.4.1',
],
extras_require={
'test': (
'coverage>=3.6',
'freezegun==0.3.5',
'pylint==1.3.1',
'pep8==1.5.7',
'pyflakes==0.8.1',
'coveralls==1.1',
),
},
keywords='saml saml2 xmlsec django flask',
)
<commit_msg>Update pylint dependency to 1.9.1<commit_after>#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2010-2018 OneLogin, Inc.
# MIT License
from setuptools import setup
setup(
name='python-saml',
version='2.4.1',
description='Onelogin Python Toolkit. Add SAML support to your Python software using this library',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
],
author='OneLogin',
author_email='support@onelogin.com',
license='MIT',
url='https://github.com/onelogin/python-saml',
packages=['onelogin', 'onelogin/saml2'],
include_package_data=True,
package_data={
'onelogin/saml2/schemas': ['*.xsd'],
},
package_dir={
'': 'src',
},
test_suite='tests',
install_requires=[
'dm.xmlsec.binding==1.3.3',
'isodate>=0.5.0',
'defusedxml>=0.4.1',
],
extras_require={
'test': (
'coverage>=3.6',
'freezegun==0.3.5',
'pylint==1.9.1',
'pep8==1.5.7',
'pyflakes==0.8.1',
'coveralls==1.1',
),
},
keywords='saml saml2 xmlsec django flask',
)
|
cf16c64e378f64d2267f75444c568aed895f940c | setup.py | setup.py | import platform, sys
from distutils.core import setup
from distextend import *
packages, package_data = findPackages("countershape")
setup(
name = "countershape",
version = "0.1",
description = "A framework for rendering static documentation.",
author = "Nullcube Pty Ltd",
author_email = "aldo@nullcube.com",
url = "http://dev.nullcube.com",
packages = packages,
package_data = package_data,
scripts = ["cshape"],
)
| import platform, sys
from distutils.core import setup
from distextend import *
packages, package_data = findPackages("countershape")
setup(
name = "countershape",
version = "0.1",
description = "A framework for rendering static documentation.",
author = "Nullcube Pty Ltd",
author_email = "aldo@nullcube.com",
url = "http://dev.nullcube.com",
packages = packages,
package_data = package_data,
scripts = ["cshape", "csblog"],
)
| Add csblog to installed scripts. | Add csblog to installed scripts.
| Python | mit | mhils/countershape,samtaufa/countershape,cortesi/countershape,cortesi/countershape,samtaufa/countershape,mhils/countershape | import platform, sys
from distutils.core import setup
from distextend import *
packages, package_data = findPackages("countershape")
setup(
name = "countershape",
version = "0.1",
description = "A framework for rendering static documentation.",
author = "Nullcube Pty Ltd",
author_email = "aldo@nullcube.com",
url = "http://dev.nullcube.com",
packages = packages,
package_data = package_data,
scripts = ["cshape"],
)
Add csblog to installed scripts. | import platform, sys
from distutils.core import setup
from distextend import *
packages, package_data = findPackages("countershape")
setup(
name = "countershape",
version = "0.1",
description = "A framework for rendering static documentation.",
author = "Nullcube Pty Ltd",
author_email = "aldo@nullcube.com",
url = "http://dev.nullcube.com",
packages = packages,
package_data = package_data,
scripts = ["cshape", "csblog"],
)
| <commit_before>import platform, sys
from distutils.core import setup
from distextend import *
packages, package_data = findPackages("countershape")
setup(
name = "countershape",
version = "0.1",
description = "A framework for rendering static documentation.",
author = "Nullcube Pty Ltd",
author_email = "aldo@nullcube.com",
url = "http://dev.nullcube.com",
packages = packages,
package_data = package_data,
scripts = ["cshape"],
)
<commit_msg>Add csblog to installed scripts.<commit_after> | import platform, sys
from distutils.core import setup
from distextend import *
packages, package_data = findPackages("countershape")
setup(
name = "countershape",
version = "0.1",
description = "A framework for rendering static documentation.",
author = "Nullcube Pty Ltd",
author_email = "aldo@nullcube.com",
url = "http://dev.nullcube.com",
packages = packages,
package_data = package_data,
scripts = ["cshape", "csblog"],
)
| import platform, sys
from distutils.core import setup
from distextend import *
packages, package_data = findPackages("countershape")
setup(
name = "countershape",
version = "0.1",
description = "A framework for rendering static documentation.",
author = "Nullcube Pty Ltd",
author_email = "aldo@nullcube.com",
url = "http://dev.nullcube.com",
packages = packages,
package_data = package_data,
scripts = ["cshape"],
)
Add csblog to installed scripts.import platform, sys
from distutils.core import setup
from distextend import *
packages, package_data = findPackages("countershape")
setup(
name = "countershape",
version = "0.1",
description = "A framework for rendering static documentation.",
author = "Nullcube Pty Ltd",
author_email = "aldo@nullcube.com",
url = "http://dev.nullcube.com",
packages = packages,
package_data = package_data,
scripts = ["cshape", "csblog"],
)
| <commit_before>import platform, sys
from distutils.core import setup
from distextend import *
packages, package_data = findPackages("countershape")
setup(
name = "countershape",
version = "0.1",
description = "A framework for rendering static documentation.",
author = "Nullcube Pty Ltd",
author_email = "aldo@nullcube.com",
url = "http://dev.nullcube.com",
packages = packages,
package_data = package_data,
scripts = ["cshape"],
)
<commit_msg>Add csblog to installed scripts.<commit_after>import platform, sys
from distutils.core import setup
from distextend import *
packages, package_data = findPackages("countershape")
setup(
name = "countershape",
version = "0.1",
description = "A framework for rendering static documentation.",
author = "Nullcube Pty Ltd",
author_email = "aldo@nullcube.com",
url = "http://dev.nullcube.com",
packages = packages,
package_data = package_data,
scripts = ["cshape", "csblog"],
)
|
075488b6f2b33c211b734dc08414d45cb35c4e68 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
# Match releases to redis-py versions
__version__ = '2.9.0.11'
# Jenkins will replace __build__ with a unique value.
__build__ = ''
setup(name='mockredispy',
version=__version__ + __build__,
description='Mock for redis-py',
url='http://www.github.com/locationlabs/mockredis',
license='Apache2',
packages=find_packages(exclude=['*.tests']),
setup_requires=[
'nose'
],
extras_require={
'lua': ['lunatic-python-bugfix==1.1.1'],
},
tests_require=[
'redis>=2.9.0'
],
test_suite='mockredis.tests',
entry_points={
'nose.plugins.0.10': [
'with_redis = mockredis.noseplugin:WithRedis'
]
})
| #!/usr/bin/env python
from setuptools import setup, find_packages
# Match releases to redis-py versions
__version__ = '2.9.0.12'
# Jenkins will replace __build__ with a unique value.
__build__ = ''
setup(name='mockredispy',
version=__version__ + __build__,
description='Mock for redis-py',
url='http://www.github.com/locationlabs/mockredis',
license='Apache2',
packages=find_packages(exclude=['*.tests']),
setup_requires=[
'nose'
],
extras_require={
'lua': ['lunatic-python-bugfix==1.1.1'],
},
tests_require=[
'redis>=2.9.0'
],
test_suite='mockredis.tests',
entry_points={
'nose.plugins.0.10': [
'with_redis = mockredis.noseplugin:WithRedis'
]
})
| Bump version to prepare for next release. | Bump version to prepare for next release.
| Python | apache-2.0 | locationlabs/mockredis | #!/usr/bin/env python
from setuptools import setup, find_packages
# Match releases to redis-py versions
__version__ = '2.9.0.11'
# Jenkins will replace __build__ with a unique value.
__build__ = ''
setup(name='mockredispy',
version=__version__ + __build__,
description='Mock for redis-py',
url='http://www.github.com/locationlabs/mockredis',
license='Apache2',
packages=find_packages(exclude=['*.tests']),
setup_requires=[
'nose'
],
extras_require={
'lua': ['lunatic-python-bugfix==1.1.1'],
},
tests_require=[
'redis>=2.9.0'
],
test_suite='mockredis.tests',
entry_points={
'nose.plugins.0.10': [
'with_redis = mockredis.noseplugin:WithRedis'
]
})
Bump version to prepare for next release. | #!/usr/bin/env python
from setuptools import setup, find_packages
# Match releases to redis-py versions
__version__ = '2.9.0.12'
# Jenkins will replace __build__ with a unique value.
__build__ = ''
setup(name='mockredispy',
version=__version__ + __build__,
description='Mock for redis-py',
url='http://www.github.com/locationlabs/mockredis',
license='Apache2',
packages=find_packages(exclude=['*.tests']),
setup_requires=[
'nose'
],
extras_require={
'lua': ['lunatic-python-bugfix==1.1.1'],
},
tests_require=[
'redis>=2.9.0'
],
test_suite='mockredis.tests',
entry_points={
'nose.plugins.0.10': [
'with_redis = mockredis.noseplugin:WithRedis'
]
})
| <commit_before>#!/usr/bin/env python
from setuptools import setup, find_packages
# Match releases to redis-py versions
__version__ = '2.9.0.11'
# Jenkins will replace __build__ with a unique value.
__build__ = ''
setup(name='mockredispy',
version=__version__ + __build__,
description='Mock for redis-py',
url='http://www.github.com/locationlabs/mockredis',
license='Apache2',
packages=find_packages(exclude=['*.tests']),
setup_requires=[
'nose'
],
extras_require={
'lua': ['lunatic-python-bugfix==1.1.1'],
},
tests_require=[
'redis>=2.9.0'
],
test_suite='mockredis.tests',
entry_points={
'nose.plugins.0.10': [
'with_redis = mockredis.noseplugin:WithRedis'
]
})
<commit_msg>Bump version to prepare for next release.<commit_after> | #!/usr/bin/env python
from setuptools import setup, find_packages
# Match releases to redis-py versions
__version__ = '2.9.0.12'
# Jenkins will replace __build__ with a unique value.
__build__ = ''
setup(name='mockredispy',
version=__version__ + __build__,
description='Mock for redis-py',
url='http://www.github.com/locationlabs/mockredis',
license='Apache2',
packages=find_packages(exclude=['*.tests']),
setup_requires=[
'nose'
],
extras_require={
'lua': ['lunatic-python-bugfix==1.1.1'],
},
tests_require=[
'redis>=2.9.0'
],
test_suite='mockredis.tests',
entry_points={
'nose.plugins.0.10': [
'with_redis = mockredis.noseplugin:WithRedis'
]
})
| #!/usr/bin/env python
from setuptools import setup, find_packages
# Match releases to redis-py versions
__version__ = '2.9.0.11'
# Jenkins will replace __build__ with a unique value.
__build__ = ''
setup(name='mockredispy',
version=__version__ + __build__,
description='Mock for redis-py',
url='http://www.github.com/locationlabs/mockredis',
license='Apache2',
packages=find_packages(exclude=['*.tests']),
setup_requires=[
'nose'
],
extras_require={
'lua': ['lunatic-python-bugfix==1.1.1'],
},
tests_require=[
'redis>=2.9.0'
],
test_suite='mockredis.tests',
entry_points={
'nose.plugins.0.10': [
'with_redis = mockredis.noseplugin:WithRedis'
]
})
Bump version to prepare for next release.#!/usr/bin/env python
from setuptools import setup, find_packages
# Match releases to redis-py versions
__version__ = '2.9.0.12'
# Jenkins will replace __build__ with a unique value.
__build__ = ''
setup(name='mockredispy',
version=__version__ + __build__,
description='Mock for redis-py',
url='http://www.github.com/locationlabs/mockredis',
license='Apache2',
packages=find_packages(exclude=['*.tests']),
setup_requires=[
'nose'
],
extras_require={
'lua': ['lunatic-python-bugfix==1.1.1'],
},
tests_require=[
'redis>=2.9.0'
],
test_suite='mockredis.tests',
entry_points={
'nose.plugins.0.10': [
'with_redis = mockredis.noseplugin:WithRedis'
]
})
| <commit_before>#!/usr/bin/env python
from setuptools import setup, find_packages
# Match releases to redis-py versions
__version__ = '2.9.0.11'
# Jenkins will replace __build__ with a unique value.
__build__ = ''
setup(name='mockredispy',
version=__version__ + __build__,
description='Mock for redis-py',
url='http://www.github.com/locationlabs/mockredis',
license='Apache2',
packages=find_packages(exclude=['*.tests']),
setup_requires=[
'nose'
],
extras_require={
'lua': ['lunatic-python-bugfix==1.1.1'],
},
tests_require=[
'redis>=2.9.0'
],
test_suite='mockredis.tests',
entry_points={
'nose.plugins.0.10': [
'with_redis = mockredis.noseplugin:WithRedis'
]
})
<commit_msg>Bump version to prepare for next release.<commit_after>#!/usr/bin/env python
from setuptools import setup, find_packages
# Match releases to redis-py versions
__version__ = '2.9.0.12'
# Jenkins will replace __build__ with a unique value.
__build__ = ''
setup(name='mockredispy',
version=__version__ + __build__,
description='Mock for redis-py',
url='http://www.github.com/locationlabs/mockredis',
license='Apache2',
packages=find_packages(exclude=['*.tests']),
setup_requires=[
'nose'
],
extras_require={
'lua': ['lunatic-python-bugfix==1.1.1'],
},
tests_require=[
'redis>=2.9.0'
],
test_suite='mockredis.tests',
entry_points={
'nose.plugins.0.10': [
'with_redis = mockredis.noseplugin:WithRedis'
]
})
|
76f254582243dc927ca25eebf2b47702ef43167b | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from setuptools import setup
from mongorm import VERSION
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
version = '.'.join(map(str, VERSION))
if __name__ == '__main__':
setup(
name='mongorm',
version=version,
author='Rahul AG',
author_email='r@hul.ag',
description=('An extremely thin ORM-ish wrapper over pymongo.'),
long_description=read('README.rst'),
license = 'BSD',
keywords = ['mongodb', 'mongo', 'orm', 'odm'],
url = 'https://github.com/rahulg/mongorm',
packages=['mongorm', 'tests'],
classifiers=[
'Development Status :: 3 - Alpha',
'Topic :: Database :: Front-Ends',
'License :: OSI Approved :: BSD License',
'Intended Audience :: Developers',
'Operating System :: OS Independent'
],
test_suite='tests',
install_requires=[
'pymongo',
'inflection',
'simplejson'
],
)
| #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from setuptools import setup
VERSION = (0, 6, 5)
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
version = '.'.join(map(str, VERSION))
if __name__ == '__main__':
setup(
name='mongorm',
version=version,
author='Rahul AG',
author_email='r@hul.ag',
description=('An extremely thin ORM-ish wrapper over pymongo.'),
long_description=read('README.rst'),
license = 'BSD',
keywords = ['mongodb', 'mongo', 'orm', 'odm'],
url = 'https://github.com/rahulg/mongorm',
packages=['mongorm', 'tests'],
classifiers=[
'Development Status :: 3 - Alpha',
'Topic :: Database :: Front-Ends',
'License :: OSI Approved :: BSD License',
'Intended Audience :: Developers',
'Operating System :: OS Independent'
],
test_suite='tests',
install_requires=[
'pymongo',
'inflection',
'simplejson'
],
)
| Fix install-time dependency on pymongo. | Fix install-time dependency on pymongo.
| Python | bsd-2-clause | rahulg/mongorm | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from setuptools import setup
from mongorm import VERSION
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
version = '.'.join(map(str, VERSION))
if __name__ == '__main__':
setup(
name='mongorm',
version=version,
author='Rahul AG',
author_email='r@hul.ag',
description=('An extremely thin ORM-ish wrapper over pymongo.'),
long_description=read('README.rst'),
license = 'BSD',
keywords = ['mongodb', 'mongo', 'orm', 'odm'],
url = 'https://github.com/rahulg/mongorm',
packages=['mongorm', 'tests'],
classifiers=[
'Development Status :: 3 - Alpha',
'Topic :: Database :: Front-Ends',
'License :: OSI Approved :: BSD License',
'Intended Audience :: Developers',
'Operating System :: OS Independent'
],
test_suite='tests',
install_requires=[
'pymongo',
'inflection',
'simplejson'
],
)
Fix install-time dependency on pymongo. | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from setuptools import setup
VERSION = (0, 6, 5)
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
version = '.'.join(map(str, VERSION))
if __name__ == '__main__':
setup(
name='mongorm',
version=version,
author='Rahul AG',
author_email='r@hul.ag',
description=('An extremely thin ORM-ish wrapper over pymongo.'),
long_description=read('README.rst'),
license = 'BSD',
keywords = ['mongodb', 'mongo', 'orm', 'odm'],
url = 'https://github.com/rahulg/mongorm',
packages=['mongorm', 'tests'],
classifiers=[
'Development Status :: 3 - Alpha',
'Topic :: Database :: Front-Ends',
'License :: OSI Approved :: BSD License',
'Intended Audience :: Developers',
'Operating System :: OS Independent'
],
test_suite='tests',
install_requires=[
'pymongo',
'inflection',
'simplejson'
],
)
| <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from setuptools import setup
from mongorm import VERSION
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
version = '.'.join(map(str, VERSION))
if __name__ == '__main__':
setup(
name='mongorm',
version=version,
author='Rahul AG',
author_email='r@hul.ag',
description=('An extremely thin ORM-ish wrapper over pymongo.'),
long_description=read('README.rst'),
license = 'BSD',
keywords = ['mongodb', 'mongo', 'orm', 'odm'],
url = 'https://github.com/rahulg/mongorm',
packages=['mongorm', 'tests'],
classifiers=[
'Development Status :: 3 - Alpha',
'Topic :: Database :: Front-Ends',
'License :: OSI Approved :: BSD License',
'Intended Audience :: Developers',
'Operating System :: OS Independent'
],
test_suite='tests',
install_requires=[
'pymongo',
'inflection',
'simplejson'
],
)
<commit_msg>Fix install-time dependency on pymongo.<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from setuptools import setup
VERSION = (0, 6, 5)
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
version = '.'.join(map(str, VERSION))
if __name__ == '__main__':
setup(
name='mongorm',
version=version,
author='Rahul AG',
author_email='r@hul.ag',
description=('An extremely thin ORM-ish wrapper over pymongo.'),
long_description=read('README.rst'),
license = 'BSD',
keywords = ['mongodb', 'mongo', 'orm', 'odm'],
url = 'https://github.com/rahulg/mongorm',
packages=['mongorm', 'tests'],
classifiers=[
'Development Status :: 3 - Alpha',
'Topic :: Database :: Front-Ends',
'License :: OSI Approved :: BSD License',
'Intended Audience :: Developers',
'Operating System :: OS Independent'
],
test_suite='tests',
install_requires=[
'pymongo',
'inflection',
'simplejson'
],
)
| #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from setuptools import setup
from mongorm import VERSION
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
version = '.'.join(map(str, VERSION))
if __name__ == '__main__':
setup(
name='mongorm',
version=version,
author='Rahul AG',
author_email='r@hul.ag',
description=('An extremely thin ORM-ish wrapper over pymongo.'),
long_description=read('README.rst'),
license = 'BSD',
keywords = ['mongodb', 'mongo', 'orm', 'odm'],
url = 'https://github.com/rahulg/mongorm',
packages=['mongorm', 'tests'],
classifiers=[
'Development Status :: 3 - Alpha',
'Topic :: Database :: Front-Ends',
'License :: OSI Approved :: BSD License',
'Intended Audience :: Developers',
'Operating System :: OS Independent'
],
test_suite='tests',
install_requires=[
'pymongo',
'inflection',
'simplejson'
],
)
Fix install-time dependency on pymongo.#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from setuptools import setup
VERSION = (0, 6, 5)
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
version = '.'.join(map(str, VERSION))
if __name__ == '__main__':
setup(
name='mongorm',
version=version,
author='Rahul AG',
author_email='r@hul.ag',
description=('An extremely thin ORM-ish wrapper over pymongo.'),
long_description=read('README.rst'),
license = 'BSD',
keywords = ['mongodb', 'mongo', 'orm', 'odm'],
url = 'https://github.com/rahulg/mongorm',
packages=['mongorm', 'tests'],
classifiers=[
'Development Status :: 3 - Alpha',
'Topic :: Database :: Front-Ends',
'License :: OSI Approved :: BSD License',
'Intended Audience :: Developers',
'Operating System :: OS Independent'
],
test_suite='tests',
install_requires=[
'pymongo',
'inflection',
'simplejson'
],
)
| <commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from setuptools import setup
from mongorm import VERSION
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
version = '.'.join(map(str, VERSION))
if __name__ == '__main__':
setup(
name='mongorm',
version=version,
author='Rahul AG',
author_email='r@hul.ag',
description=('An extremely thin ORM-ish wrapper over pymongo.'),
long_description=read('README.rst'),
license = 'BSD',
keywords = ['mongodb', 'mongo', 'orm', 'odm'],
url = 'https://github.com/rahulg/mongorm',
packages=['mongorm', 'tests'],
classifiers=[
'Development Status :: 3 - Alpha',
'Topic :: Database :: Front-Ends',
'License :: OSI Approved :: BSD License',
'Intended Audience :: Developers',
'Operating System :: OS Independent'
],
test_suite='tests',
install_requires=[
'pymongo',
'inflection',
'simplejson'
],
)
<commit_msg>Fix install-time dependency on pymongo.<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from setuptools import setup
VERSION = (0, 6, 5)
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
version = '.'.join(map(str, VERSION))
if __name__ == '__main__':
setup(
name='mongorm',
version=version,
author='Rahul AG',
author_email='r@hul.ag',
description=('An extremely thin ORM-ish wrapper over pymongo.'),
long_description=read('README.rst'),
license = 'BSD',
keywords = ['mongodb', 'mongo', 'orm', 'odm'],
url = 'https://github.com/rahulg/mongorm',
packages=['mongorm', 'tests'],
classifiers=[
'Development Status :: 3 - Alpha',
'Topic :: Database :: Front-Ends',
'License :: OSI Approved :: BSD License',
'Intended Audience :: Developers',
'Operating System :: OS Independent'
],
test_suite='tests',
install_requires=[
'pymongo',
'inflection',
'simplejson'
],
)
|
047215a3e07e7cebf78e409602dd57a2709f8923 | setup.py | setup.py |
import sys
from setuptools import setup, find_packages
from cement.utils import version
VERSION = version.get_version()
f = open('README.md', 'r')
LONG = f.read()
f.close()
setup(name='cement',
version=VERSION,
description='CLI Framework for Python',
long_description=LONG,
long_description_content_type='text/markdown',
classifiers=[],
install_requires=[],
keywords='cli framework',
author='Data Folk Labs, LLC',
author_email='derks@datafolklabs.com',
url='http://builtoncement.org',
license='BSD',
packages=find_packages(exclude=['ez_setup', 'tests*']),
package_data={'cement': ['cement/cli/templates/generate/*']},
include_package_data=True,
zip_safe=False,
test_suite='nose.collector',
entry_points="""
[console_scripts]
cement = cement.cli.main:main
""",
)
|
import sys
from setuptools import setup, find_packages
from cement.utils import version
VERSION = version.get_version()
f = open('README.md', 'r')
LONG = f.read()
f.close()
setup(name='cement',
version=VERSION,
description='CLI Framework for Python',
long_description=LONG,
long_description_content_type='text/markdown',
classifiers=[],
install_requires=[],
keywords='cli framework',
author='Data Folk Labs, LLC',
author_email='derks@datafolklabs.com',
url='https://builtoncement.com',
license='BSD',
packages=find_packages(exclude=['ez_setup', 'tests*']),
package_data={'cement': ['cement/cli/templates/generate/*']},
include_package_data=True,
zip_safe=False,
test_suite='nose.collector',
entry_points="""
[console_scripts]
cement = cement.cli.main:main
""",
)
| Update broken link in PyPi (Homepage) | Update broken link in PyPi (Homepage) | Python | bsd-3-clause | datafolklabs/cement,datafolklabs/cement,datafolklabs/cement |
import sys
from setuptools import setup, find_packages
from cement.utils import version
VERSION = version.get_version()
f = open('README.md', 'r')
LONG = f.read()
f.close()
setup(name='cement',
version=VERSION,
description='CLI Framework for Python',
long_description=LONG,
long_description_content_type='text/markdown',
classifiers=[],
install_requires=[],
keywords='cli framework',
author='Data Folk Labs, LLC',
author_email='derks@datafolklabs.com',
url='http://builtoncement.org',
license='BSD',
packages=find_packages(exclude=['ez_setup', 'tests*']),
package_data={'cement': ['cement/cli/templates/generate/*']},
include_package_data=True,
zip_safe=False,
test_suite='nose.collector',
entry_points="""
[console_scripts]
cement = cement.cli.main:main
""",
)
Update broken link in PyPi (Homepage) |
import sys
from setuptools import setup, find_packages
from cement.utils import version
VERSION = version.get_version()
f = open('README.md', 'r')
LONG = f.read()
f.close()
setup(name='cement',
version=VERSION,
description='CLI Framework for Python',
long_description=LONG,
long_description_content_type='text/markdown',
classifiers=[],
install_requires=[],
keywords='cli framework',
author='Data Folk Labs, LLC',
author_email='derks@datafolklabs.com',
url='https://builtoncement.com',
license='BSD',
packages=find_packages(exclude=['ez_setup', 'tests*']),
package_data={'cement': ['cement/cli/templates/generate/*']},
include_package_data=True,
zip_safe=False,
test_suite='nose.collector',
entry_points="""
[console_scripts]
cement = cement.cli.main:main
""",
)
| <commit_before>
import sys
from setuptools import setup, find_packages
from cement.utils import version
VERSION = version.get_version()
f = open('README.md', 'r')
LONG = f.read()
f.close()
setup(name='cement',
version=VERSION,
description='CLI Framework for Python',
long_description=LONG,
long_description_content_type='text/markdown',
classifiers=[],
install_requires=[],
keywords='cli framework',
author='Data Folk Labs, LLC',
author_email='derks@datafolklabs.com',
url='http://builtoncement.org',
license='BSD',
packages=find_packages(exclude=['ez_setup', 'tests*']),
package_data={'cement': ['cement/cli/templates/generate/*']},
include_package_data=True,
zip_safe=False,
test_suite='nose.collector',
entry_points="""
[console_scripts]
cement = cement.cli.main:main
""",
)
<commit_msg>Update broken link in PyPi (Homepage)<commit_after> |
import sys
from setuptools import setup, find_packages
from cement.utils import version
VERSION = version.get_version()
f = open('README.md', 'r')
LONG = f.read()
f.close()
setup(name='cement',
version=VERSION,
description='CLI Framework for Python',
long_description=LONG,
long_description_content_type='text/markdown',
classifiers=[],
install_requires=[],
keywords='cli framework',
author='Data Folk Labs, LLC',
author_email='derks@datafolklabs.com',
url='https://builtoncement.com',
license='BSD',
packages=find_packages(exclude=['ez_setup', 'tests*']),
package_data={'cement': ['cement/cli/templates/generate/*']},
include_package_data=True,
zip_safe=False,
test_suite='nose.collector',
entry_points="""
[console_scripts]
cement = cement.cli.main:main
""",
)
|
import sys
from setuptools import setup, find_packages
from cement.utils import version
VERSION = version.get_version()
f = open('README.md', 'r')
LONG = f.read()
f.close()
setup(name='cement',
version=VERSION,
description='CLI Framework for Python',
long_description=LONG,
long_description_content_type='text/markdown',
classifiers=[],
install_requires=[],
keywords='cli framework',
author='Data Folk Labs, LLC',
author_email='derks@datafolklabs.com',
url='http://builtoncement.org',
license='BSD',
packages=find_packages(exclude=['ez_setup', 'tests*']),
package_data={'cement': ['cement/cli/templates/generate/*']},
include_package_data=True,
zip_safe=False,
test_suite='nose.collector',
entry_points="""
[console_scripts]
cement = cement.cli.main:main
""",
)
Update broken link in PyPi (Homepage)
import sys
from setuptools import setup, find_packages
from cement.utils import version
VERSION = version.get_version()
f = open('README.md', 'r')
LONG = f.read()
f.close()
setup(name='cement',
version=VERSION,
description='CLI Framework for Python',
long_description=LONG,
long_description_content_type='text/markdown',
classifiers=[],
install_requires=[],
keywords='cli framework',
author='Data Folk Labs, LLC',
author_email='derks@datafolklabs.com',
url='https://builtoncement.com',
license='BSD',
packages=find_packages(exclude=['ez_setup', 'tests*']),
package_data={'cement': ['cement/cli/templates/generate/*']},
include_package_data=True,
zip_safe=False,
test_suite='nose.collector',
entry_points="""
[console_scripts]
cement = cement.cli.main:main
""",
)
| <commit_before>
import sys
from setuptools import setup, find_packages
from cement.utils import version
VERSION = version.get_version()
f = open('README.md', 'r')
LONG = f.read()
f.close()
setup(name='cement',
version=VERSION,
description='CLI Framework for Python',
long_description=LONG,
long_description_content_type='text/markdown',
classifiers=[],
install_requires=[],
keywords='cli framework',
author='Data Folk Labs, LLC',
author_email='derks@datafolklabs.com',
url='http://builtoncement.org',
license='BSD',
packages=find_packages(exclude=['ez_setup', 'tests*']),
package_data={'cement': ['cement/cli/templates/generate/*']},
include_package_data=True,
zip_safe=False,
test_suite='nose.collector',
entry_points="""
[console_scripts]
cement = cement.cli.main:main
""",
)
<commit_msg>Update broken link in PyPi (Homepage)<commit_after>
import sys
from setuptools import setup, find_packages
from cement.utils import version
VERSION = version.get_version()
f = open('README.md', 'r')
LONG = f.read()
f.close()
setup(name='cement',
version=VERSION,
description='CLI Framework for Python',
long_description=LONG,
long_description_content_type='text/markdown',
classifiers=[],
install_requires=[],
keywords='cli framework',
author='Data Folk Labs, LLC',
author_email='derks@datafolklabs.com',
url='https://builtoncement.com',
license='BSD',
packages=find_packages(exclude=['ez_setup', 'tests*']),
package_data={'cement': ['cement/cli/templates/generate/*']},
include_package_data=True,
zip_safe=False,
test_suite='nose.collector',
entry_points="""
[console_scripts]
cement = cement.cli.main:main
""",
)
|
ca7df2103a2e53f0b401c7004a2a5e942bd3e7e1 | setup.py | setup.py | from distutils.core import setup
from setuptools import setup, find_packages
setup(name = "django-image-cropping",
version = "0.3.0",
description = "A reusable app for cropping images easily and non-destructively in Django",
long_description=open('README.rst').read(),
author = "jonasvp",
author_email = "jvp@jonasundderwolf.de",
url = "http://github.com/jonasundderwolf/django-image-cropping",
#Name the folder where your packages live:
#(If you have other packages (dirs) or modules (py files) then
#put them into the package directory - they will be found
#recursively.)
packages = find_packages(),
include_package_data=True,
install_requires = [
'docutils',
'PIL',
'easy_thumbnails',
],
classifiers = [
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
],
)
| from distutils.core import setup
from setuptools import setup, find_packages
setup(name = "django-image-cropping",
version = "0.3.0",
description = "A reusable app for cropping images easily and non-destructively in Django",
long_description=open('README.rst').read(),
author = "jonasvp",
author_email = "jvp@jonasundderwolf.de",
url = "http://github.com/jonasundderwolf/django-image-cropping",
#Name the folder where your packages live:
#(If you have other packages (dirs) or modules (py files) then
#put them into the package directory - they will be found
#recursively.)
packages = find_packages(),
include_package_data=True,
install_requires = [
'easy_thumbnails',
],
classifiers = [
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
],
)
| Remove PIL and docutils from requirements, easy_thumbnails requires it anyway | Remove PIL and docutils from requirements, easy_thumbnails requires it anyway
| Python | bsd-3-clause | winzard/django-image-cropping,henriquechehad/django-image-cropping,henriquechehad/django-image-cropping,winzard/django-image-cropping,henriquechehad/django-image-cropping,winzard/django-image-cropping | from distutils.core import setup
from setuptools import setup, find_packages
setup(name = "django-image-cropping",
version = "0.3.0",
description = "A reusable app for cropping images easily and non-destructively in Django",
long_description=open('README.rst').read(),
author = "jonasvp",
author_email = "jvp@jonasundderwolf.de",
url = "http://github.com/jonasundderwolf/django-image-cropping",
#Name the folder where your packages live:
#(If you have other packages (dirs) or modules (py files) then
#put them into the package directory - they will be found
#recursively.)
packages = find_packages(),
include_package_data=True,
install_requires = [
'docutils',
'PIL',
'easy_thumbnails',
],
classifiers = [
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
],
)
Remove PIL and docutils from requirements, easy_thumbnails requires it anyway | from distutils.core import setup
from setuptools import setup, find_packages
setup(name = "django-image-cropping",
version = "0.3.0",
description = "A reusable app for cropping images easily and non-destructively in Django",
long_description=open('README.rst').read(),
author = "jonasvp",
author_email = "jvp@jonasundderwolf.de",
url = "http://github.com/jonasundderwolf/django-image-cropping",
#Name the folder where your packages live:
#(If you have other packages (dirs) or modules (py files) then
#put them into the package directory - they will be found
#recursively.)
packages = find_packages(),
include_package_data=True,
install_requires = [
'easy_thumbnails',
],
classifiers = [
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
],
)
| <commit_before>from distutils.core import setup
from setuptools import setup, find_packages
setup(name = "django-image-cropping",
version = "0.3.0",
description = "A reusable app for cropping images easily and non-destructively in Django",
long_description=open('README.rst').read(),
author = "jonasvp",
author_email = "jvp@jonasundderwolf.de",
url = "http://github.com/jonasundderwolf/django-image-cropping",
#Name the folder where your packages live:
#(If you have other packages (dirs) or modules (py files) then
#put them into the package directory - they will be found
#recursively.)
packages = find_packages(),
include_package_data=True,
install_requires = [
'docutils',
'PIL',
'easy_thumbnails',
],
classifiers = [
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
],
)
<commit_msg>Remove PIL and docutils from requirements, easy_thumbnails requires it anyway<commit_after> | from distutils.core import setup
from setuptools import setup, find_packages
setup(name = "django-image-cropping",
version = "0.3.0",
description = "A reusable app for cropping images easily and non-destructively in Django",
long_description=open('README.rst').read(),
author = "jonasvp",
author_email = "jvp@jonasundderwolf.de",
url = "http://github.com/jonasundderwolf/django-image-cropping",
#Name the folder where your packages live:
#(If you have other packages (dirs) or modules (py files) then
#put them into the package directory - they will be found
#recursively.)
packages = find_packages(),
include_package_data=True,
install_requires = [
'easy_thumbnails',
],
classifiers = [
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
],
)
| from distutils.core import setup
from setuptools import setup, find_packages
setup(name = "django-image-cropping",
version = "0.3.0",
description = "A reusable app for cropping images easily and non-destructively in Django",
long_description=open('README.rst').read(),
author = "jonasvp",
author_email = "jvp@jonasundderwolf.de",
url = "http://github.com/jonasundderwolf/django-image-cropping",
#Name the folder where your packages live:
#(If you have other packages (dirs) or modules (py files) then
#put them into the package directory - they will be found
#recursively.)
packages = find_packages(),
include_package_data=True,
install_requires = [
'docutils',
'PIL',
'easy_thumbnails',
],
classifiers = [
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
],
)
Remove PIL and docutils from requirements, easy_thumbnails requires it anywayfrom distutils.core import setup
from setuptools import setup, find_packages
setup(name = "django-image-cropping",
version = "0.3.0",
description = "A reusable app for cropping images easily and non-destructively in Django",
long_description=open('README.rst').read(),
author = "jonasvp",
author_email = "jvp@jonasundderwolf.de",
url = "http://github.com/jonasundderwolf/django-image-cropping",
#Name the folder where your packages live:
#(If you have other packages (dirs) or modules (py files) then
#put them into the package directory - they will be found
#recursively.)
packages = find_packages(),
include_package_data=True,
install_requires = [
'easy_thumbnails',
],
classifiers = [
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
],
)
| <commit_before>from distutils.core import setup
from setuptools import setup, find_packages
setup(name = "django-image-cropping",
version = "0.3.0",
description = "A reusable app for cropping images easily and non-destructively in Django",
long_description=open('README.rst').read(),
author = "jonasvp",
author_email = "jvp@jonasundderwolf.de",
url = "http://github.com/jonasundderwolf/django-image-cropping",
#Name the folder where your packages live:
#(If you have other packages (dirs) or modules (py files) then
#put them into the package directory - they will be found
#recursively.)
packages = find_packages(),
include_package_data=True,
install_requires = [
'docutils',
'PIL',
'easy_thumbnails',
],
classifiers = [
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
],
)
<commit_msg>Remove PIL and docutils from requirements, easy_thumbnails requires it anyway<commit_after>from distutils.core import setup
from setuptools import setup, find_packages
setup(name = "django-image-cropping",
version = "0.3.0",
description = "A reusable app for cropping images easily and non-destructively in Django",
long_description=open('README.rst').read(),
author = "jonasvp",
author_email = "jvp@jonasundderwolf.de",
url = "http://github.com/jonasundderwolf/django-image-cropping",
#Name the folder where your packages live:
#(If you have other packages (dirs) or modules (py files) then
#put them into the package directory - they will be found
#recursively.)
packages = find_packages(),
include_package_data=True,
install_requires = [
'easy_thumbnails',
],
classifiers = [
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
],
)
|
4b3dc61e5cb46774cf647f8c640b280aae1e4e90 | setup.py | setup.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# © 2017-2019 qsuscs, TobiX
# Should still run with Python 2.7...
from __future__ import print_function, unicode_literals
import os
import sys
from glob import glob
os.chdir(os.path.dirname(os.path.abspath(__file__)))
exit = 0
for f in glob('dot.*'):
dst_home = '~/' + f[3:].replace("--", "\ufffd").replace("-", "/").replace("\ufffd", "-")
dst = os.path.expanduser(dst_home)
src = os.path.join(os.getcwd(), f)
src_rel = os.path.relpath(src, os.path.dirname(dst))
try:
os.makedirs(os.path.dirname(dst))
except OSError:
pass
try:
os.symlink(src_rel, dst)
except OSError:
# Broken symbolic links do not "exist"
if not os.path.exists(dst):
print('"{}" is a broken link pointing to "{}", replacing.'.format(
dst_home, os.readlink(dst)))
os.remove(dst)
os.symlink(src_rel, dst)
elif not os.path.samefile(src, dst):
print('"{}" exists and does not link to "{}".'.format(dst_home, f))
exit = 1
sys.exit(exit)
| #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# © 2017-2021 qsuscs, TobiX
# Should still run with Python 2.7...
from __future__ import print_function, unicode_literals
import os
import sys
from glob import glob
os.chdir(os.path.dirname(os.path.abspath(__file__)))
home = os.path.realpath(os.path.expanduser('~'))
exit = 0
for f in glob('dot.*'):
dst_home = f[3:].replace("--", "\ufffd").replace("-", "/").replace("\ufffd", "-")
dst = home + '/' + dst_home
src = os.path.join(os.getcwd(), f)
src_rel = os.path.relpath(src, os.path.dirname(dst))
try:
os.makedirs(os.path.dirname(dst))
except OSError:
pass
try:
os.symlink(src_rel, dst)
except OSError:
# Broken symbolic links do not "exist"
if not os.path.exists(dst):
print('"{}" is a broken link pointing to "{}", replacing.'.format(
dst_home, os.readlink(dst)))
os.remove(dst)
os.symlink(src_rel, dst)
elif not os.path.samefile(src, dst):
print('"{}" exists and does not link to "{}".'.format(dst_home, f))
exit = 1
sys.exit(exit)
| Handle symlinks in path to home directory | Handle symlinks in path to home directory
| Python | isc | TobiX/dotfiles,TobiX/dotfiles | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# © 2017-2019 qsuscs, TobiX
# Should still run with Python 2.7...
from __future__ import print_function, unicode_literals
import os
import sys
from glob import glob
os.chdir(os.path.dirname(os.path.abspath(__file__)))
exit = 0
for f in glob('dot.*'):
dst_home = '~/' + f[3:].replace("--", "\ufffd").replace("-", "/").replace("\ufffd", "-")
dst = os.path.expanduser(dst_home)
src = os.path.join(os.getcwd(), f)
src_rel = os.path.relpath(src, os.path.dirname(dst))
try:
os.makedirs(os.path.dirname(dst))
except OSError:
pass
try:
os.symlink(src_rel, dst)
except OSError:
# Broken symbolic links do not "exist"
if not os.path.exists(dst):
print('"{}" is a broken link pointing to "{}", replacing.'.format(
dst_home, os.readlink(dst)))
os.remove(dst)
os.symlink(src_rel, dst)
elif not os.path.samefile(src, dst):
print('"{}" exists and does not link to "{}".'.format(dst_home, f))
exit = 1
sys.exit(exit)
Handle symlinks in path to home directory | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# © 2017-2021 qsuscs, TobiX
# Should still run with Python 2.7...
from __future__ import print_function, unicode_literals
import os
import sys
from glob import glob
os.chdir(os.path.dirname(os.path.abspath(__file__)))
home = os.path.realpath(os.path.expanduser('~'))
exit = 0
for f in glob('dot.*'):
dst_home = f[3:].replace("--", "\ufffd").replace("-", "/").replace("\ufffd", "-")
dst = home + '/' + dst_home
src = os.path.join(os.getcwd(), f)
src_rel = os.path.relpath(src, os.path.dirname(dst))
try:
os.makedirs(os.path.dirname(dst))
except OSError:
pass
try:
os.symlink(src_rel, dst)
except OSError:
# Broken symbolic links do not "exist"
if not os.path.exists(dst):
print('"{}" is a broken link pointing to "{}", replacing.'.format(
dst_home, os.readlink(dst)))
os.remove(dst)
os.symlink(src_rel, dst)
elif not os.path.samefile(src, dst):
print('"{}" exists and does not link to "{}".'.format(dst_home, f))
exit = 1
sys.exit(exit)
| <commit_before>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# © 2017-2019 qsuscs, TobiX
# Should still run with Python 2.7...
from __future__ import print_function, unicode_literals
import os
import sys
from glob import glob
os.chdir(os.path.dirname(os.path.abspath(__file__)))
exit = 0
for f in glob('dot.*'):
dst_home = '~/' + f[3:].replace("--", "\ufffd").replace("-", "/").replace("\ufffd", "-")
dst = os.path.expanduser(dst_home)
src = os.path.join(os.getcwd(), f)
src_rel = os.path.relpath(src, os.path.dirname(dst))
try:
os.makedirs(os.path.dirname(dst))
except OSError:
pass
try:
os.symlink(src_rel, dst)
except OSError:
# Broken symbolic links do not "exist"
if not os.path.exists(dst):
print('"{}" is a broken link pointing to "{}", replacing.'.format(
dst_home, os.readlink(dst)))
os.remove(dst)
os.symlink(src_rel, dst)
elif not os.path.samefile(src, dst):
print('"{}" exists and does not link to "{}".'.format(dst_home, f))
exit = 1
sys.exit(exit)
<commit_msg>Handle symlinks in path to home directory<commit_after> | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# © 2017-2021 qsuscs, TobiX
# Should still run with Python 2.7...
from __future__ import print_function, unicode_literals
import os
import sys
from glob import glob
os.chdir(os.path.dirname(os.path.abspath(__file__)))
home = os.path.realpath(os.path.expanduser('~'))
exit = 0
for f in glob('dot.*'):
dst_home = f[3:].replace("--", "\ufffd").replace("-", "/").replace("\ufffd", "-")
dst = home + '/' + dst_home
src = os.path.join(os.getcwd(), f)
src_rel = os.path.relpath(src, os.path.dirname(dst))
try:
os.makedirs(os.path.dirname(dst))
except OSError:
pass
try:
os.symlink(src_rel, dst)
except OSError:
# Broken symbolic links do not "exist"
if not os.path.exists(dst):
print('"{}" is a broken link pointing to "{}", replacing.'.format(
dst_home, os.readlink(dst)))
os.remove(dst)
os.symlink(src_rel, dst)
elif not os.path.samefile(src, dst):
print('"{}" exists and does not link to "{}".'.format(dst_home, f))
exit = 1
sys.exit(exit)
| #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# © 2017-2019 qsuscs, TobiX
# Should still run with Python 2.7...
from __future__ import print_function, unicode_literals
import os
import sys
from glob import glob
os.chdir(os.path.dirname(os.path.abspath(__file__)))
exit = 0
for f in glob('dot.*'):
dst_home = '~/' + f[3:].replace("--", "\ufffd").replace("-", "/").replace("\ufffd", "-")
dst = os.path.expanduser(dst_home)
src = os.path.join(os.getcwd(), f)
src_rel = os.path.relpath(src, os.path.dirname(dst))
try:
os.makedirs(os.path.dirname(dst))
except OSError:
pass
try:
os.symlink(src_rel, dst)
except OSError:
# Broken symbolic links do not "exist"
if not os.path.exists(dst):
print('"{}" is a broken link pointing to "{}", replacing.'.format(
dst_home, os.readlink(dst)))
os.remove(dst)
os.symlink(src_rel, dst)
elif not os.path.samefile(src, dst):
print('"{}" exists and does not link to "{}".'.format(dst_home, f))
exit = 1
sys.exit(exit)
Handle symlinks in path to home directory#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# © 2017-2021 qsuscs, TobiX
# Should still run with Python 2.7...
from __future__ import print_function, unicode_literals
import os
import sys
from glob import glob
os.chdir(os.path.dirname(os.path.abspath(__file__)))
home = os.path.realpath(os.path.expanduser('~'))
exit = 0
for f in glob('dot.*'):
dst_home = f[3:].replace("--", "\ufffd").replace("-", "/").replace("\ufffd", "-")
dst = home + '/' + dst_home
src = os.path.join(os.getcwd(), f)
src_rel = os.path.relpath(src, os.path.dirname(dst))
try:
os.makedirs(os.path.dirname(dst))
except OSError:
pass
try:
os.symlink(src_rel, dst)
except OSError:
# Broken symbolic links do not "exist"
if not os.path.exists(dst):
print('"{}" is a broken link pointing to "{}", replacing.'.format(
dst_home, os.readlink(dst)))
os.remove(dst)
os.symlink(src_rel, dst)
elif not os.path.samefile(src, dst):
print('"{}" exists and does not link to "{}".'.format(dst_home, f))
exit = 1
sys.exit(exit)
| <commit_before>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# © 2017-2019 qsuscs, TobiX
# Should still run with Python 2.7...
from __future__ import print_function, unicode_literals
import os
import sys
from glob import glob
os.chdir(os.path.dirname(os.path.abspath(__file__)))
exit = 0
for f in glob('dot.*'):
dst_home = '~/' + f[3:].replace("--", "\ufffd").replace("-", "/").replace("\ufffd", "-")
dst = os.path.expanduser(dst_home)
src = os.path.join(os.getcwd(), f)
src_rel = os.path.relpath(src, os.path.dirname(dst))
try:
os.makedirs(os.path.dirname(dst))
except OSError:
pass
try:
os.symlink(src_rel, dst)
except OSError:
# Broken symbolic links do not "exist"
if not os.path.exists(dst):
print('"{}" is a broken link pointing to "{}", replacing.'.format(
dst_home, os.readlink(dst)))
os.remove(dst)
os.symlink(src_rel, dst)
elif not os.path.samefile(src, dst):
print('"{}" exists and does not link to "{}".'.format(dst_home, f))
exit = 1
sys.exit(exit)
<commit_msg>Handle symlinks in path to home directory<commit_after>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# © 2017-2021 qsuscs, TobiX
# Should still run with Python 2.7...
from __future__ import print_function, unicode_literals
import os
import sys
from glob import glob
os.chdir(os.path.dirname(os.path.abspath(__file__)))
home = os.path.realpath(os.path.expanduser('~'))
exit = 0
for f in glob('dot.*'):
dst_home = f[3:].replace("--", "\ufffd").replace("-", "/").replace("\ufffd", "-")
dst = home + '/' + dst_home
src = os.path.join(os.getcwd(), f)
src_rel = os.path.relpath(src, os.path.dirname(dst))
try:
os.makedirs(os.path.dirname(dst))
except OSError:
pass
try:
os.symlink(src_rel, dst)
except OSError:
# Broken symbolic links do not "exist"
if not os.path.exists(dst):
print('"{}" is a broken link pointing to "{}", replacing.'.format(
dst_home, os.readlink(dst)))
os.remove(dst)
os.symlink(src_rel, dst)
elif not os.path.samefile(src, dst):
print('"{}" exists and does not link to "{}".'.format(dst_home, f))
exit = 1
sys.exit(exit)
|
f8c049e1b6a6309d494771e4038aa10b40bfbf76 | setup.py | setup.py | from setuptools import setup
VERSION = '1.2.2'
setup(
name='pkgconfig',
version=VERSION,
author='Matthias Vogelgesang',
author_email='matthias.vogelgesang@gmail.com',
url='http://github.com/matze/pkgconfig',
license='MIT',
packages=['pkgconfig'],
description="Interface Python with pkg-config",
long_description=open('README.rst').read(),
setup_requires=['nose>=1.0'],
python_requires='>=2.6, !=3.0.*, !=3.1.*, !=3.2.*',
test_suite='test',
)
| from setuptools import setup
VERSION = '1.2.2'
setup(
name='pkgconfig',
version=VERSION,
author='Matthias Vogelgesang',
author_email='matthias.vogelgesang@gmail.com',
url='http://github.com/matze/pkgconfig',
license='MIT',
packages=['pkgconfig'],
description="Interface Python with pkg-config",
long_description=open('README.rst').read(),
tests_require=['nose>=1.0'],
python_requires='>=2.6, !=3.0.*, !=3.1.*, !=3.2.*',
test_suite='test',
)
| Move 'nose' dependency to 'tests_require' | Move 'nose' dependency to 'tests_require'
`nose` is only required for invoking `setup.py test`, not for any other
`setup.py` command. This avoids the auto-download behavior when just
building and installing the module (e.g., installing via `pip`).
Signed-off-by: Eric N. Vander Weele <4c4001a597f85b23ba16d5c26e44733bbe755332@gmail.com>
| Python | mit | matze/pkgconfig | from setuptools import setup
VERSION = '1.2.2'
setup(
name='pkgconfig',
version=VERSION,
author='Matthias Vogelgesang',
author_email='matthias.vogelgesang@gmail.com',
url='http://github.com/matze/pkgconfig',
license='MIT',
packages=['pkgconfig'],
description="Interface Python with pkg-config",
long_description=open('README.rst').read(),
setup_requires=['nose>=1.0'],
python_requires='>=2.6, !=3.0.*, !=3.1.*, !=3.2.*',
test_suite='test',
)
Move 'nose' dependency to 'tests_require'
`nose` is only required for invoking `setup.py test`, not for any other
`setup.py` command. This avoids the auto-download behavior when just
building and installing the module (e.g., installing via `pip`).
Signed-off-by: Eric N. Vander Weele <4c4001a597f85b23ba16d5c26e44733bbe755332@gmail.com> | from setuptools import setup
VERSION = '1.2.2'
setup(
name='pkgconfig',
version=VERSION,
author='Matthias Vogelgesang',
author_email='matthias.vogelgesang@gmail.com',
url='http://github.com/matze/pkgconfig',
license='MIT',
packages=['pkgconfig'],
description="Interface Python with pkg-config",
long_description=open('README.rst').read(),
tests_require=['nose>=1.0'],
python_requires='>=2.6, !=3.0.*, !=3.1.*, !=3.2.*',
test_suite='test',
)
| <commit_before>from setuptools import setup
VERSION = '1.2.2'
setup(
name='pkgconfig',
version=VERSION,
author='Matthias Vogelgesang',
author_email='matthias.vogelgesang@gmail.com',
url='http://github.com/matze/pkgconfig',
license='MIT',
packages=['pkgconfig'],
description="Interface Python with pkg-config",
long_description=open('README.rst').read(),
setup_requires=['nose>=1.0'],
python_requires='>=2.6, !=3.0.*, !=3.1.*, !=3.2.*',
test_suite='test',
)
<commit_msg>Move 'nose' dependency to 'tests_require'
`nose` is only required for invoking `setup.py test`, not for any other
`setup.py` command. This avoids the auto-download behavior when just
building and installing the module (e.g., installing via `pip`).
Signed-off-by: Eric N. Vander Weele <4c4001a597f85b23ba16d5c26e44733bbe755332@gmail.com><commit_after> | from setuptools import setup
VERSION = '1.2.2'
setup(
name='pkgconfig',
version=VERSION,
author='Matthias Vogelgesang',
author_email='matthias.vogelgesang@gmail.com',
url='http://github.com/matze/pkgconfig',
license='MIT',
packages=['pkgconfig'],
description="Interface Python with pkg-config",
long_description=open('README.rst').read(),
tests_require=['nose>=1.0'],
python_requires='>=2.6, !=3.0.*, !=3.1.*, !=3.2.*',
test_suite='test',
)
| from setuptools import setup
VERSION = '1.2.2'
setup(
name='pkgconfig',
version=VERSION,
author='Matthias Vogelgesang',
author_email='matthias.vogelgesang@gmail.com',
url='http://github.com/matze/pkgconfig',
license='MIT',
packages=['pkgconfig'],
description="Interface Python with pkg-config",
long_description=open('README.rst').read(),
setup_requires=['nose>=1.0'],
python_requires='>=2.6, !=3.0.*, !=3.1.*, !=3.2.*',
test_suite='test',
)
Move 'nose' dependency to 'tests_require'
`nose` is only required for invoking `setup.py test`, not for any other
`setup.py` command. This avoids the auto-download behavior when just
building and installing the module (e.g., installing via `pip`).
Signed-off-by: Eric N. Vander Weele <4c4001a597f85b23ba16d5c26e44733bbe755332@gmail.com>from setuptools import setup
VERSION = '1.2.2'
setup(
name='pkgconfig',
version=VERSION,
author='Matthias Vogelgesang',
author_email='matthias.vogelgesang@gmail.com',
url='http://github.com/matze/pkgconfig',
license='MIT',
packages=['pkgconfig'],
description="Interface Python with pkg-config",
long_description=open('README.rst').read(),
tests_require=['nose>=1.0'],
python_requires='>=2.6, !=3.0.*, !=3.1.*, !=3.2.*',
test_suite='test',
)
| <commit_before>from setuptools import setup
VERSION = '1.2.2'
setup(
name='pkgconfig',
version=VERSION,
author='Matthias Vogelgesang',
author_email='matthias.vogelgesang@gmail.com',
url='http://github.com/matze/pkgconfig',
license='MIT',
packages=['pkgconfig'],
description="Interface Python with pkg-config",
long_description=open('README.rst').read(),
setup_requires=['nose>=1.0'],
python_requires='>=2.6, !=3.0.*, !=3.1.*, !=3.2.*',
test_suite='test',
)
<commit_msg>Move 'nose' dependency to 'tests_require'
`nose` is only required for invoking `setup.py test`, not for any other
`setup.py` command. This avoids the auto-download behavior when just
building and installing the module (e.g., installing via `pip`).
Signed-off-by: Eric N. Vander Weele <4c4001a597f85b23ba16d5c26e44733bbe755332@gmail.com><commit_after>from setuptools import setup
VERSION = '1.2.2'
setup(
name='pkgconfig',
version=VERSION,
author='Matthias Vogelgesang',
author_email='matthias.vogelgesang@gmail.com',
url='http://github.com/matze/pkgconfig',
license='MIT',
packages=['pkgconfig'],
description="Interface Python with pkg-config",
long_description=open('README.rst').read(),
tests_require=['nose>=1.0'],
python_requires='>=2.6, !=3.0.*, !=3.1.*, !=3.2.*',
test_suite='test',
)
|
70be93343a985b4aa81944649c42c4138fece388 | setup.py | setup.py | from __future__ import print_function
import codecs
import os
from setuptools import setup, find_packages
import piazza_api
def read(filename):
"""Read and return `filename` in root dir of project and return string"""
here = os.path.abspath(os.path.dirname(__file__))
return codecs.open(os.path.join(here, filename), 'r').read()
install_requires = read("requirements.txt").split()
long_description = read('README.md')
setup(
name='piazza-api',
version=piazza_api.__version__,
url='http://github.com/hfaran/piazza-api/',
license='MIT License',
author='Hamza Faran',
install_requires=install_requires,
description="Unofficial Client for Piazza's Internal API",
long_description=long_description,
packages=['piazza_api'],
platforms='any',
classifiers = [
'Programming Language :: Python',
'Development Status :: 3 - Alpha',
'Natural Language :: English',
'Environment :: Web Environment',
'Intended Audience :: Developers',
"License :: OSI Approved :: MIT License",
'Operating System :: OS Independent',
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.3",
'Topic :: Software Development :: Libraries :: Python Modules',
],
)
| from __future__ import print_function
import codecs
import os
import re
from setuptools import setup
def read(filename):
"""Read and return `filename` in root dir of project and return string"""
here = os.path.abspath(os.path.dirname(__file__))
return codecs.open(os.path.join(here, filename), 'r').read()
# https://github.com/kennethreitz/requests/blob/master/setup.py#L32
with open('piazza_api/__init__.py', 'r') as fd:
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
fd.read(), re.MULTILINE).group(1)
install_requires = read("requirements.txt").split()
long_description = read('README.md')
setup(
name='piazza-api',
version=version,
url='http://github.com/hfaran/piazza-api/',
license='MIT License',
author='Hamza Faran',
install_requires=install_requires,
description="Unofficial Client for Piazza's Internal API",
long_description=long_description,
packages=['piazza_api'],
platforms='any',
classifiers = [
'Programming Language :: Python',
'Development Status :: 3 - Alpha',
'Natural Language :: English',
'Environment :: Web Environment',
'Intended Audience :: Developers',
"License :: OSI Approved :: MIT License",
'Operating System :: OS Independent',
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.3",
'Topic :: Software Development :: Libraries :: Python Modules',
],
)
| Use regex for finding version in __init__.py | Use regex for finding version in __init__.py
| Python | mit | hfaran/piazza-api | from __future__ import print_function
import codecs
import os
from setuptools import setup, find_packages
import piazza_api
def read(filename):
"""Read and return `filename` in root dir of project and return string"""
here = os.path.abspath(os.path.dirname(__file__))
return codecs.open(os.path.join(here, filename), 'r').read()
install_requires = read("requirements.txt").split()
long_description = read('README.md')
setup(
name='piazza-api',
version=piazza_api.__version__,
url='http://github.com/hfaran/piazza-api/',
license='MIT License',
author='Hamza Faran',
install_requires=install_requires,
description="Unofficial Client for Piazza's Internal API",
long_description=long_description,
packages=['piazza_api'],
platforms='any',
classifiers = [
'Programming Language :: Python',
'Development Status :: 3 - Alpha',
'Natural Language :: English',
'Environment :: Web Environment',
'Intended Audience :: Developers',
"License :: OSI Approved :: MIT License",
'Operating System :: OS Independent',
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.3",
'Topic :: Software Development :: Libraries :: Python Modules',
],
)
Use regex for finding version in __init__.py | from __future__ import print_function
import codecs
import os
import re
from setuptools import setup
def read(filename):
"""Read and return `filename` in root dir of project and return string"""
here = os.path.abspath(os.path.dirname(__file__))
return codecs.open(os.path.join(here, filename), 'r').read()
# https://github.com/kennethreitz/requests/blob/master/setup.py#L32
with open('piazza_api/__init__.py', 'r') as fd:
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
fd.read(), re.MULTILINE).group(1)
install_requires = read("requirements.txt").split()
long_description = read('README.md')
setup(
name='piazza-api',
version=version,
url='http://github.com/hfaran/piazza-api/',
license='MIT License',
author='Hamza Faran',
install_requires=install_requires,
description="Unofficial Client for Piazza's Internal API",
long_description=long_description,
packages=['piazza_api'],
platforms='any',
classifiers = [
'Programming Language :: Python',
'Development Status :: 3 - Alpha',
'Natural Language :: English',
'Environment :: Web Environment',
'Intended Audience :: Developers',
"License :: OSI Approved :: MIT License",
'Operating System :: OS Independent',
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.3",
'Topic :: Software Development :: Libraries :: Python Modules',
],
)
| <commit_before>from __future__ import print_function
import codecs
import os
from setuptools import setup, find_packages
import piazza_api
def read(filename):
"""Read and return `filename` in root dir of project and return string"""
here = os.path.abspath(os.path.dirname(__file__))
return codecs.open(os.path.join(here, filename), 'r').read()
install_requires = read("requirements.txt").split()
long_description = read('README.md')
setup(
name='piazza-api',
version=piazza_api.__version__,
url='http://github.com/hfaran/piazza-api/',
license='MIT License',
author='Hamza Faran',
install_requires=install_requires,
description="Unofficial Client for Piazza's Internal API",
long_description=long_description,
packages=['piazza_api'],
platforms='any',
classifiers = [
'Programming Language :: Python',
'Development Status :: 3 - Alpha',
'Natural Language :: English',
'Environment :: Web Environment',
'Intended Audience :: Developers',
"License :: OSI Approved :: MIT License",
'Operating System :: OS Independent',
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.3",
'Topic :: Software Development :: Libraries :: Python Modules',
],
)
<commit_msg>Use regex for finding version in __init__.py<commit_after> | from __future__ import print_function
import codecs
import os
import re
from setuptools import setup
def read(filename):
"""Read and return `filename` in root dir of project and return string"""
here = os.path.abspath(os.path.dirname(__file__))
return codecs.open(os.path.join(here, filename), 'r').read()
# https://github.com/kennethreitz/requests/blob/master/setup.py#L32
with open('piazza_api/__init__.py', 'r') as fd:
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
fd.read(), re.MULTILINE).group(1)
install_requires = read("requirements.txt").split()
long_description = read('README.md')
setup(
name='piazza-api',
version=version,
url='http://github.com/hfaran/piazza-api/',
license='MIT License',
author='Hamza Faran',
install_requires=install_requires,
description="Unofficial Client for Piazza's Internal API",
long_description=long_description,
packages=['piazza_api'],
platforms='any',
classifiers = [
'Programming Language :: Python',
'Development Status :: 3 - Alpha',
'Natural Language :: English',
'Environment :: Web Environment',
'Intended Audience :: Developers',
"License :: OSI Approved :: MIT License",
'Operating System :: OS Independent',
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.3",
'Topic :: Software Development :: Libraries :: Python Modules',
],
)
| from __future__ import print_function
import codecs
import os
from setuptools import setup, find_packages
import piazza_api
def read(filename):
"""Read and return `filename` in root dir of project and return string"""
here = os.path.abspath(os.path.dirname(__file__))
return codecs.open(os.path.join(here, filename), 'r').read()
install_requires = read("requirements.txt").split()
long_description = read('README.md')
setup(
name='piazza-api',
version=piazza_api.__version__,
url='http://github.com/hfaran/piazza-api/',
license='MIT License',
author='Hamza Faran',
install_requires=install_requires,
description="Unofficial Client for Piazza's Internal API",
long_description=long_description,
packages=['piazza_api'],
platforms='any',
classifiers = [
'Programming Language :: Python',
'Development Status :: 3 - Alpha',
'Natural Language :: English',
'Environment :: Web Environment',
'Intended Audience :: Developers',
"License :: OSI Approved :: MIT License",
'Operating System :: OS Independent',
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.3",
'Topic :: Software Development :: Libraries :: Python Modules',
],
)
Use regex for finding version in __init__.pyfrom __future__ import print_function
import codecs
import os
import re
from setuptools import setup
def read(filename):
"""Read and return `filename` in root dir of project and return string"""
here = os.path.abspath(os.path.dirname(__file__))
return codecs.open(os.path.join(here, filename), 'r').read()
# https://github.com/kennethreitz/requests/blob/master/setup.py#L32
with open('piazza_api/__init__.py', 'r') as fd:
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
fd.read(), re.MULTILINE).group(1)
install_requires = read("requirements.txt").split()
long_description = read('README.md')
setup(
name='piazza-api',
version=version,
url='http://github.com/hfaran/piazza-api/',
license='MIT License',
author='Hamza Faran',
install_requires=install_requires,
description="Unofficial Client for Piazza's Internal API",
long_description=long_description,
packages=['piazza_api'],
platforms='any',
classifiers = [
'Programming Language :: Python',
'Development Status :: 3 - Alpha',
'Natural Language :: English',
'Environment :: Web Environment',
'Intended Audience :: Developers',
"License :: OSI Approved :: MIT License",
'Operating System :: OS Independent',
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.3",
'Topic :: Software Development :: Libraries :: Python Modules',
],
)
| <commit_before>from __future__ import print_function
import codecs
import os
from setuptools import setup, find_packages
import piazza_api
def read(filename):
"""Read and return `filename` in root dir of project and return string"""
here = os.path.abspath(os.path.dirname(__file__))
return codecs.open(os.path.join(here, filename), 'r').read()
install_requires = read("requirements.txt").split()
long_description = read('README.md')
setup(
name='piazza-api',
version=piazza_api.__version__,
url='http://github.com/hfaran/piazza-api/',
license='MIT License',
author='Hamza Faran',
install_requires=install_requires,
description="Unofficial Client for Piazza's Internal API",
long_description=long_description,
packages=['piazza_api'],
platforms='any',
classifiers = [
'Programming Language :: Python',
'Development Status :: 3 - Alpha',
'Natural Language :: English',
'Environment :: Web Environment',
'Intended Audience :: Developers',
"License :: OSI Approved :: MIT License",
'Operating System :: OS Independent',
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.3",
'Topic :: Software Development :: Libraries :: Python Modules',
],
)
<commit_msg>Use regex for finding version in __init__.py<commit_after>from __future__ import print_function
import codecs
import os
import re
from setuptools import setup
def read(filename):
"""Read and return `filename` in root dir of project and return string"""
here = os.path.abspath(os.path.dirname(__file__))
return codecs.open(os.path.join(here, filename), 'r').read()
# https://github.com/kennethreitz/requests/blob/master/setup.py#L32
with open('piazza_api/__init__.py', 'r') as fd:
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
fd.read(), re.MULTILINE).group(1)
install_requires = read("requirements.txt").split()
long_description = read('README.md')
setup(
name='piazza-api',
version=version,
url='http://github.com/hfaran/piazza-api/',
license='MIT License',
author='Hamza Faran',
install_requires=install_requires,
description="Unofficial Client for Piazza's Internal API",
long_description=long_description,
packages=['piazza_api'],
platforms='any',
classifiers = [
'Programming Language :: Python',
'Development Status :: 3 - Alpha',
'Natural Language :: English',
'Environment :: Web Environment',
'Intended Audience :: Developers',
"License :: OSI Approved :: MIT License",
'Operating System :: OS Independent',
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.3",
'Topic :: Software Development :: Libraries :: Python Modules',
],
)
|
e1cc4d49f37abbda308968b1bf4f49298a1c904e | setup.py | setup.py | #!/usr/bin/env python
# coding=utf8
import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='legitfs',
version='0.3dev',
description='A read-only FUSE-based filesystem allowing you to browse '
'git repositories',
long_description=read('README.rst'),
keywords='git,fuse,filesystem,fs,read-only,readonly,legit,legitfs',
author='Marc Brinkmann',
author_email='git@marcbrinkmann.de',
url='http://github.com/mbr/legitfs',
license='MIT',
packages=find_packages(exclude=['tests']),
install_requires=['dulwich', 'fusepy', 'click', 'logbook'],
entry_points={
'console_scripts': [
'legitfs = legitfs.cli:main',
]
}
)
| #!/usr/bin/env python
# coding=utf8
import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='legitfs',
version='0.3.dev1',
description='A read-only FUSE-based filesystem allowing you to browse '
'git repositories',
long_description=read('README.rst'),
keywords='git,fuse,filesystem,fs,read-only,readonly,legit,legitfs',
author='Marc Brinkmann',
author_email='git@marcbrinkmann.de',
url='http://github.com/mbr/legitfs',
license='MIT',
packages=find_packages(exclude=['tests']),
install_requires=['dulwich', 'fusepy', 'click', 'logbook'],
entry_points={
'console_scripts': [
'legitfs = legitfs.cli:main',
]
}
)
| Change version to prevent unleash from choking. | Change version to prevent unleash from choking.
| Python | mit | mbr/legitfs | #!/usr/bin/env python
# coding=utf8
import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='legitfs',
version='0.3dev',
description='A read-only FUSE-based filesystem allowing you to browse '
'git repositories',
long_description=read('README.rst'),
keywords='git,fuse,filesystem,fs,read-only,readonly,legit,legitfs',
author='Marc Brinkmann',
author_email='git@marcbrinkmann.de',
url='http://github.com/mbr/legitfs',
license='MIT',
packages=find_packages(exclude=['tests']),
install_requires=['dulwich', 'fusepy', 'click', 'logbook'],
entry_points={
'console_scripts': [
'legitfs = legitfs.cli:main',
]
}
)
Change version to prevent unleash from choking. | #!/usr/bin/env python
# coding=utf8
import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='legitfs',
version='0.3.dev1',
description='A read-only FUSE-based filesystem allowing you to browse '
'git repositories',
long_description=read('README.rst'),
keywords='git,fuse,filesystem,fs,read-only,readonly,legit,legitfs',
author='Marc Brinkmann',
author_email='git@marcbrinkmann.de',
url='http://github.com/mbr/legitfs',
license='MIT',
packages=find_packages(exclude=['tests']),
install_requires=['dulwich', 'fusepy', 'click', 'logbook'],
entry_points={
'console_scripts': [
'legitfs = legitfs.cli:main',
]
}
)
| <commit_before>#!/usr/bin/env python
# coding=utf8
import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='legitfs',
version='0.3dev',
description='A read-only FUSE-based filesystem allowing you to browse '
'git repositories',
long_description=read('README.rst'),
keywords='git,fuse,filesystem,fs,read-only,readonly,legit,legitfs',
author='Marc Brinkmann',
author_email='git@marcbrinkmann.de',
url='http://github.com/mbr/legitfs',
license='MIT',
packages=find_packages(exclude=['tests']),
install_requires=['dulwich', 'fusepy', 'click', 'logbook'],
entry_points={
'console_scripts': [
'legitfs = legitfs.cli:main',
]
}
)
<commit_msg>Change version to prevent unleash from choking.<commit_after> | #!/usr/bin/env python
# coding=utf8
import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='legitfs',
version='0.3.dev1',
description='A read-only FUSE-based filesystem allowing you to browse '
'git repositories',
long_description=read('README.rst'),
keywords='git,fuse,filesystem,fs,read-only,readonly,legit,legitfs',
author='Marc Brinkmann',
author_email='git@marcbrinkmann.de',
url='http://github.com/mbr/legitfs',
license='MIT',
packages=find_packages(exclude=['tests']),
install_requires=['dulwich', 'fusepy', 'click', 'logbook'],
entry_points={
'console_scripts': [
'legitfs = legitfs.cli:main',
]
}
)
| #!/usr/bin/env python
# coding=utf8
import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='legitfs',
version='0.3dev',
description='A read-only FUSE-based filesystem allowing you to browse '
'git repositories',
long_description=read('README.rst'),
keywords='git,fuse,filesystem,fs,read-only,readonly,legit,legitfs',
author='Marc Brinkmann',
author_email='git@marcbrinkmann.de',
url='http://github.com/mbr/legitfs',
license='MIT',
packages=find_packages(exclude=['tests']),
install_requires=['dulwich', 'fusepy', 'click', 'logbook'],
entry_points={
'console_scripts': [
'legitfs = legitfs.cli:main',
]
}
)
Change version to prevent unleash from choking.#!/usr/bin/env python
# coding=utf8
import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='legitfs',
version='0.3.dev1',
description='A read-only FUSE-based filesystem allowing you to browse '
'git repositories',
long_description=read('README.rst'),
keywords='git,fuse,filesystem,fs,read-only,readonly,legit,legitfs',
author='Marc Brinkmann',
author_email='git@marcbrinkmann.de',
url='http://github.com/mbr/legitfs',
license='MIT',
packages=find_packages(exclude=['tests']),
install_requires=['dulwich', 'fusepy', 'click', 'logbook'],
entry_points={
'console_scripts': [
'legitfs = legitfs.cli:main',
]
}
)
| <commit_before>#!/usr/bin/env python
# coding=utf8
import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='legitfs',
version='0.3dev',
description='A read-only FUSE-based filesystem allowing you to browse '
'git repositories',
long_description=read('README.rst'),
keywords='git,fuse,filesystem,fs,read-only,readonly,legit,legitfs',
author='Marc Brinkmann',
author_email='git@marcbrinkmann.de',
url='http://github.com/mbr/legitfs',
license='MIT',
packages=find_packages(exclude=['tests']),
install_requires=['dulwich', 'fusepy', 'click', 'logbook'],
entry_points={
'console_scripts': [
'legitfs = legitfs.cli:main',
]
}
)
<commit_msg>Change version to prevent unleash from choking.<commit_after>#!/usr/bin/env python
# coding=utf8
import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='legitfs',
version='0.3.dev1',
description='A read-only FUSE-based filesystem allowing you to browse '
'git repositories',
long_description=read('README.rst'),
keywords='git,fuse,filesystem,fs,read-only,readonly,legit,legitfs',
author='Marc Brinkmann',
author_email='git@marcbrinkmann.de',
url='http://github.com/mbr/legitfs',
license='MIT',
packages=find_packages(exclude=['tests']),
install_requires=['dulwich', 'fusepy', 'click', 'logbook'],
entry_points={
'console_scripts': [
'legitfs = legitfs.cli:main',
]
}
)
|
90c82f0936addeb4469db2c42c1cd48713e7f3cf | progress_logger.py | progress_logger.py | # Copyright Google
# BSD License
import copy
import wash
# from http://stackoverflow.com/questions/8924173/how-do-i-print-bold-text-in-python
class color:
PURPLE = '\033[95m'
CYAN = '\033[96m'
DARKCYAN = '\033[36m'
BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
END = '\033[0m'
class TermLogger(object):
def print_progress(self, lots, text, bold_lots):
lots = copy.copy(lots) # so I can re-sort non-destructively
print text
lots.sort(cmp=wash.cmp_by_buy_date)
bold_ids = [id(lot) for lot in bold_lots]
for lot in lots:
header = ''
footer = ''
if id(lot) in bold_ids:
header = color.BOLD
footer = color.END
print header + str(lot) + footer
raw_input('hit enter>')
class NullLogger(object):
def print_progress(self, lots, text, bold_lots):
pass
| # Copyright Google
# BSD License
import copy
import wash
# from http://stackoverflow.com/questions/8924173/how-do-i-print-bold-text-in-python
class color:
PURPLE = '\033[95m'
CYAN = '\033[96m'
DARKCYAN = '\033[36m'
BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
END = '\033[0m'
class TermLogger(object):
def print_progress(self, lots, text, red_lots):
lots = copy.copy(lots) # so I can re-sort non-destructively
print text
lots.sort(cmp=wash.cmp_by_buy_date)
red_ids = [id(lot) for lot in red_lots]
for lot in lots:
header = ''
footer = ''
if id(lot) in red_ids:
header = color.RED
footer = color.END
print header + str(lot) + footer
raw_input('hit enter>')
class NullLogger(object):
def print_progress(self, lots, text, red_lots):
pass
| Switch from bold to red highlighting. | Switch from bold to red highlighting.
With many terminal fonts bold is subtle. The red is much more clear.
| Python | bsd-2-clause | adlr/wash-sale-calculator | # Copyright Google
# BSD License
import copy
import wash
# from http://stackoverflow.com/questions/8924173/how-do-i-print-bold-text-in-python
class color:
PURPLE = '\033[95m'
CYAN = '\033[96m'
DARKCYAN = '\033[36m'
BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
END = '\033[0m'
class TermLogger(object):
def print_progress(self, lots, text, bold_lots):
lots = copy.copy(lots) # so I can re-sort non-destructively
print text
lots.sort(cmp=wash.cmp_by_buy_date)
bold_ids = [id(lot) for lot in bold_lots]
for lot in lots:
header = ''
footer = ''
if id(lot) in bold_ids:
header = color.BOLD
footer = color.END
print header + str(lot) + footer
raw_input('hit enter>')
class NullLogger(object):
def print_progress(self, lots, text, bold_lots):
pass
Switch from bold to red highlighting.
With many terminal fonts bold is subtle. The red is much more clear. | # Copyright Google
# BSD License
import copy
import wash
# from http://stackoverflow.com/questions/8924173/how-do-i-print-bold-text-in-python
class color:
PURPLE = '\033[95m'
CYAN = '\033[96m'
DARKCYAN = '\033[36m'
BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
END = '\033[0m'
class TermLogger(object):
def print_progress(self, lots, text, red_lots):
lots = copy.copy(lots) # so I can re-sort non-destructively
print text
lots.sort(cmp=wash.cmp_by_buy_date)
red_ids = [id(lot) for lot in red_lots]
for lot in lots:
header = ''
footer = ''
if id(lot) in red_ids:
header = color.RED
footer = color.END
print header + str(lot) + footer
raw_input('hit enter>')
class NullLogger(object):
def print_progress(self, lots, text, red_lots):
pass
| <commit_before># Copyright Google
# BSD License
import copy
import wash
# from http://stackoverflow.com/questions/8924173/how-do-i-print-bold-text-in-python
class color:
PURPLE = '\033[95m'
CYAN = '\033[96m'
DARKCYAN = '\033[36m'
BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
END = '\033[0m'
class TermLogger(object):
def print_progress(self, lots, text, bold_lots):
lots = copy.copy(lots) # so I can re-sort non-destructively
print text
lots.sort(cmp=wash.cmp_by_buy_date)
bold_ids = [id(lot) for lot in bold_lots]
for lot in lots:
header = ''
footer = ''
if id(lot) in bold_ids:
header = color.BOLD
footer = color.END
print header + str(lot) + footer
raw_input('hit enter>')
class NullLogger(object):
def print_progress(self, lots, text, bold_lots):
pass
<commit_msg>Switch from bold to red highlighting.
With many terminal fonts bold is subtle. The red is much more clear.<commit_after> | # Copyright Google
# BSD License
import copy
import wash
# from http://stackoverflow.com/questions/8924173/how-do-i-print-bold-text-in-python
class color:
PURPLE = '\033[95m'
CYAN = '\033[96m'
DARKCYAN = '\033[36m'
BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
END = '\033[0m'
class TermLogger(object):
def print_progress(self, lots, text, red_lots):
lots = copy.copy(lots) # so I can re-sort non-destructively
print text
lots.sort(cmp=wash.cmp_by_buy_date)
red_ids = [id(lot) for lot in red_lots]
for lot in lots:
header = ''
footer = ''
if id(lot) in red_ids:
header = color.RED
footer = color.END
print header + str(lot) + footer
raw_input('hit enter>')
class NullLogger(object):
def print_progress(self, lots, text, red_lots):
pass
| # Copyright Google
# BSD License
import copy
import wash
# from http://stackoverflow.com/questions/8924173/how-do-i-print-bold-text-in-python
class color:
PURPLE = '\033[95m'
CYAN = '\033[96m'
DARKCYAN = '\033[36m'
BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
END = '\033[0m'
class TermLogger(object):
def print_progress(self, lots, text, bold_lots):
lots = copy.copy(lots) # so I can re-sort non-destructively
print text
lots.sort(cmp=wash.cmp_by_buy_date)
bold_ids = [id(lot) for lot in bold_lots]
for lot in lots:
header = ''
footer = ''
if id(lot) in bold_ids:
header = color.BOLD
footer = color.END
print header + str(lot) + footer
raw_input('hit enter>')
class NullLogger(object):
def print_progress(self, lots, text, bold_lots):
pass
Switch from bold to red highlighting.
With many terminal fonts bold is subtle. The red is much more clear.# Copyright Google
# BSD License
import copy
import wash
# from http://stackoverflow.com/questions/8924173/how-do-i-print-bold-text-in-python
class color:
PURPLE = '\033[95m'
CYAN = '\033[96m'
DARKCYAN = '\033[36m'
BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
END = '\033[0m'
class TermLogger(object):
def print_progress(self, lots, text, red_lots):
lots = copy.copy(lots) # so I can re-sort non-destructively
print text
lots.sort(cmp=wash.cmp_by_buy_date)
red_ids = [id(lot) for lot in red_lots]
for lot in lots:
header = ''
footer = ''
if id(lot) in red_ids:
header = color.RED
footer = color.END
print header + str(lot) + footer
raw_input('hit enter>')
class NullLogger(object):
def print_progress(self, lots, text, red_lots):
pass
| <commit_before># Copyright Google
# BSD License
import copy
import wash
# from http://stackoverflow.com/questions/8924173/how-do-i-print-bold-text-in-python
class color:
PURPLE = '\033[95m'
CYAN = '\033[96m'
DARKCYAN = '\033[36m'
BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
END = '\033[0m'
class TermLogger(object):
def print_progress(self, lots, text, bold_lots):
lots = copy.copy(lots) # so I can re-sort non-destructively
print text
lots.sort(cmp=wash.cmp_by_buy_date)
bold_ids = [id(lot) for lot in bold_lots]
for lot in lots:
header = ''
footer = ''
if id(lot) in bold_ids:
header = color.BOLD
footer = color.END
print header + str(lot) + footer
raw_input('hit enter>')
class NullLogger(object):
def print_progress(self, lots, text, bold_lots):
pass
<commit_msg>Switch from bold to red highlighting.
With many terminal fonts bold is subtle. The red is much more clear.<commit_after># Copyright Google
# BSD License
import copy
import wash
# from http://stackoverflow.com/questions/8924173/how-do-i-print-bold-text-in-python
class color:
PURPLE = '\033[95m'
CYAN = '\033[96m'
DARKCYAN = '\033[36m'
BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
END = '\033[0m'
class TermLogger(object):
def print_progress(self, lots, text, red_lots):
lots = copy.copy(lots) # so I can re-sort non-destructively
print text
lots.sort(cmp=wash.cmp_by_buy_date)
red_ids = [id(lot) for lot in red_lots]
for lot in lots:
header = ''
footer = ''
if id(lot) in red_ids:
header = color.RED
footer = color.END
print header + str(lot) + footer
raw_input('hit enter>')
class NullLogger(object):
def print_progress(self, lots, text, red_lots):
pass
|
8f815c41b505c01cbc1c57088ddc3a465f1ac07c | fmn/web/default_config.py | fmn/web/default_config.py | SECRET_KEY = 'changeme please'
# TODO -- May I set this to true?
FAS_OPENID_CHECK_CERT = False
#ADMIN_GROUPS = ['sysadmin-web']
| SECRET_KEY = 'changeme please'
# TODO -- May I set this to true?
FAS_OPENID_CHECK_CERT = False
#ADMIN_GROUPS = ['sysadmin-web']
FMN_FEDORA_OPENID = 'https://id.fedoraproject.org'
| Add a configuration key for the URL of the Fedora OpenID server | Add a configuration key for the URL of the Fedora OpenID server | Python | lgpl-2.1 | jeremycline/fmn,jeremycline/fmn,jeremycline/fmn | SECRET_KEY = 'changeme please'
# TODO -- May I set this to true?
FAS_OPENID_CHECK_CERT = False
#ADMIN_GROUPS = ['sysadmin-web']
Add a configuration key for the URL of the Fedora OpenID server | SECRET_KEY = 'changeme please'
# TODO -- May I set this to true?
FAS_OPENID_CHECK_CERT = False
#ADMIN_GROUPS = ['sysadmin-web']
FMN_FEDORA_OPENID = 'https://id.fedoraproject.org'
| <commit_before>SECRET_KEY = 'changeme please'
# TODO -- May I set this to true?
FAS_OPENID_CHECK_CERT = False
#ADMIN_GROUPS = ['sysadmin-web']
<commit_msg>Add a configuration key for the URL of the Fedora OpenID server<commit_after> | SECRET_KEY = 'changeme please'
# TODO -- May I set this to true?
FAS_OPENID_CHECK_CERT = False
#ADMIN_GROUPS = ['sysadmin-web']
FMN_FEDORA_OPENID = 'https://id.fedoraproject.org'
| SECRET_KEY = 'changeme please'
# TODO -- May I set this to true?
FAS_OPENID_CHECK_CERT = False
#ADMIN_GROUPS = ['sysadmin-web']
Add a configuration key for the URL of the Fedora OpenID serverSECRET_KEY = 'changeme please'
# TODO -- May I set this to true?
FAS_OPENID_CHECK_CERT = False
#ADMIN_GROUPS = ['sysadmin-web']
FMN_FEDORA_OPENID = 'https://id.fedoraproject.org'
| <commit_before>SECRET_KEY = 'changeme please'
# TODO -- May I set this to true?
FAS_OPENID_CHECK_CERT = False
#ADMIN_GROUPS = ['sysadmin-web']
<commit_msg>Add a configuration key for the URL of the Fedora OpenID server<commit_after>SECRET_KEY = 'changeme please'
# TODO -- May I set this to true?
FAS_OPENID_CHECK_CERT = False
#ADMIN_GROUPS = ['sysadmin-web']
FMN_FEDORA_OPENID = 'https://id.fedoraproject.org'
|
c0c3d63c6124549008a2dc17c1e691e799129444 | plex2myshows/modules/plex/plex.py | plex2myshows/modules/plex/plex.py | class Plex(object):
def __init__(self, plex):
self.plex = plex
def get_watched_episodes(self, section_name):
watched_episodes = set(self.plex.library.section(section_name).searchEpisodes(unwatched=False))
return watched_episodes
| class Plex(object):
def __init__(self, plex):
self.plex = plex
def get_watched_episodes(self, section_name):
watched_episodes = []
shows = self.plex.library.section(section_name).searchShows()
for show in shows:
watched_episodes.extend(show.watched())
return watched_episodes
| Fix getting unwatched episodes from Plex | Fix getting unwatched episodes from Plex
| Python | mit | verdel/plex2myshows | class Plex(object):
def __init__(self, plex):
self.plex = plex
def get_watched_episodes(self, section_name):
watched_episodes = set(self.plex.library.section(section_name).searchEpisodes(unwatched=False))
return watched_episodes
Fix getting unwatched episodes from Plex | class Plex(object):
def __init__(self, plex):
self.plex = plex
def get_watched_episodes(self, section_name):
watched_episodes = []
shows = self.plex.library.section(section_name).searchShows()
for show in shows:
watched_episodes.extend(show.watched())
return watched_episodes
| <commit_before>class Plex(object):
def __init__(self, plex):
self.plex = plex
def get_watched_episodes(self, section_name):
watched_episodes = set(self.plex.library.section(section_name).searchEpisodes(unwatched=False))
return watched_episodes
<commit_msg>Fix getting unwatched episodes from Plex<commit_after> | class Plex(object):
def __init__(self, plex):
self.plex = plex
def get_watched_episodes(self, section_name):
watched_episodes = []
shows = self.plex.library.section(section_name).searchShows()
for show in shows:
watched_episodes.extend(show.watched())
return watched_episodes
| class Plex(object):
def __init__(self, plex):
self.plex = plex
def get_watched_episodes(self, section_name):
watched_episodes = set(self.plex.library.section(section_name).searchEpisodes(unwatched=False))
return watched_episodes
Fix getting unwatched episodes from Plexclass Plex(object):
def __init__(self, plex):
self.plex = plex
def get_watched_episodes(self, section_name):
watched_episodes = []
shows = self.plex.library.section(section_name).searchShows()
for show in shows:
watched_episodes.extend(show.watched())
return watched_episodes
| <commit_before>class Plex(object):
def __init__(self, plex):
self.plex = plex
def get_watched_episodes(self, section_name):
watched_episodes = set(self.plex.library.section(section_name).searchEpisodes(unwatched=False))
return watched_episodes
<commit_msg>Fix getting unwatched episodes from Plex<commit_after>class Plex(object):
def __init__(self, plex):
self.plex = plex
def get_watched_episodes(self, section_name):
watched_episodes = []
shows = self.plex.library.section(section_name).searchShows()
for show in shows:
watched_episodes.extend(show.watched())
return watched_episodes
|
b34c8b94202294f63ff88d2d8085222bfa50dc46 | candidates/csv_helpers.py | candidates/csv_helpers.py | from __future__ import unicode_literals
from compat import BufferDictWriter
from .models import CSV_ROW_FIELDS
def _candidate_sort_by_name_key(row):
return (
row['name'].split()[-1],
not row['election_current'],
row['election_date'],
row['election'],
row['post_label']
)
def _candidate_sort_by_post_key(row):
return (
not row['election_current'],
row['election_date'],
row['election'],
row['post_label'],
row['name'].split()[-1])
def list_to_csv(candidates_list, group_by_post=False):
from .election_specific import EXTRA_CSV_ROW_FIELDS
csv_fields = CSV_ROW_FIELDS + EXTRA_CSV_ROW_FIELDS
writer = BufferDictWriter(fieldnames=csv_fields)
writer.writeheader()
if group_by_post:
sorted_rows = sorted(candidates_list, key=_candidate_sort_by_post_key)
else:
sorted_rows = sorted(candidates_list, key=_candidate_sort_by_name_key)
for row in sorted_rows:
writer.writerow(row)
return writer.output
| from __future__ import unicode_literals
from compat import BufferDictWriter
from .models import CSV_ROW_FIELDS
def _candidate_sort_by_name_key(row):
return (
row['name'].split()[-1],
row['name'].rsplit(None, 1)[0],
not row['election_current'],
row['election_date'],
row['election'],
row['post_label']
)
def _candidate_sort_by_post_key(row):
return (
not row['election_current'],
row['election_date'],
row['election'],
row['post_label'],
row['name'].split()[-1],
row['name'].rsplit(None, 1)[0],
)
def list_to_csv(candidates_list, group_by_post=False):
from .election_specific import EXTRA_CSV_ROW_FIELDS
csv_fields = CSV_ROW_FIELDS + EXTRA_CSV_ROW_FIELDS
writer = BufferDictWriter(fieldnames=csv_fields)
writer.writeheader()
if group_by_post:
sorted_rows = sorted(candidates_list, key=_candidate_sort_by_post_key)
else:
sorted_rows = sorted(candidates_list, key=_candidate_sort_by_name_key)
for row in sorted_rows:
writer.writerow(row)
return writer.output
| Sort on first name after last name | Sort on first name after last name
| Python | agpl-3.0 | DemocracyClub/yournextrepresentative,DemocracyClub/yournextrepresentative,DemocracyClub/yournextrepresentative | from __future__ import unicode_literals
from compat import BufferDictWriter
from .models import CSV_ROW_FIELDS
def _candidate_sort_by_name_key(row):
return (
row['name'].split()[-1],
not row['election_current'],
row['election_date'],
row['election'],
row['post_label']
)
def _candidate_sort_by_post_key(row):
return (
not row['election_current'],
row['election_date'],
row['election'],
row['post_label'],
row['name'].split()[-1])
def list_to_csv(candidates_list, group_by_post=False):
from .election_specific import EXTRA_CSV_ROW_FIELDS
csv_fields = CSV_ROW_FIELDS + EXTRA_CSV_ROW_FIELDS
writer = BufferDictWriter(fieldnames=csv_fields)
writer.writeheader()
if group_by_post:
sorted_rows = sorted(candidates_list, key=_candidate_sort_by_post_key)
else:
sorted_rows = sorted(candidates_list, key=_candidate_sort_by_name_key)
for row in sorted_rows:
writer.writerow(row)
return writer.output
Sort on first name after last name | from __future__ import unicode_literals
from compat import BufferDictWriter
from .models import CSV_ROW_FIELDS
def _candidate_sort_by_name_key(row):
return (
row['name'].split()[-1],
row['name'].rsplit(None, 1)[0],
not row['election_current'],
row['election_date'],
row['election'],
row['post_label']
)
def _candidate_sort_by_post_key(row):
return (
not row['election_current'],
row['election_date'],
row['election'],
row['post_label'],
row['name'].split()[-1],
row['name'].rsplit(None, 1)[0],
)
def list_to_csv(candidates_list, group_by_post=False):
from .election_specific import EXTRA_CSV_ROW_FIELDS
csv_fields = CSV_ROW_FIELDS + EXTRA_CSV_ROW_FIELDS
writer = BufferDictWriter(fieldnames=csv_fields)
writer.writeheader()
if group_by_post:
sorted_rows = sorted(candidates_list, key=_candidate_sort_by_post_key)
else:
sorted_rows = sorted(candidates_list, key=_candidate_sort_by_name_key)
for row in sorted_rows:
writer.writerow(row)
return writer.output
| <commit_before>from __future__ import unicode_literals
from compat import BufferDictWriter
from .models import CSV_ROW_FIELDS
def _candidate_sort_by_name_key(row):
return (
row['name'].split()[-1],
not row['election_current'],
row['election_date'],
row['election'],
row['post_label']
)
def _candidate_sort_by_post_key(row):
return (
not row['election_current'],
row['election_date'],
row['election'],
row['post_label'],
row['name'].split()[-1])
def list_to_csv(candidates_list, group_by_post=False):
from .election_specific import EXTRA_CSV_ROW_FIELDS
csv_fields = CSV_ROW_FIELDS + EXTRA_CSV_ROW_FIELDS
writer = BufferDictWriter(fieldnames=csv_fields)
writer.writeheader()
if group_by_post:
sorted_rows = sorted(candidates_list, key=_candidate_sort_by_post_key)
else:
sorted_rows = sorted(candidates_list, key=_candidate_sort_by_name_key)
for row in sorted_rows:
writer.writerow(row)
return writer.output
<commit_msg>Sort on first name after last name<commit_after> | from __future__ import unicode_literals
from compat import BufferDictWriter
from .models import CSV_ROW_FIELDS
def _candidate_sort_by_name_key(row):
return (
row['name'].split()[-1],
row['name'].rsplit(None, 1)[0],
not row['election_current'],
row['election_date'],
row['election'],
row['post_label']
)
def _candidate_sort_by_post_key(row):
return (
not row['election_current'],
row['election_date'],
row['election'],
row['post_label'],
row['name'].split()[-1],
row['name'].rsplit(None, 1)[0],
)
def list_to_csv(candidates_list, group_by_post=False):
from .election_specific import EXTRA_CSV_ROW_FIELDS
csv_fields = CSV_ROW_FIELDS + EXTRA_CSV_ROW_FIELDS
writer = BufferDictWriter(fieldnames=csv_fields)
writer.writeheader()
if group_by_post:
sorted_rows = sorted(candidates_list, key=_candidate_sort_by_post_key)
else:
sorted_rows = sorted(candidates_list, key=_candidate_sort_by_name_key)
for row in sorted_rows:
writer.writerow(row)
return writer.output
| from __future__ import unicode_literals
from compat import BufferDictWriter
from .models import CSV_ROW_FIELDS
def _candidate_sort_by_name_key(row):
return (
row['name'].split()[-1],
not row['election_current'],
row['election_date'],
row['election'],
row['post_label']
)
def _candidate_sort_by_post_key(row):
return (
not row['election_current'],
row['election_date'],
row['election'],
row['post_label'],
row['name'].split()[-1])
def list_to_csv(candidates_list, group_by_post=False):
from .election_specific import EXTRA_CSV_ROW_FIELDS
csv_fields = CSV_ROW_FIELDS + EXTRA_CSV_ROW_FIELDS
writer = BufferDictWriter(fieldnames=csv_fields)
writer.writeheader()
if group_by_post:
sorted_rows = sorted(candidates_list, key=_candidate_sort_by_post_key)
else:
sorted_rows = sorted(candidates_list, key=_candidate_sort_by_name_key)
for row in sorted_rows:
writer.writerow(row)
return writer.output
Sort on first name after last namefrom __future__ import unicode_literals
from compat import BufferDictWriter
from .models import CSV_ROW_FIELDS
def _candidate_sort_by_name_key(row):
return (
row['name'].split()[-1],
row['name'].rsplit(None, 1)[0],
not row['election_current'],
row['election_date'],
row['election'],
row['post_label']
)
def _candidate_sort_by_post_key(row):
return (
not row['election_current'],
row['election_date'],
row['election'],
row['post_label'],
row['name'].split()[-1],
row['name'].rsplit(None, 1)[0],
)
def list_to_csv(candidates_list, group_by_post=False):
from .election_specific import EXTRA_CSV_ROW_FIELDS
csv_fields = CSV_ROW_FIELDS + EXTRA_CSV_ROW_FIELDS
writer = BufferDictWriter(fieldnames=csv_fields)
writer.writeheader()
if group_by_post:
sorted_rows = sorted(candidates_list, key=_candidate_sort_by_post_key)
else:
sorted_rows = sorted(candidates_list, key=_candidate_sort_by_name_key)
for row in sorted_rows:
writer.writerow(row)
return writer.output
| <commit_before>from __future__ import unicode_literals
from compat import BufferDictWriter
from .models import CSV_ROW_FIELDS
def _candidate_sort_by_name_key(row):
return (
row['name'].split()[-1],
not row['election_current'],
row['election_date'],
row['election'],
row['post_label']
)
def _candidate_sort_by_post_key(row):
return (
not row['election_current'],
row['election_date'],
row['election'],
row['post_label'],
row['name'].split()[-1])
def list_to_csv(candidates_list, group_by_post=False):
from .election_specific import EXTRA_CSV_ROW_FIELDS
csv_fields = CSV_ROW_FIELDS + EXTRA_CSV_ROW_FIELDS
writer = BufferDictWriter(fieldnames=csv_fields)
writer.writeheader()
if group_by_post:
sorted_rows = sorted(candidates_list, key=_candidate_sort_by_post_key)
else:
sorted_rows = sorted(candidates_list, key=_candidate_sort_by_name_key)
for row in sorted_rows:
writer.writerow(row)
return writer.output
<commit_msg>Sort on first name after last name<commit_after>from __future__ import unicode_literals
from compat import BufferDictWriter
from .models import CSV_ROW_FIELDS
def _candidate_sort_by_name_key(row):
return (
row['name'].split()[-1],
row['name'].rsplit(None, 1)[0],
not row['election_current'],
row['election_date'],
row['election'],
row['post_label']
)
def _candidate_sort_by_post_key(row):
return (
not row['election_current'],
row['election_date'],
row['election'],
row['post_label'],
row['name'].split()[-1],
row['name'].rsplit(None, 1)[0],
)
def list_to_csv(candidates_list, group_by_post=False):
from .election_specific import EXTRA_CSV_ROW_FIELDS
csv_fields = CSV_ROW_FIELDS + EXTRA_CSV_ROW_FIELDS
writer = BufferDictWriter(fieldnames=csv_fields)
writer.writeheader()
if group_by_post:
sorted_rows = sorted(candidates_list, key=_candidate_sort_by_post_key)
else:
sorted_rows = sorted(candidates_list, key=_candidate_sort_by_name_key)
for row in sorted_rows:
writer.writerow(row)
return writer.output
|
0ed07211d62044a42e1b0ff024f8feb20435270d | pombola/south_africa/views/api.py | pombola/south_africa/views/api.py | from django.http import JsonResponse
from django.views.generic import ListView
from pombola.core.models import Organisation
# Output Popolo JSON suitable for WriteInPublic for any committees that have an
# email address.
class CommitteesPopoloJson(ListView):
queryset = Organisation.objects.filter(
kind__name='National Assembly Committees',
contacts__kind__slug='email'
)
def render_to_response(self, context, **response_kwargs):
return JsonResponse(
{
'persons': [
{
'id': committee.id,
'name': committee.name,
'email': committee.contacts.filter(kind__slug='email')[0].value,
'contact_details': []
}
for committee in context['object_list']
]
}
)
| from django.http import JsonResponse
from django.views.generic import ListView
from pombola.core.models import Organisation
# Output Popolo JSON suitable for WriteInPublic for any committees that have an
# email address.
class CommitteesPopoloJson(ListView):
queryset = Organisation.objects.filter(
kind__name='National Assembly Committees',
contacts__kind__slug='email'
)
def render_to_response(self, context, **response_kwargs):
return JsonResponse(
{
'persons': [
{
'id': str(committee.id),
'name': committee.name,
'email': committee.contacts.filter(kind__slug='email')[0].value,
'contact_details': []
}
for committee in context['object_list']
]
}
)
| Use strings for IDs in Committee Popolo | Use strings for IDs in Committee Popolo
| Python | agpl-3.0 | mysociety/pombola,mysociety/pombola,mysociety/pombola,mysociety/pombola,mysociety/pombola,mysociety/pombola | from django.http import JsonResponse
from django.views.generic import ListView
from pombola.core.models import Organisation
# Output Popolo JSON suitable for WriteInPublic for any committees that have an
# email address.
class CommitteesPopoloJson(ListView):
queryset = Organisation.objects.filter(
kind__name='National Assembly Committees',
contacts__kind__slug='email'
)
def render_to_response(self, context, **response_kwargs):
return JsonResponse(
{
'persons': [
{
'id': committee.id,
'name': committee.name,
'email': committee.contacts.filter(kind__slug='email')[0].value,
'contact_details': []
}
for committee in context['object_list']
]
}
)
Use strings for IDs in Committee Popolo | from django.http import JsonResponse
from django.views.generic import ListView
from pombola.core.models import Organisation
# Output Popolo JSON suitable for WriteInPublic for any committees that have an
# email address.
class CommitteesPopoloJson(ListView):
queryset = Organisation.objects.filter(
kind__name='National Assembly Committees',
contacts__kind__slug='email'
)
def render_to_response(self, context, **response_kwargs):
return JsonResponse(
{
'persons': [
{
'id': str(committee.id),
'name': committee.name,
'email': committee.contacts.filter(kind__slug='email')[0].value,
'contact_details': []
}
for committee in context['object_list']
]
}
)
| <commit_before>from django.http import JsonResponse
from django.views.generic import ListView
from pombola.core.models import Organisation
# Output Popolo JSON suitable for WriteInPublic for any committees that have an
# email address.
class CommitteesPopoloJson(ListView):
queryset = Organisation.objects.filter(
kind__name='National Assembly Committees',
contacts__kind__slug='email'
)
def render_to_response(self, context, **response_kwargs):
return JsonResponse(
{
'persons': [
{
'id': committee.id,
'name': committee.name,
'email': committee.contacts.filter(kind__slug='email')[0].value,
'contact_details': []
}
for committee in context['object_list']
]
}
)
<commit_msg>Use strings for IDs in Committee Popolo<commit_after> | from django.http import JsonResponse
from django.views.generic import ListView
from pombola.core.models import Organisation
# Output Popolo JSON suitable for WriteInPublic for any committees that have an
# email address.
class CommitteesPopoloJson(ListView):
queryset = Organisation.objects.filter(
kind__name='National Assembly Committees',
contacts__kind__slug='email'
)
def render_to_response(self, context, **response_kwargs):
return JsonResponse(
{
'persons': [
{
'id': str(committee.id),
'name': committee.name,
'email': committee.contacts.filter(kind__slug='email')[0].value,
'contact_details': []
}
for committee in context['object_list']
]
}
)
| from django.http import JsonResponse
from django.views.generic import ListView
from pombola.core.models import Organisation
# Output Popolo JSON suitable for WriteInPublic for any committees that have an
# email address.
class CommitteesPopoloJson(ListView):
queryset = Organisation.objects.filter(
kind__name='National Assembly Committees',
contacts__kind__slug='email'
)
def render_to_response(self, context, **response_kwargs):
return JsonResponse(
{
'persons': [
{
'id': committee.id,
'name': committee.name,
'email': committee.contacts.filter(kind__slug='email')[0].value,
'contact_details': []
}
for committee in context['object_list']
]
}
)
Use strings for IDs in Committee Popolofrom django.http import JsonResponse
from django.views.generic import ListView
from pombola.core.models import Organisation
# Output Popolo JSON suitable for WriteInPublic for any committees that have an
# email address.
class CommitteesPopoloJson(ListView):
queryset = Organisation.objects.filter(
kind__name='National Assembly Committees',
contacts__kind__slug='email'
)
def render_to_response(self, context, **response_kwargs):
return JsonResponse(
{
'persons': [
{
'id': str(committee.id),
'name': committee.name,
'email': committee.contacts.filter(kind__slug='email')[0].value,
'contact_details': []
}
for committee in context['object_list']
]
}
)
| <commit_before>from django.http import JsonResponse
from django.views.generic import ListView
from pombola.core.models import Organisation
# Output Popolo JSON suitable for WriteInPublic for any committees that have an
# email address.
class CommitteesPopoloJson(ListView):
queryset = Organisation.objects.filter(
kind__name='National Assembly Committees',
contacts__kind__slug='email'
)
def render_to_response(self, context, **response_kwargs):
return JsonResponse(
{
'persons': [
{
'id': committee.id,
'name': committee.name,
'email': committee.contacts.filter(kind__slug='email')[0].value,
'contact_details': []
}
for committee in context['object_list']
]
}
)
<commit_msg>Use strings for IDs in Committee Popolo<commit_after>from django.http import JsonResponse
from django.views.generic import ListView
from pombola.core.models import Organisation
# Output Popolo JSON suitable for WriteInPublic for any committees that have an
# email address.
class CommitteesPopoloJson(ListView):
queryset = Organisation.objects.filter(
kind__name='National Assembly Committees',
contacts__kind__slug='email'
)
def render_to_response(self, context, **response_kwargs):
return JsonResponse(
{
'persons': [
{
'id': str(committee.id),
'name': committee.name,
'email': committee.contacts.filter(kind__slug='email')[0].value,
'contact_details': []
}
for committee in context['object_list']
]
}
)
|
1a18445482c67b38810e330065e5ff04e772af4a | foundation/letters/migrations/0009_auto_20151216_0656.py | foundation/letters/migrations/0009_auto_20151216_0656.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
def split_models(apps, schema_editor):
# We can't import the Person model directly as it may be a newer
# version than this migration expects. We use the historical version.
L = apps.get_model("letters", "Letter")
OL = apps.get_model("letters", "OutgoingLetter")
IL = apps.get_model("letters", "IncomingLetter")
for letter in L.objects.filter(incoming=True).all():
IL.objects.create(parent=letter,
temp_from_email=letter.email,
temp_sender=letter.sender_office)
for letter in L.objects.filter(incoming=False).all():
OL.objects.create(parent=letter,
temp_send_at=letter.send_at,
temp_sender=letter.sender_user,
temp_author=letter.author,
temp_email=letter.email)
class Migration(migrations.Migration):
dependencies = [
('letters', '0008_auto_20151216_0647'),
]
operations = [
migrations.RunPython(split_models),
]
| # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
def split_models(apps, schema_editor):
# We can't import the Person model directly as it may be a newer
# version than this migration expects. We use the historical version.
L = apps.get_model("letters", "Letter")
OL = apps.get_model("letters", "OutgoingLetter")
IL = apps.get_model("letters", "IncomingLetter")
for letter in L.objects.filter(incoming=True).all():
IL.objects.create(parent=letter,
temp_email=letter.email,
temp_sender=letter.sender_office)
for letter in L.objects.filter(incoming=False).all():
OL.objects.create(parent=letter,
temp_send_at=letter.send_at,
temp_sender=letter.sender_user,
temp_author=letter.author,
temp_email=letter.email)
class Migration(migrations.Migration):
dependencies = [
('letters', '0008_auto_20151216_0647'),
]
operations = [
migrations.RunPython(split_models),
]
| Fix from_email in IncomingLetter migrations | Fix from_email in IncomingLetter migrations
| Python | bsd-3-clause | ad-m/foundation-manager,pilnujemy/pytamy,pilnujemy/pytamy,pilnujemy/pytamy,ad-m/foundation-manager,ad-m/foundation-manager,pilnujemy/pytamy,ad-m/foundation-manager | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
def split_models(apps, schema_editor):
# We can't import the Person model directly as it may be a newer
# version than this migration expects. We use the historical version.
L = apps.get_model("letters", "Letter")
OL = apps.get_model("letters", "OutgoingLetter")
IL = apps.get_model("letters", "IncomingLetter")
for letter in L.objects.filter(incoming=True).all():
IL.objects.create(parent=letter,
temp_from_email=letter.email,
temp_sender=letter.sender_office)
for letter in L.objects.filter(incoming=False).all():
OL.objects.create(parent=letter,
temp_send_at=letter.send_at,
temp_sender=letter.sender_user,
temp_author=letter.author,
temp_email=letter.email)
class Migration(migrations.Migration):
dependencies = [
('letters', '0008_auto_20151216_0647'),
]
operations = [
migrations.RunPython(split_models),
]
Fix from_email in IncomingLetter migrations | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
def split_models(apps, schema_editor):
# We can't import the Person model directly as it may be a newer
# version than this migration expects. We use the historical version.
L = apps.get_model("letters", "Letter")
OL = apps.get_model("letters", "OutgoingLetter")
IL = apps.get_model("letters", "IncomingLetter")
for letter in L.objects.filter(incoming=True).all():
IL.objects.create(parent=letter,
temp_email=letter.email,
temp_sender=letter.sender_office)
for letter in L.objects.filter(incoming=False).all():
OL.objects.create(parent=letter,
temp_send_at=letter.send_at,
temp_sender=letter.sender_user,
temp_author=letter.author,
temp_email=letter.email)
class Migration(migrations.Migration):
dependencies = [
('letters', '0008_auto_20151216_0647'),
]
operations = [
migrations.RunPython(split_models),
]
| <commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
def split_models(apps, schema_editor):
# We can't import the Person model directly as it may be a newer
# version than this migration expects. We use the historical version.
L = apps.get_model("letters", "Letter")
OL = apps.get_model("letters", "OutgoingLetter")
IL = apps.get_model("letters", "IncomingLetter")
for letter in L.objects.filter(incoming=True).all():
IL.objects.create(parent=letter,
temp_from_email=letter.email,
temp_sender=letter.sender_office)
for letter in L.objects.filter(incoming=False).all():
OL.objects.create(parent=letter,
temp_send_at=letter.send_at,
temp_sender=letter.sender_user,
temp_author=letter.author,
temp_email=letter.email)
class Migration(migrations.Migration):
dependencies = [
('letters', '0008_auto_20151216_0647'),
]
operations = [
migrations.RunPython(split_models),
]
<commit_msg>Fix from_email in IncomingLetter migrations<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
def split_models(apps, schema_editor):
# We can't import the Person model directly as it may be a newer
# version than this migration expects. We use the historical version.
L = apps.get_model("letters", "Letter")
OL = apps.get_model("letters", "OutgoingLetter")
IL = apps.get_model("letters", "IncomingLetter")
for letter in L.objects.filter(incoming=True).all():
IL.objects.create(parent=letter,
temp_email=letter.email,
temp_sender=letter.sender_office)
for letter in L.objects.filter(incoming=False).all():
OL.objects.create(parent=letter,
temp_send_at=letter.send_at,
temp_sender=letter.sender_user,
temp_author=letter.author,
temp_email=letter.email)
class Migration(migrations.Migration):
dependencies = [
('letters', '0008_auto_20151216_0647'),
]
operations = [
migrations.RunPython(split_models),
]
| # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
def split_models(apps, schema_editor):
# We can't import the Person model directly as it may be a newer
# version than this migration expects. We use the historical version.
L = apps.get_model("letters", "Letter")
OL = apps.get_model("letters", "OutgoingLetter")
IL = apps.get_model("letters", "IncomingLetter")
for letter in L.objects.filter(incoming=True).all():
IL.objects.create(parent=letter,
temp_from_email=letter.email,
temp_sender=letter.sender_office)
for letter in L.objects.filter(incoming=False).all():
OL.objects.create(parent=letter,
temp_send_at=letter.send_at,
temp_sender=letter.sender_user,
temp_author=letter.author,
temp_email=letter.email)
class Migration(migrations.Migration):
dependencies = [
('letters', '0008_auto_20151216_0647'),
]
operations = [
migrations.RunPython(split_models),
]
Fix from_email in IncomingLetter migrations# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
def split_models(apps, schema_editor):
# We can't import the Person model directly as it may be a newer
# version than this migration expects. We use the historical version.
L = apps.get_model("letters", "Letter")
OL = apps.get_model("letters", "OutgoingLetter")
IL = apps.get_model("letters", "IncomingLetter")
for letter in L.objects.filter(incoming=True).all():
IL.objects.create(parent=letter,
temp_email=letter.email,
temp_sender=letter.sender_office)
for letter in L.objects.filter(incoming=False).all():
OL.objects.create(parent=letter,
temp_send_at=letter.send_at,
temp_sender=letter.sender_user,
temp_author=letter.author,
temp_email=letter.email)
class Migration(migrations.Migration):
dependencies = [
('letters', '0008_auto_20151216_0647'),
]
operations = [
migrations.RunPython(split_models),
]
| <commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
def split_models(apps, schema_editor):
# We can't import the Person model directly as it may be a newer
# version than this migration expects. We use the historical version.
L = apps.get_model("letters", "Letter")
OL = apps.get_model("letters", "OutgoingLetter")
IL = apps.get_model("letters", "IncomingLetter")
for letter in L.objects.filter(incoming=True).all():
IL.objects.create(parent=letter,
temp_from_email=letter.email,
temp_sender=letter.sender_office)
for letter in L.objects.filter(incoming=False).all():
OL.objects.create(parent=letter,
temp_send_at=letter.send_at,
temp_sender=letter.sender_user,
temp_author=letter.author,
temp_email=letter.email)
class Migration(migrations.Migration):
dependencies = [
('letters', '0008_auto_20151216_0647'),
]
operations = [
migrations.RunPython(split_models),
]
<commit_msg>Fix from_email in IncomingLetter migrations<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
def split_models(apps, schema_editor):
# We can't import the Person model directly as it may be a newer
# version than this migration expects. We use the historical version.
L = apps.get_model("letters", "Letter")
OL = apps.get_model("letters", "OutgoingLetter")
IL = apps.get_model("letters", "IncomingLetter")
for letter in L.objects.filter(incoming=True).all():
IL.objects.create(parent=letter,
temp_email=letter.email,
temp_sender=letter.sender_office)
for letter in L.objects.filter(incoming=False).all():
OL.objects.create(parent=letter,
temp_send_at=letter.send_at,
temp_sender=letter.sender_user,
temp_author=letter.author,
temp_email=letter.email)
class Migration(migrations.Migration):
dependencies = [
('letters', '0008_auto_20151216_0647'),
]
operations = [
migrations.RunPython(split_models),
]
|
e47b7e5952d4001459aee5ba570a7cc6d4c10d43 | tests/unit/directory/test_directory.py | tests/unit/directory/test_directory.py | """Contains the unit tests for the inner directory package"""
import unittest
import os
from classyfd import Directory
class TestDirectory(unittest.TestCase):
def setUp(self):
self.fake_path = os.path.abspath("hello-world-dir")
return
def test_create_directory_object(self):
d = Directory(self.fake_path)
self.assertTrue(d)
return
if __name__ == "__main__":
unittest.main() | """Contains the unit tests for the inner directory package"""
import unittest
import os
from classyfd import Directory, InvalidDirectoryValueError
class TestDirectory(unittest.TestCase):
def setUp(self):
self.fake_path = os.path.abspath("hello-world-dir")
return
def test_create_directory_object(self):
d = Directory(self.fake_path)
self.assertTrue(d)
return
if __name__ == "__main__":
unittest.main() | Add import of the InvalidDirectoryValueError to the directory package's test file | Add import of the InvalidDirectoryValueError to the directory package's test file
| Python | mit | SizzlingVortex/classyfd | """Contains the unit tests for the inner directory package"""
import unittest
import os
from classyfd import Directory
class TestDirectory(unittest.TestCase):
def setUp(self):
self.fake_path = os.path.abspath("hello-world-dir")
return
def test_create_directory_object(self):
d = Directory(self.fake_path)
self.assertTrue(d)
return
if __name__ == "__main__":
unittest.main()Add import of the InvalidDirectoryValueError to the directory package's test file | """Contains the unit tests for the inner directory package"""
import unittest
import os
from classyfd import Directory, InvalidDirectoryValueError
class TestDirectory(unittest.TestCase):
def setUp(self):
self.fake_path = os.path.abspath("hello-world-dir")
return
def test_create_directory_object(self):
d = Directory(self.fake_path)
self.assertTrue(d)
return
if __name__ == "__main__":
unittest.main() | <commit_before>"""Contains the unit tests for the inner directory package"""
import unittest
import os
from classyfd import Directory
class TestDirectory(unittest.TestCase):
def setUp(self):
self.fake_path = os.path.abspath("hello-world-dir")
return
def test_create_directory_object(self):
d = Directory(self.fake_path)
self.assertTrue(d)
return
if __name__ == "__main__":
unittest.main()<commit_msg>Add import of the InvalidDirectoryValueError to the directory package's test file<commit_after> | """Contains the unit tests for the inner directory package"""
import unittest
import os
from classyfd import Directory, InvalidDirectoryValueError
class TestDirectory(unittest.TestCase):
def setUp(self):
self.fake_path = os.path.abspath("hello-world-dir")
return
def test_create_directory_object(self):
d = Directory(self.fake_path)
self.assertTrue(d)
return
if __name__ == "__main__":
unittest.main() | """Contains the unit tests for the inner directory package"""
import unittest
import os
from classyfd import Directory
class TestDirectory(unittest.TestCase):
def setUp(self):
self.fake_path = os.path.abspath("hello-world-dir")
return
def test_create_directory_object(self):
d = Directory(self.fake_path)
self.assertTrue(d)
return
if __name__ == "__main__":
unittest.main()Add import of the InvalidDirectoryValueError to the directory package's test file"""Contains the unit tests for the inner directory package"""
import unittest
import os
from classyfd import Directory, InvalidDirectoryValueError
class TestDirectory(unittest.TestCase):
def setUp(self):
self.fake_path = os.path.abspath("hello-world-dir")
return
def test_create_directory_object(self):
d = Directory(self.fake_path)
self.assertTrue(d)
return
if __name__ == "__main__":
unittest.main() | <commit_before>"""Contains the unit tests for the inner directory package"""
import unittest
import os
from classyfd import Directory
class TestDirectory(unittest.TestCase):
def setUp(self):
self.fake_path = os.path.abspath("hello-world-dir")
return
def test_create_directory_object(self):
d = Directory(self.fake_path)
self.assertTrue(d)
return
if __name__ == "__main__":
unittest.main()<commit_msg>Add import of the InvalidDirectoryValueError to the directory package's test file<commit_after>"""Contains the unit tests for the inner directory package"""
import unittest
import os
from classyfd import Directory, InvalidDirectoryValueError
class TestDirectory(unittest.TestCase):
def setUp(self):
self.fake_path = os.path.abspath("hello-world-dir")
return
def test_create_directory_object(self):
d = Directory(self.fake_path)
self.assertTrue(d)
return
if __name__ == "__main__":
unittest.main() |
4b7b2727a35cfcb0117b0ba4571da9a0ea81824a | greenmine/base/routers.py | greenmine/base/routers.py | # -*- coding: utf-8 -*-
from rest_framework import routers
# Special router for actions.
actions_router = routers.Route(url=r'^{prefix}/{methodname}{trailing_slash}$',
mapping={'{httpmethod}': '{methodname}'},
name='{basename}-{methodnamehyphen}',
initkwargs={})
class DefaultRouter(routers.DefaultRouter):
routes = [
routers.DefaultRouter.routes[0],
actions_router,
routers.DefaultRouter.routes[2],
routers.DefaultRouter.routes[1]
]
__all__ = ["DefaultRouter"]
| # -*- coding: utf-8 -*-
from rest_framework import routers
class DefaultRouter(routers.DefaultRouter):
pass
__all__ = ["DefaultRouter"]
| Remove old reimplementation of routes. | Remove old reimplementation of routes.
| Python | agpl-3.0 | joshisa/taiga-back,joshisa/taiga-back,gam-phon/taiga-back,bdang2012/taiga-back-casting,jeffdwyatt/taiga-back,rajiteh/taiga-back,crr0004/taiga-back,crr0004/taiga-back,EvgeneOskin/taiga-back,dayatz/taiga-back,Rademade/taiga-back,joshisa/taiga-back,Rademade/taiga-back,astronaut1712/taiga-back,forging2012/taiga-back,coopsource/taiga-back,dycodedev/taiga-back,frt-arch/taiga-back,astagi/taiga-back,Rademade/taiga-back,astronaut1712/taiga-back,astagi/taiga-back,seanchen/taiga-back,Tigerwhit4/taiga-back,seanchen/taiga-back,dayatz/taiga-back,taigaio/taiga-back,Tigerwhit4/taiga-back,gauravjns/taiga-back,jeffdwyatt/taiga-back,EvgeneOskin/taiga-back,joshisa/taiga-back,forging2012/taiga-back,Zaneh-/bearded-tribble-back,obimod/taiga-back,forging2012/taiga-back,Tigerwhit4/taiga-back,gauravjns/taiga-back,gam-phon/taiga-back,taigaio/taiga-back,obimod/taiga-back,astronaut1712/taiga-back,rajiteh/taiga-back,gauravjns/taiga-back,gam-phon/taiga-back,coopsource/taiga-back,WALR/taiga-back,Zaneh-/bearded-tribble-back,Zaneh-/bearded-tribble-back,jeffdwyatt/taiga-back,jeffdwyatt/taiga-back,xdevelsistemas/taiga-back-community,gauravjns/taiga-back,astagi/taiga-back,CoolCloud/taiga-back,obimod/taiga-back,bdang2012/taiga-back-casting,CoolCloud/taiga-back,seanchen/taiga-back,Rademade/taiga-back,Tigerwhit4/taiga-back,coopsource/taiga-back,dycodedev/taiga-back,crr0004/taiga-back,rajiteh/taiga-back,CMLL/taiga-back,CMLL/taiga-back,xdevelsistemas/taiga-back-community,CoolCloud/taiga-back,CMLL/taiga-back,dycodedev/taiga-back,WALR/taiga-back,Rademade/taiga-back,bdang2012/taiga-back-casting,obimod/taiga-back,WALR/taiga-back,xdevelsistemas/taiga-back-community,rajiteh/taiga-back,dayatz/taiga-back,astronaut1712/taiga-back,WALR/taiga-back,seanchen/taiga-back,19kestier/taiga-back,frt-arch/taiga-back,CMLL/taiga-back,EvgeneOskin/taiga-back,19kestier/taiga-back,bdang2012/taiga-back-casting,forging2012/taiga-back,astagi/taiga-back,crr0004/taiga-back,coopsource/taiga-back,frt-arch/taiga-back,19kestier/taiga-back,EvgeneOskin/taiga-back,dycodedev/taiga-back,CoolCloud/taiga-back,taigaio/taiga-back,gam-phon/taiga-back | # -*- coding: utf-8 -*-
from rest_framework import routers
# Special router for actions.
actions_router = routers.Route(url=r'^{prefix}/{methodname}{trailing_slash}$',
mapping={'{httpmethod}': '{methodname}'},
name='{basename}-{methodnamehyphen}',
initkwargs={})
class DefaultRouter(routers.DefaultRouter):
routes = [
routers.DefaultRouter.routes[0],
actions_router,
routers.DefaultRouter.routes[2],
routers.DefaultRouter.routes[1]
]
__all__ = ["DefaultRouter"]
Remove old reimplementation of routes. | # -*- coding: utf-8 -*-
from rest_framework import routers
class DefaultRouter(routers.DefaultRouter):
pass
__all__ = ["DefaultRouter"]
| <commit_before># -*- coding: utf-8 -*-
from rest_framework import routers
# Special router for actions.
actions_router = routers.Route(url=r'^{prefix}/{methodname}{trailing_slash}$',
mapping={'{httpmethod}': '{methodname}'},
name='{basename}-{methodnamehyphen}',
initkwargs={})
class DefaultRouter(routers.DefaultRouter):
routes = [
routers.DefaultRouter.routes[0],
actions_router,
routers.DefaultRouter.routes[2],
routers.DefaultRouter.routes[1]
]
__all__ = ["DefaultRouter"]
<commit_msg>Remove old reimplementation of routes.<commit_after> | # -*- coding: utf-8 -*-
from rest_framework import routers
class DefaultRouter(routers.DefaultRouter):
pass
__all__ = ["DefaultRouter"]
| # -*- coding: utf-8 -*-
from rest_framework import routers
# Special router for actions.
actions_router = routers.Route(url=r'^{prefix}/{methodname}{trailing_slash}$',
mapping={'{httpmethod}': '{methodname}'},
name='{basename}-{methodnamehyphen}',
initkwargs={})
class DefaultRouter(routers.DefaultRouter):
routes = [
routers.DefaultRouter.routes[0],
actions_router,
routers.DefaultRouter.routes[2],
routers.DefaultRouter.routes[1]
]
__all__ = ["DefaultRouter"]
Remove old reimplementation of routes.# -*- coding: utf-8 -*-
from rest_framework import routers
class DefaultRouter(routers.DefaultRouter):
pass
__all__ = ["DefaultRouter"]
| <commit_before># -*- coding: utf-8 -*-
from rest_framework import routers
# Special router for actions.
actions_router = routers.Route(url=r'^{prefix}/{methodname}{trailing_slash}$',
mapping={'{httpmethod}': '{methodname}'},
name='{basename}-{methodnamehyphen}',
initkwargs={})
class DefaultRouter(routers.DefaultRouter):
routes = [
routers.DefaultRouter.routes[0],
actions_router,
routers.DefaultRouter.routes[2],
routers.DefaultRouter.routes[1]
]
__all__ = ["DefaultRouter"]
<commit_msg>Remove old reimplementation of routes.<commit_after># -*- coding: utf-8 -*-
from rest_framework import routers
class DefaultRouter(routers.DefaultRouter):
pass
__all__ = ["DefaultRouter"]
|
d896082b282d17616573de2bcca4b383420d1e7a | python/__init__.py | python/__init__.py | # -*- coding: UTF-8 -*-
# Copyright (C) 2009 Itaapy, ArsAperta, Pierlis, Talend
# Import from itools
from itools.pkg import get_version
__version__ = get_version()
| # -*- coding: UTF-8 -*-
# Copyright (C) 2009 Itaapy, ArsAperta, Pierlis, Talend
# Import from itools
from itools.core import get_version
__version__ = get_version()
| Fix a bad import (get_version) | Fix a bad import (get_version)
| Python | apache-2.0 | Agicia/lpod-python,lpod/lpod-docs,Agicia/lpod-python,lpod/lpod-docs | # -*- coding: UTF-8 -*-
# Copyright (C) 2009 Itaapy, ArsAperta, Pierlis, Talend
# Import from itools
from itools.pkg import get_version
__version__ = get_version()
Fix a bad import (get_version) | # -*- coding: UTF-8 -*-
# Copyright (C) 2009 Itaapy, ArsAperta, Pierlis, Talend
# Import from itools
from itools.core import get_version
__version__ = get_version()
| <commit_before># -*- coding: UTF-8 -*-
# Copyright (C) 2009 Itaapy, ArsAperta, Pierlis, Talend
# Import from itools
from itools.pkg import get_version
__version__ = get_version()
<commit_msg>Fix a bad import (get_version)<commit_after> | # -*- coding: UTF-8 -*-
# Copyright (C) 2009 Itaapy, ArsAperta, Pierlis, Talend
# Import from itools
from itools.core import get_version
__version__ = get_version()
| # -*- coding: UTF-8 -*-
# Copyright (C) 2009 Itaapy, ArsAperta, Pierlis, Talend
# Import from itools
from itools.pkg import get_version
__version__ = get_version()
Fix a bad import (get_version)# -*- coding: UTF-8 -*-
# Copyright (C) 2009 Itaapy, ArsAperta, Pierlis, Talend
# Import from itools
from itools.core import get_version
__version__ = get_version()
| <commit_before># -*- coding: UTF-8 -*-
# Copyright (C) 2009 Itaapy, ArsAperta, Pierlis, Talend
# Import from itools
from itools.pkg import get_version
__version__ = get_version()
<commit_msg>Fix a bad import (get_version)<commit_after># -*- coding: UTF-8 -*-
# Copyright (C) 2009 Itaapy, ArsAperta, Pierlis, Talend
# Import from itools
from itools.core import get_version
__version__ = get_version()
|
b78ce84f2a36789fc0fbb6b184b5c8d8ebb23234 | run_tests.py | run_tests.py | #!/usr/bin/env python
import sys
import pytest
if __name__ == '__main__':
sys.exit(pytest.main())
| #!/usr/bin/env python
import sys
import pytest
if __name__ == '__main__':
# show output results from every test function
args = ['-v']
# show the message output for skipped and expected failure tests
args.append('-rxs')
# compute coverage stats for bluesky
args.extend(['--cov', 'bluesky'])
# call pytest and exit with the return code from pytest so that
# travis will fail correctly if tests fail
sys.exit(pytest.main(args))
| Clarify py.test arguments in run_test.py | TST: Clarify py.test arguments in run_test.py
| Python | bsd-3-clause | ericdill/bluesky,ericdill/bluesky | #!/usr/bin/env python
import sys
import pytest
if __name__ == '__main__':
sys.exit(pytest.main())
TST: Clarify py.test arguments in run_test.py | #!/usr/bin/env python
import sys
import pytest
if __name__ == '__main__':
# show output results from every test function
args = ['-v']
# show the message output for skipped and expected failure tests
args.append('-rxs')
# compute coverage stats for bluesky
args.extend(['--cov', 'bluesky'])
# call pytest and exit with the return code from pytest so that
# travis will fail correctly if tests fail
sys.exit(pytest.main(args))
| <commit_before>#!/usr/bin/env python
import sys
import pytest
if __name__ == '__main__':
sys.exit(pytest.main())
<commit_msg>TST: Clarify py.test arguments in run_test.py<commit_after> | #!/usr/bin/env python
import sys
import pytest
if __name__ == '__main__':
# show output results from every test function
args = ['-v']
# show the message output for skipped and expected failure tests
args.append('-rxs')
# compute coverage stats for bluesky
args.extend(['--cov', 'bluesky'])
# call pytest and exit with the return code from pytest so that
# travis will fail correctly if tests fail
sys.exit(pytest.main(args))
| #!/usr/bin/env python
import sys
import pytest
if __name__ == '__main__':
sys.exit(pytest.main())
TST: Clarify py.test arguments in run_test.py#!/usr/bin/env python
import sys
import pytest
if __name__ == '__main__':
# show output results from every test function
args = ['-v']
# show the message output for skipped and expected failure tests
args.append('-rxs')
# compute coverage stats for bluesky
args.extend(['--cov', 'bluesky'])
# call pytest and exit with the return code from pytest so that
# travis will fail correctly if tests fail
sys.exit(pytest.main(args))
| <commit_before>#!/usr/bin/env python
import sys
import pytest
if __name__ == '__main__':
sys.exit(pytest.main())
<commit_msg>TST: Clarify py.test arguments in run_test.py<commit_after>#!/usr/bin/env python
import sys
import pytest
if __name__ == '__main__':
# show output results from every test function
args = ['-v']
# show the message output for skipped and expected failure tests
args.append('-rxs')
# compute coverage stats for bluesky
args.extend(['--cov', 'bluesky'])
# call pytest and exit with the return code from pytest so that
# travis will fail correctly if tests fail
sys.exit(pytest.main(args))
|
d043eef098be68690b9d6cd5790b667cdb2d825b | runserver.py | runserver.py | from wKRApp import app
app.secret_key = "my precious" # 2 security flaws, need to sort out
app.run(debug=True)
| from wKRApp import app
# 2 security flaws, need to sort out
# 1. the key should be randomy generated
# 2. the key should be set in a config file that is then imported in.
app.secret_key = "my precious"
app.run(debug=True)
| Add comments about security issue | style(comments): Add comments about security issue
- Added comments about two security issues relating to the session secret key
| Python | mit | stuffy-the-dragon/wKRApp,bafana5/wKRApp,stuffy-the-dragon/wKRApp,stuffy-the-dragon/wKRApp,bafana5/wKRApp,bafana5/wKRApp | from wKRApp import app
app.secret_key = "my precious" # 2 security flaws, need to sort out
app.run(debug=True)
style(comments): Add comments about security issue
- Added comments about two security issues relating to the session secret key | from wKRApp import app
# 2 security flaws, need to sort out
# 1. the key should be randomy generated
# 2. the key should be set in a config file that is then imported in.
app.secret_key = "my precious"
app.run(debug=True)
| <commit_before>from wKRApp import app
app.secret_key = "my precious" # 2 security flaws, need to sort out
app.run(debug=True)
<commit_msg>style(comments): Add comments about security issue
- Added comments about two security issues relating to the session secret key<commit_after> | from wKRApp import app
# 2 security flaws, need to sort out
# 1. the key should be randomy generated
# 2. the key should be set in a config file that is then imported in.
app.secret_key = "my precious"
app.run(debug=True)
| from wKRApp import app
app.secret_key = "my precious" # 2 security flaws, need to sort out
app.run(debug=True)
style(comments): Add comments about security issue
- Added comments about two security issues relating to the session secret keyfrom wKRApp import app
# 2 security flaws, need to sort out
# 1. the key should be randomy generated
# 2. the key should be set in a config file that is then imported in.
app.secret_key = "my precious"
app.run(debug=True)
| <commit_before>from wKRApp import app
app.secret_key = "my precious" # 2 security flaws, need to sort out
app.run(debug=True)
<commit_msg>style(comments): Add comments about security issue
- Added comments about two security issues relating to the session secret key<commit_after>from wKRApp import app
# 2 security flaws, need to sort out
# 1. the key should be randomy generated
# 2. the key should be set in a config file that is then imported in.
app.secret_key = "my precious"
app.run(debug=True)
|
803368f1741a9558ea84092dc975c1a10f51fa79 | administracion/urls.py | administracion/urls.py | from django.conf.urls import url
from .views import admin_main_dashboard, admin_users_dashboard, \
admin_users_create, admin_users_edit, admin_users_edit_form, \
admin_users_delete_modal, admin_users_delete, list_studies
app_name = 'administracion'
# Urls en espanol
urlpatterns = [
url(r'^principal/', admin_main_dashboard, name='main'),
url(r'^usuarios/nuevo/', admin_users_create, name='users_add'),
url(r'^usuarios/editar/(\d+)/', admin_users_edit_form, name='users_edit_form'),
url(r'^usuarios/editar/guardar/', admin_users_edit, name='users_edit'),
url(r'^usuarios/borrar/(\d+)/', admin_users_delete_modal, name='users_delete_modal'),
url(r'^usuarios/borrar/confirmar/', admin_users_delete, name='users_delete'),
url(r'^usuarios/', admin_users_dashboard, name='users'),
url(r'^principal/(?P<status_study>[\w\-]+)/$', list_studies, name='main_estudios'),
]
| from django.conf.urls import url
from .views import admin_main_dashboard, admin_users_dashboard, \
admin_users_create, admin_users_edit, admin_users_edit_form, \
admin_users_delete_modal, admin_users_delete, list_studies
app_name = 'administracion'
# Urls en espanol
urlpatterns = [
url(r'^principal/$', admin_main_dashboard, name='main'),
url(r'^usuarios/nuevo/', admin_users_create, name='users_add'),
url(r'^usuarios/editar/(\d+)/', admin_users_edit_form, name='users_edit_form'),
url(r'^usuarios/editar/guardar/', admin_users_edit, name='users_edit'),
url(r'^usuarios/borrar/(\d+)/', admin_users_delete_modal, name='users_delete_modal'),
url(r'^usuarios/borrar/confirmar/', admin_users_delete, name='users_delete'),
url(r'^usuarios/', admin_users_dashboard, name='users'),
url(r'^principal/(?P<status_study>[\w\-]+)/$', list_studies, name='main_estudios'),
]
| Change url in dashboard administrador | Change url in dashboard administrador
| Python | mit | erikiado/jp2_online,erikiado/jp2_online,erikiado/jp2_online | from django.conf.urls import url
from .views import admin_main_dashboard, admin_users_dashboard, \
admin_users_create, admin_users_edit, admin_users_edit_form, \
admin_users_delete_modal, admin_users_delete, list_studies
app_name = 'administracion'
# Urls en espanol
urlpatterns = [
url(r'^principal/', admin_main_dashboard, name='main'),
url(r'^usuarios/nuevo/', admin_users_create, name='users_add'),
url(r'^usuarios/editar/(\d+)/', admin_users_edit_form, name='users_edit_form'),
url(r'^usuarios/editar/guardar/', admin_users_edit, name='users_edit'),
url(r'^usuarios/borrar/(\d+)/', admin_users_delete_modal, name='users_delete_modal'),
url(r'^usuarios/borrar/confirmar/', admin_users_delete, name='users_delete'),
url(r'^usuarios/', admin_users_dashboard, name='users'),
url(r'^principal/(?P<status_study>[\w\-]+)/$', list_studies, name='main_estudios'),
]
Change url in dashboard administrador | from django.conf.urls import url
from .views import admin_main_dashboard, admin_users_dashboard, \
admin_users_create, admin_users_edit, admin_users_edit_form, \
admin_users_delete_modal, admin_users_delete, list_studies
app_name = 'administracion'
# Urls en espanol
urlpatterns = [
url(r'^principal/$', admin_main_dashboard, name='main'),
url(r'^usuarios/nuevo/', admin_users_create, name='users_add'),
url(r'^usuarios/editar/(\d+)/', admin_users_edit_form, name='users_edit_form'),
url(r'^usuarios/editar/guardar/', admin_users_edit, name='users_edit'),
url(r'^usuarios/borrar/(\d+)/', admin_users_delete_modal, name='users_delete_modal'),
url(r'^usuarios/borrar/confirmar/', admin_users_delete, name='users_delete'),
url(r'^usuarios/', admin_users_dashboard, name='users'),
url(r'^principal/(?P<status_study>[\w\-]+)/$', list_studies, name='main_estudios'),
]
| <commit_before>from django.conf.urls import url
from .views import admin_main_dashboard, admin_users_dashboard, \
admin_users_create, admin_users_edit, admin_users_edit_form, \
admin_users_delete_modal, admin_users_delete, list_studies
app_name = 'administracion'
# Urls en espanol
urlpatterns = [
url(r'^principal/', admin_main_dashboard, name='main'),
url(r'^usuarios/nuevo/', admin_users_create, name='users_add'),
url(r'^usuarios/editar/(\d+)/', admin_users_edit_form, name='users_edit_form'),
url(r'^usuarios/editar/guardar/', admin_users_edit, name='users_edit'),
url(r'^usuarios/borrar/(\d+)/', admin_users_delete_modal, name='users_delete_modal'),
url(r'^usuarios/borrar/confirmar/', admin_users_delete, name='users_delete'),
url(r'^usuarios/', admin_users_dashboard, name='users'),
url(r'^principal/(?P<status_study>[\w\-]+)/$', list_studies, name='main_estudios'),
]
<commit_msg>Change url in dashboard administrador<commit_after> | from django.conf.urls import url
from .views import admin_main_dashboard, admin_users_dashboard, \
admin_users_create, admin_users_edit, admin_users_edit_form, \
admin_users_delete_modal, admin_users_delete, list_studies
app_name = 'administracion'
# Urls en espanol
urlpatterns = [
url(r'^principal/$', admin_main_dashboard, name='main'),
url(r'^usuarios/nuevo/', admin_users_create, name='users_add'),
url(r'^usuarios/editar/(\d+)/', admin_users_edit_form, name='users_edit_form'),
url(r'^usuarios/editar/guardar/', admin_users_edit, name='users_edit'),
url(r'^usuarios/borrar/(\d+)/', admin_users_delete_modal, name='users_delete_modal'),
url(r'^usuarios/borrar/confirmar/', admin_users_delete, name='users_delete'),
url(r'^usuarios/', admin_users_dashboard, name='users'),
url(r'^principal/(?P<status_study>[\w\-]+)/$', list_studies, name='main_estudios'),
]
| from django.conf.urls import url
from .views import admin_main_dashboard, admin_users_dashboard, \
admin_users_create, admin_users_edit, admin_users_edit_form, \
admin_users_delete_modal, admin_users_delete, list_studies
app_name = 'administracion'
# Urls en espanol
urlpatterns = [
url(r'^principal/', admin_main_dashboard, name='main'),
url(r'^usuarios/nuevo/', admin_users_create, name='users_add'),
url(r'^usuarios/editar/(\d+)/', admin_users_edit_form, name='users_edit_form'),
url(r'^usuarios/editar/guardar/', admin_users_edit, name='users_edit'),
url(r'^usuarios/borrar/(\d+)/', admin_users_delete_modal, name='users_delete_modal'),
url(r'^usuarios/borrar/confirmar/', admin_users_delete, name='users_delete'),
url(r'^usuarios/', admin_users_dashboard, name='users'),
url(r'^principal/(?P<status_study>[\w\-]+)/$', list_studies, name='main_estudios'),
]
Change url in dashboard administradorfrom django.conf.urls import url
from .views import admin_main_dashboard, admin_users_dashboard, \
admin_users_create, admin_users_edit, admin_users_edit_form, \
admin_users_delete_modal, admin_users_delete, list_studies
app_name = 'administracion'
# Urls en espanol
urlpatterns = [
url(r'^principal/$', admin_main_dashboard, name='main'),
url(r'^usuarios/nuevo/', admin_users_create, name='users_add'),
url(r'^usuarios/editar/(\d+)/', admin_users_edit_form, name='users_edit_form'),
url(r'^usuarios/editar/guardar/', admin_users_edit, name='users_edit'),
url(r'^usuarios/borrar/(\d+)/', admin_users_delete_modal, name='users_delete_modal'),
url(r'^usuarios/borrar/confirmar/', admin_users_delete, name='users_delete'),
url(r'^usuarios/', admin_users_dashboard, name='users'),
url(r'^principal/(?P<status_study>[\w\-]+)/$', list_studies, name='main_estudios'),
]
| <commit_before>from django.conf.urls import url
from .views import admin_main_dashboard, admin_users_dashboard, \
admin_users_create, admin_users_edit, admin_users_edit_form, \
admin_users_delete_modal, admin_users_delete, list_studies
app_name = 'administracion'
# Urls en espanol
urlpatterns = [
url(r'^principal/', admin_main_dashboard, name='main'),
url(r'^usuarios/nuevo/', admin_users_create, name='users_add'),
url(r'^usuarios/editar/(\d+)/', admin_users_edit_form, name='users_edit_form'),
url(r'^usuarios/editar/guardar/', admin_users_edit, name='users_edit'),
url(r'^usuarios/borrar/(\d+)/', admin_users_delete_modal, name='users_delete_modal'),
url(r'^usuarios/borrar/confirmar/', admin_users_delete, name='users_delete'),
url(r'^usuarios/', admin_users_dashboard, name='users'),
url(r'^principal/(?P<status_study>[\w\-]+)/$', list_studies, name='main_estudios'),
]
<commit_msg>Change url in dashboard administrador<commit_after>from django.conf.urls import url
from .views import admin_main_dashboard, admin_users_dashboard, \
admin_users_create, admin_users_edit, admin_users_edit_form, \
admin_users_delete_modal, admin_users_delete, list_studies
app_name = 'administracion'
# Urls en espanol
urlpatterns = [
url(r'^principal/$', admin_main_dashboard, name='main'),
url(r'^usuarios/nuevo/', admin_users_create, name='users_add'),
url(r'^usuarios/editar/(\d+)/', admin_users_edit_form, name='users_edit_form'),
url(r'^usuarios/editar/guardar/', admin_users_edit, name='users_edit'),
url(r'^usuarios/borrar/(\d+)/', admin_users_delete_modal, name='users_delete_modal'),
url(r'^usuarios/borrar/confirmar/', admin_users_delete, name='users_delete'),
url(r'^usuarios/', admin_users_dashboard, name='users'),
url(r'^principal/(?P<status_study>[\w\-]+)/$', list_studies, name='main_estudios'),
]
|
3450712ec629c1720b6a6af28835d95a91b8fce7 | setup.py | setup.py | #!/usr/bin/python
import os
import re
from setuptools import setup
from m2r import parse_from_file
import restructuredtext_lint
# Parser README.md into reStructuredText format
rst_readme = parse_from_file('README.md')
# Validate the README, checking for errors
errors = restructuredtext_lint.lint(rst_readme)
# Raise an exception for any errors found
if errors:
print(rst_readme)
raise ValueError('README.md contains errors: ',
', '.join([e.message for e in errors]))
# Attempt to get version number from TravisCI environment variable
version = os.environ.get('TRAVIS_TAG', default='0.0.0')
# Remove leading 'v'
version = re.sub('^v', '', version)
setup(
name='anybadge',
description='Simple, flexible badge generator for project badges.',
long_description=rst_readme,
version=version,
author='Jon Grace-Cox',
author_email='jongracecox@gmail.com',
py_modules=['anybadge', 'anybadge_server'],
setup_requires=['setuptools', 'wheel'],
tests_require=['unittest'],
install_requires=[],
data_files=[],
options={
'bdist_wheel': {'universal': True}
},
url='https://github.com/jongracecox/anybadge',
entry_points={
'console_scripts': ['anybadge=anybadge:main',
'anybadge-server=anybadge_server:main'],
}
)
| #!/usr/bin/python
import os
import re
from setuptools import setup
from m2r import parse_from_file
import restructuredtext_lint
# Parser README.md into reStructuredText format
rst_readme = parse_from_file('README.md')
# Validate the README, checking for errors
errors = restructuredtext_lint.lint(rst_readme)
# Raise an exception for any errors found
if errors:
print(rst_readme)
raise ValueError('README.md contains errors: ',
', '.join([e.message for e in errors]))
# Attempt to get version number from TravisCI environment variable
version = os.environ.get('TRAVIS_TAG', default='0.0.0')
# Remove leading 'v'
version = re.sub('^v', '', version)
setup(
name='anybadge',
description='Simple, flexible badge generator for project badges.',
long_description=rst_readme,
version=version,
author='Jon Grace-Cox',
author_email='jongracecox@gmail.com',
py_modules=['anybadge', 'anybadge_server'],
setup_requires=['setuptools', 'wheel'],
tests_require=['unittest'],
install_requires=[],
data_files=[],
options={
'bdist_wheel': {'universal': True}
},
url='https://github.com/jongracecox/anybadge',
entry_points={
'console_scripts': ['anybadge=anybadge:main',
'anybadge-server=anybadge_server:main'],
},
classifiers=[
'License :: OSI Approved :: MIT License'
]
)
| Use classifiers to specify the license. | Use classifiers to specify the license.
Classifiers are a standard way of specifying a license, and make it easy
for automated tools to properly detect the license of the package.
The "license" field should only be used if the license has no
corresponding Trove classifier.
| Python | mit | jongracecox/anybadge,jongracecox/anybadge | #!/usr/bin/python
import os
import re
from setuptools import setup
from m2r import parse_from_file
import restructuredtext_lint
# Parser README.md into reStructuredText format
rst_readme = parse_from_file('README.md')
# Validate the README, checking for errors
errors = restructuredtext_lint.lint(rst_readme)
# Raise an exception for any errors found
if errors:
print(rst_readme)
raise ValueError('README.md contains errors: ',
', '.join([e.message for e in errors]))
# Attempt to get version number from TravisCI environment variable
version = os.environ.get('TRAVIS_TAG', default='0.0.0')
# Remove leading 'v'
version = re.sub('^v', '', version)
setup(
name='anybadge',
description='Simple, flexible badge generator for project badges.',
long_description=rst_readme,
version=version,
author='Jon Grace-Cox',
author_email='jongracecox@gmail.com',
py_modules=['anybadge', 'anybadge_server'],
setup_requires=['setuptools', 'wheel'],
tests_require=['unittest'],
install_requires=[],
data_files=[],
options={
'bdist_wheel': {'universal': True}
},
url='https://github.com/jongracecox/anybadge',
entry_points={
'console_scripts': ['anybadge=anybadge:main',
'anybadge-server=anybadge_server:main'],
}
)
Use classifiers to specify the license.
Classifiers are a standard way of specifying a license, and make it easy
for automated tools to properly detect the license of the package.
The "license" field should only be used if the license has no
corresponding Trove classifier. | #!/usr/bin/python
import os
import re
from setuptools import setup
from m2r import parse_from_file
import restructuredtext_lint
# Parser README.md into reStructuredText format
rst_readme = parse_from_file('README.md')
# Validate the README, checking for errors
errors = restructuredtext_lint.lint(rst_readme)
# Raise an exception for any errors found
if errors:
print(rst_readme)
raise ValueError('README.md contains errors: ',
', '.join([e.message for e in errors]))
# Attempt to get version number from TravisCI environment variable
version = os.environ.get('TRAVIS_TAG', default='0.0.0')
# Remove leading 'v'
version = re.sub('^v', '', version)
setup(
name='anybadge',
description='Simple, flexible badge generator for project badges.',
long_description=rst_readme,
version=version,
author='Jon Grace-Cox',
author_email='jongracecox@gmail.com',
py_modules=['anybadge', 'anybadge_server'],
setup_requires=['setuptools', 'wheel'],
tests_require=['unittest'],
install_requires=[],
data_files=[],
options={
'bdist_wheel': {'universal': True}
},
url='https://github.com/jongracecox/anybadge',
entry_points={
'console_scripts': ['anybadge=anybadge:main',
'anybadge-server=anybadge_server:main'],
},
classifiers=[
'License :: OSI Approved :: MIT License'
]
)
| <commit_before>#!/usr/bin/python
import os
import re
from setuptools import setup
from m2r import parse_from_file
import restructuredtext_lint
# Parser README.md into reStructuredText format
rst_readme = parse_from_file('README.md')
# Validate the README, checking for errors
errors = restructuredtext_lint.lint(rst_readme)
# Raise an exception for any errors found
if errors:
print(rst_readme)
raise ValueError('README.md contains errors: ',
', '.join([e.message for e in errors]))
# Attempt to get version number from TravisCI environment variable
version = os.environ.get('TRAVIS_TAG', default='0.0.0')
# Remove leading 'v'
version = re.sub('^v', '', version)
setup(
name='anybadge',
description='Simple, flexible badge generator for project badges.',
long_description=rst_readme,
version=version,
author='Jon Grace-Cox',
author_email='jongracecox@gmail.com',
py_modules=['anybadge', 'anybadge_server'],
setup_requires=['setuptools', 'wheel'],
tests_require=['unittest'],
install_requires=[],
data_files=[],
options={
'bdist_wheel': {'universal': True}
},
url='https://github.com/jongracecox/anybadge',
entry_points={
'console_scripts': ['anybadge=anybadge:main',
'anybadge-server=anybadge_server:main'],
}
)
<commit_msg>Use classifiers to specify the license.
Classifiers are a standard way of specifying a license, and make it easy
for automated tools to properly detect the license of the package.
The "license" field should only be used if the license has no
corresponding Trove classifier.<commit_after> | #!/usr/bin/python
import os
import re
from setuptools import setup
from m2r import parse_from_file
import restructuredtext_lint
# Parser README.md into reStructuredText format
rst_readme = parse_from_file('README.md')
# Validate the README, checking for errors
errors = restructuredtext_lint.lint(rst_readme)
# Raise an exception for any errors found
if errors:
print(rst_readme)
raise ValueError('README.md contains errors: ',
', '.join([e.message for e in errors]))
# Attempt to get version number from TravisCI environment variable
version = os.environ.get('TRAVIS_TAG', default='0.0.0')
# Remove leading 'v'
version = re.sub('^v', '', version)
setup(
name='anybadge',
description='Simple, flexible badge generator for project badges.',
long_description=rst_readme,
version=version,
author='Jon Grace-Cox',
author_email='jongracecox@gmail.com',
py_modules=['anybadge', 'anybadge_server'],
setup_requires=['setuptools', 'wheel'],
tests_require=['unittest'],
install_requires=[],
data_files=[],
options={
'bdist_wheel': {'universal': True}
},
url='https://github.com/jongracecox/anybadge',
entry_points={
'console_scripts': ['anybadge=anybadge:main',
'anybadge-server=anybadge_server:main'],
},
classifiers=[
'License :: OSI Approved :: MIT License'
]
)
| #!/usr/bin/python
import os
import re
from setuptools import setup
from m2r import parse_from_file
import restructuredtext_lint
# Parser README.md into reStructuredText format
rst_readme = parse_from_file('README.md')
# Validate the README, checking for errors
errors = restructuredtext_lint.lint(rst_readme)
# Raise an exception for any errors found
if errors:
print(rst_readme)
raise ValueError('README.md contains errors: ',
', '.join([e.message for e in errors]))
# Attempt to get version number from TravisCI environment variable
version = os.environ.get('TRAVIS_TAG', default='0.0.0')
# Remove leading 'v'
version = re.sub('^v', '', version)
setup(
name='anybadge',
description='Simple, flexible badge generator for project badges.',
long_description=rst_readme,
version=version,
author='Jon Grace-Cox',
author_email='jongracecox@gmail.com',
py_modules=['anybadge', 'anybadge_server'],
setup_requires=['setuptools', 'wheel'],
tests_require=['unittest'],
install_requires=[],
data_files=[],
options={
'bdist_wheel': {'universal': True}
},
url='https://github.com/jongracecox/anybadge',
entry_points={
'console_scripts': ['anybadge=anybadge:main',
'anybadge-server=anybadge_server:main'],
}
)
Use classifiers to specify the license.
Classifiers are a standard way of specifying a license, and make it easy
for automated tools to properly detect the license of the package.
The "license" field should only be used if the license has no
corresponding Trove classifier.#!/usr/bin/python
import os
import re
from setuptools import setup
from m2r import parse_from_file
import restructuredtext_lint
# Parser README.md into reStructuredText format
rst_readme = parse_from_file('README.md')
# Validate the README, checking for errors
errors = restructuredtext_lint.lint(rst_readme)
# Raise an exception for any errors found
if errors:
print(rst_readme)
raise ValueError('README.md contains errors: ',
', '.join([e.message for e in errors]))
# Attempt to get version number from TravisCI environment variable
version = os.environ.get('TRAVIS_TAG', default='0.0.0')
# Remove leading 'v'
version = re.sub('^v', '', version)
setup(
name='anybadge',
description='Simple, flexible badge generator for project badges.',
long_description=rst_readme,
version=version,
author='Jon Grace-Cox',
author_email='jongracecox@gmail.com',
py_modules=['anybadge', 'anybadge_server'],
setup_requires=['setuptools', 'wheel'],
tests_require=['unittest'],
install_requires=[],
data_files=[],
options={
'bdist_wheel': {'universal': True}
},
url='https://github.com/jongracecox/anybadge',
entry_points={
'console_scripts': ['anybadge=anybadge:main',
'anybadge-server=anybadge_server:main'],
},
classifiers=[
'License :: OSI Approved :: MIT License'
]
)
| <commit_before>#!/usr/bin/python
import os
import re
from setuptools import setup
from m2r import parse_from_file
import restructuredtext_lint
# Parser README.md into reStructuredText format
rst_readme = parse_from_file('README.md')
# Validate the README, checking for errors
errors = restructuredtext_lint.lint(rst_readme)
# Raise an exception for any errors found
if errors:
print(rst_readme)
raise ValueError('README.md contains errors: ',
', '.join([e.message for e in errors]))
# Attempt to get version number from TravisCI environment variable
version = os.environ.get('TRAVIS_TAG', default='0.0.0')
# Remove leading 'v'
version = re.sub('^v', '', version)
setup(
name='anybadge',
description='Simple, flexible badge generator for project badges.',
long_description=rst_readme,
version=version,
author='Jon Grace-Cox',
author_email='jongracecox@gmail.com',
py_modules=['anybadge', 'anybadge_server'],
setup_requires=['setuptools', 'wheel'],
tests_require=['unittest'],
install_requires=[],
data_files=[],
options={
'bdist_wheel': {'universal': True}
},
url='https://github.com/jongracecox/anybadge',
entry_points={
'console_scripts': ['anybadge=anybadge:main',
'anybadge-server=anybadge_server:main'],
}
)
<commit_msg>Use classifiers to specify the license.
Classifiers are a standard way of specifying a license, and make it easy
for automated tools to properly detect the license of the package.
The "license" field should only be used if the license has no
corresponding Trove classifier.<commit_after>#!/usr/bin/python
import os
import re
from setuptools import setup
from m2r import parse_from_file
import restructuredtext_lint
# Parser README.md into reStructuredText format
rst_readme = parse_from_file('README.md')
# Validate the README, checking for errors
errors = restructuredtext_lint.lint(rst_readme)
# Raise an exception for any errors found
if errors:
print(rst_readme)
raise ValueError('README.md contains errors: ',
', '.join([e.message for e in errors]))
# Attempt to get version number from TravisCI environment variable
version = os.environ.get('TRAVIS_TAG', default='0.0.0')
# Remove leading 'v'
version = re.sub('^v', '', version)
setup(
name='anybadge',
description='Simple, flexible badge generator for project badges.',
long_description=rst_readme,
version=version,
author='Jon Grace-Cox',
author_email='jongracecox@gmail.com',
py_modules=['anybadge', 'anybadge_server'],
setup_requires=['setuptools', 'wheel'],
tests_require=['unittest'],
install_requires=[],
data_files=[],
options={
'bdist_wheel': {'universal': True}
},
url='https://github.com/jongracecox/anybadge',
entry_points={
'console_scripts': ['anybadge=anybadge:main',
'anybadge-server=anybadge_server:main'],
},
classifiers=[
'License :: OSI Approved :: MIT License'
]
)
|
e2e6cdac88ee03f78713ac4a50d0003a471a0027 | setup.py | setup.py | from setuptools import setup
long_description = open('README.rst').read()
setup(
name="celery-redbeat",
description="A Celery Beat Scheduler using Redis for persistent storage",
long_description=long_description,
version="2.0.0",
url="https://github.com/sibson/redbeat",
license="Apache License, Version 2.0",
author="Marc Sibson",
author_email="sibson+redbeat@gmail.com",
keywords="python celery beat redis".split(),
packages=["redbeat"],
classifiers=[
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: Apache Software License',
'Topic :: System :: Distributed Computing',
'Topic :: Software Development :: Object Brokering',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: Implementation :: CPython',
'Operating System :: OS Independent',
],
install_requires=['redis>=3.2', 'celery>=4.2', 'python-dateutil', 'tenacity'],
tests_require=['pytest'],
)
| from setuptools import setup
long_description = open('README.rst').read()
setup(
name="celery-redbeat",
description="A Celery Beat Scheduler using Redis for persistent storage",
long_description=long_description,
version="2.0.0",
url="https://github.com/sibson/redbeat",
license="Apache License, Version 2.0",
author="Marc Sibson",
author_email="sibson+redbeat@gmail.com",
keywords="python celery beat redis".split(),
packages=["redbeat"],
classifiers=[
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: Apache Software License',
'Topic :: System :: Distributed Computing',
'Topic :: Software Development :: Object Brokering',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: Implementation :: CPython',
'Operating System :: OS Independent',
],
install_requires=['redis>=3.2', 'celery>=4.2', 'python-dateutil', 'tenacity'],
tests_require=['pytest'],
)
| Add Python 3.9 to the list of supported versions. | Add Python 3.9 to the list of supported versions.
| Python | apache-2.0 | sibson/redbeat | from setuptools import setup
long_description = open('README.rst').read()
setup(
name="celery-redbeat",
description="A Celery Beat Scheduler using Redis for persistent storage",
long_description=long_description,
version="2.0.0",
url="https://github.com/sibson/redbeat",
license="Apache License, Version 2.0",
author="Marc Sibson",
author_email="sibson+redbeat@gmail.com",
keywords="python celery beat redis".split(),
packages=["redbeat"],
classifiers=[
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: Apache Software License',
'Topic :: System :: Distributed Computing',
'Topic :: Software Development :: Object Brokering',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: Implementation :: CPython',
'Operating System :: OS Independent',
],
install_requires=['redis>=3.2', 'celery>=4.2', 'python-dateutil', 'tenacity'],
tests_require=['pytest'],
)
Add Python 3.9 to the list of supported versions. | from setuptools import setup
long_description = open('README.rst').read()
setup(
name="celery-redbeat",
description="A Celery Beat Scheduler using Redis for persistent storage",
long_description=long_description,
version="2.0.0",
url="https://github.com/sibson/redbeat",
license="Apache License, Version 2.0",
author="Marc Sibson",
author_email="sibson+redbeat@gmail.com",
keywords="python celery beat redis".split(),
packages=["redbeat"],
classifiers=[
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: Apache Software License',
'Topic :: System :: Distributed Computing',
'Topic :: Software Development :: Object Brokering',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: Implementation :: CPython',
'Operating System :: OS Independent',
],
install_requires=['redis>=3.2', 'celery>=4.2', 'python-dateutil', 'tenacity'],
tests_require=['pytest'],
)
| <commit_before>from setuptools import setup
long_description = open('README.rst').read()
setup(
name="celery-redbeat",
description="A Celery Beat Scheduler using Redis for persistent storage",
long_description=long_description,
version="2.0.0",
url="https://github.com/sibson/redbeat",
license="Apache License, Version 2.0",
author="Marc Sibson",
author_email="sibson+redbeat@gmail.com",
keywords="python celery beat redis".split(),
packages=["redbeat"],
classifiers=[
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: Apache Software License',
'Topic :: System :: Distributed Computing',
'Topic :: Software Development :: Object Brokering',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: Implementation :: CPython',
'Operating System :: OS Independent',
],
install_requires=['redis>=3.2', 'celery>=4.2', 'python-dateutil', 'tenacity'],
tests_require=['pytest'],
)
<commit_msg>Add Python 3.9 to the list of supported versions.<commit_after> | from setuptools import setup
long_description = open('README.rst').read()
setup(
name="celery-redbeat",
description="A Celery Beat Scheduler using Redis for persistent storage",
long_description=long_description,
version="2.0.0",
url="https://github.com/sibson/redbeat",
license="Apache License, Version 2.0",
author="Marc Sibson",
author_email="sibson+redbeat@gmail.com",
keywords="python celery beat redis".split(),
packages=["redbeat"],
classifiers=[
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: Apache Software License',
'Topic :: System :: Distributed Computing',
'Topic :: Software Development :: Object Brokering',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: Implementation :: CPython',
'Operating System :: OS Independent',
],
install_requires=['redis>=3.2', 'celery>=4.2', 'python-dateutil', 'tenacity'],
tests_require=['pytest'],
)
| from setuptools import setup
long_description = open('README.rst').read()
setup(
name="celery-redbeat",
description="A Celery Beat Scheduler using Redis for persistent storage",
long_description=long_description,
version="2.0.0",
url="https://github.com/sibson/redbeat",
license="Apache License, Version 2.0",
author="Marc Sibson",
author_email="sibson+redbeat@gmail.com",
keywords="python celery beat redis".split(),
packages=["redbeat"],
classifiers=[
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: Apache Software License',
'Topic :: System :: Distributed Computing',
'Topic :: Software Development :: Object Brokering',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: Implementation :: CPython',
'Operating System :: OS Independent',
],
install_requires=['redis>=3.2', 'celery>=4.2', 'python-dateutil', 'tenacity'],
tests_require=['pytest'],
)
Add Python 3.9 to the list of supported versions.from setuptools import setup
long_description = open('README.rst').read()
setup(
name="celery-redbeat",
description="A Celery Beat Scheduler using Redis for persistent storage",
long_description=long_description,
version="2.0.0",
url="https://github.com/sibson/redbeat",
license="Apache License, Version 2.0",
author="Marc Sibson",
author_email="sibson+redbeat@gmail.com",
keywords="python celery beat redis".split(),
packages=["redbeat"],
classifiers=[
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: Apache Software License',
'Topic :: System :: Distributed Computing',
'Topic :: Software Development :: Object Brokering',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: Implementation :: CPython',
'Operating System :: OS Independent',
],
install_requires=['redis>=3.2', 'celery>=4.2', 'python-dateutil', 'tenacity'],
tests_require=['pytest'],
)
| <commit_before>from setuptools import setup
long_description = open('README.rst').read()
setup(
name="celery-redbeat",
description="A Celery Beat Scheduler using Redis for persistent storage",
long_description=long_description,
version="2.0.0",
url="https://github.com/sibson/redbeat",
license="Apache License, Version 2.0",
author="Marc Sibson",
author_email="sibson+redbeat@gmail.com",
keywords="python celery beat redis".split(),
packages=["redbeat"],
classifiers=[
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: Apache Software License',
'Topic :: System :: Distributed Computing',
'Topic :: Software Development :: Object Brokering',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: Implementation :: CPython',
'Operating System :: OS Independent',
],
install_requires=['redis>=3.2', 'celery>=4.2', 'python-dateutil', 'tenacity'],
tests_require=['pytest'],
)
<commit_msg>Add Python 3.9 to the list of supported versions.<commit_after>from setuptools import setup
long_description = open('README.rst').read()
setup(
name="celery-redbeat",
description="A Celery Beat Scheduler using Redis for persistent storage",
long_description=long_description,
version="2.0.0",
url="https://github.com/sibson/redbeat",
license="Apache License, Version 2.0",
author="Marc Sibson",
author_email="sibson+redbeat@gmail.com",
keywords="python celery beat redis".split(),
packages=["redbeat"],
classifiers=[
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: Apache Software License',
'Topic :: System :: Distributed Computing',
'Topic :: Software Development :: Object Brokering',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: Implementation :: CPython',
'Operating System :: OS Independent',
],
install_requires=['redis>=3.2', 'celery>=4.2', 'python-dateutil', 'tenacity'],
tests_require=['pytest'],
)
|
38fb1ef71f827ff8483984ed9b7844dbdd945643 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup
setup(
name='Dapi',
version='1.0',
description='DevAssistant Package Index',
author='Miro Hroncok',
author_email='mhroncok@redhat.com',
url='https://github.com/hroncok/dapi',
license='AGPLv3',
install_requires=[
'Django==1.6',
'psycopg2',
'South',
'daploader>=0.0.5',
'PyYAML',
'python-social-auth',
'django-taggit',
'django-simple-captcha',
'django-haystack',
'whoosh',
'djangorestframework',
'django-gravatar2',
'markdown2',
'Markdown',
],
dependency_links = [
'git+git://github.com/omab/python-social-auth.git@c5dd3339#egg=python-social-auth',
'git+git://github.com/tomchristie/django-rest-framework.git@03b4c60b#egg=djangorestframework',
]
)
| #!/usr/bin/env python
from setuptools import setup
setup(
name='Dapi',
version='1.0',
description='DevAssistant Package Index',
author='Miro Hroncok',
author_email='mhroncok@redhat.com',
url='https://github.com/hroncok/dapi',
license='AGPLv3',
install_requires=[
'Django==1.6',
'psycopg2',
'South',
'daploader>=0.0.5',
'PyYAML',
'python-social-auth',
'django-taggit',
'django-simple-captcha',
'django-haystack',
'whoosh',
'djangorestframework',
'django-gravatar2',
'markdown2',
'Markdown',
],
dependency_links = [
'git+git://github.com/omab/python-social-auth.git@c5dd3339#egg=python-social-auth',
'git+git://github.com/tomchristie/django-rest-framework.git@03b4c60b#egg=djangorestframework',
'https://pypi.python.org/packages/source/d/daploader/daploader-0.0.5.tar.gz'
]
)
| Add dependency link to daploader from pypi to overide Openshift's cache | Add dependency link to daploader from pypi to overide Openshift's cache
| Python | agpl-3.0 | devassistant/dapi,devassistant/dapi,devassistant/dapi | #!/usr/bin/env python
from setuptools import setup
setup(
name='Dapi',
version='1.0',
description='DevAssistant Package Index',
author='Miro Hroncok',
author_email='mhroncok@redhat.com',
url='https://github.com/hroncok/dapi',
license='AGPLv3',
install_requires=[
'Django==1.6',
'psycopg2',
'South',
'daploader>=0.0.5',
'PyYAML',
'python-social-auth',
'django-taggit',
'django-simple-captcha',
'django-haystack',
'whoosh',
'djangorestframework',
'django-gravatar2',
'markdown2',
'Markdown',
],
dependency_links = [
'git+git://github.com/omab/python-social-auth.git@c5dd3339#egg=python-social-auth',
'git+git://github.com/tomchristie/django-rest-framework.git@03b4c60b#egg=djangorestframework',
]
)
Add dependency link to daploader from pypi to overide Openshift's cache | #!/usr/bin/env python
from setuptools import setup
setup(
name='Dapi',
version='1.0',
description='DevAssistant Package Index',
author='Miro Hroncok',
author_email='mhroncok@redhat.com',
url='https://github.com/hroncok/dapi',
license='AGPLv3',
install_requires=[
'Django==1.6',
'psycopg2',
'South',
'daploader>=0.0.5',
'PyYAML',
'python-social-auth',
'django-taggit',
'django-simple-captcha',
'django-haystack',
'whoosh',
'djangorestframework',
'django-gravatar2',
'markdown2',
'Markdown',
],
dependency_links = [
'git+git://github.com/omab/python-social-auth.git@c5dd3339#egg=python-social-auth',
'git+git://github.com/tomchristie/django-rest-framework.git@03b4c60b#egg=djangorestframework',
'https://pypi.python.org/packages/source/d/daploader/daploader-0.0.5.tar.gz'
]
)
| <commit_before>#!/usr/bin/env python
from setuptools import setup
setup(
name='Dapi',
version='1.0',
description='DevAssistant Package Index',
author='Miro Hroncok',
author_email='mhroncok@redhat.com',
url='https://github.com/hroncok/dapi',
license='AGPLv3',
install_requires=[
'Django==1.6',
'psycopg2',
'South',
'daploader>=0.0.5',
'PyYAML',
'python-social-auth',
'django-taggit',
'django-simple-captcha',
'django-haystack',
'whoosh',
'djangorestframework',
'django-gravatar2',
'markdown2',
'Markdown',
],
dependency_links = [
'git+git://github.com/omab/python-social-auth.git@c5dd3339#egg=python-social-auth',
'git+git://github.com/tomchristie/django-rest-framework.git@03b4c60b#egg=djangorestframework',
]
)
<commit_msg>Add dependency link to daploader from pypi to overide Openshift's cache<commit_after> | #!/usr/bin/env python
from setuptools import setup
setup(
name='Dapi',
version='1.0',
description='DevAssistant Package Index',
author='Miro Hroncok',
author_email='mhroncok@redhat.com',
url='https://github.com/hroncok/dapi',
license='AGPLv3',
install_requires=[
'Django==1.6',
'psycopg2',
'South',
'daploader>=0.0.5',
'PyYAML',
'python-social-auth',
'django-taggit',
'django-simple-captcha',
'django-haystack',
'whoosh',
'djangorestframework',
'django-gravatar2',
'markdown2',
'Markdown',
],
dependency_links = [
'git+git://github.com/omab/python-social-auth.git@c5dd3339#egg=python-social-auth',
'git+git://github.com/tomchristie/django-rest-framework.git@03b4c60b#egg=djangorestframework',
'https://pypi.python.org/packages/source/d/daploader/daploader-0.0.5.tar.gz'
]
)
| #!/usr/bin/env python
from setuptools import setup
setup(
name='Dapi',
version='1.0',
description='DevAssistant Package Index',
author='Miro Hroncok',
author_email='mhroncok@redhat.com',
url='https://github.com/hroncok/dapi',
license='AGPLv3',
install_requires=[
'Django==1.6',
'psycopg2',
'South',
'daploader>=0.0.5',
'PyYAML',
'python-social-auth',
'django-taggit',
'django-simple-captcha',
'django-haystack',
'whoosh',
'djangorestframework',
'django-gravatar2',
'markdown2',
'Markdown',
],
dependency_links = [
'git+git://github.com/omab/python-social-auth.git@c5dd3339#egg=python-social-auth',
'git+git://github.com/tomchristie/django-rest-framework.git@03b4c60b#egg=djangorestframework',
]
)
Add dependency link to daploader from pypi to overide Openshift's cache#!/usr/bin/env python
from setuptools import setup
setup(
name='Dapi',
version='1.0',
description='DevAssistant Package Index',
author='Miro Hroncok',
author_email='mhroncok@redhat.com',
url='https://github.com/hroncok/dapi',
license='AGPLv3',
install_requires=[
'Django==1.6',
'psycopg2',
'South',
'daploader>=0.0.5',
'PyYAML',
'python-social-auth',
'django-taggit',
'django-simple-captcha',
'django-haystack',
'whoosh',
'djangorestframework',
'django-gravatar2',
'markdown2',
'Markdown',
],
dependency_links = [
'git+git://github.com/omab/python-social-auth.git@c5dd3339#egg=python-social-auth',
'git+git://github.com/tomchristie/django-rest-framework.git@03b4c60b#egg=djangorestframework',
'https://pypi.python.org/packages/source/d/daploader/daploader-0.0.5.tar.gz'
]
)
| <commit_before>#!/usr/bin/env python
from setuptools import setup
setup(
name='Dapi',
version='1.0',
description='DevAssistant Package Index',
author='Miro Hroncok',
author_email='mhroncok@redhat.com',
url='https://github.com/hroncok/dapi',
license='AGPLv3',
install_requires=[
'Django==1.6',
'psycopg2',
'South',
'daploader>=0.0.5',
'PyYAML',
'python-social-auth',
'django-taggit',
'django-simple-captcha',
'django-haystack',
'whoosh',
'djangorestframework',
'django-gravatar2',
'markdown2',
'Markdown',
],
dependency_links = [
'git+git://github.com/omab/python-social-auth.git@c5dd3339#egg=python-social-auth',
'git+git://github.com/tomchristie/django-rest-framework.git@03b4c60b#egg=djangorestframework',
]
)
<commit_msg>Add dependency link to daploader from pypi to overide Openshift's cache<commit_after>#!/usr/bin/env python
from setuptools import setup
setup(
name='Dapi',
version='1.0',
description='DevAssistant Package Index',
author='Miro Hroncok',
author_email='mhroncok@redhat.com',
url='https://github.com/hroncok/dapi',
license='AGPLv3',
install_requires=[
'Django==1.6',
'psycopg2',
'South',
'daploader>=0.0.5',
'PyYAML',
'python-social-auth',
'django-taggit',
'django-simple-captcha',
'django-haystack',
'whoosh',
'djangorestframework',
'django-gravatar2',
'markdown2',
'Markdown',
],
dependency_links = [
'git+git://github.com/omab/python-social-auth.git@c5dd3339#egg=python-social-auth',
'git+git://github.com/tomchristie/django-rest-framework.git@03b4c60b#egg=djangorestframework',
'https://pypi.python.org/packages/source/d/daploader/daploader-0.0.5.tar.gz'
]
)
|
04a31c02c8186505e6e211e76903e5f1b62b3f90 | setup.py | setup.py | from distutils.core import setup, Extension
setup(name='python-pytun',
author='montag451',
author_email='montag451 at laposte.net',
maintainer='montag451',
maintainer_email='montag451 at laposte.net',
url='https://github.com/montag451/pytun',
description='Linux TUN/TAP wrapper for Python',
long_description=open('README.rst').read(),
version='2.2',
ext_modules=[Extension('pytun', ['pytun.c'])],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX :: Linux',
'Programming Language :: C',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: System :: Networking'])
| from distutils.core import setup, Extension
setup(name='python-pytun',
author='montag451',
author_email='montag451 at laposte.net',
maintainer='montag451',
maintainer_email='montag451 at laposte.net',
url='https://github.com/montag451/pytun',
description='Linux TUN/TAP wrapper for Python',
long_description=open('README.rst').read(),
version='2.2.1',
ext_modules=[Extension('pytun', ['pytun.c'])],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX :: Linux',
'Programming Language :: C',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: System :: Networking'])
| Change version number (v2.2 -> v2.2.1) | Change version number (v2.2 -> v2.2.1)
| Python | mit | montag451/pytun,montag451/pytun | from distutils.core import setup, Extension
setup(name='python-pytun',
author='montag451',
author_email='montag451 at laposte.net',
maintainer='montag451',
maintainer_email='montag451 at laposte.net',
url='https://github.com/montag451/pytun',
description='Linux TUN/TAP wrapper for Python',
long_description=open('README.rst').read(),
version='2.2',
ext_modules=[Extension('pytun', ['pytun.c'])],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX :: Linux',
'Programming Language :: C',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: System :: Networking'])
Change version number (v2.2 -> v2.2.1) | from distutils.core import setup, Extension
setup(name='python-pytun',
author='montag451',
author_email='montag451 at laposte.net',
maintainer='montag451',
maintainer_email='montag451 at laposte.net',
url='https://github.com/montag451/pytun',
description='Linux TUN/TAP wrapper for Python',
long_description=open('README.rst').read(),
version='2.2.1',
ext_modules=[Extension('pytun', ['pytun.c'])],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX :: Linux',
'Programming Language :: C',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: System :: Networking'])
| <commit_before>from distutils.core import setup, Extension
setup(name='python-pytun',
author='montag451',
author_email='montag451 at laposte.net',
maintainer='montag451',
maintainer_email='montag451 at laposte.net',
url='https://github.com/montag451/pytun',
description='Linux TUN/TAP wrapper for Python',
long_description=open('README.rst').read(),
version='2.2',
ext_modules=[Extension('pytun', ['pytun.c'])],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX :: Linux',
'Programming Language :: C',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: System :: Networking'])
<commit_msg>Change version number (v2.2 -> v2.2.1)<commit_after> | from distutils.core import setup, Extension
setup(name='python-pytun',
author='montag451',
author_email='montag451 at laposte.net',
maintainer='montag451',
maintainer_email='montag451 at laposte.net',
url='https://github.com/montag451/pytun',
description='Linux TUN/TAP wrapper for Python',
long_description=open('README.rst').read(),
version='2.2.1',
ext_modules=[Extension('pytun', ['pytun.c'])],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX :: Linux',
'Programming Language :: C',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: System :: Networking'])
| from distutils.core import setup, Extension
setup(name='python-pytun',
author='montag451',
author_email='montag451 at laposte.net',
maintainer='montag451',
maintainer_email='montag451 at laposte.net',
url='https://github.com/montag451/pytun',
description='Linux TUN/TAP wrapper for Python',
long_description=open('README.rst').read(),
version='2.2',
ext_modules=[Extension('pytun', ['pytun.c'])],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX :: Linux',
'Programming Language :: C',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: System :: Networking'])
Change version number (v2.2 -> v2.2.1)from distutils.core import setup, Extension
setup(name='python-pytun',
author='montag451',
author_email='montag451 at laposte.net',
maintainer='montag451',
maintainer_email='montag451 at laposte.net',
url='https://github.com/montag451/pytun',
description='Linux TUN/TAP wrapper for Python',
long_description=open('README.rst').read(),
version='2.2.1',
ext_modules=[Extension('pytun', ['pytun.c'])],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX :: Linux',
'Programming Language :: C',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: System :: Networking'])
| <commit_before>from distutils.core import setup, Extension
setup(name='python-pytun',
author='montag451',
author_email='montag451 at laposte.net',
maintainer='montag451',
maintainer_email='montag451 at laposte.net',
url='https://github.com/montag451/pytun',
description='Linux TUN/TAP wrapper for Python',
long_description=open('README.rst').read(),
version='2.2',
ext_modules=[Extension('pytun', ['pytun.c'])],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX :: Linux',
'Programming Language :: C',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: System :: Networking'])
<commit_msg>Change version number (v2.2 -> v2.2.1)<commit_after>from distutils.core import setup, Extension
setup(name='python-pytun',
author='montag451',
author_email='montag451 at laposte.net',
maintainer='montag451',
maintainer_email='montag451 at laposte.net',
url='https://github.com/montag451/pytun',
description='Linux TUN/TAP wrapper for Python',
long_description=open('README.rst').read(),
version='2.2.1',
ext_modules=[Extension('pytun', ['pytun.c'])],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX :: Linux',
'Programming Language :: C',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: System :: Networking'])
|
6ab083eede68946f4a87d24732cd82be09734d52 | setup.py | setup.py | import os
from setuptools import setup
longDesc = ""
if os.path.exists("README.md"):
longDesc = open("README.md").read().strip()
setup(
name = "pytesseract",
version = "0.1.6",
author = "Samuel Hoffstaetter",
author_email="",
maintainer = "Matthias Lee",
maintainer_email = "pytesseract@madmaze.net",
description = ("Python-tesseract is a python wrapper for google's Tesseract-OCR"),
long_description = longDesc,
license = "GPLv3",
keywords = "python-tesseract OCR Python",
url = "https://github.com/madmaze/python-tesseract",
packages=['pytesseract'],
package_dir={'pytesseract': 'src'},
package_data = {'pytesseract': ['*.png','*.jpg']},
entry_points = {'console_scripts': ['pytesseract = pytesseract.pytesseract:main']},
classifiers = [
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
]
)
| import os
from setuptools import setup
longDesc = ""
if os.path.exists("README.rst"):
longDesc = open("README.rst").read().strip()
setup(
name = "pytesseract",
version = "0.1.6",
author = "Samuel Hoffstaetter",
author_email="",
maintainer = "Matthias Lee",
maintainer_email = "pytesseract@madmaze.net",
description = ("Python-tesseract is a python wrapper for google's Tesseract-OCR"),
long_description = longDesc,
license = "GPLv3",
keywords = "python-tesseract OCR Python",
url = "https://github.com/madmaze/python-tesseract",
packages=['pytesseract'],
package_dir={'pytesseract': 'src'},
package_data = {'pytesseract': ['*.png','*.jpg']},
entry_points = {'console_scripts': ['pytesseract = pytesseract.pytesseract:main']},
classifiers = [
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
]
)
| Update the long_description with README.rst | Update the long_description with README.rst | Python | apache-2.0 | madmaze/pytesseract | import os
from setuptools import setup
longDesc = ""
if os.path.exists("README.md"):
longDesc = open("README.md").read().strip()
setup(
name = "pytesseract",
version = "0.1.6",
author = "Samuel Hoffstaetter",
author_email="",
maintainer = "Matthias Lee",
maintainer_email = "pytesseract@madmaze.net",
description = ("Python-tesseract is a python wrapper for google's Tesseract-OCR"),
long_description = longDesc,
license = "GPLv3",
keywords = "python-tesseract OCR Python",
url = "https://github.com/madmaze/python-tesseract",
packages=['pytesseract'],
package_dir={'pytesseract': 'src'},
package_data = {'pytesseract': ['*.png','*.jpg']},
entry_points = {'console_scripts': ['pytesseract = pytesseract.pytesseract:main']},
classifiers = [
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
]
)
Update the long_description with README.rst | import os
from setuptools import setup
longDesc = ""
if os.path.exists("README.rst"):
longDesc = open("README.rst").read().strip()
setup(
name = "pytesseract",
version = "0.1.6",
author = "Samuel Hoffstaetter",
author_email="",
maintainer = "Matthias Lee",
maintainer_email = "pytesseract@madmaze.net",
description = ("Python-tesseract is a python wrapper for google's Tesseract-OCR"),
long_description = longDesc,
license = "GPLv3",
keywords = "python-tesseract OCR Python",
url = "https://github.com/madmaze/python-tesseract",
packages=['pytesseract'],
package_dir={'pytesseract': 'src'},
package_data = {'pytesseract': ['*.png','*.jpg']},
entry_points = {'console_scripts': ['pytesseract = pytesseract.pytesseract:main']},
classifiers = [
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
]
)
| <commit_before>import os
from setuptools import setup
longDesc = ""
if os.path.exists("README.md"):
longDesc = open("README.md").read().strip()
setup(
name = "pytesseract",
version = "0.1.6",
author = "Samuel Hoffstaetter",
author_email="",
maintainer = "Matthias Lee",
maintainer_email = "pytesseract@madmaze.net",
description = ("Python-tesseract is a python wrapper for google's Tesseract-OCR"),
long_description = longDesc,
license = "GPLv3",
keywords = "python-tesseract OCR Python",
url = "https://github.com/madmaze/python-tesseract",
packages=['pytesseract'],
package_dir={'pytesseract': 'src'},
package_data = {'pytesseract': ['*.png','*.jpg']},
entry_points = {'console_scripts': ['pytesseract = pytesseract.pytesseract:main']},
classifiers = [
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
]
)
<commit_msg>Update the long_description with README.rst<commit_after> | import os
from setuptools import setup
longDesc = ""
if os.path.exists("README.rst"):
longDesc = open("README.rst").read().strip()
setup(
name = "pytesseract",
version = "0.1.6",
author = "Samuel Hoffstaetter",
author_email="",
maintainer = "Matthias Lee",
maintainer_email = "pytesseract@madmaze.net",
description = ("Python-tesseract is a python wrapper for google's Tesseract-OCR"),
long_description = longDesc,
license = "GPLv3",
keywords = "python-tesseract OCR Python",
url = "https://github.com/madmaze/python-tesseract",
packages=['pytesseract'],
package_dir={'pytesseract': 'src'},
package_data = {'pytesseract': ['*.png','*.jpg']},
entry_points = {'console_scripts': ['pytesseract = pytesseract.pytesseract:main']},
classifiers = [
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
]
)
| import os
from setuptools import setup
longDesc = ""
if os.path.exists("README.md"):
longDesc = open("README.md").read().strip()
setup(
name = "pytesseract",
version = "0.1.6",
author = "Samuel Hoffstaetter",
author_email="",
maintainer = "Matthias Lee",
maintainer_email = "pytesseract@madmaze.net",
description = ("Python-tesseract is a python wrapper for google's Tesseract-OCR"),
long_description = longDesc,
license = "GPLv3",
keywords = "python-tesseract OCR Python",
url = "https://github.com/madmaze/python-tesseract",
packages=['pytesseract'],
package_dir={'pytesseract': 'src'},
package_data = {'pytesseract': ['*.png','*.jpg']},
entry_points = {'console_scripts': ['pytesseract = pytesseract.pytesseract:main']},
classifiers = [
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
]
)
Update the long_description with README.rstimport os
from setuptools import setup
longDesc = ""
if os.path.exists("README.rst"):
longDesc = open("README.rst").read().strip()
setup(
name = "pytesseract",
version = "0.1.6",
author = "Samuel Hoffstaetter",
author_email="",
maintainer = "Matthias Lee",
maintainer_email = "pytesseract@madmaze.net",
description = ("Python-tesseract is a python wrapper for google's Tesseract-OCR"),
long_description = longDesc,
license = "GPLv3",
keywords = "python-tesseract OCR Python",
url = "https://github.com/madmaze/python-tesseract",
packages=['pytesseract'],
package_dir={'pytesseract': 'src'},
package_data = {'pytesseract': ['*.png','*.jpg']},
entry_points = {'console_scripts': ['pytesseract = pytesseract.pytesseract:main']},
classifiers = [
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
]
)
| <commit_before>import os
from setuptools import setup
longDesc = ""
if os.path.exists("README.md"):
longDesc = open("README.md").read().strip()
setup(
name = "pytesseract",
version = "0.1.6",
author = "Samuel Hoffstaetter",
author_email="",
maintainer = "Matthias Lee",
maintainer_email = "pytesseract@madmaze.net",
description = ("Python-tesseract is a python wrapper for google's Tesseract-OCR"),
long_description = longDesc,
license = "GPLv3",
keywords = "python-tesseract OCR Python",
url = "https://github.com/madmaze/python-tesseract",
packages=['pytesseract'],
package_dir={'pytesseract': 'src'},
package_data = {'pytesseract': ['*.png','*.jpg']},
entry_points = {'console_scripts': ['pytesseract = pytesseract.pytesseract:main']},
classifiers = [
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
]
)
<commit_msg>Update the long_description with README.rst<commit_after>import os
from setuptools import setup
longDesc = ""
if os.path.exists("README.rst"):
longDesc = open("README.rst").read().strip()
setup(
name = "pytesseract",
version = "0.1.6",
author = "Samuel Hoffstaetter",
author_email="",
maintainer = "Matthias Lee",
maintainer_email = "pytesseract@madmaze.net",
description = ("Python-tesseract is a python wrapper for google's Tesseract-OCR"),
long_description = longDesc,
license = "GPLv3",
keywords = "python-tesseract OCR Python",
url = "https://github.com/madmaze/python-tesseract",
packages=['pytesseract'],
package_dir={'pytesseract': 'src'},
package_data = {'pytesseract': ['*.png','*.jpg']},
entry_points = {'console_scripts': ['pytesseract = pytesseract.pytesseract:main']},
classifiers = [
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
]
)
|
1ba7e00ac7ef7f22aed22833940d3666d7584deb | setup.py | setup.py | from setuptools import setup
setup(
name='tangled.sqlalchemy',
version='0.1a3.dev0',
description='Tangled SQLAlchemy integration',
long_description=open('README.rst').read(),
url='http://tangledframework.org/',
download_url='https://github.com/TangledWeb/tangled.sqlalchemy/tags',
author='Wyatt Baldwin',
author_email='self@wyattbaldwin.com',
packages=[
'tangled',
'tangled.sqlalchemy',
],
install_requires=[
'tangled>=0.1a5',
'SQLAlchemy',
],
extras_require={
'dev': [
'tangled[dev]>=0.1a5',
],
},
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
],
)
| from setuptools import setup
setup(
name='tangled.sqlalchemy',
version='0.1a3.dev0',
description='Tangled SQLAlchemy integration',
long_description=open('README.rst').read(),
url='http://tangledframework.org/',
download_url='https://github.com/TangledWeb/tangled.sqlalchemy/tags',
author='Wyatt Baldwin',
author_email='self@wyattbaldwin.com',
packages=[
'tangled',
'tangled.sqlalchemy',
],
install_requires=[
'tangled>=0.1a5',
'SQLAlchemy',
],
extras_require={
'dev': [
'tangled[dev]>=0.1a5',
],
},
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
],
)
| Add generic Python 3 trove classifier | Add generic Python 3 trove classifier
| Python | mit | TangledWeb/tangled.sqlalchemy | from setuptools import setup
setup(
name='tangled.sqlalchemy',
version='0.1a3.dev0',
description='Tangled SQLAlchemy integration',
long_description=open('README.rst').read(),
url='http://tangledframework.org/',
download_url='https://github.com/TangledWeb/tangled.sqlalchemy/tags',
author='Wyatt Baldwin',
author_email='self@wyattbaldwin.com',
packages=[
'tangled',
'tangled.sqlalchemy',
],
install_requires=[
'tangled>=0.1a5',
'SQLAlchemy',
],
extras_require={
'dev': [
'tangled[dev]>=0.1a5',
],
},
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
],
)
Add generic Python 3 trove classifier | from setuptools import setup
setup(
name='tangled.sqlalchemy',
version='0.1a3.dev0',
description='Tangled SQLAlchemy integration',
long_description=open('README.rst').read(),
url='http://tangledframework.org/',
download_url='https://github.com/TangledWeb/tangled.sqlalchemy/tags',
author='Wyatt Baldwin',
author_email='self@wyattbaldwin.com',
packages=[
'tangled',
'tangled.sqlalchemy',
],
install_requires=[
'tangled>=0.1a5',
'SQLAlchemy',
],
extras_require={
'dev': [
'tangled[dev]>=0.1a5',
],
},
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
],
)
| <commit_before>from setuptools import setup
setup(
name='tangled.sqlalchemy',
version='0.1a3.dev0',
description='Tangled SQLAlchemy integration',
long_description=open('README.rst').read(),
url='http://tangledframework.org/',
download_url='https://github.com/TangledWeb/tangled.sqlalchemy/tags',
author='Wyatt Baldwin',
author_email='self@wyattbaldwin.com',
packages=[
'tangled',
'tangled.sqlalchemy',
],
install_requires=[
'tangled>=0.1a5',
'SQLAlchemy',
],
extras_require={
'dev': [
'tangled[dev]>=0.1a5',
],
},
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
],
)
<commit_msg>Add generic Python 3 trove classifier<commit_after> | from setuptools import setup
setup(
name='tangled.sqlalchemy',
version='0.1a3.dev0',
description='Tangled SQLAlchemy integration',
long_description=open('README.rst').read(),
url='http://tangledframework.org/',
download_url='https://github.com/TangledWeb/tangled.sqlalchemy/tags',
author='Wyatt Baldwin',
author_email='self@wyattbaldwin.com',
packages=[
'tangled',
'tangled.sqlalchemy',
],
install_requires=[
'tangled>=0.1a5',
'SQLAlchemy',
],
extras_require={
'dev': [
'tangled[dev]>=0.1a5',
],
},
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
],
)
| from setuptools import setup
setup(
name='tangled.sqlalchemy',
version='0.1a3.dev0',
description='Tangled SQLAlchemy integration',
long_description=open('README.rst').read(),
url='http://tangledframework.org/',
download_url='https://github.com/TangledWeb/tangled.sqlalchemy/tags',
author='Wyatt Baldwin',
author_email='self@wyattbaldwin.com',
packages=[
'tangled',
'tangled.sqlalchemy',
],
install_requires=[
'tangled>=0.1a5',
'SQLAlchemy',
],
extras_require={
'dev': [
'tangled[dev]>=0.1a5',
],
},
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
],
)
Add generic Python 3 trove classifierfrom setuptools import setup
setup(
name='tangled.sqlalchemy',
version='0.1a3.dev0',
description='Tangled SQLAlchemy integration',
long_description=open('README.rst').read(),
url='http://tangledframework.org/',
download_url='https://github.com/TangledWeb/tangled.sqlalchemy/tags',
author='Wyatt Baldwin',
author_email='self@wyattbaldwin.com',
packages=[
'tangled',
'tangled.sqlalchemy',
],
install_requires=[
'tangled>=0.1a5',
'SQLAlchemy',
],
extras_require={
'dev': [
'tangled[dev]>=0.1a5',
],
},
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
],
)
| <commit_before>from setuptools import setup
setup(
name='tangled.sqlalchemy',
version='0.1a3.dev0',
description='Tangled SQLAlchemy integration',
long_description=open('README.rst').read(),
url='http://tangledframework.org/',
download_url='https://github.com/TangledWeb/tangled.sqlalchemy/tags',
author='Wyatt Baldwin',
author_email='self@wyattbaldwin.com',
packages=[
'tangled',
'tangled.sqlalchemy',
],
install_requires=[
'tangled>=0.1a5',
'SQLAlchemy',
],
extras_require={
'dev': [
'tangled[dev]>=0.1a5',
],
},
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
],
)
<commit_msg>Add generic Python 3 trove classifier<commit_after>from setuptools import setup
setup(
name='tangled.sqlalchemy',
version='0.1a3.dev0',
description='Tangled SQLAlchemy integration',
long_description=open('README.rst').read(),
url='http://tangledframework.org/',
download_url='https://github.com/TangledWeb/tangled.sqlalchemy/tags',
author='Wyatt Baldwin',
author_email='self@wyattbaldwin.com',
packages=[
'tangled',
'tangled.sqlalchemy',
],
install_requires=[
'tangled>=0.1a5',
'SQLAlchemy',
],
extras_require={
'dev': [
'tangled[dev]>=0.1a5',
],
},
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
],
)
|
a84159df875f6a07300deb8f98224f92e0578445 | setup.py | setup.py | import os
from os.path import relpath, join
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
def find_package_data(data_root, package_root):
files = []
for root, dirnames, filenames in os.walk(data_root):
for fn in filenames:
files.append(relpath(join(root, fn), package_root))
return files
setup(
name = "smarty",
version = "0.1.5",
author = "John Chodera, David Mobley, and others",
author_email = "john.chodera@choderalab.org",
description = ("Automated Bayesian atomtype sampling"),
license = "MIT",
keywords = "Bayesian atomtype sampling forcefield parameterization",
url = "http://github.com/open-forcefield-group/smarty",
packages=['smarty', 'smarty/tests', 'smarty/data'],
long_description=read('README.md'),
classifiers=[
"Development Status :: 3 - Alpha",
"Topic :: Utilities",
"License :: OSI Approved :: MIT",
],
entry_points={'console_scripts': ['smarty = smarty.cli_smarty:main', 'smirky = smarty.cli_smirky:main']},
package_data={'smarty': find_package_data('smarty/data', 'smarty')},
)
| import os
from os.path import relpath, join
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
def find_package_data(data_root, package_root):
files = []
for root, dirnames, filenames in os.walk(data_root):
for fn in filenames:
files.append(relpath(join(root, fn), package_root))
return files
setup(
name = "smarty",
version = "0.1.6",
author = "John Chodera, David Mobley, and others",
author_email = "john.chodera@choderalab.org",
description = ("Automated Bayesian atomtype sampling"),
license = "MIT",
keywords = "Bayesian atomtype sampling forcefield parameterization",
url = "http://github.com/open-forcefield-group/smarty",
packages=['smarty', 'smarty/tests', 'smarty/data'],
long_description=read('README.md'),
classifiers=[
"Development Status :: 3 - Alpha",
"Topic :: Utilities",
"License :: OSI Approved :: MIT",
],
entry_points={'console_scripts': ['smarty = smarty.cli_smarty:main', 'smirky = smarty.cli_smirky:main']},
package_data={'smarty': find_package_data('smarty/data', 'smarty')},
)
| Increment version number now that 0.1.5 release out. | Increment version number now that 0.1.5 release out.
| Python | mit | open-forcefield-group/openforcefield,open-forcefield-group/openforcefield,openforcefield/openff-toolkit,open-forcefield-group/openforcefield,openforcefield/openff-toolkit | import os
from os.path import relpath, join
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
def find_package_data(data_root, package_root):
files = []
for root, dirnames, filenames in os.walk(data_root):
for fn in filenames:
files.append(relpath(join(root, fn), package_root))
return files
setup(
name = "smarty",
version = "0.1.5",
author = "John Chodera, David Mobley, and others",
author_email = "john.chodera@choderalab.org",
description = ("Automated Bayesian atomtype sampling"),
license = "MIT",
keywords = "Bayesian atomtype sampling forcefield parameterization",
url = "http://github.com/open-forcefield-group/smarty",
packages=['smarty', 'smarty/tests', 'smarty/data'],
long_description=read('README.md'),
classifiers=[
"Development Status :: 3 - Alpha",
"Topic :: Utilities",
"License :: OSI Approved :: MIT",
],
entry_points={'console_scripts': ['smarty = smarty.cli_smarty:main', 'smirky = smarty.cli_smirky:main']},
package_data={'smarty': find_package_data('smarty/data', 'smarty')},
)
Increment version number now that 0.1.5 release out. | import os
from os.path import relpath, join
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
def find_package_data(data_root, package_root):
files = []
for root, dirnames, filenames in os.walk(data_root):
for fn in filenames:
files.append(relpath(join(root, fn), package_root))
return files
setup(
name = "smarty",
version = "0.1.6",
author = "John Chodera, David Mobley, and others",
author_email = "john.chodera@choderalab.org",
description = ("Automated Bayesian atomtype sampling"),
license = "MIT",
keywords = "Bayesian atomtype sampling forcefield parameterization",
url = "http://github.com/open-forcefield-group/smarty",
packages=['smarty', 'smarty/tests', 'smarty/data'],
long_description=read('README.md'),
classifiers=[
"Development Status :: 3 - Alpha",
"Topic :: Utilities",
"License :: OSI Approved :: MIT",
],
entry_points={'console_scripts': ['smarty = smarty.cli_smarty:main', 'smirky = smarty.cli_smirky:main']},
package_data={'smarty': find_package_data('smarty/data', 'smarty')},
)
| <commit_before>import os
from os.path import relpath, join
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
def find_package_data(data_root, package_root):
files = []
for root, dirnames, filenames in os.walk(data_root):
for fn in filenames:
files.append(relpath(join(root, fn), package_root))
return files
setup(
name = "smarty",
version = "0.1.5",
author = "John Chodera, David Mobley, and others",
author_email = "john.chodera@choderalab.org",
description = ("Automated Bayesian atomtype sampling"),
license = "MIT",
keywords = "Bayesian atomtype sampling forcefield parameterization",
url = "http://github.com/open-forcefield-group/smarty",
packages=['smarty', 'smarty/tests', 'smarty/data'],
long_description=read('README.md'),
classifiers=[
"Development Status :: 3 - Alpha",
"Topic :: Utilities",
"License :: OSI Approved :: MIT",
],
entry_points={'console_scripts': ['smarty = smarty.cli_smarty:main', 'smirky = smarty.cli_smirky:main']},
package_data={'smarty': find_package_data('smarty/data', 'smarty')},
)
<commit_msg>Increment version number now that 0.1.5 release out.<commit_after> | import os
from os.path import relpath, join
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
def find_package_data(data_root, package_root):
files = []
for root, dirnames, filenames in os.walk(data_root):
for fn in filenames:
files.append(relpath(join(root, fn), package_root))
return files
setup(
name = "smarty",
version = "0.1.6",
author = "John Chodera, David Mobley, and others",
author_email = "john.chodera@choderalab.org",
description = ("Automated Bayesian atomtype sampling"),
license = "MIT",
keywords = "Bayesian atomtype sampling forcefield parameterization",
url = "http://github.com/open-forcefield-group/smarty",
packages=['smarty', 'smarty/tests', 'smarty/data'],
long_description=read('README.md'),
classifiers=[
"Development Status :: 3 - Alpha",
"Topic :: Utilities",
"License :: OSI Approved :: MIT",
],
entry_points={'console_scripts': ['smarty = smarty.cli_smarty:main', 'smirky = smarty.cli_smirky:main']},
package_data={'smarty': find_package_data('smarty/data', 'smarty')},
)
| import os
from os.path import relpath, join
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
def find_package_data(data_root, package_root):
files = []
for root, dirnames, filenames in os.walk(data_root):
for fn in filenames:
files.append(relpath(join(root, fn), package_root))
return files
setup(
name = "smarty",
version = "0.1.5",
author = "John Chodera, David Mobley, and others",
author_email = "john.chodera@choderalab.org",
description = ("Automated Bayesian atomtype sampling"),
license = "MIT",
keywords = "Bayesian atomtype sampling forcefield parameterization",
url = "http://github.com/open-forcefield-group/smarty",
packages=['smarty', 'smarty/tests', 'smarty/data'],
long_description=read('README.md'),
classifiers=[
"Development Status :: 3 - Alpha",
"Topic :: Utilities",
"License :: OSI Approved :: MIT",
],
entry_points={'console_scripts': ['smarty = smarty.cli_smarty:main', 'smirky = smarty.cli_smirky:main']},
package_data={'smarty': find_package_data('smarty/data', 'smarty')},
)
Increment version number now that 0.1.5 release out.import os
from os.path import relpath, join
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
def find_package_data(data_root, package_root):
files = []
for root, dirnames, filenames in os.walk(data_root):
for fn in filenames:
files.append(relpath(join(root, fn), package_root))
return files
setup(
name = "smarty",
version = "0.1.6",
author = "John Chodera, David Mobley, and others",
author_email = "john.chodera@choderalab.org",
description = ("Automated Bayesian atomtype sampling"),
license = "MIT",
keywords = "Bayesian atomtype sampling forcefield parameterization",
url = "http://github.com/open-forcefield-group/smarty",
packages=['smarty', 'smarty/tests', 'smarty/data'],
long_description=read('README.md'),
classifiers=[
"Development Status :: 3 - Alpha",
"Topic :: Utilities",
"License :: OSI Approved :: MIT",
],
entry_points={'console_scripts': ['smarty = smarty.cli_smarty:main', 'smirky = smarty.cli_smirky:main']},
package_data={'smarty': find_package_data('smarty/data', 'smarty')},
)
| <commit_before>import os
from os.path import relpath, join
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
def find_package_data(data_root, package_root):
files = []
for root, dirnames, filenames in os.walk(data_root):
for fn in filenames:
files.append(relpath(join(root, fn), package_root))
return files
setup(
name = "smarty",
version = "0.1.5",
author = "John Chodera, David Mobley, and others",
author_email = "john.chodera@choderalab.org",
description = ("Automated Bayesian atomtype sampling"),
license = "MIT",
keywords = "Bayesian atomtype sampling forcefield parameterization",
url = "http://github.com/open-forcefield-group/smarty",
packages=['smarty', 'smarty/tests', 'smarty/data'],
long_description=read('README.md'),
classifiers=[
"Development Status :: 3 - Alpha",
"Topic :: Utilities",
"License :: OSI Approved :: MIT",
],
entry_points={'console_scripts': ['smarty = smarty.cli_smarty:main', 'smirky = smarty.cli_smirky:main']},
package_data={'smarty': find_package_data('smarty/data', 'smarty')},
)
<commit_msg>Increment version number now that 0.1.5 release out.<commit_after>import os
from os.path import relpath, join
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
def find_package_data(data_root, package_root):
files = []
for root, dirnames, filenames in os.walk(data_root):
for fn in filenames:
files.append(relpath(join(root, fn), package_root))
return files
setup(
name = "smarty",
version = "0.1.6",
author = "John Chodera, David Mobley, and others",
author_email = "john.chodera@choderalab.org",
description = ("Automated Bayesian atomtype sampling"),
license = "MIT",
keywords = "Bayesian atomtype sampling forcefield parameterization",
url = "http://github.com/open-forcefield-group/smarty",
packages=['smarty', 'smarty/tests', 'smarty/data'],
long_description=read('README.md'),
classifiers=[
"Development Status :: 3 - Alpha",
"Topic :: Utilities",
"License :: OSI Approved :: MIT",
],
entry_points={'console_scripts': ['smarty = smarty.cli_smarty:main', 'smirky = smarty.cli_smirky:main']},
package_data={'smarty': find_package_data('smarty/data', 'smarty')},
)
|
fb166c2afa110b758efbc8aeae9ff177050bfa0c | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup
import sys
setup(name="OnionLauncher",
version="0.0.1",
description="Launcher for Tor",
license = "BSD",
author="Neel Chauhan",
author_email="neel@neelc.org",
url="https://www.github.com/neelchauhan/OnionLauncher/",
packages=["OnionLauncher"],
entry_points={'gui_scripts': ['OnionLauncher=OnionLauncher.main:main_loop']},
package_data={"OnionLauncher": ["data/*"]},
install_requires=[
"stem",
],
data_files=[
(sys.prefix + "/share/pixmaps", ["icons/scalable/onionlauncher.svg"]),
(sys.prefix + "/share/applications", ["data/onionlauncher.desktop"]),
],
classifiers=[
"Environment :: X11 Applications :: Qt",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
],
)
| #!/usr/bin/env python
from setuptools import setup
import sys
setup(name="OnionLauncher",
version="0.0.1",
description="Launcher for Tor",
license = "BSD",
author="Neel Chauhan",
author_email="neel@neelc.org",
url="https://www.github.com/neelchauhan/OnionLauncher/",
packages=["OnionLauncher"],
entry_points={'gui_scripts': ['OnionLauncher=OnionLauncher.main:main_loop']},
package_data={"OnionLauncher": ["ui_files/*"]},
install_requires=[
"stem",
],
data_files=[
(sys.prefix + "/share/pixmaps", ["icons/scalable/onionlauncher.svg"]),
(sys.prefix + "/share/applications", ["data/onionlauncher.desktop"]),
],
classifiers=[
"Environment :: X11 Applications :: Qt",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
],
)
| Add correct filename in OnionLauncher ui directory | Add correct filename in OnionLauncher ui directory
| Python | bsd-2-clause | neelchauhan/OnionLauncher | #!/usr/bin/env python
from setuptools import setup
import sys
setup(name="OnionLauncher",
version="0.0.1",
description="Launcher for Tor",
license = "BSD",
author="Neel Chauhan",
author_email="neel@neelc.org",
url="https://www.github.com/neelchauhan/OnionLauncher/",
packages=["OnionLauncher"],
entry_points={'gui_scripts': ['OnionLauncher=OnionLauncher.main:main_loop']},
package_data={"OnionLauncher": ["data/*"]},
install_requires=[
"stem",
],
data_files=[
(sys.prefix + "/share/pixmaps", ["icons/scalable/onionlauncher.svg"]),
(sys.prefix + "/share/applications", ["data/onionlauncher.desktop"]),
],
classifiers=[
"Environment :: X11 Applications :: Qt",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
],
)
Add correct filename in OnionLauncher ui directory | #!/usr/bin/env python
from setuptools import setup
import sys
setup(name="OnionLauncher",
version="0.0.1",
description="Launcher for Tor",
license = "BSD",
author="Neel Chauhan",
author_email="neel@neelc.org",
url="https://www.github.com/neelchauhan/OnionLauncher/",
packages=["OnionLauncher"],
entry_points={'gui_scripts': ['OnionLauncher=OnionLauncher.main:main_loop']},
package_data={"OnionLauncher": ["ui_files/*"]},
install_requires=[
"stem",
],
data_files=[
(sys.prefix + "/share/pixmaps", ["icons/scalable/onionlauncher.svg"]),
(sys.prefix + "/share/applications", ["data/onionlauncher.desktop"]),
],
classifiers=[
"Environment :: X11 Applications :: Qt",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
],
)
| <commit_before>#!/usr/bin/env python
from setuptools import setup
import sys
setup(name="OnionLauncher",
version="0.0.1",
description="Launcher for Tor",
license = "BSD",
author="Neel Chauhan",
author_email="neel@neelc.org",
url="https://www.github.com/neelchauhan/OnionLauncher/",
packages=["OnionLauncher"],
entry_points={'gui_scripts': ['OnionLauncher=OnionLauncher.main:main_loop']},
package_data={"OnionLauncher": ["data/*"]},
install_requires=[
"stem",
],
data_files=[
(sys.prefix + "/share/pixmaps", ["icons/scalable/onionlauncher.svg"]),
(sys.prefix + "/share/applications", ["data/onionlauncher.desktop"]),
],
classifiers=[
"Environment :: X11 Applications :: Qt",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
],
)
<commit_msg>Add correct filename in OnionLauncher ui directory<commit_after> | #!/usr/bin/env python
from setuptools import setup
import sys
setup(name="OnionLauncher",
version="0.0.1",
description="Launcher for Tor",
license = "BSD",
author="Neel Chauhan",
author_email="neel@neelc.org",
url="https://www.github.com/neelchauhan/OnionLauncher/",
packages=["OnionLauncher"],
entry_points={'gui_scripts': ['OnionLauncher=OnionLauncher.main:main_loop']},
package_data={"OnionLauncher": ["ui_files/*"]},
install_requires=[
"stem",
],
data_files=[
(sys.prefix + "/share/pixmaps", ["icons/scalable/onionlauncher.svg"]),
(sys.prefix + "/share/applications", ["data/onionlauncher.desktop"]),
],
classifiers=[
"Environment :: X11 Applications :: Qt",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
],
)
| #!/usr/bin/env python
from setuptools import setup
import sys
setup(name="OnionLauncher",
version="0.0.1",
description="Launcher for Tor",
license = "BSD",
author="Neel Chauhan",
author_email="neel@neelc.org",
url="https://www.github.com/neelchauhan/OnionLauncher/",
packages=["OnionLauncher"],
entry_points={'gui_scripts': ['OnionLauncher=OnionLauncher.main:main_loop']},
package_data={"OnionLauncher": ["data/*"]},
install_requires=[
"stem",
],
data_files=[
(sys.prefix + "/share/pixmaps", ["icons/scalable/onionlauncher.svg"]),
(sys.prefix + "/share/applications", ["data/onionlauncher.desktop"]),
],
classifiers=[
"Environment :: X11 Applications :: Qt",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
],
)
Add correct filename in OnionLauncher ui directory#!/usr/bin/env python
from setuptools import setup
import sys
setup(name="OnionLauncher",
version="0.0.1",
description="Launcher for Tor",
license = "BSD",
author="Neel Chauhan",
author_email="neel@neelc.org",
url="https://www.github.com/neelchauhan/OnionLauncher/",
packages=["OnionLauncher"],
entry_points={'gui_scripts': ['OnionLauncher=OnionLauncher.main:main_loop']},
package_data={"OnionLauncher": ["ui_files/*"]},
install_requires=[
"stem",
],
data_files=[
(sys.prefix + "/share/pixmaps", ["icons/scalable/onionlauncher.svg"]),
(sys.prefix + "/share/applications", ["data/onionlauncher.desktop"]),
],
classifiers=[
"Environment :: X11 Applications :: Qt",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
],
)
| <commit_before>#!/usr/bin/env python
from setuptools import setup
import sys
setup(name="OnionLauncher",
version="0.0.1",
description="Launcher for Tor",
license = "BSD",
author="Neel Chauhan",
author_email="neel@neelc.org",
url="https://www.github.com/neelchauhan/OnionLauncher/",
packages=["OnionLauncher"],
entry_points={'gui_scripts': ['OnionLauncher=OnionLauncher.main:main_loop']},
package_data={"OnionLauncher": ["data/*"]},
install_requires=[
"stem",
],
data_files=[
(sys.prefix + "/share/pixmaps", ["icons/scalable/onionlauncher.svg"]),
(sys.prefix + "/share/applications", ["data/onionlauncher.desktop"]),
],
classifiers=[
"Environment :: X11 Applications :: Qt",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
],
)
<commit_msg>Add correct filename in OnionLauncher ui directory<commit_after>#!/usr/bin/env python
from setuptools import setup
import sys
setup(name="OnionLauncher",
version="0.0.1",
description="Launcher for Tor",
license = "BSD",
author="Neel Chauhan",
author_email="neel@neelc.org",
url="https://www.github.com/neelchauhan/OnionLauncher/",
packages=["OnionLauncher"],
entry_points={'gui_scripts': ['OnionLauncher=OnionLauncher.main:main_loop']},
package_data={"OnionLauncher": ["ui_files/*"]},
install_requires=[
"stem",
],
data_files=[
(sys.prefix + "/share/pixmaps", ["icons/scalable/onionlauncher.svg"]),
(sys.prefix + "/share/applications", ["data/onionlauncher.desktop"]),
],
classifiers=[
"Environment :: X11 Applications :: Qt",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
],
)
|
3352920f7e92e2732eb2914313bdee6b5ab7f549 | setup.py | setup.py | # -*- coding: utf-8 -*-
# Copyright (C) 2012-2014 MUJIN Inc
from distutils.core import setup
try:
from mujincommon.setuptools import Distribution
except ImportError:
from distutils.dist import Distribution
version = {}
exec(open('python/mujincontrollerclient/version.py').read(), version)
setup(
distclass=Distribution,
name='mujincontrollerclient',
version=version['__version__'],
packages=['mujincontrollerclient'],
package_dir={'mujincontrollerclient': 'python/mujincontrollerclient'},
scripts=['bin/mujin_controllerclientpy_registerscene.py', 'bin/mujin_controllerclientpy_applyconfig.py'],
locale_dir='locale',
license='Apache License, Version 2.0',
long_description=open('README.rst').read(),
# flake8 compliance configuration
enable_flake8=True, # Enable checks
fail_on_flake=True, # Fail builds when checks fail
install_requires=[],
)
| # -*- coding: utf-8 -*-
# Copyright (C) 2012-2014 MUJIN Inc
from distutils.core import setup
try:
from mujincommon.setuptools import Distribution
except ImportError:
from distutils.dist import Distribution
version = {}
exec(open('python/mujincontrollerclient/version.py').read(), version)
setup(
distclass=Distribution,
name='mujincontrollerclient',
version=version['__version__'],
packages=['mujincontrollerclient'],
package_dir={'mujincontrollerclient': 'python/mujincontrollerclient'},
data_files=[
# using scripts= will cause the first line of the script being modified for python2 or python3
# put the scripts in data_files will copy them as-is
('bin', ['bin/mujin_controllerclientpy_registerscene.py', 'bin/mujin_controllerclientpy_applyconfig.py']),
],
locale_dir='locale',
license='Apache License, Version 2.0',
long_description=open('README.rst').read(),
# flake8 compliance configuration
enable_flake8=True, # Enable checks
fail_on_flake=True, # Fail builds when checks fail
install_requires=[],
)
| Fix bin scripts having python2 or python3 specific path. | Fix bin scripts having python2 or python3 specific path.
| Python | apache-2.0 | mujin/mujincontrollerclientpy | # -*- coding: utf-8 -*-
# Copyright (C) 2012-2014 MUJIN Inc
from distutils.core import setup
try:
from mujincommon.setuptools import Distribution
except ImportError:
from distutils.dist import Distribution
version = {}
exec(open('python/mujincontrollerclient/version.py').read(), version)
setup(
distclass=Distribution,
name='mujincontrollerclient',
version=version['__version__'],
packages=['mujincontrollerclient'],
package_dir={'mujincontrollerclient': 'python/mujincontrollerclient'},
scripts=['bin/mujin_controllerclientpy_registerscene.py', 'bin/mujin_controllerclientpy_applyconfig.py'],
locale_dir='locale',
license='Apache License, Version 2.0',
long_description=open('README.rst').read(),
# flake8 compliance configuration
enable_flake8=True, # Enable checks
fail_on_flake=True, # Fail builds when checks fail
install_requires=[],
)
Fix bin scripts having python2 or python3 specific path. | # -*- coding: utf-8 -*-
# Copyright (C) 2012-2014 MUJIN Inc
from distutils.core import setup
try:
from mujincommon.setuptools import Distribution
except ImportError:
from distutils.dist import Distribution
version = {}
exec(open('python/mujincontrollerclient/version.py').read(), version)
setup(
distclass=Distribution,
name='mujincontrollerclient',
version=version['__version__'],
packages=['mujincontrollerclient'],
package_dir={'mujincontrollerclient': 'python/mujincontrollerclient'},
data_files=[
# using scripts= will cause the first line of the script being modified for python2 or python3
# put the scripts in data_files will copy them as-is
('bin', ['bin/mujin_controllerclientpy_registerscene.py', 'bin/mujin_controllerclientpy_applyconfig.py']),
],
locale_dir='locale',
license='Apache License, Version 2.0',
long_description=open('README.rst').read(),
# flake8 compliance configuration
enable_flake8=True, # Enable checks
fail_on_flake=True, # Fail builds when checks fail
install_requires=[],
)
| <commit_before># -*- coding: utf-8 -*-
# Copyright (C) 2012-2014 MUJIN Inc
from distutils.core import setup
try:
from mujincommon.setuptools import Distribution
except ImportError:
from distutils.dist import Distribution
version = {}
exec(open('python/mujincontrollerclient/version.py').read(), version)
setup(
distclass=Distribution,
name='mujincontrollerclient',
version=version['__version__'],
packages=['mujincontrollerclient'],
package_dir={'mujincontrollerclient': 'python/mujincontrollerclient'},
scripts=['bin/mujin_controllerclientpy_registerscene.py', 'bin/mujin_controllerclientpy_applyconfig.py'],
locale_dir='locale',
license='Apache License, Version 2.0',
long_description=open('README.rst').read(),
# flake8 compliance configuration
enable_flake8=True, # Enable checks
fail_on_flake=True, # Fail builds when checks fail
install_requires=[],
)
<commit_msg>Fix bin scripts having python2 or python3 specific path.<commit_after> | # -*- coding: utf-8 -*-
# Copyright (C) 2012-2014 MUJIN Inc
from distutils.core import setup
try:
from mujincommon.setuptools import Distribution
except ImportError:
from distutils.dist import Distribution
version = {}
exec(open('python/mujincontrollerclient/version.py').read(), version)
setup(
distclass=Distribution,
name='mujincontrollerclient',
version=version['__version__'],
packages=['mujincontrollerclient'],
package_dir={'mujincontrollerclient': 'python/mujincontrollerclient'},
data_files=[
# using scripts= will cause the first line of the script being modified for python2 or python3
# put the scripts in data_files will copy them as-is
('bin', ['bin/mujin_controllerclientpy_registerscene.py', 'bin/mujin_controllerclientpy_applyconfig.py']),
],
locale_dir='locale',
license='Apache License, Version 2.0',
long_description=open('README.rst').read(),
# flake8 compliance configuration
enable_flake8=True, # Enable checks
fail_on_flake=True, # Fail builds when checks fail
install_requires=[],
)
| # -*- coding: utf-8 -*-
# Copyright (C) 2012-2014 MUJIN Inc
from distutils.core import setup
try:
from mujincommon.setuptools import Distribution
except ImportError:
from distutils.dist import Distribution
version = {}
exec(open('python/mujincontrollerclient/version.py').read(), version)
setup(
distclass=Distribution,
name='mujincontrollerclient',
version=version['__version__'],
packages=['mujincontrollerclient'],
package_dir={'mujincontrollerclient': 'python/mujincontrollerclient'},
scripts=['bin/mujin_controllerclientpy_registerscene.py', 'bin/mujin_controllerclientpy_applyconfig.py'],
locale_dir='locale',
license='Apache License, Version 2.0',
long_description=open('README.rst').read(),
# flake8 compliance configuration
enable_flake8=True, # Enable checks
fail_on_flake=True, # Fail builds when checks fail
install_requires=[],
)
Fix bin scripts having python2 or python3 specific path.# -*- coding: utf-8 -*-
# Copyright (C) 2012-2014 MUJIN Inc
from distutils.core import setup
try:
from mujincommon.setuptools import Distribution
except ImportError:
from distutils.dist import Distribution
version = {}
exec(open('python/mujincontrollerclient/version.py').read(), version)
setup(
distclass=Distribution,
name='mujincontrollerclient',
version=version['__version__'],
packages=['mujincontrollerclient'],
package_dir={'mujincontrollerclient': 'python/mujincontrollerclient'},
data_files=[
# using scripts= will cause the first line of the script being modified for python2 or python3
# put the scripts in data_files will copy them as-is
('bin', ['bin/mujin_controllerclientpy_registerscene.py', 'bin/mujin_controllerclientpy_applyconfig.py']),
],
locale_dir='locale',
license='Apache License, Version 2.0',
long_description=open('README.rst').read(),
# flake8 compliance configuration
enable_flake8=True, # Enable checks
fail_on_flake=True, # Fail builds when checks fail
install_requires=[],
)
| <commit_before># -*- coding: utf-8 -*-
# Copyright (C) 2012-2014 MUJIN Inc
from distutils.core import setup
try:
from mujincommon.setuptools import Distribution
except ImportError:
from distutils.dist import Distribution
version = {}
exec(open('python/mujincontrollerclient/version.py').read(), version)
setup(
distclass=Distribution,
name='mujincontrollerclient',
version=version['__version__'],
packages=['mujincontrollerclient'],
package_dir={'mujincontrollerclient': 'python/mujincontrollerclient'},
scripts=['bin/mujin_controllerclientpy_registerscene.py', 'bin/mujin_controllerclientpy_applyconfig.py'],
locale_dir='locale',
license='Apache License, Version 2.0',
long_description=open('README.rst').read(),
# flake8 compliance configuration
enable_flake8=True, # Enable checks
fail_on_flake=True, # Fail builds when checks fail
install_requires=[],
)
<commit_msg>Fix bin scripts having python2 or python3 specific path.<commit_after># -*- coding: utf-8 -*-
# Copyright (C) 2012-2014 MUJIN Inc
from distutils.core import setup
try:
from mujincommon.setuptools import Distribution
except ImportError:
from distutils.dist import Distribution
version = {}
exec(open('python/mujincontrollerclient/version.py').read(), version)
setup(
distclass=Distribution,
name='mujincontrollerclient',
version=version['__version__'],
packages=['mujincontrollerclient'],
package_dir={'mujincontrollerclient': 'python/mujincontrollerclient'},
data_files=[
# using scripts= will cause the first line of the script being modified for python2 or python3
# put the scripts in data_files will copy them as-is
('bin', ['bin/mujin_controllerclientpy_registerscene.py', 'bin/mujin_controllerclientpy_applyconfig.py']),
],
locale_dir='locale',
license='Apache License, Version 2.0',
long_description=open('README.rst').read(),
# flake8 compliance configuration
enable_flake8=True, # Enable checks
fail_on_flake=True, # Fail builds when checks fail
install_requires=[],
)
|
16d509f2ff1af0f7588f302323c883edcd4384b4 | setup.py | setup.py | #!/usr/bin/env python
import os
import sys
import shutil
import setuptools.command.egg_info as egg_info_cmd
from setuptools import setup, find_packages
SETUP_DIR = os.path.dirname(__file__)
README = os.path.join(SETUP_DIR, 'README.rst')
try:
import gittaggers
tagger = gittaggers.EggInfoFromGit
except ImportError:
tagger = egg_info_cmd.egg_info
setup(name='cwltest',
version='1.0',
description='Common workflow language testing framework',
long_description=open(README).read(),
author='Common workflow language working group',
author_email='common-workflow-language@googlegroups.com',
url="https://github.com/common-workflow-language/cwltest",
download_url="https://github.com/common-workflow-language/cwltest",
license='Apache 2.0',
packages=["cwltest"],
install_requires=[
'schema-salad >= 1.17',
'typing >= 3.5.2' ],
tests_require=[],
entry_points={
'console_scripts': [ "cwltest=cwltest:main" ]
},
zip_safe=True,
cmdclass={'egg_info': tagger},
)
| #!/usr/bin/env python
import os
import sys
import shutil
import setuptools.command.egg_info as egg_info_cmd
from setuptools import setup, find_packages
SETUP_DIR = os.path.dirname(__file__)
README = os.path.join(SETUP_DIR, 'README.rst')
try:
import gittaggers
tagger = gittaggers.EggInfoFromGit
except ImportError:
tagger = egg_info_cmd.egg_info
setup(name='cwltest',
version='1.0',
description='Common workflow language testing framework',
long_description=open(README).read(),
author='Common workflow language working group',
author_email='common-workflow-language@googlegroups.com',
url="https://github.com/common-workflow-language/cwltest",
download_url="https://github.com/common-workflow-language/cwltest",
license='Apache 2.0',
packages=["cwltest"],
install_requires=[
'schema-salad >= 1.14',
'typing >= 3.5.2' ],
tests_require=[],
entry_points={
'console_scripts': [ "cwltest=cwltest:main" ]
},
zip_safe=True,
cmdclass={'egg_info': tagger},
)
| Move schema salad minimum version back to earlier version. | Move schema salad minimum version back to earlier version.
| Python | apache-2.0 | common-workflow-language/cwltest,common-workflow-language/cwltest | #!/usr/bin/env python
import os
import sys
import shutil
import setuptools.command.egg_info as egg_info_cmd
from setuptools import setup, find_packages
SETUP_DIR = os.path.dirname(__file__)
README = os.path.join(SETUP_DIR, 'README.rst')
try:
import gittaggers
tagger = gittaggers.EggInfoFromGit
except ImportError:
tagger = egg_info_cmd.egg_info
setup(name='cwltest',
version='1.0',
description='Common workflow language testing framework',
long_description=open(README).read(),
author='Common workflow language working group',
author_email='common-workflow-language@googlegroups.com',
url="https://github.com/common-workflow-language/cwltest",
download_url="https://github.com/common-workflow-language/cwltest",
license='Apache 2.0',
packages=["cwltest"],
install_requires=[
'schema-salad >= 1.17',
'typing >= 3.5.2' ],
tests_require=[],
entry_points={
'console_scripts': [ "cwltest=cwltest:main" ]
},
zip_safe=True,
cmdclass={'egg_info': tagger},
)
Move schema salad minimum version back to earlier version. | #!/usr/bin/env python
import os
import sys
import shutil
import setuptools.command.egg_info as egg_info_cmd
from setuptools import setup, find_packages
SETUP_DIR = os.path.dirname(__file__)
README = os.path.join(SETUP_DIR, 'README.rst')
try:
import gittaggers
tagger = gittaggers.EggInfoFromGit
except ImportError:
tagger = egg_info_cmd.egg_info
setup(name='cwltest',
version='1.0',
description='Common workflow language testing framework',
long_description=open(README).read(),
author='Common workflow language working group',
author_email='common-workflow-language@googlegroups.com',
url="https://github.com/common-workflow-language/cwltest",
download_url="https://github.com/common-workflow-language/cwltest",
license='Apache 2.0',
packages=["cwltest"],
install_requires=[
'schema-salad >= 1.14',
'typing >= 3.5.2' ],
tests_require=[],
entry_points={
'console_scripts': [ "cwltest=cwltest:main" ]
},
zip_safe=True,
cmdclass={'egg_info': tagger},
)
| <commit_before>#!/usr/bin/env python
import os
import sys
import shutil
import setuptools.command.egg_info as egg_info_cmd
from setuptools import setup, find_packages
SETUP_DIR = os.path.dirname(__file__)
README = os.path.join(SETUP_DIR, 'README.rst')
try:
import gittaggers
tagger = gittaggers.EggInfoFromGit
except ImportError:
tagger = egg_info_cmd.egg_info
setup(name='cwltest',
version='1.0',
description='Common workflow language testing framework',
long_description=open(README).read(),
author='Common workflow language working group',
author_email='common-workflow-language@googlegroups.com',
url="https://github.com/common-workflow-language/cwltest",
download_url="https://github.com/common-workflow-language/cwltest",
license='Apache 2.0',
packages=["cwltest"],
install_requires=[
'schema-salad >= 1.17',
'typing >= 3.5.2' ],
tests_require=[],
entry_points={
'console_scripts': [ "cwltest=cwltest:main" ]
},
zip_safe=True,
cmdclass={'egg_info': tagger},
)
<commit_msg>Move schema salad minimum version back to earlier version.<commit_after> | #!/usr/bin/env python
import os
import sys
import shutil
import setuptools.command.egg_info as egg_info_cmd
from setuptools import setup, find_packages
SETUP_DIR = os.path.dirname(__file__)
README = os.path.join(SETUP_DIR, 'README.rst')
try:
import gittaggers
tagger = gittaggers.EggInfoFromGit
except ImportError:
tagger = egg_info_cmd.egg_info
setup(name='cwltest',
version='1.0',
description='Common workflow language testing framework',
long_description=open(README).read(),
author='Common workflow language working group',
author_email='common-workflow-language@googlegroups.com',
url="https://github.com/common-workflow-language/cwltest",
download_url="https://github.com/common-workflow-language/cwltest",
license='Apache 2.0',
packages=["cwltest"],
install_requires=[
'schema-salad >= 1.14',
'typing >= 3.5.2' ],
tests_require=[],
entry_points={
'console_scripts': [ "cwltest=cwltest:main" ]
},
zip_safe=True,
cmdclass={'egg_info': tagger},
)
| #!/usr/bin/env python
import os
import sys
import shutil
import setuptools.command.egg_info as egg_info_cmd
from setuptools import setup, find_packages
SETUP_DIR = os.path.dirname(__file__)
README = os.path.join(SETUP_DIR, 'README.rst')
try:
import gittaggers
tagger = gittaggers.EggInfoFromGit
except ImportError:
tagger = egg_info_cmd.egg_info
setup(name='cwltest',
version='1.0',
description='Common workflow language testing framework',
long_description=open(README).read(),
author='Common workflow language working group',
author_email='common-workflow-language@googlegroups.com',
url="https://github.com/common-workflow-language/cwltest",
download_url="https://github.com/common-workflow-language/cwltest",
license='Apache 2.0',
packages=["cwltest"],
install_requires=[
'schema-salad >= 1.17',
'typing >= 3.5.2' ],
tests_require=[],
entry_points={
'console_scripts': [ "cwltest=cwltest:main" ]
},
zip_safe=True,
cmdclass={'egg_info': tagger},
)
Move schema salad minimum version back to earlier version.#!/usr/bin/env python
import os
import sys
import shutil
import setuptools.command.egg_info as egg_info_cmd
from setuptools import setup, find_packages
SETUP_DIR = os.path.dirname(__file__)
README = os.path.join(SETUP_DIR, 'README.rst')
try:
import gittaggers
tagger = gittaggers.EggInfoFromGit
except ImportError:
tagger = egg_info_cmd.egg_info
setup(name='cwltest',
version='1.0',
description='Common workflow language testing framework',
long_description=open(README).read(),
author='Common workflow language working group',
author_email='common-workflow-language@googlegroups.com',
url="https://github.com/common-workflow-language/cwltest",
download_url="https://github.com/common-workflow-language/cwltest",
license='Apache 2.0',
packages=["cwltest"],
install_requires=[
'schema-salad >= 1.14',
'typing >= 3.5.2' ],
tests_require=[],
entry_points={
'console_scripts': [ "cwltest=cwltest:main" ]
},
zip_safe=True,
cmdclass={'egg_info': tagger},
)
| <commit_before>#!/usr/bin/env python
import os
import sys
import shutil
import setuptools.command.egg_info as egg_info_cmd
from setuptools import setup, find_packages
SETUP_DIR = os.path.dirname(__file__)
README = os.path.join(SETUP_DIR, 'README.rst')
try:
import gittaggers
tagger = gittaggers.EggInfoFromGit
except ImportError:
tagger = egg_info_cmd.egg_info
setup(name='cwltest',
version='1.0',
description='Common workflow language testing framework',
long_description=open(README).read(),
author='Common workflow language working group',
author_email='common-workflow-language@googlegroups.com',
url="https://github.com/common-workflow-language/cwltest",
download_url="https://github.com/common-workflow-language/cwltest",
license='Apache 2.0',
packages=["cwltest"],
install_requires=[
'schema-salad >= 1.17',
'typing >= 3.5.2' ],
tests_require=[],
entry_points={
'console_scripts': [ "cwltest=cwltest:main" ]
},
zip_safe=True,
cmdclass={'egg_info': tagger},
)
<commit_msg>Move schema salad minimum version back to earlier version.<commit_after>#!/usr/bin/env python
import os
import sys
import shutil
import setuptools.command.egg_info as egg_info_cmd
from setuptools import setup, find_packages
SETUP_DIR = os.path.dirname(__file__)
README = os.path.join(SETUP_DIR, 'README.rst')
try:
import gittaggers
tagger = gittaggers.EggInfoFromGit
except ImportError:
tagger = egg_info_cmd.egg_info
setup(name='cwltest',
version='1.0',
description='Common workflow language testing framework',
long_description=open(README).read(),
author='Common workflow language working group',
author_email='common-workflow-language@googlegroups.com',
url="https://github.com/common-workflow-language/cwltest",
download_url="https://github.com/common-workflow-language/cwltest",
license='Apache 2.0',
packages=["cwltest"],
install_requires=[
'schema-salad >= 1.14',
'typing >= 3.5.2' ],
tests_require=[],
entry_points={
'console_scripts': [ "cwltest=cwltest:main" ]
},
zip_safe=True,
cmdclass={'egg_info': tagger},
)
|
fb3983017da558018fd0de7ef10a4c0e98bbb0ec | txircd/modules/cmd_user.py | txircd/modules/cmd_user.py | from twisted.words.protocols import irc
from txircd.modbase import Command
import string
class UserCommand(Command):
def onUse(self, user, data):
if not user.username:
user.registered -= 1
user.setUsername(data["ident"])
user.realname = data["gecos"]
if user.registered == 0:
user.register()
def processParams(self, user, params):
if user.registered == 0:
user.sendMessage(irc.ERR_ALREADYREGISTRED, ":You may not reregister")
return {}
if params and len(params) < 4:
user.sendMessage(irc.ERR_NEEDMOREPARAMS, "USER", ":Not enough parameters")
return {}
ident = filter(lambda x: x in string.ascii_letters + string.digits + "-_", params[0][:12])
if not ident:
user.sendMessage(irc.ERR_NEEDMOREPARAMS, "USER", ":Your username is not valid")
return {}
return {
"user": user,
"ident": ident,
"gecos": params[3]
}
class Spawner(object):
def __init__(self, ircd):
self.ircd = ircd
def spawn(self):
return {
"commands": {
"USER": UserCommand()
}
} | from twisted.words.protocols import irc
from txircd.modbase import Command
import string
class UserCommand(Command):
def onUse(self, user, data):
if not user.username:
user.registered -= 1
user.setUsername(data["ident"])
user.setRealname(data["gecos"])
if user.registered == 0:
user.register()
def processParams(self, user, params):
if user.registered == 0:
user.sendMessage(irc.ERR_ALREADYREGISTRED, ":You may not reregister")
return {}
if params and len(params) < 4:
user.sendMessage(irc.ERR_NEEDMOREPARAMS, "USER", ":Not enough parameters")
return {}
ident = filter(lambda x: x in string.ascii_letters + string.digits + "-_", params[0][:12])
if not ident:
user.sendMessage(irc.ERR_NEEDMOREPARAMS, "USER", ":Your username is not valid")
return {}
return {
"user": user,
"ident": ident,
"gecos": params[3]
}
class Spawner(object):
def __init__(self, ircd):
self.ircd = ircd
def spawn(self):
return {
"commands": {
"USER": UserCommand()
}
} | Send the gecos input from USER through the sanitization as well | Send the gecos input from USER through the sanitization as well
| Python | bsd-3-clause | Heufneutje/txircd,ElementalAlchemist/txircd,DesertBus/txircd | from twisted.words.protocols import irc
from txircd.modbase import Command
import string
class UserCommand(Command):
def onUse(self, user, data):
if not user.username:
user.registered -= 1
user.setUsername(data["ident"])
user.realname = data["gecos"]
if user.registered == 0:
user.register()
def processParams(self, user, params):
if user.registered == 0:
user.sendMessage(irc.ERR_ALREADYREGISTRED, ":You may not reregister")
return {}
if params and len(params) < 4:
user.sendMessage(irc.ERR_NEEDMOREPARAMS, "USER", ":Not enough parameters")
return {}
ident = filter(lambda x: x in string.ascii_letters + string.digits + "-_", params[0][:12])
if not ident:
user.sendMessage(irc.ERR_NEEDMOREPARAMS, "USER", ":Your username is not valid")
return {}
return {
"user": user,
"ident": ident,
"gecos": params[3]
}
class Spawner(object):
def __init__(self, ircd):
self.ircd = ircd
def spawn(self):
return {
"commands": {
"USER": UserCommand()
}
}Send the gecos input from USER through the sanitization as well | from twisted.words.protocols import irc
from txircd.modbase import Command
import string
class UserCommand(Command):
def onUse(self, user, data):
if not user.username:
user.registered -= 1
user.setUsername(data["ident"])
user.setRealname(data["gecos"])
if user.registered == 0:
user.register()
def processParams(self, user, params):
if user.registered == 0:
user.sendMessage(irc.ERR_ALREADYREGISTRED, ":You may not reregister")
return {}
if params and len(params) < 4:
user.sendMessage(irc.ERR_NEEDMOREPARAMS, "USER", ":Not enough parameters")
return {}
ident = filter(lambda x: x in string.ascii_letters + string.digits + "-_", params[0][:12])
if not ident:
user.sendMessage(irc.ERR_NEEDMOREPARAMS, "USER", ":Your username is not valid")
return {}
return {
"user": user,
"ident": ident,
"gecos": params[3]
}
class Spawner(object):
def __init__(self, ircd):
self.ircd = ircd
def spawn(self):
return {
"commands": {
"USER": UserCommand()
}
} | <commit_before>from twisted.words.protocols import irc
from txircd.modbase import Command
import string
class UserCommand(Command):
def onUse(self, user, data):
if not user.username:
user.registered -= 1
user.setUsername(data["ident"])
user.realname = data["gecos"]
if user.registered == 0:
user.register()
def processParams(self, user, params):
if user.registered == 0:
user.sendMessage(irc.ERR_ALREADYREGISTRED, ":You may not reregister")
return {}
if params and len(params) < 4:
user.sendMessage(irc.ERR_NEEDMOREPARAMS, "USER", ":Not enough parameters")
return {}
ident = filter(lambda x: x in string.ascii_letters + string.digits + "-_", params[0][:12])
if not ident:
user.sendMessage(irc.ERR_NEEDMOREPARAMS, "USER", ":Your username is not valid")
return {}
return {
"user": user,
"ident": ident,
"gecos": params[3]
}
class Spawner(object):
def __init__(self, ircd):
self.ircd = ircd
def spawn(self):
return {
"commands": {
"USER": UserCommand()
}
}<commit_msg>Send the gecos input from USER through the sanitization as well<commit_after> | from twisted.words.protocols import irc
from txircd.modbase import Command
import string
class UserCommand(Command):
def onUse(self, user, data):
if not user.username:
user.registered -= 1
user.setUsername(data["ident"])
user.setRealname(data["gecos"])
if user.registered == 0:
user.register()
def processParams(self, user, params):
if user.registered == 0:
user.sendMessage(irc.ERR_ALREADYREGISTRED, ":You may not reregister")
return {}
if params and len(params) < 4:
user.sendMessage(irc.ERR_NEEDMOREPARAMS, "USER", ":Not enough parameters")
return {}
ident = filter(lambda x: x in string.ascii_letters + string.digits + "-_", params[0][:12])
if not ident:
user.sendMessage(irc.ERR_NEEDMOREPARAMS, "USER", ":Your username is not valid")
return {}
return {
"user": user,
"ident": ident,
"gecos": params[3]
}
class Spawner(object):
def __init__(self, ircd):
self.ircd = ircd
def spawn(self):
return {
"commands": {
"USER": UserCommand()
}
} | from twisted.words.protocols import irc
from txircd.modbase import Command
import string
class UserCommand(Command):
def onUse(self, user, data):
if not user.username:
user.registered -= 1
user.setUsername(data["ident"])
user.realname = data["gecos"]
if user.registered == 0:
user.register()
def processParams(self, user, params):
if user.registered == 0:
user.sendMessage(irc.ERR_ALREADYREGISTRED, ":You may not reregister")
return {}
if params and len(params) < 4:
user.sendMessage(irc.ERR_NEEDMOREPARAMS, "USER", ":Not enough parameters")
return {}
ident = filter(lambda x: x in string.ascii_letters + string.digits + "-_", params[0][:12])
if not ident:
user.sendMessage(irc.ERR_NEEDMOREPARAMS, "USER", ":Your username is not valid")
return {}
return {
"user": user,
"ident": ident,
"gecos": params[3]
}
class Spawner(object):
def __init__(self, ircd):
self.ircd = ircd
def spawn(self):
return {
"commands": {
"USER": UserCommand()
}
}Send the gecos input from USER through the sanitization as wellfrom twisted.words.protocols import irc
from txircd.modbase import Command
import string
class UserCommand(Command):
def onUse(self, user, data):
if not user.username:
user.registered -= 1
user.setUsername(data["ident"])
user.setRealname(data["gecos"])
if user.registered == 0:
user.register()
def processParams(self, user, params):
if user.registered == 0:
user.sendMessage(irc.ERR_ALREADYREGISTRED, ":You may not reregister")
return {}
if params and len(params) < 4:
user.sendMessage(irc.ERR_NEEDMOREPARAMS, "USER", ":Not enough parameters")
return {}
ident = filter(lambda x: x in string.ascii_letters + string.digits + "-_", params[0][:12])
if not ident:
user.sendMessage(irc.ERR_NEEDMOREPARAMS, "USER", ":Your username is not valid")
return {}
return {
"user": user,
"ident": ident,
"gecos": params[3]
}
class Spawner(object):
def __init__(self, ircd):
self.ircd = ircd
def spawn(self):
return {
"commands": {
"USER": UserCommand()
}
} | <commit_before>from twisted.words.protocols import irc
from txircd.modbase import Command
import string
class UserCommand(Command):
def onUse(self, user, data):
if not user.username:
user.registered -= 1
user.setUsername(data["ident"])
user.realname = data["gecos"]
if user.registered == 0:
user.register()
def processParams(self, user, params):
if user.registered == 0:
user.sendMessage(irc.ERR_ALREADYREGISTRED, ":You may not reregister")
return {}
if params and len(params) < 4:
user.sendMessage(irc.ERR_NEEDMOREPARAMS, "USER", ":Not enough parameters")
return {}
ident = filter(lambda x: x in string.ascii_letters + string.digits + "-_", params[0][:12])
if not ident:
user.sendMessage(irc.ERR_NEEDMOREPARAMS, "USER", ":Your username is not valid")
return {}
return {
"user": user,
"ident": ident,
"gecos": params[3]
}
class Spawner(object):
def __init__(self, ircd):
self.ircd = ircd
def spawn(self):
return {
"commands": {
"USER": UserCommand()
}
}<commit_msg>Send the gecos input from USER through the sanitization as well<commit_after>from twisted.words.protocols import irc
from txircd.modbase import Command
import string
class UserCommand(Command):
def onUse(self, user, data):
if not user.username:
user.registered -= 1
user.setUsername(data["ident"])
user.setRealname(data["gecos"])
if user.registered == 0:
user.register()
def processParams(self, user, params):
if user.registered == 0:
user.sendMessage(irc.ERR_ALREADYREGISTRED, ":You may not reregister")
return {}
if params and len(params) < 4:
user.sendMessage(irc.ERR_NEEDMOREPARAMS, "USER", ":Not enough parameters")
return {}
ident = filter(lambda x: x in string.ascii_letters + string.digits + "-_", params[0][:12])
if not ident:
user.sendMessage(irc.ERR_NEEDMOREPARAMS, "USER", ":Your username is not valid")
return {}
return {
"user": user,
"ident": ident,
"gecos": params[3]
}
class Spawner(object):
def __init__(self, ircd):
self.ircd = ircd
def spawn(self):
return {
"commands": {
"USER": UserCommand()
}
} |
a013af88adad469782d2f05a0b882c2f5500b6b8 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup
setup(
name='gallerize',
version='0.3.1',
description='Create a static HTML/CSS image gallery from a bunch of images.',
author='Jochen Kupperschmidt',
author_email='homework@nwsnet.de',
url='http://homework.nwsnet.de/releases/cc0e/#gallerize',
)
| # -*- coding: utf-8 -*-
from setuptools import setup
def read_readme():
with open('README.rst') as f:
return f.read()
setup(
name='gallerize',
version='0.3.1',
description='Create a static HTML/CSS image gallery from a bunch of images.',
long_description=read_readme(),
license='MIT',
author='Jochen Kupperschmidt',
author_email='homework@nwsnet.de',
url='http://homework.nwsnet.de/releases/cc0e/#gallerize',
)
| Include README as long package description. Specified license. | Include README as long package description. Specified license.
| Python | mit | TheLady/gallerize,TheLady/gallerize | #!/usr/bin/env python
from setuptools import setup
setup(
name='gallerize',
version='0.3.1',
description='Create a static HTML/CSS image gallery from a bunch of images.',
author='Jochen Kupperschmidt',
author_email='homework@nwsnet.de',
url='http://homework.nwsnet.de/releases/cc0e/#gallerize',
)
Include README as long package description. Specified license. | # -*- coding: utf-8 -*-
from setuptools import setup
def read_readme():
with open('README.rst') as f:
return f.read()
setup(
name='gallerize',
version='0.3.1',
description='Create a static HTML/CSS image gallery from a bunch of images.',
long_description=read_readme(),
license='MIT',
author='Jochen Kupperschmidt',
author_email='homework@nwsnet.de',
url='http://homework.nwsnet.de/releases/cc0e/#gallerize',
)
| <commit_before>#!/usr/bin/env python
from setuptools import setup
setup(
name='gallerize',
version='0.3.1',
description='Create a static HTML/CSS image gallery from a bunch of images.',
author='Jochen Kupperschmidt',
author_email='homework@nwsnet.de',
url='http://homework.nwsnet.de/releases/cc0e/#gallerize',
)
<commit_msg>Include README as long package description. Specified license.<commit_after> | # -*- coding: utf-8 -*-
from setuptools import setup
def read_readme():
with open('README.rst') as f:
return f.read()
setup(
name='gallerize',
version='0.3.1',
description='Create a static HTML/CSS image gallery from a bunch of images.',
long_description=read_readme(),
license='MIT',
author='Jochen Kupperschmidt',
author_email='homework@nwsnet.de',
url='http://homework.nwsnet.de/releases/cc0e/#gallerize',
)
| #!/usr/bin/env python
from setuptools import setup
setup(
name='gallerize',
version='0.3.1',
description='Create a static HTML/CSS image gallery from a bunch of images.',
author='Jochen Kupperschmidt',
author_email='homework@nwsnet.de',
url='http://homework.nwsnet.de/releases/cc0e/#gallerize',
)
Include README as long package description. Specified license.# -*- coding: utf-8 -*-
from setuptools import setup
def read_readme():
with open('README.rst') as f:
return f.read()
setup(
name='gallerize',
version='0.3.1',
description='Create a static HTML/CSS image gallery from a bunch of images.',
long_description=read_readme(),
license='MIT',
author='Jochen Kupperschmidt',
author_email='homework@nwsnet.de',
url='http://homework.nwsnet.de/releases/cc0e/#gallerize',
)
| <commit_before>#!/usr/bin/env python
from setuptools import setup
setup(
name='gallerize',
version='0.3.1',
description='Create a static HTML/CSS image gallery from a bunch of images.',
author='Jochen Kupperschmidt',
author_email='homework@nwsnet.de',
url='http://homework.nwsnet.de/releases/cc0e/#gallerize',
)
<commit_msg>Include README as long package description. Specified license.<commit_after># -*- coding: utf-8 -*-
from setuptools import setup
def read_readme():
with open('README.rst') as f:
return f.read()
setup(
name='gallerize',
version='0.3.1',
description='Create a static HTML/CSS image gallery from a bunch of images.',
long_description=read_readme(),
license='MIT',
author='Jochen Kupperschmidt',
author_email='homework@nwsnet.de',
url='http://homework.nwsnet.de/releases/cc0e/#gallerize',
)
|
71acce577d1fc7d3366e1cc763433f18bbdfdc00 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name="valideer",
version="0.4.1",
description="Lightweight data validation and adaptation library for Python",
long_description=open("README.rst").read(),
url="https://github.com/podio/valideer",
author="George Sakkis",
author_email="george.sakkis@gmail.com",
packages=find_packages(),
install_requires=["decorator"],
test_suite="valideer.tests",
platforms=["any"],
keywords="validation adaptation typechecking jsonschema",
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
"Topic :: Software Development :: Libraries :: Python Modules",
"License :: OSI Approved :: MIT License",
],
)
| #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name="valideer",
version="0.4.1",
description="Lightweight data validation and adaptation library for Python",
long_description=open("README.rst").read(),
url="https://github.com/podio/valideer",
author="George Sakkis",
author_email="george.sakkis@gmail.com",
packages=find_packages(),
install_requires=["decorator"],
test_suite="valideer.tests",
platforms=["any"],
keywords="validation adaptation typechecking jsonschema",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Topic :: Software Development :: Libraries :: Python Modules",
"License :: OSI Approved :: MIT License",
],
)
| Upgrade status to Production/Stable and add specific python version to classifiers | Upgrade status to Production/Stable and add specific python version to classifiers
| Python | mit | gsakkis/valideer,podio/valideer | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name="valideer",
version="0.4.1",
description="Lightweight data validation and adaptation library for Python",
long_description=open("README.rst").read(),
url="https://github.com/podio/valideer",
author="George Sakkis",
author_email="george.sakkis@gmail.com",
packages=find_packages(),
install_requires=["decorator"],
test_suite="valideer.tests",
platforms=["any"],
keywords="validation adaptation typechecking jsonschema",
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
"Topic :: Software Development :: Libraries :: Python Modules",
"License :: OSI Approved :: MIT License",
],
)
Upgrade status to Production/Stable and add specific python version to classifiers | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name="valideer",
version="0.4.1",
description="Lightweight data validation and adaptation library for Python",
long_description=open("README.rst").read(),
url="https://github.com/podio/valideer",
author="George Sakkis",
author_email="george.sakkis@gmail.com",
packages=find_packages(),
install_requires=["decorator"],
test_suite="valideer.tests",
platforms=["any"],
keywords="validation adaptation typechecking jsonschema",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Topic :: Software Development :: Libraries :: Python Modules",
"License :: OSI Approved :: MIT License",
],
)
| <commit_before>#!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name="valideer",
version="0.4.1",
description="Lightweight data validation and adaptation library for Python",
long_description=open("README.rst").read(),
url="https://github.com/podio/valideer",
author="George Sakkis",
author_email="george.sakkis@gmail.com",
packages=find_packages(),
install_requires=["decorator"],
test_suite="valideer.tests",
platforms=["any"],
keywords="validation adaptation typechecking jsonschema",
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
"Topic :: Software Development :: Libraries :: Python Modules",
"License :: OSI Approved :: MIT License",
],
)
<commit_msg>Upgrade status to Production/Stable and add specific python version to classifiers<commit_after> | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name="valideer",
version="0.4.1",
description="Lightweight data validation and adaptation library for Python",
long_description=open("README.rst").read(),
url="https://github.com/podio/valideer",
author="George Sakkis",
author_email="george.sakkis@gmail.com",
packages=find_packages(),
install_requires=["decorator"],
test_suite="valideer.tests",
platforms=["any"],
keywords="validation adaptation typechecking jsonschema",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Topic :: Software Development :: Libraries :: Python Modules",
"License :: OSI Approved :: MIT License",
],
)
| #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name="valideer",
version="0.4.1",
description="Lightweight data validation and adaptation library for Python",
long_description=open("README.rst").read(),
url="https://github.com/podio/valideer",
author="George Sakkis",
author_email="george.sakkis@gmail.com",
packages=find_packages(),
install_requires=["decorator"],
test_suite="valideer.tests",
platforms=["any"],
keywords="validation adaptation typechecking jsonschema",
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
"Topic :: Software Development :: Libraries :: Python Modules",
"License :: OSI Approved :: MIT License",
],
)
Upgrade status to Production/Stable and add specific python version to classifiers#!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name="valideer",
version="0.4.1",
description="Lightweight data validation and adaptation library for Python",
long_description=open("README.rst").read(),
url="https://github.com/podio/valideer",
author="George Sakkis",
author_email="george.sakkis@gmail.com",
packages=find_packages(),
install_requires=["decorator"],
test_suite="valideer.tests",
platforms=["any"],
keywords="validation adaptation typechecking jsonschema",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Topic :: Software Development :: Libraries :: Python Modules",
"License :: OSI Approved :: MIT License",
],
)
| <commit_before>#!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name="valideer",
version="0.4.1",
description="Lightweight data validation and adaptation library for Python",
long_description=open("README.rst").read(),
url="https://github.com/podio/valideer",
author="George Sakkis",
author_email="george.sakkis@gmail.com",
packages=find_packages(),
install_requires=["decorator"],
test_suite="valideer.tests",
platforms=["any"],
keywords="validation adaptation typechecking jsonschema",
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
"Topic :: Software Development :: Libraries :: Python Modules",
"License :: OSI Approved :: MIT License",
],
)
<commit_msg>Upgrade status to Production/Stable and add specific python version to classifiers<commit_after>#!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name="valideer",
version="0.4.1",
description="Lightweight data validation and adaptation library for Python",
long_description=open("README.rst").read(),
url="https://github.com/podio/valideer",
author="George Sakkis",
author_email="george.sakkis@gmail.com",
packages=find_packages(),
install_requires=["decorator"],
test_suite="valideer.tests",
platforms=["any"],
keywords="validation adaptation typechecking jsonschema",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Topic :: Software Development :: Libraries :: Python Modules",
"License :: OSI Approved :: MIT License",
],
)
|
c96dfa0387380da023f72b77b2d159e400d2f491 | setup.py | setup.py | # 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/.
from setuptools import setup
PACKAGE_VERSION = '0.1'
deps = ['fxos-appgen>=0.2.7',
'marionette_client>=0.7.1.1',
'marionette_extension >= 0.1',
'mozdevice >= 0.33',
'mozlog >= 1.8',
'moznetwork >= 0.24',
'mozprocess >= 0.18',
'wptserve >= 1.0.1',
'wptrunner >= 0.2.8, < 0.3']
setup(name='fxos-certsuite',
version=PACKAGE_VERSION,
description='Certification suite for FirefoxOS',
classifiers=[],
keywords='mozilla',
author='Mozilla Automation and Testing Team',
author_email='tools@lists.mozilla.org',
url='https://github.com/mozilla-b2g/fxos-certsuite',
license='MPL',
packages=['certsuite'],
include_package_data=True,
zip_safe=False,
install_requires=deps,
entry_points="""
# -*- Entry points: -*-
[console_scripts]
runcertsuite = certsuite:harness_main
cert = certsuite:certcli
""")
| # 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/.
from setuptools import setup
PACKAGE_VERSION = '0.1'
deps = ['fxos-appgen>=0.2.7',
'marionette_client>=0.7.1.1',
'marionette_extension >= 0.1',
'mozdevice >= 0.33',
'mozlog >= 1.8',
'moznetwork >= 0.24',
'mozprocess >= 0.18',
'wptserve >= 1.0.1',
'wptrunner >= 0.3']
setup(name='fxos-certsuite',
version=PACKAGE_VERSION,
description='Certification suite for FirefoxOS',
classifiers=[],
keywords='mozilla',
author='Mozilla Automation and Testing Team',
author_email='tools@lists.mozilla.org',
url='https://github.com/mozilla-b2g/fxos-certsuite',
license='MPL',
packages=['certsuite'],
include_package_data=True,
zip_safe=False,
install_requires=deps,
entry_points="""
# -*- Entry points: -*-
[console_scripts]
runcertsuite = certsuite:harness_main
cert = certsuite:certcli
""")
| Update to the latest version of wptrunner. | Update to the latest version of wptrunner.
| Python | mpl-2.0 | ypwalter/fxos-certsuite,mozilla-b2g/fxos-certsuite,ShakoHo/fxos-certsuite,Conjuror/fxos-certsuite,ShakoHo/fxos-certsuite,ypwalter/fxos-certsuite,oouyang/fxos-certsuite,ypwalter/fxos-certsuite,mozilla-b2g/fxos-certsuite,cr/fxos-certsuite,ypwalter/fxos-certsuite,oouyang/fxos-certsuite,askeing/fxos-certsuite,mozilla-b2g/fxos-certsuite,oouyang/fxos-certsuite,cr/fxos-certsuite,askeing/fxos-certsuite,askeing/fxos-certsuite,cr/fxos-certsuite,Conjuror/fxos-certsuite,mozilla-b2g/fxos-certsuite,ypwalter/fxos-certsuite,cr/fxos-certsuite,ypwalter/fxos-certsuite,Conjuror/fxos-certsuite,Conjuror/fxos-certsuite,ShakoHo/fxos-certsuite,mozilla-b2g/fxos-certsuite,mozilla-b2g/fxos-certsuite,ypwalter/fxos-certsuite,ShakoHo/fxos-certsuite,ShakoHo/fxos-certsuite,askeing/fxos-certsuite,cr/fxos-certsuite,cr/fxos-certsuite,oouyang/fxos-certsuite,ShakoHo/fxos-certsuite,askeing/fxos-certsuite,oouyang/fxos-certsuite,oouyang/fxos-certsuite,askeing/fxos-certsuite,oouyang/fxos-certsuite,askeing/fxos-certsuite,ShakoHo/fxos-certsuite,Conjuror/fxos-certsuite,mozilla-b2g/fxos-certsuite,Conjuror/fxos-certsuite,cr/fxos-certsuite,Conjuror/fxos-certsuite | # 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/.
from setuptools import setup
PACKAGE_VERSION = '0.1'
deps = ['fxos-appgen>=0.2.7',
'marionette_client>=0.7.1.1',
'marionette_extension >= 0.1',
'mozdevice >= 0.33',
'mozlog >= 1.8',
'moznetwork >= 0.24',
'mozprocess >= 0.18',
'wptserve >= 1.0.1',
'wptrunner >= 0.2.8, < 0.3']
setup(name='fxos-certsuite',
version=PACKAGE_VERSION,
description='Certification suite for FirefoxOS',
classifiers=[],
keywords='mozilla',
author='Mozilla Automation and Testing Team',
author_email='tools@lists.mozilla.org',
url='https://github.com/mozilla-b2g/fxos-certsuite',
license='MPL',
packages=['certsuite'],
include_package_data=True,
zip_safe=False,
install_requires=deps,
entry_points="""
# -*- Entry points: -*-
[console_scripts]
runcertsuite = certsuite:harness_main
cert = certsuite:certcli
""")
Update to the latest version of wptrunner. | # 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/.
from setuptools import setup
PACKAGE_VERSION = '0.1'
deps = ['fxos-appgen>=0.2.7',
'marionette_client>=0.7.1.1',
'marionette_extension >= 0.1',
'mozdevice >= 0.33',
'mozlog >= 1.8',
'moznetwork >= 0.24',
'mozprocess >= 0.18',
'wptserve >= 1.0.1',
'wptrunner >= 0.3']
setup(name='fxos-certsuite',
version=PACKAGE_VERSION,
description='Certification suite for FirefoxOS',
classifiers=[],
keywords='mozilla',
author='Mozilla Automation and Testing Team',
author_email='tools@lists.mozilla.org',
url='https://github.com/mozilla-b2g/fxos-certsuite',
license='MPL',
packages=['certsuite'],
include_package_data=True,
zip_safe=False,
install_requires=deps,
entry_points="""
# -*- Entry points: -*-
[console_scripts]
runcertsuite = certsuite:harness_main
cert = certsuite:certcli
""")
| <commit_before># 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/.
from setuptools import setup
PACKAGE_VERSION = '0.1'
deps = ['fxos-appgen>=0.2.7',
'marionette_client>=0.7.1.1',
'marionette_extension >= 0.1',
'mozdevice >= 0.33',
'mozlog >= 1.8',
'moznetwork >= 0.24',
'mozprocess >= 0.18',
'wptserve >= 1.0.1',
'wptrunner >= 0.2.8, < 0.3']
setup(name='fxos-certsuite',
version=PACKAGE_VERSION,
description='Certification suite for FirefoxOS',
classifiers=[],
keywords='mozilla',
author='Mozilla Automation and Testing Team',
author_email='tools@lists.mozilla.org',
url='https://github.com/mozilla-b2g/fxos-certsuite',
license='MPL',
packages=['certsuite'],
include_package_data=True,
zip_safe=False,
install_requires=deps,
entry_points="""
# -*- Entry points: -*-
[console_scripts]
runcertsuite = certsuite:harness_main
cert = certsuite:certcli
""")
<commit_msg>Update to the latest version of wptrunner.<commit_after> | # 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/.
from setuptools import setup
PACKAGE_VERSION = '0.1'
deps = ['fxos-appgen>=0.2.7',
'marionette_client>=0.7.1.1',
'marionette_extension >= 0.1',
'mozdevice >= 0.33',
'mozlog >= 1.8',
'moznetwork >= 0.24',
'mozprocess >= 0.18',
'wptserve >= 1.0.1',
'wptrunner >= 0.3']
setup(name='fxos-certsuite',
version=PACKAGE_VERSION,
description='Certification suite for FirefoxOS',
classifiers=[],
keywords='mozilla',
author='Mozilla Automation and Testing Team',
author_email='tools@lists.mozilla.org',
url='https://github.com/mozilla-b2g/fxos-certsuite',
license='MPL',
packages=['certsuite'],
include_package_data=True,
zip_safe=False,
install_requires=deps,
entry_points="""
# -*- Entry points: -*-
[console_scripts]
runcertsuite = certsuite:harness_main
cert = certsuite:certcli
""")
| # 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/.
from setuptools import setup
PACKAGE_VERSION = '0.1'
deps = ['fxos-appgen>=0.2.7',
'marionette_client>=0.7.1.1',
'marionette_extension >= 0.1',
'mozdevice >= 0.33',
'mozlog >= 1.8',
'moznetwork >= 0.24',
'mozprocess >= 0.18',
'wptserve >= 1.0.1',
'wptrunner >= 0.2.8, < 0.3']
setup(name='fxos-certsuite',
version=PACKAGE_VERSION,
description='Certification suite for FirefoxOS',
classifiers=[],
keywords='mozilla',
author='Mozilla Automation and Testing Team',
author_email='tools@lists.mozilla.org',
url='https://github.com/mozilla-b2g/fxos-certsuite',
license='MPL',
packages=['certsuite'],
include_package_data=True,
zip_safe=False,
install_requires=deps,
entry_points="""
# -*- Entry points: -*-
[console_scripts]
runcertsuite = certsuite:harness_main
cert = certsuite:certcli
""")
Update to the latest version of wptrunner.# 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/.
from setuptools import setup
PACKAGE_VERSION = '0.1'
deps = ['fxos-appgen>=0.2.7',
'marionette_client>=0.7.1.1',
'marionette_extension >= 0.1',
'mozdevice >= 0.33',
'mozlog >= 1.8',
'moznetwork >= 0.24',
'mozprocess >= 0.18',
'wptserve >= 1.0.1',
'wptrunner >= 0.3']
setup(name='fxos-certsuite',
version=PACKAGE_VERSION,
description='Certification suite for FirefoxOS',
classifiers=[],
keywords='mozilla',
author='Mozilla Automation and Testing Team',
author_email='tools@lists.mozilla.org',
url='https://github.com/mozilla-b2g/fxos-certsuite',
license='MPL',
packages=['certsuite'],
include_package_data=True,
zip_safe=False,
install_requires=deps,
entry_points="""
# -*- Entry points: -*-
[console_scripts]
runcertsuite = certsuite:harness_main
cert = certsuite:certcli
""")
| <commit_before># 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/.
from setuptools import setup
PACKAGE_VERSION = '0.1'
deps = ['fxos-appgen>=0.2.7',
'marionette_client>=0.7.1.1',
'marionette_extension >= 0.1',
'mozdevice >= 0.33',
'mozlog >= 1.8',
'moznetwork >= 0.24',
'mozprocess >= 0.18',
'wptserve >= 1.0.1',
'wptrunner >= 0.2.8, < 0.3']
setup(name='fxos-certsuite',
version=PACKAGE_VERSION,
description='Certification suite for FirefoxOS',
classifiers=[],
keywords='mozilla',
author='Mozilla Automation and Testing Team',
author_email='tools@lists.mozilla.org',
url='https://github.com/mozilla-b2g/fxos-certsuite',
license='MPL',
packages=['certsuite'],
include_package_data=True,
zip_safe=False,
install_requires=deps,
entry_points="""
# -*- Entry points: -*-
[console_scripts]
runcertsuite = certsuite:harness_main
cert = certsuite:certcli
""")
<commit_msg>Update to the latest version of wptrunner.<commit_after># 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/.
from setuptools import setup
PACKAGE_VERSION = '0.1'
deps = ['fxos-appgen>=0.2.7',
'marionette_client>=0.7.1.1',
'marionette_extension >= 0.1',
'mozdevice >= 0.33',
'mozlog >= 1.8',
'moznetwork >= 0.24',
'mozprocess >= 0.18',
'wptserve >= 1.0.1',
'wptrunner >= 0.3']
setup(name='fxos-certsuite',
version=PACKAGE_VERSION,
description='Certification suite for FirefoxOS',
classifiers=[],
keywords='mozilla',
author='Mozilla Automation and Testing Team',
author_email='tools@lists.mozilla.org',
url='https://github.com/mozilla-b2g/fxos-certsuite',
license='MPL',
packages=['certsuite'],
include_package_data=True,
zip_safe=False,
install_requires=deps,
entry_points="""
# -*- Entry points: -*-
[console_scripts]
runcertsuite = certsuite:harness_main
cert = certsuite:certcli
""")
|
6da15fd8f95638d919e47fe1150acce5a9401745 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
import conveyor
install_requires = [
"APScheduler",
"forklift",
"redis",
"xmlrpc2",
]
setup(
name="conveyor",
version=conveyor.__version__,
description="Warehouse and PyPI Synchronization",
long_description=open("README.rst").read(),
url="https://github.com/crateio/conveyor/",
license=open("LICENSE").read(),
author="Donald Stufft",
author_email="donald.stufft@gmail.com",
install_requires=install_requires,
packages=find_packages(exclude=["tests"]),
zip_safe=False,
)
| #!/usr/bin/env python
from setuptools import setup, find_packages
import conveyor
install_requires = [
"APScheduler",
"forklift",
"redis",
"six",
"xmlrpc2",
]
setup(
name="conveyor",
version=conveyor.__version__,
description="Warehouse and PyPI Synchronization",
long_description=open("README.rst").read(),
url="https://github.com/crateio/conveyor/",
license=open("LICENSE").read(),
author="Donald Stufft",
author_email="donald.stufft@gmail.com",
install_requires=install_requires,
packages=find_packages(exclude=["tests"]),
zip_safe=False,
)
| Add six to the requirements | Add six to the requirements
| Python | bsd-2-clause | crateio/carrier | #!/usr/bin/env python
from setuptools import setup, find_packages
import conveyor
install_requires = [
"APScheduler",
"forklift",
"redis",
"xmlrpc2",
]
setup(
name="conveyor",
version=conveyor.__version__,
description="Warehouse and PyPI Synchronization",
long_description=open("README.rst").read(),
url="https://github.com/crateio/conveyor/",
license=open("LICENSE").read(),
author="Donald Stufft",
author_email="donald.stufft@gmail.com",
install_requires=install_requires,
packages=find_packages(exclude=["tests"]),
zip_safe=False,
)
Add six to the requirements | #!/usr/bin/env python
from setuptools import setup, find_packages
import conveyor
install_requires = [
"APScheduler",
"forklift",
"redis",
"six",
"xmlrpc2",
]
setup(
name="conveyor",
version=conveyor.__version__,
description="Warehouse and PyPI Synchronization",
long_description=open("README.rst").read(),
url="https://github.com/crateio/conveyor/",
license=open("LICENSE").read(),
author="Donald Stufft",
author_email="donald.stufft@gmail.com",
install_requires=install_requires,
packages=find_packages(exclude=["tests"]),
zip_safe=False,
)
| <commit_before>#!/usr/bin/env python
from setuptools import setup, find_packages
import conveyor
install_requires = [
"APScheduler",
"forklift",
"redis",
"xmlrpc2",
]
setup(
name="conveyor",
version=conveyor.__version__,
description="Warehouse and PyPI Synchronization",
long_description=open("README.rst").read(),
url="https://github.com/crateio/conveyor/",
license=open("LICENSE").read(),
author="Donald Stufft",
author_email="donald.stufft@gmail.com",
install_requires=install_requires,
packages=find_packages(exclude=["tests"]),
zip_safe=False,
)
<commit_msg>Add six to the requirements<commit_after> | #!/usr/bin/env python
from setuptools import setup, find_packages
import conveyor
install_requires = [
"APScheduler",
"forklift",
"redis",
"six",
"xmlrpc2",
]
setup(
name="conveyor",
version=conveyor.__version__,
description="Warehouse and PyPI Synchronization",
long_description=open("README.rst").read(),
url="https://github.com/crateio/conveyor/",
license=open("LICENSE").read(),
author="Donald Stufft",
author_email="donald.stufft@gmail.com",
install_requires=install_requires,
packages=find_packages(exclude=["tests"]),
zip_safe=False,
)
| #!/usr/bin/env python
from setuptools import setup, find_packages
import conveyor
install_requires = [
"APScheduler",
"forklift",
"redis",
"xmlrpc2",
]
setup(
name="conveyor",
version=conveyor.__version__,
description="Warehouse and PyPI Synchronization",
long_description=open("README.rst").read(),
url="https://github.com/crateio/conveyor/",
license=open("LICENSE").read(),
author="Donald Stufft",
author_email="donald.stufft@gmail.com",
install_requires=install_requires,
packages=find_packages(exclude=["tests"]),
zip_safe=False,
)
Add six to the requirements#!/usr/bin/env python
from setuptools import setup, find_packages
import conveyor
install_requires = [
"APScheduler",
"forklift",
"redis",
"six",
"xmlrpc2",
]
setup(
name="conveyor",
version=conveyor.__version__,
description="Warehouse and PyPI Synchronization",
long_description=open("README.rst").read(),
url="https://github.com/crateio/conveyor/",
license=open("LICENSE").read(),
author="Donald Stufft",
author_email="donald.stufft@gmail.com",
install_requires=install_requires,
packages=find_packages(exclude=["tests"]),
zip_safe=False,
)
| <commit_before>#!/usr/bin/env python
from setuptools import setup, find_packages
import conveyor
install_requires = [
"APScheduler",
"forklift",
"redis",
"xmlrpc2",
]
setup(
name="conveyor",
version=conveyor.__version__,
description="Warehouse and PyPI Synchronization",
long_description=open("README.rst").read(),
url="https://github.com/crateio/conveyor/",
license=open("LICENSE").read(),
author="Donald Stufft",
author_email="donald.stufft@gmail.com",
install_requires=install_requires,
packages=find_packages(exclude=["tests"]),
zip_safe=False,
)
<commit_msg>Add six to the requirements<commit_after>#!/usr/bin/env python
from setuptools import setup, find_packages
import conveyor
install_requires = [
"APScheduler",
"forklift",
"redis",
"six",
"xmlrpc2",
]
setup(
name="conveyor",
version=conveyor.__version__,
description="Warehouse and PyPI Synchronization",
long_description=open("README.rst").read(),
url="https://github.com/crateio/conveyor/",
license=open("LICENSE").read(),
author="Donald Stufft",
author_email="donald.stufft@gmail.com",
install_requires=install_requires,
packages=find_packages(exclude=["tests"]),
zip_safe=False,
)
|
7bab32ef89d760a8cf4aeb2700725ea88e3fc31c | tests/basics/builtin_hash.py | tests/basics/builtin_hash.py | # test builtin hash function
print(hash(False))
print(hash(True))
print({():1}) # hash tuple
print({1 << 66:1}) # hash big int
print(hash in {hash:1}) # hash function
try:
hash([])
except TypeError:
print("TypeError")
class A:
def __hash__(self):
return 123
def __repr__(self):
return "a instance"
print(hash(A()))
print({A():1})
# all user-classes have default __hash__
class B:
pass
hash(B())
# if __eq__ is defined then default __hash__ is not used
class C:
def __eq__(self, another):
return True
try:
hash(C())
except TypeError:
print("TypeError")
# __hash__ must return an int
class D:
def __hash__(self):
return None
try:
hash(D())
except TypeError:
print("TypeError")
| # test builtin hash function
print(hash(False))
print(hash(True))
print({():1}) # hash tuple
print({1 << 66:1}) # hash big int
print(hash in {hash:1}) # hash function
try:
hash([])
except TypeError:
print("TypeError")
class A:
def __hash__(self):
return 123
def __repr__(self):
return "a instance"
print(hash(A()))
print({A():1})
# all user-classes have default __hash__
class B:
pass
hash(B())
# if __eq__ is defined then default __hash__ is not used
class C:
def __eq__(self, another):
return True
try:
hash(C())
except TypeError:
print("TypeError")
# __hash__ must return an int
class D:
def __hash__(self):
return None
try:
hash(D())
except TypeError:
print("TypeError")
# __hash__ returning a bool should be converted to an int
class E:
def __hash__(self):
return True
print(hash(E()))
# __hash__ returning a large number should be truncated
class F:
def __hash__(self):
return 1 << 70 | 1
print(hash(F()) != 0)
| Add further tests for class defining __hash__. | tests: Add further tests for class defining __hash__.
| Python | mit | martinribelotta/micropython,puuu/micropython,ganshun666/micropython,suda/micropython,EcmaXp/micropython,ChuckM/micropython,mgyenik/micropython,pramasoul/micropython,infinnovation/micropython,bvernoux/micropython,xyb/micropython,lbattraw/micropython,adafruit/circuitpython,blazewicz/micropython,tobbad/micropython,kostyll/micropython,toolmacher/micropython,kostyll/micropython,chrisdearman/micropython,cwyark/micropython,dhylands/micropython,orionrobots/micropython,omtinez/micropython,trezor/micropython,lowRISC/micropython,ernesto-g/micropython,blmorris/micropython,kerneltask/micropython,lowRISC/micropython,stonegithubs/micropython,tralamazza/micropython,mpalomer/micropython,skybird6672/micropython,trezor/micropython,PappaPeppar/micropython,blmorris/micropython,cloudformdesign/micropython,mianos/micropython,ruffy91/micropython,mpalomer/micropython,dhylands/micropython,dinau/micropython,ericsnowcurrently/micropython,toolmacher/micropython,noahchense/micropython,galenhz/micropython,ceramos/micropython,ChuckM/micropython,adafruit/circuitpython,oopy/micropython,supergis/micropython,pramasoul/micropython,xhat/micropython,henriknelson/micropython,jimkmc/micropython,misterdanb/micropython,dxxb/micropython,ganshun666/micropython,martinribelotta/micropython,hiway/micropython,rubencabrera/micropython,jmarcelino/pycom-micropython,MrSurly/micropython-esp32,deshipu/micropython,orionrobots/micropython,bvernoux/micropython,mgyenik/micropython,deshipu/micropython,chrisdearman/micropython,orionrobots/micropython,pramasoul/micropython,skybird6672/micropython,tdautc19841202/micropython,ernesto-g/micropython,pramasoul/micropython,slzatz/micropython,ganshun666/micropython,pfalcon/micropython,vitiral/micropython,swegener/micropython,dinau/micropython,praemdonck/micropython,vitiral/micropython,TDAbboud/micropython,firstval/micropython,tuc-osg/micropython,tdautc19841202/micropython,omtinez/micropython,puuu/micropython,emfcamp/micropython,neilh10/micropython,cloudformdesign/micropython,orionrobots/micropython,drrk/micropython,Peetz0r/micropython-esp32,swegener/micropython,HenrikSolver/micropython,torwag/micropython,cnoviello/micropython,feilongfl/micropython,turbinenreiter/micropython,lowRISC/micropython,chrisdearman/micropython,pfalcon/micropython,neilh10/micropython,SHA2017-badge/micropython-esp32,ahotam/micropython,feilongfl/micropython,chrisdearman/micropython,adamkh/micropython,MrSurly/micropython,micropython/micropython-esp32,cwyark/micropython,adamkh/micropython,ruffy91/micropython,tralamazza/micropython,rubencabrera/micropython,henriknelson/micropython,selste/micropython,danicampora/micropython,blmorris/micropython,adafruit/circuitpython,suda/micropython,rubencabrera/micropython,jlillest/micropython,puuu/micropython,TDAbboud/micropython,hiway/micropython,suda/micropython,tdautc19841202/micropython,matthewelse/micropython,feilongfl/micropython,heisewangluo/micropython,matthewelse/micropython,stonegithubs/micropython,mianos/micropython,alex-march/micropython,Peetz0r/micropython-esp32,xyb/micropython,slzatz/micropython,hosaka/micropython,TDAbboud/micropython,selste/micropython,ceramos/micropython,MrSurly/micropython,HenrikSolver/micropython,misterdanb/micropython,skybird6672/micropython,adamkh/micropython,adamkh/micropython,henriknelson/micropython,ernesto-g/micropython,MrSurly/micropython,MrSurly/micropython-esp32,xyb/micropython,adafruit/circuitpython,neilh10/micropython,oopy/micropython,stonegithubs/micropython,MrSurly/micropython,martinribelotta/micropython,firstval/micropython,EcmaXp/micropython,ruffy91/micropython,TDAbboud/micropython,alex-robbins/micropython,neilh10/micropython,AriZuu/micropython,heisewangluo/micropython,bvernoux/micropython,xyb/micropython,TDAbboud/micropython,utopiaprince/micropython,noahchense/micropython,ahotam/micropython,hiway/micropython,tralamazza/micropython,jlillest/micropython,vriera/micropython,dinau/micropython,tuc-osg/micropython,slzatz/micropython,danicampora/micropython,adafruit/micropython,MrSurly/micropython,utopiaprince/micropython,drrk/micropython,skybird6672/micropython,dxxb/micropython,adafruit/circuitpython,pfalcon/micropython,kerneltask/micropython,infinnovation/micropython,Timmenem/micropython,dhylands/micropython,xuxiaoxin/micropython,stonegithubs/micropython,Peetz0r/micropython-esp32,pozetroninc/micropython,suda/micropython,galenhz/micropython,xuxiaoxin/micropython,mhoffma/micropython,deshipu/micropython,bvernoux/micropython,hosaka/micropython,danicampora/micropython,dmazzella/micropython,jlillest/micropython,ernesto-g/micropython,orionrobots/micropython,galenhz/micropython,noahwilliamsson/micropython,jmarcelino/pycom-micropython,ahotam/micropython,pozetroninc/micropython,toolmacher/micropython,galenhz/micropython,supergis/micropython,turbinenreiter/micropython,noahchense/micropython,martinribelotta/micropython,AriZuu/micropython,redbear/micropython,xhat/micropython,pfalcon/micropython,oopy/micropython,mpalomer/micropython,matthewelse/micropython,AriZuu/micropython,alex-robbins/micropython,tobbad/micropython,ryannathans/micropython,blazewicz/micropython,blmorris/micropython,supergis/micropython,mhoffma/micropython,tobbad/micropython,omtinez/micropython,tdautc19841202/micropython,suda/micropython,toolmacher/micropython,ceramos/micropython,dinau/micropython,feilongfl/micropython,ruffy91/micropython,xuxiaoxin/micropython,noahwilliamsson/micropython,stonegithubs/micropython,Timmenem/micropython,emfcamp/micropython,slzatz/micropython,vitiral/micropython,xhat/micropython,Peetz0r/micropython-esp32,ahotam/micropython,selste/micropython,infinnovation/micropython,heisewangluo/micropython,trezor/micropython,micropython/micropython-esp32,hosaka/micropython,torwag/micropython,heisewangluo/micropython,PappaPeppar/micropython,praemdonck/micropython,micropython/micropython-esp32,kostyll/micropython,kerneltask/micropython,HenrikSolver/micropython,ChuckM/micropython,noahwilliamsson/micropython,cloudformdesign/micropython,jlillest/micropython,noahchense/micropython,tuc-osg/micropython,tuc-osg/micropython,lowRISC/micropython,lbattraw/micropython,pozetroninc/micropython,feilongfl/micropython,blmorris/micropython,vriera/micropython,dmazzella/micropython,tobbad/micropython,deshipu/micropython,vitiral/micropython,mgyenik/micropython,alex-march/micropython,ryannathans/micropython,vriera/micropython,hosaka/micropython,cwyark/micropython,ericsnowcurrently/micropython,pozetroninc/micropython,dhylands/micropython,mhoffma/micropython,danicampora/micropython,adafruit/circuitpython,lbattraw/micropython,hosaka/micropython,kostyll/micropython,HenrikSolver/micropython,mianos/micropython,lbattraw/micropython,lbattraw/micropython,adafruit/micropython,hiway/micropython,vriera/micropython,blazewicz/micropython,pramasoul/micropython,turbinenreiter/micropython,cwyark/micropython,MrSurly/micropython-esp32,alex-march/micropython,cwyark/micropython,alex-robbins/micropython,trezor/micropython,tdautc19841202/micropython,micropython/micropython-esp32,praemdonck/micropython,SHA2017-badge/micropython-esp32,tuc-osg/micropython,ruffy91/micropython,Timmenem/micropython,dxxb/micropython,dmazzella/micropython,noahwilliamsson/micropython,SHA2017-badge/micropython-esp32,PappaPeppar/micropython,turbinenreiter/micropython,torwag/micropython,alex-march/micropython,kerneltask/micropython,misterdanb/micropython,ericsnowcurrently/micropython,cnoviello/micropython,swegener/micropython,puuu/micropython,ChuckM/micropython,ahotam/micropython,PappaPeppar/micropython,firstval/micropython,emfcamp/micropython,torwag/micropython,turbinenreiter/micropython,PappaPeppar/micropython,MrSurly/micropython-esp32,mianos/micropython,toolmacher/micropython,noahchense/micropython,alex-robbins/micropython,chrisdearman/micropython,jmarcelino/pycom-micropython,MrSurly/micropython-esp32,adafruit/micropython,alex-robbins/micropython,ceramos/micropython,henriknelson/micropython,jmarcelino/pycom-micropython,ernesto-g/micropython,SHA2017-badge/micropython-esp32,jlillest/micropython,EcmaXp/micropython,kerneltask/micropython,dhylands/micropython,redbear/micropython,ganshun666/micropython,torwag/micropython,ChuckM/micropython,adafruit/micropython,mgyenik/micropython,drrk/micropython,jimkmc/micropython,blazewicz/micropython,redbear/micropython,oopy/micropython,dxxb/micropython,ryannathans/micropython,cnoviello/micropython,dmazzella/micropython,kostyll/micropython,AriZuu/micropython,cloudformdesign/micropython,mpalomer/micropython,puuu/micropython,redbear/micropython,rubencabrera/micropython,omtinez/micropython,matthewelse/micropython,vitiral/micropython,matthewelse/micropython,SHA2017-badge/micropython-esp32,mpalomer/micropython,praemdonck/micropython,xuxiaoxin/micropython,ryannathans/micropython,praemdonck/micropython,dxxb/micropython,micropython/micropython-esp32,Timmenem/micropython,mgyenik/micropython,Peetz0r/micropython-esp32,vriera/micropython,pfalcon/micropython,jmarcelino/pycom-micropython,xyb/micropython,selste/micropython,infinnovation/micropython,matthewelse/micropython,danicampora/micropython,ryannathans/micropython,pozetroninc/micropython,tralamazza/micropython,jimkmc/micropython,slzatz/micropython,cnoviello/micropython,xhat/micropython,heisewangluo/micropython,dinau/micropython,martinribelotta/micropython,utopiaprince/micropython,HenrikSolver/micropython,henriknelson/micropython,adamkh/micropython,hiway/micropython,jimkmc/micropython,skybird6672/micropython,trezor/micropython,cloudformdesign/micropython,neilh10/micropython,alex-march/micropython,emfcamp/micropython,AriZuu/micropython,adafruit/micropython,firstval/micropython,lowRISC/micropython,drrk/micropython,mhoffma/micropython,deshipu/micropython,ericsnowcurrently/micropython,xuxiaoxin/micropython,infinnovation/micropython,ceramos/micropython,selste/micropython,galenhz/micropython,drrk/micropython,utopiaprince/micropython,ericsnowcurrently/micropython,noahwilliamsson/micropython,cnoviello/micropython,mianos/micropython,bvernoux/micropython,swegener/micropython,EcmaXp/micropython,omtinez/micropython,emfcamp/micropython,ganshun666/micropython,misterdanb/micropython,utopiaprince/micropython,firstval/micropython,mhoffma/micropython,xhat/micropython,blazewicz/micropython,oopy/micropython,swegener/micropython,supergis/micropython,tobbad/micropython,redbear/micropython,EcmaXp/micropython,Timmenem/micropython,rubencabrera/micropython,supergis/micropython,jimkmc/micropython,misterdanb/micropython | # test builtin hash function
print(hash(False))
print(hash(True))
print({():1}) # hash tuple
print({1 << 66:1}) # hash big int
print(hash in {hash:1}) # hash function
try:
hash([])
except TypeError:
print("TypeError")
class A:
def __hash__(self):
return 123
def __repr__(self):
return "a instance"
print(hash(A()))
print({A():1})
# all user-classes have default __hash__
class B:
pass
hash(B())
# if __eq__ is defined then default __hash__ is not used
class C:
def __eq__(self, another):
return True
try:
hash(C())
except TypeError:
print("TypeError")
# __hash__ must return an int
class D:
def __hash__(self):
return None
try:
hash(D())
except TypeError:
print("TypeError")
tests: Add further tests for class defining __hash__. | # test builtin hash function
print(hash(False))
print(hash(True))
print({():1}) # hash tuple
print({1 << 66:1}) # hash big int
print(hash in {hash:1}) # hash function
try:
hash([])
except TypeError:
print("TypeError")
class A:
def __hash__(self):
return 123
def __repr__(self):
return "a instance"
print(hash(A()))
print({A():1})
# all user-classes have default __hash__
class B:
pass
hash(B())
# if __eq__ is defined then default __hash__ is not used
class C:
def __eq__(self, another):
return True
try:
hash(C())
except TypeError:
print("TypeError")
# __hash__ must return an int
class D:
def __hash__(self):
return None
try:
hash(D())
except TypeError:
print("TypeError")
# __hash__ returning a bool should be converted to an int
class E:
def __hash__(self):
return True
print(hash(E()))
# __hash__ returning a large number should be truncated
class F:
def __hash__(self):
return 1 << 70 | 1
print(hash(F()) != 0)
| <commit_before># test builtin hash function
print(hash(False))
print(hash(True))
print({():1}) # hash tuple
print({1 << 66:1}) # hash big int
print(hash in {hash:1}) # hash function
try:
hash([])
except TypeError:
print("TypeError")
class A:
def __hash__(self):
return 123
def __repr__(self):
return "a instance"
print(hash(A()))
print({A():1})
# all user-classes have default __hash__
class B:
pass
hash(B())
# if __eq__ is defined then default __hash__ is not used
class C:
def __eq__(self, another):
return True
try:
hash(C())
except TypeError:
print("TypeError")
# __hash__ must return an int
class D:
def __hash__(self):
return None
try:
hash(D())
except TypeError:
print("TypeError")
<commit_msg>tests: Add further tests for class defining __hash__.<commit_after> | # test builtin hash function
print(hash(False))
print(hash(True))
print({():1}) # hash tuple
print({1 << 66:1}) # hash big int
print(hash in {hash:1}) # hash function
try:
hash([])
except TypeError:
print("TypeError")
class A:
def __hash__(self):
return 123
def __repr__(self):
return "a instance"
print(hash(A()))
print({A():1})
# all user-classes have default __hash__
class B:
pass
hash(B())
# if __eq__ is defined then default __hash__ is not used
class C:
def __eq__(self, another):
return True
try:
hash(C())
except TypeError:
print("TypeError")
# __hash__ must return an int
class D:
def __hash__(self):
return None
try:
hash(D())
except TypeError:
print("TypeError")
# __hash__ returning a bool should be converted to an int
class E:
def __hash__(self):
return True
print(hash(E()))
# __hash__ returning a large number should be truncated
class F:
def __hash__(self):
return 1 << 70 | 1
print(hash(F()) != 0)
| # test builtin hash function
print(hash(False))
print(hash(True))
print({():1}) # hash tuple
print({1 << 66:1}) # hash big int
print(hash in {hash:1}) # hash function
try:
hash([])
except TypeError:
print("TypeError")
class A:
def __hash__(self):
return 123
def __repr__(self):
return "a instance"
print(hash(A()))
print({A():1})
# all user-classes have default __hash__
class B:
pass
hash(B())
# if __eq__ is defined then default __hash__ is not used
class C:
def __eq__(self, another):
return True
try:
hash(C())
except TypeError:
print("TypeError")
# __hash__ must return an int
class D:
def __hash__(self):
return None
try:
hash(D())
except TypeError:
print("TypeError")
tests: Add further tests for class defining __hash__.# test builtin hash function
print(hash(False))
print(hash(True))
print({():1}) # hash tuple
print({1 << 66:1}) # hash big int
print(hash in {hash:1}) # hash function
try:
hash([])
except TypeError:
print("TypeError")
class A:
def __hash__(self):
return 123
def __repr__(self):
return "a instance"
print(hash(A()))
print({A():1})
# all user-classes have default __hash__
class B:
pass
hash(B())
# if __eq__ is defined then default __hash__ is not used
class C:
def __eq__(self, another):
return True
try:
hash(C())
except TypeError:
print("TypeError")
# __hash__ must return an int
class D:
def __hash__(self):
return None
try:
hash(D())
except TypeError:
print("TypeError")
# __hash__ returning a bool should be converted to an int
class E:
def __hash__(self):
return True
print(hash(E()))
# __hash__ returning a large number should be truncated
class F:
def __hash__(self):
return 1 << 70 | 1
print(hash(F()) != 0)
| <commit_before># test builtin hash function
print(hash(False))
print(hash(True))
print({():1}) # hash tuple
print({1 << 66:1}) # hash big int
print(hash in {hash:1}) # hash function
try:
hash([])
except TypeError:
print("TypeError")
class A:
def __hash__(self):
return 123
def __repr__(self):
return "a instance"
print(hash(A()))
print({A():1})
# all user-classes have default __hash__
class B:
pass
hash(B())
# if __eq__ is defined then default __hash__ is not used
class C:
def __eq__(self, another):
return True
try:
hash(C())
except TypeError:
print("TypeError")
# __hash__ must return an int
class D:
def __hash__(self):
return None
try:
hash(D())
except TypeError:
print("TypeError")
<commit_msg>tests: Add further tests for class defining __hash__.<commit_after># test builtin hash function
print(hash(False))
print(hash(True))
print({():1}) # hash tuple
print({1 << 66:1}) # hash big int
print(hash in {hash:1}) # hash function
try:
hash([])
except TypeError:
print("TypeError")
class A:
def __hash__(self):
return 123
def __repr__(self):
return "a instance"
print(hash(A()))
print({A():1})
# all user-classes have default __hash__
class B:
pass
hash(B())
# if __eq__ is defined then default __hash__ is not used
class C:
def __eq__(self, another):
return True
try:
hash(C())
except TypeError:
print("TypeError")
# __hash__ must return an int
class D:
def __hash__(self):
return None
try:
hash(D())
except TypeError:
print("TypeError")
# __hash__ returning a bool should be converted to an int
class E:
def __hash__(self):
return True
print(hash(E()))
# __hash__ returning a large number should be truncated
class F:
def __hash__(self):
return 1 << 70 | 1
print(hash(F()) != 0)
|
4d6fdc98fd681a78eeeff6041efdfe7107a9743c | setup.py | setup.py | from setuptools import setup, find_packages
import account
setup(
name="django-user-accounts",
version=account.__version__,
author="Brian Rosner",
author_email="brosner@gmail.com",
description="a Django user account app",
long_description=open("README.rst").read(),
license="MIT",
url="http://github.com/pinax/django-user-accounts",
packages=find_packages(),
install_requires=[
"django-appconf>=0.6",
"pytz>=2013.9"
],
zip_safe=False,
package_data={
"account": [
"locale/*/LC_MESSAGES/*",
],
},
test_suite="runtests.runtests",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
"Framework :: Django",
]
)
| from setuptools import setup, find_packages
import account
setup(
name="django-user-accounts",
version=account.__version__,
author="Brian Rosner",
author_email="brosner@gmail.com",
description="a Django user account app",
long_description=open("README.rst").read(),
license="MIT",
url="http://github.com/pinax/django-user-accounts",
packages=find_packages(),
install_requires=[
"django-appconf>=0.6",
"pytz>=2015.6"
],
zip_safe=False,
package_data={
"account": [
"locale/*/LC_MESSAGES/*",
],
},
test_suite="runtests.runtests",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
"Framework :: Django",
]
)
| Set new minimum pytz version | Set new minimum pytz version
| Python | mit | GeoNode/geonode-user-accounts,ntucker/django-user-accounts,nderituedwin/django-user-accounts,mysociety/django-user-accounts,pinax/django-user-accounts,jawed123/django-user-accounts,pinax/django-user-accounts,ntucker/django-user-accounts,jpotterm/django-user-accounts,nderituedwin/django-user-accounts,jawed123/django-user-accounts,GeoNode/geonode-user-accounts,mysociety/django-user-accounts,jpotterm/django-user-accounts | from setuptools import setup, find_packages
import account
setup(
name="django-user-accounts",
version=account.__version__,
author="Brian Rosner",
author_email="brosner@gmail.com",
description="a Django user account app",
long_description=open("README.rst").read(),
license="MIT",
url="http://github.com/pinax/django-user-accounts",
packages=find_packages(),
install_requires=[
"django-appconf>=0.6",
"pytz>=2013.9"
],
zip_safe=False,
package_data={
"account": [
"locale/*/LC_MESSAGES/*",
],
},
test_suite="runtests.runtests",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
"Framework :: Django",
]
)
Set new minimum pytz version | from setuptools import setup, find_packages
import account
setup(
name="django-user-accounts",
version=account.__version__,
author="Brian Rosner",
author_email="brosner@gmail.com",
description="a Django user account app",
long_description=open("README.rst").read(),
license="MIT",
url="http://github.com/pinax/django-user-accounts",
packages=find_packages(),
install_requires=[
"django-appconf>=0.6",
"pytz>=2015.6"
],
zip_safe=False,
package_data={
"account": [
"locale/*/LC_MESSAGES/*",
],
},
test_suite="runtests.runtests",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
"Framework :: Django",
]
)
| <commit_before>from setuptools import setup, find_packages
import account
setup(
name="django-user-accounts",
version=account.__version__,
author="Brian Rosner",
author_email="brosner@gmail.com",
description="a Django user account app",
long_description=open("README.rst").read(),
license="MIT",
url="http://github.com/pinax/django-user-accounts",
packages=find_packages(),
install_requires=[
"django-appconf>=0.6",
"pytz>=2013.9"
],
zip_safe=False,
package_data={
"account": [
"locale/*/LC_MESSAGES/*",
],
},
test_suite="runtests.runtests",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
"Framework :: Django",
]
)
<commit_msg>Set new minimum pytz version<commit_after> | from setuptools import setup, find_packages
import account
setup(
name="django-user-accounts",
version=account.__version__,
author="Brian Rosner",
author_email="brosner@gmail.com",
description="a Django user account app",
long_description=open("README.rst").read(),
license="MIT",
url="http://github.com/pinax/django-user-accounts",
packages=find_packages(),
install_requires=[
"django-appconf>=0.6",
"pytz>=2015.6"
],
zip_safe=False,
package_data={
"account": [
"locale/*/LC_MESSAGES/*",
],
},
test_suite="runtests.runtests",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
"Framework :: Django",
]
)
| from setuptools import setup, find_packages
import account
setup(
name="django-user-accounts",
version=account.__version__,
author="Brian Rosner",
author_email="brosner@gmail.com",
description="a Django user account app",
long_description=open("README.rst").read(),
license="MIT",
url="http://github.com/pinax/django-user-accounts",
packages=find_packages(),
install_requires=[
"django-appconf>=0.6",
"pytz>=2013.9"
],
zip_safe=False,
package_data={
"account": [
"locale/*/LC_MESSAGES/*",
],
},
test_suite="runtests.runtests",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
"Framework :: Django",
]
)
Set new minimum pytz versionfrom setuptools import setup, find_packages
import account
setup(
name="django-user-accounts",
version=account.__version__,
author="Brian Rosner",
author_email="brosner@gmail.com",
description="a Django user account app",
long_description=open("README.rst").read(),
license="MIT",
url="http://github.com/pinax/django-user-accounts",
packages=find_packages(),
install_requires=[
"django-appconf>=0.6",
"pytz>=2015.6"
],
zip_safe=False,
package_data={
"account": [
"locale/*/LC_MESSAGES/*",
],
},
test_suite="runtests.runtests",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
"Framework :: Django",
]
)
| <commit_before>from setuptools import setup, find_packages
import account
setup(
name="django-user-accounts",
version=account.__version__,
author="Brian Rosner",
author_email="brosner@gmail.com",
description="a Django user account app",
long_description=open("README.rst").read(),
license="MIT",
url="http://github.com/pinax/django-user-accounts",
packages=find_packages(),
install_requires=[
"django-appconf>=0.6",
"pytz>=2013.9"
],
zip_safe=False,
package_data={
"account": [
"locale/*/LC_MESSAGES/*",
],
},
test_suite="runtests.runtests",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
"Framework :: Django",
]
)
<commit_msg>Set new minimum pytz version<commit_after>from setuptools import setup, find_packages
import account
setup(
name="django-user-accounts",
version=account.__version__,
author="Brian Rosner",
author_email="brosner@gmail.com",
description="a Django user account app",
long_description=open("README.rst").read(),
license="MIT",
url="http://github.com/pinax/django-user-accounts",
packages=find_packages(),
install_requires=[
"django-appconf>=0.6",
"pytz>=2015.6"
],
zip_safe=False,
package_data={
"account": [
"locale/*/LC_MESSAGES/*",
],
},
test_suite="runtests.runtests",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
"Framework :: Django",
]
)
|
0936621b0a4162589560cc112f4f8e4425fed652 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name = "django-ajax-utilities",
url = 'https://github.com/citylive/django-ajax-utilities',
license = 'BSD',
description = "Pagination, xhr and tabbing utilities for the Django framework.",
long_description = open('README','r').read(),
author = 'Jonathan Slenders, City Live nv',
packages = find_packages('src'),
package_data = {'django_ajax': [
'static/*.js', 'static/*/*.js', 'static/*/*/*.js',
'static/*.css', 'static/*/*.css', 'static/*/*/*.css',
'static/*.png', 'static/*/*.png', 'static/*/*/*.png', 'static/*/*/*/*.png',
'static/*.gif', 'static/*/*.gif', 'static/*/*/*.gif', 'static/*/*/*/*.gif',
'templates/*.html', 'templates/*/*.html', 'templates/*/*/*.html'
],},
zip_safe=False, # Don't create egg files, Django cannot find templates in egg files.
include_package_data=True,
package_dir = {'': 'src'},
classifiers = [
'Intended Audience :: Developers',
'Programming Language :: Python',
'Operating System :: OS Independent',
'Environment :: Web Environment',
'Framework :: Django',
],
)
| from setuptools import setup, find_packages
setup(
name = "django-ajax-utilities",
version = '1.2.0',
url = 'https://github.com/citylive/django-ajax-utilities',
license = 'BSD',
description = "Pagination, xhr and tabbing utilities for the Django framework.",
long_description = open('README','r').read(),
author = 'Jonathan Slenders, City Live nv',
packages = find_packages('src'),
package_data = {'django_ajax': [
'static/*.js', 'static/*/*.js', 'static/*/*/*.js',
'static/*.css', 'static/*/*.css', 'static/*/*/*.css',
'static/*.png', 'static/*/*.png', 'static/*/*/*.png', 'static/*/*/*/*.png',
'static/*.gif', 'static/*/*.gif', 'static/*/*/*.gif', 'static/*/*/*/*.gif',
'templates/*.html', 'templates/*/*.html', 'templates/*/*/*.html'
],},
zip_safe=False, # Don't create egg files, Django cannot find templates in egg files.
include_package_data=True,
package_dir = {'': 'src'},
classifiers = [
'Intended Audience :: Developers',
'Programming Language :: Python',
'Operating System :: OS Independent',
'Environment :: Web Environment',
'Framework :: Django',
],
)
| Change to semantic version number | Change to semantic version number
| Python | bsd-3-clause | vikingco/django-ajax-utilities,vikingco/django-ajax-utilities,vikingco/django-ajax-utilities | from setuptools import setup, find_packages
setup(
name = "django-ajax-utilities",
url = 'https://github.com/citylive/django-ajax-utilities',
license = 'BSD',
description = "Pagination, xhr and tabbing utilities for the Django framework.",
long_description = open('README','r').read(),
author = 'Jonathan Slenders, City Live nv',
packages = find_packages('src'),
package_data = {'django_ajax': [
'static/*.js', 'static/*/*.js', 'static/*/*/*.js',
'static/*.css', 'static/*/*.css', 'static/*/*/*.css',
'static/*.png', 'static/*/*.png', 'static/*/*/*.png', 'static/*/*/*/*.png',
'static/*.gif', 'static/*/*.gif', 'static/*/*/*.gif', 'static/*/*/*/*.gif',
'templates/*.html', 'templates/*/*.html', 'templates/*/*/*.html'
],},
zip_safe=False, # Don't create egg files, Django cannot find templates in egg files.
include_package_data=True,
package_dir = {'': 'src'},
classifiers = [
'Intended Audience :: Developers',
'Programming Language :: Python',
'Operating System :: OS Independent',
'Environment :: Web Environment',
'Framework :: Django',
],
)
Change to semantic version number | from setuptools import setup, find_packages
setup(
name = "django-ajax-utilities",
version = '1.2.0',
url = 'https://github.com/citylive/django-ajax-utilities',
license = 'BSD',
description = "Pagination, xhr and tabbing utilities for the Django framework.",
long_description = open('README','r').read(),
author = 'Jonathan Slenders, City Live nv',
packages = find_packages('src'),
package_data = {'django_ajax': [
'static/*.js', 'static/*/*.js', 'static/*/*/*.js',
'static/*.css', 'static/*/*.css', 'static/*/*/*.css',
'static/*.png', 'static/*/*.png', 'static/*/*/*.png', 'static/*/*/*/*.png',
'static/*.gif', 'static/*/*.gif', 'static/*/*/*.gif', 'static/*/*/*/*.gif',
'templates/*.html', 'templates/*/*.html', 'templates/*/*/*.html'
],},
zip_safe=False, # Don't create egg files, Django cannot find templates in egg files.
include_package_data=True,
package_dir = {'': 'src'},
classifiers = [
'Intended Audience :: Developers',
'Programming Language :: Python',
'Operating System :: OS Independent',
'Environment :: Web Environment',
'Framework :: Django',
],
)
| <commit_before>from setuptools import setup, find_packages
setup(
name = "django-ajax-utilities",
url = 'https://github.com/citylive/django-ajax-utilities',
license = 'BSD',
description = "Pagination, xhr and tabbing utilities for the Django framework.",
long_description = open('README','r').read(),
author = 'Jonathan Slenders, City Live nv',
packages = find_packages('src'),
package_data = {'django_ajax': [
'static/*.js', 'static/*/*.js', 'static/*/*/*.js',
'static/*.css', 'static/*/*.css', 'static/*/*/*.css',
'static/*.png', 'static/*/*.png', 'static/*/*/*.png', 'static/*/*/*/*.png',
'static/*.gif', 'static/*/*.gif', 'static/*/*/*.gif', 'static/*/*/*/*.gif',
'templates/*.html', 'templates/*/*.html', 'templates/*/*/*.html'
],},
zip_safe=False, # Don't create egg files, Django cannot find templates in egg files.
include_package_data=True,
package_dir = {'': 'src'},
classifiers = [
'Intended Audience :: Developers',
'Programming Language :: Python',
'Operating System :: OS Independent',
'Environment :: Web Environment',
'Framework :: Django',
],
)
<commit_msg>Change to semantic version number<commit_after> | from setuptools import setup, find_packages
setup(
name = "django-ajax-utilities",
version = '1.2.0',
url = 'https://github.com/citylive/django-ajax-utilities',
license = 'BSD',
description = "Pagination, xhr and tabbing utilities for the Django framework.",
long_description = open('README','r').read(),
author = 'Jonathan Slenders, City Live nv',
packages = find_packages('src'),
package_data = {'django_ajax': [
'static/*.js', 'static/*/*.js', 'static/*/*/*.js',
'static/*.css', 'static/*/*.css', 'static/*/*/*.css',
'static/*.png', 'static/*/*.png', 'static/*/*/*.png', 'static/*/*/*/*.png',
'static/*.gif', 'static/*/*.gif', 'static/*/*/*.gif', 'static/*/*/*/*.gif',
'templates/*.html', 'templates/*/*.html', 'templates/*/*/*.html'
],},
zip_safe=False, # Don't create egg files, Django cannot find templates in egg files.
include_package_data=True,
package_dir = {'': 'src'},
classifiers = [
'Intended Audience :: Developers',
'Programming Language :: Python',
'Operating System :: OS Independent',
'Environment :: Web Environment',
'Framework :: Django',
],
)
| from setuptools import setup, find_packages
setup(
name = "django-ajax-utilities",
url = 'https://github.com/citylive/django-ajax-utilities',
license = 'BSD',
description = "Pagination, xhr and tabbing utilities for the Django framework.",
long_description = open('README','r').read(),
author = 'Jonathan Slenders, City Live nv',
packages = find_packages('src'),
package_data = {'django_ajax': [
'static/*.js', 'static/*/*.js', 'static/*/*/*.js',
'static/*.css', 'static/*/*.css', 'static/*/*/*.css',
'static/*.png', 'static/*/*.png', 'static/*/*/*.png', 'static/*/*/*/*.png',
'static/*.gif', 'static/*/*.gif', 'static/*/*/*.gif', 'static/*/*/*/*.gif',
'templates/*.html', 'templates/*/*.html', 'templates/*/*/*.html'
],},
zip_safe=False, # Don't create egg files, Django cannot find templates in egg files.
include_package_data=True,
package_dir = {'': 'src'},
classifiers = [
'Intended Audience :: Developers',
'Programming Language :: Python',
'Operating System :: OS Independent',
'Environment :: Web Environment',
'Framework :: Django',
],
)
Change to semantic version numberfrom setuptools import setup, find_packages
setup(
name = "django-ajax-utilities",
version = '1.2.0',
url = 'https://github.com/citylive/django-ajax-utilities',
license = 'BSD',
description = "Pagination, xhr and tabbing utilities for the Django framework.",
long_description = open('README','r').read(),
author = 'Jonathan Slenders, City Live nv',
packages = find_packages('src'),
package_data = {'django_ajax': [
'static/*.js', 'static/*/*.js', 'static/*/*/*.js',
'static/*.css', 'static/*/*.css', 'static/*/*/*.css',
'static/*.png', 'static/*/*.png', 'static/*/*/*.png', 'static/*/*/*/*.png',
'static/*.gif', 'static/*/*.gif', 'static/*/*/*.gif', 'static/*/*/*/*.gif',
'templates/*.html', 'templates/*/*.html', 'templates/*/*/*.html'
],},
zip_safe=False, # Don't create egg files, Django cannot find templates in egg files.
include_package_data=True,
package_dir = {'': 'src'},
classifiers = [
'Intended Audience :: Developers',
'Programming Language :: Python',
'Operating System :: OS Independent',
'Environment :: Web Environment',
'Framework :: Django',
],
)
| <commit_before>from setuptools import setup, find_packages
setup(
name = "django-ajax-utilities",
url = 'https://github.com/citylive/django-ajax-utilities',
license = 'BSD',
description = "Pagination, xhr and tabbing utilities for the Django framework.",
long_description = open('README','r').read(),
author = 'Jonathan Slenders, City Live nv',
packages = find_packages('src'),
package_data = {'django_ajax': [
'static/*.js', 'static/*/*.js', 'static/*/*/*.js',
'static/*.css', 'static/*/*.css', 'static/*/*/*.css',
'static/*.png', 'static/*/*.png', 'static/*/*/*.png', 'static/*/*/*/*.png',
'static/*.gif', 'static/*/*.gif', 'static/*/*/*.gif', 'static/*/*/*/*.gif',
'templates/*.html', 'templates/*/*.html', 'templates/*/*/*.html'
],},
zip_safe=False, # Don't create egg files, Django cannot find templates in egg files.
include_package_data=True,
package_dir = {'': 'src'},
classifiers = [
'Intended Audience :: Developers',
'Programming Language :: Python',
'Operating System :: OS Independent',
'Environment :: Web Environment',
'Framework :: Django',
],
)
<commit_msg>Change to semantic version number<commit_after>from setuptools import setup, find_packages
setup(
name = "django-ajax-utilities",
version = '1.2.0',
url = 'https://github.com/citylive/django-ajax-utilities',
license = 'BSD',
description = "Pagination, xhr and tabbing utilities for the Django framework.",
long_description = open('README','r').read(),
author = 'Jonathan Slenders, City Live nv',
packages = find_packages('src'),
package_data = {'django_ajax': [
'static/*.js', 'static/*/*.js', 'static/*/*/*.js',
'static/*.css', 'static/*/*.css', 'static/*/*/*.css',
'static/*.png', 'static/*/*.png', 'static/*/*/*.png', 'static/*/*/*/*.png',
'static/*.gif', 'static/*/*.gif', 'static/*/*/*.gif', 'static/*/*/*/*.gif',
'templates/*.html', 'templates/*/*.html', 'templates/*/*/*.html'
],},
zip_safe=False, # Don't create egg files, Django cannot find templates in egg files.
include_package_data=True,
package_dir = {'': 'src'},
classifiers = [
'Intended Audience :: Developers',
'Programming Language :: Python',
'Operating System :: OS Independent',
'Environment :: Web Environment',
'Framework :: Django',
],
)
|
9712dd202f4fe5ee3938dbea987ced267a5199e5 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='pyhaproxy',
version='0.3.0',
keywords=('haproxy', 'parse'),
description='A Python library to parse haproxy configuration file',
license='MIT License',
install_requires=[],
include_package_data=True,
package_data={
'pyhaproxy': ['*.peg'],
},
author='Joey',
author_email='majunjiev@gmail.com',
url='https://github.com/imjoey/pyhaproxy',
packages=find_packages(),
platforms='any',
)
| from setuptools import setup, find_packages
setup(
name='pyhaproxy',
version='0.3.2',
keywords=('haproxy', 'parse'),
description='A Python library to parse haproxy configuration file',
license='MIT License',
install_requires=[],
include_package_data=True,
package_data={
'pyhaproxy': ['*.peg'],
},
author='Joey',
author_email='majunjiev@gmail.com',
url='https://github.com/imjoey/pyhaproxy',
packages=find_packages(),
platforms='any',
)
| Change version to v0.3.2. Release Notes: fix the incorrect attribute accessing in class Option. | Change version to v0.3.2. Release Notes: fix the incorrect attribute accessing in class Option.
| Python | mit | imjoey/pyhaproxy | from setuptools import setup, find_packages
setup(
name='pyhaproxy',
version='0.3.0',
keywords=('haproxy', 'parse'),
description='A Python library to parse haproxy configuration file',
license='MIT License',
install_requires=[],
include_package_data=True,
package_data={
'pyhaproxy': ['*.peg'],
},
author='Joey',
author_email='majunjiev@gmail.com',
url='https://github.com/imjoey/pyhaproxy',
packages=find_packages(),
platforms='any',
)
Change version to v0.3.2. Release Notes: fix the incorrect attribute accessing in class Option. | from setuptools import setup, find_packages
setup(
name='pyhaproxy',
version='0.3.2',
keywords=('haproxy', 'parse'),
description='A Python library to parse haproxy configuration file',
license='MIT License',
install_requires=[],
include_package_data=True,
package_data={
'pyhaproxy': ['*.peg'],
},
author='Joey',
author_email='majunjiev@gmail.com',
url='https://github.com/imjoey/pyhaproxy',
packages=find_packages(),
platforms='any',
)
| <commit_before>from setuptools import setup, find_packages
setup(
name='pyhaproxy',
version='0.3.0',
keywords=('haproxy', 'parse'),
description='A Python library to parse haproxy configuration file',
license='MIT License',
install_requires=[],
include_package_data=True,
package_data={
'pyhaproxy': ['*.peg'],
},
author='Joey',
author_email='majunjiev@gmail.com',
url='https://github.com/imjoey/pyhaproxy',
packages=find_packages(),
platforms='any',
)
<commit_msg>Change version to v0.3.2. Release Notes: fix the incorrect attribute accessing in class Option.<commit_after> | from setuptools import setup, find_packages
setup(
name='pyhaproxy',
version='0.3.2',
keywords=('haproxy', 'parse'),
description='A Python library to parse haproxy configuration file',
license='MIT License',
install_requires=[],
include_package_data=True,
package_data={
'pyhaproxy': ['*.peg'],
},
author='Joey',
author_email='majunjiev@gmail.com',
url='https://github.com/imjoey/pyhaproxy',
packages=find_packages(),
platforms='any',
)
| from setuptools import setup, find_packages
setup(
name='pyhaproxy',
version='0.3.0',
keywords=('haproxy', 'parse'),
description='A Python library to parse haproxy configuration file',
license='MIT License',
install_requires=[],
include_package_data=True,
package_data={
'pyhaproxy': ['*.peg'],
},
author='Joey',
author_email='majunjiev@gmail.com',
url='https://github.com/imjoey/pyhaproxy',
packages=find_packages(),
platforms='any',
)
Change version to v0.3.2. Release Notes: fix the incorrect attribute accessing in class Option.from setuptools import setup, find_packages
setup(
name='pyhaproxy',
version='0.3.2',
keywords=('haproxy', 'parse'),
description='A Python library to parse haproxy configuration file',
license='MIT License',
install_requires=[],
include_package_data=True,
package_data={
'pyhaproxy': ['*.peg'],
},
author='Joey',
author_email='majunjiev@gmail.com',
url='https://github.com/imjoey/pyhaproxy',
packages=find_packages(),
platforms='any',
)
| <commit_before>from setuptools import setup, find_packages
setup(
name='pyhaproxy',
version='0.3.0',
keywords=('haproxy', 'parse'),
description='A Python library to parse haproxy configuration file',
license='MIT License',
install_requires=[],
include_package_data=True,
package_data={
'pyhaproxy': ['*.peg'],
},
author='Joey',
author_email='majunjiev@gmail.com',
url='https://github.com/imjoey/pyhaproxy',
packages=find_packages(),
platforms='any',
)
<commit_msg>Change version to v0.3.2. Release Notes: fix the incorrect attribute accessing in class Option.<commit_after>from setuptools import setup, find_packages
setup(
name='pyhaproxy',
version='0.3.2',
keywords=('haproxy', 'parse'),
description='A Python library to parse haproxy configuration file',
license='MIT License',
install_requires=[],
include_package_data=True,
package_data={
'pyhaproxy': ['*.peg'],
},
author='Joey',
author_email='majunjiev@gmail.com',
url='https://github.com/imjoey/pyhaproxy',
packages=find_packages(),
platforms='any',
)
|
dae923853e0218fc77923f4512f72d0109e8f4bb | setup.py | setup.py | from setuptools import setup
PACKAGE_NAME = 'funsize'
PACKAGE_VERSION = '0.1'
setup(name=PACKAGE_NAME,
version=PACKAGE_VERSION,
description='partial mar webservice prototype',
long_description='https://wiki.mozilla.org/User:Ffledgling/Senbonzakura',
classifiers=[],
author='Anhad Jai Singh',
author_email='ffledgling@gmail.com',
url='https://wiki.mozilla.org/User:Ffledgling/Senbonzakura',
license='MPL',
install_requires=[
'Flask==0.10.1',
'celery==3.1.11',
'nose==1.3.3',
'requests==2.2.1',
],
packages=[
'funsize',
'funsize.backend',
'funsize.cache',
'funsize.frontend',
'funsize.utils',
],
tests_require=[
'nose',
'mock'
],
)
| from setuptools import setup
PACKAGE_NAME = 'funsize'
PACKAGE_VERSION = '0.1'
setup(name=PACKAGE_NAME,
version=PACKAGE_VERSION,
description='partial mar webservice prototype',
long_description='https://wiki.mozilla.org/User:Ffledgling/Senbonzakura',
classifiers=[],
author='Anhad Jai Singh',
author_email='ffledgling@gmail.com',
url='https://wiki.mozilla.org/User:Ffledgling/Senbonzakura',
license='MPL',
install_requires=[
'Flask==0.10.1',
'celery==3.1.11',
'nose==1.3.3',
'requests==2.2.1',
'boto==2.33.0',
],
packages=[
'funsize',
'funsize.backend',
'funsize.cache',
'funsize.frontend',
'funsize.utils',
],
tests_require=[
'nose',
'mock'
],
)
| Add boto as requirement for funsize deployment. | Add boto as requirement for funsize deployment.
| Python | mpl-2.0 | petemoore/build-funsize,petemoore/build-funsize | from setuptools import setup
PACKAGE_NAME = 'funsize'
PACKAGE_VERSION = '0.1'
setup(name=PACKAGE_NAME,
version=PACKAGE_VERSION,
description='partial mar webservice prototype',
long_description='https://wiki.mozilla.org/User:Ffledgling/Senbonzakura',
classifiers=[],
author='Anhad Jai Singh',
author_email='ffledgling@gmail.com',
url='https://wiki.mozilla.org/User:Ffledgling/Senbonzakura',
license='MPL',
install_requires=[
'Flask==0.10.1',
'celery==3.1.11',
'nose==1.3.3',
'requests==2.2.1',
],
packages=[
'funsize',
'funsize.backend',
'funsize.cache',
'funsize.frontend',
'funsize.utils',
],
tests_require=[
'nose',
'mock'
],
)
Add boto as requirement for funsize deployment. | from setuptools import setup
PACKAGE_NAME = 'funsize'
PACKAGE_VERSION = '0.1'
setup(name=PACKAGE_NAME,
version=PACKAGE_VERSION,
description='partial mar webservice prototype',
long_description='https://wiki.mozilla.org/User:Ffledgling/Senbonzakura',
classifiers=[],
author='Anhad Jai Singh',
author_email='ffledgling@gmail.com',
url='https://wiki.mozilla.org/User:Ffledgling/Senbonzakura',
license='MPL',
install_requires=[
'Flask==0.10.1',
'celery==3.1.11',
'nose==1.3.3',
'requests==2.2.1',
'boto==2.33.0',
],
packages=[
'funsize',
'funsize.backend',
'funsize.cache',
'funsize.frontend',
'funsize.utils',
],
tests_require=[
'nose',
'mock'
],
)
| <commit_before>from setuptools import setup
PACKAGE_NAME = 'funsize'
PACKAGE_VERSION = '0.1'
setup(name=PACKAGE_NAME,
version=PACKAGE_VERSION,
description='partial mar webservice prototype',
long_description='https://wiki.mozilla.org/User:Ffledgling/Senbonzakura',
classifiers=[],
author='Anhad Jai Singh',
author_email='ffledgling@gmail.com',
url='https://wiki.mozilla.org/User:Ffledgling/Senbonzakura',
license='MPL',
install_requires=[
'Flask==0.10.1',
'celery==3.1.11',
'nose==1.3.3',
'requests==2.2.1',
],
packages=[
'funsize',
'funsize.backend',
'funsize.cache',
'funsize.frontend',
'funsize.utils',
],
tests_require=[
'nose',
'mock'
],
)
<commit_msg>Add boto as requirement for funsize deployment.<commit_after> | from setuptools import setup
PACKAGE_NAME = 'funsize'
PACKAGE_VERSION = '0.1'
setup(name=PACKAGE_NAME,
version=PACKAGE_VERSION,
description='partial mar webservice prototype',
long_description='https://wiki.mozilla.org/User:Ffledgling/Senbonzakura',
classifiers=[],
author='Anhad Jai Singh',
author_email='ffledgling@gmail.com',
url='https://wiki.mozilla.org/User:Ffledgling/Senbonzakura',
license='MPL',
install_requires=[
'Flask==0.10.1',
'celery==3.1.11',
'nose==1.3.3',
'requests==2.2.1',
'boto==2.33.0',
],
packages=[
'funsize',
'funsize.backend',
'funsize.cache',
'funsize.frontend',
'funsize.utils',
],
tests_require=[
'nose',
'mock'
],
)
| from setuptools import setup
PACKAGE_NAME = 'funsize'
PACKAGE_VERSION = '0.1'
setup(name=PACKAGE_NAME,
version=PACKAGE_VERSION,
description='partial mar webservice prototype',
long_description='https://wiki.mozilla.org/User:Ffledgling/Senbonzakura',
classifiers=[],
author='Anhad Jai Singh',
author_email='ffledgling@gmail.com',
url='https://wiki.mozilla.org/User:Ffledgling/Senbonzakura',
license='MPL',
install_requires=[
'Flask==0.10.1',
'celery==3.1.11',
'nose==1.3.3',
'requests==2.2.1',
],
packages=[
'funsize',
'funsize.backend',
'funsize.cache',
'funsize.frontend',
'funsize.utils',
],
tests_require=[
'nose',
'mock'
],
)
Add boto as requirement for funsize deployment.from setuptools import setup
PACKAGE_NAME = 'funsize'
PACKAGE_VERSION = '0.1'
setup(name=PACKAGE_NAME,
version=PACKAGE_VERSION,
description='partial mar webservice prototype',
long_description='https://wiki.mozilla.org/User:Ffledgling/Senbonzakura',
classifiers=[],
author='Anhad Jai Singh',
author_email='ffledgling@gmail.com',
url='https://wiki.mozilla.org/User:Ffledgling/Senbonzakura',
license='MPL',
install_requires=[
'Flask==0.10.1',
'celery==3.1.11',
'nose==1.3.3',
'requests==2.2.1',
'boto==2.33.0',
],
packages=[
'funsize',
'funsize.backend',
'funsize.cache',
'funsize.frontend',
'funsize.utils',
],
tests_require=[
'nose',
'mock'
],
)
| <commit_before>from setuptools import setup
PACKAGE_NAME = 'funsize'
PACKAGE_VERSION = '0.1'
setup(name=PACKAGE_NAME,
version=PACKAGE_VERSION,
description='partial mar webservice prototype',
long_description='https://wiki.mozilla.org/User:Ffledgling/Senbonzakura',
classifiers=[],
author='Anhad Jai Singh',
author_email='ffledgling@gmail.com',
url='https://wiki.mozilla.org/User:Ffledgling/Senbonzakura',
license='MPL',
install_requires=[
'Flask==0.10.1',
'celery==3.1.11',
'nose==1.3.3',
'requests==2.2.1',
],
packages=[
'funsize',
'funsize.backend',
'funsize.cache',
'funsize.frontend',
'funsize.utils',
],
tests_require=[
'nose',
'mock'
],
)
<commit_msg>Add boto as requirement for funsize deployment.<commit_after>from setuptools import setup
PACKAGE_NAME = 'funsize'
PACKAGE_VERSION = '0.1'
setup(name=PACKAGE_NAME,
version=PACKAGE_VERSION,
description='partial mar webservice prototype',
long_description='https://wiki.mozilla.org/User:Ffledgling/Senbonzakura',
classifiers=[],
author='Anhad Jai Singh',
author_email='ffledgling@gmail.com',
url='https://wiki.mozilla.org/User:Ffledgling/Senbonzakura',
license='MPL',
install_requires=[
'Flask==0.10.1',
'celery==3.1.11',
'nose==1.3.3',
'requests==2.2.1',
'boto==2.33.0',
],
packages=[
'funsize',
'funsize.backend',
'funsize.cache',
'funsize.frontend',
'funsize.utils',
],
tests_require=[
'nose',
'mock'
],
)
|
bfc85ac3d2b29e5287fa556e0e2215bc39668db5 | setup.py | setup.py | """setup.py - build script for parquet-python."""
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name='parquet',
version='1.2',
description='Python support for Parquet file format',
author='Joe Crobak',
author_email='joecrow@gmail.com',
url='https://github.com/jcrobak/parquet-python',
license='Apache License 2.0',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
],
packages=['parquet'],
install_requires=[
'python-snappy',
'thriftpy>=0.3.6',
],
extras_require={
':python_version=="2.7"': [
"backports.csv",
],
},
entry_points={
'console_scripts': [
'parquet = parquet.__main__:main',
]
},
package_data={'parquet': ['*.thrift']},
include_package_data=True,
)
| """setup.py - build script for parquet-python."""
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name='parquet',
version='1.2',
description='Python support for Parquet file format',
author='Joe Crobak',
author_email='joecrow@gmail.com',
url='https://github.com/jcrobak/parquet-python',
license='Apache License 2.0',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
],
packages=['parquet'],
install_requires=[
'python-snappy',
'thriftpy2',
],
extras_require={
':python_version=="2.7"': [
"backports.csv",
],
},
entry_points={
'console_scripts': [
'parquet = parquet.__main__:main',
]
},
package_data={'parquet': ['*.thrift']},
include_package_data=True,
)
| Replace thriftpy dependency with thriftpy2 | Replace thriftpy dependency with thriftpy2
| Python | apache-2.0 | jcrobak/parquet-python | """setup.py - build script for parquet-python."""
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name='parquet',
version='1.2',
description='Python support for Parquet file format',
author='Joe Crobak',
author_email='joecrow@gmail.com',
url='https://github.com/jcrobak/parquet-python',
license='Apache License 2.0',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
],
packages=['parquet'],
install_requires=[
'python-snappy',
'thriftpy>=0.3.6',
],
extras_require={
':python_version=="2.7"': [
"backports.csv",
],
},
entry_points={
'console_scripts': [
'parquet = parquet.__main__:main',
]
},
package_data={'parquet': ['*.thrift']},
include_package_data=True,
)
Replace thriftpy dependency with thriftpy2 | """setup.py - build script for parquet-python."""
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name='parquet',
version='1.2',
description='Python support for Parquet file format',
author='Joe Crobak',
author_email='joecrow@gmail.com',
url='https://github.com/jcrobak/parquet-python',
license='Apache License 2.0',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
],
packages=['parquet'],
install_requires=[
'python-snappy',
'thriftpy2',
],
extras_require={
':python_version=="2.7"': [
"backports.csv",
],
},
entry_points={
'console_scripts': [
'parquet = parquet.__main__:main',
]
},
package_data={'parquet': ['*.thrift']},
include_package_data=True,
)
| <commit_before>"""setup.py - build script for parquet-python."""
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name='parquet',
version='1.2',
description='Python support for Parquet file format',
author='Joe Crobak',
author_email='joecrow@gmail.com',
url='https://github.com/jcrobak/parquet-python',
license='Apache License 2.0',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
],
packages=['parquet'],
install_requires=[
'python-snappy',
'thriftpy>=0.3.6',
],
extras_require={
':python_version=="2.7"': [
"backports.csv",
],
},
entry_points={
'console_scripts': [
'parquet = parquet.__main__:main',
]
},
package_data={'parquet': ['*.thrift']},
include_package_data=True,
)
<commit_msg>Replace thriftpy dependency with thriftpy2<commit_after> | """setup.py - build script for parquet-python."""
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name='parquet',
version='1.2',
description='Python support for Parquet file format',
author='Joe Crobak',
author_email='joecrow@gmail.com',
url='https://github.com/jcrobak/parquet-python',
license='Apache License 2.0',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
],
packages=['parquet'],
install_requires=[
'python-snappy',
'thriftpy2',
],
extras_require={
':python_version=="2.7"': [
"backports.csv",
],
},
entry_points={
'console_scripts': [
'parquet = parquet.__main__:main',
]
},
package_data={'parquet': ['*.thrift']},
include_package_data=True,
)
| """setup.py - build script for parquet-python."""
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name='parquet',
version='1.2',
description='Python support for Parquet file format',
author='Joe Crobak',
author_email='joecrow@gmail.com',
url='https://github.com/jcrobak/parquet-python',
license='Apache License 2.0',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
],
packages=['parquet'],
install_requires=[
'python-snappy',
'thriftpy>=0.3.6',
],
extras_require={
':python_version=="2.7"': [
"backports.csv",
],
},
entry_points={
'console_scripts': [
'parquet = parquet.__main__:main',
]
},
package_data={'parquet': ['*.thrift']},
include_package_data=True,
)
Replace thriftpy dependency with thriftpy2"""setup.py - build script for parquet-python."""
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name='parquet',
version='1.2',
description='Python support for Parquet file format',
author='Joe Crobak',
author_email='joecrow@gmail.com',
url='https://github.com/jcrobak/parquet-python',
license='Apache License 2.0',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
],
packages=['parquet'],
install_requires=[
'python-snappy',
'thriftpy2',
],
extras_require={
':python_version=="2.7"': [
"backports.csv",
],
},
entry_points={
'console_scripts': [
'parquet = parquet.__main__:main',
]
},
package_data={'parquet': ['*.thrift']},
include_package_data=True,
)
| <commit_before>"""setup.py - build script for parquet-python."""
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name='parquet',
version='1.2',
description='Python support for Parquet file format',
author='Joe Crobak',
author_email='joecrow@gmail.com',
url='https://github.com/jcrobak/parquet-python',
license='Apache License 2.0',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
],
packages=['parquet'],
install_requires=[
'python-snappy',
'thriftpy>=0.3.6',
],
extras_require={
':python_version=="2.7"': [
"backports.csv",
],
},
entry_points={
'console_scripts': [
'parquet = parquet.__main__:main',
]
},
package_data={'parquet': ['*.thrift']},
include_package_data=True,
)
<commit_msg>Replace thriftpy dependency with thriftpy2<commit_after>"""setup.py - build script for parquet-python."""
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name='parquet',
version='1.2',
description='Python support for Parquet file format',
author='Joe Crobak',
author_email='joecrow@gmail.com',
url='https://github.com/jcrobak/parquet-python',
license='Apache License 2.0',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
],
packages=['parquet'],
install_requires=[
'python-snappy',
'thriftpy2',
],
extras_require={
':python_version=="2.7"': [
"backports.csv",
],
},
entry_points={
'console_scripts': [
'parquet = parquet.__main__:main',
]
},
package_data={'parquet': ['*.thrift']},
include_package_data=True,
)
|
c4e1059b387269b6098d05d2227c085e7931b140 | setup.py | setup.py | # 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/.
from distutils.core import setup, Extension
cpp_args = ['-std=c++11', '-stdlib=libc++', '-mmacosx-version-min=10.7']
ext_modules = [
Extension(
'make_asym',
['make_asym.cc'],
include_dirs=['include'],
language='c++',
extra_compile_args=cpp_args,
),
]
setup(
name='make_asym',
version='0.1',
author='Nate Lust',
author_email='nlust@astro.princeton.edu',
description='A python extension module for calculating asymmetry values',
ext_modules=ext_modules,
)
| # 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/.
from distutils.core import setup, Extension
cpp_args = ['-std=c++11', '-stdlib=libc++', '-mmacosx-version-min=10.7']
ext_modules = [
Extension(
'make_asym',
['make_asym.cc'],
include_dirs=['include'],
language='c++',
extra_compile_args=cpp_args,
),
]
setup(
name='make_asym',
version='0.1',
author='Nate Lust',
author_email='nlust@astro.princeton.edu',
description='A module for calculating centers though least asymmetry',
ext_modules=ext_modules,
)
| Update module description for clarity | Update module description for clarity
| Python | mpl-2.0 | natelust/least_asymmetry,natelust/least_asymmetry,natelust/least_asymmetry | # 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/.
from distutils.core import setup, Extension
cpp_args = ['-std=c++11', '-stdlib=libc++', '-mmacosx-version-min=10.7']
ext_modules = [
Extension(
'make_asym',
['make_asym.cc'],
include_dirs=['include'],
language='c++',
extra_compile_args=cpp_args,
),
]
setup(
name='make_asym',
version='0.1',
author='Nate Lust',
author_email='nlust@astro.princeton.edu',
description='A python extension module for calculating asymmetry values',
ext_modules=ext_modules,
)
Update module description for clarity | # 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/.
from distutils.core import setup, Extension
cpp_args = ['-std=c++11', '-stdlib=libc++', '-mmacosx-version-min=10.7']
ext_modules = [
Extension(
'make_asym',
['make_asym.cc'],
include_dirs=['include'],
language='c++',
extra_compile_args=cpp_args,
),
]
setup(
name='make_asym',
version='0.1',
author='Nate Lust',
author_email='nlust@astro.princeton.edu',
description='A module for calculating centers though least asymmetry',
ext_modules=ext_modules,
)
| <commit_before># 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/.
from distutils.core import setup, Extension
cpp_args = ['-std=c++11', '-stdlib=libc++', '-mmacosx-version-min=10.7']
ext_modules = [
Extension(
'make_asym',
['make_asym.cc'],
include_dirs=['include'],
language='c++',
extra_compile_args=cpp_args,
),
]
setup(
name='make_asym',
version='0.1',
author='Nate Lust',
author_email='nlust@astro.princeton.edu',
description='A python extension module for calculating asymmetry values',
ext_modules=ext_modules,
)
<commit_msg>Update module description for clarity<commit_after> | # 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/.
from distutils.core import setup, Extension
cpp_args = ['-std=c++11', '-stdlib=libc++', '-mmacosx-version-min=10.7']
ext_modules = [
Extension(
'make_asym',
['make_asym.cc'],
include_dirs=['include'],
language='c++',
extra_compile_args=cpp_args,
),
]
setup(
name='make_asym',
version='0.1',
author='Nate Lust',
author_email='nlust@astro.princeton.edu',
description='A module for calculating centers though least asymmetry',
ext_modules=ext_modules,
)
| # 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/.
from distutils.core import setup, Extension
cpp_args = ['-std=c++11', '-stdlib=libc++', '-mmacosx-version-min=10.7']
ext_modules = [
Extension(
'make_asym',
['make_asym.cc'],
include_dirs=['include'],
language='c++',
extra_compile_args=cpp_args,
),
]
setup(
name='make_asym',
version='0.1',
author='Nate Lust',
author_email='nlust@astro.princeton.edu',
description='A python extension module for calculating asymmetry values',
ext_modules=ext_modules,
)
Update module description for clarity# 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/.
from distutils.core import setup, Extension
cpp_args = ['-std=c++11', '-stdlib=libc++', '-mmacosx-version-min=10.7']
ext_modules = [
Extension(
'make_asym',
['make_asym.cc'],
include_dirs=['include'],
language='c++',
extra_compile_args=cpp_args,
),
]
setup(
name='make_asym',
version='0.1',
author='Nate Lust',
author_email='nlust@astro.princeton.edu',
description='A module for calculating centers though least asymmetry',
ext_modules=ext_modules,
)
| <commit_before># 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/.
from distutils.core import setup, Extension
cpp_args = ['-std=c++11', '-stdlib=libc++', '-mmacosx-version-min=10.7']
ext_modules = [
Extension(
'make_asym',
['make_asym.cc'],
include_dirs=['include'],
language='c++',
extra_compile_args=cpp_args,
),
]
setup(
name='make_asym',
version='0.1',
author='Nate Lust',
author_email='nlust@astro.princeton.edu',
description='A python extension module for calculating asymmetry values',
ext_modules=ext_modules,
)
<commit_msg>Update module description for clarity<commit_after># 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/.
from distutils.core import setup, Extension
cpp_args = ['-std=c++11', '-stdlib=libc++', '-mmacosx-version-min=10.7']
ext_modules = [
Extension(
'make_asym',
['make_asym.cc'],
include_dirs=['include'],
language='c++',
extra_compile_args=cpp_args,
),
]
setup(
name='make_asym',
version='0.1',
author='Nate Lust',
author_email='nlust@astro.princeton.edu',
description='A module for calculating centers though least asymmetry',
ext_modules=ext_modules,
)
|
a52c84f092d89f89130c2696c98779e955f083dc | tests/test_version_parser.py | tests/test_version_parser.py | import pytest
from leak.version_parser import versions_split
def test_versions_split():
pass
def test_wrong_versions_split():
# too many dots
assert versions_split('1.2.3.4') == [0, 0, 0]
# test missing numeric version
with pytest.raises(ValueError):
versions_split('not.numeric')
# test not string provided
with pytest.raises(AttributeError):
versions_split(12345)
| import pytest
from leak.version_parser import versions_split
def test_versions_split():
assert versions_split('1.8.1') == [1, 8, 1]
assert versions_split('1.4') == [1, 4, 0]
assert versions_split('2') == [2, 0, 0]
def test_versions_split_str_mapping():
assert versions_split('1.11rc1', type_applyer=str) == ['1', '11rc1', '0']
assert versions_split('1.10b1', type_applyer=str) == ['1', '10b1', '0']
assert versions_split('text', type_applyer=str) == ['text', '0', '0']
def test_wrong_versions_split():
# too many dots
assert versions_split('1.2.3.4') == [0, 0, 0]
# test missing numeric version
with pytest.raises(ValueError):
versions_split('not.numeric')
# test not string provided
with pytest.raises(AttributeError):
versions_split(12345)
| Add tests for version splitting | Add tests for version splitting
| Python | mit | bmwant21/leak | import pytest
from leak.version_parser import versions_split
def test_versions_split():
pass
def test_wrong_versions_split():
# too many dots
assert versions_split('1.2.3.4') == [0, 0, 0]
# test missing numeric version
with pytest.raises(ValueError):
versions_split('not.numeric')
# test not string provided
with pytest.raises(AttributeError):
versions_split(12345)
Add tests for version splitting | import pytest
from leak.version_parser import versions_split
def test_versions_split():
assert versions_split('1.8.1') == [1, 8, 1]
assert versions_split('1.4') == [1, 4, 0]
assert versions_split('2') == [2, 0, 0]
def test_versions_split_str_mapping():
assert versions_split('1.11rc1', type_applyer=str) == ['1', '11rc1', '0']
assert versions_split('1.10b1', type_applyer=str) == ['1', '10b1', '0']
assert versions_split('text', type_applyer=str) == ['text', '0', '0']
def test_wrong_versions_split():
# too many dots
assert versions_split('1.2.3.4') == [0, 0, 0]
# test missing numeric version
with pytest.raises(ValueError):
versions_split('not.numeric')
# test not string provided
with pytest.raises(AttributeError):
versions_split(12345)
| <commit_before>import pytest
from leak.version_parser import versions_split
def test_versions_split():
pass
def test_wrong_versions_split():
# too many dots
assert versions_split('1.2.3.4') == [0, 0, 0]
# test missing numeric version
with pytest.raises(ValueError):
versions_split('not.numeric')
# test not string provided
with pytest.raises(AttributeError):
versions_split(12345)
<commit_msg>Add tests for version splitting<commit_after> | import pytest
from leak.version_parser import versions_split
def test_versions_split():
assert versions_split('1.8.1') == [1, 8, 1]
assert versions_split('1.4') == [1, 4, 0]
assert versions_split('2') == [2, 0, 0]
def test_versions_split_str_mapping():
assert versions_split('1.11rc1', type_applyer=str) == ['1', '11rc1', '0']
assert versions_split('1.10b1', type_applyer=str) == ['1', '10b1', '0']
assert versions_split('text', type_applyer=str) == ['text', '0', '0']
def test_wrong_versions_split():
# too many dots
assert versions_split('1.2.3.4') == [0, 0, 0]
# test missing numeric version
with pytest.raises(ValueError):
versions_split('not.numeric')
# test not string provided
with pytest.raises(AttributeError):
versions_split(12345)
| import pytest
from leak.version_parser import versions_split
def test_versions_split():
pass
def test_wrong_versions_split():
# too many dots
assert versions_split('1.2.3.4') == [0, 0, 0]
# test missing numeric version
with pytest.raises(ValueError):
versions_split('not.numeric')
# test not string provided
with pytest.raises(AttributeError):
versions_split(12345)
Add tests for version splittingimport pytest
from leak.version_parser import versions_split
def test_versions_split():
assert versions_split('1.8.1') == [1, 8, 1]
assert versions_split('1.4') == [1, 4, 0]
assert versions_split('2') == [2, 0, 0]
def test_versions_split_str_mapping():
assert versions_split('1.11rc1', type_applyer=str) == ['1', '11rc1', '0']
assert versions_split('1.10b1', type_applyer=str) == ['1', '10b1', '0']
assert versions_split('text', type_applyer=str) == ['text', '0', '0']
def test_wrong_versions_split():
# too many dots
assert versions_split('1.2.3.4') == [0, 0, 0]
# test missing numeric version
with pytest.raises(ValueError):
versions_split('not.numeric')
# test not string provided
with pytest.raises(AttributeError):
versions_split(12345)
| <commit_before>import pytest
from leak.version_parser import versions_split
def test_versions_split():
pass
def test_wrong_versions_split():
# too many dots
assert versions_split('1.2.3.4') == [0, 0, 0]
# test missing numeric version
with pytest.raises(ValueError):
versions_split('not.numeric')
# test not string provided
with pytest.raises(AttributeError):
versions_split(12345)
<commit_msg>Add tests for version splitting<commit_after>import pytest
from leak.version_parser import versions_split
def test_versions_split():
assert versions_split('1.8.1') == [1, 8, 1]
assert versions_split('1.4') == [1, 4, 0]
assert versions_split('2') == [2, 0, 0]
def test_versions_split_str_mapping():
assert versions_split('1.11rc1', type_applyer=str) == ['1', '11rc1', '0']
assert versions_split('1.10b1', type_applyer=str) == ['1', '10b1', '0']
assert versions_split('text', type_applyer=str) == ['text', '0', '0']
def test_wrong_versions_split():
# too many dots
assert versions_split('1.2.3.4') == [0, 0, 0]
# test missing numeric version
with pytest.raises(ValueError):
versions_split('not.numeric')
# test not string provided
with pytest.raises(AttributeError):
versions_split(12345)
|
fdb461f000adefff0d1050464e5783c96222f364 | setup.py | setup.py | from setuptools import setup
setup(
name='scuevals-api',
packages=['scuevals_api'],
include_package_data=True,
test_suite='tests',
entry_points={
'console_scripts': [
'app=scuevals_api.cmd:cli'
]
},
install_requires=[
'alembic==0.9.7',
'beautifulsoup4==4.6.0',
'blinker==1.4',
'coveralls==1.2.0',
'Flask-Caching==1.3.3',
'Flask-Cors==3.0.3',
'Flask-JWT-Extended==3.6.0',
'Flask-Migrate==2.1.1',
'Flask-RESTful==0.3.6',
'Flask-Rollbar==1.0.1',
'Flask-SQLAlchemy==2.3.2',
'Flask==0.12.2',
'gunicorn==19.7.1',
'newrelic==2.100.0.84',
'psycopg2==2.7.3.2',
'python-jose==2.0.1',
'PyYAML==3.12',
'requests==2.18.4',
'rollbar==0.13.17',
'vcrpy==1.11.1',
'webargs==1.8.1',
],
)
| from setuptools import setup
setup(
name='scuevals-api',
packages=['scuevals_api'],
include_package_data=True,
test_suite='tests',
entry_points={
'console_scripts': [
'app=scuevals_api.cmd:cli'
]
},
install_requires=[
'alembic==0.9.7',
'beautifulsoup4==4.6.0',
'blinker==1.4',
'coveralls==1.2.0',
'Flask-Caching==1.3.3',
'Flask-Cors==3.0.3',
'Flask-JWT-Extended==3.6.0',
'Flask-Migrate==2.1.1',
'Flask-RESTful==0.3.6',
'Flask-Rollbar==1.0.1',
'Flask-SQLAlchemy==2.3.2',
'Flask==0.12.2',
'gunicorn==19.7.1',
'newrelic==2.100.0.84',
'psycopg2==2.7.3.2',
'pycryptodome>=3.4.7'
'python-jose==2.0.1',
'PyYAML==3.12',
'requests==2.18.4',
'rollbar==0.13.17',
'vcrpy==1.11.1',
'webargs==1.8.1',
],
)
| Add minimum version for pycryptodome | Add minimum version for pycryptodome
| Python | agpl-3.0 | SCUEvals/scuevals-api,SCUEvals/scuevals-api | from setuptools import setup
setup(
name='scuevals-api',
packages=['scuevals_api'],
include_package_data=True,
test_suite='tests',
entry_points={
'console_scripts': [
'app=scuevals_api.cmd:cli'
]
},
install_requires=[
'alembic==0.9.7',
'beautifulsoup4==4.6.0',
'blinker==1.4',
'coveralls==1.2.0',
'Flask-Caching==1.3.3',
'Flask-Cors==3.0.3',
'Flask-JWT-Extended==3.6.0',
'Flask-Migrate==2.1.1',
'Flask-RESTful==0.3.6',
'Flask-Rollbar==1.0.1',
'Flask-SQLAlchemy==2.3.2',
'Flask==0.12.2',
'gunicorn==19.7.1',
'newrelic==2.100.0.84',
'psycopg2==2.7.3.2',
'python-jose==2.0.1',
'PyYAML==3.12',
'requests==2.18.4',
'rollbar==0.13.17',
'vcrpy==1.11.1',
'webargs==1.8.1',
],
)
Add minimum version for pycryptodome | from setuptools import setup
setup(
name='scuevals-api',
packages=['scuevals_api'],
include_package_data=True,
test_suite='tests',
entry_points={
'console_scripts': [
'app=scuevals_api.cmd:cli'
]
},
install_requires=[
'alembic==0.9.7',
'beautifulsoup4==4.6.0',
'blinker==1.4',
'coveralls==1.2.0',
'Flask-Caching==1.3.3',
'Flask-Cors==3.0.3',
'Flask-JWT-Extended==3.6.0',
'Flask-Migrate==2.1.1',
'Flask-RESTful==0.3.6',
'Flask-Rollbar==1.0.1',
'Flask-SQLAlchemy==2.3.2',
'Flask==0.12.2',
'gunicorn==19.7.1',
'newrelic==2.100.0.84',
'psycopg2==2.7.3.2',
'pycryptodome>=3.4.7'
'python-jose==2.0.1',
'PyYAML==3.12',
'requests==2.18.4',
'rollbar==0.13.17',
'vcrpy==1.11.1',
'webargs==1.8.1',
],
)
| <commit_before>from setuptools import setup
setup(
name='scuevals-api',
packages=['scuevals_api'],
include_package_data=True,
test_suite='tests',
entry_points={
'console_scripts': [
'app=scuevals_api.cmd:cli'
]
},
install_requires=[
'alembic==0.9.7',
'beautifulsoup4==4.6.0',
'blinker==1.4',
'coveralls==1.2.0',
'Flask-Caching==1.3.3',
'Flask-Cors==3.0.3',
'Flask-JWT-Extended==3.6.0',
'Flask-Migrate==2.1.1',
'Flask-RESTful==0.3.6',
'Flask-Rollbar==1.0.1',
'Flask-SQLAlchemy==2.3.2',
'Flask==0.12.2',
'gunicorn==19.7.1',
'newrelic==2.100.0.84',
'psycopg2==2.7.3.2',
'python-jose==2.0.1',
'PyYAML==3.12',
'requests==2.18.4',
'rollbar==0.13.17',
'vcrpy==1.11.1',
'webargs==1.8.1',
],
)
<commit_msg>Add minimum version for pycryptodome<commit_after> | from setuptools import setup
setup(
name='scuevals-api',
packages=['scuevals_api'],
include_package_data=True,
test_suite='tests',
entry_points={
'console_scripts': [
'app=scuevals_api.cmd:cli'
]
},
install_requires=[
'alembic==0.9.7',
'beautifulsoup4==4.6.0',
'blinker==1.4',
'coveralls==1.2.0',
'Flask-Caching==1.3.3',
'Flask-Cors==3.0.3',
'Flask-JWT-Extended==3.6.0',
'Flask-Migrate==2.1.1',
'Flask-RESTful==0.3.6',
'Flask-Rollbar==1.0.1',
'Flask-SQLAlchemy==2.3.2',
'Flask==0.12.2',
'gunicorn==19.7.1',
'newrelic==2.100.0.84',
'psycopg2==2.7.3.2',
'pycryptodome>=3.4.7'
'python-jose==2.0.1',
'PyYAML==3.12',
'requests==2.18.4',
'rollbar==0.13.17',
'vcrpy==1.11.1',
'webargs==1.8.1',
],
)
| from setuptools import setup
setup(
name='scuevals-api',
packages=['scuevals_api'],
include_package_data=True,
test_suite='tests',
entry_points={
'console_scripts': [
'app=scuevals_api.cmd:cli'
]
},
install_requires=[
'alembic==0.9.7',
'beautifulsoup4==4.6.0',
'blinker==1.4',
'coveralls==1.2.0',
'Flask-Caching==1.3.3',
'Flask-Cors==3.0.3',
'Flask-JWT-Extended==3.6.0',
'Flask-Migrate==2.1.1',
'Flask-RESTful==0.3.6',
'Flask-Rollbar==1.0.1',
'Flask-SQLAlchemy==2.3.2',
'Flask==0.12.2',
'gunicorn==19.7.1',
'newrelic==2.100.0.84',
'psycopg2==2.7.3.2',
'python-jose==2.0.1',
'PyYAML==3.12',
'requests==2.18.4',
'rollbar==0.13.17',
'vcrpy==1.11.1',
'webargs==1.8.1',
],
)
Add minimum version for pycryptodomefrom setuptools import setup
setup(
name='scuevals-api',
packages=['scuevals_api'],
include_package_data=True,
test_suite='tests',
entry_points={
'console_scripts': [
'app=scuevals_api.cmd:cli'
]
},
install_requires=[
'alembic==0.9.7',
'beautifulsoup4==4.6.0',
'blinker==1.4',
'coveralls==1.2.0',
'Flask-Caching==1.3.3',
'Flask-Cors==3.0.3',
'Flask-JWT-Extended==3.6.0',
'Flask-Migrate==2.1.1',
'Flask-RESTful==0.3.6',
'Flask-Rollbar==1.0.1',
'Flask-SQLAlchemy==2.3.2',
'Flask==0.12.2',
'gunicorn==19.7.1',
'newrelic==2.100.0.84',
'psycopg2==2.7.3.2',
'pycryptodome>=3.4.7'
'python-jose==2.0.1',
'PyYAML==3.12',
'requests==2.18.4',
'rollbar==0.13.17',
'vcrpy==1.11.1',
'webargs==1.8.1',
],
)
| <commit_before>from setuptools import setup
setup(
name='scuevals-api',
packages=['scuevals_api'],
include_package_data=True,
test_suite='tests',
entry_points={
'console_scripts': [
'app=scuevals_api.cmd:cli'
]
},
install_requires=[
'alembic==0.9.7',
'beautifulsoup4==4.6.0',
'blinker==1.4',
'coveralls==1.2.0',
'Flask-Caching==1.3.3',
'Flask-Cors==3.0.3',
'Flask-JWT-Extended==3.6.0',
'Flask-Migrate==2.1.1',
'Flask-RESTful==0.3.6',
'Flask-Rollbar==1.0.1',
'Flask-SQLAlchemy==2.3.2',
'Flask==0.12.2',
'gunicorn==19.7.1',
'newrelic==2.100.0.84',
'psycopg2==2.7.3.2',
'python-jose==2.0.1',
'PyYAML==3.12',
'requests==2.18.4',
'rollbar==0.13.17',
'vcrpy==1.11.1',
'webargs==1.8.1',
],
)
<commit_msg>Add minimum version for pycryptodome<commit_after>from setuptools import setup
setup(
name='scuevals-api',
packages=['scuevals_api'],
include_package_data=True,
test_suite='tests',
entry_points={
'console_scripts': [
'app=scuevals_api.cmd:cli'
]
},
install_requires=[
'alembic==0.9.7',
'beautifulsoup4==4.6.0',
'blinker==1.4',
'coveralls==1.2.0',
'Flask-Caching==1.3.3',
'Flask-Cors==3.0.3',
'Flask-JWT-Extended==3.6.0',
'Flask-Migrate==2.1.1',
'Flask-RESTful==0.3.6',
'Flask-Rollbar==1.0.1',
'Flask-SQLAlchemy==2.3.2',
'Flask==0.12.2',
'gunicorn==19.7.1',
'newrelic==2.100.0.84',
'psycopg2==2.7.3.2',
'pycryptodome>=3.4.7'
'python-jose==2.0.1',
'PyYAML==3.12',
'requests==2.18.4',
'rollbar==0.13.17',
'vcrpy==1.11.1',
'webargs==1.8.1',
],
)
|
43dc6dc0a9b33de0db1f79f7470d69519192dc1f | setup.py | setup.py | from setuptools import setup, find_packages
try:
import nose.commands
extra_args = dict(
cmdclass={'test': nose.commands.nosetests},
)
except ImportError:
extra_args = dict()
setup(
name='dear_astrid',
version='0.1.0',
author='Randy Stauner',
author_email='randy@magnificent-tears.com',
packages=find_packages(), #['dear_astrid', 'dear_astrid.test'],
#scripts=['bin/dear_astrid.py'],
url='http://github.com/rwstauner/dear_astrid/',
license='MIT',
description='Migrate tasks from Astrid backup xml',
long_description=open('README.rst').read(),
install_requires=[
'pyrtm>=0.4.1',
],
setup_requires=['nose>=1.0'],
tests_require=[
'nose',
'mock',
],
**extra_args
)
| from setuptools import setup, find_packages
try:
import nose.commands
extra_args = dict(
cmdclass={'test': nose.commands.nosetests},
)
except ImportError:
extra_args = dict()
# TODO: would this work? (is the file included in the dist?)
#tests_require = [l.strip() for l in open('test-requirements.txt').readlines()]
tests_require = ['mock']
setup(
name='dear_astrid',
version='0.1.0',
author='Randy Stauner',
author_email='randy@magnificent-tears.com',
packages=find_packages(), #['dear_astrid', 'dear_astrid.test'],
#scripts=['bin/dear_astrid.py'],
url='http://github.com/rwstauner/dear_astrid/',
license='MIT',
description='Migrate tasks from Astrid backup xml',
long_description=open('README.rst').read(),
install_requires=[
'pyrtm>=0.4.1',
],
setup_requires=['nose>=1.0'],
tests_require=tests_require,
extras_require={
'test': tests_require,
},
**extra_args
)
| Put tests_require into extras_require also | Put tests_require into extras_require also
| Python | mit | rwstauner/dear_astrid,rwstauner/dear_astrid | from setuptools import setup, find_packages
try:
import nose.commands
extra_args = dict(
cmdclass={'test': nose.commands.nosetests},
)
except ImportError:
extra_args = dict()
setup(
name='dear_astrid',
version='0.1.0',
author='Randy Stauner',
author_email='randy@magnificent-tears.com',
packages=find_packages(), #['dear_astrid', 'dear_astrid.test'],
#scripts=['bin/dear_astrid.py'],
url='http://github.com/rwstauner/dear_astrid/',
license='MIT',
description='Migrate tasks from Astrid backup xml',
long_description=open('README.rst').read(),
install_requires=[
'pyrtm>=0.4.1',
],
setup_requires=['nose>=1.0'],
tests_require=[
'nose',
'mock',
],
**extra_args
)
Put tests_require into extras_require also | from setuptools import setup, find_packages
try:
import nose.commands
extra_args = dict(
cmdclass={'test': nose.commands.nosetests},
)
except ImportError:
extra_args = dict()
# TODO: would this work? (is the file included in the dist?)
#tests_require = [l.strip() for l in open('test-requirements.txt').readlines()]
tests_require = ['mock']
setup(
name='dear_astrid',
version='0.1.0',
author='Randy Stauner',
author_email='randy@magnificent-tears.com',
packages=find_packages(), #['dear_astrid', 'dear_astrid.test'],
#scripts=['bin/dear_astrid.py'],
url='http://github.com/rwstauner/dear_astrid/',
license='MIT',
description='Migrate tasks from Astrid backup xml',
long_description=open('README.rst').read(),
install_requires=[
'pyrtm>=0.4.1',
],
setup_requires=['nose>=1.0'],
tests_require=tests_require,
extras_require={
'test': tests_require,
},
**extra_args
)
| <commit_before>from setuptools import setup, find_packages
try:
import nose.commands
extra_args = dict(
cmdclass={'test': nose.commands.nosetests},
)
except ImportError:
extra_args = dict()
setup(
name='dear_astrid',
version='0.1.0',
author='Randy Stauner',
author_email='randy@magnificent-tears.com',
packages=find_packages(), #['dear_astrid', 'dear_astrid.test'],
#scripts=['bin/dear_astrid.py'],
url='http://github.com/rwstauner/dear_astrid/',
license='MIT',
description='Migrate tasks from Astrid backup xml',
long_description=open('README.rst').read(),
install_requires=[
'pyrtm>=0.4.1',
],
setup_requires=['nose>=1.0'],
tests_require=[
'nose',
'mock',
],
**extra_args
)
<commit_msg>Put tests_require into extras_require also<commit_after> | from setuptools import setup, find_packages
try:
import nose.commands
extra_args = dict(
cmdclass={'test': nose.commands.nosetests},
)
except ImportError:
extra_args = dict()
# TODO: would this work? (is the file included in the dist?)
#tests_require = [l.strip() for l in open('test-requirements.txt').readlines()]
tests_require = ['mock']
setup(
name='dear_astrid',
version='0.1.0',
author='Randy Stauner',
author_email='randy@magnificent-tears.com',
packages=find_packages(), #['dear_astrid', 'dear_astrid.test'],
#scripts=['bin/dear_astrid.py'],
url='http://github.com/rwstauner/dear_astrid/',
license='MIT',
description='Migrate tasks from Astrid backup xml',
long_description=open('README.rst').read(),
install_requires=[
'pyrtm>=0.4.1',
],
setup_requires=['nose>=1.0'],
tests_require=tests_require,
extras_require={
'test': tests_require,
},
**extra_args
)
| from setuptools import setup, find_packages
try:
import nose.commands
extra_args = dict(
cmdclass={'test': nose.commands.nosetests},
)
except ImportError:
extra_args = dict()
setup(
name='dear_astrid',
version='0.1.0',
author='Randy Stauner',
author_email='randy@magnificent-tears.com',
packages=find_packages(), #['dear_astrid', 'dear_astrid.test'],
#scripts=['bin/dear_astrid.py'],
url='http://github.com/rwstauner/dear_astrid/',
license='MIT',
description='Migrate tasks from Astrid backup xml',
long_description=open('README.rst').read(),
install_requires=[
'pyrtm>=0.4.1',
],
setup_requires=['nose>=1.0'],
tests_require=[
'nose',
'mock',
],
**extra_args
)
Put tests_require into extras_require alsofrom setuptools import setup, find_packages
try:
import nose.commands
extra_args = dict(
cmdclass={'test': nose.commands.nosetests},
)
except ImportError:
extra_args = dict()
# TODO: would this work? (is the file included in the dist?)
#tests_require = [l.strip() for l in open('test-requirements.txt').readlines()]
tests_require = ['mock']
setup(
name='dear_astrid',
version='0.1.0',
author='Randy Stauner',
author_email='randy@magnificent-tears.com',
packages=find_packages(), #['dear_astrid', 'dear_astrid.test'],
#scripts=['bin/dear_astrid.py'],
url='http://github.com/rwstauner/dear_astrid/',
license='MIT',
description='Migrate tasks from Astrid backup xml',
long_description=open('README.rst').read(),
install_requires=[
'pyrtm>=0.4.1',
],
setup_requires=['nose>=1.0'],
tests_require=tests_require,
extras_require={
'test': tests_require,
},
**extra_args
)
| <commit_before>from setuptools import setup, find_packages
try:
import nose.commands
extra_args = dict(
cmdclass={'test': nose.commands.nosetests},
)
except ImportError:
extra_args = dict()
setup(
name='dear_astrid',
version='0.1.0',
author='Randy Stauner',
author_email='randy@magnificent-tears.com',
packages=find_packages(), #['dear_astrid', 'dear_astrid.test'],
#scripts=['bin/dear_astrid.py'],
url='http://github.com/rwstauner/dear_astrid/',
license='MIT',
description='Migrate tasks from Astrid backup xml',
long_description=open('README.rst').read(),
install_requires=[
'pyrtm>=0.4.1',
],
setup_requires=['nose>=1.0'],
tests_require=[
'nose',
'mock',
],
**extra_args
)
<commit_msg>Put tests_require into extras_require also<commit_after>from setuptools import setup, find_packages
try:
import nose.commands
extra_args = dict(
cmdclass={'test': nose.commands.nosetests},
)
except ImportError:
extra_args = dict()
# TODO: would this work? (is the file included in the dist?)
#tests_require = [l.strip() for l in open('test-requirements.txt').readlines()]
tests_require = ['mock']
setup(
name='dear_astrid',
version='0.1.0',
author='Randy Stauner',
author_email='randy@magnificent-tears.com',
packages=find_packages(), #['dear_astrid', 'dear_astrid.test'],
#scripts=['bin/dear_astrid.py'],
url='http://github.com/rwstauner/dear_astrid/',
license='MIT',
description='Migrate tasks from Astrid backup xml',
long_description=open('README.rst').read(),
install_requires=[
'pyrtm>=0.4.1',
],
setup_requires=['nose>=1.0'],
tests_require=tests_require,
extras_require={
'test': tests_require,
},
**extra_args
)
|
85d2c012bfaeeb04fa8dd31cd05a04a8dc43c14e | tests/grammar_term-nonterm_test/NonterminalsInvalidTest.py | tests/grammar_term-nonterm_test/NonterminalsInvalidTest.py | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import TestCase, main
from grammpy.RawGrammar import RawGrammar
class NonterminalsInvalidTest(TestCase):
pass
if __name__ == '__main__':
main()
| #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import TestCase, main
from grammpy.RawGrammar import RawGrammar as Grammar
from grammpy import Nonterminal
from grammpy.exceptions import NotNonterminalException
class TempClass(Nonterminal):
pass
class NonterminalsInvalidTest(TestCase):
def test_invalidAddNumber(self):
gr = Grammar()
with self.assertRaises(NotNonterminalException):
gr.add_nonterm(0)
def test_invalidAddString(self):
gr = Grammar()
with self.assertRaises(NotNonterminalException):
gr.add_nonterm("string")
def test_invalidAddAfterCorrectAdd(self):
gr = Grammar()
gr.add_nonterm(TempClass)
with self.assertRaises(NotNonterminalException):
gr.add_nonterm("asdf")
def test_invalidAddInArray(self):
gr = Grammar()
with self.assertRaises(NotNonterminalException):
gr.add_nonterm([TempClass, "asdf"])
def test_invalidHaveNumber(self):
gr = Grammar()
with self.assertRaises(NotNonterminalException):
gr.have_nonterm(0)
def test_invalidHaveString(self):
gr = Grammar()
with self.assertRaises(NotNonterminalException):
gr.have_nonterm("string")
def test_invalidHaveAfterCorrectAdd(self):
gr = Grammar()
gr.add_nonterm(TempClass)
with self.assertRaises(NotNonterminalException):
gr.have_nonterm("asdf")
def test_invalidHaveInArray(self):
gr = Grammar()
with self.assertRaises(NotNonterminalException):
gr.have_nonterm([TempClass, "asdf"])
if __name__ == '__main__':
main()
| Add tests that have and get of nonterms raise exceptions | Add tests that have and get of nonterms raise exceptions
| Python | mit | PatrikValkovic/grammpy | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import TestCase, main
from grammpy.RawGrammar import RawGrammar
class NonterminalsInvalidTest(TestCase):
pass
if __name__ == '__main__':
main()
Add tests that have and get of nonterms raise exceptions | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import TestCase, main
from grammpy.RawGrammar import RawGrammar as Grammar
from grammpy import Nonterminal
from grammpy.exceptions import NotNonterminalException
class TempClass(Nonterminal):
pass
class NonterminalsInvalidTest(TestCase):
def test_invalidAddNumber(self):
gr = Grammar()
with self.assertRaises(NotNonterminalException):
gr.add_nonterm(0)
def test_invalidAddString(self):
gr = Grammar()
with self.assertRaises(NotNonterminalException):
gr.add_nonterm("string")
def test_invalidAddAfterCorrectAdd(self):
gr = Grammar()
gr.add_nonterm(TempClass)
with self.assertRaises(NotNonterminalException):
gr.add_nonterm("asdf")
def test_invalidAddInArray(self):
gr = Grammar()
with self.assertRaises(NotNonterminalException):
gr.add_nonterm([TempClass, "asdf"])
def test_invalidHaveNumber(self):
gr = Grammar()
with self.assertRaises(NotNonterminalException):
gr.have_nonterm(0)
def test_invalidHaveString(self):
gr = Grammar()
with self.assertRaises(NotNonterminalException):
gr.have_nonterm("string")
def test_invalidHaveAfterCorrectAdd(self):
gr = Grammar()
gr.add_nonterm(TempClass)
with self.assertRaises(NotNonterminalException):
gr.have_nonterm("asdf")
def test_invalidHaveInArray(self):
gr = Grammar()
with self.assertRaises(NotNonterminalException):
gr.have_nonterm([TempClass, "asdf"])
if __name__ == '__main__':
main()
| <commit_before>#!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import TestCase, main
from grammpy.RawGrammar import RawGrammar
class NonterminalsInvalidTest(TestCase):
pass
if __name__ == '__main__':
main()
<commit_msg>Add tests that have and get of nonterms raise exceptions<commit_after> | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import TestCase, main
from grammpy.RawGrammar import RawGrammar as Grammar
from grammpy import Nonterminal
from grammpy.exceptions import NotNonterminalException
class TempClass(Nonterminal):
pass
class NonterminalsInvalidTest(TestCase):
def test_invalidAddNumber(self):
gr = Grammar()
with self.assertRaises(NotNonterminalException):
gr.add_nonterm(0)
def test_invalidAddString(self):
gr = Grammar()
with self.assertRaises(NotNonterminalException):
gr.add_nonterm("string")
def test_invalidAddAfterCorrectAdd(self):
gr = Grammar()
gr.add_nonterm(TempClass)
with self.assertRaises(NotNonterminalException):
gr.add_nonterm("asdf")
def test_invalidAddInArray(self):
gr = Grammar()
with self.assertRaises(NotNonterminalException):
gr.add_nonterm([TempClass, "asdf"])
def test_invalidHaveNumber(self):
gr = Grammar()
with self.assertRaises(NotNonterminalException):
gr.have_nonterm(0)
def test_invalidHaveString(self):
gr = Grammar()
with self.assertRaises(NotNonterminalException):
gr.have_nonterm("string")
def test_invalidHaveAfterCorrectAdd(self):
gr = Grammar()
gr.add_nonterm(TempClass)
with self.assertRaises(NotNonterminalException):
gr.have_nonterm("asdf")
def test_invalidHaveInArray(self):
gr = Grammar()
with self.assertRaises(NotNonterminalException):
gr.have_nonterm([TempClass, "asdf"])
if __name__ == '__main__':
main()
| #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import TestCase, main
from grammpy.RawGrammar import RawGrammar
class NonterminalsInvalidTest(TestCase):
pass
if __name__ == '__main__':
main()
Add tests that have and get of nonterms raise exceptions#!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import TestCase, main
from grammpy.RawGrammar import RawGrammar as Grammar
from grammpy import Nonterminal
from grammpy.exceptions import NotNonterminalException
class TempClass(Nonterminal):
pass
class NonterminalsInvalidTest(TestCase):
def test_invalidAddNumber(self):
gr = Grammar()
with self.assertRaises(NotNonterminalException):
gr.add_nonterm(0)
def test_invalidAddString(self):
gr = Grammar()
with self.assertRaises(NotNonterminalException):
gr.add_nonterm("string")
def test_invalidAddAfterCorrectAdd(self):
gr = Grammar()
gr.add_nonterm(TempClass)
with self.assertRaises(NotNonterminalException):
gr.add_nonterm("asdf")
def test_invalidAddInArray(self):
gr = Grammar()
with self.assertRaises(NotNonterminalException):
gr.add_nonterm([TempClass, "asdf"])
def test_invalidHaveNumber(self):
gr = Grammar()
with self.assertRaises(NotNonterminalException):
gr.have_nonterm(0)
def test_invalidHaveString(self):
gr = Grammar()
with self.assertRaises(NotNonterminalException):
gr.have_nonterm("string")
def test_invalidHaveAfterCorrectAdd(self):
gr = Grammar()
gr.add_nonterm(TempClass)
with self.assertRaises(NotNonterminalException):
gr.have_nonterm("asdf")
def test_invalidHaveInArray(self):
gr = Grammar()
with self.assertRaises(NotNonterminalException):
gr.have_nonterm([TempClass, "asdf"])
if __name__ == '__main__':
main()
| <commit_before>#!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import TestCase, main
from grammpy.RawGrammar import RawGrammar
class NonterminalsInvalidTest(TestCase):
pass
if __name__ == '__main__':
main()
<commit_msg>Add tests that have and get of nonterms raise exceptions<commit_after>#!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import TestCase, main
from grammpy.RawGrammar import RawGrammar as Grammar
from grammpy import Nonterminal
from grammpy.exceptions import NotNonterminalException
class TempClass(Nonterminal):
pass
class NonterminalsInvalidTest(TestCase):
def test_invalidAddNumber(self):
gr = Grammar()
with self.assertRaises(NotNonterminalException):
gr.add_nonterm(0)
def test_invalidAddString(self):
gr = Grammar()
with self.assertRaises(NotNonterminalException):
gr.add_nonterm("string")
def test_invalidAddAfterCorrectAdd(self):
gr = Grammar()
gr.add_nonterm(TempClass)
with self.assertRaises(NotNonterminalException):
gr.add_nonterm("asdf")
def test_invalidAddInArray(self):
gr = Grammar()
with self.assertRaises(NotNonterminalException):
gr.add_nonterm([TempClass, "asdf"])
def test_invalidHaveNumber(self):
gr = Grammar()
with self.assertRaises(NotNonterminalException):
gr.have_nonterm(0)
def test_invalidHaveString(self):
gr = Grammar()
with self.assertRaises(NotNonterminalException):
gr.have_nonterm("string")
def test_invalidHaveAfterCorrectAdd(self):
gr = Grammar()
gr.add_nonterm(TempClass)
with self.assertRaises(NotNonterminalException):
gr.have_nonterm("asdf")
def test_invalidHaveInArray(self):
gr = Grammar()
with self.assertRaises(NotNonterminalException):
gr.have_nonterm([TempClass, "asdf"])
if __name__ == '__main__':
main()
|
d57161b9449faa1218e4dab55fe4b2bd6f0c3436 | utils.py | utils.py | import json
import os
import time
import uuid
from google.appengine.api import urlfetch
from models import Profile
def getUserId(user, id_type="email"):
if id_type == "email":
return user.email()
if id_type == "oauth":
"""A workaround implementation for getting userid."""
auth = os.getenv('HTTP_AUTHORIZATION')
bearer, token = auth.split()
token_type = 'id_token'
if 'OAUTH_USER_ID' in os.environ:
token_type = 'access_token'
url = ('https://www.googleapis.com/oauth2/v1/tokeninfo?%s=%s'
% (token_type, token))
user = {}
wait = 1
for i in range(3):
resp = urlfetch.fetch(url)
if resp.status_code == 200:
user = json.loads(resp.content)
break
elif resp.status_code == 400 and 'invalid_token' in resp.content:
url = ('https://www.googleapis.com/oauth2/v1/tokeninfo?%s=%s'
% ('access_token', token))
else:
time.sleep(wait)
wait = wait + i
return user.get('user_id', '')
if id_type == "custom":
# implement your own user_id creation and getting algorythm
# this is just a sample that queries datastore for an existing profile
# and generates an id if profile does not exist for an email
profile = Conference.query(Conference.mainEmail == user.email())
if profile:
return profile.id()
else:
return str(uuid.uuid1().get_hex())
| import json
import os
import time
from google.appengine.api import urlfetch
def getUserId(user, id_type="email"):
if id_type == "email":
return user.email()
if id_type == "oauth":
"""A workaround implementation for getting userid."""
auth = os.getenv('HTTP_AUTHORIZATION')
bearer, token = auth.split()
token_type = 'id_token'
if 'OAUTH_USER_ID' in os.environ:
token_type = 'access_token'
url = ('https://www.googleapis.com/oauth2/v1/tokeninfo?%s=%s'
% (token_type, token))
user = {}
wait = 1
for i in range(3):
resp = urlfetch.fetch(url)
if resp.status_code == 200:
user = json.loads(resp.content)
break
elif resp.status_code == 400 and 'invalid_token' in resp.content:
url = ('https://www.googleapis.com/oauth2/v1/tokeninfo?%s=%s'
% ('access_token', token))
else:
time.sleep(wait)
wait = wait + i
return user.get('user_id', '')
| Remove unused code and get rid of flake8 errors | Remove unused code and get rid of flake8 errors
| Python | apache-2.0 | swesterveld/udacity-nd004-p4-conference-organization-app,swesterveld/udacity-nd004-p4-conference-organization-app,swesterveld/udacity-nd004-p4-conference-organization-app | import json
import os
import time
import uuid
from google.appengine.api import urlfetch
from models import Profile
def getUserId(user, id_type="email"):
if id_type == "email":
return user.email()
if id_type == "oauth":
"""A workaround implementation for getting userid."""
auth = os.getenv('HTTP_AUTHORIZATION')
bearer, token = auth.split()
token_type = 'id_token'
if 'OAUTH_USER_ID' in os.environ:
token_type = 'access_token'
url = ('https://www.googleapis.com/oauth2/v1/tokeninfo?%s=%s'
% (token_type, token))
user = {}
wait = 1
for i in range(3):
resp = urlfetch.fetch(url)
if resp.status_code == 200:
user = json.loads(resp.content)
break
elif resp.status_code == 400 and 'invalid_token' in resp.content:
url = ('https://www.googleapis.com/oauth2/v1/tokeninfo?%s=%s'
% ('access_token', token))
else:
time.sleep(wait)
wait = wait + i
return user.get('user_id', '')
if id_type == "custom":
# implement your own user_id creation and getting algorythm
# this is just a sample that queries datastore for an existing profile
# and generates an id if profile does not exist for an email
profile = Conference.query(Conference.mainEmail == user.email())
if profile:
return profile.id()
else:
return str(uuid.uuid1().get_hex())
Remove unused code and get rid of flake8 errors | import json
import os
import time
from google.appengine.api import urlfetch
def getUserId(user, id_type="email"):
if id_type == "email":
return user.email()
if id_type == "oauth":
"""A workaround implementation for getting userid."""
auth = os.getenv('HTTP_AUTHORIZATION')
bearer, token = auth.split()
token_type = 'id_token'
if 'OAUTH_USER_ID' in os.environ:
token_type = 'access_token'
url = ('https://www.googleapis.com/oauth2/v1/tokeninfo?%s=%s'
% (token_type, token))
user = {}
wait = 1
for i in range(3):
resp = urlfetch.fetch(url)
if resp.status_code == 200:
user = json.loads(resp.content)
break
elif resp.status_code == 400 and 'invalid_token' in resp.content:
url = ('https://www.googleapis.com/oauth2/v1/tokeninfo?%s=%s'
% ('access_token', token))
else:
time.sleep(wait)
wait = wait + i
return user.get('user_id', '')
| <commit_before>import json
import os
import time
import uuid
from google.appengine.api import urlfetch
from models import Profile
def getUserId(user, id_type="email"):
if id_type == "email":
return user.email()
if id_type == "oauth":
"""A workaround implementation for getting userid."""
auth = os.getenv('HTTP_AUTHORIZATION')
bearer, token = auth.split()
token_type = 'id_token'
if 'OAUTH_USER_ID' in os.environ:
token_type = 'access_token'
url = ('https://www.googleapis.com/oauth2/v1/tokeninfo?%s=%s'
% (token_type, token))
user = {}
wait = 1
for i in range(3):
resp = urlfetch.fetch(url)
if resp.status_code == 200:
user = json.loads(resp.content)
break
elif resp.status_code == 400 and 'invalid_token' in resp.content:
url = ('https://www.googleapis.com/oauth2/v1/tokeninfo?%s=%s'
% ('access_token', token))
else:
time.sleep(wait)
wait = wait + i
return user.get('user_id', '')
if id_type == "custom":
# implement your own user_id creation and getting algorythm
# this is just a sample that queries datastore for an existing profile
# and generates an id if profile does not exist for an email
profile = Conference.query(Conference.mainEmail == user.email())
if profile:
return profile.id()
else:
return str(uuid.uuid1().get_hex())
<commit_msg>Remove unused code and get rid of flake8 errors<commit_after> | import json
import os
import time
from google.appengine.api import urlfetch
def getUserId(user, id_type="email"):
if id_type == "email":
return user.email()
if id_type == "oauth":
"""A workaround implementation for getting userid."""
auth = os.getenv('HTTP_AUTHORIZATION')
bearer, token = auth.split()
token_type = 'id_token'
if 'OAUTH_USER_ID' in os.environ:
token_type = 'access_token'
url = ('https://www.googleapis.com/oauth2/v1/tokeninfo?%s=%s'
% (token_type, token))
user = {}
wait = 1
for i in range(3):
resp = urlfetch.fetch(url)
if resp.status_code == 200:
user = json.loads(resp.content)
break
elif resp.status_code == 400 and 'invalid_token' in resp.content:
url = ('https://www.googleapis.com/oauth2/v1/tokeninfo?%s=%s'
% ('access_token', token))
else:
time.sleep(wait)
wait = wait + i
return user.get('user_id', '')
| import json
import os
import time
import uuid
from google.appengine.api import urlfetch
from models import Profile
def getUserId(user, id_type="email"):
if id_type == "email":
return user.email()
if id_type == "oauth":
"""A workaround implementation for getting userid."""
auth = os.getenv('HTTP_AUTHORIZATION')
bearer, token = auth.split()
token_type = 'id_token'
if 'OAUTH_USER_ID' in os.environ:
token_type = 'access_token'
url = ('https://www.googleapis.com/oauth2/v1/tokeninfo?%s=%s'
% (token_type, token))
user = {}
wait = 1
for i in range(3):
resp = urlfetch.fetch(url)
if resp.status_code == 200:
user = json.loads(resp.content)
break
elif resp.status_code == 400 and 'invalid_token' in resp.content:
url = ('https://www.googleapis.com/oauth2/v1/tokeninfo?%s=%s'
% ('access_token', token))
else:
time.sleep(wait)
wait = wait + i
return user.get('user_id', '')
if id_type == "custom":
# implement your own user_id creation and getting algorythm
# this is just a sample that queries datastore for an existing profile
# and generates an id if profile does not exist for an email
profile = Conference.query(Conference.mainEmail == user.email())
if profile:
return profile.id()
else:
return str(uuid.uuid1().get_hex())
Remove unused code and get rid of flake8 errorsimport json
import os
import time
from google.appengine.api import urlfetch
def getUserId(user, id_type="email"):
if id_type == "email":
return user.email()
if id_type == "oauth":
"""A workaround implementation for getting userid."""
auth = os.getenv('HTTP_AUTHORIZATION')
bearer, token = auth.split()
token_type = 'id_token'
if 'OAUTH_USER_ID' in os.environ:
token_type = 'access_token'
url = ('https://www.googleapis.com/oauth2/v1/tokeninfo?%s=%s'
% (token_type, token))
user = {}
wait = 1
for i in range(3):
resp = urlfetch.fetch(url)
if resp.status_code == 200:
user = json.loads(resp.content)
break
elif resp.status_code == 400 and 'invalid_token' in resp.content:
url = ('https://www.googleapis.com/oauth2/v1/tokeninfo?%s=%s'
% ('access_token', token))
else:
time.sleep(wait)
wait = wait + i
return user.get('user_id', '')
| <commit_before>import json
import os
import time
import uuid
from google.appengine.api import urlfetch
from models import Profile
def getUserId(user, id_type="email"):
if id_type == "email":
return user.email()
if id_type == "oauth":
"""A workaround implementation for getting userid."""
auth = os.getenv('HTTP_AUTHORIZATION')
bearer, token = auth.split()
token_type = 'id_token'
if 'OAUTH_USER_ID' in os.environ:
token_type = 'access_token'
url = ('https://www.googleapis.com/oauth2/v1/tokeninfo?%s=%s'
% (token_type, token))
user = {}
wait = 1
for i in range(3):
resp = urlfetch.fetch(url)
if resp.status_code == 200:
user = json.loads(resp.content)
break
elif resp.status_code == 400 and 'invalid_token' in resp.content:
url = ('https://www.googleapis.com/oauth2/v1/tokeninfo?%s=%s'
% ('access_token', token))
else:
time.sleep(wait)
wait = wait + i
return user.get('user_id', '')
if id_type == "custom":
# implement your own user_id creation and getting algorythm
# this is just a sample that queries datastore for an existing profile
# and generates an id if profile does not exist for an email
profile = Conference.query(Conference.mainEmail == user.email())
if profile:
return profile.id()
else:
return str(uuid.uuid1().get_hex())
<commit_msg>Remove unused code and get rid of flake8 errors<commit_after>import json
import os
import time
from google.appengine.api import urlfetch
def getUserId(user, id_type="email"):
if id_type == "email":
return user.email()
if id_type == "oauth":
"""A workaround implementation for getting userid."""
auth = os.getenv('HTTP_AUTHORIZATION')
bearer, token = auth.split()
token_type = 'id_token'
if 'OAUTH_USER_ID' in os.environ:
token_type = 'access_token'
url = ('https://www.googleapis.com/oauth2/v1/tokeninfo?%s=%s'
% (token_type, token))
user = {}
wait = 1
for i in range(3):
resp = urlfetch.fetch(url)
if resp.status_code == 200:
user = json.loads(resp.content)
break
elif resp.status_code == 400 and 'invalid_token' in resp.content:
url = ('https://www.googleapis.com/oauth2/v1/tokeninfo?%s=%s'
% ('access_token', token))
else:
time.sleep(wait)
wait = wait + i
return user.get('user_id', '')
|
2a7ed7c2d6f37c3b6965ad92b21cecc0a4abd91a | upload_datasets_to_galaxy.py | upload_datasets_to_galaxy.py | #!/usr/bin/python3
import argparse
# from bioblend.galaxy import GalaxyInstance
import configparser
def upload_datasets_to_galaxy():
# Arguments initialization
parser = argparse.ArgumentParser(description="Script to upload a folder into"
"Galaxy Data Libraries")
parser.add_argument('--folder', help='Folder to add in Data Libraries of Galaxy')
args = parser.parse_args()
# Fetch arguments
folder_path = args.folder
# Launch config
config = configparser.ConfigParser()
config.read('config.ini')
galaxy_config = config['Galaxy']
# gi = GalaxyInstance(url=galaxy_config['url'], key=galaxy_config['api-key'])
# print(gi.histories.get_histories())
if __name__ == "__main__":
upload_datasets_to_galaxy() | #!/usr/bin/python3
import argparse
from bioblend.galaxy import GalaxyInstance
import configparser
import os
def upload_datasets_to_galaxy():
# Arguments initialization
parser = argparse.ArgumentParser(description="Script to upload a folder into"
"Galaxy Data Libraries")
parser.add_argument('--folder', help='Folder to add in Data Libraries of Galaxy')
args = parser.parse_args()
# Fetch arguments
folder_path = args.folder
# Launch config
config = configparser.ConfigParser()
config.read('config.ini')
galaxy_config = config['Galaxy']
gi = GalaxyInstance(url='http://127.0.0.1:8080', key='5e8cc5748922c598c1aa6ec9e605780f')
name_folder_test = '160802_D00281L_0127_C9NPBANXX'
path_folder_test = './test-data/staging/' + name_folder_test
path_to_fastq_folder_test = os.path.join(path_folder_test, 'fastq')
# TODO: Make a loop which execute the following, for each directory found
libs_folder = gi.libraries.get_libraries(name=name_folder_test)
# TODO: Check the library does already exist
# Create the library with the name equal to the folder name
# and description 'Library' + folder_name
dict_library_test = gi.libraries.create_library(name_folder_test,
description=' '.join(['Library', name_folder_test]),
synopsis=None)
# Upload the data in the library just created
list_of_files = '\n'.join(os.listdir(path_to_fastq_folder_test))
unknow_return = gi.libraries.upload_from_galaxy_filesystem(
library_id=dict_library_test.get('id'),
filesystem_paths=list_of_files,
file_type='auto',
link_data_only='link_to_files',
)
print(unknow_return)
# TODO: Check if no new files, else upload them
# print("Already there! Skipping {0}".format(name_folder_test))
#print(gi.histories.get_histories())
if __name__ == "__main__":
upload_datasets_to_galaxy() | Add first verion to upload via BioBlend | Add first verion to upload via BioBlend
| Python | mit | pajanne/galaxy-kickstart,pajanne/galaxy-kickstart | #!/usr/bin/python3
import argparse
# from bioblend.galaxy import GalaxyInstance
import configparser
def upload_datasets_to_galaxy():
# Arguments initialization
parser = argparse.ArgumentParser(description="Script to upload a folder into"
"Galaxy Data Libraries")
parser.add_argument('--folder', help='Folder to add in Data Libraries of Galaxy')
args = parser.parse_args()
# Fetch arguments
folder_path = args.folder
# Launch config
config = configparser.ConfigParser()
config.read('config.ini')
galaxy_config = config['Galaxy']
# gi = GalaxyInstance(url=galaxy_config['url'], key=galaxy_config['api-key'])
# print(gi.histories.get_histories())
if __name__ == "__main__":
upload_datasets_to_galaxy()Add first verion to upload via BioBlend | #!/usr/bin/python3
import argparse
from bioblend.galaxy import GalaxyInstance
import configparser
import os
def upload_datasets_to_galaxy():
# Arguments initialization
parser = argparse.ArgumentParser(description="Script to upload a folder into"
"Galaxy Data Libraries")
parser.add_argument('--folder', help='Folder to add in Data Libraries of Galaxy')
args = parser.parse_args()
# Fetch arguments
folder_path = args.folder
# Launch config
config = configparser.ConfigParser()
config.read('config.ini')
galaxy_config = config['Galaxy']
gi = GalaxyInstance(url='http://127.0.0.1:8080', key='5e8cc5748922c598c1aa6ec9e605780f')
name_folder_test = '160802_D00281L_0127_C9NPBANXX'
path_folder_test = './test-data/staging/' + name_folder_test
path_to_fastq_folder_test = os.path.join(path_folder_test, 'fastq')
# TODO: Make a loop which execute the following, for each directory found
libs_folder = gi.libraries.get_libraries(name=name_folder_test)
# TODO: Check the library does already exist
# Create the library with the name equal to the folder name
# and description 'Library' + folder_name
dict_library_test = gi.libraries.create_library(name_folder_test,
description=' '.join(['Library', name_folder_test]),
synopsis=None)
# Upload the data in the library just created
list_of_files = '\n'.join(os.listdir(path_to_fastq_folder_test))
unknow_return = gi.libraries.upload_from_galaxy_filesystem(
library_id=dict_library_test.get('id'),
filesystem_paths=list_of_files,
file_type='auto',
link_data_only='link_to_files',
)
print(unknow_return)
# TODO: Check if no new files, else upload them
# print("Already there! Skipping {0}".format(name_folder_test))
#print(gi.histories.get_histories())
if __name__ == "__main__":
upload_datasets_to_galaxy() | <commit_before>#!/usr/bin/python3
import argparse
# from bioblend.galaxy import GalaxyInstance
import configparser
def upload_datasets_to_galaxy():
# Arguments initialization
parser = argparse.ArgumentParser(description="Script to upload a folder into"
"Galaxy Data Libraries")
parser.add_argument('--folder', help='Folder to add in Data Libraries of Galaxy')
args = parser.parse_args()
# Fetch arguments
folder_path = args.folder
# Launch config
config = configparser.ConfigParser()
config.read('config.ini')
galaxy_config = config['Galaxy']
# gi = GalaxyInstance(url=galaxy_config['url'], key=galaxy_config['api-key'])
# print(gi.histories.get_histories())
if __name__ == "__main__":
upload_datasets_to_galaxy()<commit_msg>Add first verion to upload via BioBlend<commit_after> | #!/usr/bin/python3
import argparse
from bioblend.galaxy import GalaxyInstance
import configparser
import os
def upload_datasets_to_galaxy():
# Arguments initialization
parser = argparse.ArgumentParser(description="Script to upload a folder into"
"Galaxy Data Libraries")
parser.add_argument('--folder', help='Folder to add in Data Libraries of Galaxy')
args = parser.parse_args()
# Fetch arguments
folder_path = args.folder
# Launch config
config = configparser.ConfigParser()
config.read('config.ini')
galaxy_config = config['Galaxy']
gi = GalaxyInstance(url='http://127.0.0.1:8080', key='5e8cc5748922c598c1aa6ec9e605780f')
name_folder_test = '160802_D00281L_0127_C9NPBANXX'
path_folder_test = './test-data/staging/' + name_folder_test
path_to_fastq_folder_test = os.path.join(path_folder_test, 'fastq')
# TODO: Make a loop which execute the following, for each directory found
libs_folder = gi.libraries.get_libraries(name=name_folder_test)
# TODO: Check the library does already exist
# Create the library with the name equal to the folder name
# and description 'Library' + folder_name
dict_library_test = gi.libraries.create_library(name_folder_test,
description=' '.join(['Library', name_folder_test]),
synopsis=None)
# Upload the data in the library just created
list_of_files = '\n'.join(os.listdir(path_to_fastq_folder_test))
unknow_return = gi.libraries.upload_from_galaxy_filesystem(
library_id=dict_library_test.get('id'),
filesystem_paths=list_of_files,
file_type='auto',
link_data_only='link_to_files',
)
print(unknow_return)
# TODO: Check if no new files, else upload them
# print("Already there! Skipping {0}".format(name_folder_test))
#print(gi.histories.get_histories())
if __name__ == "__main__":
upload_datasets_to_galaxy() | #!/usr/bin/python3
import argparse
# from bioblend.galaxy import GalaxyInstance
import configparser
def upload_datasets_to_galaxy():
# Arguments initialization
parser = argparse.ArgumentParser(description="Script to upload a folder into"
"Galaxy Data Libraries")
parser.add_argument('--folder', help='Folder to add in Data Libraries of Galaxy')
args = parser.parse_args()
# Fetch arguments
folder_path = args.folder
# Launch config
config = configparser.ConfigParser()
config.read('config.ini')
galaxy_config = config['Galaxy']
# gi = GalaxyInstance(url=galaxy_config['url'], key=galaxy_config['api-key'])
# print(gi.histories.get_histories())
if __name__ == "__main__":
upload_datasets_to_galaxy()Add first verion to upload via BioBlend#!/usr/bin/python3
import argparse
from bioblend.galaxy import GalaxyInstance
import configparser
import os
def upload_datasets_to_galaxy():
# Arguments initialization
parser = argparse.ArgumentParser(description="Script to upload a folder into"
"Galaxy Data Libraries")
parser.add_argument('--folder', help='Folder to add in Data Libraries of Galaxy')
args = parser.parse_args()
# Fetch arguments
folder_path = args.folder
# Launch config
config = configparser.ConfigParser()
config.read('config.ini')
galaxy_config = config['Galaxy']
gi = GalaxyInstance(url='http://127.0.0.1:8080', key='5e8cc5748922c598c1aa6ec9e605780f')
name_folder_test = '160802_D00281L_0127_C9NPBANXX'
path_folder_test = './test-data/staging/' + name_folder_test
path_to_fastq_folder_test = os.path.join(path_folder_test, 'fastq')
# TODO: Make a loop which execute the following, for each directory found
libs_folder = gi.libraries.get_libraries(name=name_folder_test)
# TODO: Check the library does already exist
# Create the library with the name equal to the folder name
# and description 'Library' + folder_name
dict_library_test = gi.libraries.create_library(name_folder_test,
description=' '.join(['Library', name_folder_test]),
synopsis=None)
# Upload the data in the library just created
list_of_files = '\n'.join(os.listdir(path_to_fastq_folder_test))
unknow_return = gi.libraries.upload_from_galaxy_filesystem(
library_id=dict_library_test.get('id'),
filesystem_paths=list_of_files,
file_type='auto',
link_data_only='link_to_files',
)
print(unknow_return)
# TODO: Check if no new files, else upload them
# print("Already there! Skipping {0}".format(name_folder_test))
#print(gi.histories.get_histories())
if __name__ == "__main__":
upload_datasets_to_galaxy() | <commit_before>#!/usr/bin/python3
import argparse
# from bioblend.galaxy import GalaxyInstance
import configparser
def upload_datasets_to_galaxy():
# Arguments initialization
parser = argparse.ArgumentParser(description="Script to upload a folder into"
"Galaxy Data Libraries")
parser.add_argument('--folder', help='Folder to add in Data Libraries of Galaxy')
args = parser.parse_args()
# Fetch arguments
folder_path = args.folder
# Launch config
config = configparser.ConfigParser()
config.read('config.ini')
galaxy_config = config['Galaxy']
# gi = GalaxyInstance(url=galaxy_config['url'], key=galaxy_config['api-key'])
# print(gi.histories.get_histories())
if __name__ == "__main__":
upload_datasets_to_galaxy()<commit_msg>Add first verion to upload via BioBlend<commit_after>#!/usr/bin/python3
import argparse
from bioblend.galaxy import GalaxyInstance
import configparser
import os
def upload_datasets_to_galaxy():
# Arguments initialization
parser = argparse.ArgumentParser(description="Script to upload a folder into"
"Galaxy Data Libraries")
parser.add_argument('--folder', help='Folder to add in Data Libraries of Galaxy')
args = parser.parse_args()
# Fetch arguments
folder_path = args.folder
# Launch config
config = configparser.ConfigParser()
config.read('config.ini')
galaxy_config = config['Galaxy']
gi = GalaxyInstance(url='http://127.0.0.1:8080', key='5e8cc5748922c598c1aa6ec9e605780f')
name_folder_test = '160802_D00281L_0127_C9NPBANXX'
path_folder_test = './test-data/staging/' + name_folder_test
path_to_fastq_folder_test = os.path.join(path_folder_test, 'fastq')
# TODO: Make a loop which execute the following, for each directory found
libs_folder = gi.libraries.get_libraries(name=name_folder_test)
# TODO: Check the library does already exist
# Create the library with the name equal to the folder name
# and description 'Library' + folder_name
dict_library_test = gi.libraries.create_library(name_folder_test,
description=' '.join(['Library', name_folder_test]),
synopsis=None)
# Upload the data in the library just created
list_of_files = '\n'.join(os.listdir(path_to_fastq_folder_test))
unknow_return = gi.libraries.upload_from_galaxy_filesystem(
library_id=dict_library_test.get('id'),
filesystem_paths=list_of_files,
file_type='auto',
link_data_only='link_to_files',
)
print(unknow_return)
# TODO: Check if no new files, else upload them
# print("Already there! Skipping {0}".format(name_folder_test))
#print(gi.histories.get_histories())
if __name__ == "__main__":
upload_datasets_to_galaxy() |
e890ac9ef00193beac77b757c62911553cebf656 | test.py | test.py | import urllib
urllib.urlretrieve('http://192.168.0.13:8080/photoaf.jpg', '/home/pi/img/img.jpg') | import urllib
urllib.urlretrieve('http://192.168.0.13:8080/photoaf.jpg', 'img.jpg') | Change save path to local path | Change save path to local path
| Python | mit | adampiskorski/lpr_poc | import urllib
urllib.urlretrieve('http://192.168.0.13:8080/photoaf.jpg', '/home/pi/img/img.jpg')Change save path to local path | import urllib
urllib.urlretrieve('http://192.168.0.13:8080/photoaf.jpg', 'img.jpg') | <commit_before>import urllib
urllib.urlretrieve('http://192.168.0.13:8080/photoaf.jpg', '/home/pi/img/img.jpg')<commit_msg>Change save path to local path<commit_after> | import urllib
urllib.urlretrieve('http://192.168.0.13:8080/photoaf.jpg', 'img.jpg') | import urllib
urllib.urlretrieve('http://192.168.0.13:8080/photoaf.jpg', '/home/pi/img/img.jpg')Change save path to local pathimport urllib
urllib.urlretrieve('http://192.168.0.13:8080/photoaf.jpg', 'img.jpg') | <commit_before>import urllib
urllib.urlretrieve('http://192.168.0.13:8080/photoaf.jpg', '/home/pi/img/img.jpg')<commit_msg>Change save path to local path<commit_after>import urllib
urllib.urlretrieve('http://192.168.0.13:8080/photoaf.jpg', 'img.jpg') |
ac8d6210b1e48e7ce1131412b45d23846b7c73d2 | test.py | test.py | import time
import panoply
KEY = "panoply/2g866xw4oaqt1emi"
SECRET = "MmM0NWNvc2wwYmJ4ZDJ0OS84MmY3MzQ4NC02MDIzLTQyN2QtODdkMS0yY2I0NTAzNDk0NDQvMDM3MzM1OTk5NTYyL3VzLWVhc3QtMQ==" # noqa
sdk = panoply.SDK(KEY, SECRET)
sdk.write('roi-test', {'hello': 1})
print sdk.qurl
time.sleep(5)
| import time
import panoply
KEY = "panoply/2g866xw4oaqt1emi"
SECRET = "MmM0NWNvc2wwYmJ4ZDJ0OS84MmY3MzQ4NC02MDIzLTQyN2QtODdkMS0yY2I0NTAzNDk0NDQvMDM3MzM1OTk5NTYyL3VzLWVhc3QtMQ==" # noqa
sdk = panoply.SDK(KEY, SECRET)
sdk.write('roi-test', {'hello': 1})
print sdk.qurl
time.sleep(5)
| Fix to minor style issue | Fix to minor style issue
| Python | mit | panoplyio/panoply-python-sdk | import time
import panoply
KEY = "panoply/2g866xw4oaqt1emi"
SECRET = "MmM0NWNvc2wwYmJ4ZDJ0OS84MmY3MzQ4NC02MDIzLTQyN2QtODdkMS0yY2I0NTAzNDk0NDQvMDM3MzM1OTk5NTYyL3VzLWVhc3QtMQ==" # noqa
sdk = panoply.SDK(KEY, SECRET)
sdk.write('roi-test', {'hello': 1})
print sdk.qurl
time.sleep(5)
Fix to minor style issue | import time
import panoply
KEY = "panoply/2g866xw4oaqt1emi"
SECRET = "MmM0NWNvc2wwYmJ4ZDJ0OS84MmY3MzQ4NC02MDIzLTQyN2QtODdkMS0yY2I0NTAzNDk0NDQvMDM3MzM1OTk5NTYyL3VzLWVhc3QtMQ==" # noqa
sdk = panoply.SDK(KEY, SECRET)
sdk.write('roi-test', {'hello': 1})
print sdk.qurl
time.sleep(5)
| <commit_before>import time
import panoply
KEY = "panoply/2g866xw4oaqt1emi"
SECRET = "MmM0NWNvc2wwYmJ4ZDJ0OS84MmY3MzQ4NC02MDIzLTQyN2QtODdkMS0yY2I0NTAzNDk0NDQvMDM3MzM1OTk5NTYyL3VzLWVhc3QtMQ==" # noqa
sdk = panoply.SDK(KEY, SECRET)
sdk.write('roi-test', {'hello': 1})
print sdk.qurl
time.sleep(5)
<commit_msg>Fix to minor style issue<commit_after> | import time
import panoply
KEY = "panoply/2g866xw4oaqt1emi"
SECRET = "MmM0NWNvc2wwYmJ4ZDJ0OS84MmY3MzQ4NC02MDIzLTQyN2QtODdkMS0yY2I0NTAzNDk0NDQvMDM3MzM1OTk5NTYyL3VzLWVhc3QtMQ==" # noqa
sdk = panoply.SDK(KEY, SECRET)
sdk.write('roi-test', {'hello': 1})
print sdk.qurl
time.sleep(5)
| import time
import panoply
KEY = "panoply/2g866xw4oaqt1emi"
SECRET = "MmM0NWNvc2wwYmJ4ZDJ0OS84MmY3MzQ4NC02MDIzLTQyN2QtODdkMS0yY2I0NTAzNDk0NDQvMDM3MzM1OTk5NTYyL3VzLWVhc3QtMQ==" # noqa
sdk = panoply.SDK(KEY, SECRET)
sdk.write('roi-test', {'hello': 1})
print sdk.qurl
time.sleep(5)
Fix to minor style issueimport time
import panoply
KEY = "panoply/2g866xw4oaqt1emi"
SECRET = "MmM0NWNvc2wwYmJ4ZDJ0OS84MmY3MzQ4NC02MDIzLTQyN2QtODdkMS0yY2I0NTAzNDk0NDQvMDM3MzM1OTk5NTYyL3VzLWVhc3QtMQ==" # noqa
sdk = panoply.SDK(KEY, SECRET)
sdk.write('roi-test', {'hello': 1})
print sdk.qurl
time.sleep(5)
| <commit_before>import time
import panoply
KEY = "panoply/2g866xw4oaqt1emi"
SECRET = "MmM0NWNvc2wwYmJ4ZDJ0OS84MmY3MzQ4NC02MDIzLTQyN2QtODdkMS0yY2I0NTAzNDk0NDQvMDM3MzM1OTk5NTYyL3VzLWVhc3QtMQ==" # noqa
sdk = panoply.SDK(KEY, SECRET)
sdk.write('roi-test', {'hello': 1})
print sdk.qurl
time.sleep(5)
<commit_msg>Fix to minor style issue<commit_after>import time
import panoply
KEY = "panoply/2g866xw4oaqt1emi"
SECRET = "MmM0NWNvc2wwYmJ4ZDJ0OS84MmY3MzQ4NC02MDIzLTQyN2QtODdkMS0yY2I0NTAzNDk0NDQvMDM3MzM1OTk5NTYyL3VzLWVhc3QtMQ==" # noqa
sdk = panoply.SDK(KEY, SECRET)
sdk.write('roi-test', {'hello': 1})
print sdk.qurl
time.sleep(5)
|
0c1b0a7787bd6824815ae208edab8f208b53af09 | api/base/exceptions.py | api/base/exceptions.py |
def jsonapi_exception_handler(exc, context):
"""
Custom exception handler that returns errors object as an array with a 'detail' member
"""
from rest_framework.views import exception_handler
response = exception_handler(exc, context)
if response is not None:
if 'detail' in response.data:
response.data = {'errors': [response.data]}
else:
response.data = {'errors': [{'detail': response.data}]}
if response is not None and response.data['errors'][0]['detail'] == "Authentication credentials were not provided.":
response.status_code = 401
return response
|
def jsonapi_exception_handler(exc, context):
"""
Custom exception handler that returns errors object as an array with a 'detail' member
"""
from rest_framework.views import exception_handler
response = exception_handler(exc, context)
if response is not None:
if 'detail' in response.data:
response.data = {'errors': [response.data]}
else:
response.data = {'errors': [{'detail': response.data}]}
# Returns 401 instead of 403 during unauthorized requests without having user to log in with Basic Auth
if response is not None and response.data['errors'][0]['detail'] == "Authentication credentials were not provided.":
response.status_code = 401
return response
| Add comment to override of status code | Add comment to override of status code
| Python | apache-2.0 | Ghalko/osf.io,billyhunt/osf.io,wearpants/osf.io,asanfilippo7/osf.io,ticklemepierce/osf.io,kch8qx/osf.io,GageGaskins/osf.io,njantrania/osf.io,mluke93/osf.io,baylee-d/osf.io,alexschiller/osf.io,asanfilippo7/osf.io,wearpants/osf.io,kwierman/osf.io,leb2dg/osf.io,leb2dg/osf.io,chennan47/osf.io,arpitar/osf.io,leb2dg/osf.io,erinspace/osf.io,Johnetordoff/osf.io,Ghalko/osf.io,petermalcolm/osf.io,adlius/osf.io,abought/osf.io,icereval/osf.io,cwisecarver/osf.io,samchrisinger/osf.io,saradbowman/osf.io,DanielSBrown/osf.io,sbt9uc/osf.io,HalcyonChimera/osf.io,kwierman/osf.io,GageGaskins/osf.io,brianjgeiger/osf.io,felliott/osf.io,Nesiehr/osf.io,felliott/osf.io,SSJohns/osf.io,baylee-d/osf.io,KAsante95/osf.io,billyhunt/osf.io,sbt9uc/osf.io,mluke93/osf.io,mluo613/osf.io,RomanZWang/osf.io,Johnetordoff/osf.io,samanehsan/osf.io,mluke93/osf.io,crcresearch/osf.io,ticklemepierce/osf.io,petermalcolm/osf.io,caseyrollins/osf.io,RomanZWang/osf.io,Nesiehr/osf.io,amyshi188/osf.io,laurenrevere/osf.io,cwisecarver/osf.io,billyhunt/osf.io,arpitar/osf.io,brandonPurvis/osf.io,rdhyee/osf.io,samchrisinger/osf.io,emetsger/osf.io,Ghalko/osf.io,haoyuchen1992/osf.io,alexschiller/osf.io,doublebits/osf.io,abought/osf.io,Johnetordoff/osf.io,CenterForOpenScience/osf.io,samanehsan/osf.io,monikagrabowska/osf.io,rdhyee/osf.io,ZobairAlijan/osf.io,laurenrevere/osf.io,SSJohns/osf.io,aaxelb/osf.io,ZobairAlijan/osf.io,kwierman/osf.io,Johnetordoff/osf.io,TomBaxter/osf.io,HalcyonChimera/osf.io,alexschiller/osf.io,sbt9uc/osf.io,TomHeatwole/osf.io,pattisdr/osf.io,Nesiehr/osf.io,binoculars/osf.io,kwierman/osf.io,emetsger/osf.io,petermalcolm/osf.io,zachjanicki/osf.io,zamattiac/osf.io,crcresearch/osf.io,felliott/osf.io,doublebits/osf.io,rdhyee/osf.io,leb2dg/osf.io,alexschiller/osf.io,chrisseto/osf.io,HalcyonChimera/osf.io,acshi/osf.io,njantrania/osf.io,billyhunt/osf.io,SSJohns/osf.io,CenterForOpenScience/osf.io,caneruguz/osf.io,cslzchen/osf.io,zamattiac/osf.io,emetsger/osf.io,abought/osf.io,mluke93/osf.io,RomanZWang/osf.io,danielneis/osf.io,acshi/osf.io,danielneis/osf.io,erinspace/osf.io,samchrisinger/osf.io,wearpants/osf.io,aaxelb/osf.io,rdhyee/osf.io,doublebits/osf.io,zamattiac/osf.io,brianjgeiger/osf.io,pattisdr/osf.io,KAsante95/osf.io,GageGaskins/osf.io,kch8qx/osf.io,DanielSBrown/osf.io,caneruguz/osf.io,hmoco/osf.io,icereval/osf.io,danielneis/osf.io,TomHeatwole/osf.io,njantrania/osf.io,haoyuchen1992/osf.io,caseyrygt/osf.io,SSJohns/osf.io,GageGaskins/osf.io,ZobairAlijan/osf.io,CenterForOpenScience/osf.io,asanfilippo7/osf.io,brandonPurvis/osf.io,zamattiac/osf.io,njantrania/osf.io,ticklemepierce/osf.io,RomanZWang/osf.io,zachjanicki/osf.io,jnayak1/osf.io,billyhunt/osf.io,caseyrollins/osf.io,caseyrollins/osf.io,mluo613/osf.io,chennan47/osf.io,binoculars/osf.io,hmoco/osf.io,monikagrabowska/osf.io,amyshi188/osf.io,samanehsan/osf.io,caneruguz/osf.io,kch8qx/osf.io,doublebits/osf.io,samanehsan/osf.io,acshi/osf.io,TomHeatwole/osf.io,aaxelb/osf.io,sloria/osf.io,KAsante95/osf.io,sbt9uc/osf.io,monikagrabowska/osf.io,caseyrygt/osf.io,caseyrygt/osf.io,mfraezz/osf.io,DanielSBrown/osf.io,laurenrevere/osf.io,petermalcolm/osf.io,wearpants/osf.io,emetsger/osf.io,mluo613/osf.io,caneruguz/osf.io,haoyuchen1992/osf.io,zachjanicki/osf.io,chrisseto/osf.io,chrisseto/osf.io,ticklemepierce/osf.io,brandonPurvis/osf.io,brandonPurvis/osf.io,adlius/osf.io,HalcyonChimera/osf.io,hmoco/osf.io,sloria/osf.io,monikagrabowska/osf.io,cosenal/osf.io,doublebits/osf.io,TomBaxter/osf.io,DanielSBrown/osf.io,KAsante95/osf.io,saradbowman/osf.io,haoyuchen1992/osf.io,mfraezz/osf.io,kch8qx/osf.io,crcresearch/osf.io,jnayak1/osf.io,abought/osf.io,cosenal/osf.io,cslzchen/osf.io,icereval/osf.io,monikagrabowska/osf.io,mluo613/osf.io,mfraezz/osf.io,danielneis/osf.io,sloria/osf.io,jnayak1/osf.io,acshi/osf.io,caseyrygt/osf.io,mluo613/osf.io,cwisecarver/osf.io,cosenal/osf.io,hmoco/osf.io,amyshi188/osf.io,acshi/osf.io,TomHeatwole/osf.io,asanfilippo7/osf.io,RomanZWang/osf.io,aaxelb/osf.io,adlius/osf.io,KAsante95/osf.io,TomBaxter/osf.io,mattclark/osf.io,pattisdr/osf.io,brandonPurvis/osf.io,jnayak1/osf.io,arpitar/osf.io,binoculars/osf.io,arpitar/osf.io,brianjgeiger/osf.io,cosenal/osf.io,mfraezz/osf.io,alexschiller/osf.io,baylee-d/osf.io,chrisseto/osf.io,GageGaskins/osf.io,mattclark/osf.io,zachjanicki/osf.io,chennan47/osf.io,CenterForOpenScience/osf.io,kch8qx/osf.io,samchrisinger/osf.io,brianjgeiger/osf.io,adlius/osf.io,cslzchen/osf.io,Nesiehr/osf.io,ZobairAlijan/osf.io,Ghalko/osf.io,erinspace/osf.io,amyshi188/osf.io,cwisecarver/osf.io,felliott/osf.io,mattclark/osf.io,cslzchen/osf.io |
def jsonapi_exception_handler(exc, context):
"""
Custom exception handler that returns errors object as an array with a 'detail' member
"""
from rest_framework.views import exception_handler
response = exception_handler(exc, context)
if response is not None:
if 'detail' in response.data:
response.data = {'errors': [response.data]}
else:
response.data = {'errors': [{'detail': response.data}]}
if response is not None and response.data['errors'][0]['detail'] == "Authentication credentials were not provided.":
response.status_code = 401
return response
Add comment to override of status code |
def jsonapi_exception_handler(exc, context):
"""
Custom exception handler that returns errors object as an array with a 'detail' member
"""
from rest_framework.views import exception_handler
response = exception_handler(exc, context)
if response is not None:
if 'detail' in response.data:
response.data = {'errors': [response.data]}
else:
response.data = {'errors': [{'detail': response.data}]}
# Returns 401 instead of 403 during unauthorized requests without having user to log in with Basic Auth
if response is not None and response.data['errors'][0]['detail'] == "Authentication credentials were not provided.":
response.status_code = 401
return response
| <commit_before>
def jsonapi_exception_handler(exc, context):
"""
Custom exception handler that returns errors object as an array with a 'detail' member
"""
from rest_framework.views import exception_handler
response = exception_handler(exc, context)
if response is not None:
if 'detail' in response.data:
response.data = {'errors': [response.data]}
else:
response.data = {'errors': [{'detail': response.data}]}
if response is not None and response.data['errors'][0]['detail'] == "Authentication credentials were not provided.":
response.status_code = 401
return response
<commit_msg>Add comment to override of status code<commit_after> |
def jsonapi_exception_handler(exc, context):
"""
Custom exception handler that returns errors object as an array with a 'detail' member
"""
from rest_framework.views import exception_handler
response = exception_handler(exc, context)
if response is not None:
if 'detail' in response.data:
response.data = {'errors': [response.data]}
else:
response.data = {'errors': [{'detail': response.data}]}
# Returns 401 instead of 403 during unauthorized requests without having user to log in with Basic Auth
if response is not None and response.data['errors'][0]['detail'] == "Authentication credentials were not provided.":
response.status_code = 401
return response
|
def jsonapi_exception_handler(exc, context):
"""
Custom exception handler that returns errors object as an array with a 'detail' member
"""
from rest_framework.views import exception_handler
response = exception_handler(exc, context)
if response is not None:
if 'detail' in response.data:
response.data = {'errors': [response.data]}
else:
response.data = {'errors': [{'detail': response.data}]}
if response is not None and response.data['errors'][0]['detail'] == "Authentication credentials were not provided.":
response.status_code = 401
return response
Add comment to override of status code
def jsonapi_exception_handler(exc, context):
"""
Custom exception handler that returns errors object as an array with a 'detail' member
"""
from rest_framework.views import exception_handler
response = exception_handler(exc, context)
if response is not None:
if 'detail' in response.data:
response.data = {'errors': [response.data]}
else:
response.data = {'errors': [{'detail': response.data}]}
# Returns 401 instead of 403 during unauthorized requests without having user to log in with Basic Auth
if response is not None and response.data['errors'][0]['detail'] == "Authentication credentials were not provided.":
response.status_code = 401
return response
| <commit_before>
def jsonapi_exception_handler(exc, context):
"""
Custom exception handler that returns errors object as an array with a 'detail' member
"""
from rest_framework.views import exception_handler
response = exception_handler(exc, context)
if response is not None:
if 'detail' in response.data:
response.data = {'errors': [response.data]}
else:
response.data = {'errors': [{'detail': response.data}]}
if response is not None and response.data['errors'][0]['detail'] == "Authentication credentials were not provided.":
response.status_code = 401
return response
<commit_msg>Add comment to override of status code<commit_after>
def jsonapi_exception_handler(exc, context):
"""
Custom exception handler that returns errors object as an array with a 'detail' member
"""
from rest_framework.views import exception_handler
response = exception_handler(exc, context)
if response is not None:
if 'detail' in response.data:
response.data = {'errors': [response.data]}
else:
response.data = {'errors': [{'detail': response.data}]}
# Returns 401 instead of 403 during unauthorized requests without having user to log in with Basic Auth
if response is not None and response.data['errors'][0]['detail'] == "Authentication credentials were not provided.":
response.status_code = 401
return response
|
a155e8654a95969abc2290d4198622991d6cb00e | ideascube/conf/idb_bdi.py | ideascube/conf/idb_bdi.py | """Generic config for Ideasbox of Burundi"""
from .idb import * # noqa
from django.utils.translation import ugettext_lazy as _
USER_FORM_FIELDS = (
('Ideasbox', ['serial', 'box_awareness']),
(_('Personal informations'), ['refugee_id', 'short_name', 'full_name', 'birth_year', 'gender', 'phone']), # noqa
(_('Family'), ['marital_status', 'family_status', 'children_under_12', 'children_under_18', 'children_above_18']), # noqa
(_('In the camp'), ['camp_entry_date', 'camp_activities', 'current_occupation', 'camp_address']), # noqa
(_('Origin'), ['country', 'city', 'country_of_origin_occupation', 'school_level', 'is_sent_to_school']), # noqa
(_('Language skills'), ['rn_level', 'sw_level', 'fr_level']),
(_('National residents'), ['id_card_number']),
)
HOME_CARDS = HOME_CARDS + [
{
'id': 'vikidia',
},
{
'id': 'gutenberg',
},
{
'id': 'cpassorcier',
},
{
'id': 'ted',
},
]
| """Generic config for Ideasbox of Burundi"""
from .idb import * # noqa
from django.utils.translation import ugettext_lazy as _
USER_FORM_FIELDS = (
('Ideasbox', ['serial', 'box_awareness']),
(_('Personal informations'), ['refugee_id', 'short_name', 'full_name', 'birth_year', 'gender', 'phone']), # noqa
(_('Family'), ['marital_status', 'family_status', 'children_under_12', 'children_under_18', 'children_above_18']), # noqa
(_('In the camp'), ['camp_entry_date', 'camp_activities', 'current_occupation', 'camp_address']), # noqa
(_('Origin'), ['country', 'city', 'country_of_origin_occupation', 'school_level', 'is_sent_to_school']), # noqa
(_('Language skills'), ['rn_level', 'sw_level', 'fr_level']),
(_('National residents'), ['id_card_number']),
)
HOME_CARDS = HOME_CARDS + [
{
'id': 'cpassorcier',
},
{
'id': 'ted',
},
]
| Remove duplicate entry for vikidia and gutenberg in burundi boxes | Remove duplicate entry for vikidia and gutenberg in burundi boxes
| Python | agpl-3.0 | ideascube/ideascube,ideascube/ideascube,ideascube/ideascube,ideascube/ideascube | """Generic config for Ideasbox of Burundi"""
from .idb import * # noqa
from django.utils.translation import ugettext_lazy as _
USER_FORM_FIELDS = (
('Ideasbox', ['serial', 'box_awareness']),
(_('Personal informations'), ['refugee_id', 'short_name', 'full_name', 'birth_year', 'gender', 'phone']), # noqa
(_('Family'), ['marital_status', 'family_status', 'children_under_12', 'children_under_18', 'children_above_18']), # noqa
(_('In the camp'), ['camp_entry_date', 'camp_activities', 'current_occupation', 'camp_address']), # noqa
(_('Origin'), ['country', 'city', 'country_of_origin_occupation', 'school_level', 'is_sent_to_school']), # noqa
(_('Language skills'), ['rn_level', 'sw_level', 'fr_level']),
(_('National residents'), ['id_card_number']),
)
HOME_CARDS = HOME_CARDS + [
{
'id': 'vikidia',
},
{
'id': 'gutenberg',
},
{
'id': 'cpassorcier',
},
{
'id': 'ted',
},
]
Remove duplicate entry for vikidia and gutenberg in burundi boxes | """Generic config for Ideasbox of Burundi"""
from .idb import * # noqa
from django.utils.translation import ugettext_lazy as _
USER_FORM_FIELDS = (
('Ideasbox', ['serial', 'box_awareness']),
(_('Personal informations'), ['refugee_id', 'short_name', 'full_name', 'birth_year', 'gender', 'phone']), # noqa
(_('Family'), ['marital_status', 'family_status', 'children_under_12', 'children_under_18', 'children_above_18']), # noqa
(_('In the camp'), ['camp_entry_date', 'camp_activities', 'current_occupation', 'camp_address']), # noqa
(_('Origin'), ['country', 'city', 'country_of_origin_occupation', 'school_level', 'is_sent_to_school']), # noqa
(_('Language skills'), ['rn_level', 'sw_level', 'fr_level']),
(_('National residents'), ['id_card_number']),
)
HOME_CARDS = HOME_CARDS + [
{
'id': 'cpassorcier',
},
{
'id': 'ted',
},
]
| <commit_before>"""Generic config for Ideasbox of Burundi"""
from .idb import * # noqa
from django.utils.translation import ugettext_lazy as _
USER_FORM_FIELDS = (
('Ideasbox', ['serial', 'box_awareness']),
(_('Personal informations'), ['refugee_id', 'short_name', 'full_name', 'birth_year', 'gender', 'phone']), # noqa
(_('Family'), ['marital_status', 'family_status', 'children_under_12', 'children_under_18', 'children_above_18']), # noqa
(_('In the camp'), ['camp_entry_date', 'camp_activities', 'current_occupation', 'camp_address']), # noqa
(_('Origin'), ['country', 'city', 'country_of_origin_occupation', 'school_level', 'is_sent_to_school']), # noqa
(_('Language skills'), ['rn_level', 'sw_level', 'fr_level']),
(_('National residents'), ['id_card_number']),
)
HOME_CARDS = HOME_CARDS + [
{
'id': 'vikidia',
},
{
'id': 'gutenberg',
},
{
'id': 'cpassorcier',
},
{
'id': 'ted',
},
]
<commit_msg>Remove duplicate entry for vikidia and gutenberg in burundi boxes<commit_after> | """Generic config for Ideasbox of Burundi"""
from .idb import * # noqa
from django.utils.translation import ugettext_lazy as _
USER_FORM_FIELDS = (
('Ideasbox', ['serial', 'box_awareness']),
(_('Personal informations'), ['refugee_id', 'short_name', 'full_name', 'birth_year', 'gender', 'phone']), # noqa
(_('Family'), ['marital_status', 'family_status', 'children_under_12', 'children_under_18', 'children_above_18']), # noqa
(_('In the camp'), ['camp_entry_date', 'camp_activities', 'current_occupation', 'camp_address']), # noqa
(_('Origin'), ['country', 'city', 'country_of_origin_occupation', 'school_level', 'is_sent_to_school']), # noqa
(_('Language skills'), ['rn_level', 'sw_level', 'fr_level']),
(_('National residents'), ['id_card_number']),
)
HOME_CARDS = HOME_CARDS + [
{
'id': 'cpassorcier',
},
{
'id': 'ted',
},
]
| """Generic config for Ideasbox of Burundi"""
from .idb import * # noqa
from django.utils.translation import ugettext_lazy as _
USER_FORM_FIELDS = (
('Ideasbox', ['serial', 'box_awareness']),
(_('Personal informations'), ['refugee_id', 'short_name', 'full_name', 'birth_year', 'gender', 'phone']), # noqa
(_('Family'), ['marital_status', 'family_status', 'children_under_12', 'children_under_18', 'children_above_18']), # noqa
(_('In the camp'), ['camp_entry_date', 'camp_activities', 'current_occupation', 'camp_address']), # noqa
(_('Origin'), ['country', 'city', 'country_of_origin_occupation', 'school_level', 'is_sent_to_school']), # noqa
(_('Language skills'), ['rn_level', 'sw_level', 'fr_level']),
(_('National residents'), ['id_card_number']),
)
HOME_CARDS = HOME_CARDS + [
{
'id': 'vikidia',
},
{
'id': 'gutenberg',
},
{
'id': 'cpassorcier',
},
{
'id': 'ted',
},
]
Remove duplicate entry for vikidia and gutenberg in burundi boxes"""Generic config for Ideasbox of Burundi"""
from .idb import * # noqa
from django.utils.translation import ugettext_lazy as _
USER_FORM_FIELDS = (
('Ideasbox', ['serial', 'box_awareness']),
(_('Personal informations'), ['refugee_id', 'short_name', 'full_name', 'birth_year', 'gender', 'phone']), # noqa
(_('Family'), ['marital_status', 'family_status', 'children_under_12', 'children_under_18', 'children_above_18']), # noqa
(_('In the camp'), ['camp_entry_date', 'camp_activities', 'current_occupation', 'camp_address']), # noqa
(_('Origin'), ['country', 'city', 'country_of_origin_occupation', 'school_level', 'is_sent_to_school']), # noqa
(_('Language skills'), ['rn_level', 'sw_level', 'fr_level']),
(_('National residents'), ['id_card_number']),
)
HOME_CARDS = HOME_CARDS + [
{
'id': 'cpassorcier',
},
{
'id': 'ted',
},
]
| <commit_before>"""Generic config for Ideasbox of Burundi"""
from .idb import * # noqa
from django.utils.translation import ugettext_lazy as _
USER_FORM_FIELDS = (
('Ideasbox', ['serial', 'box_awareness']),
(_('Personal informations'), ['refugee_id', 'short_name', 'full_name', 'birth_year', 'gender', 'phone']), # noqa
(_('Family'), ['marital_status', 'family_status', 'children_under_12', 'children_under_18', 'children_above_18']), # noqa
(_('In the camp'), ['camp_entry_date', 'camp_activities', 'current_occupation', 'camp_address']), # noqa
(_('Origin'), ['country', 'city', 'country_of_origin_occupation', 'school_level', 'is_sent_to_school']), # noqa
(_('Language skills'), ['rn_level', 'sw_level', 'fr_level']),
(_('National residents'), ['id_card_number']),
)
HOME_CARDS = HOME_CARDS + [
{
'id': 'vikidia',
},
{
'id': 'gutenberg',
},
{
'id': 'cpassorcier',
},
{
'id': 'ted',
},
]
<commit_msg>Remove duplicate entry for vikidia and gutenberg in burundi boxes<commit_after>"""Generic config for Ideasbox of Burundi"""
from .idb import * # noqa
from django.utils.translation import ugettext_lazy as _
USER_FORM_FIELDS = (
('Ideasbox', ['serial', 'box_awareness']),
(_('Personal informations'), ['refugee_id', 'short_name', 'full_name', 'birth_year', 'gender', 'phone']), # noqa
(_('Family'), ['marital_status', 'family_status', 'children_under_12', 'children_under_18', 'children_above_18']), # noqa
(_('In the camp'), ['camp_entry_date', 'camp_activities', 'current_occupation', 'camp_address']), # noqa
(_('Origin'), ['country', 'city', 'country_of_origin_occupation', 'school_level', 'is_sent_to_school']), # noqa
(_('Language skills'), ['rn_level', 'sw_level', 'fr_level']),
(_('National residents'), ['id_card_number']),
)
HOME_CARDS = HOME_CARDS + [
{
'id': 'cpassorcier',
},
{
'id': 'ted',
},
]
|
bc199a9eaa2416b35d1d691f580e6c9ca0b1a2ae | website/discovery/views.py | website/discovery/views.py | from website import settings
from website.project import Node
from website.project import utils
from modularodm.query.querydialect import DefaultQueryDialect as Q
def activity():
node_data = utils.get_node_data()
if node_data:
hits = utils.hits(node_data)
else:
hits = {}
# New Projects
new_and_noteworthy_pointers = Node.find_one(Q('_id', 'eq', settings.NEW_AND_NOTEWORTHY_LINKS_NODE)).nodes_pointer
new_and_noteworthy_projects = [pointer.node for pointer in new_and_noteworthy_pointers]
# Popular Projects
popular_public_projects = Node.find_one(Q('_id', 'eq', settings.POPULAR_LINKS_NODE)).nodes_pointer
# Popular Registrations
popular_public_registrations = Node.find_one(Q('_id', 'eq', settings.POPULAR_LINKS_NODE_REGISTRATIONS)).nodes_pointer
return {
'new_and_noteworthy_projects': new_and_noteworthy_projects,
'recent_public_registrations': utils.recent_public_registrations(),
'popular_public_projects': popular_public_projects,
'popular_public_registrations': popular_public_registrations,
'hits': hits,
}
| from website import settings
from website.project import Node
from website.project import utils
from modularodm.query.querydialect import DefaultQueryDialect as Q
def activity():
"""Reads node activity from pre-generated popular projects and registrations.
New and Noteworthy projects are set manually or through `scripts/populate_new_and_noteworthy_projects.py`
Popular projects and registrations are generated by `scripts/populate_popular_projects_and_registrations.py`
"""
# New and Noreworthy Projects
new_and_noteworthy_pointers = Node.find_one(Q('_id', 'eq', settings.NEW_AND_NOTEWORTHY_LINKS_NODE)).nodes_pointer
new_and_noteworthy_projects = [pointer.node for pointer in new_and_noteworthy_pointers]
# Popular Projects
popular_public_projects = Node.find_one(Q('_id', 'eq', settings.POPULAR_LINKS_NODE)).nodes_pointer
# Popular Registrations
popular_public_registrations = Node.find_one(Q('_id', 'eq', settings.POPULAR_LINKS_NODE_REGISTRATIONS)).nodes_pointer
return {
'new_and_noteworthy_projects': new_and_noteworthy_projects,
'recent_public_registrations': utils.recent_public_registrations(),
'popular_public_projects': popular_public_projects,
'popular_public_registrations': popular_public_registrations,
}
| Remove node counts and update docstrings on new view for activity | Remove node counts and update docstrings on new view for activity
| Python | apache-2.0 | monikagrabowska/osf.io,binoculars/osf.io,monikagrabowska/osf.io,acshi/osf.io,laurenrevere/osf.io,cslzchen/osf.io,laurenrevere/osf.io,alexschiller/osf.io,monikagrabowska/osf.io,Johnetordoff/osf.io,alexschiller/osf.io,mluo613/osf.io,CenterForOpenScience/osf.io,chennan47/osf.io,mfraezz/osf.io,aaxelb/osf.io,alexschiller/osf.io,Nesiehr/osf.io,mluo613/osf.io,sloria/osf.io,CenterForOpenScience/osf.io,mluo613/osf.io,acshi/osf.io,erinspace/osf.io,monikagrabowska/osf.io,rdhyee/osf.io,caneruguz/osf.io,adlius/osf.io,binoculars/osf.io,aaxelb/osf.io,HalcyonChimera/osf.io,baylee-d/osf.io,acshi/osf.io,adlius/osf.io,icereval/osf.io,monikagrabowska/osf.io,baylee-d/osf.io,adlius/osf.io,leb2dg/osf.io,icereval/osf.io,brianjgeiger/osf.io,HalcyonChimera/osf.io,caseyrollins/osf.io,brianjgeiger/osf.io,leb2dg/osf.io,brianjgeiger/osf.io,laurenrevere/osf.io,mfraezz/osf.io,mattclark/osf.io,crcresearch/osf.io,rdhyee/osf.io,aaxelb/osf.io,Nesiehr/osf.io,cwisecarver/osf.io,TomBaxter/osf.io,cslzchen/osf.io,pattisdr/osf.io,Johnetordoff/osf.io,icereval/osf.io,mattclark/osf.io,crcresearch/osf.io,HalcyonChimera/osf.io,saradbowman/osf.io,pattisdr/osf.io,sloria/osf.io,caneruguz/osf.io,brianjgeiger/osf.io,sloria/osf.io,mluo613/osf.io,felliott/osf.io,HalcyonChimera/osf.io,Johnetordoff/osf.io,cslzchen/osf.io,pattisdr/osf.io,leb2dg/osf.io,caseyrollins/osf.io,CenterForOpenScience/osf.io,chennan47/osf.io,aaxelb/osf.io,caneruguz/osf.io,adlius/osf.io,cwisecarver/osf.io,hmoco/osf.io,TomBaxter/osf.io,erinspace/osf.io,acshi/osf.io,leb2dg/osf.io,mattclark/osf.io,alexschiller/osf.io,TomBaxter/osf.io,Nesiehr/osf.io,binoculars/osf.io,acshi/osf.io,chennan47/osf.io,cwisecarver/osf.io,caneruguz/osf.io,chrisseto/osf.io,baylee-d/osf.io,felliott/osf.io,felliott/osf.io,caseyrollins/osf.io,chrisseto/osf.io,saradbowman/osf.io,cwisecarver/osf.io,hmoco/osf.io,erinspace/osf.io,crcresearch/osf.io,rdhyee/osf.io,chrisseto/osf.io,rdhyee/osf.io,hmoco/osf.io,CenterForOpenScience/osf.io,mfraezz/osf.io,cslzchen/osf.io,mfraezz/osf.io,Johnetordoff/osf.io,chrisseto/osf.io,felliott/osf.io,alexschiller/osf.io,Nesiehr/osf.io,hmoco/osf.io,mluo613/osf.io | from website import settings
from website.project import Node
from website.project import utils
from modularodm.query.querydialect import DefaultQueryDialect as Q
def activity():
node_data = utils.get_node_data()
if node_data:
hits = utils.hits(node_data)
else:
hits = {}
# New Projects
new_and_noteworthy_pointers = Node.find_one(Q('_id', 'eq', settings.NEW_AND_NOTEWORTHY_LINKS_NODE)).nodes_pointer
new_and_noteworthy_projects = [pointer.node for pointer in new_and_noteworthy_pointers]
# Popular Projects
popular_public_projects = Node.find_one(Q('_id', 'eq', settings.POPULAR_LINKS_NODE)).nodes_pointer
# Popular Registrations
popular_public_registrations = Node.find_one(Q('_id', 'eq', settings.POPULAR_LINKS_NODE_REGISTRATIONS)).nodes_pointer
return {
'new_and_noteworthy_projects': new_and_noteworthy_projects,
'recent_public_registrations': utils.recent_public_registrations(),
'popular_public_projects': popular_public_projects,
'popular_public_registrations': popular_public_registrations,
'hits': hits,
}
Remove node counts and update docstrings on new view for activity | from website import settings
from website.project import Node
from website.project import utils
from modularodm.query.querydialect import DefaultQueryDialect as Q
def activity():
"""Reads node activity from pre-generated popular projects and registrations.
New and Noteworthy projects are set manually or through `scripts/populate_new_and_noteworthy_projects.py`
Popular projects and registrations are generated by `scripts/populate_popular_projects_and_registrations.py`
"""
# New and Noreworthy Projects
new_and_noteworthy_pointers = Node.find_one(Q('_id', 'eq', settings.NEW_AND_NOTEWORTHY_LINKS_NODE)).nodes_pointer
new_and_noteworthy_projects = [pointer.node for pointer in new_and_noteworthy_pointers]
# Popular Projects
popular_public_projects = Node.find_one(Q('_id', 'eq', settings.POPULAR_LINKS_NODE)).nodes_pointer
# Popular Registrations
popular_public_registrations = Node.find_one(Q('_id', 'eq', settings.POPULAR_LINKS_NODE_REGISTRATIONS)).nodes_pointer
return {
'new_and_noteworthy_projects': new_and_noteworthy_projects,
'recent_public_registrations': utils.recent_public_registrations(),
'popular_public_projects': popular_public_projects,
'popular_public_registrations': popular_public_registrations,
}
| <commit_before>from website import settings
from website.project import Node
from website.project import utils
from modularodm.query.querydialect import DefaultQueryDialect as Q
def activity():
node_data = utils.get_node_data()
if node_data:
hits = utils.hits(node_data)
else:
hits = {}
# New Projects
new_and_noteworthy_pointers = Node.find_one(Q('_id', 'eq', settings.NEW_AND_NOTEWORTHY_LINKS_NODE)).nodes_pointer
new_and_noteworthy_projects = [pointer.node for pointer in new_and_noteworthy_pointers]
# Popular Projects
popular_public_projects = Node.find_one(Q('_id', 'eq', settings.POPULAR_LINKS_NODE)).nodes_pointer
# Popular Registrations
popular_public_registrations = Node.find_one(Q('_id', 'eq', settings.POPULAR_LINKS_NODE_REGISTRATIONS)).nodes_pointer
return {
'new_and_noteworthy_projects': new_and_noteworthy_projects,
'recent_public_registrations': utils.recent_public_registrations(),
'popular_public_projects': popular_public_projects,
'popular_public_registrations': popular_public_registrations,
'hits': hits,
}
<commit_msg>Remove node counts and update docstrings on new view for activity<commit_after> | from website import settings
from website.project import Node
from website.project import utils
from modularodm.query.querydialect import DefaultQueryDialect as Q
def activity():
"""Reads node activity from pre-generated popular projects and registrations.
New and Noteworthy projects are set manually or through `scripts/populate_new_and_noteworthy_projects.py`
Popular projects and registrations are generated by `scripts/populate_popular_projects_and_registrations.py`
"""
# New and Noreworthy Projects
new_and_noteworthy_pointers = Node.find_one(Q('_id', 'eq', settings.NEW_AND_NOTEWORTHY_LINKS_NODE)).nodes_pointer
new_and_noteworthy_projects = [pointer.node for pointer in new_and_noteworthy_pointers]
# Popular Projects
popular_public_projects = Node.find_one(Q('_id', 'eq', settings.POPULAR_LINKS_NODE)).nodes_pointer
# Popular Registrations
popular_public_registrations = Node.find_one(Q('_id', 'eq', settings.POPULAR_LINKS_NODE_REGISTRATIONS)).nodes_pointer
return {
'new_and_noteworthy_projects': new_and_noteworthy_projects,
'recent_public_registrations': utils.recent_public_registrations(),
'popular_public_projects': popular_public_projects,
'popular_public_registrations': popular_public_registrations,
}
| from website import settings
from website.project import Node
from website.project import utils
from modularodm.query.querydialect import DefaultQueryDialect as Q
def activity():
node_data = utils.get_node_data()
if node_data:
hits = utils.hits(node_data)
else:
hits = {}
# New Projects
new_and_noteworthy_pointers = Node.find_one(Q('_id', 'eq', settings.NEW_AND_NOTEWORTHY_LINKS_NODE)).nodes_pointer
new_and_noteworthy_projects = [pointer.node for pointer in new_and_noteworthy_pointers]
# Popular Projects
popular_public_projects = Node.find_one(Q('_id', 'eq', settings.POPULAR_LINKS_NODE)).nodes_pointer
# Popular Registrations
popular_public_registrations = Node.find_one(Q('_id', 'eq', settings.POPULAR_LINKS_NODE_REGISTRATIONS)).nodes_pointer
return {
'new_and_noteworthy_projects': new_and_noteworthy_projects,
'recent_public_registrations': utils.recent_public_registrations(),
'popular_public_projects': popular_public_projects,
'popular_public_registrations': popular_public_registrations,
'hits': hits,
}
Remove node counts and update docstrings on new view for activityfrom website import settings
from website.project import Node
from website.project import utils
from modularodm.query.querydialect import DefaultQueryDialect as Q
def activity():
"""Reads node activity from pre-generated popular projects and registrations.
New and Noteworthy projects are set manually or through `scripts/populate_new_and_noteworthy_projects.py`
Popular projects and registrations are generated by `scripts/populate_popular_projects_and_registrations.py`
"""
# New and Noreworthy Projects
new_and_noteworthy_pointers = Node.find_one(Q('_id', 'eq', settings.NEW_AND_NOTEWORTHY_LINKS_NODE)).nodes_pointer
new_and_noteworthy_projects = [pointer.node for pointer in new_and_noteworthy_pointers]
# Popular Projects
popular_public_projects = Node.find_one(Q('_id', 'eq', settings.POPULAR_LINKS_NODE)).nodes_pointer
# Popular Registrations
popular_public_registrations = Node.find_one(Q('_id', 'eq', settings.POPULAR_LINKS_NODE_REGISTRATIONS)).nodes_pointer
return {
'new_and_noteworthy_projects': new_and_noteworthy_projects,
'recent_public_registrations': utils.recent_public_registrations(),
'popular_public_projects': popular_public_projects,
'popular_public_registrations': popular_public_registrations,
}
| <commit_before>from website import settings
from website.project import Node
from website.project import utils
from modularodm.query.querydialect import DefaultQueryDialect as Q
def activity():
node_data = utils.get_node_data()
if node_data:
hits = utils.hits(node_data)
else:
hits = {}
# New Projects
new_and_noteworthy_pointers = Node.find_one(Q('_id', 'eq', settings.NEW_AND_NOTEWORTHY_LINKS_NODE)).nodes_pointer
new_and_noteworthy_projects = [pointer.node for pointer in new_and_noteworthy_pointers]
# Popular Projects
popular_public_projects = Node.find_one(Q('_id', 'eq', settings.POPULAR_LINKS_NODE)).nodes_pointer
# Popular Registrations
popular_public_registrations = Node.find_one(Q('_id', 'eq', settings.POPULAR_LINKS_NODE_REGISTRATIONS)).nodes_pointer
return {
'new_and_noteworthy_projects': new_and_noteworthy_projects,
'recent_public_registrations': utils.recent_public_registrations(),
'popular_public_projects': popular_public_projects,
'popular_public_registrations': popular_public_registrations,
'hits': hits,
}
<commit_msg>Remove node counts and update docstrings on new view for activity<commit_after>from website import settings
from website.project import Node
from website.project import utils
from modularodm.query.querydialect import DefaultQueryDialect as Q
def activity():
"""Reads node activity from pre-generated popular projects and registrations.
New and Noteworthy projects are set manually or through `scripts/populate_new_and_noteworthy_projects.py`
Popular projects and registrations are generated by `scripts/populate_popular_projects_and_registrations.py`
"""
# New and Noreworthy Projects
new_and_noteworthy_pointers = Node.find_one(Q('_id', 'eq', settings.NEW_AND_NOTEWORTHY_LINKS_NODE)).nodes_pointer
new_and_noteworthy_projects = [pointer.node for pointer in new_and_noteworthy_pointers]
# Popular Projects
popular_public_projects = Node.find_one(Q('_id', 'eq', settings.POPULAR_LINKS_NODE)).nodes_pointer
# Popular Registrations
popular_public_registrations = Node.find_one(Q('_id', 'eq', settings.POPULAR_LINKS_NODE_REGISTRATIONS)).nodes_pointer
return {
'new_and_noteworthy_projects': new_and_noteworthy_projects,
'recent_public_registrations': utils.recent_public_registrations(),
'popular_public_projects': popular_public_projects,
'popular_public_registrations': popular_public_registrations,
}
|
e968983001cced5391a163ab282ef2f2ded492f6 | eliot/__init__.py | eliot/__init__.py | """
Eliot: An Opinionated Logging Library
Suppose we turn from outside estimates of a man, to wonder, with keener
interest, what is the report of his own consciousness about his doings or
capacity: with what hindrances he is carrying on his daily labors; what
fading of hopes, or what deeper fixity of self-delusion the years are
marking off within him; and with what spirit he wrestles against universal
pressure, which will one day be too heavy for him, and bring his heart to
its final pause.
-- George Eliot, "Middlemarch"
See http://wiki.hybrid-cluster.com/index.php?title=Logging_Design_Document for
motivation.
"""
# Expose the public API:
from ._message import Message
from ._action import startAction, startTask, Action
from ._output import ILogger, Logger, MemoryLogger
from ._validation import Field, MessageType, ActionType
from ._traceback import writeTraceback, writeFailure
addDestination = Logger._destinations.add
removeDestination = Logger._destinations.remove
__all__ = ["Message", "writeTraceback", "writeFailure",
"startAction", "startTask", "Action",
"Field", "MessageType", "ActionType",
"ILogger", "Logger", "MemoryLogger", "addDestination",
"removeDestination",
]
| """
Eliot: Logging as Storytelling
Suppose we turn from outside estimates of a man, to wonder, with keener
interest, what is the report of his own consciousness about his doings or
capacity: with what hindrances he is carrying on his daily labors; what
fading of hopes, or what deeper fixity of self-delusion the years are
marking off within him; and with what spirit he wrestles against universal
pressure, which will one day be too heavy for him, and bring his heart to
its final pause.
-- George Eliot, "Middlemarch"
"""
# Expose the public API:
from ._message import Message
from ._action import startAction, startTask, Action
from ._output import ILogger, Logger, MemoryLogger
from ._validation import Field, MessageType, ActionType
from ._traceback import writeTraceback, writeFailure
addDestination = Logger._destinations.add
removeDestination = Logger._destinations.remove
__all__ = ["Message", "writeTraceback", "writeFailure",
"startAction", "startTask", "Action",
"Field", "MessageType", "ActionType",
"ILogger", "Logger", "MemoryLogger", "addDestination",
"removeDestination",
]
| Remove link to private document. | Remove link to private document.
| Python | apache-2.0 | ScatterHQ/eliot,ClusterHQ/eliot,ScatterHQ/eliot,iffy/eliot,ScatterHQ/eliot | """
Eliot: An Opinionated Logging Library
Suppose we turn from outside estimates of a man, to wonder, with keener
interest, what is the report of his own consciousness about his doings or
capacity: with what hindrances he is carrying on his daily labors; what
fading of hopes, or what deeper fixity of self-delusion the years are
marking off within him; and with what spirit he wrestles against universal
pressure, which will one day be too heavy for him, and bring his heart to
its final pause.
-- George Eliot, "Middlemarch"
See http://wiki.hybrid-cluster.com/index.php?title=Logging_Design_Document for
motivation.
"""
# Expose the public API:
from ._message import Message
from ._action import startAction, startTask, Action
from ._output import ILogger, Logger, MemoryLogger
from ._validation import Field, MessageType, ActionType
from ._traceback import writeTraceback, writeFailure
addDestination = Logger._destinations.add
removeDestination = Logger._destinations.remove
__all__ = ["Message", "writeTraceback", "writeFailure",
"startAction", "startTask", "Action",
"Field", "MessageType", "ActionType",
"ILogger", "Logger", "MemoryLogger", "addDestination",
"removeDestination",
]
Remove link to private document. | """
Eliot: Logging as Storytelling
Suppose we turn from outside estimates of a man, to wonder, with keener
interest, what is the report of his own consciousness about his doings or
capacity: with what hindrances he is carrying on his daily labors; what
fading of hopes, or what deeper fixity of self-delusion the years are
marking off within him; and with what spirit he wrestles against universal
pressure, which will one day be too heavy for him, and bring his heart to
its final pause.
-- George Eliot, "Middlemarch"
"""
# Expose the public API:
from ._message import Message
from ._action import startAction, startTask, Action
from ._output import ILogger, Logger, MemoryLogger
from ._validation import Field, MessageType, ActionType
from ._traceback import writeTraceback, writeFailure
addDestination = Logger._destinations.add
removeDestination = Logger._destinations.remove
__all__ = ["Message", "writeTraceback", "writeFailure",
"startAction", "startTask", "Action",
"Field", "MessageType", "ActionType",
"ILogger", "Logger", "MemoryLogger", "addDestination",
"removeDestination",
]
| <commit_before>"""
Eliot: An Opinionated Logging Library
Suppose we turn from outside estimates of a man, to wonder, with keener
interest, what is the report of his own consciousness about his doings or
capacity: with what hindrances he is carrying on his daily labors; what
fading of hopes, or what deeper fixity of self-delusion the years are
marking off within him; and with what spirit he wrestles against universal
pressure, which will one day be too heavy for him, and bring his heart to
its final pause.
-- George Eliot, "Middlemarch"
See http://wiki.hybrid-cluster.com/index.php?title=Logging_Design_Document for
motivation.
"""
# Expose the public API:
from ._message import Message
from ._action import startAction, startTask, Action
from ._output import ILogger, Logger, MemoryLogger
from ._validation import Field, MessageType, ActionType
from ._traceback import writeTraceback, writeFailure
addDestination = Logger._destinations.add
removeDestination = Logger._destinations.remove
__all__ = ["Message", "writeTraceback", "writeFailure",
"startAction", "startTask", "Action",
"Field", "MessageType", "ActionType",
"ILogger", "Logger", "MemoryLogger", "addDestination",
"removeDestination",
]
<commit_msg>Remove link to private document.<commit_after> | """
Eliot: Logging as Storytelling
Suppose we turn from outside estimates of a man, to wonder, with keener
interest, what is the report of his own consciousness about his doings or
capacity: with what hindrances he is carrying on his daily labors; what
fading of hopes, or what deeper fixity of self-delusion the years are
marking off within him; and with what spirit he wrestles against universal
pressure, which will one day be too heavy for him, and bring his heart to
its final pause.
-- George Eliot, "Middlemarch"
"""
# Expose the public API:
from ._message import Message
from ._action import startAction, startTask, Action
from ._output import ILogger, Logger, MemoryLogger
from ._validation import Field, MessageType, ActionType
from ._traceback import writeTraceback, writeFailure
addDestination = Logger._destinations.add
removeDestination = Logger._destinations.remove
__all__ = ["Message", "writeTraceback", "writeFailure",
"startAction", "startTask", "Action",
"Field", "MessageType", "ActionType",
"ILogger", "Logger", "MemoryLogger", "addDestination",
"removeDestination",
]
| """
Eliot: An Opinionated Logging Library
Suppose we turn from outside estimates of a man, to wonder, with keener
interest, what is the report of his own consciousness about his doings or
capacity: with what hindrances he is carrying on his daily labors; what
fading of hopes, or what deeper fixity of self-delusion the years are
marking off within him; and with what spirit he wrestles against universal
pressure, which will one day be too heavy for him, and bring his heart to
its final pause.
-- George Eliot, "Middlemarch"
See http://wiki.hybrid-cluster.com/index.php?title=Logging_Design_Document for
motivation.
"""
# Expose the public API:
from ._message import Message
from ._action import startAction, startTask, Action
from ._output import ILogger, Logger, MemoryLogger
from ._validation import Field, MessageType, ActionType
from ._traceback import writeTraceback, writeFailure
addDestination = Logger._destinations.add
removeDestination = Logger._destinations.remove
__all__ = ["Message", "writeTraceback", "writeFailure",
"startAction", "startTask", "Action",
"Field", "MessageType", "ActionType",
"ILogger", "Logger", "MemoryLogger", "addDestination",
"removeDestination",
]
Remove link to private document."""
Eliot: Logging as Storytelling
Suppose we turn from outside estimates of a man, to wonder, with keener
interest, what is the report of his own consciousness about his doings or
capacity: with what hindrances he is carrying on his daily labors; what
fading of hopes, or what deeper fixity of self-delusion the years are
marking off within him; and with what spirit he wrestles against universal
pressure, which will one day be too heavy for him, and bring his heart to
its final pause.
-- George Eliot, "Middlemarch"
"""
# Expose the public API:
from ._message import Message
from ._action import startAction, startTask, Action
from ._output import ILogger, Logger, MemoryLogger
from ._validation import Field, MessageType, ActionType
from ._traceback import writeTraceback, writeFailure
addDestination = Logger._destinations.add
removeDestination = Logger._destinations.remove
__all__ = ["Message", "writeTraceback", "writeFailure",
"startAction", "startTask", "Action",
"Field", "MessageType", "ActionType",
"ILogger", "Logger", "MemoryLogger", "addDestination",
"removeDestination",
]
| <commit_before>"""
Eliot: An Opinionated Logging Library
Suppose we turn from outside estimates of a man, to wonder, with keener
interest, what is the report of his own consciousness about his doings or
capacity: with what hindrances he is carrying on his daily labors; what
fading of hopes, or what deeper fixity of self-delusion the years are
marking off within him; and with what spirit he wrestles against universal
pressure, which will one day be too heavy for him, and bring his heart to
its final pause.
-- George Eliot, "Middlemarch"
See http://wiki.hybrid-cluster.com/index.php?title=Logging_Design_Document for
motivation.
"""
# Expose the public API:
from ._message import Message
from ._action import startAction, startTask, Action
from ._output import ILogger, Logger, MemoryLogger
from ._validation import Field, MessageType, ActionType
from ._traceback import writeTraceback, writeFailure
addDestination = Logger._destinations.add
removeDestination = Logger._destinations.remove
__all__ = ["Message", "writeTraceback", "writeFailure",
"startAction", "startTask", "Action",
"Field", "MessageType", "ActionType",
"ILogger", "Logger", "MemoryLogger", "addDestination",
"removeDestination",
]
<commit_msg>Remove link to private document.<commit_after>"""
Eliot: Logging as Storytelling
Suppose we turn from outside estimates of a man, to wonder, with keener
interest, what is the report of his own consciousness about his doings or
capacity: with what hindrances he is carrying on his daily labors; what
fading of hopes, or what deeper fixity of self-delusion the years are
marking off within him; and with what spirit he wrestles against universal
pressure, which will one day be too heavy for him, and bring his heart to
its final pause.
-- George Eliot, "Middlemarch"
"""
# Expose the public API:
from ._message import Message
from ._action import startAction, startTask, Action
from ._output import ILogger, Logger, MemoryLogger
from ._validation import Field, MessageType, ActionType
from ._traceback import writeTraceback, writeFailure
addDestination = Logger._destinations.add
removeDestination = Logger._destinations.remove
__all__ = ["Message", "writeTraceback", "writeFailure",
"startAction", "startTask", "Action",
"Field", "MessageType", "ActionType",
"ILogger", "Logger", "MemoryLogger", "addDestination",
"removeDestination",
]
|
4d46001296ad083df6827a9c97333f0f093f31bd | example/config.py | example/config.py | # Mnemosyne configuration
# =======================
#
# This file is a Python script. When run, the following variables will be
# defined for you; you may change or add to them as you see fit.
#
# ``entries_dir``: a Maildir containing all the blog entries.
# ``layout_dir``: the blog's layout, as a skeleton directory tree.
# ``style_dir``: empy styles used for filling layout templates.
# ``output_dir``: location where we will write the generated pages.
#
# These will be $HOME/Mnemosyne/{entries,layout,style,htdocs} respectively.
#
# ``vars``: a dict of default local variables passed to all templates.
#
# This will contain the keys __version__, __url__, __author__, and __email__.
#
# You may also define functions here to add 'magic' attributes to each entry.
# A function with a name of the form ``make_MAGIC`` (which takes a single
# argument, the entry) will be used to create an attribute ``e._MAGIC`` for
# each entry ``e``. Either a single value or a list of values may be returned.
#
# In your layout, a file or directory name containing ``__MAGIC__`` will then
# be evaluated once for each value ``make_MAGIC`` returns, with the entries
# for which ``make_MAGIC`` returns that value or a list containing it.
vars['blogname'] = 'Example Blog'
class Entry:
def get_organization(self):
return self.m.get('Organization')
| # Mnemosyne configuration
# =======================
#
# This file is a Python script. When run, the following variables will be
# defined for you; you may change or add to them as you see fit.
#
# * ``entries_dir``: a Maildir containing all the blog entries.
# * ``layout_dir``: the blog's layout, as a skeleton directory tree.
# * ``style_dir``: empy styles used for filling layout templates.
# * ``output_dir``: location where we will write the generated pages.
#
# These will be $HOME/Mnemosyne/{entries,layout,style,htdocs} respectively.
#
# * ``locals``: a dict of default local variables passed to all templates.
#
# This will contain the keys __version__, __url__, __author__, and __email__.
#
# * ``MnemosyneEntry``: a class used to represent each entry passed to the
# templates.
#
# If you wish to extend this class, you may define a new class ``Entry`` here,
# using ``MnemosyneEntry`` as its base class. Any methods with a name of the
# form ``get_ATTRIBUTE`` will be used to provide e.ATTRIBUTE at runtime.
locals['blogname'] = 'Example Blog'
locals['base'] = 'http://example.invalid'
class Entry:
def get_organization(self):
return self.m.get('Organization')
| Document new evil magic, and add required var. | Document new evil magic, and add required var.
| Python | isc | decklin/ennepe | # Mnemosyne configuration
# =======================
#
# This file is a Python script. When run, the following variables will be
# defined for you; you may change or add to them as you see fit.
#
# ``entries_dir``: a Maildir containing all the blog entries.
# ``layout_dir``: the blog's layout, as a skeleton directory tree.
# ``style_dir``: empy styles used for filling layout templates.
# ``output_dir``: location where we will write the generated pages.
#
# These will be $HOME/Mnemosyne/{entries,layout,style,htdocs} respectively.
#
# ``vars``: a dict of default local variables passed to all templates.
#
# This will contain the keys __version__, __url__, __author__, and __email__.
#
# You may also define functions here to add 'magic' attributes to each entry.
# A function with a name of the form ``make_MAGIC`` (which takes a single
# argument, the entry) will be used to create an attribute ``e._MAGIC`` for
# each entry ``e``. Either a single value or a list of values may be returned.
#
# In your layout, a file or directory name containing ``__MAGIC__`` will then
# be evaluated once for each value ``make_MAGIC`` returns, with the entries
# for which ``make_MAGIC`` returns that value or a list containing it.
vars['blogname'] = 'Example Blog'
class Entry:
def get_organization(self):
return self.m.get('Organization')
Document new evil magic, and add required var. | # Mnemosyne configuration
# =======================
#
# This file is a Python script. When run, the following variables will be
# defined for you; you may change or add to them as you see fit.
#
# * ``entries_dir``: a Maildir containing all the blog entries.
# * ``layout_dir``: the blog's layout, as a skeleton directory tree.
# * ``style_dir``: empy styles used for filling layout templates.
# * ``output_dir``: location where we will write the generated pages.
#
# These will be $HOME/Mnemosyne/{entries,layout,style,htdocs} respectively.
#
# * ``locals``: a dict of default local variables passed to all templates.
#
# This will contain the keys __version__, __url__, __author__, and __email__.
#
# * ``MnemosyneEntry``: a class used to represent each entry passed to the
# templates.
#
# If you wish to extend this class, you may define a new class ``Entry`` here,
# using ``MnemosyneEntry`` as its base class. Any methods with a name of the
# form ``get_ATTRIBUTE`` will be used to provide e.ATTRIBUTE at runtime.
locals['blogname'] = 'Example Blog'
locals['base'] = 'http://example.invalid'
class Entry:
def get_organization(self):
return self.m.get('Organization')
| <commit_before># Mnemosyne configuration
# =======================
#
# This file is a Python script. When run, the following variables will be
# defined for you; you may change or add to them as you see fit.
#
# ``entries_dir``: a Maildir containing all the blog entries.
# ``layout_dir``: the blog's layout, as a skeleton directory tree.
# ``style_dir``: empy styles used for filling layout templates.
# ``output_dir``: location where we will write the generated pages.
#
# These will be $HOME/Mnemosyne/{entries,layout,style,htdocs} respectively.
#
# ``vars``: a dict of default local variables passed to all templates.
#
# This will contain the keys __version__, __url__, __author__, and __email__.
#
# You may also define functions here to add 'magic' attributes to each entry.
# A function with a name of the form ``make_MAGIC`` (which takes a single
# argument, the entry) will be used to create an attribute ``e._MAGIC`` for
# each entry ``e``. Either a single value or a list of values may be returned.
#
# In your layout, a file or directory name containing ``__MAGIC__`` will then
# be evaluated once for each value ``make_MAGIC`` returns, with the entries
# for which ``make_MAGIC`` returns that value or a list containing it.
vars['blogname'] = 'Example Blog'
class Entry:
def get_organization(self):
return self.m.get('Organization')
<commit_msg>Document new evil magic, and add required var.<commit_after> | # Mnemosyne configuration
# =======================
#
# This file is a Python script. When run, the following variables will be
# defined for you; you may change or add to them as you see fit.
#
# * ``entries_dir``: a Maildir containing all the blog entries.
# * ``layout_dir``: the blog's layout, as a skeleton directory tree.
# * ``style_dir``: empy styles used for filling layout templates.
# * ``output_dir``: location where we will write the generated pages.
#
# These will be $HOME/Mnemosyne/{entries,layout,style,htdocs} respectively.
#
# * ``locals``: a dict of default local variables passed to all templates.
#
# This will contain the keys __version__, __url__, __author__, and __email__.
#
# * ``MnemosyneEntry``: a class used to represent each entry passed to the
# templates.
#
# If you wish to extend this class, you may define a new class ``Entry`` here,
# using ``MnemosyneEntry`` as its base class. Any methods with a name of the
# form ``get_ATTRIBUTE`` will be used to provide e.ATTRIBUTE at runtime.
locals['blogname'] = 'Example Blog'
locals['base'] = 'http://example.invalid'
class Entry:
def get_organization(self):
return self.m.get('Organization')
| # Mnemosyne configuration
# =======================
#
# This file is a Python script. When run, the following variables will be
# defined for you; you may change or add to them as you see fit.
#
# ``entries_dir``: a Maildir containing all the blog entries.
# ``layout_dir``: the blog's layout, as a skeleton directory tree.
# ``style_dir``: empy styles used for filling layout templates.
# ``output_dir``: location where we will write the generated pages.
#
# These will be $HOME/Mnemosyne/{entries,layout,style,htdocs} respectively.
#
# ``vars``: a dict of default local variables passed to all templates.
#
# This will contain the keys __version__, __url__, __author__, and __email__.
#
# You may also define functions here to add 'magic' attributes to each entry.
# A function with a name of the form ``make_MAGIC`` (which takes a single
# argument, the entry) will be used to create an attribute ``e._MAGIC`` for
# each entry ``e``. Either a single value or a list of values may be returned.
#
# In your layout, a file or directory name containing ``__MAGIC__`` will then
# be evaluated once for each value ``make_MAGIC`` returns, with the entries
# for which ``make_MAGIC`` returns that value or a list containing it.
vars['blogname'] = 'Example Blog'
class Entry:
def get_organization(self):
return self.m.get('Organization')
Document new evil magic, and add required var.# Mnemosyne configuration
# =======================
#
# This file is a Python script. When run, the following variables will be
# defined for you; you may change or add to them as you see fit.
#
# * ``entries_dir``: a Maildir containing all the blog entries.
# * ``layout_dir``: the blog's layout, as a skeleton directory tree.
# * ``style_dir``: empy styles used for filling layout templates.
# * ``output_dir``: location where we will write the generated pages.
#
# These will be $HOME/Mnemosyne/{entries,layout,style,htdocs} respectively.
#
# * ``locals``: a dict of default local variables passed to all templates.
#
# This will contain the keys __version__, __url__, __author__, and __email__.
#
# * ``MnemosyneEntry``: a class used to represent each entry passed to the
# templates.
#
# If you wish to extend this class, you may define a new class ``Entry`` here,
# using ``MnemosyneEntry`` as its base class. Any methods with a name of the
# form ``get_ATTRIBUTE`` will be used to provide e.ATTRIBUTE at runtime.
locals['blogname'] = 'Example Blog'
locals['base'] = 'http://example.invalid'
class Entry:
def get_organization(self):
return self.m.get('Organization')
| <commit_before># Mnemosyne configuration
# =======================
#
# This file is a Python script. When run, the following variables will be
# defined for you; you may change or add to them as you see fit.
#
# ``entries_dir``: a Maildir containing all the blog entries.
# ``layout_dir``: the blog's layout, as a skeleton directory tree.
# ``style_dir``: empy styles used for filling layout templates.
# ``output_dir``: location where we will write the generated pages.
#
# These will be $HOME/Mnemosyne/{entries,layout,style,htdocs} respectively.
#
# ``vars``: a dict of default local variables passed to all templates.
#
# This will contain the keys __version__, __url__, __author__, and __email__.
#
# You may also define functions here to add 'magic' attributes to each entry.
# A function with a name of the form ``make_MAGIC`` (which takes a single
# argument, the entry) will be used to create an attribute ``e._MAGIC`` for
# each entry ``e``. Either a single value or a list of values may be returned.
#
# In your layout, a file or directory name containing ``__MAGIC__`` will then
# be evaluated once for each value ``make_MAGIC`` returns, with the entries
# for which ``make_MAGIC`` returns that value or a list containing it.
vars['blogname'] = 'Example Blog'
class Entry:
def get_organization(self):
return self.m.get('Organization')
<commit_msg>Document new evil magic, and add required var.<commit_after># Mnemosyne configuration
# =======================
#
# This file is a Python script. When run, the following variables will be
# defined for you; you may change or add to them as you see fit.
#
# * ``entries_dir``: a Maildir containing all the blog entries.
# * ``layout_dir``: the blog's layout, as a skeleton directory tree.
# * ``style_dir``: empy styles used for filling layout templates.
# * ``output_dir``: location where we will write the generated pages.
#
# These will be $HOME/Mnemosyne/{entries,layout,style,htdocs} respectively.
#
# * ``locals``: a dict of default local variables passed to all templates.
#
# This will contain the keys __version__, __url__, __author__, and __email__.
#
# * ``MnemosyneEntry``: a class used to represent each entry passed to the
# templates.
#
# If you wish to extend this class, you may define a new class ``Entry`` here,
# using ``MnemosyneEntry`` as its base class. Any methods with a name of the
# form ``get_ATTRIBUTE`` will be used to provide e.ATTRIBUTE at runtime.
locals['blogname'] = 'Example Blog'
locals['base'] = 'http://example.invalid'
class Entry:
def get_organization(self):
return self.m.get('Organization')
|
5b0386d0872d4106902655ada78389503c62a95a | yunity/models/relations.py | yunity/models/relations.py | from django.db.models import ForeignKey, DateTimeField, ManyToManyField
from yunity.models.entities import User, Location, Mappable, Message
from yunity.models.utils import BaseModel, MaxLengthCharField
from yunity.utils.decorators import classproperty
class Chat(BaseModel):
participants = ManyToManyField(User)
messages = ManyToManyField(Message)
class MappableLocation(BaseModel):
mappable = ForeignKey(Mappable)
location = ForeignKey(Location)
startTime = DateTimeField(null=True)
endTime = DateTimeField(null=True)
class MappableResponsibility(BaseModel):
@classproperty
def TYPE(cls):
return cls.create_constants('type', 'OWNER')
@classproperty
def STATUS(cls):
return cls.create_constants('status', 'GRANTED', 'PENDING', 'REQUESTED')
responsible = ForeignKey(User, null=True)
mappable = ForeignKey(Mappable)
status = MaxLengthCharField()
date = DateTimeField(null=True, auto_now=True)
type = MaxLengthCharField()
class UserLocation(BaseModel):
user = ForeignKey(User)
location = ForeignKey(Location)
type = MaxLengthCharField()
class ItemRequest(BaseModel):
requester = ForeignKey(User)
requested = ForeignKey(Mappable)
feedback = MaxLengthCharField(null=True, default=None)
| from django.db.models import ForeignKey, DateTimeField, ManyToManyField
from yunity.models.entities import User, Location, Mappable, Message
from yunity.models.utils import BaseModel, MaxLengthCharField
from yunity.utils.decorators import classproperty
class Chat(BaseModel):
participants = ManyToManyField(User)
messages = ManyToManyField(Message)
class MappableLocation(BaseModel):
mappable = ForeignKey(Mappable)
location = ForeignKey(Location)
startTime = DateTimeField(null=True)
endTime = DateTimeField(null=True)
class MappableResponsibility(BaseModel):
@classproperty
def TYPE(cls):
return cls.create_constants('type', 'OWNER')
@classproperty
def STATUS(cls):
return cls.create_constants('status', 'GRANTED', 'PENDING', 'REQUESTED')
responsible = ForeignKey(User, null=True)
mappable = ForeignKey(Mappable)
status = MaxLengthCharField()
date = DateTimeField(null=True, auto_now=True)
type = MaxLengthCharField()
class UserLocation(BaseModel):
user = ForeignKey(User)
location = ForeignKey(Location)
type = MaxLengthCharField()
class ItemRequest(BaseModel):
@classproperty
def FEEDBACK(cls):
return cls.create_constants('feedback', 'OK', 'NO_SHOW', 'NOT_GRANTED')
requester = ForeignKey(User)
requested = ForeignKey(Mappable)
feedback = MaxLengthCharField(null=True, default=None)
| Add some default feedback types for item requests | Add some default feedback types for item requests
| Python | agpl-3.0 | yunity/yunity-core,yunity/yunity-core,yunity/foodsaving-backend,yunity/foodsaving-backend,yunity/foodsaving-backend | from django.db.models import ForeignKey, DateTimeField, ManyToManyField
from yunity.models.entities import User, Location, Mappable, Message
from yunity.models.utils import BaseModel, MaxLengthCharField
from yunity.utils.decorators import classproperty
class Chat(BaseModel):
participants = ManyToManyField(User)
messages = ManyToManyField(Message)
class MappableLocation(BaseModel):
mappable = ForeignKey(Mappable)
location = ForeignKey(Location)
startTime = DateTimeField(null=True)
endTime = DateTimeField(null=True)
class MappableResponsibility(BaseModel):
@classproperty
def TYPE(cls):
return cls.create_constants('type', 'OWNER')
@classproperty
def STATUS(cls):
return cls.create_constants('status', 'GRANTED', 'PENDING', 'REQUESTED')
responsible = ForeignKey(User, null=True)
mappable = ForeignKey(Mappable)
status = MaxLengthCharField()
date = DateTimeField(null=True, auto_now=True)
type = MaxLengthCharField()
class UserLocation(BaseModel):
user = ForeignKey(User)
location = ForeignKey(Location)
type = MaxLengthCharField()
class ItemRequest(BaseModel):
requester = ForeignKey(User)
requested = ForeignKey(Mappable)
feedback = MaxLengthCharField(null=True, default=None)
Add some default feedback types for item requests | from django.db.models import ForeignKey, DateTimeField, ManyToManyField
from yunity.models.entities import User, Location, Mappable, Message
from yunity.models.utils import BaseModel, MaxLengthCharField
from yunity.utils.decorators import classproperty
class Chat(BaseModel):
participants = ManyToManyField(User)
messages = ManyToManyField(Message)
class MappableLocation(BaseModel):
mappable = ForeignKey(Mappable)
location = ForeignKey(Location)
startTime = DateTimeField(null=True)
endTime = DateTimeField(null=True)
class MappableResponsibility(BaseModel):
@classproperty
def TYPE(cls):
return cls.create_constants('type', 'OWNER')
@classproperty
def STATUS(cls):
return cls.create_constants('status', 'GRANTED', 'PENDING', 'REQUESTED')
responsible = ForeignKey(User, null=True)
mappable = ForeignKey(Mappable)
status = MaxLengthCharField()
date = DateTimeField(null=True, auto_now=True)
type = MaxLengthCharField()
class UserLocation(BaseModel):
user = ForeignKey(User)
location = ForeignKey(Location)
type = MaxLengthCharField()
class ItemRequest(BaseModel):
@classproperty
def FEEDBACK(cls):
return cls.create_constants('feedback', 'OK', 'NO_SHOW', 'NOT_GRANTED')
requester = ForeignKey(User)
requested = ForeignKey(Mappable)
feedback = MaxLengthCharField(null=True, default=None)
| <commit_before>from django.db.models import ForeignKey, DateTimeField, ManyToManyField
from yunity.models.entities import User, Location, Mappable, Message
from yunity.models.utils import BaseModel, MaxLengthCharField
from yunity.utils.decorators import classproperty
class Chat(BaseModel):
participants = ManyToManyField(User)
messages = ManyToManyField(Message)
class MappableLocation(BaseModel):
mappable = ForeignKey(Mappable)
location = ForeignKey(Location)
startTime = DateTimeField(null=True)
endTime = DateTimeField(null=True)
class MappableResponsibility(BaseModel):
@classproperty
def TYPE(cls):
return cls.create_constants('type', 'OWNER')
@classproperty
def STATUS(cls):
return cls.create_constants('status', 'GRANTED', 'PENDING', 'REQUESTED')
responsible = ForeignKey(User, null=True)
mappable = ForeignKey(Mappable)
status = MaxLengthCharField()
date = DateTimeField(null=True, auto_now=True)
type = MaxLengthCharField()
class UserLocation(BaseModel):
user = ForeignKey(User)
location = ForeignKey(Location)
type = MaxLengthCharField()
class ItemRequest(BaseModel):
requester = ForeignKey(User)
requested = ForeignKey(Mappable)
feedback = MaxLengthCharField(null=True, default=None)
<commit_msg>Add some default feedback types for item requests<commit_after> | from django.db.models import ForeignKey, DateTimeField, ManyToManyField
from yunity.models.entities import User, Location, Mappable, Message
from yunity.models.utils import BaseModel, MaxLengthCharField
from yunity.utils.decorators import classproperty
class Chat(BaseModel):
participants = ManyToManyField(User)
messages = ManyToManyField(Message)
class MappableLocation(BaseModel):
mappable = ForeignKey(Mappable)
location = ForeignKey(Location)
startTime = DateTimeField(null=True)
endTime = DateTimeField(null=True)
class MappableResponsibility(BaseModel):
@classproperty
def TYPE(cls):
return cls.create_constants('type', 'OWNER')
@classproperty
def STATUS(cls):
return cls.create_constants('status', 'GRANTED', 'PENDING', 'REQUESTED')
responsible = ForeignKey(User, null=True)
mappable = ForeignKey(Mappable)
status = MaxLengthCharField()
date = DateTimeField(null=True, auto_now=True)
type = MaxLengthCharField()
class UserLocation(BaseModel):
user = ForeignKey(User)
location = ForeignKey(Location)
type = MaxLengthCharField()
class ItemRequest(BaseModel):
@classproperty
def FEEDBACK(cls):
return cls.create_constants('feedback', 'OK', 'NO_SHOW', 'NOT_GRANTED')
requester = ForeignKey(User)
requested = ForeignKey(Mappable)
feedback = MaxLengthCharField(null=True, default=None)
| from django.db.models import ForeignKey, DateTimeField, ManyToManyField
from yunity.models.entities import User, Location, Mappable, Message
from yunity.models.utils import BaseModel, MaxLengthCharField
from yunity.utils.decorators import classproperty
class Chat(BaseModel):
participants = ManyToManyField(User)
messages = ManyToManyField(Message)
class MappableLocation(BaseModel):
mappable = ForeignKey(Mappable)
location = ForeignKey(Location)
startTime = DateTimeField(null=True)
endTime = DateTimeField(null=True)
class MappableResponsibility(BaseModel):
@classproperty
def TYPE(cls):
return cls.create_constants('type', 'OWNER')
@classproperty
def STATUS(cls):
return cls.create_constants('status', 'GRANTED', 'PENDING', 'REQUESTED')
responsible = ForeignKey(User, null=True)
mappable = ForeignKey(Mappable)
status = MaxLengthCharField()
date = DateTimeField(null=True, auto_now=True)
type = MaxLengthCharField()
class UserLocation(BaseModel):
user = ForeignKey(User)
location = ForeignKey(Location)
type = MaxLengthCharField()
class ItemRequest(BaseModel):
requester = ForeignKey(User)
requested = ForeignKey(Mappable)
feedback = MaxLengthCharField(null=True, default=None)
Add some default feedback types for item requestsfrom django.db.models import ForeignKey, DateTimeField, ManyToManyField
from yunity.models.entities import User, Location, Mappable, Message
from yunity.models.utils import BaseModel, MaxLengthCharField
from yunity.utils.decorators import classproperty
class Chat(BaseModel):
participants = ManyToManyField(User)
messages = ManyToManyField(Message)
class MappableLocation(BaseModel):
mappable = ForeignKey(Mappable)
location = ForeignKey(Location)
startTime = DateTimeField(null=True)
endTime = DateTimeField(null=True)
class MappableResponsibility(BaseModel):
@classproperty
def TYPE(cls):
return cls.create_constants('type', 'OWNER')
@classproperty
def STATUS(cls):
return cls.create_constants('status', 'GRANTED', 'PENDING', 'REQUESTED')
responsible = ForeignKey(User, null=True)
mappable = ForeignKey(Mappable)
status = MaxLengthCharField()
date = DateTimeField(null=True, auto_now=True)
type = MaxLengthCharField()
class UserLocation(BaseModel):
user = ForeignKey(User)
location = ForeignKey(Location)
type = MaxLengthCharField()
class ItemRequest(BaseModel):
@classproperty
def FEEDBACK(cls):
return cls.create_constants('feedback', 'OK', 'NO_SHOW', 'NOT_GRANTED')
requester = ForeignKey(User)
requested = ForeignKey(Mappable)
feedback = MaxLengthCharField(null=True, default=None)
| <commit_before>from django.db.models import ForeignKey, DateTimeField, ManyToManyField
from yunity.models.entities import User, Location, Mappable, Message
from yunity.models.utils import BaseModel, MaxLengthCharField
from yunity.utils.decorators import classproperty
class Chat(BaseModel):
participants = ManyToManyField(User)
messages = ManyToManyField(Message)
class MappableLocation(BaseModel):
mappable = ForeignKey(Mappable)
location = ForeignKey(Location)
startTime = DateTimeField(null=True)
endTime = DateTimeField(null=True)
class MappableResponsibility(BaseModel):
@classproperty
def TYPE(cls):
return cls.create_constants('type', 'OWNER')
@classproperty
def STATUS(cls):
return cls.create_constants('status', 'GRANTED', 'PENDING', 'REQUESTED')
responsible = ForeignKey(User, null=True)
mappable = ForeignKey(Mappable)
status = MaxLengthCharField()
date = DateTimeField(null=True, auto_now=True)
type = MaxLengthCharField()
class UserLocation(BaseModel):
user = ForeignKey(User)
location = ForeignKey(Location)
type = MaxLengthCharField()
class ItemRequest(BaseModel):
requester = ForeignKey(User)
requested = ForeignKey(Mappable)
feedback = MaxLengthCharField(null=True, default=None)
<commit_msg>Add some default feedback types for item requests<commit_after>from django.db.models import ForeignKey, DateTimeField, ManyToManyField
from yunity.models.entities import User, Location, Mappable, Message
from yunity.models.utils import BaseModel, MaxLengthCharField
from yunity.utils.decorators import classproperty
class Chat(BaseModel):
participants = ManyToManyField(User)
messages = ManyToManyField(Message)
class MappableLocation(BaseModel):
mappable = ForeignKey(Mappable)
location = ForeignKey(Location)
startTime = DateTimeField(null=True)
endTime = DateTimeField(null=True)
class MappableResponsibility(BaseModel):
@classproperty
def TYPE(cls):
return cls.create_constants('type', 'OWNER')
@classproperty
def STATUS(cls):
return cls.create_constants('status', 'GRANTED', 'PENDING', 'REQUESTED')
responsible = ForeignKey(User, null=True)
mappable = ForeignKey(Mappable)
status = MaxLengthCharField()
date = DateTimeField(null=True, auto_now=True)
type = MaxLengthCharField()
class UserLocation(BaseModel):
user = ForeignKey(User)
location = ForeignKey(Location)
type = MaxLengthCharField()
class ItemRequest(BaseModel):
@classproperty
def FEEDBACK(cls):
return cls.create_constants('feedback', 'OK', 'NO_SHOW', 'NOT_GRANTED')
requester = ForeignKey(User)
requested = ForeignKey(Mappable)
feedback = MaxLengthCharField(null=True, default=None)
|
af4c5a72afb80ff59662cc6992ce3084fed75dfe | node/deduplicate.py | node/deduplicate.py | #!/usr/bin/env python
from nodes import Node
class Deduplicate(Node):
char = "}"
args = 1
results = 2
@Node.test_func([2], [4])
@Node.test_func([1.5], [3])
def double(self, inp: Node.number):
"""inp*2"""
self.results = 1
return inp*2
def func(self, seq:Node.indexable):
"""remove duplicates from seq"""
if isinstance(seq, str):
return "".join(set(seq))
return [type(seq)(set(seq))] | #!/usr/bin/env python
from nodes import Node
class Deduplicate(Node):
char = "}"
args = 1
results = 1
@Node.test_func([2], [4])
@Node.test_func([1.5], [3])
def double(self, inp: Node.number):
"""inp*2"""
return inp*2
@Node.test_func([[1,2,3,1,1]], [[1,2,3]])
@Node.test_func(["hi!!!"], ["hi!"])
def func(self, seq:Node.indexable):
"""remove duplicates from seq"""
seen = set()
seen_add = seen.add
if isinstance(seq, str):
return "".join(x for x in seq if not (x in seen or seen_add(x)))
return[type(seq)([x for x in seq if not (x in seen or seen_add(x))])] | Fix dedupe not preserving order | Fix dedupe not preserving order
| Python | mit | muddyfish/PYKE,muddyfish/PYKE | #!/usr/bin/env python
from nodes import Node
class Deduplicate(Node):
char = "}"
args = 1
results = 2
@Node.test_func([2], [4])
@Node.test_func([1.5], [3])
def double(self, inp: Node.number):
"""inp*2"""
self.results = 1
return inp*2
def func(self, seq:Node.indexable):
"""remove duplicates from seq"""
if isinstance(seq, str):
return "".join(set(seq))
return [type(seq)(set(seq))]Fix dedupe not preserving order | #!/usr/bin/env python
from nodes import Node
class Deduplicate(Node):
char = "}"
args = 1
results = 1
@Node.test_func([2], [4])
@Node.test_func([1.5], [3])
def double(self, inp: Node.number):
"""inp*2"""
return inp*2
@Node.test_func([[1,2,3,1,1]], [[1,2,3]])
@Node.test_func(["hi!!!"], ["hi!"])
def func(self, seq:Node.indexable):
"""remove duplicates from seq"""
seen = set()
seen_add = seen.add
if isinstance(seq, str):
return "".join(x for x in seq if not (x in seen or seen_add(x)))
return[type(seq)([x for x in seq if not (x in seen or seen_add(x))])] | <commit_before>#!/usr/bin/env python
from nodes import Node
class Deduplicate(Node):
char = "}"
args = 1
results = 2
@Node.test_func([2], [4])
@Node.test_func([1.5], [3])
def double(self, inp: Node.number):
"""inp*2"""
self.results = 1
return inp*2
def func(self, seq:Node.indexable):
"""remove duplicates from seq"""
if isinstance(seq, str):
return "".join(set(seq))
return [type(seq)(set(seq))]<commit_msg>Fix dedupe not preserving order<commit_after> | #!/usr/bin/env python
from nodes import Node
class Deduplicate(Node):
char = "}"
args = 1
results = 1
@Node.test_func([2], [4])
@Node.test_func([1.5], [3])
def double(self, inp: Node.number):
"""inp*2"""
return inp*2
@Node.test_func([[1,2,3,1,1]], [[1,2,3]])
@Node.test_func(["hi!!!"], ["hi!"])
def func(self, seq:Node.indexable):
"""remove duplicates from seq"""
seen = set()
seen_add = seen.add
if isinstance(seq, str):
return "".join(x for x in seq if not (x in seen or seen_add(x)))
return[type(seq)([x for x in seq if not (x in seen or seen_add(x))])] | #!/usr/bin/env python
from nodes import Node
class Deduplicate(Node):
char = "}"
args = 1
results = 2
@Node.test_func([2], [4])
@Node.test_func([1.5], [3])
def double(self, inp: Node.number):
"""inp*2"""
self.results = 1
return inp*2
def func(self, seq:Node.indexable):
"""remove duplicates from seq"""
if isinstance(seq, str):
return "".join(set(seq))
return [type(seq)(set(seq))]Fix dedupe not preserving order#!/usr/bin/env python
from nodes import Node
class Deduplicate(Node):
char = "}"
args = 1
results = 1
@Node.test_func([2], [4])
@Node.test_func([1.5], [3])
def double(self, inp: Node.number):
"""inp*2"""
return inp*2
@Node.test_func([[1,2,3,1,1]], [[1,2,3]])
@Node.test_func(["hi!!!"], ["hi!"])
def func(self, seq:Node.indexable):
"""remove duplicates from seq"""
seen = set()
seen_add = seen.add
if isinstance(seq, str):
return "".join(x for x in seq if not (x in seen or seen_add(x)))
return[type(seq)([x for x in seq if not (x in seen or seen_add(x))])] | <commit_before>#!/usr/bin/env python
from nodes import Node
class Deduplicate(Node):
char = "}"
args = 1
results = 2
@Node.test_func([2], [4])
@Node.test_func([1.5], [3])
def double(self, inp: Node.number):
"""inp*2"""
self.results = 1
return inp*2
def func(self, seq:Node.indexable):
"""remove duplicates from seq"""
if isinstance(seq, str):
return "".join(set(seq))
return [type(seq)(set(seq))]<commit_msg>Fix dedupe not preserving order<commit_after>#!/usr/bin/env python
from nodes import Node
class Deduplicate(Node):
char = "}"
args = 1
results = 1
@Node.test_func([2], [4])
@Node.test_func([1.5], [3])
def double(self, inp: Node.number):
"""inp*2"""
return inp*2
@Node.test_func([[1,2,3,1,1]], [[1,2,3]])
@Node.test_func(["hi!!!"], ["hi!"])
def func(self, seq:Node.indexable):
"""remove duplicates from seq"""
seen = set()
seen_add = seen.add
if isinstance(seq, str):
return "".join(x for x in seq if not (x in seen or seen_add(x)))
return[type(seq)([x for x in seq if not (x in seen or seen_add(x))])] |
05c319f868215f832e97577f5e158edf82fab074 | markdown/__version__.py | markdown/__version__.py | #
# markdown/__version__.py
#
# version_info should conform to PEP 386
# (major, minor, micro, alpha/beta/rc/final, #)
# (1, 1, 2, 'alpha', 0) => "1.1.2.dev"
# (1, 2, 0, 'beta', 2) => "1.2b2"
version_info = (2, 6, 0, 'zds', 7)
def _get_version():
" Returns a PEP 386-compliant version number from version_info. "
assert len(version_info) == 5
assert version_info[3] in ('alpha', 'beta', 'rc', 'final', 'zds')
parts = 2 if version_info[2] == 0 else 3
main = '.'.join(map(str, version_info[:parts]))
sub = ''
if version_info[3] == 'alpha' and version_info[4] == 0:
# TODO: maybe append some sort of git info here??
sub = '.dev'
elif version_info[3] != 'final':
mapping = {'alpha': 'a', 'beta': 'b', 'rc': 'c', 'zds': 'post'}
sub = mapping[version_info[3]] + str(version_info[4])
return str(main + sub)
version = _get_version()
| #
# markdown/__version__.py
#
# version_info should conform to PEP 386
# (major, minor, micro, alpha/beta/rc/final, #)
# (1, 1, 2, 'alpha', 0) => "1.1.2.dev"
# (1, 2, 0, 'beta', 2) => "1.2b2"
version_info = (2, 6, 0, 'zds', 8)
def _get_version():
" Returns a PEP 386-compliant version number from version_info. "
assert len(version_info) == 5
assert version_info[3] in ('alpha', 'beta', 'rc', 'final', 'zds')
parts = 2 if version_info[2] == 0 else 3
main = '.'.join(map(str, version_info[:parts]))
sub = ''
if version_info[3] == 'alpha' and version_info[4] == 0:
# TODO: maybe append some sort of git info here??
sub = '.dev'
elif version_info[3] != 'final':
mapping = {'alpha': 'a', 'beta': 'b', 'rc': 'c', 'zds': 'post'}
sub = mapping[version_info[3]] + str(version_info[4])
return str(main + sub)
version = _get_version()
| Change version for next release | Change version for next release | Python | bsd-3-clause | zestedesavoir/Python-ZMarkdown,Situphen/Python-ZMarkdown,zestedesavoir/Python-ZMarkdown,Situphen/Python-ZMarkdown,zestedesavoir/Python-ZMarkdown,Situphen/Python-ZMarkdown | #
# markdown/__version__.py
#
# version_info should conform to PEP 386
# (major, minor, micro, alpha/beta/rc/final, #)
# (1, 1, 2, 'alpha', 0) => "1.1.2.dev"
# (1, 2, 0, 'beta', 2) => "1.2b2"
version_info = (2, 6, 0, 'zds', 7)
def _get_version():
" Returns a PEP 386-compliant version number from version_info. "
assert len(version_info) == 5
assert version_info[3] in ('alpha', 'beta', 'rc', 'final', 'zds')
parts = 2 if version_info[2] == 0 else 3
main = '.'.join(map(str, version_info[:parts]))
sub = ''
if version_info[3] == 'alpha' and version_info[4] == 0:
# TODO: maybe append some sort of git info here??
sub = '.dev'
elif version_info[3] != 'final':
mapping = {'alpha': 'a', 'beta': 'b', 'rc': 'c', 'zds': 'post'}
sub = mapping[version_info[3]] + str(version_info[4])
return str(main + sub)
version = _get_version()
Change version for next release | #
# markdown/__version__.py
#
# version_info should conform to PEP 386
# (major, minor, micro, alpha/beta/rc/final, #)
# (1, 1, 2, 'alpha', 0) => "1.1.2.dev"
# (1, 2, 0, 'beta', 2) => "1.2b2"
version_info = (2, 6, 0, 'zds', 8)
def _get_version():
" Returns a PEP 386-compliant version number from version_info. "
assert len(version_info) == 5
assert version_info[3] in ('alpha', 'beta', 'rc', 'final', 'zds')
parts = 2 if version_info[2] == 0 else 3
main = '.'.join(map(str, version_info[:parts]))
sub = ''
if version_info[3] == 'alpha' and version_info[4] == 0:
# TODO: maybe append some sort of git info here??
sub = '.dev'
elif version_info[3] != 'final':
mapping = {'alpha': 'a', 'beta': 'b', 'rc': 'c', 'zds': 'post'}
sub = mapping[version_info[3]] + str(version_info[4])
return str(main + sub)
version = _get_version()
| <commit_before>#
# markdown/__version__.py
#
# version_info should conform to PEP 386
# (major, minor, micro, alpha/beta/rc/final, #)
# (1, 1, 2, 'alpha', 0) => "1.1.2.dev"
# (1, 2, 0, 'beta', 2) => "1.2b2"
version_info = (2, 6, 0, 'zds', 7)
def _get_version():
" Returns a PEP 386-compliant version number from version_info. "
assert len(version_info) == 5
assert version_info[3] in ('alpha', 'beta', 'rc', 'final', 'zds')
parts = 2 if version_info[2] == 0 else 3
main = '.'.join(map(str, version_info[:parts]))
sub = ''
if version_info[3] == 'alpha' and version_info[4] == 0:
# TODO: maybe append some sort of git info here??
sub = '.dev'
elif version_info[3] != 'final':
mapping = {'alpha': 'a', 'beta': 'b', 'rc': 'c', 'zds': 'post'}
sub = mapping[version_info[3]] + str(version_info[4])
return str(main + sub)
version = _get_version()
<commit_msg>Change version for next release<commit_after> | #
# markdown/__version__.py
#
# version_info should conform to PEP 386
# (major, minor, micro, alpha/beta/rc/final, #)
# (1, 1, 2, 'alpha', 0) => "1.1.2.dev"
# (1, 2, 0, 'beta', 2) => "1.2b2"
version_info = (2, 6, 0, 'zds', 8)
def _get_version():
" Returns a PEP 386-compliant version number from version_info. "
assert len(version_info) == 5
assert version_info[3] in ('alpha', 'beta', 'rc', 'final', 'zds')
parts = 2 if version_info[2] == 0 else 3
main = '.'.join(map(str, version_info[:parts]))
sub = ''
if version_info[3] == 'alpha' and version_info[4] == 0:
# TODO: maybe append some sort of git info here??
sub = '.dev'
elif version_info[3] != 'final':
mapping = {'alpha': 'a', 'beta': 'b', 'rc': 'c', 'zds': 'post'}
sub = mapping[version_info[3]] + str(version_info[4])
return str(main + sub)
version = _get_version()
| #
# markdown/__version__.py
#
# version_info should conform to PEP 386
# (major, minor, micro, alpha/beta/rc/final, #)
# (1, 1, 2, 'alpha', 0) => "1.1.2.dev"
# (1, 2, 0, 'beta', 2) => "1.2b2"
version_info = (2, 6, 0, 'zds', 7)
def _get_version():
" Returns a PEP 386-compliant version number from version_info. "
assert len(version_info) == 5
assert version_info[3] in ('alpha', 'beta', 'rc', 'final', 'zds')
parts = 2 if version_info[2] == 0 else 3
main = '.'.join(map(str, version_info[:parts]))
sub = ''
if version_info[3] == 'alpha' and version_info[4] == 0:
# TODO: maybe append some sort of git info here??
sub = '.dev'
elif version_info[3] != 'final':
mapping = {'alpha': 'a', 'beta': 'b', 'rc': 'c', 'zds': 'post'}
sub = mapping[version_info[3]] + str(version_info[4])
return str(main + sub)
version = _get_version()
Change version for next release#
# markdown/__version__.py
#
# version_info should conform to PEP 386
# (major, minor, micro, alpha/beta/rc/final, #)
# (1, 1, 2, 'alpha', 0) => "1.1.2.dev"
# (1, 2, 0, 'beta', 2) => "1.2b2"
version_info = (2, 6, 0, 'zds', 8)
def _get_version():
" Returns a PEP 386-compliant version number from version_info. "
assert len(version_info) == 5
assert version_info[3] in ('alpha', 'beta', 'rc', 'final', 'zds')
parts = 2 if version_info[2] == 0 else 3
main = '.'.join(map(str, version_info[:parts]))
sub = ''
if version_info[3] == 'alpha' and version_info[4] == 0:
# TODO: maybe append some sort of git info here??
sub = '.dev'
elif version_info[3] != 'final':
mapping = {'alpha': 'a', 'beta': 'b', 'rc': 'c', 'zds': 'post'}
sub = mapping[version_info[3]] + str(version_info[4])
return str(main + sub)
version = _get_version()
| <commit_before>#
# markdown/__version__.py
#
# version_info should conform to PEP 386
# (major, minor, micro, alpha/beta/rc/final, #)
# (1, 1, 2, 'alpha', 0) => "1.1.2.dev"
# (1, 2, 0, 'beta', 2) => "1.2b2"
version_info = (2, 6, 0, 'zds', 7)
def _get_version():
" Returns a PEP 386-compliant version number from version_info. "
assert len(version_info) == 5
assert version_info[3] in ('alpha', 'beta', 'rc', 'final', 'zds')
parts = 2 if version_info[2] == 0 else 3
main = '.'.join(map(str, version_info[:parts]))
sub = ''
if version_info[3] == 'alpha' and version_info[4] == 0:
# TODO: maybe append some sort of git info here??
sub = '.dev'
elif version_info[3] != 'final':
mapping = {'alpha': 'a', 'beta': 'b', 'rc': 'c', 'zds': 'post'}
sub = mapping[version_info[3]] + str(version_info[4])
return str(main + sub)
version = _get_version()
<commit_msg>Change version for next release<commit_after>#
# markdown/__version__.py
#
# version_info should conform to PEP 386
# (major, minor, micro, alpha/beta/rc/final, #)
# (1, 1, 2, 'alpha', 0) => "1.1.2.dev"
# (1, 2, 0, 'beta', 2) => "1.2b2"
version_info = (2, 6, 0, 'zds', 8)
def _get_version():
" Returns a PEP 386-compliant version number from version_info. "
assert len(version_info) == 5
assert version_info[3] in ('alpha', 'beta', 'rc', 'final', 'zds')
parts = 2 if version_info[2] == 0 else 3
main = '.'.join(map(str, version_info[:parts]))
sub = ''
if version_info[3] == 'alpha' and version_info[4] == 0:
# TODO: maybe append some sort of git info here??
sub = '.dev'
elif version_info[3] != 'final':
mapping = {'alpha': 'a', 'beta': 'b', 'rc': 'c', 'zds': 'post'}
sub = mapping[version_info[3]] + str(version_info[4])
return str(main + sub)
version = _get_version()
|
ab10f3d134065047a7260662d3c39295904795b8 | migration/versions/001_initial_migration.py | migration/versions/001_initial_migration.py | from __future__ import print_function
from getpass import getpass
import readline
import sys
from sqlalchemy import *
from migrate import *
from migrate.changeset.constraint import ForeignKeyConstraint
import annotateit
from annotateit import db
from annotateit.model import Consumer, User
meta = MetaData()
consumer = Table('consumer', meta,
Column('id', Integer, primary_key=True, nullable=False),
Column('key', String),
Column('secret', String),
Column('ttl', Integer),
Column('created_at', DateTime),
Column('updated_at', DateTime),
Column('user_id', Integer),
)
user = Table('user', meta,
Column('id', Integer, primary_key=True, nullable=False),
Column('username', String),
Column('email', String),
Column('password_hash', String),
Column('created_at', DateTime),
Column('updated_at', DateTime),
)
consumer_user_id_fkey = ForeignKeyConstraint([consumer.c.user_id], [user.c.id])
def upgrade(migrate_engine):
meta.bind = migrate_engine
consumer.create()
user.create()
consumer_user_id_fkey.create()
def downgrade(migrate_engine):
meta.bind = migrate_engine
consumer_user_id_fkey.create()
user.drop()
consumer.drop()
| from sqlalchemy import *
from migrate import *
import annotateit
from annotateit import db
from annotateit.model import Consumer, User
meta = MetaData()
consumer = Table('consumer', meta,
Column('id', Integer, primary_key=True, nullable=False),
Column('key', String),
Column('secret', String),
Column('ttl', Integer),
Column('created_at', DateTime),
Column('updated_at', DateTime),
Column('user_id', Integer, ForeignKey('user.id')),
)
user = Table('user', meta,
Column('id', Integer, primary_key=True, nullable=False),
Column('username', String),
Column('email', String),
Column('password_hash', String),
Column('created_at', DateTime),
Column('updated_at', DateTime),
)
def upgrade(migrate_engine):
meta.bind = migrate_engine
user.create()
consumer.create()
def downgrade(migrate_engine):
meta.bind = migrate_engine
consumer.drop()
user.drop()
| Add fkey constraints at the same time | Add fkey constraints at the same time
| Python | agpl-3.0 | openannotation/annotateit,openannotation/annotateit | from __future__ import print_function
from getpass import getpass
import readline
import sys
from sqlalchemy import *
from migrate import *
from migrate.changeset.constraint import ForeignKeyConstraint
import annotateit
from annotateit import db
from annotateit.model import Consumer, User
meta = MetaData()
consumer = Table('consumer', meta,
Column('id', Integer, primary_key=True, nullable=False),
Column('key', String),
Column('secret', String),
Column('ttl', Integer),
Column('created_at', DateTime),
Column('updated_at', DateTime),
Column('user_id', Integer),
)
user = Table('user', meta,
Column('id', Integer, primary_key=True, nullable=False),
Column('username', String),
Column('email', String),
Column('password_hash', String),
Column('created_at', DateTime),
Column('updated_at', DateTime),
)
consumer_user_id_fkey = ForeignKeyConstraint([consumer.c.user_id], [user.c.id])
def upgrade(migrate_engine):
meta.bind = migrate_engine
consumer.create()
user.create()
consumer_user_id_fkey.create()
def downgrade(migrate_engine):
meta.bind = migrate_engine
consumer_user_id_fkey.create()
user.drop()
consumer.drop()
Add fkey constraints at the same time | from sqlalchemy import *
from migrate import *
import annotateit
from annotateit import db
from annotateit.model import Consumer, User
meta = MetaData()
consumer = Table('consumer', meta,
Column('id', Integer, primary_key=True, nullable=False),
Column('key', String),
Column('secret', String),
Column('ttl', Integer),
Column('created_at', DateTime),
Column('updated_at', DateTime),
Column('user_id', Integer, ForeignKey('user.id')),
)
user = Table('user', meta,
Column('id', Integer, primary_key=True, nullable=False),
Column('username', String),
Column('email', String),
Column('password_hash', String),
Column('created_at', DateTime),
Column('updated_at', DateTime),
)
def upgrade(migrate_engine):
meta.bind = migrate_engine
user.create()
consumer.create()
def downgrade(migrate_engine):
meta.bind = migrate_engine
consumer.drop()
user.drop()
| <commit_before>from __future__ import print_function
from getpass import getpass
import readline
import sys
from sqlalchemy import *
from migrate import *
from migrate.changeset.constraint import ForeignKeyConstraint
import annotateit
from annotateit import db
from annotateit.model import Consumer, User
meta = MetaData()
consumer = Table('consumer', meta,
Column('id', Integer, primary_key=True, nullable=False),
Column('key', String),
Column('secret', String),
Column('ttl', Integer),
Column('created_at', DateTime),
Column('updated_at', DateTime),
Column('user_id', Integer),
)
user = Table('user', meta,
Column('id', Integer, primary_key=True, nullable=False),
Column('username', String),
Column('email', String),
Column('password_hash', String),
Column('created_at', DateTime),
Column('updated_at', DateTime),
)
consumer_user_id_fkey = ForeignKeyConstraint([consumer.c.user_id], [user.c.id])
def upgrade(migrate_engine):
meta.bind = migrate_engine
consumer.create()
user.create()
consumer_user_id_fkey.create()
def downgrade(migrate_engine):
meta.bind = migrate_engine
consumer_user_id_fkey.create()
user.drop()
consumer.drop()
<commit_msg>Add fkey constraints at the same time<commit_after> | from sqlalchemy import *
from migrate import *
import annotateit
from annotateit import db
from annotateit.model import Consumer, User
meta = MetaData()
consumer = Table('consumer', meta,
Column('id', Integer, primary_key=True, nullable=False),
Column('key', String),
Column('secret', String),
Column('ttl', Integer),
Column('created_at', DateTime),
Column('updated_at', DateTime),
Column('user_id', Integer, ForeignKey('user.id')),
)
user = Table('user', meta,
Column('id', Integer, primary_key=True, nullable=False),
Column('username', String),
Column('email', String),
Column('password_hash', String),
Column('created_at', DateTime),
Column('updated_at', DateTime),
)
def upgrade(migrate_engine):
meta.bind = migrate_engine
user.create()
consumer.create()
def downgrade(migrate_engine):
meta.bind = migrate_engine
consumer.drop()
user.drop()
| from __future__ import print_function
from getpass import getpass
import readline
import sys
from sqlalchemy import *
from migrate import *
from migrate.changeset.constraint import ForeignKeyConstraint
import annotateit
from annotateit import db
from annotateit.model import Consumer, User
meta = MetaData()
consumer = Table('consumer', meta,
Column('id', Integer, primary_key=True, nullable=False),
Column('key', String),
Column('secret', String),
Column('ttl', Integer),
Column('created_at', DateTime),
Column('updated_at', DateTime),
Column('user_id', Integer),
)
user = Table('user', meta,
Column('id', Integer, primary_key=True, nullable=False),
Column('username', String),
Column('email', String),
Column('password_hash', String),
Column('created_at', DateTime),
Column('updated_at', DateTime),
)
consumer_user_id_fkey = ForeignKeyConstraint([consumer.c.user_id], [user.c.id])
def upgrade(migrate_engine):
meta.bind = migrate_engine
consumer.create()
user.create()
consumer_user_id_fkey.create()
def downgrade(migrate_engine):
meta.bind = migrate_engine
consumer_user_id_fkey.create()
user.drop()
consumer.drop()
Add fkey constraints at the same timefrom sqlalchemy import *
from migrate import *
import annotateit
from annotateit import db
from annotateit.model import Consumer, User
meta = MetaData()
consumer = Table('consumer', meta,
Column('id', Integer, primary_key=True, nullable=False),
Column('key', String),
Column('secret', String),
Column('ttl', Integer),
Column('created_at', DateTime),
Column('updated_at', DateTime),
Column('user_id', Integer, ForeignKey('user.id')),
)
user = Table('user', meta,
Column('id', Integer, primary_key=True, nullable=False),
Column('username', String),
Column('email', String),
Column('password_hash', String),
Column('created_at', DateTime),
Column('updated_at', DateTime),
)
def upgrade(migrate_engine):
meta.bind = migrate_engine
user.create()
consumer.create()
def downgrade(migrate_engine):
meta.bind = migrate_engine
consumer.drop()
user.drop()
| <commit_before>from __future__ import print_function
from getpass import getpass
import readline
import sys
from sqlalchemy import *
from migrate import *
from migrate.changeset.constraint import ForeignKeyConstraint
import annotateit
from annotateit import db
from annotateit.model import Consumer, User
meta = MetaData()
consumer = Table('consumer', meta,
Column('id', Integer, primary_key=True, nullable=False),
Column('key', String),
Column('secret', String),
Column('ttl', Integer),
Column('created_at', DateTime),
Column('updated_at', DateTime),
Column('user_id', Integer),
)
user = Table('user', meta,
Column('id', Integer, primary_key=True, nullable=False),
Column('username', String),
Column('email', String),
Column('password_hash', String),
Column('created_at', DateTime),
Column('updated_at', DateTime),
)
consumer_user_id_fkey = ForeignKeyConstraint([consumer.c.user_id], [user.c.id])
def upgrade(migrate_engine):
meta.bind = migrate_engine
consumer.create()
user.create()
consumer_user_id_fkey.create()
def downgrade(migrate_engine):
meta.bind = migrate_engine
consumer_user_id_fkey.create()
user.drop()
consumer.drop()
<commit_msg>Add fkey constraints at the same time<commit_after>from sqlalchemy import *
from migrate import *
import annotateit
from annotateit import db
from annotateit.model import Consumer, User
meta = MetaData()
consumer = Table('consumer', meta,
Column('id', Integer, primary_key=True, nullable=False),
Column('key', String),
Column('secret', String),
Column('ttl', Integer),
Column('created_at', DateTime),
Column('updated_at', DateTime),
Column('user_id', Integer, ForeignKey('user.id')),
)
user = Table('user', meta,
Column('id', Integer, primary_key=True, nullable=False),
Column('username', String),
Column('email', String),
Column('password_hash', String),
Column('created_at', DateTime),
Column('updated_at', DateTime),
)
def upgrade(migrate_engine):
meta.bind = migrate_engine
user.create()
consumer.create()
def downgrade(migrate_engine):
meta.bind = migrate_engine
consumer.drop()
user.drop()
|
1421866ac3c4e4f1f09d17019d058aa903597df5 | modules/menus_reader.py | modules/menus_reader.py | # -*- coding: utf-8 -*-
from json_reader import *
from config import *
def get_menus_data():
old_data = read_json_from_file(filenames["menus"])
if old_data == None or type(old_data) is not dict: # rewrite old_data and create new recipe dictionary
# initialize new dict
old_data = {}
old_data["menus"] = {}
elif "menus" not in old_data and type(old_data) is dict: # save other data (maybe worthless)
# add new row: recipes
old_data["menus"] = {}
return old_data
def get_menus():
data = get_menus_data()
return data["menus"]
def get_menu(index): #get recipe with spesific index
pass
#return get_menus()[index] | # -*- coding: utf-8 -*-
from json_reader import *
from config import *
def get_menus_data():
old_data = read_json_from_file(filenames["menus"])
if old_data == None or type(old_data) is not dict: # rewrite old_data and create new recipe dictionary
# initialize new dict
old_data = {}
old_data["menus"] = {}
elif "menus" not in old_data and type(old_data) is dict: # save other data (maybe worthless)
# add new row: recipes
old_data["menus"] = {}
return old_data
def get_menus():
data = get_menus_data()
return data["menus"]
def get_menu(index): #get recipe with spesific index
return get_menus()[index]
def is_week_menu_created(week):
return week in get_menus() # True/False | Add new feature: find out is current week menu created already | Add new feature: find out is current week menu created already
| Python | mit | Jntz/RuokalistaCommandLine | # -*- coding: utf-8 -*-
from json_reader import *
from config import *
def get_menus_data():
old_data = read_json_from_file(filenames["menus"])
if old_data == None or type(old_data) is not dict: # rewrite old_data and create new recipe dictionary
# initialize new dict
old_data = {}
old_data["menus"] = {}
elif "menus" not in old_data and type(old_data) is dict: # save other data (maybe worthless)
# add new row: recipes
old_data["menus"] = {}
return old_data
def get_menus():
data = get_menus_data()
return data["menus"]
def get_menu(index): #get recipe with spesific index
pass
#return get_menus()[index]Add new feature: find out is current week menu created already | # -*- coding: utf-8 -*-
from json_reader import *
from config import *
def get_menus_data():
old_data = read_json_from_file(filenames["menus"])
if old_data == None or type(old_data) is not dict: # rewrite old_data and create new recipe dictionary
# initialize new dict
old_data = {}
old_data["menus"] = {}
elif "menus" not in old_data and type(old_data) is dict: # save other data (maybe worthless)
# add new row: recipes
old_data["menus"] = {}
return old_data
def get_menus():
data = get_menus_data()
return data["menus"]
def get_menu(index): #get recipe with spesific index
return get_menus()[index]
def is_week_menu_created(week):
return week in get_menus() # True/False | <commit_before># -*- coding: utf-8 -*-
from json_reader import *
from config import *
def get_menus_data():
old_data = read_json_from_file(filenames["menus"])
if old_data == None or type(old_data) is not dict: # rewrite old_data and create new recipe dictionary
# initialize new dict
old_data = {}
old_data["menus"] = {}
elif "menus" not in old_data and type(old_data) is dict: # save other data (maybe worthless)
# add new row: recipes
old_data["menus"] = {}
return old_data
def get_menus():
data = get_menus_data()
return data["menus"]
def get_menu(index): #get recipe with spesific index
pass
#return get_menus()[index]<commit_msg>Add new feature: find out is current week menu created already<commit_after> | # -*- coding: utf-8 -*-
from json_reader import *
from config import *
def get_menus_data():
old_data = read_json_from_file(filenames["menus"])
if old_data == None or type(old_data) is not dict: # rewrite old_data and create new recipe dictionary
# initialize new dict
old_data = {}
old_data["menus"] = {}
elif "menus" not in old_data and type(old_data) is dict: # save other data (maybe worthless)
# add new row: recipes
old_data["menus"] = {}
return old_data
def get_menus():
data = get_menus_data()
return data["menus"]
def get_menu(index): #get recipe with spesific index
return get_menus()[index]
def is_week_menu_created(week):
return week in get_menus() # True/False | # -*- coding: utf-8 -*-
from json_reader import *
from config import *
def get_menus_data():
old_data = read_json_from_file(filenames["menus"])
if old_data == None or type(old_data) is not dict: # rewrite old_data and create new recipe dictionary
# initialize new dict
old_data = {}
old_data["menus"] = {}
elif "menus" not in old_data and type(old_data) is dict: # save other data (maybe worthless)
# add new row: recipes
old_data["menus"] = {}
return old_data
def get_menus():
data = get_menus_data()
return data["menus"]
def get_menu(index): #get recipe with spesific index
pass
#return get_menus()[index]Add new feature: find out is current week menu created already# -*- coding: utf-8 -*-
from json_reader import *
from config import *
def get_menus_data():
old_data = read_json_from_file(filenames["menus"])
if old_data == None or type(old_data) is not dict: # rewrite old_data and create new recipe dictionary
# initialize new dict
old_data = {}
old_data["menus"] = {}
elif "menus" not in old_data and type(old_data) is dict: # save other data (maybe worthless)
# add new row: recipes
old_data["menus"] = {}
return old_data
def get_menus():
data = get_menus_data()
return data["menus"]
def get_menu(index): #get recipe with spesific index
return get_menus()[index]
def is_week_menu_created(week):
return week in get_menus() # True/False | <commit_before># -*- coding: utf-8 -*-
from json_reader import *
from config import *
def get_menus_data():
old_data = read_json_from_file(filenames["menus"])
if old_data == None or type(old_data) is not dict: # rewrite old_data and create new recipe dictionary
# initialize new dict
old_data = {}
old_data["menus"] = {}
elif "menus" not in old_data and type(old_data) is dict: # save other data (maybe worthless)
# add new row: recipes
old_data["menus"] = {}
return old_data
def get_menus():
data = get_menus_data()
return data["menus"]
def get_menu(index): #get recipe with spesific index
pass
#return get_menus()[index]<commit_msg>Add new feature: find out is current week menu created already<commit_after># -*- coding: utf-8 -*-
from json_reader import *
from config import *
def get_menus_data():
old_data = read_json_from_file(filenames["menus"])
if old_data == None or type(old_data) is not dict: # rewrite old_data and create new recipe dictionary
# initialize new dict
old_data = {}
old_data["menus"] = {}
elif "menus" not in old_data and type(old_data) is dict: # save other data (maybe worthless)
# add new row: recipes
old_data["menus"] = {}
return old_data
def get_menus():
data = get_menus_data()
return data["menus"]
def get_menu(index): #get recipe with spesific index
return get_menus()[index]
def is_week_menu_created(week):
return week in get_menus() # True/False |
10dc027ee15428d7ca210e0b74e5ae9274de0fa8 | lianXiangCi.py | lianXiangCi.py | #coding:utf-8
import urllib
import urllib2
import re
from random import choice
ipList=['120.76.115.134:80','222.83.14.145:3128','119.188.94.145:80']
thisIp=choice(ipList)
keyWord=urllib.quote('科学')
url='http://search.sina.com.cn/iframe/suggest/index.php?q='+keyWord
headers={
'Get':url,
'Host':'search.sina.com.cn',
'Referer':'http://search.sina.com.cn/',
'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.97 Safari/537.36'
}
proxy_support = urllib2.ProxyHandler({'http': 'http://'+thisIp})
opener=urllib2.build_opener(proxy_support)
urllib2.install_opener(opener)
req=urllib2.Request(url)
for key in headers:
req.add_header(key,headers[key])
html=urllib2.urlopen(req).read()
file=open('C:\Users\Ryan\Desktop\lianXC.txt','w')
file.write(html)
| #coding:utf-8
import urllib
import urllib2
import re
from random import choice
ipList=['120.76.115.134:80','222.83.14.145:3128','119.188.94.145:80']
thisIp=choice(ipList)
input = raw_input("Please input your key words:")
keyWord=urllib.quote(input)
url='http://search.sina.com.cn/iframe/suggest/index.php?q='+keyWord
headers={
'Get':url,
'Host':'search.sina.com.cn',
'Referer':'http://search.sina.com.cn/',
'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.97 Safari/537.36'
}
proxy_support = urllib2.ProxyHandler({'http': 'http://'+thisIp})
opener=urllib2.build_opener(proxy_support)
urllib2.install_opener(opener)
req=urllib2.Request(url)
for key in headers:
req.add_header(key,headers[key])
html=urllib2.urlopen(req).read()
file=open('C:\Users\Ryan\Desktop\lianXC.txt','w')
file.write(html)
| Use raw_input instead of the unmodified words | Use raw_input instead of the unmodified words | Python | mit | YChrisZhang/PythonCrawler | #coding:utf-8
import urllib
import urllib2
import re
from random import choice
ipList=['120.76.115.134:80','222.83.14.145:3128','119.188.94.145:80']
thisIp=choice(ipList)
keyWord=urllib.quote('科学')
url='http://search.sina.com.cn/iframe/suggest/index.php?q='+keyWord
headers={
'Get':url,
'Host':'search.sina.com.cn',
'Referer':'http://search.sina.com.cn/',
'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.97 Safari/537.36'
}
proxy_support = urllib2.ProxyHandler({'http': 'http://'+thisIp})
opener=urllib2.build_opener(proxy_support)
urllib2.install_opener(opener)
req=urllib2.Request(url)
for key in headers:
req.add_header(key,headers[key])
html=urllib2.urlopen(req).read()
file=open('C:\Users\Ryan\Desktop\lianXC.txt','w')
file.write(html)
Use raw_input instead of the unmodified words | #coding:utf-8
import urllib
import urllib2
import re
from random import choice
ipList=['120.76.115.134:80','222.83.14.145:3128','119.188.94.145:80']
thisIp=choice(ipList)
input = raw_input("Please input your key words:")
keyWord=urllib.quote(input)
url='http://search.sina.com.cn/iframe/suggest/index.php?q='+keyWord
headers={
'Get':url,
'Host':'search.sina.com.cn',
'Referer':'http://search.sina.com.cn/',
'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.97 Safari/537.36'
}
proxy_support = urllib2.ProxyHandler({'http': 'http://'+thisIp})
opener=urllib2.build_opener(proxy_support)
urllib2.install_opener(opener)
req=urllib2.Request(url)
for key in headers:
req.add_header(key,headers[key])
html=urllib2.urlopen(req).read()
file=open('C:\Users\Ryan\Desktop\lianXC.txt','w')
file.write(html)
| <commit_before>#coding:utf-8
import urllib
import urllib2
import re
from random import choice
ipList=['120.76.115.134:80','222.83.14.145:3128','119.188.94.145:80']
thisIp=choice(ipList)
keyWord=urllib.quote('科学')
url='http://search.sina.com.cn/iframe/suggest/index.php?q='+keyWord
headers={
'Get':url,
'Host':'search.sina.com.cn',
'Referer':'http://search.sina.com.cn/',
'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.97 Safari/537.36'
}
proxy_support = urllib2.ProxyHandler({'http': 'http://'+thisIp})
opener=urllib2.build_opener(proxy_support)
urllib2.install_opener(opener)
req=urllib2.Request(url)
for key in headers:
req.add_header(key,headers[key])
html=urllib2.urlopen(req).read()
file=open('C:\Users\Ryan\Desktop\lianXC.txt','w')
file.write(html)
<commit_msg>Use raw_input instead of the unmodified words<commit_after> | #coding:utf-8
import urllib
import urllib2
import re
from random import choice
ipList=['120.76.115.134:80','222.83.14.145:3128','119.188.94.145:80']
thisIp=choice(ipList)
input = raw_input("Please input your key words:")
keyWord=urllib.quote(input)
url='http://search.sina.com.cn/iframe/suggest/index.php?q='+keyWord
headers={
'Get':url,
'Host':'search.sina.com.cn',
'Referer':'http://search.sina.com.cn/',
'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.97 Safari/537.36'
}
proxy_support = urllib2.ProxyHandler({'http': 'http://'+thisIp})
opener=urllib2.build_opener(proxy_support)
urllib2.install_opener(opener)
req=urllib2.Request(url)
for key in headers:
req.add_header(key,headers[key])
html=urllib2.urlopen(req).read()
file=open('C:\Users\Ryan\Desktop\lianXC.txt','w')
file.write(html)
| #coding:utf-8
import urllib
import urllib2
import re
from random import choice
ipList=['120.76.115.134:80','222.83.14.145:3128','119.188.94.145:80']
thisIp=choice(ipList)
keyWord=urllib.quote('科学')
url='http://search.sina.com.cn/iframe/suggest/index.php?q='+keyWord
headers={
'Get':url,
'Host':'search.sina.com.cn',
'Referer':'http://search.sina.com.cn/',
'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.97 Safari/537.36'
}
proxy_support = urllib2.ProxyHandler({'http': 'http://'+thisIp})
opener=urllib2.build_opener(proxy_support)
urllib2.install_opener(opener)
req=urllib2.Request(url)
for key in headers:
req.add_header(key,headers[key])
html=urllib2.urlopen(req).read()
file=open('C:\Users\Ryan\Desktop\lianXC.txt','w')
file.write(html)
Use raw_input instead of the unmodified words#coding:utf-8
import urllib
import urllib2
import re
from random import choice
ipList=['120.76.115.134:80','222.83.14.145:3128','119.188.94.145:80']
thisIp=choice(ipList)
input = raw_input("Please input your key words:")
keyWord=urllib.quote(input)
url='http://search.sina.com.cn/iframe/suggest/index.php?q='+keyWord
headers={
'Get':url,
'Host':'search.sina.com.cn',
'Referer':'http://search.sina.com.cn/',
'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.97 Safari/537.36'
}
proxy_support = urllib2.ProxyHandler({'http': 'http://'+thisIp})
opener=urllib2.build_opener(proxy_support)
urllib2.install_opener(opener)
req=urllib2.Request(url)
for key in headers:
req.add_header(key,headers[key])
html=urllib2.urlopen(req).read()
file=open('C:\Users\Ryan\Desktop\lianXC.txt','w')
file.write(html)
| <commit_before>#coding:utf-8
import urllib
import urllib2
import re
from random import choice
ipList=['120.76.115.134:80','222.83.14.145:3128','119.188.94.145:80']
thisIp=choice(ipList)
keyWord=urllib.quote('科学')
url='http://search.sina.com.cn/iframe/suggest/index.php?q='+keyWord
headers={
'Get':url,
'Host':'search.sina.com.cn',
'Referer':'http://search.sina.com.cn/',
'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.97 Safari/537.36'
}
proxy_support = urllib2.ProxyHandler({'http': 'http://'+thisIp})
opener=urllib2.build_opener(proxy_support)
urllib2.install_opener(opener)
req=urllib2.Request(url)
for key in headers:
req.add_header(key,headers[key])
html=urllib2.urlopen(req).read()
file=open('C:\Users\Ryan\Desktop\lianXC.txt','w')
file.write(html)
<commit_msg>Use raw_input instead of the unmodified words<commit_after>#coding:utf-8
import urllib
import urllib2
import re
from random import choice
ipList=['120.76.115.134:80','222.83.14.145:3128','119.188.94.145:80']
thisIp=choice(ipList)
input = raw_input("Please input your key words:")
keyWord=urllib.quote(input)
url='http://search.sina.com.cn/iframe/suggest/index.php?q='+keyWord
headers={
'Get':url,
'Host':'search.sina.com.cn',
'Referer':'http://search.sina.com.cn/',
'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.97 Safari/537.36'
}
proxy_support = urllib2.ProxyHandler({'http': 'http://'+thisIp})
opener=urllib2.build_opener(proxy_support)
urllib2.install_opener(opener)
req=urllib2.Request(url)
for key in headers:
req.add_header(key,headers[key])
html=urllib2.urlopen(req).read()
file=open('C:\Users\Ryan\Desktop\lianXC.txt','w')
file.write(html)
|
03fec45fa269a8badbe047b4911c655c3c952404 | st2client/st2client/models/action_alias.py | st2client/st2client/models/action_alias.py | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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 st2client.models import core
__all__ = [
'ActionAlias'
]
class ActionAlias(core.Resource):
_alias = 'ActionAlias'
_display_name = 'Action Alias'
_plural = 'ActionAliases'
_plural_display_name = 'Runners'
_url_path = 'actionalias'
_repr_attributes = ['name', 'pack', 'action_ref']
| # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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 st2client.models import core
__all__ = [
'ActionAlias'
]
class ActionAlias(core.Resource):
_alias = 'Action-Alias'
_display_name = 'Action Alias'
_plural = 'ActionAliases'
_plural_display_name = 'Runners'
_url_path = 'actionalias'
_repr_attributes = ['name', 'pack', 'action_ref']
| Use consistent CLI command names. | Use consistent CLI command names.
| Python | apache-2.0 | alfasin/st2,Itxaka/st2,StackStorm/st2,StackStorm/st2,alfasin/st2,punalpatel/st2,punalpatel/st2,dennybaa/st2,alfasin/st2,punalpatel/st2,Plexxi/st2,Plexxi/st2,nzlosh/st2,StackStorm/st2,peak6/st2,pixelrebel/st2,armab/st2,tonybaloney/st2,grengojbo/st2,Plexxi/st2,grengojbo/st2,emedvedev/st2,Plexxi/st2,nzlosh/st2,pixelrebel/st2,StackStorm/st2,dennybaa/st2,dennybaa/st2,armab/st2,emedvedev/st2,lakshmi-kannan/st2,tonybaloney/st2,pixelrebel/st2,tonybaloney/st2,Itxaka/st2,grengojbo/st2,nzlosh/st2,emedvedev/st2,Itxaka/st2,nzlosh/st2,armab/st2,lakshmi-kannan/st2,peak6/st2,lakshmi-kannan/st2,peak6/st2 | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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 st2client.models import core
__all__ = [
'ActionAlias'
]
class ActionAlias(core.Resource):
_alias = 'ActionAlias'
_display_name = 'Action Alias'
_plural = 'ActionAliases'
_plural_display_name = 'Runners'
_url_path = 'actionalias'
_repr_attributes = ['name', 'pack', 'action_ref']
Use consistent CLI command names. | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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 st2client.models import core
__all__ = [
'ActionAlias'
]
class ActionAlias(core.Resource):
_alias = 'Action-Alias'
_display_name = 'Action Alias'
_plural = 'ActionAliases'
_plural_display_name = 'Runners'
_url_path = 'actionalias'
_repr_attributes = ['name', 'pack', 'action_ref']
| <commit_before># Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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 st2client.models import core
__all__ = [
'ActionAlias'
]
class ActionAlias(core.Resource):
_alias = 'ActionAlias'
_display_name = 'Action Alias'
_plural = 'ActionAliases'
_plural_display_name = 'Runners'
_url_path = 'actionalias'
_repr_attributes = ['name', 'pack', 'action_ref']
<commit_msg>Use consistent CLI command names.<commit_after> | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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 st2client.models import core
__all__ = [
'ActionAlias'
]
class ActionAlias(core.Resource):
_alias = 'Action-Alias'
_display_name = 'Action Alias'
_plural = 'ActionAliases'
_plural_display_name = 'Runners'
_url_path = 'actionalias'
_repr_attributes = ['name', 'pack', 'action_ref']
| # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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 st2client.models import core
__all__ = [
'ActionAlias'
]
class ActionAlias(core.Resource):
_alias = 'ActionAlias'
_display_name = 'Action Alias'
_plural = 'ActionAliases'
_plural_display_name = 'Runners'
_url_path = 'actionalias'
_repr_attributes = ['name', 'pack', 'action_ref']
Use consistent CLI command names.# Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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 st2client.models import core
__all__ = [
'ActionAlias'
]
class ActionAlias(core.Resource):
_alias = 'Action-Alias'
_display_name = 'Action Alias'
_plural = 'ActionAliases'
_plural_display_name = 'Runners'
_url_path = 'actionalias'
_repr_attributes = ['name', 'pack', 'action_ref']
| <commit_before># Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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 st2client.models import core
__all__ = [
'ActionAlias'
]
class ActionAlias(core.Resource):
_alias = 'ActionAlias'
_display_name = 'Action Alias'
_plural = 'ActionAliases'
_plural_display_name = 'Runners'
_url_path = 'actionalias'
_repr_attributes = ['name', 'pack', 'action_ref']
<commit_msg>Use consistent CLI command names.<commit_after># Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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 st2client.models import core
__all__ = [
'ActionAlias'
]
class ActionAlias(core.Resource):
_alias = 'Action-Alias'
_display_name = 'Action Alias'
_plural = 'ActionAliases'
_plural_display_name = 'Runners'
_url_path = 'actionalias'
_repr_attributes = ['name', 'pack', 'action_ref']
|
70181b3069649eddacac86dbcb49cb43733be0ec | tw_begins.py | tw_begins.py | #!/usr/bin/env python
import begin
import twitterlib
@begin.subcommand
def timeline():
"Display recent tweets from users timeline"
for status in begin.context.api.timeline:
print u"%s: %s" % (status.user.screen_name, status.text)
@begin.subcommand
def mentions():
"Display recent tweets mentioning user"
for status in begin.context.api.mentions:
print u"%s: %s" % (status.user.screen_name, status.text)
@begin.subcommand
def retweets():
"Display recent retweets from user's timeline"
for status in begin.context.api.retweets:
print u"%s: %s" % (status.user.screen_name, status.text)
@begin.start(env_prefix='', short_args=False)
def main(api_key='', api_secret='', access_token='', access_secret=''):
"""Minimal Twitter client
Demonstrate the use of the begins command line application framework by
implementing a simple Twitter command line client.
"""
api = twitterlib.API(api_key, api_secret, access_token, access_secret)
begin.context.api = api
| #!/usr/bin/env python
import begin
import twitterlib
# sub-command definitions using subcommand decorator for each sub-command that
# implements a timeline display
@begin.subcommand
def timeline():
"Display recent tweets from users timeline"
for status in begin.context.api.timeline:
print u"%s: %s" % (status.user.screen_name, status.text)
@begin.subcommand
def mentions():
"Display recent tweets mentioning user"
for status in begin.context.api.mentions:
print u"%s: %s" % (status.user.screen_name, status.text)
@begin.subcommand
def retweets():
"Display recent retweets from user's timeline"
for status in begin.context.api.retweets:
print u"%s: %s" % (status.user.screen_name, status.text)
# program main definition replace __name__ === '__main__' magic
# sub-commands are registered and loaded automatically
@begin.start(env_prefix='', short_args=False)
def main(api_key='', api_secret='', access_token='', access_secret=''):
"""Minimal Twitter client
Demonstrate the use of the begins command line application framework by
implementing a simple Twitter command line client.
"""
api = twitterlib.API(api_key, api_secret, access_token, access_secret)
begin.context.api = api
| Add code comments for begins example | Add code comments for begins example
Code comments for the major sections of the begins example program.
| Python | mit | aliles/cmdline_examples | #!/usr/bin/env python
import begin
import twitterlib
@begin.subcommand
def timeline():
"Display recent tweets from users timeline"
for status in begin.context.api.timeline:
print u"%s: %s" % (status.user.screen_name, status.text)
@begin.subcommand
def mentions():
"Display recent tweets mentioning user"
for status in begin.context.api.mentions:
print u"%s: %s" % (status.user.screen_name, status.text)
@begin.subcommand
def retweets():
"Display recent retweets from user's timeline"
for status in begin.context.api.retweets:
print u"%s: %s" % (status.user.screen_name, status.text)
@begin.start(env_prefix='', short_args=False)
def main(api_key='', api_secret='', access_token='', access_secret=''):
"""Minimal Twitter client
Demonstrate the use of the begins command line application framework by
implementing a simple Twitter command line client.
"""
api = twitterlib.API(api_key, api_secret, access_token, access_secret)
begin.context.api = api
Add code comments for begins example
Code comments for the major sections of the begins example program. | #!/usr/bin/env python
import begin
import twitterlib
# sub-command definitions using subcommand decorator for each sub-command that
# implements a timeline display
@begin.subcommand
def timeline():
"Display recent tweets from users timeline"
for status in begin.context.api.timeline:
print u"%s: %s" % (status.user.screen_name, status.text)
@begin.subcommand
def mentions():
"Display recent tweets mentioning user"
for status in begin.context.api.mentions:
print u"%s: %s" % (status.user.screen_name, status.text)
@begin.subcommand
def retweets():
"Display recent retweets from user's timeline"
for status in begin.context.api.retweets:
print u"%s: %s" % (status.user.screen_name, status.text)
# program main definition replace __name__ === '__main__' magic
# sub-commands are registered and loaded automatically
@begin.start(env_prefix='', short_args=False)
def main(api_key='', api_secret='', access_token='', access_secret=''):
"""Minimal Twitter client
Demonstrate the use of the begins command line application framework by
implementing a simple Twitter command line client.
"""
api = twitterlib.API(api_key, api_secret, access_token, access_secret)
begin.context.api = api
| <commit_before>#!/usr/bin/env python
import begin
import twitterlib
@begin.subcommand
def timeline():
"Display recent tweets from users timeline"
for status in begin.context.api.timeline:
print u"%s: %s" % (status.user.screen_name, status.text)
@begin.subcommand
def mentions():
"Display recent tweets mentioning user"
for status in begin.context.api.mentions:
print u"%s: %s" % (status.user.screen_name, status.text)
@begin.subcommand
def retweets():
"Display recent retweets from user's timeline"
for status in begin.context.api.retweets:
print u"%s: %s" % (status.user.screen_name, status.text)
@begin.start(env_prefix='', short_args=False)
def main(api_key='', api_secret='', access_token='', access_secret=''):
"""Minimal Twitter client
Demonstrate the use of the begins command line application framework by
implementing a simple Twitter command line client.
"""
api = twitterlib.API(api_key, api_secret, access_token, access_secret)
begin.context.api = api
<commit_msg>Add code comments for begins example
Code comments for the major sections of the begins example program.<commit_after> | #!/usr/bin/env python
import begin
import twitterlib
# sub-command definitions using subcommand decorator for each sub-command that
# implements a timeline display
@begin.subcommand
def timeline():
"Display recent tweets from users timeline"
for status in begin.context.api.timeline:
print u"%s: %s" % (status.user.screen_name, status.text)
@begin.subcommand
def mentions():
"Display recent tweets mentioning user"
for status in begin.context.api.mentions:
print u"%s: %s" % (status.user.screen_name, status.text)
@begin.subcommand
def retweets():
"Display recent retweets from user's timeline"
for status in begin.context.api.retweets:
print u"%s: %s" % (status.user.screen_name, status.text)
# program main definition replace __name__ === '__main__' magic
# sub-commands are registered and loaded automatically
@begin.start(env_prefix='', short_args=False)
def main(api_key='', api_secret='', access_token='', access_secret=''):
"""Minimal Twitter client
Demonstrate the use of the begins command line application framework by
implementing a simple Twitter command line client.
"""
api = twitterlib.API(api_key, api_secret, access_token, access_secret)
begin.context.api = api
| #!/usr/bin/env python
import begin
import twitterlib
@begin.subcommand
def timeline():
"Display recent tweets from users timeline"
for status in begin.context.api.timeline:
print u"%s: %s" % (status.user.screen_name, status.text)
@begin.subcommand
def mentions():
"Display recent tweets mentioning user"
for status in begin.context.api.mentions:
print u"%s: %s" % (status.user.screen_name, status.text)
@begin.subcommand
def retweets():
"Display recent retweets from user's timeline"
for status in begin.context.api.retweets:
print u"%s: %s" % (status.user.screen_name, status.text)
@begin.start(env_prefix='', short_args=False)
def main(api_key='', api_secret='', access_token='', access_secret=''):
"""Minimal Twitter client
Demonstrate the use of the begins command line application framework by
implementing a simple Twitter command line client.
"""
api = twitterlib.API(api_key, api_secret, access_token, access_secret)
begin.context.api = api
Add code comments for begins example
Code comments for the major sections of the begins example program.#!/usr/bin/env python
import begin
import twitterlib
# sub-command definitions using subcommand decorator for each sub-command that
# implements a timeline display
@begin.subcommand
def timeline():
"Display recent tweets from users timeline"
for status in begin.context.api.timeline:
print u"%s: %s" % (status.user.screen_name, status.text)
@begin.subcommand
def mentions():
"Display recent tweets mentioning user"
for status in begin.context.api.mentions:
print u"%s: %s" % (status.user.screen_name, status.text)
@begin.subcommand
def retweets():
"Display recent retweets from user's timeline"
for status in begin.context.api.retweets:
print u"%s: %s" % (status.user.screen_name, status.text)
# program main definition replace __name__ === '__main__' magic
# sub-commands are registered and loaded automatically
@begin.start(env_prefix='', short_args=False)
def main(api_key='', api_secret='', access_token='', access_secret=''):
"""Minimal Twitter client
Demonstrate the use of the begins command line application framework by
implementing a simple Twitter command line client.
"""
api = twitterlib.API(api_key, api_secret, access_token, access_secret)
begin.context.api = api
| <commit_before>#!/usr/bin/env python
import begin
import twitterlib
@begin.subcommand
def timeline():
"Display recent tweets from users timeline"
for status in begin.context.api.timeline:
print u"%s: %s" % (status.user.screen_name, status.text)
@begin.subcommand
def mentions():
"Display recent tweets mentioning user"
for status in begin.context.api.mentions:
print u"%s: %s" % (status.user.screen_name, status.text)
@begin.subcommand
def retweets():
"Display recent retweets from user's timeline"
for status in begin.context.api.retweets:
print u"%s: %s" % (status.user.screen_name, status.text)
@begin.start(env_prefix='', short_args=False)
def main(api_key='', api_secret='', access_token='', access_secret=''):
"""Minimal Twitter client
Demonstrate the use of the begins command line application framework by
implementing a simple Twitter command line client.
"""
api = twitterlib.API(api_key, api_secret, access_token, access_secret)
begin.context.api = api
<commit_msg>Add code comments for begins example
Code comments for the major sections of the begins example program.<commit_after>#!/usr/bin/env python
import begin
import twitterlib
# sub-command definitions using subcommand decorator for each sub-command that
# implements a timeline display
@begin.subcommand
def timeline():
"Display recent tweets from users timeline"
for status in begin.context.api.timeline:
print u"%s: %s" % (status.user.screen_name, status.text)
@begin.subcommand
def mentions():
"Display recent tweets mentioning user"
for status in begin.context.api.mentions:
print u"%s: %s" % (status.user.screen_name, status.text)
@begin.subcommand
def retweets():
"Display recent retweets from user's timeline"
for status in begin.context.api.retweets:
print u"%s: %s" % (status.user.screen_name, status.text)
# program main definition replace __name__ === '__main__' magic
# sub-commands are registered and loaded automatically
@begin.start(env_prefix='', short_args=False)
def main(api_key='', api_secret='', access_token='', access_secret=''):
"""Minimal Twitter client
Demonstrate the use of the begins command line application framework by
implementing a simple Twitter command line client.
"""
api = twitterlib.API(api_key, api_secret, access_token, access_secret)
begin.context.api = api
|
c95bff54d8ff6534c40d60f34484f864cc04754a | lib/web/web.py | lib/web/web.py | import os, os.path
import random
import string
import json
import cherrypy
from . import get_pic
class StringGenerator(object):
@cherrypy.expose
def index(self):
return """<html>
<head>
<link href="/static/css/style.css" rel="stylesheet">
</head>
<body>
wrong page
</body>
</html>"""
@cherrypy.expose
def get_picture(self, url=""):
return get_pic.base64_picture(url)
@cherrypy.expose
def search(self, query):
return json.dumps({"book": {"title":"Gs", "author":"Bash Gs", "url":"https://chitanka.info/text/1"},
"recommended":[{"title":"Gs1", "author":"Bash Gs1", "url":"https://chitanka.info/text/2"},
{"title":"Gs2", "author":"Bash Gs2", "url":"https://chitanka.info/text/3"}]})
@cherrypy.expose
def display(self):
return cherrypy.session['mystring']
def main():
conf = {
'/': {
'tools.staticdir.on': True,
'tools.staticdir.dir': os.path.join(
os.path.abspath(os.path.dirname(os.path.realpath(__file__))),
'web'
)
},
}
cherrypy.quickstart(StringGenerator(), '/', conf)
if __name__ == '__main__':
main()
| import os, os.path
import random
import string
import json
import cherrypy
from . import get_pic
class StringGenerator(object):
@cherrypy.expose
def index(self):
return """<html>
<head>
<link href="/static/css/style.css" rel="stylesheet">
</head>
<body>
wrong page
</body>
</html>"""
@cherrypy.expose
def get_picture(self, url=""):
return get_pic.base64_picture(url)
@cherrypy.expose
def search(self, query):
return json.dumps({"book": {"title":"Gs", "author":"Bash Gs", "url":"https://chitanka.info/text/1"},
"recommended":[{"title":"Gs1", "author":"Bash Gs1", "url":"https://chitanka.info/text/2"},
{"title":"Gs2", "author":"Bash Gs2", "url":None}]})
@cherrypy.expose
def display(self):
return cherrypy.session['mystring']
def main():
conf = {
'/': {
'tools.staticdir.on': True,
'tools.staticdir.dir': os.path.join(
os.path.abspath(os.path.dirname(os.path.realpath(__file__))),
'web'
)
},
}
cherrypy.quickstart(StringGenerator(), '/', conf)
if __name__ == '__main__':
main()
| Add example for when there is no book cover url | Add example for when there is no book cover url
| Python | mit | DexterLB/bookrat,DexterLB/bookrat,DexterLB/bookrat,DexterLB/bookrat,DexterLB/bookrat | import os, os.path
import random
import string
import json
import cherrypy
from . import get_pic
class StringGenerator(object):
@cherrypy.expose
def index(self):
return """<html>
<head>
<link href="/static/css/style.css" rel="stylesheet">
</head>
<body>
wrong page
</body>
</html>"""
@cherrypy.expose
def get_picture(self, url=""):
return get_pic.base64_picture(url)
@cherrypy.expose
def search(self, query):
return json.dumps({"book": {"title":"Gs", "author":"Bash Gs", "url":"https://chitanka.info/text/1"},
"recommended":[{"title":"Gs1", "author":"Bash Gs1", "url":"https://chitanka.info/text/2"},
{"title":"Gs2", "author":"Bash Gs2", "url":"https://chitanka.info/text/3"}]})
@cherrypy.expose
def display(self):
return cherrypy.session['mystring']
def main():
conf = {
'/': {
'tools.staticdir.on': True,
'tools.staticdir.dir': os.path.join(
os.path.abspath(os.path.dirname(os.path.realpath(__file__))),
'web'
)
},
}
cherrypy.quickstart(StringGenerator(), '/', conf)
if __name__ == '__main__':
main()
Add example for when there is no book cover url | import os, os.path
import random
import string
import json
import cherrypy
from . import get_pic
class StringGenerator(object):
@cherrypy.expose
def index(self):
return """<html>
<head>
<link href="/static/css/style.css" rel="stylesheet">
</head>
<body>
wrong page
</body>
</html>"""
@cherrypy.expose
def get_picture(self, url=""):
return get_pic.base64_picture(url)
@cherrypy.expose
def search(self, query):
return json.dumps({"book": {"title":"Gs", "author":"Bash Gs", "url":"https://chitanka.info/text/1"},
"recommended":[{"title":"Gs1", "author":"Bash Gs1", "url":"https://chitanka.info/text/2"},
{"title":"Gs2", "author":"Bash Gs2", "url":None}]})
@cherrypy.expose
def display(self):
return cherrypy.session['mystring']
def main():
conf = {
'/': {
'tools.staticdir.on': True,
'tools.staticdir.dir': os.path.join(
os.path.abspath(os.path.dirname(os.path.realpath(__file__))),
'web'
)
},
}
cherrypy.quickstart(StringGenerator(), '/', conf)
if __name__ == '__main__':
main()
| <commit_before>import os, os.path
import random
import string
import json
import cherrypy
from . import get_pic
class StringGenerator(object):
@cherrypy.expose
def index(self):
return """<html>
<head>
<link href="/static/css/style.css" rel="stylesheet">
</head>
<body>
wrong page
</body>
</html>"""
@cherrypy.expose
def get_picture(self, url=""):
return get_pic.base64_picture(url)
@cherrypy.expose
def search(self, query):
return json.dumps({"book": {"title":"Gs", "author":"Bash Gs", "url":"https://chitanka.info/text/1"},
"recommended":[{"title":"Gs1", "author":"Bash Gs1", "url":"https://chitanka.info/text/2"},
{"title":"Gs2", "author":"Bash Gs2", "url":"https://chitanka.info/text/3"}]})
@cherrypy.expose
def display(self):
return cherrypy.session['mystring']
def main():
conf = {
'/': {
'tools.staticdir.on': True,
'tools.staticdir.dir': os.path.join(
os.path.abspath(os.path.dirname(os.path.realpath(__file__))),
'web'
)
},
}
cherrypy.quickstart(StringGenerator(), '/', conf)
if __name__ == '__main__':
main()
<commit_msg>Add example for when there is no book cover url<commit_after> | import os, os.path
import random
import string
import json
import cherrypy
from . import get_pic
class StringGenerator(object):
@cherrypy.expose
def index(self):
return """<html>
<head>
<link href="/static/css/style.css" rel="stylesheet">
</head>
<body>
wrong page
</body>
</html>"""
@cherrypy.expose
def get_picture(self, url=""):
return get_pic.base64_picture(url)
@cherrypy.expose
def search(self, query):
return json.dumps({"book": {"title":"Gs", "author":"Bash Gs", "url":"https://chitanka.info/text/1"},
"recommended":[{"title":"Gs1", "author":"Bash Gs1", "url":"https://chitanka.info/text/2"},
{"title":"Gs2", "author":"Bash Gs2", "url":None}]})
@cherrypy.expose
def display(self):
return cherrypy.session['mystring']
def main():
conf = {
'/': {
'tools.staticdir.on': True,
'tools.staticdir.dir': os.path.join(
os.path.abspath(os.path.dirname(os.path.realpath(__file__))),
'web'
)
},
}
cherrypy.quickstart(StringGenerator(), '/', conf)
if __name__ == '__main__':
main()
| import os, os.path
import random
import string
import json
import cherrypy
from . import get_pic
class StringGenerator(object):
@cherrypy.expose
def index(self):
return """<html>
<head>
<link href="/static/css/style.css" rel="stylesheet">
</head>
<body>
wrong page
</body>
</html>"""
@cherrypy.expose
def get_picture(self, url=""):
return get_pic.base64_picture(url)
@cherrypy.expose
def search(self, query):
return json.dumps({"book": {"title":"Gs", "author":"Bash Gs", "url":"https://chitanka.info/text/1"},
"recommended":[{"title":"Gs1", "author":"Bash Gs1", "url":"https://chitanka.info/text/2"},
{"title":"Gs2", "author":"Bash Gs2", "url":"https://chitanka.info/text/3"}]})
@cherrypy.expose
def display(self):
return cherrypy.session['mystring']
def main():
conf = {
'/': {
'tools.staticdir.on': True,
'tools.staticdir.dir': os.path.join(
os.path.abspath(os.path.dirname(os.path.realpath(__file__))),
'web'
)
},
}
cherrypy.quickstart(StringGenerator(), '/', conf)
if __name__ == '__main__':
main()
Add example for when there is no book cover urlimport os, os.path
import random
import string
import json
import cherrypy
from . import get_pic
class StringGenerator(object):
@cherrypy.expose
def index(self):
return """<html>
<head>
<link href="/static/css/style.css" rel="stylesheet">
</head>
<body>
wrong page
</body>
</html>"""
@cherrypy.expose
def get_picture(self, url=""):
return get_pic.base64_picture(url)
@cherrypy.expose
def search(self, query):
return json.dumps({"book": {"title":"Gs", "author":"Bash Gs", "url":"https://chitanka.info/text/1"},
"recommended":[{"title":"Gs1", "author":"Bash Gs1", "url":"https://chitanka.info/text/2"},
{"title":"Gs2", "author":"Bash Gs2", "url":None}]})
@cherrypy.expose
def display(self):
return cherrypy.session['mystring']
def main():
conf = {
'/': {
'tools.staticdir.on': True,
'tools.staticdir.dir': os.path.join(
os.path.abspath(os.path.dirname(os.path.realpath(__file__))),
'web'
)
},
}
cherrypy.quickstart(StringGenerator(), '/', conf)
if __name__ == '__main__':
main()
| <commit_before>import os, os.path
import random
import string
import json
import cherrypy
from . import get_pic
class StringGenerator(object):
@cherrypy.expose
def index(self):
return """<html>
<head>
<link href="/static/css/style.css" rel="stylesheet">
</head>
<body>
wrong page
</body>
</html>"""
@cherrypy.expose
def get_picture(self, url=""):
return get_pic.base64_picture(url)
@cherrypy.expose
def search(self, query):
return json.dumps({"book": {"title":"Gs", "author":"Bash Gs", "url":"https://chitanka.info/text/1"},
"recommended":[{"title":"Gs1", "author":"Bash Gs1", "url":"https://chitanka.info/text/2"},
{"title":"Gs2", "author":"Bash Gs2", "url":"https://chitanka.info/text/3"}]})
@cherrypy.expose
def display(self):
return cherrypy.session['mystring']
def main():
conf = {
'/': {
'tools.staticdir.on': True,
'tools.staticdir.dir': os.path.join(
os.path.abspath(os.path.dirname(os.path.realpath(__file__))),
'web'
)
},
}
cherrypy.quickstart(StringGenerator(), '/', conf)
if __name__ == '__main__':
main()
<commit_msg>Add example for when there is no book cover url<commit_after>import os, os.path
import random
import string
import json
import cherrypy
from . import get_pic
class StringGenerator(object):
@cherrypy.expose
def index(self):
return """<html>
<head>
<link href="/static/css/style.css" rel="stylesheet">
</head>
<body>
wrong page
</body>
</html>"""
@cherrypy.expose
def get_picture(self, url=""):
return get_pic.base64_picture(url)
@cherrypy.expose
def search(self, query):
return json.dumps({"book": {"title":"Gs", "author":"Bash Gs", "url":"https://chitanka.info/text/1"},
"recommended":[{"title":"Gs1", "author":"Bash Gs1", "url":"https://chitanka.info/text/2"},
{"title":"Gs2", "author":"Bash Gs2", "url":None}]})
@cherrypy.expose
def display(self):
return cherrypy.session['mystring']
def main():
conf = {
'/': {
'tools.staticdir.on': True,
'tools.staticdir.dir': os.path.join(
os.path.abspath(os.path.dirname(os.path.realpath(__file__))),
'web'
)
},
}
cherrypy.quickstart(StringGenerator(), '/', conf)
if __name__ == '__main__':
main()
|
ecc471f94dc2ca2931370e53948d9f674dd673d4 | h2o-py/tests/testdir_munging/unop/pyunit_cor.py | h2o-py/tests/testdir_munging/unop/pyunit_cor.py | from builtins import range
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
##
# Test out the cor() functionality
# If NAs in the frame, they are skipped in calculation unless na.rm = F
# If any categorical columns, throw an error
##
import numpy as np
def cor_test():
iris_h2o = h2o.import_file(path=pyunit_utils.locate("smalldata/iris/iris.csv"))
iris_np = np.genfromtxt(pyunit_utils.locate("smalldata/iris/iris.csv"),
delimiter=',',
skip_header=1,
usecols=(0, 1, 2, 3))
cor_np = h2o.H2OFrame(np.corrcoef(iris_np,rowvar=0))
cor_h2o = iris_h2o[0:4].cor()
cor_diff = abs(cor_h2o - cor_np)
print("Correlation matrix with H2O: ")
print cor_h2o
print("Correlation matrix with Numpy: ")
print cor_np
print("Correlation differences between H2O and Numpy: ")
print cor_diff
print("Max difference in correlation calculation between H2O and Numpy: ")
print cor_diff.max()
max = cor_diff.max()
assert max < .006, "expected equal correlations"
if __name__ == "__main__":
pyunit_utils.standalone_test(cor_test)
else:
cor_test() | from builtins import range
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
##
# Test out the cor() functionality
# If NAs in the frame, they are skipped in calculation unless na.rm = F
# If any categorical columns, throw an error
##
import numpy as np
def cor_test():
iris_h2o = h2o.import_file(path=pyunit_utils.locate("smalldata/iris/iris.csv"))
iris_np = np.genfromtxt(pyunit_utils.locate("smalldata/iris/iris.csv"),
delimiter=',',
skip_header=1,
usecols=(0, 1, 2, 3))
cor_np = h2o.H2OFrame(np.corrcoef(iris_np,rowvar=0))
cor_h2o = iris_h2o[0:4].cor()
cor_diff = abs(cor_h2o - cor_np)
print("Correlation matrix with H2O: ")
print(cor_h2o)
print("Correlation matrix with Numpy: ")
print(cor_np)
print("Correlation differences between H2O and Numpy: ")
print(cor_diff)
print("Max difference in correlation calculation between H2O and Numpy: ")
print(cor_diff.max())
max = cor_diff.max()
assert max < .006, "expected equal correlations"
if __name__ == "__main__":
pyunit_utils.standalone_test(cor_test)
else:
cor_test() | Add parenthesis to print statement | Add parenthesis to print statement
| Python | apache-2.0 | mathemage/h2o-3,h2oai/h2o-dev,h2oai/h2o-3,h2oai/h2o-3,mathemage/h2o-3,mathemage/h2o-3,michalkurka/h2o-3,jangorecki/h2o-3,h2oai/h2o-dev,mathemage/h2o-3,h2oai/h2o-3,jangorecki/h2o-3,michalkurka/h2o-3,mathemage/h2o-3,michalkurka/h2o-3,michalkurka/h2o-3,michalkurka/h2o-3,h2oai/h2o-dev,jangorecki/h2o-3,michalkurka/h2o-3,h2oai/h2o-3,spennihana/h2o-3,jangorecki/h2o-3,spennihana/h2o-3,mathemage/h2o-3,h2oai/h2o-3,h2oai/h2o-3,h2oai/h2o-dev,spennihana/h2o-3,h2oai/h2o-3,h2oai/h2o-dev,jangorecki/h2o-3,h2oai/h2o-3,h2oai/h2o-dev,jangorecki/h2o-3,h2oai/h2o-dev,spennihana/h2o-3,spennihana/h2o-3,spennihana/h2o-3,jangorecki/h2o-3,michalkurka/h2o-3,mathemage/h2o-3,spennihana/h2o-3 | from builtins import range
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
##
# Test out the cor() functionality
# If NAs in the frame, they are skipped in calculation unless na.rm = F
# If any categorical columns, throw an error
##
import numpy as np
def cor_test():
iris_h2o = h2o.import_file(path=pyunit_utils.locate("smalldata/iris/iris.csv"))
iris_np = np.genfromtxt(pyunit_utils.locate("smalldata/iris/iris.csv"),
delimiter=',',
skip_header=1,
usecols=(0, 1, 2, 3))
cor_np = h2o.H2OFrame(np.corrcoef(iris_np,rowvar=0))
cor_h2o = iris_h2o[0:4].cor()
cor_diff = abs(cor_h2o - cor_np)
print("Correlation matrix with H2O: ")
print cor_h2o
print("Correlation matrix with Numpy: ")
print cor_np
print("Correlation differences between H2O and Numpy: ")
print cor_diff
print("Max difference in correlation calculation between H2O and Numpy: ")
print cor_diff.max()
max = cor_diff.max()
assert max < .006, "expected equal correlations"
if __name__ == "__main__":
pyunit_utils.standalone_test(cor_test)
else:
cor_test()Add parenthesis to print statement | from builtins import range
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
##
# Test out the cor() functionality
# If NAs in the frame, they are skipped in calculation unless na.rm = F
# If any categorical columns, throw an error
##
import numpy as np
def cor_test():
iris_h2o = h2o.import_file(path=pyunit_utils.locate("smalldata/iris/iris.csv"))
iris_np = np.genfromtxt(pyunit_utils.locate("smalldata/iris/iris.csv"),
delimiter=',',
skip_header=1,
usecols=(0, 1, 2, 3))
cor_np = h2o.H2OFrame(np.corrcoef(iris_np,rowvar=0))
cor_h2o = iris_h2o[0:4].cor()
cor_diff = abs(cor_h2o - cor_np)
print("Correlation matrix with H2O: ")
print(cor_h2o)
print("Correlation matrix with Numpy: ")
print(cor_np)
print("Correlation differences between H2O and Numpy: ")
print(cor_diff)
print("Max difference in correlation calculation between H2O and Numpy: ")
print(cor_diff.max())
max = cor_diff.max()
assert max < .006, "expected equal correlations"
if __name__ == "__main__":
pyunit_utils.standalone_test(cor_test)
else:
cor_test() | <commit_before>from builtins import range
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
##
# Test out the cor() functionality
# If NAs in the frame, they are skipped in calculation unless na.rm = F
# If any categorical columns, throw an error
##
import numpy as np
def cor_test():
iris_h2o = h2o.import_file(path=pyunit_utils.locate("smalldata/iris/iris.csv"))
iris_np = np.genfromtxt(pyunit_utils.locate("smalldata/iris/iris.csv"),
delimiter=',',
skip_header=1,
usecols=(0, 1, 2, 3))
cor_np = h2o.H2OFrame(np.corrcoef(iris_np,rowvar=0))
cor_h2o = iris_h2o[0:4].cor()
cor_diff = abs(cor_h2o - cor_np)
print("Correlation matrix with H2O: ")
print cor_h2o
print("Correlation matrix with Numpy: ")
print cor_np
print("Correlation differences between H2O and Numpy: ")
print cor_diff
print("Max difference in correlation calculation between H2O and Numpy: ")
print cor_diff.max()
max = cor_diff.max()
assert max < .006, "expected equal correlations"
if __name__ == "__main__":
pyunit_utils.standalone_test(cor_test)
else:
cor_test()<commit_msg>Add parenthesis to print statement<commit_after> | from builtins import range
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
##
# Test out the cor() functionality
# If NAs in the frame, they are skipped in calculation unless na.rm = F
# If any categorical columns, throw an error
##
import numpy as np
def cor_test():
iris_h2o = h2o.import_file(path=pyunit_utils.locate("smalldata/iris/iris.csv"))
iris_np = np.genfromtxt(pyunit_utils.locate("smalldata/iris/iris.csv"),
delimiter=',',
skip_header=1,
usecols=(0, 1, 2, 3))
cor_np = h2o.H2OFrame(np.corrcoef(iris_np,rowvar=0))
cor_h2o = iris_h2o[0:4].cor()
cor_diff = abs(cor_h2o - cor_np)
print("Correlation matrix with H2O: ")
print(cor_h2o)
print("Correlation matrix with Numpy: ")
print(cor_np)
print("Correlation differences between H2O and Numpy: ")
print(cor_diff)
print("Max difference in correlation calculation between H2O and Numpy: ")
print(cor_diff.max())
max = cor_diff.max()
assert max < .006, "expected equal correlations"
if __name__ == "__main__":
pyunit_utils.standalone_test(cor_test)
else:
cor_test() | from builtins import range
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
##
# Test out the cor() functionality
# If NAs in the frame, they are skipped in calculation unless na.rm = F
# If any categorical columns, throw an error
##
import numpy as np
def cor_test():
iris_h2o = h2o.import_file(path=pyunit_utils.locate("smalldata/iris/iris.csv"))
iris_np = np.genfromtxt(pyunit_utils.locate("smalldata/iris/iris.csv"),
delimiter=',',
skip_header=1,
usecols=(0, 1, 2, 3))
cor_np = h2o.H2OFrame(np.corrcoef(iris_np,rowvar=0))
cor_h2o = iris_h2o[0:4].cor()
cor_diff = abs(cor_h2o - cor_np)
print("Correlation matrix with H2O: ")
print cor_h2o
print("Correlation matrix with Numpy: ")
print cor_np
print("Correlation differences between H2O and Numpy: ")
print cor_diff
print("Max difference in correlation calculation between H2O and Numpy: ")
print cor_diff.max()
max = cor_diff.max()
assert max < .006, "expected equal correlations"
if __name__ == "__main__":
pyunit_utils.standalone_test(cor_test)
else:
cor_test()Add parenthesis to print statementfrom builtins import range
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
##
# Test out the cor() functionality
# If NAs in the frame, they are skipped in calculation unless na.rm = F
# If any categorical columns, throw an error
##
import numpy as np
def cor_test():
iris_h2o = h2o.import_file(path=pyunit_utils.locate("smalldata/iris/iris.csv"))
iris_np = np.genfromtxt(pyunit_utils.locate("smalldata/iris/iris.csv"),
delimiter=',',
skip_header=1,
usecols=(0, 1, 2, 3))
cor_np = h2o.H2OFrame(np.corrcoef(iris_np,rowvar=0))
cor_h2o = iris_h2o[0:4].cor()
cor_diff = abs(cor_h2o - cor_np)
print("Correlation matrix with H2O: ")
print(cor_h2o)
print("Correlation matrix with Numpy: ")
print(cor_np)
print("Correlation differences between H2O and Numpy: ")
print(cor_diff)
print("Max difference in correlation calculation between H2O and Numpy: ")
print(cor_diff.max())
max = cor_diff.max()
assert max < .006, "expected equal correlations"
if __name__ == "__main__":
pyunit_utils.standalone_test(cor_test)
else:
cor_test() | <commit_before>from builtins import range
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
##
# Test out the cor() functionality
# If NAs in the frame, they are skipped in calculation unless na.rm = F
# If any categorical columns, throw an error
##
import numpy as np
def cor_test():
iris_h2o = h2o.import_file(path=pyunit_utils.locate("smalldata/iris/iris.csv"))
iris_np = np.genfromtxt(pyunit_utils.locate("smalldata/iris/iris.csv"),
delimiter=',',
skip_header=1,
usecols=(0, 1, 2, 3))
cor_np = h2o.H2OFrame(np.corrcoef(iris_np,rowvar=0))
cor_h2o = iris_h2o[0:4].cor()
cor_diff = abs(cor_h2o - cor_np)
print("Correlation matrix with H2O: ")
print cor_h2o
print("Correlation matrix with Numpy: ")
print cor_np
print("Correlation differences between H2O and Numpy: ")
print cor_diff
print("Max difference in correlation calculation between H2O and Numpy: ")
print cor_diff.max()
max = cor_diff.max()
assert max < .006, "expected equal correlations"
if __name__ == "__main__":
pyunit_utils.standalone_test(cor_test)
else:
cor_test()<commit_msg>Add parenthesis to print statement<commit_after>from builtins import range
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
##
# Test out the cor() functionality
# If NAs in the frame, they are skipped in calculation unless na.rm = F
# If any categorical columns, throw an error
##
import numpy as np
def cor_test():
iris_h2o = h2o.import_file(path=pyunit_utils.locate("smalldata/iris/iris.csv"))
iris_np = np.genfromtxt(pyunit_utils.locate("smalldata/iris/iris.csv"),
delimiter=',',
skip_header=1,
usecols=(0, 1, 2, 3))
cor_np = h2o.H2OFrame(np.corrcoef(iris_np,rowvar=0))
cor_h2o = iris_h2o[0:4].cor()
cor_diff = abs(cor_h2o - cor_np)
print("Correlation matrix with H2O: ")
print(cor_h2o)
print("Correlation matrix with Numpy: ")
print(cor_np)
print("Correlation differences between H2O and Numpy: ")
print(cor_diff)
print("Max difference in correlation calculation between H2O and Numpy: ")
print(cor_diff.max())
max = cor_diff.max()
assert max < .006, "expected equal correlations"
if __name__ == "__main__":
pyunit_utils.standalone_test(cor_test)
else:
cor_test() |
4adb78fde502faed78350233896f3efd3f42816e | cytoplasm/interpreters.py | cytoplasm/interpreters.py | '''
These are some utilites used when writing and handling interpreters.
'''
import shutil
from cytoplasm import configuration
from cytoplasm.errors import InterpreterError
def SaveReturned(fn):
'''Some potential interpreters, like Mako, don't give you an easy way to save to a destination.
In these cases, simply use this function as a decorater.'''
def InterpreterWithSave(source, destination, **kwargs):
# under some circumstances, this should be able to write to file-like objects;
# so if destination is a string, assume it's a path; otherwise, it's a file-like object
if isinstance(destination, str):
f = open(destination, "w")
else:
f = destination
# pass **kwargs to this function.
f.write(fn(source, **kwargs))
f.close()
return InterpreterWithSave
def interpret(file, destination, **kwargs):
"Interpret a file with an interpreter according to its suffix."
# get the list of interpreters from the configuration
interpreters = configuration.get_config().interpreters
# figure out the suffix of the file, to use to determine which interpreter to use
ending = ".".join(file.split(".")[:-1])
try:
interpreters.get(ending, shutil.copyfile)(file, destination, **kwargs)
except Exception as exception:
# if the interpreter chokes, raise an InterpreterError with some useful information.
raise InterpreterError("%s on file '%s': %s" %(ending, file, exception))
| '''
These are some utilites used when writing and handling interpreters.
'''
import shutil
from cytoplasm import configuration
from cytoplasm.errors import InterpreterError
def SaveReturned(fn):
'''Some potential interpreters, like Mako, don't give you an easy way to save to a destination.
In these cases, simply use this function as a decorater.'''
def InterpreterWithSave(source, destination, **kwargs):
# under some circumstances, this should be able to write to file-like objects;
# so if destination is a string, assume it's a path; otherwise, it's a file-like object
if isinstance(destination, str):
f = open(destination, "w")
else:
f = destination
# pass **kwargs to this function.
f.write(fn(source, **kwargs))
f.close()
return InterpreterWithSave
@SaveReturned
def default_interpreter(source, **kwargs):
f = open(source)
source_string = f.read()
f.close()
return source_string
def interpret(file, destination, **kwargs):
"Interpret a file with an interpreter according to its suffix."
# get the list of interpreters from the configuration
interpreters = configuration.get_config().interpreters
# figure out the suffix of the file, to use to determine which interpreter to use
ending = file.split(".")[-1]
interpreters.get(ending, default_interpreter)(file, destination, **kwargs)
| Define a default interpreter rather than using shutil.copyfile. | Define a default interpreter rather than using shutil.copyfile.
It would choke before if it was handed a file-like object rather than a
file name. Even more bleh!.
| Python | mit | startling/cytoplasm | '''
These are some utilites used when writing and handling interpreters.
'''
import shutil
from cytoplasm import configuration
from cytoplasm.errors import InterpreterError
def SaveReturned(fn):
'''Some potential interpreters, like Mako, don't give you an easy way to save to a destination.
In these cases, simply use this function as a decorater.'''
def InterpreterWithSave(source, destination, **kwargs):
# under some circumstances, this should be able to write to file-like objects;
# so if destination is a string, assume it's a path; otherwise, it's a file-like object
if isinstance(destination, str):
f = open(destination, "w")
else:
f = destination
# pass **kwargs to this function.
f.write(fn(source, **kwargs))
f.close()
return InterpreterWithSave
def interpret(file, destination, **kwargs):
"Interpret a file with an interpreter according to its suffix."
# get the list of interpreters from the configuration
interpreters = configuration.get_config().interpreters
# figure out the suffix of the file, to use to determine which interpreter to use
ending = ".".join(file.split(".")[:-1])
try:
interpreters.get(ending, shutil.copyfile)(file, destination, **kwargs)
except Exception as exception:
# if the interpreter chokes, raise an InterpreterError with some useful information.
raise InterpreterError("%s on file '%s': %s" %(ending, file, exception))
Define a default interpreter rather than using shutil.copyfile.
It would choke before if it was handed a file-like object rather than a
file name. Even more bleh!. | '''
These are some utilites used when writing and handling interpreters.
'''
import shutil
from cytoplasm import configuration
from cytoplasm.errors import InterpreterError
def SaveReturned(fn):
'''Some potential interpreters, like Mako, don't give you an easy way to save to a destination.
In these cases, simply use this function as a decorater.'''
def InterpreterWithSave(source, destination, **kwargs):
# under some circumstances, this should be able to write to file-like objects;
# so if destination is a string, assume it's a path; otherwise, it's a file-like object
if isinstance(destination, str):
f = open(destination, "w")
else:
f = destination
# pass **kwargs to this function.
f.write(fn(source, **kwargs))
f.close()
return InterpreterWithSave
@SaveReturned
def default_interpreter(source, **kwargs):
f = open(source)
source_string = f.read()
f.close()
return source_string
def interpret(file, destination, **kwargs):
"Interpret a file with an interpreter according to its suffix."
# get the list of interpreters from the configuration
interpreters = configuration.get_config().interpreters
# figure out the suffix of the file, to use to determine which interpreter to use
ending = file.split(".")[-1]
interpreters.get(ending, default_interpreter)(file, destination, **kwargs)
| <commit_before>'''
These are some utilites used when writing and handling interpreters.
'''
import shutil
from cytoplasm import configuration
from cytoplasm.errors import InterpreterError
def SaveReturned(fn):
'''Some potential interpreters, like Mako, don't give you an easy way to save to a destination.
In these cases, simply use this function as a decorater.'''
def InterpreterWithSave(source, destination, **kwargs):
# under some circumstances, this should be able to write to file-like objects;
# so if destination is a string, assume it's a path; otherwise, it's a file-like object
if isinstance(destination, str):
f = open(destination, "w")
else:
f = destination
# pass **kwargs to this function.
f.write(fn(source, **kwargs))
f.close()
return InterpreterWithSave
def interpret(file, destination, **kwargs):
"Interpret a file with an interpreter according to its suffix."
# get the list of interpreters from the configuration
interpreters = configuration.get_config().interpreters
# figure out the suffix of the file, to use to determine which interpreter to use
ending = ".".join(file.split(".")[:-1])
try:
interpreters.get(ending, shutil.copyfile)(file, destination, **kwargs)
except Exception as exception:
# if the interpreter chokes, raise an InterpreterError with some useful information.
raise InterpreterError("%s on file '%s': %s" %(ending, file, exception))
<commit_msg>Define a default interpreter rather than using shutil.copyfile.
It would choke before if it was handed a file-like object rather than a
file name. Even more bleh!.<commit_after> | '''
These are some utilites used when writing and handling interpreters.
'''
import shutil
from cytoplasm import configuration
from cytoplasm.errors import InterpreterError
def SaveReturned(fn):
'''Some potential interpreters, like Mako, don't give you an easy way to save to a destination.
In these cases, simply use this function as a decorater.'''
def InterpreterWithSave(source, destination, **kwargs):
# under some circumstances, this should be able to write to file-like objects;
# so if destination is a string, assume it's a path; otherwise, it's a file-like object
if isinstance(destination, str):
f = open(destination, "w")
else:
f = destination
# pass **kwargs to this function.
f.write(fn(source, **kwargs))
f.close()
return InterpreterWithSave
@SaveReturned
def default_interpreter(source, **kwargs):
f = open(source)
source_string = f.read()
f.close()
return source_string
def interpret(file, destination, **kwargs):
"Interpret a file with an interpreter according to its suffix."
# get the list of interpreters from the configuration
interpreters = configuration.get_config().interpreters
# figure out the suffix of the file, to use to determine which interpreter to use
ending = file.split(".")[-1]
interpreters.get(ending, default_interpreter)(file, destination, **kwargs)
| '''
These are some utilites used when writing and handling interpreters.
'''
import shutil
from cytoplasm import configuration
from cytoplasm.errors import InterpreterError
def SaveReturned(fn):
'''Some potential interpreters, like Mako, don't give you an easy way to save to a destination.
In these cases, simply use this function as a decorater.'''
def InterpreterWithSave(source, destination, **kwargs):
# under some circumstances, this should be able to write to file-like objects;
# so if destination is a string, assume it's a path; otherwise, it's a file-like object
if isinstance(destination, str):
f = open(destination, "w")
else:
f = destination
# pass **kwargs to this function.
f.write(fn(source, **kwargs))
f.close()
return InterpreterWithSave
def interpret(file, destination, **kwargs):
"Interpret a file with an interpreter according to its suffix."
# get the list of interpreters from the configuration
interpreters = configuration.get_config().interpreters
# figure out the suffix of the file, to use to determine which interpreter to use
ending = ".".join(file.split(".")[:-1])
try:
interpreters.get(ending, shutil.copyfile)(file, destination, **kwargs)
except Exception as exception:
# if the interpreter chokes, raise an InterpreterError with some useful information.
raise InterpreterError("%s on file '%s': %s" %(ending, file, exception))
Define a default interpreter rather than using shutil.copyfile.
It would choke before if it was handed a file-like object rather than a
file name. Even more bleh!.'''
These are some utilites used when writing and handling interpreters.
'''
import shutil
from cytoplasm import configuration
from cytoplasm.errors import InterpreterError
def SaveReturned(fn):
'''Some potential interpreters, like Mako, don't give you an easy way to save to a destination.
In these cases, simply use this function as a decorater.'''
def InterpreterWithSave(source, destination, **kwargs):
# under some circumstances, this should be able to write to file-like objects;
# so if destination is a string, assume it's a path; otherwise, it's a file-like object
if isinstance(destination, str):
f = open(destination, "w")
else:
f = destination
# pass **kwargs to this function.
f.write(fn(source, **kwargs))
f.close()
return InterpreterWithSave
@SaveReturned
def default_interpreter(source, **kwargs):
f = open(source)
source_string = f.read()
f.close()
return source_string
def interpret(file, destination, **kwargs):
"Interpret a file with an interpreter according to its suffix."
# get the list of interpreters from the configuration
interpreters = configuration.get_config().interpreters
# figure out the suffix of the file, to use to determine which interpreter to use
ending = file.split(".")[-1]
interpreters.get(ending, default_interpreter)(file, destination, **kwargs)
| <commit_before>'''
These are some utilites used when writing and handling interpreters.
'''
import shutil
from cytoplasm import configuration
from cytoplasm.errors import InterpreterError
def SaveReturned(fn):
'''Some potential interpreters, like Mako, don't give you an easy way to save to a destination.
In these cases, simply use this function as a decorater.'''
def InterpreterWithSave(source, destination, **kwargs):
# under some circumstances, this should be able to write to file-like objects;
# so if destination is a string, assume it's a path; otherwise, it's a file-like object
if isinstance(destination, str):
f = open(destination, "w")
else:
f = destination
# pass **kwargs to this function.
f.write(fn(source, **kwargs))
f.close()
return InterpreterWithSave
def interpret(file, destination, **kwargs):
"Interpret a file with an interpreter according to its suffix."
# get the list of interpreters from the configuration
interpreters = configuration.get_config().interpreters
# figure out the suffix of the file, to use to determine which interpreter to use
ending = ".".join(file.split(".")[:-1])
try:
interpreters.get(ending, shutil.copyfile)(file, destination, **kwargs)
except Exception as exception:
# if the interpreter chokes, raise an InterpreterError with some useful information.
raise InterpreterError("%s on file '%s': %s" %(ending, file, exception))
<commit_msg>Define a default interpreter rather than using shutil.copyfile.
It would choke before if it was handed a file-like object rather than a
file name. Even more bleh!.<commit_after>'''
These are some utilites used when writing and handling interpreters.
'''
import shutil
from cytoplasm import configuration
from cytoplasm.errors import InterpreterError
def SaveReturned(fn):
'''Some potential interpreters, like Mako, don't give you an easy way to save to a destination.
In these cases, simply use this function as a decorater.'''
def InterpreterWithSave(source, destination, **kwargs):
# under some circumstances, this should be able to write to file-like objects;
# so if destination is a string, assume it's a path; otherwise, it's a file-like object
if isinstance(destination, str):
f = open(destination, "w")
else:
f = destination
# pass **kwargs to this function.
f.write(fn(source, **kwargs))
f.close()
return InterpreterWithSave
@SaveReturned
def default_interpreter(source, **kwargs):
f = open(source)
source_string = f.read()
f.close()
return source_string
def interpret(file, destination, **kwargs):
"Interpret a file with an interpreter according to its suffix."
# get the list of interpreters from the configuration
interpreters = configuration.get_config().interpreters
# figure out the suffix of the file, to use to determine which interpreter to use
ending = file.split(".")[-1]
interpreters.get(ending, default_interpreter)(file, destination, **kwargs)
|
5934669c0edbd914d14612e16be7c88641b50bee | test/test_chat_chatserverstatus.py | test/test_chat_chatserverstatus.py | from pytwitcherapi import chat
def test_eq_str(servers):
assert servers[0] == '192.16.64.11:80',\
"Server should be equal to the same address."
def test_noteq_str(servers):
assert servers[0] != '192.16.64.50:89',\
"""Server should not be equal to a different address"""
def test_eq(servers):
s1 = chat.ChatServerStatus('192.16.64.11:80')
assert servers[0] == s1,\
"""Servers with same address should be equal"""
def test_noteq(servers):
assert servers[0] != servers[1],\
"""Servers with different address should not be equal"""
def test_lt(servers):
sortedservers = sorted(servers)
expected = [servers[2], servers[3], servers[0], servers[1]]
assert sortedservers == expected,\
"""Server should be sorted like this: online, then offline,
little errors, then more errors, little lag, then more lag."""
| from pytwitcherapi import chat
def test_eq_str(servers):
assert servers[0] == '192.16.64.11:80',\
"Server should be equal to the same address."
def test_noteq_str(servers):
assert servers[0] != '192.16.64.50:89',\
"""Server should not be equal to a different address"""
def test_eq(servers):
s1 = chat.ChatServerStatus('192.16.64.11:80')
assert servers[0] == s1,\
"""Servers with same address should be equal"""
assert not (s1 == 123),\
"""Servers should not be eqaul to other classes with different id"""
def test_noteq(servers):
assert not (servers[0] == servers[1]),\
"""Servers with different address should not be equal"""
def test_lt(servers):
sortedservers = sorted(servers)
expected = [servers[2], servers[3], servers[0], servers[1]]
assert sortedservers == expected,\
"""Server should be sorted like this: online, then offline,
little errors, then more errors, little lag, then more lag."""
| Fix test for eq and test eq with other classes | Fix test for eq and test eq with other classes
| Python | bsd-3-clause | Pytwitcher/pytwitcherapi,Pytwitcher/pytwitcherapi | from pytwitcherapi import chat
def test_eq_str(servers):
assert servers[0] == '192.16.64.11:80',\
"Server should be equal to the same address."
def test_noteq_str(servers):
assert servers[0] != '192.16.64.50:89',\
"""Server should not be equal to a different address"""
def test_eq(servers):
s1 = chat.ChatServerStatus('192.16.64.11:80')
assert servers[0] == s1,\
"""Servers with same address should be equal"""
def test_noteq(servers):
assert servers[0] != servers[1],\
"""Servers with different address should not be equal"""
def test_lt(servers):
sortedservers = sorted(servers)
expected = [servers[2], servers[3], servers[0], servers[1]]
assert sortedservers == expected,\
"""Server should be sorted like this: online, then offline,
little errors, then more errors, little lag, then more lag."""
Fix test for eq and test eq with other classes | from pytwitcherapi import chat
def test_eq_str(servers):
assert servers[0] == '192.16.64.11:80',\
"Server should be equal to the same address."
def test_noteq_str(servers):
assert servers[0] != '192.16.64.50:89',\
"""Server should not be equal to a different address"""
def test_eq(servers):
s1 = chat.ChatServerStatus('192.16.64.11:80')
assert servers[0] == s1,\
"""Servers with same address should be equal"""
assert not (s1 == 123),\
"""Servers should not be eqaul to other classes with different id"""
def test_noteq(servers):
assert not (servers[0] == servers[1]),\
"""Servers with different address should not be equal"""
def test_lt(servers):
sortedservers = sorted(servers)
expected = [servers[2], servers[3], servers[0], servers[1]]
assert sortedservers == expected,\
"""Server should be sorted like this: online, then offline,
little errors, then more errors, little lag, then more lag."""
| <commit_before>from pytwitcherapi import chat
def test_eq_str(servers):
assert servers[0] == '192.16.64.11:80',\
"Server should be equal to the same address."
def test_noteq_str(servers):
assert servers[0] != '192.16.64.50:89',\
"""Server should not be equal to a different address"""
def test_eq(servers):
s1 = chat.ChatServerStatus('192.16.64.11:80')
assert servers[0] == s1,\
"""Servers with same address should be equal"""
def test_noteq(servers):
assert servers[0] != servers[1],\
"""Servers with different address should not be equal"""
def test_lt(servers):
sortedservers = sorted(servers)
expected = [servers[2], servers[3], servers[0], servers[1]]
assert sortedservers == expected,\
"""Server should be sorted like this: online, then offline,
little errors, then more errors, little lag, then more lag."""
<commit_msg>Fix test for eq and test eq with other classes<commit_after> | from pytwitcherapi import chat
def test_eq_str(servers):
assert servers[0] == '192.16.64.11:80',\
"Server should be equal to the same address."
def test_noteq_str(servers):
assert servers[0] != '192.16.64.50:89',\
"""Server should not be equal to a different address"""
def test_eq(servers):
s1 = chat.ChatServerStatus('192.16.64.11:80')
assert servers[0] == s1,\
"""Servers with same address should be equal"""
assert not (s1 == 123),\
"""Servers should not be eqaul to other classes with different id"""
def test_noteq(servers):
assert not (servers[0] == servers[1]),\
"""Servers with different address should not be equal"""
def test_lt(servers):
sortedservers = sorted(servers)
expected = [servers[2], servers[3], servers[0], servers[1]]
assert sortedservers == expected,\
"""Server should be sorted like this: online, then offline,
little errors, then more errors, little lag, then more lag."""
| from pytwitcherapi import chat
def test_eq_str(servers):
assert servers[0] == '192.16.64.11:80',\
"Server should be equal to the same address."
def test_noteq_str(servers):
assert servers[0] != '192.16.64.50:89',\
"""Server should not be equal to a different address"""
def test_eq(servers):
s1 = chat.ChatServerStatus('192.16.64.11:80')
assert servers[0] == s1,\
"""Servers with same address should be equal"""
def test_noteq(servers):
assert servers[0] != servers[1],\
"""Servers with different address should not be equal"""
def test_lt(servers):
sortedservers = sorted(servers)
expected = [servers[2], servers[3], servers[0], servers[1]]
assert sortedservers == expected,\
"""Server should be sorted like this: online, then offline,
little errors, then more errors, little lag, then more lag."""
Fix test for eq and test eq with other classesfrom pytwitcherapi import chat
def test_eq_str(servers):
assert servers[0] == '192.16.64.11:80',\
"Server should be equal to the same address."
def test_noteq_str(servers):
assert servers[0] != '192.16.64.50:89',\
"""Server should not be equal to a different address"""
def test_eq(servers):
s1 = chat.ChatServerStatus('192.16.64.11:80')
assert servers[0] == s1,\
"""Servers with same address should be equal"""
assert not (s1 == 123),\
"""Servers should not be eqaul to other classes with different id"""
def test_noteq(servers):
assert not (servers[0] == servers[1]),\
"""Servers with different address should not be equal"""
def test_lt(servers):
sortedservers = sorted(servers)
expected = [servers[2], servers[3], servers[0], servers[1]]
assert sortedservers == expected,\
"""Server should be sorted like this: online, then offline,
little errors, then more errors, little lag, then more lag."""
| <commit_before>from pytwitcherapi import chat
def test_eq_str(servers):
assert servers[0] == '192.16.64.11:80',\
"Server should be equal to the same address."
def test_noteq_str(servers):
assert servers[0] != '192.16.64.50:89',\
"""Server should not be equal to a different address"""
def test_eq(servers):
s1 = chat.ChatServerStatus('192.16.64.11:80')
assert servers[0] == s1,\
"""Servers with same address should be equal"""
def test_noteq(servers):
assert servers[0] != servers[1],\
"""Servers with different address should not be equal"""
def test_lt(servers):
sortedservers = sorted(servers)
expected = [servers[2], servers[3], servers[0], servers[1]]
assert sortedservers == expected,\
"""Server should be sorted like this: online, then offline,
little errors, then more errors, little lag, then more lag."""
<commit_msg>Fix test for eq and test eq with other classes<commit_after>from pytwitcherapi import chat
def test_eq_str(servers):
assert servers[0] == '192.16.64.11:80',\
"Server should be equal to the same address."
def test_noteq_str(servers):
assert servers[0] != '192.16.64.50:89',\
"""Server should not be equal to a different address"""
def test_eq(servers):
s1 = chat.ChatServerStatus('192.16.64.11:80')
assert servers[0] == s1,\
"""Servers with same address should be equal"""
assert not (s1 == 123),\
"""Servers should not be eqaul to other classes with different id"""
def test_noteq(servers):
assert not (servers[0] == servers[1]),\
"""Servers with different address should not be equal"""
def test_lt(servers):
sortedservers = sorted(servers)
expected = [servers[2], servers[3], servers[0], servers[1]]
assert sortedservers == expected,\
"""Server should be sorted like this: online, then offline,
little errors, then more errors, little lag, then more lag."""
|
0cc04e9a486fb7dcf312a5c336f8f529f8b1f32d | skcode/__init__.py | skcode/__init__.py | """
SkCode (Python implementation of BBcode syntax) parser library.
"""
# Package information
__author__ = "Fabien Batteix (@skywodd)"
__copyright__ = "Copyright 2015, TamiaLab"
__credits__ = ["Fabien Batteix", "TamiaLab"]
__license__ = "GPLv3"
__version__ = "1.0.4"
__maintainer__ = "Fabien Batteix"
__email__ = "fabien.batteix@tamialab.fr"
__status__ = "Development" # "Production"
# User friendly imports
from .treebuilder import parse_skcode
from .render import (render_to_html,
render_to_skcode,
render_to_text)
| """
SkCode (Python implementation of BBcode syntax) parser library.
"""
# Package information
__author__ = "Fabien Batteix (@skywodd)"
__copyright__ = "Copyright 2015, TamiaLab"
__credits__ = ["Fabien Batteix", "TamiaLab"]
__license__ = "GPLv3"
__version__ = "1.0.5"
__maintainer__ = "Fabien Batteix"
__email__ = "fabien.batteix@tamialab.fr"
__status__ = "Development" # "Production"
# User friendly imports
from .treebuilder import parse_skcode
from .render import (render_to_html,
render_to_skcode,
render_to_text)
| Update version 1.0.4 -> 1.0.5 | Update version 1.0.4 -> 1.0.5
| Python | agpl-3.0 | TamiaLab/PySkCode | """
SkCode (Python implementation of BBcode syntax) parser library.
"""
# Package information
__author__ = "Fabien Batteix (@skywodd)"
__copyright__ = "Copyright 2015, TamiaLab"
__credits__ = ["Fabien Batteix", "TamiaLab"]
__license__ = "GPLv3"
__version__ = "1.0.4"
__maintainer__ = "Fabien Batteix"
__email__ = "fabien.batteix@tamialab.fr"
__status__ = "Development" # "Production"
# User friendly imports
from .treebuilder import parse_skcode
from .render import (render_to_html,
render_to_skcode,
render_to_text)
Update version 1.0.4 -> 1.0.5 | """
SkCode (Python implementation of BBcode syntax) parser library.
"""
# Package information
__author__ = "Fabien Batteix (@skywodd)"
__copyright__ = "Copyright 2015, TamiaLab"
__credits__ = ["Fabien Batteix", "TamiaLab"]
__license__ = "GPLv3"
__version__ = "1.0.5"
__maintainer__ = "Fabien Batteix"
__email__ = "fabien.batteix@tamialab.fr"
__status__ = "Development" # "Production"
# User friendly imports
from .treebuilder import parse_skcode
from .render import (render_to_html,
render_to_skcode,
render_to_text)
| <commit_before>"""
SkCode (Python implementation of BBcode syntax) parser library.
"""
# Package information
__author__ = "Fabien Batteix (@skywodd)"
__copyright__ = "Copyright 2015, TamiaLab"
__credits__ = ["Fabien Batteix", "TamiaLab"]
__license__ = "GPLv3"
__version__ = "1.0.4"
__maintainer__ = "Fabien Batteix"
__email__ = "fabien.batteix@tamialab.fr"
__status__ = "Development" # "Production"
# User friendly imports
from .treebuilder import parse_skcode
from .render import (render_to_html,
render_to_skcode,
render_to_text)
<commit_msg>Update version 1.0.4 -> 1.0.5<commit_after> | """
SkCode (Python implementation of BBcode syntax) parser library.
"""
# Package information
__author__ = "Fabien Batteix (@skywodd)"
__copyright__ = "Copyright 2015, TamiaLab"
__credits__ = ["Fabien Batteix", "TamiaLab"]
__license__ = "GPLv3"
__version__ = "1.0.5"
__maintainer__ = "Fabien Batteix"
__email__ = "fabien.batteix@tamialab.fr"
__status__ = "Development" # "Production"
# User friendly imports
from .treebuilder import parse_skcode
from .render import (render_to_html,
render_to_skcode,
render_to_text)
| """
SkCode (Python implementation of BBcode syntax) parser library.
"""
# Package information
__author__ = "Fabien Batteix (@skywodd)"
__copyright__ = "Copyright 2015, TamiaLab"
__credits__ = ["Fabien Batteix", "TamiaLab"]
__license__ = "GPLv3"
__version__ = "1.0.4"
__maintainer__ = "Fabien Batteix"
__email__ = "fabien.batteix@tamialab.fr"
__status__ = "Development" # "Production"
# User friendly imports
from .treebuilder import parse_skcode
from .render import (render_to_html,
render_to_skcode,
render_to_text)
Update version 1.0.4 -> 1.0.5"""
SkCode (Python implementation of BBcode syntax) parser library.
"""
# Package information
__author__ = "Fabien Batteix (@skywodd)"
__copyright__ = "Copyright 2015, TamiaLab"
__credits__ = ["Fabien Batteix", "TamiaLab"]
__license__ = "GPLv3"
__version__ = "1.0.5"
__maintainer__ = "Fabien Batteix"
__email__ = "fabien.batteix@tamialab.fr"
__status__ = "Development" # "Production"
# User friendly imports
from .treebuilder import parse_skcode
from .render import (render_to_html,
render_to_skcode,
render_to_text)
| <commit_before>"""
SkCode (Python implementation of BBcode syntax) parser library.
"""
# Package information
__author__ = "Fabien Batteix (@skywodd)"
__copyright__ = "Copyright 2015, TamiaLab"
__credits__ = ["Fabien Batteix", "TamiaLab"]
__license__ = "GPLv3"
__version__ = "1.0.4"
__maintainer__ = "Fabien Batteix"
__email__ = "fabien.batteix@tamialab.fr"
__status__ = "Development" # "Production"
# User friendly imports
from .treebuilder import parse_skcode
from .render import (render_to_html,
render_to_skcode,
render_to_text)
<commit_msg>Update version 1.0.4 -> 1.0.5<commit_after>"""
SkCode (Python implementation of BBcode syntax) parser library.
"""
# Package information
__author__ = "Fabien Batteix (@skywodd)"
__copyright__ = "Copyright 2015, TamiaLab"
__credits__ = ["Fabien Batteix", "TamiaLab"]
__license__ = "GPLv3"
__version__ = "1.0.5"
__maintainer__ = "Fabien Batteix"
__email__ = "fabien.batteix@tamialab.fr"
__status__ = "Development" # "Production"
# User friendly imports
from .treebuilder import parse_skcode
from .render import (render_to_html,
render_to_skcode,
render_to_text)
|
76829380376c31ea3f1e899770d1edffd1afc047 | apps/profiles/utils.py | apps/profiles/utils.py | import hashlib
def get_gravatar_url(email):
email_hash = hashlib.md5(email.lower().encode('utf-8')).hexdigest()
return "http://www.gravatar.com/avatar/{}".format(email_hash)
| import hashlib
def get_gravatar_url(email):
email_hash = hashlib.md5(email.lower().encode('utf-8')).hexdigest()
return "https://www.gravatar.com/avatar/{}".format(email_hash)
| Change gravatar url to use https | Change gravatar url to use https
| Python | mit | SoPR/horas,SoPR/horas,SoPR/horas,SoPR/horas | import hashlib
def get_gravatar_url(email):
email_hash = hashlib.md5(email.lower().encode('utf-8')).hexdigest()
return "http://www.gravatar.com/avatar/{}".format(email_hash)
Change gravatar url to use https | import hashlib
def get_gravatar_url(email):
email_hash = hashlib.md5(email.lower().encode('utf-8')).hexdigest()
return "https://www.gravatar.com/avatar/{}".format(email_hash)
| <commit_before>import hashlib
def get_gravatar_url(email):
email_hash = hashlib.md5(email.lower().encode('utf-8')).hexdigest()
return "http://www.gravatar.com/avatar/{}".format(email_hash)
<commit_msg>Change gravatar url to use https<commit_after> | import hashlib
def get_gravatar_url(email):
email_hash = hashlib.md5(email.lower().encode('utf-8')).hexdigest()
return "https://www.gravatar.com/avatar/{}".format(email_hash)
| import hashlib
def get_gravatar_url(email):
email_hash = hashlib.md5(email.lower().encode('utf-8')).hexdigest()
return "http://www.gravatar.com/avatar/{}".format(email_hash)
Change gravatar url to use httpsimport hashlib
def get_gravatar_url(email):
email_hash = hashlib.md5(email.lower().encode('utf-8')).hexdigest()
return "https://www.gravatar.com/avatar/{}".format(email_hash)
| <commit_before>import hashlib
def get_gravatar_url(email):
email_hash = hashlib.md5(email.lower().encode('utf-8')).hexdigest()
return "http://www.gravatar.com/avatar/{}".format(email_hash)
<commit_msg>Change gravatar url to use https<commit_after>import hashlib
def get_gravatar_url(email):
email_hash = hashlib.md5(email.lower().encode('utf-8')).hexdigest()
return "https://www.gravatar.com/avatar/{}".format(email_hash)
|
ae916c1ee52941bb5a1ccf87abe2a9758897bd08 | IPython/utils/ulinecache.py | IPython/utils/ulinecache.py | """
Wrapper around linecache which decodes files to unicode according to PEP 263.
"""
import functools
import linecache
import sys
from IPython.utils import py3compat
from IPython.utils import openpy
getline = linecache.getline
# getlines has to be looked up at runtime, because doctests monkeypatch it.
@functools.wraps(linecache.getlines)
def getlines(filename, module_globals=None):
return linecache.getlines(filename, module_globals=module_globals)
| """
This module has been deprecated since IPython 6.0.
Wrapper around linecache which decodes files to unicode according to PEP 263.
"""
import functools
import linecache
import sys
from warnings import warn
from IPython.utils import py3compat
from IPython.utils import openpy
getline = linecache.getline
# getlines has to be looked up at runtime, because doctests monkeypatch it.
@functools.wraps(linecache.getlines)
def getlines(filename, module_globals=None):
"""
Deprecated since IPython 6.0
"""
warn(("`IPython.utils.ulinecache.getlines` is deprecated since"
" IPython 6.0 and will be removed in future versions."),
DeprecationWarning, stacklevel=2)
return linecache.getlines(filename, module_globals=module_globals)
| Add deprecation warnings and message to getlines function | Add deprecation warnings and message to getlines function
| Python | bsd-3-clause | ipython/ipython,ipython/ipython | """
Wrapper around linecache which decodes files to unicode according to PEP 263.
"""
import functools
import linecache
import sys
from IPython.utils import py3compat
from IPython.utils import openpy
getline = linecache.getline
# getlines has to be looked up at runtime, because doctests monkeypatch it.
@functools.wraps(linecache.getlines)
def getlines(filename, module_globals=None):
return linecache.getlines(filename, module_globals=module_globals)
Add deprecation warnings and message to getlines function | """
This module has been deprecated since IPython 6.0.
Wrapper around linecache which decodes files to unicode according to PEP 263.
"""
import functools
import linecache
import sys
from warnings import warn
from IPython.utils import py3compat
from IPython.utils import openpy
getline = linecache.getline
# getlines has to be looked up at runtime, because doctests monkeypatch it.
@functools.wraps(linecache.getlines)
def getlines(filename, module_globals=None):
"""
Deprecated since IPython 6.0
"""
warn(("`IPython.utils.ulinecache.getlines` is deprecated since"
" IPython 6.0 and will be removed in future versions."),
DeprecationWarning, stacklevel=2)
return linecache.getlines(filename, module_globals=module_globals)
| <commit_before>"""
Wrapper around linecache which decodes files to unicode according to PEP 263.
"""
import functools
import linecache
import sys
from IPython.utils import py3compat
from IPython.utils import openpy
getline = linecache.getline
# getlines has to be looked up at runtime, because doctests monkeypatch it.
@functools.wraps(linecache.getlines)
def getlines(filename, module_globals=None):
return linecache.getlines(filename, module_globals=module_globals)
<commit_msg>Add deprecation warnings and message to getlines function<commit_after> | """
This module has been deprecated since IPython 6.0.
Wrapper around linecache which decodes files to unicode according to PEP 263.
"""
import functools
import linecache
import sys
from warnings import warn
from IPython.utils import py3compat
from IPython.utils import openpy
getline = linecache.getline
# getlines has to be looked up at runtime, because doctests monkeypatch it.
@functools.wraps(linecache.getlines)
def getlines(filename, module_globals=None):
"""
Deprecated since IPython 6.0
"""
warn(("`IPython.utils.ulinecache.getlines` is deprecated since"
" IPython 6.0 and will be removed in future versions."),
DeprecationWarning, stacklevel=2)
return linecache.getlines(filename, module_globals=module_globals)
| """
Wrapper around linecache which decodes files to unicode according to PEP 263.
"""
import functools
import linecache
import sys
from IPython.utils import py3compat
from IPython.utils import openpy
getline = linecache.getline
# getlines has to be looked up at runtime, because doctests monkeypatch it.
@functools.wraps(linecache.getlines)
def getlines(filename, module_globals=None):
return linecache.getlines(filename, module_globals=module_globals)
Add deprecation warnings and message to getlines function"""
This module has been deprecated since IPython 6.0.
Wrapper around linecache which decodes files to unicode according to PEP 263.
"""
import functools
import linecache
import sys
from warnings import warn
from IPython.utils import py3compat
from IPython.utils import openpy
getline = linecache.getline
# getlines has to be looked up at runtime, because doctests monkeypatch it.
@functools.wraps(linecache.getlines)
def getlines(filename, module_globals=None):
"""
Deprecated since IPython 6.0
"""
warn(("`IPython.utils.ulinecache.getlines` is deprecated since"
" IPython 6.0 and will be removed in future versions."),
DeprecationWarning, stacklevel=2)
return linecache.getlines(filename, module_globals=module_globals)
| <commit_before>"""
Wrapper around linecache which decodes files to unicode according to PEP 263.
"""
import functools
import linecache
import sys
from IPython.utils import py3compat
from IPython.utils import openpy
getline = linecache.getline
# getlines has to be looked up at runtime, because doctests monkeypatch it.
@functools.wraps(linecache.getlines)
def getlines(filename, module_globals=None):
return linecache.getlines(filename, module_globals=module_globals)
<commit_msg>Add deprecation warnings and message to getlines function<commit_after>"""
This module has been deprecated since IPython 6.0.
Wrapper around linecache which decodes files to unicode according to PEP 263.
"""
import functools
import linecache
import sys
from warnings import warn
from IPython.utils import py3compat
from IPython.utils import openpy
getline = linecache.getline
# getlines has to be looked up at runtime, because doctests monkeypatch it.
@functools.wraps(linecache.getlines)
def getlines(filename, module_globals=None):
"""
Deprecated since IPython 6.0
"""
warn(("`IPython.utils.ulinecache.getlines` is deprecated since"
" IPython 6.0 and will be removed in future versions."),
DeprecationWarning, stacklevel=2)
return linecache.getlines(filename, module_globals=module_globals)
|
31381728cb8d76314c82833d4400b4140fcc573f | django_jinja/builtins/global_context.py | django_jinja/builtins/global_context.py | # -*- coding: utf-8 -*-
import logging
from django.conf import settings
from django.core.urlresolvers import reverse as django_reverse, NoReverseMatch
from django.contrib.staticfiles.storage import staticfiles_storage
JINJA2_MUTE_URLRESOLVE_EXCEPTIONS = getattr(settings, "JINJA2_MUTE_URLRESOLVE_EXCEPTIONS", False)
logger = logging.getLogger(__name__)
def url(name, *args, **kwargs):
"""
Shortcut filter for reverse url on templates. Is a alternative to
django {% url %} tag, but more simple.
Usage example:
{{ url('web:timeline', userid=2) }}
This is a equivalent to django:
{% url 'web:timeline' userid=2 %}
"""
try:
return django_reverse(name, args=args, kwargs=kwargs)
except NoReverseMatch as exc:
logger.error('Error: %s', exc)
if not JINJA2_MUTE_URLRESOLVE_EXCEPTIONS:
raise
return ''
def static(path):
return staticfiles_storage.url(path)
| # -*- coding: utf-8 -*-
import logging
from django.conf import settings
from django.core.urlresolvers import reverse as django_reverse, NoReverseMatch
from django.contrib.staticfiles.storage import staticfiles_storage
JINJA2_MUTE_URLRESOLVE_EXCEPTIONS = getattr(settings, "JINJA2_MUTE_URLRESOLVE_EXCEPTIONS", False)
logger = logging.getLogger(__name__)
def url(view_name, *args, **kwargs):
"""
Shortcut filter for reverse url on templates. Is a alternative to
django {% url %} tag, but more simple.
Usage example:
{{ url('web:timeline', userid=2) }}
This is a equivalent to django:
{% url 'web:timeline' userid=2 %}
"""
try:
return django_reverse(view_name, args=args, kwargs=kwargs)
except NoReverseMatch as exc:
logger.error('Error: %s', exc)
if not JINJA2_MUTE_URLRESOLVE_EXCEPTIONS:
raise
return ''
def static(path):
return staticfiles_storage.url(path)
| Change parameter name so it does not conflict with an url parameter called "name". | builtins/url: Change parameter name so it does not conflict with an url parameter called "name".
This reflects the same name used in https://github.com/coffin/coffin/blob/master/coffin/template/defaultfilters.py, but it's probably as bad as a solution, because now you cannot use url() with a "view_name" url parameter. Maybe a better way to implement it would be to pop the first *args element (that'd raise if no arg is provided) and use it as the view name. | Python | bsd-3-clause | akx/django-jinja,glogiotatidis/django-jinja,glogiotatidis/django-jinja,akx/django-jinja,akx/django-jinja,glogiotatidis/django-jinja,niwinz/django-jinja,glogiotatidis/django-jinja,niwinz/django-jinja,akx/django-jinja,niwinz/django-jinja | # -*- coding: utf-8 -*-
import logging
from django.conf import settings
from django.core.urlresolvers import reverse as django_reverse, NoReverseMatch
from django.contrib.staticfiles.storage import staticfiles_storage
JINJA2_MUTE_URLRESOLVE_EXCEPTIONS = getattr(settings, "JINJA2_MUTE_URLRESOLVE_EXCEPTIONS", False)
logger = logging.getLogger(__name__)
def url(name, *args, **kwargs):
"""
Shortcut filter for reverse url on templates. Is a alternative to
django {% url %} tag, but more simple.
Usage example:
{{ url('web:timeline', userid=2) }}
This is a equivalent to django:
{% url 'web:timeline' userid=2 %}
"""
try:
return django_reverse(name, args=args, kwargs=kwargs)
except NoReverseMatch as exc:
logger.error('Error: %s', exc)
if not JINJA2_MUTE_URLRESOLVE_EXCEPTIONS:
raise
return ''
def static(path):
return staticfiles_storage.url(path)
builtins/url: Change parameter name so it does not conflict with an url parameter called "name".
This reflects the same name used in https://github.com/coffin/coffin/blob/master/coffin/template/defaultfilters.py, but it's probably as bad as a solution, because now you cannot use url() with a "view_name" url parameter. Maybe a better way to implement it would be to pop the first *args element (that'd raise if no arg is provided) and use it as the view name. | # -*- coding: utf-8 -*-
import logging
from django.conf import settings
from django.core.urlresolvers import reverse as django_reverse, NoReverseMatch
from django.contrib.staticfiles.storage import staticfiles_storage
JINJA2_MUTE_URLRESOLVE_EXCEPTIONS = getattr(settings, "JINJA2_MUTE_URLRESOLVE_EXCEPTIONS", False)
logger = logging.getLogger(__name__)
def url(view_name, *args, **kwargs):
"""
Shortcut filter for reverse url on templates. Is a alternative to
django {% url %} tag, but more simple.
Usage example:
{{ url('web:timeline', userid=2) }}
This is a equivalent to django:
{% url 'web:timeline' userid=2 %}
"""
try:
return django_reverse(view_name, args=args, kwargs=kwargs)
except NoReverseMatch as exc:
logger.error('Error: %s', exc)
if not JINJA2_MUTE_URLRESOLVE_EXCEPTIONS:
raise
return ''
def static(path):
return staticfiles_storage.url(path)
| <commit_before># -*- coding: utf-8 -*-
import logging
from django.conf import settings
from django.core.urlresolvers import reverse as django_reverse, NoReverseMatch
from django.contrib.staticfiles.storage import staticfiles_storage
JINJA2_MUTE_URLRESOLVE_EXCEPTIONS = getattr(settings, "JINJA2_MUTE_URLRESOLVE_EXCEPTIONS", False)
logger = logging.getLogger(__name__)
def url(name, *args, **kwargs):
"""
Shortcut filter for reverse url on templates. Is a alternative to
django {% url %} tag, but more simple.
Usage example:
{{ url('web:timeline', userid=2) }}
This is a equivalent to django:
{% url 'web:timeline' userid=2 %}
"""
try:
return django_reverse(name, args=args, kwargs=kwargs)
except NoReverseMatch as exc:
logger.error('Error: %s', exc)
if not JINJA2_MUTE_URLRESOLVE_EXCEPTIONS:
raise
return ''
def static(path):
return staticfiles_storage.url(path)
<commit_msg>builtins/url: Change parameter name so it does not conflict with an url parameter called "name".
This reflects the same name used in https://github.com/coffin/coffin/blob/master/coffin/template/defaultfilters.py, but it's probably as bad as a solution, because now you cannot use url() with a "view_name" url parameter. Maybe a better way to implement it would be to pop the first *args element (that'd raise if no arg is provided) and use it as the view name.<commit_after> | # -*- coding: utf-8 -*-
import logging
from django.conf import settings
from django.core.urlresolvers import reverse as django_reverse, NoReverseMatch
from django.contrib.staticfiles.storage import staticfiles_storage
JINJA2_MUTE_URLRESOLVE_EXCEPTIONS = getattr(settings, "JINJA2_MUTE_URLRESOLVE_EXCEPTIONS", False)
logger = logging.getLogger(__name__)
def url(view_name, *args, **kwargs):
"""
Shortcut filter for reverse url on templates. Is a alternative to
django {% url %} tag, but more simple.
Usage example:
{{ url('web:timeline', userid=2) }}
This is a equivalent to django:
{% url 'web:timeline' userid=2 %}
"""
try:
return django_reverse(view_name, args=args, kwargs=kwargs)
except NoReverseMatch as exc:
logger.error('Error: %s', exc)
if not JINJA2_MUTE_URLRESOLVE_EXCEPTIONS:
raise
return ''
def static(path):
return staticfiles_storage.url(path)
| # -*- coding: utf-8 -*-
import logging
from django.conf import settings
from django.core.urlresolvers import reverse as django_reverse, NoReverseMatch
from django.contrib.staticfiles.storage import staticfiles_storage
JINJA2_MUTE_URLRESOLVE_EXCEPTIONS = getattr(settings, "JINJA2_MUTE_URLRESOLVE_EXCEPTIONS", False)
logger = logging.getLogger(__name__)
def url(name, *args, **kwargs):
"""
Shortcut filter for reverse url on templates. Is a alternative to
django {% url %} tag, but more simple.
Usage example:
{{ url('web:timeline', userid=2) }}
This is a equivalent to django:
{% url 'web:timeline' userid=2 %}
"""
try:
return django_reverse(name, args=args, kwargs=kwargs)
except NoReverseMatch as exc:
logger.error('Error: %s', exc)
if not JINJA2_MUTE_URLRESOLVE_EXCEPTIONS:
raise
return ''
def static(path):
return staticfiles_storage.url(path)
builtins/url: Change parameter name so it does not conflict with an url parameter called "name".
This reflects the same name used in https://github.com/coffin/coffin/blob/master/coffin/template/defaultfilters.py, but it's probably as bad as a solution, because now you cannot use url() with a "view_name" url parameter. Maybe a better way to implement it would be to pop the first *args element (that'd raise if no arg is provided) and use it as the view name.# -*- coding: utf-8 -*-
import logging
from django.conf import settings
from django.core.urlresolvers import reverse as django_reverse, NoReverseMatch
from django.contrib.staticfiles.storage import staticfiles_storage
JINJA2_MUTE_URLRESOLVE_EXCEPTIONS = getattr(settings, "JINJA2_MUTE_URLRESOLVE_EXCEPTIONS", False)
logger = logging.getLogger(__name__)
def url(view_name, *args, **kwargs):
"""
Shortcut filter for reverse url on templates. Is a alternative to
django {% url %} tag, but more simple.
Usage example:
{{ url('web:timeline', userid=2) }}
This is a equivalent to django:
{% url 'web:timeline' userid=2 %}
"""
try:
return django_reverse(view_name, args=args, kwargs=kwargs)
except NoReverseMatch as exc:
logger.error('Error: %s', exc)
if not JINJA2_MUTE_URLRESOLVE_EXCEPTIONS:
raise
return ''
def static(path):
return staticfiles_storage.url(path)
| <commit_before># -*- coding: utf-8 -*-
import logging
from django.conf import settings
from django.core.urlresolvers import reverse as django_reverse, NoReverseMatch
from django.contrib.staticfiles.storage import staticfiles_storage
JINJA2_MUTE_URLRESOLVE_EXCEPTIONS = getattr(settings, "JINJA2_MUTE_URLRESOLVE_EXCEPTIONS", False)
logger = logging.getLogger(__name__)
def url(name, *args, **kwargs):
"""
Shortcut filter for reverse url on templates. Is a alternative to
django {% url %} tag, but more simple.
Usage example:
{{ url('web:timeline', userid=2) }}
This is a equivalent to django:
{% url 'web:timeline' userid=2 %}
"""
try:
return django_reverse(name, args=args, kwargs=kwargs)
except NoReverseMatch as exc:
logger.error('Error: %s', exc)
if not JINJA2_MUTE_URLRESOLVE_EXCEPTIONS:
raise
return ''
def static(path):
return staticfiles_storage.url(path)
<commit_msg>builtins/url: Change parameter name so it does not conflict with an url parameter called "name".
This reflects the same name used in https://github.com/coffin/coffin/blob/master/coffin/template/defaultfilters.py, but it's probably as bad as a solution, because now you cannot use url() with a "view_name" url parameter. Maybe a better way to implement it would be to pop the first *args element (that'd raise if no arg is provided) and use it as the view name.<commit_after># -*- coding: utf-8 -*-
import logging
from django.conf import settings
from django.core.urlresolvers import reverse as django_reverse, NoReverseMatch
from django.contrib.staticfiles.storage import staticfiles_storage
JINJA2_MUTE_URLRESOLVE_EXCEPTIONS = getattr(settings, "JINJA2_MUTE_URLRESOLVE_EXCEPTIONS", False)
logger = logging.getLogger(__name__)
def url(view_name, *args, **kwargs):
"""
Shortcut filter for reverse url on templates. Is a alternative to
django {% url %} tag, but more simple.
Usage example:
{{ url('web:timeline', userid=2) }}
This is a equivalent to django:
{% url 'web:timeline' userid=2 %}
"""
try:
return django_reverse(view_name, args=args, kwargs=kwargs)
except NoReverseMatch as exc:
logger.error('Error: %s', exc)
if not JINJA2_MUTE_URLRESOLVE_EXCEPTIONS:
raise
return ''
def static(path):
return staticfiles_storage.url(path)
|
6dffa2d22fa5da3b2d8fbcdff04477ff0116bfc1 | utilities.py | utilities.py | # Function to return a list of pvs from a given file
import pkg_resources
pkg_resources.require('aphla')
import aphla as ap
def get_pv_names(mode):
''' Given a certain ring mode as a string, return all available pvs '''
ap.machines.load(mode)
result = set()
elements = ap.getElements('*')
for element in elements:
pvs = element.pv()
if(len(pvs) > 0):
pv_name = pvs[0].split(':')[0]
result.add(pv_name)
return result
def get_pvs_from_file(filepath):
''' Return a list of pvs from a given file '''
with open(filepath) as f:
contents = f.read().splitlines()
return contents
def write_pvs_to_file(filename, data):
''' Write given pvs to file '''
f = open(filename, 'w')
for element in data:
f.write(element, '\n')
f.close()
| # Function to return a list of pvs from a given file
import pkg_resources
pkg_resources.require('aphla')
import aphla as ap
def get_pv_names(mode):
''' Given a certain ring mode as a string, return all available pvs '''
ap.machines.load(mode)
result = set()
elements = ap.getElements('*')
for element in elements:
pvs = element.pv()
if(len(pvs) > 0):
pv_name = pvs[0].split(':')[0]
result.add(pv_name)
return result
def get_pvs_from_file(filepath):
''' Return a list of pvs from a given file '''
with open(filepath) as f:
contents = f.read().splitlines()
return contents
def write_pvs_to_file(filename, data):
''' Write given pvs to file '''
f = open(filename, 'w')
for element in data:
f.write(element + '\n')
f.close()
| Resolve a bug in the write function | Resolve a bug in the write function
| Python | apache-2.0 | razvanvasile/Work-Mini-Projects,razvanvasile/Work-Mini-Projects,razvanvasile/Work-Mini-Projects | # Function to return a list of pvs from a given file
import pkg_resources
pkg_resources.require('aphla')
import aphla as ap
def get_pv_names(mode):
''' Given a certain ring mode as a string, return all available pvs '''
ap.machines.load(mode)
result = set()
elements = ap.getElements('*')
for element in elements:
pvs = element.pv()
if(len(pvs) > 0):
pv_name = pvs[0].split(':')[0]
result.add(pv_name)
return result
def get_pvs_from_file(filepath):
''' Return a list of pvs from a given file '''
with open(filepath) as f:
contents = f.read().splitlines()
return contents
def write_pvs_to_file(filename, data):
''' Write given pvs to file '''
f = open(filename, 'w')
for element in data:
f.write(element, '\n')
f.close()
Resolve a bug in the write function | # Function to return a list of pvs from a given file
import pkg_resources
pkg_resources.require('aphla')
import aphla as ap
def get_pv_names(mode):
''' Given a certain ring mode as a string, return all available pvs '''
ap.machines.load(mode)
result = set()
elements = ap.getElements('*')
for element in elements:
pvs = element.pv()
if(len(pvs) > 0):
pv_name = pvs[0].split(':')[0]
result.add(pv_name)
return result
def get_pvs_from_file(filepath):
''' Return a list of pvs from a given file '''
with open(filepath) as f:
contents = f.read().splitlines()
return contents
def write_pvs_to_file(filename, data):
''' Write given pvs to file '''
f = open(filename, 'w')
for element in data:
f.write(element + '\n')
f.close()
| <commit_before># Function to return a list of pvs from a given file
import pkg_resources
pkg_resources.require('aphla')
import aphla as ap
def get_pv_names(mode):
''' Given a certain ring mode as a string, return all available pvs '''
ap.machines.load(mode)
result = set()
elements = ap.getElements('*')
for element in elements:
pvs = element.pv()
if(len(pvs) > 0):
pv_name = pvs[0].split(':')[0]
result.add(pv_name)
return result
def get_pvs_from_file(filepath):
''' Return a list of pvs from a given file '''
with open(filepath) as f:
contents = f.read().splitlines()
return contents
def write_pvs_to_file(filename, data):
''' Write given pvs to file '''
f = open(filename, 'w')
for element in data:
f.write(element, '\n')
f.close()
<commit_msg>Resolve a bug in the write function<commit_after> | # Function to return a list of pvs from a given file
import pkg_resources
pkg_resources.require('aphla')
import aphla as ap
def get_pv_names(mode):
''' Given a certain ring mode as a string, return all available pvs '''
ap.machines.load(mode)
result = set()
elements = ap.getElements('*')
for element in elements:
pvs = element.pv()
if(len(pvs) > 0):
pv_name = pvs[0].split(':')[0]
result.add(pv_name)
return result
def get_pvs_from_file(filepath):
''' Return a list of pvs from a given file '''
with open(filepath) as f:
contents = f.read().splitlines()
return contents
def write_pvs_to_file(filename, data):
''' Write given pvs to file '''
f = open(filename, 'w')
for element in data:
f.write(element + '\n')
f.close()
| # Function to return a list of pvs from a given file
import pkg_resources
pkg_resources.require('aphla')
import aphla as ap
def get_pv_names(mode):
''' Given a certain ring mode as a string, return all available pvs '''
ap.machines.load(mode)
result = set()
elements = ap.getElements('*')
for element in elements:
pvs = element.pv()
if(len(pvs) > 0):
pv_name = pvs[0].split(':')[0]
result.add(pv_name)
return result
def get_pvs_from_file(filepath):
''' Return a list of pvs from a given file '''
with open(filepath) as f:
contents = f.read().splitlines()
return contents
def write_pvs_to_file(filename, data):
''' Write given pvs to file '''
f = open(filename, 'w')
for element in data:
f.write(element, '\n')
f.close()
Resolve a bug in the write function# Function to return a list of pvs from a given file
import pkg_resources
pkg_resources.require('aphla')
import aphla as ap
def get_pv_names(mode):
''' Given a certain ring mode as a string, return all available pvs '''
ap.machines.load(mode)
result = set()
elements = ap.getElements('*')
for element in elements:
pvs = element.pv()
if(len(pvs) > 0):
pv_name = pvs[0].split(':')[0]
result.add(pv_name)
return result
def get_pvs_from_file(filepath):
''' Return a list of pvs from a given file '''
with open(filepath) as f:
contents = f.read().splitlines()
return contents
def write_pvs_to_file(filename, data):
''' Write given pvs to file '''
f = open(filename, 'w')
for element in data:
f.write(element + '\n')
f.close()
| <commit_before># Function to return a list of pvs from a given file
import pkg_resources
pkg_resources.require('aphla')
import aphla as ap
def get_pv_names(mode):
''' Given a certain ring mode as a string, return all available pvs '''
ap.machines.load(mode)
result = set()
elements = ap.getElements('*')
for element in elements:
pvs = element.pv()
if(len(pvs) > 0):
pv_name = pvs[0].split(':')[0]
result.add(pv_name)
return result
def get_pvs_from_file(filepath):
''' Return a list of pvs from a given file '''
with open(filepath) as f:
contents = f.read().splitlines()
return contents
def write_pvs_to_file(filename, data):
''' Write given pvs to file '''
f = open(filename, 'w')
for element in data:
f.write(element, '\n')
f.close()
<commit_msg>Resolve a bug in the write function<commit_after># Function to return a list of pvs from a given file
import pkg_resources
pkg_resources.require('aphla')
import aphla as ap
def get_pv_names(mode):
''' Given a certain ring mode as a string, return all available pvs '''
ap.machines.load(mode)
result = set()
elements = ap.getElements('*')
for element in elements:
pvs = element.pv()
if(len(pvs) > 0):
pv_name = pvs[0].split(':')[0]
result.add(pv_name)
return result
def get_pvs_from_file(filepath):
''' Return a list of pvs from a given file '''
with open(filepath) as f:
contents = f.read().splitlines()
return contents
def write_pvs_to_file(filename, data):
''' Write given pvs to file '''
f = open(filename, 'w')
for element in data:
f.write(element + '\n')
f.close()
|
7f13b29cc918f63c4d1fc24717c0a0b5d2f5f8ad | filter.py | filter.py | import numpy as np
class LowPassFilter(object):
'''
First order discrete IIR filter.
'''
def __init__(self, feedback_gain, initial_value=0.0):
self.feedback_gain = np.ones_like(initial_value) * feedback_gain
self.initial_value = initial_value
self.output_gain = 1.0 - feedback_gain
self.input = np.nan
self.output = initial_value
self.feedback_value = initial_value / self.output_gain
def filter(self, value):
#if not math.isanan(value) and math.isinf(value):
self.input = value
self.feedback_value = value + self.feedback_gain * self.feedback_value
self.output = self.output_gain * self.feedback_value
return self.output
class MovingAverage(object):
'''
Moving average filter.
'''
def __init__(self, lifetime, sampling_time):
self.lifetime = lifetime
self.sampling_time = sampling_time
self.exp = np.exp(-sampling_time / lifetime)
self.last_value = np.nan
self.mean_value = np.nan
def filter(self, value):
self.last_value = value
if np.isnan(self.mean_value):
self.mean_value = value
else:
self.mean_value = value + self.exp * (self.mean_value - value)
return self.mean_value
| import numpy as np
class LowPassFilter(object):
'''
First order discrete IIR filter.
'''
def __init__(self, feedback_gain, initial_value=0.0):
self.feedback_gain = np.ones_like(initial_value) * feedback_gain
self.initial_value = initial_value
self.output_gain = 1.0 - feedback_gain
self.input = np.nan
self.output = initial_value
self.feedback_value = initial_value / self.output_gain
def filter(self, value):
#if not math.isanan(value) and math.isinf(value):
self.input = value
self.feedback_value = value + self.feedback_gain * self.feedback_value
self.output = self.output_gain * self.feedback_value
return self.output
class MovingAverage(object):
'''
Moving average filter.
'''
def __init__(self, lifetime, sampling_time):
self.lifetime = lifetime
self.sampling_time = sampling_time
self.exp = np.exp(-sampling_time / lifetime)
self.last_value = None
self.mean_value = None
def filter(self, value):
self.last_value = value
if self.mean_value is None:
self.mean_value = value
else:
self.mean_value = value + self.exp * (self.mean_value - value)
return self.mean_value
| Fix problem with array values. | Fix problem with array values.
| Python | mit | jcsharp/DriveIt | import numpy as np
class LowPassFilter(object):
'''
First order discrete IIR filter.
'''
def __init__(self, feedback_gain, initial_value=0.0):
self.feedback_gain = np.ones_like(initial_value) * feedback_gain
self.initial_value = initial_value
self.output_gain = 1.0 - feedback_gain
self.input = np.nan
self.output = initial_value
self.feedback_value = initial_value / self.output_gain
def filter(self, value):
#if not math.isanan(value) and math.isinf(value):
self.input = value
self.feedback_value = value + self.feedback_gain * self.feedback_value
self.output = self.output_gain * self.feedback_value
return self.output
class MovingAverage(object):
'''
Moving average filter.
'''
def __init__(self, lifetime, sampling_time):
self.lifetime = lifetime
self.sampling_time = sampling_time
self.exp = np.exp(-sampling_time / lifetime)
self.last_value = np.nan
self.mean_value = np.nan
def filter(self, value):
self.last_value = value
if np.isnan(self.mean_value):
self.mean_value = value
else:
self.mean_value = value + self.exp * (self.mean_value - value)
return self.mean_value
Fix problem with array values. | import numpy as np
class LowPassFilter(object):
'''
First order discrete IIR filter.
'''
def __init__(self, feedback_gain, initial_value=0.0):
self.feedback_gain = np.ones_like(initial_value) * feedback_gain
self.initial_value = initial_value
self.output_gain = 1.0 - feedback_gain
self.input = np.nan
self.output = initial_value
self.feedback_value = initial_value / self.output_gain
def filter(self, value):
#if not math.isanan(value) and math.isinf(value):
self.input = value
self.feedback_value = value + self.feedback_gain * self.feedback_value
self.output = self.output_gain * self.feedback_value
return self.output
class MovingAverage(object):
'''
Moving average filter.
'''
def __init__(self, lifetime, sampling_time):
self.lifetime = lifetime
self.sampling_time = sampling_time
self.exp = np.exp(-sampling_time / lifetime)
self.last_value = None
self.mean_value = None
def filter(self, value):
self.last_value = value
if self.mean_value is None:
self.mean_value = value
else:
self.mean_value = value + self.exp * (self.mean_value - value)
return self.mean_value
| <commit_before>import numpy as np
class LowPassFilter(object):
'''
First order discrete IIR filter.
'''
def __init__(self, feedback_gain, initial_value=0.0):
self.feedback_gain = np.ones_like(initial_value) * feedback_gain
self.initial_value = initial_value
self.output_gain = 1.0 - feedback_gain
self.input = np.nan
self.output = initial_value
self.feedback_value = initial_value / self.output_gain
def filter(self, value):
#if not math.isanan(value) and math.isinf(value):
self.input = value
self.feedback_value = value + self.feedback_gain * self.feedback_value
self.output = self.output_gain * self.feedback_value
return self.output
class MovingAverage(object):
'''
Moving average filter.
'''
def __init__(self, lifetime, sampling_time):
self.lifetime = lifetime
self.sampling_time = sampling_time
self.exp = np.exp(-sampling_time / lifetime)
self.last_value = np.nan
self.mean_value = np.nan
def filter(self, value):
self.last_value = value
if np.isnan(self.mean_value):
self.mean_value = value
else:
self.mean_value = value + self.exp * (self.mean_value - value)
return self.mean_value
<commit_msg>Fix problem with array values.<commit_after> | import numpy as np
class LowPassFilter(object):
'''
First order discrete IIR filter.
'''
def __init__(self, feedback_gain, initial_value=0.0):
self.feedback_gain = np.ones_like(initial_value) * feedback_gain
self.initial_value = initial_value
self.output_gain = 1.0 - feedback_gain
self.input = np.nan
self.output = initial_value
self.feedback_value = initial_value / self.output_gain
def filter(self, value):
#if not math.isanan(value) and math.isinf(value):
self.input = value
self.feedback_value = value + self.feedback_gain * self.feedback_value
self.output = self.output_gain * self.feedback_value
return self.output
class MovingAverage(object):
'''
Moving average filter.
'''
def __init__(self, lifetime, sampling_time):
self.lifetime = lifetime
self.sampling_time = sampling_time
self.exp = np.exp(-sampling_time / lifetime)
self.last_value = None
self.mean_value = None
def filter(self, value):
self.last_value = value
if self.mean_value is None:
self.mean_value = value
else:
self.mean_value = value + self.exp * (self.mean_value - value)
return self.mean_value
| import numpy as np
class LowPassFilter(object):
'''
First order discrete IIR filter.
'''
def __init__(self, feedback_gain, initial_value=0.0):
self.feedback_gain = np.ones_like(initial_value) * feedback_gain
self.initial_value = initial_value
self.output_gain = 1.0 - feedback_gain
self.input = np.nan
self.output = initial_value
self.feedback_value = initial_value / self.output_gain
def filter(self, value):
#if not math.isanan(value) and math.isinf(value):
self.input = value
self.feedback_value = value + self.feedback_gain * self.feedback_value
self.output = self.output_gain * self.feedback_value
return self.output
class MovingAverage(object):
'''
Moving average filter.
'''
def __init__(self, lifetime, sampling_time):
self.lifetime = lifetime
self.sampling_time = sampling_time
self.exp = np.exp(-sampling_time / lifetime)
self.last_value = np.nan
self.mean_value = np.nan
def filter(self, value):
self.last_value = value
if np.isnan(self.mean_value):
self.mean_value = value
else:
self.mean_value = value + self.exp * (self.mean_value - value)
return self.mean_value
Fix problem with array values.import numpy as np
class LowPassFilter(object):
'''
First order discrete IIR filter.
'''
def __init__(self, feedback_gain, initial_value=0.0):
self.feedback_gain = np.ones_like(initial_value) * feedback_gain
self.initial_value = initial_value
self.output_gain = 1.0 - feedback_gain
self.input = np.nan
self.output = initial_value
self.feedback_value = initial_value / self.output_gain
def filter(self, value):
#if not math.isanan(value) and math.isinf(value):
self.input = value
self.feedback_value = value + self.feedback_gain * self.feedback_value
self.output = self.output_gain * self.feedback_value
return self.output
class MovingAverage(object):
'''
Moving average filter.
'''
def __init__(self, lifetime, sampling_time):
self.lifetime = lifetime
self.sampling_time = sampling_time
self.exp = np.exp(-sampling_time / lifetime)
self.last_value = None
self.mean_value = None
def filter(self, value):
self.last_value = value
if self.mean_value is None:
self.mean_value = value
else:
self.mean_value = value + self.exp * (self.mean_value - value)
return self.mean_value
| <commit_before>import numpy as np
class LowPassFilter(object):
'''
First order discrete IIR filter.
'''
def __init__(self, feedback_gain, initial_value=0.0):
self.feedback_gain = np.ones_like(initial_value) * feedback_gain
self.initial_value = initial_value
self.output_gain = 1.0 - feedback_gain
self.input = np.nan
self.output = initial_value
self.feedback_value = initial_value / self.output_gain
def filter(self, value):
#if not math.isanan(value) and math.isinf(value):
self.input = value
self.feedback_value = value + self.feedback_gain * self.feedback_value
self.output = self.output_gain * self.feedback_value
return self.output
class MovingAverage(object):
'''
Moving average filter.
'''
def __init__(self, lifetime, sampling_time):
self.lifetime = lifetime
self.sampling_time = sampling_time
self.exp = np.exp(-sampling_time / lifetime)
self.last_value = np.nan
self.mean_value = np.nan
def filter(self, value):
self.last_value = value
if np.isnan(self.mean_value):
self.mean_value = value
else:
self.mean_value = value + self.exp * (self.mean_value - value)
return self.mean_value
<commit_msg>Fix problem with array values.<commit_after>import numpy as np
class LowPassFilter(object):
'''
First order discrete IIR filter.
'''
def __init__(self, feedback_gain, initial_value=0.0):
self.feedback_gain = np.ones_like(initial_value) * feedback_gain
self.initial_value = initial_value
self.output_gain = 1.0 - feedback_gain
self.input = np.nan
self.output = initial_value
self.feedback_value = initial_value / self.output_gain
def filter(self, value):
#if not math.isanan(value) and math.isinf(value):
self.input = value
self.feedback_value = value + self.feedback_gain * self.feedback_value
self.output = self.output_gain * self.feedback_value
return self.output
class MovingAverage(object):
'''
Moving average filter.
'''
def __init__(self, lifetime, sampling_time):
self.lifetime = lifetime
self.sampling_time = sampling_time
self.exp = np.exp(-sampling_time / lifetime)
self.last_value = None
self.mean_value = None
def filter(self, value):
self.last_value = value
if self.mean_value is None:
self.mean_value = value
else:
self.mean_value = value + self.exp * (self.mean_value - value)
return self.mean_value
|
b717696b5cff69e3586e06c399be7d06c057e503 | nova/tests/fake_utils.py | nova/tests/fake_utils.py | # Copyright (c) 2013 Rackspace Hosting
#
# 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.
"""This modules stubs out functions in nova.utils."""
from nova import utils
def stub_out_utils_spawn_n(stubs):
"""Stubs out spawn_n with a blocking version.
This aids testing async processes by blocking until they're done.
"""
def no_spawn(func, *args, **kwargs):
return func(*args, **kwargs)
stubs.Set(utils, 'spawn_n', no_spawn)
| # Copyright (c) 2013 Rackspace Hosting
#
# 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.
"""This modules stubs out functions in nova.utils."""
from nova import utils
def stub_out_utils_spawn_n(stubs):
"""Stubs out spawn_n with a blocking version.
This aids testing async processes by blocking until they're done.
"""
def no_spawn(func, *args, **kwargs):
try:
return func(*args, **kwargs)
except Exception:
# NOTE(danms): This is supposed to simulate spawning
# of a thread, which would run separate from the parent,
# and die silently on error. If we don't catch and discard
# any exceptions here, we're not honoring the usual
# behavior.
pass
stubs.Set(utils, 'spawn_n', no_spawn)
| Make spawn_n() stub properly ignore errors in the child thread work | Make spawn_n() stub properly ignore errors in the child thread work
When we call spawn_n() normally, we fork off a thread that can run or
die on its own, without affecting the parent. In unit tests, we stub
this out to be a synchronous call, but we allow any exceptions that
occur in that work to bubble up to the caller. This is not normal
behavior and thus we should discard any such exceptions in order to
mimic actual behavior of a child thread.
Change-Id: I35ab21e9525aa76cced797436daa0b99a4fa99f2
Related-bug: #1349147
| Python | apache-2.0 | barnsnake351/nova,dawnpower/nova,alvarolopez/nova,JioCloud/nova_test_latest,joker946/nova,apporc/nova,cyx1231st/nova,dims/nova,klmitch/nova,mgagne/nova,openstack/nova,orbitfp7/nova,phenoxim/nova,rajalokan/nova,Stavitsky/nova,akash1808/nova_test_latest,apporc/nova,projectcalico/calico-nova,devendermishrajio/nova_test_latest,noironetworks/nova,maelnor/nova,j-carpentier/nova,dims/nova,ted-gould/nova,tangfeixiong/nova,zaina/nova,rajalokan/nova,rahulunair/nova,takeshineshiro/nova,LoHChina/nova,cloudbase/nova,fnordahl/nova,mikalstill/nova,fnordahl/nova,viggates/nova,gooddata/openstack-nova,vmturbo/nova,saleemjaveds/https-github.com-openstack-nova,alaski/nova,Metaswitch/calico-nova,JioCloud/nova_test_latest,devendermishrajio/nova,belmiromoreira/nova,eonpatapon/nova,cloudbase/nova-virtualbox,felixma/nova,JioCloud/nova,CEG-FYP-OpenStack/scheduler,alaski/nova,thomasem/nova,hanlind/nova,noironetworks/nova,klmitch/nova,edulramirez/nova,isyippee/nova,mmnelemane/nova,jeffrey4l/nova,CloudServer/nova,silenceli/nova,eayunstack/nova,sebrandon1/nova,tealover/nova,scripnichenko/nova,Francis-Liu/animated-broccoli,projectcalico/calico-nova,angdraug/nova,tianweizhang/nova,rahulunair/nova,BeyondTheClouds/nova,scripnichenko/nova,belmiromoreira/nova,iuliat/nova,berrange/nova,double12gzh/nova,viggates/nova,openstack/nova,mahak/nova,tangfeixiong/nova,nikesh-mahalka/nova,Stavitsky/nova,LoHChina/nova,zhimin711/nova,alexandrucoman/vbox-nova-driver,petrutlucian94/nova,klmitch/nova,angdraug/nova,CEG-FYP-OpenStack/scheduler,berrange/nova,tianweizhang/nova,devendermishrajio/nova,petrutlucian94/nova,vmturbo/nova,blueboxgroup/nova,badock/nova,adelina-t/nova,virtualopensystems/nova,nikesh-mahalka/nova,redhat-openstack/nova,ruslanloman/nova,yosshy/nova,mmnelemane/nova,NeCTAR-RC/nova,whitepages/nova,varunarya10/nova_test_latest,jianghuaw/nova,bgxavier/nova,affo/nova,jeffrey4l/nova,blueboxgroup/nova,dawnpower/nova,hanlind/nova,barnsnake351/nova,akash1808/nova,sebrandon1/nova,Francis-Liu/animated-broccoli,eayunstack/nova,cernops/nova,mandeepdhami/nova,phenoxim/nova,rajalokan/nova,Yusuke1987/openstack_template,sebrandon1/nova,JioCloud/nova,akash1808/nova_test_latest,affo/nova,joker946/nova,kimjaejoong/nova,Juniper/nova,MountainWei/nova,double12gzh/nova,mgagne/nova,mandeepdhami/nova,yosshy/nova,watonyweng/nova,cernops/nova,yatinkumbhare/openstack-nova,cyx1231st/nova,rajalokan/nova,zzicewind/nova,CCI-MOC/nova,yatinkumbhare/openstack-nova,BeyondTheClouds/nova,bigswitch/nova,jianghuaw/nova,redhat-openstack/nova,vladikr/nova_drafts,Tehsmash/nova,cloudbase/nova,cernops/nova,JianyuWang/nova,orbitfp7/nova,devendermishrajio/nova_test_latest,felixma/nova,mahak/nova,Metaswitch/calico-nova,Tehsmash/nova,TwinkleChawla/nova,vladikr/nova_drafts,gooddata/openstack-nova,ruslanloman/nova,tealover/nova,BeyondTheClouds/nova,zaina/nova,watonyweng/nova,bigswitch/nova,MountainWei/nova,thomasem/nova,kimjaejoong/nova,bgxavier/nova,Juniper/nova,cloudbase/nova-virtualbox,alvarolopez/nova,TwinkleChawla/nova,raildo/nova,edulramirez/nova,ted-gould/nova,Juniper/nova,zhimin711/nova,saleemjaveds/https-github.com-openstack-nova,alexandrucoman/vbox-nova-driver,zzicewind/nova,tudorvio/nova,vmturbo/nova,virtualopensystems/nova,gooddata/openstack-nova,Juniper/nova,isyippee/nova,hanlind/nova,takeshineshiro/nova,silenceli/nova,gooddata/openstack-nova,NeCTAR-RC/nova,CloudServer/nova,eonpatapon/nova,shail2810/nova,Yusuke1987/openstack_template,CCI-MOC/nova,badock/nova,rahulunair/nova,shail2810/nova,mikalstill/nova,jianghuaw/nova,tudorvio/nova,varunarya10/nova_test_latest,klmitch/nova,maelnor/nova,iuliat/nova,j-carpentier/nova,whitepages/nova,akash1808/nova,jianghuaw/nova,adelina-t/nova,vmturbo/nova,openstack/nova,raildo/nova,cloudbase/nova,mikalstill/nova,JianyuWang/nova,mahak/nova | # Copyright (c) 2013 Rackspace Hosting
#
# 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.
"""This modules stubs out functions in nova.utils."""
from nova import utils
def stub_out_utils_spawn_n(stubs):
"""Stubs out spawn_n with a blocking version.
This aids testing async processes by blocking until they're done.
"""
def no_spawn(func, *args, **kwargs):
return func(*args, **kwargs)
stubs.Set(utils, 'spawn_n', no_spawn)
Make spawn_n() stub properly ignore errors in the child thread work
When we call spawn_n() normally, we fork off a thread that can run or
die on its own, without affecting the parent. In unit tests, we stub
this out to be a synchronous call, but we allow any exceptions that
occur in that work to bubble up to the caller. This is not normal
behavior and thus we should discard any such exceptions in order to
mimic actual behavior of a child thread.
Change-Id: I35ab21e9525aa76cced797436daa0b99a4fa99f2
Related-bug: #1349147 | # Copyright (c) 2013 Rackspace Hosting
#
# 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.
"""This modules stubs out functions in nova.utils."""
from nova import utils
def stub_out_utils_spawn_n(stubs):
"""Stubs out spawn_n with a blocking version.
This aids testing async processes by blocking until they're done.
"""
def no_spawn(func, *args, **kwargs):
try:
return func(*args, **kwargs)
except Exception:
# NOTE(danms): This is supposed to simulate spawning
# of a thread, which would run separate from the parent,
# and die silently on error. If we don't catch and discard
# any exceptions here, we're not honoring the usual
# behavior.
pass
stubs.Set(utils, 'spawn_n', no_spawn)
| <commit_before># Copyright (c) 2013 Rackspace Hosting
#
# 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.
"""This modules stubs out functions in nova.utils."""
from nova import utils
def stub_out_utils_spawn_n(stubs):
"""Stubs out spawn_n with a blocking version.
This aids testing async processes by blocking until they're done.
"""
def no_spawn(func, *args, **kwargs):
return func(*args, **kwargs)
stubs.Set(utils, 'spawn_n', no_spawn)
<commit_msg>Make spawn_n() stub properly ignore errors in the child thread work
When we call spawn_n() normally, we fork off a thread that can run or
die on its own, without affecting the parent. In unit tests, we stub
this out to be a synchronous call, but we allow any exceptions that
occur in that work to bubble up to the caller. This is not normal
behavior and thus we should discard any such exceptions in order to
mimic actual behavior of a child thread.
Change-Id: I35ab21e9525aa76cced797436daa0b99a4fa99f2
Related-bug: #1349147<commit_after> | # Copyright (c) 2013 Rackspace Hosting
#
# 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.
"""This modules stubs out functions in nova.utils."""
from nova import utils
def stub_out_utils_spawn_n(stubs):
"""Stubs out spawn_n with a blocking version.
This aids testing async processes by blocking until they're done.
"""
def no_spawn(func, *args, **kwargs):
try:
return func(*args, **kwargs)
except Exception:
# NOTE(danms): This is supposed to simulate spawning
# of a thread, which would run separate from the parent,
# and die silently on error. If we don't catch and discard
# any exceptions here, we're not honoring the usual
# behavior.
pass
stubs.Set(utils, 'spawn_n', no_spawn)
| # Copyright (c) 2013 Rackspace Hosting
#
# 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.
"""This modules stubs out functions in nova.utils."""
from nova import utils
def stub_out_utils_spawn_n(stubs):
"""Stubs out spawn_n with a blocking version.
This aids testing async processes by blocking until they're done.
"""
def no_spawn(func, *args, **kwargs):
return func(*args, **kwargs)
stubs.Set(utils, 'spawn_n', no_spawn)
Make spawn_n() stub properly ignore errors in the child thread work
When we call spawn_n() normally, we fork off a thread that can run or
die on its own, without affecting the parent. In unit tests, we stub
this out to be a synchronous call, but we allow any exceptions that
occur in that work to bubble up to the caller. This is not normal
behavior and thus we should discard any such exceptions in order to
mimic actual behavior of a child thread.
Change-Id: I35ab21e9525aa76cced797436daa0b99a4fa99f2
Related-bug: #1349147# Copyright (c) 2013 Rackspace Hosting
#
# 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.
"""This modules stubs out functions in nova.utils."""
from nova import utils
def stub_out_utils_spawn_n(stubs):
"""Stubs out spawn_n with a blocking version.
This aids testing async processes by blocking until they're done.
"""
def no_spawn(func, *args, **kwargs):
try:
return func(*args, **kwargs)
except Exception:
# NOTE(danms): This is supposed to simulate spawning
# of a thread, which would run separate from the parent,
# and die silently on error. If we don't catch and discard
# any exceptions here, we're not honoring the usual
# behavior.
pass
stubs.Set(utils, 'spawn_n', no_spawn)
| <commit_before># Copyright (c) 2013 Rackspace Hosting
#
# 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.
"""This modules stubs out functions in nova.utils."""
from nova import utils
def stub_out_utils_spawn_n(stubs):
"""Stubs out spawn_n with a blocking version.
This aids testing async processes by blocking until they're done.
"""
def no_spawn(func, *args, **kwargs):
return func(*args, **kwargs)
stubs.Set(utils, 'spawn_n', no_spawn)
<commit_msg>Make spawn_n() stub properly ignore errors in the child thread work
When we call spawn_n() normally, we fork off a thread that can run or
die on its own, without affecting the parent. In unit tests, we stub
this out to be a synchronous call, but we allow any exceptions that
occur in that work to bubble up to the caller. This is not normal
behavior and thus we should discard any such exceptions in order to
mimic actual behavior of a child thread.
Change-Id: I35ab21e9525aa76cced797436daa0b99a4fa99f2
Related-bug: #1349147<commit_after># Copyright (c) 2013 Rackspace Hosting
#
# 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.
"""This modules stubs out functions in nova.utils."""
from nova import utils
def stub_out_utils_spawn_n(stubs):
"""Stubs out spawn_n with a blocking version.
This aids testing async processes by blocking until they're done.
"""
def no_spawn(func, *args, **kwargs):
try:
return func(*args, **kwargs)
except Exception:
# NOTE(danms): This is supposed to simulate spawning
# of a thread, which would run separate from the parent,
# and die silently on error. If we don't catch and discard
# any exceptions here, we're not honoring the usual
# behavior.
pass
stubs.Set(utils, 'spawn_n', no_spawn)
|
e76777897bed5b9396d126e384555ea230b35784 | sass_processor/apps.py | sass_processor/apps.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from django.apps import apps, AppConfig
APPS_INCLUDE_DIRS = []
class SassProcessorConfig(AppConfig):
name = 'sass_processor'
verbose_name = "Sass Processor"
_static_dir = 'static'
_sass_exts = ('.scss', '.sass')
def ready(self):
app_configs = apps.get_app_configs()
for app_config in app_configs:
static_dir = os.path.join(app_config.path, self._static_dir)
if os.path.isdir(static_dir):
self.traverse_tree(static_dir)
print(APPS_INCLUDE_DIRS)
@classmethod
def traverse_tree(cls, static_dir):
"""traverse the static folders an look for at least one file ending in .scss/.sass"""
for root, dirs, files in os.walk(static_dir):
for filename in files:
basename, ext = os.path.splitext(filename)
if basename.startswith('_') and ext in cls._sass_exts:
APPS_INCLUDE_DIRS.append(static_dir)
return
| # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from django.apps import apps, AppConfig
from django.conf import settings
from django.core.files.storage import get_storage_class
APPS_INCLUDE_DIRS = []
class SassProcessorConfig(AppConfig):
name = 'sass_processor'
verbose_name = "Sass Processor"
_sass_exts = ('.scss', '.sass')
_storage = get_storage_class(import_path=settings.STATICFILES_STORAGE)()
def ready(self):
app_configs = apps.get_app_configs()
for app_config in app_configs:
static_dir = os.path.join(app_config.path, self._storage.base_url.strip(os.path.sep))
if os.path.isdir(static_dir):
self.traverse_tree(static_dir)
@classmethod
def traverse_tree(cls, static_dir):
"""traverse the static folders an look for at least one file ending in .scss/.sass"""
for root, dirs, files in os.walk(static_dir):
for filename in files:
basename, ext = os.path.splitext(filename)
if basename.startswith('_') and ext in cls._sass_exts:
APPS_INCLUDE_DIRS.append(static_dir)
return
| Use StaticFileStorage to determine source directories | Use StaticFileStorage to determine source directories
| Python | mit | jrief/django-sass-processor,jrief/django-sass-processor | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from django.apps import apps, AppConfig
APPS_INCLUDE_DIRS = []
class SassProcessorConfig(AppConfig):
name = 'sass_processor'
verbose_name = "Sass Processor"
_static_dir = 'static'
_sass_exts = ('.scss', '.sass')
def ready(self):
app_configs = apps.get_app_configs()
for app_config in app_configs:
static_dir = os.path.join(app_config.path, self._static_dir)
if os.path.isdir(static_dir):
self.traverse_tree(static_dir)
print(APPS_INCLUDE_DIRS)
@classmethod
def traverse_tree(cls, static_dir):
"""traverse the static folders an look for at least one file ending in .scss/.sass"""
for root, dirs, files in os.walk(static_dir):
for filename in files:
basename, ext = os.path.splitext(filename)
if basename.startswith('_') and ext in cls._sass_exts:
APPS_INCLUDE_DIRS.append(static_dir)
return
Use StaticFileStorage to determine source directories | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from django.apps import apps, AppConfig
from django.conf import settings
from django.core.files.storage import get_storage_class
APPS_INCLUDE_DIRS = []
class SassProcessorConfig(AppConfig):
name = 'sass_processor'
verbose_name = "Sass Processor"
_sass_exts = ('.scss', '.sass')
_storage = get_storage_class(import_path=settings.STATICFILES_STORAGE)()
def ready(self):
app_configs = apps.get_app_configs()
for app_config in app_configs:
static_dir = os.path.join(app_config.path, self._storage.base_url.strip(os.path.sep))
if os.path.isdir(static_dir):
self.traverse_tree(static_dir)
@classmethod
def traverse_tree(cls, static_dir):
"""traverse the static folders an look for at least one file ending in .scss/.sass"""
for root, dirs, files in os.walk(static_dir):
for filename in files:
basename, ext = os.path.splitext(filename)
if basename.startswith('_') and ext in cls._sass_exts:
APPS_INCLUDE_DIRS.append(static_dir)
return
| <commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from django.apps import apps, AppConfig
APPS_INCLUDE_DIRS = []
class SassProcessorConfig(AppConfig):
name = 'sass_processor'
verbose_name = "Sass Processor"
_static_dir = 'static'
_sass_exts = ('.scss', '.sass')
def ready(self):
app_configs = apps.get_app_configs()
for app_config in app_configs:
static_dir = os.path.join(app_config.path, self._static_dir)
if os.path.isdir(static_dir):
self.traverse_tree(static_dir)
print(APPS_INCLUDE_DIRS)
@classmethod
def traverse_tree(cls, static_dir):
"""traverse the static folders an look for at least one file ending in .scss/.sass"""
for root, dirs, files in os.walk(static_dir):
for filename in files:
basename, ext = os.path.splitext(filename)
if basename.startswith('_') and ext in cls._sass_exts:
APPS_INCLUDE_DIRS.append(static_dir)
return
<commit_msg>Use StaticFileStorage to determine source directories<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from django.apps import apps, AppConfig
from django.conf import settings
from django.core.files.storage import get_storage_class
APPS_INCLUDE_DIRS = []
class SassProcessorConfig(AppConfig):
name = 'sass_processor'
verbose_name = "Sass Processor"
_sass_exts = ('.scss', '.sass')
_storage = get_storage_class(import_path=settings.STATICFILES_STORAGE)()
def ready(self):
app_configs = apps.get_app_configs()
for app_config in app_configs:
static_dir = os.path.join(app_config.path, self._storage.base_url.strip(os.path.sep))
if os.path.isdir(static_dir):
self.traverse_tree(static_dir)
@classmethod
def traverse_tree(cls, static_dir):
"""traverse the static folders an look for at least one file ending in .scss/.sass"""
for root, dirs, files in os.walk(static_dir):
for filename in files:
basename, ext = os.path.splitext(filename)
if basename.startswith('_') and ext in cls._sass_exts:
APPS_INCLUDE_DIRS.append(static_dir)
return
| # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from django.apps import apps, AppConfig
APPS_INCLUDE_DIRS = []
class SassProcessorConfig(AppConfig):
name = 'sass_processor'
verbose_name = "Sass Processor"
_static_dir = 'static'
_sass_exts = ('.scss', '.sass')
def ready(self):
app_configs = apps.get_app_configs()
for app_config in app_configs:
static_dir = os.path.join(app_config.path, self._static_dir)
if os.path.isdir(static_dir):
self.traverse_tree(static_dir)
print(APPS_INCLUDE_DIRS)
@classmethod
def traverse_tree(cls, static_dir):
"""traverse the static folders an look for at least one file ending in .scss/.sass"""
for root, dirs, files in os.walk(static_dir):
for filename in files:
basename, ext = os.path.splitext(filename)
if basename.startswith('_') and ext in cls._sass_exts:
APPS_INCLUDE_DIRS.append(static_dir)
return
Use StaticFileStorage to determine source directories# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from django.apps import apps, AppConfig
from django.conf import settings
from django.core.files.storage import get_storage_class
APPS_INCLUDE_DIRS = []
class SassProcessorConfig(AppConfig):
name = 'sass_processor'
verbose_name = "Sass Processor"
_sass_exts = ('.scss', '.sass')
_storage = get_storage_class(import_path=settings.STATICFILES_STORAGE)()
def ready(self):
app_configs = apps.get_app_configs()
for app_config in app_configs:
static_dir = os.path.join(app_config.path, self._storage.base_url.strip(os.path.sep))
if os.path.isdir(static_dir):
self.traverse_tree(static_dir)
@classmethod
def traverse_tree(cls, static_dir):
"""traverse the static folders an look for at least one file ending in .scss/.sass"""
for root, dirs, files in os.walk(static_dir):
for filename in files:
basename, ext = os.path.splitext(filename)
if basename.startswith('_') and ext in cls._sass_exts:
APPS_INCLUDE_DIRS.append(static_dir)
return
| <commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from django.apps import apps, AppConfig
APPS_INCLUDE_DIRS = []
class SassProcessorConfig(AppConfig):
name = 'sass_processor'
verbose_name = "Sass Processor"
_static_dir = 'static'
_sass_exts = ('.scss', '.sass')
def ready(self):
app_configs = apps.get_app_configs()
for app_config in app_configs:
static_dir = os.path.join(app_config.path, self._static_dir)
if os.path.isdir(static_dir):
self.traverse_tree(static_dir)
print(APPS_INCLUDE_DIRS)
@classmethod
def traverse_tree(cls, static_dir):
"""traverse the static folders an look for at least one file ending in .scss/.sass"""
for root, dirs, files in os.walk(static_dir):
for filename in files:
basename, ext = os.path.splitext(filename)
if basename.startswith('_') and ext in cls._sass_exts:
APPS_INCLUDE_DIRS.append(static_dir)
return
<commit_msg>Use StaticFileStorage to determine source directories<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from django.apps import apps, AppConfig
from django.conf import settings
from django.core.files.storage import get_storage_class
APPS_INCLUDE_DIRS = []
class SassProcessorConfig(AppConfig):
name = 'sass_processor'
verbose_name = "Sass Processor"
_sass_exts = ('.scss', '.sass')
_storage = get_storage_class(import_path=settings.STATICFILES_STORAGE)()
def ready(self):
app_configs = apps.get_app_configs()
for app_config in app_configs:
static_dir = os.path.join(app_config.path, self._storage.base_url.strip(os.path.sep))
if os.path.isdir(static_dir):
self.traverse_tree(static_dir)
@classmethod
def traverse_tree(cls, static_dir):
"""traverse the static folders an look for at least one file ending in .scss/.sass"""
for root, dirs, files in os.walk(static_dir):
for filename in files:
basename, ext = os.path.splitext(filename)
if basename.startswith('_') and ext in cls._sass_exts:
APPS_INCLUDE_DIRS.append(static_dir)
return
|
dac0afb3db74b1e8cd144993e662dc8ac0622cb9 | osbrain/ftp.py | osbrain/ftp.py | """
Implementation of FTP-related features.
"""
from .core import BaseAgent
from .common import address_to_host_port
class FTPAgent(BaseAgent):
"""
An agent that provides basic FTP functionality.
"""
def ftp_configure(self, addr, user, passwd, path, perm='elr'):
from pyftpdlib.authorizers import DummyAuthorizer
from pyftpdlib.handlers import FTPHandler
from pyftpdlib.servers import FTPServer
# Create authorizer
authorizer = DummyAuthorizer()
authorizer.add_user(user, passwd, path, perm=perm)
# Create handler
handler = FTPHandler
handler.authorizer = authorizer
# Create server
host, port = address_to_host_port(addr)
# TODO: is this necessary? Or would `None` be sufficient?
if port is None:
port = 0
self.ftp_server = FTPServer((host, port), handler)
return self.ftp_server.socket.getsockname()
@Pyro4.oneway
def ftp_run(self):
# Serve forever
self.ftp_server.serve_forever()
def ftp_addr(self):
return self.ftp_server.socket.getsockname()
def ftp_retrieve(self, addr, origin, destiny, user, passwd):
import ftplib
host, port = addr
ftp = ftplib.FTP()
ftp.connect(host, port)
ftp.login(user, passwd)
ftp.retrbinary('RETR %s' % origin, open(destiny, 'wb').write)
ftp.close()
return destiny
| """
Implementation of FTP-related features.
"""
import Pyro4
from .core import BaseAgent
from .common import address_to_host_port
class FTPAgent(BaseAgent):
"""
An agent that provides basic FTP functionality.
"""
def ftp_configure(self, addr, user, passwd, path, perm='elr'):
from pyftpdlib.authorizers import DummyAuthorizer
from pyftpdlib.handlers import FTPHandler
from pyftpdlib.servers import FTPServer
# Create authorizer
authorizer = DummyAuthorizer()
authorizer.add_user(user, passwd, path, perm=perm)
# Create handler
handler = FTPHandler
handler.authorizer = authorizer
# Create server
host, port = address_to_host_port(addr)
# TODO: is this necessary? Or would `None` be sufficient?
if port is None:
port = 0
self.ftp_server = FTPServer((host, port), handler)
return self.ftp_server.socket.getsockname()
@Pyro4.oneway
def ftp_run(self):
# Serve forever
self.ftp_server.serve_forever()
def ftp_addr(self):
return self.ftp_server.socket.getsockname()
def ftp_retrieve(self, addr, origin, destiny, user, passwd):
import ftplib
host, port = addr
ftp = ftplib.FTP()
ftp.connect(host, port)
ftp.login(user, passwd)
ftp.retrbinary('RETR %s' % origin, open(destiny, 'wb').write)
ftp.close()
return destiny
| Add missing import to FTP module | Add missing import to FTP module
| Python | apache-2.0 | opensistemas-hub/osbrain | """
Implementation of FTP-related features.
"""
from .core import BaseAgent
from .common import address_to_host_port
class FTPAgent(BaseAgent):
"""
An agent that provides basic FTP functionality.
"""
def ftp_configure(self, addr, user, passwd, path, perm='elr'):
from pyftpdlib.authorizers import DummyAuthorizer
from pyftpdlib.handlers import FTPHandler
from pyftpdlib.servers import FTPServer
# Create authorizer
authorizer = DummyAuthorizer()
authorizer.add_user(user, passwd, path, perm=perm)
# Create handler
handler = FTPHandler
handler.authorizer = authorizer
# Create server
host, port = address_to_host_port(addr)
# TODO: is this necessary? Or would `None` be sufficient?
if port is None:
port = 0
self.ftp_server = FTPServer((host, port), handler)
return self.ftp_server.socket.getsockname()
@Pyro4.oneway
def ftp_run(self):
# Serve forever
self.ftp_server.serve_forever()
def ftp_addr(self):
return self.ftp_server.socket.getsockname()
def ftp_retrieve(self, addr, origin, destiny, user, passwd):
import ftplib
host, port = addr
ftp = ftplib.FTP()
ftp.connect(host, port)
ftp.login(user, passwd)
ftp.retrbinary('RETR %s' % origin, open(destiny, 'wb').write)
ftp.close()
return destiny
Add missing import to FTP module | """
Implementation of FTP-related features.
"""
import Pyro4
from .core import BaseAgent
from .common import address_to_host_port
class FTPAgent(BaseAgent):
"""
An agent that provides basic FTP functionality.
"""
def ftp_configure(self, addr, user, passwd, path, perm='elr'):
from pyftpdlib.authorizers import DummyAuthorizer
from pyftpdlib.handlers import FTPHandler
from pyftpdlib.servers import FTPServer
# Create authorizer
authorizer = DummyAuthorizer()
authorizer.add_user(user, passwd, path, perm=perm)
# Create handler
handler = FTPHandler
handler.authorizer = authorizer
# Create server
host, port = address_to_host_port(addr)
# TODO: is this necessary? Or would `None` be sufficient?
if port is None:
port = 0
self.ftp_server = FTPServer((host, port), handler)
return self.ftp_server.socket.getsockname()
@Pyro4.oneway
def ftp_run(self):
# Serve forever
self.ftp_server.serve_forever()
def ftp_addr(self):
return self.ftp_server.socket.getsockname()
def ftp_retrieve(self, addr, origin, destiny, user, passwd):
import ftplib
host, port = addr
ftp = ftplib.FTP()
ftp.connect(host, port)
ftp.login(user, passwd)
ftp.retrbinary('RETR %s' % origin, open(destiny, 'wb').write)
ftp.close()
return destiny
| <commit_before>"""
Implementation of FTP-related features.
"""
from .core import BaseAgent
from .common import address_to_host_port
class FTPAgent(BaseAgent):
"""
An agent that provides basic FTP functionality.
"""
def ftp_configure(self, addr, user, passwd, path, perm='elr'):
from pyftpdlib.authorizers import DummyAuthorizer
from pyftpdlib.handlers import FTPHandler
from pyftpdlib.servers import FTPServer
# Create authorizer
authorizer = DummyAuthorizer()
authorizer.add_user(user, passwd, path, perm=perm)
# Create handler
handler = FTPHandler
handler.authorizer = authorizer
# Create server
host, port = address_to_host_port(addr)
# TODO: is this necessary? Or would `None` be sufficient?
if port is None:
port = 0
self.ftp_server = FTPServer((host, port), handler)
return self.ftp_server.socket.getsockname()
@Pyro4.oneway
def ftp_run(self):
# Serve forever
self.ftp_server.serve_forever()
def ftp_addr(self):
return self.ftp_server.socket.getsockname()
def ftp_retrieve(self, addr, origin, destiny, user, passwd):
import ftplib
host, port = addr
ftp = ftplib.FTP()
ftp.connect(host, port)
ftp.login(user, passwd)
ftp.retrbinary('RETR %s' % origin, open(destiny, 'wb').write)
ftp.close()
return destiny
<commit_msg>Add missing import to FTP module<commit_after> | """
Implementation of FTP-related features.
"""
import Pyro4
from .core import BaseAgent
from .common import address_to_host_port
class FTPAgent(BaseAgent):
"""
An agent that provides basic FTP functionality.
"""
def ftp_configure(self, addr, user, passwd, path, perm='elr'):
from pyftpdlib.authorizers import DummyAuthorizer
from pyftpdlib.handlers import FTPHandler
from pyftpdlib.servers import FTPServer
# Create authorizer
authorizer = DummyAuthorizer()
authorizer.add_user(user, passwd, path, perm=perm)
# Create handler
handler = FTPHandler
handler.authorizer = authorizer
# Create server
host, port = address_to_host_port(addr)
# TODO: is this necessary? Or would `None` be sufficient?
if port is None:
port = 0
self.ftp_server = FTPServer((host, port), handler)
return self.ftp_server.socket.getsockname()
@Pyro4.oneway
def ftp_run(self):
# Serve forever
self.ftp_server.serve_forever()
def ftp_addr(self):
return self.ftp_server.socket.getsockname()
def ftp_retrieve(self, addr, origin, destiny, user, passwd):
import ftplib
host, port = addr
ftp = ftplib.FTP()
ftp.connect(host, port)
ftp.login(user, passwd)
ftp.retrbinary('RETR %s' % origin, open(destiny, 'wb').write)
ftp.close()
return destiny
| """
Implementation of FTP-related features.
"""
from .core import BaseAgent
from .common import address_to_host_port
class FTPAgent(BaseAgent):
"""
An agent that provides basic FTP functionality.
"""
def ftp_configure(self, addr, user, passwd, path, perm='elr'):
from pyftpdlib.authorizers import DummyAuthorizer
from pyftpdlib.handlers import FTPHandler
from pyftpdlib.servers import FTPServer
# Create authorizer
authorizer = DummyAuthorizer()
authorizer.add_user(user, passwd, path, perm=perm)
# Create handler
handler = FTPHandler
handler.authorizer = authorizer
# Create server
host, port = address_to_host_port(addr)
# TODO: is this necessary? Or would `None` be sufficient?
if port is None:
port = 0
self.ftp_server = FTPServer((host, port), handler)
return self.ftp_server.socket.getsockname()
@Pyro4.oneway
def ftp_run(self):
# Serve forever
self.ftp_server.serve_forever()
def ftp_addr(self):
return self.ftp_server.socket.getsockname()
def ftp_retrieve(self, addr, origin, destiny, user, passwd):
import ftplib
host, port = addr
ftp = ftplib.FTP()
ftp.connect(host, port)
ftp.login(user, passwd)
ftp.retrbinary('RETR %s' % origin, open(destiny, 'wb').write)
ftp.close()
return destiny
Add missing import to FTP module"""
Implementation of FTP-related features.
"""
import Pyro4
from .core import BaseAgent
from .common import address_to_host_port
class FTPAgent(BaseAgent):
"""
An agent that provides basic FTP functionality.
"""
def ftp_configure(self, addr, user, passwd, path, perm='elr'):
from pyftpdlib.authorizers import DummyAuthorizer
from pyftpdlib.handlers import FTPHandler
from pyftpdlib.servers import FTPServer
# Create authorizer
authorizer = DummyAuthorizer()
authorizer.add_user(user, passwd, path, perm=perm)
# Create handler
handler = FTPHandler
handler.authorizer = authorizer
# Create server
host, port = address_to_host_port(addr)
# TODO: is this necessary? Or would `None` be sufficient?
if port is None:
port = 0
self.ftp_server = FTPServer((host, port), handler)
return self.ftp_server.socket.getsockname()
@Pyro4.oneway
def ftp_run(self):
# Serve forever
self.ftp_server.serve_forever()
def ftp_addr(self):
return self.ftp_server.socket.getsockname()
def ftp_retrieve(self, addr, origin, destiny, user, passwd):
import ftplib
host, port = addr
ftp = ftplib.FTP()
ftp.connect(host, port)
ftp.login(user, passwd)
ftp.retrbinary('RETR %s' % origin, open(destiny, 'wb').write)
ftp.close()
return destiny
| <commit_before>"""
Implementation of FTP-related features.
"""
from .core import BaseAgent
from .common import address_to_host_port
class FTPAgent(BaseAgent):
"""
An agent that provides basic FTP functionality.
"""
def ftp_configure(self, addr, user, passwd, path, perm='elr'):
from pyftpdlib.authorizers import DummyAuthorizer
from pyftpdlib.handlers import FTPHandler
from pyftpdlib.servers import FTPServer
# Create authorizer
authorizer = DummyAuthorizer()
authorizer.add_user(user, passwd, path, perm=perm)
# Create handler
handler = FTPHandler
handler.authorizer = authorizer
# Create server
host, port = address_to_host_port(addr)
# TODO: is this necessary? Or would `None` be sufficient?
if port is None:
port = 0
self.ftp_server = FTPServer((host, port), handler)
return self.ftp_server.socket.getsockname()
@Pyro4.oneway
def ftp_run(self):
# Serve forever
self.ftp_server.serve_forever()
def ftp_addr(self):
return self.ftp_server.socket.getsockname()
def ftp_retrieve(self, addr, origin, destiny, user, passwd):
import ftplib
host, port = addr
ftp = ftplib.FTP()
ftp.connect(host, port)
ftp.login(user, passwd)
ftp.retrbinary('RETR %s' % origin, open(destiny, 'wb').write)
ftp.close()
return destiny
<commit_msg>Add missing import to FTP module<commit_after>"""
Implementation of FTP-related features.
"""
import Pyro4
from .core import BaseAgent
from .common import address_to_host_port
class FTPAgent(BaseAgent):
"""
An agent that provides basic FTP functionality.
"""
def ftp_configure(self, addr, user, passwd, path, perm='elr'):
from pyftpdlib.authorizers import DummyAuthorizer
from pyftpdlib.handlers import FTPHandler
from pyftpdlib.servers import FTPServer
# Create authorizer
authorizer = DummyAuthorizer()
authorizer.add_user(user, passwd, path, perm=perm)
# Create handler
handler = FTPHandler
handler.authorizer = authorizer
# Create server
host, port = address_to_host_port(addr)
# TODO: is this necessary? Or would `None` be sufficient?
if port is None:
port = 0
self.ftp_server = FTPServer((host, port), handler)
return self.ftp_server.socket.getsockname()
@Pyro4.oneway
def ftp_run(self):
# Serve forever
self.ftp_server.serve_forever()
def ftp_addr(self):
return self.ftp_server.socket.getsockname()
def ftp_retrieve(self, addr, origin, destiny, user, passwd):
import ftplib
host, port = addr
ftp = ftplib.FTP()
ftp.connect(host, port)
ftp.login(user, passwd)
ftp.retrbinary('RETR %s' % origin, open(destiny, 'wb').write)
ftp.close()
return destiny
|
3199b523a67f9c241950992a07fe38d2bbee07dc | seedlibrary/migrations/0003_extendedview_fix.py | seedlibrary/migrations/0003_extendedview_fix.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2017-02-21 02:55
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('seedlibrary', '0002_auto_20170219_2058'),
]
operations = [
migrations.RenameField(
model_name='extendedview',
old_name='external_field',
new_name='external_url',
),
migrations.AddField(
model_name='extendedview',
name='grain_subcategory',
field=models.CharField(blank=True, max_length=50),
),
]
| # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2017-02-21 02:55
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('seedlibrary', '0002_add_extendedview'),
]
operations = [
migrations.RenameField(
model_name='extendedview',
old_name='external_field',
new_name='external_url',
),
migrations.AddField(
model_name='extendedview',
name='grain_subcategory',
field=models.CharField(blank=True, max_length=50),
),
]
| Update migration file for namechange | Update migration file for namechange
| Python | mit | RockinRobin/seednetwork,RockinRobin/seednetwork,RockinRobin/seednetwork | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2017-02-21 02:55
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('seedlibrary', '0002_auto_20170219_2058'),
]
operations = [
migrations.RenameField(
model_name='extendedview',
old_name='external_field',
new_name='external_url',
),
migrations.AddField(
model_name='extendedview',
name='grain_subcategory',
field=models.CharField(blank=True, max_length=50),
),
]
Update migration file for namechange | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2017-02-21 02:55
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('seedlibrary', '0002_add_extendedview'),
]
operations = [
migrations.RenameField(
model_name='extendedview',
old_name='external_field',
new_name='external_url',
),
migrations.AddField(
model_name='extendedview',
name='grain_subcategory',
field=models.CharField(blank=True, max_length=50),
),
]
| <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2017-02-21 02:55
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('seedlibrary', '0002_auto_20170219_2058'),
]
operations = [
migrations.RenameField(
model_name='extendedview',
old_name='external_field',
new_name='external_url',
),
migrations.AddField(
model_name='extendedview',
name='grain_subcategory',
field=models.CharField(blank=True, max_length=50),
),
]
<commit_msg>Update migration file for namechange<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2017-02-21 02:55
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('seedlibrary', '0002_add_extendedview'),
]
operations = [
migrations.RenameField(
model_name='extendedview',
old_name='external_field',
new_name='external_url',
),
migrations.AddField(
model_name='extendedview',
name='grain_subcategory',
field=models.CharField(blank=True, max_length=50),
),
]
| # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2017-02-21 02:55
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('seedlibrary', '0002_auto_20170219_2058'),
]
operations = [
migrations.RenameField(
model_name='extendedview',
old_name='external_field',
new_name='external_url',
),
migrations.AddField(
model_name='extendedview',
name='grain_subcategory',
field=models.CharField(blank=True, max_length=50),
),
]
Update migration file for namechange# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2017-02-21 02:55
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('seedlibrary', '0002_add_extendedview'),
]
operations = [
migrations.RenameField(
model_name='extendedview',
old_name='external_field',
new_name='external_url',
),
migrations.AddField(
model_name='extendedview',
name='grain_subcategory',
field=models.CharField(blank=True, max_length=50),
),
]
| <commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2017-02-21 02:55
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('seedlibrary', '0002_auto_20170219_2058'),
]
operations = [
migrations.RenameField(
model_name='extendedview',
old_name='external_field',
new_name='external_url',
),
migrations.AddField(
model_name='extendedview',
name='grain_subcategory',
field=models.CharField(blank=True, max_length=50),
),
]
<commit_msg>Update migration file for namechange<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2017-02-21 02:55
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('seedlibrary', '0002_add_extendedview'),
]
operations = [
migrations.RenameField(
model_name='extendedview',
old_name='external_field',
new_name='external_url',
),
migrations.AddField(
model_name='extendedview',
name='grain_subcategory',
field=models.CharField(blank=True, max_length=50),
),
]
|
17b0f5d7b718bc12755f7ddefdd76ee9312adf5f | books.py | books.py | import falcon
import template
def get_paragraphs(pathname: str) -> list:
result = []
with open(pathname) as f:
for line in f.readlines():
if line != '\n':
result.append(line[:-1])
return result
class BooksResource:
def on_get(self, req, resp):
resp.status = falcon.HTTP_200
paragraphs = get_paragraphs('/home/sanchopanca/Documents/thunder.txt')
resp.body = template.render_template('book.html', paragraphs=paragraphs)
app = falcon.API()
books = BooksResource()
app.add_route('/books', books)
if __name__ == '__main__':
paragraphs = get_paragraphs('/home/sanchopanca/Documents/thunder.txt')
print(paragraphs) | import falcon
import template
def get_paragraphs(pathname: str) -> list:
result = []
with open(pathname) as f:
for line in f.readlines():
if line != '\n':
result.append(line[:-1])
return result
class BooksResource:
def on_get(self, req, resp):
resp.status = falcon.HTTP_200
resp.content_type = 'text/html'
paragraphs = get_paragraphs('/home/sanchopanca/Documents/thunder.txt')
resp.body = template.render_template('book.html', paragraphs=paragraphs)
app = falcon.API()
books = BooksResource()
app.add_route('/books', books)
if __name__ == '__main__':
paragraphs = get_paragraphs('/home/sanchopanca/Documents/thunder.txt')
print(paragraphs) | Add content type text/html to response | Add content type text/html to response
| Python | agpl-3.0 | sanchopanca/reader,sanchopanca/reader | import falcon
import template
def get_paragraphs(pathname: str) -> list:
result = []
with open(pathname) as f:
for line in f.readlines():
if line != '\n':
result.append(line[:-1])
return result
class BooksResource:
def on_get(self, req, resp):
resp.status = falcon.HTTP_200
paragraphs = get_paragraphs('/home/sanchopanca/Documents/thunder.txt')
resp.body = template.render_template('book.html', paragraphs=paragraphs)
app = falcon.API()
books = BooksResource()
app.add_route('/books', books)
if __name__ == '__main__':
paragraphs = get_paragraphs('/home/sanchopanca/Documents/thunder.txt')
print(paragraphs)Add content type text/html to response | import falcon
import template
def get_paragraphs(pathname: str) -> list:
result = []
with open(pathname) as f:
for line in f.readlines():
if line != '\n':
result.append(line[:-1])
return result
class BooksResource:
def on_get(self, req, resp):
resp.status = falcon.HTTP_200
resp.content_type = 'text/html'
paragraphs = get_paragraphs('/home/sanchopanca/Documents/thunder.txt')
resp.body = template.render_template('book.html', paragraphs=paragraphs)
app = falcon.API()
books = BooksResource()
app.add_route('/books', books)
if __name__ == '__main__':
paragraphs = get_paragraphs('/home/sanchopanca/Documents/thunder.txt')
print(paragraphs) | <commit_before>import falcon
import template
def get_paragraphs(pathname: str) -> list:
result = []
with open(pathname) as f:
for line in f.readlines():
if line != '\n':
result.append(line[:-1])
return result
class BooksResource:
def on_get(self, req, resp):
resp.status = falcon.HTTP_200
paragraphs = get_paragraphs('/home/sanchopanca/Documents/thunder.txt')
resp.body = template.render_template('book.html', paragraphs=paragraphs)
app = falcon.API()
books = BooksResource()
app.add_route('/books', books)
if __name__ == '__main__':
paragraphs = get_paragraphs('/home/sanchopanca/Documents/thunder.txt')
print(paragraphs)<commit_msg>Add content type text/html to response<commit_after> | import falcon
import template
def get_paragraphs(pathname: str) -> list:
result = []
with open(pathname) as f:
for line in f.readlines():
if line != '\n':
result.append(line[:-1])
return result
class BooksResource:
def on_get(self, req, resp):
resp.status = falcon.HTTP_200
resp.content_type = 'text/html'
paragraphs = get_paragraphs('/home/sanchopanca/Documents/thunder.txt')
resp.body = template.render_template('book.html', paragraphs=paragraphs)
app = falcon.API()
books = BooksResource()
app.add_route('/books', books)
if __name__ == '__main__':
paragraphs = get_paragraphs('/home/sanchopanca/Documents/thunder.txt')
print(paragraphs) | import falcon
import template
def get_paragraphs(pathname: str) -> list:
result = []
with open(pathname) as f:
for line in f.readlines():
if line != '\n':
result.append(line[:-1])
return result
class BooksResource:
def on_get(self, req, resp):
resp.status = falcon.HTTP_200
paragraphs = get_paragraphs('/home/sanchopanca/Documents/thunder.txt')
resp.body = template.render_template('book.html', paragraphs=paragraphs)
app = falcon.API()
books = BooksResource()
app.add_route('/books', books)
if __name__ == '__main__':
paragraphs = get_paragraphs('/home/sanchopanca/Documents/thunder.txt')
print(paragraphs)Add content type text/html to responseimport falcon
import template
def get_paragraphs(pathname: str) -> list:
result = []
with open(pathname) as f:
for line in f.readlines():
if line != '\n':
result.append(line[:-1])
return result
class BooksResource:
def on_get(self, req, resp):
resp.status = falcon.HTTP_200
resp.content_type = 'text/html'
paragraphs = get_paragraphs('/home/sanchopanca/Documents/thunder.txt')
resp.body = template.render_template('book.html', paragraphs=paragraphs)
app = falcon.API()
books = BooksResource()
app.add_route('/books', books)
if __name__ == '__main__':
paragraphs = get_paragraphs('/home/sanchopanca/Documents/thunder.txt')
print(paragraphs) | <commit_before>import falcon
import template
def get_paragraphs(pathname: str) -> list:
result = []
with open(pathname) as f:
for line in f.readlines():
if line != '\n':
result.append(line[:-1])
return result
class BooksResource:
def on_get(self, req, resp):
resp.status = falcon.HTTP_200
paragraphs = get_paragraphs('/home/sanchopanca/Documents/thunder.txt')
resp.body = template.render_template('book.html', paragraphs=paragraphs)
app = falcon.API()
books = BooksResource()
app.add_route('/books', books)
if __name__ == '__main__':
paragraphs = get_paragraphs('/home/sanchopanca/Documents/thunder.txt')
print(paragraphs)<commit_msg>Add content type text/html to response<commit_after>import falcon
import template
def get_paragraphs(pathname: str) -> list:
result = []
with open(pathname) as f:
for line in f.readlines():
if line != '\n':
result.append(line[:-1])
return result
class BooksResource:
def on_get(self, req, resp):
resp.status = falcon.HTTP_200
resp.content_type = 'text/html'
paragraphs = get_paragraphs('/home/sanchopanca/Documents/thunder.txt')
resp.body = template.render_template('book.html', paragraphs=paragraphs)
app = falcon.API()
books = BooksResource()
app.add_route('/books', books)
if __name__ == '__main__':
paragraphs = get_paragraphs('/home/sanchopanca/Documents/thunder.txt')
print(paragraphs) |
02efde47b5cf20b7385eacaa3f21454ffa636ad7 | troposphere/codestarconnections.py | troposphere/codestarconnections.py | # Copyright (c) 2012-2020, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, Tags
VALID_CONNECTION_PROVIDERTYPE = ('Bitbucket')
def validate_connection_providertype(connection_providertype):
"""Validate ProviderType for Connection"""
if connection_providertype not in VALID_CONNECTION_PROVIDERTYPE:
raise ValueError("Connection ProviderType must be one of: %s" %
", ".join(VALID_CONNECTION_PROVIDERTYPE))
return connection_providertype
class Connection(AWSObject):
resource_type = "AWS::CodeStarConnections::Connection"
props = {
'ConnectionName': (basestring, True),
'ProviderType': (validate_connection_providertype, True),
'Tags': (Tags, False),
}
| # Copyright (c) 2012-2020, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, Tags
VALID_CONNECTION_PROVIDERTYPE = ('Bitbucket')
def validate_connection_providertype(connection_providertype):
"""Validate ProviderType for Connection"""
if connection_providertype not in VALID_CONNECTION_PROVIDERTYPE:
raise ValueError("Connection ProviderType must be one of: %s" %
", ".join(VALID_CONNECTION_PROVIDERTYPE))
return connection_providertype
class Connection(AWSObject):
resource_type = "AWS::CodeStarConnections::Connection"
props = {
'ConnectionName': (basestring, True),
'HostArn': (basestring, False),
'ProviderType': (validate_connection_providertype, True),
'Tags': (Tags, False),
}
| Update CodeStarConnections::Connection per 2020-07-23 update | Update CodeStarConnections::Connection per 2020-07-23 update
| Python | bsd-2-clause | cloudtools/troposphere,cloudtools/troposphere | # Copyright (c) 2012-2020, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, Tags
VALID_CONNECTION_PROVIDERTYPE = ('Bitbucket')
def validate_connection_providertype(connection_providertype):
"""Validate ProviderType for Connection"""
if connection_providertype not in VALID_CONNECTION_PROVIDERTYPE:
raise ValueError("Connection ProviderType must be one of: %s" %
", ".join(VALID_CONNECTION_PROVIDERTYPE))
return connection_providertype
class Connection(AWSObject):
resource_type = "AWS::CodeStarConnections::Connection"
props = {
'ConnectionName': (basestring, True),
'ProviderType': (validate_connection_providertype, True),
'Tags': (Tags, False),
}
Update CodeStarConnections::Connection per 2020-07-23 update | # Copyright (c) 2012-2020, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, Tags
VALID_CONNECTION_PROVIDERTYPE = ('Bitbucket')
def validate_connection_providertype(connection_providertype):
"""Validate ProviderType for Connection"""
if connection_providertype not in VALID_CONNECTION_PROVIDERTYPE:
raise ValueError("Connection ProviderType must be one of: %s" %
", ".join(VALID_CONNECTION_PROVIDERTYPE))
return connection_providertype
class Connection(AWSObject):
resource_type = "AWS::CodeStarConnections::Connection"
props = {
'ConnectionName': (basestring, True),
'HostArn': (basestring, False),
'ProviderType': (validate_connection_providertype, True),
'Tags': (Tags, False),
}
| <commit_before># Copyright (c) 2012-2020, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, Tags
VALID_CONNECTION_PROVIDERTYPE = ('Bitbucket')
def validate_connection_providertype(connection_providertype):
"""Validate ProviderType for Connection"""
if connection_providertype not in VALID_CONNECTION_PROVIDERTYPE:
raise ValueError("Connection ProviderType must be one of: %s" %
", ".join(VALID_CONNECTION_PROVIDERTYPE))
return connection_providertype
class Connection(AWSObject):
resource_type = "AWS::CodeStarConnections::Connection"
props = {
'ConnectionName': (basestring, True),
'ProviderType': (validate_connection_providertype, True),
'Tags': (Tags, False),
}
<commit_msg>Update CodeStarConnections::Connection per 2020-07-23 update<commit_after> | # Copyright (c) 2012-2020, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, Tags
VALID_CONNECTION_PROVIDERTYPE = ('Bitbucket')
def validate_connection_providertype(connection_providertype):
"""Validate ProviderType for Connection"""
if connection_providertype not in VALID_CONNECTION_PROVIDERTYPE:
raise ValueError("Connection ProviderType must be one of: %s" %
", ".join(VALID_CONNECTION_PROVIDERTYPE))
return connection_providertype
class Connection(AWSObject):
resource_type = "AWS::CodeStarConnections::Connection"
props = {
'ConnectionName': (basestring, True),
'HostArn': (basestring, False),
'ProviderType': (validate_connection_providertype, True),
'Tags': (Tags, False),
}
| # Copyright (c) 2012-2020, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, Tags
VALID_CONNECTION_PROVIDERTYPE = ('Bitbucket')
def validate_connection_providertype(connection_providertype):
"""Validate ProviderType for Connection"""
if connection_providertype not in VALID_CONNECTION_PROVIDERTYPE:
raise ValueError("Connection ProviderType must be one of: %s" %
", ".join(VALID_CONNECTION_PROVIDERTYPE))
return connection_providertype
class Connection(AWSObject):
resource_type = "AWS::CodeStarConnections::Connection"
props = {
'ConnectionName': (basestring, True),
'ProviderType': (validate_connection_providertype, True),
'Tags': (Tags, False),
}
Update CodeStarConnections::Connection per 2020-07-23 update# Copyright (c) 2012-2020, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, Tags
VALID_CONNECTION_PROVIDERTYPE = ('Bitbucket')
def validate_connection_providertype(connection_providertype):
"""Validate ProviderType for Connection"""
if connection_providertype not in VALID_CONNECTION_PROVIDERTYPE:
raise ValueError("Connection ProviderType must be one of: %s" %
", ".join(VALID_CONNECTION_PROVIDERTYPE))
return connection_providertype
class Connection(AWSObject):
resource_type = "AWS::CodeStarConnections::Connection"
props = {
'ConnectionName': (basestring, True),
'HostArn': (basestring, False),
'ProviderType': (validate_connection_providertype, True),
'Tags': (Tags, False),
}
| <commit_before># Copyright (c) 2012-2020, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, Tags
VALID_CONNECTION_PROVIDERTYPE = ('Bitbucket')
def validate_connection_providertype(connection_providertype):
"""Validate ProviderType for Connection"""
if connection_providertype not in VALID_CONNECTION_PROVIDERTYPE:
raise ValueError("Connection ProviderType must be one of: %s" %
", ".join(VALID_CONNECTION_PROVIDERTYPE))
return connection_providertype
class Connection(AWSObject):
resource_type = "AWS::CodeStarConnections::Connection"
props = {
'ConnectionName': (basestring, True),
'ProviderType': (validate_connection_providertype, True),
'Tags': (Tags, False),
}
<commit_msg>Update CodeStarConnections::Connection per 2020-07-23 update<commit_after># Copyright (c) 2012-2020, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, Tags
VALID_CONNECTION_PROVIDERTYPE = ('Bitbucket')
def validate_connection_providertype(connection_providertype):
"""Validate ProviderType for Connection"""
if connection_providertype not in VALID_CONNECTION_PROVIDERTYPE:
raise ValueError("Connection ProviderType must be one of: %s" %
", ".join(VALID_CONNECTION_PROVIDERTYPE))
return connection_providertype
class Connection(AWSObject):
resource_type = "AWS::CodeStarConnections::Connection"
props = {
'ConnectionName': (basestring, True),
'HostArn': (basestring, False),
'ProviderType': (validate_connection_providertype, True),
'Tags': (Tags, False),
}
|
b628e466f86bc27cbe45ec27a02d4774a0efd3bb | semantic_release/pypi.py | semantic_release/pypi.py | """PyPI
"""
from invoke import run
from semantic_release import ImproperConfigurationError
def upload_to_pypi(
dists: str = 'sdist bdist_wheel',
username: str = None,
password: str = None,
skip_existing: bool = False
):
"""Creates the wheel and uploads to pypi with twine.
:param dists: The dists string passed to setup.py. Default: 'bdist_wheel'
:param username: PyPI account username string
:param password: PyPI account password string
:param skip_existing: Continue uploading files if one already exists. (Only valid when
uploading to PyPI. Other implementations may not support this.)
"""
if username is None or password is None or username == "" or password == "":
raise ImproperConfigurationError('Missing credentials for uploading')
run('python setup.py {}'.format(dists))
run(
'twine upload -u {} -p {} {} {}'.format(
username,
password,
'--skip-existing' if skip_existing else '',
'dist/*'
)
)
run('rm -rf build dist')
| """PyPI
"""
from invoke import run
from semantic_release import ImproperConfigurationError
def upload_to_pypi(
dists: str = 'sdist bdist_wheel',
username: str = None,
password: str = None,
skip_existing: bool = False
):
"""Creates the wheel and uploads to pypi with twine.
:param dists: The dists string passed to setup.py. Default: 'bdist_wheel'
:param username: PyPI account username string
:param password: PyPI account password string
:param skip_existing: Continue uploading files if one already exists. (Only valid when
uploading to PyPI. Other implementations may not support this.)
"""
if username is None or password is None or username == "" or password == "":
raise ImproperConfigurationError('Missing credentials for uploading')
run('rm -rf build dist')
run('python setup.py {}'.format(dists))
run(
'twine upload -u {} -p {} {} {}'.format(
username,
password,
'--skip-existing' if skip_existing else '',
'dist/*'
)
)
run('rm -rf build dist')
| Clean out dist and build before building | fix: Clean out dist and build before building
This should fix the problem with uploading old versions.
Fixes #86
| Python | mit | relekang/python-semantic-release,relekang/python-semantic-release | """PyPI
"""
from invoke import run
from semantic_release import ImproperConfigurationError
def upload_to_pypi(
dists: str = 'sdist bdist_wheel',
username: str = None,
password: str = None,
skip_existing: bool = False
):
"""Creates the wheel and uploads to pypi with twine.
:param dists: The dists string passed to setup.py. Default: 'bdist_wheel'
:param username: PyPI account username string
:param password: PyPI account password string
:param skip_existing: Continue uploading files if one already exists. (Only valid when
uploading to PyPI. Other implementations may not support this.)
"""
if username is None or password is None or username == "" or password == "":
raise ImproperConfigurationError('Missing credentials for uploading')
run('python setup.py {}'.format(dists))
run(
'twine upload -u {} -p {} {} {}'.format(
username,
password,
'--skip-existing' if skip_existing else '',
'dist/*'
)
)
run('rm -rf build dist')
fix: Clean out dist and build before building
This should fix the problem with uploading old versions.
Fixes #86 | """PyPI
"""
from invoke import run
from semantic_release import ImproperConfigurationError
def upload_to_pypi(
dists: str = 'sdist bdist_wheel',
username: str = None,
password: str = None,
skip_existing: bool = False
):
"""Creates the wheel and uploads to pypi with twine.
:param dists: The dists string passed to setup.py. Default: 'bdist_wheel'
:param username: PyPI account username string
:param password: PyPI account password string
:param skip_existing: Continue uploading files if one already exists. (Only valid when
uploading to PyPI. Other implementations may not support this.)
"""
if username is None or password is None or username == "" or password == "":
raise ImproperConfigurationError('Missing credentials for uploading')
run('rm -rf build dist')
run('python setup.py {}'.format(dists))
run(
'twine upload -u {} -p {} {} {}'.format(
username,
password,
'--skip-existing' if skip_existing else '',
'dist/*'
)
)
run('rm -rf build dist')
| <commit_before>"""PyPI
"""
from invoke import run
from semantic_release import ImproperConfigurationError
def upload_to_pypi(
dists: str = 'sdist bdist_wheel',
username: str = None,
password: str = None,
skip_existing: bool = False
):
"""Creates the wheel and uploads to pypi with twine.
:param dists: The dists string passed to setup.py. Default: 'bdist_wheel'
:param username: PyPI account username string
:param password: PyPI account password string
:param skip_existing: Continue uploading files if one already exists. (Only valid when
uploading to PyPI. Other implementations may not support this.)
"""
if username is None or password is None or username == "" or password == "":
raise ImproperConfigurationError('Missing credentials for uploading')
run('python setup.py {}'.format(dists))
run(
'twine upload -u {} -p {} {} {}'.format(
username,
password,
'--skip-existing' if skip_existing else '',
'dist/*'
)
)
run('rm -rf build dist')
<commit_msg>fix: Clean out dist and build before building
This should fix the problem with uploading old versions.
Fixes #86<commit_after> | """PyPI
"""
from invoke import run
from semantic_release import ImproperConfigurationError
def upload_to_pypi(
dists: str = 'sdist bdist_wheel',
username: str = None,
password: str = None,
skip_existing: bool = False
):
"""Creates the wheel and uploads to pypi with twine.
:param dists: The dists string passed to setup.py. Default: 'bdist_wheel'
:param username: PyPI account username string
:param password: PyPI account password string
:param skip_existing: Continue uploading files if one already exists. (Only valid when
uploading to PyPI. Other implementations may not support this.)
"""
if username is None or password is None or username == "" or password == "":
raise ImproperConfigurationError('Missing credentials for uploading')
run('rm -rf build dist')
run('python setup.py {}'.format(dists))
run(
'twine upload -u {} -p {} {} {}'.format(
username,
password,
'--skip-existing' if skip_existing else '',
'dist/*'
)
)
run('rm -rf build dist')
| """PyPI
"""
from invoke import run
from semantic_release import ImproperConfigurationError
def upload_to_pypi(
dists: str = 'sdist bdist_wheel',
username: str = None,
password: str = None,
skip_existing: bool = False
):
"""Creates the wheel and uploads to pypi with twine.
:param dists: The dists string passed to setup.py. Default: 'bdist_wheel'
:param username: PyPI account username string
:param password: PyPI account password string
:param skip_existing: Continue uploading files if one already exists. (Only valid when
uploading to PyPI. Other implementations may not support this.)
"""
if username is None or password is None or username == "" or password == "":
raise ImproperConfigurationError('Missing credentials for uploading')
run('python setup.py {}'.format(dists))
run(
'twine upload -u {} -p {} {} {}'.format(
username,
password,
'--skip-existing' if skip_existing else '',
'dist/*'
)
)
run('rm -rf build dist')
fix: Clean out dist and build before building
This should fix the problem with uploading old versions.
Fixes #86"""PyPI
"""
from invoke import run
from semantic_release import ImproperConfigurationError
def upload_to_pypi(
dists: str = 'sdist bdist_wheel',
username: str = None,
password: str = None,
skip_existing: bool = False
):
"""Creates the wheel and uploads to pypi with twine.
:param dists: The dists string passed to setup.py. Default: 'bdist_wheel'
:param username: PyPI account username string
:param password: PyPI account password string
:param skip_existing: Continue uploading files if one already exists. (Only valid when
uploading to PyPI. Other implementations may not support this.)
"""
if username is None or password is None or username == "" or password == "":
raise ImproperConfigurationError('Missing credentials for uploading')
run('rm -rf build dist')
run('python setup.py {}'.format(dists))
run(
'twine upload -u {} -p {} {} {}'.format(
username,
password,
'--skip-existing' if skip_existing else '',
'dist/*'
)
)
run('rm -rf build dist')
| <commit_before>"""PyPI
"""
from invoke import run
from semantic_release import ImproperConfigurationError
def upload_to_pypi(
dists: str = 'sdist bdist_wheel',
username: str = None,
password: str = None,
skip_existing: bool = False
):
"""Creates the wheel and uploads to pypi with twine.
:param dists: The dists string passed to setup.py. Default: 'bdist_wheel'
:param username: PyPI account username string
:param password: PyPI account password string
:param skip_existing: Continue uploading files if one already exists. (Only valid when
uploading to PyPI. Other implementations may not support this.)
"""
if username is None or password is None or username == "" or password == "":
raise ImproperConfigurationError('Missing credentials for uploading')
run('python setup.py {}'.format(dists))
run(
'twine upload -u {} -p {} {} {}'.format(
username,
password,
'--skip-existing' if skip_existing else '',
'dist/*'
)
)
run('rm -rf build dist')
<commit_msg>fix: Clean out dist and build before building
This should fix the problem with uploading old versions.
Fixes #86<commit_after>"""PyPI
"""
from invoke import run
from semantic_release import ImproperConfigurationError
def upload_to_pypi(
dists: str = 'sdist bdist_wheel',
username: str = None,
password: str = None,
skip_existing: bool = False
):
"""Creates the wheel and uploads to pypi with twine.
:param dists: The dists string passed to setup.py. Default: 'bdist_wheel'
:param username: PyPI account username string
:param password: PyPI account password string
:param skip_existing: Continue uploading files if one already exists. (Only valid when
uploading to PyPI. Other implementations may not support this.)
"""
if username is None or password is None or username == "" or password == "":
raise ImproperConfigurationError('Missing credentials for uploading')
run('rm -rf build dist')
run('python setup.py {}'.format(dists))
run(
'twine upload -u {} -p {} {} {}'.format(
username,
password,
'--skip-existing' if skip_existing else '',
'dist/*'
)
)
run('rm -rf build dist')
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.