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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8daf5c8402a981942165d62ccb6057a26ad73012 | cms/tests/fixture_loading.py | cms/tests/fixture_loading.py | # -*- coding: utf-8 -*-
import tempfile
import codecs
try:
from cStringIO import StringIO
except:
from io import StringIO
from django.core.management import call_command
from cms.test_utils.fixtures.navextenders import NavextendersFixture
from cms.test_utils.testcases import SettingsOverrideTestCase
from cms.models import Page
class FixtureTestCase(NavextendersFixture, SettingsOverrideTestCase):
def test_fixture_load(self):
"""
This test dumps a live set of pages, cleanup the database and load it
again.
This makes fixtures unnecessary and it's easier to maintain.
"""
output = StringIO()
dump = tempfile.mkstemp(".json")
call_command('dumpdata', 'cms', indent=3, stdout=output)
Page.objects.all().delete()
output.seek(0)
with codecs.open(dump[1], 'w', 'utf-8') as dumpfile:
dumpfile.write(output.read())
self.assertEqual(0, Page.objects.count())
# Transaction disable, otherwise the connection it the test would be
# isolated from the data loaded in the different command connection
call_command('loaddata', dump[1], commit=False, stdout=output)
self.assertEqual(10, Page.objects.count())
| # -*- coding: utf-8 -*-
import tempfile
import codecs
try:
from cStringIO import StringIO
except:
from io import StringIO
from django.core.management import call_command
from cms.test_utils.fixtures.navextenders import NavextendersFixture
from cms.test_utils.testcases import SettingsOverrideTestCase
from cms.models import Page, Placeholder, CMSPlugin
class FixtureTestCase(NavextendersFixture, SettingsOverrideTestCase):
def test_fixture_load(self):
"""
This test dumps a live set of pages, cleanup the database and load it
again.
This makes fixtures unnecessary and it's easier to maintain.
"""
output = StringIO()
dump = tempfile.mkstemp(".json")
call_command('dumpdata', 'cms', indent=3, stdout=output)
original_ph = Placeholder.objects.count()
original_pages = Page.objects.count()
original_plugins = CMSPlugin.objects.count()
Page.objects.all().delete()
output.seek(0)
with codecs.open(dump[1], 'w', 'utf-8') as dumpfile:
dumpfile.write(output.read())
self.assertEqual(0, Page.objects.count())
self.assertEqual(0, Placeholder.objects.count())
# Transaction disable, otherwise the connection it the test would be
# isolated from the data loaded in the different command connection
call_command('loaddata', dump[1], commit=False, stdout=output)
self.assertEqual(10, Page.objects.count())
self.assertEqual(original_pages, Page.objects.count())
# Placeholder number may differ if signals does not correctly handle
# load data command
self.assertEqual(original_ph, Placeholder.objects.count())
self.assertEqual(original_plugins, CMSPlugin.objects.count()) | Change test_fixture_load to check for rescanned placeholders | Change test_fixture_load to check for rescanned placeholders
| Python | bsd-3-clause | stefanw/django-cms,bittner/django-cms,robmagee/django-cms,jsma/django-cms,jeffreylu9/django-cms,AlexProfi/django-cms,Jaccorot/django-cms,yakky/django-cms,memnonila/django-cms,intgr/django-cms,andyzsf/django-cms,intip/django-cms,leture/django-cms,jrief/django-cms,SachaMPS/django-cms,SofiaReis/django-cms,Livefyre/django-cms,liuyisiyisi/django-cms,ScholzVolkmer/django-cms,datakortet/django-cms,divio/django-cms,FinalAngel/django-cms,iddqd1/django-cms,MagicSolutions/django-cms,wuzhihui1123/django-cms,intip/django-cms,datakortet/django-cms,DylannCordel/django-cms,netzkolchose/django-cms,evildmp/django-cms,saintbird/django-cms,iddqd1/django-cms,liuyisiyisi/django-cms,isotoma/django-cms,owers19856/django-cms,divio/django-cms,360youlun/django-cms,leture/django-cms,donce/django-cms,intgr/django-cms,memnonila/django-cms,astagi/django-cms,wuzhihui1123/django-cms,dhorelik/django-cms,rryan/django-cms,divio/django-cms,vad/django-cms,iddqd1/django-cms,stefanfoulis/django-cms,mkoistinen/django-cms,keimlink/django-cms,SachaMPS/django-cms,selecsosi/django-cms,mkoistinen/django-cms,wuzhihui1123/django-cms,Vegasvikk/django-cms,cyberintruder/django-cms,frnhr/django-cms,rsalmaso/django-cms,SmithsonianEnterprises/django-cms,stefanw/django-cms,czpython/django-cms,sznekol/django-cms,takeshineshiro/django-cms,jsma/django-cms,wyg3958/django-cms,vstoykov/django-cms,qnub/django-cms,rsalmaso/django-cms,youprofit/django-cms,saintbird/django-cms,rryan/django-cms,Vegasvikk/django-cms,rsalmaso/django-cms,stefanfoulis/django-cms,rscnt/django-cms,petecummings/django-cms,donce/django-cms,datakortet/django-cms,benzkji/django-cms,benzkji/django-cms,dhorelik/django-cms,irudayarajisawa/django-cms,sephii/django-cms,jproffitt/django-cms,isotoma/django-cms,czpython/django-cms,timgraham/django-cms,qnub/django-cms,youprofit/django-cms,FinalAngel/django-cms,chmberl/django-cms,philippze/django-cms,chkir/django-cms,isotoma/django-cms,Jaccorot/django-cms,cyberintruder/django-cms,takeshineshiro/django-cms,vad/django-cms,selecsosi/django-cms,rscnt/django-cms,jrief/django-cms,robmagee/django-cms,farhaadila/django-cms,sephii/django-cms,qnub/django-cms,DylannCordel/django-cms,jproffitt/django-cms,Vegasvikk/django-cms,jrief/django-cms,keimlink/django-cms,chmberl/django-cms,AlexProfi/django-cms,yakky/django-cms,frnhr/django-cms,chmberl/django-cms,360youlun/django-cms,selecsosi/django-cms,vad/django-cms,irudayarajisawa/django-cms,jeffreylu9/django-cms,SmithsonianEnterprises/django-cms,selecsosi/django-cms,farhaadila/django-cms,Livefyre/django-cms,vxsx/django-cms,benzkji/django-cms,andyzsf/django-cms,dhorelik/django-cms,bittner/django-cms,MagicSolutions/django-cms,netzkolchose/django-cms,donce/django-cms,astagi/django-cms,frnhr/django-cms,rryan/django-cms,cyberintruder/django-cms,chkir/django-cms,360youlun/django-cms,SofiaReis/django-cms,nostalgiaz/django-cms,chkir/django-cms,timgraham/django-cms,webu/django-cms,vad/django-cms,bittner/django-cms,jrclaramunt/django-cms,netzkolchose/django-cms,frnhr/django-cms,vstoykov/django-cms,philippze/django-cms,Livefyre/django-cms,rryan/django-cms,astagi/django-cms,netzkolchose/django-cms,ScholzVolkmer/django-cms,kk9599/django-cms,divio/django-cms,bittner/django-cms,sephii/django-cms,nostalgiaz/django-cms,memnonila/django-cms,evildmp/django-cms,sznekol/django-cms,takeshineshiro/django-cms,czpython/django-cms,leture/django-cms,webu/django-cms,benzkji/django-cms,intip/django-cms,petecummings/django-cms,josjevv/django-cms,youprofit/django-cms,nimbis/django-cms,SofiaReis/django-cms,ScholzVolkmer/django-cms,rsalmaso/django-cms,jeffreylu9/django-cms,mkoistinen/django-cms,nimbis/django-cms,Jaccorot/django-cms,intgr/django-cms,evildmp/django-cms,andyzsf/django-cms,stefanw/django-cms,jproffitt/django-cms,josjevv/django-cms,intgr/django-cms,Livefyre/django-cms,farhaadila/django-cms,josjevv/django-cms,jrclaramunt/django-cms,sephii/django-cms,SachaMPS/django-cms,stefanfoulis/django-cms,robmagee/django-cms,wyg3958/django-cms,mkoistinen/django-cms,datakortet/django-cms,wyg3958/django-cms,jrief/django-cms,jsma/django-cms,SmithsonianEnterprises/django-cms,philippze/django-cms,DylannCordel/django-cms,stefanfoulis/django-cms,jeffreylu9/django-cms,vxsx/django-cms,liuyisiyisi/django-cms,sznekol/django-cms,owers19856/django-cms,kk9599/django-cms,vstoykov/django-cms,stefanw/django-cms,andyzsf/django-cms,jrclaramunt/django-cms,irudayarajisawa/django-cms,evildmp/django-cms,czpython/django-cms,jproffitt/django-cms,nostalgiaz/django-cms,AlexProfi/django-cms,nimbis/django-cms,isotoma/django-cms,FinalAngel/django-cms,vxsx/django-cms,wuzhihui1123/django-cms,kk9599/django-cms,nostalgiaz/django-cms,FinalAngel/django-cms,MagicSolutions/django-cms,jsma/django-cms,vxsx/django-cms,yakky/django-cms,intip/django-cms,saintbird/django-cms,owers19856/django-cms,nimbis/django-cms,webu/django-cms,petecummings/django-cms,rscnt/django-cms,yakky/django-cms,keimlink/django-cms,timgraham/django-cms | # -*- coding: utf-8 -*-
import tempfile
import codecs
try:
from cStringIO import StringIO
except:
from io import StringIO
from django.core.management import call_command
from cms.test_utils.fixtures.navextenders import NavextendersFixture
from cms.test_utils.testcases import SettingsOverrideTestCase
from cms.models import Page
class FixtureTestCase(NavextendersFixture, SettingsOverrideTestCase):
def test_fixture_load(self):
"""
This test dumps a live set of pages, cleanup the database and load it
again.
This makes fixtures unnecessary and it's easier to maintain.
"""
output = StringIO()
dump = tempfile.mkstemp(".json")
call_command('dumpdata', 'cms', indent=3, stdout=output)
Page.objects.all().delete()
output.seek(0)
with codecs.open(dump[1], 'w', 'utf-8') as dumpfile:
dumpfile.write(output.read())
self.assertEqual(0, Page.objects.count())
# Transaction disable, otherwise the connection it the test would be
# isolated from the data loaded in the different command connection
call_command('loaddata', dump[1], commit=False, stdout=output)
self.assertEqual(10, Page.objects.count())
Change test_fixture_load to check for rescanned placeholders | # -*- coding: utf-8 -*-
import tempfile
import codecs
try:
from cStringIO import StringIO
except:
from io import StringIO
from django.core.management import call_command
from cms.test_utils.fixtures.navextenders import NavextendersFixture
from cms.test_utils.testcases import SettingsOverrideTestCase
from cms.models import Page, Placeholder, CMSPlugin
class FixtureTestCase(NavextendersFixture, SettingsOverrideTestCase):
def test_fixture_load(self):
"""
This test dumps a live set of pages, cleanup the database and load it
again.
This makes fixtures unnecessary and it's easier to maintain.
"""
output = StringIO()
dump = tempfile.mkstemp(".json")
call_command('dumpdata', 'cms', indent=3, stdout=output)
original_ph = Placeholder.objects.count()
original_pages = Page.objects.count()
original_plugins = CMSPlugin.objects.count()
Page.objects.all().delete()
output.seek(0)
with codecs.open(dump[1], 'w', 'utf-8') as dumpfile:
dumpfile.write(output.read())
self.assertEqual(0, Page.objects.count())
self.assertEqual(0, Placeholder.objects.count())
# Transaction disable, otherwise the connection it the test would be
# isolated from the data loaded in the different command connection
call_command('loaddata', dump[1], commit=False, stdout=output)
self.assertEqual(10, Page.objects.count())
self.assertEqual(original_pages, Page.objects.count())
# Placeholder number may differ if signals does not correctly handle
# load data command
self.assertEqual(original_ph, Placeholder.objects.count())
self.assertEqual(original_plugins, CMSPlugin.objects.count()) | <commit_before># -*- coding: utf-8 -*-
import tempfile
import codecs
try:
from cStringIO import StringIO
except:
from io import StringIO
from django.core.management import call_command
from cms.test_utils.fixtures.navextenders import NavextendersFixture
from cms.test_utils.testcases import SettingsOverrideTestCase
from cms.models import Page
class FixtureTestCase(NavextendersFixture, SettingsOverrideTestCase):
def test_fixture_load(self):
"""
This test dumps a live set of pages, cleanup the database and load it
again.
This makes fixtures unnecessary and it's easier to maintain.
"""
output = StringIO()
dump = tempfile.mkstemp(".json")
call_command('dumpdata', 'cms', indent=3, stdout=output)
Page.objects.all().delete()
output.seek(0)
with codecs.open(dump[1], 'w', 'utf-8') as dumpfile:
dumpfile.write(output.read())
self.assertEqual(0, Page.objects.count())
# Transaction disable, otherwise the connection it the test would be
# isolated from the data loaded in the different command connection
call_command('loaddata', dump[1], commit=False, stdout=output)
self.assertEqual(10, Page.objects.count())
<commit_msg>Change test_fixture_load to check for rescanned placeholders<commit_after> | # -*- coding: utf-8 -*-
import tempfile
import codecs
try:
from cStringIO import StringIO
except:
from io import StringIO
from django.core.management import call_command
from cms.test_utils.fixtures.navextenders import NavextendersFixture
from cms.test_utils.testcases import SettingsOverrideTestCase
from cms.models import Page, Placeholder, CMSPlugin
class FixtureTestCase(NavextendersFixture, SettingsOverrideTestCase):
def test_fixture_load(self):
"""
This test dumps a live set of pages, cleanup the database and load it
again.
This makes fixtures unnecessary and it's easier to maintain.
"""
output = StringIO()
dump = tempfile.mkstemp(".json")
call_command('dumpdata', 'cms', indent=3, stdout=output)
original_ph = Placeholder.objects.count()
original_pages = Page.objects.count()
original_plugins = CMSPlugin.objects.count()
Page.objects.all().delete()
output.seek(0)
with codecs.open(dump[1], 'w', 'utf-8') as dumpfile:
dumpfile.write(output.read())
self.assertEqual(0, Page.objects.count())
self.assertEqual(0, Placeholder.objects.count())
# Transaction disable, otherwise the connection it the test would be
# isolated from the data loaded in the different command connection
call_command('loaddata', dump[1], commit=False, stdout=output)
self.assertEqual(10, Page.objects.count())
self.assertEqual(original_pages, Page.objects.count())
# Placeholder number may differ if signals does not correctly handle
# load data command
self.assertEqual(original_ph, Placeholder.objects.count())
self.assertEqual(original_plugins, CMSPlugin.objects.count()) | # -*- coding: utf-8 -*-
import tempfile
import codecs
try:
from cStringIO import StringIO
except:
from io import StringIO
from django.core.management import call_command
from cms.test_utils.fixtures.navextenders import NavextendersFixture
from cms.test_utils.testcases import SettingsOverrideTestCase
from cms.models import Page
class FixtureTestCase(NavextendersFixture, SettingsOverrideTestCase):
def test_fixture_load(self):
"""
This test dumps a live set of pages, cleanup the database and load it
again.
This makes fixtures unnecessary and it's easier to maintain.
"""
output = StringIO()
dump = tempfile.mkstemp(".json")
call_command('dumpdata', 'cms', indent=3, stdout=output)
Page.objects.all().delete()
output.seek(0)
with codecs.open(dump[1], 'w', 'utf-8') as dumpfile:
dumpfile.write(output.read())
self.assertEqual(0, Page.objects.count())
# Transaction disable, otherwise the connection it the test would be
# isolated from the data loaded in the different command connection
call_command('loaddata', dump[1], commit=False, stdout=output)
self.assertEqual(10, Page.objects.count())
Change test_fixture_load to check for rescanned placeholders# -*- coding: utf-8 -*-
import tempfile
import codecs
try:
from cStringIO import StringIO
except:
from io import StringIO
from django.core.management import call_command
from cms.test_utils.fixtures.navextenders import NavextendersFixture
from cms.test_utils.testcases import SettingsOverrideTestCase
from cms.models import Page, Placeholder, CMSPlugin
class FixtureTestCase(NavextendersFixture, SettingsOverrideTestCase):
def test_fixture_load(self):
"""
This test dumps a live set of pages, cleanup the database and load it
again.
This makes fixtures unnecessary and it's easier to maintain.
"""
output = StringIO()
dump = tempfile.mkstemp(".json")
call_command('dumpdata', 'cms', indent=3, stdout=output)
original_ph = Placeholder.objects.count()
original_pages = Page.objects.count()
original_plugins = CMSPlugin.objects.count()
Page.objects.all().delete()
output.seek(0)
with codecs.open(dump[1], 'w', 'utf-8') as dumpfile:
dumpfile.write(output.read())
self.assertEqual(0, Page.objects.count())
self.assertEqual(0, Placeholder.objects.count())
# Transaction disable, otherwise the connection it the test would be
# isolated from the data loaded in the different command connection
call_command('loaddata', dump[1], commit=False, stdout=output)
self.assertEqual(10, Page.objects.count())
self.assertEqual(original_pages, Page.objects.count())
# Placeholder number may differ if signals does not correctly handle
# load data command
self.assertEqual(original_ph, Placeholder.objects.count())
self.assertEqual(original_plugins, CMSPlugin.objects.count()) | <commit_before># -*- coding: utf-8 -*-
import tempfile
import codecs
try:
from cStringIO import StringIO
except:
from io import StringIO
from django.core.management import call_command
from cms.test_utils.fixtures.navextenders import NavextendersFixture
from cms.test_utils.testcases import SettingsOverrideTestCase
from cms.models import Page
class FixtureTestCase(NavextendersFixture, SettingsOverrideTestCase):
def test_fixture_load(self):
"""
This test dumps a live set of pages, cleanup the database and load it
again.
This makes fixtures unnecessary and it's easier to maintain.
"""
output = StringIO()
dump = tempfile.mkstemp(".json")
call_command('dumpdata', 'cms', indent=3, stdout=output)
Page.objects.all().delete()
output.seek(0)
with codecs.open(dump[1], 'w', 'utf-8') as dumpfile:
dumpfile.write(output.read())
self.assertEqual(0, Page.objects.count())
# Transaction disable, otherwise the connection it the test would be
# isolated from the data loaded in the different command connection
call_command('loaddata', dump[1], commit=False, stdout=output)
self.assertEqual(10, Page.objects.count())
<commit_msg>Change test_fixture_load to check for rescanned placeholders<commit_after># -*- coding: utf-8 -*-
import tempfile
import codecs
try:
from cStringIO import StringIO
except:
from io import StringIO
from django.core.management import call_command
from cms.test_utils.fixtures.navextenders import NavextendersFixture
from cms.test_utils.testcases import SettingsOverrideTestCase
from cms.models import Page, Placeholder, CMSPlugin
class FixtureTestCase(NavextendersFixture, SettingsOverrideTestCase):
def test_fixture_load(self):
"""
This test dumps a live set of pages, cleanup the database and load it
again.
This makes fixtures unnecessary and it's easier to maintain.
"""
output = StringIO()
dump = tempfile.mkstemp(".json")
call_command('dumpdata', 'cms', indent=3, stdout=output)
original_ph = Placeholder.objects.count()
original_pages = Page.objects.count()
original_plugins = CMSPlugin.objects.count()
Page.objects.all().delete()
output.seek(0)
with codecs.open(dump[1], 'w', 'utf-8') as dumpfile:
dumpfile.write(output.read())
self.assertEqual(0, Page.objects.count())
self.assertEqual(0, Placeholder.objects.count())
# Transaction disable, otherwise the connection it the test would be
# isolated from the data loaded in the different command connection
call_command('loaddata', dump[1], commit=False, stdout=output)
self.assertEqual(10, Page.objects.count())
self.assertEqual(original_pages, Page.objects.count())
# Placeholder number may differ if signals does not correctly handle
# load data command
self.assertEqual(original_ph, Placeholder.objects.count())
self.assertEqual(original_plugins, CMSPlugin.objects.count()) |
cc380dc41f02735d49da95a099646b0b6bcc29fb | src/hocr/parser.py | src/hocr/parser.py | from .page import Page
import six
from bs4 import UnicodeDammit, BeautifulSoup
# from lxml.etree import fromstring
def parse(source):
"""Parse a HOCR stream into page elements.
@param[in] source
Either a file-like object or a filename of the HOCR text.
"""
# Corece the source into content.
if isinstance(source, six.string_types):
with open(source, 'rb') as stream:
content = stream.read()
else:
content = source.read()
# Parse the HOCR xml stream.
ud = UnicodeDammit(content, is_html=True)
soup = BeautifulSoup(ud.unicode_markup)
# Get all the pages and parse them into page elements.
return [Page(x) for x in soup.find_all(class_='ocr_page')]
| from .page import Page
import six
from bs4 import UnicodeDammit, BeautifulSoup
# from lxml.etree import fromstring
def parse(source):
"""Parse a HOCR stream into page elements.
@param[in] source
Either a file-like object or a filename of the HOCR text.
"""
# Corece the source into content.
if isinstance(source, six.string_types):
with open(source, 'rb') as stream:
content = stream.read()
else:
content = source.read()
# Parse the HOCR xml stream.
ud = UnicodeDammit(content, is_html=True)
soup = BeautifulSoup(ud.unicode_markup, 'lxml')
# Get all the pages and parse them into page elements.
return [Page(x) for x in soup.find_all(class_='ocr_page')]
| Add explicit usage of backend | Add explicit usage of backend
| Python | mit | concordusapps/python-hocr | from .page import Page
import six
from bs4 import UnicodeDammit, BeautifulSoup
# from lxml.etree import fromstring
def parse(source):
"""Parse a HOCR stream into page elements.
@param[in] source
Either a file-like object or a filename of the HOCR text.
"""
# Corece the source into content.
if isinstance(source, six.string_types):
with open(source, 'rb') as stream:
content = stream.read()
else:
content = source.read()
# Parse the HOCR xml stream.
ud = UnicodeDammit(content, is_html=True)
soup = BeautifulSoup(ud.unicode_markup)
# Get all the pages and parse them into page elements.
return [Page(x) for x in soup.find_all(class_='ocr_page')]
Add explicit usage of backend | from .page import Page
import six
from bs4 import UnicodeDammit, BeautifulSoup
# from lxml.etree import fromstring
def parse(source):
"""Parse a HOCR stream into page elements.
@param[in] source
Either a file-like object or a filename of the HOCR text.
"""
# Corece the source into content.
if isinstance(source, six.string_types):
with open(source, 'rb') as stream:
content = stream.read()
else:
content = source.read()
# Parse the HOCR xml stream.
ud = UnicodeDammit(content, is_html=True)
soup = BeautifulSoup(ud.unicode_markup, 'lxml')
# Get all the pages and parse them into page elements.
return [Page(x) for x in soup.find_all(class_='ocr_page')]
| <commit_before>from .page import Page
import six
from bs4 import UnicodeDammit, BeautifulSoup
# from lxml.etree import fromstring
def parse(source):
"""Parse a HOCR stream into page elements.
@param[in] source
Either a file-like object or a filename of the HOCR text.
"""
# Corece the source into content.
if isinstance(source, six.string_types):
with open(source, 'rb') as stream:
content = stream.read()
else:
content = source.read()
# Parse the HOCR xml stream.
ud = UnicodeDammit(content, is_html=True)
soup = BeautifulSoup(ud.unicode_markup)
# Get all the pages and parse them into page elements.
return [Page(x) for x in soup.find_all(class_='ocr_page')]
<commit_msg>Add explicit usage of backend<commit_after> | from .page import Page
import six
from bs4 import UnicodeDammit, BeautifulSoup
# from lxml.etree import fromstring
def parse(source):
"""Parse a HOCR stream into page elements.
@param[in] source
Either a file-like object or a filename of the HOCR text.
"""
# Corece the source into content.
if isinstance(source, six.string_types):
with open(source, 'rb') as stream:
content = stream.read()
else:
content = source.read()
# Parse the HOCR xml stream.
ud = UnicodeDammit(content, is_html=True)
soup = BeautifulSoup(ud.unicode_markup, 'lxml')
# Get all the pages and parse them into page elements.
return [Page(x) for x in soup.find_all(class_='ocr_page')]
| from .page import Page
import six
from bs4 import UnicodeDammit, BeautifulSoup
# from lxml.etree import fromstring
def parse(source):
"""Parse a HOCR stream into page elements.
@param[in] source
Either a file-like object or a filename of the HOCR text.
"""
# Corece the source into content.
if isinstance(source, six.string_types):
with open(source, 'rb') as stream:
content = stream.read()
else:
content = source.read()
# Parse the HOCR xml stream.
ud = UnicodeDammit(content, is_html=True)
soup = BeautifulSoup(ud.unicode_markup)
# Get all the pages and parse them into page elements.
return [Page(x) for x in soup.find_all(class_='ocr_page')]
Add explicit usage of backendfrom .page import Page
import six
from bs4 import UnicodeDammit, BeautifulSoup
# from lxml.etree import fromstring
def parse(source):
"""Parse a HOCR stream into page elements.
@param[in] source
Either a file-like object or a filename of the HOCR text.
"""
# Corece the source into content.
if isinstance(source, six.string_types):
with open(source, 'rb') as stream:
content = stream.read()
else:
content = source.read()
# Parse the HOCR xml stream.
ud = UnicodeDammit(content, is_html=True)
soup = BeautifulSoup(ud.unicode_markup, 'lxml')
# Get all the pages and parse them into page elements.
return [Page(x) for x in soup.find_all(class_='ocr_page')]
| <commit_before>from .page import Page
import six
from bs4 import UnicodeDammit, BeautifulSoup
# from lxml.etree import fromstring
def parse(source):
"""Parse a HOCR stream into page elements.
@param[in] source
Either a file-like object or a filename of the HOCR text.
"""
# Corece the source into content.
if isinstance(source, six.string_types):
with open(source, 'rb') as stream:
content = stream.read()
else:
content = source.read()
# Parse the HOCR xml stream.
ud = UnicodeDammit(content, is_html=True)
soup = BeautifulSoup(ud.unicode_markup)
# Get all the pages and parse them into page elements.
return [Page(x) for x in soup.find_all(class_='ocr_page')]
<commit_msg>Add explicit usage of backend<commit_after>from .page import Page
import six
from bs4 import UnicodeDammit, BeautifulSoup
# from lxml.etree import fromstring
def parse(source):
"""Parse a HOCR stream into page elements.
@param[in] source
Either a file-like object or a filename of the HOCR text.
"""
# Corece the source into content.
if isinstance(source, six.string_types):
with open(source, 'rb') as stream:
content = stream.read()
else:
content = source.read()
# Parse the HOCR xml stream.
ud = UnicodeDammit(content, is_html=True)
soup = BeautifulSoup(ud.unicode_markup, 'lxml')
# Get all the pages and parse them into page elements.
return [Page(x) for x in soup.find_all(class_='ocr_page')]
|
d8e3612d0defdd55253275e676ef57c22a25c3f7 | wishlist/admin.py | wishlist/admin.py | ## Django Admin
from django.contrib import admin
from wishlist.models import Item
#admin.site.register( Category )
#admin.site.register( Item )
class ItemAdmin( admin.ModelAdmin ) :
list_display = ( "id", "name", "category", "sort_order", "price" )
list_filter = ( "is_active", "category" )
search_fields = ( 'name', )
list_per_page = 30
admin.site.register( Item, ItemAdmin )
| ## Django Admin
from django.contrib import admin
from wishlist.models import *
admin.site.register( Category )
class ItemAdmin( admin.ModelAdmin ) :
list_display = ( "id", "name", "category", "sort_order", "price" )
list_filter = ( "is_active", "category" )
search_fields = ( 'name', )
list_per_page = 30
admin.site.register( Item, ItemAdmin )
| Update Django Admin interface to allow editing of Categories | Update Django Admin interface to allow editing of Categories
| Python | mit | cgarvey/django-mywishlist,cgarvey/django-mywishlist | ## Django Admin
from django.contrib import admin
from wishlist.models import Item
#admin.site.register( Category )
#admin.site.register( Item )
class ItemAdmin( admin.ModelAdmin ) :
list_display = ( "id", "name", "category", "sort_order", "price" )
list_filter = ( "is_active", "category" )
search_fields = ( 'name', )
list_per_page = 30
admin.site.register( Item, ItemAdmin )
Update Django Admin interface to allow editing of Categories | ## Django Admin
from django.contrib import admin
from wishlist.models import *
admin.site.register( Category )
class ItemAdmin( admin.ModelAdmin ) :
list_display = ( "id", "name", "category", "sort_order", "price" )
list_filter = ( "is_active", "category" )
search_fields = ( 'name', )
list_per_page = 30
admin.site.register( Item, ItemAdmin )
| <commit_before>## Django Admin
from django.contrib import admin
from wishlist.models import Item
#admin.site.register( Category )
#admin.site.register( Item )
class ItemAdmin( admin.ModelAdmin ) :
list_display = ( "id", "name", "category", "sort_order", "price" )
list_filter = ( "is_active", "category" )
search_fields = ( 'name', )
list_per_page = 30
admin.site.register( Item, ItemAdmin )
<commit_msg>Update Django Admin interface to allow editing of Categories<commit_after> | ## Django Admin
from django.contrib import admin
from wishlist.models import *
admin.site.register( Category )
class ItemAdmin( admin.ModelAdmin ) :
list_display = ( "id", "name", "category", "sort_order", "price" )
list_filter = ( "is_active", "category" )
search_fields = ( 'name', )
list_per_page = 30
admin.site.register( Item, ItemAdmin )
| ## Django Admin
from django.contrib import admin
from wishlist.models import Item
#admin.site.register( Category )
#admin.site.register( Item )
class ItemAdmin( admin.ModelAdmin ) :
list_display = ( "id", "name", "category", "sort_order", "price" )
list_filter = ( "is_active", "category" )
search_fields = ( 'name', )
list_per_page = 30
admin.site.register( Item, ItemAdmin )
Update Django Admin interface to allow editing of Categories## Django Admin
from django.contrib import admin
from wishlist.models import *
admin.site.register( Category )
class ItemAdmin( admin.ModelAdmin ) :
list_display = ( "id", "name", "category", "sort_order", "price" )
list_filter = ( "is_active", "category" )
search_fields = ( 'name', )
list_per_page = 30
admin.site.register( Item, ItemAdmin )
| <commit_before>## Django Admin
from django.contrib import admin
from wishlist.models import Item
#admin.site.register( Category )
#admin.site.register( Item )
class ItemAdmin( admin.ModelAdmin ) :
list_display = ( "id", "name", "category", "sort_order", "price" )
list_filter = ( "is_active", "category" )
search_fields = ( 'name', )
list_per_page = 30
admin.site.register( Item, ItemAdmin )
<commit_msg>Update Django Admin interface to allow editing of Categories<commit_after>## Django Admin
from django.contrib import admin
from wishlist.models import *
admin.site.register( Category )
class ItemAdmin( admin.ModelAdmin ) :
list_display = ( "id", "name", "category", "sort_order", "price" )
list_filter = ( "is_active", "category" )
search_fields = ( 'name', )
list_per_page = 30
admin.site.register( Item, ItemAdmin )
|
d1826b00f4b4944161c66e737978bdc87bb57b52 | polyaxon/libs/decorators.py | polyaxon/libs/decorators.py | class IgnoreRawDecorator(object):
"""The `IgnoreRawDecorator` is a decorator to ignore raw/fixture data during signals handling.
usage example:
@receiver(post_save, sender=settings.AUTH_USER_MODEL)
@ignore_raw
def my_signal_handler(sender, instance=None, created=False, **kwargs):
...
return ...
"""
def __init__(self, f):
self.f = f
def __call__(self, *args, **kwargs):
if kwargs.get('raw'):
# Ignore signal handling for fixture loading
return
return self.f(*args, **kwargs)
ignore_raw = IgnoreRawDecorator
| from django.conf import settings
class IgnoreRawDecorator(object):
"""The `IgnoreRawDecorator` is a decorator to ignore raw/fixture data during signals handling.
usage example:
@receiver(post_save, sender=settings.AUTH_USER_MODEL)
@ignore_raw
def my_signal_handler(sender, instance=None, created=False, **kwargs):
...
return ...
"""
def __init__(self, f):
self.f = f
def __call__(self, *args, **kwargs):
if kwargs.get('raw'):
# Ignore signal handling for fixture loading
return
return self.f(*args, **kwargs)
class RunnerSignalDecorator(object):
"""The `RunnerSignalDecorator` is a decorator to ignore signals related to runner.
This is useful to ignore any signal that is runner specific.
usage example:
@receiver(post_save, sender=settings.AUTH_USER_MODEL)
@runner_signal
@ignore_raw
def my_signal_handler(sender, instance=None, created=False, **kwargs):
...
return ...
"""
def __init__(self, f):
self.f = f
def __call__(self, *args, **kwargs):
if not settings.DEPLOY_RUNNER:
# Ignore signal handling for fixture loading
return
return self.f(*args, **kwargs)
ignore_raw = IgnoreRawDecorator
runner_signal = RunnerSignalDecorator
| Add decorator for runner signals | Add decorator for runner signals
| Python | apache-2.0 | polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon | class IgnoreRawDecorator(object):
"""The `IgnoreRawDecorator` is a decorator to ignore raw/fixture data during signals handling.
usage example:
@receiver(post_save, sender=settings.AUTH_USER_MODEL)
@ignore_raw
def my_signal_handler(sender, instance=None, created=False, **kwargs):
...
return ...
"""
def __init__(self, f):
self.f = f
def __call__(self, *args, **kwargs):
if kwargs.get('raw'):
# Ignore signal handling for fixture loading
return
return self.f(*args, **kwargs)
ignore_raw = IgnoreRawDecorator
Add decorator for runner signals | from django.conf import settings
class IgnoreRawDecorator(object):
"""The `IgnoreRawDecorator` is a decorator to ignore raw/fixture data during signals handling.
usage example:
@receiver(post_save, sender=settings.AUTH_USER_MODEL)
@ignore_raw
def my_signal_handler(sender, instance=None, created=False, **kwargs):
...
return ...
"""
def __init__(self, f):
self.f = f
def __call__(self, *args, **kwargs):
if kwargs.get('raw'):
# Ignore signal handling for fixture loading
return
return self.f(*args, **kwargs)
class RunnerSignalDecorator(object):
"""The `RunnerSignalDecorator` is a decorator to ignore signals related to runner.
This is useful to ignore any signal that is runner specific.
usage example:
@receiver(post_save, sender=settings.AUTH_USER_MODEL)
@runner_signal
@ignore_raw
def my_signal_handler(sender, instance=None, created=False, **kwargs):
...
return ...
"""
def __init__(self, f):
self.f = f
def __call__(self, *args, **kwargs):
if not settings.DEPLOY_RUNNER:
# Ignore signal handling for fixture loading
return
return self.f(*args, **kwargs)
ignore_raw = IgnoreRawDecorator
runner_signal = RunnerSignalDecorator
| <commit_before>class IgnoreRawDecorator(object):
"""The `IgnoreRawDecorator` is a decorator to ignore raw/fixture data during signals handling.
usage example:
@receiver(post_save, sender=settings.AUTH_USER_MODEL)
@ignore_raw
def my_signal_handler(sender, instance=None, created=False, **kwargs):
...
return ...
"""
def __init__(self, f):
self.f = f
def __call__(self, *args, **kwargs):
if kwargs.get('raw'):
# Ignore signal handling for fixture loading
return
return self.f(*args, **kwargs)
ignore_raw = IgnoreRawDecorator
<commit_msg>Add decorator for runner signals<commit_after> | from django.conf import settings
class IgnoreRawDecorator(object):
"""The `IgnoreRawDecorator` is a decorator to ignore raw/fixture data during signals handling.
usage example:
@receiver(post_save, sender=settings.AUTH_USER_MODEL)
@ignore_raw
def my_signal_handler(sender, instance=None, created=False, **kwargs):
...
return ...
"""
def __init__(self, f):
self.f = f
def __call__(self, *args, **kwargs):
if kwargs.get('raw'):
# Ignore signal handling for fixture loading
return
return self.f(*args, **kwargs)
class RunnerSignalDecorator(object):
"""The `RunnerSignalDecorator` is a decorator to ignore signals related to runner.
This is useful to ignore any signal that is runner specific.
usage example:
@receiver(post_save, sender=settings.AUTH_USER_MODEL)
@runner_signal
@ignore_raw
def my_signal_handler(sender, instance=None, created=False, **kwargs):
...
return ...
"""
def __init__(self, f):
self.f = f
def __call__(self, *args, **kwargs):
if not settings.DEPLOY_RUNNER:
# Ignore signal handling for fixture loading
return
return self.f(*args, **kwargs)
ignore_raw = IgnoreRawDecorator
runner_signal = RunnerSignalDecorator
| class IgnoreRawDecorator(object):
"""The `IgnoreRawDecorator` is a decorator to ignore raw/fixture data during signals handling.
usage example:
@receiver(post_save, sender=settings.AUTH_USER_MODEL)
@ignore_raw
def my_signal_handler(sender, instance=None, created=False, **kwargs):
...
return ...
"""
def __init__(self, f):
self.f = f
def __call__(self, *args, **kwargs):
if kwargs.get('raw'):
# Ignore signal handling for fixture loading
return
return self.f(*args, **kwargs)
ignore_raw = IgnoreRawDecorator
Add decorator for runner signalsfrom django.conf import settings
class IgnoreRawDecorator(object):
"""The `IgnoreRawDecorator` is a decorator to ignore raw/fixture data during signals handling.
usage example:
@receiver(post_save, sender=settings.AUTH_USER_MODEL)
@ignore_raw
def my_signal_handler(sender, instance=None, created=False, **kwargs):
...
return ...
"""
def __init__(self, f):
self.f = f
def __call__(self, *args, **kwargs):
if kwargs.get('raw'):
# Ignore signal handling for fixture loading
return
return self.f(*args, **kwargs)
class RunnerSignalDecorator(object):
"""The `RunnerSignalDecorator` is a decorator to ignore signals related to runner.
This is useful to ignore any signal that is runner specific.
usage example:
@receiver(post_save, sender=settings.AUTH_USER_MODEL)
@runner_signal
@ignore_raw
def my_signal_handler(sender, instance=None, created=False, **kwargs):
...
return ...
"""
def __init__(self, f):
self.f = f
def __call__(self, *args, **kwargs):
if not settings.DEPLOY_RUNNER:
# Ignore signal handling for fixture loading
return
return self.f(*args, **kwargs)
ignore_raw = IgnoreRawDecorator
runner_signal = RunnerSignalDecorator
| <commit_before>class IgnoreRawDecorator(object):
"""The `IgnoreRawDecorator` is a decorator to ignore raw/fixture data during signals handling.
usage example:
@receiver(post_save, sender=settings.AUTH_USER_MODEL)
@ignore_raw
def my_signal_handler(sender, instance=None, created=False, **kwargs):
...
return ...
"""
def __init__(self, f):
self.f = f
def __call__(self, *args, **kwargs):
if kwargs.get('raw'):
# Ignore signal handling for fixture loading
return
return self.f(*args, **kwargs)
ignore_raw = IgnoreRawDecorator
<commit_msg>Add decorator for runner signals<commit_after>from django.conf import settings
class IgnoreRawDecorator(object):
"""The `IgnoreRawDecorator` is a decorator to ignore raw/fixture data during signals handling.
usage example:
@receiver(post_save, sender=settings.AUTH_USER_MODEL)
@ignore_raw
def my_signal_handler(sender, instance=None, created=False, **kwargs):
...
return ...
"""
def __init__(self, f):
self.f = f
def __call__(self, *args, **kwargs):
if kwargs.get('raw'):
# Ignore signal handling for fixture loading
return
return self.f(*args, **kwargs)
class RunnerSignalDecorator(object):
"""The `RunnerSignalDecorator` is a decorator to ignore signals related to runner.
This is useful to ignore any signal that is runner specific.
usage example:
@receiver(post_save, sender=settings.AUTH_USER_MODEL)
@runner_signal
@ignore_raw
def my_signal_handler(sender, instance=None, created=False, **kwargs):
...
return ...
"""
def __init__(self, f):
self.f = f
def __call__(self, *args, **kwargs):
if not settings.DEPLOY_RUNNER:
# Ignore signal handling for fixture loading
return
return self.f(*args, **kwargs)
ignore_raw = IgnoreRawDecorator
runner_signal = RunnerSignalDecorator
|
d19a6ea9da1f6fe3313a36d44d6e6b4e9749acaa | test/test_regression_17.py | test/test_regression_17.py | import pytest
import python_jsonschema_objects as pjo
@pytest.fixture
def test_class():
schema = {
'title': 'Example',
'properties': {
"claimed_by": {
"id": "claimed",
"type": ["string", "integer", "null"],
"description": "Robots Only. The human agent that has claimed this robot.",
"required": False
},
}
}
builder = pjo.ObjectBuilder(schema)
ns = builder.build_classes()
return ns
@pytest.mark.parametrize('value', [
"Hi", 4, None])
def test_properties_can_have_multiple_types(test_class, value):
test_class.Example(claimed_by=value)
@pytest.mark.parametrize('value', [2.4])
def test_multiply_typed_properties_still_validate(test_class, value):
with pytest.raises(pjo.ValidationError):
test_class.Example(claimed_by=value)
| import pytest
import python_jsonschema_objects as pjo
@pytest.fixture
def test_class():
schema = {
'title': 'Example',
'properties': {
"claimed_by": {
"id": "claimed",
"type": ["string", "integer", "null"],
"description": "Robots Only. The human agent that has claimed this robot.",
},
}
}
builder = pjo.ObjectBuilder(schema)
ns = builder.build_classes()
return ns
@pytest.mark.parametrize('value', [
"Hi", 4, None])
def test_properties_can_have_multiple_types(test_class, value):
test_class.Example(claimed_by=value)
@pytest.mark.parametrize('value', [2.4])
def test_multiply_typed_properties_still_validate(test_class, value):
with pytest.raises(pjo.ValidationError):
test_class.Example(claimed_by=value)
| Fix an actual schema validation error in one of the tests | Fix an actual schema validation error in one of the tests
| Python | mit | cwacek/python-jsonschema-objects | import pytest
import python_jsonschema_objects as pjo
@pytest.fixture
def test_class():
schema = {
'title': 'Example',
'properties': {
"claimed_by": {
"id": "claimed",
"type": ["string", "integer", "null"],
"description": "Robots Only. The human agent that has claimed this robot.",
"required": False
},
}
}
builder = pjo.ObjectBuilder(schema)
ns = builder.build_classes()
return ns
@pytest.mark.parametrize('value', [
"Hi", 4, None])
def test_properties_can_have_multiple_types(test_class, value):
test_class.Example(claimed_by=value)
@pytest.mark.parametrize('value', [2.4])
def test_multiply_typed_properties_still_validate(test_class, value):
with pytest.raises(pjo.ValidationError):
test_class.Example(claimed_by=value)
Fix an actual schema validation error in one of the tests | import pytest
import python_jsonschema_objects as pjo
@pytest.fixture
def test_class():
schema = {
'title': 'Example',
'properties': {
"claimed_by": {
"id": "claimed",
"type": ["string", "integer", "null"],
"description": "Robots Only. The human agent that has claimed this robot.",
},
}
}
builder = pjo.ObjectBuilder(schema)
ns = builder.build_classes()
return ns
@pytest.mark.parametrize('value', [
"Hi", 4, None])
def test_properties_can_have_multiple_types(test_class, value):
test_class.Example(claimed_by=value)
@pytest.mark.parametrize('value', [2.4])
def test_multiply_typed_properties_still_validate(test_class, value):
with pytest.raises(pjo.ValidationError):
test_class.Example(claimed_by=value)
| <commit_before>import pytest
import python_jsonschema_objects as pjo
@pytest.fixture
def test_class():
schema = {
'title': 'Example',
'properties': {
"claimed_by": {
"id": "claimed",
"type": ["string", "integer", "null"],
"description": "Robots Only. The human agent that has claimed this robot.",
"required": False
},
}
}
builder = pjo.ObjectBuilder(schema)
ns = builder.build_classes()
return ns
@pytest.mark.parametrize('value', [
"Hi", 4, None])
def test_properties_can_have_multiple_types(test_class, value):
test_class.Example(claimed_by=value)
@pytest.mark.parametrize('value', [2.4])
def test_multiply_typed_properties_still_validate(test_class, value):
with pytest.raises(pjo.ValidationError):
test_class.Example(claimed_by=value)
<commit_msg>Fix an actual schema validation error in one of the tests<commit_after> | import pytest
import python_jsonschema_objects as pjo
@pytest.fixture
def test_class():
schema = {
'title': 'Example',
'properties': {
"claimed_by": {
"id": "claimed",
"type": ["string", "integer", "null"],
"description": "Robots Only. The human agent that has claimed this robot.",
},
}
}
builder = pjo.ObjectBuilder(schema)
ns = builder.build_classes()
return ns
@pytest.mark.parametrize('value', [
"Hi", 4, None])
def test_properties_can_have_multiple_types(test_class, value):
test_class.Example(claimed_by=value)
@pytest.mark.parametrize('value', [2.4])
def test_multiply_typed_properties_still_validate(test_class, value):
with pytest.raises(pjo.ValidationError):
test_class.Example(claimed_by=value)
| import pytest
import python_jsonschema_objects as pjo
@pytest.fixture
def test_class():
schema = {
'title': 'Example',
'properties': {
"claimed_by": {
"id": "claimed",
"type": ["string", "integer", "null"],
"description": "Robots Only. The human agent that has claimed this robot.",
"required": False
},
}
}
builder = pjo.ObjectBuilder(schema)
ns = builder.build_classes()
return ns
@pytest.mark.parametrize('value', [
"Hi", 4, None])
def test_properties_can_have_multiple_types(test_class, value):
test_class.Example(claimed_by=value)
@pytest.mark.parametrize('value', [2.4])
def test_multiply_typed_properties_still_validate(test_class, value):
with pytest.raises(pjo.ValidationError):
test_class.Example(claimed_by=value)
Fix an actual schema validation error in one of the testsimport pytest
import python_jsonschema_objects as pjo
@pytest.fixture
def test_class():
schema = {
'title': 'Example',
'properties': {
"claimed_by": {
"id": "claimed",
"type": ["string", "integer", "null"],
"description": "Robots Only. The human agent that has claimed this robot.",
},
}
}
builder = pjo.ObjectBuilder(schema)
ns = builder.build_classes()
return ns
@pytest.mark.parametrize('value', [
"Hi", 4, None])
def test_properties_can_have_multiple_types(test_class, value):
test_class.Example(claimed_by=value)
@pytest.mark.parametrize('value', [2.4])
def test_multiply_typed_properties_still_validate(test_class, value):
with pytest.raises(pjo.ValidationError):
test_class.Example(claimed_by=value)
| <commit_before>import pytest
import python_jsonschema_objects as pjo
@pytest.fixture
def test_class():
schema = {
'title': 'Example',
'properties': {
"claimed_by": {
"id": "claimed",
"type": ["string", "integer", "null"],
"description": "Robots Only. The human agent that has claimed this robot.",
"required": False
},
}
}
builder = pjo.ObjectBuilder(schema)
ns = builder.build_classes()
return ns
@pytest.mark.parametrize('value', [
"Hi", 4, None])
def test_properties_can_have_multiple_types(test_class, value):
test_class.Example(claimed_by=value)
@pytest.mark.parametrize('value', [2.4])
def test_multiply_typed_properties_still_validate(test_class, value):
with pytest.raises(pjo.ValidationError):
test_class.Example(claimed_by=value)
<commit_msg>Fix an actual schema validation error in one of the tests<commit_after>import pytest
import python_jsonschema_objects as pjo
@pytest.fixture
def test_class():
schema = {
'title': 'Example',
'properties': {
"claimed_by": {
"id": "claimed",
"type": ["string", "integer", "null"],
"description": "Robots Only. The human agent that has claimed this robot.",
},
}
}
builder = pjo.ObjectBuilder(schema)
ns = builder.build_classes()
return ns
@pytest.mark.parametrize('value', [
"Hi", 4, None])
def test_properties_can_have_multiple_types(test_class, value):
test_class.Example(claimed_by=value)
@pytest.mark.parametrize('value', [2.4])
def test_multiply_typed_properties_still_validate(test_class, value):
with pytest.raises(pjo.ValidationError):
test_class.Example(claimed_by=value)
|
31b69d9810fb694be005e21d9c1fc80574460d97 | promgen/tests/test_rules.py | promgen/tests/test_rules.py | from unittest import mock
from django.test import TestCase
from promgen import models, prometheus
_RULES = '''
# Service: Service 1
# Service URL: /service/1/
ALERT RuleName
IF up==0
FOR 1s
LABELS {severity="severe"}
ANNOTATIONS {service="http://example.com/service/1/", summary="Test case"}
'''.lstrip()
class RuleTest(TestCase):
@mock.patch('django.db.models.signals.post_save', mock.Mock())
def setUp(self):
self.shard = models.Shard.objects.create(name='Shard 1')
self.service = models.Service.objects.create(id=1, name='Service 1', shard=self.shard)
self.rule = models.Rule.objects.create(
name='RuleName',
clause='up==0',
duration='1s',
service=self.service
)
models.RuleLabel.objects.create(name='severity', value='severe', rule=self.rule)
models.RuleAnnotation.objects.create(name='summary', value='Test case', rule=self.rule)
@mock.patch('django.db.models.signals.post_save')
def test_write(self, mock_render):
result = prometheus.render_rules()
self.assertEqual(result, _RULES)
| from unittest import mock
from django.test import TestCase
from promgen import models, prometheus
_RULES = '''
# Service: Service 1
# Service URL: /service/1/
ALERT RuleName
IF up==0
FOR 1s
LABELS {severity="severe"}
ANNOTATIONS {service="http://example.com/service/1/", summary="Test case"}
'''.lstrip()
class RuleTest(TestCase):
@mock.patch('django.db.models.signals.post_save', mock.Mock())
def setUp(self):
self.shard = models.Shard.objects.create(name='Shard 1')
self.service = models.Service.objects.create(id=1, name='Service 1', shard=self.shard)
self.rule = models.Rule.objects.create(
name='RuleName',
clause='up==0',
duration='1s',
service=self.service
)
models.RuleLabel.objects.create(name='severity', value='severe', rule=self.rule)
models.RuleAnnotation.objects.create(name='summary', value='Test case', rule=self.rule)
@mock.patch('django.db.models.signals.post_save')
def test_write(self, mock_render):
result = prometheus.render_rules()
self.assertEqual(result, _RULES)
@mock.patch('django.db.models.signals.post_save')
def test_copy(self, mock_render):
service = models.Service.objects.create(name='Service 2', shard=self.shard)
copy = self.rule.copy_to(service)
self.assertIn('severity', copy.labels())
self.assertIn('summary', copy.annotations())
| Add test for copying rules with their labels and annotations | Add test for copying rules with their labels and annotations
| Python | mit | kfdm/promgen,kfdm/promgen,kfdm/promgen,kfdm/promgen | from unittest import mock
from django.test import TestCase
from promgen import models, prometheus
_RULES = '''
# Service: Service 1
# Service URL: /service/1/
ALERT RuleName
IF up==0
FOR 1s
LABELS {severity="severe"}
ANNOTATIONS {service="http://example.com/service/1/", summary="Test case"}
'''.lstrip()
class RuleTest(TestCase):
@mock.patch('django.db.models.signals.post_save', mock.Mock())
def setUp(self):
self.shard = models.Shard.objects.create(name='Shard 1')
self.service = models.Service.objects.create(id=1, name='Service 1', shard=self.shard)
self.rule = models.Rule.objects.create(
name='RuleName',
clause='up==0',
duration='1s',
service=self.service
)
models.RuleLabel.objects.create(name='severity', value='severe', rule=self.rule)
models.RuleAnnotation.objects.create(name='summary', value='Test case', rule=self.rule)
@mock.patch('django.db.models.signals.post_save')
def test_write(self, mock_render):
result = prometheus.render_rules()
self.assertEqual(result, _RULES)
Add test for copying rules with their labels and annotations | from unittest import mock
from django.test import TestCase
from promgen import models, prometheus
_RULES = '''
# Service: Service 1
# Service URL: /service/1/
ALERT RuleName
IF up==0
FOR 1s
LABELS {severity="severe"}
ANNOTATIONS {service="http://example.com/service/1/", summary="Test case"}
'''.lstrip()
class RuleTest(TestCase):
@mock.patch('django.db.models.signals.post_save', mock.Mock())
def setUp(self):
self.shard = models.Shard.objects.create(name='Shard 1')
self.service = models.Service.objects.create(id=1, name='Service 1', shard=self.shard)
self.rule = models.Rule.objects.create(
name='RuleName',
clause='up==0',
duration='1s',
service=self.service
)
models.RuleLabel.objects.create(name='severity', value='severe', rule=self.rule)
models.RuleAnnotation.objects.create(name='summary', value='Test case', rule=self.rule)
@mock.patch('django.db.models.signals.post_save')
def test_write(self, mock_render):
result = prometheus.render_rules()
self.assertEqual(result, _RULES)
@mock.patch('django.db.models.signals.post_save')
def test_copy(self, mock_render):
service = models.Service.objects.create(name='Service 2', shard=self.shard)
copy = self.rule.copy_to(service)
self.assertIn('severity', copy.labels())
self.assertIn('summary', copy.annotations())
| <commit_before>from unittest import mock
from django.test import TestCase
from promgen import models, prometheus
_RULES = '''
# Service: Service 1
# Service URL: /service/1/
ALERT RuleName
IF up==0
FOR 1s
LABELS {severity="severe"}
ANNOTATIONS {service="http://example.com/service/1/", summary="Test case"}
'''.lstrip()
class RuleTest(TestCase):
@mock.patch('django.db.models.signals.post_save', mock.Mock())
def setUp(self):
self.shard = models.Shard.objects.create(name='Shard 1')
self.service = models.Service.objects.create(id=1, name='Service 1', shard=self.shard)
self.rule = models.Rule.objects.create(
name='RuleName',
clause='up==0',
duration='1s',
service=self.service
)
models.RuleLabel.objects.create(name='severity', value='severe', rule=self.rule)
models.RuleAnnotation.objects.create(name='summary', value='Test case', rule=self.rule)
@mock.patch('django.db.models.signals.post_save')
def test_write(self, mock_render):
result = prometheus.render_rules()
self.assertEqual(result, _RULES)
<commit_msg>Add test for copying rules with their labels and annotations<commit_after> | from unittest import mock
from django.test import TestCase
from promgen import models, prometheus
_RULES = '''
# Service: Service 1
# Service URL: /service/1/
ALERT RuleName
IF up==0
FOR 1s
LABELS {severity="severe"}
ANNOTATIONS {service="http://example.com/service/1/", summary="Test case"}
'''.lstrip()
class RuleTest(TestCase):
@mock.patch('django.db.models.signals.post_save', mock.Mock())
def setUp(self):
self.shard = models.Shard.objects.create(name='Shard 1')
self.service = models.Service.objects.create(id=1, name='Service 1', shard=self.shard)
self.rule = models.Rule.objects.create(
name='RuleName',
clause='up==0',
duration='1s',
service=self.service
)
models.RuleLabel.objects.create(name='severity', value='severe', rule=self.rule)
models.RuleAnnotation.objects.create(name='summary', value='Test case', rule=self.rule)
@mock.patch('django.db.models.signals.post_save')
def test_write(self, mock_render):
result = prometheus.render_rules()
self.assertEqual(result, _RULES)
@mock.patch('django.db.models.signals.post_save')
def test_copy(self, mock_render):
service = models.Service.objects.create(name='Service 2', shard=self.shard)
copy = self.rule.copy_to(service)
self.assertIn('severity', copy.labels())
self.assertIn('summary', copy.annotations())
| from unittest import mock
from django.test import TestCase
from promgen import models, prometheus
_RULES = '''
# Service: Service 1
# Service URL: /service/1/
ALERT RuleName
IF up==0
FOR 1s
LABELS {severity="severe"}
ANNOTATIONS {service="http://example.com/service/1/", summary="Test case"}
'''.lstrip()
class RuleTest(TestCase):
@mock.patch('django.db.models.signals.post_save', mock.Mock())
def setUp(self):
self.shard = models.Shard.objects.create(name='Shard 1')
self.service = models.Service.objects.create(id=1, name='Service 1', shard=self.shard)
self.rule = models.Rule.objects.create(
name='RuleName',
clause='up==0',
duration='1s',
service=self.service
)
models.RuleLabel.objects.create(name='severity', value='severe', rule=self.rule)
models.RuleAnnotation.objects.create(name='summary', value='Test case', rule=self.rule)
@mock.patch('django.db.models.signals.post_save')
def test_write(self, mock_render):
result = prometheus.render_rules()
self.assertEqual(result, _RULES)
Add test for copying rules with their labels and annotationsfrom unittest import mock
from django.test import TestCase
from promgen import models, prometheus
_RULES = '''
# Service: Service 1
# Service URL: /service/1/
ALERT RuleName
IF up==0
FOR 1s
LABELS {severity="severe"}
ANNOTATIONS {service="http://example.com/service/1/", summary="Test case"}
'''.lstrip()
class RuleTest(TestCase):
@mock.patch('django.db.models.signals.post_save', mock.Mock())
def setUp(self):
self.shard = models.Shard.objects.create(name='Shard 1')
self.service = models.Service.objects.create(id=1, name='Service 1', shard=self.shard)
self.rule = models.Rule.objects.create(
name='RuleName',
clause='up==0',
duration='1s',
service=self.service
)
models.RuleLabel.objects.create(name='severity', value='severe', rule=self.rule)
models.RuleAnnotation.objects.create(name='summary', value='Test case', rule=self.rule)
@mock.patch('django.db.models.signals.post_save')
def test_write(self, mock_render):
result = prometheus.render_rules()
self.assertEqual(result, _RULES)
@mock.patch('django.db.models.signals.post_save')
def test_copy(self, mock_render):
service = models.Service.objects.create(name='Service 2', shard=self.shard)
copy = self.rule.copy_to(service)
self.assertIn('severity', copy.labels())
self.assertIn('summary', copy.annotations())
| <commit_before>from unittest import mock
from django.test import TestCase
from promgen import models, prometheus
_RULES = '''
# Service: Service 1
# Service URL: /service/1/
ALERT RuleName
IF up==0
FOR 1s
LABELS {severity="severe"}
ANNOTATIONS {service="http://example.com/service/1/", summary="Test case"}
'''.lstrip()
class RuleTest(TestCase):
@mock.patch('django.db.models.signals.post_save', mock.Mock())
def setUp(self):
self.shard = models.Shard.objects.create(name='Shard 1')
self.service = models.Service.objects.create(id=1, name='Service 1', shard=self.shard)
self.rule = models.Rule.objects.create(
name='RuleName',
clause='up==0',
duration='1s',
service=self.service
)
models.RuleLabel.objects.create(name='severity', value='severe', rule=self.rule)
models.RuleAnnotation.objects.create(name='summary', value='Test case', rule=self.rule)
@mock.patch('django.db.models.signals.post_save')
def test_write(self, mock_render):
result = prometheus.render_rules()
self.assertEqual(result, _RULES)
<commit_msg>Add test for copying rules with their labels and annotations<commit_after>from unittest import mock
from django.test import TestCase
from promgen import models, prometheus
_RULES = '''
# Service: Service 1
# Service URL: /service/1/
ALERT RuleName
IF up==0
FOR 1s
LABELS {severity="severe"}
ANNOTATIONS {service="http://example.com/service/1/", summary="Test case"}
'''.lstrip()
class RuleTest(TestCase):
@mock.patch('django.db.models.signals.post_save', mock.Mock())
def setUp(self):
self.shard = models.Shard.objects.create(name='Shard 1')
self.service = models.Service.objects.create(id=1, name='Service 1', shard=self.shard)
self.rule = models.Rule.objects.create(
name='RuleName',
clause='up==0',
duration='1s',
service=self.service
)
models.RuleLabel.objects.create(name='severity', value='severe', rule=self.rule)
models.RuleAnnotation.objects.create(name='summary', value='Test case', rule=self.rule)
@mock.patch('django.db.models.signals.post_save')
def test_write(self, mock_render):
result = prometheus.render_rules()
self.assertEqual(result, _RULES)
@mock.patch('django.db.models.signals.post_save')
def test_copy(self, mock_render):
service = models.Service.objects.create(name='Service 2', shard=self.shard)
copy = self.rule.copy_to(service)
self.assertIn('severity', copy.labels())
self.assertIn('summary', copy.annotations())
|
c34f630bf1d4a6c77ec68f69428df930b0ade146 | pymc/examples/glm_robust.py | pymc/examples/glm_robust.py | import numpy as np
try:
import statsmodels.api as sm
except ImportError:
sys.exit(0)
from pymc import *
# Generate data
size = 50
true_intercept = 1
true_slope = 2
x = np.linspace(0, 1, size)
y = true_intercept + x*true_slope + np.random.normal(scale=.5, size=size)
# Add outliers
x = np.append(x, [.1, .15, .2])
y = np.append(y, [8, 6, 9])
data_outlier = dict(x=x, y=y)
with Model() as model:
family = glm.families.T(link=glm.links.Identity,
priors={'nu': 1.5,
'lam': ('sigma', Uniform.dist(0, 20))})
glm.glm('y ~ x', data_outlier, family=family)
def run(n=2000):
if n == "short":
n = 50
import matplotlib.pyplot as plt
with model:
trace = sample(n, Slice(model.vars))
plt.plot(x, y, 'x')
glm.plot_posterior_predictive(trace)
plt.show()
if __name__ == '__main__':
run()
| import numpy as np
import sys
try:
import statsmodels.api as sm
except ImportError:
print "Example requires statsmodels"
sys.exit(0)
from pymc import *
# Generate data
size = 50
true_intercept = 1
true_slope = 2
x = np.linspace(0, 1, size)
y = true_intercept + x*true_slope + np.random.normal(scale=.5, size=size)
# Add outliers
x = np.append(x, [.1, .15, .2])
y = np.append(y, [8, 6, 9])
data_outlier = dict(x=x, y=y)
with Model() as model:
family = glm.families.T(link=glm.links.Identity,
priors={'nu': 1.5,
'lam': ('sigma', Uniform.dist(0, 20))})
glm.glm('y ~ x', data_outlier, family=family)
def run(n=2000):
if n == "short":
n = 50
import matplotlib.pyplot as plt
with model:
trace = sample(n, Slice(model.vars))
plt.plot(x, y, 'x')
glm.plot_posterior_predictive(trace)
plt.show()
if __name__ == '__main__':
run()
| Add missing import and explanation of failure | Add missing import and explanation of failure
| Python | apache-2.0 | superbobry/pymc3,LoLab-VU/pymc,superbobry/pymc3,Anjum48/pymc3,hothHowler/pymc3,jameshensman/pymc3,wanderer2/pymc3,hothHowler/pymc3,MCGallaspy/pymc3,kmather73/pymc3,dhiapet/PyMC3,JesseLivezey/pymc3,kmather73/pymc3,tyarkoni/pymc3,clk8908/pymc3,jameshensman/pymc3,evidation-health/pymc3,MichielCottaar/pymc3,arunlodhi/pymc3,dhiapet/PyMC3,tyarkoni/pymc3,Anjum48/pymc3,arunlodhi/pymc3,kyleam/pymc3,wanderer2/pymc3,LoLab-VU/pymc,clk8908/pymc3,JesseLivezey/pymc3,CVML/pymc3,CVML/pymc3,MichielCottaar/pymc3,kyleam/pymc3,MCGallaspy/pymc3,evidation-health/pymc3 | import numpy as np
try:
import statsmodels.api as sm
except ImportError:
sys.exit(0)
from pymc import *
# Generate data
size = 50
true_intercept = 1
true_slope = 2
x = np.linspace(0, 1, size)
y = true_intercept + x*true_slope + np.random.normal(scale=.5, size=size)
# Add outliers
x = np.append(x, [.1, .15, .2])
y = np.append(y, [8, 6, 9])
data_outlier = dict(x=x, y=y)
with Model() as model:
family = glm.families.T(link=glm.links.Identity,
priors={'nu': 1.5,
'lam': ('sigma', Uniform.dist(0, 20))})
glm.glm('y ~ x', data_outlier, family=family)
def run(n=2000):
if n == "short":
n = 50
import matplotlib.pyplot as plt
with model:
trace = sample(n, Slice(model.vars))
plt.plot(x, y, 'x')
glm.plot_posterior_predictive(trace)
plt.show()
if __name__ == '__main__':
run()
Add missing import and explanation of failure | import numpy as np
import sys
try:
import statsmodels.api as sm
except ImportError:
print "Example requires statsmodels"
sys.exit(0)
from pymc import *
# Generate data
size = 50
true_intercept = 1
true_slope = 2
x = np.linspace(0, 1, size)
y = true_intercept + x*true_slope + np.random.normal(scale=.5, size=size)
# Add outliers
x = np.append(x, [.1, .15, .2])
y = np.append(y, [8, 6, 9])
data_outlier = dict(x=x, y=y)
with Model() as model:
family = glm.families.T(link=glm.links.Identity,
priors={'nu': 1.5,
'lam': ('sigma', Uniform.dist(0, 20))})
glm.glm('y ~ x', data_outlier, family=family)
def run(n=2000):
if n == "short":
n = 50
import matplotlib.pyplot as plt
with model:
trace = sample(n, Slice(model.vars))
plt.plot(x, y, 'x')
glm.plot_posterior_predictive(trace)
plt.show()
if __name__ == '__main__':
run()
| <commit_before>import numpy as np
try:
import statsmodels.api as sm
except ImportError:
sys.exit(0)
from pymc import *
# Generate data
size = 50
true_intercept = 1
true_slope = 2
x = np.linspace(0, 1, size)
y = true_intercept + x*true_slope + np.random.normal(scale=.5, size=size)
# Add outliers
x = np.append(x, [.1, .15, .2])
y = np.append(y, [8, 6, 9])
data_outlier = dict(x=x, y=y)
with Model() as model:
family = glm.families.T(link=glm.links.Identity,
priors={'nu': 1.5,
'lam': ('sigma', Uniform.dist(0, 20))})
glm.glm('y ~ x', data_outlier, family=family)
def run(n=2000):
if n == "short":
n = 50
import matplotlib.pyplot as plt
with model:
trace = sample(n, Slice(model.vars))
plt.plot(x, y, 'x')
glm.plot_posterior_predictive(trace)
plt.show()
if __name__ == '__main__':
run()
<commit_msg>Add missing import and explanation of failure<commit_after> | import numpy as np
import sys
try:
import statsmodels.api as sm
except ImportError:
print "Example requires statsmodels"
sys.exit(0)
from pymc import *
# Generate data
size = 50
true_intercept = 1
true_slope = 2
x = np.linspace(0, 1, size)
y = true_intercept + x*true_slope + np.random.normal(scale=.5, size=size)
# Add outliers
x = np.append(x, [.1, .15, .2])
y = np.append(y, [8, 6, 9])
data_outlier = dict(x=x, y=y)
with Model() as model:
family = glm.families.T(link=glm.links.Identity,
priors={'nu': 1.5,
'lam': ('sigma', Uniform.dist(0, 20))})
glm.glm('y ~ x', data_outlier, family=family)
def run(n=2000):
if n == "short":
n = 50
import matplotlib.pyplot as plt
with model:
trace = sample(n, Slice(model.vars))
plt.plot(x, y, 'x')
glm.plot_posterior_predictive(trace)
plt.show()
if __name__ == '__main__':
run()
| import numpy as np
try:
import statsmodels.api as sm
except ImportError:
sys.exit(0)
from pymc import *
# Generate data
size = 50
true_intercept = 1
true_slope = 2
x = np.linspace(0, 1, size)
y = true_intercept + x*true_slope + np.random.normal(scale=.5, size=size)
# Add outliers
x = np.append(x, [.1, .15, .2])
y = np.append(y, [8, 6, 9])
data_outlier = dict(x=x, y=y)
with Model() as model:
family = glm.families.T(link=glm.links.Identity,
priors={'nu': 1.5,
'lam': ('sigma', Uniform.dist(0, 20))})
glm.glm('y ~ x', data_outlier, family=family)
def run(n=2000):
if n == "short":
n = 50
import matplotlib.pyplot as plt
with model:
trace = sample(n, Slice(model.vars))
plt.plot(x, y, 'x')
glm.plot_posterior_predictive(trace)
plt.show()
if __name__ == '__main__':
run()
Add missing import and explanation of failureimport numpy as np
import sys
try:
import statsmodels.api as sm
except ImportError:
print "Example requires statsmodels"
sys.exit(0)
from pymc import *
# Generate data
size = 50
true_intercept = 1
true_slope = 2
x = np.linspace(0, 1, size)
y = true_intercept + x*true_slope + np.random.normal(scale=.5, size=size)
# Add outliers
x = np.append(x, [.1, .15, .2])
y = np.append(y, [8, 6, 9])
data_outlier = dict(x=x, y=y)
with Model() as model:
family = glm.families.T(link=glm.links.Identity,
priors={'nu': 1.5,
'lam': ('sigma', Uniform.dist(0, 20))})
glm.glm('y ~ x', data_outlier, family=family)
def run(n=2000):
if n == "short":
n = 50
import matplotlib.pyplot as plt
with model:
trace = sample(n, Slice(model.vars))
plt.plot(x, y, 'x')
glm.plot_posterior_predictive(trace)
plt.show()
if __name__ == '__main__':
run()
| <commit_before>import numpy as np
try:
import statsmodels.api as sm
except ImportError:
sys.exit(0)
from pymc import *
# Generate data
size = 50
true_intercept = 1
true_slope = 2
x = np.linspace(0, 1, size)
y = true_intercept + x*true_slope + np.random.normal(scale=.5, size=size)
# Add outliers
x = np.append(x, [.1, .15, .2])
y = np.append(y, [8, 6, 9])
data_outlier = dict(x=x, y=y)
with Model() as model:
family = glm.families.T(link=glm.links.Identity,
priors={'nu': 1.5,
'lam': ('sigma', Uniform.dist(0, 20))})
glm.glm('y ~ x', data_outlier, family=family)
def run(n=2000):
if n == "short":
n = 50
import matplotlib.pyplot as plt
with model:
trace = sample(n, Slice(model.vars))
plt.plot(x, y, 'x')
glm.plot_posterior_predictive(trace)
plt.show()
if __name__ == '__main__':
run()
<commit_msg>Add missing import and explanation of failure<commit_after>import numpy as np
import sys
try:
import statsmodels.api as sm
except ImportError:
print "Example requires statsmodels"
sys.exit(0)
from pymc import *
# Generate data
size = 50
true_intercept = 1
true_slope = 2
x = np.linspace(0, 1, size)
y = true_intercept + x*true_slope + np.random.normal(scale=.5, size=size)
# Add outliers
x = np.append(x, [.1, .15, .2])
y = np.append(y, [8, 6, 9])
data_outlier = dict(x=x, y=y)
with Model() as model:
family = glm.families.T(link=glm.links.Identity,
priors={'nu': 1.5,
'lam': ('sigma', Uniform.dist(0, 20))})
glm.glm('y ~ x', data_outlier, family=family)
def run(n=2000):
if n == "short":
n = 50
import matplotlib.pyplot as plt
with model:
trace = sample(n, Slice(model.vars))
plt.plot(x, y, 'x')
glm.plot_posterior_predictive(trace)
plt.show()
if __name__ == '__main__':
run()
|
d46c0a045b8cab7cb51e9fe2aefb4286da8266d6 | .ycm_extra_conf.py | .ycm_extra_conf.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2014 Adrian Perez <aperez@igalia.com>
#
# Distributed under terms of the MIT license.
from subprocess import check_output
from shlex import split as sh_split
def FlagsForFile(path, **kwarg):
flags = sh_split(check_output(["make", "print-flags"]))
flags.extend(("-Qunused-arguments",
"-DDWT_USE_HEADER_BAR=TRUE",
"-DDWT_USE_POPOVER=TRUE",
"-DDWT_USE_OVERLAY=TRUE"))
return { 'flags': flags, 'do_cache': True }
| #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2014 Adrian Perez <aperez@igalia.com>
#
# Distributed under terms of the MIT license.
from subprocess import check_output
from shlex import split as sh_split
def FlagsForFile(path, **kwarg):
flags = sh_split(check_output(["make", "print-flags"]))
flags.extend(("-Qunused-arguments",
"-DDWT_USE_POPOVER=TRUE",
"-DDWT_USE_OVERLAY=TRUE"))
return { 'flags': flags, 'do_cache': True }
| Remove -DDWT_USE_HEADER_BAR from YCM configuration | Remove -DDWT_USE_HEADER_BAR from YCM configuration
The option does not exist anymore, so there is no reason to keep
it around.
| Python | mit | aperezdc/dwt,aperezdc/dwt | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2014 Adrian Perez <aperez@igalia.com>
#
# Distributed under terms of the MIT license.
from subprocess import check_output
from shlex import split as sh_split
def FlagsForFile(path, **kwarg):
flags = sh_split(check_output(["make", "print-flags"]))
flags.extend(("-Qunused-arguments",
"-DDWT_USE_HEADER_BAR=TRUE",
"-DDWT_USE_POPOVER=TRUE",
"-DDWT_USE_OVERLAY=TRUE"))
return { 'flags': flags, 'do_cache': True }
Remove -DDWT_USE_HEADER_BAR from YCM configuration
The option does not exist anymore, so there is no reason to keep
it around. | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2014 Adrian Perez <aperez@igalia.com>
#
# Distributed under terms of the MIT license.
from subprocess import check_output
from shlex import split as sh_split
def FlagsForFile(path, **kwarg):
flags = sh_split(check_output(["make", "print-flags"]))
flags.extend(("-Qunused-arguments",
"-DDWT_USE_POPOVER=TRUE",
"-DDWT_USE_OVERLAY=TRUE"))
return { 'flags': flags, 'do_cache': True }
| <commit_before>#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2014 Adrian Perez <aperez@igalia.com>
#
# Distributed under terms of the MIT license.
from subprocess import check_output
from shlex import split as sh_split
def FlagsForFile(path, **kwarg):
flags = sh_split(check_output(["make", "print-flags"]))
flags.extend(("-Qunused-arguments",
"-DDWT_USE_HEADER_BAR=TRUE",
"-DDWT_USE_POPOVER=TRUE",
"-DDWT_USE_OVERLAY=TRUE"))
return { 'flags': flags, 'do_cache': True }
<commit_msg>Remove -DDWT_USE_HEADER_BAR from YCM configuration
The option does not exist anymore, so there is no reason to keep
it around.<commit_after> | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2014 Adrian Perez <aperez@igalia.com>
#
# Distributed under terms of the MIT license.
from subprocess import check_output
from shlex import split as sh_split
def FlagsForFile(path, **kwarg):
flags = sh_split(check_output(["make", "print-flags"]))
flags.extend(("-Qunused-arguments",
"-DDWT_USE_POPOVER=TRUE",
"-DDWT_USE_OVERLAY=TRUE"))
return { 'flags': flags, 'do_cache': True }
| #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2014 Adrian Perez <aperez@igalia.com>
#
# Distributed under terms of the MIT license.
from subprocess import check_output
from shlex import split as sh_split
def FlagsForFile(path, **kwarg):
flags = sh_split(check_output(["make", "print-flags"]))
flags.extend(("-Qunused-arguments",
"-DDWT_USE_HEADER_BAR=TRUE",
"-DDWT_USE_POPOVER=TRUE",
"-DDWT_USE_OVERLAY=TRUE"))
return { 'flags': flags, 'do_cache': True }
Remove -DDWT_USE_HEADER_BAR from YCM configuration
The option does not exist anymore, so there is no reason to keep
it around.#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2014 Adrian Perez <aperez@igalia.com>
#
# Distributed under terms of the MIT license.
from subprocess import check_output
from shlex import split as sh_split
def FlagsForFile(path, **kwarg):
flags = sh_split(check_output(["make", "print-flags"]))
flags.extend(("-Qunused-arguments",
"-DDWT_USE_POPOVER=TRUE",
"-DDWT_USE_OVERLAY=TRUE"))
return { 'flags': flags, 'do_cache': True }
| <commit_before>#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2014 Adrian Perez <aperez@igalia.com>
#
# Distributed under terms of the MIT license.
from subprocess import check_output
from shlex import split as sh_split
def FlagsForFile(path, **kwarg):
flags = sh_split(check_output(["make", "print-flags"]))
flags.extend(("-Qunused-arguments",
"-DDWT_USE_HEADER_BAR=TRUE",
"-DDWT_USE_POPOVER=TRUE",
"-DDWT_USE_OVERLAY=TRUE"))
return { 'flags': flags, 'do_cache': True }
<commit_msg>Remove -DDWT_USE_HEADER_BAR from YCM configuration
The option does not exist anymore, so there is no reason to keep
it around.<commit_after>#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2014 Adrian Perez <aperez@igalia.com>
#
# Distributed under terms of the MIT license.
from subprocess import check_output
from shlex import split as sh_split
def FlagsForFile(path, **kwarg):
flags = sh_split(check_output(["make", "print-flags"]))
flags.extend(("-Qunused-arguments",
"-DDWT_USE_POPOVER=TRUE",
"-DDWT_USE_OVERLAY=TRUE"))
return { 'flags': flags, 'do_cache': True }
|
3b1cab31872ba7ed335d1ea254c3c1a477020966 | extract_contamination.py | extract_contamination.py | import sys
import os
header = ['Mouse_single', 'Mouse_multiple', 'Human', 'Other', 'Unmapped']
print '\t'.join(header)
for fi in sys.argv[1:]:
sample = os.path.basename(fi).split('.')[0]
with open(fi) as screen_results:
results = {}
for line in screen_results:
fields = line.strip().split()
if len(fields) and fields[0][0] != '#' and fields[0] != 'Library':
if fields[0] == '%Hit_no_libraries:':
results['unmapped'] = int(float(fields[1]) / 100.0 * results['no_reads'])
continue
results[fields[0] + '_single'] = int(fields[4])
results[fields[0] + '_multiple'] = int(fields[6])
results['no_reads'] = int(fields[1])
if not len(results):
data = ['0'] * 5
else:
try:
data = [results['Mouse_single'],
results['Mouse_multiple'],
results['Human_single'] + results['Human_multiple']]
except:
sys.exit('Malformed file: {0}'.format(fi))
data.append(results['no_reads'] - sum(data) - results['unmapped'])
data.append(results['unmapped'])
data = map(lambda i:str(i / float(sum(data))),data)
data = [sample] + data
print '\t'.join(data)
| import sys
import os
header = ['Sample', 'Mouse_single', 'Mouse_multiple', 'Human', 'Other', 'Unmapped']
print '\t'.join(header)
for fi in sys.argv[1:]:
sample = os.path.basename(fi).split('.')[0]
if sample[-7:] == '_screen':
sample = sample[:-7]
with open(fi) as screen_results:
results = {}
for line in screen_results:
fields = line.strip().split()
if len(fields) and fields[0][0] != '#' and fields[0] != 'Library':
if fields[0] == '%Hit_no_libraries:':
results['unmapped'] = int(float(fields[1]) / 100.0 * results['no_reads'])
continue
results[fields[0] + '_single'] = int(fields[4])
results[fields[0] + '_multiple'] = int(fields[6])
results['no_reads'] = int(fields[1])
if not len(results):
data = ['0'] * 5
else:
try:
data = [results['Mouse_single'],
results['Mouse_multiple'],
results['Human_single'] + results['Human_multiple']]
except:
sys.exit('Malformed file: {0}'.format(fi))
data.append(results['no_reads'] - sum(data) - results['unmapped'])
data.append(results['unmapped'])
data = map(lambda i:str(i / float(sum(data))),data)
data = [sample] + data
print '\t'.join(data)
| Fix problem with finding sample name from fastqc_screen output | Fix problem with finding sample name from fastqc_screen output
| Python | apache-2.0 | pombo-lab/gamtools,pombo-lab/gamtools | import sys
import os
header = ['Mouse_single', 'Mouse_multiple', 'Human', 'Other', 'Unmapped']
print '\t'.join(header)
for fi in sys.argv[1:]:
sample = os.path.basename(fi).split('.')[0]
with open(fi) as screen_results:
results = {}
for line in screen_results:
fields = line.strip().split()
if len(fields) and fields[0][0] != '#' and fields[0] != 'Library':
if fields[0] == '%Hit_no_libraries:':
results['unmapped'] = int(float(fields[1]) / 100.0 * results['no_reads'])
continue
results[fields[0] + '_single'] = int(fields[4])
results[fields[0] + '_multiple'] = int(fields[6])
results['no_reads'] = int(fields[1])
if not len(results):
data = ['0'] * 5
else:
try:
data = [results['Mouse_single'],
results['Mouse_multiple'],
results['Human_single'] + results['Human_multiple']]
except:
sys.exit('Malformed file: {0}'.format(fi))
data.append(results['no_reads'] - sum(data) - results['unmapped'])
data.append(results['unmapped'])
data = map(lambda i:str(i / float(sum(data))),data)
data = [sample] + data
print '\t'.join(data)
Fix problem with finding sample name from fastqc_screen output | import sys
import os
header = ['Sample', 'Mouse_single', 'Mouse_multiple', 'Human', 'Other', 'Unmapped']
print '\t'.join(header)
for fi in sys.argv[1:]:
sample = os.path.basename(fi).split('.')[0]
if sample[-7:] == '_screen':
sample = sample[:-7]
with open(fi) as screen_results:
results = {}
for line in screen_results:
fields = line.strip().split()
if len(fields) and fields[0][0] != '#' and fields[0] != 'Library':
if fields[0] == '%Hit_no_libraries:':
results['unmapped'] = int(float(fields[1]) / 100.0 * results['no_reads'])
continue
results[fields[0] + '_single'] = int(fields[4])
results[fields[0] + '_multiple'] = int(fields[6])
results['no_reads'] = int(fields[1])
if not len(results):
data = ['0'] * 5
else:
try:
data = [results['Mouse_single'],
results['Mouse_multiple'],
results['Human_single'] + results['Human_multiple']]
except:
sys.exit('Malformed file: {0}'.format(fi))
data.append(results['no_reads'] - sum(data) - results['unmapped'])
data.append(results['unmapped'])
data = map(lambda i:str(i / float(sum(data))),data)
data = [sample] + data
print '\t'.join(data)
| <commit_before>import sys
import os
header = ['Mouse_single', 'Mouse_multiple', 'Human', 'Other', 'Unmapped']
print '\t'.join(header)
for fi in sys.argv[1:]:
sample = os.path.basename(fi).split('.')[0]
with open(fi) as screen_results:
results = {}
for line in screen_results:
fields = line.strip().split()
if len(fields) and fields[0][0] != '#' and fields[0] != 'Library':
if fields[0] == '%Hit_no_libraries:':
results['unmapped'] = int(float(fields[1]) / 100.0 * results['no_reads'])
continue
results[fields[0] + '_single'] = int(fields[4])
results[fields[0] + '_multiple'] = int(fields[6])
results['no_reads'] = int(fields[1])
if not len(results):
data = ['0'] * 5
else:
try:
data = [results['Mouse_single'],
results['Mouse_multiple'],
results['Human_single'] + results['Human_multiple']]
except:
sys.exit('Malformed file: {0}'.format(fi))
data.append(results['no_reads'] - sum(data) - results['unmapped'])
data.append(results['unmapped'])
data = map(lambda i:str(i / float(sum(data))),data)
data = [sample] + data
print '\t'.join(data)
<commit_msg>Fix problem with finding sample name from fastqc_screen output<commit_after> | import sys
import os
header = ['Sample', 'Mouse_single', 'Mouse_multiple', 'Human', 'Other', 'Unmapped']
print '\t'.join(header)
for fi in sys.argv[1:]:
sample = os.path.basename(fi).split('.')[0]
if sample[-7:] == '_screen':
sample = sample[:-7]
with open(fi) as screen_results:
results = {}
for line in screen_results:
fields = line.strip().split()
if len(fields) and fields[0][0] != '#' and fields[0] != 'Library':
if fields[0] == '%Hit_no_libraries:':
results['unmapped'] = int(float(fields[1]) / 100.0 * results['no_reads'])
continue
results[fields[0] + '_single'] = int(fields[4])
results[fields[0] + '_multiple'] = int(fields[6])
results['no_reads'] = int(fields[1])
if not len(results):
data = ['0'] * 5
else:
try:
data = [results['Mouse_single'],
results['Mouse_multiple'],
results['Human_single'] + results['Human_multiple']]
except:
sys.exit('Malformed file: {0}'.format(fi))
data.append(results['no_reads'] - sum(data) - results['unmapped'])
data.append(results['unmapped'])
data = map(lambda i:str(i / float(sum(data))),data)
data = [sample] + data
print '\t'.join(data)
| import sys
import os
header = ['Mouse_single', 'Mouse_multiple', 'Human', 'Other', 'Unmapped']
print '\t'.join(header)
for fi in sys.argv[1:]:
sample = os.path.basename(fi).split('.')[0]
with open(fi) as screen_results:
results = {}
for line in screen_results:
fields = line.strip().split()
if len(fields) and fields[0][0] != '#' and fields[0] != 'Library':
if fields[0] == '%Hit_no_libraries:':
results['unmapped'] = int(float(fields[1]) / 100.0 * results['no_reads'])
continue
results[fields[0] + '_single'] = int(fields[4])
results[fields[0] + '_multiple'] = int(fields[6])
results['no_reads'] = int(fields[1])
if not len(results):
data = ['0'] * 5
else:
try:
data = [results['Mouse_single'],
results['Mouse_multiple'],
results['Human_single'] + results['Human_multiple']]
except:
sys.exit('Malformed file: {0}'.format(fi))
data.append(results['no_reads'] - sum(data) - results['unmapped'])
data.append(results['unmapped'])
data = map(lambda i:str(i / float(sum(data))),data)
data = [sample] + data
print '\t'.join(data)
Fix problem with finding sample name from fastqc_screen outputimport sys
import os
header = ['Sample', 'Mouse_single', 'Mouse_multiple', 'Human', 'Other', 'Unmapped']
print '\t'.join(header)
for fi in sys.argv[1:]:
sample = os.path.basename(fi).split('.')[0]
if sample[-7:] == '_screen':
sample = sample[:-7]
with open(fi) as screen_results:
results = {}
for line in screen_results:
fields = line.strip().split()
if len(fields) and fields[0][0] != '#' and fields[0] != 'Library':
if fields[0] == '%Hit_no_libraries:':
results['unmapped'] = int(float(fields[1]) / 100.0 * results['no_reads'])
continue
results[fields[0] + '_single'] = int(fields[4])
results[fields[0] + '_multiple'] = int(fields[6])
results['no_reads'] = int(fields[1])
if not len(results):
data = ['0'] * 5
else:
try:
data = [results['Mouse_single'],
results['Mouse_multiple'],
results['Human_single'] + results['Human_multiple']]
except:
sys.exit('Malformed file: {0}'.format(fi))
data.append(results['no_reads'] - sum(data) - results['unmapped'])
data.append(results['unmapped'])
data = map(lambda i:str(i / float(sum(data))),data)
data = [sample] + data
print '\t'.join(data)
| <commit_before>import sys
import os
header = ['Mouse_single', 'Mouse_multiple', 'Human', 'Other', 'Unmapped']
print '\t'.join(header)
for fi in sys.argv[1:]:
sample = os.path.basename(fi).split('.')[0]
with open(fi) as screen_results:
results = {}
for line in screen_results:
fields = line.strip().split()
if len(fields) and fields[0][0] != '#' and fields[0] != 'Library':
if fields[0] == '%Hit_no_libraries:':
results['unmapped'] = int(float(fields[1]) / 100.0 * results['no_reads'])
continue
results[fields[0] + '_single'] = int(fields[4])
results[fields[0] + '_multiple'] = int(fields[6])
results['no_reads'] = int(fields[1])
if not len(results):
data = ['0'] * 5
else:
try:
data = [results['Mouse_single'],
results['Mouse_multiple'],
results['Human_single'] + results['Human_multiple']]
except:
sys.exit('Malformed file: {0}'.format(fi))
data.append(results['no_reads'] - sum(data) - results['unmapped'])
data.append(results['unmapped'])
data = map(lambda i:str(i / float(sum(data))),data)
data = [sample] + data
print '\t'.join(data)
<commit_msg>Fix problem with finding sample name from fastqc_screen output<commit_after>import sys
import os
header = ['Sample', 'Mouse_single', 'Mouse_multiple', 'Human', 'Other', 'Unmapped']
print '\t'.join(header)
for fi in sys.argv[1:]:
sample = os.path.basename(fi).split('.')[0]
if sample[-7:] == '_screen':
sample = sample[:-7]
with open(fi) as screen_results:
results = {}
for line in screen_results:
fields = line.strip().split()
if len(fields) and fields[0][0] != '#' and fields[0] != 'Library':
if fields[0] == '%Hit_no_libraries:':
results['unmapped'] = int(float(fields[1]) / 100.0 * results['no_reads'])
continue
results[fields[0] + '_single'] = int(fields[4])
results[fields[0] + '_multiple'] = int(fields[6])
results['no_reads'] = int(fields[1])
if not len(results):
data = ['0'] * 5
else:
try:
data = [results['Mouse_single'],
results['Mouse_multiple'],
results['Human_single'] + results['Human_multiple']]
except:
sys.exit('Malformed file: {0}'.format(fi))
data.append(results['no_reads'] - sum(data) - results['unmapped'])
data.append(results['unmapped'])
data = map(lambda i:str(i / float(sum(data))),data)
data = [sample] + data
print '\t'.join(data)
|
ed9601b2899aef7fcadfe7306dc1320ce72f232c | raven/transport/requests.py | raven/transport/requests.py | """
raven.transport.requests
~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from raven.transport.http import HTTPTransport
try:
import requests
has_requests = True
except:
has_requests = False
class RequestsHTTPTransport(HTTPTransport):
scheme = ['requests+http', 'requests+https']
def __init__(self, parsed_url):
if not has_requests:
raise ImportError('RequestsHTTPTransport requires requests.')
super(RequestsHTTPTransport, self).__init__(parsed_url)
# remove the requests+ from the protocol, as it is not a real protocol
self._url = self._url.split('+', 1)[-1]
def send(self, data, headers):
requests.post(self._url, data=data, headers=headers)
| """
raven.transport.requests
~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from raven.conf import defaults
from raven.transport.http import HTTPTransport
try:
import requests
has_requests = True
except:
has_requests = False
class RequestsHTTPTransport(HTTPTransport):
scheme = ['requests+http', 'requests+https']
def __init__(self, parsed_url, timeout=defaults.TIMEOUT, verify_ssl=True,
ca_certs=defaults.CA_BUNDLE):
if not has_requests:
raise ImportError('RequestsHTTPTransport requires requests.')
super(RequestsHTTPTransport, self).__init__(parsed_url,
timeout=timeout,
verify_ssl=verify_ssl,
ca_certs=ca_certs)
# remove the requests+ from the protocol, as it is not a real protocol
self._url = self._url.split('+', 1)[-1]
def send(self, data, headers):
if self.verify_ssl:
# If SSL verification is enabled use the provided CA bundle to
# perform the verification.
self.verify_ssl = self.ca_certs
requests.post(self._url, data=data, headers=headers,
verify=self.verify_ssl, timeout=self.timeout)
| Add support for the verify_ssl, ca_certs and timeout parameters for the request transport. | Add support for the verify_ssl, ca_certs and timeout parameters for the request transport.
| Python | bsd-3-clause | dbravender/raven-python,johansteffner/raven-python,ronaldevers/raven-python,lepture/raven-python,dbravender/raven-python,jbarbuto/raven-python,johansteffner/raven-python,nikolas/raven-python,jbarbuto/raven-python,recht/raven-python,lepture/raven-python,akheron/raven-python,jmp0xf/raven-python,arthurlogilab/raven-python,getsentry/raven-python,jmagnusson/raven-python,nikolas/raven-python,someonehan/raven-python,someonehan/raven-python,getsentry/raven-python,akheron/raven-python,arthurlogilab/raven-python,akheron/raven-python,nikolas/raven-python,smarkets/raven-python,percipient/raven-python,hzy/raven-python,Photonomie/raven-python,Photonomie/raven-python,johansteffner/raven-python,danriti/raven-python,ewdurbin/raven-python,lepture/raven-python,dbravender/raven-python,jmp0xf/raven-python,hzy/raven-python,arthurlogilab/raven-python,hzy/raven-python,getsentry/raven-python,percipient/raven-python,jmp0xf/raven-python,percipient/raven-python,smarkets/raven-python,arthurlogilab/raven-python,smarkets/raven-python,someonehan/raven-python,recht/raven-python,jmagnusson/raven-python,ewdurbin/raven-python,akalipetis/raven-python,ewdurbin/raven-python,jbarbuto/raven-python,akalipetis/raven-python,jbarbuto/raven-python,akalipetis/raven-python,recht/raven-python,ronaldevers/raven-python,danriti/raven-python,nikolas/raven-python,ronaldevers/raven-python,danriti/raven-python,Photonomie/raven-python,smarkets/raven-python,jmagnusson/raven-python | """
raven.transport.requests
~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from raven.transport.http import HTTPTransport
try:
import requests
has_requests = True
except:
has_requests = False
class RequestsHTTPTransport(HTTPTransport):
scheme = ['requests+http', 'requests+https']
def __init__(self, parsed_url):
if not has_requests:
raise ImportError('RequestsHTTPTransport requires requests.')
super(RequestsHTTPTransport, self).__init__(parsed_url)
# remove the requests+ from the protocol, as it is not a real protocol
self._url = self._url.split('+', 1)[-1]
def send(self, data, headers):
requests.post(self._url, data=data, headers=headers)
Add support for the verify_ssl, ca_certs and timeout parameters for the request transport. | """
raven.transport.requests
~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from raven.conf import defaults
from raven.transport.http import HTTPTransport
try:
import requests
has_requests = True
except:
has_requests = False
class RequestsHTTPTransport(HTTPTransport):
scheme = ['requests+http', 'requests+https']
def __init__(self, parsed_url, timeout=defaults.TIMEOUT, verify_ssl=True,
ca_certs=defaults.CA_BUNDLE):
if not has_requests:
raise ImportError('RequestsHTTPTransport requires requests.')
super(RequestsHTTPTransport, self).__init__(parsed_url,
timeout=timeout,
verify_ssl=verify_ssl,
ca_certs=ca_certs)
# remove the requests+ from the protocol, as it is not a real protocol
self._url = self._url.split('+', 1)[-1]
def send(self, data, headers):
if self.verify_ssl:
# If SSL verification is enabled use the provided CA bundle to
# perform the verification.
self.verify_ssl = self.ca_certs
requests.post(self._url, data=data, headers=headers,
verify=self.verify_ssl, timeout=self.timeout)
| <commit_before>"""
raven.transport.requests
~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from raven.transport.http import HTTPTransport
try:
import requests
has_requests = True
except:
has_requests = False
class RequestsHTTPTransport(HTTPTransport):
scheme = ['requests+http', 'requests+https']
def __init__(self, parsed_url):
if not has_requests:
raise ImportError('RequestsHTTPTransport requires requests.')
super(RequestsHTTPTransport, self).__init__(parsed_url)
# remove the requests+ from the protocol, as it is not a real protocol
self._url = self._url.split('+', 1)[-1]
def send(self, data, headers):
requests.post(self._url, data=data, headers=headers)
<commit_msg>Add support for the verify_ssl, ca_certs and timeout parameters for the request transport.<commit_after> | """
raven.transport.requests
~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from raven.conf import defaults
from raven.transport.http import HTTPTransport
try:
import requests
has_requests = True
except:
has_requests = False
class RequestsHTTPTransport(HTTPTransport):
scheme = ['requests+http', 'requests+https']
def __init__(self, parsed_url, timeout=defaults.TIMEOUT, verify_ssl=True,
ca_certs=defaults.CA_BUNDLE):
if not has_requests:
raise ImportError('RequestsHTTPTransport requires requests.')
super(RequestsHTTPTransport, self).__init__(parsed_url,
timeout=timeout,
verify_ssl=verify_ssl,
ca_certs=ca_certs)
# remove the requests+ from the protocol, as it is not a real protocol
self._url = self._url.split('+', 1)[-1]
def send(self, data, headers):
if self.verify_ssl:
# If SSL verification is enabled use the provided CA bundle to
# perform the verification.
self.verify_ssl = self.ca_certs
requests.post(self._url, data=data, headers=headers,
verify=self.verify_ssl, timeout=self.timeout)
| """
raven.transport.requests
~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from raven.transport.http import HTTPTransport
try:
import requests
has_requests = True
except:
has_requests = False
class RequestsHTTPTransport(HTTPTransport):
scheme = ['requests+http', 'requests+https']
def __init__(self, parsed_url):
if not has_requests:
raise ImportError('RequestsHTTPTransport requires requests.')
super(RequestsHTTPTransport, self).__init__(parsed_url)
# remove the requests+ from the protocol, as it is not a real protocol
self._url = self._url.split('+', 1)[-1]
def send(self, data, headers):
requests.post(self._url, data=data, headers=headers)
Add support for the verify_ssl, ca_certs and timeout parameters for the request transport."""
raven.transport.requests
~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from raven.conf import defaults
from raven.transport.http import HTTPTransport
try:
import requests
has_requests = True
except:
has_requests = False
class RequestsHTTPTransport(HTTPTransport):
scheme = ['requests+http', 'requests+https']
def __init__(self, parsed_url, timeout=defaults.TIMEOUT, verify_ssl=True,
ca_certs=defaults.CA_BUNDLE):
if not has_requests:
raise ImportError('RequestsHTTPTransport requires requests.')
super(RequestsHTTPTransport, self).__init__(parsed_url,
timeout=timeout,
verify_ssl=verify_ssl,
ca_certs=ca_certs)
# remove the requests+ from the protocol, as it is not a real protocol
self._url = self._url.split('+', 1)[-1]
def send(self, data, headers):
if self.verify_ssl:
# If SSL verification is enabled use the provided CA bundle to
# perform the verification.
self.verify_ssl = self.ca_certs
requests.post(self._url, data=data, headers=headers,
verify=self.verify_ssl, timeout=self.timeout)
| <commit_before>"""
raven.transport.requests
~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from raven.transport.http import HTTPTransport
try:
import requests
has_requests = True
except:
has_requests = False
class RequestsHTTPTransport(HTTPTransport):
scheme = ['requests+http', 'requests+https']
def __init__(self, parsed_url):
if not has_requests:
raise ImportError('RequestsHTTPTransport requires requests.')
super(RequestsHTTPTransport, self).__init__(parsed_url)
# remove the requests+ from the protocol, as it is not a real protocol
self._url = self._url.split('+', 1)[-1]
def send(self, data, headers):
requests.post(self._url, data=data, headers=headers)
<commit_msg>Add support for the verify_ssl, ca_certs and timeout parameters for the request transport.<commit_after>"""
raven.transport.requests
~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from raven.conf import defaults
from raven.transport.http import HTTPTransport
try:
import requests
has_requests = True
except:
has_requests = False
class RequestsHTTPTransport(HTTPTransport):
scheme = ['requests+http', 'requests+https']
def __init__(self, parsed_url, timeout=defaults.TIMEOUT, verify_ssl=True,
ca_certs=defaults.CA_BUNDLE):
if not has_requests:
raise ImportError('RequestsHTTPTransport requires requests.')
super(RequestsHTTPTransport, self).__init__(parsed_url,
timeout=timeout,
verify_ssl=verify_ssl,
ca_certs=ca_certs)
# remove the requests+ from the protocol, as it is not a real protocol
self._url = self._url.split('+', 1)[-1]
def send(self, data, headers):
if self.verify_ssl:
# If SSL verification is enabled use the provided CA bundle to
# perform the verification.
self.verify_ssl = self.ca_certs
requests.post(self._url, data=data, headers=headers,
verify=self.verify_ssl, timeout=self.timeout)
|
02ef868100ab190b5fa3bff5bad4891f21101ee2 | getkey/__init__.py | getkey/__init__.py | from __future__ import absolute_import
from .platforms import platform
__platform = platform()
getkey = __platform.getkey
keys = __platform.keys
key = keys # alias
bang = __platform.bang
# __all__ = [getkey, key, bang, platform]
__version__ = '0.6'
| from __future__ import absolute_import, print_function
import sys
from .platforms import platform, PlatformError
try:
__platform = platform()
except PlatformError as err:
print('Error initializing standard platform: {}'.format(err.args[0]),
file=sys.stderr)
else:
getkey = __platform.getkey
keys = __platform.keys
key = keys # alias
bang = __platform.bang
# __all__ = [getkey, key, bang, platform]
__version__ = '0.6'
| Handle test environment with no real stdin | Handle test environment with no real stdin
| Python | mit | kcsaff/getkey | from __future__ import absolute_import
from .platforms import platform
__platform = platform()
getkey = __platform.getkey
keys = __platform.keys
key = keys # alias
bang = __platform.bang
# __all__ = [getkey, key, bang, platform]
__version__ = '0.6'
Handle test environment with no real stdin | from __future__ import absolute_import, print_function
import sys
from .platforms import platform, PlatformError
try:
__platform = platform()
except PlatformError as err:
print('Error initializing standard platform: {}'.format(err.args[0]),
file=sys.stderr)
else:
getkey = __platform.getkey
keys = __platform.keys
key = keys # alias
bang = __platform.bang
# __all__ = [getkey, key, bang, platform]
__version__ = '0.6'
| <commit_before>from __future__ import absolute_import
from .platforms import platform
__platform = platform()
getkey = __platform.getkey
keys = __platform.keys
key = keys # alias
bang = __platform.bang
# __all__ = [getkey, key, bang, platform]
__version__ = '0.6'
<commit_msg>Handle test environment with no real stdin<commit_after> | from __future__ import absolute_import, print_function
import sys
from .platforms import platform, PlatformError
try:
__platform = platform()
except PlatformError as err:
print('Error initializing standard platform: {}'.format(err.args[0]),
file=sys.stderr)
else:
getkey = __platform.getkey
keys = __platform.keys
key = keys # alias
bang = __platform.bang
# __all__ = [getkey, key, bang, platform]
__version__ = '0.6'
| from __future__ import absolute_import
from .platforms import platform
__platform = platform()
getkey = __platform.getkey
keys = __platform.keys
key = keys # alias
bang = __platform.bang
# __all__ = [getkey, key, bang, platform]
__version__ = '0.6'
Handle test environment with no real stdinfrom __future__ import absolute_import, print_function
import sys
from .platforms import platform, PlatformError
try:
__platform = platform()
except PlatformError as err:
print('Error initializing standard platform: {}'.format(err.args[0]),
file=sys.stderr)
else:
getkey = __platform.getkey
keys = __platform.keys
key = keys # alias
bang = __platform.bang
# __all__ = [getkey, key, bang, platform]
__version__ = '0.6'
| <commit_before>from __future__ import absolute_import
from .platforms import platform
__platform = platform()
getkey = __platform.getkey
keys = __platform.keys
key = keys # alias
bang = __platform.bang
# __all__ = [getkey, key, bang, platform]
__version__ = '0.6'
<commit_msg>Handle test environment with no real stdin<commit_after>from __future__ import absolute_import, print_function
import sys
from .platforms import platform, PlatformError
try:
__platform = platform()
except PlatformError as err:
print('Error initializing standard platform: {}'.format(err.args[0]),
file=sys.stderr)
else:
getkey = __platform.getkey
keys = __platform.keys
key = keys # alias
bang = __platform.bang
# __all__ = [getkey, key, bang, platform]
__version__ = '0.6'
|
044e9a29e594db1b081175d20d9525151c870e41 | torchtext/data/pipeline.py | torchtext/data/pipeline.py | class Pipeline(object):
"""Defines a pipeline for transforming sequence data."""
def __init__(self, convert_token=None):
if convert_token is not None:
self.convert_token = convert_token
else:
self.convert_token = lambda x: x
self.pipes = [self]
def __call__(self, x, *args):
for pipe in self.pipes:
x = pipe.call(x)
return x
def call(self, x, *args):
if isinstance(x, list):
return [self(tok, *args) for tok in x]
return self.convert_token(x, *args)
def add_before(self, pipeline):
"""Add `pipeline` before this processing pipeline."""
if not isinstance(pipeline, Pipeline):
pipeline = Pipeline(pipeline)
self.pipes = pipeline.pipes[:] + self.pipes[:]
def add_after(self, pipeline):
"""Add `pipeline` after this processing pipeline."""
if not isinstance(pipeline, Pipeline):
pipeline = Pipeline(pipeline)
self.pipes = self.pipes[:] + pipeline.pipes[:]
| class Pipeline(object):
"""Defines a pipeline for transforming sequence data."""
def __init__(self, convert_token=None):
if convert_token is not None:
self.convert_token = convert_token
else:
self.convert_token = lambda x: x
self.pipes = [self]
def __call__(self, x, *args):
for pipe in self.pipes:
x = pipe.call(x)
return x
def call(self, x, *args):
if isinstance(x, list):
return [self(tok, *args) for tok in x]
return self.convert_token(x, *args)
def add_before(self, pipeline):
"""Add `pipeline` before this processing pipeline."""
if not isinstance(pipeline, Pipeline):
pipeline = Pipeline(pipeline)
self.pipes = pipeline.pipes[:] + self.pipes[:]
return self
def add_after(self, pipeline):
"""Add `pipeline` after this processing pipeline."""
if not isinstance(pipeline, Pipeline):
pipeline = Pipeline(pipeline)
self.pipes = self.pipes[:] + pipeline.pipes[:]
return self
| Return self in Pipeline add_after and add_before | Return self in Pipeline add_after and add_before
| Python | bsd-3-clause | pytorch/text,pytorch/text,pytorch/text,pytorch/text | class Pipeline(object):
"""Defines a pipeline for transforming sequence data."""
def __init__(self, convert_token=None):
if convert_token is not None:
self.convert_token = convert_token
else:
self.convert_token = lambda x: x
self.pipes = [self]
def __call__(self, x, *args):
for pipe in self.pipes:
x = pipe.call(x)
return x
def call(self, x, *args):
if isinstance(x, list):
return [self(tok, *args) for tok in x]
return self.convert_token(x, *args)
def add_before(self, pipeline):
"""Add `pipeline` before this processing pipeline."""
if not isinstance(pipeline, Pipeline):
pipeline = Pipeline(pipeline)
self.pipes = pipeline.pipes[:] + self.pipes[:]
def add_after(self, pipeline):
"""Add `pipeline` after this processing pipeline."""
if not isinstance(pipeline, Pipeline):
pipeline = Pipeline(pipeline)
self.pipes = self.pipes[:] + pipeline.pipes[:]
Return self in Pipeline add_after and add_before | class Pipeline(object):
"""Defines a pipeline for transforming sequence data."""
def __init__(self, convert_token=None):
if convert_token is not None:
self.convert_token = convert_token
else:
self.convert_token = lambda x: x
self.pipes = [self]
def __call__(self, x, *args):
for pipe in self.pipes:
x = pipe.call(x)
return x
def call(self, x, *args):
if isinstance(x, list):
return [self(tok, *args) for tok in x]
return self.convert_token(x, *args)
def add_before(self, pipeline):
"""Add `pipeline` before this processing pipeline."""
if not isinstance(pipeline, Pipeline):
pipeline = Pipeline(pipeline)
self.pipes = pipeline.pipes[:] + self.pipes[:]
return self
def add_after(self, pipeline):
"""Add `pipeline` after this processing pipeline."""
if not isinstance(pipeline, Pipeline):
pipeline = Pipeline(pipeline)
self.pipes = self.pipes[:] + pipeline.pipes[:]
return self
| <commit_before>class Pipeline(object):
"""Defines a pipeline for transforming sequence data."""
def __init__(self, convert_token=None):
if convert_token is not None:
self.convert_token = convert_token
else:
self.convert_token = lambda x: x
self.pipes = [self]
def __call__(self, x, *args):
for pipe in self.pipes:
x = pipe.call(x)
return x
def call(self, x, *args):
if isinstance(x, list):
return [self(tok, *args) for tok in x]
return self.convert_token(x, *args)
def add_before(self, pipeline):
"""Add `pipeline` before this processing pipeline."""
if not isinstance(pipeline, Pipeline):
pipeline = Pipeline(pipeline)
self.pipes = pipeline.pipes[:] + self.pipes[:]
def add_after(self, pipeline):
"""Add `pipeline` after this processing pipeline."""
if not isinstance(pipeline, Pipeline):
pipeline = Pipeline(pipeline)
self.pipes = self.pipes[:] + pipeline.pipes[:]
<commit_msg>Return self in Pipeline add_after and add_before<commit_after> | class Pipeline(object):
"""Defines a pipeline for transforming sequence data."""
def __init__(self, convert_token=None):
if convert_token is not None:
self.convert_token = convert_token
else:
self.convert_token = lambda x: x
self.pipes = [self]
def __call__(self, x, *args):
for pipe in self.pipes:
x = pipe.call(x)
return x
def call(self, x, *args):
if isinstance(x, list):
return [self(tok, *args) for tok in x]
return self.convert_token(x, *args)
def add_before(self, pipeline):
"""Add `pipeline` before this processing pipeline."""
if not isinstance(pipeline, Pipeline):
pipeline = Pipeline(pipeline)
self.pipes = pipeline.pipes[:] + self.pipes[:]
return self
def add_after(self, pipeline):
"""Add `pipeline` after this processing pipeline."""
if not isinstance(pipeline, Pipeline):
pipeline = Pipeline(pipeline)
self.pipes = self.pipes[:] + pipeline.pipes[:]
return self
| class Pipeline(object):
"""Defines a pipeline for transforming sequence data."""
def __init__(self, convert_token=None):
if convert_token is not None:
self.convert_token = convert_token
else:
self.convert_token = lambda x: x
self.pipes = [self]
def __call__(self, x, *args):
for pipe in self.pipes:
x = pipe.call(x)
return x
def call(self, x, *args):
if isinstance(x, list):
return [self(tok, *args) for tok in x]
return self.convert_token(x, *args)
def add_before(self, pipeline):
"""Add `pipeline` before this processing pipeline."""
if not isinstance(pipeline, Pipeline):
pipeline = Pipeline(pipeline)
self.pipes = pipeline.pipes[:] + self.pipes[:]
def add_after(self, pipeline):
"""Add `pipeline` after this processing pipeline."""
if not isinstance(pipeline, Pipeline):
pipeline = Pipeline(pipeline)
self.pipes = self.pipes[:] + pipeline.pipes[:]
Return self in Pipeline add_after and add_beforeclass Pipeline(object):
"""Defines a pipeline for transforming sequence data."""
def __init__(self, convert_token=None):
if convert_token is not None:
self.convert_token = convert_token
else:
self.convert_token = lambda x: x
self.pipes = [self]
def __call__(self, x, *args):
for pipe in self.pipes:
x = pipe.call(x)
return x
def call(self, x, *args):
if isinstance(x, list):
return [self(tok, *args) for tok in x]
return self.convert_token(x, *args)
def add_before(self, pipeline):
"""Add `pipeline` before this processing pipeline."""
if not isinstance(pipeline, Pipeline):
pipeline = Pipeline(pipeline)
self.pipes = pipeline.pipes[:] + self.pipes[:]
return self
def add_after(self, pipeline):
"""Add `pipeline` after this processing pipeline."""
if not isinstance(pipeline, Pipeline):
pipeline = Pipeline(pipeline)
self.pipes = self.pipes[:] + pipeline.pipes[:]
return self
| <commit_before>class Pipeline(object):
"""Defines a pipeline for transforming sequence data."""
def __init__(self, convert_token=None):
if convert_token is not None:
self.convert_token = convert_token
else:
self.convert_token = lambda x: x
self.pipes = [self]
def __call__(self, x, *args):
for pipe in self.pipes:
x = pipe.call(x)
return x
def call(self, x, *args):
if isinstance(x, list):
return [self(tok, *args) for tok in x]
return self.convert_token(x, *args)
def add_before(self, pipeline):
"""Add `pipeline` before this processing pipeline."""
if not isinstance(pipeline, Pipeline):
pipeline = Pipeline(pipeline)
self.pipes = pipeline.pipes[:] + self.pipes[:]
def add_after(self, pipeline):
"""Add `pipeline` after this processing pipeline."""
if not isinstance(pipeline, Pipeline):
pipeline = Pipeline(pipeline)
self.pipes = self.pipes[:] + pipeline.pipes[:]
<commit_msg>Return self in Pipeline add_after and add_before<commit_after>class Pipeline(object):
"""Defines a pipeline for transforming sequence data."""
def __init__(self, convert_token=None):
if convert_token is not None:
self.convert_token = convert_token
else:
self.convert_token = lambda x: x
self.pipes = [self]
def __call__(self, x, *args):
for pipe in self.pipes:
x = pipe.call(x)
return x
def call(self, x, *args):
if isinstance(x, list):
return [self(tok, *args) for tok in x]
return self.convert_token(x, *args)
def add_before(self, pipeline):
"""Add `pipeline` before this processing pipeline."""
if not isinstance(pipeline, Pipeline):
pipeline = Pipeline(pipeline)
self.pipes = pipeline.pipes[:] + self.pipes[:]
return self
def add_after(self, pipeline):
"""Add `pipeline` after this processing pipeline."""
if not isinstance(pipeline, Pipeline):
pipeline = Pipeline(pipeline)
self.pipes = self.pipes[:] + pipeline.pipes[:]
return self
|
c54a1286200ce62ef5eddef436428c2244e94798 | totemlogs/elasticsearch.py | totemlogs/elasticsearch.py | from __future__ import absolute_import
from future.builtins import ( # noqa
bytes, dict, int, list, object, range, str,
ascii, chr, hex, input, next, oct, open,
pow, round, super,
filter, map, zip)
from functools import wraps
import logging
from elasticsearch import Elasticsearch
from conf.appconfig import SEARCH_SETTINGS
MAPPING_LOCATION = './conf/index-mapping.json'
logger = logging.getLogger(__name__)
def using_search(fun):
"""
Function wrapper that automatically passes elastic search instance to
wrapped function.
:param fun: Function to be wrapped
:return: Wrapped function.
"""
@wraps(fun)
def outer(*args, **kwargs):
kwargs.setdefault('es', get_search_client())
kwargs.setdefault('idx', SEARCH_SETTINGS['default-index'])
return fun(*args, **kwargs)
return outer
def get_search_client():
"""
Creates the elasticsearch client instance using SEARCH_SETTINGS
:return: Instance of Elasticsearch
:rtype: elasticsearch.Elasticsearch
"""
return Elasticsearch(hosts=SEARCH_SETTINGS['host'],
port=SEARCH_SETTINGS['port'])
| from __future__ import absolute_import
from future.builtins import ( # noqa
bytes, dict, int, list, object, range, str,
ascii, chr, hex, input, next, oct, open,
pow, round, super,
filter, map, zip)
from functools import wraps
import logging
from elasticsearch import Elasticsearch
from conf.appconfig import SEARCH_SETTINGS
MAPPING_LOCATION = './conf/index-mapping.json'
logger = logging.getLogger(__name__)
def using_search(fun):
"""
Function wrapper that automatically passes elastic search instance to
wrapped function.
:param fun: Function to be wrapped
:return: Wrapped function.
"""
@wraps(fun)
def outer(*args, **kwargs):
kwargs.setdefault('es', get_search_client())
kwargs.setdefault('idx', SEARCH_SETTINGS['default-index'])
return fun(*args, **kwargs)
return outer
def get_search_client():
"""
Creates the elasticsearch client instance using SEARCH_SETTINGS
:return: Instance of Elasticsearch
:rtype: elasticsearch.Elasticsearch
"""
return Elasticsearch(hosts=SEARCH_SETTINGS['host'],
port=SEARCH_SETTINGS['port'],
send_get_body_as='POST')
| Use POST instead of GET Request for ES Search API (Issue with query string size) | Use POST instead of GET Request for ES Search API (Issue with query string size)
| Python | mit | totem/totem-logs,totem/totem-logs,totem/totem-logs,totem/totem-logs | from __future__ import absolute_import
from future.builtins import ( # noqa
bytes, dict, int, list, object, range, str,
ascii, chr, hex, input, next, oct, open,
pow, round, super,
filter, map, zip)
from functools import wraps
import logging
from elasticsearch import Elasticsearch
from conf.appconfig import SEARCH_SETTINGS
MAPPING_LOCATION = './conf/index-mapping.json'
logger = logging.getLogger(__name__)
def using_search(fun):
"""
Function wrapper that automatically passes elastic search instance to
wrapped function.
:param fun: Function to be wrapped
:return: Wrapped function.
"""
@wraps(fun)
def outer(*args, **kwargs):
kwargs.setdefault('es', get_search_client())
kwargs.setdefault('idx', SEARCH_SETTINGS['default-index'])
return fun(*args, **kwargs)
return outer
def get_search_client():
"""
Creates the elasticsearch client instance using SEARCH_SETTINGS
:return: Instance of Elasticsearch
:rtype: elasticsearch.Elasticsearch
"""
return Elasticsearch(hosts=SEARCH_SETTINGS['host'],
port=SEARCH_SETTINGS['port'])
Use POST instead of GET Request for ES Search API (Issue with query string size) | from __future__ import absolute_import
from future.builtins import ( # noqa
bytes, dict, int, list, object, range, str,
ascii, chr, hex, input, next, oct, open,
pow, round, super,
filter, map, zip)
from functools import wraps
import logging
from elasticsearch import Elasticsearch
from conf.appconfig import SEARCH_SETTINGS
MAPPING_LOCATION = './conf/index-mapping.json'
logger = logging.getLogger(__name__)
def using_search(fun):
"""
Function wrapper that automatically passes elastic search instance to
wrapped function.
:param fun: Function to be wrapped
:return: Wrapped function.
"""
@wraps(fun)
def outer(*args, **kwargs):
kwargs.setdefault('es', get_search_client())
kwargs.setdefault('idx', SEARCH_SETTINGS['default-index'])
return fun(*args, **kwargs)
return outer
def get_search_client():
"""
Creates the elasticsearch client instance using SEARCH_SETTINGS
:return: Instance of Elasticsearch
:rtype: elasticsearch.Elasticsearch
"""
return Elasticsearch(hosts=SEARCH_SETTINGS['host'],
port=SEARCH_SETTINGS['port'],
send_get_body_as='POST')
| <commit_before>from __future__ import absolute_import
from future.builtins import ( # noqa
bytes, dict, int, list, object, range, str,
ascii, chr, hex, input, next, oct, open,
pow, round, super,
filter, map, zip)
from functools import wraps
import logging
from elasticsearch import Elasticsearch
from conf.appconfig import SEARCH_SETTINGS
MAPPING_LOCATION = './conf/index-mapping.json'
logger = logging.getLogger(__name__)
def using_search(fun):
"""
Function wrapper that automatically passes elastic search instance to
wrapped function.
:param fun: Function to be wrapped
:return: Wrapped function.
"""
@wraps(fun)
def outer(*args, **kwargs):
kwargs.setdefault('es', get_search_client())
kwargs.setdefault('idx', SEARCH_SETTINGS['default-index'])
return fun(*args, **kwargs)
return outer
def get_search_client():
"""
Creates the elasticsearch client instance using SEARCH_SETTINGS
:return: Instance of Elasticsearch
:rtype: elasticsearch.Elasticsearch
"""
return Elasticsearch(hosts=SEARCH_SETTINGS['host'],
port=SEARCH_SETTINGS['port'])
<commit_msg>Use POST instead of GET Request for ES Search API (Issue with query string size)<commit_after> | from __future__ import absolute_import
from future.builtins import ( # noqa
bytes, dict, int, list, object, range, str,
ascii, chr, hex, input, next, oct, open,
pow, round, super,
filter, map, zip)
from functools import wraps
import logging
from elasticsearch import Elasticsearch
from conf.appconfig import SEARCH_SETTINGS
MAPPING_LOCATION = './conf/index-mapping.json'
logger = logging.getLogger(__name__)
def using_search(fun):
"""
Function wrapper that automatically passes elastic search instance to
wrapped function.
:param fun: Function to be wrapped
:return: Wrapped function.
"""
@wraps(fun)
def outer(*args, **kwargs):
kwargs.setdefault('es', get_search_client())
kwargs.setdefault('idx', SEARCH_SETTINGS['default-index'])
return fun(*args, **kwargs)
return outer
def get_search_client():
"""
Creates the elasticsearch client instance using SEARCH_SETTINGS
:return: Instance of Elasticsearch
:rtype: elasticsearch.Elasticsearch
"""
return Elasticsearch(hosts=SEARCH_SETTINGS['host'],
port=SEARCH_SETTINGS['port'],
send_get_body_as='POST')
| from __future__ import absolute_import
from future.builtins import ( # noqa
bytes, dict, int, list, object, range, str,
ascii, chr, hex, input, next, oct, open,
pow, round, super,
filter, map, zip)
from functools import wraps
import logging
from elasticsearch import Elasticsearch
from conf.appconfig import SEARCH_SETTINGS
MAPPING_LOCATION = './conf/index-mapping.json'
logger = logging.getLogger(__name__)
def using_search(fun):
"""
Function wrapper that automatically passes elastic search instance to
wrapped function.
:param fun: Function to be wrapped
:return: Wrapped function.
"""
@wraps(fun)
def outer(*args, **kwargs):
kwargs.setdefault('es', get_search_client())
kwargs.setdefault('idx', SEARCH_SETTINGS['default-index'])
return fun(*args, **kwargs)
return outer
def get_search_client():
"""
Creates the elasticsearch client instance using SEARCH_SETTINGS
:return: Instance of Elasticsearch
:rtype: elasticsearch.Elasticsearch
"""
return Elasticsearch(hosts=SEARCH_SETTINGS['host'],
port=SEARCH_SETTINGS['port'])
Use POST instead of GET Request for ES Search API (Issue with query string size)from __future__ import absolute_import
from future.builtins import ( # noqa
bytes, dict, int, list, object, range, str,
ascii, chr, hex, input, next, oct, open,
pow, round, super,
filter, map, zip)
from functools import wraps
import logging
from elasticsearch import Elasticsearch
from conf.appconfig import SEARCH_SETTINGS
MAPPING_LOCATION = './conf/index-mapping.json'
logger = logging.getLogger(__name__)
def using_search(fun):
"""
Function wrapper that automatically passes elastic search instance to
wrapped function.
:param fun: Function to be wrapped
:return: Wrapped function.
"""
@wraps(fun)
def outer(*args, **kwargs):
kwargs.setdefault('es', get_search_client())
kwargs.setdefault('idx', SEARCH_SETTINGS['default-index'])
return fun(*args, **kwargs)
return outer
def get_search_client():
"""
Creates the elasticsearch client instance using SEARCH_SETTINGS
:return: Instance of Elasticsearch
:rtype: elasticsearch.Elasticsearch
"""
return Elasticsearch(hosts=SEARCH_SETTINGS['host'],
port=SEARCH_SETTINGS['port'],
send_get_body_as='POST')
| <commit_before>from __future__ import absolute_import
from future.builtins import ( # noqa
bytes, dict, int, list, object, range, str,
ascii, chr, hex, input, next, oct, open,
pow, round, super,
filter, map, zip)
from functools import wraps
import logging
from elasticsearch import Elasticsearch
from conf.appconfig import SEARCH_SETTINGS
MAPPING_LOCATION = './conf/index-mapping.json'
logger = logging.getLogger(__name__)
def using_search(fun):
"""
Function wrapper that automatically passes elastic search instance to
wrapped function.
:param fun: Function to be wrapped
:return: Wrapped function.
"""
@wraps(fun)
def outer(*args, **kwargs):
kwargs.setdefault('es', get_search_client())
kwargs.setdefault('idx', SEARCH_SETTINGS['default-index'])
return fun(*args, **kwargs)
return outer
def get_search_client():
"""
Creates the elasticsearch client instance using SEARCH_SETTINGS
:return: Instance of Elasticsearch
:rtype: elasticsearch.Elasticsearch
"""
return Elasticsearch(hosts=SEARCH_SETTINGS['host'],
port=SEARCH_SETTINGS['port'])
<commit_msg>Use POST instead of GET Request for ES Search API (Issue with query string size)<commit_after>from __future__ import absolute_import
from future.builtins import ( # noqa
bytes, dict, int, list, object, range, str,
ascii, chr, hex, input, next, oct, open,
pow, round, super,
filter, map, zip)
from functools import wraps
import logging
from elasticsearch import Elasticsearch
from conf.appconfig import SEARCH_SETTINGS
MAPPING_LOCATION = './conf/index-mapping.json'
logger = logging.getLogger(__name__)
def using_search(fun):
"""
Function wrapper that automatically passes elastic search instance to
wrapped function.
:param fun: Function to be wrapped
:return: Wrapped function.
"""
@wraps(fun)
def outer(*args, **kwargs):
kwargs.setdefault('es', get_search_client())
kwargs.setdefault('idx', SEARCH_SETTINGS['default-index'])
return fun(*args, **kwargs)
return outer
def get_search_client():
"""
Creates the elasticsearch client instance using SEARCH_SETTINGS
:return: Instance of Elasticsearch
:rtype: elasticsearch.Elasticsearch
"""
return Elasticsearch(hosts=SEARCH_SETTINGS['host'],
port=SEARCH_SETTINGS['port'],
send_get_body_as='POST')
|
396027e1b779304b085d60ba8d64877f96a51deb | src/webassets/filter/typescript.py | src/webassets/filter/typescript.py | import os
import subprocess
import tempfile
from webassets.filter import Filter
from webassets.exceptions import FilterError
__all__ = ('TypeScript',)
class TypeScript(Filter):
"""Compile `TypeScript <http://www.typescriptlang.org`_ to JavaScript.
TypeScript is an external tool written for NodeJS.
This filter assumes that the ``tsc`` executable is in the path. Otherwise, you
may define the ``TYPESCRIPT_BIN`` setting.
"""
name = 'typescript'
options = {
'binary': 'TYPESCRIPT_BIN',
}
def output(self, _in, out, **kw):
# The typescript compiler cannot read a file which does not have
# the .ts extension
input_filename = tempfile.mktemp() + ".ts"
output_filename = tempfile.mktemp()
with open(input_filename, 'wb') as f:
f.write(_in.read())
args = [self.binary or 'tsc', '--out', output_filename, input_filename]
proc = subprocess.Popen(
args,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = proc.communicate()
if proc.returncode != 0:
raise FilterError("typescript: subprocess had error: stderr=%s," % stderr +
"stdout=%s, returncode=%s" % (stdout, proc.returncode))
with open(output_filename, 'rb') as f:
out.write(f.read())
os.unlink(input_filename)
os.unlink(output_filename)
| import os
import subprocess
import tempfile
from webassets.filter import Filter
from webassets.exceptions import FilterError
__all__ = ('TypeScript',)
class TypeScript(Filter):
"""Compile `TypeScript <http://www.typescriptlang.org`_ to JavaScript.
TypeScript is an external tool written for NodeJS.
This filter assumes that the ``tsc`` executable is in the path. Otherwise, you
may define the ``TYPESCRIPT_BIN`` setting.
"""
name = 'typescript'
max_debug_level = None
options = {
'binary': 'TYPESCRIPT_BIN',
}
def output(self, _in, out, **kw):
# The typescript compiler cannot read a file which does not have
# the .ts extension
input_filename = tempfile.mktemp() + ".ts"
output_filename = tempfile.mktemp()
with open(input_filename, 'wb') as f:
f.write(_in.read())
args = [self.binary or 'tsc', '--out', output_filename, input_filename]
proc = subprocess.Popen(
args,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = proc.communicate()
if proc.returncode != 0:
raise FilterError("typescript: subprocess had error: stderr=%s," % stderr +
"stdout=%s, returncode=%s" % (stdout, proc.returncode))
with open(output_filename, 'rb') as f:
out.write(f.read())
os.unlink(input_filename)
os.unlink(output_filename)
| Allow compilation even in debug mode | Allow compilation even in debug mode
| Python | bsd-2-clause | wijerasa/webassets,john2x/webassets,JDeuce/webassets,0x1997/webassets,glorpen/webassets,florianjacob/webassets,glorpen/webassets,aconrad/webassets,heynemann/webassets,john2x/webassets,wijerasa/webassets,heynemann/webassets,florianjacob/webassets,JDeuce/webassets,scorphus/webassets,heynemann/webassets,scorphus/webassets,aconrad/webassets,0x1997/webassets,aconrad/webassets,glorpen/webassets | import os
import subprocess
import tempfile
from webassets.filter import Filter
from webassets.exceptions import FilterError
__all__ = ('TypeScript',)
class TypeScript(Filter):
"""Compile `TypeScript <http://www.typescriptlang.org`_ to JavaScript.
TypeScript is an external tool written for NodeJS.
This filter assumes that the ``tsc`` executable is in the path. Otherwise, you
may define the ``TYPESCRIPT_BIN`` setting.
"""
name = 'typescript'
options = {
'binary': 'TYPESCRIPT_BIN',
}
def output(self, _in, out, **kw):
# The typescript compiler cannot read a file which does not have
# the .ts extension
input_filename = tempfile.mktemp() + ".ts"
output_filename = tempfile.mktemp()
with open(input_filename, 'wb') as f:
f.write(_in.read())
args = [self.binary or 'tsc', '--out', output_filename, input_filename]
proc = subprocess.Popen(
args,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = proc.communicate()
if proc.returncode != 0:
raise FilterError("typescript: subprocess had error: stderr=%s," % stderr +
"stdout=%s, returncode=%s" % (stdout, proc.returncode))
with open(output_filename, 'rb') as f:
out.write(f.read())
os.unlink(input_filename)
os.unlink(output_filename)
Allow compilation even in debug mode | import os
import subprocess
import tempfile
from webassets.filter import Filter
from webassets.exceptions import FilterError
__all__ = ('TypeScript',)
class TypeScript(Filter):
"""Compile `TypeScript <http://www.typescriptlang.org`_ to JavaScript.
TypeScript is an external tool written for NodeJS.
This filter assumes that the ``tsc`` executable is in the path. Otherwise, you
may define the ``TYPESCRIPT_BIN`` setting.
"""
name = 'typescript'
max_debug_level = None
options = {
'binary': 'TYPESCRIPT_BIN',
}
def output(self, _in, out, **kw):
# The typescript compiler cannot read a file which does not have
# the .ts extension
input_filename = tempfile.mktemp() + ".ts"
output_filename = tempfile.mktemp()
with open(input_filename, 'wb') as f:
f.write(_in.read())
args = [self.binary or 'tsc', '--out', output_filename, input_filename]
proc = subprocess.Popen(
args,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = proc.communicate()
if proc.returncode != 0:
raise FilterError("typescript: subprocess had error: stderr=%s," % stderr +
"stdout=%s, returncode=%s" % (stdout, proc.returncode))
with open(output_filename, 'rb') as f:
out.write(f.read())
os.unlink(input_filename)
os.unlink(output_filename)
| <commit_before>import os
import subprocess
import tempfile
from webassets.filter import Filter
from webassets.exceptions import FilterError
__all__ = ('TypeScript',)
class TypeScript(Filter):
"""Compile `TypeScript <http://www.typescriptlang.org`_ to JavaScript.
TypeScript is an external tool written for NodeJS.
This filter assumes that the ``tsc`` executable is in the path. Otherwise, you
may define the ``TYPESCRIPT_BIN`` setting.
"""
name = 'typescript'
options = {
'binary': 'TYPESCRIPT_BIN',
}
def output(self, _in, out, **kw):
# The typescript compiler cannot read a file which does not have
# the .ts extension
input_filename = tempfile.mktemp() + ".ts"
output_filename = tempfile.mktemp()
with open(input_filename, 'wb') as f:
f.write(_in.read())
args = [self.binary or 'tsc', '--out', output_filename, input_filename]
proc = subprocess.Popen(
args,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = proc.communicate()
if proc.returncode != 0:
raise FilterError("typescript: subprocess had error: stderr=%s," % stderr +
"stdout=%s, returncode=%s" % (stdout, proc.returncode))
with open(output_filename, 'rb') as f:
out.write(f.read())
os.unlink(input_filename)
os.unlink(output_filename)
<commit_msg>Allow compilation even in debug mode<commit_after> | import os
import subprocess
import tempfile
from webassets.filter import Filter
from webassets.exceptions import FilterError
__all__ = ('TypeScript',)
class TypeScript(Filter):
"""Compile `TypeScript <http://www.typescriptlang.org`_ to JavaScript.
TypeScript is an external tool written for NodeJS.
This filter assumes that the ``tsc`` executable is in the path. Otherwise, you
may define the ``TYPESCRIPT_BIN`` setting.
"""
name = 'typescript'
max_debug_level = None
options = {
'binary': 'TYPESCRIPT_BIN',
}
def output(self, _in, out, **kw):
# The typescript compiler cannot read a file which does not have
# the .ts extension
input_filename = tempfile.mktemp() + ".ts"
output_filename = tempfile.mktemp()
with open(input_filename, 'wb') as f:
f.write(_in.read())
args = [self.binary or 'tsc', '--out', output_filename, input_filename]
proc = subprocess.Popen(
args,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = proc.communicate()
if proc.returncode != 0:
raise FilterError("typescript: subprocess had error: stderr=%s," % stderr +
"stdout=%s, returncode=%s" % (stdout, proc.returncode))
with open(output_filename, 'rb') as f:
out.write(f.read())
os.unlink(input_filename)
os.unlink(output_filename)
| import os
import subprocess
import tempfile
from webassets.filter import Filter
from webassets.exceptions import FilterError
__all__ = ('TypeScript',)
class TypeScript(Filter):
"""Compile `TypeScript <http://www.typescriptlang.org`_ to JavaScript.
TypeScript is an external tool written for NodeJS.
This filter assumes that the ``tsc`` executable is in the path. Otherwise, you
may define the ``TYPESCRIPT_BIN`` setting.
"""
name = 'typescript'
options = {
'binary': 'TYPESCRIPT_BIN',
}
def output(self, _in, out, **kw):
# The typescript compiler cannot read a file which does not have
# the .ts extension
input_filename = tempfile.mktemp() + ".ts"
output_filename = tempfile.mktemp()
with open(input_filename, 'wb') as f:
f.write(_in.read())
args = [self.binary or 'tsc', '--out', output_filename, input_filename]
proc = subprocess.Popen(
args,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = proc.communicate()
if proc.returncode != 0:
raise FilterError("typescript: subprocess had error: stderr=%s," % stderr +
"stdout=%s, returncode=%s" % (stdout, proc.returncode))
with open(output_filename, 'rb') as f:
out.write(f.read())
os.unlink(input_filename)
os.unlink(output_filename)
Allow compilation even in debug modeimport os
import subprocess
import tempfile
from webassets.filter import Filter
from webassets.exceptions import FilterError
__all__ = ('TypeScript',)
class TypeScript(Filter):
"""Compile `TypeScript <http://www.typescriptlang.org`_ to JavaScript.
TypeScript is an external tool written for NodeJS.
This filter assumes that the ``tsc`` executable is in the path. Otherwise, you
may define the ``TYPESCRIPT_BIN`` setting.
"""
name = 'typescript'
max_debug_level = None
options = {
'binary': 'TYPESCRIPT_BIN',
}
def output(self, _in, out, **kw):
# The typescript compiler cannot read a file which does not have
# the .ts extension
input_filename = tempfile.mktemp() + ".ts"
output_filename = tempfile.mktemp()
with open(input_filename, 'wb') as f:
f.write(_in.read())
args = [self.binary or 'tsc', '--out', output_filename, input_filename]
proc = subprocess.Popen(
args,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = proc.communicate()
if proc.returncode != 0:
raise FilterError("typescript: subprocess had error: stderr=%s," % stderr +
"stdout=%s, returncode=%s" % (stdout, proc.returncode))
with open(output_filename, 'rb') as f:
out.write(f.read())
os.unlink(input_filename)
os.unlink(output_filename)
| <commit_before>import os
import subprocess
import tempfile
from webassets.filter import Filter
from webassets.exceptions import FilterError
__all__ = ('TypeScript',)
class TypeScript(Filter):
"""Compile `TypeScript <http://www.typescriptlang.org`_ to JavaScript.
TypeScript is an external tool written for NodeJS.
This filter assumes that the ``tsc`` executable is in the path. Otherwise, you
may define the ``TYPESCRIPT_BIN`` setting.
"""
name = 'typescript'
options = {
'binary': 'TYPESCRIPT_BIN',
}
def output(self, _in, out, **kw):
# The typescript compiler cannot read a file which does not have
# the .ts extension
input_filename = tempfile.mktemp() + ".ts"
output_filename = tempfile.mktemp()
with open(input_filename, 'wb') as f:
f.write(_in.read())
args = [self.binary or 'tsc', '--out', output_filename, input_filename]
proc = subprocess.Popen(
args,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = proc.communicate()
if proc.returncode != 0:
raise FilterError("typescript: subprocess had error: stderr=%s," % stderr +
"stdout=%s, returncode=%s" % (stdout, proc.returncode))
with open(output_filename, 'rb') as f:
out.write(f.read())
os.unlink(input_filename)
os.unlink(output_filename)
<commit_msg>Allow compilation even in debug mode<commit_after>import os
import subprocess
import tempfile
from webassets.filter import Filter
from webassets.exceptions import FilterError
__all__ = ('TypeScript',)
class TypeScript(Filter):
"""Compile `TypeScript <http://www.typescriptlang.org`_ to JavaScript.
TypeScript is an external tool written for NodeJS.
This filter assumes that the ``tsc`` executable is in the path. Otherwise, you
may define the ``TYPESCRIPT_BIN`` setting.
"""
name = 'typescript'
max_debug_level = None
options = {
'binary': 'TYPESCRIPT_BIN',
}
def output(self, _in, out, **kw):
# The typescript compiler cannot read a file which does not have
# the .ts extension
input_filename = tempfile.mktemp() + ".ts"
output_filename = tempfile.mktemp()
with open(input_filename, 'wb') as f:
f.write(_in.read())
args = [self.binary or 'tsc', '--out', output_filename, input_filename]
proc = subprocess.Popen(
args,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = proc.communicate()
if proc.returncode != 0:
raise FilterError("typescript: subprocess had error: stderr=%s," % stderr +
"stdout=%s, returncode=%s" % (stdout, proc.returncode))
with open(output_filename, 'rb') as f:
out.write(f.read())
os.unlink(input_filename)
os.unlink(output_filename)
|
35a15e06feca24872acb42c5395b58b2a1bed60e | byceps/services/snippet/transfer/models.py | byceps/services/snippet/transfer/models.py | """
byceps.services.snippet.transfer.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from __future__ import annotations
from dataclasses import dataclass
from enum import Enum
from typing import NewType
from uuid import UUID
from ...site.transfer.models import SiteID
from ....typing import BrandID
@dataclass(frozen=True)
class Scope:
type_: str
name: str
@classmethod
def for_global(cls) -> Scope:
return cls('global', 'global')
@classmethod
def for_brand(cls, brand_id: BrandID) -> Scope:
return cls('brand', str(brand_id))
@classmethod
def for_site(cls, site_id: SiteID) -> Scope:
return cls('site', str(site_id))
SnippetID = NewType('SnippetID', UUID)
SnippetType = Enum('SnippetType', ['document', 'fragment'])
SnippetVersionID = NewType('SnippetVersionID', UUID)
MountpointID = NewType('MountpointID', UUID)
@dataclass(frozen=True)
class Mountpoint:
id: MountpointID
site_id: SiteID
endpoint_suffix: str
url_path: str
snippet_id: SnippetID
| """
byceps.services.snippet.transfer.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from __future__ import annotations
from dataclasses import dataclass
from enum import Enum
from typing import NewType
from uuid import UUID
from ...site.transfer.models import SiteID
from ....typing import BrandID
@dataclass(frozen=True)
class Scope:
type_: str
name: str
@classmethod
def for_brand(cls, brand_id: BrandID) -> Scope:
return cls('brand', str(brand_id))
@classmethod
def for_site(cls, site_id: SiteID) -> Scope:
return cls('site', str(site_id))
SnippetID = NewType('SnippetID', UUID)
SnippetType = Enum('SnippetType', ['document', 'fragment'])
SnippetVersionID = NewType('SnippetVersionID', UUID)
MountpointID = NewType('MountpointID', UUID)
@dataclass(frozen=True)
class Mountpoint:
id: MountpointID
site_id: SiteID
endpoint_suffix: str
url_path: str
snippet_id: SnippetID
| Remove unused class method `Scope.for_global` | Remove unused class method `Scope.for_global`
| Python | bsd-3-clause | homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps | """
byceps.services.snippet.transfer.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from __future__ import annotations
from dataclasses import dataclass
from enum import Enum
from typing import NewType
from uuid import UUID
from ...site.transfer.models import SiteID
from ....typing import BrandID
@dataclass(frozen=True)
class Scope:
type_: str
name: str
@classmethod
def for_global(cls) -> Scope:
return cls('global', 'global')
@classmethod
def for_brand(cls, brand_id: BrandID) -> Scope:
return cls('brand', str(brand_id))
@classmethod
def for_site(cls, site_id: SiteID) -> Scope:
return cls('site', str(site_id))
SnippetID = NewType('SnippetID', UUID)
SnippetType = Enum('SnippetType', ['document', 'fragment'])
SnippetVersionID = NewType('SnippetVersionID', UUID)
MountpointID = NewType('MountpointID', UUID)
@dataclass(frozen=True)
class Mountpoint:
id: MountpointID
site_id: SiteID
endpoint_suffix: str
url_path: str
snippet_id: SnippetID
Remove unused class method `Scope.for_global` | """
byceps.services.snippet.transfer.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from __future__ import annotations
from dataclasses import dataclass
from enum import Enum
from typing import NewType
from uuid import UUID
from ...site.transfer.models import SiteID
from ....typing import BrandID
@dataclass(frozen=True)
class Scope:
type_: str
name: str
@classmethod
def for_brand(cls, brand_id: BrandID) -> Scope:
return cls('brand', str(brand_id))
@classmethod
def for_site(cls, site_id: SiteID) -> Scope:
return cls('site', str(site_id))
SnippetID = NewType('SnippetID', UUID)
SnippetType = Enum('SnippetType', ['document', 'fragment'])
SnippetVersionID = NewType('SnippetVersionID', UUID)
MountpointID = NewType('MountpointID', UUID)
@dataclass(frozen=True)
class Mountpoint:
id: MountpointID
site_id: SiteID
endpoint_suffix: str
url_path: str
snippet_id: SnippetID
| <commit_before>"""
byceps.services.snippet.transfer.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from __future__ import annotations
from dataclasses import dataclass
from enum import Enum
from typing import NewType
from uuid import UUID
from ...site.transfer.models import SiteID
from ....typing import BrandID
@dataclass(frozen=True)
class Scope:
type_: str
name: str
@classmethod
def for_global(cls) -> Scope:
return cls('global', 'global')
@classmethod
def for_brand(cls, brand_id: BrandID) -> Scope:
return cls('brand', str(brand_id))
@classmethod
def for_site(cls, site_id: SiteID) -> Scope:
return cls('site', str(site_id))
SnippetID = NewType('SnippetID', UUID)
SnippetType = Enum('SnippetType', ['document', 'fragment'])
SnippetVersionID = NewType('SnippetVersionID', UUID)
MountpointID = NewType('MountpointID', UUID)
@dataclass(frozen=True)
class Mountpoint:
id: MountpointID
site_id: SiteID
endpoint_suffix: str
url_path: str
snippet_id: SnippetID
<commit_msg>Remove unused class method `Scope.for_global`<commit_after> | """
byceps.services.snippet.transfer.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from __future__ import annotations
from dataclasses import dataclass
from enum import Enum
from typing import NewType
from uuid import UUID
from ...site.transfer.models import SiteID
from ....typing import BrandID
@dataclass(frozen=True)
class Scope:
type_: str
name: str
@classmethod
def for_brand(cls, brand_id: BrandID) -> Scope:
return cls('brand', str(brand_id))
@classmethod
def for_site(cls, site_id: SiteID) -> Scope:
return cls('site', str(site_id))
SnippetID = NewType('SnippetID', UUID)
SnippetType = Enum('SnippetType', ['document', 'fragment'])
SnippetVersionID = NewType('SnippetVersionID', UUID)
MountpointID = NewType('MountpointID', UUID)
@dataclass(frozen=True)
class Mountpoint:
id: MountpointID
site_id: SiteID
endpoint_suffix: str
url_path: str
snippet_id: SnippetID
| """
byceps.services.snippet.transfer.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from __future__ import annotations
from dataclasses import dataclass
from enum import Enum
from typing import NewType
from uuid import UUID
from ...site.transfer.models import SiteID
from ....typing import BrandID
@dataclass(frozen=True)
class Scope:
type_: str
name: str
@classmethod
def for_global(cls) -> Scope:
return cls('global', 'global')
@classmethod
def for_brand(cls, brand_id: BrandID) -> Scope:
return cls('brand', str(brand_id))
@classmethod
def for_site(cls, site_id: SiteID) -> Scope:
return cls('site', str(site_id))
SnippetID = NewType('SnippetID', UUID)
SnippetType = Enum('SnippetType', ['document', 'fragment'])
SnippetVersionID = NewType('SnippetVersionID', UUID)
MountpointID = NewType('MountpointID', UUID)
@dataclass(frozen=True)
class Mountpoint:
id: MountpointID
site_id: SiteID
endpoint_suffix: str
url_path: str
snippet_id: SnippetID
Remove unused class method `Scope.for_global`"""
byceps.services.snippet.transfer.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from __future__ import annotations
from dataclasses import dataclass
from enum import Enum
from typing import NewType
from uuid import UUID
from ...site.transfer.models import SiteID
from ....typing import BrandID
@dataclass(frozen=True)
class Scope:
type_: str
name: str
@classmethod
def for_brand(cls, brand_id: BrandID) -> Scope:
return cls('brand', str(brand_id))
@classmethod
def for_site(cls, site_id: SiteID) -> Scope:
return cls('site', str(site_id))
SnippetID = NewType('SnippetID', UUID)
SnippetType = Enum('SnippetType', ['document', 'fragment'])
SnippetVersionID = NewType('SnippetVersionID', UUID)
MountpointID = NewType('MountpointID', UUID)
@dataclass(frozen=True)
class Mountpoint:
id: MountpointID
site_id: SiteID
endpoint_suffix: str
url_path: str
snippet_id: SnippetID
| <commit_before>"""
byceps.services.snippet.transfer.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from __future__ import annotations
from dataclasses import dataclass
from enum import Enum
from typing import NewType
from uuid import UUID
from ...site.transfer.models import SiteID
from ....typing import BrandID
@dataclass(frozen=True)
class Scope:
type_: str
name: str
@classmethod
def for_global(cls) -> Scope:
return cls('global', 'global')
@classmethod
def for_brand(cls, brand_id: BrandID) -> Scope:
return cls('brand', str(brand_id))
@classmethod
def for_site(cls, site_id: SiteID) -> Scope:
return cls('site', str(site_id))
SnippetID = NewType('SnippetID', UUID)
SnippetType = Enum('SnippetType', ['document', 'fragment'])
SnippetVersionID = NewType('SnippetVersionID', UUID)
MountpointID = NewType('MountpointID', UUID)
@dataclass(frozen=True)
class Mountpoint:
id: MountpointID
site_id: SiteID
endpoint_suffix: str
url_path: str
snippet_id: SnippetID
<commit_msg>Remove unused class method `Scope.for_global`<commit_after>"""
byceps.services.snippet.transfer.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from __future__ import annotations
from dataclasses import dataclass
from enum import Enum
from typing import NewType
from uuid import UUID
from ...site.transfer.models import SiteID
from ....typing import BrandID
@dataclass(frozen=True)
class Scope:
type_: str
name: str
@classmethod
def for_brand(cls, brand_id: BrandID) -> Scope:
return cls('brand', str(brand_id))
@classmethod
def for_site(cls, site_id: SiteID) -> Scope:
return cls('site', str(site_id))
SnippetID = NewType('SnippetID', UUID)
SnippetType = Enum('SnippetType', ['document', 'fragment'])
SnippetVersionID = NewType('SnippetVersionID', UUID)
MountpointID = NewType('MountpointID', UUID)
@dataclass(frozen=True)
class Mountpoint:
id: MountpointID
site_id: SiteID
endpoint_suffix: str
url_path: str
snippet_id: SnippetID
|
a3eef3be93e4328194997ea48c509105110145b8 | utils/management/commands/get_settings_values.py | utils/management/commands/get_settings_values.py | # Amara, universalsubtitles.org
#
# Copyright (C) 2012 Participatory Culture Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see
# http://www.gnu.org/licenses/agpl-3.0.html.
from django.core.management.base import BaseCommand
from django.conf import settings
import socket
class Command(BaseCommand):
help = u'Test if Solr, Redis and Memcached are available'
def handle(self, *args, **kwargs):
hostname = socket.gethostname()
print "@ %s" % hostname
for name in args :
print "\t%s : %s" % (name, getattr(settings, name, "empty"))
| # Amara, universalsubtitles.org
#
# Copyright (C) 2012 Participatory Culture Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see
# http://www.gnu.org/licenses/agpl-3.0.html.
from django.core.management.base import BaseCommand
from django.conf import settings
import optparse
import socket
class Command(BaseCommand):
help = u'Lists the settings values for a given setting name'
option_list = BaseCommand.option_list + (
optparse.make_option('--single-host',
action='store_true', dest='single_host', default=False,
help="Print only the value for one host"),
)
def handle(self, *args, **kwargs):
if kwargs.get("single_host", False):
for name in args :
print getattr(settings, name, "")
return
hostname = socket.gethostname()
print "@ %s" % hostname
for name in args :
print "\t%s : %s" % (name, getattr(settings, name, "empty"))
| Allow for getting a settings value from a single server in the enviroment | Allow for getting a settings value from a single server in the enviroment
| Python | agpl-3.0 | pculture/unisubs,wevoice/wesub,ofer43211/unisubs,wevoice/wesub,eloquence/unisubs,eloquence/unisubs,norayr/unisubs,norayr/unisubs,pculture/unisubs,wevoice/wesub,pculture/unisubs,eloquence/unisubs,ReachingOut/unisubs,ujdhesa/unisubs,ReachingOut/unisubs,ofer43211/unisubs,norayr/unisubs,eloquence/unisubs,ujdhesa/unisubs,pculture/unisubs,ReachingOut/unisubs,wevoice/wesub,ujdhesa/unisubs,ReachingOut/unisubs,ofer43211/unisubs,norayr/unisubs,ujdhesa/unisubs,ofer43211/unisubs | # Amara, universalsubtitles.org
#
# Copyright (C) 2012 Participatory Culture Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see
# http://www.gnu.org/licenses/agpl-3.0.html.
from django.core.management.base import BaseCommand
from django.conf import settings
import socket
class Command(BaseCommand):
help = u'Test if Solr, Redis and Memcached are available'
def handle(self, *args, **kwargs):
hostname = socket.gethostname()
print "@ %s" % hostname
for name in args :
print "\t%s : %s" % (name, getattr(settings, name, "empty"))
Allow for getting a settings value from a single server in the enviroment | # Amara, universalsubtitles.org
#
# Copyright (C) 2012 Participatory Culture Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see
# http://www.gnu.org/licenses/agpl-3.0.html.
from django.core.management.base import BaseCommand
from django.conf import settings
import optparse
import socket
class Command(BaseCommand):
help = u'Lists the settings values for a given setting name'
option_list = BaseCommand.option_list + (
optparse.make_option('--single-host',
action='store_true', dest='single_host', default=False,
help="Print only the value for one host"),
)
def handle(self, *args, **kwargs):
if kwargs.get("single_host", False):
for name in args :
print getattr(settings, name, "")
return
hostname = socket.gethostname()
print "@ %s" % hostname
for name in args :
print "\t%s : %s" % (name, getattr(settings, name, "empty"))
| <commit_before># Amara, universalsubtitles.org
#
# Copyright (C) 2012 Participatory Culture Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see
# http://www.gnu.org/licenses/agpl-3.0.html.
from django.core.management.base import BaseCommand
from django.conf import settings
import socket
class Command(BaseCommand):
help = u'Test if Solr, Redis and Memcached are available'
def handle(self, *args, **kwargs):
hostname = socket.gethostname()
print "@ %s" % hostname
for name in args :
print "\t%s : %s" % (name, getattr(settings, name, "empty"))
<commit_msg>Allow for getting a settings value from a single server in the enviroment<commit_after> | # Amara, universalsubtitles.org
#
# Copyright (C) 2012 Participatory Culture Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see
# http://www.gnu.org/licenses/agpl-3.0.html.
from django.core.management.base import BaseCommand
from django.conf import settings
import optparse
import socket
class Command(BaseCommand):
help = u'Lists the settings values for a given setting name'
option_list = BaseCommand.option_list + (
optparse.make_option('--single-host',
action='store_true', dest='single_host', default=False,
help="Print only the value for one host"),
)
def handle(self, *args, **kwargs):
if kwargs.get("single_host", False):
for name in args :
print getattr(settings, name, "")
return
hostname = socket.gethostname()
print "@ %s" % hostname
for name in args :
print "\t%s : %s" % (name, getattr(settings, name, "empty"))
| # Amara, universalsubtitles.org
#
# Copyright (C) 2012 Participatory Culture Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see
# http://www.gnu.org/licenses/agpl-3.0.html.
from django.core.management.base import BaseCommand
from django.conf import settings
import socket
class Command(BaseCommand):
help = u'Test if Solr, Redis and Memcached are available'
def handle(self, *args, **kwargs):
hostname = socket.gethostname()
print "@ %s" % hostname
for name in args :
print "\t%s : %s" % (name, getattr(settings, name, "empty"))
Allow for getting a settings value from a single server in the enviroment# Amara, universalsubtitles.org
#
# Copyright (C) 2012 Participatory Culture Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see
# http://www.gnu.org/licenses/agpl-3.0.html.
from django.core.management.base import BaseCommand
from django.conf import settings
import optparse
import socket
class Command(BaseCommand):
help = u'Lists the settings values for a given setting name'
option_list = BaseCommand.option_list + (
optparse.make_option('--single-host',
action='store_true', dest='single_host', default=False,
help="Print only the value for one host"),
)
def handle(self, *args, **kwargs):
if kwargs.get("single_host", False):
for name in args :
print getattr(settings, name, "")
return
hostname = socket.gethostname()
print "@ %s" % hostname
for name in args :
print "\t%s : %s" % (name, getattr(settings, name, "empty"))
| <commit_before># Amara, universalsubtitles.org
#
# Copyright (C) 2012 Participatory Culture Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see
# http://www.gnu.org/licenses/agpl-3.0.html.
from django.core.management.base import BaseCommand
from django.conf import settings
import socket
class Command(BaseCommand):
help = u'Test if Solr, Redis and Memcached are available'
def handle(self, *args, **kwargs):
hostname = socket.gethostname()
print "@ %s" % hostname
for name in args :
print "\t%s : %s" % (name, getattr(settings, name, "empty"))
<commit_msg>Allow for getting a settings value from a single server in the enviroment<commit_after># Amara, universalsubtitles.org
#
# Copyright (C) 2012 Participatory Culture Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see
# http://www.gnu.org/licenses/agpl-3.0.html.
from django.core.management.base import BaseCommand
from django.conf import settings
import optparse
import socket
class Command(BaseCommand):
help = u'Lists the settings values for a given setting name'
option_list = BaseCommand.option_list + (
optparse.make_option('--single-host',
action='store_true', dest='single_host', default=False,
help="Print only the value for one host"),
)
def handle(self, *args, **kwargs):
if kwargs.get("single_host", False):
for name in args :
print getattr(settings, name, "")
return
hostname = socket.gethostname()
print "@ %s" % hostname
for name in args :
print "\t%s : %s" % (name, getattr(settings, name, "empty"))
|
90bfdbe432763565d7e8ccc8b04e9d3440164557 | draftjs_exporter/constants.py | draftjs_exporter/constants.py | from __future__ import absolute_import, unicode_literals
# http://stackoverflow.com/a/22723724/1798491
class Enum(object):
def __init__(self, *elements):
self.elements = tuple(elements)
def __getattr__(self, name):
if name not in self.elements:
raise AttributeError("'Enum' has no attribute '{}'".format(name))
return name
# https://github.com/facebook/draft-js/blob/master/src/model/constants/DraftBlockType.js
class BLOCK_TYPES:
UNSTYLED = 'unstyled'
HEADER_ONE = 'header-one'
HEADER_TWO = 'header-two'
HEADER_THREE = 'header-three'
HEADER_FOUR = 'header-four'
HEADER_FIVE = 'header-five'
HEADER_SIX = 'header-six'
UNORDERED_LIST_ITEM = 'unordered-list-item'
ORDERED_LIST_ITEM = 'ordered-list-item'
BLOCKQUOTE = 'blockquote'
PULLQUOTE = 'pullquote'
CODE = 'code-block'
ATOMIC = 'atomic'
ENTITY_TYPES = Enum('LINK', 'IMAGE', 'HORIZONTAL_RULE')
INLINE_STYLES = Enum('BOLD', 'CODE', 'ITALIC', 'STRIKETHROUGH', 'UNDERLINE')
| from __future__ import absolute_import, unicode_literals
# http://stackoverflow.com/a/22723724/1798491
class Enum(object):
def __init__(self, *elements):
self.elements = tuple(elements)
def __getattr__(self, name):
if name not in self.elements:
raise AttributeError("'Enum' has no attribute '{}'".format(name))
return name
# https://github.com/facebook/draft-js/blob/master/src/model/constants/DraftBlockType.js
class BLOCK_TYPES:
UNSTYLED = 'unstyled'
HEADER_ONE = 'header-one'
HEADER_TWO = 'header-two'
HEADER_THREE = 'header-three'
HEADER_FOUR = 'header-four'
HEADER_FIVE = 'header-five'
HEADER_SIX = 'header-six'
UNORDERED_LIST_ITEM = 'unordered-list-item'
ORDERED_LIST_ITEM = 'ordered-list-item'
BLOCKQUOTE = 'blockquote'
CODE = 'code-block'
ATOMIC = 'atomic'
ENTITY_TYPES = Enum('LINK', 'IMAGE', 'HORIZONTAL_RULE')
INLINE_STYLES = Enum('BOLD', 'CODE', 'ITALIC', 'STRIKETHROUGH', 'UNDERLINE')
| Remove unused pullquote block type | Remove unused pullquote block type
| Python | mit | springload/draftjs_exporter,springload/draftjs_exporter,springload/draftjs_exporter | from __future__ import absolute_import, unicode_literals
# http://stackoverflow.com/a/22723724/1798491
class Enum(object):
def __init__(self, *elements):
self.elements = tuple(elements)
def __getattr__(self, name):
if name not in self.elements:
raise AttributeError("'Enum' has no attribute '{}'".format(name))
return name
# https://github.com/facebook/draft-js/blob/master/src/model/constants/DraftBlockType.js
class BLOCK_TYPES:
UNSTYLED = 'unstyled'
HEADER_ONE = 'header-one'
HEADER_TWO = 'header-two'
HEADER_THREE = 'header-three'
HEADER_FOUR = 'header-four'
HEADER_FIVE = 'header-five'
HEADER_SIX = 'header-six'
UNORDERED_LIST_ITEM = 'unordered-list-item'
ORDERED_LIST_ITEM = 'ordered-list-item'
BLOCKQUOTE = 'blockquote'
PULLQUOTE = 'pullquote'
CODE = 'code-block'
ATOMIC = 'atomic'
ENTITY_TYPES = Enum('LINK', 'IMAGE', 'HORIZONTAL_RULE')
INLINE_STYLES = Enum('BOLD', 'CODE', 'ITALIC', 'STRIKETHROUGH', 'UNDERLINE')
Remove unused pullquote block type | from __future__ import absolute_import, unicode_literals
# http://stackoverflow.com/a/22723724/1798491
class Enum(object):
def __init__(self, *elements):
self.elements = tuple(elements)
def __getattr__(self, name):
if name not in self.elements:
raise AttributeError("'Enum' has no attribute '{}'".format(name))
return name
# https://github.com/facebook/draft-js/blob/master/src/model/constants/DraftBlockType.js
class BLOCK_TYPES:
UNSTYLED = 'unstyled'
HEADER_ONE = 'header-one'
HEADER_TWO = 'header-two'
HEADER_THREE = 'header-three'
HEADER_FOUR = 'header-four'
HEADER_FIVE = 'header-five'
HEADER_SIX = 'header-six'
UNORDERED_LIST_ITEM = 'unordered-list-item'
ORDERED_LIST_ITEM = 'ordered-list-item'
BLOCKQUOTE = 'blockquote'
CODE = 'code-block'
ATOMIC = 'atomic'
ENTITY_TYPES = Enum('LINK', 'IMAGE', 'HORIZONTAL_RULE')
INLINE_STYLES = Enum('BOLD', 'CODE', 'ITALIC', 'STRIKETHROUGH', 'UNDERLINE')
| <commit_before>from __future__ import absolute_import, unicode_literals
# http://stackoverflow.com/a/22723724/1798491
class Enum(object):
def __init__(self, *elements):
self.elements = tuple(elements)
def __getattr__(self, name):
if name not in self.elements:
raise AttributeError("'Enum' has no attribute '{}'".format(name))
return name
# https://github.com/facebook/draft-js/blob/master/src/model/constants/DraftBlockType.js
class BLOCK_TYPES:
UNSTYLED = 'unstyled'
HEADER_ONE = 'header-one'
HEADER_TWO = 'header-two'
HEADER_THREE = 'header-three'
HEADER_FOUR = 'header-four'
HEADER_FIVE = 'header-five'
HEADER_SIX = 'header-six'
UNORDERED_LIST_ITEM = 'unordered-list-item'
ORDERED_LIST_ITEM = 'ordered-list-item'
BLOCKQUOTE = 'blockquote'
PULLQUOTE = 'pullquote'
CODE = 'code-block'
ATOMIC = 'atomic'
ENTITY_TYPES = Enum('LINK', 'IMAGE', 'HORIZONTAL_RULE')
INLINE_STYLES = Enum('BOLD', 'CODE', 'ITALIC', 'STRIKETHROUGH', 'UNDERLINE')
<commit_msg>Remove unused pullquote block type<commit_after> | from __future__ import absolute_import, unicode_literals
# http://stackoverflow.com/a/22723724/1798491
class Enum(object):
def __init__(self, *elements):
self.elements = tuple(elements)
def __getattr__(self, name):
if name not in self.elements:
raise AttributeError("'Enum' has no attribute '{}'".format(name))
return name
# https://github.com/facebook/draft-js/blob/master/src/model/constants/DraftBlockType.js
class BLOCK_TYPES:
UNSTYLED = 'unstyled'
HEADER_ONE = 'header-one'
HEADER_TWO = 'header-two'
HEADER_THREE = 'header-three'
HEADER_FOUR = 'header-four'
HEADER_FIVE = 'header-five'
HEADER_SIX = 'header-six'
UNORDERED_LIST_ITEM = 'unordered-list-item'
ORDERED_LIST_ITEM = 'ordered-list-item'
BLOCKQUOTE = 'blockquote'
CODE = 'code-block'
ATOMIC = 'atomic'
ENTITY_TYPES = Enum('LINK', 'IMAGE', 'HORIZONTAL_RULE')
INLINE_STYLES = Enum('BOLD', 'CODE', 'ITALIC', 'STRIKETHROUGH', 'UNDERLINE')
| from __future__ import absolute_import, unicode_literals
# http://stackoverflow.com/a/22723724/1798491
class Enum(object):
def __init__(self, *elements):
self.elements = tuple(elements)
def __getattr__(self, name):
if name not in self.elements:
raise AttributeError("'Enum' has no attribute '{}'".format(name))
return name
# https://github.com/facebook/draft-js/blob/master/src/model/constants/DraftBlockType.js
class BLOCK_TYPES:
UNSTYLED = 'unstyled'
HEADER_ONE = 'header-one'
HEADER_TWO = 'header-two'
HEADER_THREE = 'header-three'
HEADER_FOUR = 'header-four'
HEADER_FIVE = 'header-five'
HEADER_SIX = 'header-six'
UNORDERED_LIST_ITEM = 'unordered-list-item'
ORDERED_LIST_ITEM = 'ordered-list-item'
BLOCKQUOTE = 'blockquote'
PULLQUOTE = 'pullquote'
CODE = 'code-block'
ATOMIC = 'atomic'
ENTITY_TYPES = Enum('LINK', 'IMAGE', 'HORIZONTAL_RULE')
INLINE_STYLES = Enum('BOLD', 'CODE', 'ITALIC', 'STRIKETHROUGH', 'UNDERLINE')
Remove unused pullquote block typefrom __future__ import absolute_import, unicode_literals
# http://stackoverflow.com/a/22723724/1798491
class Enum(object):
def __init__(self, *elements):
self.elements = tuple(elements)
def __getattr__(self, name):
if name not in self.elements:
raise AttributeError("'Enum' has no attribute '{}'".format(name))
return name
# https://github.com/facebook/draft-js/blob/master/src/model/constants/DraftBlockType.js
class BLOCK_TYPES:
UNSTYLED = 'unstyled'
HEADER_ONE = 'header-one'
HEADER_TWO = 'header-two'
HEADER_THREE = 'header-three'
HEADER_FOUR = 'header-four'
HEADER_FIVE = 'header-five'
HEADER_SIX = 'header-six'
UNORDERED_LIST_ITEM = 'unordered-list-item'
ORDERED_LIST_ITEM = 'ordered-list-item'
BLOCKQUOTE = 'blockquote'
CODE = 'code-block'
ATOMIC = 'atomic'
ENTITY_TYPES = Enum('LINK', 'IMAGE', 'HORIZONTAL_RULE')
INLINE_STYLES = Enum('BOLD', 'CODE', 'ITALIC', 'STRIKETHROUGH', 'UNDERLINE')
| <commit_before>from __future__ import absolute_import, unicode_literals
# http://stackoverflow.com/a/22723724/1798491
class Enum(object):
def __init__(self, *elements):
self.elements = tuple(elements)
def __getattr__(self, name):
if name not in self.elements:
raise AttributeError("'Enum' has no attribute '{}'".format(name))
return name
# https://github.com/facebook/draft-js/blob/master/src/model/constants/DraftBlockType.js
class BLOCK_TYPES:
UNSTYLED = 'unstyled'
HEADER_ONE = 'header-one'
HEADER_TWO = 'header-two'
HEADER_THREE = 'header-three'
HEADER_FOUR = 'header-four'
HEADER_FIVE = 'header-five'
HEADER_SIX = 'header-six'
UNORDERED_LIST_ITEM = 'unordered-list-item'
ORDERED_LIST_ITEM = 'ordered-list-item'
BLOCKQUOTE = 'blockquote'
PULLQUOTE = 'pullquote'
CODE = 'code-block'
ATOMIC = 'atomic'
ENTITY_TYPES = Enum('LINK', 'IMAGE', 'HORIZONTAL_RULE')
INLINE_STYLES = Enum('BOLD', 'CODE', 'ITALIC', 'STRIKETHROUGH', 'UNDERLINE')
<commit_msg>Remove unused pullquote block type<commit_after>from __future__ import absolute_import, unicode_literals
# http://stackoverflow.com/a/22723724/1798491
class Enum(object):
def __init__(self, *elements):
self.elements = tuple(elements)
def __getattr__(self, name):
if name not in self.elements:
raise AttributeError("'Enum' has no attribute '{}'".format(name))
return name
# https://github.com/facebook/draft-js/blob/master/src/model/constants/DraftBlockType.js
class BLOCK_TYPES:
UNSTYLED = 'unstyled'
HEADER_ONE = 'header-one'
HEADER_TWO = 'header-two'
HEADER_THREE = 'header-three'
HEADER_FOUR = 'header-four'
HEADER_FIVE = 'header-five'
HEADER_SIX = 'header-six'
UNORDERED_LIST_ITEM = 'unordered-list-item'
ORDERED_LIST_ITEM = 'ordered-list-item'
BLOCKQUOTE = 'blockquote'
CODE = 'code-block'
ATOMIC = 'atomic'
ENTITY_TYPES = Enum('LINK', 'IMAGE', 'HORIZONTAL_RULE')
INLINE_STYLES = Enum('BOLD', 'CODE', 'ITALIC', 'STRIKETHROUGH', 'UNDERLINE')
|
45510b1adc401244297fb281b8f6ecd22f7c4b0e | InvenTree/part/serializers.py | InvenTree/part/serializers.py | from rest_framework import serializers
from .models import Part
class PartSerializer(serializers.ModelSerializer):
""" Serializer for complete detail information of a part.
Used when displaying all details of a single component.
"""
class Meta:
model = Part
fields = [
'url', # Link to the part detail page
'name',
'IPN',
'URL', # Link to an external URL (optional)
'description',
'category',
'category_path',
'total_stock',
'available_stock',
'units',
'trackable',
'buildable',
'trackable',
'salable',
]
| from rest_framework import serializers
from .models import Part
class PartSerializer(serializers.ModelSerializer):
""" Serializer for complete detail information of a part.
Used when displaying all details of a single component.
"""
def _category_name(self, part):
if part.category:
return part.category.name
return ''
def _category_url(self, part):
if part.category:
return part.category.get_absolute_url()
return ''
category_name = serializers.SerializerMethodField('_category_name')
category_url = serializers.SerializerMethodField('_category_url')
class Meta:
model = Part
fields = [
'pk',
'url', # Link to the part detail page
'name',
'IPN',
'URL', # Link to an external URL (optional)
'description',
'category',
'category_name',
'category_url',
'total_stock',
'available_stock',
'units',
'trackable',
'buildable',
'trackable',
'salable',
]
| Add category info to part serializer | Add category info to part serializer
| Python | mit | inventree/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree,SchrodingersGat/InvenTree | from rest_framework import serializers
from .models import Part
class PartSerializer(serializers.ModelSerializer):
""" Serializer for complete detail information of a part.
Used when displaying all details of a single component.
"""
class Meta:
model = Part
fields = [
'url', # Link to the part detail page
'name',
'IPN',
'URL', # Link to an external URL (optional)
'description',
'category',
'category_path',
'total_stock',
'available_stock',
'units',
'trackable',
'buildable',
'trackable',
'salable',
]
Add category info to part serializer | from rest_framework import serializers
from .models import Part
class PartSerializer(serializers.ModelSerializer):
""" Serializer for complete detail information of a part.
Used when displaying all details of a single component.
"""
def _category_name(self, part):
if part.category:
return part.category.name
return ''
def _category_url(self, part):
if part.category:
return part.category.get_absolute_url()
return ''
category_name = serializers.SerializerMethodField('_category_name')
category_url = serializers.SerializerMethodField('_category_url')
class Meta:
model = Part
fields = [
'pk',
'url', # Link to the part detail page
'name',
'IPN',
'URL', # Link to an external URL (optional)
'description',
'category',
'category_name',
'category_url',
'total_stock',
'available_stock',
'units',
'trackable',
'buildable',
'trackable',
'salable',
]
| <commit_before>from rest_framework import serializers
from .models import Part
class PartSerializer(serializers.ModelSerializer):
""" Serializer for complete detail information of a part.
Used when displaying all details of a single component.
"""
class Meta:
model = Part
fields = [
'url', # Link to the part detail page
'name',
'IPN',
'URL', # Link to an external URL (optional)
'description',
'category',
'category_path',
'total_stock',
'available_stock',
'units',
'trackable',
'buildable',
'trackable',
'salable',
]
<commit_msg>Add category info to part serializer<commit_after> | from rest_framework import serializers
from .models import Part
class PartSerializer(serializers.ModelSerializer):
""" Serializer for complete detail information of a part.
Used when displaying all details of a single component.
"""
def _category_name(self, part):
if part.category:
return part.category.name
return ''
def _category_url(self, part):
if part.category:
return part.category.get_absolute_url()
return ''
category_name = serializers.SerializerMethodField('_category_name')
category_url = serializers.SerializerMethodField('_category_url')
class Meta:
model = Part
fields = [
'pk',
'url', # Link to the part detail page
'name',
'IPN',
'URL', # Link to an external URL (optional)
'description',
'category',
'category_name',
'category_url',
'total_stock',
'available_stock',
'units',
'trackable',
'buildable',
'trackable',
'salable',
]
| from rest_framework import serializers
from .models import Part
class PartSerializer(serializers.ModelSerializer):
""" Serializer for complete detail information of a part.
Used when displaying all details of a single component.
"""
class Meta:
model = Part
fields = [
'url', # Link to the part detail page
'name',
'IPN',
'URL', # Link to an external URL (optional)
'description',
'category',
'category_path',
'total_stock',
'available_stock',
'units',
'trackable',
'buildable',
'trackable',
'salable',
]
Add category info to part serializerfrom rest_framework import serializers
from .models import Part
class PartSerializer(serializers.ModelSerializer):
""" Serializer for complete detail information of a part.
Used when displaying all details of a single component.
"""
def _category_name(self, part):
if part.category:
return part.category.name
return ''
def _category_url(self, part):
if part.category:
return part.category.get_absolute_url()
return ''
category_name = serializers.SerializerMethodField('_category_name')
category_url = serializers.SerializerMethodField('_category_url')
class Meta:
model = Part
fields = [
'pk',
'url', # Link to the part detail page
'name',
'IPN',
'URL', # Link to an external URL (optional)
'description',
'category',
'category_name',
'category_url',
'total_stock',
'available_stock',
'units',
'trackable',
'buildable',
'trackable',
'salable',
]
| <commit_before>from rest_framework import serializers
from .models import Part
class PartSerializer(serializers.ModelSerializer):
""" Serializer for complete detail information of a part.
Used when displaying all details of a single component.
"""
class Meta:
model = Part
fields = [
'url', # Link to the part detail page
'name',
'IPN',
'URL', # Link to an external URL (optional)
'description',
'category',
'category_path',
'total_stock',
'available_stock',
'units',
'trackable',
'buildable',
'trackable',
'salable',
]
<commit_msg>Add category info to part serializer<commit_after>from rest_framework import serializers
from .models import Part
class PartSerializer(serializers.ModelSerializer):
""" Serializer for complete detail information of a part.
Used when displaying all details of a single component.
"""
def _category_name(self, part):
if part.category:
return part.category.name
return ''
def _category_url(self, part):
if part.category:
return part.category.get_absolute_url()
return ''
category_name = serializers.SerializerMethodField('_category_name')
category_url = serializers.SerializerMethodField('_category_url')
class Meta:
model = Part
fields = [
'pk',
'url', # Link to the part detail page
'name',
'IPN',
'URL', # Link to an external URL (optional)
'description',
'category',
'category_name',
'category_url',
'total_stock',
'available_stock',
'units',
'trackable',
'buildable',
'trackable',
'salable',
]
|
d99bdbd710c6b3bf0e1eeed5d2cf8f26790040ef | alembic/versions/38f01b0893b8_add_call_in_campaign_id_to_.py | alembic/versions/38f01b0893b8_add_call_in_campaign_id_to_.py | """Add call_in_campaign_id to TwilioPhoneNumber
Revision ID: 38f01b0893b8
Revises: 3c34cfd19bf8
Create Date: 2016-10-21 18:59:13.190060
"""
# revision identifiers, used by Alembic.
revision = '38f01b0893b8'
down_revision = '3c34cfd19bf8'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():
with op.batch_alter_table('campaign_phone') as batch_op:
batch_op.add_column(sa.Column('call_in_campaign_id',
sa.Integer(),
sa.ForeignKey('campaign_campaign.id'),
nullable=True))
def downgrade():
with op.batch_alter_table('campaign_phone') as batch_op:
batch_op.drop_column('call_in_campaign_id')
| """Add call_in_campaign_id to TwilioPhoneNumber
Revision ID: 38f01b0893b8
Revises: 3c34cfd19bf8
Create Date: 2016-10-21 18:59:13.190060
"""
# revision identifiers, used by Alembic.
revision = '38f01b0893b8'
down_revision = '3c34cfd19bf8'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():
with op.batch_alter_table('campaign_phone') as batch_op:
batch_op.add_column(sa.Column('call_in_campaign_id',
sa.Integer(),
sa.ForeignKey('campaign_campaign.id'),
nullable=True))
connection = op.get_bind()
campaign_call_in_numbers = connection.execute(
"""SELECT campaign_phone_numbers.campaign_id, campaign_phone_numbers.phone_id
FROM campaign_phone_numbers
INNER JOIN campaign_phone ON campaign_phone_numbers.phone_id = campaign_phone.id
WHERE campaign_phone.call_in_allowed"""
)
for (campaign_id, phone_id) in campaign_call_in_numbers:
connection.execute("""UPDATE campaign_phone
SET call_in_campaign_id = """+str(campaign_id)+"""
WHERE campaign_phone.id = """+str(phone_id))
def downgrade():
with op.batch_alter_table('campaign_phone') as batch_op:
batch_op.drop_column('call_in_campaign_id')
| Initialize call_in_campaign_id column after adding | Initialize call_in_campaign_id column after adding
| Python | agpl-3.0 | OpenSourceActivismTech/call-power,spacedogXYZ/call-power,spacedogXYZ/call-power,18mr/call-congress,spacedogXYZ/call-power,OpenSourceActivismTech/call-power,spacedogXYZ/call-power,OpenSourceActivismTech/call-power,18mr/call-congress,18mr/call-congress,18mr/call-congress,OpenSourceActivismTech/call-power | """Add call_in_campaign_id to TwilioPhoneNumber
Revision ID: 38f01b0893b8
Revises: 3c34cfd19bf8
Create Date: 2016-10-21 18:59:13.190060
"""
# revision identifiers, used by Alembic.
revision = '38f01b0893b8'
down_revision = '3c34cfd19bf8'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():
with op.batch_alter_table('campaign_phone') as batch_op:
batch_op.add_column(sa.Column('call_in_campaign_id',
sa.Integer(),
sa.ForeignKey('campaign_campaign.id'),
nullable=True))
def downgrade():
with op.batch_alter_table('campaign_phone') as batch_op:
batch_op.drop_column('call_in_campaign_id')
Initialize call_in_campaign_id column after adding | """Add call_in_campaign_id to TwilioPhoneNumber
Revision ID: 38f01b0893b8
Revises: 3c34cfd19bf8
Create Date: 2016-10-21 18:59:13.190060
"""
# revision identifiers, used by Alembic.
revision = '38f01b0893b8'
down_revision = '3c34cfd19bf8'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():
with op.batch_alter_table('campaign_phone') as batch_op:
batch_op.add_column(sa.Column('call_in_campaign_id',
sa.Integer(),
sa.ForeignKey('campaign_campaign.id'),
nullable=True))
connection = op.get_bind()
campaign_call_in_numbers = connection.execute(
"""SELECT campaign_phone_numbers.campaign_id, campaign_phone_numbers.phone_id
FROM campaign_phone_numbers
INNER JOIN campaign_phone ON campaign_phone_numbers.phone_id = campaign_phone.id
WHERE campaign_phone.call_in_allowed"""
)
for (campaign_id, phone_id) in campaign_call_in_numbers:
connection.execute("""UPDATE campaign_phone
SET call_in_campaign_id = """+str(campaign_id)+"""
WHERE campaign_phone.id = """+str(phone_id))
def downgrade():
with op.batch_alter_table('campaign_phone') as batch_op:
batch_op.drop_column('call_in_campaign_id')
| <commit_before>"""Add call_in_campaign_id to TwilioPhoneNumber
Revision ID: 38f01b0893b8
Revises: 3c34cfd19bf8
Create Date: 2016-10-21 18:59:13.190060
"""
# revision identifiers, used by Alembic.
revision = '38f01b0893b8'
down_revision = '3c34cfd19bf8'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():
with op.batch_alter_table('campaign_phone') as batch_op:
batch_op.add_column(sa.Column('call_in_campaign_id',
sa.Integer(),
sa.ForeignKey('campaign_campaign.id'),
nullable=True))
def downgrade():
with op.batch_alter_table('campaign_phone') as batch_op:
batch_op.drop_column('call_in_campaign_id')
<commit_msg>Initialize call_in_campaign_id column after adding<commit_after> | """Add call_in_campaign_id to TwilioPhoneNumber
Revision ID: 38f01b0893b8
Revises: 3c34cfd19bf8
Create Date: 2016-10-21 18:59:13.190060
"""
# revision identifiers, used by Alembic.
revision = '38f01b0893b8'
down_revision = '3c34cfd19bf8'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():
with op.batch_alter_table('campaign_phone') as batch_op:
batch_op.add_column(sa.Column('call_in_campaign_id',
sa.Integer(),
sa.ForeignKey('campaign_campaign.id'),
nullable=True))
connection = op.get_bind()
campaign_call_in_numbers = connection.execute(
"""SELECT campaign_phone_numbers.campaign_id, campaign_phone_numbers.phone_id
FROM campaign_phone_numbers
INNER JOIN campaign_phone ON campaign_phone_numbers.phone_id = campaign_phone.id
WHERE campaign_phone.call_in_allowed"""
)
for (campaign_id, phone_id) in campaign_call_in_numbers:
connection.execute("""UPDATE campaign_phone
SET call_in_campaign_id = """+str(campaign_id)+"""
WHERE campaign_phone.id = """+str(phone_id))
def downgrade():
with op.batch_alter_table('campaign_phone') as batch_op:
batch_op.drop_column('call_in_campaign_id')
| """Add call_in_campaign_id to TwilioPhoneNumber
Revision ID: 38f01b0893b8
Revises: 3c34cfd19bf8
Create Date: 2016-10-21 18:59:13.190060
"""
# revision identifiers, used by Alembic.
revision = '38f01b0893b8'
down_revision = '3c34cfd19bf8'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():
with op.batch_alter_table('campaign_phone') as batch_op:
batch_op.add_column(sa.Column('call_in_campaign_id',
sa.Integer(),
sa.ForeignKey('campaign_campaign.id'),
nullable=True))
def downgrade():
with op.batch_alter_table('campaign_phone') as batch_op:
batch_op.drop_column('call_in_campaign_id')
Initialize call_in_campaign_id column after adding"""Add call_in_campaign_id to TwilioPhoneNumber
Revision ID: 38f01b0893b8
Revises: 3c34cfd19bf8
Create Date: 2016-10-21 18:59:13.190060
"""
# revision identifiers, used by Alembic.
revision = '38f01b0893b8'
down_revision = '3c34cfd19bf8'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():
with op.batch_alter_table('campaign_phone') as batch_op:
batch_op.add_column(sa.Column('call_in_campaign_id',
sa.Integer(),
sa.ForeignKey('campaign_campaign.id'),
nullable=True))
connection = op.get_bind()
campaign_call_in_numbers = connection.execute(
"""SELECT campaign_phone_numbers.campaign_id, campaign_phone_numbers.phone_id
FROM campaign_phone_numbers
INNER JOIN campaign_phone ON campaign_phone_numbers.phone_id = campaign_phone.id
WHERE campaign_phone.call_in_allowed"""
)
for (campaign_id, phone_id) in campaign_call_in_numbers:
connection.execute("""UPDATE campaign_phone
SET call_in_campaign_id = """+str(campaign_id)+"""
WHERE campaign_phone.id = """+str(phone_id))
def downgrade():
with op.batch_alter_table('campaign_phone') as batch_op:
batch_op.drop_column('call_in_campaign_id')
| <commit_before>"""Add call_in_campaign_id to TwilioPhoneNumber
Revision ID: 38f01b0893b8
Revises: 3c34cfd19bf8
Create Date: 2016-10-21 18:59:13.190060
"""
# revision identifiers, used by Alembic.
revision = '38f01b0893b8'
down_revision = '3c34cfd19bf8'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():
with op.batch_alter_table('campaign_phone') as batch_op:
batch_op.add_column(sa.Column('call_in_campaign_id',
sa.Integer(),
sa.ForeignKey('campaign_campaign.id'),
nullable=True))
def downgrade():
with op.batch_alter_table('campaign_phone') as batch_op:
batch_op.drop_column('call_in_campaign_id')
<commit_msg>Initialize call_in_campaign_id column after adding<commit_after>"""Add call_in_campaign_id to TwilioPhoneNumber
Revision ID: 38f01b0893b8
Revises: 3c34cfd19bf8
Create Date: 2016-10-21 18:59:13.190060
"""
# revision identifiers, used by Alembic.
revision = '38f01b0893b8'
down_revision = '3c34cfd19bf8'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():
with op.batch_alter_table('campaign_phone') as batch_op:
batch_op.add_column(sa.Column('call_in_campaign_id',
sa.Integer(),
sa.ForeignKey('campaign_campaign.id'),
nullable=True))
connection = op.get_bind()
campaign_call_in_numbers = connection.execute(
"""SELECT campaign_phone_numbers.campaign_id, campaign_phone_numbers.phone_id
FROM campaign_phone_numbers
INNER JOIN campaign_phone ON campaign_phone_numbers.phone_id = campaign_phone.id
WHERE campaign_phone.call_in_allowed"""
)
for (campaign_id, phone_id) in campaign_call_in_numbers:
connection.execute("""UPDATE campaign_phone
SET call_in_campaign_id = """+str(campaign_id)+"""
WHERE campaign_phone.id = """+str(phone_id))
def downgrade():
with op.batch_alter_table('campaign_phone') as batch_op:
batch_op.drop_column('call_in_campaign_id')
|
4ed8f05fa43f29a1881a23ae99fdc3ad8cd661b0 | grammpy/StringGrammar.py | grammpy/StringGrammar.py | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from .RawGrammar import RawGrammar as Grammar
class StringGrammar(Grammar):
@staticmethod
def __to_string_arr(t):
if isinstance(t, str):
return [t]
return t
def remove_term(self, term=None):
return super().remove_term(StringGrammar.__to_string_arr(term))
def add_term(self, term):
return super().add_term(StringGrammar.__to_string_arr(term))
def term(self, term=None):
return super().term(StringGrammar.__to_string_arr(term))
def get_term(self, term=None):
return super().get_term(StringGrammar.__to_string_arr(term))
def have_term(self, term):
return super().have_term(StringGrammar.__to_string_arr(term))
| #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from .RawGrammar import RawGrammar as Grammar
class StringGrammar(Grammar):
@staticmethod
def __to_string_arr(t):
if isinstance(t, str):
return [t]
return t
def remove_term(self, term=None):
return super().remove_term(StringGrammar.__to_string_arr(term))
def add_term(self, term):
return super().add_term(StringGrammar.__to_string_arr(term))
def term(self, term=None):
return super().term(StringGrammar.__to_string_arr(term))
def get_term(self, term=None):
res = super().get_term(StringGrammar.__to_string_arr(term))
if isinstance(term, str):
return res[0]
return res
def have_term(self, term):
return super().have_term(StringGrammar.__to_string_arr(term))
| Correct return of Terminal instance when parameter is string | Correct return of Terminal instance when parameter is string
| Python | mit | PatrikValkovic/grammpy | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from .RawGrammar import RawGrammar as Grammar
class StringGrammar(Grammar):
@staticmethod
def __to_string_arr(t):
if isinstance(t, str):
return [t]
return t
def remove_term(self, term=None):
return super().remove_term(StringGrammar.__to_string_arr(term))
def add_term(self, term):
return super().add_term(StringGrammar.__to_string_arr(term))
def term(self, term=None):
return super().term(StringGrammar.__to_string_arr(term))
def get_term(self, term=None):
return super().get_term(StringGrammar.__to_string_arr(term))
def have_term(self, term):
return super().have_term(StringGrammar.__to_string_arr(term))
Correct return of Terminal instance when parameter is string | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from .RawGrammar import RawGrammar as Grammar
class StringGrammar(Grammar):
@staticmethod
def __to_string_arr(t):
if isinstance(t, str):
return [t]
return t
def remove_term(self, term=None):
return super().remove_term(StringGrammar.__to_string_arr(term))
def add_term(self, term):
return super().add_term(StringGrammar.__to_string_arr(term))
def term(self, term=None):
return super().term(StringGrammar.__to_string_arr(term))
def get_term(self, term=None):
res = super().get_term(StringGrammar.__to_string_arr(term))
if isinstance(term, str):
return res[0]
return res
def have_term(self, term):
return super().have_term(StringGrammar.__to_string_arr(term))
| <commit_before>#!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from .RawGrammar import RawGrammar as Grammar
class StringGrammar(Grammar):
@staticmethod
def __to_string_arr(t):
if isinstance(t, str):
return [t]
return t
def remove_term(self, term=None):
return super().remove_term(StringGrammar.__to_string_arr(term))
def add_term(self, term):
return super().add_term(StringGrammar.__to_string_arr(term))
def term(self, term=None):
return super().term(StringGrammar.__to_string_arr(term))
def get_term(self, term=None):
return super().get_term(StringGrammar.__to_string_arr(term))
def have_term(self, term):
return super().have_term(StringGrammar.__to_string_arr(term))
<commit_msg>Correct return of Terminal instance when parameter is string<commit_after> | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from .RawGrammar import RawGrammar as Grammar
class StringGrammar(Grammar):
@staticmethod
def __to_string_arr(t):
if isinstance(t, str):
return [t]
return t
def remove_term(self, term=None):
return super().remove_term(StringGrammar.__to_string_arr(term))
def add_term(self, term):
return super().add_term(StringGrammar.__to_string_arr(term))
def term(self, term=None):
return super().term(StringGrammar.__to_string_arr(term))
def get_term(self, term=None):
res = super().get_term(StringGrammar.__to_string_arr(term))
if isinstance(term, str):
return res[0]
return res
def have_term(self, term):
return super().have_term(StringGrammar.__to_string_arr(term))
| #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from .RawGrammar import RawGrammar as Grammar
class StringGrammar(Grammar):
@staticmethod
def __to_string_arr(t):
if isinstance(t, str):
return [t]
return t
def remove_term(self, term=None):
return super().remove_term(StringGrammar.__to_string_arr(term))
def add_term(self, term):
return super().add_term(StringGrammar.__to_string_arr(term))
def term(self, term=None):
return super().term(StringGrammar.__to_string_arr(term))
def get_term(self, term=None):
return super().get_term(StringGrammar.__to_string_arr(term))
def have_term(self, term):
return super().have_term(StringGrammar.__to_string_arr(term))
Correct return of Terminal instance when parameter is string#!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from .RawGrammar import RawGrammar as Grammar
class StringGrammar(Grammar):
@staticmethod
def __to_string_arr(t):
if isinstance(t, str):
return [t]
return t
def remove_term(self, term=None):
return super().remove_term(StringGrammar.__to_string_arr(term))
def add_term(self, term):
return super().add_term(StringGrammar.__to_string_arr(term))
def term(self, term=None):
return super().term(StringGrammar.__to_string_arr(term))
def get_term(self, term=None):
res = super().get_term(StringGrammar.__to_string_arr(term))
if isinstance(term, str):
return res[0]
return res
def have_term(self, term):
return super().have_term(StringGrammar.__to_string_arr(term))
| <commit_before>#!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from .RawGrammar import RawGrammar as Grammar
class StringGrammar(Grammar):
@staticmethod
def __to_string_arr(t):
if isinstance(t, str):
return [t]
return t
def remove_term(self, term=None):
return super().remove_term(StringGrammar.__to_string_arr(term))
def add_term(self, term):
return super().add_term(StringGrammar.__to_string_arr(term))
def term(self, term=None):
return super().term(StringGrammar.__to_string_arr(term))
def get_term(self, term=None):
return super().get_term(StringGrammar.__to_string_arr(term))
def have_term(self, term):
return super().have_term(StringGrammar.__to_string_arr(term))
<commit_msg>Correct return of Terminal instance when parameter is string<commit_after>#!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from .RawGrammar import RawGrammar as Grammar
class StringGrammar(Grammar):
@staticmethod
def __to_string_arr(t):
if isinstance(t, str):
return [t]
return t
def remove_term(self, term=None):
return super().remove_term(StringGrammar.__to_string_arr(term))
def add_term(self, term):
return super().add_term(StringGrammar.__to_string_arr(term))
def term(self, term=None):
return super().term(StringGrammar.__to_string_arr(term))
def get_term(self, term=None):
res = super().get_term(StringGrammar.__to_string_arr(term))
if isinstance(term, str):
return res[0]
return res
def have_term(self, term):
return super().have_term(StringGrammar.__to_string_arr(term))
|
fdd69cb0b7b11fce9cfc70d85e51a29aaabc0ee0 | wagtailmenus/management/commands/autopopulate_main_menus.py | wagtailmenus/management/commands/autopopulate_main_menus.py | # -*- coding: utf-8 -*-
import logging
from django.core.management.base import BaseCommand
from wagtail.wagtailcore.models import Site
from wagtailmenus import app_settings
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = (
"Create a 'main menu' for any 'Site' that doesn't already have one. "
"If main menus for any site do not have menu items, identify the "
"'home' and 'section root' pages for the site, and menu items linking "
"to those to the menu. Assumes 'site.root_page' is the 'home page' "
"and its children are the 'section root' pages")
def add_arguments(self, parser):
parser.add_argument(
'--add-home-links',
action='store_true',
dest='add-home-links',
default=True,
help="Add menu items for 'home' pages",
)
def handle(self, *args, **options):
for site in Site.objects.all():
menu = app_settings.MAIN_MENU_MODEL_CLASS.get_for_site(site)
if not menu.get_menu_items_manager().exists():
menu.add_menu_items_for_pages(
site.root_page.get_descendants(
inclusive=options['add-home-links']
).filter(depth__lte=3)
)
| # -*- coding: utf-8 -*-
import logging
from django.core.management.base import BaseCommand
from wagtail.wagtailcore.models import Site
from wagtailmenus import app_settings
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = (
"Create a 'main menu' for any 'Site' that doesn't already have one. "
"If main menus for any site do not have menu items, identify the "
"'home' and 'section root' pages for the site, and menu items linking "
"to those to the menu. Assumes 'site.root_page' is the 'home page' "
"and its children are the 'section root' pages")
def add_arguments(self, parser):
parser.add_argument(
'--add-home-links',
action='store_true',
dest='add-home-links',
default=True,
help="Add menu items for 'home' pages",
)
def handle(self, *args, **options):
for site in Site.objects.all():
menu = app_settings.MAIN_MENU_MODEL_CLASS.get_for_site(site)
if not menu.get_menu_items_manager().exists():
menu.add_menu_items_for_pages(
site.root_page.get_descendants(
inclusive=options['add-home-links']
).filter(depth__lte=site.root_page.depth + 1)
)
| Use the root_page.depth to determine filter value to identify section root pages | Use the root_page.depth to determine filter value to identify section root pages
| Python | mit | rkhleics/wagtailmenus,ababic/wagtailmenus,rkhleics/wagtailmenus,ababic/wagtailmenus,rkhleics/wagtailmenus,ababic/wagtailmenus | # -*- coding: utf-8 -*-
import logging
from django.core.management.base import BaseCommand
from wagtail.wagtailcore.models import Site
from wagtailmenus import app_settings
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = (
"Create a 'main menu' for any 'Site' that doesn't already have one. "
"If main menus for any site do not have menu items, identify the "
"'home' and 'section root' pages for the site, and menu items linking "
"to those to the menu. Assumes 'site.root_page' is the 'home page' "
"and its children are the 'section root' pages")
def add_arguments(self, parser):
parser.add_argument(
'--add-home-links',
action='store_true',
dest='add-home-links',
default=True,
help="Add menu items for 'home' pages",
)
def handle(self, *args, **options):
for site in Site.objects.all():
menu = app_settings.MAIN_MENU_MODEL_CLASS.get_for_site(site)
if not menu.get_menu_items_manager().exists():
menu.add_menu_items_for_pages(
site.root_page.get_descendants(
inclusive=options['add-home-links']
).filter(depth__lte=3)
)
Use the root_page.depth to determine filter value to identify section root pages | # -*- coding: utf-8 -*-
import logging
from django.core.management.base import BaseCommand
from wagtail.wagtailcore.models import Site
from wagtailmenus import app_settings
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = (
"Create a 'main menu' for any 'Site' that doesn't already have one. "
"If main menus for any site do not have menu items, identify the "
"'home' and 'section root' pages for the site, and menu items linking "
"to those to the menu. Assumes 'site.root_page' is the 'home page' "
"and its children are the 'section root' pages")
def add_arguments(self, parser):
parser.add_argument(
'--add-home-links',
action='store_true',
dest='add-home-links',
default=True,
help="Add menu items for 'home' pages",
)
def handle(self, *args, **options):
for site in Site.objects.all():
menu = app_settings.MAIN_MENU_MODEL_CLASS.get_for_site(site)
if not menu.get_menu_items_manager().exists():
menu.add_menu_items_for_pages(
site.root_page.get_descendants(
inclusive=options['add-home-links']
).filter(depth__lte=site.root_page.depth + 1)
)
| <commit_before># -*- coding: utf-8 -*-
import logging
from django.core.management.base import BaseCommand
from wagtail.wagtailcore.models import Site
from wagtailmenus import app_settings
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = (
"Create a 'main menu' for any 'Site' that doesn't already have one. "
"If main menus for any site do not have menu items, identify the "
"'home' and 'section root' pages for the site, and menu items linking "
"to those to the menu. Assumes 'site.root_page' is the 'home page' "
"and its children are the 'section root' pages")
def add_arguments(self, parser):
parser.add_argument(
'--add-home-links',
action='store_true',
dest='add-home-links',
default=True,
help="Add menu items for 'home' pages",
)
def handle(self, *args, **options):
for site in Site.objects.all():
menu = app_settings.MAIN_MENU_MODEL_CLASS.get_for_site(site)
if not menu.get_menu_items_manager().exists():
menu.add_menu_items_for_pages(
site.root_page.get_descendants(
inclusive=options['add-home-links']
).filter(depth__lte=3)
)
<commit_msg>Use the root_page.depth to determine filter value to identify section root pages<commit_after> | # -*- coding: utf-8 -*-
import logging
from django.core.management.base import BaseCommand
from wagtail.wagtailcore.models import Site
from wagtailmenus import app_settings
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = (
"Create a 'main menu' for any 'Site' that doesn't already have one. "
"If main menus for any site do not have menu items, identify the "
"'home' and 'section root' pages for the site, and menu items linking "
"to those to the menu. Assumes 'site.root_page' is the 'home page' "
"and its children are the 'section root' pages")
def add_arguments(self, parser):
parser.add_argument(
'--add-home-links',
action='store_true',
dest='add-home-links',
default=True,
help="Add menu items for 'home' pages",
)
def handle(self, *args, **options):
for site in Site.objects.all():
menu = app_settings.MAIN_MENU_MODEL_CLASS.get_for_site(site)
if not menu.get_menu_items_manager().exists():
menu.add_menu_items_for_pages(
site.root_page.get_descendants(
inclusive=options['add-home-links']
).filter(depth__lte=site.root_page.depth + 1)
)
| # -*- coding: utf-8 -*-
import logging
from django.core.management.base import BaseCommand
from wagtail.wagtailcore.models import Site
from wagtailmenus import app_settings
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = (
"Create a 'main menu' for any 'Site' that doesn't already have one. "
"If main menus for any site do not have menu items, identify the "
"'home' and 'section root' pages for the site, and menu items linking "
"to those to the menu. Assumes 'site.root_page' is the 'home page' "
"and its children are the 'section root' pages")
def add_arguments(self, parser):
parser.add_argument(
'--add-home-links',
action='store_true',
dest='add-home-links',
default=True,
help="Add menu items for 'home' pages",
)
def handle(self, *args, **options):
for site in Site.objects.all():
menu = app_settings.MAIN_MENU_MODEL_CLASS.get_for_site(site)
if not menu.get_menu_items_manager().exists():
menu.add_menu_items_for_pages(
site.root_page.get_descendants(
inclusive=options['add-home-links']
).filter(depth__lte=3)
)
Use the root_page.depth to determine filter value to identify section root pages# -*- coding: utf-8 -*-
import logging
from django.core.management.base import BaseCommand
from wagtail.wagtailcore.models import Site
from wagtailmenus import app_settings
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = (
"Create a 'main menu' for any 'Site' that doesn't already have one. "
"If main menus for any site do not have menu items, identify the "
"'home' and 'section root' pages for the site, and menu items linking "
"to those to the menu. Assumes 'site.root_page' is the 'home page' "
"and its children are the 'section root' pages")
def add_arguments(self, parser):
parser.add_argument(
'--add-home-links',
action='store_true',
dest='add-home-links',
default=True,
help="Add menu items for 'home' pages",
)
def handle(self, *args, **options):
for site in Site.objects.all():
menu = app_settings.MAIN_MENU_MODEL_CLASS.get_for_site(site)
if not menu.get_menu_items_manager().exists():
menu.add_menu_items_for_pages(
site.root_page.get_descendants(
inclusive=options['add-home-links']
).filter(depth__lte=site.root_page.depth + 1)
)
| <commit_before># -*- coding: utf-8 -*-
import logging
from django.core.management.base import BaseCommand
from wagtail.wagtailcore.models import Site
from wagtailmenus import app_settings
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = (
"Create a 'main menu' for any 'Site' that doesn't already have one. "
"If main menus for any site do not have menu items, identify the "
"'home' and 'section root' pages for the site, and menu items linking "
"to those to the menu. Assumes 'site.root_page' is the 'home page' "
"and its children are the 'section root' pages")
def add_arguments(self, parser):
parser.add_argument(
'--add-home-links',
action='store_true',
dest='add-home-links',
default=True,
help="Add menu items for 'home' pages",
)
def handle(self, *args, **options):
for site in Site.objects.all():
menu = app_settings.MAIN_MENU_MODEL_CLASS.get_for_site(site)
if not menu.get_menu_items_manager().exists():
menu.add_menu_items_for_pages(
site.root_page.get_descendants(
inclusive=options['add-home-links']
).filter(depth__lte=3)
)
<commit_msg>Use the root_page.depth to determine filter value to identify section root pages<commit_after># -*- coding: utf-8 -*-
import logging
from django.core.management.base import BaseCommand
from wagtail.wagtailcore.models import Site
from wagtailmenus import app_settings
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = (
"Create a 'main menu' for any 'Site' that doesn't already have one. "
"If main menus for any site do not have menu items, identify the "
"'home' and 'section root' pages for the site, and menu items linking "
"to those to the menu. Assumes 'site.root_page' is the 'home page' "
"and its children are the 'section root' pages")
def add_arguments(self, parser):
parser.add_argument(
'--add-home-links',
action='store_true',
dest='add-home-links',
default=True,
help="Add menu items for 'home' pages",
)
def handle(self, *args, **options):
for site in Site.objects.all():
menu = app_settings.MAIN_MENU_MODEL_CLASS.get_for_site(site)
if not menu.get_menu_items_manager().exists():
menu.add_menu_items_for_pages(
site.root_page.get_descendants(
inclusive=options['add-home-links']
).filter(depth__lte=site.root_page.depth + 1)
)
|
8b42fff2404794cf9f883f6dffa0fd1e9fa0c7a6 | chrome/test/nacl_test_injection/buildbot_nacl_integration.py | chrome/test/nacl_test_injection/buildbot_nacl_integration.py | #!/usr/bin/python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import subprocess
import sys
def Main():
pwd = os.environ.get('PWD', '')
# TODO(ncbray): figure out why this is failing on windows and enable.
if (sys.platform in ['win32', 'cygwin'] and
'xp-nacl-chrome' not in pwd and 'win64-nacl-chrome' not in pwd): return
# TODO(ncbray): figure out why this is failing on mac and re-enable.
if (sys.platform == 'darwin' and
'mac-nacl-chrome' not in pwd): return
# TODO(ncbray): figure out why this is failing on some linux trybots.
if (sys.platform in ['linux', 'linux2'] and
'hardy64-nacl-chrome' not in pwd): return
script_dir = os.path.dirname(os.path.abspath(__file__))
test_dir = os.path.dirname(script_dir)
chrome_dir = os.path.dirname(test_dir)
src_dir = os.path.dirname(chrome_dir)
nacl_integration_script = os.path.join(
src_dir, 'native_client/build/buildbot_chrome_nacl_stage.py')
cmd = [sys.executable, nacl_integration_script] + sys.argv[1:]
print cmd
subprocess.check_call(cmd)
if __name__ == '__main__':
Main()
| #!/usr/bin/python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import subprocess
import sys
def Main():
pwd = os.environ.get('PWD', '')
# TODO(ncbray): figure out why this is failing on windows and enable.
if sys.platform in ['win32', 'cygwin'] and 'nacl-chrome' not in pwd: return
# TODO(ncbray): figure out why this is failing on mac and re-enable.
if sys.platform == 'darwin' and 'nacl-chrome' not in pwd: return
# TODO(ncbray): figure out why this is failing on some linux trybots.
if sys.platform in ['linux', 'linux2'] and 'nacl-chrome' not in pwd: return
script_dir = os.path.dirname(os.path.abspath(__file__))
test_dir = os.path.dirname(script_dir)
chrome_dir = os.path.dirname(test_dir)
src_dir = os.path.dirname(chrome_dir)
nacl_integration_script = os.path.join(
src_dir, 'native_client/build/buildbot_chrome_nacl_stage.py')
cmd = [sys.executable, nacl_integration_script] + sys.argv[1:]
print cmd
subprocess.check_call(cmd)
if __name__ == '__main__':
Main()
| Whitelist nacl_integration tests to run on new nacl integration bot. | Whitelist nacl_integration tests to run on new nacl integration bot.
BUG= none
TEST= none
Review URL: http://codereview.chromium.org/7050026
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@86021 0039d316-1c4b-4281-b951-d872f2087c98
| Python | bsd-3-clause | mohamed--abdel-maksoud/chromium.src,TheTypoMaster/chromium-crosswalk,anirudhSK/chromium,zcbenz/cefode-chromium,ltilve/chromium,robclark/chromium,M4sse/chromium.src,hgl888/chromium-crosswalk,dushu1203/chromium.src,anirudhSK/chromium,chuan9/chromium-crosswalk,hujiajie/pa-chromium,timopulkkinen/BubbleFish,jaruba/chromium.src,timopulkkinen/BubbleFish,markYoungH/chromium.src,rogerwang/chromium,dushu1203/chromium.src,Chilledheart/chromium,nacl-webkit/chrome_deps,hgl888/chromium-crosswalk,junmin-zhu/chromium-rivertrail,crosswalk-project/chromium-crosswalk-efl,pozdnyakov/chromium-crosswalk,bright-sparks/chromium-spacewalk,patrickm/chromium.src,Pluto-tv/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,ltilve/chromium,mohamed--abdel-maksoud/chromium.src,Chilledheart/chromium,M4sse/chromium.src,krieger-od/nwjs_chromium.src,ChromiumWebApps/chromium,jaruba/chromium.src,ondra-novak/chromium.src,krieger-od/nwjs_chromium.src,hujiajie/pa-chromium,krieger-od/nwjs_chromium.src,Pluto-tv/chromium-crosswalk,pozdnyakov/chromium-crosswalk,anirudhSK/chromium,Just-D/chromium-1,pozdnyakov/chromium-crosswalk,zcbenz/cefode-chromium,keishi/chromium,dednal/chromium.src,hujiajie/pa-chromium,jaruba/chromium.src,timopulkkinen/BubbleFish,pozdnyakov/chromium-crosswalk,ltilve/chromium,ltilve/chromium,M4sse/chromium.src,hujiajie/pa-chromium,bright-sparks/chromium-spacewalk,ChromiumWebApps/chromium,junmin-zhu/chromium-rivertrail,PeterWangIntel/chromium-crosswalk,ChromiumWebApps/chromium,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,fujunwei/chromium-crosswalk,M4sse/chromium.src,hgl888/chromium-crosswalk-efl,ondra-novak/chromium.src,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk-efl,markYoungH/chromium.src,Jonekee/chromium.src,chuan9/chromium-crosswalk,pozdnyakov/chromium-crosswalk,junmin-zhu/chromium-rivertrail,pozdnyakov/chromium-crosswalk,krieger-od/nwjs_chromium.src,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk,keishi/chromium,rogerwang/chromium,hgl888/chromium-crosswalk-efl,robclark/chromium,timopulkkinen/BubbleFish,robclark/chromium,markYoungH/chromium.src,hgl888/chromium-crosswalk,littlstar/chromium.src,keishi/chromium,Fireblend/chromium-crosswalk,dednal/chromium.src,axinging/chromium-crosswalk,bright-sparks/chromium-spacewalk,Jonekee/chromium.src,axinging/chromium-crosswalk,hgl888/chromium-crosswalk-efl,littlstar/chromium.src,bright-sparks/chromium-spacewalk,PeterWangIntel/chromium-crosswalk,M4sse/chromium.src,ChromiumWebApps/chromium,TheTypoMaster/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,zcbenz/cefode-chromium,crosswalk-project/chromium-crosswalk-efl,dednal/chromium.src,PeterWangIntel/chromium-crosswalk,ltilve/chromium,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk-efl,hujiajie/pa-chromium,PeterWangIntel/chromium-crosswalk,keishi/chromium,Chilledheart/chromium,axinging/chromium-crosswalk,junmin-zhu/chromium-rivertrail,crosswalk-project/chromium-crosswalk-efl,Just-D/chromium-1,TheTypoMaster/chromium-crosswalk,junmin-zhu/chromium-rivertrail,ondra-novak/chromium.src,mogoweb/chromium-crosswalk,bright-sparks/chromium-spacewalk,mohamed--abdel-maksoud/chromium.src,markYoungH/chromium.src,robclark/chromium,M4sse/chromium.src,anirudhSK/chromium,krieger-od/nwjs_chromium.src,robclark/chromium,nacl-webkit/chrome_deps,markYoungH/chromium.src,nacl-webkit/chrome_deps,markYoungH/chromium.src,anirudhSK/chromium,dushu1203/chromium.src,jaruba/chromium.src,timopulkkinen/BubbleFish,anirudhSK/chromium,bright-sparks/chromium-spacewalk,anirudhSK/chromium,robclark/chromium,jaruba/chromium.src,zcbenz/cefode-chromium,M4sse/chromium.src,Just-D/chromium-1,dushu1203/chromium.src,zcbenz/cefode-chromium,krieger-od/nwjs_chromium.src,fujunwei/chromium-crosswalk,Jonekee/chromium.src,dushu1203/chromium.src,Chilledheart/chromium,hujiajie/pa-chromium,PeterWangIntel/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,M4sse/chromium.src,littlstar/chromium.src,mogoweb/chromium-crosswalk,timopulkkinen/BubbleFish,zcbenz/cefode-chromium,littlstar/chromium.src,patrickm/chromium.src,crosswalk-project/chromium-crosswalk-efl,hgl888/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,zcbenz/cefode-chromium,littlstar/chromium.src,timopulkkinen/BubbleFish,fujunwei/chromium-crosswalk,Jonekee/chromium.src,junmin-zhu/chromium-rivertrail,chuan9/chromium-crosswalk,anirudhSK/chromium,keishi/chromium,junmin-zhu/chromium-rivertrail,keishi/chromium,dushu1203/chromium.src,patrickm/chromium.src,ondra-novak/chromium.src,rogerwang/chromium,anirudhSK/chromium,ChromiumWebApps/chromium,axinging/chromium-crosswalk,hgl888/chromium-crosswalk-efl,zcbenz/cefode-chromium,TheTypoMaster/chromium-crosswalk,Chilledheart/chromium,Just-D/chromium-1,axinging/chromium-crosswalk,mogoweb/chromium-crosswalk,robclark/chromium,mogoweb/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,timopulkkinen/BubbleFish,keishi/chromium,chuan9/chromium-crosswalk,ChromiumWebApps/chromium,patrickm/chromium.src,mohamed--abdel-maksoud/chromium.src,mohamed--abdel-maksoud/chromium.src,nacl-webkit/chrome_deps,PeterWangIntel/chromium-crosswalk,fujunwei/chromium-crosswalk,hujiajie/pa-chromium,mogoweb/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,jaruba/chromium.src,Just-D/chromium-1,ChromiumWebApps/chromium,nacl-webkit/chrome_deps,mogoweb/chromium-crosswalk,littlstar/chromium.src,markYoungH/chromium.src,Pluto-tv/chromium-crosswalk,patrickm/chromium.src,Just-D/chromium-1,ChromiumWebApps/chromium,M4sse/chromium.src,PeterWangIntel/chromium-crosswalk,pozdnyakov/chromium-crosswalk,rogerwang/chromium,ChromiumWebApps/chromium,PeterWangIntel/chromium-crosswalk,chuan9/chromium-crosswalk,markYoungH/chromium.src,dednal/chromium.src,dednal/chromium.src,Just-D/chromium-1,bright-sparks/chromium-spacewalk,rogerwang/chromium,hujiajie/pa-chromium,robclark/chromium,dushu1203/chromium.src,Pluto-tv/chromium-crosswalk,hujiajie/pa-chromium,Jonekee/chromium.src,crosswalk-project/chromium-crosswalk-efl,hgl888/chromium-crosswalk,fujunwei/chromium-crosswalk,Chilledheart/chromium,patrickm/chromium.src,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,krieger-od/nwjs_chromium.src,Jonekee/chromium.src,chuan9/chromium-crosswalk,Fireblend/chromium-crosswalk,rogerwang/chromium,zcbenz/cefode-chromium,Just-D/chromium-1,nacl-webkit/chrome_deps,markYoungH/chromium.src,crosswalk-project/chromium-crosswalk-efl,dednal/chromium.src,krieger-od/nwjs_chromium.src,hgl888/chromium-crosswalk-efl,Chilledheart/chromium,junmin-zhu/chromium-rivertrail,rogerwang/chromium,fujunwei/chromium-crosswalk,pozdnyakov/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,axinging/chromium-crosswalk,ltilve/chromium,mogoweb/chromium-crosswalk,chuan9/chromium-crosswalk,Fireblend/chromium-crosswalk,markYoungH/chromium.src,mogoweb/chromium-crosswalk,keishi/chromium,dednal/chromium.src,mogoweb/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,ChromiumWebApps/chromium,timopulkkinen/BubbleFish,dednal/chromium.src,littlstar/chromium.src,rogerwang/chromium,Fireblend/chromium-crosswalk,pozdnyakov/chromium-crosswalk,chuan9/chromium-crosswalk,markYoungH/chromium.src,M4sse/chromium.src,M4sse/chromium.src,Jonekee/chromium.src,dednal/chromium.src,Fireblend/chromium-crosswalk,hujiajie/pa-chromium,jaruba/chromium.src,zcbenz/cefode-chromium,axinging/chromium-crosswalk,jaruba/chromium.src,ltilve/chromium,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,timopulkkinen/BubbleFish,ondra-novak/chromium.src,ltilve/chromium,keishi/chromium,rogerwang/chromium,chuan9/chromium-crosswalk,Chilledheart/chromium,ondra-novak/chromium.src,Jonekee/chromium.src,axinging/chromium-crosswalk,Pluto-tv/chromium-crosswalk,junmin-zhu/chromium-rivertrail,ChromiumWebApps/chromium,Jonekee/chromium.src,junmin-zhu/chromium-rivertrail,jaruba/chromium.src,ondra-novak/chromium.src,dushu1203/chromium.src,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk,axinging/chromium-crosswalk,bright-sparks/chromium-spacewalk,patrickm/chromium.src,dushu1203/chromium.src,hgl888/chromium-crosswalk,pozdnyakov/chromium-crosswalk,Chilledheart/chromium,keishi/chromium,patrickm/chromium.src,PeterWangIntel/chromium-crosswalk,junmin-zhu/chromium-rivertrail,nacl-webkit/chrome_deps,krieger-od/nwjs_chromium.src,fujunwei/chromium-crosswalk,rogerwang/chromium,keishi/chromium,jaruba/chromium.src,krieger-od/nwjs_chromium.src,hujiajie/pa-chromium,crosswalk-project/chromium-crosswalk-efl,dednal/chromium.src,dednal/chromium.src,nacl-webkit/chrome_deps,anirudhSK/chromium,anirudhSK/chromium,ltilve/chromium,hgl888/chromium-crosswalk-efl,fujunwei/chromium-crosswalk,axinging/chromium-crosswalk,hgl888/chromium-crosswalk,ondra-novak/chromium.src,fujunwei/chromium-crosswalk,timopulkkinen/BubbleFish,Pluto-tv/chromium-crosswalk,nacl-webkit/chrome_deps,littlstar/chromium.src,mohamed--abdel-maksoud/chromium.src,ChromiumWebApps/chromium,Just-D/chromium-1,zcbenz/cefode-chromium,nacl-webkit/chrome_deps,robclark/chromium,krieger-od/nwjs_chromium.src,ondra-novak/chromium.src,Jonekee/chromium.src,Jonekee/chromium.src,robclark/chromium,jaruba/chromium.src,dushu1203/chromium.src,patrickm/chromium.src,pozdnyakov/chromium-crosswalk,nacl-webkit/chrome_deps,anirudhSK/chromium,dushu1203/chromium.src,Fireblend/chromium-crosswalk,Pluto-tv/chromium-crosswalk | #!/usr/bin/python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import subprocess
import sys
def Main():
pwd = os.environ.get('PWD', '')
# TODO(ncbray): figure out why this is failing on windows and enable.
if (sys.platform in ['win32', 'cygwin'] and
'xp-nacl-chrome' not in pwd and 'win64-nacl-chrome' not in pwd): return
# TODO(ncbray): figure out why this is failing on mac and re-enable.
if (sys.platform == 'darwin' and
'mac-nacl-chrome' not in pwd): return
# TODO(ncbray): figure out why this is failing on some linux trybots.
if (sys.platform in ['linux', 'linux2'] and
'hardy64-nacl-chrome' not in pwd): return
script_dir = os.path.dirname(os.path.abspath(__file__))
test_dir = os.path.dirname(script_dir)
chrome_dir = os.path.dirname(test_dir)
src_dir = os.path.dirname(chrome_dir)
nacl_integration_script = os.path.join(
src_dir, 'native_client/build/buildbot_chrome_nacl_stage.py')
cmd = [sys.executable, nacl_integration_script] + sys.argv[1:]
print cmd
subprocess.check_call(cmd)
if __name__ == '__main__':
Main()
Whitelist nacl_integration tests to run on new nacl integration bot.
BUG= none
TEST= none
Review URL: http://codereview.chromium.org/7050026
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@86021 0039d316-1c4b-4281-b951-d872f2087c98 | #!/usr/bin/python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import subprocess
import sys
def Main():
pwd = os.environ.get('PWD', '')
# TODO(ncbray): figure out why this is failing on windows and enable.
if sys.platform in ['win32', 'cygwin'] and 'nacl-chrome' not in pwd: return
# TODO(ncbray): figure out why this is failing on mac and re-enable.
if sys.platform == 'darwin' and 'nacl-chrome' not in pwd: return
# TODO(ncbray): figure out why this is failing on some linux trybots.
if sys.platform in ['linux', 'linux2'] and 'nacl-chrome' not in pwd: return
script_dir = os.path.dirname(os.path.abspath(__file__))
test_dir = os.path.dirname(script_dir)
chrome_dir = os.path.dirname(test_dir)
src_dir = os.path.dirname(chrome_dir)
nacl_integration_script = os.path.join(
src_dir, 'native_client/build/buildbot_chrome_nacl_stage.py')
cmd = [sys.executable, nacl_integration_script] + sys.argv[1:]
print cmd
subprocess.check_call(cmd)
if __name__ == '__main__':
Main()
| <commit_before>#!/usr/bin/python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import subprocess
import sys
def Main():
pwd = os.environ.get('PWD', '')
# TODO(ncbray): figure out why this is failing on windows and enable.
if (sys.platform in ['win32', 'cygwin'] and
'xp-nacl-chrome' not in pwd and 'win64-nacl-chrome' not in pwd): return
# TODO(ncbray): figure out why this is failing on mac and re-enable.
if (sys.platform == 'darwin' and
'mac-nacl-chrome' not in pwd): return
# TODO(ncbray): figure out why this is failing on some linux trybots.
if (sys.platform in ['linux', 'linux2'] and
'hardy64-nacl-chrome' not in pwd): return
script_dir = os.path.dirname(os.path.abspath(__file__))
test_dir = os.path.dirname(script_dir)
chrome_dir = os.path.dirname(test_dir)
src_dir = os.path.dirname(chrome_dir)
nacl_integration_script = os.path.join(
src_dir, 'native_client/build/buildbot_chrome_nacl_stage.py')
cmd = [sys.executable, nacl_integration_script] + sys.argv[1:]
print cmd
subprocess.check_call(cmd)
if __name__ == '__main__':
Main()
<commit_msg>Whitelist nacl_integration tests to run on new nacl integration bot.
BUG= none
TEST= none
Review URL: http://codereview.chromium.org/7050026
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@86021 0039d316-1c4b-4281-b951-d872f2087c98<commit_after> | #!/usr/bin/python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import subprocess
import sys
def Main():
pwd = os.environ.get('PWD', '')
# TODO(ncbray): figure out why this is failing on windows and enable.
if sys.platform in ['win32', 'cygwin'] and 'nacl-chrome' not in pwd: return
# TODO(ncbray): figure out why this is failing on mac and re-enable.
if sys.platform == 'darwin' and 'nacl-chrome' not in pwd: return
# TODO(ncbray): figure out why this is failing on some linux trybots.
if sys.platform in ['linux', 'linux2'] and 'nacl-chrome' not in pwd: return
script_dir = os.path.dirname(os.path.abspath(__file__))
test_dir = os.path.dirname(script_dir)
chrome_dir = os.path.dirname(test_dir)
src_dir = os.path.dirname(chrome_dir)
nacl_integration_script = os.path.join(
src_dir, 'native_client/build/buildbot_chrome_nacl_stage.py')
cmd = [sys.executable, nacl_integration_script] + sys.argv[1:]
print cmd
subprocess.check_call(cmd)
if __name__ == '__main__':
Main()
| #!/usr/bin/python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import subprocess
import sys
def Main():
pwd = os.environ.get('PWD', '')
# TODO(ncbray): figure out why this is failing on windows and enable.
if (sys.platform in ['win32', 'cygwin'] and
'xp-nacl-chrome' not in pwd and 'win64-nacl-chrome' not in pwd): return
# TODO(ncbray): figure out why this is failing on mac and re-enable.
if (sys.platform == 'darwin' and
'mac-nacl-chrome' not in pwd): return
# TODO(ncbray): figure out why this is failing on some linux trybots.
if (sys.platform in ['linux', 'linux2'] and
'hardy64-nacl-chrome' not in pwd): return
script_dir = os.path.dirname(os.path.abspath(__file__))
test_dir = os.path.dirname(script_dir)
chrome_dir = os.path.dirname(test_dir)
src_dir = os.path.dirname(chrome_dir)
nacl_integration_script = os.path.join(
src_dir, 'native_client/build/buildbot_chrome_nacl_stage.py')
cmd = [sys.executable, nacl_integration_script] + sys.argv[1:]
print cmd
subprocess.check_call(cmd)
if __name__ == '__main__':
Main()
Whitelist nacl_integration tests to run on new nacl integration bot.
BUG= none
TEST= none
Review URL: http://codereview.chromium.org/7050026
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@86021 0039d316-1c4b-4281-b951-d872f2087c98#!/usr/bin/python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import subprocess
import sys
def Main():
pwd = os.environ.get('PWD', '')
# TODO(ncbray): figure out why this is failing on windows and enable.
if sys.platform in ['win32', 'cygwin'] and 'nacl-chrome' not in pwd: return
# TODO(ncbray): figure out why this is failing on mac and re-enable.
if sys.platform == 'darwin' and 'nacl-chrome' not in pwd: return
# TODO(ncbray): figure out why this is failing on some linux trybots.
if sys.platform in ['linux', 'linux2'] and 'nacl-chrome' not in pwd: return
script_dir = os.path.dirname(os.path.abspath(__file__))
test_dir = os.path.dirname(script_dir)
chrome_dir = os.path.dirname(test_dir)
src_dir = os.path.dirname(chrome_dir)
nacl_integration_script = os.path.join(
src_dir, 'native_client/build/buildbot_chrome_nacl_stage.py')
cmd = [sys.executable, nacl_integration_script] + sys.argv[1:]
print cmd
subprocess.check_call(cmd)
if __name__ == '__main__':
Main()
| <commit_before>#!/usr/bin/python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import subprocess
import sys
def Main():
pwd = os.environ.get('PWD', '')
# TODO(ncbray): figure out why this is failing on windows and enable.
if (sys.platform in ['win32', 'cygwin'] and
'xp-nacl-chrome' not in pwd and 'win64-nacl-chrome' not in pwd): return
# TODO(ncbray): figure out why this is failing on mac and re-enable.
if (sys.platform == 'darwin' and
'mac-nacl-chrome' not in pwd): return
# TODO(ncbray): figure out why this is failing on some linux trybots.
if (sys.platform in ['linux', 'linux2'] and
'hardy64-nacl-chrome' not in pwd): return
script_dir = os.path.dirname(os.path.abspath(__file__))
test_dir = os.path.dirname(script_dir)
chrome_dir = os.path.dirname(test_dir)
src_dir = os.path.dirname(chrome_dir)
nacl_integration_script = os.path.join(
src_dir, 'native_client/build/buildbot_chrome_nacl_stage.py')
cmd = [sys.executable, nacl_integration_script] + sys.argv[1:]
print cmd
subprocess.check_call(cmd)
if __name__ == '__main__':
Main()
<commit_msg>Whitelist nacl_integration tests to run on new nacl integration bot.
BUG= none
TEST= none
Review URL: http://codereview.chromium.org/7050026
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@86021 0039d316-1c4b-4281-b951-d872f2087c98<commit_after>#!/usr/bin/python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import subprocess
import sys
def Main():
pwd = os.environ.get('PWD', '')
# TODO(ncbray): figure out why this is failing on windows and enable.
if sys.platform in ['win32', 'cygwin'] and 'nacl-chrome' not in pwd: return
# TODO(ncbray): figure out why this is failing on mac and re-enable.
if sys.platform == 'darwin' and 'nacl-chrome' not in pwd: return
# TODO(ncbray): figure out why this is failing on some linux trybots.
if sys.platform in ['linux', 'linux2'] and 'nacl-chrome' not in pwd: return
script_dir = os.path.dirname(os.path.abspath(__file__))
test_dir = os.path.dirname(script_dir)
chrome_dir = os.path.dirname(test_dir)
src_dir = os.path.dirname(chrome_dir)
nacl_integration_script = os.path.join(
src_dir, 'native_client/build/buildbot_chrome_nacl_stage.py')
cmd = [sys.executable, nacl_integration_script] + sys.argv[1:]
print cmd
subprocess.check_call(cmd)
if __name__ == '__main__':
Main()
|
eadf9bf6ce1bf09c6551f4a54a0a32d6fb872ab3 | gaphor/ui/tests/test_recentfiles.py | gaphor/ui/tests/test_recentfiles.py | import pytest
from gi.repository import GLib
from gaphor.services.eventmanager import EventManager
from gaphor.ui.event import FileLoaded
from gaphor.ui.recentfiles import RecentFiles
class RecentManagerStub:
def __init__(self):
self.items = []
def add_full(self, uri, meta):
self.items.append(uri)
@pytest.fixture
def event_manager():
return EventManager()
def test_add_new_recent_file(event_manager):
recent_manager = RecentManagerStub()
RecentFiles(event_manager, recent_manager)
event_manager.handle(FileLoaded(None, "testfile.gaphor"))
assert len(recent_manager.items) == 1
assert recent_manager.items[0].startswith("file:///"), recent_manager.items[0]
def test_uri_conversion_with_spaces():
filename = "/path name/with spaces"
uri = GLib.filename_to_uri(filename)
decoded_filename, hostname = GLib.filename_from_uri(uri)
assert uri == "file:///path%20name/with%20spaces"
assert decoded_filename == filename
assert hostname is None
def test_decode_not_encoded_uri():
filename = "/path name/with spaces"
uri = f"file://{filename}"
decoded_filename, hostname = GLib.filename_from_uri(uri)
assert decoded_filename == filename
assert hostname is None
| import pathlib
import pytest
from gi.repository import GLib
from gaphor.services.eventmanager import EventManager
from gaphor.ui.event import FileLoaded
from gaphor.ui.recentfiles import RecentFiles
class RecentManagerStub:
def __init__(self):
self.items = []
def add_full(self, uri, meta):
self.items.append(uri)
@pytest.fixture
def event_manager():
return EventManager()
def test_add_new_recent_file(event_manager):
recent_manager = RecentManagerStub()
RecentFiles(event_manager, recent_manager)
event_manager.handle(FileLoaded(None, "testfile.gaphor"))
assert len(recent_manager.items) == 1
assert recent_manager.items[0].startswith("file:///"), recent_manager.items[0]
def test_uri_conversion_with_spaces():
filename = "/path name/with spaces"
uri = GLib.filename_to_uri(filename)
decoded_filename, hostname = GLib.filename_from_uri(uri)
decoded_posix_filename = pathlib.PurePath(decoded_filename).as_posix()
assert uri == "file:///path%20name/with%20spaces"
assert decoded_posix_filename == filename
assert hostname is None
def test_decode_not_encoded_uri():
filename = "/path name/with spaces"
uri = f"file://{filename}"
decoded_filename, hostname = GLib.filename_from_uri(uri)
decoded_posix_filename = pathlib.PurePath(decoded_filename).as_posix()
assert decoded_posix_filename == filename
assert hostname is None
| Fix tests in Windows: decoded_filename contains backslashes | Fix tests in Windows: decoded_filename contains backslashes
Signed-off-by: Dan Yeaw <2591e5f46f28d303f9dc027d475a5c60d8dea17a@yeaw.me>
| Python | lgpl-2.1 | amolenaar/gaphor,amolenaar/gaphor | import pytest
from gi.repository import GLib
from gaphor.services.eventmanager import EventManager
from gaphor.ui.event import FileLoaded
from gaphor.ui.recentfiles import RecentFiles
class RecentManagerStub:
def __init__(self):
self.items = []
def add_full(self, uri, meta):
self.items.append(uri)
@pytest.fixture
def event_manager():
return EventManager()
def test_add_new_recent_file(event_manager):
recent_manager = RecentManagerStub()
RecentFiles(event_manager, recent_manager)
event_manager.handle(FileLoaded(None, "testfile.gaphor"))
assert len(recent_manager.items) == 1
assert recent_manager.items[0].startswith("file:///"), recent_manager.items[0]
def test_uri_conversion_with_spaces():
filename = "/path name/with spaces"
uri = GLib.filename_to_uri(filename)
decoded_filename, hostname = GLib.filename_from_uri(uri)
assert uri == "file:///path%20name/with%20spaces"
assert decoded_filename == filename
assert hostname is None
def test_decode_not_encoded_uri():
filename = "/path name/with spaces"
uri = f"file://{filename}"
decoded_filename, hostname = GLib.filename_from_uri(uri)
assert decoded_filename == filename
assert hostname is None
Fix tests in Windows: decoded_filename contains backslashes
Signed-off-by: Dan Yeaw <2591e5f46f28d303f9dc027d475a5c60d8dea17a@yeaw.me> | import pathlib
import pytest
from gi.repository import GLib
from gaphor.services.eventmanager import EventManager
from gaphor.ui.event import FileLoaded
from gaphor.ui.recentfiles import RecentFiles
class RecentManagerStub:
def __init__(self):
self.items = []
def add_full(self, uri, meta):
self.items.append(uri)
@pytest.fixture
def event_manager():
return EventManager()
def test_add_new_recent_file(event_manager):
recent_manager = RecentManagerStub()
RecentFiles(event_manager, recent_manager)
event_manager.handle(FileLoaded(None, "testfile.gaphor"))
assert len(recent_manager.items) == 1
assert recent_manager.items[0].startswith("file:///"), recent_manager.items[0]
def test_uri_conversion_with_spaces():
filename = "/path name/with spaces"
uri = GLib.filename_to_uri(filename)
decoded_filename, hostname = GLib.filename_from_uri(uri)
decoded_posix_filename = pathlib.PurePath(decoded_filename).as_posix()
assert uri == "file:///path%20name/with%20spaces"
assert decoded_posix_filename == filename
assert hostname is None
def test_decode_not_encoded_uri():
filename = "/path name/with spaces"
uri = f"file://{filename}"
decoded_filename, hostname = GLib.filename_from_uri(uri)
decoded_posix_filename = pathlib.PurePath(decoded_filename).as_posix()
assert decoded_posix_filename == filename
assert hostname is None
| <commit_before>import pytest
from gi.repository import GLib
from gaphor.services.eventmanager import EventManager
from gaphor.ui.event import FileLoaded
from gaphor.ui.recentfiles import RecentFiles
class RecentManagerStub:
def __init__(self):
self.items = []
def add_full(self, uri, meta):
self.items.append(uri)
@pytest.fixture
def event_manager():
return EventManager()
def test_add_new_recent_file(event_manager):
recent_manager = RecentManagerStub()
RecentFiles(event_manager, recent_manager)
event_manager.handle(FileLoaded(None, "testfile.gaphor"))
assert len(recent_manager.items) == 1
assert recent_manager.items[0].startswith("file:///"), recent_manager.items[0]
def test_uri_conversion_with_spaces():
filename = "/path name/with spaces"
uri = GLib.filename_to_uri(filename)
decoded_filename, hostname = GLib.filename_from_uri(uri)
assert uri == "file:///path%20name/with%20spaces"
assert decoded_filename == filename
assert hostname is None
def test_decode_not_encoded_uri():
filename = "/path name/with spaces"
uri = f"file://{filename}"
decoded_filename, hostname = GLib.filename_from_uri(uri)
assert decoded_filename == filename
assert hostname is None
<commit_msg>Fix tests in Windows: decoded_filename contains backslashes
Signed-off-by: Dan Yeaw <2591e5f46f28d303f9dc027d475a5c60d8dea17a@yeaw.me><commit_after> | import pathlib
import pytest
from gi.repository import GLib
from gaphor.services.eventmanager import EventManager
from gaphor.ui.event import FileLoaded
from gaphor.ui.recentfiles import RecentFiles
class RecentManagerStub:
def __init__(self):
self.items = []
def add_full(self, uri, meta):
self.items.append(uri)
@pytest.fixture
def event_manager():
return EventManager()
def test_add_new_recent_file(event_manager):
recent_manager = RecentManagerStub()
RecentFiles(event_manager, recent_manager)
event_manager.handle(FileLoaded(None, "testfile.gaphor"))
assert len(recent_manager.items) == 1
assert recent_manager.items[0].startswith("file:///"), recent_manager.items[0]
def test_uri_conversion_with_spaces():
filename = "/path name/with spaces"
uri = GLib.filename_to_uri(filename)
decoded_filename, hostname = GLib.filename_from_uri(uri)
decoded_posix_filename = pathlib.PurePath(decoded_filename).as_posix()
assert uri == "file:///path%20name/with%20spaces"
assert decoded_posix_filename == filename
assert hostname is None
def test_decode_not_encoded_uri():
filename = "/path name/with spaces"
uri = f"file://{filename}"
decoded_filename, hostname = GLib.filename_from_uri(uri)
decoded_posix_filename = pathlib.PurePath(decoded_filename).as_posix()
assert decoded_posix_filename == filename
assert hostname is None
| import pytest
from gi.repository import GLib
from gaphor.services.eventmanager import EventManager
from gaphor.ui.event import FileLoaded
from gaphor.ui.recentfiles import RecentFiles
class RecentManagerStub:
def __init__(self):
self.items = []
def add_full(self, uri, meta):
self.items.append(uri)
@pytest.fixture
def event_manager():
return EventManager()
def test_add_new_recent_file(event_manager):
recent_manager = RecentManagerStub()
RecentFiles(event_manager, recent_manager)
event_manager.handle(FileLoaded(None, "testfile.gaphor"))
assert len(recent_manager.items) == 1
assert recent_manager.items[0].startswith("file:///"), recent_manager.items[0]
def test_uri_conversion_with_spaces():
filename = "/path name/with spaces"
uri = GLib.filename_to_uri(filename)
decoded_filename, hostname = GLib.filename_from_uri(uri)
assert uri == "file:///path%20name/with%20spaces"
assert decoded_filename == filename
assert hostname is None
def test_decode_not_encoded_uri():
filename = "/path name/with spaces"
uri = f"file://{filename}"
decoded_filename, hostname = GLib.filename_from_uri(uri)
assert decoded_filename == filename
assert hostname is None
Fix tests in Windows: decoded_filename contains backslashes
Signed-off-by: Dan Yeaw <2591e5f46f28d303f9dc027d475a5c60d8dea17a@yeaw.me>import pathlib
import pytest
from gi.repository import GLib
from gaphor.services.eventmanager import EventManager
from gaphor.ui.event import FileLoaded
from gaphor.ui.recentfiles import RecentFiles
class RecentManagerStub:
def __init__(self):
self.items = []
def add_full(self, uri, meta):
self.items.append(uri)
@pytest.fixture
def event_manager():
return EventManager()
def test_add_new_recent_file(event_manager):
recent_manager = RecentManagerStub()
RecentFiles(event_manager, recent_manager)
event_manager.handle(FileLoaded(None, "testfile.gaphor"))
assert len(recent_manager.items) == 1
assert recent_manager.items[0].startswith("file:///"), recent_manager.items[0]
def test_uri_conversion_with_spaces():
filename = "/path name/with spaces"
uri = GLib.filename_to_uri(filename)
decoded_filename, hostname = GLib.filename_from_uri(uri)
decoded_posix_filename = pathlib.PurePath(decoded_filename).as_posix()
assert uri == "file:///path%20name/with%20spaces"
assert decoded_posix_filename == filename
assert hostname is None
def test_decode_not_encoded_uri():
filename = "/path name/with spaces"
uri = f"file://{filename}"
decoded_filename, hostname = GLib.filename_from_uri(uri)
decoded_posix_filename = pathlib.PurePath(decoded_filename).as_posix()
assert decoded_posix_filename == filename
assert hostname is None
| <commit_before>import pytest
from gi.repository import GLib
from gaphor.services.eventmanager import EventManager
from gaphor.ui.event import FileLoaded
from gaphor.ui.recentfiles import RecentFiles
class RecentManagerStub:
def __init__(self):
self.items = []
def add_full(self, uri, meta):
self.items.append(uri)
@pytest.fixture
def event_manager():
return EventManager()
def test_add_new_recent_file(event_manager):
recent_manager = RecentManagerStub()
RecentFiles(event_manager, recent_manager)
event_manager.handle(FileLoaded(None, "testfile.gaphor"))
assert len(recent_manager.items) == 1
assert recent_manager.items[0].startswith("file:///"), recent_manager.items[0]
def test_uri_conversion_with_spaces():
filename = "/path name/with spaces"
uri = GLib.filename_to_uri(filename)
decoded_filename, hostname = GLib.filename_from_uri(uri)
assert uri == "file:///path%20name/with%20spaces"
assert decoded_filename == filename
assert hostname is None
def test_decode_not_encoded_uri():
filename = "/path name/with spaces"
uri = f"file://{filename}"
decoded_filename, hostname = GLib.filename_from_uri(uri)
assert decoded_filename == filename
assert hostname is None
<commit_msg>Fix tests in Windows: decoded_filename contains backslashes
Signed-off-by: Dan Yeaw <2591e5f46f28d303f9dc027d475a5c60d8dea17a@yeaw.me><commit_after>import pathlib
import pytest
from gi.repository import GLib
from gaphor.services.eventmanager import EventManager
from gaphor.ui.event import FileLoaded
from gaphor.ui.recentfiles import RecentFiles
class RecentManagerStub:
def __init__(self):
self.items = []
def add_full(self, uri, meta):
self.items.append(uri)
@pytest.fixture
def event_manager():
return EventManager()
def test_add_new_recent_file(event_manager):
recent_manager = RecentManagerStub()
RecentFiles(event_manager, recent_manager)
event_manager.handle(FileLoaded(None, "testfile.gaphor"))
assert len(recent_manager.items) == 1
assert recent_manager.items[0].startswith("file:///"), recent_manager.items[0]
def test_uri_conversion_with_spaces():
filename = "/path name/with spaces"
uri = GLib.filename_to_uri(filename)
decoded_filename, hostname = GLib.filename_from_uri(uri)
decoded_posix_filename = pathlib.PurePath(decoded_filename).as_posix()
assert uri == "file:///path%20name/with%20spaces"
assert decoded_posix_filename == filename
assert hostname is None
def test_decode_not_encoded_uri():
filename = "/path name/with spaces"
uri = f"file://{filename}"
decoded_filename, hostname = GLib.filename_from_uri(uri)
decoded_posix_filename = pathlib.PurePath(decoded_filename).as_posix()
assert decoded_posix_filename == filename
assert hostname is None
|
41ec266722eefb01b7e884696c7825bd5273e4ca | tests/test_diff.py | tests/test_diff.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from livemark.diff import _is_same_node, _next_noempty
from wdom.tests.util import TestCase
from wdom.parser import parse_html
class TestSameNode(TestCase):
def test_same_node(self):
node1_src = '<h1>A</h1>'
node1 = parse_html(node1_src)
node2 = parse_html(node1_src)
self.assertTrue(_is_same_node(node1.firstChild, node2.firstChild))
| #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from livemark.diff import _is_same_node, _next_noempty
from wdom.tests.util import TestCase
from wdom.parser import parse_html
class TestSameNode(TestCase):
def setUp(self):
self.src1 = '<h1>text1</h1>'
self.src2 = '<h1>text2</h1>'
self.src3 = '<h2>text1</h2>'
self.text1 = 'text1'
self.text2 = 'text2'
self.node1 = parse_html(self.src1).firstChild
self.node2 = parse_html(self.src2).firstChild
self.node3 = parse_html(self.src3).firstChild
self.t_node1 = parse_html(self.text1).firstChild
self.t_node2 = parse_html(self.text2).firstChild
def test_same_node(self):
node1 = parse_html(self.src1).firstChild
node2 = parse_html(self.src1).firstChild
self.assertTrue(_is_same_node(node1, node2))
def test_different_text(self):
self.assertFalse(_is_same_node(self.node1, self.node2))
def test_different_tag(self):
self.assertFalse(_is_same_node(self.node1, self.node3))
def test_same_text(self):
node1 = parse_html(self.text1).firstChild
node2 = parse_html(self.text1).firstChild
self.assertTrue(_is_same_node(node1, node2))
def test_different_text_node(self):
self.assertFalse(_is_same_node(self.t_node1, self.t_node2))
def test_different_tag_text(self):
self.assertFalse(_is_same_node(self.node1, self.t_node1))
self.assertFalse(_is_same_node(self.node2, self.t_node2))
self.assertFalse(_is_same_node(self.node3, self.t_node1))
| Add test for same node check | Add test for same node check
| Python | mit | miyakogi/livemark | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from livemark.diff import _is_same_node, _next_noempty
from wdom.tests.util import TestCase
from wdom.parser import parse_html
class TestSameNode(TestCase):
def test_same_node(self):
node1_src = '<h1>A</h1>'
node1 = parse_html(node1_src)
node2 = parse_html(node1_src)
self.assertTrue(_is_same_node(node1.firstChild, node2.firstChild))
Add test for same node check | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from livemark.diff import _is_same_node, _next_noempty
from wdom.tests.util import TestCase
from wdom.parser import parse_html
class TestSameNode(TestCase):
def setUp(self):
self.src1 = '<h1>text1</h1>'
self.src2 = '<h1>text2</h1>'
self.src3 = '<h2>text1</h2>'
self.text1 = 'text1'
self.text2 = 'text2'
self.node1 = parse_html(self.src1).firstChild
self.node2 = parse_html(self.src2).firstChild
self.node3 = parse_html(self.src3).firstChild
self.t_node1 = parse_html(self.text1).firstChild
self.t_node2 = parse_html(self.text2).firstChild
def test_same_node(self):
node1 = parse_html(self.src1).firstChild
node2 = parse_html(self.src1).firstChild
self.assertTrue(_is_same_node(node1, node2))
def test_different_text(self):
self.assertFalse(_is_same_node(self.node1, self.node2))
def test_different_tag(self):
self.assertFalse(_is_same_node(self.node1, self.node3))
def test_same_text(self):
node1 = parse_html(self.text1).firstChild
node2 = parse_html(self.text1).firstChild
self.assertTrue(_is_same_node(node1, node2))
def test_different_text_node(self):
self.assertFalse(_is_same_node(self.t_node1, self.t_node2))
def test_different_tag_text(self):
self.assertFalse(_is_same_node(self.node1, self.t_node1))
self.assertFalse(_is_same_node(self.node2, self.t_node2))
self.assertFalse(_is_same_node(self.node3, self.t_node1))
| <commit_before>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from livemark.diff import _is_same_node, _next_noempty
from wdom.tests.util import TestCase
from wdom.parser import parse_html
class TestSameNode(TestCase):
def test_same_node(self):
node1_src = '<h1>A</h1>'
node1 = parse_html(node1_src)
node2 = parse_html(node1_src)
self.assertTrue(_is_same_node(node1.firstChild, node2.firstChild))
<commit_msg>Add test for same node check<commit_after> | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from livemark.diff import _is_same_node, _next_noempty
from wdom.tests.util import TestCase
from wdom.parser import parse_html
class TestSameNode(TestCase):
def setUp(self):
self.src1 = '<h1>text1</h1>'
self.src2 = '<h1>text2</h1>'
self.src3 = '<h2>text1</h2>'
self.text1 = 'text1'
self.text2 = 'text2'
self.node1 = parse_html(self.src1).firstChild
self.node2 = parse_html(self.src2).firstChild
self.node3 = parse_html(self.src3).firstChild
self.t_node1 = parse_html(self.text1).firstChild
self.t_node2 = parse_html(self.text2).firstChild
def test_same_node(self):
node1 = parse_html(self.src1).firstChild
node2 = parse_html(self.src1).firstChild
self.assertTrue(_is_same_node(node1, node2))
def test_different_text(self):
self.assertFalse(_is_same_node(self.node1, self.node2))
def test_different_tag(self):
self.assertFalse(_is_same_node(self.node1, self.node3))
def test_same_text(self):
node1 = parse_html(self.text1).firstChild
node2 = parse_html(self.text1).firstChild
self.assertTrue(_is_same_node(node1, node2))
def test_different_text_node(self):
self.assertFalse(_is_same_node(self.t_node1, self.t_node2))
def test_different_tag_text(self):
self.assertFalse(_is_same_node(self.node1, self.t_node1))
self.assertFalse(_is_same_node(self.node2, self.t_node2))
self.assertFalse(_is_same_node(self.node3, self.t_node1))
| #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from livemark.diff import _is_same_node, _next_noempty
from wdom.tests.util import TestCase
from wdom.parser import parse_html
class TestSameNode(TestCase):
def test_same_node(self):
node1_src = '<h1>A</h1>'
node1 = parse_html(node1_src)
node2 = parse_html(node1_src)
self.assertTrue(_is_same_node(node1.firstChild, node2.firstChild))
Add test for same node check#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from livemark.diff import _is_same_node, _next_noempty
from wdom.tests.util import TestCase
from wdom.parser import parse_html
class TestSameNode(TestCase):
def setUp(self):
self.src1 = '<h1>text1</h1>'
self.src2 = '<h1>text2</h1>'
self.src3 = '<h2>text1</h2>'
self.text1 = 'text1'
self.text2 = 'text2'
self.node1 = parse_html(self.src1).firstChild
self.node2 = parse_html(self.src2).firstChild
self.node3 = parse_html(self.src3).firstChild
self.t_node1 = parse_html(self.text1).firstChild
self.t_node2 = parse_html(self.text2).firstChild
def test_same_node(self):
node1 = parse_html(self.src1).firstChild
node2 = parse_html(self.src1).firstChild
self.assertTrue(_is_same_node(node1, node2))
def test_different_text(self):
self.assertFalse(_is_same_node(self.node1, self.node2))
def test_different_tag(self):
self.assertFalse(_is_same_node(self.node1, self.node3))
def test_same_text(self):
node1 = parse_html(self.text1).firstChild
node2 = parse_html(self.text1).firstChild
self.assertTrue(_is_same_node(node1, node2))
def test_different_text_node(self):
self.assertFalse(_is_same_node(self.t_node1, self.t_node2))
def test_different_tag_text(self):
self.assertFalse(_is_same_node(self.node1, self.t_node1))
self.assertFalse(_is_same_node(self.node2, self.t_node2))
self.assertFalse(_is_same_node(self.node3, self.t_node1))
| <commit_before>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from livemark.diff import _is_same_node, _next_noempty
from wdom.tests.util import TestCase
from wdom.parser import parse_html
class TestSameNode(TestCase):
def test_same_node(self):
node1_src = '<h1>A</h1>'
node1 = parse_html(node1_src)
node2 = parse_html(node1_src)
self.assertTrue(_is_same_node(node1.firstChild, node2.firstChild))
<commit_msg>Add test for same node check<commit_after>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from livemark.diff import _is_same_node, _next_noempty
from wdom.tests.util import TestCase
from wdom.parser import parse_html
class TestSameNode(TestCase):
def setUp(self):
self.src1 = '<h1>text1</h1>'
self.src2 = '<h1>text2</h1>'
self.src3 = '<h2>text1</h2>'
self.text1 = 'text1'
self.text2 = 'text2'
self.node1 = parse_html(self.src1).firstChild
self.node2 = parse_html(self.src2).firstChild
self.node3 = parse_html(self.src3).firstChild
self.t_node1 = parse_html(self.text1).firstChild
self.t_node2 = parse_html(self.text2).firstChild
def test_same_node(self):
node1 = parse_html(self.src1).firstChild
node2 = parse_html(self.src1).firstChild
self.assertTrue(_is_same_node(node1, node2))
def test_different_text(self):
self.assertFalse(_is_same_node(self.node1, self.node2))
def test_different_tag(self):
self.assertFalse(_is_same_node(self.node1, self.node3))
def test_same_text(self):
node1 = parse_html(self.text1).firstChild
node2 = parse_html(self.text1).firstChild
self.assertTrue(_is_same_node(node1, node2))
def test_different_text_node(self):
self.assertFalse(_is_same_node(self.t_node1, self.t_node2))
def test_different_tag_text(self):
self.assertFalse(_is_same_node(self.node1, self.t_node1))
self.assertFalse(_is_same_node(self.node2, self.t_node2))
self.assertFalse(_is_same_node(self.node3, self.t_node1))
|
88d6728a157a260ed0b8ffc947c710d22a948efb | stock_transfer_restrict_lot/models/stock_move.py | stock_transfer_restrict_lot/models/stock_move.py | from openerp import models, fields, api, _
from openerp.exceptions import UserError
class StockPackOperation(models.Model):
_inherit = 'stock.pack.operation'
code = fields.Selection(
related='picking_id.picking_type_id.code',
string='Operation Type',
readonly=True)
@api.one
@api.constrains('pack_lot_ids')
def validate_quantity(self):
if self.code != 'incoming' and self.pack_lot_ids:
for pack in self.pack_lot_ids:
quants = self.env['stock.quant'].search(
[('id', 'in', pack.lot_id.quant_ids.ids),
('location_id', '=', self.location_id.id)])
if quants:
qty = sum([x.qty for x in quants])
else:
qty = 0.0
if qty < pack.qty:
raise UserError(
_('Sending amount can not exceed the quantity in\
stock for this product in this lot. \
\n Product:%s \
\n Lot:%s \
\n Stock:%s') % (pack.lot_id.product_id.
name, pack.lot_id.name, qty))
| from openerp import models, fields, api, _
from openerp.exceptions import UserError
class StockPackOperation(models.Model):
_inherit = 'stock.pack.operation'
code = fields.Selection(
related='picking_id.picking_type_id.code',
string='Operation Type',
readonly=True)
@api.one
@api.constrains('pack_lot_ids')
def validate_quantity(self):
if self.code != 'incoming' and self.pack_lot_ids:
for pack in self.pack_lot_ids:
quants = self.env['stock.quant'].search(
[('id', 'in', pack.lot_id.quant_ids.ids),
('location_id', '=', self.location_id.id), '|',
('reservation_id', '=', False),
('reservation_id.picking_id', '=', self.
picking_id.id)])
if quants:
qty = sum([x.qty for x in quants])
else:
qty = 0.0
if qty < pack.qty:
raise UserError(
_('Sending amount can not exceed the quantity in\
stock for this product in this lot. \
\n Product:%s \
\n Lot:%s \
\n Stock:%s') % (pack.lot_id.product_id.
name, pack.lot_id.name, qty))
| FIX stock transfer restrict lot when lost is reserved | FIX stock transfer restrict lot when lost is reserved
| Python | agpl-3.0 | ingadhoc/stock | from openerp import models, fields, api, _
from openerp.exceptions import UserError
class StockPackOperation(models.Model):
_inherit = 'stock.pack.operation'
code = fields.Selection(
related='picking_id.picking_type_id.code',
string='Operation Type',
readonly=True)
@api.one
@api.constrains('pack_lot_ids')
def validate_quantity(self):
if self.code != 'incoming' and self.pack_lot_ids:
for pack in self.pack_lot_ids:
quants = self.env['stock.quant'].search(
[('id', 'in', pack.lot_id.quant_ids.ids),
('location_id', '=', self.location_id.id)])
if quants:
qty = sum([x.qty for x in quants])
else:
qty = 0.0
if qty < pack.qty:
raise UserError(
_('Sending amount can not exceed the quantity in\
stock for this product in this lot. \
\n Product:%s \
\n Lot:%s \
\n Stock:%s') % (pack.lot_id.product_id.
name, pack.lot_id.name, qty))
FIX stock transfer restrict lot when lost is reserved | from openerp import models, fields, api, _
from openerp.exceptions import UserError
class StockPackOperation(models.Model):
_inherit = 'stock.pack.operation'
code = fields.Selection(
related='picking_id.picking_type_id.code',
string='Operation Type',
readonly=True)
@api.one
@api.constrains('pack_lot_ids')
def validate_quantity(self):
if self.code != 'incoming' and self.pack_lot_ids:
for pack in self.pack_lot_ids:
quants = self.env['stock.quant'].search(
[('id', 'in', pack.lot_id.quant_ids.ids),
('location_id', '=', self.location_id.id), '|',
('reservation_id', '=', False),
('reservation_id.picking_id', '=', self.
picking_id.id)])
if quants:
qty = sum([x.qty for x in quants])
else:
qty = 0.0
if qty < pack.qty:
raise UserError(
_('Sending amount can not exceed the quantity in\
stock for this product in this lot. \
\n Product:%s \
\n Lot:%s \
\n Stock:%s') % (pack.lot_id.product_id.
name, pack.lot_id.name, qty))
| <commit_before>from openerp import models, fields, api, _
from openerp.exceptions import UserError
class StockPackOperation(models.Model):
_inherit = 'stock.pack.operation'
code = fields.Selection(
related='picking_id.picking_type_id.code',
string='Operation Type',
readonly=True)
@api.one
@api.constrains('pack_lot_ids')
def validate_quantity(self):
if self.code != 'incoming' and self.pack_lot_ids:
for pack in self.pack_lot_ids:
quants = self.env['stock.quant'].search(
[('id', 'in', pack.lot_id.quant_ids.ids),
('location_id', '=', self.location_id.id)])
if quants:
qty = sum([x.qty for x in quants])
else:
qty = 0.0
if qty < pack.qty:
raise UserError(
_('Sending amount can not exceed the quantity in\
stock for this product in this lot. \
\n Product:%s \
\n Lot:%s \
\n Stock:%s') % (pack.lot_id.product_id.
name, pack.lot_id.name, qty))
<commit_msg>FIX stock transfer restrict lot when lost is reserved<commit_after> | from openerp import models, fields, api, _
from openerp.exceptions import UserError
class StockPackOperation(models.Model):
_inherit = 'stock.pack.operation'
code = fields.Selection(
related='picking_id.picking_type_id.code',
string='Operation Type',
readonly=True)
@api.one
@api.constrains('pack_lot_ids')
def validate_quantity(self):
if self.code != 'incoming' and self.pack_lot_ids:
for pack in self.pack_lot_ids:
quants = self.env['stock.quant'].search(
[('id', 'in', pack.lot_id.quant_ids.ids),
('location_id', '=', self.location_id.id), '|',
('reservation_id', '=', False),
('reservation_id.picking_id', '=', self.
picking_id.id)])
if quants:
qty = sum([x.qty for x in quants])
else:
qty = 0.0
if qty < pack.qty:
raise UserError(
_('Sending amount can not exceed the quantity in\
stock for this product in this lot. \
\n Product:%s \
\n Lot:%s \
\n Stock:%s') % (pack.lot_id.product_id.
name, pack.lot_id.name, qty))
| from openerp import models, fields, api, _
from openerp.exceptions import UserError
class StockPackOperation(models.Model):
_inherit = 'stock.pack.operation'
code = fields.Selection(
related='picking_id.picking_type_id.code',
string='Operation Type',
readonly=True)
@api.one
@api.constrains('pack_lot_ids')
def validate_quantity(self):
if self.code != 'incoming' and self.pack_lot_ids:
for pack in self.pack_lot_ids:
quants = self.env['stock.quant'].search(
[('id', 'in', pack.lot_id.quant_ids.ids),
('location_id', '=', self.location_id.id)])
if quants:
qty = sum([x.qty for x in quants])
else:
qty = 0.0
if qty < pack.qty:
raise UserError(
_('Sending amount can not exceed the quantity in\
stock for this product in this lot. \
\n Product:%s \
\n Lot:%s \
\n Stock:%s') % (pack.lot_id.product_id.
name, pack.lot_id.name, qty))
FIX stock transfer restrict lot when lost is reservedfrom openerp import models, fields, api, _
from openerp.exceptions import UserError
class StockPackOperation(models.Model):
_inherit = 'stock.pack.operation'
code = fields.Selection(
related='picking_id.picking_type_id.code',
string='Operation Type',
readonly=True)
@api.one
@api.constrains('pack_lot_ids')
def validate_quantity(self):
if self.code != 'incoming' and self.pack_lot_ids:
for pack in self.pack_lot_ids:
quants = self.env['stock.quant'].search(
[('id', 'in', pack.lot_id.quant_ids.ids),
('location_id', '=', self.location_id.id), '|',
('reservation_id', '=', False),
('reservation_id.picking_id', '=', self.
picking_id.id)])
if quants:
qty = sum([x.qty for x in quants])
else:
qty = 0.0
if qty < pack.qty:
raise UserError(
_('Sending amount can not exceed the quantity in\
stock for this product in this lot. \
\n Product:%s \
\n Lot:%s \
\n Stock:%s') % (pack.lot_id.product_id.
name, pack.lot_id.name, qty))
| <commit_before>from openerp import models, fields, api, _
from openerp.exceptions import UserError
class StockPackOperation(models.Model):
_inherit = 'stock.pack.operation'
code = fields.Selection(
related='picking_id.picking_type_id.code',
string='Operation Type',
readonly=True)
@api.one
@api.constrains('pack_lot_ids')
def validate_quantity(self):
if self.code != 'incoming' and self.pack_lot_ids:
for pack in self.pack_lot_ids:
quants = self.env['stock.quant'].search(
[('id', 'in', pack.lot_id.quant_ids.ids),
('location_id', '=', self.location_id.id)])
if quants:
qty = sum([x.qty for x in quants])
else:
qty = 0.0
if qty < pack.qty:
raise UserError(
_('Sending amount can not exceed the quantity in\
stock for this product in this lot. \
\n Product:%s \
\n Lot:%s \
\n Stock:%s') % (pack.lot_id.product_id.
name, pack.lot_id.name, qty))
<commit_msg>FIX stock transfer restrict lot when lost is reserved<commit_after>from openerp import models, fields, api, _
from openerp.exceptions import UserError
class StockPackOperation(models.Model):
_inherit = 'stock.pack.operation'
code = fields.Selection(
related='picking_id.picking_type_id.code',
string='Operation Type',
readonly=True)
@api.one
@api.constrains('pack_lot_ids')
def validate_quantity(self):
if self.code != 'incoming' and self.pack_lot_ids:
for pack in self.pack_lot_ids:
quants = self.env['stock.quant'].search(
[('id', 'in', pack.lot_id.quant_ids.ids),
('location_id', '=', self.location_id.id), '|',
('reservation_id', '=', False),
('reservation_id.picking_id', '=', self.
picking_id.id)])
if quants:
qty = sum([x.qty for x in quants])
else:
qty = 0.0
if qty < pack.qty:
raise UserError(
_('Sending amount can not exceed the quantity in\
stock for this product in this lot. \
\n Product:%s \
\n Lot:%s \
\n Stock:%s') % (pack.lot_id.product_id.
name, pack.lot_id.name, qty))
|
5ff983c1a464fc559cb13addb5316f99379472bf | tests/test_trip.py | tests/test_trip.py | #!/usr/bin/env python
import unittest
from parsemypsa.storage import objects
class TripTestCase(unittest.TestCase):
def setUp(self):
self.trip1 = objects.Trip.create(id=1, 1462731168, 200, 1000, 1, 0, 0)
def test_mileage_calculation(self):
self.trip1.calculate_mileage()
self.assertEqual(self.trip1._mileage, 1000)
def test_formatted_date(self):
self.assertEqual(self.trip1.return_formatted_date(), "2016-05-08 20:12:48")
def test_to_string(self):
self.assertEqual(str(self.trip1), "Trip 1 lasted 200") | #!/usr/bin/env python
import unittest
from playhouse.test_utils import test_database
from peewee import *
from parsemypsa.storage import objects
# Data for testing
test_db = SqliteDatabase(':memory:')
model_list = [objects.Alert, objects.VehiculeInformation, objects.Trip]
class TripTestCase(unittest.TestCase):
def setUp(self):
with test_database(test_db, model_list):
self.trip1 = objects.Trip.create(id=1, timestamp=1462731168, duration=200, distance=1000, fuel_consumation=1, typ=0, merged=0)
def test_mileage_calculation(self):
with test_database(test_db, model_list):
self.trip1.calculate_mileage()
self.assertEqual(self.trip1.mileage, 1000)
def test_formatted_date(self):
with test_database(test_db, model_list):
self.assertEqual(self.trip1.return_formatted_date(), "2016-05-08 20:12:48")
def test_to_string(self):
with test_database(test_db, model_list):
self.assertEqual(str(self.trip1), "Trip 1 lasted 200")
| Fix unittests broken after ORM adoption | Fix unittests broken after ORM adoption
| Python | mit | klenje/parsemypsa | #!/usr/bin/env python
import unittest
from parsemypsa.storage import objects
class TripTestCase(unittest.TestCase):
def setUp(self):
self.trip1 = objects.Trip.create(id=1, 1462731168, 200, 1000, 1, 0, 0)
def test_mileage_calculation(self):
self.trip1.calculate_mileage()
self.assertEqual(self.trip1._mileage, 1000)
def test_formatted_date(self):
self.assertEqual(self.trip1.return_formatted_date(), "2016-05-08 20:12:48")
def test_to_string(self):
self.assertEqual(str(self.trip1), "Trip 1 lasted 200")Fix unittests broken after ORM adoption | #!/usr/bin/env python
import unittest
from playhouse.test_utils import test_database
from peewee import *
from parsemypsa.storage import objects
# Data for testing
test_db = SqliteDatabase(':memory:')
model_list = [objects.Alert, objects.VehiculeInformation, objects.Trip]
class TripTestCase(unittest.TestCase):
def setUp(self):
with test_database(test_db, model_list):
self.trip1 = objects.Trip.create(id=1, timestamp=1462731168, duration=200, distance=1000, fuel_consumation=1, typ=0, merged=0)
def test_mileage_calculation(self):
with test_database(test_db, model_list):
self.trip1.calculate_mileage()
self.assertEqual(self.trip1.mileage, 1000)
def test_formatted_date(self):
with test_database(test_db, model_list):
self.assertEqual(self.trip1.return_formatted_date(), "2016-05-08 20:12:48")
def test_to_string(self):
with test_database(test_db, model_list):
self.assertEqual(str(self.trip1), "Trip 1 lasted 200")
| <commit_before>#!/usr/bin/env python
import unittest
from parsemypsa.storage import objects
class TripTestCase(unittest.TestCase):
def setUp(self):
self.trip1 = objects.Trip.create(id=1, 1462731168, 200, 1000, 1, 0, 0)
def test_mileage_calculation(self):
self.trip1.calculate_mileage()
self.assertEqual(self.trip1._mileage, 1000)
def test_formatted_date(self):
self.assertEqual(self.trip1.return_formatted_date(), "2016-05-08 20:12:48")
def test_to_string(self):
self.assertEqual(str(self.trip1), "Trip 1 lasted 200")<commit_msg>Fix unittests broken after ORM adoption<commit_after> | #!/usr/bin/env python
import unittest
from playhouse.test_utils import test_database
from peewee import *
from parsemypsa.storage import objects
# Data for testing
test_db = SqliteDatabase(':memory:')
model_list = [objects.Alert, objects.VehiculeInformation, objects.Trip]
class TripTestCase(unittest.TestCase):
def setUp(self):
with test_database(test_db, model_list):
self.trip1 = objects.Trip.create(id=1, timestamp=1462731168, duration=200, distance=1000, fuel_consumation=1, typ=0, merged=0)
def test_mileage_calculation(self):
with test_database(test_db, model_list):
self.trip1.calculate_mileage()
self.assertEqual(self.trip1.mileage, 1000)
def test_formatted_date(self):
with test_database(test_db, model_list):
self.assertEqual(self.trip1.return_formatted_date(), "2016-05-08 20:12:48")
def test_to_string(self):
with test_database(test_db, model_list):
self.assertEqual(str(self.trip1), "Trip 1 lasted 200")
| #!/usr/bin/env python
import unittest
from parsemypsa.storage import objects
class TripTestCase(unittest.TestCase):
def setUp(self):
self.trip1 = objects.Trip.create(id=1, 1462731168, 200, 1000, 1, 0, 0)
def test_mileage_calculation(self):
self.trip1.calculate_mileage()
self.assertEqual(self.trip1._mileage, 1000)
def test_formatted_date(self):
self.assertEqual(self.trip1.return_formatted_date(), "2016-05-08 20:12:48")
def test_to_string(self):
self.assertEqual(str(self.trip1), "Trip 1 lasted 200")Fix unittests broken after ORM adoption#!/usr/bin/env python
import unittest
from playhouse.test_utils import test_database
from peewee import *
from parsemypsa.storage import objects
# Data for testing
test_db = SqliteDatabase(':memory:')
model_list = [objects.Alert, objects.VehiculeInformation, objects.Trip]
class TripTestCase(unittest.TestCase):
def setUp(self):
with test_database(test_db, model_list):
self.trip1 = objects.Trip.create(id=1, timestamp=1462731168, duration=200, distance=1000, fuel_consumation=1, typ=0, merged=0)
def test_mileage_calculation(self):
with test_database(test_db, model_list):
self.trip1.calculate_mileage()
self.assertEqual(self.trip1.mileage, 1000)
def test_formatted_date(self):
with test_database(test_db, model_list):
self.assertEqual(self.trip1.return_formatted_date(), "2016-05-08 20:12:48")
def test_to_string(self):
with test_database(test_db, model_list):
self.assertEqual(str(self.trip1), "Trip 1 lasted 200")
| <commit_before>#!/usr/bin/env python
import unittest
from parsemypsa.storage import objects
class TripTestCase(unittest.TestCase):
def setUp(self):
self.trip1 = objects.Trip.create(id=1, 1462731168, 200, 1000, 1, 0, 0)
def test_mileage_calculation(self):
self.trip1.calculate_mileage()
self.assertEqual(self.trip1._mileage, 1000)
def test_formatted_date(self):
self.assertEqual(self.trip1.return_formatted_date(), "2016-05-08 20:12:48")
def test_to_string(self):
self.assertEqual(str(self.trip1), "Trip 1 lasted 200")<commit_msg>Fix unittests broken after ORM adoption<commit_after>#!/usr/bin/env python
import unittest
from playhouse.test_utils import test_database
from peewee import *
from parsemypsa.storage import objects
# Data for testing
test_db = SqliteDatabase(':memory:')
model_list = [objects.Alert, objects.VehiculeInformation, objects.Trip]
class TripTestCase(unittest.TestCase):
def setUp(self):
with test_database(test_db, model_list):
self.trip1 = objects.Trip.create(id=1, timestamp=1462731168, duration=200, distance=1000, fuel_consumation=1, typ=0, merged=0)
def test_mileage_calculation(self):
with test_database(test_db, model_list):
self.trip1.calculate_mileage()
self.assertEqual(self.trip1.mileage, 1000)
def test_formatted_date(self):
with test_database(test_db, model_list):
self.assertEqual(self.trip1.return_formatted_date(), "2016-05-08 20:12:48")
def test_to_string(self):
with test_database(test_db, model_list):
self.assertEqual(str(self.trip1), "Trip 1 lasted 200")
|
9f356ed8f9b975eb82d44454a1e4482f2063b1b1 | server_dev.py | server_dev.py | import projects
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
def index():
project_list = projects.get_projects()
return render_template('index.html', projects=project_list)
@app.route('/blog')
def blog():
return "Flasktopress isn't quite ready yet, but we're stoked that it's coming."
@app.route('/<project>')
def project(project):
return "Bet you can't wait to join %s, huh?" % project
if __name__ == '__main__':
app.run(debug=True)
| import projects
from flask import Flask, render_template, abort
app = Flask(__name__)
@app.route('/')
def index():
project_list = projects.get_projects()
return render_template('index.html', projects=project_list)
@app.route('/blog')
def blog():
return "Flasktopress isn't quite ready yet, but we're stoked that it's coming."
@app.route('/<project>')
def project(project):
project_list = projects.get_projects()
if project in project_list:
project_data = project_list[project]
return "Contact %s to join the %s project!" % (project_data['project_leaders'][0]['name'], project_data['project_title'])
else:
abort(404)
if __name__ == '__main__':
app.run(debug=True)
| Test if a project exists, load or 404 accordingly | Test if a project exists, load or 404 accordingly
| Python | mit | teslaworksumn/teslaworks.net,teslaworksumn/teslaworks.net | import projects
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
def index():
project_list = projects.get_projects()
return render_template('index.html', projects=project_list)
@app.route('/blog')
def blog():
return "Flasktopress isn't quite ready yet, but we're stoked that it's coming."
@app.route('/<project>')
def project(project):
return "Bet you can't wait to join %s, huh?" % project
if __name__ == '__main__':
app.run(debug=True)
Test if a project exists, load or 404 accordingly | import projects
from flask import Flask, render_template, abort
app = Flask(__name__)
@app.route('/')
def index():
project_list = projects.get_projects()
return render_template('index.html', projects=project_list)
@app.route('/blog')
def blog():
return "Flasktopress isn't quite ready yet, but we're stoked that it's coming."
@app.route('/<project>')
def project(project):
project_list = projects.get_projects()
if project in project_list:
project_data = project_list[project]
return "Contact %s to join the %s project!" % (project_data['project_leaders'][0]['name'], project_data['project_title'])
else:
abort(404)
if __name__ == '__main__':
app.run(debug=True)
| <commit_before>import projects
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
def index():
project_list = projects.get_projects()
return render_template('index.html', projects=project_list)
@app.route('/blog')
def blog():
return "Flasktopress isn't quite ready yet, but we're stoked that it's coming."
@app.route('/<project>')
def project(project):
return "Bet you can't wait to join %s, huh?" % project
if __name__ == '__main__':
app.run(debug=True)
<commit_msg>Test if a project exists, load or 404 accordingly<commit_after> | import projects
from flask import Flask, render_template, abort
app = Flask(__name__)
@app.route('/')
def index():
project_list = projects.get_projects()
return render_template('index.html', projects=project_list)
@app.route('/blog')
def blog():
return "Flasktopress isn't quite ready yet, but we're stoked that it's coming."
@app.route('/<project>')
def project(project):
project_list = projects.get_projects()
if project in project_list:
project_data = project_list[project]
return "Contact %s to join the %s project!" % (project_data['project_leaders'][0]['name'], project_data['project_title'])
else:
abort(404)
if __name__ == '__main__':
app.run(debug=True)
| import projects
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
def index():
project_list = projects.get_projects()
return render_template('index.html', projects=project_list)
@app.route('/blog')
def blog():
return "Flasktopress isn't quite ready yet, but we're stoked that it's coming."
@app.route('/<project>')
def project(project):
return "Bet you can't wait to join %s, huh?" % project
if __name__ == '__main__':
app.run(debug=True)
Test if a project exists, load or 404 accordinglyimport projects
from flask import Flask, render_template, abort
app = Flask(__name__)
@app.route('/')
def index():
project_list = projects.get_projects()
return render_template('index.html', projects=project_list)
@app.route('/blog')
def blog():
return "Flasktopress isn't quite ready yet, but we're stoked that it's coming."
@app.route('/<project>')
def project(project):
project_list = projects.get_projects()
if project in project_list:
project_data = project_list[project]
return "Contact %s to join the %s project!" % (project_data['project_leaders'][0]['name'], project_data['project_title'])
else:
abort(404)
if __name__ == '__main__':
app.run(debug=True)
| <commit_before>import projects
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
def index():
project_list = projects.get_projects()
return render_template('index.html', projects=project_list)
@app.route('/blog')
def blog():
return "Flasktopress isn't quite ready yet, but we're stoked that it's coming."
@app.route('/<project>')
def project(project):
return "Bet you can't wait to join %s, huh?" % project
if __name__ == '__main__':
app.run(debug=True)
<commit_msg>Test if a project exists, load or 404 accordingly<commit_after>import projects
from flask import Flask, render_template, abort
app = Flask(__name__)
@app.route('/')
def index():
project_list = projects.get_projects()
return render_template('index.html', projects=project_list)
@app.route('/blog')
def blog():
return "Flasktopress isn't quite ready yet, but we're stoked that it's coming."
@app.route('/<project>')
def project(project):
project_list = projects.get_projects()
if project in project_list:
project_data = project_list[project]
return "Contact %s to join the %s project!" % (project_data['project_leaders'][0]['name'], project_data['project_title'])
else:
abort(404)
if __name__ == '__main__':
app.run(debug=True)
|
1890347d0dd5f831a8a9b4cd704dbdc0859d4997 | tmuxp/__about__.py | tmuxp/__about__.py | __title__ = 'tmuxp'
__package_name__ = 'tmuxp'
__version__ = '1.4.0'
__description__ = 'tmux session manager'
__email__ = 'tony@git-pull.com'
__author__ = 'Tony Narlock'
__github__ = 'https://github.com/tmux-python/tmuxp'
__pypi__ = 'https://pypi.python.org/pypi/tmuxp'
__license__ = 'MIT'
__copyright__ = 'Copyright 2013-2018 Tony Narlock'
| __title__ = 'tmuxp'
__package_name__ = 'tmuxp'
__version__ = 'dev'
__description__ = 'tmux session manager'
__email__ = 'tony@git-pull.com'
__author__ = 'Tony Narlock'
__github__ = 'https://github.com/tmux-python/tmuxp'
__pypi__ = 'https://pypi.python.org/pypi/tmuxp'
__license__ = 'MIT'
__copyright__ = 'Copyright 2013-2018 Tony Narlock'
| Change __version__ to dev until we tag | Change __version__ to dev until we tag
This is for sphinx linkcode links to work on our API page.
| Python | bsd-3-clause | tony/tmuxp | __title__ = 'tmuxp'
__package_name__ = 'tmuxp'
__version__ = '1.4.0'
__description__ = 'tmux session manager'
__email__ = 'tony@git-pull.com'
__author__ = 'Tony Narlock'
__github__ = 'https://github.com/tmux-python/tmuxp'
__pypi__ = 'https://pypi.python.org/pypi/tmuxp'
__license__ = 'MIT'
__copyright__ = 'Copyright 2013-2018 Tony Narlock'
Change __version__ to dev until we tag
This is for sphinx linkcode links to work on our API page. | __title__ = 'tmuxp'
__package_name__ = 'tmuxp'
__version__ = 'dev'
__description__ = 'tmux session manager'
__email__ = 'tony@git-pull.com'
__author__ = 'Tony Narlock'
__github__ = 'https://github.com/tmux-python/tmuxp'
__pypi__ = 'https://pypi.python.org/pypi/tmuxp'
__license__ = 'MIT'
__copyright__ = 'Copyright 2013-2018 Tony Narlock'
| <commit_before>__title__ = 'tmuxp'
__package_name__ = 'tmuxp'
__version__ = '1.4.0'
__description__ = 'tmux session manager'
__email__ = 'tony@git-pull.com'
__author__ = 'Tony Narlock'
__github__ = 'https://github.com/tmux-python/tmuxp'
__pypi__ = 'https://pypi.python.org/pypi/tmuxp'
__license__ = 'MIT'
__copyright__ = 'Copyright 2013-2018 Tony Narlock'
<commit_msg>Change __version__ to dev until we tag
This is for sphinx linkcode links to work on our API page.<commit_after> | __title__ = 'tmuxp'
__package_name__ = 'tmuxp'
__version__ = 'dev'
__description__ = 'tmux session manager'
__email__ = 'tony@git-pull.com'
__author__ = 'Tony Narlock'
__github__ = 'https://github.com/tmux-python/tmuxp'
__pypi__ = 'https://pypi.python.org/pypi/tmuxp'
__license__ = 'MIT'
__copyright__ = 'Copyright 2013-2018 Tony Narlock'
| __title__ = 'tmuxp'
__package_name__ = 'tmuxp'
__version__ = '1.4.0'
__description__ = 'tmux session manager'
__email__ = 'tony@git-pull.com'
__author__ = 'Tony Narlock'
__github__ = 'https://github.com/tmux-python/tmuxp'
__pypi__ = 'https://pypi.python.org/pypi/tmuxp'
__license__ = 'MIT'
__copyright__ = 'Copyright 2013-2018 Tony Narlock'
Change __version__ to dev until we tag
This is for sphinx linkcode links to work on our API page.__title__ = 'tmuxp'
__package_name__ = 'tmuxp'
__version__ = 'dev'
__description__ = 'tmux session manager'
__email__ = 'tony@git-pull.com'
__author__ = 'Tony Narlock'
__github__ = 'https://github.com/tmux-python/tmuxp'
__pypi__ = 'https://pypi.python.org/pypi/tmuxp'
__license__ = 'MIT'
__copyright__ = 'Copyright 2013-2018 Tony Narlock'
| <commit_before>__title__ = 'tmuxp'
__package_name__ = 'tmuxp'
__version__ = '1.4.0'
__description__ = 'tmux session manager'
__email__ = 'tony@git-pull.com'
__author__ = 'Tony Narlock'
__github__ = 'https://github.com/tmux-python/tmuxp'
__pypi__ = 'https://pypi.python.org/pypi/tmuxp'
__license__ = 'MIT'
__copyright__ = 'Copyright 2013-2018 Tony Narlock'
<commit_msg>Change __version__ to dev until we tag
This is for sphinx linkcode links to work on our API page.<commit_after>__title__ = 'tmuxp'
__package_name__ = 'tmuxp'
__version__ = 'dev'
__description__ = 'tmux session manager'
__email__ = 'tony@git-pull.com'
__author__ = 'Tony Narlock'
__github__ = 'https://github.com/tmux-python/tmuxp'
__pypi__ = 'https://pypi.python.org/pypi/tmuxp'
__license__ = 'MIT'
__copyright__ = 'Copyright 2013-2018 Tony Narlock'
|
436195aad8c3e7a069066e9e1d4db6dfa9ac34db | devilry/addons/student/devilry_plugin.py | devilry/addons/student/devilry_plugin.py | from django.utils.translation import ugettext as _
from django.utils.safestring import mark_safe
from django.core.urlresolvers import reverse
from devilry.addons.dashboard.dashboardplugin_registry import registry, \
DashboardItem
import dashboardviews
def simpleview(request, *args):
return mark_safe(u"""Student dashboard-view(s) is not finished.
<a href='%s'>Click here</a> for the
main student view.""" % reverse('devilry-student-show-assignments'))
registry.register_important(DashboardItem(
title = _('Student'),
candidate_access = True,
view = dashboardviews.list_assignments))
| from django.utils.translation import ugettext as _
from django.utils.safestring import mark_safe
from django.core.urlresolvers import reverse
from devilry.addons.dashboard.dashboardplugin_registry import registry, \
DashboardItem
import dashboardviews
registry.register_important(DashboardItem(
title = _('Assignments'),
candidate_access = True,
view = dashboardviews.list_assignments))
| Set title to 'Assignment' in student dashboard | Set title to 'Assignment' in student dashboard
| Python | bsd-3-clause | devilry/devilry-django,devilry/devilry-django,devilry/devilry-django,vegarang/devilry-django,vegarang/devilry-django,devilry/devilry-django | from django.utils.translation import ugettext as _
from django.utils.safestring import mark_safe
from django.core.urlresolvers import reverse
from devilry.addons.dashboard.dashboardplugin_registry import registry, \
DashboardItem
import dashboardviews
def simpleview(request, *args):
return mark_safe(u"""Student dashboard-view(s) is not finished.
<a href='%s'>Click here</a> for the
main student view.""" % reverse('devilry-student-show-assignments'))
registry.register_important(DashboardItem(
title = _('Student'),
candidate_access = True,
view = dashboardviews.list_assignments))
Set title to 'Assignment' in student dashboard | from django.utils.translation import ugettext as _
from django.utils.safestring import mark_safe
from django.core.urlresolvers import reverse
from devilry.addons.dashboard.dashboardplugin_registry import registry, \
DashboardItem
import dashboardviews
registry.register_important(DashboardItem(
title = _('Assignments'),
candidate_access = True,
view = dashboardviews.list_assignments))
| <commit_before>from django.utils.translation import ugettext as _
from django.utils.safestring import mark_safe
from django.core.urlresolvers import reverse
from devilry.addons.dashboard.dashboardplugin_registry import registry, \
DashboardItem
import dashboardviews
def simpleview(request, *args):
return mark_safe(u"""Student dashboard-view(s) is not finished.
<a href='%s'>Click here</a> for the
main student view.""" % reverse('devilry-student-show-assignments'))
registry.register_important(DashboardItem(
title = _('Student'),
candidate_access = True,
view = dashboardviews.list_assignments))
<commit_msg>Set title to 'Assignment' in student dashboard<commit_after> | from django.utils.translation import ugettext as _
from django.utils.safestring import mark_safe
from django.core.urlresolvers import reverse
from devilry.addons.dashboard.dashboardplugin_registry import registry, \
DashboardItem
import dashboardviews
registry.register_important(DashboardItem(
title = _('Assignments'),
candidate_access = True,
view = dashboardviews.list_assignments))
| from django.utils.translation import ugettext as _
from django.utils.safestring import mark_safe
from django.core.urlresolvers import reverse
from devilry.addons.dashboard.dashboardplugin_registry import registry, \
DashboardItem
import dashboardviews
def simpleview(request, *args):
return mark_safe(u"""Student dashboard-view(s) is not finished.
<a href='%s'>Click here</a> for the
main student view.""" % reverse('devilry-student-show-assignments'))
registry.register_important(DashboardItem(
title = _('Student'),
candidate_access = True,
view = dashboardviews.list_assignments))
Set title to 'Assignment' in student dashboardfrom django.utils.translation import ugettext as _
from django.utils.safestring import mark_safe
from django.core.urlresolvers import reverse
from devilry.addons.dashboard.dashboardplugin_registry import registry, \
DashboardItem
import dashboardviews
registry.register_important(DashboardItem(
title = _('Assignments'),
candidate_access = True,
view = dashboardviews.list_assignments))
| <commit_before>from django.utils.translation import ugettext as _
from django.utils.safestring import mark_safe
from django.core.urlresolvers import reverse
from devilry.addons.dashboard.dashboardplugin_registry import registry, \
DashboardItem
import dashboardviews
def simpleview(request, *args):
return mark_safe(u"""Student dashboard-view(s) is not finished.
<a href='%s'>Click here</a> for the
main student view.""" % reverse('devilry-student-show-assignments'))
registry.register_important(DashboardItem(
title = _('Student'),
candidate_access = True,
view = dashboardviews.list_assignments))
<commit_msg>Set title to 'Assignment' in student dashboard<commit_after>from django.utils.translation import ugettext as _
from django.utils.safestring import mark_safe
from django.core.urlresolvers import reverse
from devilry.addons.dashboard.dashboardplugin_registry import registry, \
DashboardItem
import dashboardviews
registry.register_important(DashboardItem(
title = _('Assignments'),
candidate_access = True,
view = dashboardviews.list_assignments))
|
2f37ae17eae3701eb205f5f524de3254f6d965e8 | tools/skp/page_sets/skia_worldjournal_nexus10.py | tools/skp/page_sets/skia_worldjournal_nexus10.py | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# pylint: disable=W0401,W0614
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class SkiaBuildbotDesktopPage(page_module.Page):
def __init__(self, url, page_set):
super(SkiaBuildbotDesktopPage, self).__init__(
url=url,
page_set=page_set,
credentials_path='data/credentials.json')
self.user_agent_type = 'tablet'
self.archive_data_file = 'data/skia_worldjournal_nexus10.json'
def RunSmoothness(self, action_runner):
action_runner.ScrollElement()
def RunNavigateSteps(self, action_runner):
action_runner.NavigateToPage(self)
action_runner.Wait(15)
class SkiaWorldjournalNexus10PageSet(page_set_module.PageSet):
""" Pages designed to represent the median, not highly optimized web """
def __init__(self):
super(SkiaWorldjournalNexus10PageSet, self).__init__(
user_agent_type='tablet',
archive_data_file='data/skia_worldjournal_nexus10.json')
urls_list = [
# Why: Chinese font test case
'http://worldjournal.com/',
]
for url in urls_list:
self.AddPage(SkiaBuildbotDesktopPage(url, self))
| # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# pylint: disable=W0401,W0614
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class SkiaBuildbotDesktopPage(page_module.Page):
def __init__(self, url, page_set):
super(SkiaBuildbotDesktopPage, self).__init__(
url=url,
page_set=page_set,
credentials_path='data/credentials.json')
self.user_agent_type = 'tablet'
self.archive_data_file = 'data/skia_worldjournal_nexus10.json'
class SkiaWorldjournalNexus10PageSet(page_set_module.PageSet):
""" Pages designed to represent the median, not highly optimized web """
def __init__(self):
super(SkiaWorldjournalNexus10PageSet, self).__init__(
user_agent_type='tablet',
archive_data_file='data/skia_worldjournal_nexus10.json')
urls_list = [
# Why: Chinese font test case
'http://worldjournal.com/',
]
for url in urls_list:
self.AddPage(SkiaBuildbotDesktopPage(url, self))
| Remove action_runner steps for worldjournal pageset to prevent crashes | Remove action_runner steps for worldjournal pageset to prevent crashes
BUG=skia:3196
NOTRY=true
Review URL: https://codereview.chromium.org/795173002
| Python | bsd-3-clause | OneRom/external_skia,VRToxin-AOSP/android_external_skia,Infinitive-OS/platform_external_skia,Hikari-no-Tenshi/android_external_skia,google/skia,PAC-ROM/android_external_skia,timduru/platform-external-skia,AOSP-YU/platform_external_skia,pcwalton/skia,vanish87/skia,Infinitive-OS/platform_external_skia,TeamExodus/external_skia,OneRom/external_skia,amyvmiwei/skia,amyvmiwei/skia,TeamExodus/external_skia,pcwalton/skia,Infinitive-OS/platform_external_skia,spezi77/android_external_skia,AOSPB/external_skia,todotodoo/skia,HalCanary/skia-hc,HalCanary/skia-hc,VRToxin-AOSP/android_external_skia,AOSPB/external_skia,spezi77/android_external_skia,VRToxin-AOSP/android_external_skia,rubenvb/skia,vanish87/skia,PAC-ROM/android_external_skia,noselhq/skia,nfxosp/platform_external_skia,Hikari-no-Tenshi/android_external_skia,AOSPB/external_skia,ominux/skia,spezi77/android_external_skia,MarshedOut/android_external_skia,spezi77/android_external_skia,qrealka/skia-hc,qrealka/skia-hc,scroggo/skia,rubenvb/skia,tmpvar/skia.cc,invisiblek/android_external_skia,AOSPB/external_skia,nvoron23/skia,timduru/platform-external-skia,amyvmiwei/skia,HalCanary/skia-hc,UBERMALLOW/external_skia,jtg-gg/skia,todotodoo/skia,OneRom/external_skia,tmpvar/skia.cc,DiamondLovesYou/skia-sys,boulzordev/android_external_skia,noselhq/skia,scroggo/skia,OneRom/external_skia,noselhq/skia,timduru/platform-external-skia,rubenvb/skia,Igalia/skia,MonkeyZZZZ/platform_external_skia,MonkeyZZZZ/platform_external_skia,Hikari-no-Tenshi/android_external_skia,nvoron23/skia,geekboxzone/mmallow_external_skia,BrokenROM/external_skia,jtg-gg/skia,VRToxin-AOSP/android_external_skia,UBERMALLOW/external_skia,vanish87/skia,ominux/skia,shahrzadmn/skia,boulzordev/android_external_skia,invisiblek/android_external_skia,BrokenROM/external_skia,AOSP-YU/platform_external_skia,todotodoo/skia,Infinitive-OS/platform_external_skia,OneRom/external_skia,DiamondLovesYou/skia-sys,Jichao/skia,Igalia/skia,shahrzadmn/skia,nvoron23/skia,spezi77/android_external_skia,TeamTwisted/external_skia,PAC-ROM/android_external_skia,nfxosp/platform_external_skia,scroggo/skia,pcwalton/skia,tmpvar/skia.cc,Hikari-no-Tenshi/android_external_skia,MinimalOS-AOSP/platform_external_skia,TeamExodus/external_skia,w3nd1go/android_external_skia,samuelig/skia,geekboxzone/mmallow_external_skia,UBERMALLOW/external_skia,Jichao/skia,aosp-mirror/platform_external_skia,todotodoo/skia,w3nd1go/android_external_skia,google/skia,Igalia/skia,Jichao/skia,aosp-mirror/platform_external_skia,nvoron23/skia,YUPlayGodDev/platform_external_skia,samuelig/skia,HalCanary/skia-hc,nvoron23/skia,MonkeyZZZZ/platform_external_skia,DiamondLovesYou/skia-sys,tmpvar/skia.cc,vanish87/skia,nfxosp/platform_external_skia,scroggo/skia,pcwalton/skia,w3nd1go/android_external_skia,geekboxzone/mmallow_external_skia,scroggo/skia,AOSP-YU/platform_external_skia,shahrzadmn/skia,amyvmiwei/skia,PAC-ROM/android_external_skia,ominux/skia,MonkeyZZZZ/platform_external_skia,nvoron23/skia,nfxosp/platform_external_skia,google/skia,boulzordev/android_external_skia,DiamondLovesYou/skia-sys,MinimalOS-AOSP/platform_external_skia,geekboxzone/mmallow_external_skia,vanish87/skia,nvoron23/skia,jtg-gg/skia,BrokenROM/external_skia,TeamExodus/external_skia,shahrzadmn/skia,boulzordev/android_external_skia,ominux/skia,rubenvb/skia,HalCanary/skia-hc,geekboxzone/mmallow_external_skia,Igalia/skia,qrealka/skia-hc,AOSPB/external_skia,jtg-gg/skia,qrealka/skia-hc,w3nd1go/android_external_skia,timduru/platform-external-skia,google/skia,Infinitive-OS/platform_external_skia,scroggo/skia,TeamTwisted/external_skia,BrokenROM/external_skia,Jichao/skia,samuelig/skia,amyvmiwei/skia,aosp-mirror/platform_external_skia,shahrzadmn/skia,google/skia,TeamExodus/external_skia,geekboxzone/mmallow_external_skia,TeamExodus/external_skia,MarshedOut/android_external_skia,YUPlayGodDev/platform_external_skia,TeamExodus/external_skia,qrealka/skia-hc,nvoron23/skia,Infinitive-OS/platform_external_skia,samuelig/skia,MonkeyZZZZ/platform_external_skia,MinimalOS-AOSP/platform_external_skia,PAC-ROM/android_external_skia,pcwalton/skia,amyvmiwei/skia,MarshedOut/android_external_skia,Igalia/skia,invisiblek/android_external_skia,noselhq/skia,UBERMALLOW/external_skia,Igalia/skia,VRToxin-AOSP/android_external_skia,AOSP-YU/platform_external_skia,HalCanary/skia-hc,shahrzadmn/skia,scroggo/skia,YUPlayGodDev/platform_external_skia,BrokenROM/external_skia,vanish87/skia,todotodoo/skia,ominux/skia,PAC-ROM/android_external_skia,Jichao/skia,vanish87/skia,noselhq/skia,MonkeyZZZZ/platform_external_skia,VRToxin-AOSP/android_external_skia,OneRom/external_skia,DiamondLovesYou/skia-sys,MinimalOS-AOSP/platform_external_skia,aosp-mirror/platform_external_skia,PAC-ROM/android_external_skia,w3nd1go/android_external_skia,rubenvb/skia,UBERMALLOW/external_skia,vanish87/skia,tmpvar/skia.cc,BrokenROM/external_skia,timduru/platform-external-skia,PAC-ROM/android_external_skia,amyvmiwei/skia,boulzordev/android_external_skia,qrealka/skia-hc,ominux/skia,MarshedOut/android_external_skia,OneRom/external_skia,TeamTwisted/external_skia,nfxosp/platform_external_skia,invisiblek/android_external_skia,TeamTwisted/external_skia,DiamondLovesYou/skia-sys,aosp-mirror/platform_external_skia,google/skia,Infinitive-OS/platform_external_skia,ominux/skia,noselhq/skia,invisiblek/android_external_skia,TeamTwisted/external_skia,noselhq/skia,invisiblek/android_external_skia,UBERMALLOW/external_skia,Jichao/skia,BrokenROM/external_skia,nfxosp/platform_external_skia,UBERMALLOW/external_skia,YUPlayGodDev/platform_external_skia,MarshedOut/android_external_skia,aosp-mirror/platform_external_skia,pcwalton/skia,tmpvar/skia.cc,UBERMALLOW/external_skia,tmpvar/skia.cc,MonkeyZZZZ/platform_external_skia,ominux/skia,jtg-gg/skia,google/skia,HalCanary/skia-hc,rubenvb/skia,Jichao/skia,boulzordev/android_external_skia,VRToxin-AOSP/android_external_skia,todotodoo/skia,google/skia,aosp-mirror/platform_external_skia,shahrzadmn/skia,spezi77/android_external_skia,rubenvb/skia,AOSP-YU/platform_external_skia,Jichao/skia,TeamTwisted/external_skia,MarshedOut/android_external_skia,shahrzadmn/skia,Hikari-no-Tenshi/android_external_skia,tmpvar/skia.cc,VRToxin-AOSP/android_external_skia,Hikari-no-Tenshi/android_external_skia,aosp-mirror/platform_external_skia,AOSPB/external_skia,MinimalOS-AOSP/platform_external_skia,Igalia/skia,MarshedOut/android_external_skia,AOSP-YU/platform_external_skia,UBERMALLOW/external_skia,HalCanary/skia-hc,qrealka/skia-hc,Jichao/skia,nvoron23/skia,TeamTwisted/external_skia,qrealka/skia-hc,boulzordev/android_external_skia,shahrzadmn/skia,Infinitive-OS/platform_external_skia,timduru/platform-external-skia,AOSP-YU/platform_external_skia,invisiblek/android_external_skia,pcwalton/skia,AOSPB/external_skia,jtg-gg/skia,rubenvb/skia,TeamTwisted/external_skia,Hikari-no-Tenshi/android_external_skia,w3nd1go/android_external_skia,todotodoo/skia,YUPlayGodDev/platform_external_skia,geekboxzone/mmallow_external_skia,YUPlayGodDev/platform_external_skia,invisiblek/android_external_skia,vanish87/skia,MarshedOut/android_external_skia,PAC-ROM/android_external_skia,w3nd1go/android_external_skia,ominux/skia,pcwalton/skia,Infinitive-OS/platform_external_skia,MonkeyZZZZ/platform_external_skia,samuelig/skia,nfxosp/platform_external_skia,TeamExodus/external_skia,pcwalton/skia,aosp-mirror/platform_external_skia,OneRom/external_skia,Igalia/skia,Hikari-no-Tenshi/android_external_skia,nfxosp/platform_external_skia,HalCanary/skia-hc,w3nd1go/android_external_skia,MinimalOS-AOSP/platform_external_skia,MinimalOS-AOSP/platform_external_skia,nfxosp/platform_external_skia,TeamTwisted/external_skia,AOSPB/external_skia,rubenvb/skia,google/skia,samuelig/skia,samuelig/skia,YUPlayGodDev/platform_external_skia,AOSP-YU/platform_external_skia,TeamExodus/external_skia,OneRom/external_skia,todotodoo/skia,noselhq/skia,YUPlayGodDev/platform_external_skia,AOSP-YU/platform_external_skia,YUPlayGodDev/platform_external_skia,DiamondLovesYou/skia-sys,MinimalOS-AOSP/platform_external_skia,boulzordev/android_external_skia,todotodoo/skia,MonkeyZZZZ/platform_external_skia,timduru/platform-external-skia,boulzordev/android_external_skia,geekboxzone/mmallow_external_skia,rubenvb/skia,jtg-gg/skia,VRToxin-AOSP/android_external_skia,AOSPB/external_skia,w3nd1go/android_external_skia,BrokenROM/external_skia,amyvmiwei/skia,scroggo/skia,tmpvar/skia.cc,noselhq/skia,geekboxzone/mmallow_external_skia,aosp-mirror/platform_external_skia,samuelig/skia,MarshedOut/android_external_skia,HalCanary/skia-hc,MinimalOS-AOSP/platform_external_skia,google/skia | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# pylint: disable=W0401,W0614
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class SkiaBuildbotDesktopPage(page_module.Page):
def __init__(self, url, page_set):
super(SkiaBuildbotDesktopPage, self).__init__(
url=url,
page_set=page_set,
credentials_path='data/credentials.json')
self.user_agent_type = 'tablet'
self.archive_data_file = 'data/skia_worldjournal_nexus10.json'
def RunSmoothness(self, action_runner):
action_runner.ScrollElement()
def RunNavigateSteps(self, action_runner):
action_runner.NavigateToPage(self)
action_runner.Wait(15)
class SkiaWorldjournalNexus10PageSet(page_set_module.PageSet):
""" Pages designed to represent the median, not highly optimized web """
def __init__(self):
super(SkiaWorldjournalNexus10PageSet, self).__init__(
user_agent_type='tablet',
archive_data_file='data/skia_worldjournal_nexus10.json')
urls_list = [
# Why: Chinese font test case
'http://worldjournal.com/',
]
for url in urls_list:
self.AddPage(SkiaBuildbotDesktopPage(url, self))
Remove action_runner steps for worldjournal pageset to prevent crashes
BUG=skia:3196
NOTRY=true
Review URL: https://codereview.chromium.org/795173002 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# pylint: disable=W0401,W0614
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class SkiaBuildbotDesktopPage(page_module.Page):
def __init__(self, url, page_set):
super(SkiaBuildbotDesktopPage, self).__init__(
url=url,
page_set=page_set,
credentials_path='data/credentials.json')
self.user_agent_type = 'tablet'
self.archive_data_file = 'data/skia_worldjournal_nexus10.json'
class SkiaWorldjournalNexus10PageSet(page_set_module.PageSet):
""" Pages designed to represent the median, not highly optimized web """
def __init__(self):
super(SkiaWorldjournalNexus10PageSet, self).__init__(
user_agent_type='tablet',
archive_data_file='data/skia_worldjournal_nexus10.json')
urls_list = [
# Why: Chinese font test case
'http://worldjournal.com/',
]
for url in urls_list:
self.AddPage(SkiaBuildbotDesktopPage(url, self))
| <commit_before># Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# pylint: disable=W0401,W0614
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class SkiaBuildbotDesktopPage(page_module.Page):
def __init__(self, url, page_set):
super(SkiaBuildbotDesktopPage, self).__init__(
url=url,
page_set=page_set,
credentials_path='data/credentials.json')
self.user_agent_type = 'tablet'
self.archive_data_file = 'data/skia_worldjournal_nexus10.json'
def RunSmoothness(self, action_runner):
action_runner.ScrollElement()
def RunNavigateSteps(self, action_runner):
action_runner.NavigateToPage(self)
action_runner.Wait(15)
class SkiaWorldjournalNexus10PageSet(page_set_module.PageSet):
""" Pages designed to represent the median, not highly optimized web """
def __init__(self):
super(SkiaWorldjournalNexus10PageSet, self).__init__(
user_agent_type='tablet',
archive_data_file='data/skia_worldjournal_nexus10.json')
urls_list = [
# Why: Chinese font test case
'http://worldjournal.com/',
]
for url in urls_list:
self.AddPage(SkiaBuildbotDesktopPage(url, self))
<commit_msg>Remove action_runner steps for worldjournal pageset to prevent crashes
BUG=skia:3196
NOTRY=true
Review URL: https://codereview.chromium.org/795173002<commit_after> | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# pylint: disable=W0401,W0614
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class SkiaBuildbotDesktopPage(page_module.Page):
def __init__(self, url, page_set):
super(SkiaBuildbotDesktopPage, self).__init__(
url=url,
page_set=page_set,
credentials_path='data/credentials.json')
self.user_agent_type = 'tablet'
self.archive_data_file = 'data/skia_worldjournal_nexus10.json'
class SkiaWorldjournalNexus10PageSet(page_set_module.PageSet):
""" Pages designed to represent the median, not highly optimized web """
def __init__(self):
super(SkiaWorldjournalNexus10PageSet, self).__init__(
user_agent_type='tablet',
archive_data_file='data/skia_worldjournal_nexus10.json')
urls_list = [
# Why: Chinese font test case
'http://worldjournal.com/',
]
for url in urls_list:
self.AddPage(SkiaBuildbotDesktopPage(url, self))
| # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# pylint: disable=W0401,W0614
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class SkiaBuildbotDesktopPage(page_module.Page):
def __init__(self, url, page_set):
super(SkiaBuildbotDesktopPage, self).__init__(
url=url,
page_set=page_set,
credentials_path='data/credentials.json')
self.user_agent_type = 'tablet'
self.archive_data_file = 'data/skia_worldjournal_nexus10.json'
def RunSmoothness(self, action_runner):
action_runner.ScrollElement()
def RunNavigateSteps(self, action_runner):
action_runner.NavigateToPage(self)
action_runner.Wait(15)
class SkiaWorldjournalNexus10PageSet(page_set_module.PageSet):
""" Pages designed to represent the median, not highly optimized web """
def __init__(self):
super(SkiaWorldjournalNexus10PageSet, self).__init__(
user_agent_type='tablet',
archive_data_file='data/skia_worldjournal_nexus10.json')
urls_list = [
# Why: Chinese font test case
'http://worldjournal.com/',
]
for url in urls_list:
self.AddPage(SkiaBuildbotDesktopPage(url, self))
Remove action_runner steps for worldjournal pageset to prevent crashes
BUG=skia:3196
NOTRY=true
Review URL: https://codereview.chromium.org/795173002# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# pylint: disable=W0401,W0614
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class SkiaBuildbotDesktopPage(page_module.Page):
def __init__(self, url, page_set):
super(SkiaBuildbotDesktopPage, self).__init__(
url=url,
page_set=page_set,
credentials_path='data/credentials.json')
self.user_agent_type = 'tablet'
self.archive_data_file = 'data/skia_worldjournal_nexus10.json'
class SkiaWorldjournalNexus10PageSet(page_set_module.PageSet):
""" Pages designed to represent the median, not highly optimized web """
def __init__(self):
super(SkiaWorldjournalNexus10PageSet, self).__init__(
user_agent_type='tablet',
archive_data_file='data/skia_worldjournal_nexus10.json')
urls_list = [
# Why: Chinese font test case
'http://worldjournal.com/',
]
for url in urls_list:
self.AddPage(SkiaBuildbotDesktopPage(url, self))
| <commit_before># Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# pylint: disable=W0401,W0614
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class SkiaBuildbotDesktopPage(page_module.Page):
def __init__(self, url, page_set):
super(SkiaBuildbotDesktopPage, self).__init__(
url=url,
page_set=page_set,
credentials_path='data/credentials.json')
self.user_agent_type = 'tablet'
self.archive_data_file = 'data/skia_worldjournal_nexus10.json'
def RunSmoothness(self, action_runner):
action_runner.ScrollElement()
def RunNavigateSteps(self, action_runner):
action_runner.NavigateToPage(self)
action_runner.Wait(15)
class SkiaWorldjournalNexus10PageSet(page_set_module.PageSet):
""" Pages designed to represent the median, not highly optimized web """
def __init__(self):
super(SkiaWorldjournalNexus10PageSet, self).__init__(
user_agent_type='tablet',
archive_data_file='data/skia_worldjournal_nexus10.json')
urls_list = [
# Why: Chinese font test case
'http://worldjournal.com/',
]
for url in urls_list:
self.AddPage(SkiaBuildbotDesktopPage(url, self))
<commit_msg>Remove action_runner steps for worldjournal pageset to prevent crashes
BUG=skia:3196
NOTRY=true
Review URL: https://codereview.chromium.org/795173002<commit_after># Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# pylint: disable=W0401,W0614
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class SkiaBuildbotDesktopPage(page_module.Page):
def __init__(self, url, page_set):
super(SkiaBuildbotDesktopPage, self).__init__(
url=url,
page_set=page_set,
credentials_path='data/credentials.json')
self.user_agent_type = 'tablet'
self.archive_data_file = 'data/skia_worldjournal_nexus10.json'
class SkiaWorldjournalNexus10PageSet(page_set_module.PageSet):
""" Pages designed to represent the median, not highly optimized web """
def __init__(self):
super(SkiaWorldjournalNexus10PageSet, self).__init__(
user_agent_type='tablet',
archive_data_file='data/skia_worldjournal_nexus10.json')
urls_list = [
# Why: Chinese font test case
'http://worldjournal.com/',
]
for url in urls_list:
self.AddPage(SkiaBuildbotDesktopPage(url, self))
|
a1c87c491bf936d441ef7fd79b531384fa174138 | simpleubjson/version.py | simpleubjson/version.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
__version_info__ = (0, 6, 0, 'dev', 0)
__version__ = '{version}{tag}{build}'.format(
version='.'.join(map(str, __version_info__[:3])),
tag='-' + __version_info__[3] if __version_info__[3] else '',
build='.' + str(__version_info__[4]) if __version_info__[4] else ''
)
| # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
__version_info__ = (0, 6, 0, 'dev', 0)
__version__ = '%(version)s%(tag)s%(build)s' % {
'version': '.'.join(map(str, __version_info__[:3])),
'tag': '-' + __version_info__[3] if __version_info__[3] else '',
'build': '.' + str(__version_info__[4]) if __version_info__[4] else ''
}
| Fix compatibility with Python 2.5 | Fix compatibility with Python 2.5
| Python | bsd-2-clause | kxepal/simpleubjson,brainwater/simpleubjson,samipshah/simpleubjson,498888197/simpleubjson | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
__version_info__ = (0, 6, 0, 'dev', 0)
__version__ = '{version}{tag}{build}'.format(
version='.'.join(map(str, __version_info__[:3])),
tag='-' + __version_info__[3] if __version_info__[3] else '',
build='.' + str(__version_info__[4]) if __version_info__[4] else ''
)
Fix compatibility with Python 2.5 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
__version_info__ = (0, 6, 0, 'dev', 0)
__version__ = '%(version)s%(tag)s%(build)s' % {
'version': '.'.join(map(str, __version_info__[:3])),
'tag': '-' + __version_info__[3] if __version_info__[3] else '',
'build': '.' + str(__version_info__[4]) if __version_info__[4] else ''
}
| <commit_before># -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
__version_info__ = (0, 6, 0, 'dev', 0)
__version__ = '{version}{tag}{build}'.format(
version='.'.join(map(str, __version_info__[:3])),
tag='-' + __version_info__[3] if __version_info__[3] else '',
build='.' + str(__version_info__[4]) if __version_info__[4] else ''
)
<commit_msg>Fix compatibility with Python 2.5<commit_after> | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
__version_info__ = (0, 6, 0, 'dev', 0)
__version__ = '%(version)s%(tag)s%(build)s' % {
'version': '.'.join(map(str, __version_info__[:3])),
'tag': '-' + __version_info__[3] if __version_info__[3] else '',
'build': '.' + str(__version_info__[4]) if __version_info__[4] else ''
}
| # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
__version_info__ = (0, 6, 0, 'dev', 0)
__version__ = '{version}{tag}{build}'.format(
version='.'.join(map(str, __version_info__[:3])),
tag='-' + __version_info__[3] if __version_info__[3] else '',
build='.' + str(__version_info__[4]) if __version_info__[4] else ''
)
Fix compatibility with Python 2.5# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
__version_info__ = (0, 6, 0, 'dev', 0)
__version__ = '%(version)s%(tag)s%(build)s' % {
'version': '.'.join(map(str, __version_info__[:3])),
'tag': '-' + __version_info__[3] if __version_info__[3] else '',
'build': '.' + str(__version_info__[4]) if __version_info__[4] else ''
}
| <commit_before># -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
__version_info__ = (0, 6, 0, 'dev', 0)
__version__ = '{version}{tag}{build}'.format(
version='.'.join(map(str, __version_info__[:3])),
tag='-' + __version_info__[3] if __version_info__[3] else '',
build='.' + str(__version_info__[4]) if __version_info__[4] else ''
)
<commit_msg>Fix compatibility with Python 2.5<commit_after># -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
__version_info__ = (0, 6, 0, 'dev', 0)
__version__ = '%(version)s%(tag)s%(build)s' % {
'version': '.'.join(map(str, __version_info__[:3])),
'tag': '-' + __version_info__[3] if __version_info__[3] else '',
'build': '.' + str(__version_info__[4]) if __version_info__[4] else ''
}
|
30f259dbd1c5c9963a5a75855188e4f668626fb7 | test/test_Spectrum.py | test/test_Spectrum.py | #!/usr/bin/env python
from __future__ import division, print_function
import pytest
import sys
# Add Spectrum location to path
sys.path.append('../')
import Spectrum
# Test using hypothesis
def test_spectrum_assigns_data():
x = [1,2,3,4,5,6]
y = [1,1,0.9,0.95,1,1]
z = 2200*x
spec = Spectrum.Spectrum(x, y, z)
assert spec.flux == y
assert spec.pixel == x
assert spec.wavelength == z
| #!/usr/bin/env python
from __future__ import division, print_function
import pytest
import sys
# Add Spectrum location to path
sys.path.append('../')
import Spectrum
# Test using hypothesis
from hypothesis import given
import hypothesis.strategies as st
@given(st.lists(st.integers()), st.lists(st.floats()), st.lists(st.floats()))
def test_spectrum_assigns_hypothesis_data(x, y, z):
spec = Spectrum.Spectrum(x, y, z)
assert spec.flux == y
assert spec.pixel == x
assert spec.wavelength == z
def test_spectrum_assigns_data():
x = [1,2,3,4,5,6]
y = [1,1,0.9,0.95,1,1]
z = 2200*x
spec = Spectrum.Spectrum(x, y, z)
assert spec.flux == y
assert spec.pixel == x
assert spec.wavelength == z
| Add hypothesis test to test assignment | Add hypothesis test to test assignment
| Python | mit | jason-neal/spectrum_overload,jason-neal/spectrum_overload,jason-neal/spectrum_overload | #!/usr/bin/env python
from __future__ import division, print_function
import pytest
import sys
# Add Spectrum location to path
sys.path.append('../')
import Spectrum
# Test using hypothesis
def test_spectrum_assigns_data():
x = [1,2,3,4,5,6]
y = [1,1,0.9,0.95,1,1]
z = 2200*x
spec = Spectrum.Spectrum(x, y, z)
assert spec.flux == y
assert spec.pixel == x
assert spec.wavelength == z
Add hypothesis test to test assignment | #!/usr/bin/env python
from __future__ import division, print_function
import pytest
import sys
# Add Spectrum location to path
sys.path.append('../')
import Spectrum
# Test using hypothesis
from hypothesis import given
import hypothesis.strategies as st
@given(st.lists(st.integers()), st.lists(st.floats()), st.lists(st.floats()))
def test_spectrum_assigns_hypothesis_data(x, y, z):
spec = Spectrum.Spectrum(x, y, z)
assert spec.flux == y
assert spec.pixel == x
assert spec.wavelength == z
def test_spectrum_assigns_data():
x = [1,2,3,4,5,6]
y = [1,1,0.9,0.95,1,1]
z = 2200*x
spec = Spectrum.Spectrum(x, y, z)
assert spec.flux == y
assert spec.pixel == x
assert spec.wavelength == z
| <commit_before>#!/usr/bin/env python
from __future__ import division, print_function
import pytest
import sys
# Add Spectrum location to path
sys.path.append('../')
import Spectrum
# Test using hypothesis
def test_spectrum_assigns_data():
x = [1,2,3,4,5,6]
y = [1,1,0.9,0.95,1,1]
z = 2200*x
spec = Spectrum.Spectrum(x, y, z)
assert spec.flux == y
assert spec.pixel == x
assert spec.wavelength == z
<commit_msg>Add hypothesis test to test assignment<commit_after> | #!/usr/bin/env python
from __future__ import division, print_function
import pytest
import sys
# Add Spectrum location to path
sys.path.append('../')
import Spectrum
# Test using hypothesis
from hypothesis import given
import hypothesis.strategies as st
@given(st.lists(st.integers()), st.lists(st.floats()), st.lists(st.floats()))
def test_spectrum_assigns_hypothesis_data(x, y, z):
spec = Spectrum.Spectrum(x, y, z)
assert spec.flux == y
assert spec.pixel == x
assert spec.wavelength == z
def test_spectrum_assigns_data():
x = [1,2,3,4,5,6]
y = [1,1,0.9,0.95,1,1]
z = 2200*x
spec = Spectrum.Spectrum(x, y, z)
assert spec.flux == y
assert spec.pixel == x
assert spec.wavelength == z
| #!/usr/bin/env python
from __future__ import division, print_function
import pytest
import sys
# Add Spectrum location to path
sys.path.append('../')
import Spectrum
# Test using hypothesis
def test_spectrum_assigns_data():
x = [1,2,3,4,5,6]
y = [1,1,0.9,0.95,1,1]
z = 2200*x
spec = Spectrum.Spectrum(x, y, z)
assert spec.flux == y
assert spec.pixel == x
assert spec.wavelength == z
Add hypothesis test to test assignment#!/usr/bin/env python
from __future__ import division, print_function
import pytest
import sys
# Add Spectrum location to path
sys.path.append('../')
import Spectrum
# Test using hypothesis
from hypothesis import given
import hypothesis.strategies as st
@given(st.lists(st.integers()), st.lists(st.floats()), st.lists(st.floats()))
def test_spectrum_assigns_hypothesis_data(x, y, z):
spec = Spectrum.Spectrum(x, y, z)
assert spec.flux == y
assert spec.pixel == x
assert spec.wavelength == z
def test_spectrum_assigns_data():
x = [1,2,3,4,5,6]
y = [1,1,0.9,0.95,1,1]
z = 2200*x
spec = Spectrum.Spectrum(x, y, z)
assert spec.flux == y
assert spec.pixel == x
assert spec.wavelength == z
| <commit_before>#!/usr/bin/env python
from __future__ import division, print_function
import pytest
import sys
# Add Spectrum location to path
sys.path.append('../')
import Spectrum
# Test using hypothesis
def test_spectrum_assigns_data():
x = [1,2,3,4,5,6]
y = [1,1,0.9,0.95,1,1]
z = 2200*x
spec = Spectrum.Spectrum(x, y, z)
assert spec.flux == y
assert spec.pixel == x
assert spec.wavelength == z
<commit_msg>Add hypothesis test to test assignment<commit_after>#!/usr/bin/env python
from __future__ import division, print_function
import pytest
import sys
# Add Spectrum location to path
sys.path.append('../')
import Spectrum
# Test using hypothesis
from hypothesis import given
import hypothesis.strategies as st
@given(st.lists(st.integers()), st.lists(st.floats()), st.lists(st.floats()))
def test_spectrum_assigns_hypothesis_data(x, y, z):
spec = Spectrum.Spectrum(x, y, z)
assert spec.flux == y
assert spec.pixel == x
assert spec.wavelength == z
def test_spectrum_assigns_data():
x = [1,2,3,4,5,6]
y = [1,1,0.9,0.95,1,1]
z = 2200*x
spec = Spectrum.Spectrum(x, y, z)
assert spec.flux == y
assert spec.pixel == x
assert spec.wavelength == z
|
ff471c9eb9f13b7dbb0c704aca2a8338576d243a | examples/hello_world/hello_world.py | examples/hello_world/hello_world.py | #!/usr/bin/env python
# encoding: utf-8
"""
A Simple Example Flask Application
==================================
"""
# Third Party Libs
from flask import Flask
# First Party Libs
from flask_hal import HAL, document
app = Flask(__name__)
HAL(app) # Initialise HAL
@app.route('/hello')
def foo():
return document.Document(data={
'message': 'Hello World'
})
if __name__ == "__main__":
app.run()
| #!/usr/bin/env python
# encoding: utf-8
"""
A Simple Example Flask Application
==================================
"""
# Third Party Libs
from flask import Flask
# First Party Libs
from flask_hal import HAL, document
app = Flask(__name__)
HAL(app) # Initialise HAL
@app.route('/hello')
def hello():
return document.Document(data={
'message': 'Hello World'
})
if __name__ == "__main__":
app.run(debug=True)
| Rename example foo method to hello and run in debug | Rename example foo method to hello and run in debug
| Python | unlicense | thisissoon/Flask-HAL,thisissoon/Flask-HAL | #!/usr/bin/env python
# encoding: utf-8
"""
A Simple Example Flask Application
==================================
"""
# Third Party Libs
from flask import Flask
# First Party Libs
from flask_hal import HAL, document
app = Flask(__name__)
HAL(app) # Initialise HAL
@app.route('/hello')
def foo():
return document.Document(data={
'message': 'Hello World'
})
if __name__ == "__main__":
app.run()
Rename example foo method to hello and run in debug | #!/usr/bin/env python
# encoding: utf-8
"""
A Simple Example Flask Application
==================================
"""
# Third Party Libs
from flask import Flask
# First Party Libs
from flask_hal import HAL, document
app = Flask(__name__)
HAL(app) # Initialise HAL
@app.route('/hello')
def hello():
return document.Document(data={
'message': 'Hello World'
})
if __name__ == "__main__":
app.run(debug=True)
| <commit_before>#!/usr/bin/env python
# encoding: utf-8
"""
A Simple Example Flask Application
==================================
"""
# Third Party Libs
from flask import Flask
# First Party Libs
from flask_hal import HAL, document
app = Flask(__name__)
HAL(app) # Initialise HAL
@app.route('/hello')
def foo():
return document.Document(data={
'message': 'Hello World'
})
if __name__ == "__main__":
app.run()
<commit_msg>Rename example foo method to hello and run in debug<commit_after> | #!/usr/bin/env python
# encoding: utf-8
"""
A Simple Example Flask Application
==================================
"""
# Third Party Libs
from flask import Flask
# First Party Libs
from flask_hal import HAL, document
app = Flask(__name__)
HAL(app) # Initialise HAL
@app.route('/hello')
def hello():
return document.Document(data={
'message': 'Hello World'
})
if __name__ == "__main__":
app.run(debug=True)
| #!/usr/bin/env python
# encoding: utf-8
"""
A Simple Example Flask Application
==================================
"""
# Third Party Libs
from flask import Flask
# First Party Libs
from flask_hal import HAL, document
app = Flask(__name__)
HAL(app) # Initialise HAL
@app.route('/hello')
def foo():
return document.Document(data={
'message': 'Hello World'
})
if __name__ == "__main__":
app.run()
Rename example foo method to hello and run in debug#!/usr/bin/env python
# encoding: utf-8
"""
A Simple Example Flask Application
==================================
"""
# Third Party Libs
from flask import Flask
# First Party Libs
from flask_hal import HAL, document
app = Flask(__name__)
HAL(app) # Initialise HAL
@app.route('/hello')
def hello():
return document.Document(data={
'message': 'Hello World'
})
if __name__ == "__main__":
app.run(debug=True)
| <commit_before>#!/usr/bin/env python
# encoding: utf-8
"""
A Simple Example Flask Application
==================================
"""
# Third Party Libs
from flask import Flask
# First Party Libs
from flask_hal import HAL, document
app = Flask(__name__)
HAL(app) # Initialise HAL
@app.route('/hello')
def foo():
return document.Document(data={
'message': 'Hello World'
})
if __name__ == "__main__":
app.run()
<commit_msg>Rename example foo method to hello and run in debug<commit_after>#!/usr/bin/env python
# encoding: utf-8
"""
A Simple Example Flask Application
==================================
"""
# Third Party Libs
from flask import Flask
# First Party Libs
from flask_hal import HAL, document
app = Flask(__name__)
HAL(app) # Initialise HAL
@app.route('/hello')
def hello():
return document.Document(data={
'message': 'Hello World'
})
if __name__ == "__main__":
app.run(debug=True)
|
0fd464dcd405faa356c18d69a0b7419c5cff0f21 | pmxbot/__init__.py | pmxbot/__init__.py | # -*- coding: utf-8 -*-
# vim:ts=4:sw=4:noexpandtab
import importlib
from .dictlib import ConfigDict
config = ConfigDict(
bot_nickname = 'pmxbot',
database = 'sqlite:pmxbot.sqlite',
server_host = 'irc.freenode.net',
server_port = 6667,
use_ssl = False,
password = None,
silent_bot = False,
log_channels = [],
other_channels = [],
places = ['London', 'Tokyo', 'New York'],
feed_interval = 15, # minutes
feeds = [dict(
name = 'pmxbot bitbucket',
channel = '#inane',
linkurl = 'http://bitbucket.org/yougov/pmxbot',
url = 'http://bitbucket.org/yougov/pmxbot',
),
],
librarypaste = 'http://paste.jaraco.com',
)
"The config object"
if __name__ == '__main__':
importlib.import_module('pmxbot.core').run()
| # -*- coding: utf-8 -*-
# vim:ts=4:sw=4:noexpandtab
import importlib
from .dictlib import ConfigDict
config = ConfigDict(
bot_nickname = 'pmxbot',
database = 'sqlite:pmxbot.sqlite',
server_host = 'localhost',
server_port = 6667,
use_ssl = False,
password = None,
silent_bot = False,
log_channels = [],
other_channels = [],
places = ['London', 'Tokyo', 'New York'],
feed_interval = 15, # minutes
feeds = [dict(
name = 'pmxbot bitbucket',
channel = '#inane',
linkurl = 'http://bitbucket.org/yougov/pmxbot',
url = 'http://bitbucket.org/yougov/pmxbot',
),
],
librarypaste = 'http://paste.jaraco.com',
)
"The config object"
if __name__ == '__main__':
importlib.import_module('pmxbot.core').run()
| Use IRC server on localhost by default | Use IRC server on localhost by default
| Python | bsd-3-clause | jamwt/diesel-pmxbot,jamwt/diesel-pmxbot | # -*- coding: utf-8 -*-
# vim:ts=4:sw=4:noexpandtab
import importlib
from .dictlib import ConfigDict
config = ConfigDict(
bot_nickname = 'pmxbot',
database = 'sqlite:pmxbot.sqlite',
server_host = 'irc.freenode.net',
server_port = 6667,
use_ssl = False,
password = None,
silent_bot = False,
log_channels = [],
other_channels = [],
places = ['London', 'Tokyo', 'New York'],
feed_interval = 15, # minutes
feeds = [dict(
name = 'pmxbot bitbucket',
channel = '#inane',
linkurl = 'http://bitbucket.org/yougov/pmxbot',
url = 'http://bitbucket.org/yougov/pmxbot',
),
],
librarypaste = 'http://paste.jaraco.com',
)
"The config object"
if __name__ == '__main__':
importlib.import_module('pmxbot.core').run()
Use IRC server on localhost by default | # -*- coding: utf-8 -*-
# vim:ts=4:sw=4:noexpandtab
import importlib
from .dictlib import ConfigDict
config = ConfigDict(
bot_nickname = 'pmxbot',
database = 'sqlite:pmxbot.sqlite',
server_host = 'localhost',
server_port = 6667,
use_ssl = False,
password = None,
silent_bot = False,
log_channels = [],
other_channels = [],
places = ['London', 'Tokyo', 'New York'],
feed_interval = 15, # minutes
feeds = [dict(
name = 'pmxbot bitbucket',
channel = '#inane',
linkurl = 'http://bitbucket.org/yougov/pmxbot',
url = 'http://bitbucket.org/yougov/pmxbot',
),
],
librarypaste = 'http://paste.jaraco.com',
)
"The config object"
if __name__ == '__main__':
importlib.import_module('pmxbot.core').run()
| <commit_before># -*- coding: utf-8 -*-
# vim:ts=4:sw=4:noexpandtab
import importlib
from .dictlib import ConfigDict
config = ConfigDict(
bot_nickname = 'pmxbot',
database = 'sqlite:pmxbot.sqlite',
server_host = 'irc.freenode.net',
server_port = 6667,
use_ssl = False,
password = None,
silent_bot = False,
log_channels = [],
other_channels = [],
places = ['London', 'Tokyo', 'New York'],
feed_interval = 15, # minutes
feeds = [dict(
name = 'pmxbot bitbucket',
channel = '#inane',
linkurl = 'http://bitbucket.org/yougov/pmxbot',
url = 'http://bitbucket.org/yougov/pmxbot',
),
],
librarypaste = 'http://paste.jaraco.com',
)
"The config object"
if __name__ == '__main__':
importlib.import_module('pmxbot.core').run()
<commit_msg>Use IRC server on localhost by default<commit_after> | # -*- coding: utf-8 -*-
# vim:ts=4:sw=4:noexpandtab
import importlib
from .dictlib import ConfigDict
config = ConfigDict(
bot_nickname = 'pmxbot',
database = 'sqlite:pmxbot.sqlite',
server_host = 'localhost',
server_port = 6667,
use_ssl = False,
password = None,
silent_bot = False,
log_channels = [],
other_channels = [],
places = ['London', 'Tokyo', 'New York'],
feed_interval = 15, # minutes
feeds = [dict(
name = 'pmxbot bitbucket',
channel = '#inane',
linkurl = 'http://bitbucket.org/yougov/pmxbot',
url = 'http://bitbucket.org/yougov/pmxbot',
),
],
librarypaste = 'http://paste.jaraco.com',
)
"The config object"
if __name__ == '__main__':
importlib.import_module('pmxbot.core').run()
| # -*- coding: utf-8 -*-
# vim:ts=4:sw=4:noexpandtab
import importlib
from .dictlib import ConfigDict
config = ConfigDict(
bot_nickname = 'pmxbot',
database = 'sqlite:pmxbot.sqlite',
server_host = 'irc.freenode.net',
server_port = 6667,
use_ssl = False,
password = None,
silent_bot = False,
log_channels = [],
other_channels = [],
places = ['London', 'Tokyo', 'New York'],
feed_interval = 15, # minutes
feeds = [dict(
name = 'pmxbot bitbucket',
channel = '#inane',
linkurl = 'http://bitbucket.org/yougov/pmxbot',
url = 'http://bitbucket.org/yougov/pmxbot',
),
],
librarypaste = 'http://paste.jaraco.com',
)
"The config object"
if __name__ == '__main__':
importlib.import_module('pmxbot.core').run()
Use IRC server on localhost by default# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:noexpandtab
import importlib
from .dictlib import ConfigDict
config = ConfigDict(
bot_nickname = 'pmxbot',
database = 'sqlite:pmxbot.sqlite',
server_host = 'localhost',
server_port = 6667,
use_ssl = False,
password = None,
silent_bot = False,
log_channels = [],
other_channels = [],
places = ['London', 'Tokyo', 'New York'],
feed_interval = 15, # minutes
feeds = [dict(
name = 'pmxbot bitbucket',
channel = '#inane',
linkurl = 'http://bitbucket.org/yougov/pmxbot',
url = 'http://bitbucket.org/yougov/pmxbot',
),
],
librarypaste = 'http://paste.jaraco.com',
)
"The config object"
if __name__ == '__main__':
importlib.import_module('pmxbot.core').run()
| <commit_before># -*- coding: utf-8 -*-
# vim:ts=4:sw=4:noexpandtab
import importlib
from .dictlib import ConfigDict
config = ConfigDict(
bot_nickname = 'pmxbot',
database = 'sqlite:pmxbot.sqlite',
server_host = 'irc.freenode.net',
server_port = 6667,
use_ssl = False,
password = None,
silent_bot = False,
log_channels = [],
other_channels = [],
places = ['London', 'Tokyo', 'New York'],
feed_interval = 15, # minutes
feeds = [dict(
name = 'pmxbot bitbucket',
channel = '#inane',
linkurl = 'http://bitbucket.org/yougov/pmxbot',
url = 'http://bitbucket.org/yougov/pmxbot',
),
],
librarypaste = 'http://paste.jaraco.com',
)
"The config object"
if __name__ == '__main__':
importlib.import_module('pmxbot.core').run()
<commit_msg>Use IRC server on localhost by default<commit_after># -*- coding: utf-8 -*-
# vim:ts=4:sw=4:noexpandtab
import importlib
from .dictlib import ConfigDict
config = ConfigDict(
bot_nickname = 'pmxbot',
database = 'sqlite:pmxbot.sqlite',
server_host = 'localhost',
server_port = 6667,
use_ssl = False,
password = None,
silent_bot = False,
log_channels = [],
other_channels = [],
places = ['London', 'Tokyo', 'New York'],
feed_interval = 15, # minutes
feeds = [dict(
name = 'pmxbot bitbucket',
channel = '#inane',
linkurl = 'http://bitbucket.org/yougov/pmxbot',
url = 'http://bitbucket.org/yougov/pmxbot',
),
],
librarypaste = 'http://paste.jaraco.com',
)
"The config object"
if __name__ == '__main__':
importlib.import_module('pmxbot.core').run()
|
547e002534d3a9757c84bad7e125b9186dd78078 | tests/test_common.py | tests/test_common.py | import os, os.path
import ConfigParser
package = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
import slack
class TestSlack(object):
def setup(self):
self.set_up_config()
self.set_up_slack()
def set_up_config(self):
search_paths = [os.path.expanduser('~/.slack'), '/etc/slack']
self.config = ConfigParser.ConfigParser()
self.config.read(search_paths)
if self.config.has_section('Slack'):
self.access_token = self.config.get('Slack', 'token')
elif 'SLACK_TOKEN' in os.environ:
self.access_token = os.environ['SLACK_TOKEN']
else:
print('Authorization token not detected! The token is pulled from '\
'~/.slack, /etc/slack, or the environment variable SLACK_TOKEN.')
self.test_channel = self.config.get('Slack', 'test-channel')
def set_up_slack(self):
self.slack = slack.Slack(self.access_token)
| import os, os.path
import ConfigParser
package = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
import slack
class TestSlack(object):
def setup(self):
self.set_up_config()
self.set_up_slack()
def set_up_config(self):
search_paths = [os.path.expanduser('~/.slack'), '/etc/slack']
self.config = ConfigParser.ConfigParser()
self.config.read(search_paths)
if self.config.has_section('Slack'):
self.access_token = self.config.get('Slack', 'token')
elif 'SLACK_TOKEN' in os.environ:
self.access_token = os.environ['SLACK_TOKEN']
else:
print('Authorization token not detected! The token is pulled from '\
'~/.slack, /etc/slack, or the environment variable SLACK_TOKEN.')
self.test_channel = self.config.get('Slack', 'test-channel')
self.test_channel_name = self.config.get('Slack', 'test-channel-name')
def set_up_slack(self):
self.slack = slack.Slack(self.access_token)
| Add new channel name for test. | Add new channel name for test.
| Python | mit | nabetama/slacky | import os, os.path
import ConfigParser
package = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
import slack
class TestSlack(object):
def setup(self):
self.set_up_config()
self.set_up_slack()
def set_up_config(self):
search_paths = [os.path.expanduser('~/.slack'), '/etc/slack']
self.config = ConfigParser.ConfigParser()
self.config.read(search_paths)
if self.config.has_section('Slack'):
self.access_token = self.config.get('Slack', 'token')
elif 'SLACK_TOKEN' in os.environ:
self.access_token = os.environ['SLACK_TOKEN']
else:
print('Authorization token not detected! The token is pulled from '\
'~/.slack, /etc/slack, or the environment variable SLACK_TOKEN.')
self.test_channel = self.config.get('Slack', 'test-channel')
def set_up_slack(self):
self.slack = slack.Slack(self.access_token)
Add new channel name for test. | import os, os.path
import ConfigParser
package = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
import slack
class TestSlack(object):
def setup(self):
self.set_up_config()
self.set_up_slack()
def set_up_config(self):
search_paths = [os.path.expanduser('~/.slack'), '/etc/slack']
self.config = ConfigParser.ConfigParser()
self.config.read(search_paths)
if self.config.has_section('Slack'):
self.access_token = self.config.get('Slack', 'token')
elif 'SLACK_TOKEN' in os.environ:
self.access_token = os.environ['SLACK_TOKEN']
else:
print('Authorization token not detected! The token is pulled from '\
'~/.slack, /etc/slack, or the environment variable SLACK_TOKEN.')
self.test_channel = self.config.get('Slack', 'test-channel')
self.test_channel_name = self.config.get('Slack', 'test-channel-name')
def set_up_slack(self):
self.slack = slack.Slack(self.access_token)
| <commit_before>import os, os.path
import ConfigParser
package = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
import slack
class TestSlack(object):
def setup(self):
self.set_up_config()
self.set_up_slack()
def set_up_config(self):
search_paths = [os.path.expanduser('~/.slack'), '/etc/slack']
self.config = ConfigParser.ConfigParser()
self.config.read(search_paths)
if self.config.has_section('Slack'):
self.access_token = self.config.get('Slack', 'token')
elif 'SLACK_TOKEN' in os.environ:
self.access_token = os.environ['SLACK_TOKEN']
else:
print('Authorization token not detected! The token is pulled from '\
'~/.slack, /etc/slack, or the environment variable SLACK_TOKEN.')
self.test_channel = self.config.get('Slack', 'test-channel')
def set_up_slack(self):
self.slack = slack.Slack(self.access_token)
<commit_msg>Add new channel name for test.<commit_after> | import os, os.path
import ConfigParser
package = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
import slack
class TestSlack(object):
def setup(self):
self.set_up_config()
self.set_up_slack()
def set_up_config(self):
search_paths = [os.path.expanduser('~/.slack'), '/etc/slack']
self.config = ConfigParser.ConfigParser()
self.config.read(search_paths)
if self.config.has_section('Slack'):
self.access_token = self.config.get('Slack', 'token')
elif 'SLACK_TOKEN' in os.environ:
self.access_token = os.environ['SLACK_TOKEN']
else:
print('Authorization token not detected! The token is pulled from '\
'~/.slack, /etc/slack, or the environment variable SLACK_TOKEN.')
self.test_channel = self.config.get('Slack', 'test-channel')
self.test_channel_name = self.config.get('Slack', 'test-channel-name')
def set_up_slack(self):
self.slack = slack.Slack(self.access_token)
| import os, os.path
import ConfigParser
package = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
import slack
class TestSlack(object):
def setup(self):
self.set_up_config()
self.set_up_slack()
def set_up_config(self):
search_paths = [os.path.expanduser('~/.slack'), '/etc/slack']
self.config = ConfigParser.ConfigParser()
self.config.read(search_paths)
if self.config.has_section('Slack'):
self.access_token = self.config.get('Slack', 'token')
elif 'SLACK_TOKEN' in os.environ:
self.access_token = os.environ['SLACK_TOKEN']
else:
print('Authorization token not detected! The token is pulled from '\
'~/.slack, /etc/slack, or the environment variable SLACK_TOKEN.')
self.test_channel = self.config.get('Slack', 'test-channel')
def set_up_slack(self):
self.slack = slack.Slack(self.access_token)
Add new channel name for test.import os, os.path
import ConfigParser
package = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
import slack
class TestSlack(object):
def setup(self):
self.set_up_config()
self.set_up_slack()
def set_up_config(self):
search_paths = [os.path.expanduser('~/.slack'), '/etc/slack']
self.config = ConfigParser.ConfigParser()
self.config.read(search_paths)
if self.config.has_section('Slack'):
self.access_token = self.config.get('Slack', 'token')
elif 'SLACK_TOKEN' in os.environ:
self.access_token = os.environ['SLACK_TOKEN']
else:
print('Authorization token not detected! The token is pulled from '\
'~/.slack, /etc/slack, or the environment variable SLACK_TOKEN.')
self.test_channel = self.config.get('Slack', 'test-channel')
self.test_channel_name = self.config.get('Slack', 'test-channel-name')
def set_up_slack(self):
self.slack = slack.Slack(self.access_token)
| <commit_before>import os, os.path
import ConfigParser
package = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
import slack
class TestSlack(object):
def setup(self):
self.set_up_config()
self.set_up_slack()
def set_up_config(self):
search_paths = [os.path.expanduser('~/.slack'), '/etc/slack']
self.config = ConfigParser.ConfigParser()
self.config.read(search_paths)
if self.config.has_section('Slack'):
self.access_token = self.config.get('Slack', 'token')
elif 'SLACK_TOKEN' in os.environ:
self.access_token = os.environ['SLACK_TOKEN']
else:
print('Authorization token not detected! The token is pulled from '\
'~/.slack, /etc/slack, or the environment variable SLACK_TOKEN.')
self.test_channel = self.config.get('Slack', 'test-channel')
def set_up_slack(self):
self.slack = slack.Slack(self.access_token)
<commit_msg>Add new channel name for test.<commit_after>import os, os.path
import ConfigParser
package = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
import slack
class TestSlack(object):
def setup(self):
self.set_up_config()
self.set_up_slack()
def set_up_config(self):
search_paths = [os.path.expanduser('~/.slack'), '/etc/slack']
self.config = ConfigParser.ConfigParser()
self.config.read(search_paths)
if self.config.has_section('Slack'):
self.access_token = self.config.get('Slack', 'token')
elif 'SLACK_TOKEN' in os.environ:
self.access_token = os.environ['SLACK_TOKEN']
else:
print('Authorization token not detected! The token is pulled from '\
'~/.slack, /etc/slack, or the environment variable SLACK_TOKEN.')
self.test_channel = self.config.get('Slack', 'test-channel')
self.test_channel_name = self.config.get('Slack', 'test-channel-name')
def set_up_slack(self):
self.slack = slack.Slack(self.access_token)
|
8d32970073c699e06663cae12861b58e7c365f2c | tests/test_rtnorm.py | tests/test_rtnorm.py |
# This should plot a histogram looking like a gaussian
# ... It does.
## CONFIGURATION (play with different values)
samples = int(1e6)
minimum = 1.
maximum = 17.
center = 7.
stddev = 5.
## VARIABLES FROM RANDOM TRUNCATED NORMAL DISTRIBUTION
from lib.rtnorm import rtnorm
variables = rtnorm(minimum, maximum, mu=center, sigma=stddev, size=samples)
## PLOT THEIR HISTOGRAM
import matplotlib.pyplot as plot
plot.hist(variables, bins=400)
plot.show()
|
import unittest
import matplotlib.pyplot as plot
import numpy as np
import sys
sys.path.append('.') # T_T
from lib.rtnorm import rtnorm
class RunTest(unittest.TestCase):
longMessage = True
def test_histogram(self):
"""
This should plot a histogram looking like a gaussian
... It does.
"""
# CONFIGURATION (play with different values)
samples = int(1e6)
minimum = 1.
maximum = 17.
center = 7.
stddev = 5.
# VARIABLES FROM RANDOM TRUNCATED NORMAL DISTRIBUTION
variables = rtnorm(minimum, maximum, mu=center, sigma=stddev,
size=samples)
# PLOT THEIR HISTOGRAM
plot.hist(variables, bins=400)
plot.show()
def test_sanity(self):
"""
Simple sanity test for the random truncated normal distribution.
"""
from sys import maxint
# Generate an array with one number
r = rtnorm(0, maxint)
self.assertTrue(isinstance(r, np.ndarray))
self.assertTrue(len(r) == 1)
self.assertTrue((r > 0).all())
self.assertTrue((r < maxint).all())
# Generate an array with 42 numbers
r = rtnorm(0, maxint, size=42)
self.assertTrue(isinstance(r, np.ndarray))
self.assertTrue(len(r) == 42)
self.assertTrue((r > 0).all())
self.assertTrue((r < maxint).all())
| Fix the random truncated distribution tests | Fix the random truncated distribution tests
| Python | mit | irap-omp/deconv3d,irap-omp/deconv3d |
# This should plot a histogram looking like a gaussian
# ... It does.
## CONFIGURATION (play with different values)
samples = int(1e6)
minimum = 1.
maximum = 17.
center = 7.
stddev = 5.
## VARIABLES FROM RANDOM TRUNCATED NORMAL DISTRIBUTION
from lib.rtnorm import rtnorm
variables = rtnorm(minimum, maximum, mu=center, sigma=stddev, size=samples)
## PLOT THEIR HISTOGRAM
import matplotlib.pyplot as plot
plot.hist(variables, bins=400)
plot.show()
Fix the random truncated distribution tests |
import unittest
import matplotlib.pyplot as plot
import numpy as np
import sys
sys.path.append('.') # T_T
from lib.rtnorm import rtnorm
class RunTest(unittest.TestCase):
longMessage = True
def test_histogram(self):
"""
This should plot a histogram looking like a gaussian
... It does.
"""
# CONFIGURATION (play with different values)
samples = int(1e6)
minimum = 1.
maximum = 17.
center = 7.
stddev = 5.
# VARIABLES FROM RANDOM TRUNCATED NORMAL DISTRIBUTION
variables = rtnorm(minimum, maximum, mu=center, sigma=stddev,
size=samples)
# PLOT THEIR HISTOGRAM
plot.hist(variables, bins=400)
plot.show()
def test_sanity(self):
"""
Simple sanity test for the random truncated normal distribution.
"""
from sys import maxint
# Generate an array with one number
r = rtnorm(0, maxint)
self.assertTrue(isinstance(r, np.ndarray))
self.assertTrue(len(r) == 1)
self.assertTrue((r > 0).all())
self.assertTrue((r < maxint).all())
# Generate an array with 42 numbers
r = rtnorm(0, maxint, size=42)
self.assertTrue(isinstance(r, np.ndarray))
self.assertTrue(len(r) == 42)
self.assertTrue((r > 0).all())
self.assertTrue((r < maxint).all())
| <commit_before>
# This should plot a histogram looking like a gaussian
# ... It does.
## CONFIGURATION (play with different values)
samples = int(1e6)
minimum = 1.
maximum = 17.
center = 7.
stddev = 5.
## VARIABLES FROM RANDOM TRUNCATED NORMAL DISTRIBUTION
from lib.rtnorm import rtnorm
variables = rtnorm(minimum, maximum, mu=center, sigma=stddev, size=samples)
## PLOT THEIR HISTOGRAM
import matplotlib.pyplot as plot
plot.hist(variables, bins=400)
plot.show()
<commit_msg>Fix the random truncated distribution tests<commit_after> |
import unittest
import matplotlib.pyplot as plot
import numpy as np
import sys
sys.path.append('.') # T_T
from lib.rtnorm import rtnorm
class RunTest(unittest.TestCase):
longMessage = True
def test_histogram(self):
"""
This should plot a histogram looking like a gaussian
... It does.
"""
# CONFIGURATION (play with different values)
samples = int(1e6)
minimum = 1.
maximum = 17.
center = 7.
stddev = 5.
# VARIABLES FROM RANDOM TRUNCATED NORMAL DISTRIBUTION
variables = rtnorm(minimum, maximum, mu=center, sigma=stddev,
size=samples)
# PLOT THEIR HISTOGRAM
plot.hist(variables, bins=400)
plot.show()
def test_sanity(self):
"""
Simple sanity test for the random truncated normal distribution.
"""
from sys import maxint
# Generate an array with one number
r = rtnorm(0, maxint)
self.assertTrue(isinstance(r, np.ndarray))
self.assertTrue(len(r) == 1)
self.assertTrue((r > 0).all())
self.assertTrue((r < maxint).all())
# Generate an array with 42 numbers
r = rtnorm(0, maxint, size=42)
self.assertTrue(isinstance(r, np.ndarray))
self.assertTrue(len(r) == 42)
self.assertTrue((r > 0).all())
self.assertTrue((r < maxint).all())
|
# This should plot a histogram looking like a gaussian
# ... It does.
## CONFIGURATION (play with different values)
samples = int(1e6)
minimum = 1.
maximum = 17.
center = 7.
stddev = 5.
## VARIABLES FROM RANDOM TRUNCATED NORMAL DISTRIBUTION
from lib.rtnorm import rtnorm
variables = rtnorm(minimum, maximum, mu=center, sigma=stddev, size=samples)
## PLOT THEIR HISTOGRAM
import matplotlib.pyplot as plot
plot.hist(variables, bins=400)
plot.show()
Fix the random truncated distribution tests
import unittest
import matplotlib.pyplot as plot
import numpy as np
import sys
sys.path.append('.') # T_T
from lib.rtnorm import rtnorm
class RunTest(unittest.TestCase):
longMessage = True
def test_histogram(self):
"""
This should plot a histogram looking like a gaussian
... It does.
"""
# CONFIGURATION (play with different values)
samples = int(1e6)
minimum = 1.
maximum = 17.
center = 7.
stddev = 5.
# VARIABLES FROM RANDOM TRUNCATED NORMAL DISTRIBUTION
variables = rtnorm(minimum, maximum, mu=center, sigma=stddev,
size=samples)
# PLOT THEIR HISTOGRAM
plot.hist(variables, bins=400)
plot.show()
def test_sanity(self):
"""
Simple sanity test for the random truncated normal distribution.
"""
from sys import maxint
# Generate an array with one number
r = rtnorm(0, maxint)
self.assertTrue(isinstance(r, np.ndarray))
self.assertTrue(len(r) == 1)
self.assertTrue((r > 0).all())
self.assertTrue((r < maxint).all())
# Generate an array with 42 numbers
r = rtnorm(0, maxint, size=42)
self.assertTrue(isinstance(r, np.ndarray))
self.assertTrue(len(r) == 42)
self.assertTrue((r > 0).all())
self.assertTrue((r < maxint).all())
| <commit_before>
# This should plot a histogram looking like a gaussian
# ... It does.
## CONFIGURATION (play with different values)
samples = int(1e6)
minimum = 1.
maximum = 17.
center = 7.
stddev = 5.
## VARIABLES FROM RANDOM TRUNCATED NORMAL DISTRIBUTION
from lib.rtnorm import rtnorm
variables = rtnorm(minimum, maximum, mu=center, sigma=stddev, size=samples)
## PLOT THEIR HISTOGRAM
import matplotlib.pyplot as plot
plot.hist(variables, bins=400)
plot.show()
<commit_msg>Fix the random truncated distribution tests<commit_after>
import unittest
import matplotlib.pyplot as plot
import numpy as np
import sys
sys.path.append('.') # T_T
from lib.rtnorm import rtnorm
class RunTest(unittest.TestCase):
longMessage = True
def test_histogram(self):
"""
This should plot a histogram looking like a gaussian
... It does.
"""
# CONFIGURATION (play with different values)
samples = int(1e6)
minimum = 1.
maximum = 17.
center = 7.
stddev = 5.
# VARIABLES FROM RANDOM TRUNCATED NORMAL DISTRIBUTION
variables = rtnorm(minimum, maximum, mu=center, sigma=stddev,
size=samples)
# PLOT THEIR HISTOGRAM
plot.hist(variables, bins=400)
plot.show()
def test_sanity(self):
"""
Simple sanity test for the random truncated normal distribution.
"""
from sys import maxint
# Generate an array with one number
r = rtnorm(0, maxint)
self.assertTrue(isinstance(r, np.ndarray))
self.assertTrue(len(r) == 1)
self.assertTrue((r > 0).all())
self.assertTrue((r < maxint).all())
# Generate an array with 42 numbers
r = rtnorm(0, maxint, size=42)
self.assertTrue(isinstance(r, np.ndarray))
self.assertTrue(len(r) == 42)
self.assertTrue((r > 0).all())
self.assertTrue((r < maxint).all())
|
754707379a12058b4c66802c3f0545c0e634103d | bumblebee_status/modules/contrib/taskwarrior.py | bumblebee_status/modules/contrib/taskwarrior.py | """Displays the number of pending tasks in TaskWarrior.
Requires the following library:
* taskw
Parameters:
* taskwarrior.taskrc : path to the taskrc file (defaults to ~/.taskrc)
contributed by `chdorb <https://github.com/chdorb>`_ - many thanks!
"""
from taskw import TaskWarrior
import core.module
import core.widget
import core.decorators
class Module(core.module.Module):
def __init__(self, config, theme):
super().__init__(config, theme, core.widget.Widget(self.output))
self.__pending_tasks = "0"
def update(self):
"""Return a string with the number of pending tasks from TaskWarrior."""
try:
taskrc = self.parameter("taskrc", "~/.taskrc")
w = TaskWarrior(config_filename=taskrc)
pending_tasks = w.filter_tasks({"status": "pending"})
self.__pending_tasks = str(len(pending_tasks))
except:
self.__pending_tasks = "n/a"
def output(self, _):
"""Format the task counter to output in bumblebee."""
return "{}".format(self.__pending_tasks)
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
| """Displays the number of pending tasks in TaskWarrior.
Requires the following library:
* taskw
Parameters:
* taskwarrior.taskrc : path to the taskrc file (defaults to ~/.taskrc)
contributed by `chdorb <https://github.com/chdorb>`_ - many thanks!
"""
from taskw import TaskWarrior
import core.module
import core.widget
import core.decorators
class Module(core.module.Module):
def __init__(self, config, theme):
super().__init__(config, theme, core.widget.Widget(self.output))
self.__pending_tasks = "0"
def update(self):
"""Return a string with the number of pending tasks from TaskWarrior."""
try:
taskrc = self.parameter("taskrc", "~/.taskrc")
show_active = self.parameter("show_active", False)
w = TaskWarrior(config_filename=taskrc)
active_tasks = (
w.filter_tasks({"start.any": "", "status": "pending"}) or None
)
if show_active and active_tasks:
reporting_tasks = (
f"{active_tasks[0]['id']} - {active_tasks[0]['description']}"
)
else:
reporting_tasks = len(w.filter_tasks({"status": "pending"}))
self.__pending_tasks = reporting_tasks
except:
self.__pending_tasks = "n/a"
@core.decorators.scrollable
def output(self, _):
"""Format the task counter to output in bumblebee."""
return "{}".format(self.__pending_tasks)
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
| Add active-task display and scrolling | Add active-task display and scrolling
This adds an option allowing you to specify
"taskwarrior.show_active=true" in your bar configuration and will
display the current, active task id and description on the status bar, but will show the
number of pending tasks if one isn't active.
This also adds the scrolling decorator, since task descriptions can be
quite long.
| Python | mit | tobi-wan-kenobi/bumblebee-status,tobi-wan-kenobi/bumblebee-status | """Displays the number of pending tasks in TaskWarrior.
Requires the following library:
* taskw
Parameters:
* taskwarrior.taskrc : path to the taskrc file (defaults to ~/.taskrc)
contributed by `chdorb <https://github.com/chdorb>`_ - many thanks!
"""
from taskw import TaskWarrior
import core.module
import core.widget
import core.decorators
class Module(core.module.Module):
def __init__(self, config, theme):
super().__init__(config, theme, core.widget.Widget(self.output))
self.__pending_tasks = "0"
def update(self):
"""Return a string with the number of pending tasks from TaskWarrior."""
try:
taskrc = self.parameter("taskrc", "~/.taskrc")
w = TaskWarrior(config_filename=taskrc)
pending_tasks = w.filter_tasks({"status": "pending"})
self.__pending_tasks = str(len(pending_tasks))
except:
self.__pending_tasks = "n/a"
def output(self, _):
"""Format the task counter to output in bumblebee."""
return "{}".format(self.__pending_tasks)
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
Add active-task display and scrolling
This adds an option allowing you to specify
"taskwarrior.show_active=true" in your bar configuration and will
display the current, active task id and description on the status bar, but will show the
number of pending tasks if one isn't active.
This also adds the scrolling decorator, since task descriptions can be
quite long. | """Displays the number of pending tasks in TaskWarrior.
Requires the following library:
* taskw
Parameters:
* taskwarrior.taskrc : path to the taskrc file (defaults to ~/.taskrc)
contributed by `chdorb <https://github.com/chdorb>`_ - many thanks!
"""
from taskw import TaskWarrior
import core.module
import core.widget
import core.decorators
class Module(core.module.Module):
def __init__(self, config, theme):
super().__init__(config, theme, core.widget.Widget(self.output))
self.__pending_tasks = "0"
def update(self):
"""Return a string with the number of pending tasks from TaskWarrior."""
try:
taskrc = self.parameter("taskrc", "~/.taskrc")
show_active = self.parameter("show_active", False)
w = TaskWarrior(config_filename=taskrc)
active_tasks = (
w.filter_tasks({"start.any": "", "status": "pending"}) or None
)
if show_active and active_tasks:
reporting_tasks = (
f"{active_tasks[0]['id']} - {active_tasks[0]['description']}"
)
else:
reporting_tasks = len(w.filter_tasks({"status": "pending"}))
self.__pending_tasks = reporting_tasks
except:
self.__pending_tasks = "n/a"
@core.decorators.scrollable
def output(self, _):
"""Format the task counter to output in bumblebee."""
return "{}".format(self.__pending_tasks)
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
| <commit_before>"""Displays the number of pending tasks in TaskWarrior.
Requires the following library:
* taskw
Parameters:
* taskwarrior.taskrc : path to the taskrc file (defaults to ~/.taskrc)
contributed by `chdorb <https://github.com/chdorb>`_ - many thanks!
"""
from taskw import TaskWarrior
import core.module
import core.widget
import core.decorators
class Module(core.module.Module):
def __init__(self, config, theme):
super().__init__(config, theme, core.widget.Widget(self.output))
self.__pending_tasks = "0"
def update(self):
"""Return a string with the number of pending tasks from TaskWarrior."""
try:
taskrc = self.parameter("taskrc", "~/.taskrc")
w = TaskWarrior(config_filename=taskrc)
pending_tasks = w.filter_tasks({"status": "pending"})
self.__pending_tasks = str(len(pending_tasks))
except:
self.__pending_tasks = "n/a"
def output(self, _):
"""Format the task counter to output in bumblebee."""
return "{}".format(self.__pending_tasks)
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
<commit_msg>Add active-task display and scrolling
This adds an option allowing you to specify
"taskwarrior.show_active=true" in your bar configuration and will
display the current, active task id and description on the status bar, but will show the
number of pending tasks if one isn't active.
This also adds the scrolling decorator, since task descriptions can be
quite long.<commit_after> | """Displays the number of pending tasks in TaskWarrior.
Requires the following library:
* taskw
Parameters:
* taskwarrior.taskrc : path to the taskrc file (defaults to ~/.taskrc)
contributed by `chdorb <https://github.com/chdorb>`_ - many thanks!
"""
from taskw import TaskWarrior
import core.module
import core.widget
import core.decorators
class Module(core.module.Module):
def __init__(self, config, theme):
super().__init__(config, theme, core.widget.Widget(self.output))
self.__pending_tasks = "0"
def update(self):
"""Return a string with the number of pending tasks from TaskWarrior."""
try:
taskrc = self.parameter("taskrc", "~/.taskrc")
show_active = self.parameter("show_active", False)
w = TaskWarrior(config_filename=taskrc)
active_tasks = (
w.filter_tasks({"start.any": "", "status": "pending"}) or None
)
if show_active and active_tasks:
reporting_tasks = (
f"{active_tasks[0]['id']} - {active_tasks[0]['description']}"
)
else:
reporting_tasks = len(w.filter_tasks({"status": "pending"}))
self.__pending_tasks = reporting_tasks
except:
self.__pending_tasks = "n/a"
@core.decorators.scrollable
def output(self, _):
"""Format the task counter to output in bumblebee."""
return "{}".format(self.__pending_tasks)
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
| """Displays the number of pending tasks in TaskWarrior.
Requires the following library:
* taskw
Parameters:
* taskwarrior.taskrc : path to the taskrc file (defaults to ~/.taskrc)
contributed by `chdorb <https://github.com/chdorb>`_ - many thanks!
"""
from taskw import TaskWarrior
import core.module
import core.widget
import core.decorators
class Module(core.module.Module):
def __init__(self, config, theme):
super().__init__(config, theme, core.widget.Widget(self.output))
self.__pending_tasks = "0"
def update(self):
"""Return a string with the number of pending tasks from TaskWarrior."""
try:
taskrc = self.parameter("taskrc", "~/.taskrc")
w = TaskWarrior(config_filename=taskrc)
pending_tasks = w.filter_tasks({"status": "pending"})
self.__pending_tasks = str(len(pending_tasks))
except:
self.__pending_tasks = "n/a"
def output(self, _):
"""Format the task counter to output in bumblebee."""
return "{}".format(self.__pending_tasks)
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
Add active-task display and scrolling
This adds an option allowing you to specify
"taskwarrior.show_active=true" in your bar configuration and will
display the current, active task id and description on the status bar, but will show the
number of pending tasks if one isn't active.
This also adds the scrolling decorator, since task descriptions can be
quite long."""Displays the number of pending tasks in TaskWarrior.
Requires the following library:
* taskw
Parameters:
* taskwarrior.taskrc : path to the taskrc file (defaults to ~/.taskrc)
contributed by `chdorb <https://github.com/chdorb>`_ - many thanks!
"""
from taskw import TaskWarrior
import core.module
import core.widget
import core.decorators
class Module(core.module.Module):
def __init__(self, config, theme):
super().__init__(config, theme, core.widget.Widget(self.output))
self.__pending_tasks = "0"
def update(self):
"""Return a string with the number of pending tasks from TaskWarrior."""
try:
taskrc = self.parameter("taskrc", "~/.taskrc")
show_active = self.parameter("show_active", False)
w = TaskWarrior(config_filename=taskrc)
active_tasks = (
w.filter_tasks({"start.any": "", "status": "pending"}) or None
)
if show_active and active_tasks:
reporting_tasks = (
f"{active_tasks[0]['id']} - {active_tasks[0]['description']}"
)
else:
reporting_tasks = len(w.filter_tasks({"status": "pending"}))
self.__pending_tasks = reporting_tasks
except:
self.__pending_tasks = "n/a"
@core.decorators.scrollable
def output(self, _):
"""Format the task counter to output in bumblebee."""
return "{}".format(self.__pending_tasks)
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
| <commit_before>"""Displays the number of pending tasks in TaskWarrior.
Requires the following library:
* taskw
Parameters:
* taskwarrior.taskrc : path to the taskrc file (defaults to ~/.taskrc)
contributed by `chdorb <https://github.com/chdorb>`_ - many thanks!
"""
from taskw import TaskWarrior
import core.module
import core.widget
import core.decorators
class Module(core.module.Module):
def __init__(self, config, theme):
super().__init__(config, theme, core.widget.Widget(self.output))
self.__pending_tasks = "0"
def update(self):
"""Return a string with the number of pending tasks from TaskWarrior."""
try:
taskrc = self.parameter("taskrc", "~/.taskrc")
w = TaskWarrior(config_filename=taskrc)
pending_tasks = w.filter_tasks({"status": "pending"})
self.__pending_tasks = str(len(pending_tasks))
except:
self.__pending_tasks = "n/a"
def output(self, _):
"""Format the task counter to output in bumblebee."""
return "{}".format(self.__pending_tasks)
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
<commit_msg>Add active-task display and scrolling
This adds an option allowing you to specify
"taskwarrior.show_active=true" in your bar configuration and will
display the current, active task id and description on the status bar, but will show the
number of pending tasks if one isn't active.
This also adds the scrolling decorator, since task descriptions can be
quite long.<commit_after>"""Displays the number of pending tasks in TaskWarrior.
Requires the following library:
* taskw
Parameters:
* taskwarrior.taskrc : path to the taskrc file (defaults to ~/.taskrc)
contributed by `chdorb <https://github.com/chdorb>`_ - many thanks!
"""
from taskw import TaskWarrior
import core.module
import core.widget
import core.decorators
class Module(core.module.Module):
def __init__(self, config, theme):
super().__init__(config, theme, core.widget.Widget(self.output))
self.__pending_tasks = "0"
def update(self):
"""Return a string with the number of pending tasks from TaskWarrior."""
try:
taskrc = self.parameter("taskrc", "~/.taskrc")
show_active = self.parameter("show_active", False)
w = TaskWarrior(config_filename=taskrc)
active_tasks = (
w.filter_tasks({"start.any": "", "status": "pending"}) or None
)
if show_active and active_tasks:
reporting_tasks = (
f"{active_tasks[0]['id']} - {active_tasks[0]['description']}"
)
else:
reporting_tasks = len(w.filter_tasks({"status": "pending"}))
self.__pending_tasks = reporting_tasks
except:
self.__pending_tasks = "n/a"
@core.decorators.scrollable
def output(self, _):
"""Format the task counter to output in bumblebee."""
return "{}".format(self.__pending_tasks)
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|
3421db3528a655768141b3615d04d84cf7100bb0 | ckanext/requestdata/plugin.py | ckanext/requestdata/plugin.py | import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
from ckanext.requestdata.model import setup as model_setup
class RequestdataPlugin(plugins.SingletonPlugin):
plugins.implements(plugins.IConfigurer)
plugins.implements(plugins.IRoutes, inherit=True)
plugins.implements(plugins.IConfigurable)
# IConfigurer
def update_config(self, config_):
toolkit.add_template_directory(config_, 'templates')
toolkit.add_public_directory(config_, 'public')
toolkit.add_resource('fanstatic', 'requestdata')
# IMapper
def before_map(self, map):
controller =\
'ckanext.requestdata.controllers.package:PackageController'
map.connect('/dataset/make_active/{pkg_name}', controller=controller,
action='make_active')
return map
# IConfigurable
def configure(self, config):
# Setup requestdata model
model_setup()
| import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
from ckanext.requestdata.model import setup as model_setup
from ckanext.requestdata.logic import actions
from ckanext.requestdata.logic import auth
class RequestdataPlugin(plugins.SingletonPlugin):
plugins.implements(plugins.IConfigurer)
plugins.implements(plugins.IRoutes, inherit=True)
plugins.implements(plugins.IConfigurable)
plugins.implements(plugins.IActions)
plugins.implements(plugins.IAuthFunctions)
# IConfigurer
def update_config(self, config_):
toolkit.add_template_directory(config_, 'templates')
toolkit.add_public_directory(config_, 'public')
toolkit.add_resource('fanstatic', 'requestdata')
# IMapper
def before_map(self, map):
controller =\
'ckanext.requestdata.controllers.package:PackageController'
map.connect('/dataset/make_active/{pkg_name}', controller=controller,
action='make_active')
return map
# IConfigurable
def configure(self, config):
# Setup requestdata model
model_setup()
# IActions
def get_actions(self):
return {
'requestdata_request_create': actions.request_create,
'requestdata_request_show': actions.request_show,
'requestdata_request_list': actions.request_list,
'requestdata_request_patch': actions.request_patch,
'requestdata_request_update': actions.request_update,
'requestdata_request_delete': actions.request_delete
}
# IAuthFunctions
def get_auth_functions(self):
return {
'requestdata_request_create': auth.request_create
}
| Define actions and auth functions | Define actions and auth functions
| Python | agpl-3.0 | ViderumGlobal/ckanext-requestdata,ViderumGlobal/ckanext-requestdata,ViderumGlobal/ckanext-requestdata,ViderumGlobal/ckanext-requestdata | import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
from ckanext.requestdata.model import setup as model_setup
class RequestdataPlugin(plugins.SingletonPlugin):
plugins.implements(plugins.IConfigurer)
plugins.implements(plugins.IRoutes, inherit=True)
plugins.implements(plugins.IConfigurable)
# IConfigurer
def update_config(self, config_):
toolkit.add_template_directory(config_, 'templates')
toolkit.add_public_directory(config_, 'public')
toolkit.add_resource('fanstatic', 'requestdata')
# IMapper
def before_map(self, map):
controller =\
'ckanext.requestdata.controllers.package:PackageController'
map.connect('/dataset/make_active/{pkg_name}', controller=controller,
action='make_active')
return map
# IConfigurable
def configure(self, config):
# Setup requestdata model
model_setup()
Define actions and auth functions | import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
from ckanext.requestdata.model import setup as model_setup
from ckanext.requestdata.logic import actions
from ckanext.requestdata.logic import auth
class RequestdataPlugin(plugins.SingletonPlugin):
plugins.implements(plugins.IConfigurer)
plugins.implements(plugins.IRoutes, inherit=True)
plugins.implements(plugins.IConfigurable)
plugins.implements(plugins.IActions)
plugins.implements(plugins.IAuthFunctions)
# IConfigurer
def update_config(self, config_):
toolkit.add_template_directory(config_, 'templates')
toolkit.add_public_directory(config_, 'public')
toolkit.add_resource('fanstatic', 'requestdata')
# IMapper
def before_map(self, map):
controller =\
'ckanext.requestdata.controllers.package:PackageController'
map.connect('/dataset/make_active/{pkg_name}', controller=controller,
action='make_active')
return map
# IConfigurable
def configure(self, config):
# Setup requestdata model
model_setup()
# IActions
def get_actions(self):
return {
'requestdata_request_create': actions.request_create,
'requestdata_request_show': actions.request_show,
'requestdata_request_list': actions.request_list,
'requestdata_request_patch': actions.request_patch,
'requestdata_request_update': actions.request_update,
'requestdata_request_delete': actions.request_delete
}
# IAuthFunctions
def get_auth_functions(self):
return {
'requestdata_request_create': auth.request_create
}
| <commit_before>import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
from ckanext.requestdata.model import setup as model_setup
class RequestdataPlugin(plugins.SingletonPlugin):
plugins.implements(plugins.IConfigurer)
plugins.implements(plugins.IRoutes, inherit=True)
plugins.implements(plugins.IConfigurable)
# IConfigurer
def update_config(self, config_):
toolkit.add_template_directory(config_, 'templates')
toolkit.add_public_directory(config_, 'public')
toolkit.add_resource('fanstatic', 'requestdata')
# IMapper
def before_map(self, map):
controller =\
'ckanext.requestdata.controllers.package:PackageController'
map.connect('/dataset/make_active/{pkg_name}', controller=controller,
action='make_active')
return map
# IConfigurable
def configure(self, config):
# Setup requestdata model
model_setup()
<commit_msg>Define actions and auth functions<commit_after> | import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
from ckanext.requestdata.model import setup as model_setup
from ckanext.requestdata.logic import actions
from ckanext.requestdata.logic import auth
class RequestdataPlugin(plugins.SingletonPlugin):
plugins.implements(plugins.IConfigurer)
plugins.implements(plugins.IRoutes, inherit=True)
plugins.implements(plugins.IConfigurable)
plugins.implements(plugins.IActions)
plugins.implements(plugins.IAuthFunctions)
# IConfigurer
def update_config(self, config_):
toolkit.add_template_directory(config_, 'templates')
toolkit.add_public_directory(config_, 'public')
toolkit.add_resource('fanstatic', 'requestdata')
# IMapper
def before_map(self, map):
controller =\
'ckanext.requestdata.controllers.package:PackageController'
map.connect('/dataset/make_active/{pkg_name}', controller=controller,
action='make_active')
return map
# IConfigurable
def configure(self, config):
# Setup requestdata model
model_setup()
# IActions
def get_actions(self):
return {
'requestdata_request_create': actions.request_create,
'requestdata_request_show': actions.request_show,
'requestdata_request_list': actions.request_list,
'requestdata_request_patch': actions.request_patch,
'requestdata_request_update': actions.request_update,
'requestdata_request_delete': actions.request_delete
}
# IAuthFunctions
def get_auth_functions(self):
return {
'requestdata_request_create': auth.request_create
}
| import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
from ckanext.requestdata.model import setup as model_setup
class RequestdataPlugin(plugins.SingletonPlugin):
plugins.implements(plugins.IConfigurer)
plugins.implements(plugins.IRoutes, inherit=True)
plugins.implements(plugins.IConfigurable)
# IConfigurer
def update_config(self, config_):
toolkit.add_template_directory(config_, 'templates')
toolkit.add_public_directory(config_, 'public')
toolkit.add_resource('fanstatic', 'requestdata')
# IMapper
def before_map(self, map):
controller =\
'ckanext.requestdata.controllers.package:PackageController'
map.connect('/dataset/make_active/{pkg_name}', controller=controller,
action='make_active')
return map
# IConfigurable
def configure(self, config):
# Setup requestdata model
model_setup()
Define actions and auth functionsimport ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
from ckanext.requestdata.model import setup as model_setup
from ckanext.requestdata.logic import actions
from ckanext.requestdata.logic import auth
class RequestdataPlugin(plugins.SingletonPlugin):
plugins.implements(plugins.IConfigurer)
plugins.implements(plugins.IRoutes, inherit=True)
plugins.implements(plugins.IConfigurable)
plugins.implements(plugins.IActions)
plugins.implements(plugins.IAuthFunctions)
# IConfigurer
def update_config(self, config_):
toolkit.add_template_directory(config_, 'templates')
toolkit.add_public_directory(config_, 'public')
toolkit.add_resource('fanstatic', 'requestdata')
# IMapper
def before_map(self, map):
controller =\
'ckanext.requestdata.controllers.package:PackageController'
map.connect('/dataset/make_active/{pkg_name}', controller=controller,
action='make_active')
return map
# IConfigurable
def configure(self, config):
# Setup requestdata model
model_setup()
# IActions
def get_actions(self):
return {
'requestdata_request_create': actions.request_create,
'requestdata_request_show': actions.request_show,
'requestdata_request_list': actions.request_list,
'requestdata_request_patch': actions.request_patch,
'requestdata_request_update': actions.request_update,
'requestdata_request_delete': actions.request_delete
}
# IAuthFunctions
def get_auth_functions(self):
return {
'requestdata_request_create': auth.request_create
}
| <commit_before>import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
from ckanext.requestdata.model import setup as model_setup
class RequestdataPlugin(plugins.SingletonPlugin):
plugins.implements(plugins.IConfigurer)
plugins.implements(plugins.IRoutes, inherit=True)
plugins.implements(plugins.IConfigurable)
# IConfigurer
def update_config(self, config_):
toolkit.add_template_directory(config_, 'templates')
toolkit.add_public_directory(config_, 'public')
toolkit.add_resource('fanstatic', 'requestdata')
# IMapper
def before_map(self, map):
controller =\
'ckanext.requestdata.controllers.package:PackageController'
map.connect('/dataset/make_active/{pkg_name}', controller=controller,
action='make_active')
return map
# IConfigurable
def configure(self, config):
# Setup requestdata model
model_setup()
<commit_msg>Define actions and auth functions<commit_after>import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
from ckanext.requestdata.model import setup as model_setup
from ckanext.requestdata.logic import actions
from ckanext.requestdata.logic import auth
class RequestdataPlugin(plugins.SingletonPlugin):
plugins.implements(plugins.IConfigurer)
plugins.implements(plugins.IRoutes, inherit=True)
plugins.implements(plugins.IConfigurable)
plugins.implements(plugins.IActions)
plugins.implements(plugins.IAuthFunctions)
# IConfigurer
def update_config(self, config_):
toolkit.add_template_directory(config_, 'templates')
toolkit.add_public_directory(config_, 'public')
toolkit.add_resource('fanstatic', 'requestdata')
# IMapper
def before_map(self, map):
controller =\
'ckanext.requestdata.controllers.package:PackageController'
map.connect('/dataset/make_active/{pkg_name}', controller=controller,
action='make_active')
return map
# IConfigurable
def configure(self, config):
# Setup requestdata model
model_setup()
# IActions
def get_actions(self):
return {
'requestdata_request_create': actions.request_create,
'requestdata_request_show': actions.request_show,
'requestdata_request_list': actions.request_list,
'requestdata_request_patch': actions.request_patch,
'requestdata_request_update': actions.request_update,
'requestdata_request_delete': actions.request_delete
}
# IAuthFunctions
def get_auth_functions(self):
return {
'requestdata_request_create': auth.request_create
}
|
109c46252a0b55f31c4b0b7471d9712764ade9a3 | pinry/urls.py | pinry/urls.py | from django.conf import settings
from django.conf.urls import include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
from django.views.static import serve
from rest_framework.documentation import include_docs_urls
from core.views import drf_router
admin.autodiscover()
urlpatterns = [
# drf api
url(r'^drf_api/', include(drf_router.urls)),
url(r'^api-auth/', include('rest_framework.urls', namespace="rest_framework")),
url(r'^drf_api/docs/', include_docs_urls(title='PinryAPI', schema_url='/')),
# old api and views
url(r'^admin/', include(admin.site.urls)),
url(r'', include('core.urls', namespace='core')),
url(r'', include('users.urls', namespace='users')),
]
if settings.DEBUG:
urlpatterns += staticfiles_urlpatterns()
urlpatterns += [
url(r'^media/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT, }),
]
if settings.IS_TEST:
urlpatterns += staticfiles_urlpatterns()
# For test running of django_images
urlpatterns += [
url(r'^__images/', include('django_images.urls')),
]
| from django.conf import settings
from django.conf.urls import include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
from django.views.static import serve
from rest_framework.documentation import include_docs_urls
from core.views import drf_router
admin.autodiscover()
urlpatterns = [
# drf api
url(r'^api/v2/', include(drf_router.urls)),
url(r'^api-auth/', include('rest_framework.urls', namespace="rest_framework")),
url(r'^api/v2/docs/', include_docs_urls(title='PinryAPI', schema_url='/')),
# old api and views
url(r'^admin/', include(admin.site.urls)),
url(r'', include('core.urls', namespace='core')),
url(r'', include('users.urls', namespace='users')),
]
if settings.DEBUG:
urlpatterns += staticfiles_urlpatterns()
urlpatterns += [
url(r'^media/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT, }),
]
if settings.IS_TEST:
urlpatterns += staticfiles_urlpatterns()
# For test running of django_images
urlpatterns += [
url(r'^__images/', include('django_images.urls')),
]
| Use api/v2 instead of drf_api/ | Feature: Use api/v2 instead of drf_api/
| Python | bsd-2-clause | pinry/pinry,lapo-luchini/pinry,pinry/pinry,lapo-luchini/pinry,pinry/pinry,pinry/pinry,lapo-luchini/pinry,lapo-luchini/pinry | from django.conf import settings
from django.conf.urls import include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
from django.views.static import serve
from rest_framework.documentation import include_docs_urls
from core.views import drf_router
admin.autodiscover()
urlpatterns = [
# drf api
url(r'^drf_api/', include(drf_router.urls)),
url(r'^api-auth/', include('rest_framework.urls', namespace="rest_framework")),
url(r'^drf_api/docs/', include_docs_urls(title='PinryAPI', schema_url='/')),
# old api and views
url(r'^admin/', include(admin.site.urls)),
url(r'', include('core.urls', namespace='core')),
url(r'', include('users.urls', namespace='users')),
]
if settings.DEBUG:
urlpatterns += staticfiles_urlpatterns()
urlpatterns += [
url(r'^media/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT, }),
]
if settings.IS_TEST:
urlpatterns += staticfiles_urlpatterns()
# For test running of django_images
urlpatterns += [
url(r'^__images/', include('django_images.urls')),
]
Feature: Use api/v2 instead of drf_api/ | from django.conf import settings
from django.conf.urls import include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
from django.views.static import serve
from rest_framework.documentation import include_docs_urls
from core.views import drf_router
admin.autodiscover()
urlpatterns = [
# drf api
url(r'^api/v2/', include(drf_router.urls)),
url(r'^api-auth/', include('rest_framework.urls', namespace="rest_framework")),
url(r'^api/v2/docs/', include_docs_urls(title='PinryAPI', schema_url='/')),
# old api and views
url(r'^admin/', include(admin.site.urls)),
url(r'', include('core.urls', namespace='core')),
url(r'', include('users.urls', namespace='users')),
]
if settings.DEBUG:
urlpatterns += staticfiles_urlpatterns()
urlpatterns += [
url(r'^media/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT, }),
]
if settings.IS_TEST:
urlpatterns += staticfiles_urlpatterns()
# For test running of django_images
urlpatterns += [
url(r'^__images/', include('django_images.urls')),
]
| <commit_before>from django.conf import settings
from django.conf.urls import include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
from django.views.static import serve
from rest_framework.documentation import include_docs_urls
from core.views import drf_router
admin.autodiscover()
urlpatterns = [
# drf api
url(r'^drf_api/', include(drf_router.urls)),
url(r'^api-auth/', include('rest_framework.urls', namespace="rest_framework")),
url(r'^drf_api/docs/', include_docs_urls(title='PinryAPI', schema_url='/')),
# old api and views
url(r'^admin/', include(admin.site.urls)),
url(r'', include('core.urls', namespace='core')),
url(r'', include('users.urls', namespace='users')),
]
if settings.DEBUG:
urlpatterns += staticfiles_urlpatterns()
urlpatterns += [
url(r'^media/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT, }),
]
if settings.IS_TEST:
urlpatterns += staticfiles_urlpatterns()
# For test running of django_images
urlpatterns += [
url(r'^__images/', include('django_images.urls')),
]
<commit_msg>Feature: Use api/v2 instead of drf_api/<commit_after> | from django.conf import settings
from django.conf.urls import include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
from django.views.static import serve
from rest_framework.documentation import include_docs_urls
from core.views import drf_router
admin.autodiscover()
urlpatterns = [
# drf api
url(r'^api/v2/', include(drf_router.urls)),
url(r'^api-auth/', include('rest_framework.urls', namespace="rest_framework")),
url(r'^api/v2/docs/', include_docs_urls(title='PinryAPI', schema_url='/')),
# old api and views
url(r'^admin/', include(admin.site.urls)),
url(r'', include('core.urls', namespace='core')),
url(r'', include('users.urls', namespace='users')),
]
if settings.DEBUG:
urlpatterns += staticfiles_urlpatterns()
urlpatterns += [
url(r'^media/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT, }),
]
if settings.IS_TEST:
urlpatterns += staticfiles_urlpatterns()
# For test running of django_images
urlpatterns += [
url(r'^__images/', include('django_images.urls')),
]
| from django.conf import settings
from django.conf.urls import include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
from django.views.static import serve
from rest_framework.documentation import include_docs_urls
from core.views import drf_router
admin.autodiscover()
urlpatterns = [
# drf api
url(r'^drf_api/', include(drf_router.urls)),
url(r'^api-auth/', include('rest_framework.urls', namespace="rest_framework")),
url(r'^drf_api/docs/', include_docs_urls(title='PinryAPI', schema_url='/')),
# old api and views
url(r'^admin/', include(admin.site.urls)),
url(r'', include('core.urls', namespace='core')),
url(r'', include('users.urls', namespace='users')),
]
if settings.DEBUG:
urlpatterns += staticfiles_urlpatterns()
urlpatterns += [
url(r'^media/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT, }),
]
if settings.IS_TEST:
urlpatterns += staticfiles_urlpatterns()
# For test running of django_images
urlpatterns += [
url(r'^__images/', include('django_images.urls')),
]
Feature: Use api/v2 instead of drf_api/from django.conf import settings
from django.conf.urls import include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
from django.views.static import serve
from rest_framework.documentation import include_docs_urls
from core.views import drf_router
admin.autodiscover()
urlpatterns = [
# drf api
url(r'^api/v2/', include(drf_router.urls)),
url(r'^api-auth/', include('rest_framework.urls', namespace="rest_framework")),
url(r'^api/v2/docs/', include_docs_urls(title='PinryAPI', schema_url='/')),
# old api and views
url(r'^admin/', include(admin.site.urls)),
url(r'', include('core.urls', namespace='core')),
url(r'', include('users.urls', namespace='users')),
]
if settings.DEBUG:
urlpatterns += staticfiles_urlpatterns()
urlpatterns += [
url(r'^media/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT, }),
]
if settings.IS_TEST:
urlpatterns += staticfiles_urlpatterns()
# For test running of django_images
urlpatterns += [
url(r'^__images/', include('django_images.urls')),
]
| <commit_before>from django.conf import settings
from django.conf.urls import include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
from django.views.static import serve
from rest_framework.documentation import include_docs_urls
from core.views import drf_router
admin.autodiscover()
urlpatterns = [
# drf api
url(r'^drf_api/', include(drf_router.urls)),
url(r'^api-auth/', include('rest_framework.urls', namespace="rest_framework")),
url(r'^drf_api/docs/', include_docs_urls(title='PinryAPI', schema_url='/')),
# old api and views
url(r'^admin/', include(admin.site.urls)),
url(r'', include('core.urls', namespace='core')),
url(r'', include('users.urls', namespace='users')),
]
if settings.DEBUG:
urlpatterns += staticfiles_urlpatterns()
urlpatterns += [
url(r'^media/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT, }),
]
if settings.IS_TEST:
urlpatterns += staticfiles_urlpatterns()
# For test running of django_images
urlpatterns += [
url(r'^__images/', include('django_images.urls')),
]
<commit_msg>Feature: Use api/v2 instead of drf_api/<commit_after>from django.conf import settings
from django.conf.urls import include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
from django.views.static import serve
from rest_framework.documentation import include_docs_urls
from core.views import drf_router
admin.autodiscover()
urlpatterns = [
# drf api
url(r'^api/v2/', include(drf_router.urls)),
url(r'^api-auth/', include('rest_framework.urls', namespace="rest_framework")),
url(r'^api/v2/docs/', include_docs_urls(title='PinryAPI', schema_url='/')),
# old api and views
url(r'^admin/', include(admin.site.urls)),
url(r'', include('core.urls', namespace='core')),
url(r'', include('users.urls', namespace='users')),
]
if settings.DEBUG:
urlpatterns += staticfiles_urlpatterns()
urlpatterns += [
url(r'^media/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT, }),
]
if settings.IS_TEST:
urlpatterns += staticfiles_urlpatterns()
# For test running of django_images
urlpatterns += [
url(r'^__images/', include('django_images.urls')),
]
|
89a232538c2ce7bc3ed406e6b9587cebbff2849e | amplpy/amplpython/__init__.py | amplpy/amplpython/__init__.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import platform
if platform.system() == 'Windows':
lib32 = os.path.join(os.path.dirname(__file__), 'lib32')
lib64 = os.path.join(os.path.dirname(__file__), 'lib64')
os.environ['PATH'] += os.pathsep + lib32
os.environ['PATH'] += os.pathsep + lib64
from .amplpython import *
from .amplpython import _READTABLE, _WRITETABLE
| # -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import ctypes
import platform
if platform.system() == 'Windows':
lib32 = os.path.join(os.path.dirname(__file__), 'lib32')
lib64 = os.path.join(os.path.dirname(__file__), 'lib64')
from glob import glob
from ctypes import sizeof
try:
if ctypes.sizeof(ctypes.c_voidp) == 4:
dllfile = glob(lib32 + '/*.dll')[0]
else:
dllfile = glob(lib64 + '/*.dll')[0]
ctypes.CDLL(dllfile)
except:
pass
from .amplpython import *
from .amplpython import _READTABLE, _WRITETABLE
| Add workaround for conda python | Add workaround for conda python
Python versions that come with conda for Windows
do not load .dlls in the same way as standard
python versions.
| Python | bsd-3-clause | ampl/amplpy,ampl/amplpy,ampl/amplpy | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import platform
if platform.system() == 'Windows':
lib32 = os.path.join(os.path.dirname(__file__), 'lib32')
lib64 = os.path.join(os.path.dirname(__file__), 'lib64')
os.environ['PATH'] += os.pathsep + lib32
os.environ['PATH'] += os.pathsep + lib64
from .amplpython import *
from .amplpython import _READTABLE, _WRITETABLE
Add workaround for conda python
Python versions that come with conda for Windows
do not load .dlls in the same way as standard
python versions. | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import ctypes
import platform
if platform.system() == 'Windows':
lib32 = os.path.join(os.path.dirname(__file__), 'lib32')
lib64 = os.path.join(os.path.dirname(__file__), 'lib64')
from glob import glob
from ctypes import sizeof
try:
if ctypes.sizeof(ctypes.c_voidp) == 4:
dllfile = glob(lib32 + '/*.dll')[0]
else:
dllfile = glob(lib64 + '/*.dll')[0]
ctypes.CDLL(dllfile)
except:
pass
from .amplpython import *
from .amplpython import _READTABLE, _WRITETABLE
| <commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import platform
if platform.system() == 'Windows':
lib32 = os.path.join(os.path.dirname(__file__), 'lib32')
lib64 = os.path.join(os.path.dirname(__file__), 'lib64')
os.environ['PATH'] += os.pathsep + lib32
os.environ['PATH'] += os.pathsep + lib64
from .amplpython import *
from .amplpython import _READTABLE, _WRITETABLE
<commit_msg>Add workaround for conda python
Python versions that come with conda for Windows
do not load .dlls in the same way as standard
python versions.<commit_after> | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import ctypes
import platform
if platform.system() == 'Windows':
lib32 = os.path.join(os.path.dirname(__file__), 'lib32')
lib64 = os.path.join(os.path.dirname(__file__), 'lib64')
from glob import glob
from ctypes import sizeof
try:
if ctypes.sizeof(ctypes.c_voidp) == 4:
dllfile = glob(lib32 + '/*.dll')[0]
else:
dllfile = glob(lib64 + '/*.dll')[0]
ctypes.CDLL(dllfile)
except:
pass
from .amplpython import *
from .amplpython import _READTABLE, _WRITETABLE
| # -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import platform
if platform.system() == 'Windows':
lib32 = os.path.join(os.path.dirname(__file__), 'lib32')
lib64 = os.path.join(os.path.dirname(__file__), 'lib64')
os.environ['PATH'] += os.pathsep + lib32
os.environ['PATH'] += os.pathsep + lib64
from .amplpython import *
from .amplpython import _READTABLE, _WRITETABLE
Add workaround for conda python
Python versions that come with conda for Windows
do not load .dlls in the same way as standard
python versions.# -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import ctypes
import platform
if platform.system() == 'Windows':
lib32 = os.path.join(os.path.dirname(__file__), 'lib32')
lib64 = os.path.join(os.path.dirname(__file__), 'lib64')
from glob import glob
from ctypes import sizeof
try:
if ctypes.sizeof(ctypes.c_voidp) == 4:
dllfile = glob(lib32 + '/*.dll')[0]
else:
dllfile = glob(lib64 + '/*.dll')[0]
ctypes.CDLL(dllfile)
except:
pass
from .amplpython import *
from .amplpython import _READTABLE, _WRITETABLE
| <commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import platform
if platform.system() == 'Windows':
lib32 = os.path.join(os.path.dirname(__file__), 'lib32')
lib64 = os.path.join(os.path.dirname(__file__), 'lib64')
os.environ['PATH'] += os.pathsep + lib32
os.environ['PATH'] += os.pathsep + lib64
from .amplpython import *
from .amplpython import _READTABLE, _WRITETABLE
<commit_msg>Add workaround for conda python
Python versions that come with conda for Windows
do not load .dlls in the same way as standard
python versions.<commit_after># -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import ctypes
import platform
if platform.system() == 'Windows':
lib32 = os.path.join(os.path.dirname(__file__), 'lib32')
lib64 = os.path.join(os.path.dirname(__file__), 'lib64')
from glob import glob
from ctypes import sizeof
try:
if ctypes.sizeof(ctypes.c_voidp) == 4:
dllfile = glob(lib32 + '/*.dll')[0]
else:
dllfile = glob(lib64 + '/*.dll')[0]
ctypes.CDLL(dllfile)
except:
pass
from .amplpython import *
from .amplpython import _READTABLE, _WRITETABLE
|
f97f4378e2d39e211bb4df195664c54e925dc867 | core/management/commands/delete_old_sessions.py | core/management/commands/delete_old_sessions.py | from datetime import datetime
from django.core.management.base import BaseCommand
from django.contrib.sessions.models import Session
"""
>>> def clean(count):
... for idx, s in enumerate(Session.objects.filter(expire_date__lt=now)[:count+1]):
... s.delete()
... if str(idx).endswith('000'): print idx
... print "{0} records left".format(Session.objects.filter(expire_date__lt=now).count())
...
"""
class Command(NoArgsCommand):
args = '<count count ...>'
help = "Delete old sessions"
def handle(self, *args, **options):
old_sessions = Session.objects.filter(expire_date__lt=datetime.now())
self.stdout.write("Deleting {0} expired sessions".format(
old_sessions.count()
)
)
for index, session in enumerate(old_sessions):
session.delete()
if str(idx).endswith('000'):
self.stdout.write("{0} records deleted".format(index))
self.stdout.write("{0} expired sessions remaining".format(
Session.objects.filter(expire_date__lt=datetime.now())
)
)
| from datetime import datetime
from django.core.management.base import BaseCommand
from django.contrib.sessions.models import Session
"""
>>> def clean(count):
... for idx, s in enumerate(Session.objects.filter(expire_date__lt=now)[:count+1]):
... s.delete()
... if str(idx).endswith('000'): print idx
... print "{0} records left".format(Session.objects.filter(expire_date__lt=now).count())
...
"""
class Command(BaseCommand):
args = '<count count ...>'
help = "Delete old sessions"
def handle(self, *args, **options):
old_sessions = Session.objects.filter(expire_date__lt=datetime.now())
self.stdout.write("Deleting {0} expired sessions".format(
old_sessions.count()
)
)
for index, session in enumerate(old_sessions):
session.delete()
if str(idx).endswith('000'):
self.stdout.write("{0} records deleted".format(index))
self.stdout.write("{0} expired sessions remaining".format(
Session.objects.filter(expire_date__lt=datetime.now())
)
)
| Add delete old sessions command | Add delete old sessions command
| Python | mit | QLGu/djangopackages,pydanny/djangopackages,nanuxbe/djangopackages,QLGu/djangopackages,pydanny/djangopackages,QLGu/djangopackages,nanuxbe/djangopackages,pydanny/djangopackages,nanuxbe/djangopackages | from datetime import datetime
from django.core.management.base import BaseCommand
from django.contrib.sessions.models import Session
"""
>>> def clean(count):
... for idx, s in enumerate(Session.objects.filter(expire_date__lt=now)[:count+1]):
... s.delete()
... if str(idx).endswith('000'): print idx
... print "{0} records left".format(Session.objects.filter(expire_date__lt=now).count())
...
"""
class Command(NoArgsCommand):
args = '<count count ...>'
help = "Delete old sessions"
def handle(self, *args, **options):
old_sessions = Session.objects.filter(expire_date__lt=datetime.now())
self.stdout.write("Deleting {0} expired sessions".format(
old_sessions.count()
)
)
for index, session in enumerate(old_sessions):
session.delete()
if str(idx).endswith('000'):
self.stdout.write("{0} records deleted".format(index))
self.stdout.write("{0} expired sessions remaining".format(
Session.objects.filter(expire_date__lt=datetime.now())
)
)
Add delete old sessions command | from datetime import datetime
from django.core.management.base import BaseCommand
from django.contrib.sessions.models import Session
"""
>>> def clean(count):
... for idx, s in enumerate(Session.objects.filter(expire_date__lt=now)[:count+1]):
... s.delete()
... if str(idx).endswith('000'): print idx
... print "{0} records left".format(Session.objects.filter(expire_date__lt=now).count())
...
"""
class Command(BaseCommand):
args = '<count count ...>'
help = "Delete old sessions"
def handle(self, *args, **options):
old_sessions = Session.objects.filter(expire_date__lt=datetime.now())
self.stdout.write("Deleting {0} expired sessions".format(
old_sessions.count()
)
)
for index, session in enumerate(old_sessions):
session.delete()
if str(idx).endswith('000'):
self.stdout.write("{0} records deleted".format(index))
self.stdout.write("{0} expired sessions remaining".format(
Session.objects.filter(expire_date__lt=datetime.now())
)
)
| <commit_before>from datetime import datetime
from django.core.management.base import BaseCommand
from django.contrib.sessions.models import Session
"""
>>> def clean(count):
... for idx, s in enumerate(Session.objects.filter(expire_date__lt=now)[:count+1]):
... s.delete()
... if str(idx).endswith('000'): print idx
... print "{0} records left".format(Session.objects.filter(expire_date__lt=now).count())
...
"""
class Command(NoArgsCommand):
args = '<count count ...>'
help = "Delete old sessions"
def handle(self, *args, **options):
old_sessions = Session.objects.filter(expire_date__lt=datetime.now())
self.stdout.write("Deleting {0} expired sessions".format(
old_sessions.count()
)
)
for index, session in enumerate(old_sessions):
session.delete()
if str(idx).endswith('000'):
self.stdout.write("{0} records deleted".format(index))
self.stdout.write("{0} expired sessions remaining".format(
Session.objects.filter(expire_date__lt=datetime.now())
)
)
<commit_msg>Add delete old sessions command<commit_after> | from datetime import datetime
from django.core.management.base import BaseCommand
from django.contrib.sessions.models import Session
"""
>>> def clean(count):
... for idx, s in enumerate(Session.objects.filter(expire_date__lt=now)[:count+1]):
... s.delete()
... if str(idx).endswith('000'): print idx
... print "{0} records left".format(Session.objects.filter(expire_date__lt=now).count())
...
"""
class Command(BaseCommand):
args = '<count count ...>'
help = "Delete old sessions"
def handle(self, *args, **options):
old_sessions = Session.objects.filter(expire_date__lt=datetime.now())
self.stdout.write("Deleting {0} expired sessions".format(
old_sessions.count()
)
)
for index, session in enumerate(old_sessions):
session.delete()
if str(idx).endswith('000'):
self.stdout.write("{0} records deleted".format(index))
self.stdout.write("{0} expired sessions remaining".format(
Session.objects.filter(expire_date__lt=datetime.now())
)
)
| from datetime import datetime
from django.core.management.base import BaseCommand
from django.contrib.sessions.models import Session
"""
>>> def clean(count):
... for idx, s in enumerate(Session.objects.filter(expire_date__lt=now)[:count+1]):
... s.delete()
... if str(idx).endswith('000'): print idx
... print "{0} records left".format(Session.objects.filter(expire_date__lt=now).count())
...
"""
class Command(NoArgsCommand):
args = '<count count ...>'
help = "Delete old sessions"
def handle(self, *args, **options):
old_sessions = Session.objects.filter(expire_date__lt=datetime.now())
self.stdout.write("Deleting {0} expired sessions".format(
old_sessions.count()
)
)
for index, session in enumerate(old_sessions):
session.delete()
if str(idx).endswith('000'):
self.stdout.write("{0} records deleted".format(index))
self.stdout.write("{0} expired sessions remaining".format(
Session.objects.filter(expire_date__lt=datetime.now())
)
)
Add delete old sessions commandfrom datetime import datetime
from django.core.management.base import BaseCommand
from django.contrib.sessions.models import Session
"""
>>> def clean(count):
... for idx, s in enumerate(Session.objects.filter(expire_date__lt=now)[:count+1]):
... s.delete()
... if str(idx).endswith('000'): print idx
... print "{0} records left".format(Session.objects.filter(expire_date__lt=now).count())
...
"""
class Command(BaseCommand):
args = '<count count ...>'
help = "Delete old sessions"
def handle(self, *args, **options):
old_sessions = Session.objects.filter(expire_date__lt=datetime.now())
self.stdout.write("Deleting {0} expired sessions".format(
old_sessions.count()
)
)
for index, session in enumerate(old_sessions):
session.delete()
if str(idx).endswith('000'):
self.stdout.write("{0} records deleted".format(index))
self.stdout.write("{0} expired sessions remaining".format(
Session.objects.filter(expire_date__lt=datetime.now())
)
)
| <commit_before>from datetime import datetime
from django.core.management.base import BaseCommand
from django.contrib.sessions.models import Session
"""
>>> def clean(count):
... for idx, s in enumerate(Session.objects.filter(expire_date__lt=now)[:count+1]):
... s.delete()
... if str(idx).endswith('000'): print idx
... print "{0} records left".format(Session.objects.filter(expire_date__lt=now).count())
...
"""
class Command(NoArgsCommand):
args = '<count count ...>'
help = "Delete old sessions"
def handle(self, *args, **options):
old_sessions = Session.objects.filter(expire_date__lt=datetime.now())
self.stdout.write("Deleting {0} expired sessions".format(
old_sessions.count()
)
)
for index, session in enumerate(old_sessions):
session.delete()
if str(idx).endswith('000'):
self.stdout.write("{0} records deleted".format(index))
self.stdout.write("{0} expired sessions remaining".format(
Session.objects.filter(expire_date__lt=datetime.now())
)
)
<commit_msg>Add delete old sessions command<commit_after>from datetime import datetime
from django.core.management.base import BaseCommand
from django.contrib.sessions.models import Session
"""
>>> def clean(count):
... for idx, s in enumerate(Session.objects.filter(expire_date__lt=now)[:count+1]):
... s.delete()
... if str(idx).endswith('000'): print idx
... print "{0} records left".format(Session.objects.filter(expire_date__lt=now).count())
...
"""
class Command(BaseCommand):
args = '<count count ...>'
help = "Delete old sessions"
def handle(self, *args, **options):
old_sessions = Session.objects.filter(expire_date__lt=datetime.now())
self.stdout.write("Deleting {0} expired sessions".format(
old_sessions.count()
)
)
for index, session in enumerate(old_sessions):
session.delete()
if str(idx).endswith('000'):
self.stdout.write("{0} records deleted".format(index))
self.stdout.write("{0} expired sessions remaining".format(
Session.objects.filter(expire_date__lt=datetime.now())
)
)
|
7adcf50f27e805931e7bb4c39fa07fa346710acf | anserv/modules/mixpanel/generic_event_handlers.py | anserv/modules/mixpanel/generic_event_handlers.py | from modules.mixpanel.mixpanel import track_event_mixpanel
from modules.decorators import view, query, event_handler
import re
SINGLE_PAGES_TO_TRACK = ['/', '/dashboard', '/create_account']
REGEX_PAGES_TO_TRACK = ['/course', '/about']
@event_handler()
def single_page_track_event(fs, db, response):
for resp in response:
if resp['event_type'] in SINGLE_PAGES_TO_TRACK:
user = resp["username"]
track_event_mixpanel(resp['event_type'],{'user' : user, 'distinct_id' : user})
@event_handler()
def regex_track_event(fs,db,response):
for rep in response:
for regex in REGEX_PAGES_TO_TRACK:
match = re.search(regex, resp['event_type'])
if match is not None:
track_event_mixpanel(regex,{'user' : user, 'distinct_id' : user, 'full_url' : resp['event_type']})
| from modules.mixpanel.mixpanel import track_event_mixpanel
from modules.decorators import view, query, event_handler
import re
SINGLE_PAGES_TO_TRACK = ['/', '/dashboard', '/create_account']
COURSE_PAGES_TO_TRACK = ['/courses', '/about']
@event_handler()
def single_page_track_event(fs, db, response):
for resp in response:
if resp['event_type'] in SINGLE_PAGES_TO_TRACK:
user = resp["username"]
track_event_mixpanel(resp['event_type'],{'user' : user, 'distinct_id' : user})
@event_handler()
def course_track_event(fs,db,response):
for resp in response:
for regex in COURSE_PAGES_TO_TRACK:
match = re.search(regex, resp['event_type'])
user = resp["username"]
if match is not None:
split_url = resp['event_type'].split("/")
org = split_url[2]
course = split_url[3]
track_event_mixpanel(regex,{'user' : user, 'distinct_id' : user, 'full_url' : resp['event_type'], 'course' : course, 'org' : org})
| Fix up mixpanel course tracking | Fix up mixpanel course tracking
| Python | agpl-3.0 | edx/edxanalytics,edx/edxanalytics,edx/insights,edx/edxanalytics,edx/edxanalytics,edx/insights | from modules.mixpanel.mixpanel import track_event_mixpanel
from modules.decorators import view, query, event_handler
import re
SINGLE_PAGES_TO_TRACK = ['/', '/dashboard', '/create_account']
REGEX_PAGES_TO_TRACK = ['/course', '/about']
@event_handler()
def single_page_track_event(fs, db, response):
for resp in response:
if resp['event_type'] in SINGLE_PAGES_TO_TRACK:
user = resp["username"]
track_event_mixpanel(resp['event_type'],{'user' : user, 'distinct_id' : user})
@event_handler()
def regex_track_event(fs,db,response):
for rep in response:
for regex in REGEX_PAGES_TO_TRACK:
match = re.search(regex, resp['event_type'])
if match is not None:
track_event_mixpanel(regex,{'user' : user, 'distinct_id' : user, 'full_url' : resp['event_type']})
Fix up mixpanel course tracking | from modules.mixpanel.mixpanel import track_event_mixpanel
from modules.decorators import view, query, event_handler
import re
SINGLE_PAGES_TO_TRACK = ['/', '/dashboard', '/create_account']
COURSE_PAGES_TO_TRACK = ['/courses', '/about']
@event_handler()
def single_page_track_event(fs, db, response):
for resp in response:
if resp['event_type'] in SINGLE_PAGES_TO_TRACK:
user = resp["username"]
track_event_mixpanel(resp['event_type'],{'user' : user, 'distinct_id' : user})
@event_handler()
def course_track_event(fs,db,response):
for resp in response:
for regex in COURSE_PAGES_TO_TRACK:
match = re.search(regex, resp['event_type'])
user = resp["username"]
if match is not None:
split_url = resp['event_type'].split("/")
org = split_url[2]
course = split_url[3]
track_event_mixpanel(regex,{'user' : user, 'distinct_id' : user, 'full_url' : resp['event_type'], 'course' : course, 'org' : org})
| <commit_before>from modules.mixpanel.mixpanel import track_event_mixpanel
from modules.decorators import view, query, event_handler
import re
SINGLE_PAGES_TO_TRACK = ['/', '/dashboard', '/create_account']
REGEX_PAGES_TO_TRACK = ['/course', '/about']
@event_handler()
def single_page_track_event(fs, db, response):
for resp in response:
if resp['event_type'] in SINGLE_PAGES_TO_TRACK:
user = resp["username"]
track_event_mixpanel(resp['event_type'],{'user' : user, 'distinct_id' : user})
@event_handler()
def regex_track_event(fs,db,response):
for rep in response:
for regex in REGEX_PAGES_TO_TRACK:
match = re.search(regex, resp['event_type'])
if match is not None:
track_event_mixpanel(regex,{'user' : user, 'distinct_id' : user, 'full_url' : resp['event_type']})
<commit_msg>Fix up mixpanel course tracking<commit_after> | from modules.mixpanel.mixpanel import track_event_mixpanel
from modules.decorators import view, query, event_handler
import re
SINGLE_PAGES_TO_TRACK = ['/', '/dashboard', '/create_account']
COURSE_PAGES_TO_TRACK = ['/courses', '/about']
@event_handler()
def single_page_track_event(fs, db, response):
for resp in response:
if resp['event_type'] in SINGLE_PAGES_TO_TRACK:
user = resp["username"]
track_event_mixpanel(resp['event_type'],{'user' : user, 'distinct_id' : user})
@event_handler()
def course_track_event(fs,db,response):
for resp in response:
for regex in COURSE_PAGES_TO_TRACK:
match = re.search(regex, resp['event_type'])
user = resp["username"]
if match is not None:
split_url = resp['event_type'].split("/")
org = split_url[2]
course = split_url[3]
track_event_mixpanel(regex,{'user' : user, 'distinct_id' : user, 'full_url' : resp['event_type'], 'course' : course, 'org' : org})
| from modules.mixpanel.mixpanel import track_event_mixpanel
from modules.decorators import view, query, event_handler
import re
SINGLE_PAGES_TO_TRACK = ['/', '/dashboard', '/create_account']
REGEX_PAGES_TO_TRACK = ['/course', '/about']
@event_handler()
def single_page_track_event(fs, db, response):
for resp in response:
if resp['event_type'] in SINGLE_PAGES_TO_TRACK:
user = resp["username"]
track_event_mixpanel(resp['event_type'],{'user' : user, 'distinct_id' : user})
@event_handler()
def regex_track_event(fs,db,response):
for rep in response:
for regex in REGEX_PAGES_TO_TRACK:
match = re.search(regex, resp['event_type'])
if match is not None:
track_event_mixpanel(regex,{'user' : user, 'distinct_id' : user, 'full_url' : resp['event_type']})
Fix up mixpanel course trackingfrom modules.mixpanel.mixpanel import track_event_mixpanel
from modules.decorators import view, query, event_handler
import re
SINGLE_PAGES_TO_TRACK = ['/', '/dashboard', '/create_account']
COURSE_PAGES_TO_TRACK = ['/courses', '/about']
@event_handler()
def single_page_track_event(fs, db, response):
for resp in response:
if resp['event_type'] in SINGLE_PAGES_TO_TRACK:
user = resp["username"]
track_event_mixpanel(resp['event_type'],{'user' : user, 'distinct_id' : user})
@event_handler()
def course_track_event(fs,db,response):
for resp in response:
for regex in COURSE_PAGES_TO_TRACK:
match = re.search(regex, resp['event_type'])
user = resp["username"]
if match is not None:
split_url = resp['event_type'].split("/")
org = split_url[2]
course = split_url[3]
track_event_mixpanel(regex,{'user' : user, 'distinct_id' : user, 'full_url' : resp['event_type'], 'course' : course, 'org' : org})
| <commit_before>from modules.mixpanel.mixpanel import track_event_mixpanel
from modules.decorators import view, query, event_handler
import re
SINGLE_PAGES_TO_TRACK = ['/', '/dashboard', '/create_account']
REGEX_PAGES_TO_TRACK = ['/course', '/about']
@event_handler()
def single_page_track_event(fs, db, response):
for resp in response:
if resp['event_type'] in SINGLE_PAGES_TO_TRACK:
user = resp["username"]
track_event_mixpanel(resp['event_type'],{'user' : user, 'distinct_id' : user})
@event_handler()
def regex_track_event(fs,db,response):
for rep in response:
for regex in REGEX_PAGES_TO_TRACK:
match = re.search(regex, resp['event_type'])
if match is not None:
track_event_mixpanel(regex,{'user' : user, 'distinct_id' : user, 'full_url' : resp['event_type']})
<commit_msg>Fix up mixpanel course tracking<commit_after>from modules.mixpanel.mixpanel import track_event_mixpanel
from modules.decorators import view, query, event_handler
import re
SINGLE_PAGES_TO_TRACK = ['/', '/dashboard', '/create_account']
COURSE_PAGES_TO_TRACK = ['/courses', '/about']
@event_handler()
def single_page_track_event(fs, db, response):
for resp in response:
if resp['event_type'] in SINGLE_PAGES_TO_TRACK:
user = resp["username"]
track_event_mixpanel(resp['event_type'],{'user' : user, 'distinct_id' : user})
@event_handler()
def course_track_event(fs,db,response):
for resp in response:
for regex in COURSE_PAGES_TO_TRACK:
match = re.search(regex, resp['event_type'])
user = resp["username"]
if match is not None:
split_url = resp['event_type'].split("/")
org = split_url[2]
course = split_url[3]
track_event_mixpanel(regex,{'user' : user, 'distinct_id' : user, 'full_url' : resp['event_type'], 'course' : course, 'org' : org})
|
aeef2c319ea5c7d59a0bdf69a5fbe5dc8a1ab1bc | wagtailnews/feeds.py | wagtailnews/feeds.py | from django.contrib.syndication.views import Feed
from django.utils import timezone
class LatestEnteriesFeed(Feed):
description = "Latest news"
def items(self):
now = timezone.now()
NewsItem = self.news_index.get_newsitem_model()
newsitem_list = NewsItem.objects.live().order_by('-date').filter(
newsindex=self.news_index, date__lte=now)[:20]
return newsitem_list
def item_link(self, item):
return item.url()
def __init__(self, news_index):
super(LatestEnteriesFeed, self).__init__()
self.news_index = news_index
self.title = news_index.title
self.link = news_index.url
def item_pubdate(self, item):
return item.date
| from django.contrib.syndication.views import Feed
from django.utils import timezone
class LatestEnteriesFeed(Feed):
def items(self):
now = timezone.now()
NewsItem = self.news_index.get_newsitem_model()
newsitem_list = NewsItem.objects.live().order_by('-date').filter(
newsindex=self.news_index, date__lte=now)[:20]
return newsitem_list
def item_link(self, item):
return item.full_url()
def item_guid(self, item):
return item.full_url()
item_guid_is_permalink = True
def item_pubdate(self, item):
return item.date
def __init__(self, news_index):
super(LatestEnteriesFeed, self).__init__()
self.news_index = news_index
self.title = news_index.title
self.description = news_index.title
self.link = news_index.full_url
self.feed_url = self.link + news_index.reverse_subpage('feed')
| Add some extra item methods / parameters to LatestEntriesFeed | Add some extra item methods / parameters to LatestEntriesFeed
| Python | bsd-2-clause | takeflight/wagtailnews,takeflight/wagtailnews,takeflight/wagtailnews,takeflight/wagtailnews | from django.contrib.syndication.views import Feed
from django.utils import timezone
class LatestEnteriesFeed(Feed):
description = "Latest news"
def items(self):
now = timezone.now()
NewsItem = self.news_index.get_newsitem_model()
newsitem_list = NewsItem.objects.live().order_by('-date').filter(
newsindex=self.news_index, date__lte=now)[:20]
return newsitem_list
def item_link(self, item):
return item.url()
def __init__(self, news_index):
super(LatestEnteriesFeed, self).__init__()
self.news_index = news_index
self.title = news_index.title
self.link = news_index.url
def item_pubdate(self, item):
return item.date
Add some extra item methods / parameters to LatestEntriesFeed | from django.contrib.syndication.views import Feed
from django.utils import timezone
class LatestEnteriesFeed(Feed):
def items(self):
now = timezone.now()
NewsItem = self.news_index.get_newsitem_model()
newsitem_list = NewsItem.objects.live().order_by('-date').filter(
newsindex=self.news_index, date__lte=now)[:20]
return newsitem_list
def item_link(self, item):
return item.full_url()
def item_guid(self, item):
return item.full_url()
item_guid_is_permalink = True
def item_pubdate(self, item):
return item.date
def __init__(self, news_index):
super(LatestEnteriesFeed, self).__init__()
self.news_index = news_index
self.title = news_index.title
self.description = news_index.title
self.link = news_index.full_url
self.feed_url = self.link + news_index.reverse_subpage('feed')
| <commit_before>from django.contrib.syndication.views import Feed
from django.utils import timezone
class LatestEnteriesFeed(Feed):
description = "Latest news"
def items(self):
now = timezone.now()
NewsItem = self.news_index.get_newsitem_model()
newsitem_list = NewsItem.objects.live().order_by('-date').filter(
newsindex=self.news_index, date__lte=now)[:20]
return newsitem_list
def item_link(self, item):
return item.url()
def __init__(self, news_index):
super(LatestEnteriesFeed, self).__init__()
self.news_index = news_index
self.title = news_index.title
self.link = news_index.url
def item_pubdate(self, item):
return item.date
<commit_msg>Add some extra item methods / parameters to LatestEntriesFeed<commit_after> | from django.contrib.syndication.views import Feed
from django.utils import timezone
class LatestEnteriesFeed(Feed):
def items(self):
now = timezone.now()
NewsItem = self.news_index.get_newsitem_model()
newsitem_list = NewsItem.objects.live().order_by('-date').filter(
newsindex=self.news_index, date__lte=now)[:20]
return newsitem_list
def item_link(self, item):
return item.full_url()
def item_guid(self, item):
return item.full_url()
item_guid_is_permalink = True
def item_pubdate(self, item):
return item.date
def __init__(self, news_index):
super(LatestEnteriesFeed, self).__init__()
self.news_index = news_index
self.title = news_index.title
self.description = news_index.title
self.link = news_index.full_url
self.feed_url = self.link + news_index.reverse_subpage('feed')
| from django.contrib.syndication.views import Feed
from django.utils import timezone
class LatestEnteriesFeed(Feed):
description = "Latest news"
def items(self):
now = timezone.now()
NewsItem = self.news_index.get_newsitem_model()
newsitem_list = NewsItem.objects.live().order_by('-date').filter(
newsindex=self.news_index, date__lte=now)[:20]
return newsitem_list
def item_link(self, item):
return item.url()
def __init__(self, news_index):
super(LatestEnteriesFeed, self).__init__()
self.news_index = news_index
self.title = news_index.title
self.link = news_index.url
def item_pubdate(self, item):
return item.date
Add some extra item methods / parameters to LatestEntriesFeedfrom django.contrib.syndication.views import Feed
from django.utils import timezone
class LatestEnteriesFeed(Feed):
def items(self):
now = timezone.now()
NewsItem = self.news_index.get_newsitem_model()
newsitem_list = NewsItem.objects.live().order_by('-date').filter(
newsindex=self.news_index, date__lte=now)[:20]
return newsitem_list
def item_link(self, item):
return item.full_url()
def item_guid(self, item):
return item.full_url()
item_guid_is_permalink = True
def item_pubdate(self, item):
return item.date
def __init__(self, news_index):
super(LatestEnteriesFeed, self).__init__()
self.news_index = news_index
self.title = news_index.title
self.description = news_index.title
self.link = news_index.full_url
self.feed_url = self.link + news_index.reverse_subpage('feed')
| <commit_before>from django.contrib.syndication.views import Feed
from django.utils import timezone
class LatestEnteriesFeed(Feed):
description = "Latest news"
def items(self):
now = timezone.now()
NewsItem = self.news_index.get_newsitem_model()
newsitem_list = NewsItem.objects.live().order_by('-date').filter(
newsindex=self.news_index, date__lte=now)[:20]
return newsitem_list
def item_link(self, item):
return item.url()
def __init__(self, news_index):
super(LatestEnteriesFeed, self).__init__()
self.news_index = news_index
self.title = news_index.title
self.link = news_index.url
def item_pubdate(self, item):
return item.date
<commit_msg>Add some extra item methods / parameters to LatestEntriesFeed<commit_after>from django.contrib.syndication.views import Feed
from django.utils import timezone
class LatestEnteriesFeed(Feed):
def items(self):
now = timezone.now()
NewsItem = self.news_index.get_newsitem_model()
newsitem_list = NewsItem.objects.live().order_by('-date').filter(
newsindex=self.news_index, date__lte=now)[:20]
return newsitem_list
def item_link(self, item):
return item.full_url()
def item_guid(self, item):
return item.full_url()
item_guid_is_permalink = True
def item_pubdate(self, item):
return item.date
def __init__(self, news_index):
super(LatestEnteriesFeed, self).__init__()
self.news_index = news_index
self.title = news_index.title
self.description = news_index.title
self.link = news_index.full_url
self.feed_url = self.link + news_index.reverse_subpage('feed')
|
b3a8a187cb6e569229d7e6d2929377035790f7de | virtool/dev/api.py | virtool/dev/api.py | from logging import getLogger
from virtool.api.response import no_content
from virtool.fake.wrapper import FakerWrapper
from virtool.http.routes import Routes
from virtool.samples.fake import create_fake_samples
from virtool.subtractions.fake import create_fake_fasta_upload, create_fake_finalized_subtraction
from virtool.utils import random_alphanumeric
logger = getLogger(__name__)
routes = Routes()
faker = FakerWrapper()
@routes.post("/api/dev")
async def dev(req):
data = await req.json()
user_id = req["client"].user_id
command = data.get("command")
if command == "clear_users":
await req.app["db"].users.delete_many({})
await req.app["db"].sessions.delete_many({})
await req.app["db"].keys.delete_many({})
logger.debug("Cleared users")
if command == "create_subtraction":
upload_id, upload_name = await create_fake_fasta_upload(
req.app,
req["client"].user_id
)
await create_fake_finalized_subtraction(
req.app,
upload_id,
upload_name,
random_alphanumeric(8),
user_id
)
if command == "create_sample":
await create_fake_samples(req.app)
return no_content()
| from logging import getLogger
from virtool.api.response import no_content
from virtool.fake.wrapper import FakerWrapper
from virtool.http.routes import Routes
from virtool.samples.fake import create_fake_sample
from virtool.subtractions.fake import create_fake_fasta_upload, create_fake_finalized_subtraction
from virtool.utils import random_alphanumeric
logger = getLogger(__name__)
routes = Routes()
faker = FakerWrapper()
@routes.post("/api/dev")
async def dev(req):
data = await req.json()
user_id = req["client"].user_id
command = data.get("command")
if command == "clear_users":
await req.app["db"].users.delete_many({})
await req.app["db"].sessions.delete_many({})
await req.app["db"].keys.delete_many({})
logger.debug("Cleared users")
if command == "create_subtraction":
upload_id, upload_name = await create_fake_fasta_upload(
req.app,
req["client"].user_id
)
await create_fake_finalized_subtraction(
req.app,
upload_id,
upload_name,
random_alphanumeric(8),
user_id
)
if command == "create_sample":
await create_fake_sample(
req.app,
random_alphanumeric(8),
req["client"].user_id,
False,
True
)
return no_content()
| Fix handling of create_sample command on dev API endpoint | Fix handling of create_sample command on dev API endpoint
This was completely broken. | Python | mit | virtool/virtool,igboyes/virtool,virtool/virtool,igboyes/virtool | from logging import getLogger
from virtool.api.response import no_content
from virtool.fake.wrapper import FakerWrapper
from virtool.http.routes import Routes
from virtool.samples.fake import create_fake_samples
from virtool.subtractions.fake import create_fake_fasta_upload, create_fake_finalized_subtraction
from virtool.utils import random_alphanumeric
logger = getLogger(__name__)
routes = Routes()
faker = FakerWrapper()
@routes.post("/api/dev")
async def dev(req):
data = await req.json()
user_id = req["client"].user_id
command = data.get("command")
if command == "clear_users":
await req.app["db"].users.delete_many({})
await req.app["db"].sessions.delete_many({})
await req.app["db"].keys.delete_many({})
logger.debug("Cleared users")
if command == "create_subtraction":
upload_id, upload_name = await create_fake_fasta_upload(
req.app,
req["client"].user_id
)
await create_fake_finalized_subtraction(
req.app,
upload_id,
upload_name,
random_alphanumeric(8),
user_id
)
if command == "create_sample":
await create_fake_samples(req.app)
return no_content()
Fix handling of create_sample command on dev API endpoint
This was completely broken. | from logging import getLogger
from virtool.api.response import no_content
from virtool.fake.wrapper import FakerWrapper
from virtool.http.routes import Routes
from virtool.samples.fake import create_fake_sample
from virtool.subtractions.fake import create_fake_fasta_upload, create_fake_finalized_subtraction
from virtool.utils import random_alphanumeric
logger = getLogger(__name__)
routes = Routes()
faker = FakerWrapper()
@routes.post("/api/dev")
async def dev(req):
data = await req.json()
user_id = req["client"].user_id
command = data.get("command")
if command == "clear_users":
await req.app["db"].users.delete_many({})
await req.app["db"].sessions.delete_many({})
await req.app["db"].keys.delete_many({})
logger.debug("Cleared users")
if command == "create_subtraction":
upload_id, upload_name = await create_fake_fasta_upload(
req.app,
req["client"].user_id
)
await create_fake_finalized_subtraction(
req.app,
upload_id,
upload_name,
random_alphanumeric(8),
user_id
)
if command == "create_sample":
await create_fake_sample(
req.app,
random_alphanumeric(8),
req["client"].user_id,
False,
True
)
return no_content()
| <commit_before>from logging import getLogger
from virtool.api.response import no_content
from virtool.fake.wrapper import FakerWrapper
from virtool.http.routes import Routes
from virtool.samples.fake import create_fake_samples
from virtool.subtractions.fake import create_fake_fasta_upload, create_fake_finalized_subtraction
from virtool.utils import random_alphanumeric
logger = getLogger(__name__)
routes = Routes()
faker = FakerWrapper()
@routes.post("/api/dev")
async def dev(req):
data = await req.json()
user_id = req["client"].user_id
command = data.get("command")
if command == "clear_users":
await req.app["db"].users.delete_many({})
await req.app["db"].sessions.delete_many({})
await req.app["db"].keys.delete_many({})
logger.debug("Cleared users")
if command == "create_subtraction":
upload_id, upload_name = await create_fake_fasta_upload(
req.app,
req["client"].user_id
)
await create_fake_finalized_subtraction(
req.app,
upload_id,
upload_name,
random_alphanumeric(8),
user_id
)
if command == "create_sample":
await create_fake_samples(req.app)
return no_content()
<commit_msg>Fix handling of create_sample command on dev API endpoint
This was completely broken.<commit_after> | from logging import getLogger
from virtool.api.response import no_content
from virtool.fake.wrapper import FakerWrapper
from virtool.http.routes import Routes
from virtool.samples.fake import create_fake_sample
from virtool.subtractions.fake import create_fake_fasta_upload, create_fake_finalized_subtraction
from virtool.utils import random_alphanumeric
logger = getLogger(__name__)
routes = Routes()
faker = FakerWrapper()
@routes.post("/api/dev")
async def dev(req):
data = await req.json()
user_id = req["client"].user_id
command = data.get("command")
if command == "clear_users":
await req.app["db"].users.delete_many({})
await req.app["db"].sessions.delete_many({})
await req.app["db"].keys.delete_many({})
logger.debug("Cleared users")
if command == "create_subtraction":
upload_id, upload_name = await create_fake_fasta_upload(
req.app,
req["client"].user_id
)
await create_fake_finalized_subtraction(
req.app,
upload_id,
upload_name,
random_alphanumeric(8),
user_id
)
if command == "create_sample":
await create_fake_sample(
req.app,
random_alphanumeric(8),
req["client"].user_id,
False,
True
)
return no_content()
| from logging import getLogger
from virtool.api.response import no_content
from virtool.fake.wrapper import FakerWrapper
from virtool.http.routes import Routes
from virtool.samples.fake import create_fake_samples
from virtool.subtractions.fake import create_fake_fasta_upload, create_fake_finalized_subtraction
from virtool.utils import random_alphanumeric
logger = getLogger(__name__)
routes = Routes()
faker = FakerWrapper()
@routes.post("/api/dev")
async def dev(req):
data = await req.json()
user_id = req["client"].user_id
command = data.get("command")
if command == "clear_users":
await req.app["db"].users.delete_many({})
await req.app["db"].sessions.delete_many({})
await req.app["db"].keys.delete_many({})
logger.debug("Cleared users")
if command == "create_subtraction":
upload_id, upload_name = await create_fake_fasta_upload(
req.app,
req["client"].user_id
)
await create_fake_finalized_subtraction(
req.app,
upload_id,
upload_name,
random_alphanumeric(8),
user_id
)
if command == "create_sample":
await create_fake_samples(req.app)
return no_content()
Fix handling of create_sample command on dev API endpoint
This was completely broken.from logging import getLogger
from virtool.api.response import no_content
from virtool.fake.wrapper import FakerWrapper
from virtool.http.routes import Routes
from virtool.samples.fake import create_fake_sample
from virtool.subtractions.fake import create_fake_fasta_upload, create_fake_finalized_subtraction
from virtool.utils import random_alphanumeric
logger = getLogger(__name__)
routes = Routes()
faker = FakerWrapper()
@routes.post("/api/dev")
async def dev(req):
data = await req.json()
user_id = req["client"].user_id
command = data.get("command")
if command == "clear_users":
await req.app["db"].users.delete_many({})
await req.app["db"].sessions.delete_many({})
await req.app["db"].keys.delete_many({})
logger.debug("Cleared users")
if command == "create_subtraction":
upload_id, upload_name = await create_fake_fasta_upload(
req.app,
req["client"].user_id
)
await create_fake_finalized_subtraction(
req.app,
upload_id,
upload_name,
random_alphanumeric(8),
user_id
)
if command == "create_sample":
await create_fake_sample(
req.app,
random_alphanumeric(8),
req["client"].user_id,
False,
True
)
return no_content()
| <commit_before>from logging import getLogger
from virtool.api.response import no_content
from virtool.fake.wrapper import FakerWrapper
from virtool.http.routes import Routes
from virtool.samples.fake import create_fake_samples
from virtool.subtractions.fake import create_fake_fasta_upload, create_fake_finalized_subtraction
from virtool.utils import random_alphanumeric
logger = getLogger(__name__)
routes = Routes()
faker = FakerWrapper()
@routes.post("/api/dev")
async def dev(req):
data = await req.json()
user_id = req["client"].user_id
command = data.get("command")
if command == "clear_users":
await req.app["db"].users.delete_many({})
await req.app["db"].sessions.delete_many({})
await req.app["db"].keys.delete_many({})
logger.debug("Cleared users")
if command == "create_subtraction":
upload_id, upload_name = await create_fake_fasta_upload(
req.app,
req["client"].user_id
)
await create_fake_finalized_subtraction(
req.app,
upload_id,
upload_name,
random_alphanumeric(8),
user_id
)
if command == "create_sample":
await create_fake_samples(req.app)
return no_content()
<commit_msg>Fix handling of create_sample command on dev API endpoint
This was completely broken.<commit_after>from logging import getLogger
from virtool.api.response import no_content
from virtool.fake.wrapper import FakerWrapper
from virtool.http.routes import Routes
from virtool.samples.fake import create_fake_sample
from virtool.subtractions.fake import create_fake_fasta_upload, create_fake_finalized_subtraction
from virtool.utils import random_alphanumeric
logger = getLogger(__name__)
routes = Routes()
faker = FakerWrapper()
@routes.post("/api/dev")
async def dev(req):
data = await req.json()
user_id = req["client"].user_id
command = data.get("command")
if command == "clear_users":
await req.app["db"].users.delete_many({})
await req.app["db"].sessions.delete_many({})
await req.app["db"].keys.delete_many({})
logger.debug("Cleared users")
if command == "create_subtraction":
upload_id, upload_name = await create_fake_fasta_upload(
req.app,
req["client"].user_id
)
await create_fake_finalized_subtraction(
req.app,
upload_id,
upload_name,
random_alphanumeric(8),
user_id
)
if command == "create_sample":
await create_fake_sample(
req.app,
random_alphanumeric(8),
req["client"].user_id,
False,
True
)
return no_content()
|
c8bf23253aaacb880f438b7093c85c76767734e7 | duedil/resources/pro/company/accounts/__init__.py | duedil/resources/pro/company/accounts/__init__.py | 'Accounts'
from __future__ import unicode_literals
from .... import ProResource, RelatedResourceMixin
import six
import sys
class Account(RelatedResourceMixin, ProResource):
'Abstraction of Accounts resource in duedil v3 pro api'
attribute_names = [
'uri',
'date',
'type'
]
account_classes = {
'financial': 'pro.company.accounts.financial.AccountDetailsFinancial',
'gaap': 'pro.company.accounts.gaap.AccountDetailsGAAP',
'ifrs': 'pro.company.accounts.ifrs.AccountDetailsIFRS',
'insurance': 'pro.company.accounts.insurance.AccountDetailsInsurance',
'statutory': 'pro.company.accounts.statutory.AccountDetailsStatutory',
}
full_endpoint = True
def __iter__(self):
return iter(dict([(i,getattr(self, i)) for i in self.attribute_names]))
@property
def path(self):
return self.uri.split('/', 5)[-1].rsplit('/', 1)[0]
@property
def details(self):
resource = self.account_classes[self.type]
if isinstance(resource, six.string_types):
module, resource = resource.rsplit('.', 1)
resource = getattr(sys.modules['duedil.resources.{0!s}'.format(module)], resource)
resource_obj = self.load_related('details', resource, self.full_endpoint)
resource_obj.path = '{0}'.format(self.path)
resource_obj.loaded = True
return resource_obj
| 'Accounts'
from __future__ import unicode_literals
from .... import ProResource, RelatedResourceMixin
import six
import sys
class Account(RelatedResourceMixin, ProResource):
'Abstraction of Accounts resource in duedil v3 pro api'
attribute_names = [
'uri',
'date',
'type'
]
account_classes = {
'financial': 'pro.company.accounts.financial.AccountDetailsFinancial',
'gaap': 'pro.company.accounts.gaap.AccountDetailsGAAP',
'ifrs': 'pro.company.accounts.ifrs.AccountDetailsIFRS',
'insurance': 'pro.company.accounts.insurance.AccountDetailsInsurance',
'statutory': 'pro.company.accounts.statutory.AccountDetailsStatutory',
}
full_endpoint = True
def __iter__(self):
return iter({i: getattr(self, i) for i in self.attribute_names})
@property
def path(self):
return self.uri.split('/', 5)[-1].rsplit('/', 1)[0]
@property
def details(self):
resource = self.account_classes[self.type]
if isinstance(resource, six.string_types):
module, resource = resource.rsplit('.', 1)
resource = getattr(sys.modules['duedil.resources.{0!s}'.format(module)], resource)
resource_obj = self.load_related('details', resource, self.full_endpoint)
resource_obj.path = '{0}'.format(self.path)
resource_obj.loaded = True
return resource_obj
| Use dict comprehension instead of dict([...]) | Use dict comprehension instead of dict([...])
| Python | apache-2.0 | founders4schools/duedilv3 | 'Accounts'
from __future__ import unicode_literals
from .... import ProResource, RelatedResourceMixin
import six
import sys
class Account(RelatedResourceMixin, ProResource):
'Abstraction of Accounts resource in duedil v3 pro api'
attribute_names = [
'uri',
'date',
'type'
]
account_classes = {
'financial': 'pro.company.accounts.financial.AccountDetailsFinancial',
'gaap': 'pro.company.accounts.gaap.AccountDetailsGAAP',
'ifrs': 'pro.company.accounts.ifrs.AccountDetailsIFRS',
'insurance': 'pro.company.accounts.insurance.AccountDetailsInsurance',
'statutory': 'pro.company.accounts.statutory.AccountDetailsStatutory',
}
full_endpoint = True
def __iter__(self):
return iter(dict([(i,getattr(self, i)) for i in self.attribute_names]))
@property
def path(self):
return self.uri.split('/', 5)[-1].rsplit('/', 1)[0]
@property
def details(self):
resource = self.account_classes[self.type]
if isinstance(resource, six.string_types):
module, resource = resource.rsplit('.', 1)
resource = getattr(sys.modules['duedil.resources.{0!s}'.format(module)], resource)
resource_obj = self.load_related('details', resource, self.full_endpoint)
resource_obj.path = '{0}'.format(self.path)
resource_obj.loaded = True
return resource_obj
Use dict comprehension instead of dict([...]) | 'Accounts'
from __future__ import unicode_literals
from .... import ProResource, RelatedResourceMixin
import six
import sys
class Account(RelatedResourceMixin, ProResource):
'Abstraction of Accounts resource in duedil v3 pro api'
attribute_names = [
'uri',
'date',
'type'
]
account_classes = {
'financial': 'pro.company.accounts.financial.AccountDetailsFinancial',
'gaap': 'pro.company.accounts.gaap.AccountDetailsGAAP',
'ifrs': 'pro.company.accounts.ifrs.AccountDetailsIFRS',
'insurance': 'pro.company.accounts.insurance.AccountDetailsInsurance',
'statutory': 'pro.company.accounts.statutory.AccountDetailsStatutory',
}
full_endpoint = True
def __iter__(self):
return iter({i: getattr(self, i) for i in self.attribute_names})
@property
def path(self):
return self.uri.split('/', 5)[-1].rsplit('/', 1)[0]
@property
def details(self):
resource = self.account_classes[self.type]
if isinstance(resource, six.string_types):
module, resource = resource.rsplit('.', 1)
resource = getattr(sys.modules['duedil.resources.{0!s}'.format(module)], resource)
resource_obj = self.load_related('details', resource, self.full_endpoint)
resource_obj.path = '{0}'.format(self.path)
resource_obj.loaded = True
return resource_obj
| <commit_before>'Accounts'
from __future__ import unicode_literals
from .... import ProResource, RelatedResourceMixin
import six
import sys
class Account(RelatedResourceMixin, ProResource):
'Abstraction of Accounts resource in duedil v3 pro api'
attribute_names = [
'uri',
'date',
'type'
]
account_classes = {
'financial': 'pro.company.accounts.financial.AccountDetailsFinancial',
'gaap': 'pro.company.accounts.gaap.AccountDetailsGAAP',
'ifrs': 'pro.company.accounts.ifrs.AccountDetailsIFRS',
'insurance': 'pro.company.accounts.insurance.AccountDetailsInsurance',
'statutory': 'pro.company.accounts.statutory.AccountDetailsStatutory',
}
full_endpoint = True
def __iter__(self):
return iter(dict([(i,getattr(self, i)) for i in self.attribute_names]))
@property
def path(self):
return self.uri.split('/', 5)[-1].rsplit('/', 1)[0]
@property
def details(self):
resource = self.account_classes[self.type]
if isinstance(resource, six.string_types):
module, resource = resource.rsplit('.', 1)
resource = getattr(sys.modules['duedil.resources.{0!s}'.format(module)], resource)
resource_obj = self.load_related('details', resource, self.full_endpoint)
resource_obj.path = '{0}'.format(self.path)
resource_obj.loaded = True
return resource_obj
<commit_msg>Use dict comprehension instead of dict([...])<commit_after> | 'Accounts'
from __future__ import unicode_literals
from .... import ProResource, RelatedResourceMixin
import six
import sys
class Account(RelatedResourceMixin, ProResource):
'Abstraction of Accounts resource in duedil v3 pro api'
attribute_names = [
'uri',
'date',
'type'
]
account_classes = {
'financial': 'pro.company.accounts.financial.AccountDetailsFinancial',
'gaap': 'pro.company.accounts.gaap.AccountDetailsGAAP',
'ifrs': 'pro.company.accounts.ifrs.AccountDetailsIFRS',
'insurance': 'pro.company.accounts.insurance.AccountDetailsInsurance',
'statutory': 'pro.company.accounts.statutory.AccountDetailsStatutory',
}
full_endpoint = True
def __iter__(self):
return iter({i: getattr(self, i) for i in self.attribute_names})
@property
def path(self):
return self.uri.split('/', 5)[-1].rsplit('/', 1)[0]
@property
def details(self):
resource = self.account_classes[self.type]
if isinstance(resource, six.string_types):
module, resource = resource.rsplit('.', 1)
resource = getattr(sys.modules['duedil.resources.{0!s}'.format(module)], resource)
resource_obj = self.load_related('details', resource, self.full_endpoint)
resource_obj.path = '{0}'.format(self.path)
resource_obj.loaded = True
return resource_obj
| 'Accounts'
from __future__ import unicode_literals
from .... import ProResource, RelatedResourceMixin
import six
import sys
class Account(RelatedResourceMixin, ProResource):
'Abstraction of Accounts resource in duedil v3 pro api'
attribute_names = [
'uri',
'date',
'type'
]
account_classes = {
'financial': 'pro.company.accounts.financial.AccountDetailsFinancial',
'gaap': 'pro.company.accounts.gaap.AccountDetailsGAAP',
'ifrs': 'pro.company.accounts.ifrs.AccountDetailsIFRS',
'insurance': 'pro.company.accounts.insurance.AccountDetailsInsurance',
'statutory': 'pro.company.accounts.statutory.AccountDetailsStatutory',
}
full_endpoint = True
def __iter__(self):
return iter(dict([(i,getattr(self, i)) for i in self.attribute_names]))
@property
def path(self):
return self.uri.split('/', 5)[-1].rsplit('/', 1)[0]
@property
def details(self):
resource = self.account_classes[self.type]
if isinstance(resource, six.string_types):
module, resource = resource.rsplit('.', 1)
resource = getattr(sys.modules['duedil.resources.{0!s}'.format(module)], resource)
resource_obj = self.load_related('details', resource, self.full_endpoint)
resource_obj.path = '{0}'.format(self.path)
resource_obj.loaded = True
return resource_obj
Use dict comprehension instead of dict([...])'Accounts'
from __future__ import unicode_literals
from .... import ProResource, RelatedResourceMixin
import six
import sys
class Account(RelatedResourceMixin, ProResource):
'Abstraction of Accounts resource in duedil v3 pro api'
attribute_names = [
'uri',
'date',
'type'
]
account_classes = {
'financial': 'pro.company.accounts.financial.AccountDetailsFinancial',
'gaap': 'pro.company.accounts.gaap.AccountDetailsGAAP',
'ifrs': 'pro.company.accounts.ifrs.AccountDetailsIFRS',
'insurance': 'pro.company.accounts.insurance.AccountDetailsInsurance',
'statutory': 'pro.company.accounts.statutory.AccountDetailsStatutory',
}
full_endpoint = True
def __iter__(self):
return iter({i: getattr(self, i) for i in self.attribute_names})
@property
def path(self):
return self.uri.split('/', 5)[-1].rsplit('/', 1)[0]
@property
def details(self):
resource = self.account_classes[self.type]
if isinstance(resource, six.string_types):
module, resource = resource.rsplit('.', 1)
resource = getattr(sys.modules['duedil.resources.{0!s}'.format(module)], resource)
resource_obj = self.load_related('details', resource, self.full_endpoint)
resource_obj.path = '{0}'.format(self.path)
resource_obj.loaded = True
return resource_obj
| <commit_before>'Accounts'
from __future__ import unicode_literals
from .... import ProResource, RelatedResourceMixin
import six
import sys
class Account(RelatedResourceMixin, ProResource):
'Abstraction of Accounts resource in duedil v3 pro api'
attribute_names = [
'uri',
'date',
'type'
]
account_classes = {
'financial': 'pro.company.accounts.financial.AccountDetailsFinancial',
'gaap': 'pro.company.accounts.gaap.AccountDetailsGAAP',
'ifrs': 'pro.company.accounts.ifrs.AccountDetailsIFRS',
'insurance': 'pro.company.accounts.insurance.AccountDetailsInsurance',
'statutory': 'pro.company.accounts.statutory.AccountDetailsStatutory',
}
full_endpoint = True
def __iter__(self):
return iter(dict([(i,getattr(self, i)) for i in self.attribute_names]))
@property
def path(self):
return self.uri.split('/', 5)[-1].rsplit('/', 1)[0]
@property
def details(self):
resource = self.account_classes[self.type]
if isinstance(resource, six.string_types):
module, resource = resource.rsplit('.', 1)
resource = getattr(sys.modules['duedil.resources.{0!s}'.format(module)], resource)
resource_obj = self.load_related('details', resource, self.full_endpoint)
resource_obj.path = '{0}'.format(self.path)
resource_obj.loaded = True
return resource_obj
<commit_msg>Use dict comprehension instead of dict([...])<commit_after>'Accounts'
from __future__ import unicode_literals
from .... import ProResource, RelatedResourceMixin
import six
import sys
class Account(RelatedResourceMixin, ProResource):
'Abstraction of Accounts resource in duedil v3 pro api'
attribute_names = [
'uri',
'date',
'type'
]
account_classes = {
'financial': 'pro.company.accounts.financial.AccountDetailsFinancial',
'gaap': 'pro.company.accounts.gaap.AccountDetailsGAAP',
'ifrs': 'pro.company.accounts.ifrs.AccountDetailsIFRS',
'insurance': 'pro.company.accounts.insurance.AccountDetailsInsurance',
'statutory': 'pro.company.accounts.statutory.AccountDetailsStatutory',
}
full_endpoint = True
def __iter__(self):
return iter({i: getattr(self, i) for i in self.attribute_names})
@property
def path(self):
return self.uri.split('/', 5)[-1].rsplit('/', 1)[0]
@property
def details(self):
resource = self.account_classes[self.type]
if isinstance(resource, six.string_types):
module, resource = resource.rsplit('.', 1)
resource = getattr(sys.modules['duedil.resources.{0!s}'.format(module)], resource)
resource_obj = self.load_related('details', resource, self.full_endpoint)
resource_obj.path = '{0}'.format(self.path)
resource_obj.loaded = True
return resource_obj
|
b0085ad5268da92181b043c56b64d690e5eb8679 | access/admin.py | access/admin.py | from django.contrib.auth.admin import UserAdmin
from .forms import UserCreationForm, UserChangeForm
class UserAdmin(UserAdmin):
form = UserChangeForm
add_form = UserCreationForm
fieldsets = (
(None, {'fields': ('email', 'password',)}),
('Permissions', {'fields': ('is_active', 'is_staff', 'is_superuser',)}),
('Groups', {'fields': ('groups', 'user_permissions',)}),
)
add_fieldsets = (
(None, {'classes': ('wide',),
'fields': ('email', 'password1', 'password2')}),
)
list_display = ('email', )
list_filter = ('is_active', )
search_fields = ('email',)
ordering = ('email',)
| from django.contrib.auth.admin import UserAdmin
from django.utils.translation import ugettext_lazy as _
from .forms import UserCreationForm, UserChangeForm
class UserAdmin(UserAdmin):
form = UserChangeForm
add_form = UserCreationForm
fieldsets = (
(None, {'fields': ('email', 'password', 'two_fa_enabled')}),
(_('Permissions'), {'fields': ('is_active', 'is_staff', 'is_superuser',)}),
(_('Groups'), {'fields': ('groups', 'user_permissions',)}),
(_('Important dates'), {'fields': ('last_login', 'date_joined')}),
)
add_fieldsets = (
(None, {'classes': ('wide',),
'fields': ('email', 'password1', 'password2')}),
)
list_display = ('email', )
list_filter = ('is_active', )
search_fields = ('email',)
ordering = ('email',)
| Add 2FA field, use localized labels in UserAdmin | Add 2FA field, use localized labels in UserAdmin
| Python | agpl-3.0 | node13h/droll,node13h/droll | from django.contrib.auth.admin import UserAdmin
from .forms import UserCreationForm, UserChangeForm
class UserAdmin(UserAdmin):
form = UserChangeForm
add_form = UserCreationForm
fieldsets = (
(None, {'fields': ('email', 'password',)}),
('Permissions', {'fields': ('is_active', 'is_staff', 'is_superuser',)}),
('Groups', {'fields': ('groups', 'user_permissions',)}),
)
add_fieldsets = (
(None, {'classes': ('wide',),
'fields': ('email', 'password1', 'password2')}),
)
list_display = ('email', )
list_filter = ('is_active', )
search_fields = ('email',)
ordering = ('email',)
Add 2FA field, use localized labels in UserAdmin | from django.contrib.auth.admin import UserAdmin
from django.utils.translation import ugettext_lazy as _
from .forms import UserCreationForm, UserChangeForm
class UserAdmin(UserAdmin):
form = UserChangeForm
add_form = UserCreationForm
fieldsets = (
(None, {'fields': ('email', 'password', 'two_fa_enabled')}),
(_('Permissions'), {'fields': ('is_active', 'is_staff', 'is_superuser',)}),
(_('Groups'), {'fields': ('groups', 'user_permissions',)}),
(_('Important dates'), {'fields': ('last_login', 'date_joined')}),
)
add_fieldsets = (
(None, {'classes': ('wide',),
'fields': ('email', 'password1', 'password2')}),
)
list_display = ('email', )
list_filter = ('is_active', )
search_fields = ('email',)
ordering = ('email',)
| <commit_before>from django.contrib.auth.admin import UserAdmin
from .forms import UserCreationForm, UserChangeForm
class UserAdmin(UserAdmin):
form = UserChangeForm
add_form = UserCreationForm
fieldsets = (
(None, {'fields': ('email', 'password',)}),
('Permissions', {'fields': ('is_active', 'is_staff', 'is_superuser',)}),
('Groups', {'fields': ('groups', 'user_permissions',)}),
)
add_fieldsets = (
(None, {'classes': ('wide',),
'fields': ('email', 'password1', 'password2')}),
)
list_display = ('email', )
list_filter = ('is_active', )
search_fields = ('email',)
ordering = ('email',)
<commit_msg>Add 2FA field, use localized labels in UserAdmin<commit_after> | from django.contrib.auth.admin import UserAdmin
from django.utils.translation import ugettext_lazy as _
from .forms import UserCreationForm, UserChangeForm
class UserAdmin(UserAdmin):
form = UserChangeForm
add_form = UserCreationForm
fieldsets = (
(None, {'fields': ('email', 'password', 'two_fa_enabled')}),
(_('Permissions'), {'fields': ('is_active', 'is_staff', 'is_superuser',)}),
(_('Groups'), {'fields': ('groups', 'user_permissions',)}),
(_('Important dates'), {'fields': ('last_login', 'date_joined')}),
)
add_fieldsets = (
(None, {'classes': ('wide',),
'fields': ('email', 'password1', 'password2')}),
)
list_display = ('email', )
list_filter = ('is_active', )
search_fields = ('email',)
ordering = ('email',)
| from django.contrib.auth.admin import UserAdmin
from .forms import UserCreationForm, UserChangeForm
class UserAdmin(UserAdmin):
form = UserChangeForm
add_form = UserCreationForm
fieldsets = (
(None, {'fields': ('email', 'password',)}),
('Permissions', {'fields': ('is_active', 'is_staff', 'is_superuser',)}),
('Groups', {'fields': ('groups', 'user_permissions',)}),
)
add_fieldsets = (
(None, {'classes': ('wide',),
'fields': ('email', 'password1', 'password2')}),
)
list_display = ('email', )
list_filter = ('is_active', )
search_fields = ('email',)
ordering = ('email',)
Add 2FA field, use localized labels in UserAdminfrom django.contrib.auth.admin import UserAdmin
from django.utils.translation import ugettext_lazy as _
from .forms import UserCreationForm, UserChangeForm
class UserAdmin(UserAdmin):
form = UserChangeForm
add_form = UserCreationForm
fieldsets = (
(None, {'fields': ('email', 'password', 'two_fa_enabled')}),
(_('Permissions'), {'fields': ('is_active', 'is_staff', 'is_superuser',)}),
(_('Groups'), {'fields': ('groups', 'user_permissions',)}),
(_('Important dates'), {'fields': ('last_login', 'date_joined')}),
)
add_fieldsets = (
(None, {'classes': ('wide',),
'fields': ('email', 'password1', 'password2')}),
)
list_display = ('email', )
list_filter = ('is_active', )
search_fields = ('email',)
ordering = ('email',)
| <commit_before>from django.contrib.auth.admin import UserAdmin
from .forms import UserCreationForm, UserChangeForm
class UserAdmin(UserAdmin):
form = UserChangeForm
add_form = UserCreationForm
fieldsets = (
(None, {'fields': ('email', 'password',)}),
('Permissions', {'fields': ('is_active', 'is_staff', 'is_superuser',)}),
('Groups', {'fields': ('groups', 'user_permissions',)}),
)
add_fieldsets = (
(None, {'classes': ('wide',),
'fields': ('email', 'password1', 'password2')}),
)
list_display = ('email', )
list_filter = ('is_active', )
search_fields = ('email',)
ordering = ('email',)
<commit_msg>Add 2FA field, use localized labels in UserAdmin<commit_after>from django.contrib.auth.admin import UserAdmin
from django.utils.translation import ugettext_lazy as _
from .forms import UserCreationForm, UserChangeForm
class UserAdmin(UserAdmin):
form = UserChangeForm
add_form = UserCreationForm
fieldsets = (
(None, {'fields': ('email', 'password', 'two_fa_enabled')}),
(_('Permissions'), {'fields': ('is_active', 'is_staff', 'is_superuser',)}),
(_('Groups'), {'fields': ('groups', 'user_permissions',)}),
(_('Important dates'), {'fields': ('last_login', 'date_joined')}),
)
add_fieldsets = (
(None, {'classes': ('wide',),
'fields': ('email', 'password1', 'password2')}),
)
list_display = ('email', )
list_filter = ('is_active', )
search_fields = ('email',)
ordering = ('email',)
|
1bd0cd5ed8cc41a14363d9fedcb1799096e27221 | widgets/__init__.py | widgets/__init__.py | from os.path import dirname, basename, isfile
import glob
excepts = ['__init__', 'widget']
# Find all *.py files and add them to import
modules = [basename(f)[:-3] for f in glob.glob(dirname(__file__)+"/*.py") if
isfile(f)]
__all__ = [f for f in modules if f not in excepts]
| Load all widgets when 'widgets' module is loaded. | widgets: Load all widgets when 'widgets' module is loaded.
| Python | mit | alberand/lemonbar,alberand/lemonbar,alberand/lemonbar | widgets: Load all widgets when 'widgets' module is loaded. | from os.path import dirname, basename, isfile
import glob
excepts = ['__init__', 'widget']
# Find all *.py files and add them to import
modules = [basename(f)[:-3] for f in glob.glob(dirname(__file__)+"/*.py") if
isfile(f)]
__all__ = [f for f in modules if f not in excepts]
| <commit_before><commit_msg>widgets: Load all widgets when 'widgets' module is loaded.<commit_after> | from os.path import dirname, basename, isfile
import glob
excepts = ['__init__', 'widget']
# Find all *.py files and add them to import
modules = [basename(f)[:-3] for f in glob.glob(dirname(__file__)+"/*.py") if
isfile(f)]
__all__ = [f for f in modules if f not in excepts]
| widgets: Load all widgets when 'widgets' module is loaded.from os.path import dirname, basename, isfile
import glob
excepts = ['__init__', 'widget']
# Find all *.py files and add them to import
modules = [basename(f)[:-3] for f in glob.glob(dirname(__file__)+"/*.py") if
isfile(f)]
__all__ = [f for f in modules if f not in excepts]
| <commit_before><commit_msg>widgets: Load all widgets when 'widgets' module is loaded.<commit_after>from os.path import dirname, basename, isfile
import glob
excepts = ['__init__', 'widget']
# Find all *.py files and add them to import
modules = [basename(f)[:-3] for f in glob.glob(dirname(__file__)+"/*.py") if
isfile(f)]
__all__ = [f for f in modules if f not in excepts]
| |
5c2ca9afac5fe29a86de8ff6774c62b7d3d33561 | tests/base.py | tests/base.py | from dh_syncserver import config
from dh_syncserver import models
from dh_syncserver import database
from twisted.trial import unittest
from twisted.enterprise import adbapi
from twisted.internet.defer import inlineCallbacks, returnValue
from twistar.registry import Registry
class TestBase(unittest.TestCase):
@inlineCallbacks
def setUp(self):
Registry.DBPOOL = adbapi.ConnectionPool("sqlite3", "unittest.sqlite")
Registry.register(models.Cracker, models.Report)
# Kludge to get evolve_database to work
config.dbtype = "sqlite3"
yield database.clean_database()
| import logging
from dh_syncserver import config
from dh_syncserver import models
from dh_syncserver import database
from twisted.trial import unittest
from twisted.enterprise import adbapi
from twisted.internet.defer import inlineCallbacks, returnValue
from twistar.registry import Registry
class TestBase(unittest.TestCase):
@inlineCallbacks
def setUp(self):
Registry.DBPOOL = adbapi.ConnectionPool("sqlite3", "unittest.sqlite")
Registry.register(models.Cracker, models.Report)
# Kludge to get evolve_database to work
config.dbtype = "sqlite3"
yield database.clean_database()
config.logfile = "unittest.log"
config.loglevel = 10
logging.basicConfig(filename=config.logfile,
level=config.loglevel,
format="%(asctime)s %(levelname)-8s %(message)s",
datefmt="%Y-%m-%d %H:%M:%S")
| Write log file from unit tests | Write log file from unit tests
| Python | agpl-3.0 | sergey-dryabzhinsky/denyhosts_sync,sergey-dryabzhinsky/denyhosts_sync,janpascal/denyhosts_sync,sergey-dryabzhinsky/denyhosts_sync,janpascal/denyhosts_sync,janpascal/denyhosts_sync | from dh_syncserver import config
from dh_syncserver import models
from dh_syncserver import database
from twisted.trial import unittest
from twisted.enterprise import adbapi
from twisted.internet.defer import inlineCallbacks, returnValue
from twistar.registry import Registry
class TestBase(unittest.TestCase):
@inlineCallbacks
def setUp(self):
Registry.DBPOOL = adbapi.ConnectionPool("sqlite3", "unittest.sqlite")
Registry.register(models.Cracker, models.Report)
# Kludge to get evolve_database to work
config.dbtype = "sqlite3"
yield database.clean_database()
Write log file from unit tests | import logging
from dh_syncserver import config
from dh_syncserver import models
from dh_syncserver import database
from twisted.trial import unittest
from twisted.enterprise import adbapi
from twisted.internet.defer import inlineCallbacks, returnValue
from twistar.registry import Registry
class TestBase(unittest.TestCase):
@inlineCallbacks
def setUp(self):
Registry.DBPOOL = adbapi.ConnectionPool("sqlite3", "unittest.sqlite")
Registry.register(models.Cracker, models.Report)
# Kludge to get evolve_database to work
config.dbtype = "sqlite3"
yield database.clean_database()
config.logfile = "unittest.log"
config.loglevel = 10
logging.basicConfig(filename=config.logfile,
level=config.loglevel,
format="%(asctime)s %(levelname)-8s %(message)s",
datefmt="%Y-%m-%d %H:%M:%S")
| <commit_before>from dh_syncserver import config
from dh_syncserver import models
from dh_syncserver import database
from twisted.trial import unittest
from twisted.enterprise import adbapi
from twisted.internet.defer import inlineCallbacks, returnValue
from twistar.registry import Registry
class TestBase(unittest.TestCase):
@inlineCallbacks
def setUp(self):
Registry.DBPOOL = adbapi.ConnectionPool("sqlite3", "unittest.sqlite")
Registry.register(models.Cracker, models.Report)
# Kludge to get evolve_database to work
config.dbtype = "sqlite3"
yield database.clean_database()
<commit_msg>Write log file from unit tests<commit_after> | import logging
from dh_syncserver import config
from dh_syncserver import models
from dh_syncserver import database
from twisted.trial import unittest
from twisted.enterprise import adbapi
from twisted.internet.defer import inlineCallbacks, returnValue
from twistar.registry import Registry
class TestBase(unittest.TestCase):
@inlineCallbacks
def setUp(self):
Registry.DBPOOL = adbapi.ConnectionPool("sqlite3", "unittest.sqlite")
Registry.register(models.Cracker, models.Report)
# Kludge to get evolve_database to work
config.dbtype = "sqlite3"
yield database.clean_database()
config.logfile = "unittest.log"
config.loglevel = 10
logging.basicConfig(filename=config.logfile,
level=config.loglevel,
format="%(asctime)s %(levelname)-8s %(message)s",
datefmt="%Y-%m-%d %H:%M:%S")
| from dh_syncserver import config
from dh_syncserver import models
from dh_syncserver import database
from twisted.trial import unittest
from twisted.enterprise import adbapi
from twisted.internet.defer import inlineCallbacks, returnValue
from twistar.registry import Registry
class TestBase(unittest.TestCase):
@inlineCallbacks
def setUp(self):
Registry.DBPOOL = adbapi.ConnectionPool("sqlite3", "unittest.sqlite")
Registry.register(models.Cracker, models.Report)
# Kludge to get evolve_database to work
config.dbtype = "sqlite3"
yield database.clean_database()
Write log file from unit testsimport logging
from dh_syncserver import config
from dh_syncserver import models
from dh_syncserver import database
from twisted.trial import unittest
from twisted.enterprise import adbapi
from twisted.internet.defer import inlineCallbacks, returnValue
from twistar.registry import Registry
class TestBase(unittest.TestCase):
@inlineCallbacks
def setUp(self):
Registry.DBPOOL = adbapi.ConnectionPool("sqlite3", "unittest.sqlite")
Registry.register(models.Cracker, models.Report)
# Kludge to get evolve_database to work
config.dbtype = "sqlite3"
yield database.clean_database()
config.logfile = "unittest.log"
config.loglevel = 10
logging.basicConfig(filename=config.logfile,
level=config.loglevel,
format="%(asctime)s %(levelname)-8s %(message)s",
datefmt="%Y-%m-%d %H:%M:%S")
| <commit_before>from dh_syncserver import config
from dh_syncserver import models
from dh_syncserver import database
from twisted.trial import unittest
from twisted.enterprise import adbapi
from twisted.internet.defer import inlineCallbacks, returnValue
from twistar.registry import Registry
class TestBase(unittest.TestCase):
@inlineCallbacks
def setUp(self):
Registry.DBPOOL = adbapi.ConnectionPool("sqlite3", "unittest.sqlite")
Registry.register(models.Cracker, models.Report)
# Kludge to get evolve_database to work
config.dbtype = "sqlite3"
yield database.clean_database()
<commit_msg>Write log file from unit tests<commit_after>import logging
from dh_syncserver import config
from dh_syncserver import models
from dh_syncserver import database
from twisted.trial import unittest
from twisted.enterprise import adbapi
from twisted.internet.defer import inlineCallbacks, returnValue
from twistar.registry import Registry
class TestBase(unittest.TestCase):
@inlineCallbacks
def setUp(self):
Registry.DBPOOL = adbapi.ConnectionPool("sqlite3", "unittest.sqlite")
Registry.register(models.Cracker, models.Report)
# Kludge to get evolve_database to work
config.dbtype = "sqlite3"
yield database.clean_database()
config.logfile = "unittest.log"
config.loglevel = 10
logging.basicConfig(filename=config.logfile,
level=config.loglevel,
format="%(asctime)s %(levelname)-8s %(message)s",
datefmt="%Y-%m-%d %H:%M:%S")
|
c7863c1efa1a030b04e4efcb97948925c84b7508 | acute/referrals.py | acute/referrals.py | """
Referral routes for OPAL acute
"""
from referral import ReferralRoute
from acute import models
class ClerkingRoute(ReferralRoute):
name = 'Acute Take'
description = 'Add a patient to the Acute Take list'
target_teams = ['take']
success_link = '/#/list/take'
verb = 'Book in'
progressive_verb = 'Booking in'
past_verb = 'Booked in'
def post_create(self, episode, user):
"""
Auto Populate clerked by
"""
name = user.first_name[:1] + ' ' + user.last_name
models.Clerking.objects.create(episode=episode, clerked_by=name)
return
| """
Referral routes for OPAL acute
"""
from referral import ReferralRoute
from acute import models
class ClerkingRoute(ReferralRoute):
name = 'Acute Take'
description = 'Add a patient to the Acute Take list'
page_title = 'Acute Admissions'
target_teams = ['take']
success_link = '/#/list/take'
verb = 'Book in'
progressive_verb = 'Booking in'
past_verb = 'Booked in'
def post_create(self, episode, user):
"""
Auto Populate clerked by
"""
name = user.first_name[:1] + ' ' + user.last_name
models.Clerking.objects.create(episode=episode, clerked_by=name)
return
| Rename referral portal -> Acute admissions | Rename referral portal -> Acute admissions
| Python | agpl-3.0 | openhealthcare/acute,openhealthcare/acute,openhealthcare/acute | """
Referral routes for OPAL acute
"""
from referral import ReferralRoute
from acute import models
class ClerkingRoute(ReferralRoute):
name = 'Acute Take'
description = 'Add a patient to the Acute Take list'
target_teams = ['take']
success_link = '/#/list/take'
verb = 'Book in'
progressive_verb = 'Booking in'
past_verb = 'Booked in'
def post_create(self, episode, user):
"""
Auto Populate clerked by
"""
name = user.first_name[:1] + ' ' + user.last_name
models.Clerking.objects.create(episode=episode, clerked_by=name)
return
Rename referral portal -> Acute admissions | """
Referral routes for OPAL acute
"""
from referral import ReferralRoute
from acute import models
class ClerkingRoute(ReferralRoute):
name = 'Acute Take'
description = 'Add a patient to the Acute Take list'
page_title = 'Acute Admissions'
target_teams = ['take']
success_link = '/#/list/take'
verb = 'Book in'
progressive_verb = 'Booking in'
past_verb = 'Booked in'
def post_create(self, episode, user):
"""
Auto Populate clerked by
"""
name = user.first_name[:1] + ' ' + user.last_name
models.Clerking.objects.create(episode=episode, clerked_by=name)
return
| <commit_before>"""
Referral routes for OPAL acute
"""
from referral import ReferralRoute
from acute import models
class ClerkingRoute(ReferralRoute):
name = 'Acute Take'
description = 'Add a patient to the Acute Take list'
target_teams = ['take']
success_link = '/#/list/take'
verb = 'Book in'
progressive_verb = 'Booking in'
past_verb = 'Booked in'
def post_create(self, episode, user):
"""
Auto Populate clerked by
"""
name = user.first_name[:1] + ' ' + user.last_name
models.Clerking.objects.create(episode=episode, clerked_by=name)
return
<commit_msg>Rename referral portal -> Acute admissions<commit_after> | """
Referral routes for OPAL acute
"""
from referral import ReferralRoute
from acute import models
class ClerkingRoute(ReferralRoute):
name = 'Acute Take'
description = 'Add a patient to the Acute Take list'
page_title = 'Acute Admissions'
target_teams = ['take']
success_link = '/#/list/take'
verb = 'Book in'
progressive_verb = 'Booking in'
past_verb = 'Booked in'
def post_create(self, episode, user):
"""
Auto Populate clerked by
"""
name = user.first_name[:1] + ' ' + user.last_name
models.Clerking.objects.create(episode=episode, clerked_by=name)
return
| """
Referral routes for OPAL acute
"""
from referral import ReferralRoute
from acute import models
class ClerkingRoute(ReferralRoute):
name = 'Acute Take'
description = 'Add a patient to the Acute Take list'
target_teams = ['take']
success_link = '/#/list/take'
verb = 'Book in'
progressive_verb = 'Booking in'
past_verb = 'Booked in'
def post_create(self, episode, user):
"""
Auto Populate clerked by
"""
name = user.first_name[:1] + ' ' + user.last_name
models.Clerking.objects.create(episode=episode, clerked_by=name)
return
Rename referral portal -> Acute admissions"""
Referral routes for OPAL acute
"""
from referral import ReferralRoute
from acute import models
class ClerkingRoute(ReferralRoute):
name = 'Acute Take'
description = 'Add a patient to the Acute Take list'
page_title = 'Acute Admissions'
target_teams = ['take']
success_link = '/#/list/take'
verb = 'Book in'
progressive_verb = 'Booking in'
past_verb = 'Booked in'
def post_create(self, episode, user):
"""
Auto Populate clerked by
"""
name = user.first_name[:1] + ' ' + user.last_name
models.Clerking.objects.create(episode=episode, clerked_by=name)
return
| <commit_before>"""
Referral routes for OPAL acute
"""
from referral import ReferralRoute
from acute import models
class ClerkingRoute(ReferralRoute):
name = 'Acute Take'
description = 'Add a patient to the Acute Take list'
target_teams = ['take']
success_link = '/#/list/take'
verb = 'Book in'
progressive_verb = 'Booking in'
past_verb = 'Booked in'
def post_create(self, episode, user):
"""
Auto Populate clerked by
"""
name = user.first_name[:1] + ' ' + user.last_name
models.Clerking.objects.create(episode=episode, clerked_by=name)
return
<commit_msg>Rename referral portal -> Acute admissions<commit_after>"""
Referral routes for OPAL acute
"""
from referral import ReferralRoute
from acute import models
class ClerkingRoute(ReferralRoute):
name = 'Acute Take'
description = 'Add a patient to the Acute Take list'
page_title = 'Acute Admissions'
target_teams = ['take']
success_link = '/#/list/take'
verb = 'Book in'
progressive_verb = 'Booking in'
past_verb = 'Booked in'
def post_create(self, episode, user):
"""
Auto Populate clerked by
"""
name = user.first_name[:1] + ' ' + user.last_name
models.Clerking.objects.create(episode=episode, clerked_by=name)
return
|
b37655199a42622dec88ba11f845cc78d2ed0e8c | mama_cas/services/__init__.py | mama_cas/services/__init__.py | from django.utils.module_loading import import_string
def _get_backends():
backends = []
for backend_path in ['mama_cas.services.backends.SettingsBackend']:
backend = import_string(backend_path)()
backends.append(backend)
return backends
def _is_allowed(attr, *args):
for backend in _get_backends():
try:
if getattr(backend, attr)(*args):
return True
except AttributeError:
raise NotImplementedError("%s does not implement %s()" % (backend, attr))
return False
def get_callbacks(service):
for backend in _get_backends():
try:
callbacks = backend.get_callbacks(service)
except AttributeError:
raise NotImplementedError("%s does not implement get_callbacks()" % backend)
if callbacks:
# TODO merge callback dicts?
return callbacks
return []
def get_logout_url(service):
for backend in _get_backends():
try:
logout_url = backend.get_logout_url(service)
except AttributeError:
raise NotImplementedError("%s does not implement get_logout_url()" % backend)
if logout_url:
return logout_url
return None
def logout_allowed(service):
return _is_allowed('logout_allowed', service)
def proxy_allowed(service):
return _is_allowed('proxy_allowed', service)
def proxy_callback_allowed(service, pgturl):
return _is_allowed('proxy_callback_allowed', service, pgturl)
def service_allowed(service):
return _is_allowed('service_allowed', service)
| from django.utils.module_loading import import_string
def _get_backends():
backends = []
for backend_path in ['mama_cas.services.backends.SettingsBackend']:
backend = import_string(backend_path)()
backends.append(backend)
return backends
def _is_allowed(attr, *args):
for backend in _get_backends():
try:
if getattr(backend, attr)(*args):
return True
except AttributeError:
raise NotImplementedError("%s does not implement %s()" % (backend, attr))
return False
def get_callbacks(service):
callbacks = []
for backend in _get_backends():
try:
callbacks = callbacks + backend.get_callbacks(service)
except AttributeError:
raise NotImplementedError("%s does not implement get_callbacks()" % backend)
return callbacks
def get_logout_url(service):
for backend in _get_backends():
try:
return backend.get_logout_url(service)
except AttributeError:
raise NotImplementedError("%s does not implement get_logout_url()" % backend)
return None
def logout_allowed(service):
return _is_allowed('logout_allowed', service)
def proxy_allowed(service):
return _is_allowed('proxy_allowed', service)
def proxy_callback_allowed(service, pgturl):
return _is_allowed('proxy_callback_allowed', service, pgturl)
def service_allowed(service):
return _is_allowed('service_allowed', service)
| Join callback lists returned from backends | Join callback lists returned from backends
| Python | bsd-3-clause | jbittel/django-mama-cas,orbitvu/django-mama-cas,jbittel/django-mama-cas,orbitvu/django-mama-cas | from django.utils.module_loading import import_string
def _get_backends():
backends = []
for backend_path in ['mama_cas.services.backends.SettingsBackend']:
backend = import_string(backend_path)()
backends.append(backend)
return backends
def _is_allowed(attr, *args):
for backend in _get_backends():
try:
if getattr(backend, attr)(*args):
return True
except AttributeError:
raise NotImplementedError("%s does not implement %s()" % (backend, attr))
return False
def get_callbacks(service):
for backend in _get_backends():
try:
callbacks = backend.get_callbacks(service)
except AttributeError:
raise NotImplementedError("%s does not implement get_callbacks()" % backend)
if callbacks:
# TODO merge callback dicts?
return callbacks
return []
def get_logout_url(service):
for backend in _get_backends():
try:
logout_url = backend.get_logout_url(service)
except AttributeError:
raise NotImplementedError("%s does not implement get_logout_url()" % backend)
if logout_url:
return logout_url
return None
def logout_allowed(service):
return _is_allowed('logout_allowed', service)
def proxy_allowed(service):
return _is_allowed('proxy_allowed', service)
def proxy_callback_allowed(service, pgturl):
return _is_allowed('proxy_callback_allowed', service, pgturl)
def service_allowed(service):
return _is_allowed('service_allowed', service)
Join callback lists returned from backends | from django.utils.module_loading import import_string
def _get_backends():
backends = []
for backend_path in ['mama_cas.services.backends.SettingsBackend']:
backend = import_string(backend_path)()
backends.append(backend)
return backends
def _is_allowed(attr, *args):
for backend in _get_backends():
try:
if getattr(backend, attr)(*args):
return True
except AttributeError:
raise NotImplementedError("%s does not implement %s()" % (backend, attr))
return False
def get_callbacks(service):
callbacks = []
for backend in _get_backends():
try:
callbacks = callbacks + backend.get_callbacks(service)
except AttributeError:
raise NotImplementedError("%s does not implement get_callbacks()" % backend)
return callbacks
def get_logout_url(service):
for backend in _get_backends():
try:
return backend.get_logout_url(service)
except AttributeError:
raise NotImplementedError("%s does not implement get_logout_url()" % backend)
return None
def logout_allowed(service):
return _is_allowed('logout_allowed', service)
def proxy_allowed(service):
return _is_allowed('proxy_allowed', service)
def proxy_callback_allowed(service, pgturl):
return _is_allowed('proxy_callback_allowed', service, pgturl)
def service_allowed(service):
return _is_allowed('service_allowed', service)
| <commit_before>from django.utils.module_loading import import_string
def _get_backends():
backends = []
for backend_path in ['mama_cas.services.backends.SettingsBackend']:
backend = import_string(backend_path)()
backends.append(backend)
return backends
def _is_allowed(attr, *args):
for backend in _get_backends():
try:
if getattr(backend, attr)(*args):
return True
except AttributeError:
raise NotImplementedError("%s does not implement %s()" % (backend, attr))
return False
def get_callbacks(service):
for backend in _get_backends():
try:
callbacks = backend.get_callbacks(service)
except AttributeError:
raise NotImplementedError("%s does not implement get_callbacks()" % backend)
if callbacks:
# TODO merge callback dicts?
return callbacks
return []
def get_logout_url(service):
for backend in _get_backends():
try:
logout_url = backend.get_logout_url(service)
except AttributeError:
raise NotImplementedError("%s does not implement get_logout_url()" % backend)
if logout_url:
return logout_url
return None
def logout_allowed(service):
return _is_allowed('logout_allowed', service)
def proxy_allowed(service):
return _is_allowed('proxy_allowed', service)
def proxy_callback_allowed(service, pgturl):
return _is_allowed('proxy_callback_allowed', service, pgturl)
def service_allowed(service):
return _is_allowed('service_allowed', service)
<commit_msg>Join callback lists returned from backends<commit_after> | from django.utils.module_loading import import_string
def _get_backends():
backends = []
for backend_path in ['mama_cas.services.backends.SettingsBackend']:
backend = import_string(backend_path)()
backends.append(backend)
return backends
def _is_allowed(attr, *args):
for backend in _get_backends():
try:
if getattr(backend, attr)(*args):
return True
except AttributeError:
raise NotImplementedError("%s does not implement %s()" % (backend, attr))
return False
def get_callbacks(service):
callbacks = []
for backend in _get_backends():
try:
callbacks = callbacks + backend.get_callbacks(service)
except AttributeError:
raise NotImplementedError("%s does not implement get_callbacks()" % backend)
return callbacks
def get_logout_url(service):
for backend in _get_backends():
try:
return backend.get_logout_url(service)
except AttributeError:
raise NotImplementedError("%s does not implement get_logout_url()" % backend)
return None
def logout_allowed(service):
return _is_allowed('logout_allowed', service)
def proxy_allowed(service):
return _is_allowed('proxy_allowed', service)
def proxy_callback_allowed(service, pgturl):
return _is_allowed('proxy_callback_allowed', service, pgturl)
def service_allowed(service):
return _is_allowed('service_allowed', service)
| from django.utils.module_loading import import_string
def _get_backends():
backends = []
for backend_path in ['mama_cas.services.backends.SettingsBackend']:
backend = import_string(backend_path)()
backends.append(backend)
return backends
def _is_allowed(attr, *args):
for backend in _get_backends():
try:
if getattr(backend, attr)(*args):
return True
except AttributeError:
raise NotImplementedError("%s does not implement %s()" % (backend, attr))
return False
def get_callbacks(service):
for backend in _get_backends():
try:
callbacks = backend.get_callbacks(service)
except AttributeError:
raise NotImplementedError("%s does not implement get_callbacks()" % backend)
if callbacks:
# TODO merge callback dicts?
return callbacks
return []
def get_logout_url(service):
for backend in _get_backends():
try:
logout_url = backend.get_logout_url(service)
except AttributeError:
raise NotImplementedError("%s does not implement get_logout_url()" % backend)
if logout_url:
return logout_url
return None
def logout_allowed(service):
return _is_allowed('logout_allowed', service)
def proxy_allowed(service):
return _is_allowed('proxy_allowed', service)
def proxy_callback_allowed(service, pgturl):
return _is_allowed('proxy_callback_allowed', service, pgturl)
def service_allowed(service):
return _is_allowed('service_allowed', service)
Join callback lists returned from backendsfrom django.utils.module_loading import import_string
def _get_backends():
backends = []
for backend_path in ['mama_cas.services.backends.SettingsBackend']:
backend = import_string(backend_path)()
backends.append(backend)
return backends
def _is_allowed(attr, *args):
for backend in _get_backends():
try:
if getattr(backend, attr)(*args):
return True
except AttributeError:
raise NotImplementedError("%s does not implement %s()" % (backend, attr))
return False
def get_callbacks(service):
callbacks = []
for backend in _get_backends():
try:
callbacks = callbacks + backend.get_callbacks(service)
except AttributeError:
raise NotImplementedError("%s does not implement get_callbacks()" % backend)
return callbacks
def get_logout_url(service):
for backend in _get_backends():
try:
return backend.get_logout_url(service)
except AttributeError:
raise NotImplementedError("%s does not implement get_logout_url()" % backend)
return None
def logout_allowed(service):
return _is_allowed('logout_allowed', service)
def proxy_allowed(service):
return _is_allowed('proxy_allowed', service)
def proxy_callback_allowed(service, pgturl):
return _is_allowed('proxy_callback_allowed', service, pgturl)
def service_allowed(service):
return _is_allowed('service_allowed', service)
| <commit_before>from django.utils.module_loading import import_string
def _get_backends():
backends = []
for backend_path in ['mama_cas.services.backends.SettingsBackend']:
backend = import_string(backend_path)()
backends.append(backend)
return backends
def _is_allowed(attr, *args):
for backend in _get_backends():
try:
if getattr(backend, attr)(*args):
return True
except AttributeError:
raise NotImplementedError("%s does not implement %s()" % (backend, attr))
return False
def get_callbacks(service):
for backend in _get_backends():
try:
callbacks = backend.get_callbacks(service)
except AttributeError:
raise NotImplementedError("%s does not implement get_callbacks()" % backend)
if callbacks:
# TODO merge callback dicts?
return callbacks
return []
def get_logout_url(service):
for backend in _get_backends():
try:
logout_url = backend.get_logout_url(service)
except AttributeError:
raise NotImplementedError("%s does not implement get_logout_url()" % backend)
if logout_url:
return logout_url
return None
def logout_allowed(service):
return _is_allowed('logout_allowed', service)
def proxy_allowed(service):
return _is_allowed('proxy_allowed', service)
def proxy_callback_allowed(service, pgturl):
return _is_allowed('proxy_callback_allowed', service, pgturl)
def service_allowed(service):
return _is_allowed('service_allowed', service)
<commit_msg>Join callback lists returned from backends<commit_after>from django.utils.module_loading import import_string
def _get_backends():
backends = []
for backend_path in ['mama_cas.services.backends.SettingsBackend']:
backend = import_string(backend_path)()
backends.append(backend)
return backends
def _is_allowed(attr, *args):
for backend in _get_backends():
try:
if getattr(backend, attr)(*args):
return True
except AttributeError:
raise NotImplementedError("%s does not implement %s()" % (backend, attr))
return False
def get_callbacks(service):
callbacks = []
for backend in _get_backends():
try:
callbacks = callbacks + backend.get_callbacks(service)
except AttributeError:
raise NotImplementedError("%s does not implement get_callbacks()" % backend)
return callbacks
def get_logout_url(service):
for backend in _get_backends():
try:
return backend.get_logout_url(service)
except AttributeError:
raise NotImplementedError("%s does not implement get_logout_url()" % backend)
return None
def logout_allowed(service):
return _is_allowed('logout_allowed', service)
def proxy_allowed(service):
return _is_allowed('proxy_allowed', service)
def proxy_callback_allowed(service, pgturl):
return _is_allowed('proxy_callback_allowed', service, pgturl)
def service_allowed(service):
return _is_allowed('service_allowed', service)
|
e352ae0e0868cda1d76528379fc2454cd5c5edd2 | scripts/reactions.py | scripts/reactions.py | import argparse
from lenrmc.nubase import System
class App(object):
def __init__(self, **kwargs):
self.kwargs = kwargs
def run(self):
s = System.parse(self.kwargs['system'], **self.kwargs)
for reaction in s.terminal():
print(reaction)
def parse_arguments():
parser = argparse.ArgumentParser()
parser.add_argument('system', type=str)
parser.add_argument('--lb', dest='lower_bound', help='lower bound in keV')
parser.set_defaults(lower_bound=-1000)
return parser.parse_args()
if '__main__' == __name__:
opts = parse_arguments()
App(**vars(opts)).run()
| import argparse
from lenrmc.nubase import System
class App(object):
def __init__(self, **kwargs):
self.kwargs = kwargs
def run(self):
s = System.parse(self.kwargs['system'], **self.kwargs)
for reaction in s.terminal():
print(reaction)
def parse_arguments():
parser = argparse.ArgumentParser()
parser.add_argument('system', type=str)
parser.add_argument('--lb', dest='lower_bound', help='lower bound in keV')
parser.set_defaults(lower_bound=0)
return parser.parse_args()
if '__main__' == __name__:
opts = parse_arguments()
App(**vars(opts)).run()
| Change the default lower bound. | Change the default lower bound.
| Python | mit | emwalker/lenrmc | import argparse
from lenrmc.nubase import System
class App(object):
def __init__(self, **kwargs):
self.kwargs = kwargs
def run(self):
s = System.parse(self.kwargs['system'], **self.kwargs)
for reaction in s.terminal():
print(reaction)
def parse_arguments():
parser = argparse.ArgumentParser()
parser.add_argument('system', type=str)
parser.add_argument('--lb', dest='lower_bound', help='lower bound in keV')
parser.set_defaults(lower_bound=-1000)
return parser.parse_args()
if '__main__' == __name__:
opts = parse_arguments()
App(**vars(opts)).run()
Change the default lower bound. | import argparse
from lenrmc.nubase import System
class App(object):
def __init__(self, **kwargs):
self.kwargs = kwargs
def run(self):
s = System.parse(self.kwargs['system'], **self.kwargs)
for reaction in s.terminal():
print(reaction)
def parse_arguments():
parser = argparse.ArgumentParser()
parser.add_argument('system', type=str)
parser.add_argument('--lb', dest='lower_bound', help='lower bound in keV')
parser.set_defaults(lower_bound=0)
return parser.parse_args()
if '__main__' == __name__:
opts = parse_arguments()
App(**vars(opts)).run()
| <commit_before>import argparse
from lenrmc.nubase import System
class App(object):
def __init__(self, **kwargs):
self.kwargs = kwargs
def run(self):
s = System.parse(self.kwargs['system'], **self.kwargs)
for reaction in s.terminal():
print(reaction)
def parse_arguments():
parser = argparse.ArgumentParser()
parser.add_argument('system', type=str)
parser.add_argument('--lb', dest='lower_bound', help='lower bound in keV')
parser.set_defaults(lower_bound=-1000)
return parser.parse_args()
if '__main__' == __name__:
opts = parse_arguments()
App(**vars(opts)).run()
<commit_msg>Change the default lower bound.<commit_after> | import argparse
from lenrmc.nubase import System
class App(object):
def __init__(self, **kwargs):
self.kwargs = kwargs
def run(self):
s = System.parse(self.kwargs['system'], **self.kwargs)
for reaction in s.terminal():
print(reaction)
def parse_arguments():
parser = argparse.ArgumentParser()
parser.add_argument('system', type=str)
parser.add_argument('--lb', dest='lower_bound', help='lower bound in keV')
parser.set_defaults(lower_bound=0)
return parser.parse_args()
if '__main__' == __name__:
opts = parse_arguments()
App(**vars(opts)).run()
| import argparse
from lenrmc.nubase import System
class App(object):
def __init__(self, **kwargs):
self.kwargs = kwargs
def run(self):
s = System.parse(self.kwargs['system'], **self.kwargs)
for reaction in s.terminal():
print(reaction)
def parse_arguments():
parser = argparse.ArgumentParser()
parser.add_argument('system', type=str)
parser.add_argument('--lb', dest='lower_bound', help='lower bound in keV')
parser.set_defaults(lower_bound=-1000)
return parser.parse_args()
if '__main__' == __name__:
opts = parse_arguments()
App(**vars(opts)).run()
Change the default lower bound.import argparse
from lenrmc.nubase import System
class App(object):
def __init__(self, **kwargs):
self.kwargs = kwargs
def run(self):
s = System.parse(self.kwargs['system'], **self.kwargs)
for reaction in s.terminal():
print(reaction)
def parse_arguments():
parser = argparse.ArgumentParser()
parser.add_argument('system', type=str)
parser.add_argument('--lb', dest='lower_bound', help='lower bound in keV')
parser.set_defaults(lower_bound=0)
return parser.parse_args()
if '__main__' == __name__:
opts = parse_arguments()
App(**vars(opts)).run()
| <commit_before>import argparse
from lenrmc.nubase import System
class App(object):
def __init__(self, **kwargs):
self.kwargs = kwargs
def run(self):
s = System.parse(self.kwargs['system'], **self.kwargs)
for reaction in s.terminal():
print(reaction)
def parse_arguments():
parser = argparse.ArgumentParser()
parser.add_argument('system', type=str)
parser.add_argument('--lb', dest='lower_bound', help='lower bound in keV')
parser.set_defaults(lower_bound=-1000)
return parser.parse_args()
if '__main__' == __name__:
opts = parse_arguments()
App(**vars(opts)).run()
<commit_msg>Change the default lower bound.<commit_after>import argparse
from lenrmc.nubase import System
class App(object):
def __init__(self, **kwargs):
self.kwargs = kwargs
def run(self):
s = System.parse(self.kwargs['system'], **self.kwargs)
for reaction in s.terminal():
print(reaction)
def parse_arguments():
parser = argparse.ArgumentParser()
parser.add_argument('system', type=str)
parser.add_argument('--lb', dest='lower_bound', help='lower bound in keV')
parser.set_defaults(lower_bound=0)
return parser.parse_args()
if '__main__' == __name__:
opts = parse_arguments()
App(**vars(opts)).run()
|
4be891f9d371e1c46211b0ed7920ae95df142a16 | seqcluster/create_report.py | seqcluster/create_report.py | import os
import shutil
import logging
#try:
# from bcbio.install import _set_matplotlib_default_backend
# _set_matplotlib_default_backend()
#except (ImportError, OSError, IOError):
# pass
#import matplotlib
#matplotlib.use('Agg', force=True)
from libs.read import load_data
from libs.report import make_profile
from libs.utils import safe_dirs
from db import make_database
import templates
logger = logging.getLogger('report')
def report(args):
"""
Create report in html format
"""
logger.info("reading sequeces")
data = load_data(args.json)
logger.info("create profile")
data = make_profile(data, out_dir, args)
logger.info("create database")
make_database(data, "seqcluster.db", args.out)
logger.info("Done. Download https://github.com/lpantano/seqclusterViz/archive/master.zip to browse the output.")
| import os
import shutil
import logging
#try:
# from bcbio.install import _set_matplotlib_default_backend
# _set_matplotlib_default_backend()
#except (ImportError, OSError, IOError):
# pass
#import matplotlib
#matplotlib.use('Agg', force=True)
from libs.read import load_data
from libs.report import make_profile
from libs.utils import safe_dirs
from db import make_database
import templates
logger = logging.getLogger('report')
def report(args):
"""
Create report in html format
"""
logger.info("reading sequeces")
data = load_data(args.json)
logger.info("create profile")
data = make_profile(data, args.out, args)
logger.info("create database")
make_database(data, "seqcluster.db", args.out)
logger.info("Done. Download https://github.com/lpantano/seqclusterViz/archive/master.zip to browse the output.")
| Fix out dir in report | Fix out dir in report
| Python | mit | lpantano/seqcluster,lpantano/seqcluster,lpantano/seqcluster,lpantano/seqcluster,lpantano/seqcluster | import os
import shutil
import logging
#try:
# from bcbio.install import _set_matplotlib_default_backend
# _set_matplotlib_default_backend()
#except (ImportError, OSError, IOError):
# pass
#import matplotlib
#matplotlib.use('Agg', force=True)
from libs.read import load_data
from libs.report import make_profile
from libs.utils import safe_dirs
from db import make_database
import templates
logger = logging.getLogger('report')
def report(args):
"""
Create report in html format
"""
logger.info("reading sequeces")
data = load_data(args.json)
logger.info("create profile")
data = make_profile(data, out_dir, args)
logger.info("create database")
make_database(data, "seqcluster.db", args.out)
logger.info("Done. Download https://github.com/lpantano/seqclusterViz/archive/master.zip to browse the output.")
Fix out dir in report | import os
import shutil
import logging
#try:
# from bcbio.install import _set_matplotlib_default_backend
# _set_matplotlib_default_backend()
#except (ImportError, OSError, IOError):
# pass
#import matplotlib
#matplotlib.use('Agg', force=True)
from libs.read import load_data
from libs.report import make_profile
from libs.utils import safe_dirs
from db import make_database
import templates
logger = logging.getLogger('report')
def report(args):
"""
Create report in html format
"""
logger.info("reading sequeces")
data = load_data(args.json)
logger.info("create profile")
data = make_profile(data, args.out, args)
logger.info("create database")
make_database(data, "seqcluster.db", args.out)
logger.info("Done. Download https://github.com/lpantano/seqclusterViz/archive/master.zip to browse the output.")
| <commit_before>import os
import shutil
import logging
#try:
# from bcbio.install import _set_matplotlib_default_backend
# _set_matplotlib_default_backend()
#except (ImportError, OSError, IOError):
# pass
#import matplotlib
#matplotlib.use('Agg', force=True)
from libs.read import load_data
from libs.report import make_profile
from libs.utils import safe_dirs
from db import make_database
import templates
logger = logging.getLogger('report')
def report(args):
"""
Create report in html format
"""
logger.info("reading sequeces")
data = load_data(args.json)
logger.info("create profile")
data = make_profile(data, out_dir, args)
logger.info("create database")
make_database(data, "seqcluster.db", args.out)
logger.info("Done. Download https://github.com/lpantano/seqclusterViz/archive/master.zip to browse the output.")
<commit_msg>Fix out dir in report<commit_after> | import os
import shutil
import logging
#try:
# from bcbio.install import _set_matplotlib_default_backend
# _set_matplotlib_default_backend()
#except (ImportError, OSError, IOError):
# pass
#import matplotlib
#matplotlib.use('Agg', force=True)
from libs.read import load_data
from libs.report import make_profile
from libs.utils import safe_dirs
from db import make_database
import templates
logger = logging.getLogger('report')
def report(args):
"""
Create report in html format
"""
logger.info("reading sequeces")
data = load_data(args.json)
logger.info("create profile")
data = make_profile(data, args.out, args)
logger.info("create database")
make_database(data, "seqcluster.db", args.out)
logger.info("Done. Download https://github.com/lpantano/seqclusterViz/archive/master.zip to browse the output.")
| import os
import shutil
import logging
#try:
# from bcbio.install import _set_matplotlib_default_backend
# _set_matplotlib_default_backend()
#except (ImportError, OSError, IOError):
# pass
#import matplotlib
#matplotlib.use('Agg', force=True)
from libs.read import load_data
from libs.report import make_profile
from libs.utils import safe_dirs
from db import make_database
import templates
logger = logging.getLogger('report')
def report(args):
"""
Create report in html format
"""
logger.info("reading sequeces")
data = load_data(args.json)
logger.info("create profile")
data = make_profile(data, out_dir, args)
logger.info("create database")
make_database(data, "seqcluster.db", args.out)
logger.info("Done. Download https://github.com/lpantano/seqclusterViz/archive/master.zip to browse the output.")
Fix out dir in reportimport os
import shutil
import logging
#try:
# from bcbio.install import _set_matplotlib_default_backend
# _set_matplotlib_default_backend()
#except (ImportError, OSError, IOError):
# pass
#import matplotlib
#matplotlib.use('Agg', force=True)
from libs.read import load_data
from libs.report import make_profile
from libs.utils import safe_dirs
from db import make_database
import templates
logger = logging.getLogger('report')
def report(args):
"""
Create report in html format
"""
logger.info("reading sequeces")
data = load_data(args.json)
logger.info("create profile")
data = make_profile(data, args.out, args)
logger.info("create database")
make_database(data, "seqcluster.db", args.out)
logger.info("Done. Download https://github.com/lpantano/seqclusterViz/archive/master.zip to browse the output.")
| <commit_before>import os
import shutil
import logging
#try:
# from bcbio.install import _set_matplotlib_default_backend
# _set_matplotlib_default_backend()
#except (ImportError, OSError, IOError):
# pass
#import matplotlib
#matplotlib.use('Agg', force=True)
from libs.read import load_data
from libs.report import make_profile
from libs.utils import safe_dirs
from db import make_database
import templates
logger = logging.getLogger('report')
def report(args):
"""
Create report in html format
"""
logger.info("reading sequeces")
data = load_data(args.json)
logger.info("create profile")
data = make_profile(data, out_dir, args)
logger.info("create database")
make_database(data, "seqcluster.db", args.out)
logger.info("Done. Download https://github.com/lpantano/seqclusterViz/archive/master.zip to browse the output.")
<commit_msg>Fix out dir in report<commit_after>import os
import shutil
import logging
#try:
# from bcbio.install import _set_matplotlib_default_backend
# _set_matplotlib_default_backend()
#except (ImportError, OSError, IOError):
# pass
#import matplotlib
#matplotlib.use('Agg', force=True)
from libs.read import load_data
from libs.report import make_profile
from libs.utils import safe_dirs
from db import make_database
import templates
logger = logging.getLogger('report')
def report(args):
"""
Create report in html format
"""
logger.info("reading sequeces")
data = load_data(args.json)
logger.info("create profile")
data = make_profile(data, args.out, args)
logger.info("create database")
make_database(data, "seqcluster.db", args.out)
logger.info("Done. Download https://github.com/lpantano/seqclusterViz/archive/master.zip to browse the output.")
|
5253f7fbcea33e28af6348c3cc0f65334cad5623 | setuptools/launch.py | setuptools/launch.py | """
Launch the Python script on the command line after
setuptools is bootstrapped via import.
"""
# Note that setuptools gets imported implicitly by the
# invocation of this script using python -m setuptools.launch
import tokenize
import sys
def run():
"""
Run the script in sys.argv[1] as if it had
been invoked naturally.
"""
__builtins__
script_name = sys.argv[1]
namespace = dict(
__file__ = script_name,
__name__ = '__main__',
__doc__ = None,
)
sys.argv[:] = sys.argv[1:]
open_ = getattr(tokenize, 'open', open)
script = open_(script_name).read()
norm_script = script.replace('\\r\\n', '\\n')
code = compile(norm_script, script_name, 'exec')
exec(code, namespace)
if __name__ == '__main__':
run()
| """
Launch the Python script on the command line after
setuptools is bootstrapped via import.
"""
# Note that setuptools gets imported implicitly by the
# invocation of this script using python -m setuptools.launch
import tokenize
import sys
def run():
"""
Run the script in sys.argv[1] as if it had
been invoked naturally.
"""
__builtins__
script_name = sys.argv[1]
namespace = dict(
__file__ = script_name,
__name__ = '__main__',
__doc__ = None,
)
sys.argv[:] = sys.argv[1:]
open_ = getattr(tokenize, 'open', open)
script = open_(script_name).read()
norm_script = script.replace('\\r\\n', '\\n')
code = compile(norm_script, script_name, 'exec')
exec(code, namespace)
if __name__ == '__main__':
run()
| Swap out hard tabs for spaces | Swap out hard tabs for spaces | Python | mit | pypa/setuptools,pypa/setuptools,pypa/setuptools | """
Launch the Python script on the command line after
setuptools is bootstrapped via import.
"""
# Note that setuptools gets imported implicitly by the
# invocation of this script using python -m setuptools.launch
import tokenize
import sys
def run():
"""
Run the script in sys.argv[1] as if it had
been invoked naturally.
"""
__builtins__
script_name = sys.argv[1]
namespace = dict(
__file__ = script_name,
__name__ = '__main__',
__doc__ = None,
)
sys.argv[:] = sys.argv[1:]
open_ = getattr(tokenize, 'open', open)
script = open_(script_name).read()
norm_script = script.replace('\\r\\n', '\\n')
code = compile(norm_script, script_name, 'exec')
exec(code, namespace)
if __name__ == '__main__':
run()
Swap out hard tabs for spaces | """
Launch the Python script on the command line after
setuptools is bootstrapped via import.
"""
# Note that setuptools gets imported implicitly by the
# invocation of this script using python -m setuptools.launch
import tokenize
import sys
def run():
"""
Run the script in sys.argv[1] as if it had
been invoked naturally.
"""
__builtins__
script_name = sys.argv[1]
namespace = dict(
__file__ = script_name,
__name__ = '__main__',
__doc__ = None,
)
sys.argv[:] = sys.argv[1:]
open_ = getattr(tokenize, 'open', open)
script = open_(script_name).read()
norm_script = script.replace('\\r\\n', '\\n')
code = compile(norm_script, script_name, 'exec')
exec(code, namespace)
if __name__ == '__main__':
run()
| <commit_before>"""
Launch the Python script on the command line after
setuptools is bootstrapped via import.
"""
# Note that setuptools gets imported implicitly by the
# invocation of this script using python -m setuptools.launch
import tokenize
import sys
def run():
"""
Run the script in sys.argv[1] as if it had
been invoked naturally.
"""
__builtins__
script_name = sys.argv[1]
namespace = dict(
__file__ = script_name,
__name__ = '__main__',
__doc__ = None,
)
sys.argv[:] = sys.argv[1:]
open_ = getattr(tokenize, 'open', open)
script = open_(script_name).read()
norm_script = script.replace('\\r\\n', '\\n')
code = compile(norm_script, script_name, 'exec')
exec(code, namespace)
if __name__ == '__main__':
run()
<commit_msg>Swap out hard tabs for spaces<commit_after> | """
Launch the Python script on the command line after
setuptools is bootstrapped via import.
"""
# Note that setuptools gets imported implicitly by the
# invocation of this script using python -m setuptools.launch
import tokenize
import sys
def run():
"""
Run the script in sys.argv[1] as if it had
been invoked naturally.
"""
__builtins__
script_name = sys.argv[1]
namespace = dict(
__file__ = script_name,
__name__ = '__main__',
__doc__ = None,
)
sys.argv[:] = sys.argv[1:]
open_ = getattr(tokenize, 'open', open)
script = open_(script_name).read()
norm_script = script.replace('\\r\\n', '\\n')
code = compile(norm_script, script_name, 'exec')
exec(code, namespace)
if __name__ == '__main__':
run()
| """
Launch the Python script on the command line after
setuptools is bootstrapped via import.
"""
# Note that setuptools gets imported implicitly by the
# invocation of this script using python -m setuptools.launch
import tokenize
import sys
def run():
"""
Run the script in sys.argv[1] as if it had
been invoked naturally.
"""
__builtins__
script_name = sys.argv[1]
namespace = dict(
__file__ = script_name,
__name__ = '__main__',
__doc__ = None,
)
sys.argv[:] = sys.argv[1:]
open_ = getattr(tokenize, 'open', open)
script = open_(script_name).read()
norm_script = script.replace('\\r\\n', '\\n')
code = compile(norm_script, script_name, 'exec')
exec(code, namespace)
if __name__ == '__main__':
run()
Swap out hard tabs for spaces"""
Launch the Python script on the command line after
setuptools is bootstrapped via import.
"""
# Note that setuptools gets imported implicitly by the
# invocation of this script using python -m setuptools.launch
import tokenize
import sys
def run():
"""
Run the script in sys.argv[1] as if it had
been invoked naturally.
"""
__builtins__
script_name = sys.argv[1]
namespace = dict(
__file__ = script_name,
__name__ = '__main__',
__doc__ = None,
)
sys.argv[:] = sys.argv[1:]
open_ = getattr(tokenize, 'open', open)
script = open_(script_name).read()
norm_script = script.replace('\\r\\n', '\\n')
code = compile(norm_script, script_name, 'exec')
exec(code, namespace)
if __name__ == '__main__':
run()
| <commit_before>"""
Launch the Python script on the command line after
setuptools is bootstrapped via import.
"""
# Note that setuptools gets imported implicitly by the
# invocation of this script using python -m setuptools.launch
import tokenize
import sys
def run():
"""
Run the script in sys.argv[1] as if it had
been invoked naturally.
"""
__builtins__
script_name = sys.argv[1]
namespace = dict(
__file__ = script_name,
__name__ = '__main__',
__doc__ = None,
)
sys.argv[:] = sys.argv[1:]
open_ = getattr(tokenize, 'open', open)
script = open_(script_name).read()
norm_script = script.replace('\\r\\n', '\\n')
code = compile(norm_script, script_name, 'exec')
exec(code, namespace)
if __name__ == '__main__':
run()
<commit_msg>Swap out hard tabs for spaces<commit_after>"""
Launch the Python script on the command line after
setuptools is bootstrapped via import.
"""
# Note that setuptools gets imported implicitly by the
# invocation of this script using python -m setuptools.launch
import tokenize
import sys
def run():
"""
Run the script in sys.argv[1] as if it had
been invoked naturally.
"""
__builtins__
script_name = sys.argv[1]
namespace = dict(
__file__ = script_name,
__name__ = '__main__',
__doc__ = None,
)
sys.argv[:] = sys.argv[1:]
open_ = getattr(tokenize, 'open', open)
script = open_(script_name).read()
norm_script = script.replace('\\r\\n', '\\n')
code = compile(norm_script, script_name, 'exec')
exec(code, namespace)
if __name__ == '__main__':
run()
|
5d78a0da7d24eb2dc4af648ece4e21cc2448b76e | app/admin/forms.py | app/admin/forms.py | from flask.ext.wtf import Form
from wtforms import StringField, TextAreaField, SubmitField
from wtforms.validators import Required, Length, Email, Optional
class ProfileForm(Form):
name = StringField('Nafn', validators=[Optional(),
Length(1,64)])
location = StringField('Staðsetning', validators=[Optional(),
Length(1,64)])
bio = TextAreaField('Um', validators=[Optional()])
submit = SubmitField('Breyta')
| from flask.ext.wtf import Form
from wtforms import StringField, TextAreaField, SubmitField, SelectField
from wtforms.fields.html5 import DateField
from wtforms.validators import Required, Length, Email, Optional
class ProfileForm(Form):
name = StringField('Nafn', validators=[Optional(),
Length(1,64)])
location = StringField('Staðsetning', validators=[Optional(),
Length(1,64)])
bio = TextAreaField('Um', validators=[Optional()])
submit = SubmitField('Breyta')
class PostForm(Form):
title = StringField('Titill', validators=[Required(),
Length(1,64)])
created = DateField('Dagsetning', validators=[Optional()])
post = TextAreaField('Frétt', validators=[Required()])
category = SelectField('Flokkur', coerce=int, validators=[Optional()])
submit = SubmitField('Senda')
| Add a PostForm for posting a news story | Add a PostForm for posting a news story
| Python | mit | finnurtorfa/aflafrettir.is,finnurtorfa/aflafrettir.is,finnurtorfa/aflafrettir.is,finnurtorfa/aflafrettir.is | from flask.ext.wtf import Form
from wtforms import StringField, TextAreaField, SubmitField
from wtforms.validators import Required, Length, Email, Optional
class ProfileForm(Form):
name = StringField('Nafn', validators=[Optional(),
Length(1,64)])
location = StringField('Staðsetning', validators=[Optional(),
Length(1,64)])
bio = TextAreaField('Um', validators=[Optional()])
submit = SubmitField('Breyta')
Add a PostForm for posting a news story | from flask.ext.wtf import Form
from wtforms import StringField, TextAreaField, SubmitField, SelectField
from wtforms.fields.html5 import DateField
from wtforms.validators import Required, Length, Email, Optional
class ProfileForm(Form):
name = StringField('Nafn', validators=[Optional(),
Length(1,64)])
location = StringField('Staðsetning', validators=[Optional(),
Length(1,64)])
bio = TextAreaField('Um', validators=[Optional()])
submit = SubmitField('Breyta')
class PostForm(Form):
title = StringField('Titill', validators=[Required(),
Length(1,64)])
created = DateField('Dagsetning', validators=[Optional()])
post = TextAreaField('Frétt', validators=[Required()])
category = SelectField('Flokkur', coerce=int, validators=[Optional()])
submit = SubmitField('Senda')
| <commit_before>from flask.ext.wtf import Form
from wtforms import StringField, TextAreaField, SubmitField
from wtforms.validators import Required, Length, Email, Optional
class ProfileForm(Form):
name = StringField('Nafn', validators=[Optional(),
Length(1,64)])
location = StringField('Staðsetning', validators=[Optional(),
Length(1,64)])
bio = TextAreaField('Um', validators=[Optional()])
submit = SubmitField('Breyta')
<commit_msg>Add a PostForm for posting a news story<commit_after> | from flask.ext.wtf import Form
from wtforms import StringField, TextAreaField, SubmitField, SelectField
from wtforms.fields.html5 import DateField
from wtforms.validators import Required, Length, Email, Optional
class ProfileForm(Form):
name = StringField('Nafn', validators=[Optional(),
Length(1,64)])
location = StringField('Staðsetning', validators=[Optional(),
Length(1,64)])
bio = TextAreaField('Um', validators=[Optional()])
submit = SubmitField('Breyta')
class PostForm(Form):
title = StringField('Titill', validators=[Required(),
Length(1,64)])
created = DateField('Dagsetning', validators=[Optional()])
post = TextAreaField('Frétt', validators=[Required()])
category = SelectField('Flokkur', coerce=int, validators=[Optional()])
submit = SubmitField('Senda')
| from flask.ext.wtf import Form
from wtforms import StringField, TextAreaField, SubmitField
from wtforms.validators import Required, Length, Email, Optional
class ProfileForm(Form):
name = StringField('Nafn', validators=[Optional(),
Length(1,64)])
location = StringField('Staðsetning', validators=[Optional(),
Length(1,64)])
bio = TextAreaField('Um', validators=[Optional()])
submit = SubmitField('Breyta')
Add a PostForm for posting a news storyfrom flask.ext.wtf import Form
from wtforms import StringField, TextAreaField, SubmitField, SelectField
from wtforms.fields.html5 import DateField
from wtforms.validators import Required, Length, Email, Optional
class ProfileForm(Form):
name = StringField('Nafn', validators=[Optional(),
Length(1,64)])
location = StringField('Staðsetning', validators=[Optional(),
Length(1,64)])
bio = TextAreaField('Um', validators=[Optional()])
submit = SubmitField('Breyta')
class PostForm(Form):
title = StringField('Titill', validators=[Required(),
Length(1,64)])
created = DateField('Dagsetning', validators=[Optional()])
post = TextAreaField('Frétt', validators=[Required()])
category = SelectField('Flokkur', coerce=int, validators=[Optional()])
submit = SubmitField('Senda')
| <commit_before>from flask.ext.wtf import Form
from wtforms import StringField, TextAreaField, SubmitField
from wtforms.validators import Required, Length, Email, Optional
class ProfileForm(Form):
name = StringField('Nafn', validators=[Optional(),
Length(1,64)])
location = StringField('Staðsetning', validators=[Optional(),
Length(1,64)])
bio = TextAreaField('Um', validators=[Optional()])
submit = SubmitField('Breyta')
<commit_msg>Add a PostForm for posting a news story<commit_after>from flask.ext.wtf import Form
from wtforms import StringField, TextAreaField, SubmitField, SelectField
from wtforms.fields.html5 import DateField
from wtforms.validators import Required, Length, Email, Optional
class ProfileForm(Form):
name = StringField('Nafn', validators=[Optional(),
Length(1,64)])
location = StringField('Staðsetning', validators=[Optional(),
Length(1,64)])
bio = TextAreaField('Um', validators=[Optional()])
submit = SubmitField('Breyta')
class PostForm(Form):
title = StringField('Titill', validators=[Required(),
Length(1,64)])
created = DateField('Dagsetning', validators=[Optional()])
post = TextAreaField('Frétt', validators=[Required()])
category = SelectField('Flokkur', coerce=int, validators=[Optional()])
submit = SubmitField('Senda')
|
761b2675471dfee97943e4123e45fc058d8f8153 | qsdl/simulator/defaultCostCallbacks.py | qsdl/simulator/defaultCostCallbacks.py | # -*- coding: latin-1 -*-
'''
Created on 3.10.2012
@author: Teemu Pkknen
'''
def get_callback_map():
AVG_AUTOCOMPLETE_INPUT_LENGTH = 5
def get_current_query_cost( simulation, key_cost, interaction_type ):
if "basic" == interaction_type:
return float(key_cost) * len( simulation.get_current_query_text() )
elif "autocomplete" == interaction_type:
return float(key_cost) * AVG_AUTOCOMPLETE_INPUT_LENGTH
return { 'get_default_current_query_cost': get_current_query_cost }
| # -*- coding: latin-1 -*-
'''
Created on 3.10.2012
@author: Teemu Pkknen
'''
def get_callback_map():
AVG_AUTOCOMPLETE_INPUT_LENGTH = 5
def get_current_query_cost( simulation, key_cost, interaction_type = "basic" ):
if "basic" == interaction_type:
return float(key_cost) * len( simulation.get_current_query_text() )
elif "autocomplete" == interaction_type:
return float(key_cost) * AVG_AUTOCOMPLETE_INPUT_LENGTH
return { 'get_default_current_query_cost': get_current_query_cost }
| Change default query cost calculation interaction type to "basic" | Change default query cost calculation interaction type to "basic"
| Python | mit | fire-uta/ir-simulation,fire-uta/ir-simulation | # -*- coding: latin-1 -*-
'''
Created on 3.10.2012
@author: Teemu Pkknen
'''
def get_callback_map():
AVG_AUTOCOMPLETE_INPUT_LENGTH = 5
def get_current_query_cost( simulation, key_cost, interaction_type ):
if "basic" == interaction_type:
return float(key_cost) * len( simulation.get_current_query_text() )
elif "autocomplete" == interaction_type:
return float(key_cost) * AVG_AUTOCOMPLETE_INPUT_LENGTH
return { 'get_default_current_query_cost': get_current_query_cost }
Change default query cost calculation interaction type to "basic" | # -*- coding: latin-1 -*-
'''
Created on 3.10.2012
@author: Teemu Pkknen
'''
def get_callback_map():
AVG_AUTOCOMPLETE_INPUT_LENGTH = 5
def get_current_query_cost( simulation, key_cost, interaction_type = "basic" ):
if "basic" == interaction_type:
return float(key_cost) * len( simulation.get_current_query_text() )
elif "autocomplete" == interaction_type:
return float(key_cost) * AVG_AUTOCOMPLETE_INPUT_LENGTH
return { 'get_default_current_query_cost': get_current_query_cost }
| <commit_before># -*- coding: latin-1 -*-
'''
Created on 3.10.2012
@author: Teemu Pkknen
'''
def get_callback_map():
AVG_AUTOCOMPLETE_INPUT_LENGTH = 5
def get_current_query_cost( simulation, key_cost, interaction_type ):
if "basic" == interaction_type:
return float(key_cost) * len( simulation.get_current_query_text() )
elif "autocomplete" == interaction_type:
return float(key_cost) * AVG_AUTOCOMPLETE_INPUT_LENGTH
return { 'get_default_current_query_cost': get_current_query_cost }
<commit_msg>Change default query cost calculation interaction type to "basic"<commit_after> | # -*- coding: latin-1 -*-
'''
Created on 3.10.2012
@author: Teemu Pkknen
'''
def get_callback_map():
AVG_AUTOCOMPLETE_INPUT_LENGTH = 5
def get_current_query_cost( simulation, key_cost, interaction_type = "basic" ):
if "basic" == interaction_type:
return float(key_cost) * len( simulation.get_current_query_text() )
elif "autocomplete" == interaction_type:
return float(key_cost) * AVG_AUTOCOMPLETE_INPUT_LENGTH
return { 'get_default_current_query_cost': get_current_query_cost }
| # -*- coding: latin-1 -*-
'''
Created on 3.10.2012
@author: Teemu Pkknen
'''
def get_callback_map():
AVG_AUTOCOMPLETE_INPUT_LENGTH = 5
def get_current_query_cost( simulation, key_cost, interaction_type ):
if "basic" == interaction_type:
return float(key_cost) * len( simulation.get_current_query_text() )
elif "autocomplete" == interaction_type:
return float(key_cost) * AVG_AUTOCOMPLETE_INPUT_LENGTH
return { 'get_default_current_query_cost': get_current_query_cost }
Change default query cost calculation interaction type to "basic"# -*- coding: latin-1 -*-
'''
Created on 3.10.2012
@author: Teemu Pkknen
'''
def get_callback_map():
AVG_AUTOCOMPLETE_INPUT_LENGTH = 5
def get_current_query_cost( simulation, key_cost, interaction_type = "basic" ):
if "basic" == interaction_type:
return float(key_cost) * len( simulation.get_current_query_text() )
elif "autocomplete" == interaction_type:
return float(key_cost) * AVG_AUTOCOMPLETE_INPUT_LENGTH
return { 'get_default_current_query_cost': get_current_query_cost }
| <commit_before># -*- coding: latin-1 -*-
'''
Created on 3.10.2012
@author: Teemu Pkknen
'''
def get_callback_map():
AVG_AUTOCOMPLETE_INPUT_LENGTH = 5
def get_current_query_cost( simulation, key_cost, interaction_type ):
if "basic" == interaction_type:
return float(key_cost) * len( simulation.get_current_query_text() )
elif "autocomplete" == interaction_type:
return float(key_cost) * AVG_AUTOCOMPLETE_INPUT_LENGTH
return { 'get_default_current_query_cost': get_current_query_cost }
<commit_msg>Change default query cost calculation interaction type to "basic"<commit_after># -*- coding: latin-1 -*-
'''
Created on 3.10.2012
@author: Teemu Pkknen
'''
def get_callback_map():
AVG_AUTOCOMPLETE_INPUT_LENGTH = 5
def get_current_query_cost( simulation, key_cost, interaction_type = "basic" ):
if "basic" == interaction_type:
return float(key_cost) * len( simulation.get_current_query_text() )
elif "autocomplete" == interaction_type:
return float(key_cost) * AVG_AUTOCOMPLETE_INPUT_LENGTH
return { 'get_default_current_query_cost': get_current_query_cost }
|
03b40d180c7781a153c6f6be65d560db17fffd1e | zephyr/lib/logging_util.py | zephyr/lib/logging_util.py | import logging
import traceback
from hashlib import sha256
from datetime import datetime, timedelta
# Adapted http://djangosnippets.org/snippets/2242/ by user s29 (October 25, 2010)
class _RateLimitFilter(object):
last_error = datetime.min
def filter(self, record):
from django.conf import settings
from django.core.cache import cache
# Track duplicate errors
duplicate = False
rate = getattr(settings, '%s_LIMIT' % self.__class__.__name__.upper(),
600) # seconds
if rate > 0:
# Test if the cache works
try:
cache.set('RLF_TEST_KEY', 1, 1)
use_cache = cache.get('RLF_TEST_KEY') == 1
except:
use_cache = False
if use_cache:
key = self.__class__.__name__.upper()
duplicate = cache.get(key) == 1
cache.set(key, 1, rate)
else:
min_date = datetime.now() - timedelta(seconds=rate)
duplicate = (self.last_error >= min_date)
if not duplicate:
self.last_error = datetime.now()
return not duplicate
class HumbugLimiter(_RateLimitFilter):
pass
class EmailLimiter(_RateLimitFilter):
pass
class ReturnTrue(logging.Filter):
def filter(self, record):
return True
| import logging
import traceback
from hashlib import sha256
from datetime import datetime, timedelta
# Adapted http://djangosnippets.org/snippets/2242/ by user s29 (October 25, 2010)
class _RateLimitFilter(object):
last_error = datetime.min
def filter(self, record):
from django.conf import settings
from django.core.cache import cache
# Track duplicate errors
duplicate = False
rate = getattr(settings, '%s_LIMIT' % self.__class__.__name__.upper(),
600) # seconds
if rate > 0:
# Test if the cache works
try:
cache.set('RLF_TEST_KEY', 1, 1)
use_cache = cache.get('RLF_TEST_KEY') == 1
except:
use_cache = False
if use_cache:
key = self.__class__.__name__.upper()
duplicate = cache.get(key) == 1
cache.set(key, 1, rate)
else:
min_date = datetime.now() - timedelta(seconds=rate)
duplicate = (self.last_error >= min_date)
if not duplicate:
self.last_error = datetime.now()
return not duplicate
class HumbugLimiter(_RateLimitFilter):
pass
class EmailLimiter(_RateLimitFilter):
pass
class ReturnTrue(logging.Filter):
def filter(self, record):
return True
class RequireReallyDeployed(logging.Filter):
def filter(self, record):
from django.conf import settings
return settings.DEPLOYED and not settings.TESTING_DEPLOYED
| Add logging filter for checking that the app is actually deployed | Add logging filter for checking that the app is actually deployed
(imported from commit 77bd7e008fdea4033e18a91d206999f9714e0f74)
| Python | apache-2.0 | dnmfarrell/zulip,arpith/zulip,thomasboyt/zulip,moria/zulip,peiwei/zulip,mahim97/zulip,mohsenSy/zulip,gigawhitlocks/zulip,praveenaki/zulip,tdr130/zulip,hengqujushi/zulip,kou/zulip,vikas-parashar/zulip,ApsOps/zulip,wavelets/zulip,MayB/zulip,jrowan/zulip,niftynei/zulip,shubhamdhama/zulip,xuanhan863/zulip,calvinleenyc/zulip,willingc/zulip,seapasulli/zulip,eeshangarg/zulip,SmartPeople/zulip,kokoar/zulip,ryansnowboarder/zulip,jrowan/zulip,voidException/zulip,ufosky-server/zulip,bluesea/zulip,lfranchi/zulip,wweiradio/zulip,MariaFaBella85/zulip,calvinleenyc/zulip,brockwhittaker/zulip,zulip/zulip,hustlzp/zulip,ryanbackman/zulip,yocome/zulip,mdavid/zulip,TigorC/zulip,sharmaeklavya2/zulip,ahmadassaf/zulip,shaunstanislaus/zulip,JanzTam/zulip,dxq-git/zulip,showell/zulip,glovebx/zulip,dxq-git/zulip,zwily/zulip,pradiptad/zulip,xuanhan863/zulip,brockwhittaker/zulip,ahmadassaf/zulip,natanovia/zulip,brainwane/zulip,ikasumiwt/zulip,so0k/zulip,peguin40/zulip,swinghu/zulip,jerryge/zulip,sup95/zulip,mansilladev/zulip,KingxBanana/zulip,tiansiyuan/zulip,ipernet/zulip,DazWorrall/zulip,Diptanshu8/zulip,alliejones/zulip,jainayush975/zulip,reyha/zulip,kaiyuanheshang/zulip,kokoar/zulip,LAndreas/zulip,zwily/zulip,Drooids/zulip,dotcool/zulip,showell/zulip,levixie/zulip,johnnygaddarr/zulip,noroot/zulip,xuxiao/zulip,qq1012803704/zulip,punchagan/zulip,technicalpickles/zulip,eeshangarg/zulip,atomic-labs/zulip,babbage/zulip,zulip/zulip,ashwinirudrappa/zulip,technicalpickles/zulip,jrowan/zulip,sup95/zulip,LAndreas/zulip,wweiradio/zulip,calvinleenyc/zulip,hustlzp/zulip,jackrzhang/zulip,kokoar/zulip,susansls/zulip,Diptanshu8/zulip,alliejones/zulip,TigorC/zulip,tdr130/zulip,codeKonami/zulip,hengqujushi/zulip,j831/zulip,littledogboy/zulip,praveenaki/zulip,hayderimran7/zulip,krtkmj/zulip,fw1121/zulip,joyhchen/zulip,bowlofstew/zulip,LeeRisk/zulip,codeKonami/zulip,brainwane/zulip,jonesgithub/zulip,timabbott/zulip,yocome/zulip,timabbott/zulip,wavelets/zulip,dxq-git/zulip,littledogboy/zulip,dhcrzf/zulip,calvinleenyc/zulip,nicholasbs/zulip,fw1121/zulip,zacps/zulip,Qgap/zulip,johnny9/zulip,mansilladev/zulip,mansilladev/zulip,alliejones/zulip,EasonYi/zulip,MariaFaBella85/zulip,johnnygaddarr/zulip,moria/zulip,zhaoweigg/zulip,huangkebo/zulip,pradiptad/zulip,lfranchi/zulip,blaze225/zulip,gkotian/zulip,jphilipsen05/zulip,willingc/zulip,kokoar/zulip,hackerkid/zulip,ApsOps/zulip,Jianchun1/zulip,noroot/zulip,gigawhitlocks/zulip,yuvipanda/zulip,joyhchen/zulip,LeeRisk/zulip,johnny9/zulip,ryansnowboarder/zulip,brainwane/zulip,christi3k/zulip,arpitpanwar/zulip,pradiptad/zulip,hackerkid/zulip,LAndreas/zulip,christi3k/zulip,avastu/zulip,so0k/zulip,jainayush975/zulip,Vallher/zulip,Juanvulcano/zulip,MayB/zulip,glovebx/zulip,yuvipanda/zulip,wangdeshui/zulip,hj3938/zulip,bastianh/zulip,wavelets/zulip,souravbadami/zulip,noroot/zulip,vaidap/zulip,niftynei/zulip,JPJPJPOPOP/zulip,dattatreya303/zulip,niftynei/zulip,krtkmj/zulip,JanzTam/zulip,wweiradio/zulip,Frouk/zulip,ryansnowboarder/zulip,kaiyuanheshang/zulip,blaze225/zulip,peguin40/zulip,praveenaki/zulip,voidException/zulip,huangkebo/zulip,karamcnair/zulip,Suninus/zulip,rht/zulip,zofuthan/zulip,Vallher/zulip,vakila/zulip,Qgap/zulip,jerryge/zulip,zulip/zulip,umkay/zulip,aliceriot/zulip,ikasumiwt/zulip,Qgap/zulip,themass/zulip,dawran6/zulip,Frouk/zulip,natanovia/zulip,johnnygaddarr/zulip,deer-hope/zulip,ipernet/zulip,luyifan/zulip,zachallaun/zulip,zorojean/zulip,jessedhillon/zulip,esander91/zulip,Diptanshu8/zulip,jessedhillon/zulip,peguin40/zulip,hustlzp/zulip,wangdeshui/zulip,ufosky-server/zulip,vakila/zulip,vikas-parashar/zulip,easyfmxu/zulip,mohsenSy/zulip,peguin40/zulip,mansilladev/zulip,MayB/zulip,tiansiyuan/zulip,dwrpayne/zulip,punchagan/zulip,ahmadassaf/zulip,natanovia/zulip,verma-varsha/zulip,jimmy54/zulip,cosmicAsymmetry/zulip,yuvipanda/zulip,shaunstanislaus/zulip,stamhe/zulip,bssrdf/zulip,samatdav/zulip,jessedhillon/zulip,amyliu345/zulip,dhcrzf/zulip,bowlofstew/zulip,LeeRisk/zulip,calvinleenyc/zulip,praveenaki/zulip,voidException/zulip,timabbott/zulip,Galexrt/zulip,Frouk/zulip,bastianh/zulip,KJin99/zulip,DazWorrall/zulip,esander91/zulip,babbage/zulip,Gabriel0402/zulip,m1ssou/zulip,jessedhillon/zulip,peiwei/zulip,timabbott/zulip,suxinde2009/zulip,thomasboyt/zulip,brockwhittaker/zulip,itnihao/zulip,grave-w-grave/zulip,swinghu/zulip,atomic-labs/zulip,akuseru/zulip,zwily/zulip,Frouk/zulip,umkay/zulip,hj3938/zulip,Cheppers/zulip,shrikrishnaholla/zulip,ashwinirudrappa/zulip,ahmadassaf/zulip,zhaoweigg/zulip,qq1012803704/zulip,wangdeshui/zulip,schatt/zulip,jphilipsen05/zulip,ipernet/zulip,swinghu/zulip,krtkmj/zulip,hackerkid/zulip,jrowan/zulip,sharmaeklavya2/zulip,cosmicAsymmetry/zulip,joshisa/zulip,ericzhou2008/zulip,wweiradio/zulip,rishig/zulip,shubhamdhama/zulip,reyha/zulip,armooo/zulip,developerfm/zulip,luyifan/zulip,so0k/zulip,isht3/zulip,Jianchun1/zulip,ikasumiwt/zulip,brockwhittaker/zulip,Gabriel0402/zulip,proliming/zulip,suxinde2009/zulip,zofuthan/zulip,easyfmxu/zulip,dotcool/zulip,JanzTam/zulip,AZtheAsian/zulip,Drooids/zulip,Galexrt/zulip,saitodisse/zulip,xuanhan863/zulip,ApsOps/zulip,themass/zulip,codeKonami/zulip,moria/zulip,susansls/zulip,themass/zulip,mohsenSy/zulip,glovebx/zulip,joshisa/zulip,bluesea/zulip,johnny9/zulip,ufosky-server/zulip,jimmy54/zulip,bluesea/zulip,mahim97/zulip,zorojean/zulip,DazWorrall/zulip,guiquanz/zulip,tdr130/zulip,tommyip/zulip,jainayush975/zulip,praveenaki/zulip,yuvipanda/zulip,souravbadami/zulip,synicalsyntax/zulip,brockwhittaker/zulip,dxq-git/zulip,jerryge/zulip,Drooids/zulip,punchagan/zulip,zacps/zulip,zorojean/zulip,stamhe/zulip,xuxiao/zulip,ikasumiwt/zulip,JanzTam/zulip,schatt/zulip,EasonYi/zulip,tommyip/zulip,tommyip/zulip,aps-sids/zulip,adnanh/zulip,hj3938/zulip,thomasboyt/zulip,levixie/zulip,Cheppers/zulip,Vallher/zulip,Drooids/zulip,shaunstanislaus/zulip,EasonYi/zulip,SmartPeople/zulip,sharmaeklavya2/zulip,levixie/zulip,shrikrishnaholla/zulip,dhcrzf/zulip,ericzhou2008/zulip,easyfmxu/zulip,pradiptad/zulip,swinghu/zulip,schatt/zulip,mansilladev/zulip,PaulPetring/zulip,johnnygaddarr/zulip,ipernet/zulip,punchagan/zulip,PhilSk/zulip,firstblade/zulip,esander91/zulip,ryanbackman/zulip,Juanvulcano/zulip,amyliu345/zulip,jphilipsen05/zulip,susansls/zulip,cosmicAsymmetry/zulip,itnihao/zulip,niftynei/zulip,stamhe/zulip,he15his/zulip,krtkmj/zulip,reyha/zulip,amyliu345/zulip,guiquanz/zulip,mansilladev/zulip,xuanhan863/zulip,wangdeshui/zulip,timabbott/zulip,tbutter/zulip,m1ssou/zulip,deer-hope/zulip,paxapy/zulip,hafeez3000/zulip,hj3938/zulip,technicalpickles/zulip,willingc/zulip,yuvipanda/zulip,so0k/zulip,ryanbackman/zulip,bssrdf/zulip,hafeez3000/zulip,kaiyuanheshang/zulip,ufosky-server/zulip,MariaFaBella85/zulip,tiansiyuan/zulip,andersk/zulip,mohsenSy/zulip,susansls/zulip,johnny9/zulip,Diptanshu8/zulip,arpith/zulip,Juanvulcano/zulip,vakila/zulip,Galexrt/zulip,vaidap/zulip,zhaoweigg/zulip,brainwane/zulip,zachallaun/zulip,Batterfii/zulip,dwrpayne/zulip,vikas-parashar/zulip,zofuthan/zulip,dawran6/zulip,bluesea/zulip,codeKonami/zulip,Cheppers/zulip,Gabriel0402/zulip,fw1121/zulip,JPJPJPOPOP/zulip,themass/zulip,udxxabp/zulip,yuvipanda/zulip,ikasumiwt/zulip,AZtheAsian/zulip,aliceriot/zulip,gigawhitlocks/zulip,jerryge/zulip,ahmadassaf/zulip,fw1121/zulip,karamcnair/zulip,tdr130/zulip,avastu/zulip,ashwinirudrappa/zulip,aakash-cr7/zulip,suxinde2009/zulip,fw1121/zulip,sup95/zulip,hustlzp/zulip,AZtheAsian/zulip,LeeRisk/zulip,ryanbackman/zulip,Diptanshu8/zulip,dattatreya303/zulip,Batterfii/zulip,amallia/zulip,deer-hope/zulip,arpitpanwar/zulip,dnmfarrell/zulip,avastu/zulip,saitodisse/zulip,he15his/zulip,zacps/zulip,gkotian/zulip,xuxiao/zulip,PaulPetring/zulip,voidException/zulip,hengqujushi/zulip,natanovia/zulip,stamhe/zulip,deer-hope/zulip,littledogboy/zulip,Batterfii/zulip,babbage/zulip,j831/zulip,nicholasbs/zulip,zulip/zulip,ahmadassaf/zulip,susansls/zulip,TigorC/zulip,PaulPetring/zulip,vabs22/zulip,xuanhan863/zulip,Drooids/zulip,PaulPetring/zulip,niftynei/zulip,firstblade/zulip,hafeez3000/zulip,codeKonami/zulip,bastianh/zulip,wangdeshui/zulip,nicholasbs/zulip,Galexrt/zulip,shrikrishnaholla/zulip,peguin40/zulip,amallia/zulip,adnanh/zulip,umkay/zulip,KJin99/zulip,jainayush975/zulip,jonesgithub/zulip,jphilipsen05/zulip,jessedhillon/zulip,eastlhu/zulip,dawran6/zulip,tbutter/zulip,PhilSk/zulip,shubhamdhama/zulip,zwily/zulip,schatt/zulip,JPJPJPOPOP/zulip,gkotian/zulip,MayB/zulip,sonali0901/zulip,gkotian/zulip,KJin99/zulip,he15his/zulip,souravbadami/zulip,gigawhitlocks/zulip,bitemyapp/zulip,karamcnair/zulip,seapasulli/zulip,paxapy/zulip,sharmaeklavya2/zulip,rishig/zulip,hj3938/zulip,wangdeshui/zulip,kokoar/zulip,levixie/zulip,itnihao/zulip,jackrzhang/zulip,ryanbackman/zulip,tdr130/zulip,joshisa/zulip,schatt/zulip,kou/zulip,hustlzp/zulip,jphilipsen05/zulip,shaunstanislaus/zulip,vaidap/zulip,DazWorrall/zulip,willingc/zulip,shaunstanislaus/zulip,jrowan/zulip,proliming/zulip,aliceriot/zulip,grave-w-grave/zulip,tdr130/zulip,DazWorrall/zulip,eeshangarg/zulip,shubhamdhama/zulip,hayderimran7/zulip,dxq-git/zulip,Qgap/zulip,shrikrishnaholla/zulip,zwily/zulip,tdr130/zulip,kaiyuanheshang/zulip,avastu/zulip,KingxBanana/zulip,LAndreas/zulip,j831/zulip,samatdav/zulip,zofuthan/zulip,aliceriot/zulip,vikas-parashar/zulip,dattatreya303/zulip,thomasboyt/zulip,Gabriel0402/zulip,ericzhou2008/zulip,zacps/zulip,TigorC/zulip,guiquanz/zulip,armooo/zulip,KJin99/zulip,KingxBanana/zulip,tommyip/zulip,vakila/zulip,amallia/zulip,zacps/zulip,ashwinirudrappa/zulip,souravbadami/zulip,tiansiyuan/zulip,Batterfii/zulip,ApsOps/zulip,amanharitsh123/zulip,hackerkid/zulip,xuxiao/zulip,kou/zulip,ufosky-server/zulip,codeKonami/zulip,tommyip/zulip,easyfmxu/zulip,aakash-cr7/zulip,dattatreya303/zulip,bowlofstew/zulip,mohsenSy/zulip,samatdav/zulip,shubhamdhama/zulip,shrikrishnaholla/zulip,isht3/zulip,Gabriel0402/zulip,amanharitsh123/zulip,luyifan/zulip,littledogboy/zulip,so0k/zulip,itnihao/zulip,vaidap/zulip,willingc/zulip,bowlofstew/zulip,suxinde2009/zulip,dxq-git/zulip,mansilladev/zulip,arpith/zulip,deer-hope/zulip,qq1012803704/zulip,esander91/zulip,jeffcao/zulip,rishig/zulip,adnanh/zulip,christi3k/zulip,shrikrishnaholla/zulip,atomic-labs/zulip,shrikrishnaholla/zulip,grave-w-grave/zulip,bitemyapp/zulip,zhaoweigg/zulip,thomasboyt/zulip,JanzTam/zulip,hayderimran7/zulip,luyifan/zulip,joshisa/zulip,jainayush975/zulip,guiquanz/zulip,zorojean/zulip,firstblade/zulip,wweiradio/zulip,PhilSk/zulip,AZtheAsian/zulip,Galexrt/zulip,wdaher/zulip,tiansiyuan/zulip,avastu/zulip,KJin99/zulip,rishig/zulip,kaiyuanheshang/zulip,itnihao/zulip,noroot/zulip,KingxBanana/zulip,stamhe/zulip,proliming/zulip,voidException/zulip,gkotian/zulip,bitemyapp/zulip,jackrzhang/zulip,qq1012803704/zulip,MariaFaBella85/zulip,Cheppers/zulip,babbage/zulip,bastianh/zulip,jonesgithub/zulip,zorojean/zulip,natanovia/zulip,dotcool/zulip,peiwei/zulip,saitodisse/zulip,vikas-parashar/zulip,grave-w-grave/zulip,lfranchi/zulip,AZtheAsian/zulip,sharmaeklavya2/zulip,vikas-parashar/zulip,ikasumiwt/zulip,EasonYi/zulip,MariaFaBella85/zulip,arpitpanwar/zulip,hustlzp/zulip,Drooids/zulip,KingxBanana/zulip,punchagan/zulip,ashwinirudrappa/zulip,zachallaun/zulip,proliming/zulip,calvinleenyc/zulip,themass/zulip,EasonYi/zulip,ahmadassaf/zulip,RobotCaleb/zulip,adnanh/zulip,wavelets/zulip,wavelets/zulip,Cheppers/zulip,Suninus/zulip,luyifan/zulip,bowlofstew/zulip,arpith/zulip,verma-varsha/zulip,PaulPetring/zulip,seapasulli/zulip,schatt/zulip,udxxabp/zulip,LeeRisk/zulip,arpitpanwar/zulip,avastu/zulip,rht/zulip,joyhchen/zulip,akuseru/zulip,sup95/zulip,themass/zulip,suxinde2009/zulip,hengqujushi/zulip,zwily/zulip,amanharitsh123/zulip,grave-w-grave/zulip,developerfm/zulip,Frouk/zulip,rishig/zulip,atomic-labs/zulip,wdaher/zulip,hj3938/zulip,arpith/zulip,he15his/zulip,armooo/zulip,krtkmj/zulip,developerfm/zulip,johnnygaddarr/zulip,PaulPetring/zulip,adnanh/zulip,Vallher/zulip,Frouk/zulip,zhaoweigg/zulip,noroot/zulip,tiansiyuan/zulip,natanovia/zulip,huangkebo/zulip,dawran6/zulip,vaidap/zulip,PhilSk/zulip,hafeez3000/zulip,peiwei/zulip,joshisa/zulip,saitodisse/zulip,kokoar/zulip,moria/zulip,MayB/zulip,alliejones/zulip,andersk/zulip,Suninus/zulip,armooo/zulip,rishig/zulip,dotcool/zulip,jrowan/zulip,Galexrt/zulip,christi3k/zulip,seapasulli/zulip,huangkebo/zulip,andersk/zulip,dhcrzf/zulip,dnmfarrell/zulip,hj3938/zulip,rht/zulip,shaunstanislaus/zulip,ikasumiwt/zulip,RobotCaleb/zulip,LAndreas/zulip,isht3/zulip,timabbott/zulip,bssrdf/zulip,showell/zulip,amallia/zulip,mdavid/zulip,aliceriot/zulip,peiwei/zulip,zhaoweigg/zulip,dattatreya303/zulip,paxapy/zulip,eeshangarg/zulip,KJin99/zulip,reyha/zulip,jeffcao/zulip,rishig/zulip,atomic-labs/zulip,shubhamdhama/zulip,huangkebo/zulip,christi3k/zulip,johnny9/zulip,amyliu345/zulip,wdaher/zulip,jerryge/zulip,isht3/zulip,aliceriot/zulip,m1ssou/zulip,gkotian/zulip,dhcrzf/zulip,m1ssou/zulip,voidException/zulip,eastlhu/zulip,umkay/zulip,m1ssou/zulip,jphilipsen05/zulip,wdaher/zulip,so0k/zulip,bluesea/zulip,Suninus/zulip,cosmicAsymmetry/zulip,hengqujushi/zulip,dotcool/zulip,glovebx/zulip,gigawhitlocks/zulip,nicholasbs/zulip,ipernet/zulip,avastu/zulip,ashwinirudrappa/zulip,paxapy/zulip,tbutter/zulip,LeeRisk/zulip,jonesgithub/zulip,SmartPeople/zulip,mdavid/zulip,easyfmxu/zulip,Suninus/zulip,zhaoweigg/zulip,PhilSk/zulip,verma-varsha/zulip,seapasulli/zulip,punchagan/zulip,guiquanz/zulip,proliming/zulip,verma-varsha/zulip,vakila/zulip,Diptanshu8/zulip,KJin99/zulip,qq1012803704/zulip,swinghu/zulip,wavelets/zulip,dwrpayne/zulip,sonali0901/zulip,wdaher/zulip,synicalsyntax/zulip,Gabriel0402/zulip,tiansiyuan/zulip,jimmy54/zulip,Jianchun1/zulip,gigawhitlocks/zulip,hayderimran7/zulip,zachallaun/zulip,xuanhan863/zulip,bastianh/zulip,technicalpickles/zulip,he15his/zulip,mdavid/zulip,johnnygaddarr/zulip,itnihao/zulip,samatdav/zulip,levixie/zulip,alliejones/zulip,Batterfii/zulip,DazWorrall/zulip,hayderimran7/zulip,yocome/zulip,karamcnair/zulip,dwrpayne/zulip,ApsOps/zulip,RobotCaleb/zulip,easyfmxu/zulip,Jianchun1/zulip,udxxabp/zulip,JPJPJPOPOP/zulip,saitodisse/zulip,showell/zulip,stamhe/zulip,tommyip/zulip,armooo/zulip,jeffcao/zulip,proliming/zulip,yocome/zulip,akuseru/zulip,m1ssou/zulip,firstblade/zulip,dawran6/zulip,jainayush975/zulip,MayB/zulip,Cheppers/zulip,ApsOps/zulip,jerryge/zulip,dotcool/zulip,paxapy/zulip,brainwane/zulip,bluesea/zulip,umkay/zulip,bowlofstew/zulip,zofuthan/zulip,RobotCaleb/zulip,umkay/zulip,vabs22/zulip,paxapy/zulip,guiquanz/zulip,sharmaeklavya2/zulip,amanharitsh123/zulip,aps-sids/zulip,showell/zulip,so0k/zulip,joshisa/zulip,brockwhittaker/zulip,sonali0901/zulip,eastlhu/zulip,MariaFaBella85/zulip,developerfm/zulip,johnny9/zulip,tommyip/zulip,ufosky-server/zulip,ericzhou2008/zulip,gigawhitlocks/zulip,hackerkid/zulip,he15his/zulip,adnanh/zulip,zachallaun/zulip,mahim97/zulip,Vallher/zulip,babbage/zulip,moria/zulip,praveenaki/zulip,niftynei/zulip,bssrdf/zulip,dotcool/zulip,sonali0901/zulip,kaiyuanheshang/zulip,EasonYi/zulip,bluesea/zulip,suxinde2009/zulip,joyhchen/zulip,hafeez3000/zulip,suxinde2009/zulip,souravbadami/zulip,jackrzhang/zulip,babbage/zulip,ipernet/zulip,ufosky-server/zulip,DazWorrall/zulip,susansls/zulip,samatdav/zulip,Batterfii/zulip,mdavid/zulip,jeffcao/zulip,amallia/zulip,wweiradio/zulip,dwrpayne/zulip,Jianchun1/zulip,natanovia/zulip,j831/zulip,udxxabp/zulip,schatt/zulip,sonali0901/zulip,ericzhou2008/zulip,jessedhillon/zulip,JPJPJPOPOP/zulip,JPJPJPOPOP/zulip,bitemyapp/zulip,luyifan/zulip,xuanhan863/zulip,brainwane/zulip,jerryge/zulip,amanharitsh123/zulip,jackrzhang/zulip,saitodisse/zulip,bastianh/zulip,dnmfarrell/zulip,bowlofstew/zulip,aps-sids/zulip,vabs22/zulip,yocome/zulip,rht/zulip,Vallher/zulip,ipernet/zulip,andersk/zulip,SmartPeople/zulip,jackrzhang/zulip,atomic-labs/zulip,joshisa/zulip,levixie/zulip,hengqujushi/zulip,andersk/zulip,j831/zulip,he15his/zulip,akuseru/zulip,arpitpanwar/zulip,synicalsyntax/zulip,krtkmj/zulip,zachallaun/zulip,MariaFaBella85/zulip,bastianh/zulip,jimmy54/zulip,JanzTam/zulip,verma-varsha/zulip,dxq-git/zulip,brainwane/zulip,hackerkid/zulip,zulip/zulip,Jianchun1/zulip,aakash-cr7/zulip,eastlhu/zulip,peiwei/zulip,synicalsyntax/zulip,willingc/zulip,saitodisse/zulip,bitemyapp/zulip,adnanh/zulip,dnmfarrell/zulip,amanharitsh123/zulip,xuxiao/zulip,reyha/zulip,ericzhou2008/zulip,bitemyapp/zulip,sup95/zulip,yuvipanda/zulip,mahim97/zulip,ryansnowboarder/zulip,peiwei/zulip,shubhamdhama/zulip,zacps/zulip,KingxBanana/zulip,LAndreas/zulip,jonesgithub/zulip,developerfm/zulip,Juanvulcano/zulip,kou/zulip,udxxabp/zulip,luyifan/zulip,aakash-cr7/zulip,eastlhu/zulip,souravbadami/zulip,showell/zulip,seapasulli/zulip,fw1121/zulip,jimmy54/zulip,sonali0901/zulip,xuxiao/zulip,technicalpickles/zulip,AZtheAsian/zulip,bssrdf/zulip,jeffcao/zulip,littledogboy/zulip,itnihao/zulip,timabbott/zulip,glovebx/zulip,easyfmxu/zulip,mdavid/zulip,blaze225/zulip,proliming/zulip,hayderimran7/zulip,LeeRisk/zulip,rht/zulip,synicalsyntax/zulip,tbutter/zulip,moria/zulip,joyhchen/zulip,Batterfii/zulip,mahim97/zulip,dwrpayne/zulip,Suninus/zulip,blaze225/zulip,zwily/zulip,MayB/zulip,arpitpanwar/zulip,TigorC/zulip,nicholasbs/zulip,technicalpickles/zulip,xuxiao/zulip,Gabriel0402/zulip,jackrzhang/zulip,showell/zulip,bitemyapp/zulip,glovebx/zulip,joyhchen/zulip,blaze225/zulip,kou/zulip,udxxabp/zulip,atomic-labs/zulip,noroot/zulip,karamcnair/zulip,rht/zulip,dnmfarrell/zulip,j831/zulip,firstblade/zulip,eastlhu/zulip,hustlzp/zulip,Drooids/zulip,qq1012803704/zulip,jimmy54/zulip,mdavid/zulip,RobotCaleb/zulip,stamhe/zulip,dhcrzf/zulip,akuseru/zulip,huangkebo/zulip,technicalpickles/zulip,dhcrzf/zulip,tbutter/zulip,zofuthan/zulip,aakash-cr7/zulip,LAndreas/zulip,Cheppers/zulip,vabs22/zulip,TigorC/zulip,Juanvulcano/zulip,blaze225/zulip,udxxabp/zulip,karamcnair/zulip,shaunstanislaus/zulip,jonesgithub/zulip,hafeez3000/zulip,amallia/zulip,hengqujushi/zulip,dwrpayne/zulip,EasonYi/zulip,zorojean/zulip,moria/zulip,vabs22/zulip,Qgap/zulip,kou/zulip,alliejones/zulip,tbutter/zulip,babbage/zulip,pradiptad/zulip,johnnygaddarr/zulip,Vallher/zulip,swinghu/zulip,peguin40/zulip,voidException/zulip,sup95/zulip,cosmicAsymmetry/zulip,armooo/zulip,wangdeshui/zulip,reyha/zulip,tbutter/zulip,armooo/zulip,zachallaun/zulip,developerfm/zulip,ryanbackman/zulip,verma-varsha/zulip,qq1012803704/zulip,SmartPeople/zulip,hackerkid/zulip,zulip/zulip,vaidap/zulip,PhilSk/zulip,isht3/zulip,jessedhillon/zulip,wdaher/zulip,littledogboy/zulip,zorojean/zulip,yocome/zulip,zofuthan/zulip,firstblade/zulip,ryansnowboarder/zulip,andersk/zulip,Qgap/zulip,willingc/zulip,hayderimran7/zulip,mohsenSy/zulip,ericzhou2008/zulip,codeKonami/zulip,alliejones/zulip,bssrdf/zulip,littledogboy/zulip,amyliu345/zulip,guiquanz/zulip,kou/zulip,RobotCaleb/zulip,jonesgithub/zulip,jimmy54/zulip,wavelets/zulip,krtkmj/zulip,eastlhu/zulip,esander91/zulip,JanzTam/zulip,karamcnair/zulip,dawran6/zulip,esander91/zulip,Frouk/zulip,aliceriot/zulip,SmartPeople/zulip,Qgap/zulip,firstblade/zulip,deer-hope/zulip,lfranchi/zulip,wweiradio/zulip,christi3k/zulip,esander91/zulip,amyliu345/zulip,arpith/zulip,kokoar/zulip,mahim97/zulip,jeffcao/zulip,akuseru/zulip,pradiptad/zulip,samatdav/zulip,aakash-cr7/zulip,eeshangarg/zulip,glovebx/zulip,grave-w-grave/zulip,jeffcao/zulip,umkay/zulip,PaulPetring/zulip,vakila/zulip,andersk/zulip,huangkebo/zulip,isht3/zulip,arpitpanwar/zulip,seapasulli/zulip,noroot/zulip,kaiyuanheshang/zulip,eeshangarg/zulip,johnny9/zulip,Galexrt/zulip,vakila/zulip,lfranchi/zulip,thomasboyt/zulip,aps-sids/zulip,amallia/zulip,cosmicAsymmetry/zulip,nicholasbs/zulip,synicalsyntax/zulip,thomasboyt/zulip,bssrdf/zulip,praveenaki/zulip,wdaher/zulip,punchagan/zulip,ryansnowboarder/zulip,Suninus/zulip,aps-sids/zulip,levixie/zulip,dattatreya303/zulip,lfranchi/zulip,Juanvulcano/zulip,zulip/zulip,ryansnowboarder/zulip,gkotian/zulip,m1ssou/zulip,dnmfarrell/zulip,pradiptad/zulip,ApsOps/zulip,swinghu/zulip,fw1121/zulip,hafeez3000/zulip,nicholasbs/zulip,lfranchi/zulip,RobotCaleb/zulip,aps-sids/zulip,aps-sids/zulip,eeshangarg/zulip,synicalsyntax/zulip,akuseru/zulip,vabs22/zulip,themass/zulip,yocome/zulip,deer-hope/zulip,rht/zulip,developerfm/zulip,ashwinirudrappa/zulip | import logging
import traceback
from hashlib import sha256
from datetime import datetime, timedelta
# Adapted http://djangosnippets.org/snippets/2242/ by user s29 (October 25, 2010)
class _RateLimitFilter(object):
last_error = datetime.min
def filter(self, record):
from django.conf import settings
from django.core.cache import cache
# Track duplicate errors
duplicate = False
rate = getattr(settings, '%s_LIMIT' % self.__class__.__name__.upper(),
600) # seconds
if rate > 0:
# Test if the cache works
try:
cache.set('RLF_TEST_KEY', 1, 1)
use_cache = cache.get('RLF_TEST_KEY') == 1
except:
use_cache = False
if use_cache:
key = self.__class__.__name__.upper()
duplicate = cache.get(key) == 1
cache.set(key, 1, rate)
else:
min_date = datetime.now() - timedelta(seconds=rate)
duplicate = (self.last_error >= min_date)
if not duplicate:
self.last_error = datetime.now()
return not duplicate
class HumbugLimiter(_RateLimitFilter):
pass
class EmailLimiter(_RateLimitFilter):
pass
class ReturnTrue(logging.Filter):
def filter(self, record):
return True
Add logging filter for checking that the app is actually deployed
(imported from commit 77bd7e008fdea4033e18a91d206999f9714e0f74) | import logging
import traceback
from hashlib import sha256
from datetime import datetime, timedelta
# Adapted http://djangosnippets.org/snippets/2242/ by user s29 (October 25, 2010)
class _RateLimitFilter(object):
last_error = datetime.min
def filter(self, record):
from django.conf import settings
from django.core.cache import cache
# Track duplicate errors
duplicate = False
rate = getattr(settings, '%s_LIMIT' % self.__class__.__name__.upper(),
600) # seconds
if rate > 0:
# Test if the cache works
try:
cache.set('RLF_TEST_KEY', 1, 1)
use_cache = cache.get('RLF_TEST_KEY') == 1
except:
use_cache = False
if use_cache:
key = self.__class__.__name__.upper()
duplicate = cache.get(key) == 1
cache.set(key, 1, rate)
else:
min_date = datetime.now() - timedelta(seconds=rate)
duplicate = (self.last_error >= min_date)
if not duplicate:
self.last_error = datetime.now()
return not duplicate
class HumbugLimiter(_RateLimitFilter):
pass
class EmailLimiter(_RateLimitFilter):
pass
class ReturnTrue(logging.Filter):
def filter(self, record):
return True
class RequireReallyDeployed(logging.Filter):
def filter(self, record):
from django.conf import settings
return settings.DEPLOYED and not settings.TESTING_DEPLOYED
| <commit_before>import logging
import traceback
from hashlib import sha256
from datetime import datetime, timedelta
# Adapted http://djangosnippets.org/snippets/2242/ by user s29 (October 25, 2010)
class _RateLimitFilter(object):
last_error = datetime.min
def filter(self, record):
from django.conf import settings
from django.core.cache import cache
# Track duplicate errors
duplicate = False
rate = getattr(settings, '%s_LIMIT' % self.__class__.__name__.upper(),
600) # seconds
if rate > 0:
# Test if the cache works
try:
cache.set('RLF_TEST_KEY', 1, 1)
use_cache = cache.get('RLF_TEST_KEY') == 1
except:
use_cache = False
if use_cache:
key = self.__class__.__name__.upper()
duplicate = cache.get(key) == 1
cache.set(key, 1, rate)
else:
min_date = datetime.now() - timedelta(seconds=rate)
duplicate = (self.last_error >= min_date)
if not duplicate:
self.last_error = datetime.now()
return not duplicate
class HumbugLimiter(_RateLimitFilter):
pass
class EmailLimiter(_RateLimitFilter):
pass
class ReturnTrue(logging.Filter):
def filter(self, record):
return True
<commit_msg>Add logging filter for checking that the app is actually deployed
(imported from commit 77bd7e008fdea4033e18a91d206999f9714e0f74)<commit_after> | import logging
import traceback
from hashlib import sha256
from datetime import datetime, timedelta
# Adapted http://djangosnippets.org/snippets/2242/ by user s29 (October 25, 2010)
class _RateLimitFilter(object):
last_error = datetime.min
def filter(self, record):
from django.conf import settings
from django.core.cache import cache
# Track duplicate errors
duplicate = False
rate = getattr(settings, '%s_LIMIT' % self.__class__.__name__.upper(),
600) # seconds
if rate > 0:
# Test if the cache works
try:
cache.set('RLF_TEST_KEY', 1, 1)
use_cache = cache.get('RLF_TEST_KEY') == 1
except:
use_cache = False
if use_cache:
key = self.__class__.__name__.upper()
duplicate = cache.get(key) == 1
cache.set(key, 1, rate)
else:
min_date = datetime.now() - timedelta(seconds=rate)
duplicate = (self.last_error >= min_date)
if not duplicate:
self.last_error = datetime.now()
return not duplicate
class HumbugLimiter(_RateLimitFilter):
pass
class EmailLimiter(_RateLimitFilter):
pass
class ReturnTrue(logging.Filter):
def filter(self, record):
return True
class RequireReallyDeployed(logging.Filter):
def filter(self, record):
from django.conf import settings
return settings.DEPLOYED and not settings.TESTING_DEPLOYED
| import logging
import traceback
from hashlib import sha256
from datetime import datetime, timedelta
# Adapted http://djangosnippets.org/snippets/2242/ by user s29 (October 25, 2010)
class _RateLimitFilter(object):
last_error = datetime.min
def filter(self, record):
from django.conf import settings
from django.core.cache import cache
# Track duplicate errors
duplicate = False
rate = getattr(settings, '%s_LIMIT' % self.__class__.__name__.upper(),
600) # seconds
if rate > 0:
# Test if the cache works
try:
cache.set('RLF_TEST_KEY', 1, 1)
use_cache = cache.get('RLF_TEST_KEY') == 1
except:
use_cache = False
if use_cache:
key = self.__class__.__name__.upper()
duplicate = cache.get(key) == 1
cache.set(key, 1, rate)
else:
min_date = datetime.now() - timedelta(seconds=rate)
duplicate = (self.last_error >= min_date)
if not duplicate:
self.last_error = datetime.now()
return not duplicate
class HumbugLimiter(_RateLimitFilter):
pass
class EmailLimiter(_RateLimitFilter):
pass
class ReturnTrue(logging.Filter):
def filter(self, record):
return True
Add logging filter for checking that the app is actually deployed
(imported from commit 77bd7e008fdea4033e18a91d206999f9714e0f74)import logging
import traceback
from hashlib import sha256
from datetime import datetime, timedelta
# Adapted http://djangosnippets.org/snippets/2242/ by user s29 (October 25, 2010)
class _RateLimitFilter(object):
last_error = datetime.min
def filter(self, record):
from django.conf import settings
from django.core.cache import cache
# Track duplicate errors
duplicate = False
rate = getattr(settings, '%s_LIMIT' % self.__class__.__name__.upper(),
600) # seconds
if rate > 0:
# Test if the cache works
try:
cache.set('RLF_TEST_KEY', 1, 1)
use_cache = cache.get('RLF_TEST_KEY') == 1
except:
use_cache = False
if use_cache:
key = self.__class__.__name__.upper()
duplicate = cache.get(key) == 1
cache.set(key, 1, rate)
else:
min_date = datetime.now() - timedelta(seconds=rate)
duplicate = (self.last_error >= min_date)
if not duplicate:
self.last_error = datetime.now()
return not duplicate
class HumbugLimiter(_RateLimitFilter):
pass
class EmailLimiter(_RateLimitFilter):
pass
class ReturnTrue(logging.Filter):
def filter(self, record):
return True
class RequireReallyDeployed(logging.Filter):
def filter(self, record):
from django.conf import settings
return settings.DEPLOYED and not settings.TESTING_DEPLOYED
| <commit_before>import logging
import traceback
from hashlib import sha256
from datetime import datetime, timedelta
# Adapted http://djangosnippets.org/snippets/2242/ by user s29 (October 25, 2010)
class _RateLimitFilter(object):
last_error = datetime.min
def filter(self, record):
from django.conf import settings
from django.core.cache import cache
# Track duplicate errors
duplicate = False
rate = getattr(settings, '%s_LIMIT' % self.__class__.__name__.upper(),
600) # seconds
if rate > 0:
# Test if the cache works
try:
cache.set('RLF_TEST_KEY', 1, 1)
use_cache = cache.get('RLF_TEST_KEY') == 1
except:
use_cache = False
if use_cache:
key = self.__class__.__name__.upper()
duplicate = cache.get(key) == 1
cache.set(key, 1, rate)
else:
min_date = datetime.now() - timedelta(seconds=rate)
duplicate = (self.last_error >= min_date)
if not duplicate:
self.last_error = datetime.now()
return not duplicate
class HumbugLimiter(_RateLimitFilter):
pass
class EmailLimiter(_RateLimitFilter):
pass
class ReturnTrue(logging.Filter):
def filter(self, record):
return True
<commit_msg>Add logging filter for checking that the app is actually deployed
(imported from commit 77bd7e008fdea4033e18a91d206999f9714e0f74)<commit_after>import logging
import traceback
from hashlib import sha256
from datetime import datetime, timedelta
# Adapted http://djangosnippets.org/snippets/2242/ by user s29 (October 25, 2010)
class _RateLimitFilter(object):
last_error = datetime.min
def filter(self, record):
from django.conf import settings
from django.core.cache import cache
# Track duplicate errors
duplicate = False
rate = getattr(settings, '%s_LIMIT' % self.__class__.__name__.upper(),
600) # seconds
if rate > 0:
# Test if the cache works
try:
cache.set('RLF_TEST_KEY', 1, 1)
use_cache = cache.get('RLF_TEST_KEY') == 1
except:
use_cache = False
if use_cache:
key = self.__class__.__name__.upper()
duplicate = cache.get(key) == 1
cache.set(key, 1, rate)
else:
min_date = datetime.now() - timedelta(seconds=rate)
duplicate = (self.last_error >= min_date)
if not duplicate:
self.last_error = datetime.now()
return not duplicate
class HumbugLimiter(_RateLimitFilter):
pass
class EmailLimiter(_RateLimitFilter):
pass
class ReturnTrue(logging.Filter):
def filter(self, record):
return True
class RequireReallyDeployed(logging.Filter):
def filter(self, record):
from django.conf import settings
return settings.DEPLOYED and not settings.TESTING_DEPLOYED
|
0a78f0cc03124662871c27ae2ac8647ecac58457 | rasa_nlu/tokenizers/spacy_tokenizer.py | rasa_nlu/tokenizers/spacy_tokenizer.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import typing
from typing import Any, List
from rasa_nlu.components import Component
from rasa_nlu.config import RasaNLUModelConfig
from rasa_nlu.tokenizers import Tokenizer, Token
from rasa_nlu.training_data import Message
from rasa_nlu.training_data import TrainingData
if typing.TYPE_CHECKING:
from spacy.tokens.doc import Doc
class SpacyTokenizer(Tokenizer, Component):
name = "tokenizer_spacy"
provides = ["tokens"]
def train(self, training_data, config, **kwargs):
# type: (TrainingData, RasaNLUModelConfig, **Any) -> None
for example in training_data.training_examples:
example.set("tokens", self.tokenize(example.get("spacy_doc")))
def process(self, message, **kwargs):
# type: (Message, **Any) -> None
message.set("tokens", self.tokenize(message.get("spacy_doc")))
def tokenize(self, doc):
# type: (Doc) -> List[Token]
return [Token(t.text, t.idx) for t in doc]
| from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import typing
from typing import Any, List
from rasa_nlu.components import Component
from rasa_nlu.config import RasaNLUModelConfig
from rasa_nlu.tokenizers import Tokenizer, Token
from rasa_nlu.training_data import Message
from rasa_nlu.training_data import TrainingData
if typing.TYPE_CHECKING:
from spacy.tokens.doc import Doc
class SpacyTokenizer(Tokenizer, Component):
name = "tokenizer_spacy"
provides = ["tokens"]
requires = ["spacy_doc"]
def train(self, training_data, config, **kwargs):
# type: (TrainingData, RasaNLUModelConfig, **Any) -> None
for example in training_data.training_examples:
example.set("tokens", self.tokenize(example.get("spacy_doc")))
def process(self, message, **kwargs):
# type: (Message, **Any) -> None
message.set("tokens", self.tokenize(message.get("spacy_doc")))
def tokenize(self, doc):
# type: (Doc) -> List[Token]
return [Token(t.text, t.idx) for t in doc]
| Add missing "requires" to spacy tokenizer | Add missing "requires" to spacy tokenizer
| Python | apache-2.0 | RasaHQ/rasa_nlu,RasaHQ/rasa_nlu,RasaHQ/rasa_nlu | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import typing
from typing import Any, List
from rasa_nlu.components import Component
from rasa_nlu.config import RasaNLUModelConfig
from rasa_nlu.tokenizers import Tokenizer, Token
from rasa_nlu.training_data import Message
from rasa_nlu.training_data import TrainingData
if typing.TYPE_CHECKING:
from spacy.tokens.doc import Doc
class SpacyTokenizer(Tokenizer, Component):
name = "tokenizer_spacy"
provides = ["tokens"]
def train(self, training_data, config, **kwargs):
# type: (TrainingData, RasaNLUModelConfig, **Any) -> None
for example in training_data.training_examples:
example.set("tokens", self.tokenize(example.get("spacy_doc")))
def process(self, message, **kwargs):
# type: (Message, **Any) -> None
message.set("tokens", self.tokenize(message.get("spacy_doc")))
def tokenize(self, doc):
# type: (Doc) -> List[Token]
return [Token(t.text, t.idx) for t in doc]
Add missing "requires" to spacy tokenizer | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import typing
from typing import Any, List
from rasa_nlu.components import Component
from rasa_nlu.config import RasaNLUModelConfig
from rasa_nlu.tokenizers import Tokenizer, Token
from rasa_nlu.training_data import Message
from rasa_nlu.training_data import TrainingData
if typing.TYPE_CHECKING:
from spacy.tokens.doc import Doc
class SpacyTokenizer(Tokenizer, Component):
name = "tokenizer_spacy"
provides = ["tokens"]
requires = ["spacy_doc"]
def train(self, training_data, config, **kwargs):
# type: (TrainingData, RasaNLUModelConfig, **Any) -> None
for example in training_data.training_examples:
example.set("tokens", self.tokenize(example.get("spacy_doc")))
def process(self, message, **kwargs):
# type: (Message, **Any) -> None
message.set("tokens", self.tokenize(message.get("spacy_doc")))
def tokenize(self, doc):
# type: (Doc) -> List[Token]
return [Token(t.text, t.idx) for t in doc]
| <commit_before>from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import typing
from typing import Any, List
from rasa_nlu.components import Component
from rasa_nlu.config import RasaNLUModelConfig
from rasa_nlu.tokenizers import Tokenizer, Token
from rasa_nlu.training_data import Message
from rasa_nlu.training_data import TrainingData
if typing.TYPE_CHECKING:
from spacy.tokens.doc import Doc
class SpacyTokenizer(Tokenizer, Component):
name = "tokenizer_spacy"
provides = ["tokens"]
def train(self, training_data, config, **kwargs):
# type: (TrainingData, RasaNLUModelConfig, **Any) -> None
for example in training_data.training_examples:
example.set("tokens", self.tokenize(example.get("spacy_doc")))
def process(self, message, **kwargs):
# type: (Message, **Any) -> None
message.set("tokens", self.tokenize(message.get("spacy_doc")))
def tokenize(self, doc):
# type: (Doc) -> List[Token]
return [Token(t.text, t.idx) for t in doc]
<commit_msg>Add missing "requires" to spacy tokenizer<commit_after> | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import typing
from typing import Any, List
from rasa_nlu.components import Component
from rasa_nlu.config import RasaNLUModelConfig
from rasa_nlu.tokenizers import Tokenizer, Token
from rasa_nlu.training_data import Message
from rasa_nlu.training_data import TrainingData
if typing.TYPE_CHECKING:
from spacy.tokens.doc import Doc
class SpacyTokenizer(Tokenizer, Component):
name = "tokenizer_spacy"
provides = ["tokens"]
requires = ["spacy_doc"]
def train(self, training_data, config, **kwargs):
# type: (TrainingData, RasaNLUModelConfig, **Any) -> None
for example in training_data.training_examples:
example.set("tokens", self.tokenize(example.get("spacy_doc")))
def process(self, message, **kwargs):
# type: (Message, **Any) -> None
message.set("tokens", self.tokenize(message.get("spacy_doc")))
def tokenize(self, doc):
# type: (Doc) -> List[Token]
return [Token(t.text, t.idx) for t in doc]
| from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import typing
from typing import Any, List
from rasa_nlu.components import Component
from rasa_nlu.config import RasaNLUModelConfig
from rasa_nlu.tokenizers import Tokenizer, Token
from rasa_nlu.training_data import Message
from rasa_nlu.training_data import TrainingData
if typing.TYPE_CHECKING:
from spacy.tokens.doc import Doc
class SpacyTokenizer(Tokenizer, Component):
name = "tokenizer_spacy"
provides = ["tokens"]
def train(self, training_data, config, **kwargs):
# type: (TrainingData, RasaNLUModelConfig, **Any) -> None
for example in training_data.training_examples:
example.set("tokens", self.tokenize(example.get("spacy_doc")))
def process(self, message, **kwargs):
# type: (Message, **Any) -> None
message.set("tokens", self.tokenize(message.get("spacy_doc")))
def tokenize(self, doc):
# type: (Doc) -> List[Token]
return [Token(t.text, t.idx) for t in doc]
Add missing "requires" to spacy tokenizerfrom __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import typing
from typing import Any, List
from rasa_nlu.components import Component
from rasa_nlu.config import RasaNLUModelConfig
from rasa_nlu.tokenizers import Tokenizer, Token
from rasa_nlu.training_data import Message
from rasa_nlu.training_data import TrainingData
if typing.TYPE_CHECKING:
from spacy.tokens.doc import Doc
class SpacyTokenizer(Tokenizer, Component):
name = "tokenizer_spacy"
provides = ["tokens"]
requires = ["spacy_doc"]
def train(self, training_data, config, **kwargs):
# type: (TrainingData, RasaNLUModelConfig, **Any) -> None
for example in training_data.training_examples:
example.set("tokens", self.tokenize(example.get("spacy_doc")))
def process(self, message, **kwargs):
# type: (Message, **Any) -> None
message.set("tokens", self.tokenize(message.get("spacy_doc")))
def tokenize(self, doc):
# type: (Doc) -> List[Token]
return [Token(t.text, t.idx) for t in doc]
| <commit_before>from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import typing
from typing import Any, List
from rasa_nlu.components import Component
from rasa_nlu.config import RasaNLUModelConfig
from rasa_nlu.tokenizers import Tokenizer, Token
from rasa_nlu.training_data import Message
from rasa_nlu.training_data import TrainingData
if typing.TYPE_CHECKING:
from spacy.tokens.doc import Doc
class SpacyTokenizer(Tokenizer, Component):
name = "tokenizer_spacy"
provides = ["tokens"]
def train(self, training_data, config, **kwargs):
# type: (TrainingData, RasaNLUModelConfig, **Any) -> None
for example in training_data.training_examples:
example.set("tokens", self.tokenize(example.get("spacy_doc")))
def process(self, message, **kwargs):
# type: (Message, **Any) -> None
message.set("tokens", self.tokenize(message.get("spacy_doc")))
def tokenize(self, doc):
# type: (Doc) -> List[Token]
return [Token(t.text, t.idx) for t in doc]
<commit_msg>Add missing "requires" to spacy tokenizer<commit_after>from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import typing
from typing import Any, List
from rasa_nlu.components import Component
from rasa_nlu.config import RasaNLUModelConfig
from rasa_nlu.tokenizers import Tokenizer, Token
from rasa_nlu.training_data import Message
from rasa_nlu.training_data import TrainingData
if typing.TYPE_CHECKING:
from spacy.tokens.doc import Doc
class SpacyTokenizer(Tokenizer, Component):
name = "tokenizer_spacy"
provides = ["tokens"]
requires = ["spacy_doc"]
def train(self, training_data, config, **kwargs):
# type: (TrainingData, RasaNLUModelConfig, **Any) -> None
for example in training_data.training_examples:
example.set("tokens", self.tokenize(example.get("spacy_doc")))
def process(self, message, **kwargs):
# type: (Message, **Any) -> None
message.set("tokens", self.tokenize(message.get("spacy_doc")))
def tokenize(self, doc):
# type: (Doc) -> List[Token]
return [Token(t.text, t.idx) for t in doc]
|
4848dfc9e965f7f82eb1f7aa4d90e8b39489a6a0 | recipes/pyglet/display_import_tests.py | recipes/pyglet/display_import_tests.py | # The import tests in here should be only those that
# 1. Require an X11 display on linux
test_imports = [
'pyglet.font',
'pyglet.gl',
'pyglet.graphics',
'pyglet.image',
'pyglet.image.codecs',
'pyglet.input',
'pyglet.media',
'pyglet.media.drivers',
'pyglet.media.drivers.directsound',
'pyglet.window',
'pyglet.text',
'pyglet.text.formats',
]
def expected_fail(module):
try:
__import__(module)
except Exception as e:
# Yes, make the exception general, because we can't import the specific
# exception on linux without an actual display. Look at the source
# code if you want to see why.
assert 'No standard config is available.' in str(e)
# Handle an import that should only happen on linux and requires
# a display.
for module in test_imports:
expected_fail(module)
import sys
if sys.platform.startswith('linux'):
expected_fail('pyglet.window.xlib')
# And another import that is expected to fail in...
if sys.platform == 'darwin':
expected_fail('pyglet.window.cocoa')
| # The import tests in here should be only those that
# 1. Require an X11 display on linux
test_imports = [
'pyglet.font',
'pyglet.gl',
'pyglet.graphics',
'pyglet.image',
'pyglet.image.codecs',
'pyglet.input',
'pyglet.media',
'pyglet.media.drivers',
'pyglet.media.drivers.directsound',
'pyglet.window',
'pyglet.text',
'pyglet.text.formats',
]
def expected_fail(module):
try:
print('Importing {}'.format(module))
__import__(module)
except Exception as e:
# Yes, make the exception general, because we can't import the specific
# exception on linux without an actual display. Look at the source
# code if you want to see why.
assert 'No standard config is available.' in str(e)
# Handle an import that should only happen on linux and requires
# a display.
for module in test_imports:
expected_fail(module)
import sys
if sys.platform.startswith('linux'):
expected_fail('pyglet.window.xlib')
# And another import that is expected to fail in...
if sys.platform == 'darwin':
expected_fail('pyglet.window.cocoa')
| Add a tiny bit of output | Add a tiny bit of output
| Python | bsd-3-clause | data-exp-lab/staged-recipes,Savvysherpa/staged-recipes,hbredin/staged-recipes,tylere/staged-recipes,johannesring/staged-recipes,shadowwalkersb/staged-recipes,kwilcox/staged-recipes,mcernak/staged-recipes,rvalieris/staged-recipes,barkls/staged-recipes,johanneskoester/staged-recipes,birdsarah/staged-recipes,rmcgibbo/staged-recipes,bmabey/staged-recipes,hadim/staged-recipes,caspervdw/staged-recipes,caspervdw/staged-recipes,dschreij/staged-recipes,guillochon/staged-recipes,atedstone/staged-recipes,koverholt/staged-recipes,larray-project/staged-recipes,hajapy/staged-recipes,isuruf/staged-recipes,gqmelo/staged-recipes,chrisburr/staged-recipes,NOAA-ORR-ERD/staged-recipes,mcs07/staged-recipes,conda-forge/staged-recipes,pstjohn/staged-recipes,grlee77/staged-recipes,igortg/staged-recipes,jochym/staged-recipes,jakirkham/staged-recipes,rmcgibbo/staged-recipes,asmeurer/staged-recipes,jcb91/staged-recipes,OpenPIV/staged-recipes,data-exp-lab/staged-recipes,benvandyke/staged-recipes,goanpeca/staged-recipes,tylere/staged-recipes,khallock/staged-recipes,stuertz/staged-recipes,pmlandwehr/staged-recipes,cpaulik/staged-recipes,nicoddemus/staged-recipes,planetarypy/staged-recipes,mcernak/staged-recipes,ceholden/staged-recipes,pstjohn/staged-recipes,sodre/staged-recipes,hadim/staged-recipes,basnijholt/staged-recipes,patricksnape/staged-recipes,scopatz/staged-recipes,glemaitre/staged-recipes,mariusvniekerk/staged-recipes,rolando-contrib/staged-recipes,planetarypy/staged-recipes,bmabey/staged-recipes,mcs07/staged-recipes,NOAA-ORR-ERD/staged-recipes,basnijholt/staged-recipes,goanpeca/staged-recipes,sodre/staged-recipes,hajapy/staged-recipes,SylvainCorlay/staged-recipes,shadowwalkersb/staged-recipes,dfroger/staged-recipes,ReimarBauer/staged-recipes,gqmelo/staged-recipes,jcb91/staged-recipes,stuertz/staged-recipes,chohner/staged-recipes,asmeurer/staged-recipes,scopatz/staged-recipes,patricksnape/staged-recipes,richardotis/staged-recipes,valgur/staged-recipes,JohnGreeley/staged-recipes,richardotis/staged-recipes,blowekamp/staged-recipes,sannykr/staged-recipes,dschreij/staged-recipes,kwilcox/staged-recipes,petrushy/staged-recipes,petrushy/staged-recipes,koverholt/staged-recipes,jerowe/staged-recipes,chrisburr/staged-recipes,benvandyke/staged-recipes,dharhas/staged-recipes,ocefpaf/staged-recipes,guillochon/staged-recipes,Cashalow/staged-recipes,jjhelmus/staged-recipes,sodre/staged-recipes,rvalieris/staged-recipes,blowekamp/staged-recipes,Cashalow/staged-recipes,jochym/staged-recipes,johannesring/staged-recipes,grlee77/staged-recipes,atedstone/staged-recipes,vamega/staged-recipes,SylvainCorlay/staged-recipes,vamega/staged-recipes,cpaulik/staged-recipes,glemaitre/staged-recipes,barkls/staged-recipes,conda-forge/staged-recipes,larray-project/staged-recipes,dfroger/staged-recipes,mariusvniekerk/staged-recipes,Juanlu001/staged-recipes,chohner/staged-recipes,rolando-contrib/staged-recipes,ceholden/staged-recipes,jerowe/staged-recipes,JohnGreeley/staged-recipes,OpenPIV/staged-recipes,khallock/staged-recipes,johanneskoester/staged-recipes,ocefpaf/staged-recipes,ReimarBauer/staged-recipes,isuruf/staged-recipes,Juanlu001/staged-recipes,nicoddemus/staged-recipes,synapticarbors/staged-recipes,jjhelmus/staged-recipes,Savvysherpa/staged-recipes,pmlandwehr/staged-recipes,hbredin/staged-recipes,sannykr/staged-recipes,synapticarbors/staged-recipes,dharhas/staged-recipes,jakirkham/staged-recipes,igortg/staged-recipes,birdsarah/staged-recipes,valgur/staged-recipes | # The import tests in here should be only those that
# 1. Require an X11 display on linux
test_imports = [
'pyglet.font',
'pyglet.gl',
'pyglet.graphics',
'pyglet.image',
'pyglet.image.codecs',
'pyglet.input',
'pyglet.media',
'pyglet.media.drivers',
'pyglet.media.drivers.directsound',
'pyglet.window',
'pyglet.text',
'pyglet.text.formats',
]
def expected_fail(module):
try:
__import__(module)
except Exception as e:
# Yes, make the exception general, because we can't import the specific
# exception on linux without an actual display. Look at the source
# code if you want to see why.
assert 'No standard config is available.' in str(e)
# Handle an import that should only happen on linux and requires
# a display.
for module in test_imports:
expected_fail(module)
import sys
if sys.platform.startswith('linux'):
expected_fail('pyglet.window.xlib')
# And another import that is expected to fail in...
if sys.platform == 'darwin':
expected_fail('pyglet.window.cocoa')
Add a tiny bit of output | # The import tests in here should be only those that
# 1. Require an X11 display on linux
test_imports = [
'pyglet.font',
'pyglet.gl',
'pyglet.graphics',
'pyglet.image',
'pyglet.image.codecs',
'pyglet.input',
'pyglet.media',
'pyglet.media.drivers',
'pyglet.media.drivers.directsound',
'pyglet.window',
'pyglet.text',
'pyglet.text.formats',
]
def expected_fail(module):
try:
print('Importing {}'.format(module))
__import__(module)
except Exception as e:
# Yes, make the exception general, because we can't import the specific
# exception on linux without an actual display. Look at the source
# code if you want to see why.
assert 'No standard config is available.' in str(e)
# Handle an import that should only happen on linux and requires
# a display.
for module in test_imports:
expected_fail(module)
import sys
if sys.platform.startswith('linux'):
expected_fail('pyglet.window.xlib')
# And another import that is expected to fail in...
if sys.platform == 'darwin':
expected_fail('pyglet.window.cocoa')
| <commit_before># The import tests in here should be only those that
# 1. Require an X11 display on linux
test_imports = [
'pyglet.font',
'pyglet.gl',
'pyglet.graphics',
'pyglet.image',
'pyglet.image.codecs',
'pyglet.input',
'pyglet.media',
'pyglet.media.drivers',
'pyglet.media.drivers.directsound',
'pyglet.window',
'pyglet.text',
'pyglet.text.formats',
]
def expected_fail(module):
try:
__import__(module)
except Exception as e:
# Yes, make the exception general, because we can't import the specific
# exception on linux without an actual display. Look at the source
# code if you want to see why.
assert 'No standard config is available.' in str(e)
# Handle an import that should only happen on linux and requires
# a display.
for module in test_imports:
expected_fail(module)
import sys
if sys.platform.startswith('linux'):
expected_fail('pyglet.window.xlib')
# And another import that is expected to fail in...
if sys.platform == 'darwin':
expected_fail('pyglet.window.cocoa')
<commit_msg>Add a tiny bit of output<commit_after> | # The import tests in here should be only those that
# 1. Require an X11 display on linux
test_imports = [
'pyglet.font',
'pyglet.gl',
'pyglet.graphics',
'pyglet.image',
'pyglet.image.codecs',
'pyglet.input',
'pyglet.media',
'pyglet.media.drivers',
'pyglet.media.drivers.directsound',
'pyglet.window',
'pyglet.text',
'pyglet.text.formats',
]
def expected_fail(module):
try:
print('Importing {}'.format(module))
__import__(module)
except Exception as e:
# Yes, make the exception general, because we can't import the specific
# exception on linux without an actual display. Look at the source
# code if you want to see why.
assert 'No standard config is available.' in str(e)
# Handle an import that should only happen on linux and requires
# a display.
for module in test_imports:
expected_fail(module)
import sys
if sys.platform.startswith('linux'):
expected_fail('pyglet.window.xlib')
# And another import that is expected to fail in...
if sys.platform == 'darwin':
expected_fail('pyglet.window.cocoa')
| # The import tests in here should be only those that
# 1. Require an X11 display on linux
test_imports = [
'pyglet.font',
'pyglet.gl',
'pyglet.graphics',
'pyglet.image',
'pyglet.image.codecs',
'pyglet.input',
'pyglet.media',
'pyglet.media.drivers',
'pyglet.media.drivers.directsound',
'pyglet.window',
'pyglet.text',
'pyglet.text.formats',
]
def expected_fail(module):
try:
__import__(module)
except Exception as e:
# Yes, make the exception general, because we can't import the specific
# exception on linux without an actual display. Look at the source
# code if you want to see why.
assert 'No standard config is available.' in str(e)
# Handle an import that should only happen on linux and requires
# a display.
for module in test_imports:
expected_fail(module)
import sys
if sys.platform.startswith('linux'):
expected_fail('pyglet.window.xlib')
# And another import that is expected to fail in...
if sys.platform == 'darwin':
expected_fail('pyglet.window.cocoa')
Add a tiny bit of output# The import tests in here should be only those that
# 1. Require an X11 display on linux
test_imports = [
'pyglet.font',
'pyglet.gl',
'pyglet.graphics',
'pyglet.image',
'pyglet.image.codecs',
'pyglet.input',
'pyglet.media',
'pyglet.media.drivers',
'pyglet.media.drivers.directsound',
'pyglet.window',
'pyglet.text',
'pyglet.text.formats',
]
def expected_fail(module):
try:
print('Importing {}'.format(module))
__import__(module)
except Exception as e:
# Yes, make the exception general, because we can't import the specific
# exception on linux without an actual display. Look at the source
# code if you want to see why.
assert 'No standard config is available.' in str(e)
# Handle an import that should only happen on linux and requires
# a display.
for module in test_imports:
expected_fail(module)
import sys
if sys.platform.startswith('linux'):
expected_fail('pyglet.window.xlib')
# And another import that is expected to fail in...
if sys.platform == 'darwin':
expected_fail('pyglet.window.cocoa')
| <commit_before># The import tests in here should be only those that
# 1. Require an X11 display on linux
test_imports = [
'pyglet.font',
'pyglet.gl',
'pyglet.graphics',
'pyglet.image',
'pyglet.image.codecs',
'pyglet.input',
'pyglet.media',
'pyglet.media.drivers',
'pyglet.media.drivers.directsound',
'pyglet.window',
'pyglet.text',
'pyglet.text.formats',
]
def expected_fail(module):
try:
__import__(module)
except Exception as e:
# Yes, make the exception general, because we can't import the specific
# exception on linux without an actual display. Look at the source
# code if you want to see why.
assert 'No standard config is available.' in str(e)
# Handle an import that should only happen on linux and requires
# a display.
for module in test_imports:
expected_fail(module)
import sys
if sys.platform.startswith('linux'):
expected_fail('pyglet.window.xlib')
# And another import that is expected to fail in...
if sys.platform == 'darwin':
expected_fail('pyglet.window.cocoa')
<commit_msg>Add a tiny bit of output<commit_after># The import tests in here should be only those that
# 1. Require an X11 display on linux
test_imports = [
'pyglet.font',
'pyglet.gl',
'pyglet.graphics',
'pyglet.image',
'pyglet.image.codecs',
'pyglet.input',
'pyglet.media',
'pyglet.media.drivers',
'pyglet.media.drivers.directsound',
'pyglet.window',
'pyglet.text',
'pyglet.text.formats',
]
def expected_fail(module):
try:
print('Importing {}'.format(module))
__import__(module)
except Exception as e:
# Yes, make the exception general, because we can't import the specific
# exception on linux without an actual display. Look at the source
# code if you want to see why.
assert 'No standard config is available.' in str(e)
# Handle an import that should only happen on linux and requires
# a display.
for module in test_imports:
expected_fail(module)
import sys
if sys.platform.startswith('linux'):
expected_fail('pyglet.window.xlib')
# And another import that is expected to fail in...
if sys.platform == 'darwin':
expected_fail('pyglet.window.cocoa')
|
b14d2827d3358ee2c5e1262d10f7b4e54cecdddb | setup.py | setup.py | import setuptools
from src.land_registry_elements.version import Version
setuptools.setup(name='land-registry-elements',
version=Version('1.0.4').number,
description='Land Registry Elements',
packages=['land_registry_elements'],
package_dir={'': 'src'},
package_data={'land_registry_elements': ['**/template.html']}
)
| from json import loads
from os.path import join, dirname
from src.land_registry_elements.version import Version
import setuptools
def read(filename):
path = join(dirname(__file__), filename)
with open(path, 'rt') as file:
return file.read()
package = loads(read('package.json'))
setuptools.setup(name='land-registry-elements',
version=Version(package['version']).number,
description='Land Registry Elements',
packages=['land_registry_elements'],
package_dir={'': 'src'},
package_data={'land_registry_elements': ['**/template.html']}
)
| Read python package version from node package.json | Read python package version from node package.json
| Python | mit | LandRegistry/land-registry-elements,LandRegistry/land-registry-elements,LandRegistry/land-registry-elements,LandRegistry/land-registry-elements,LandRegistry/land-registry-elements | import setuptools
from src.land_registry_elements.version import Version
setuptools.setup(name='land-registry-elements',
version=Version('1.0.4').number,
description='Land Registry Elements',
packages=['land_registry_elements'],
package_dir={'': 'src'},
package_data={'land_registry_elements': ['**/template.html']}
)
Read python package version from node package.json | from json import loads
from os.path import join, dirname
from src.land_registry_elements.version import Version
import setuptools
def read(filename):
path = join(dirname(__file__), filename)
with open(path, 'rt') as file:
return file.read()
package = loads(read('package.json'))
setuptools.setup(name='land-registry-elements',
version=Version(package['version']).number,
description='Land Registry Elements',
packages=['land_registry_elements'],
package_dir={'': 'src'},
package_data={'land_registry_elements': ['**/template.html']}
)
| <commit_before>import setuptools
from src.land_registry_elements.version import Version
setuptools.setup(name='land-registry-elements',
version=Version('1.0.4').number,
description='Land Registry Elements',
packages=['land_registry_elements'],
package_dir={'': 'src'},
package_data={'land_registry_elements': ['**/template.html']}
)
<commit_msg>Read python package version from node package.json<commit_after> | from json import loads
from os.path import join, dirname
from src.land_registry_elements.version import Version
import setuptools
def read(filename):
path = join(dirname(__file__), filename)
with open(path, 'rt') as file:
return file.read()
package = loads(read('package.json'))
setuptools.setup(name='land-registry-elements',
version=Version(package['version']).number,
description='Land Registry Elements',
packages=['land_registry_elements'],
package_dir={'': 'src'},
package_data={'land_registry_elements': ['**/template.html']}
)
| import setuptools
from src.land_registry_elements.version import Version
setuptools.setup(name='land-registry-elements',
version=Version('1.0.4').number,
description='Land Registry Elements',
packages=['land_registry_elements'],
package_dir={'': 'src'},
package_data={'land_registry_elements': ['**/template.html']}
)
Read python package version from node package.jsonfrom json import loads
from os.path import join, dirname
from src.land_registry_elements.version import Version
import setuptools
def read(filename):
path = join(dirname(__file__), filename)
with open(path, 'rt') as file:
return file.read()
package = loads(read('package.json'))
setuptools.setup(name='land-registry-elements',
version=Version(package['version']).number,
description='Land Registry Elements',
packages=['land_registry_elements'],
package_dir={'': 'src'},
package_data={'land_registry_elements': ['**/template.html']}
)
| <commit_before>import setuptools
from src.land_registry_elements.version import Version
setuptools.setup(name='land-registry-elements',
version=Version('1.0.4').number,
description='Land Registry Elements',
packages=['land_registry_elements'],
package_dir={'': 'src'},
package_data={'land_registry_elements': ['**/template.html']}
)
<commit_msg>Read python package version from node package.json<commit_after>from json import loads
from os.path import join, dirname
from src.land_registry_elements.version import Version
import setuptools
def read(filename):
path = join(dirname(__file__), filename)
with open(path, 'rt') as file:
return file.read()
package = loads(read('package.json'))
setuptools.setup(name='land-registry-elements',
version=Version(package['version']).number,
description='Land Registry Elements',
packages=['land_registry_elements'],
package_dir={'': 'src'},
package_data={'land_registry_elements': ['**/template.html']}
)
|
52058f7ea882d9d62d1003796520387e2a092c6c | volt/hooks.py | volt/hooks.py | """Hooks for various events."""
# Copyright (c) 2012-2022 Wibowo Arindrarto <contact@arindrarto.dev>
# SPDX-License-Identifier: BSD-3-Clause
import sys
import structlog
from typing import Any
from . import signals as s
__all__ = [
"log",
"post_site_load_engines",
"post_site_collect_targets",
"pre_site_write",
]
def log() -> Any:
"""Return a logger for a hook function.
This function is meant to be called inside the top-level hook function. That is, the
function that is decorated with the hook. Calling this elsewhere will result in the
log message showing incorrect hook names.
:returns: A :class:`structlog.BoundLogger` instance ready for logging.
"""
frame = sys._getframe(1)
hook_name = frame.f_code.co_name
mod_name = frame.f_globals["__name__"]
return structlog.get_logger(mod_name, hook=hook_name)
post_site_load_engines = s.post_site_load_engines.connect
post_site_collect_targets = s.post_site_collect_targets.connect
pre_site_write = s.pre_site_write.connect
| """Hooks for various events."""
# Copyright (c) 2012-2022 Wibowo Arindrarto <contact@arindrarto.dev>
# SPDX-License-Identifier: BSD-3-Clause
import sys
import structlog
from typing import Any
from . import signals as s
__all__ = [
"log",
"post_site_load_engines",
"post_site_collect_targets",
"pre_site_write",
]
def name() -> str:
"""Return the name of the current hook.
This function must be called inside the top-level hook function. That is, the
function that is decorated with the hook.
"""
frame = sys._getframe(1)
hook_name = frame.f_code.co_name
return hook_name
def log() -> Any:
"""Return a logger for a hook function.
This function is meant to be called inside the top-level hook function. That is, the
function that is decorated with the hook. Calling this elsewhere will result in the
log message showing incorrect hook names.
:returns: A :class:`structlog.BoundLogger` instance ready for logging.
"""
frame = sys._getframe(1)
hook_name = frame.f_code.co_name
mod_name = frame.f_globals["__name__"]
return structlog.get_logger(mod_name, hook=hook_name)
post_site_load_engines = s.post_site_load_engines.connect
post_site_collect_targets = s.post_site_collect_targets.connect
pre_site_write = s.pre_site_write.connect
| Add hook.name function for inferring hook names | feat: Add hook.name function for inferring hook names
| Python | bsd-3-clause | bow/volt | """Hooks for various events."""
# Copyright (c) 2012-2022 Wibowo Arindrarto <contact@arindrarto.dev>
# SPDX-License-Identifier: BSD-3-Clause
import sys
import structlog
from typing import Any
from . import signals as s
__all__ = [
"log",
"post_site_load_engines",
"post_site_collect_targets",
"pre_site_write",
]
def log() -> Any:
"""Return a logger for a hook function.
This function is meant to be called inside the top-level hook function. That is, the
function that is decorated with the hook. Calling this elsewhere will result in the
log message showing incorrect hook names.
:returns: A :class:`structlog.BoundLogger` instance ready for logging.
"""
frame = sys._getframe(1)
hook_name = frame.f_code.co_name
mod_name = frame.f_globals["__name__"]
return structlog.get_logger(mod_name, hook=hook_name)
post_site_load_engines = s.post_site_load_engines.connect
post_site_collect_targets = s.post_site_collect_targets.connect
pre_site_write = s.pre_site_write.connect
feat: Add hook.name function for inferring hook names | """Hooks for various events."""
# Copyright (c) 2012-2022 Wibowo Arindrarto <contact@arindrarto.dev>
# SPDX-License-Identifier: BSD-3-Clause
import sys
import structlog
from typing import Any
from . import signals as s
__all__ = [
"log",
"post_site_load_engines",
"post_site_collect_targets",
"pre_site_write",
]
def name() -> str:
"""Return the name of the current hook.
This function must be called inside the top-level hook function. That is, the
function that is decorated with the hook.
"""
frame = sys._getframe(1)
hook_name = frame.f_code.co_name
return hook_name
def log() -> Any:
"""Return a logger for a hook function.
This function is meant to be called inside the top-level hook function. That is, the
function that is decorated with the hook. Calling this elsewhere will result in the
log message showing incorrect hook names.
:returns: A :class:`structlog.BoundLogger` instance ready for logging.
"""
frame = sys._getframe(1)
hook_name = frame.f_code.co_name
mod_name = frame.f_globals["__name__"]
return structlog.get_logger(mod_name, hook=hook_name)
post_site_load_engines = s.post_site_load_engines.connect
post_site_collect_targets = s.post_site_collect_targets.connect
pre_site_write = s.pre_site_write.connect
| <commit_before>"""Hooks for various events."""
# Copyright (c) 2012-2022 Wibowo Arindrarto <contact@arindrarto.dev>
# SPDX-License-Identifier: BSD-3-Clause
import sys
import structlog
from typing import Any
from . import signals as s
__all__ = [
"log",
"post_site_load_engines",
"post_site_collect_targets",
"pre_site_write",
]
def log() -> Any:
"""Return a logger for a hook function.
This function is meant to be called inside the top-level hook function. That is, the
function that is decorated with the hook. Calling this elsewhere will result in the
log message showing incorrect hook names.
:returns: A :class:`structlog.BoundLogger` instance ready for logging.
"""
frame = sys._getframe(1)
hook_name = frame.f_code.co_name
mod_name = frame.f_globals["__name__"]
return structlog.get_logger(mod_name, hook=hook_name)
post_site_load_engines = s.post_site_load_engines.connect
post_site_collect_targets = s.post_site_collect_targets.connect
pre_site_write = s.pre_site_write.connect
<commit_msg>feat: Add hook.name function for inferring hook names<commit_after> | """Hooks for various events."""
# Copyright (c) 2012-2022 Wibowo Arindrarto <contact@arindrarto.dev>
# SPDX-License-Identifier: BSD-3-Clause
import sys
import structlog
from typing import Any
from . import signals as s
__all__ = [
"log",
"post_site_load_engines",
"post_site_collect_targets",
"pre_site_write",
]
def name() -> str:
"""Return the name of the current hook.
This function must be called inside the top-level hook function. That is, the
function that is decorated with the hook.
"""
frame = sys._getframe(1)
hook_name = frame.f_code.co_name
return hook_name
def log() -> Any:
"""Return a logger for a hook function.
This function is meant to be called inside the top-level hook function. That is, the
function that is decorated with the hook. Calling this elsewhere will result in the
log message showing incorrect hook names.
:returns: A :class:`structlog.BoundLogger` instance ready for logging.
"""
frame = sys._getframe(1)
hook_name = frame.f_code.co_name
mod_name = frame.f_globals["__name__"]
return structlog.get_logger(mod_name, hook=hook_name)
post_site_load_engines = s.post_site_load_engines.connect
post_site_collect_targets = s.post_site_collect_targets.connect
pre_site_write = s.pre_site_write.connect
| """Hooks for various events."""
# Copyright (c) 2012-2022 Wibowo Arindrarto <contact@arindrarto.dev>
# SPDX-License-Identifier: BSD-3-Clause
import sys
import structlog
from typing import Any
from . import signals as s
__all__ = [
"log",
"post_site_load_engines",
"post_site_collect_targets",
"pre_site_write",
]
def log() -> Any:
"""Return a logger for a hook function.
This function is meant to be called inside the top-level hook function. That is, the
function that is decorated with the hook. Calling this elsewhere will result in the
log message showing incorrect hook names.
:returns: A :class:`structlog.BoundLogger` instance ready for logging.
"""
frame = sys._getframe(1)
hook_name = frame.f_code.co_name
mod_name = frame.f_globals["__name__"]
return structlog.get_logger(mod_name, hook=hook_name)
post_site_load_engines = s.post_site_load_engines.connect
post_site_collect_targets = s.post_site_collect_targets.connect
pre_site_write = s.pre_site_write.connect
feat: Add hook.name function for inferring hook names"""Hooks for various events."""
# Copyright (c) 2012-2022 Wibowo Arindrarto <contact@arindrarto.dev>
# SPDX-License-Identifier: BSD-3-Clause
import sys
import structlog
from typing import Any
from . import signals as s
__all__ = [
"log",
"post_site_load_engines",
"post_site_collect_targets",
"pre_site_write",
]
def name() -> str:
"""Return the name of the current hook.
This function must be called inside the top-level hook function. That is, the
function that is decorated with the hook.
"""
frame = sys._getframe(1)
hook_name = frame.f_code.co_name
return hook_name
def log() -> Any:
"""Return a logger for a hook function.
This function is meant to be called inside the top-level hook function. That is, the
function that is decorated with the hook. Calling this elsewhere will result in the
log message showing incorrect hook names.
:returns: A :class:`structlog.BoundLogger` instance ready for logging.
"""
frame = sys._getframe(1)
hook_name = frame.f_code.co_name
mod_name = frame.f_globals["__name__"]
return structlog.get_logger(mod_name, hook=hook_name)
post_site_load_engines = s.post_site_load_engines.connect
post_site_collect_targets = s.post_site_collect_targets.connect
pre_site_write = s.pre_site_write.connect
| <commit_before>"""Hooks for various events."""
# Copyright (c) 2012-2022 Wibowo Arindrarto <contact@arindrarto.dev>
# SPDX-License-Identifier: BSD-3-Clause
import sys
import structlog
from typing import Any
from . import signals as s
__all__ = [
"log",
"post_site_load_engines",
"post_site_collect_targets",
"pre_site_write",
]
def log() -> Any:
"""Return a logger for a hook function.
This function is meant to be called inside the top-level hook function. That is, the
function that is decorated with the hook. Calling this elsewhere will result in the
log message showing incorrect hook names.
:returns: A :class:`structlog.BoundLogger` instance ready for logging.
"""
frame = sys._getframe(1)
hook_name = frame.f_code.co_name
mod_name = frame.f_globals["__name__"]
return structlog.get_logger(mod_name, hook=hook_name)
post_site_load_engines = s.post_site_load_engines.connect
post_site_collect_targets = s.post_site_collect_targets.connect
pre_site_write = s.pre_site_write.connect
<commit_msg>feat: Add hook.name function for inferring hook names<commit_after>"""Hooks for various events."""
# Copyright (c) 2012-2022 Wibowo Arindrarto <contact@arindrarto.dev>
# SPDX-License-Identifier: BSD-3-Clause
import sys
import structlog
from typing import Any
from . import signals as s
__all__ = [
"log",
"post_site_load_engines",
"post_site_collect_targets",
"pre_site_write",
]
def name() -> str:
"""Return the name of the current hook.
This function must be called inside the top-level hook function. That is, the
function that is decorated with the hook.
"""
frame = sys._getframe(1)
hook_name = frame.f_code.co_name
return hook_name
def log() -> Any:
"""Return a logger for a hook function.
This function is meant to be called inside the top-level hook function. That is, the
function that is decorated with the hook. Calling this elsewhere will result in the
log message showing incorrect hook names.
:returns: A :class:`structlog.BoundLogger` instance ready for logging.
"""
frame = sys._getframe(1)
hook_name = frame.f_code.co_name
mod_name = frame.f_globals["__name__"]
return structlog.get_logger(mod_name, hook=hook_name)
post_site_load_engines = s.post_site_load_engines.connect
post_site_collect_targets = s.post_site_collect_targets.connect
pre_site_write = s.pre_site_write.connect
|
9e1eae8b5d63a046b0dbfdb738419abd2a8edd69 | setup.py | setup.py | # -*- coding: utf-8 -*-
from os import path
from setuptools import setup, find_packages
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
install_requires = [
'tornado',
'pyserial'
]
setup_requires = [
'pytest-runner'
]
tests_require = [
'pytest',
'coverage',
'pytest-cov'
]
extras_require = {
'tests': tests_require,
'all': install_requires + tests_require
}
setup(
name="dusty-acorn",
version="2.0",
description="Air Quality monitoring web application",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/niwa/dusty-acorn",
packages=find_packages(),
python_requires='>=3.7',
install_requires=install_requires,
setup_requires=setup_requires,
tests_require=tests_require,
extras_require=extras_require,
entry_points={
'console_scripts': [
'dusty-acorn=dusty_acorn:main'
]
}
)
| # -*- coding: utf-8 -*-
from os import path
from setuptools import setup, find_packages
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
install_requires = [
'tornado',
'pyserial'
]
setup_requires = [
'pytest-runner'
]
tests_require = [
'pytest',
'coverage',
'pytest-cov'
]
extras_require = {
'tests': tests_require,
'all': install_requires + tests_require
}
setup(
name="dusty-acorn",
version="2.0",
description="Air Quality monitoring web application",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/niwa/dusty-acorn",
packages=find_packages(),
# find . -name "*.*" -exec sh -c 'echo "${0##*.}"' {} \; | sort | uniq
package_data={
'': [
'*.css',
'*.eot',
'*.html',
'*.jpg',
'*.js',
'*.json',
'*.mp3',
'*.mp4',
'*.ods',
'*.otf',
'*.png',
'*.svg',
'*.ttf',
'*.woff',
'*.woff2'
],
},
python_requires='>=3.7',
install_requires=install_requires,
setup_requires=setup_requires,
tests_require=tests_require,
extras_require=extras_require,
entry_points={
'console_scripts': [
'dusty-acorn=dusty_acorn:main'
]
}
)
| Include non-py files in the final package too | Include non-py files in the final package too
| Python | mit | guolivar/dusty-acorn,guolivar/dusty-acorn,guolivar/dusty-acorn,guolivar/dusty-acorn | # -*- coding: utf-8 -*-
from os import path
from setuptools import setup, find_packages
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
install_requires = [
'tornado',
'pyserial'
]
setup_requires = [
'pytest-runner'
]
tests_require = [
'pytest',
'coverage',
'pytest-cov'
]
extras_require = {
'tests': tests_require,
'all': install_requires + tests_require
}
setup(
name="dusty-acorn",
version="2.0",
description="Air Quality monitoring web application",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/niwa/dusty-acorn",
packages=find_packages(),
python_requires='>=3.7',
install_requires=install_requires,
setup_requires=setup_requires,
tests_require=tests_require,
extras_require=extras_require,
entry_points={
'console_scripts': [
'dusty-acorn=dusty_acorn:main'
]
}
)
Include non-py files in the final package too | # -*- coding: utf-8 -*-
from os import path
from setuptools import setup, find_packages
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
install_requires = [
'tornado',
'pyserial'
]
setup_requires = [
'pytest-runner'
]
tests_require = [
'pytest',
'coverage',
'pytest-cov'
]
extras_require = {
'tests': tests_require,
'all': install_requires + tests_require
}
setup(
name="dusty-acorn",
version="2.0",
description="Air Quality monitoring web application",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/niwa/dusty-acorn",
packages=find_packages(),
# find . -name "*.*" -exec sh -c 'echo "${0##*.}"' {} \; | sort | uniq
package_data={
'': [
'*.css',
'*.eot',
'*.html',
'*.jpg',
'*.js',
'*.json',
'*.mp3',
'*.mp4',
'*.ods',
'*.otf',
'*.png',
'*.svg',
'*.ttf',
'*.woff',
'*.woff2'
],
},
python_requires='>=3.7',
install_requires=install_requires,
setup_requires=setup_requires,
tests_require=tests_require,
extras_require=extras_require,
entry_points={
'console_scripts': [
'dusty-acorn=dusty_acorn:main'
]
}
)
| <commit_before># -*- coding: utf-8 -*-
from os import path
from setuptools import setup, find_packages
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
install_requires = [
'tornado',
'pyserial'
]
setup_requires = [
'pytest-runner'
]
tests_require = [
'pytest',
'coverage',
'pytest-cov'
]
extras_require = {
'tests': tests_require,
'all': install_requires + tests_require
}
setup(
name="dusty-acorn",
version="2.0",
description="Air Quality monitoring web application",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/niwa/dusty-acorn",
packages=find_packages(),
python_requires='>=3.7',
install_requires=install_requires,
setup_requires=setup_requires,
tests_require=tests_require,
extras_require=extras_require,
entry_points={
'console_scripts': [
'dusty-acorn=dusty_acorn:main'
]
}
)
<commit_msg>Include non-py files in the final package too<commit_after> | # -*- coding: utf-8 -*-
from os import path
from setuptools import setup, find_packages
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
install_requires = [
'tornado',
'pyserial'
]
setup_requires = [
'pytest-runner'
]
tests_require = [
'pytest',
'coverage',
'pytest-cov'
]
extras_require = {
'tests': tests_require,
'all': install_requires + tests_require
}
setup(
name="dusty-acorn",
version="2.0",
description="Air Quality monitoring web application",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/niwa/dusty-acorn",
packages=find_packages(),
# find . -name "*.*" -exec sh -c 'echo "${0##*.}"' {} \; | sort | uniq
package_data={
'': [
'*.css',
'*.eot',
'*.html',
'*.jpg',
'*.js',
'*.json',
'*.mp3',
'*.mp4',
'*.ods',
'*.otf',
'*.png',
'*.svg',
'*.ttf',
'*.woff',
'*.woff2'
],
},
python_requires='>=3.7',
install_requires=install_requires,
setup_requires=setup_requires,
tests_require=tests_require,
extras_require=extras_require,
entry_points={
'console_scripts': [
'dusty-acorn=dusty_acorn:main'
]
}
)
| # -*- coding: utf-8 -*-
from os import path
from setuptools import setup, find_packages
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
install_requires = [
'tornado',
'pyserial'
]
setup_requires = [
'pytest-runner'
]
tests_require = [
'pytest',
'coverage',
'pytest-cov'
]
extras_require = {
'tests': tests_require,
'all': install_requires + tests_require
}
setup(
name="dusty-acorn",
version="2.0",
description="Air Quality monitoring web application",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/niwa/dusty-acorn",
packages=find_packages(),
python_requires='>=3.7',
install_requires=install_requires,
setup_requires=setup_requires,
tests_require=tests_require,
extras_require=extras_require,
entry_points={
'console_scripts': [
'dusty-acorn=dusty_acorn:main'
]
}
)
Include non-py files in the final package too# -*- coding: utf-8 -*-
from os import path
from setuptools import setup, find_packages
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
install_requires = [
'tornado',
'pyserial'
]
setup_requires = [
'pytest-runner'
]
tests_require = [
'pytest',
'coverage',
'pytest-cov'
]
extras_require = {
'tests': tests_require,
'all': install_requires + tests_require
}
setup(
name="dusty-acorn",
version="2.0",
description="Air Quality monitoring web application",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/niwa/dusty-acorn",
packages=find_packages(),
# find . -name "*.*" -exec sh -c 'echo "${0##*.}"' {} \; | sort | uniq
package_data={
'': [
'*.css',
'*.eot',
'*.html',
'*.jpg',
'*.js',
'*.json',
'*.mp3',
'*.mp4',
'*.ods',
'*.otf',
'*.png',
'*.svg',
'*.ttf',
'*.woff',
'*.woff2'
],
},
python_requires='>=3.7',
install_requires=install_requires,
setup_requires=setup_requires,
tests_require=tests_require,
extras_require=extras_require,
entry_points={
'console_scripts': [
'dusty-acorn=dusty_acorn:main'
]
}
)
| <commit_before># -*- coding: utf-8 -*-
from os import path
from setuptools import setup, find_packages
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
install_requires = [
'tornado',
'pyserial'
]
setup_requires = [
'pytest-runner'
]
tests_require = [
'pytest',
'coverage',
'pytest-cov'
]
extras_require = {
'tests': tests_require,
'all': install_requires + tests_require
}
setup(
name="dusty-acorn",
version="2.0",
description="Air Quality monitoring web application",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/niwa/dusty-acorn",
packages=find_packages(),
python_requires='>=3.7',
install_requires=install_requires,
setup_requires=setup_requires,
tests_require=tests_require,
extras_require=extras_require,
entry_points={
'console_scripts': [
'dusty-acorn=dusty_acorn:main'
]
}
)
<commit_msg>Include non-py files in the final package too<commit_after># -*- coding: utf-8 -*-
from os import path
from setuptools import setup, find_packages
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
install_requires = [
'tornado',
'pyserial'
]
setup_requires = [
'pytest-runner'
]
tests_require = [
'pytest',
'coverage',
'pytest-cov'
]
extras_require = {
'tests': tests_require,
'all': install_requires + tests_require
}
setup(
name="dusty-acorn",
version="2.0",
description="Air Quality monitoring web application",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/niwa/dusty-acorn",
packages=find_packages(),
# find . -name "*.*" -exec sh -c 'echo "${0##*.}"' {} \; | sort | uniq
package_data={
'': [
'*.css',
'*.eot',
'*.html',
'*.jpg',
'*.js',
'*.json',
'*.mp3',
'*.mp4',
'*.ods',
'*.otf',
'*.png',
'*.svg',
'*.ttf',
'*.woff',
'*.woff2'
],
},
python_requires='>=3.7',
install_requires=install_requires,
setup_requires=setup_requires,
tests_require=tests_require,
extras_require=extras_require,
entry_points={
'console_scripts': [
'dusty-acorn=dusty_acorn:main'
]
}
)
|
eb4eea9f76a50884743774a9723e14c1aa869eea | setup.py | setup.py | from setuptools import setup
setup(name='role2rdme',
version='0.1',
description='Script to generate md table from Ansible role',
url='https://github.com/RcRonco/role2md',
author='RcRonco',
author_email='cohenronco@gmail.com',
license='MIT',
packages=['role2md'],
install_requires=['yaml', 'jinja2'],
zip_safe=False)
| from setuptools import setup
setup(name='role2rdme',
version='0.1',
description='Script to generate md table from Ansible role',
url='https://github.com/RcRonco/role2md',
author='RcRonco',
author_email='cohenronco@gmail.com',
license='MIT',
packages=['role2md'],
install_requires=['pyYAML', 'jinja2'],
zip_safe=False)
| Change install_requires from yaml to pyYAML | Change install_requires from yaml to pyYAML | Python | bsd-3-clause | RcRonco/role2md,RcRonco/role2md | from setuptools import setup
setup(name='role2rdme',
version='0.1',
description='Script to generate md table from Ansible role',
url='https://github.com/RcRonco/role2md',
author='RcRonco',
author_email='cohenronco@gmail.com',
license='MIT',
packages=['role2md'],
install_requires=['yaml', 'jinja2'],
zip_safe=False)
Change install_requires from yaml to pyYAML | from setuptools import setup
setup(name='role2rdme',
version='0.1',
description='Script to generate md table from Ansible role',
url='https://github.com/RcRonco/role2md',
author='RcRonco',
author_email='cohenronco@gmail.com',
license='MIT',
packages=['role2md'],
install_requires=['pyYAML', 'jinja2'],
zip_safe=False)
| <commit_before>from setuptools import setup
setup(name='role2rdme',
version='0.1',
description='Script to generate md table from Ansible role',
url='https://github.com/RcRonco/role2md',
author='RcRonco',
author_email='cohenronco@gmail.com',
license='MIT',
packages=['role2md'],
install_requires=['yaml', 'jinja2'],
zip_safe=False)
<commit_msg>Change install_requires from yaml to pyYAML<commit_after> | from setuptools import setup
setup(name='role2rdme',
version='0.1',
description='Script to generate md table from Ansible role',
url='https://github.com/RcRonco/role2md',
author='RcRonco',
author_email='cohenronco@gmail.com',
license='MIT',
packages=['role2md'],
install_requires=['pyYAML', 'jinja2'],
zip_safe=False)
| from setuptools import setup
setup(name='role2rdme',
version='0.1',
description='Script to generate md table from Ansible role',
url='https://github.com/RcRonco/role2md',
author='RcRonco',
author_email='cohenronco@gmail.com',
license='MIT',
packages=['role2md'],
install_requires=['yaml', 'jinja2'],
zip_safe=False)
Change install_requires from yaml to pyYAMLfrom setuptools import setup
setup(name='role2rdme',
version='0.1',
description='Script to generate md table from Ansible role',
url='https://github.com/RcRonco/role2md',
author='RcRonco',
author_email='cohenronco@gmail.com',
license='MIT',
packages=['role2md'],
install_requires=['pyYAML', 'jinja2'],
zip_safe=False)
| <commit_before>from setuptools import setup
setup(name='role2rdme',
version='0.1',
description='Script to generate md table from Ansible role',
url='https://github.com/RcRonco/role2md',
author='RcRonco',
author_email='cohenronco@gmail.com',
license='MIT',
packages=['role2md'],
install_requires=['yaml', 'jinja2'],
zip_safe=False)
<commit_msg>Change install_requires from yaml to pyYAML<commit_after>from setuptools import setup
setup(name='role2rdme',
version='0.1',
description='Script to generate md table from Ansible role',
url='https://github.com/RcRonco/role2md',
author='RcRonco',
author_email='cohenronco@gmail.com',
license='MIT',
packages=['role2md'],
install_requires=['pyYAML', 'jinja2'],
zip_safe=False)
|
0de11865966a2d05a33e6dc3b7ab198350227985 | setup.py | setup.py | #from distutils.core import setup
from setuptools import setup
setup(
name='django-auth_mac',
version='0.1.1',
description="Basic Django implementation of the draft RFC ietf-oauth-v2-http-mac-01",
author='Nicholas Devenish',
author_email='n.devenish@gmail.com',
packages=['auth_mac', 'auth_mac.tests'],
license=open('LICENSE.txt').read(),
long_description=open('README.rst').read(),
url='https://github.com/ndevenish/auth_mac',
keywords = ['django', 'authorization', 'MAC'],
classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"License :: OSI Approved :: MIT License",
"Framework :: Django",
"Operating System :: OS Independent",
"Intended Audience :: Developers",
"Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware",
"Development Status :: 2 - Pre-Alpha",
"Topic :: Software Development :: Libraries :: Python Modules",
],
install_requires=['Django >= 1.3'],
zip_safe=False,
) | #from distutils.core import setup
from setuptools import setup
setup(
name='django-auth_mac',
version='0.1.2',
description="Basic Django implementation of the draft RFC ietf-oauth-v2-http-mac-01",
author='Nicholas Devenish',
author_email='n.devenish@gmail.com',
packages=['auth_mac', 'auth_mac.tests'],
license=open('LICENSE.txt').read(),
long_description=open('README.rst').read(),
url='https://github.com/ndevenish/auth_mac',
keywords = ['django', 'authorization', 'MAC'],
classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"License :: OSI Approved :: MIT License",
"Framework :: Django",
"Operating System :: OS Independent",
"Intended Audience :: Developers",
"Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware",
"Development Status :: 2 - Pre-Alpha",
"Topic :: Software Development :: Libraries :: Python Modules",
],
install_requires=['Django >= 1.3'],
zip_safe=False,
) | Advance the minor version to reflect the bug fixes | Advance the minor version to reflect the bug fixes
| Python | mit | ndevenish/auth_mac | #from distutils.core import setup
from setuptools import setup
setup(
name='django-auth_mac',
version='0.1.1',
description="Basic Django implementation of the draft RFC ietf-oauth-v2-http-mac-01",
author='Nicholas Devenish',
author_email='n.devenish@gmail.com',
packages=['auth_mac', 'auth_mac.tests'],
license=open('LICENSE.txt').read(),
long_description=open('README.rst').read(),
url='https://github.com/ndevenish/auth_mac',
keywords = ['django', 'authorization', 'MAC'],
classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"License :: OSI Approved :: MIT License",
"Framework :: Django",
"Operating System :: OS Independent",
"Intended Audience :: Developers",
"Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware",
"Development Status :: 2 - Pre-Alpha",
"Topic :: Software Development :: Libraries :: Python Modules",
],
install_requires=['Django >= 1.3'],
zip_safe=False,
)Advance the minor version to reflect the bug fixes | #from distutils.core import setup
from setuptools import setup
setup(
name='django-auth_mac',
version='0.1.2',
description="Basic Django implementation of the draft RFC ietf-oauth-v2-http-mac-01",
author='Nicholas Devenish',
author_email='n.devenish@gmail.com',
packages=['auth_mac', 'auth_mac.tests'],
license=open('LICENSE.txt').read(),
long_description=open('README.rst').read(),
url='https://github.com/ndevenish/auth_mac',
keywords = ['django', 'authorization', 'MAC'],
classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"License :: OSI Approved :: MIT License",
"Framework :: Django",
"Operating System :: OS Independent",
"Intended Audience :: Developers",
"Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware",
"Development Status :: 2 - Pre-Alpha",
"Topic :: Software Development :: Libraries :: Python Modules",
],
install_requires=['Django >= 1.3'],
zip_safe=False,
) | <commit_before>#from distutils.core import setup
from setuptools import setup
setup(
name='django-auth_mac',
version='0.1.1',
description="Basic Django implementation of the draft RFC ietf-oauth-v2-http-mac-01",
author='Nicholas Devenish',
author_email='n.devenish@gmail.com',
packages=['auth_mac', 'auth_mac.tests'],
license=open('LICENSE.txt').read(),
long_description=open('README.rst').read(),
url='https://github.com/ndevenish/auth_mac',
keywords = ['django', 'authorization', 'MAC'],
classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"License :: OSI Approved :: MIT License",
"Framework :: Django",
"Operating System :: OS Independent",
"Intended Audience :: Developers",
"Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware",
"Development Status :: 2 - Pre-Alpha",
"Topic :: Software Development :: Libraries :: Python Modules",
],
install_requires=['Django >= 1.3'],
zip_safe=False,
)<commit_msg>Advance the minor version to reflect the bug fixes<commit_after> | #from distutils.core import setup
from setuptools import setup
setup(
name='django-auth_mac',
version='0.1.2',
description="Basic Django implementation of the draft RFC ietf-oauth-v2-http-mac-01",
author='Nicholas Devenish',
author_email='n.devenish@gmail.com',
packages=['auth_mac', 'auth_mac.tests'],
license=open('LICENSE.txt').read(),
long_description=open('README.rst').read(),
url='https://github.com/ndevenish/auth_mac',
keywords = ['django', 'authorization', 'MAC'],
classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"License :: OSI Approved :: MIT License",
"Framework :: Django",
"Operating System :: OS Independent",
"Intended Audience :: Developers",
"Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware",
"Development Status :: 2 - Pre-Alpha",
"Topic :: Software Development :: Libraries :: Python Modules",
],
install_requires=['Django >= 1.3'],
zip_safe=False,
) | #from distutils.core import setup
from setuptools import setup
setup(
name='django-auth_mac',
version='0.1.1',
description="Basic Django implementation of the draft RFC ietf-oauth-v2-http-mac-01",
author='Nicholas Devenish',
author_email='n.devenish@gmail.com',
packages=['auth_mac', 'auth_mac.tests'],
license=open('LICENSE.txt').read(),
long_description=open('README.rst').read(),
url='https://github.com/ndevenish/auth_mac',
keywords = ['django', 'authorization', 'MAC'],
classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"License :: OSI Approved :: MIT License",
"Framework :: Django",
"Operating System :: OS Independent",
"Intended Audience :: Developers",
"Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware",
"Development Status :: 2 - Pre-Alpha",
"Topic :: Software Development :: Libraries :: Python Modules",
],
install_requires=['Django >= 1.3'],
zip_safe=False,
)Advance the minor version to reflect the bug fixes#from distutils.core import setup
from setuptools import setup
setup(
name='django-auth_mac',
version='0.1.2',
description="Basic Django implementation of the draft RFC ietf-oauth-v2-http-mac-01",
author='Nicholas Devenish',
author_email='n.devenish@gmail.com',
packages=['auth_mac', 'auth_mac.tests'],
license=open('LICENSE.txt').read(),
long_description=open('README.rst').read(),
url='https://github.com/ndevenish/auth_mac',
keywords = ['django', 'authorization', 'MAC'],
classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"License :: OSI Approved :: MIT License",
"Framework :: Django",
"Operating System :: OS Independent",
"Intended Audience :: Developers",
"Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware",
"Development Status :: 2 - Pre-Alpha",
"Topic :: Software Development :: Libraries :: Python Modules",
],
install_requires=['Django >= 1.3'],
zip_safe=False,
) | <commit_before>#from distutils.core import setup
from setuptools import setup
setup(
name='django-auth_mac',
version='0.1.1',
description="Basic Django implementation of the draft RFC ietf-oauth-v2-http-mac-01",
author='Nicholas Devenish',
author_email='n.devenish@gmail.com',
packages=['auth_mac', 'auth_mac.tests'],
license=open('LICENSE.txt').read(),
long_description=open('README.rst').read(),
url='https://github.com/ndevenish/auth_mac',
keywords = ['django', 'authorization', 'MAC'],
classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"License :: OSI Approved :: MIT License",
"Framework :: Django",
"Operating System :: OS Independent",
"Intended Audience :: Developers",
"Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware",
"Development Status :: 2 - Pre-Alpha",
"Topic :: Software Development :: Libraries :: Python Modules",
],
install_requires=['Django >= 1.3'],
zip_safe=False,
)<commit_msg>Advance the minor version to reflect the bug fixes<commit_after>#from distutils.core import setup
from setuptools import setup
setup(
name='django-auth_mac',
version='0.1.2',
description="Basic Django implementation of the draft RFC ietf-oauth-v2-http-mac-01",
author='Nicholas Devenish',
author_email='n.devenish@gmail.com',
packages=['auth_mac', 'auth_mac.tests'],
license=open('LICENSE.txt').read(),
long_description=open('README.rst').read(),
url='https://github.com/ndevenish/auth_mac',
keywords = ['django', 'authorization', 'MAC'],
classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"License :: OSI Approved :: MIT License",
"Framework :: Django",
"Operating System :: OS Independent",
"Intended Audience :: Developers",
"Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware",
"Development Status :: 2 - Pre-Alpha",
"Topic :: Software Development :: Libraries :: Python Modules",
],
install_requires=['Django >= 1.3'],
zip_safe=False,
) |
96a262dea7cf4a5559ae64088f0c8a072a3264aa | setup.py | setup.py | import setuptools
REQUIREMENTS = [
"docopt==0.6.1",
"feedparser==5.1.3",
"jabberbot==0.15",
"xmpppy==0.5.0rc1",
]
if __name__ == "__main__":
setuptools.setup(
name="dudebot",
version="0.0.7",
author="Sujay Mansingh",
author_email="sujay.mansingh@gmail.com",
packages=setuptools.find_packages(),
package_data={
"dudebot": ["README.rst"]
},
scripts=[],
url="https://github.com/sujaymansingh/dudebot",
license="LICENSE.txt",
description="A really simple framework for chatroom bots",
long_description="View the github page (https://github.com/sujaymansingh/dudebot) for more details.",
install_requires=REQUIREMENTS
)
| import setuptools
REQUIREMENTS = [
"docopt==0.6.1",
"feedparser==5.1.3",
"jabberbot==0.15",
"xmpppy==0.5.0rc1",
]
if __name__ == "__main__":
setuptools.setup(
name="dudebot",
version="0.0.7",
author="Sujay Mansingh",
author_email="sujay.mansingh@gmail.com",
packages=setuptools.find_packages(),
scripts=[],
url="https://github.com/sujaymansingh/dudebot",
license="LICENSE.txt",
description="A really simple framework for chatroom bots",
long_description="View the github page (https://github.com/sujaymansingh/dudebot) for more details.",
install_requires=REQUIREMENTS
)
| Use a placeholder string instead of a README. | Use a placeholder string instead of a README.
Until I work out why README.rst isn't being included, use this.
| Python | bsd-2-clause | sujaymansingh/dudebot | import setuptools
REQUIREMENTS = [
"docopt==0.6.1",
"feedparser==5.1.3",
"jabberbot==0.15",
"xmpppy==0.5.0rc1",
]
if __name__ == "__main__":
setuptools.setup(
name="dudebot",
version="0.0.7",
author="Sujay Mansingh",
author_email="sujay.mansingh@gmail.com",
packages=setuptools.find_packages(),
package_data={
"dudebot": ["README.rst"]
},
scripts=[],
url="https://github.com/sujaymansingh/dudebot",
license="LICENSE.txt",
description="A really simple framework for chatroom bots",
long_description="View the github page (https://github.com/sujaymansingh/dudebot) for more details.",
install_requires=REQUIREMENTS
)
Use a placeholder string instead of a README.
Until I work out why README.rst isn't being included, use this. | import setuptools
REQUIREMENTS = [
"docopt==0.6.1",
"feedparser==5.1.3",
"jabberbot==0.15",
"xmpppy==0.5.0rc1",
]
if __name__ == "__main__":
setuptools.setup(
name="dudebot",
version="0.0.7",
author="Sujay Mansingh",
author_email="sujay.mansingh@gmail.com",
packages=setuptools.find_packages(),
scripts=[],
url="https://github.com/sujaymansingh/dudebot",
license="LICENSE.txt",
description="A really simple framework for chatroom bots",
long_description="View the github page (https://github.com/sujaymansingh/dudebot) for more details.",
install_requires=REQUIREMENTS
)
| <commit_before>import setuptools
REQUIREMENTS = [
"docopt==0.6.1",
"feedparser==5.1.3",
"jabberbot==0.15",
"xmpppy==0.5.0rc1",
]
if __name__ == "__main__":
setuptools.setup(
name="dudebot",
version="0.0.7",
author="Sujay Mansingh",
author_email="sujay.mansingh@gmail.com",
packages=setuptools.find_packages(),
package_data={
"dudebot": ["README.rst"]
},
scripts=[],
url="https://github.com/sujaymansingh/dudebot",
license="LICENSE.txt",
description="A really simple framework for chatroom bots",
long_description="View the github page (https://github.com/sujaymansingh/dudebot) for more details.",
install_requires=REQUIREMENTS
)
<commit_msg>Use a placeholder string instead of a README.
Until I work out why README.rst isn't being included, use this.<commit_after> | import setuptools
REQUIREMENTS = [
"docopt==0.6.1",
"feedparser==5.1.3",
"jabberbot==0.15",
"xmpppy==0.5.0rc1",
]
if __name__ == "__main__":
setuptools.setup(
name="dudebot",
version="0.0.7",
author="Sujay Mansingh",
author_email="sujay.mansingh@gmail.com",
packages=setuptools.find_packages(),
scripts=[],
url="https://github.com/sujaymansingh/dudebot",
license="LICENSE.txt",
description="A really simple framework for chatroom bots",
long_description="View the github page (https://github.com/sujaymansingh/dudebot) for more details.",
install_requires=REQUIREMENTS
)
| import setuptools
REQUIREMENTS = [
"docopt==0.6.1",
"feedparser==5.1.3",
"jabberbot==0.15",
"xmpppy==0.5.0rc1",
]
if __name__ == "__main__":
setuptools.setup(
name="dudebot",
version="0.0.7",
author="Sujay Mansingh",
author_email="sujay.mansingh@gmail.com",
packages=setuptools.find_packages(),
package_data={
"dudebot": ["README.rst"]
},
scripts=[],
url="https://github.com/sujaymansingh/dudebot",
license="LICENSE.txt",
description="A really simple framework for chatroom bots",
long_description="View the github page (https://github.com/sujaymansingh/dudebot) for more details.",
install_requires=REQUIREMENTS
)
Use a placeholder string instead of a README.
Until I work out why README.rst isn't being included, use this.import setuptools
REQUIREMENTS = [
"docopt==0.6.1",
"feedparser==5.1.3",
"jabberbot==0.15",
"xmpppy==0.5.0rc1",
]
if __name__ == "__main__":
setuptools.setup(
name="dudebot",
version="0.0.7",
author="Sujay Mansingh",
author_email="sujay.mansingh@gmail.com",
packages=setuptools.find_packages(),
scripts=[],
url="https://github.com/sujaymansingh/dudebot",
license="LICENSE.txt",
description="A really simple framework for chatroom bots",
long_description="View the github page (https://github.com/sujaymansingh/dudebot) for more details.",
install_requires=REQUIREMENTS
)
| <commit_before>import setuptools
REQUIREMENTS = [
"docopt==0.6.1",
"feedparser==5.1.3",
"jabberbot==0.15",
"xmpppy==0.5.0rc1",
]
if __name__ == "__main__":
setuptools.setup(
name="dudebot",
version="0.0.7",
author="Sujay Mansingh",
author_email="sujay.mansingh@gmail.com",
packages=setuptools.find_packages(),
package_data={
"dudebot": ["README.rst"]
},
scripts=[],
url="https://github.com/sujaymansingh/dudebot",
license="LICENSE.txt",
description="A really simple framework for chatroom bots",
long_description="View the github page (https://github.com/sujaymansingh/dudebot) for more details.",
install_requires=REQUIREMENTS
)
<commit_msg>Use a placeholder string instead of a README.
Until I work out why README.rst isn't being included, use this.<commit_after>import setuptools
REQUIREMENTS = [
"docopt==0.6.1",
"feedparser==5.1.3",
"jabberbot==0.15",
"xmpppy==0.5.0rc1",
]
if __name__ == "__main__":
setuptools.setup(
name="dudebot",
version="0.0.7",
author="Sujay Mansingh",
author_email="sujay.mansingh@gmail.com",
packages=setuptools.find_packages(),
scripts=[],
url="https://github.com/sujaymansingh/dudebot",
license="LICENSE.txt",
description="A really simple framework for chatroom bots",
long_description="View the github page (https://github.com/sujaymansingh/dudebot) for more details.",
install_requires=REQUIREMENTS
)
|
1b91e3ef7831a956b62a662a5084eee884b55331 | setup.py | setup.py | #!/usr/bin/env python
from distutils.core import setup, Command
class TestDiscovery(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import sys, subprocess
errno = subprocess.call([
sys.executable,
'-m', 'unittest',
'discover',
'-p', '*.py',
'tests',
])
raise SystemExit(errno)
setup(name='Steel',
version='0.1',
description='A Python framework for describing binary file formats',
author='Marty Alchin',
author_email='marty@martyalchin.com',
url='https://github.com/gulopine/steel',
packages=['steel'],
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 3.1',
'Programming Language :: Python :: 3.2',
'Topic :: Software Development :: Libraries :: Application Frameworks',
'Topic :: System :: Filesystems',
],
cmdclass={'test': TestDiscovery},
)
| #!/usr/bin/env python
from distutils.core import setup, Command
class TestDiscovery(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import sys, subprocess
errno = subprocess.call([
sys.executable,
'-m', 'unittest',
'discover',
'-p', '*.py',
'tests',
])
raise SystemExit(errno)
setup(name='steel',
version='0.1',
description='A Python framework for describing binary file formats',
author='Marty Alchin',
author_email='marty@martyalchin.com',
url='https://github.com/gulopine/steel',
packages=['steel'],
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 3.1',
'Programming Language :: Python :: 3.2',
'Topic :: Software Development :: Libraries :: Application Frameworks',
'Topic :: System :: Filesystems',
],
cmdclass={'test': TestDiscovery},
)
| Use the right case for the package name | Use the right case for the package name
| Python | bsd-3-clause | gulopine/steel | #!/usr/bin/env python
from distutils.core import setup, Command
class TestDiscovery(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import sys, subprocess
errno = subprocess.call([
sys.executable,
'-m', 'unittest',
'discover',
'-p', '*.py',
'tests',
])
raise SystemExit(errno)
setup(name='Steel',
version='0.1',
description='A Python framework for describing binary file formats',
author='Marty Alchin',
author_email='marty@martyalchin.com',
url='https://github.com/gulopine/steel',
packages=['steel'],
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 3.1',
'Programming Language :: Python :: 3.2',
'Topic :: Software Development :: Libraries :: Application Frameworks',
'Topic :: System :: Filesystems',
],
cmdclass={'test': TestDiscovery},
)
Use the right case for the package name | #!/usr/bin/env python
from distutils.core import setup, Command
class TestDiscovery(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import sys, subprocess
errno = subprocess.call([
sys.executable,
'-m', 'unittest',
'discover',
'-p', '*.py',
'tests',
])
raise SystemExit(errno)
setup(name='steel',
version='0.1',
description='A Python framework for describing binary file formats',
author='Marty Alchin',
author_email='marty@martyalchin.com',
url='https://github.com/gulopine/steel',
packages=['steel'],
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 3.1',
'Programming Language :: Python :: 3.2',
'Topic :: Software Development :: Libraries :: Application Frameworks',
'Topic :: System :: Filesystems',
],
cmdclass={'test': TestDiscovery},
)
| <commit_before>#!/usr/bin/env python
from distutils.core import setup, Command
class TestDiscovery(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import sys, subprocess
errno = subprocess.call([
sys.executable,
'-m', 'unittest',
'discover',
'-p', '*.py',
'tests',
])
raise SystemExit(errno)
setup(name='Steel',
version='0.1',
description='A Python framework for describing binary file formats',
author='Marty Alchin',
author_email='marty@martyalchin.com',
url='https://github.com/gulopine/steel',
packages=['steel'],
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 3.1',
'Programming Language :: Python :: 3.2',
'Topic :: Software Development :: Libraries :: Application Frameworks',
'Topic :: System :: Filesystems',
],
cmdclass={'test': TestDiscovery},
)
<commit_msg>Use the right case for the package name<commit_after> | #!/usr/bin/env python
from distutils.core import setup, Command
class TestDiscovery(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import sys, subprocess
errno = subprocess.call([
sys.executable,
'-m', 'unittest',
'discover',
'-p', '*.py',
'tests',
])
raise SystemExit(errno)
setup(name='steel',
version='0.1',
description='A Python framework for describing binary file formats',
author='Marty Alchin',
author_email='marty@martyalchin.com',
url='https://github.com/gulopine/steel',
packages=['steel'],
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 3.1',
'Programming Language :: Python :: 3.2',
'Topic :: Software Development :: Libraries :: Application Frameworks',
'Topic :: System :: Filesystems',
],
cmdclass={'test': TestDiscovery},
)
| #!/usr/bin/env python
from distutils.core import setup, Command
class TestDiscovery(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import sys, subprocess
errno = subprocess.call([
sys.executable,
'-m', 'unittest',
'discover',
'-p', '*.py',
'tests',
])
raise SystemExit(errno)
setup(name='Steel',
version='0.1',
description='A Python framework for describing binary file formats',
author='Marty Alchin',
author_email='marty@martyalchin.com',
url='https://github.com/gulopine/steel',
packages=['steel'],
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 3.1',
'Programming Language :: Python :: 3.2',
'Topic :: Software Development :: Libraries :: Application Frameworks',
'Topic :: System :: Filesystems',
],
cmdclass={'test': TestDiscovery},
)
Use the right case for the package name#!/usr/bin/env python
from distutils.core import setup, Command
class TestDiscovery(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import sys, subprocess
errno = subprocess.call([
sys.executable,
'-m', 'unittest',
'discover',
'-p', '*.py',
'tests',
])
raise SystemExit(errno)
setup(name='steel',
version='0.1',
description='A Python framework for describing binary file formats',
author='Marty Alchin',
author_email='marty@martyalchin.com',
url='https://github.com/gulopine/steel',
packages=['steel'],
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 3.1',
'Programming Language :: Python :: 3.2',
'Topic :: Software Development :: Libraries :: Application Frameworks',
'Topic :: System :: Filesystems',
],
cmdclass={'test': TestDiscovery},
)
| <commit_before>#!/usr/bin/env python
from distutils.core import setup, Command
class TestDiscovery(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import sys, subprocess
errno = subprocess.call([
sys.executable,
'-m', 'unittest',
'discover',
'-p', '*.py',
'tests',
])
raise SystemExit(errno)
setup(name='Steel',
version='0.1',
description='A Python framework for describing binary file formats',
author='Marty Alchin',
author_email='marty@martyalchin.com',
url='https://github.com/gulopine/steel',
packages=['steel'],
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 3.1',
'Programming Language :: Python :: 3.2',
'Topic :: Software Development :: Libraries :: Application Frameworks',
'Topic :: System :: Filesystems',
],
cmdclass={'test': TestDiscovery},
)
<commit_msg>Use the right case for the package name<commit_after>#!/usr/bin/env python
from distutils.core import setup, Command
class TestDiscovery(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import sys, subprocess
errno = subprocess.call([
sys.executable,
'-m', 'unittest',
'discover',
'-p', '*.py',
'tests',
])
raise SystemExit(errno)
setup(name='steel',
version='0.1',
description='A Python framework for describing binary file formats',
author='Marty Alchin',
author_email='marty@martyalchin.com',
url='https://github.com/gulopine/steel',
packages=['steel'],
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 3.1',
'Programming Language :: Python :: 3.2',
'Topic :: Software Development :: Libraries :: Application Frameworks',
'Topic :: System :: Filesystems',
],
cmdclass={'test': TestDiscovery},
)
|
35ae3f1f9f77552af637cf9ba96cd02c81a21284 | setup.py | setup.py | """Setup module for txrudp."""
import codecs
from os import path
import sys
from setuptools import setup
_HERE = path.abspath(path.dirname(__file__))
with codecs.open(path.join(_HERE, 'README.rst'), encoding='utf-8') as f:
_LONG_DESCRIPTION = f.read()
setup(
name='txrudp',
version='0.4.0',
description='A Twisted extension implementing RUDP',
long_description=_LONG_DESCRIPTION,
url='https://github.com/Renelvon/txrudp',
author='Nikolaos Korasidis',
author_email='renelvon@gmail.com',
license='MIT',
classifiers=(
'Development Status :: 3 - Alpha',
'Framework :: Twisted',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: System :: Networking'
),
keywords='rudp twisted reliable',
packages=('txrudp', 'tests'),
install_requires=('enum34', 'protobuf', 'pynacl', 'twisted'),
tests_require=('coverage', 'nose', 'mock'),
test_suite='tests',
zip_safe=False
)
| """Setup module for txrudp."""
import codecs
from os import path
import sys
from setuptools import setup
_HERE = path.abspath(path.dirname(__file__))
with codecs.open(path.join(_HERE, 'README.rst'), encoding='utf-8') as f:
_LONG_DESCRIPTION = f.read()
setup(
name='txrudp',
version='0.4.0',
description='A Twisted extension implementing RUDP',
long_description=_LONG_DESCRIPTION,
url='https://github.com/Renelvon/txrudp',
author='Nikolaos Korasidis',
author_email='renelvon@gmail.com',
license='MIT',
classifiers=(
'Development Status :: 3 - Alpha',
'Framework :: Twisted',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: System :: Networking'
),
keywords='rudp twisted reliable',
packages=('txrudp', 'tests'),
install_requires=('enum34', 'protobuf', 'pynacl', 'twisted'),
tests_require=('coverage', 'nose', 'mock'),
test_suite='nose.collector',
zip_safe=False
)
| Use nose to run the testsuite. | Use nose to run the testsuite.
| Python | mit | OpenBazaar/txrudp,Renelvon/txrudp | """Setup module for txrudp."""
import codecs
from os import path
import sys
from setuptools import setup
_HERE = path.abspath(path.dirname(__file__))
with codecs.open(path.join(_HERE, 'README.rst'), encoding='utf-8') as f:
_LONG_DESCRIPTION = f.read()
setup(
name='txrudp',
version='0.4.0',
description='A Twisted extension implementing RUDP',
long_description=_LONG_DESCRIPTION,
url='https://github.com/Renelvon/txrudp',
author='Nikolaos Korasidis',
author_email='renelvon@gmail.com',
license='MIT',
classifiers=(
'Development Status :: 3 - Alpha',
'Framework :: Twisted',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: System :: Networking'
),
keywords='rudp twisted reliable',
packages=('txrudp', 'tests'),
install_requires=('enum34', 'protobuf', 'pynacl', 'twisted'),
tests_require=('coverage', 'nose', 'mock'),
test_suite='tests',
zip_safe=False
)
Use nose to run the testsuite. | """Setup module for txrudp."""
import codecs
from os import path
import sys
from setuptools import setup
_HERE = path.abspath(path.dirname(__file__))
with codecs.open(path.join(_HERE, 'README.rst'), encoding='utf-8') as f:
_LONG_DESCRIPTION = f.read()
setup(
name='txrudp',
version='0.4.0',
description='A Twisted extension implementing RUDP',
long_description=_LONG_DESCRIPTION,
url='https://github.com/Renelvon/txrudp',
author='Nikolaos Korasidis',
author_email='renelvon@gmail.com',
license='MIT',
classifiers=(
'Development Status :: 3 - Alpha',
'Framework :: Twisted',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: System :: Networking'
),
keywords='rudp twisted reliable',
packages=('txrudp', 'tests'),
install_requires=('enum34', 'protobuf', 'pynacl', 'twisted'),
tests_require=('coverage', 'nose', 'mock'),
test_suite='nose.collector',
zip_safe=False
)
| <commit_before>"""Setup module for txrudp."""
import codecs
from os import path
import sys
from setuptools import setup
_HERE = path.abspath(path.dirname(__file__))
with codecs.open(path.join(_HERE, 'README.rst'), encoding='utf-8') as f:
_LONG_DESCRIPTION = f.read()
setup(
name='txrudp',
version='0.4.0',
description='A Twisted extension implementing RUDP',
long_description=_LONG_DESCRIPTION,
url='https://github.com/Renelvon/txrudp',
author='Nikolaos Korasidis',
author_email='renelvon@gmail.com',
license='MIT',
classifiers=(
'Development Status :: 3 - Alpha',
'Framework :: Twisted',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: System :: Networking'
),
keywords='rudp twisted reliable',
packages=('txrudp', 'tests'),
install_requires=('enum34', 'protobuf', 'pynacl', 'twisted'),
tests_require=('coverage', 'nose', 'mock'),
test_suite='tests',
zip_safe=False
)
<commit_msg>Use nose to run the testsuite.<commit_after> | """Setup module for txrudp."""
import codecs
from os import path
import sys
from setuptools import setup
_HERE = path.abspath(path.dirname(__file__))
with codecs.open(path.join(_HERE, 'README.rst'), encoding='utf-8') as f:
_LONG_DESCRIPTION = f.read()
setup(
name='txrudp',
version='0.4.0',
description='A Twisted extension implementing RUDP',
long_description=_LONG_DESCRIPTION,
url='https://github.com/Renelvon/txrudp',
author='Nikolaos Korasidis',
author_email='renelvon@gmail.com',
license='MIT',
classifiers=(
'Development Status :: 3 - Alpha',
'Framework :: Twisted',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: System :: Networking'
),
keywords='rudp twisted reliable',
packages=('txrudp', 'tests'),
install_requires=('enum34', 'protobuf', 'pynacl', 'twisted'),
tests_require=('coverage', 'nose', 'mock'),
test_suite='nose.collector',
zip_safe=False
)
| """Setup module for txrudp."""
import codecs
from os import path
import sys
from setuptools import setup
_HERE = path.abspath(path.dirname(__file__))
with codecs.open(path.join(_HERE, 'README.rst'), encoding='utf-8') as f:
_LONG_DESCRIPTION = f.read()
setup(
name='txrudp',
version='0.4.0',
description='A Twisted extension implementing RUDP',
long_description=_LONG_DESCRIPTION,
url='https://github.com/Renelvon/txrudp',
author='Nikolaos Korasidis',
author_email='renelvon@gmail.com',
license='MIT',
classifiers=(
'Development Status :: 3 - Alpha',
'Framework :: Twisted',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: System :: Networking'
),
keywords='rudp twisted reliable',
packages=('txrudp', 'tests'),
install_requires=('enum34', 'protobuf', 'pynacl', 'twisted'),
tests_require=('coverage', 'nose', 'mock'),
test_suite='tests',
zip_safe=False
)
Use nose to run the testsuite."""Setup module for txrudp."""
import codecs
from os import path
import sys
from setuptools import setup
_HERE = path.abspath(path.dirname(__file__))
with codecs.open(path.join(_HERE, 'README.rst'), encoding='utf-8') as f:
_LONG_DESCRIPTION = f.read()
setup(
name='txrudp',
version='0.4.0',
description='A Twisted extension implementing RUDP',
long_description=_LONG_DESCRIPTION,
url='https://github.com/Renelvon/txrudp',
author='Nikolaos Korasidis',
author_email='renelvon@gmail.com',
license='MIT',
classifiers=(
'Development Status :: 3 - Alpha',
'Framework :: Twisted',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: System :: Networking'
),
keywords='rudp twisted reliable',
packages=('txrudp', 'tests'),
install_requires=('enum34', 'protobuf', 'pynacl', 'twisted'),
tests_require=('coverage', 'nose', 'mock'),
test_suite='nose.collector',
zip_safe=False
)
| <commit_before>"""Setup module for txrudp."""
import codecs
from os import path
import sys
from setuptools import setup
_HERE = path.abspath(path.dirname(__file__))
with codecs.open(path.join(_HERE, 'README.rst'), encoding='utf-8') as f:
_LONG_DESCRIPTION = f.read()
setup(
name='txrudp',
version='0.4.0',
description='A Twisted extension implementing RUDP',
long_description=_LONG_DESCRIPTION,
url='https://github.com/Renelvon/txrudp',
author='Nikolaos Korasidis',
author_email='renelvon@gmail.com',
license='MIT',
classifiers=(
'Development Status :: 3 - Alpha',
'Framework :: Twisted',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: System :: Networking'
),
keywords='rudp twisted reliable',
packages=('txrudp', 'tests'),
install_requires=('enum34', 'protobuf', 'pynacl', 'twisted'),
tests_require=('coverage', 'nose', 'mock'),
test_suite='tests',
zip_safe=False
)
<commit_msg>Use nose to run the testsuite.<commit_after>"""Setup module for txrudp."""
import codecs
from os import path
import sys
from setuptools import setup
_HERE = path.abspath(path.dirname(__file__))
with codecs.open(path.join(_HERE, 'README.rst'), encoding='utf-8') as f:
_LONG_DESCRIPTION = f.read()
setup(
name='txrudp',
version='0.4.0',
description='A Twisted extension implementing RUDP',
long_description=_LONG_DESCRIPTION,
url='https://github.com/Renelvon/txrudp',
author='Nikolaos Korasidis',
author_email='renelvon@gmail.com',
license='MIT',
classifiers=(
'Development Status :: 3 - Alpha',
'Framework :: Twisted',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: System :: Networking'
),
keywords='rudp twisted reliable',
packages=('txrudp', 'tests'),
install_requires=('enum34', 'protobuf', 'pynacl', 'twisted'),
tests_require=('coverage', 'nose', 'mock'),
test_suite='nose.collector',
zip_safe=False
)
|
68014f6e907df3711f14bae7e949a47081f5a0d0 | setup.py | setup.py | import os.path
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
# read README as the long description
readme = 'README' if os.path.exists('README') else 'README.md'
with open(readme, 'r') as f:
long_description = f.read()
setup(
name='spandex',
version='0.1dev',
description='Spatial Analysis and Data Exploration',
long_description=long_description,
author='Synthicity',
author_email='ejanowicz@synthicity.com',
license='BSD',
url='https://github.com/synthicity/spandex',
classifiers=[
'Development Status :: 4 - Beta',
'Programming Language :: Python :: 2.7',
'License :: OSI Approved :: BSD License'
],
packages=find_packages(exclude=['*.tests']),
install_requires=[
'gdal>=1.8.0',
'numpy>=1.8.0',
'pandas>=0.13.1',
'psycopg2>=2.5',
],
extras_require={
'rastertoolz': ['rasterio>=0.12', 'rasterstats>=0.4',
'shapely>=1.3.2']
}
)
| import os.path
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
# read README as the long description
readme = 'README' if os.path.exists('README') else 'README.md'
with open(readme, 'r') as f:
long_description = f.read()
setup(
name='spandex',
version='0.1dev',
description='Spatial Analysis and Data Exploration',
long_description=long_description,
author='Synthicity',
author_email='ejanowicz@synthicity.com',
license='BSD',
url='https://github.com/synthicity/spandex',
classifiers=[
'Development Status :: 4 - Beta',
'Programming Language :: Python :: 2.7',
'License :: OSI Approved :: BSD License'
],
packages=find_packages(exclude=['*.tests']),
install_requires=[
'gdal>=1.8.0',
'pandas>=0.13.1',
'psycopg2>=2.5',
],
extras_require={
'rastertoolz': ['numpy>=1.8.0', 'rasterio>=0.12', 'rasterstats>=0.4',
'shapely>=1.3.2']
}
)
| Move NumPy dependency to optional rastertoolz dependency | Move NumPy dependency to optional rastertoolz dependency
| Python | bsd-3-clause | SANDAG/spandex,UDST/spandex | import os.path
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
# read README as the long description
readme = 'README' if os.path.exists('README') else 'README.md'
with open(readme, 'r') as f:
long_description = f.read()
setup(
name='spandex',
version='0.1dev',
description='Spatial Analysis and Data Exploration',
long_description=long_description,
author='Synthicity',
author_email='ejanowicz@synthicity.com',
license='BSD',
url='https://github.com/synthicity/spandex',
classifiers=[
'Development Status :: 4 - Beta',
'Programming Language :: Python :: 2.7',
'License :: OSI Approved :: BSD License'
],
packages=find_packages(exclude=['*.tests']),
install_requires=[
'gdal>=1.8.0',
'numpy>=1.8.0',
'pandas>=0.13.1',
'psycopg2>=2.5',
],
extras_require={
'rastertoolz': ['rasterio>=0.12', 'rasterstats>=0.4',
'shapely>=1.3.2']
}
)
Move NumPy dependency to optional rastertoolz dependency | import os.path
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
# read README as the long description
readme = 'README' if os.path.exists('README') else 'README.md'
with open(readme, 'r') as f:
long_description = f.read()
setup(
name='spandex',
version='0.1dev',
description='Spatial Analysis and Data Exploration',
long_description=long_description,
author='Synthicity',
author_email='ejanowicz@synthicity.com',
license='BSD',
url='https://github.com/synthicity/spandex',
classifiers=[
'Development Status :: 4 - Beta',
'Programming Language :: Python :: 2.7',
'License :: OSI Approved :: BSD License'
],
packages=find_packages(exclude=['*.tests']),
install_requires=[
'gdal>=1.8.0',
'pandas>=0.13.1',
'psycopg2>=2.5',
],
extras_require={
'rastertoolz': ['numpy>=1.8.0', 'rasterio>=0.12', 'rasterstats>=0.4',
'shapely>=1.3.2']
}
)
| <commit_before>import os.path
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
# read README as the long description
readme = 'README' if os.path.exists('README') else 'README.md'
with open(readme, 'r') as f:
long_description = f.read()
setup(
name='spandex',
version='0.1dev',
description='Spatial Analysis and Data Exploration',
long_description=long_description,
author='Synthicity',
author_email='ejanowicz@synthicity.com',
license='BSD',
url='https://github.com/synthicity/spandex',
classifiers=[
'Development Status :: 4 - Beta',
'Programming Language :: Python :: 2.7',
'License :: OSI Approved :: BSD License'
],
packages=find_packages(exclude=['*.tests']),
install_requires=[
'gdal>=1.8.0',
'numpy>=1.8.0',
'pandas>=0.13.1',
'psycopg2>=2.5',
],
extras_require={
'rastertoolz': ['rasterio>=0.12', 'rasterstats>=0.4',
'shapely>=1.3.2']
}
)
<commit_msg>Move NumPy dependency to optional rastertoolz dependency<commit_after> | import os.path
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
# read README as the long description
readme = 'README' if os.path.exists('README') else 'README.md'
with open(readme, 'r') as f:
long_description = f.read()
setup(
name='spandex',
version='0.1dev',
description='Spatial Analysis and Data Exploration',
long_description=long_description,
author='Synthicity',
author_email='ejanowicz@synthicity.com',
license='BSD',
url='https://github.com/synthicity/spandex',
classifiers=[
'Development Status :: 4 - Beta',
'Programming Language :: Python :: 2.7',
'License :: OSI Approved :: BSD License'
],
packages=find_packages(exclude=['*.tests']),
install_requires=[
'gdal>=1.8.0',
'pandas>=0.13.1',
'psycopg2>=2.5',
],
extras_require={
'rastertoolz': ['numpy>=1.8.0', 'rasterio>=0.12', 'rasterstats>=0.4',
'shapely>=1.3.2']
}
)
| import os.path
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
# read README as the long description
readme = 'README' if os.path.exists('README') else 'README.md'
with open(readme, 'r') as f:
long_description = f.read()
setup(
name='spandex',
version='0.1dev',
description='Spatial Analysis and Data Exploration',
long_description=long_description,
author='Synthicity',
author_email='ejanowicz@synthicity.com',
license='BSD',
url='https://github.com/synthicity/spandex',
classifiers=[
'Development Status :: 4 - Beta',
'Programming Language :: Python :: 2.7',
'License :: OSI Approved :: BSD License'
],
packages=find_packages(exclude=['*.tests']),
install_requires=[
'gdal>=1.8.0',
'numpy>=1.8.0',
'pandas>=0.13.1',
'psycopg2>=2.5',
],
extras_require={
'rastertoolz': ['rasterio>=0.12', 'rasterstats>=0.4',
'shapely>=1.3.2']
}
)
Move NumPy dependency to optional rastertoolz dependencyimport os.path
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
# read README as the long description
readme = 'README' if os.path.exists('README') else 'README.md'
with open(readme, 'r') as f:
long_description = f.read()
setup(
name='spandex',
version='0.1dev',
description='Spatial Analysis and Data Exploration',
long_description=long_description,
author='Synthicity',
author_email='ejanowicz@synthicity.com',
license='BSD',
url='https://github.com/synthicity/spandex',
classifiers=[
'Development Status :: 4 - Beta',
'Programming Language :: Python :: 2.7',
'License :: OSI Approved :: BSD License'
],
packages=find_packages(exclude=['*.tests']),
install_requires=[
'gdal>=1.8.0',
'pandas>=0.13.1',
'psycopg2>=2.5',
],
extras_require={
'rastertoolz': ['numpy>=1.8.0', 'rasterio>=0.12', 'rasterstats>=0.4',
'shapely>=1.3.2']
}
)
| <commit_before>import os.path
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
# read README as the long description
readme = 'README' if os.path.exists('README') else 'README.md'
with open(readme, 'r') as f:
long_description = f.read()
setup(
name='spandex',
version='0.1dev',
description='Spatial Analysis and Data Exploration',
long_description=long_description,
author='Synthicity',
author_email='ejanowicz@synthicity.com',
license='BSD',
url='https://github.com/synthicity/spandex',
classifiers=[
'Development Status :: 4 - Beta',
'Programming Language :: Python :: 2.7',
'License :: OSI Approved :: BSD License'
],
packages=find_packages(exclude=['*.tests']),
install_requires=[
'gdal>=1.8.0',
'numpy>=1.8.0',
'pandas>=0.13.1',
'psycopg2>=2.5',
],
extras_require={
'rastertoolz': ['rasterio>=0.12', 'rasterstats>=0.4',
'shapely>=1.3.2']
}
)
<commit_msg>Move NumPy dependency to optional rastertoolz dependency<commit_after>import os.path
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
# read README as the long description
readme = 'README' if os.path.exists('README') else 'README.md'
with open(readme, 'r') as f:
long_description = f.read()
setup(
name='spandex',
version='0.1dev',
description='Spatial Analysis and Data Exploration',
long_description=long_description,
author='Synthicity',
author_email='ejanowicz@synthicity.com',
license='BSD',
url='https://github.com/synthicity/spandex',
classifiers=[
'Development Status :: 4 - Beta',
'Programming Language :: Python :: 2.7',
'License :: OSI Approved :: BSD License'
],
packages=find_packages(exclude=['*.tests']),
install_requires=[
'gdal>=1.8.0',
'pandas>=0.13.1',
'psycopg2>=2.5',
],
extras_require={
'rastertoolz': ['numpy>=1.8.0', 'rasterio>=0.12', 'rasterstats>=0.4',
'shapely>=1.3.2']
}
)
|
24bbd5dea392bc7206a939941f43a878baaf61dd | setup.py | setup.py | from setuptools import setup
def readme():
with open('README.rst') as f:
return f.read()
setup(name='housecanary',
version='0.6.2',
description='Client Wrapper for the HouseCanary API',
long_description=readme(),
url='http://github.com/housecanary/hc-api-python',
author='HouseCanary',
author_email='techops@housecanary.com',
license='MIT',
packages=['housecanary', 'housecanary.excel'],
install_requires=['requests', 'docopt', 'openpyxl'],
zip_safe=False,
test_suite='nose.collector',
tests_require=['nose', 'mock'],
entry_points={
'console_scripts': [
'hc_api_excel_concat=housecanary.hc_api_excel_concat.hc_api_excel_concat:main',
'hc_api_export=housecanary.hc_api_export.hc_api_export:main'
]
})
| from setuptools import setup
def readme():
with open('README.rst', 'rb') as f:
return f.read().decode('UTF-8')
setup(name='housecanary',
version='0.6.2',
description='Client Wrapper for the HouseCanary API',
long_description=readme(),
url='http://github.com/housecanary/hc-api-python',
author='HouseCanary',
author_email='techops@housecanary.com',
license='MIT',
packages=['housecanary', 'housecanary.excel'],
install_requires=['requests', 'docopt', 'openpyxl'],
zip_safe=False,
test_suite='nose.collector',
tests_require=['nose', 'mock'],
entry_points={
'console_scripts': [
'hc_api_excel_concat=housecanary.hc_api_excel_concat.hc_api_excel_concat:main',
'hc_api_export=housecanary.hc_api_export.hc_api_export:main'
]
})
| Fix encoding error happening on some Windows servers | Fix encoding error happening on some Windows servers
Fix error causing: “UnicodeDecodeError: 'charmap' codec can't decode
byte 0x9d”
| Python | mit | housecanary/hc-api-python | from setuptools import setup
def readme():
with open('README.rst') as f:
return f.read()
setup(name='housecanary',
version='0.6.2',
description='Client Wrapper for the HouseCanary API',
long_description=readme(),
url='http://github.com/housecanary/hc-api-python',
author='HouseCanary',
author_email='techops@housecanary.com',
license='MIT',
packages=['housecanary', 'housecanary.excel'],
install_requires=['requests', 'docopt', 'openpyxl'],
zip_safe=False,
test_suite='nose.collector',
tests_require=['nose', 'mock'],
entry_points={
'console_scripts': [
'hc_api_excel_concat=housecanary.hc_api_excel_concat.hc_api_excel_concat:main',
'hc_api_export=housecanary.hc_api_export.hc_api_export:main'
]
})
Fix encoding error happening on some Windows servers
Fix error causing: “UnicodeDecodeError: 'charmap' codec can't decode
byte 0x9d” | from setuptools import setup
def readme():
with open('README.rst', 'rb') as f:
return f.read().decode('UTF-8')
setup(name='housecanary',
version='0.6.2',
description='Client Wrapper for the HouseCanary API',
long_description=readme(),
url='http://github.com/housecanary/hc-api-python',
author='HouseCanary',
author_email='techops@housecanary.com',
license='MIT',
packages=['housecanary', 'housecanary.excel'],
install_requires=['requests', 'docopt', 'openpyxl'],
zip_safe=False,
test_suite='nose.collector',
tests_require=['nose', 'mock'],
entry_points={
'console_scripts': [
'hc_api_excel_concat=housecanary.hc_api_excel_concat.hc_api_excel_concat:main',
'hc_api_export=housecanary.hc_api_export.hc_api_export:main'
]
})
| <commit_before>from setuptools import setup
def readme():
with open('README.rst') as f:
return f.read()
setup(name='housecanary',
version='0.6.2',
description='Client Wrapper for the HouseCanary API',
long_description=readme(),
url='http://github.com/housecanary/hc-api-python',
author='HouseCanary',
author_email='techops@housecanary.com',
license='MIT',
packages=['housecanary', 'housecanary.excel'],
install_requires=['requests', 'docopt', 'openpyxl'],
zip_safe=False,
test_suite='nose.collector',
tests_require=['nose', 'mock'],
entry_points={
'console_scripts': [
'hc_api_excel_concat=housecanary.hc_api_excel_concat.hc_api_excel_concat:main',
'hc_api_export=housecanary.hc_api_export.hc_api_export:main'
]
})
<commit_msg>Fix encoding error happening on some Windows servers
Fix error causing: “UnicodeDecodeError: 'charmap' codec can't decode
byte 0x9d”<commit_after> | from setuptools import setup
def readme():
with open('README.rst', 'rb') as f:
return f.read().decode('UTF-8')
setup(name='housecanary',
version='0.6.2',
description='Client Wrapper for the HouseCanary API',
long_description=readme(),
url='http://github.com/housecanary/hc-api-python',
author='HouseCanary',
author_email='techops@housecanary.com',
license='MIT',
packages=['housecanary', 'housecanary.excel'],
install_requires=['requests', 'docopt', 'openpyxl'],
zip_safe=False,
test_suite='nose.collector',
tests_require=['nose', 'mock'],
entry_points={
'console_scripts': [
'hc_api_excel_concat=housecanary.hc_api_excel_concat.hc_api_excel_concat:main',
'hc_api_export=housecanary.hc_api_export.hc_api_export:main'
]
})
| from setuptools import setup
def readme():
with open('README.rst') as f:
return f.read()
setup(name='housecanary',
version='0.6.2',
description='Client Wrapper for the HouseCanary API',
long_description=readme(),
url='http://github.com/housecanary/hc-api-python',
author='HouseCanary',
author_email='techops@housecanary.com',
license='MIT',
packages=['housecanary', 'housecanary.excel'],
install_requires=['requests', 'docopt', 'openpyxl'],
zip_safe=False,
test_suite='nose.collector',
tests_require=['nose', 'mock'],
entry_points={
'console_scripts': [
'hc_api_excel_concat=housecanary.hc_api_excel_concat.hc_api_excel_concat:main',
'hc_api_export=housecanary.hc_api_export.hc_api_export:main'
]
})
Fix encoding error happening on some Windows servers
Fix error causing: “UnicodeDecodeError: 'charmap' codec can't decode
byte 0x9d”from setuptools import setup
def readme():
with open('README.rst', 'rb') as f:
return f.read().decode('UTF-8')
setup(name='housecanary',
version='0.6.2',
description='Client Wrapper for the HouseCanary API',
long_description=readme(),
url='http://github.com/housecanary/hc-api-python',
author='HouseCanary',
author_email='techops@housecanary.com',
license='MIT',
packages=['housecanary', 'housecanary.excel'],
install_requires=['requests', 'docopt', 'openpyxl'],
zip_safe=False,
test_suite='nose.collector',
tests_require=['nose', 'mock'],
entry_points={
'console_scripts': [
'hc_api_excel_concat=housecanary.hc_api_excel_concat.hc_api_excel_concat:main',
'hc_api_export=housecanary.hc_api_export.hc_api_export:main'
]
})
| <commit_before>from setuptools import setup
def readme():
with open('README.rst') as f:
return f.read()
setup(name='housecanary',
version='0.6.2',
description='Client Wrapper for the HouseCanary API',
long_description=readme(),
url='http://github.com/housecanary/hc-api-python',
author='HouseCanary',
author_email='techops@housecanary.com',
license='MIT',
packages=['housecanary', 'housecanary.excel'],
install_requires=['requests', 'docopt', 'openpyxl'],
zip_safe=False,
test_suite='nose.collector',
tests_require=['nose', 'mock'],
entry_points={
'console_scripts': [
'hc_api_excel_concat=housecanary.hc_api_excel_concat.hc_api_excel_concat:main',
'hc_api_export=housecanary.hc_api_export.hc_api_export:main'
]
})
<commit_msg>Fix encoding error happening on some Windows servers
Fix error causing: “UnicodeDecodeError: 'charmap' codec can't decode
byte 0x9d”<commit_after>from setuptools import setup
def readme():
with open('README.rst', 'rb') as f:
return f.read().decode('UTF-8')
setup(name='housecanary',
version='0.6.2',
description='Client Wrapper for the HouseCanary API',
long_description=readme(),
url='http://github.com/housecanary/hc-api-python',
author='HouseCanary',
author_email='techops@housecanary.com',
license='MIT',
packages=['housecanary', 'housecanary.excel'],
install_requires=['requests', 'docopt', 'openpyxl'],
zip_safe=False,
test_suite='nose.collector',
tests_require=['nose', 'mock'],
entry_points={
'console_scripts': [
'hc_api_excel_concat=housecanary.hc_api_excel_concat.hc_api_excel_concat:main',
'hc_api_export=housecanary.hc_api_export.hc_api_export:main'
]
})
|
dcf766b0423e66927ab36f09716ad1736d54a7ab | 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, find_packages
PACKAGE_VERSION = '0.1'
deps = ['flask',
'manifestparser',
'mongoengine',
'mozillapulse']
setup(name='test-informant',
version=PACKAGE_VERSION,
description='A web service for monitoring and reporting the state of test manifests.',
long_description='See https://github.com/ahal/test-informant',
classifiers=['Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
],
keywords='mozilla',
author='Andrew Halberstadt',
author_email='ahalberstadt@mozilla.com',
url='https://github.com/ahal/test-informant',
license='MPL 2.0',
packages=find_packages(),
include_package_data=True,
zip_safe=False,
install_requires=deps)
| # 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, find_packages
PACKAGE_VERSION = '0.1'
deps = ['flask',
'manifestparser',
'mongoengine',
'mozfile',
'mozillapulse']
setup(name='test-informant',
version=PACKAGE_VERSION,
description='A web service for monitoring and reporting the state of test manifests.',
long_description='See https://github.com/ahal/test-informant',
classifiers=['Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
],
keywords='mozilla',
author='Andrew Halberstadt',
author_email='ahalberstadt@mozilla.com',
url='https://github.com/ahal/test-informant',
license='MPL 2.0',
packages=find_packages(),
include_package_data=True,
zip_safe=False,
install_requires=deps)
| Add mozfile to the dependency list | Add mozfile to the dependency list
| Python | mpl-2.0 | mozilla/test-informant,ahal/test-informant,ahal/test-informant,mozilla/test-informant | # 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, find_packages
PACKAGE_VERSION = '0.1'
deps = ['flask',
'manifestparser',
'mongoengine',
'mozillapulse']
setup(name='test-informant',
version=PACKAGE_VERSION,
description='A web service for monitoring and reporting the state of test manifests.',
long_description='See https://github.com/ahal/test-informant',
classifiers=['Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
],
keywords='mozilla',
author='Andrew Halberstadt',
author_email='ahalberstadt@mozilla.com',
url='https://github.com/ahal/test-informant',
license='MPL 2.0',
packages=find_packages(),
include_package_data=True,
zip_safe=False,
install_requires=deps)
Add mozfile to the dependency list | # 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, find_packages
PACKAGE_VERSION = '0.1'
deps = ['flask',
'manifestparser',
'mongoengine',
'mozfile',
'mozillapulse']
setup(name='test-informant',
version=PACKAGE_VERSION,
description='A web service for monitoring and reporting the state of test manifests.',
long_description='See https://github.com/ahal/test-informant',
classifiers=['Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
],
keywords='mozilla',
author='Andrew Halberstadt',
author_email='ahalberstadt@mozilla.com',
url='https://github.com/ahal/test-informant',
license='MPL 2.0',
packages=find_packages(),
include_package_data=True,
zip_safe=False,
install_requires=deps)
| <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, find_packages
PACKAGE_VERSION = '0.1'
deps = ['flask',
'manifestparser',
'mongoengine',
'mozillapulse']
setup(name='test-informant',
version=PACKAGE_VERSION,
description='A web service for monitoring and reporting the state of test manifests.',
long_description='See https://github.com/ahal/test-informant',
classifiers=['Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
],
keywords='mozilla',
author='Andrew Halberstadt',
author_email='ahalberstadt@mozilla.com',
url='https://github.com/ahal/test-informant',
license='MPL 2.0',
packages=find_packages(),
include_package_data=True,
zip_safe=False,
install_requires=deps)
<commit_msg>Add mozfile to the dependency list<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, find_packages
PACKAGE_VERSION = '0.1'
deps = ['flask',
'manifestparser',
'mongoengine',
'mozfile',
'mozillapulse']
setup(name='test-informant',
version=PACKAGE_VERSION,
description='A web service for monitoring and reporting the state of test manifests.',
long_description='See https://github.com/ahal/test-informant',
classifiers=['Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
],
keywords='mozilla',
author='Andrew Halberstadt',
author_email='ahalberstadt@mozilla.com',
url='https://github.com/ahal/test-informant',
license='MPL 2.0',
packages=find_packages(),
include_package_data=True,
zip_safe=False,
install_requires=deps)
| # 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, find_packages
PACKAGE_VERSION = '0.1'
deps = ['flask',
'manifestparser',
'mongoengine',
'mozillapulse']
setup(name='test-informant',
version=PACKAGE_VERSION,
description='A web service for monitoring and reporting the state of test manifests.',
long_description='See https://github.com/ahal/test-informant',
classifiers=['Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
],
keywords='mozilla',
author='Andrew Halberstadt',
author_email='ahalberstadt@mozilla.com',
url='https://github.com/ahal/test-informant',
license='MPL 2.0',
packages=find_packages(),
include_package_data=True,
zip_safe=False,
install_requires=deps)
Add mozfile to the dependency list# 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, find_packages
PACKAGE_VERSION = '0.1'
deps = ['flask',
'manifestparser',
'mongoengine',
'mozfile',
'mozillapulse']
setup(name='test-informant',
version=PACKAGE_VERSION,
description='A web service for monitoring and reporting the state of test manifests.',
long_description='See https://github.com/ahal/test-informant',
classifiers=['Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
],
keywords='mozilla',
author='Andrew Halberstadt',
author_email='ahalberstadt@mozilla.com',
url='https://github.com/ahal/test-informant',
license='MPL 2.0',
packages=find_packages(),
include_package_data=True,
zip_safe=False,
install_requires=deps)
| <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, find_packages
PACKAGE_VERSION = '0.1'
deps = ['flask',
'manifestparser',
'mongoengine',
'mozillapulse']
setup(name='test-informant',
version=PACKAGE_VERSION,
description='A web service for monitoring and reporting the state of test manifests.',
long_description='See https://github.com/ahal/test-informant',
classifiers=['Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
],
keywords='mozilla',
author='Andrew Halberstadt',
author_email='ahalberstadt@mozilla.com',
url='https://github.com/ahal/test-informant',
license='MPL 2.0',
packages=find_packages(),
include_package_data=True,
zip_safe=False,
install_requires=deps)
<commit_msg>Add mozfile to the dependency list<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, find_packages
PACKAGE_VERSION = '0.1'
deps = ['flask',
'manifestparser',
'mongoengine',
'mozfile',
'mozillapulse']
setup(name='test-informant',
version=PACKAGE_VERSION,
description='A web service for monitoring and reporting the state of test manifests.',
long_description='See https://github.com/ahal/test-informant',
classifiers=['Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
],
keywords='mozilla',
author='Andrew Halberstadt',
author_email='ahalberstadt@mozilla.com',
url='https://github.com/ahal/test-informant',
license='MPL 2.0',
packages=find_packages(),
include_package_data=True,
zip_safe=False,
install_requires=deps)
|
ea66f16926b379cad3379440658a759e82256225 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup
setup(name='Robot Daemon',
version='1.0',
description='Daemon for vision code for Source Bots',
author='SourceBots',
author_email='',
packages=['robotd'],
setup_requires=["cffi>=1.0.0"],
ffi_modules=["robotd/vision/apriltag/apriltag_build.py:ffibuilder"],
install_requires=['pyudev', 'pyserial', 'pygame', 'Pillow', "cffi>=1.0.0", 'numpy'],
)
| #!/usr/bin/env python
from setuptools import setup
setup(name='Robot Daemon',
version='1.0',
description='Daemon for vision code for Source Bots',
author='SourceBots',
author_email='',
packages=['robotd'],
setup_requires=["cffi>=0.8.6"],
ffi_modules=["robotd/vision/apriltag/apriltag_build.py:ffibuilder"],
install_requires=['pyudev', 'pyserial', 'pygame', 'Pillow', "cffi>=1.0.0", 'numpy'],
)
| Decrease the bound on cffi | Decrease the bound on cffi
| Python | mit | sourcebots/robotd,sourcebots/robotd | #!/usr/bin/env python
from setuptools import setup
setup(name='Robot Daemon',
version='1.0',
description='Daemon for vision code for Source Bots',
author='SourceBots',
author_email='',
packages=['robotd'],
setup_requires=["cffi>=1.0.0"],
ffi_modules=["robotd/vision/apriltag/apriltag_build.py:ffibuilder"],
install_requires=['pyudev', 'pyserial', 'pygame', 'Pillow', "cffi>=1.0.0", 'numpy'],
)
Decrease the bound on cffi | #!/usr/bin/env python
from setuptools import setup
setup(name='Robot Daemon',
version='1.0',
description='Daemon for vision code for Source Bots',
author='SourceBots',
author_email='',
packages=['robotd'],
setup_requires=["cffi>=0.8.6"],
ffi_modules=["robotd/vision/apriltag/apriltag_build.py:ffibuilder"],
install_requires=['pyudev', 'pyserial', 'pygame', 'Pillow', "cffi>=1.0.0", 'numpy'],
)
| <commit_before>#!/usr/bin/env python
from setuptools import setup
setup(name='Robot Daemon',
version='1.0',
description='Daemon for vision code for Source Bots',
author='SourceBots',
author_email='',
packages=['robotd'],
setup_requires=["cffi>=1.0.0"],
ffi_modules=["robotd/vision/apriltag/apriltag_build.py:ffibuilder"],
install_requires=['pyudev', 'pyserial', 'pygame', 'Pillow', "cffi>=1.0.0", 'numpy'],
)
<commit_msg>Decrease the bound on cffi<commit_after> | #!/usr/bin/env python
from setuptools import setup
setup(name='Robot Daemon',
version='1.0',
description='Daemon for vision code for Source Bots',
author='SourceBots',
author_email='',
packages=['robotd'],
setup_requires=["cffi>=0.8.6"],
ffi_modules=["robotd/vision/apriltag/apriltag_build.py:ffibuilder"],
install_requires=['pyudev', 'pyserial', 'pygame', 'Pillow', "cffi>=1.0.0", 'numpy'],
)
| #!/usr/bin/env python
from setuptools import setup
setup(name='Robot Daemon',
version='1.0',
description='Daemon for vision code for Source Bots',
author='SourceBots',
author_email='',
packages=['robotd'],
setup_requires=["cffi>=1.0.0"],
ffi_modules=["robotd/vision/apriltag/apriltag_build.py:ffibuilder"],
install_requires=['pyudev', 'pyserial', 'pygame', 'Pillow', "cffi>=1.0.0", 'numpy'],
)
Decrease the bound on cffi#!/usr/bin/env python
from setuptools import setup
setup(name='Robot Daemon',
version='1.0',
description='Daemon for vision code for Source Bots',
author='SourceBots',
author_email='',
packages=['robotd'],
setup_requires=["cffi>=0.8.6"],
ffi_modules=["robotd/vision/apriltag/apriltag_build.py:ffibuilder"],
install_requires=['pyudev', 'pyserial', 'pygame', 'Pillow', "cffi>=1.0.0", 'numpy'],
)
| <commit_before>#!/usr/bin/env python
from setuptools import setup
setup(name='Robot Daemon',
version='1.0',
description='Daemon for vision code for Source Bots',
author='SourceBots',
author_email='',
packages=['robotd'],
setup_requires=["cffi>=1.0.0"],
ffi_modules=["robotd/vision/apriltag/apriltag_build.py:ffibuilder"],
install_requires=['pyudev', 'pyserial', 'pygame', 'Pillow', "cffi>=1.0.0", 'numpy'],
)
<commit_msg>Decrease the bound on cffi<commit_after>#!/usr/bin/env python
from setuptools import setup
setup(name='Robot Daemon',
version='1.0',
description='Daemon for vision code for Source Bots',
author='SourceBots',
author_email='',
packages=['robotd'],
setup_requires=["cffi>=0.8.6"],
ffi_modules=["robotd/vision/apriltag/apriltag_build.py:ffibuilder"],
install_requires=['pyudev', 'pyserial', 'pygame', 'Pillow', "cffi>=1.0.0", 'numpy'],
)
|
c4266e2de376475974dd20c66da747d2e23182b9 | setup.py | setup.py | __doc__ = """
Manipulate audio with an simple and easy high level interface.
See the README file for details, usage info, and a list of gotchas.
"""
from setuptools import setup
setup(
name='pydub',
version='0.10.0',
author='James Robert',
author_email='jiaaro@gmail.com',
description='Manipulate audio with an simple and easy high level interface',
license='MIT',
keywords='audio sound high-level',
url='http://pydub.com',
packages=['pydub'],
long_description=__doc__,
classifiers=[
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
"Topic :: Multimedia :: Sound/Audio",
"Topic :: Multimedia :: Sound/Audio :: Analysis",
"Topic :: Multimedia :: Sound/Audio :: Conversion",
"Topic :: Multimedia :: Sound/Audio :: Editors",
"Topic :: Multimedia :: Sound/Audio :: Mixers",
"Topic :: Software Development :: Libraries",
'Topic :: Utilities',
]
)
| __doc__ = """
Manipulate audio with an simple and easy high level interface.
See the README file for details, usage info, and a list of gotchas.
"""
from setuptools import setup
setup(
name='pydub',
version='0.11.0',
author='James Robert',
author_email='jiaaro@gmail.com',
description='Manipulate audio with an simple and easy high level interface',
license='MIT',
keywords='audio sound high-level',
url='http://pydub.com',
packages=['pydub'],
long_description=__doc__,
classifiers=[
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
"Topic :: Multimedia :: Sound/Audio",
"Topic :: Multimedia :: Sound/Audio :: Analysis",
"Topic :: Multimedia :: Sound/Audio :: Conversion",
"Topic :: Multimedia :: Sound/Audio :: Editors",
"Topic :: Multimedia :: Sound/Audio :: Mixers",
"Topic :: Software Development :: Libraries",
'Topic :: Utilities',
]
)
| Increment version for new max_dBFS property | Increment version for new max_dBFS property | Python | mit | Geoion/pydub,jiaaro/pydub,cbelth/pyMusic,miguelgrinberg/pydub,joshrobo/pydub,sgml/pydub | __doc__ = """
Manipulate audio with an simple and easy high level interface.
See the README file for details, usage info, and a list of gotchas.
"""
from setuptools import setup
setup(
name='pydub',
version='0.10.0',
author='James Robert',
author_email='jiaaro@gmail.com',
description='Manipulate audio with an simple and easy high level interface',
license='MIT',
keywords='audio sound high-level',
url='http://pydub.com',
packages=['pydub'],
long_description=__doc__,
classifiers=[
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
"Topic :: Multimedia :: Sound/Audio",
"Topic :: Multimedia :: Sound/Audio :: Analysis",
"Topic :: Multimedia :: Sound/Audio :: Conversion",
"Topic :: Multimedia :: Sound/Audio :: Editors",
"Topic :: Multimedia :: Sound/Audio :: Mixers",
"Topic :: Software Development :: Libraries",
'Topic :: Utilities',
]
)
Increment version for new max_dBFS property | __doc__ = """
Manipulate audio with an simple and easy high level interface.
See the README file for details, usage info, and a list of gotchas.
"""
from setuptools import setup
setup(
name='pydub',
version='0.11.0',
author='James Robert',
author_email='jiaaro@gmail.com',
description='Manipulate audio with an simple and easy high level interface',
license='MIT',
keywords='audio sound high-level',
url='http://pydub.com',
packages=['pydub'],
long_description=__doc__,
classifiers=[
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
"Topic :: Multimedia :: Sound/Audio",
"Topic :: Multimedia :: Sound/Audio :: Analysis",
"Topic :: Multimedia :: Sound/Audio :: Conversion",
"Topic :: Multimedia :: Sound/Audio :: Editors",
"Topic :: Multimedia :: Sound/Audio :: Mixers",
"Topic :: Software Development :: Libraries",
'Topic :: Utilities',
]
)
| <commit_before>__doc__ = """
Manipulate audio with an simple and easy high level interface.
See the README file for details, usage info, and a list of gotchas.
"""
from setuptools import setup
setup(
name='pydub',
version='0.10.0',
author='James Robert',
author_email='jiaaro@gmail.com',
description='Manipulate audio with an simple and easy high level interface',
license='MIT',
keywords='audio sound high-level',
url='http://pydub.com',
packages=['pydub'],
long_description=__doc__,
classifiers=[
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
"Topic :: Multimedia :: Sound/Audio",
"Topic :: Multimedia :: Sound/Audio :: Analysis",
"Topic :: Multimedia :: Sound/Audio :: Conversion",
"Topic :: Multimedia :: Sound/Audio :: Editors",
"Topic :: Multimedia :: Sound/Audio :: Mixers",
"Topic :: Software Development :: Libraries",
'Topic :: Utilities',
]
)
<commit_msg>Increment version for new max_dBFS property<commit_after> | __doc__ = """
Manipulate audio with an simple and easy high level interface.
See the README file for details, usage info, and a list of gotchas.
"""
from setuptools import setup
setup(
name='pydub',
version='0.11.0',
author='James Robert',
author_email='jiaaro@gmail.com',
description='Manipulate audio with an simple and easy high level interface',
license='MIT',
keywords='audio sound high-level',
url='http://pydub.com',
packages=['pydub'],
long_description=__doc__,
classifiers=[
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
"Topic :: Multimedia :: Sound/Audio",
"Topic :: Multimedia :: Sound/Audio :: Analysis",
"Topic :: Multimedia :: Sound/Audio :: Conversion",
"Topic :: Multimedia :: Sound/Audio :: Editors",
"Topic :: Multimedia :: Sound/Audio :: Mixers",
"Topic :: Software Development :: Libraries",
'Topic :: Utilities',
]
)
| __doc__ = """
Manipulate audio with an simple and easy high level interface.
See the README file for details, usage info, and a list of gotchas.
"""
from setuptools import setup
setup(
name='pydub',
version='0.10.0',
author='James Robert',
author_email='jiaaro@gmail.com',
description='Manipulate audio with an simple and easy high level interface',
license='MIT',
keywords='audio sound high-level',
url='http://pydub.com',
packages=['pydub'],
long_description=__doc__,
classifiers=[
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
"Topic :: Multimedia :: Sound/Audio",
"Topic :: Multimedia :: Sound/Audio :: Analysis",
"Topic :: Multimedia :: Sound/Audio :: Conversion",
"Topic :: Multimedia :: Sound/Audio :: Editors",
"Topic :: Multimedia :: Sound/Audio :: Mixers",
"Topic :: Software Development :: Libraries",
'Topic :: Utilities',
]
)
Increment version for new max_dBFS property__doc__ = """
Manipulate audio with an simple and easy high level interface.
See the README file for details, usage info, and a list of gotchas.
"""
from setuptools import setup
setup(
name='pydub',
version='0.11.0',
author='James Robert',
author_email='jiaaro@gmail.com',
description='Manipulate audio with an simple and easy high level interface',
license='MIT',
keywords='audio sound high-level',
url='http://pydub.com',
packages=['pydub'],
long_description=__doc__,
classifiers=[
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
"Topic :: Multimedia :: Sound/Audio",
"Topic :: Multimedia :: Sound/Audio :: Analysis",
"Topic :: Multimedia :: Sound/Audio :: Conversion",
"Topic :: Multimedia :: Sound/Audio :: Editors",
"Topic :: Multimedia :: Sound/Audio :: Mixers",
"Topic :: Software Development :: Libraries",
'Topic :: Utilities',
]
)
| <commit_before>__doc__ = """
Manipulate audio with an simple and easy high level interface.
See the README file for details, usage info, and a list of gotchas.
"""
from setuptools import setup
setup(
name='pydub',
version='0.10.0',
author='James Robert',
author_email='jiaaro@gmail.com',
description='Manipulate audio with an simple and easy high level interface',
license='MIT',
keywords='audio sound high-level',
url='http://pydub.com',
packages=['pydub'],
long_description=__doc__,
classifiers=[
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
"Topic :: Multimedia :: Sound/Audio",
"Topic :: Multimedia :: Sound/Audio :: Analysis",
"Topic :: Multimedia :: Sound/Audio :: Conversion",
"Topic :: Multimedia :: Sound/Audio :: Editors",
"Topic :: Multimedia :: Sound/Audio :: Mixers",
"Topic :: Software Development :: Libraries",
'Topic :: Utilities',
]
)
<commit_msg>Increment version for new max_dBFS property<commit_after>__doc__ = """
Manipulate audio with an simple and easy high level interface.
See the README file for details, usage info, and a list of gotchas.
"""
from setuptools import setup
setup(
name='pydub',
version='0.11.0',
author='James Robert',
author_email='jiaaro@gmail.com',
description='Manipulate audio with an simple and easy high level interface',
license='MIT',
keywords='audio sound high-level',
url='http://pydub.com',
packages=['pydub'],
long_description=__doc__,
classifiers=[
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
"Topic :: Multimedia :: Sound/Audio",
"Topic :: Multimedia :: Sound/Audio :: Analysis",
"Topic :: Multimedia :: Sound/Audio :: Conversion",
"Topic :: Multimedia :: Sound/Audio :: Editors",
"Topic :: Multimedia :: Sound/Audio :: Mixers",
"Topic :: Software Development :: Libraries",
'Topic :: Utilities',
]
)
|
825b946ea1a10041c2cfc2e711e05d57d22ff349 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name="openslides-gui",
version="1.0.0dev1",
description="GUI frontend for openslides",
long_description="", # TODO
url='http://openslides.org',
author='OpenSlides-Team, see AUTHORS',
author_email='support@openslides.org',
license='MIT',
keywords='OpenSlides',
classifiers=[
# TODO: fill those
],
packages=find_packages(),
include_package_data=True,
install_requires=[
"openslides",
"wxPython-Phoenix",
"psutil",
],
package_data={
"openslides_gui": [
"data/openslides.ico",
"data/openslides-logo_wide.png",
],
},
entry_points={
"gui_scripts": [
"openslides-gui=openslides_gui.gui:main",
],
}
)
| from setuptools import setup, find_packages
setup(
name="openslides-gui",
version="1.0.0dev1",
description="GUI frontend for openslides",
long_description="", # TODO
url='http://openslides.org',
author='OpenSlides-Team, see AUTHORS',
author_email='support@openslides.org',
license='MIT',
keywords='OpenSlides',
classifiers=[
# TODO: fill those
],
packages=find_packages(),
install_requires=[
"openslides",
"wxPython-Phoenix",
"psutil",
],
package_data={
"openslides_gui": [
"data/openslides.ico",
"data/openslides-logo_wide.png",
],
},
entry_points={
"gui_scripts": [
"openslides-gui=openslides_gui.gui:main",
],
}
)
| Fix packaging of data files | Fix packaging of data files
| Python | mit | OpenSlides/openslides-gui,emanuelschuetze/openslides-gui | from setuptools import setup, find_packages
setup(
name="openslides-gui",
version="1.0.0dev1",
description="GUI frontend for openslides",
long_description="", # TODO
url='http://openslides.org',
author='OpenSlides-Team, see AUTHORS',
author_email='support@openslides.org',
license='MIT',
keywords='OpenSlides',
classifiers=[
# TODO: fill those
],
packages=find_packages(),
include_package_data=True,
install_requires=[
"openslides",
"wxPython-Phoenix",
"psutil",
],
package_data={
"openslides_gui": [
"data/openslides.ico",
"data/openslides-logo_wide.png",
],
},
entry_points={
"gui_scripts": [
"openslides-gui=openslides_gui.gui:main",
],
}
)
Fix packaging of data files | from setuptools import setup, find_packages
setup(
name="openslides-gui",
version="1.0.0dev1",
description="GUI frontend for openslides",
long_description="", # TODO
url='http://openslides.org',
author='OpenSlides-Team, see AUTHORS',
author_email='support@openslides.org',
license='MIT',
keywords='OpenSlides',
classifiers=[
# TODO: fill those
],
packages=find_packages(),
install_requires=[
"openslides",
"wxPython-Phoenix",
"psutil",
],
package_data={
"openslides_gui": [
"data/openslides.ico",
"data/openslides-logo_wide.png",
],
},
entry_points={
"gui_scripts": [
"openslides-gui=openslides_gui.gui:main",
],
}
)
| <commit_before>from setuptools import setup, find_packages
setup(
name="openslides-gui",
version="1.0.0dev1",
description="GUI frontend for openslides",
long_description="", # TODO
url='http://openslides.org',
author='OpenSlides-Team, see AUTHORS',
author_email='support@openslides.org',
license='MIT',
keywords='OpenSlides',
classifiers=[
# TODO: fill those
],
packages=find_packages(),
include_package_data=True,
install_requires=[
"openslides",
"wxPython-Phoenix",
"psutil",
],
package_data={
"openslides_gui": [
"data/openslides.ico",
"data/openslides-logo_wide.png",
],
},
entry_points={
"gui_scripts": [
"openslides-gui=openslides_gui.gui:main",
],
}
)
<commit_msg>Fix packaging of data files<commit_after> | from setuptools import setup, find_packages
setup(
name="openslides-gui",
version="1.0.0dev1",
description="GUI frontend for openslides",
long_description="", # TODO
url='http://openslides.org',
author='OpenSlides-Team, see AUTHORS',
author_email='support@openslides.org',
license='MIT',
keywords='OpenSlides',
classifiers=[
# TODO: fill those
],
packages=find_packages(),
install_requires=[
"openslides",
"wxPython-Phoenix",
"psutil",
],
package_data={
"openslides_gui": [
"data/openslides.ico",
"data/openslides-logo_wide.png",
],
},
entry_points={
"gui_scripts": [
"openslides-gui=openslides_gui.gui:main",
],
}
)
| from setuptools import setup, find_packages
setup(
name="openslides-gui",
version="1.0.0dev1",
description="GUI frontend for openslides",
long_description="", # TODO
url='http://openslides.org',
author='OpenSlides-Team, see AUTHORS',
author_email='support@openslides.org',
license='MIT',
keywords='OpenSlides',
classifiers=[
# TODO: fill those
],
packages=find_packages(),
include_package_data=True,
install_requires=[
"openslides",
"wxPython-Phoenix",
"psutil",
],
package_data={
"openslides_gui": [
"data/openslides.ico",
"data/openslides-logo_wide.png",
],
},
entry_points={
"gui_scripts": [
"openslides-gui=openslides_gui.gui:main",
],
}
)
Fix packaging of data filesfrom setuptools import setup, find_packages
setup(
name="openslides-gui",
version="1.0.0dev1",
description="GUI frontend for openslides",
long_description="", # TODO
url='http://openslides.org',
author='OpenSlides-Team, see AUTHORS',
author_email='support@openslides.org',
license='MIT',
keywords='OpenSlides',
classifiers=[
# TODO: fill those
],
packages=find_packages(),
install_requires=[
"openslides",
"wxPython-Phoenix",
"psutil",
],
package_data={
"openslides_gui": [
"data/openslides.ico",
"data/openslides-logo_wide.png",
],
},
entry_points={
"gui_scripts": [
"openslides-gui=openslides_gui.gui:main",
],
}
)
| <commit_before>from setuptools import setup, find_packages
setup(
name="openslides-gui",
version="1.0.0dev1",
description="GUI frontend for openslides",
long_description="", # TODO
url='http://openslides.org',
author='OpenSlides-Team, see AUTHORS',
author_email='support@openslides.org',
license='MIT',
keywords='OpenSlides',
classifiers=[
# TODO: fill those
],
packages=find_packages(),
include_package_data=True,
install_requires=[
"openslides",
"wxPython-Phoenix",
"psutil",
],
package_data={
"openslides_gui": [
"data/openslides.ico",
"data/openslides-logo_wide.png",
],
},
entry_points={
"gui_scripts": [
"openslides-gui=openslides_gui.gui:main",
],
}
)
<commit_msg>Fix packaging of data files<commit_after>from setuptools import setup, find_packages
setup(
name="openslides-gui",
version="1.0.0dev1",
description="GUI frontend for openslides",
long_description="", # TODO
url='http://openslides.org',
author='OpenSlides-Team, see AUTHORS',
author_email='support@openslides.org',
license='MIT',
keywords='OpenSlides',
classifiers=[
# TODO: fill those
],
packages=find_packages(),
install_requires=[
"openslides",
"wxPython-Phoenix",
"psutil",
],
package_data={
"openslides_gui": [
"data/openslides.ico",
"data/openslides-logo_wide.png",
],
},
entry_points={
"gui_scripts": [
"openslides-gui=openslides_gui.gui:main",
],
}
)
|
7cbb83b376924cb6ae6cdf317cd5ead1b658beef | setup.py | setup.py | from distutils.core import setup
import os.path
here = os.path.abspath(os.path.dirname(__file__))
try:
with open(os.path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
except:
long_description = ""
setup(name='diary',
packages=['diary'],
scripts=['diary/bin/diary'],
version='0.1.0',
description='Async Logging',
long_description=long_description,
author='Sam Rosen',
author_email='samrosen90@gmail.com',
url='https://github.com/GreenVars/diary',
license='MIT',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.1',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
],
keywords='logging async asynchronous parallel threading',
)
| from distutils.core import setup
import os.path
here = os.path.abspath(os.path.dirname(__file__))
try:
with open(os.path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
except:
long_description = ""
setup(name='diary',
packages=['diary'],
scripts=['diary/bin/diary'],
version='0.1.1',
description='Async Logging',
long_description=long_description,
author='Sam Rosen',
author_email='samrosen90@gmail.com',
url='https://github.com/GreenVars/diary',
license='MIT',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.1',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
],
keywords='logging async asynchronous parallel threading',
)
| Prepare for 0.1.1 small improvement release | Prepare for 0.1.1 small improvement release
| Python | mit | GreenVars/diary | from distutils.core import setup
import os.path
here = os.path.abspath(os.path.dirname(__file__))
try:
with open(os.path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
except:
long_description = ""
setup(name='diary',
packages=['diary'],
scripts=['diary/bin/diary'],
version='0.1.0',
description='Async Logging',
long_description=long_description,
author='Sam Rosen',
author_email='samrosen90@gmail.com',
url='https://github.com/GreenVars/diary',
license='MIT',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.1',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
],
keywords='logging async asynchronous parallel threading',
)
Prepare for 0.1.1 small improvement release | from distutils.core import setup
import os.path
here = os.path.abspath(os.path.dirname(__file__))
try:
with open(os.path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
except:
long_description = ""
setup(name='diary',
packages=['diary'],
scripts=['diary/bin/diary'],
version='0.1.1',
description='Async Logging',
long_description=long_description,
author='Sam Rosen',
author_email='samrosen90@gmail.com',
url='https://github.com/GreenVars/diary',
license='MIT',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.1',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
],
keywords='logging async asynchronous parallel threading',
)
| <commit_before>from distutils.core import setup
import os.path
here = os.path.abspath(os.path.dirname(__file__))
try:
with open(os.path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
except:
long_description = ""
setup(name='diary',
packages=['diary'],
scripts=['diary/bin/diary'],
version='0.1.0',
description='Async Logging',
long_description=long_description,
author='Sam Rosen',
author_email='samrosen90@gmail.com',
url='https://github.com/GreenVars/diary',
license='MIT',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.1',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
],
keywords='logging async asynchronous parallel threading',
)
<commit_msg>Prepare for 0.1.1 small improvement release<commit_after> | from distutils.core import setup
import os.path
here = os.path.abspath(os.path.dirname(__file__))
try:
with open(os.path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
except:
long_description = ""
setup(name='diary',
packages=['diary'],
scripts=['diary/bin/diary'],
version='0.1.1',
description='Async Logging',
long_description=long_description,
author='Sam Rosen',
author_email='samrosen90@gmail.com',
url='https://github.com/GreenVars/diary',
license='MIT',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.1',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
],
keywords='logging async asynchronous parallel threading',
)
| from distutils.core import setup
import os.path
here = os.path.abspath(os.path.dirname(__file__))
try:
with open(os.path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
except:
long_description = ""
setup(name='diary',
packages=['diary'],
scripts=['diary/bin/diary'],
version='0.1.0',
description='Async Logging',
long_description=long_description,
author='Sam Rosen',
author_email='samrosen90@gmail.com',
url='https://github.com/GreenVars/diary',
license='MIT',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.1',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
],
keywords='logging async asynchronous parallel threading',
)
Prepare for 0.1.1 small improvement releasefrom distutils.core import setup
import os.path
here = os.path.abspath(os.path.dirname(__file__))
try:
with open(os.path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
except:
long_description = ""
setup(name='diary',
packages=['diary'],
scripts=['diary/bin/diary'],
version='0.1.1',
description='Async Logging',
long_description=long_description,
author='Sam Rosen',
author_email='samrosen90@gmail.com',
url='https://github.com/GreenVars/diary',
license='MIT',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.1',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
],
keywords='logging async asynchronous parallel threading',
)
| <commit_before>from distutils.core import setup
import os.path
here = os.path.abspath(os.path.dirname(__file__))
try:
with open(os.path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
except:
long_description = ""
setup(name='diary',
packages=['diary'],
scripts=['diary/bin/diary'],
version='0.1.0',
description='Async Logging',
long_description=long_description,
author='Sam Rosen',
author_email='samrosen90@gmail.com',
url='https://github.com/GreenVars/diary',
license='MIT',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.1',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
],
keywords='logging async asynchronous parallel threading',
)
<commit_msg>Prepare for 0.1.1 small improvement release<commit_after>from distutils.core import setup
import os.path
here = os.path.abspath(os.path.dirname(__file__))
try:
with open(os.path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
except:
long_description = ""
setup(name='diary',
packages=['diary'],
scripts=['diary/bin/diary'],
version='0.1.1',
description='Async Logging',
long_description=long_description,
author='Sam Rosen',
author_email='samrosen90@gmail.com',
url='https://github.com/GreenVars/diary',
license='MIT',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.1',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
],
keywords='logging async asynchronous parallel threading',
)
|
10d42226246e13886b01c0f1b11066439ff9644f | setup.py | setup.py | """Setup for to_words package."""
from setuptools import setup, find_packages
from wordsapp import AUTHOR, VERSION
name = 'words_app'
version = VERSION
setup(
name=name,
version=version,
packages=find_packages(exclude=['tests', 'tests.*']),
description="Numbers to words library",
author=AUTHOR,
author_email="dee.caranja@gmail.com",
license="MIT",
install_requires=[
],
scripts=[
],
include_package_data=True
)
| """Setup for to_words package."""
from setuptools import setup, find_packages
from wordsapp import AUTHOR, VERSION
name = 'words_app'
def get_version(version_iter):
"""Get the version number."""
assert isinstance(version_iter, (tuple, list,))
version = ''
for number in version_iter:
version += str(number) + '.'
return version[:len(version) - 1]
version = get_version(VERSION)
setup(
name=name,
version=version,
packages=find_packages(exclude=['tests', 'tests.*']),
description="Numbers to words library",
author=AUTHOR,
author_email="dee.caranja@gmail.com",
license="MIT",
install_requires=[
],
scripts=[
],
include_package_data=True
)
| Convert Version number into a decimal seperated string | Convert Version number into a decimal seperated string
| Python | mit | yoda-yoda/numbers-to-words | """Setup for to_words package."""
from setuptools import setup, find_packages
from wordsapp import AUTHOR, VERSION
name = 'words_app'
version = VERSION
setup(
name=name,
version=version,
packages=find_packages(exclude=['tests', 'tests.*']),
description="Numbers to words library",
author=AUTHOR,
author_email="dee.caranja@gmail.com",
license="MIT",
install_requires=[
],
scripts=[
],
include_package_data=True
)
Convert Version number into a decimal seperated string | """Setup for to_words package."""
from setuptools import setup, find_packages
from wordsapp import AUTHOR, VERSION
name = 'words_app'
def get_version(version_iter):
"""Get the version number."""
assert isinstance(version_iter, (tuple, list,))
version = ''
for number in version_iter:
version += str(number) + '.'
return version[:len(version) - 1]
version = get_version(VERSION)
setup(
name=name,
version=version,
packages=find_packages(exclude=['tests', 'tests.*']),
description="Numbers to words library",
author=AUTHOR,
author_email="dee.caranja@gmail.com",
license="MIT",
install_requires=[
],
scripts=[
],
include_package_data=True
)
| <commit_before>"""Setup for to_words package."""
from setuptools import setup, find_packages
from wordsapp import AUTHOR, VERSION
name = 'words_app'
version = VERSION
setup(
name=name,
version=version,
packages=find_packages(exclude=['tests', 'tests.*']),
description="Numbers to words library",
author=AUTHOR,
author_email="dee.caranja@gmail.com",
license="MIT",
install_requires=[
],
scripts=[
],
include_package_data=True
)
<commit_msg>Convert Version number into a decimal seperated string<commit_after> | """Setup for to_words package."""
from setuptools import setup, find_packages
from wordsapp import AUTHOR, VERSION
name = 'words_app'
def get_version(version_iter):
"""Get the version number."""
assert isinstance(version_iter, (tuple, list,))
version = ''
for number in version_iter:
version += str(number) + '.'
return version[:len(version) - 1]
version = get_version(VERSION)
setup(
name=name,
version=version,
packages=find_packages(exclude=['tests', 'tests.*']),
description="Numbers to words library",
author=AUTHOR,
author_email="dee.caranja@gmail.com",
license="MIT",
install_requires=[
],
scripts=[
],
include_package_data=True
)
| """Setup for to_words package."""
from setuptools import setup, find_packages
from wordsapp import AUTHOR, VERSION
name = 'words_app'
version = VERSION
setup(
name=name,
version=version,
packages=find_packages(exclude=['tests', 'tests.*']),
description="Numbers to words library",
author=AUTHOR,
author_email="dee.caranja@gmail.com",
license="MIT",
install_requires=[
],
scripts=[
],
include_package_data=True
)
Convert Version number into a decimal seperated string"""Setup for to_words package."""
from setuptools import setup, find_packages
from wordsapp import AUTHOR, VERSION
name = 'words_app'
def get_version(version_iter):
"""Get the version number."""
assert isinstance(version_iter, (tuple, list,))
version = ''
for number in version_iter:
version += str(number) + '.'
return version[:len(version) - 1]
version = get_version(VERSION)
setup(
name=name,
version=version,
packages=find_packages(exclude=['tests', 'tests.*']),
description="Numbers to words library",
author=AUTHOR,
author_email="dee.caranja@gmail.com",
license="MIT",
install_requires=[
],
scripts=[
],
include_package_data=True
)
| <commit_before>"""Setup for to_words package."""
from setuptools import setup, find_packages
from wordsapp import AUTHOR, VERSION
name = 'words_app'
version = VERSION
setup(
name=name,
version=version,
packages=find_packages(exclude=['tests', 'tests.*']),
description="Numbers to words library",
author=AUTHOR,
author_email="dee.caranja@gmail.com",
license="MIT",
install_requires=[
],
scripts=[
],
include_package_data=True
)
<commit_msg>Convert Version number into a decimal seperated string<commit_after>"""Setup for to_words package."""
from setuptools import setup, find_packages
from wordsapp import AUTHOR, VERSION
name = 'words_app'
def get_version(version_iter):
"""Get the version number."""
assert isinstance(version_iter, (tuple, list,))
version = ''
for number in version_iter:
version += str(number) + '.'
return version[:len(version) - 1]
version = get_version(VERSION)
setup(
name=name,
version=version,
packages=find_packages(exclude=['tests', 'tests.*']),
description="Numbers to words library",
author=AUTHOR,
author_email="dee.caranja@gmail.com",
license="MIT",
install_requires=[
],
scripts=[
],
include_package_data=True
)
|
b76a6cafa7beabc3fc4bcb7357369b70e8d8b09a | setup.py | setup.py | from setuptools import setup
setup(
name='visioimg',
version='1.0.0',
author='Yassu',
author_email='yassumath@gmail.com',
url='https://github.com/yassu/VisioInRst',
description='Python reStructuredText directive for embedding visio image',
license='MIT',
packages=['visioimg'],
install_requires=[
'visio2img'
],
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Natural Language :: English',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
]
)
| from setuptools import setup
setup(
name='visioemb_rst',
version='1.0.0',
author='Yassu',
author_email='yassumath@gmail.com',
url='https://github.com/yassu/VisioInRst',
description='Python reStructuredText directive for embedding visio image',
license='MIT',
packages=['visioemb_rst'],
install_requires=[
'visio2img'
],
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Natural Language :: English',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
]
)
| Change name: visioimg -> visioemb_rst | Change name: visioimg -> visioemb_rst
| Python | apache-2.0 | visio2img/sphinxcontrib-visio | from setuptools import setup
setup(
name='visioimg',
version='1.0.0',
author='Yassu',
author_email='yassumath@gmail.com',
url='https://github.com/yassu/VisioInRst',
description='Python reStructuredText directive for embedding visio image',
license='MIT',
packages=['visioimg'],
install_requires=[
'visio2img'
],
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Natural Language :: English',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
]
)
Change name: visioimg -> visioemb_rst | from setuptools import setup
setup(
name='visioemb_rst',
version='1.0.0',
author='Yassu',
author_email='yassumath@gmail.com',
url='https://github.com/yassu/VisioInRst',
description='Python reStructuredText directive for embedding visio image',
license='MIT',
packages=['visioemb_rst'],
install_requires=[
'visio2img'
],
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Natural Language :: English',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
]
)
| <commit_before>from setuptools import setup
setup(
name='visioimg',
version='1.0.0',
author='Yassu',
author_email='yassumath@gmail.com',
url='https://github.com/yassu/VisioInRst',
description='Python reStructuredText directive for embedding visio image',
license='MIT',
packages=['visioimg'],
install_requires=[
'visio2img'
],
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Natural Language :: English',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
]
)
<commit_msg>Change name: visioimg -> visioemb_rst<commit_after> | from setuptools import setup
setup(
name='visioemb_rst',
version='1.0.0',
author='Yassu',
author_email='yassumath@gmail.com',
url='https://github.com/yassu/VisioInRst',
description='Python reStructuredText directive for embedding visio image',
license='MIT',
packages=['visioemb_rst'],
install_requires=[
'visio2img'
],
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Natural Language :: English',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
]
)
| from setuptools import setup
setup(
name='visioimg',
version='1.0.0',
author='Yassu',
author_email='yassumath@gmail.com',
url='https://github.com/yassu/VisioInRst',
description='Python reStructuredText directive for embedding visio image',
license='MIT',
packages=['visioimg'],
install_requires=[
'visio2img'
],
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Natural Language :: English',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
]
)
Change name: visioimg -> visioemb_rstfrom setuptools import setup
setup(
name='visioemb_rst',
version='1.0.0',
author='Yassu',
author_email='yassumath@gmail.com',
url='https://github.com/yassu/VisioInRst',
description='Python reStructuredText directive for embedding visio image',
license='MIT',
packages=['visioemb_rst'],
install_requires=[
'visio2img'
],
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Natural Language :: English',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
]
)
| <commit_before>from setuptools import setup
setup(
name='visioimg',
version='1.0.0',
author='Yassu',
author_email='yassumath@gmail.com',
url='https://github.com/yassu/VisioInRst',
description='Python reStructuredText directive for embedding visio image',
license='MIT',
packages=['visioimg'],
install_requires=[
'visio2img'
],
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Natural Language :: English',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
]
)
<commit_msg>Change name: visioimg -> visioemb_rst<commit_after>from setuptools import setup
setup(
name='visioemb_rst',
version='1.0.0',
author='Yassu',
author_email='yassumath@gmail.com',
url='https://github.com/yassu/VisioInRst',
description='Python reStructuredText directive for embedding visio image',
license='MIT',
packages=['visioemb_rst'],
install_requires=[
'visio2img'
],
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Natural Language :: English',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
]
)
|
bffdd8ee32e20d7d6f39049514b76dcb5d4a2825 | setup.py | setup.py | #!/usr/bin/python
"""Install, build, or test the HXL Proxy.
For details, try
python setup.py -h
"""
import sys, setuptools
from hxl_proxy import __version__
if sys.version_info.major != 3:
raise SystemExit("The HXL Proxy requires Python 3.x")
setuptools.setup(
name = 'hxl-proxy',
packages = ['hxl_proxy'],
package_data={'hxl_proxy': ['*.sql']},
version = __version__,
description = 'Flask-based web proxy for HXL',
author='David Megginson',
author_email='contact@megginson.com',
url='https://github.com/HXLStandard/hxl-proxy',
include_package_data = True,
zip_safe = False,
install_requires=['flask-cache>=0.13', 'libhxl==4.8', 'ckanapi>=3.5', 'flask==0.12.4', 'requests_cache', 'mysql-connector-python'],
test_suite = "tests",
tests_require = ['mock']
)
| #!/usr/bin/python
"""Install, build, or test the HXL Proxy.
For details, try
python setup.py -h
"""
import sys, setuptools
from hxl_proxy import __version__
if sys.version_info.major != 3:
raise SystemExit("The HXL Proxy requires Python 3.x")
setuptools.setup(
name = 'hxl-proxy',
packages = ['hxl_proxy'],
package_data={'hxl_proxy': ['*.sql']},
version = __version__,
description = 'Flask-based web proxy for HXL',
author='David Megginson',
author_email='contact@megginson.com',
url='https://github.com/HXLStandard/hxl-proxy',
include_package_data = True,
zip_safe = False,
install_requires=['flask-cache>=0.13', 'libhxl', 'ckanapi>=3.5', 'flask==0.12.4', 'requests_cache', 'mysql-connector-python'],
test_suite = "tests",
tests_require = ['mock']
)
| Remove version for now, since it's messing up beta deployment. | Remove version for now, since it's messing up beta deployment.
| Python | unlicense | HXLStandard/hxl-proxy,HXLStandard/hxl-proxy,HXLStandard/hxl-proxy,HXLStandard/hxl-proxy | #!/usr/bin/python
"""Install, build, or test the HXL Proxy.
For details, try
python setup.py -h
"""
import sys, setuptools
from hxl_proxy import __version__
if sys.version_info.major != 3:
raise SystemExit("The HXL Proxy requires Python 3.x")
setuptools.setup(
name = 'hxl-proxy',
packages = ['hxl_proxy'],
package_data={'hxl_proxy': ['*.sql']},
version = __version__,
description = 'Flask-based web proxy for HXL',
author='David Megginson',
author_email='contact@megginson.com',
url='https://github.com/HXLStandard/hxl-proxy',
include_package_data = True,
zip_safe = False,
install_requires=['flask-cache>=0.13', 'libhxl==4.8', 'ckanapi>=3.5', 'flask==0.12.4', 'requests_cache', 'mysql-connector-python'],
test_suite = "tests",
tests_require = ['mock']
)
Remove version for now, since it's messing up beta deployment. | #!/usr/bin/python
"""Install, build, or test the HXL Proxy.
For details, try
python setup.py -h
"""
import sys, setuptools
from hxl_proxy import __version__
if sys.version_info.major != 3:
raise SystemExit("The HXL Proxy requires Python 3.x")
setuptools.setup(
name = 'hxl-proxy',
packages = ['hxl_proxy'],
package_data={'hxl_proxy': ['*.sql']},
version = __version__,
description = 'Flask-based web proxy for HXL',
author='David Megginson',
author_email='contact@megginson.com',
url='https://github.com/HXLStandard/hxl-proxy',
include_package_data = True,
zip_safe = False,
install_requires=['flask-cache>=0.13', 'libhxl', 'ckanapi>=3.5', 'flask==0.12.4', 'requests_cache', 'mysql-connector-python'],
test_suite = "tests",
tests_require = ['mock']
)
| <commit_before>#!/usr/bin/python
"""Install, build, or test the HXL Proxy.
For details, try
python setup.py -h
"""
import sys, setuptools
from hxl_proxy import __version__
if sys.version_info.major != 3:
raise SystemExit("The HXL Proxy requires Python 3.x")
setuptools.setup(
name = 'hxl-proxy',
packages = ['hxl_proxy'],
package_data={'hxl_proxy': ['*.sql']},
version = __version__,
description = 'Flask-based web proxy for HXL',
author='David Megginson',
author_email='contact@megginson.com',
url='https://github.com/HXLStandard/hxl-proxy',
include_package_data = True,
zip_safe = False,
install_requires=['flask-cache>=0.13', 'libhxl==4.8', 'ckanapi>=3.5', 'flask==0.12.4', 'requests_cache', 'mysql-connector-python'],
test_suite = "tests",
tests_require = ['mock']
)
<commit_msg>Remove version for now, since it's messing up beta deployment.<commit_after> | #!/usr/bin/python
"""Install, build, or test the HXL Proxy.
For details, try
python setup.py -h
"""
import sys, setuptools
from hxl_proxy import __version__
if sys.version_info.major != 3:
raise SystemExit("The HXL Proxy requires Python 3.x")
setuptools.setup(
name = 'hxl-proxy',
packages = ['hxl_proxy'],
package_data={'hxl_proxy': ['*.sql']},
version = __version__,
description = 'Flask-based web proxy for HXL',
author='David Megginson',
author_email='contact@megginson.com',
url='https://github.com/HXLStandard/hxl-proxy',
include_package_data = True,
zip_safe = False,
install_requires=['flask-cache>=0.13', 'libhxl', 'ckanapi>=3.5', 'flask==0.12.4', 'requests_cache', 'mysql-connector-python'],
test_suite = "tests",
tests_require = ['mock']
)
| #!/usr/bin/python
"""Install, build, or test the HXL Proxy.
For details, try
python setup.py -h
"""
import sys, setuptools
from hxl_proxy import __version__
if sys.version_info.major != 3:
raise SystemExit("The HXL Proxy requires Python 3.x")
setuptools.setup(
name = 'hxl-proxy',
packages = ['hxl_proxy'],
package_data={'hxl_proxy': ['*.sql']},
version = __version__,
description = 'Flask-based web proxy for HXL',
author='David Megginson',
author_email='contact@megginson.com',
url='https://github.com/HXLStandard/hxl-proxy',
include_package_data = True,
zip_safe = False,
install_requires=['flask-cache>=0.13', 'libhxl==4.8', 'ckanapi>=3.5', 'flask==0.12.4', 'requests_cache', 'mysql-connector-python'],
test_suite = "tests",
tests_require = ['mock']
)
Remove version for now, since it's messing up beta deployment.#!/usr/bin/python
"""Install, build, or test the HXL Proxy.
For details, try
python setup.py -h
"""
import sys, setuptools
from hxl_proxy import __version__
if sys.version_info.major != 3:
raise SystemExit("The HXL Proxy requires Python 3.x")
setuptools.setup(
name = 'hxl-proxy',
packages = ['hxl_proxy'],
package_data={'hxl_proxy': ['*.sql']},
version = __version__,
description = 'Flask-based web proxy for HXL',
author='David Megginson',
author_email='contact@megginson.com',
url='https://github.com/HXLStandard/hxl-proxy',
include_package_data = True,
zip_safe = False,
install_requires=['flask-cache>=0.13', 'libhxl', 'ckanapi>=3.5', 'flask==0.12.4', 'requests_cache', 'mysql-connector-python'],
test_suite = "tests",
tests_require = ['mock']
)
| <commit_before>#!/usr/bin/python
"""Install, build, or test the HXL Proxy.
For details, try
python setup.py -h
"""
import sys, setuptools
from hxl_proxy import __version__
if sys.version_info.major != 3:
raise SystemExit("The HXL Proxy requires Python 3.x")
setuptools.setup(
name = 'hxl-proxy',
packages = ['hxl_proxy'],
package_data={'hxl_proxy': ['*.sql']},
version = __version__,
description = 'Flask-based web proxy for HXL',
author='David Megginson',
author_email='contact@megginson.com',
url='https://github.com/HXLStandard/hxl-proxy',
include_package_data = True,
zip_safe = False,
install_requires=['flask-cache>=0.13', 'libhxl==4.8', 'ckanapi>=3.5', 'flask==0.12.4', 'requests_cache', 'mysql-connector-python'],
test_suite = "tests",
tests_require = ['mock']
)
<commit_msg>Remove version for now, since it's messing up beta deployment.<commit_after>#!/usr/bin/python
"""Install, build, or test the HXL Proxy.
For details, try
python setup.py -h
"""
import sys, setuptools
from hxl_proxy import __version__
if sys.version_info.major != 3:
raise SystemExit("The HXL Proxy requires Python 3.x")
setuptools.setup(
name = 'hxl-proxy',
packages = ['hxl_proxy'],
package_data={'hxl_proxy': ['*.sql']},
version = __version__,
description = 'Flask-based web proxy for HXL',
author='David Megginson',
author_email='contact@megginson.com',
url='https://github.com/HXLStandard/hxl-proxy',
include_package_data = True,
zip_safe = False,
install_requires=['flask-cache>=0.13', 'libhxl', 'ckanapi>=3.5', 'flask==0.12.4', 'requests_cache', 'mysql-connector-python'],
test_suite = "tests",
tests_require = ['mock']
)
|
ed202eef3e75b10e90c7fcd2ceac1feddc4acd95 | setup.py | setup.py | from __future__ import absolute_import
from setuptools import setup, find_packages
long_desc = """
Transform Excel spreadsheets
"""
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers for classifiers
conf = dict(
name='databaker',
version='1.2.1',
description="DataBaker, part of QuickCode for ONS",
long_description=long_desc,
classifiers=[
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
],
keywords='',
author='The Sensible Code Company Ltd',
author_email='feedback@sensiblecode.io',
url='https://github.com/sensiblecodeio/databaker',
license='AGPL',
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
namespace_packages=[],
include_package_data=False,
zip_safe=False,
install_requires=['docopt', 'xypath>=1.1.0', 'xlutils', 'pyhamcrest'],
tests_require=[],
entry_points={
'console_scripts': [
'bake = databaker.bake:main',
]
})
if __name__ == '__main__':
setup(**conf)
| from __future__ import absolute_import
from setuptools import setup, find_packages
long_desc = """
Transform Excel spreadsheets
"""
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers for classifiers
conf = dict(
name='databaker',
version='1.2.1',
description="DataBaker, part of QuickCode for ONS",
long_description=long_desc,
classifiers=[
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
],
keywords='',
author='The Sensible Code Company Ltd',
author_email='feedback@sensiblecode.io',
url='https://github.com/sensiblecodeio/databaker',
license='AGPL',
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
namespace_packages=[],
include_package_data=False,
zip_safe=False,
install_requires=['docopt', 'xypath>=1.1.0', 'xlutils', 'pyhamcrest'],
tests_require=[],
entry_points={},
)
if __name__ == '__main__':
setup(**conf)
| Remove bake.py console script entry point | Remove bake.py console script entry point
bake.py no longer exists.
| Python | agpl-3.0 | scraperwiki/databaker,scraperwiki/databaker | from __future__ import absolute_import
from setuptools import setup, find_packages
long_desc = """
Transform Excel spreadsheets
"""
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers for classifiers
conf = dict(
name='databaker',
version='1.2.1',
description="DataBaker, part of QuickCode for ONS",
long_description=long_desc,
classifiers=[
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
],
keywords='',
author='The Sensible Code Company Ltd',
author_email='feedback@sensiblecode.io',
url='https://github.com/sensiblecodeio/databaker',
license='AGPL',
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
namespace_packages=[],
include_package_data=False,
zip_safe=False,
install_requires=['docopt', 'xypath>=1.1.0', 'xlutils', 'pyhamcrest'],
tests_require=[],
entry_points={
'console_scripts': [
'bake = databaker.bake:main',
]
})
if __name__ == '__main__':
setup(**conf)
Remove bake.py console script entry point
bake.py no longer exists. | from __future__ import absolute_import
from setuptools import setup, find_packages
long_desc = """
Transform Excel spreadsheets
"""
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers for classifiers
conf = dict(
name='databaker',
version='1.2.1',
description="DataBaker, part of QuickCode for ONS",
long_description=long_desc,
classifiers=[
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
],
keywords='',
author='The Sensible Code Company Ltd',
author_email='feedback@sensiblecode.io',
url='https://github.com/sensiblecodeio/databaker',
license='AGPL',
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
namespace_packages=[],
include_package_data=False,
zip_safe=False,
install_requires=['docopt', 'xypath>=1.1.0', 'xlutils', 'pyhamcrest'],
tests_require=[],
entry_points={},
)
if __name__ == '__main__':
setup(**conf)
| <commit_before>from __future__ import absolute_import
from setuptools import setup, find_packages
long_desc = """
Transform Excel spreadsheets
"""
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers for classifiers
conf = dict(
name='databaker',
version='1.2.1',
description="DataBaker, part of QuickCode for ONS",
long_description=long_desc,
classifiers=[
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
],
keywords='',
author='The Sensible Code Company Ltd',
author_email='feedback@sensiblecode.io',
url='https://github.com/sensiblecodeio/databaker',
license='AGPL',
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
namespace_packages=[],
include_package_data=False,
zip_safe=False,
install_requires=['docopt', 'xypath>=1.1.0', 'xlutils', 'pyhamcrest'],
tests_require=[],
entry_points={
'console_scripts': [
'bake = databaker.bake:main',
]
})
if __name__ == '__main__':
setup(**conf)
<commit_msg>Remove bake.py console script entry point
bake.py no longer exists.<commit_after> | from __future__ import absolute_import
from setuptools import setup, find_packages
long_desc = """
Transform Excel spreadsheets
"""
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers for classifiers
conf = dict(
name='databaker',
version='1.2.1',
description="DataBaker, part of QuickCode for ONS",
long_description=long_desc,
classifiers=[
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
],
keywords='',
author='The Sensible Code Company Ltd',
author_email='feedback@sensiblecode.io',
url='https://github.com/sensiblecodeio/databaker',
license='AGPL',
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
namespace_packages=[],
include_package_data=False,
zip_safe=False,
install_requires=['docopt', 'xypath>=1.1.0', 'xlutils', 'pyhamcrest'],
tests_require=[],
entry_points={},
)
if __name__ == '__main__':
setup(**conf)
| from __future__ import absolute_import
from setuptools import setup, find_packages
long_desc = """
Transform Excel spreadsheets
"""
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers for classifiers
conf = dict(
name='databaker',
version='1.2.1',
description="DataBaker, part of QuickCode for ONS",
long_description=long_desc,
classifiers=[
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
],
keywords='',
author='The Sensible Code Company Ltd',
author_email='feedback@sensiblecode.io',
url='https://github.com/sensiblecodeio/databaker',
license='AGPL',
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
namespace_packages=[],
include_package_data=False,
zip_safe=False,
install_requires=['docopt', 'xypath>=1.1.0', 'xlutils', 'pyhamcrest'],
tests_require=[],
entry_points={
'console_scripts': [
'bake = databaker.bake:main',
]
})
if __name__ == '__main__':
setup(**conf)
Remove bake.py console script entry point
bake.py no longer exists.from __future__ import absolute_import
from setuptools import setup, find_packages
long_desc = """
Transform Excel spreadsheets
"""
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers for classifiers
conf = dict(
name='databaker',
version='1.2.1',
description="DataBaker, part of QuickCode for ONS",
long_description=long_desc,
classifiers=[
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
],
keywords='',
author='The Sensible Code Company Ltd',
author_email='feedback@sensiblecode.io',
url='https://github.com/sensiblecodeio/databaker',
license='AGPL',
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
namespace_packages=[],
include_package_data=False,
zip_safe=False,
install_requires=['docopt', 'xypath>=1.1.0', 'xlutils', 'pyhamcrest'],
tests_require=[],
entry_points={},
)
if __name__ == '__main__':
setup(**conf)
| <commit_before>from __future__ import absolute_import
from setuptools import setup, find_packages
long_desc = """
Transform Excel spreadsheets
"""
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers for classifiers
conf = dict(
name='databaker',
version='1.2.1',
description="DataBaker, part of QuickCode for ONS",
long_description=long_desc,
classifiers=[
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
],
keywords='',
author='The Sensible Code Company Ltd',
author_email='feedback@sensiblecode.io',
url='https://github.com/sensiblecodeio/databaker',
license='AGPL',
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
namespace_packages=[],
include_package_data=False,
zip_safe=False,
install_requires=['docopt', 'xypath>=1.1.0', 'xlutils', 'pyhamcrest'],
tests_require=[],
entry_points={
'console_scripts': [
'bake = databaker.bake:main',
]
})
if __name__ == '__main__':
setup(**conf)
<commit_msg>Remove bake.py console script entry point
bake.py no longer exists.<commit_after>from __future__ import absolute_import
from setuptools import setup, find_packages
long_desc = """
Transform Excel spreadsheets
"""
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers for classifiers
conf = dict(
name='databaker',
version='1.2.1',
description="DataBaker, part of QuickCode for ONS",
long_description=long_desc,
classifiers=[
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
],
keywords='',
author='The Sensible Code Company Ltd',
author_email='feedback@sensiblecode.io',
url='https://github.com/sensiblecodeio/databaker',
license='AGPL',
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
namespace_packages=[],
include_package_data=False,
zip_safe=False,
install_requires=['docopt', 'xypath>=1.1.0', 'xlutils', 'pyhamcrest'],
tests_require=[],
entry_points={},
)
if __name__ == '__main__':
setup(**conf)
|
cc0ae53316705f4d432ca8a92b1dd8ba93facc7c | setup.py | setup.py | #!/usr/bin/env python3
from distutils.core import setup
version = "0.0.1"
setup(
name = 'homer',
packages = ['homer'],
license = 'MIT',
version = version,
description = 'Homer is a config handler tool.',
author = 'Manoel Carvalho',
author_email = 'manoelhc@gmail.com',
url = 'https://github.com/manoelhc/homer', # use the URL to the github repo
download_url = 'https://github.com/manoelhc/homer', # I'll explain this in a second
keywords = ['testing', 'configuration'], # arbitrary keywords
install_requires=[
'Crypto'
],
classifiers = [
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Topic :: Software Development :: Build Tools',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6'
],
)
| #!/usr/bin/env python3
from distutils.core import setup
version = "0.0.1"
setup(
name = 'homer',
packages = ['homer'],
license = 'MIT',
version = version,
description = 'Homer is a config handler tool.',
author = 'Manoel Carvalho',
author_email = 'manoelhc@gmail.com',
url = 'https://github.com/manoelhc/homer', # use the URL to the github repo
download_url = 'https://github.com/manoelhc/homer', # I'll explain this in a second
keywords = ['testing', 'configuration'], # arbitrary keywords
install_requires=[
'pycrypto'
],
classifiers = [
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Topic :: Software Development :: Build Tools',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6'
],
)
| Fix the required package name | Fix the required package name
| Python | mit | manoelhc/homer | #!/usr/bin/env python3
from distutils.core import setup
version = "0.0.1"
setup(
name = 'homer',
packages = ['homer'],
license = 'MIT',
version = version,
description = 'Homer is a config handler tool.',
author = 'Manoel Carvalho',
author_email = 'manoelhc@gmail.com',
url = 'https://github.com/manoelhc/homer', # use the URL to the github repo
download_url = 'https://github.com/manoelhc/homer', # I'll explain this in a second
keywords = ['testing', 'configuration'], # arbitrary keywords
install_requires=[
'Crypto'
],
classifiers = [
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Topic :: Software Development :: Build Tools',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6'
],
)
Fix the required package name | #!/usr/bin/env python3
from distutils.core import setup
version = "0.0.1"
setup(
name = 'homer',
packages = ['homer'],
license = 'MIT',
version = version,
description = 'Homer is a config handler tool.',
author = 'Manoel Carvalho',
author_email = 'manoelhc@gmail.com',
url = 'https://github.com/manoelhc/homer', # use the URL to the github repo
download_url = 'https://github.com/manoelhc/homer', # I'll explain this in a second
keywords = ['testing', 'configuration'], # arbitrary keywords
install_requires=[
'pycrypto'
],
classifiers = [
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Topic :: Software Development :: Build Tools',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6'
],
)
| <commit_before>#!/usr/bin/env python3
from distutils.core import setup
version = "0.0.1"
setup(
name = 'homer',
packages = ['homer'],
license = 'MIT',
version = version,
description = 'Homer is a config handler tool.',
author = 'Manoel Carvalho',
author_email = 'manoelhc@gmail.com',
url = 'https://github.com/manoelhc/homer', # use the URL to the github repo
download_url = 'https://github.com/manoelhc/homer', # I'll explain this in a second
keywords = ['testing', 'configuration'], # arbitrary keywords
install_requires=[
'Crypto'
],
classifiers = [
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Topic :: Software Development :: Build Tools',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6'
],
)
<commit_msg>Fix the required package name<commit_after> | #!/usr/bin/env python3
from distutils.core import setup
version = "0.0.1"
setup(
name = 'homer',
packages = ['homer'],
license = 'MIT',
version = version,
description = 'Homer is a config handler tool.',
author = 'Manoel Carvalho',
author_email = 'manoelhc@gmail.com',
url = 'https://github.com/manoelhc/homer', # use the URL to the github repo
download_url = 'https://github.com/manoelhc/homer', # I'll explain this in a second
keywords = ['testing', 'configuration'], # arbitrary keywords
install_requires=[
'pycrypto'
],
classifiers = [
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Topic :: Software Development :: Build Tools',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6'
],
)
| #!/usr/bin/env python3
from distutils.core import setup
version = "0.0.1"
setup(
name = 'homer',
packages = ['homer'],
license = 'MIT',
version = version,
description = 'Homer is a config handler tool.',
author = 'Manoel Carvalho',
author_email = 'manoelhc@gmail.com',
url = 'https://github.com/manoelhc/homer', # use the URL to the github repo
download_url = 'https://github.com/manoelhc/homer', # I'll explain this in a second
keywords = ['testing', 'configuration'], # arbitrary keywords
install_requires=[
'Crypto'
],
classifiers = [
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Topic :: Software Development :: Build Tools',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6'
],
)
Fix the required package name#!/usr/bin/env python3
from distutils.core import setup
version = "0.0.1"
setup(
name = 'homer',
packages = ['homer'],
license = 'MIT',
version = version,
description = 'Homer is a config handler tool.',
author = 'Manoel Carvalho',
author_email = 'manoelhc@gmail.com',
url = 'https://github.com/manoelhc/homer', # use the URL to the github repo
download_url = 'https://github.com/manoelhc/homer', # I'll explain this in a second
keywords = ['testing', 'configuration'], # arbitrary keywords
install_requires=[
'pycrypto'
],
classifiers = [
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Topic :: Software Development :: Build Tools',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6'
],
)
| <commit_before>#!/usr/bin/env python3
from distutils.core import setup
version = "0.0.1"
setup(
name = 'homer',
packages = ['homer'],
license = 'MIT',
version = version,
description = 'Homer is a config handler tool.',
author = 'Manoel Carvalho',
author_email = 'manoelhc@gmail.com',
url = 'https://github.com/manoelhc/homer', # use the URL to the github repo
download_url = 'https://github.com/manoelhc/homer', # I'll explain this in a second
keywords = ['testing', 'configuration'], # arbitrary keywords
install_requires=[
'Crypto'
],
classifiers = [
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Topic :: Software Development :: Build Tools',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6'
],
)
<commit_msg>Fix the required package name<commit_after>#!/usr/bin/env python3
from distutils.core import setup
version = "0.0.1"
setup(
name = 'homer',
packages = ['homer'],
license = 'MIT',
version = version,
description = 'Homer is a config handler tool.',
author = 'Manoel Carvalho',
author_email = 'manoelhc@gmail.com',
url = 'https://github.com/manoelhc/homer', # use the URL to the github repo
download_url = 'https://github.com/manoelhc/homer', # I'll explain this in a second
keywords = ['testing', 'configuration'], # arbitrary keywords
install_requires=[
'pycrypto'
],
classifiers = [
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Topic :: Software Development :: Build Tools',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6'
],
)
|
c858af26c6940cb514e845acede25b56b9274449 | setup.py | setup.py | from setuptools import setup, find_packages
setup (
name = 'hypnotoad',
version = '0.1.1',
author = 'Jon Bringhurst',
author_email = 'jonb@lanl.gov',
url = 'https://www.git.lanl.gov/rm/hypnotoad',
license = 'LICENSE.txt',
scripts = ['hypnotoad/bin/hypnotoad'],
long_description = open('README.txt').read(),
description = 'A utility that aids in transporting directory ' +
'information from one or more data sources to various ' +
'applications on a cluster using a standard interface. ' +
'Not Zoidberg.',
packages = find_packages(),
)
# EOF
| from setuptools import setup, find_packages
setup (
name = 'hypnotoad',
version = '0.1.2',
author = 'Jon Bringhurst',
author_email = 'jonb@lanl.gov',
url = 'https://www.git.lanl.gov/rm/hypnotoad',
license = 'LICENSE.txt',
scripts = ['hypnotoad/bin/hypnotoad'],
long_description = open('README.txt').read(),
description = 'A utility that aids in transporting directory ' +
'information from one or more data sources to various ' +
'applications on a cluster using a standard interface. ' +
'Not Zoidberg.',
packages = find_packages(),
)
# EOF
| Bump version number for future release. | Bump version number for future release.
| Python | bsd-3-clause | hpc/hypnotoad | from setuptools import setup, find_packages
setup (
name = 'hypnotoad',
version = '0.1.1',
author = 'Jon Bringhurst',
author_email = 'jonb@lanl.gov',
url = 'https://www.git.lanl.gov/rm/hypnotoad',
license = 'LICENSE.txt',
scripts = ['hypnotoad/bin/hypnotoad'],
long_description = open('README.txt').read(),
description = 'A utility that aids in transporting directory ' +
'information from one or more data sources to various ' +
'applications on a cluster using a standard interface. ' +
'Not Zoidberg.',
packages = find_packages(),
)
# EOF
Bump version number for future release. | from setuptools import setup, find_packages
setup (
name = 'hypnotoad',
version = '0.1.2',
author = 'Jon Bringhurst',
author_email = 'jonb@lanl.gov',
url = 'https://www.git.lanl.gov/rm/hypnotoad',
license = 'LICENSE.txt',
scripts = ['hypnotoad/bin/hypnotoad'],
long_description = open('README.txt').read(),
description = 'A utility that aids in transporting directory ' +
'information from one or more data sources to various ' +
'applications on a cluster using a standard interface. ' +
'Not Zoidberg.',
packages = find_packages(),
)
# EOF
| <commit_before>from setuptools import setup, find_packages
setup (
name = 'hypnotoad',
version = '0.1.1',
author = 'Jon Bringhurst',
author_email = 'jonb@lanl.gov',
url = 'https://www.git.lanl.gov/rm/hypnotoad',
license = 'LICENSE.txt',
scripts = ['hypnotoad/bin/hypnotoad'],
long_description = open('README.txt').read(),
description = 'A utility that aids in transporting directory ' +
'information from one or more data sources to various ' +
'applications on a cluster using a standard interface. ' +
'Not Zoidberg.',
packages = find_packages(),
)
# EOF
<commit_msg>Bump version number for future release.<commit_after> | from setuptools import setup, find_packages
setup (
name = 'hypnotoad',
version = '0.1.2',
author = 'Jon Bringhurst',
author_email = 'jonb@lanl.gov',
url = 'https://www.git.lanl.gov/rm/hypnotoad',
license = 'LICENSE.txt',
scripts = ['hypnotoad/bin/hypnotoad'],
long_description = open('README.txt').read(),
description = 'A utility that aids in transporting directory ' +
'information from one or more data sources to various ' +
'applications on a cluster using a standard interface. ' +
'Not Zoidberg.',
packages = find_packages(),
)
# EOF
| from setuptools import setup, find_packages
setup (
name = 'hypnotoad',
version = '0.1.1',
author = 'Jon Bringhurst',
author_email = 'jonb@lanl.gov',
url = 'https://www.git.lanl.gov/rm/hypnotoad',
license = 'LICENSE.txt',
scripts = ['hypnotoad/bin/hypnotoad'],
long_description = open('README.txt').read(),
description = 'A utility that aids in transporting directory ' +
'information from one or more data sources to various ' +
'applications on a cluster using a standard interface. ' +
'Not Zoidberg.',
packages = find_packages(),
)
# EOF
Bump version number for future release.from setuptools import setup, find_packages
setup (
name = 'hypnotoad',
version = '0.1.2',
author = 'Jon Bringhurst',
author_email = 'jonb@lanl.gov',
url = 'https://www.git.lanl.gov/rm/hypnotoad',
license = 'LICENSE.txt',
scripts = ['hypnotoad/bin/hypnotoad'],
long_description = open('README.txt').read(),
description = 'A utility that aids in transporting directory ' +
'information from one or more data sources to various ' +
'applications on a cluster using a standard interface. ' +
'Not Zoidberg.',
packages = find_packages(),
)
# EOF
| <commit_before>from setuptools import setup, find_packages
setup (
name = 'hypnotoad',
version = '0.1.1',
author = 'Jon Bringhurst',
author_email = 'jonb@lanl.gov',
url = 'https://www.git.lanl.gov/rm/hypnotoad',
license = 'LICENSE.txt',
scripts = ['hypnotoad/bin/hypnotoad'],
long_description = open('README.txt').read(),
description = 'A utility that aids in transporting directory ' +
'information from one or more data sources to various ' +
'applications on a cluster using a standard interface. ' +
'Not Zoidberg.',
packages = find_packages(),
)
# EOF
<commit_msg>Bump version number for future release.<commit_after>from setuptools import setup, find_packages
setup (
name = 'hypnotoad',
version = '0.1.2',
author = 'Jon Bringhurst',
author_email = 'jonb@lanl.gov',
url = 'https://www.git.lanl.gov/rm/hypnotoad',
license = 'LICENSE.txt',
scripts = ['hypnotoad/bin/hypnotoad'],
long_description = open('README.txt').read(),
description = 'A utility that aids in transporting directory ' +
'information from one or more data sources to various ' +
'applications on a cluster using a standard interface. ' +
'Not Zoidberg.',
packages = find_packages(),
)
# EOF
|
48a9701fc57679a3526f55e516710b7b787d479f | setup.py | setup.py | import os
from setuptools import setup
README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='mdot',
version='0.1',
packages=['mdot'],
include_package_data=True,
install_requires=[
'setuptools',
'django<1.9rc1',
'django-compressor',
'django_mobileesp',
'uw-restclients<2.0',
'django-htmlmin',
],
license='Apache License, Version 2.0',
description='A Django app to ...',
long_description=README,
url='http://www.example.com/',
author='Your Name',
author_email='yourname@example.com',
classifiers=[
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
],
)
| import os
from setuptools import setup
README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='mdot',
version='0.1',
packages=['mdot'],
include_package_data=True,
install_requires=[
'setuptools',
'django<1.9rc1',
'django-compressor',
'django_mobileesp',
'uw-restclients==1.1',
'django-htmlmin',
],
license='Apache License, Version 2.0',
description='A Django app to ...',
long_description=README,
url='http://www.example.com/',
author='Your Name',
author_email='yourname@example.com',
classifiers=[
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
],
)
| Revert "Try less than 2.0." | Revert "Try less than 2.0."
This reverts commit 1bffae34a767e56943bb83027719fbe6dffcdc3b.
| Python | apache-2.0 | uw-it-aca/mdot,uw-it-aca/mdot,charlon/mdot,uw-it-aca/mdot,charlon/mdot,uw-it-aca/mdot,charlon/mdot | import os
from setuptools import setup
README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='mdot',
version='0.1',
packages=['mdot'],
include_package_data=True,
install_requires=[
'setuptools',
'django<1.9rc1',
'django-compressor',
'django_mobileesp',
'uw-restclients<2.0',
'django-htmlmin',
],
license='Apache License, Version 2.0',
description='A Django app to ...',
long_description=README,
url='http://www.example.com/',
author='Your Name',
author_email='yourname@example.com',
classifiers=[
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
],
)
Revert "Try less than 2.0."
This reverts commit 1bffae34a767e56943bb83027719fbe6dffcdc3b. | import os
from setuptools import setup
README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='mdot',
version='0.1',
packages=['mdot'],
include_package_data=True,
install_requires=[
'setuptools',
'django<1.9rc1',
'django-compressor',
'django_mobileesp',
'uw-restclients==1.1',
'django-htmlmin',
],
license='Apache License, Version 2.0',
description='A Django app to ...',
long_description=README,
url='http://www.example.com/',
author='Your Name',
author_email='yourname@example.com',
classifiers=[
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
],
)
| <commit_before>import os
from setuptools import setup
README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='mdot',
version='0.1',
packages=['mdot'],
include_package_data=True,
install_requires=[
'setuptools',
'django<1.9rc1',
'django-compressor',
'django_mobileesp',
'uw-restclients<2.0',
'django-htmlmin',
],
license='Apache License, Version 2.0',
description='A Django app to ...',
long_description=README,
url='http://www.example.com/',
author='Your Name',
author_email='yourname@example.com',
classifiers=[
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
],
)
<commit_msg>Revert "Try less than 2.0."
This reverts commit 1bffae34a767e56943bb83027719fbe6dffcdc3b.<commit_after> | import os
from setuptools import setup
README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='mdot',
version='0.1',
packages=['mdot'],
include_package_data=True,
install_requires=[
'setuptools',
'django<1.9rc1',
'django-compressor',
'django_mobileesp',
'uw-restclients==1.1',
'django-htmlmin',
],
license='Apache License, Version 2.0',
description='A Django app to ...',
long_description=README,
url='http://www.example.com/',
author='Your Name',
author_email='yourname@example.com',
classifiers=[
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
],
)
| import os
from setuptools import setup
README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='mdot',
version='0.1',
packages=['mdot'],
include_package_data=True,
install_requires=[
'setuptools',
'django<1.9rc1',
'django-compressor',
'django_mobileesp',
'uw-restclients<2.0',
'django-htmlmin',
],
license='Apache License, Version 2.0',
description='A Django app to ...',
long_description=README,
url='http://www.example.com/',
author='Your Name',
author_email='yourname@example.com',
classifiers=[
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
],
)
Revert "Try less than 2.0."
This reverts commit 1bffae34a767e56943bb83027719fbe6dffcdc3b.import os
from setuptools import setup
README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='mdot',
version='0.1',
packages=['mdot'],
include_package_data=True,
install_requires=[
'setuptools',
'django<1.9rc1',
'django-compressor',
'django_mobileesp',
'uw-restclients==1.1',
'django-htmlmin',
],
license='Apache License, Version 2.0',
description='A Django app to ...',
long_description=README,
url='http://www.example.com/',
author='Your Name',
author_email='yourname@example.com',
classifiers=[
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
],
)
| <commit_before>import os
from setuptools import setup
README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='mdot',
version='0.1',
packages=['mdot'],
include_package_data=True,
install_requires=[
'setuptools',
'django<1.9rc1',
'django-compressor',
'django_mobileesp',
'uw-restclients<2.0',
'django-htmlmin',
],
license='Apache License, Version 2.0',
description='A Django app to ...',
long_description=README,
url='http://www.example.com/',
author='Your Name',
author_email='yourname@example.com',
classifiers=[
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
],
)
<commit_msg>Revert "Try less than 2.0."
This reverts commit 1bffae34a767e56943bb83027719fbe6dffcdc3b.<commit_after>import os
from setuptools import setup
README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='mdot',
version='0.1',
packages=['mdot'],
include_package_data=True,
install_requires=[
'setuptools',
'django<1.9rc1',
'django-compressor',
'django_mobileesp',
'uw-restclients==1.1',
'django-htmlmin',
],
license='Apache License, Version 2.0',
description='A Django app to ...',
long_description=README,
url='http://www.example.com/',
author='Your Name',
author_email='yourname@example.com',
classifiers=[
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
],
)
|
23f328b1abb8e21942fb1c23a67ab18304674c4d | setup.py | setup.py | #!/usr/bin/env python
import sys
import os
from setuptools import setup, find_packages
assert sys.version_info >= (2, 6), 'We only support Python 2.6+'
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'asana'))
from version import VERSION
setup(name='asana',
version=VERSION,
description='Asana API client',
# license='',
install_requires=[
'requests~=2.9.1',
'requests_oauthlib~=0.6.1',
'six~=1.10.0'
],
author='Asana, Inc',
# author_email='',
url='http://github.com/asana/python-asana',
packages = find_packages(),
keywords= 'asana',
zip_safe = True,
test_suite='tests')
| #!/usr/bin/env python
import sys
import os
from setuptools import setup, find_packages
from version import VERSION
assert sys.version_info >= (2, 6), 'We only support Python 2.6+'
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'asana'))
setup(
name='asana',
version=VERSION,
description='Asana API client',
license='MIT',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4'
],
install_requires=[
'requests~=2.9.1',
'requests_oauthlib~=0.6.1',
'six~=1.10.0'
],
author='Asana, Inc',
# author_email='',
url='http://github.com/asana/python-asana',
packages=find_packages(exclude=('tests',)),
keywords='asana',
zip_safe=True,
test_suite='tests')
| Add PyPI classifiers and additional metadata. | Add PyPI classifiers and additional metadata.
| Python | mit | Asana/python-asana,asana/python-asana,asana/python-asana | #!/usr/bin/env python
import sys
import os
from setuptools import setup, find_packages
assert sys.version_info >= (2, 6), 'We only support Python 2.6+'
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'asana'))
from version import VERSION
setup(name='asana',
version=VERSION,
description='Asana API client',
# license='',
install_requires=[
'requests~=2.9.1',
'requests_oauthlib~=0.6.1',
'six~=1.10.0'
],
author='Asana, Inc',
# author_email='',
url='http://github.com/asana/python-asana',
packages = find_packages(),
keywords= 'asana',
zip_safe = True,
test_suite='tests')
Add PyPI classifiers and additional metadata. | #!/usr/bin/env python
import sys
import os
from setuptools import setup, find_packages
from version import VERSION
assert sys.version_info >= (2, 6), 'We only support Python 2.6+'
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'asana'))
setup(
name='asana',
version=VERSION,
description='Asana API client',
license='MIT',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4'
],
install_requires=[
'requests~=2.9.1',
'requests_oauthlib~=0.6.1',
'six~=1.10.0'
],
author='Asana, Inc',
# author_email='',
url='http://github.com/asana/python-asana',
packages=find_packages(exclude=('tests',)),
keywords='asana',
zip_safe=True,
test_suite='tests')
| <commit_before>#!/usr/bin/env python
import sys
import os
from setuptools import setup, find_packages
assert sys.version_info >= (2, 6), 'We only support Python 2.6+'
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'asana'))
from version import VERSION
setup(name='asana',
version=VERSION,
description='Asana API client',
# license='',
install_requires=[
'requests~=2.9.1',
'requests_oauthlib~=0.6.1',
'six~=1.10.0'
],
author='Asana, Inc',
# author_email='',
url='http://github.com/asana/python-asana',
packages = find_packages(),
keywords= 'asana',
zip_safe = True,
test_suite='tests')
<commit_msg>Add PyPI classifiers and additional metadata.<commit_after> | #!/usr/bin/env python
import sys
import os
from setuptools import setup, find_packages
from version import VERSION
assert sys.version_info >= (2, 6), 'We only support Python 2.6+'
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'asana'))
setup(
name='asana',
version=VERSION,
description='Asana API client',
license='MIT',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4'
],
install_requires=[
'requests~=2.9.1',
'requests_oauthlib~=0.6.1',
'six~=1.10.0'
],
author='Asana, Inc',
# author_email='',
url='http://github.com/asana/python-asana',
packages=find_packages(exclude=('tests',)),
keywords='asana',
zip_safe=True,
test_suite='tests')
| #!/usr/bin/env python
import sys
import os
from setuptools import setup, find_packages
assert sys.version_info >= (2, 6), 'We only support Python 2.6+'
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'asana'))
from version import VERSION
setup(name='asana',
version=VERSION,
description='Asana API client',
# license='',
install_requires=[
'requests~=2.9.1',
'requests_oauthlib~=0.6.1',
'six~=1.10.0'
],
author='Asana, Inc',
# author_email='',
url='http://github.com/asana/python-asana',
packages = find_packages(),
keywords= 'asana',
zip_safe = True,
test_suite='tests')
Add PyPI classifiers and additional metadata.#!/usr/bin/env python
import sys
import os
from setuptools import setup, find_packages
from version import VERSION
assert sys.version_info >= (2, 6), 'We only support Python 2.6+'
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'asana'))
setup(
name='asana',
version=VERSION,
description='Asana API client',
license='MIT',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4'
],
install_requires=[
'requests~=2.9.1',
'requests_oauthlib~=0.6.1',
'six~=1.10.0'
],
author='Asana, Inc',
# author_email='',
url='http://github.com/asana/python-asana',
packages=find_packages(exclude=('tests',)),
keywords='asana',
zip_safe=True,
test_suite='tests')
| <commit_before>#!/usr/bin/env python
import sys
import os
from setuptools import setup, find_packages
assert sys.version_info >= (2, 6), 'We only support Python 2.6+'
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'asana'))
from version import VERSION
setup(name='asana',
version=VERSION,
description='Asana API client',
# license='',
install_requires=[
'requests~=2.9.1',
'requests_oauthlib~=0.6.1',
'six~=1.10.0'
],
author='Asana, Inc',
# author_email='',
url='http://github.com/asana/python-asana',
packages = find_packages(),
keywords= 'asana',
zip_safe = True,
test_suite='tests')
<commit_msg>Add PyPI classifiers and additional metadata.<commit_after>#!/usr/bin/env python
import sys
import os
from setuptools import setup, find_packages
from version import VERSION
assert sys.version_info >= (2, 6), 'We only support Python 2.6+'
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'asana'))
setup(
name='asana',
version=VERSION,
description='Asana API client',
license='MIT',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4'
],
install_requires=[
'requests~=2.9.1',
'requests_oauthlib~=0.6.1',
'six~=1.10.0'
],
author='Asana, Inc',
# author_email='',
url='http://github.com/asana/python-asana',
packages=find_packages(exclude=('tests',)),
keywords='asana',
zip_safe=True,
test_suite='tests')
|
09e320c678016a4a12fdecbbe36a7e1c1905cf5c | setup.py | setup.py | from setuptools import setup, find_packages
import os
version = '1.0'
setup(name='rhaptos.cnxmlutils',
version=version,
description="",
long_description=open("README.txt").read() + "\n" +
open(os.path.join("docs", "HISTORY.txt")).read(),
# Get more strings from
# http://pypi.python.org/pypi?:action=list_classifiers
classifiers=[
"Programming Language :: Python",
],
keywords='',
author='',
author_email='',
url='http://svn.plone.org/svn/collective/',
license='GPL',
packages=find_packages(exclude=['ez_setup']),
namespace_packages=['rhaptos'],
include_package_data=True,
zip_safe=False,
install_requires=[
'setuptools',
'lxml',
#'argparse',
# -*- Extra requirements: -*-
],
entry_points="""
# -*- Entry points: -*-
""",
)
| from setuptools import setup, find_packages
import os
version = '1.0'
setup(name='rhaptos.cnxmlutils',
version=version,
description="",
long_description=open("README.txt").read() + "\n" +
open(os.path.join("docs", "HISTORY.txt")).read(),
# Get more strings from
# http://pypi.python.org/pypi?:action=list_classifiers
classifiers=[
"Programming Language :: Python",
],
keywords='',
author='',
author_email='',
url='http://svn.plone.org/svn/collective/',
license='GPL',
packages=find_packages(exclude=['ez_setup']),
namespace_packages=['rhaptos'],
include_package_data=True,
zip_safe=False,
install_requires=[
'setuptools',
#'lxml',
#'argparse',
# -*- Extra requirements: -*-
],
entry_points="""
# -*- Entry points: -*-
""",
)
| Remove requirement for lxml (it's compiled/installed as a system package) | Remove requirement for lxml (it's compiled/installed as a system package)
| Python | agpl-3.0 | Connexions/rhaptos.cnxmlutils,Connexions/rhaptos.cnxmlutils,Connexions/rhaptos.cnxmlutils,Connexions/rhaptos.cnxmlutils,Connexions/rhaptos.cnxmlutils | from setuptools import setup, find_packages
import os
version = '1.0'
setup(name='rhaptos.cnxmlutils',
version=version,
description="",
long_description=open("README.txt").read() + "\n" +
open(os.path.join("docs", "HISTORY.txt")).read(),
# Get more strings from
# http://pypi.python.org/pypi?:action=list_classifiers
classifiers=[
"Programming Language :: Python",
],
keywords='',
author='',
author_email='',
url='http://svn.plone.org/svn/collective/',
license='GPL',
packages=find_packages(exclude=['ez_setup']),
namespace_packages=['rhaptos'],
include_package_data=True,
zip_safe=False,
install_requires=[
'setuptools',
'lxml',
#'argparse',
# -*- Extra requirements: -*-
],
entry_points="""
# -*- Entry points: -*-
""",
)
Remove requirement for lxml (it's compiled/installed as a system package) | from setuptools import setup, find_packages
import os
version = '1.0'
setup(name='rhaptos.cnxmlutils',
version=version,
description="",
long_description=open("README.txt").read() + "\n" +
open(os.path.join("docs", "HISTORY.txt")).read(),
# Get more strings from
# http://pypi.python.org/pypi?:action=list_classifiers
classifiers=[
"Programming Language :: Python",
],
keywords='',
author='',
author_email='',
url='http://svn.plone.org/svn/collective/',
license='GPL',
packages=find_packages(exclude=['ez_setup']),
namespace_packages=['rhaptos'],
include_package_data=True,
zip_safe=False,
install_requires=[
'setuptools',
#'lxml',
#'argparse',
# -*- Extra requirements: -*-
],
entry_points="""
# -*- Entry points: -*-
""",
)
| <commit_before>from setuptools import setup, find_packages
import os
version = '1.0'
setup(name='rhaptos.cnxmlutils',
version=version,
description="",
long_description=open("README.txt").read() + "\n" +
open(os.path.join("docs", "HISTORY.txt")).read(),
# Get more strings from
# http://pypi.python.org/pypi?:action=list_classifiers
classifiers=[
"Programming Language :: Python",
],
keywords='',
author='',
author_email='',
url='http://svn.plone.org/svn/collective/',
license='GPL',
packages=find_packages(exclude=['ez_setup']),
namespace_packages=['rhaptos'],
include_package_data=True,
zip_safe=False,
install_requires=[
'setuptools',
'lxml',
#'argparse',
# -*- Extra requirements: -*-
],
entry_points="""
# -*- Entry points: -*-
""",
)
<commit_msg>Remove requirement for lxml (it's compiled/installed as a system package)<commit_after> | from setuptools import setup, find_packages
import os
version = '1.0'
setup(name='rhaptos.cnxmlutils',
version=version,
description="",
long_description=open("README.txt").read() + "\n" +
open(os.path.join("docs", "HISTORY.txt")).read(),
# Get more strings from
# http://pypi.python.org/pypi?:action=list_classifiers
classifiers=[
"Programming Language :: Python",
],
keywords='',
author='',
author_email='',
url='http://svn.plone.org/svn/collective/',
license='GPL',
packages=find_packages(exclude=['ez_setup']),
namespace_packages=['rhaptos'],
include_package_data=True,
zip_safe=False,
install_requires=[
'setuptools',
#'lxml',
#'argparse',
# -*- Extra requirements: -*-
],
entry_points="""
# -*- Entry points: -*-
""",
)
| from setuptools import setup, find_packages
import os
version = '1.0'
setup(name='rhaptos.cnxmlutils',
version=version,
description="",
long_description=open("README.txt").read() + "\n" +
open(os.path.join("docs", "HISTORY.txt")).read(),
# Get more strings from
# http://pypi.python.org/pypi?:action=list_classifiers
classifiers=[
"Programming Language :: Python",
],
keywords='',
author='',
author_email='',
url='http://svn.plone.org/svn/collective/',
license='GPL',
packages=find_packages(exclude=['ez_setup']),
namespace_packages=['rhaptos'],
include_package_data=True,
zip_safe=False,
install_requires=[
'setuptools',
'lxml',
#'argparse',
# -*- Extra requirements: -*-
],
entry_points="""
# -*- Entry points: -*-
""",
)
Remove requirement for lxml (it's compiled/installed as a system package)from setuptools import setup, find_packages
import os
version = '1.0'
setup(name='rhaptos.cnxmlutils',
version=version,
description="",
long_description=open("README.txt").read() + "\n" +
open(os.path.join("docs", "HISTORY.txt")).read(),
# Get more strings from
# http://pypi.python.org/pypi?:action=list_classifiers
classifiers=[
"Programming Language :: Python",
],
keywords='',
author='',
author_email='',
url='http://svn.plone.org/svn/collective/',
license='GPL',
packages=find_packages(exclude=['ez_setup']),
namespace_packages=['rhaptos'],
include_package_data=True,
zip_safe=False,
install_requires=[
'setuptools',
#'lxml',
#'argparse',
# -*- Extra requirements: -*-
],
entry_points="""
# -*- Entry points: -*-
""",
)
| <commit_before>from setuptools import setup, find_packages
import os
version = '1.0'
setup(name='rhaptos.cnxmlutils',
version=version,
description="",
long_description=open("README.txt").read() + "\n" +
open(os.path.join("docs", "HISTORY.txt")).read(),
# Get more strings from
# http://pypi.python.org/pypi?:action=list_classifiers
classifiers=[
"Programming Language :: Python",
],
keywords='',
author='',
author_email='',
url='http://svn.plone.org/svn/collective/',
license='GPL',
packages=find_packages(exclude=['ez_setup']),
namespace_packages=['rhaptos'],
include_package_data=True,
zip_safe=False,
install_requires=[
'setuptools',
'lxml',
#'argparse',
# -*- Extra requirements: -*-
],
entry_points="""
# -*- Entry points: -*-
""",
)
<commit_msg>Remove requirement for lxml (it's compiled/installed as a system package)<commit_after>from setuptools import setup, find_packages
import os
version = '1.0'
setup(name='rhaptos.cnxmlutils',
version=version,
description="",
long_description=open("README.txt").read() + "\n" +
open(os.path.join("docs", "HISTORY.txt")).read(),
# Get more strings from
# http://pypi.python.org/pypi?:action=list_classifiers
classifiers=[
"Programming Language :: Python",
],
keywords='',
author='',
author_email='',
url='http://svn.plone.org/svn/collective/',
license='GPL',
packages=find_packages(exclude=['ez_setup']),
namespace_packages=['rhaptos'],
include_package_data=True,
zip_safe=False,
install_requires=[
'setuptools',
#'lxml',
#'argparse',
# -*- Extra requirements: -*-
],
entry_points="""
# -*- Entry points: -*-
""",
)
|
915e7a12e7e30aba93e9008c6daed32c38435f0c | setup.py | setup.py | from setuptools import setup, find_packages
version = open('VERSION').read().strip()
setup(
name="btw-backup",
version=version,
packages=find_packages(),
entry_points={
'console_scripts': [
'btw-backup = btw_backup.__main__:main'
],
},
author="Louis-Dominique Dubeau",
author_email="ldd@lddubeau.com",
description="Backup script for BTW.",
license="MPL 2.0",
keywords=["backup"],
url="https://github.com/mangalam-research/btw-backup",
install_requires=[
'pytimeparse>=1.1.4,<=2',
'pyhash>=0.6.2,<1',
'pyee>=1.0.2,<2',
'awscli>=1.10.21,<2'
],
tests_require = [
'psycopg2>=2.5.2,<3'
],
test_suite= 'nose.collector',
setup_requires=['nose>=1.3.0'],
data_files=[
('.', ['LICENSE', 'VERSION'])
],
# use_2to3=True,
classifiers=[
"Programming Language :: Python :: 2.7",
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"Operating System :: POSIX",
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)"],
)
| from setuptools import setup, find_packages
version = open('VERSION').read().strip()
setup(
name="btw-backup",
version=version,
packages=find_packages(),
entry_points={
'console_scripts': [
'btw-backup = btw_backup.__main__:main'
],
},
author="Louis-Dominique Dubeau",
author_email="ldd@lddubeau.com",
description="Backup script for BTW.",
license="MPL 2.0",
keywords=["backup"],
url="https://github.com/mangalam-research/btw-backup",
install_requires=[
'pytimeparse>=1.1.4,<=2',
'pyhash>=0.6.2,<1',
'pyee>=1.0.2,<2',
'awscli>=1.10.21,<2',
's3cmd<3',
],
tests_require=[
'psycopg2>=2.5.2,<3'
],
test_suite='nose.collector',
setup_requires=['nose>=1.3.0'],
data_files=[
('.', ['LICENSE', 'VERSION'])
],
# use_2to3=True,
classifiers=[
"Programming Language :: Python :: 2.7",
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"Operating System :: POSIX",
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)"],
)
| Add s3cmd to the list of requirements. | Add s3cmd to the list of requirements.
| Python | mpl-2.0 | mangalam-research/btw-backup,mangalam-research/btw-backup | from setuptools import setup, find_packages
version = open('VERSION').read().strip()
setup(
name="btw-backup",
version=version,
packages=find_packages(),
entry_points={
'console_scripts': [
'btw-backup = btw_backup.__main__:main'
],
},
author="Louis-Dominique Dubeau",
author_email="ldd@lddubeau.com",
description="Backup script for BTW.",
license="MPL 2.0",
keywords=["backup"],
url="https://github.com/mangalam-research/btw-backup",
install_requires=[
'pytimeparse>=1.1.4,<=2',
'pyhash>=0.6.2,<1',
'pyee>=1.0.2,<2',
'awscli>=1.10.21,<2'
],
tests_require = [
'psycopg2>=2.5.2,<3'
],
test_suite= 'nose.collector',
setup_requires=['nose>=1.3.0'],
data_files=[
('.', ['LICENSE', 'VERSION'])
],
# use_2to3=True,
classifiers=[
"Programming Language :: Python :: 2.7",
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"Operating System :: POSIX",
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)"],
)
Add s3cmd to the list of requirements. | from setuptools import setup, find_packages
version = open('VERSION').read().strip()
setup(
name="btw-backup",
version=version,
packages=find_packages(),
entry_points={
'console_scripts': [
'btw-backup = btw_backup.__main__:main'
],
},
author="Louis-Dominique Dubeau",
author_email="ldd@lddubeau.com",
description="Backup script for BTW.",
license="MPL 2.0",
keywords=["backup"],
url="https://github.com/mangalam-research/btw-backup",
install_requires=[
'pytimeparse>=1.1.4,<=2',
'pyhash>=0.6.2,<1',
'pyee>=1.0.2,<2',
'awscli>=1.10.21,<2',
's3cmd<3',
],
tests_require=[
'psycopg2>=2.5.2,<3'
],
test_suite='nose.collector',
setup_requires=['nose>=1.3.0'],
data_files=[
('.', ['LICENSE', 'VERSION'])
],
# use_2to3=True,
classifiers=[
"Programming Language :: Python :: 2.7",
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"Operating System :: POSIX",
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)"],
)
| <commit_before>from setuptools import setup, find_packages
version = open('VERSION').read().strip()
setup(
name="btw-backup",
version=version,
packages=find_packages(),
entry_points={
'console_scripts': [
'btw-backup = btw_backup.__main__:main'
],
},
author="Louis-Dominique Dubeau",
author_email="ldd@lddubeau.com",
description="Backup script for BTW.",
license="MPL 2.0",
keywords=["backup"],
url="https://github.com/mangalam-research/btw-backup",
install_requires=[
'pytimeparse>=1.1.4,<=2',
'pyhash>=0.6.2,<1',
'pyee>=1.0.2,<2',
'awscli>=1.10.21,<2'
],
tests_require = [
'psycopg2>=2.5.2,<3'
],
test_suite= 'nose.collector',
setup_requires=['nose>=1.3.0'],
data_files=[
('.', ['LICENSE', 'VERSION'])
],
# use_2to3=True,
classifiers=[
"Programming Language :: Python :: 2.7",
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"Operating System :: POSIX",
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)"],
)
<commit_msg>Add s3cmd to the list of requirements.<commit_after> | from setuptools import setup, find_packages
version = open('VERSION').read().strip()
setup(
name="btw-backup",
version=version,
packages=find_packages(),
entry_points={
'console_scripts': [
'btw-backup = btw_backup.__main__:main'
],
},
author="Louis-Dominique Dubeau",
author_email="ldd@lddubeau.com",
description="Backup script for BTW.",
license="MPL 2.0",
keywords=["backup"],
url="https://github.com/mangalam-research/btw-backup",
install_requires=[
'pytimeparse>=1.1.4,<=2',
'pyhash>=0.6.2,<1',
'pyee>=1.0.2,<2',
'awscli>=1.10.21,<2',
's3cmd<3',
],
tests_require=[
'psycopg2>=2.5.2,<3'
],
test_suite='nose.collector',
setup_requires=['nose>=1.3.0'],
data_files=[
('.', ['LICENSE', 'VERSION'])
],
# use_2to3=True,
classifiers=[
"Programming Language :: Python :: 2.7",
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"Operating System :: POSIX",
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)"],
)
| from setuptools import setup, find_packages
version = open('VERSION').read().strip()
setup(
name="btw-backup",
version=version,
packages=find_packages(),
entry_points={
'console_scripts': [
'btw-backup = btw_backup.__main__:main'
],
},
author="Louis-Dominique Dubeau",
author_email="ldd@lddubeau.com",
description="Backup script for BTW.",
license="MPL 2.0",
keywords=["backup"],
url="https://github.com/mangalam-research/btw-backup",
install_requires=[
'pytimeparse>=1.1.4,<=2',
'pyhash>=0.6.2,<1',
'pyee>=1.0.2,<2',
'awscli>=1.10.21,<2'
],
tests_require = [
'psycopg2>=2.5.2,<3'
],
test_suite= 'nose.collector',
setup_requires=['nose>=1.3.0'],
data_files=[
('.', ['LICENSE', 'VERSION'])
],
# use_2to3=True,
classifiers=[
"Programming Language :: Python :: 2.7",
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"Operating System :: POSIX",
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)"],
)
Add s3cmd to the list of requirements.from setuptools import setup, find_packages
version = open('VERSION').read().strip()
setup(
name="btw-backup",
version=version,
packages=find_packages(),
entry_points={
'console_scripts': [
'btw-backup = btw_backup.__main__:main'
],
},
author="Louis-Dominique Dubeau",
author_email="ldd@lddubeau.com",
description="Backup script for BTW.",
license="MPL 2.0",
keywords=["backup"],
url="https://github.com/mangalam-research/btw-backup",
install_requires=[
'pytimeparse>=1.1.4,<=2',
'pyhash>=0.6.2,<1',
'pyee>=1.0.2,<2',
'awscli>=1.10.21,<2',
's3cmd<3',
],
tests_require=[
'psycopg2>=2.5.2,<3'
],
test_suite='nose.collector',
setup_requires=['nose>=1.3.0'],
data_files=[
('.', ['LICENSE', 'VERSION'])
],
# use_2to3=True,
classifiers=[
"Programming Language :: Python :: 2.7",
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"Operating System :: POSIX",
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)"],
)
| <commit_before>from setuptools import setup, find_packages
version = open('VERSION').read().strip()
setup(
name="btw-backup",
version=version,
packages=find_packages(),
entry_points={
'console_scripts': [
'btw-backup = btw_backup.__main__:main'
],
},
author="Louis-Dominique Dubeau",
author_email="ldd@lddubeau.com",
description="Backup script for BTW.",
license="MPL 2.0",
keywords=["backup"],
url="https://github.com/mangalam-research/btw-backup",
install_requires=[
'pytimeparse>=1.1.4,<=2',
'pyhash>=0.6.2,<1',
'pyee>=1.0.2,<2',
'awscli>=1.10.21,<2'
],
tests_require = [
'psycopg2>=2.5.2,<3'
],
test_suite= 'nose.collector',
setup_requires=['nose>=1.3.0'],
data_files=[
('.', ['LICENSE', 'VERSION'])
],
# use_2to3=True,
classifiers=[
"Programming Language :: Python :: 2.7",
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"Operating System :: POSIX",
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)"],
)
<commit_msg>Add s3cmd to the list of requirements.<commit_after>from setuptools import setup, find_packages
version = open('VERSION').read().strip()
setup(
name="btw-backup",
version=version,
packages=find_packages(),
entry_points={
'console_scripts': [
'btw-backup = btw_backup.__main__:main'
],
},
author="Louis-Dominique Dubeau",
author_email="ldd@lddubeau.com",
description="Backup script for BTW.",
license="MPL 2.0",
keywords=["backup"],
url="https://github.com/mangalam-research/btw-backup",
install_requires=[
'pytimeparse>=1.1.4,<=2',
'pyhash>=0.6.2,<1',
'pyee>=1.0.2,<2',
'awscli>=1.10.21,<2',
's3cmd<3',
],
tests_require=[
'psycopg2>=2.5.2,<3'
],
test_suite='nose.collector',
setup_requires=['nose>=1.3.0'],
data_files=[
('.', ['LICENSE', 'VERSION'])
],
# use_2to3=True,
classifiers=[
"Programming Language :: Python :: 2.7",
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"Operating System :: POSIX",
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)"],
)
|
349b0efb7a3714439f208c967cce2a0cd7344167 | setup.py | setup.py | import os
from setuptools import setup
def read(*paths):
"""Build a file path from *paths* and return the contents."""
with open(os.path.join(*paths), 'r') as f:
return f.read()
setup(
name='pykismet3',
version='0.1.0',
description='A Python 3 module for the Akismet spam comment-spam-detection web service.',
long_description=(read('README.md')),
url='https://github.com/grundleborg/pykismet',
license='MIT',
author='George Goldberg',
author_email='george@grundleborg.com',
py_modules=['pykismet3'],
include_package_data=True,
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'Natural Language :: English',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Topic :: Software Development :: Libraries :: Python Modules',
],
install_requires=[ "requests", ],
)
| import os
from setuptools import setup
def read(*paths):
"""Build a file path from *paths* and return the contents."""
with open(os.path.join(*paths), 'r') as f:
return f.read()
setup(
name='pykismet3',
version='0.1.0',
description='A Python 3 module for the Akismet spam comment-spam-detection web service.',
long_description=(read('README.md')),
url='https://github.com/grundleborg/pykismet3',
license='MIT',
author='George Goldberg',
author_email='george@grundleborg.com',
py_modules=['pykismet3'],
include_package_data=True,
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'Natural Language :: English',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Topic :: Software Development :: Libraries :: Python Modules',
],
install_requires=[ "requests", ],
)
| Fix URL to renamed github repo. | Fix URL to renamed github repo.
| Python | mit | grundleborg/pykismet3 | import os
from setuptools import setup
def read(*paths):
"""Build a file path from *paths* and return the contents."""
with open(os.path.join(*paths), 'r') as f:
return f.read()
setup(
name='pykismet3',
version='0.1.0',
description='A Python 3 module for the Akismet spam comment-spam-detection web service.',
long_description=(read('README.md')),
url='https://github.com/grundleborg/pykismet',
license='MIT',
author='George Goldberg',
author_email='george@grundleborg.com',
py_modules=['pykismet3'],
include_package_data=True,
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'Natural Language :: English',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Topic :: Software Development :: Libraries :: Python Modules',
],
install_requires=[ "requests", ],
)
Fix URL to renamed github repo. | import os
from setuptools import setup
def read(*paths):
"""Build a file path from *paths* and return the contents."""
with open(os.path.join(*paths), 'r') as f:
return f.read()
setup(
name='pykismet3',
version='0.1.0',
description='A Python 3 module for the Akismet spam comment-spam-detection web service.',
long_description=(read('README.md')),
url='https://github.com/grundleborg/pykismet3',
license='MIT',
author='George Goldberg',
author_email='george@grundleborg.com',
py_modules=['pykismet3'],
include_package_data=True,
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'Natural Language :: English',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Topic :: Software Development :: Libraries :: Python Modules',
],
install_requires=[ "requests", ],
)
| <commit_before>import os
from setuptools import setup
def read(*paths):
"""Build a file path from *paths* and return the contents."""
with open(os.path.join(*paths), 'r') as f:
return f.read()
setup(
name='pykismet3',
version='0.1.0',
description='A Python 3 module for the Akismet spam comment-spam-detection web service.',
long_description=(read('README.md')),
url='https://github.com/grundleborg/pykismet',
license='MIT',
author='George Goldberg',
author_email='george@grundleborg.com',
py_modules=['pykismet3'],
include_package_data=True,
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'Natural Language :: English',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Topic :: Software Development :: Libraries :: Python Modules',
],
install_requires=[ "requests", ],
)
<commit_msg>Fix URL to renamed github repo.<commit_after> | import os
from setuptools import setup
def read(*paths):
"""Build a file path from *paths* and return the contents."""
with open(os.path.join(*paths), 'r') as f:
return f.read()
setup(
name='pykismet3',
version='0.1.0',
description='A Python 3 module for the Akismet spam comment-spam-detection web service.',
long_description=(read('README.md')),
url='https://github.com/grundleborg/pykismet3',
license='MIT',
author='George Goldberg',
author_email='george@grundleborg.com',
py_modules=['pykismet3'],
include_package_data=True,
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'Natural Language :: English',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Topic :: Software Development :: Libraries :: Python Modules',
],
install_requires=[ "requests", ],
)
| import os
from setuptools import setup
def read(*paths):
"""Build a file path from *paths* and return the contents."""
with open(os.path.join(*paths), 'r') as f:
return f.read()
setup(
name='pykismet3',
version='0.1.0',
description='A Python 3 module for the Akismet spam comment-spam-detection web service.',
long_description=(read('README.md')),
url='https://github.com/grundleborg/pykismet',
license='MIT',
author='George Goldberg',
author_email='george@grundleborg.com',
py_modules=['pykismet3'],
include_package_data=True,
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'Natural Language :: English',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Topic :: Software Development :: Libraries :: Python Modules',
],
install_requires=[ "requests", ],
)
Fix URL to renamed github repo.import os
from setuptools import setup
def read(*paths):
"""Build a file path from *paths* and return the contents."""
with open(os.path.join(*paths), 'r') as f:
return f.read()
setup(
name='pykismet3',
version='0.1.0',
description='A Python 3 module for the Akismet spam comment-spam-detection web service.',
long_description=(read('README.md')),
url='https://github.com/grundleborg/pykismet3',
license='MIT',
author='George Goldberg',
author_email='george@grundleborg.com',
py_modules=['pykismet3'],
include_package_data=True,
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'Natural Language :: English',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Topic :: Software Development :: Libraries :: Python Modules',
],
install_requires=[ "requests", ],
)
| <commit_before>import os
from setuptools import setup
def read(*paths):
"""Build a file path from *paths* and return the contents."""
with open(os.path.join(*paths), 'r') as f:
return f.read()
setup(
name='pykismet3',
version='0.1.0',
description='A Python 3 module for the Akismet spam comment-spam-detection web service.',
long_description=(read('README.md')),
url='https://github.com/grundleborg/pykismet',
license='MIT',
author='George Goldberg',
author_email='george@grundleborg.com',
py_modules=['pykismet3'],
include_package_data=True,
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'Natural Language :: English',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Topic :: Software Development :: Libraries :: Python Modules',
],
install_requires=[ "requests", ],
)
<commit_msg>Fix URL to renamed github repo.<commit_after>import os
from setuptools import setup
def read(*paths):
"""Build a file path from *paths* and return the contents."""
with open(os.path.join(*paths), 'r') as f:
return f.read()
setup(
name='pykismet3',
version='0.1.0',
description='A Python 3 module for the Akismet spam comment-spam-detection web service.',
long_description=(read('README.md')),
url='https://github.com/grundleborg/pykismet3',
license='MIT',
author='George Goldberg',
author_email='george@grundleborg.com',
py_modules=['pykismet3'],
include_package_data=True,
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'Natural Language :: English',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Topic :: Software Development :: Libraries :: Python Modules',
],
install_requires=[ "requests", ],
)
|
ddb70c43c0b63cb5af74fb059975cac17bf9f7b9 | mdot_rest/views.py | mdot_rest/views.py | from django.shortcuts import render
from .models import Resource
from .serializers import ResourceSerializer
from rest_framework import generics
class ResourceList(generics.ListCreateAPIView):
queryset = Resource.objects.all()
serializer_class = ResourceSerializer
class ResourceDetail(generics.RetrieveUpdateDestroyAPIView):
queryset = Resource.objects.all()
serializer_class = ResourceSerializer
| from django.shortcuts import render
from .models import Resource
from .serializers import ResourceSerializer
from rest_framework import generics, permissions
class ResourceList(generics.ListCreateAPIView):
queryset = Resource.objects.all()
serializer_class = ResourceSerializer
permission_classes = (permissions.IsAuthenticatedOrReadOnly,)
class ResourceDetail(generics.RetrieveUpdateDestroyAPIView):
queryset = Resource.objects.all()
serializer_class = ResourceSerializer
permission_classes = (permissions.IsAuthenticatedOrReadOnly,)
| Make the API read only unless authenticated. | Make the API read only unless authenticated.
| Python | apache-2.0 | uw-it-aca/mdot-rest,uw-it-aca/mdot-rest | from django.shortcuts import render
from .models import Resource
from .serializers import ResourceSerializer
from rest_framework import generics
class ResourceList(generics.ListCreateAPIView):
queryset = Resource.objects.all()
serializer_class = ResourceSerializer
class ResourceDetail(generics.RetrieveUpdateDestroyAPIView):
queryset = Resource.objects.all()
serializer_class = ResourceSerializer
Make the API read only unless authenticated. | from django.shortcuts import render
from .models import Resource
from .serializers import ResourceSerializer
from rest_framework import generics, permissions
class ResourceList(generics.ListCreateAPIView):
queryset = Resource.objects.all()
serializer_class = ResourceSerializer
permission_classes = (permissions.IsAuthenticatedOrReadOnly,)
class ResourceDetail(generics.RetrieveUpdateDestroyAPIView):
queryset = Resource.objects.all()
serializer_class = ResourceSerializer
permission_classes = (permissions.IsAuthenticatedOrReadOnly,)
| <commit_before>from django.shortcuts import render
from .models import Resource
from .serializers import ResourceSerializer
from rest_framework import generics
class ResourceList(generics.ListCreateAPIView):
queryset = Resource.objects.all()
serializer_class = ResourceSerializer
class ResourceDetail(generics.RetrieveUpdateDestroyAPIView):
queryset = Resource.objects.all()
serializer_class = ResourceSerializer
<commit_msg>Make the API read only unless authenticated.<commit_after> | from django.shortcuts import render
from .models import Resource
from .serializers import ResourceSerializer
from rest_framework import generics, permissions
class ResourceList(generics.ListCreateAPIView):
queryset = Resource.objects.all()
serializer_class = ResourceSerializer
permission_classes = (permissions.IsAuthenticatedOrReadOnly,)
class ResourceDetail(generics.RetrieveUpdateDestroyAPIView):
queryset = Resource.objects.all()
serializer_class = ResourceSerializer
permission_classes = (permissions.IsAuthenticatedOrReadOnly,)
| from django.shortcuts import render
from .models import Resource
from .serializers import ResourceSerializer
from rest_framework import generics
class ResourceList(generics.ListCreateAPIView):
queryset = Resource.objects.all()
serializer_class = ResourceSerializer
class ResourceDetail(generics.RetrieveUpdateDestroyAPIView):
queryset = Resource.objects.all()
serializer_class = ResourceSerializer
Make the API read only unless authenticated.from django.shortcuts import render
from .models import Resource
from .serializers import ResourceSerializer
from rest_framework import generics, permissions
class ResourceList(generics.ListCreateAPIView):
queryset = Resource.objects.all()
serializer_class = ResourceSerializer
permission_classes = (permissions.IsAuthenticatedOrReadOnly,)
class ResourceDetail(generics.RetrieveUpdateDestroyAPIView):
queryset = Resource.objects.all()
serializer_class = ResourceSerializer
permission_classes = (permissions.IsAuthenticatedOrReadOnly,)
| <commit_before>from django.shortcuts import render
from .models import Resource
from .serializers import ResourceSerializer
from rest_framework import generics
class ResourceList(generics.ListCreateAPIView):
queryset = Resource.objects.all()
serializer_class = ResourceSerializer
class ResourceDetail(generics.RetrieveUpdateDestroyAPIView):
queryset = Resource.objects.all()
serializer_class = ResourceSerializer
<commit_msg>Make the API read only unless authenticated.<commit_after>from django.shortcuts import render
from .models import Resource
from .serializers import ResourceSerializer
from rest_framework import generics, permissions
class ResourceList(generics.ListCreateAPIView):
queryset = Resource.objects.all()
serializer_class = ResourceSerializer
permission_classes = (permissions.IsAuthenticatedOrReadOnly,)
class ResourceDetail(generics.RetrieveUpdateDestroyAPIView):
queryset = Resource.objects.all()
serializer_class = ResourceSerializer
permission_classes = (permissions.IsAuthenticatedOrReadOnly,)
|
e5ab635527281f9647f444e59ade4449d53aa979 | alexa/__init__.py | alexa/__init__.py | """
This script downloads the alexa top 1M sites, unzips it, and reads the CSV and
returns a list of the top N sites.
"""
import zipfile
import cStringIO
from urllib import urlopen
ALEXA_DATA_URL = 'http://s3.amazonaws.com/alexa-static/top-1m.csv.zip'
def alexa_etl():
"""
Generator that:
Extracts by downloading the csv.zip, unzipping.
Transforms the data into python via CSV lib
Loads it to the end user as a python list
"""
f = urlopen(ALEXA_DATA_URL)
buf = cStringIO.StringIO(f.read())
zfile = zipfile.ZipFile(buf)
buf = cStringIO.StringIO(zfile.read('top-1m.csv'))
for line in buf:
(rank, domain) = line.split(',')
yield (int(rank), domain.strip())
def top_list(num=100):
a = alexa_etl()
return [a.next() for x in xrange(num)]
if __name__ == "__main__":
print alexa_list()
| """
This script downloads the alexa top 1M sites, unzips it, and reads the CSV and
returns a list of the top N sites.
"""
import zipfile
import cStringIO
from urllib import urlopen
ALEXA_DATA_URL = 'http://s3.amazonaws.com/alexa-static/top-1m.csv.zip'
def alexa_etl():
"""
Generator that:
Extracts by downloading the csv.zip, unzipping.
Transforms the data into python via CSV lib
Loads it to the end user as a python list
"""
f = urlopen(ALEXA_DATA_URL)
buf = cStringIO.StringIO(f.read())
zfile = zipfile.ZipFile(buf)
buf = cStringIO.StringIO(zfile.read('top-1m.csv'))
for line in buf:
(rank, domain) = line.split(',')
yield (int(rank), domain.strip())
def top_list(num=100):
a = alexa_etl()
return [a.next() for x in xrange(num)]
if __name__ == "__main__":
print top_list()
| Fix error when run as script | Fix error when run as script
Change method call from alexa_list(), which is undefined, to top_list()
| Python | bsd-3-clause | davedash/Alexa-Top-Sites | """
This script downloads the alexa top 1M sites, unzips it, and reads the CSV and
returns a list of the top N sites.
"""
import zipfile
import cStringIO
from urllib import urlopen
ALEXA_DATA_URL = 'http://s3.amazonaws.com/alexa-static/top-1m.csv.zip'
def alexa_etl():
"""
Generator that:
Extracts by downloading the csv.zip, unzipping.
Transforms the data into python via CSV lib
Loads it to the end user as a python list
"""
f = urlopen(ALEXA_DATA_URL)
buf = cStringIO.StringIO(f.read())
zfile = zipfile.ZipFile(buf)
buf = cStringIO.StringIO(zfile.read('top-1m.csv'))
for line in buf:
(rank, domain) = line.split(',')
yield (int(rank), domain.strip())
def top_list(num=100):
a = alexa_etl()
return [a.next() for x in xrange(num)]
if __name__ == "__main__":
print alexa_list()
Fix error when run as script
Change method call from alexa_list(), which is undefined, to top_list() | """
This script downloads the alexa top 1M sites, unzips it, and reads the CSV and
returns a list of the top N sites.
"""
import zipfile
import cStringIO
from urllib import urlopen
ALEXA_DATA_URL = 'http://s3.amazonaws.com/alexa-static/top-1m.csv.zip'
def alexa_etl():
"""
Generator that:
Extracts by downloading the csv.zip, unzipping.
Transforms the data into python via CSV lib
Loads it to the end user as a python list
"""
f = urlopen(ALEXA_DATA_URL)
buf = cStringIO.StringIO(f.read())
zfile = zipfile.ZipFile(buf)
buf = cStringIO.StringIO(zfile.read('top-1m.csv'))
for line in buf:
(rank, domain) = line.split(',')
yield (int(rank), domain.strip())
def top_list(num=100):
a = alexa_etl()
return [a.next() for x in xrange(num)]
if __name__ == "__main__":
print top_list()
| <commit_before>"""
This script downloads the alexa top 1M sites, unzips it, and reads the CSV and
returns a list of the top N sites.
"""
import zipfile
import cStringIO
from urllib import urlopen
ALEXA_DATA_URL = 'http://s3.amazonaws.com/alexa-static/top-1m.csv.zip'
def alexa_etl():
"""
Generator that:
Extracts by downloading the csv.zip, unzipping.
Transforms the data into python via CSV lib
Loads it to the end user as a python list
"""
f = urlopen(ALEXA_DATA_URL)
buf = cStringIO.StringIO(f.read())
zfile = zipfile.ZipFile(buf)
buf = cStringIO.StringIO(zfile.read('top-1m.csv'))
for line in buf:
(rank, domain) = line.split(',')
yield (int(rank), domain.strip())
def top_list(num=100):
a = alexa_etl()
return [a.next() for x in xrange(num)]
if __name__ == "__main__":
print alexa_list()
<commit_msg>Fix error when run as script
Change method call from alexa_list(), which is undefined, to top_list()<commit_after> | """
This script downloads the alexa top 1M sites, unzips it, and reads the CSV and
returns a list of the top N sites.
"""
import zipfile
import cStringIO
from urllib import urlopen
ALEXA_DATA_URL = 'http://s3.amazonaws.com/alexa-static/top-1m.csv.zip'
def alexa_etl():
"""
Generator that:
Extracts by downloading the csv.zip, unzipping.
Transforms the data into python via CSV lib
Loads it to the end user as a python list
"""
f = urlopen(ALEXA_DATA_URL)
buf = cStringIO.StringIO(f.read())
zfile = zipfile.ZipFile(buf)
buf = cStringIO.StringIO(zfile.read('top-1m.csv'))
for line in buf:
(rank, domain) = line.split(',')
yield (int(rank), domain.strip())
def top_list(num=100):
a = alexa_etl()
return [a.next() for x in xrange(num)]
if __name__ == "__main__":
print top_list()
| """
This script downloads the alexa top 1M sites, unzips it, and reads the CSV and
returns a list of the top N sites.
"""
import zipfile
import cStringIO
from urllib import urlopen
ALEXA_DATA_URL = 'http://s3.amazonaws.com/alexa-static/top-1m.csv.zip'
def alexa_etl():
"""
Generator that:
Extracts by downloading the csv.zip, unzipping.
Transforms the data into python via CSV lib
Loads it to the end user as a python list
"""
f = urlopen(ALEXA_DATA_URL)
buf = cStringIO.StringIO(f.read())
zfile = zipfile.ZipFile(buf)
buf = cStringIO.StringIO(zfile.read('top-1m.csv'))
for line in buf:
(rank, domain) = line.split(',')
yield (int(rank), domain.strip())
def top_list(num=100):
a = alexa_etl()
return [a.next() for x in xrange(num)]
if __name__ == "__main__":
print alexa_list()
Fix error when run as script
Change method call from alexa_list(), which is undefined, to top_list()"""
This script downloads the alexa top 1M sites, unzips it, and reads the CSV and
returns a list of the top N sites.
"""
import zipfile
import cStringIO
from urllib import urlopen
ALEXA_DATA_URL = 'http://s3.amazonaws.com/alexa-static/top-1m.csv.zip'
def alexa_etl():
"""
Generator that:
Extracts by downloading the csv.zip, unzipping.
Transforms the data into python via CSV lib
Loads it to the end user as a python list
"""
f = urlopen(ALEXA_DATA_URL)
buf = cStringIO.StringIO(f.read())
zfile = zipfile.ZipFile(buf)
buf = cStringIO.StringIO(zfile.read('top-1m.csv'))
for line in buf:
(rank, domain) = line.split(',')
yield (int(rank), domain.strip())
def top_list(num=100):
a = alexa_etl()
return [a.next() for x in xrange(num)]
if __name__ == "__main__":
print top_list()
| <commit_before>"""
This script downloads the alexa top 1M sites, unzips it, and reads the CSV and
returns a list of the top N sites.
"""
import zipfile
import cStringIO
from urllib import urlopen
ALEXA_DATA_URL = 'http://s3.amazonaws.com/alexa-static/top-1m.csv.zip'
def alexa_etl():
"""
Generator that:
Extracts by downloading the csv.zip, unzipping.
Transforms the data into python via CSV lib
Loads it to the end user as a python list
"""
f = urlopen(ALEXA_DATA_URL)
buf = cStringIO.StringIO(f.read())
zfile = zipfile.ZipFile(buf)
buf = cStringIO.StringIO(zfile.read('top-1m.csv'))
for line in buf:
(rank, domain) = line.split(',')
yield (int(rank), domain.strip())
def top_list(num=100):
a = alexa_etl()
return [a.next() for x in xrange(num)]
if __name__ == "__main__":
print alexa_list()
<commit_msg>Fix error when run as script
Change method call from alexa_list(), which is undefined, to top_list()<commit_after>"""
This script downloads the alexa top 1M sites, unzips it, and reads the CSV and
returns a list of the top N sites.
"""
import zipfile
import cStringIO
from urllib import urlopen
ALEXA_DATA_URL = 'http://s3.amazonaws.com/alexa-static/top-1m.csv.zip'
def alexa_etl():
"""
Generator that:
Extracts by downloading the csv.zip, unzipping.
Transforms the data into python via CSV lib
Loads it to the end user as a python list
"""
f = urlopen(ALEXA_DATA_URL)
buf = cStringIO.StringIO(f.read())
zfile = zipfile.ZipFile(buf)
buf = cStringIO.StringIO(zfile.read('top-1m.csv'))
for line in buf:
(rank, domain) = line.split(',')
yield (int(rank), domain.strip())
def top_list(num=100):
a = alexa_etl()
return [a.next() for x in xrange(num)]
if __name__ == "__main__":
print top_list()
|
925270e5dd8ffcc72b95bf431444bce480fa18bb | simphony/engine/__init__.py | simphony/engine/__init__.py | """ Simphony engine module
This module is dynamicaly populated at import with the
registered plugins modules. Plugins modules need to be
registered at the 'simphony.engine' entry point.
"""
from ..extension import get_engine_manager
from ..extension import create_wrapper
__all__ = ['get_supported_engines', 'create_wrapper',
'get_supported_engine_names']
def get_supported_engine_names():
"""Show a list of supported engine names.
Returns
-------
names: list
a list of engine names
"""
return get_engine_manager().get_supported_engine_names()
def get_supported_engines():
"""Show a list of supported engines.
Returns
-------
metadata: list
a list of engine metadata objects
"""
return get_engine_manager().get_supported_engines()
def load_engine_extentions():
""" Discover and load engine extension modules.
"""
from stevedore import extension
mgr = extension.ExtensionManager(
namespace='simphony.engine',
invoke_on_load=False)
extensions = {}
engine_manager = get_engine_manager()
for ext in mgr.extensions:
extensions[ext.name] = ext.plugin
# Load engine metadata
engine_manager.load_metadata(ext.plugin)
return extensions
# Populate the module namespace
globals().update(load_engine_extentions())
# cleanup
del load_engine_extentions
| """ Simphony engine module
This module is dynamicaly populated at import with the
registered plugins modules. Plugins modules need to be
registered at the 'simphony.engine' entry point.
"""
from ..extension import get_engine_manager
__all__ = ['get_supported_engines',
'get_supported_engine_names']
def get_supported_engine_names():
"""Show a list of supported engine names.
Returns
-------
names: list
a list of engine names
"""
return get_engine_manager().get_supported_engine_names()
def get_supported_engines():
"""Show a list of supported engines.
Returns
-------
metadata: list
a list of engine metadata objects
"""
return get_engine_manager().get_supported_engines()
def load_engine_extentions():
""" Discover and load engine extension modules.
"""
from stevedore import extension
mgr = extension.ExtensionManager(
namespace='simphony.engine',
invoke_on_load=False)
extensions = {}
engine_manager = get_engine_manager()
for ext in mgr.extensions:
extensions[ext.name] = ext.plugin
# Load engine metadata
engine_manager.load_metadata(ext.plugin)
return extensions
# Populate the module namespace
globals().update(load_engine_extentions())
# cleanup
del load_engine_extentions
| Remove create_wrapper from the API | Remove create_wrapper from the API
| Python | bsd-2-clause | simphony/simphony-common | """ Simphony engine module
This module is dynamicaly populated at import with the
registered plugins modules. Plugins modules need to be
registered at the 'simphony.engine' entry point.
"""
from ..extension import get_engine_manager
from ..extension import create_wrapper
__all__ = ['get_supported_engines', 'create_wrapper',
'get_supported_engine_names']
def get_supported_engine_names():
"""Show a list of supported engine names.
Returns
-------
names: list
a list of engine names
"""
return get_engine_manager().get_supported_engine_names()
def get_supported_engines():
"""Show a list of supported engines.
Returns
-------
metadata: list
a list of engine metadata objects
"""
return get_engine_manager().get_supported_engines()
def load_engine_extentions():
""" Discover and load engine extension modules.
"""
from stevedore import extension
mgr = extension.ExtensionManager(
namespace='simphony.engine',
invoke_on_load=False)
extensions = {}
engine_manager = get_engine_manager()
for ext in mgr.extensions:
extensions[ext.name] = ext.plugin
# Load engine metadata
engine_manager.load_metadata(ext.plugin)
return extensions
# Populate the module namespace
globals().update(load_engine_extentions())
# cleanup
del load_engine_extentions
Remove create_wrapper from the API | """ Simphony engine module
This module is dynamicaly populated at import with the
registered plugins modules. Plugins modules need to be
registered at the 'simphony.engine' entry point.
"""
from ..extension import get_engine_manager
__all__ = ['get_supported_engines',
'get_supported_engine_names']
def get_supported_engine_names():
"""Show a list of supported engine names.
Returns
-------
names: list
a list of engine names
"""
return get_engine_manager().get_supported_engine_names()
def get_supported_engines():
"""Show a list of supported engines.
Returns
-------
metadata: list
a list of engine metadata objects
"""
return get_engine_manager().get_supported_engines()
def load_engine_extentions():
""" Discover and load engine extension modules.
"""
from stevedore import extension
mgr = extension.ExtensionManager(
namespace='simphony.engine',
invoke_on_load=False)
extensions = {}
engine_manager = get_engine_manager()
for ext in mgr.extensions:
extensions[ext.name] = ext.plugin
# Load engine metadata
engine_manager.load_metadata(ext.plugin)
return extensions
# Populate the module namespace
globals().update(load_engine_extentions())
# cleanup
del load_engine_extentions
| <commit_before>""" Simphony engine module
This module is dynamicaly populated at import with the
registered plugins modules. Plugins modules need to be
registered at the 'simphony.engine' entry point.
"""
from ..extension import get_engine_manager
from ..extension import create_wrapper
__all__ = ['get_supported_engines', 'create_wrapper',
'get_supported_engine_names']
def get_supported_engine_names():
"""Show a list of supported engine names.
Returns
-------
names: list
a list of engine names
"""
return get_engine_manager().get_supported_engine_names()
def get_supported_engines():
"""Show a list of supported engines.
Returns
-------
metadata: list
a list of engine metadata objects
"""
return get_engine_manager().get_supported_engines()
def load_engine_extentions():
""" Discover and load engine extension modules.
"""
from stevedore import extension
mgr = extension.ExtensionManager(
namespace='simphony.engine',
invoke_on_load=False)
extensions = {}
engine_manager = get_engine_manager()
for ext in mgr.extensions:
extensions[ext.name] = ext.plugin
# Load engine metadata
engine_manager.load_metadata(ext.plugin)
return extensions
# Populate the module namespace
globals().update(load_engine_extentions())
# cleanup
del load_engine_extentions
<commit_msg>Remove create_wrapper from the API<commit_after> | """ Simphony engine module
This module is dynamicaly populated at import with the
registered plugins modules. Plugins modules need to be
registered at the 'simphony.engine' entry point.
"""
from ..extension import get_engine_manager
__all__ = ['get_supported_engines',
'get_supported_engine_names']
def get_supported_engine_names():
"""Show a list of supported engine names.
Returns
-------
names: list
a list of engine names
"""
return get_engine_manager().get_supported_engine_names()
def get_supported_engines():
"""Show a list of supported engines.
Returns
-------
metadata: list
a list of engine metadata objects
"""
return get_engine_manager().get_supported_engines()
def load_engine_extentions():
""" Discover and load engine extension modules.
"""
from stevedore import extension
mgr = extension.ExtensionManager(
namespace='simphony.engine',
invoke_on_load=False)
extensions = {}
engine_manager = get_engine_manager()
for ext in mgr.extensions:
extensions[ext.name] = ext.plugin
# Load engine metadata
engine_manager.load_metadata(ext.plugin)
return extensions
# Populate the module namespace
globals().update(load_engine_extentions())
# cleanup
del load_engine_extentions
| """ Simphony engine module
This module is dynamicaly populated at import with the
registered plugins modules. Plugins modules need to be
registered at the 'simphony.engine' entry point.
"""
from ..extension import get_engine_manager
from ..extension import create_wrapper
__all__ = ['get_supported_engines', 'create_wrapper',
'get_supported_engine_names']
def get_supported_engine_names():
"""Show a list of supported engine names.
Returns
-------
names: list
a list of engine names
"""
return get_engine_manager().get_supported_engine_names()
def get_supported_engines():
"""Show a list of supported engines.
Returns
-------
metadata: list
a list of engine metadata objects
"""
return get_engine_manager().get_supported_engines()
def load_engine_extentions():
""" Discover and load engine extension modules.
"""
from stevedore import extension
mgr = extension.ExtensionManager(
namespace='simphony.engine',
invoke_on_load=False)
extensions = {}
engine_manager = get_engine_manager()
for ext in mgr.extensions:
extensions[ext.name] = ext.plugin
# Load engine metadata
engine_manager.load_metadata(ext.plugin)
return extensions
# Populate the module namespace
globals().update(load_engine_extentions())
# cleanup
del load_engine_extentions
Remove create_wrapper from the API""" Simphony engine module
This module is dynamicaly populated at import with the
registered plugins modules. Plugins modules need to be
registered at the 'simphony.engine' entry point.
"""
from ..extension import get_engine_manager
__all__ = ['get_supported_engines',
'get_supported_engine_names']
def get_supported_engine_names():
"""Show a list of supported engine names.
Returns
-------
names: list
a list of engine names
"""
return get_engine_manager().get_supported_engine_names()
def get_supported_engines():
"""Show a list of supported engines.
Returns
-------
metadata: list
a list of engine metadata objects
"""
return get_engine_manager().get_supported_engines()
def load_engine_extentions():
""" Discover and load engine extension modules.
"""
from stevedore import extension
mgr = extension.ExtensionManager(
namespace='simphony.engine',
invoke_on_load=False)
extensions = {}
engine_manager = get_engine_manager()
for ext in mgr.extensions:
extensions[ext.name] = ext.plugin
# Load engine metadata
engine_manager.load_metadata(ext.plugin)
return extensions
# Populate the module namespace
globals().update(load_engine_extentions())
# cleanup
del load_engine_extentions
| <commit_before>""" Simphony engine module
This module is dynamicaly populated at import with the
registered plugins modules. Plugins modules need to be
registered at the 'simphony.engine' entry point.
"""
from ..extension import get_engine_manager
from ..extension import create_wrapper
__all__ = ['get_supported_engines', 'create_wrapper',
'get_supported_engine_names']
def get_supported_engine_names():
"""Show a list of supported engine names.
Returns
-------
names: list
a list of engine names
"""
return get_engine_manager().get_supported_engine_names()
def get_supported_engines():
"""Show a list of supported engines.
Returns
-------
metadata: list
a list of engine metadata objects
"""
return get_engine_manager().get_supported_engines()
def load_engine_extentions():
""" Discover and load engine extension modules.
"""
from stevedore import extension
mgr = extension.ExtensionManager(
namespace='simphony.engine',
invoke_on_load=False)
extensions = {}
engine_manager = get_engine_manager()
for ext in mgr.extensions:
extensions[ext.name] = ext.plugin
# Load engine metadata
engine_manager.load_metadata(ext.plugin)
return extensions
# Populate the module namespace
globals().update(load_engine_extentions())
# cleanup
del load_engine_extentions
<commit_msg>Remove create_wrapper from the API<commit_after>""" Simphony engine module
This module is dynamicaly populated at import with the
registered plugins modules. Plugins modules need to be
registered at the 'simphony.engine' entry point.
"""
from ..extension import get_engine_manager
__all__ = ['get_supported_engines',
'get_supported_engine_names']
def get_supported_engine_names():
"""Show a list of supported engine names.
Returns
-------
names: list
a list of engine names
"""
return get_engine_manager().get_supported_engine_names()
def get_supported_engines():
"""Show a list of supported engines.
Returns
-------
metadata: list
a list of engine metadata objects
"""
return get_engine_manager().get_supported_engines()
def load_engine_extentions():
""" Discover and load engine extension modules.
"""
from stevedore import extension
mgr = extension.ExtensionManager(
namespace='simphony.engine',
invoke_on_load=False)
extensions = {}
engine_manager = get_engine_manager()
for ext in mgr.extensions:
extensions[ext.name] = ext.plugin
# Load engine metadata
engine_manager.load_metadata(ext.plugin)
return extensions
# Populate the module namespace
globals().update(load_engine_extentions())
# cleanup
del load_engine_extentions
|
a7ead6577d885475e82a1c18872eb55e9d39c8b0 | rwt/launch.py | rwt/launch.py | import os
import subprocess
import sys
import signal
def _build_env(target):
"""
Prepend target to PYTHONPATH
"""
env = dict(os.environ)
suffix = env.get('PYTHONPATH', '')
prefix = target
joined = os.pathsep.join([prefix, suffix]).rstrip(os.pathsep)
env['PYTHONPATH'] = joined
return env
def with_path(target, params):
"""
Launch Python with target on the path and params
"""
def null_handler(signum, frame):
pass
signal.signal(signal.SIGINT, null_handler)
cmd = [sys.executable] + params
subprocess.Popen(cmd, env=_build_env(target)).wait()
def with_path_overlay(target, params):
"""
Overlay Python with target on the path and params
"""
cmd = [sys.executable] + params
os.execve(sys.executable, cmd, _build_env(target))
| import os
import subprocess
import sys
import signal
import itertools
def _build_env(target):
"""
Prepend target and .pth references in target to PYTHONPATH
"""
env = dict(os.environ)
suffix = env.get('PYTHONPATH')
prefix = target,
items = itertools.chain(
prefix,
(suffix,) if suffix else (),
)
joined = os.pathsep.join(items)
env['PYTHONPATH'] = joined
return env
def with_path(target, params):
"""
Launch Python with target on the path and params
"""
def null_handler(signum, frame):
pass
signal.signal(signal.SIGINT, null_handler)
cmd = [sys.executable] + params
subprocess.Popen(cmd, env=_build_env(target)).wait()
def with_path_overlay(target, params):
"""
Overlay Python with target on the path and params
"""
cmd = [sys.executable] + params
os.execve(sys.executable, cmd, _build_env(target))
| Refactor to better inject values into path items | Refactor to better inject values into path items
| Python | mit | jaraco/rwt | import os
import subprocess
import sys
import signal
def _build_env(target):
"""
Prepend target to PYTHONPATH
"""
env = dict(os.environ)
suffix = env.get('PYTHONPATH', '')
prefix = target
joined = os.pathsep.join([prefix, suffix]).rstrip(os.pathsep)
env['PYTHONPATH'] = joined
return env
def with_path(target, params):
"""
Launch Python with target on the path and params
"""
def null_handler(signum, frame):
pass
signal.signal(signal.SIGINT, null_handler)
cmd = [sys.executable] + params
subprocess.Popen(cmd, env=_build_env(target)).wait()
def with_path_overlay(target, params):
"""
Overlay Python with target on the path and params
"""
cmd = [sys.executable] + params
os.execve(sys.executable, cmd, _build_env(target))
Refactor to better inject values into path items | import os
import subprocess
import sys
import signal
import itertools
def _build_env(target):
"""
Prepend target and .pth references in target to PYTHONPATH
"""
env = dict(os.environ)
suffix = env.get('PYTHONPATH')
prefix = target,
items = itertools.chain(
prefix,
(suffix,) if suffix else (),
)
joined = os.pathsep.join(items)
env['PYTHONPATH'] = joined
return env
def with_path(target, params):
"""
Launch Python with target on the path and params
"""
def null_handler(signum, frame):
pass
signal.signal(signal.SIGINT, null_handler)
cmd = [sys.executable] + params
subprocess.Popen(cmd, env=_build_env(target)).wait()
def with_path_overlay(target, params):
"""
Overlay Python with target on the path and params
"""
cmd = [sys.executable] + params
os.execve(sys.executable, cmd, _build_env(target))
| <commit_before>import os
import subprocess
import sys
import signal
def _build_env(target):
"""
Prepend target to PYTHONPATH
"""
env = dict(os.environ)
suffix = env.get('PYTHONPATH', '')
prefix = target
joined = os.pathsep.join([prefix, suffix]).rstrip(os.pathsep)
env['PYTHONPATH'] = joined
return env
def with_path(target, params):
"""
Launch Python with target on the path and params
"""
def null_handler(signum, frame):
pass
signal.signal(signal.SIGINT, null_handler)
cmd = [sys.executable] + params
subprocess.Popen(cmd, env=_build_env(target)).wait()
def with_path_overlay(target, params):
"""
Overlay Python with target on the path and params
"""
cmd = [sys.executable] + params
os.execve(sys.executable, cmd, _build_env(target))
<commit_msg>Refactor to better inject values into path items<commit_after> | import os
import subprocess
import sys
import signal
import itertools
def _build_env(target):
"""
Prepend target and .pth references in target to PYTHONPATH
"""
env = dict(os.environ)
suffix = env.get('PYTHONPATH')
prefix = target,
items = itertools.chain(
prefix,
(suffix,) if suffix else (),
)
joined = os.pathsep.join(items)
env['PYTHONPATH'] = joined
return env
def with_path(target, params):
"""
Launch Python with target on the path and params
"""
def null_handler(signum, frame):
pass
signal.signal(signal.SIGINT, null_handler)
cmd = [sys.executable] + params
subprocess.Popen(cmd, env=_build_env(target)).wait()
def with_path_overlay(target, params):
"""
Overlay Python with target on the path and params
"""
cmd = [sys.executable] + params
os.execve(sys.executable, cmd, _build_env(target))
| import os
import subprocess
import sys
import signal
def _build_env(target):
"""
Prepend target to PYTHONPATH
"""
env = dict(os.environ)
suffix = env.get('PYTHONPATH', '')
prefix = target
joined = os.pathsep.join([prefix, suffix]).rstrip(os.pathsep)
env['PYTHONPATH'] = joined
return env
def with_path(target, params):
"""
Launch Python with target on the path and params
"""
def null_handler(signum, frame):
pass
signal.signal(signal.SIGINT, null_handler)
cmd = [sys.executable] + params
subprocess.Popen(cmd, env=_build_env(target)).wait()
def with_path_overlay(target, params):
"""
Overlay Python with target on the path and params
"""
cmd = [sys.executable] + params
os.execve(sys.executable, cmd, _build_env(target))
Refactor to better inject values into path itemsimport os
import subprocess
import sys
import signal
import itertools
def _build_env(target):
"""
Prepend target and .pth references in target to PYTHONPATH
"""
env = dict(os.environ)
suffix = env.get('PYTHONPATH')
prefix = target,
items = itertools.chain(
prefix,
(suffix,) if suffix else (),
)
joined = os.pathsep.join(items)
env['PYTHONPATH'] = joined
return env
def with_path(target, params):
"""
Launch Python with target on the path and params
"""
def null_handler(signum, frame):
pass
signal.signal(signal.SIGINT, null_handler)
cmd = [sys.executable] + params
subprocess.Popen(cmd, env=_build_env(target)).wait()
def with_path_overlay(target, params):
"""
Overlay Python with target on the path and params
"""
cmd = [sys.executable] + params
os.execve(sys.executable, cmd, _build_env(target))
| <commit_before>import os
import subprocess
import sys
import signal
def _build_env(target):
"""
Prepend target to PYTHONPATH
"""
env = dict(os.environ)
suffix = env.get('PYTHONPATH', '')
prefix = target
joined = os.pathsep.join([prefix, suffix]).rstrip(os.pathsep)
env['PYTHONPATH'] = joined
return env
def with_path(target, params):
"""
Launch Python with target on the path and params
"""
def null_handler(signum, frame):
pass
signal.signal(signal.SIGINT, null_handler)
cmd = [sys.executable] + params
subprocess.Popen(cmd, env=_build_env(target)).wait()
def with_path_overlay(target, params):
"""
Overlay Python with target on the path and params
"""
cmd = [sys.executable] + params
os.execve(sys.executable, cmd, _build_env(target))
<commit_msg>Refactor to better inject values into path items<commit_after>import os
import subprocess
import sys
import signal
import itertools
def _build_env(target):
"""
Prepend target and .pth references in target to PYTHONPATH
"""
env = dict(os.environ)
suffix = env.get('PYTHONPATH')
prefix = target,
items = itertools.chain(
prefix,
(suffix,) if suffix else (),
)
joined = os.pathsep.join(items)
env['PYTHONPATH'] = joined
return env
def with_path(target, params):
"""
Launch Python with target on the path and params
"""
def null_handler(signum, frame):
pass
signal.signal(signal.SIGINT, null_handler)
cmd = [sys.executable] + params
subprocess.Popen(cmd, env=_build_env(target)).wait()
def with_path_overlay(target, params):
"""
Overlay Python with target on the path and params
"""
cmd = [sys.executable] + params
os.execve(sys.executable, cmd, _build_env(target))
|
9489e8512df9e073ac019c75f827c03fe64242dd | sorts/bubble_sort.py | sorts/bubble_sort.py | """
This is pure python implementation of bubble sort algorithm
For doctests run following command:
python -m doctest -v bubble_sort.py
or
python3 -m doctest -v bubble_sort.py
For manual testing run:
python bubble_sort.py
"""
from __future__ import print_function
def bubble_sort(collection):
"""Pure implementation of bubble sort algorithm in Python
:param collection: some mutable ordered collection with heterogeneous
comparable items inside
:return: the same collection ordered by ascending
Examples:
>>> bubble_sort([0, 5, 3, 2, 2])
[0, 2, 2, 3, 5]
>>> bubble_sort([])
[]
>>> bubble_sort([-2, -5, -45])
[-45, -5, -2]
"""
length = len(collection)
for i in range(length):
for j in range(length-1):
if collection[j] > collection[j+1]:
collection[j], collection[j+1] = collection[j+1], collection[j]
return collection
if __name__ == '__main__':
try:
raw_input # Python 2
except NameError:
raw_input = input # Python 3
user_input = raw_input('Enter numbers separated by a comma:\n').strip()
unsorted = [int(item) for item in user_input.split(',')]
print(bubble_sort(unsorted))
| """
This is pure python implementation of bubble sort algorithm
For doctests run following command:
python -m doctest -v bubble_sort.py
or
python3 -m doctest -v bubble_sort.py
For manual testing run:
python bubble_sort.py
"""
from __future__ import print_function
def bubble_sort(collection):
"""Pure implementation of bubble sort algorithm in Python
:param collection: some mutable ordered collection with heterogeneous
comparable items inside
:return: the same collection ordered by ascending
Examples:
>>> bubble_sort([0, 5, 3, 2, 2])
[0, 2, 2, 3, 5]
>>> bubble_sort([])
[]
>>> bubble_sort([-2, -5, -45])
[-45, -5, -2]
"""
length = len(collection)
for i in range(length):
swapped = False
for j in range(length-1):
if collection[j] > collection[j+1]:
swapped = True
collection[j], collection[j+1] = collection[j+1], collection[j]
if not swapped: break # Stop iteration if the collection is sorted.
return collection
if __name__ == '__main__':
try:
raw_input # Python 2
except NameError:
raw_input = input # Python 3
user_input = raw_input('Enter numbers separated by a comma:\n').strip()
unsorted = [int(item) for item in user_input.split(',')]
print(bubble_sort(unsorted))
| Break if the collection is sorted | Break if the collection is sorted
| Python | mit | TheAlgorithms/Python | """
This is pure python implementation of bubble sort algorithm
For doctests run following command:
python -m doctest -v bubble_sort.py
or
python3 -m doctest -v bubble_sort.py
For manual testing run:
python bubble_sort.py
"""
from __future__ import print_function
def bubble_sort(collection):
"""Pure implementation of bubble sort algorithm in Python
:param collection: some mutable ordered collection with heterogeneous
comparable items inside
:return: the same collection ordered by ascending
Examples:
>>> bubble_sort([0, 5, 3, 2, 2])
[0, 2, 2, 3, 5]
>>> bubble_sort([])
[]
>>> bubble_sort([-2, -5, -45])
[-45, -5, -2]
"""
length = len(collection)
for i in range(length):
for j in range(length-1):
if collection[j] > collection[j+1]:
collection[j], collection[j+1] = collection[j+1], collection[j]
return collection
if __name__ == '__main__':
try:
raw_input # Python 2
except NameError:
raw_input = input # Python 3
user_input = raw_input('Enter numbers separated by a comma:\n').strip()
unsorted = [int(item) for item in user_input.split(',')]
print(bubble_sort(unsorted))
Break if the collection is sorted | """
This is pure python implementation of bubble sort algorithm
For doctests run following command:
python -m doctest -v bubble_sort.py
or
python3 -m doctest -v bubble_sort.py
For manual testing run:
python bubble_sort.py
"""
from __future__ import print_function
def bubble_sort(collection):
"""Pure implementation of bubble sort algorithm in Python
:param collection: some mutable ordered collection with heterogeneous
comparable items inside
:return: the same collection ordered by ascending
Examples:
>>> bubble_sort([0, 5, 3, 2, 2])
[0, 2, 2, 3, 5]
>>> bubble_sort([])
[]
>>> bubble_sort([-2, -5, -45])
[-45, -5, -2]
"""
length = len(collection)
for i in range(length):
swapped = False
for j in range(length-1):
if collection[j] > collection[j+1]:
swapped = True
collection[j], collection[j+1] = collection[j+1], collection[j]
if not swapped: break # Stop iteration if the collection is sorted.
return collection
if __name__ == '__main__':
try:
raw_input # Python 2
except NameError:
raw_input = input # Python 3
user_input = raw_input('Enter numbers separated by a comma:\n').strip()
unsorted = [int(item) for item in user_input.split(',')]
print(bubble_sort(unsorted))
| <commit_before>"""
This is pure python implementation of bubble sort algorithm
For doctests run following command:
python -m doctest -v bubble_sort.py
or
python3 -m doctest -v bubble_sort.py
For manual testing run:
python bubble_sort.py
"""
from __future__ import print_function
def bubble_sort(collection):
"""Pure implementation of bubble sort algorithm in Python
:param collection: some mutable ordered collection with heterogeneous
comparable items inside
:return: the same collection ordered by ascending
Examples:
>>> bubble_sort([0, 5, 3, 2, 2])
[0, 2, 2, 3, 5]
>>> bubble_sort([])
[]
>>> bubble_sort([-2, -5, -45])
[-45, -5, -2]
"""
length = len(collection)
for i in range(length):
for j in range(length-1):
if collection[j] > collection[j+1]:
collection[j], collection[j+1] = collection[j+1], collection[j]
return collection
if __name__ == '__main__':
try:
raw_input # Python 2
except NameError:
raw_input = input # Python 3
user_input = raw_input('Enter numbers separated by a comma:\n').strip()
unsorted = [int(item) for item in user_input.split(',')]
print(bubble_sort(unsorted))
<commit_msg>Break if the collection is sorted<commit_after> | """
This is pure python implementation of bubble sort algorithm
For doctests run following command:
python -m doctest -v bubble_sort.py
or
python3 -m doctest -v bubble_sort.py
For manual testing run:
python bubble_sort.py
"""
from __future__ import print_function
def bubble_sort(collection):
"""Pure implementation of bubble sort algorithm in Python
:param collection: some mutable ordered collection with heterogeneous
comparable items inside
:return: the same collection ordered by ascending
Examples:
>>> bubble_sort([0, 5, 3, 2, 2])
[0, 2, 2, 3, 5]
>>> bubble_sort([])
[]
>>> bubble_sort([-2, -5, -45])
[-45, -5, -2]
"""
length = len(collection)
for i in range(length):
swapped = False
for j in range(length-1):
if collection[j] > collection[j+1]:
swapped = True
collection[j], collection[j+1] = collection[j+1], collection[j]
if not swapped: break # Stop iteration if the collection is sorted.
return collection
if __name__ == '__main__':
try:
raw_input # Python 2
except NameError:
raw_input = input # Python 3
user_input = raw_input('Enter numbers separated by a comma:\n').strip()
unsorted = [int(item) for item in user_input.split(',')]
print(bubble_sort(unsorted))
| """
This is pure python implementation of bubble sort algorithm
For doctests run following command:
python -m doctest -v bubble_sort.py
or
python3 -m doctest -v bubble_sort.py
For manual testing run:
python bubble_sort.py
"""
from __future__ import print_function
def bubble_sort(collection):
"""Pure implementation of bubble sort algorithm in Python
:param collection: some mutable ordered collection with heterogeneous
comparable items inside
:return: the same collection ordered by ascending
Examples:
>>> bubble_sort([0, 5, 3, 2, 2])
[0, 2, 2, 3, 5]
>>> bubble_sort([])
[]
>>> bubble_sort([-2, -5, -45])
[-45, -5, -2]
"""
length = len(collection)
for i in range(length):
for j in range(length-1):
if collection[j] > collection[j+1]:
collection[j], collection[j+1] = collection[j+1], collection[j]
return collection
if __name__ == '__main__':
try:
raw_input # Python 2
except NameError:
raw_input = input # Python 3
user_input = raw_input('Enter numbers separated by a comma:\n').strip()
unsorted = [int(item) for item in user_input.split(',')]
print(bubble_sort(unsorted))
Break if the collection is sorted"""
This is pure python implementation of bubble sort algorithm
For doctests run following command:
python -m doctest -v bubble_sort.py
or
python3 -m doctest -v bubble_sort.py
For manual testing run:
python bubble_sort.py
"""
from __future__ import print_function
def bubble_sort(collection):
"""Pure implementation of bubble sort algorithm in Python
:param collection: some mutable ordered collection with heterogeneous
comparable items inside
:return: the same collection ordered by ascending
Examples:
>>> bubble_sort([0, 5, 3, 2, 2])
[0, 2, 2, 3, 5]
>>> bubble_sort([])
[]
>>> bubble_sort([-2, -5, -45])
[-45, -5, -2]
"""
length = len(collection)
for i in range(length):
swapped = False
for j in range(length-1):
if collection[j] > collection[j+1]:
swapped = True
collection[j], collection[j+1] = collection[j+1], collection[j]
if not swapped: break # Stop iteration if the collection is sorted.
return collection
if __name__ == '__main__':
try:
raw_input # Python 2
except NameError:
raw_input = input # Python 3
user_input = raw_input('Enter numbers separated by a comma:\n').strip()
unsorted = [int(item) for item in user_input.split(',')]
print(bubble_sort(unsorted))
| <commit_before>"""
This is pure python implementation of bubble sort algorithm
For doctests run following command:
python -m doctest -v bubble_sort.py
or
python3 -m doctest -v bubble_sort.py
For manual testing run:
python bubble_sort.py
"""
from __future__ import print_function
def bubble_sort(collection):
"""Pure implementation of bubble sort algorithm in Python
:param collection: some mutable ordered collection with heterogeneous
comparable items inside
:return: the same collection ordered by ascending
Examples:
>>> bubble_sort([0, 5, 3, 2, 2])
[0, 2, 2, 3, 5]
>>> bubble_sort([])
[]
>>> bubble_sort([-2, -5, -45])
[-45, -5, -2]
"""
length = len(collection)
for i in range(length):
for j in range(length-1):
if collection[j] > collection[j+1]:
collection[j], collection[j+1] = collection[j+1], collection[j]
return collection
if __name__ == '__main__':
try:
raw_input # Python 2
except NameError:
raw_input = input # Python 3
user_input = raw_input('Enter numbers separated by a comma:\n').strip()
unsorted = [int(item) for item in user_input.split(',')]
print(bubble_sort(unsorted))
<commit_msg>Break if the collection is sorted<commit_after>"""
This is pure python implementation of bubble sort algorithm
For doctests run following command:
python -m doctest -v bubble_sort.py
or
python3 -m doctest -v bubble_sort.py
For manual testing run:
python bubble_sort.py
"""
from __future__ import print_function
def bubble_sort(collection):
"""Pure implementation of bubble sort algorithm in Python
:param collection: some mutable ordered collection with heterogeneous
comparable items inside
:return: the same collection ordered by ascending
Examples:
>>> bubble_sort([0, 5, 3, 2, 2])
[0, 2, 2, 3, 5]
>>> bubble_sort([])
[]
>>> bubble_sort([-2, -5, -45])
[-45, -5, -2]
"""
length = len(collection)
for i in range(length):
swapped = False
for j in range(length-1):
if collection[j] > collection[j+1]:
swapped = True
collection[j], collection[j+1] = collection[j+1], collection[j]
if not swapped: break # Stop iteration if the collection is sorted.
return collection
if __name__ == '__main__':
try:
raw_input # Python 2
except NameError:
raw_input = input # Python 3
user_input = raw_input('Enter numbers separated by a comma:\n').strip()
unsorted = [int(item) for item in user_input.split(',')]
print(bubble_sort(unsorted))
|
6182fd214580e517ffe8a59ed89037adf7fd2094 | traits/tests/test_dynamic_trait_definition.py | traits/tests/test_dynamic_trait_definition.py | from traits.testing.unittest_tools import unittest
from traits.api import Float, HasTraits, Int, List
class Foo(HasTraits):
x = Float
x_changes = List
y_changes = List
def _x_changed(self, new):
self.x_changes.append(new)
def _y_changed(self, new):
self.y_changes.append(new)
class TestDynamicTraitDefinition(unittest.TestCase):
""" Test demonstrating special change events using the 'event' metadata.
"""
def test_add_trait(self):
foo = Foo(x=3)
foo.add_trait('y', Int)
self.assertTrue(hasattr(foo, 'y'))
self.assertEqual(type(foo.y), int)
foo.y = 4
self.assertEqual(foo.y_changes, [4])
def test_remove_trait(self):
foo = Foo(x=3)
# We can't remove a "statically" added trait (i.e., a trait defined
# in the Foo class).
result = foo.remove_trait('x')
self.assertFalse(result)
# We can remove dynamically added traits.
foo.add_trait('y', Int)
foo.y = 70
result = foo.remove_trait('y')
self.assertTrue(result)
self.assertFalse(hasattr(foo, 'y'))
foo.y = 10
self.assertEqual(foo.y_changes, [70])
| from traits.testing.unittest_tools import unittest
from traits.api import Float, HasTraits, Int, List
class Foo(HasTraits):
x = Float
y_changes = List
def _y_changed(self, new):
self.y_changes.append(new)
class TestDynamicTraitDefinition(unittest.TestCase):
""" Test demonstrating special change events using the 'event' metadata.
"""
def test_add_trait(self):
foo = Foo(x=3)
foo.add_trait('y', Int)
self.assertTrue(hasattr(foo, 'y'))
self.assertEqual(type(foo.y), int)
foo.y = 4
self.assertEqual(foo.y_changes, [4])
def test_remove_trait(self):
foo = Foo(x=3)
# We can't remove a "statically" added trait (i.e., a trait defined
# in the Foo class).
result = foo.remove_trait('x')
self.assertFalse(result)
# We can remove dynamically added traits.
foo.add_trait('y', Int)
foo.y = 70
result = foo.remove_trait('y')
self.assertTrue(result)
self.assertFalse(hasattr(foo, 'y'))
foo.y = 10
self.assertEqual(foo.y_changes, [70])
| Remove unused trait definitions in test. | Remove unused trait definitions in test.
| Python | bsd-3-clause | burnpanck/traits,burnpanck/traits | from traits.testing.unittest_tools import unittest
from traits.api import Float, HasTraits, Int, List
class Foo(HasTraits):
x = Float
x_changes = List
y_changes = List
def _x_changed(self, new):
self.x_changes.append(new)
def _y_changed(self, new):
self.y_changes.append(new)
class TestDynamicTraitDefinition(unittest.TestCase):
""" Test demonstrating special change events using the 'event' metadata.
"""
def test_add_trait(self):
foo = Foo(x=3)
foo.add_trait('y', Int)
self.assertTrue(hasattr(foo, 'y'))
self.assertEqual(type(foo.y), int)
foo.y = 4
self.assertEqual(foo.y_changes, [4])
def test_remove_trait(self):
foo = Foo(x=3)
# We can't remove a "statically" added trait (i.e., a trait defined
# in the Foo class).
result = foo.remove_trait('x')
self.assertFalse(result)
# We can remove dynamically added traits.
foo.add_trait('y', Int)
foo.y = 70
result = foo.remove_trait('y')
self.assertTrue(result)
self.assertFalse(hasattr(foo, 'y'))
foo.y = 10
self.assertEqual(foo.y_changes, [70])
Remove unused trait definitions in test. | from traits.testing.unittest_tools import unittest
from traits.api import Float, HasTraits, Int, List
class Foo(HasTraits):
x = Float
y_changes = List
def _y_changed(self, new):
self.y_changes.append(new)
class TestDynamicTraitDefinition(unittest.TestCase):
""" Test demonstrating special change events using the 'event' metadata.
"""
def test_add_trait(self):
foo = Foo(x=3)
foo.add_trait('y', Int)
self.assertTrue(hasattr(foo, 'y'))
self.assertEqual(type(foo.y), int)
foo.y = 4
self.assertEqual(foo.y_changes, [4])
def test_remove_trait(self):
foo = Foo(x=3)
# We can't remove a "statically" added trait (i.e., a trait defined
# in the Foo class).
result = foo.remove_trait('x')
self.assertFalse(result)
# We can remove dynamically added traits.
foo.add_trait('y', Int)
foo.y = 70
result = foo.remove_trait('y')
self.assertTrue(result)
self.assertFalse(hasattr(foo, 'y'))
foo.y = 10
self.assertEqual(foo.y_changes, [70])
| <commit_before>from traits.testing.unittest_tools import unittest
from traits.api import Float, HasTraits, Int, List
class Foo(HasTraits):
x = Float
x_changes = List
y_changes = List
def _x_changed(self, new):
self.x_changes.append(new)
def _y_changed(self, new):
self.y_changes.append(new)
class TestDynamicTraitDefinition(unittest.TestCase):
""" Test demonstrating special change events using the 'event' metadata.
"""
def test_add_trait(self):
foo = Foo(x=3)
foo.add_trait('y', Int)
self.assertTrue(hasattr(foo, 'y'))
self.assertEqual(type(foo.y), int)
foo.y = 4
self.assertEqual(foo.y_changes, [4])
def test_remove_trait(self):
foo = Foo(x=3)
# We can't remove a "statically" added trait (i.e., a trait defined
# in the Foo class).
result = foo.remove_trait('x')
self.assertFalse(result)
# We can remove dynamically added traits.
foo.add_trait('y', Int)
foo.y = 70
result = foo.remove_trait('y')
self.assertTrue(result)
self.assertFalse(hasattr(foo, 'y'))
foo.y = 10
self.assertEqual(foo.y_changes, [70])
<commit_msg>Remove unused trait definitions in test.<commit_after> | from traits.testing.unittest_tools import unittest
from traits.api import Float, HasTraits, Int, List
class Foo(HasTraits):
x = Float
y_changes = List
def _y_changed(self, new):
self.y_changes.append(new)
class TestDynamicTraitDefinition(unittest.TestCase):
""" Test demonstrating special change events using the 'event' metadata.
"""
def test_add_trait(self):
foo = Foo(x=3)
foo.add_trait('y', Int)
self.assertTrue(hasattr(foo, 'y'))
self.assertEqual(type(foo.y), int)
foo.y = 4
self.assertEqual(foo.y_changes, [4])
def test_remove_trait(self):
foo = Foo(x=3)
# We can't remove a "statically" added trait (i.e., a trait defined
# in the Foo class).
result = foo.remove_trait('x')
self.assertFalse(result)
# We can remove dynamically added traits.
foo.add_trait('y', Int)
foo.y = 70
result = foo.remove_trait('y')
self.assertTrue(result)
self.assertFalse(hasattr(foo, 'y'))
foo.y = 10
self.assertEqual(foo.y_changes, [70])
| from traits.testing.unittest_tools import unittest
from traits.api import Float, HasTraits, Int, List
class Foo(HasTraits):
x = Float
x_changes = List
y_changes = List
def _x_changed(self, new):
self.x_changes.append(new)
def _y_changed(self, new):
self.y_changes.append(new)
class TestDynamicTraitDefinition(unittest.TestCase):
""" Test demonstrating special change events using the 'event' metadata.
"""
def test_add_trait(self):
foo = Foo(x=3)
foo.add_trait('y', Int)
self.assertTrue(hasattr(foo, 'y'))
self.assertEqual(type(foo.y), int)
foo.y = 4
self.assertEqual(foo.y_changes, [4])
def test_remove_trait(self):
foo = Foo(x=3)
# We can't remove a "statically" added trait (i.e., a trait defined
# in the Foo class).
result = foo.remove_trait('x')
self.assertFalse(result)
# We can remove dynamically added traits.
foo.add_trait('y', Int)
foo.y = 70
result = foo.remove_trait('y')
self.assertTrue(result)
self.assertFalse(hasattr(foo, 'y'))
foo.y = 10
self.assertEqual(foo.y_changes, [70])
Remove unused trait definitions in test.from traits.testing.unittest_tools import unittest
from traits.api import Float, HasTraits, Int, List
class Foo(HasTraits):
x = Float
y_changes = List
def _y_changed(self, new):
self.y_changes.append(new)
class TestDynamicTraitDefinition(unittest.TestCase):
""" Test demonstrating special change events using the 'event' metadata.
"""
def test_add_trait(self):
foo = Foo(x=3)
foo.add_trait('y', Int)
self.assertTrue(hasattr(foo, 'y'))
self.assertEqual(type(foo.y), int)
foo.y = 4
self.assertEqual(foo.y_changes, [4])
def test_remove_trait(self):
foo = Foo(x=3)
# We can't remove a "statically" added trait (i.e., a trait defined
# in the Foo class).
result = foo.remove_trait('x')
self.assertFalse(result)
# We can remove dynamically added traits.
foo.add_trait('y', Int)
foo.y = 70
result = foo.remove_trait('y')
self.assertTrue(result)
self.assertFalse(hasattr(foo, 'y'))
foo.y = 10
self.assertEqual(foo.y_changes, [70])
| <commit_before>from traits.testing.unittest_tools import unittest
from traits.api import Float, HasTraits, Int, List
class Foo(HasTraits):
x = Float
x_changes = List
y_changes = List
def _x_changed(self, new):
self.x_changes.append(new)
def _y_changed(self, new):
self.y_changes.append(new)
class TestDynamicTraitDefinition(unittest.TestCase):
""" Test demonstrating special change events using the 'event' metadata.
"""
def test_add_trait(self):
foo = Foo(x=3)
foo.add_trait('y', Int)
self.assertTrue(hasattr(foo, 'y'))
self.assertEqual(type(foo.y), int)
foo.y = 4
self.assertEqual(foo.y_changes, [4])
def test_remove_trait(self):
foo = Foo(x=3)
# We can't remove a "statically" added trait (i.e., a trait defined
# in the Foo class).
result = foo.remove_trait('x')
self.assertFalse(result)
# We can remove dynamically added traits.
foo.add_trait('y', Int)
foo.y = 70
result = foo.remove_trait('y')
self.assertTrue(result)
self.assertFalse(hasattr(foo, 'y'))
foo.y = 10
self.assertEqual(foo.y_changes, [70])
<commit_msg>Remove unused trait definitions in test.<commit_after>from traits.testing.unittest_tools import unittest
from traits.api import Float, HasTraits, Int, List
class Foo(HasTraits):
x = Float
y_changes = List
def _y_changed(self, new):
self.y_changes.append(new)
class TestDynamicTraitDefinition(unittest.TestCase):
""" Test demonstrating special change events using the 'event' metadata.
"""
def test_add_trait(self):
foo = Foo(x=3)
foo.add_trait('y', Int)
self.assertTrue(hasattr(foo, 'y'))
self.assertEqual(type(foo.y), int)
foo.y = 4
self.assertEqual(foo.y_changes, [4])
def test_remove_trait(self):
foo = Foo(x=3)
# We can't remove a "statically" added trait (i.e., a trait defined
# in the Foo class).
result = foo.remove_trait('x')
self.assertFalse(result)
# We can remove dynamically added traits.
foo.add_trait('y', Int)
foo.y = 70
result = foo.remove_trait('y')
self.assertTrue(result)
self.assertFalse(hasattr(foo, 'y'))
foo.y = 10
self.assertEqual(foo.y_changes, [70])
|
399ba60eb17744ea4c45891e29140f1a2b44a4c0 | netpyne/analysis/hnn.py | netpyne/analysis/hnn.py | """
analysis/rxd.py
Functions to plot and analyze RxD-related results
Contributors: salvadordura@gmail.com
"""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from netpyne import __gui__
if __gui__:
import matplotlib.pyplot as plt
from matplotlib_scalebar import scalebar
from .utils import exception, _showFigure, _saveFigData
import numpy as np
# -------------------------------------------------------------------------------------------------------------------
## Plot HNN dipole
# -------------------------------------------------------------------------------------------------------------------
@exception
def plotDipole():
from .. import sim
from bokeh.plotting import figure, show, output_file
TOOLS = "pan,wheel_zoom,box_zoom,reset,save,box_select"
fig = figure(title="HNN Diple Plot", tools=TOOLS)
spkt = sim.allSimData['spkt']
spkid = sim.allSimData['spkid']
fig.scatter(spkt, spkid, size=1, legend="all spikes")
output_file("hnn_dipole.html", title="HNN Dipole Plot (spikes for now!)")
show(fig) # open a browser | """
analysis/rxd.py
Functions to plot and analyze RxD-related results
Contributors: salvadordura@gmail.com
"""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from netpyne import __gui__
if __gui__:
import matplotlib.pyplot as plt
from matplotlib_scalebar import scalebar
from .utils import exception, _showFigure, _saveFigData
import numpy as np
# -------------------------------------------------------------------------------------------------------------------
## Plot HNN dipole
# -------------------------------------------------------------------------------------------------------------------
@exception
def plotDipole():
from .. import sim
from bokeh.plotting import figure
from bokeh.resources import CDN
from bokeh.embed import file_html
from bokeh.layouts import layout
TOOLS = "pan,wheel_zoom,box_zoom,reset,save,box_select"
fig = figure(title="HNN Diple Plot", tools=TOOLS)
spkt = sim.allSimData['spkt']
spkid = sim.allSimData['spkid']
fig.scatter(spkt, spkid, size=1, legend="all spikes")
plot_layout = layout(fig, sizing_mode='scale_both')
html = file_html(plot_layout, CDN, title="HNN Dipole Plot (spikes for now!)")
return html
| Change plotDipole to return html instead of saving it as a file | Change plotDipole to return html instead of saving it as a file
| Python | mit | Neurosim-lab/netpyne,Neurosim-lab/netpyne | """
analysis/rxd.py
Functions to plot and analyze RxD-related results
Contributors: salvadordura@gmail.com
"""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from netpyne import __gui__
if __gui__:
import matplotlib.pyplot as plt
from matplotlib_scalebar import scalebar
from .utils import exception, _showFigure, _saveFigData
import numpy as np
# -------------------------------------------------------------------------------------------------------------------
## Plot HNN dipole
# -------------------------------------------------------------------------------------------------------------------
@exception
def plotDipole():
from .. import sim
from bokeh.plotting import figure, show, output_file
TOOLS = "pan,wheel_zoom,box_zoom,reset,save,box_select"
fig = figure(title="HNN Diple Plot", tools=TOOLS)
spkt = sim.allSimData['spkt']
spkid = sim.allSimData['spkid']
fig.scatter(spkt, spkid, size=1, legend="all spikes")
output_file("hnn_dipole.html", title="HNN Dipole Plot (spikes for now!)")
show(fig) # open a browser Change plotDipole to return html instead of saving it as a file | """
analysis/rxd.py
Functions to plot and analyze RxD-related results
Contributors: salvadordura@gmail.com
"""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from netpyne import __gui__
if __gui__:
import matplotlib.pyplot as plt
from matplotlib_scalebar import scalebar
from .utils import exception, _showFigure, _saveFigData
import numpy as np
# -------------------------------------------------------------------------------------------------------------------
## Plot HNN dipole
# -------------------------------------------------------------------------------------------------------------------
@exception
def plotDipole():
from .. import sim
from bokeh.plotting import figure
from bokeh.resources import CDN
from bokeh.embed import file_html
from bokeh.layouts import layout
TOOLS = "pan,wheel_zoom,box_zoom,reset,save,box_select"
fig = figure(title="HNN Diple Plot", tools=TOOLS)
spkt = sim.allSimData['spkt']
spkid = sim.allSimData['spkid']
fig.scatter(spkt, spkid, size=1, legend="all spikes")
plot_layout = layout(fig, sizing_mode='scale_both')
html = file_html(plot_layout, CDN, title="HNN Dipole Plot (spikes for now!)")
return html
| <commit_before>"""
analysis/rxd.py
Functions to plot and analyze RxD-related results
Contributors: salvadordura@gmail.com
"""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from netpyne import __gui__
if __gui__:
import matplotlib.pyplot as plt
from matplotlib_scalebar import scalebar
from .utils import exception, _showFigure, _saveFigData
import numpy as np
# -------------------------------------------------------------------------------------------------------------------
## Plot HNN dipole
# -------------------------------------------------------------------------------------------------------------------
@exception
def plotDipole():
from .. import sim
from bokeh.plotting import figure, show, output_file
TOOLS = "pan,wheel_zoom,box_zoom,reset,save,box_select"
fig = figure(title="HNN Diple Plot", tools=TOOLS)
spkt = sim.allSimData['spkt']
spkid = sim.allSimData['spkid']
fig.scatter(spkt, spkid, size=1, legend="all spikes")
output_file("hnn_dipole.html", title="HNN Dipole Plot (spikes for now!)")
show(fig) # open a browser <commit_msg>Change plotDipole to return html instead of saving it as a file<commit_after> | """
analysis/rxd.py
Functions to plot and analyze RxD-related results
Contributors: salvadordura@gmail.com
"""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from netpyne import __gui__
if __gui__:
import matplotlib.pyplot as plt
from matplotlib_scalebar import scalebar
from .utils import exception, _showFigure, _saveFigData
import numpy as np
# -------------------------------------------------------------------------------------------------------------------
## Plot HNN dipole
# -------------------------------------------------------------------------------------------------------------------
@exception
def plotDipole():
from .. import sim
from bokeh.plotting import figure
from bokeh.resources import CDN
from bokeh.embed import file_html
from bokeh.layouts import layout
TOOLS = "pan,wheel_zoom,box_zoom,reset,save,box_select"
fig = figure(title="HNN Diple Plot", tools=TOOLS)
spkt = sim.allSimData['spkt']
spkid = sim.allSimData['spkid']
fig.scatter(spkt, spkid, size=1, legend="all spikes")
plot_layout = layout(fig, sizing_mode='scale_both')
html = file_html(plot_layout, CDN, title="HNN Dipole Plot (spikes for now!)")
return html
| """
analysis/rxd.py
Functions to plot and analyze RxD-related results
Contributors: salvadordura@gmail.com
"""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from netpyne import __gui__
if __gui__:
import matplotlib.pyplot as plt
from matplotlib_scalebar import scalebar
from .utils import exception, _showFigure, _saveFigData
import numpy as np
# -------------------------------------------------------------------------------------------------------------------
## Plot HNN dipole
# -------------------------------------------------------------------------------------------------------------------
@exception
def plotDipole():
from .. import sim
from bokeh.plotting import figure, show, output_file
TOOLS = "pan,wheel_zoom,box_zoom,reset,save,box_select"
fig = figure(title="HNN Diple Plot", tools=TOOLS)
spkt = sim.allSimData['spkt']
spkid = sim.allSimData['spkid']
fig.scatter(spkt, spkid, size=1, legend="all spikes")
output_file("hnn_dipole.html", title="HNN Dipole Plot (spikes for now!)")
show(fig) # open a browser Change plotDipole to return html instead of saving it as a file"""
analysis/rxd.py
Functions to plot and analyze RxD-related results
Contributors: salvadordura@gmail.com
"""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from netpyne import __gui__
if __gui__:
import matplotlib.pyplot as plt
from matplotlib_scalebar import scalebar
from .utils import exception, _showFigure, _saveFigData
import numpy as np
# -------------------------------------------------------------------------------------------------------------------
## Plot HNN dipole
# -------------------------------------------------------------------------------------------------------------------
@exception
def plotDipole():
from .. import sim
from bokeh.plotting import figure
from bokeh.resources import CDN
from bokeh.embed import file_html
from bokeh.layouts import layout
TOOLS = "pan,wheel_zoom,box_zoom,reset,save,box_select"
fig = figure(title="HNN Diple Plot", tools=TOOLS)
spkt = sim.allSimData['spkt']
spkid = sim.allSimData['spkid']
fig.scatter(spkt, spkid, size=1, legend="all spikes")
plot_layout = layout(fig, sizing_mode='scale_both')
html = file_html(plot_layout, CDN, title="HNN Dipole Plot (spikes for now!)")
return html
| <commit_before>"""
analysis/rxd.py
Functions to plot and analyze RxD-related results
Contributors: salvadordura@gmail.com
"""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from netpyne import __gui__
if __gui__:
import matplotlib.pyplot as plt
from matplotlib_scalebar import scalebar
from .utils import exception, _showFigure, _saveFigData
import numpy as np
# -------------------------------------------------------------------------------------------------------------------
## Plot HNN dipole
# -------------------------------------------------------------------------------------------------------------------
@exception
def plotDipole():
from .. import sim
from bokeh.plotting import figure, show, output_file
TOOLS = "pan,wheel_zoom,box_zoom,reset,save,box_select"
fig = figure(title="HNN Diple Plot", tools=TOOLS)
spkt = sim.allSimData['spkt']
spkid = sim.allSimData['spkid']
fig.scatter(spkt, spkid, size=1, legend="all spikes")
output_file("hnn_dipole.html", title="HNN Dipole Plot (spikes for now!)")
show(fig) # open a browser <commit_msg>Change plotDipole to return html instead of saving it as a file<commit_after>"""
analysis/rxd.py
Functions to plot and analyze RxD-related results
Contributors: salvadordura@gmail.com
"""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from netpyne import __gui__
if __gui__:
import matplotlib.pyplot as plt
from matplotlib_scalebar import scalebar
from .utils import exception, _showFigure, _saveFigData
import numpy as np
# -------------------------------------------------------------------------------------------------------------------
## Plot HNN dipole
# -------------------------------------------------------------------------------------------------------------------
@exception
def plotDipole():
from .. import sim
from bokeh.plotting import figure
from bokeh.resources import CDN
from bokeh.embed import file_html
from bokeh.layouts import layout
TOOLS = "pan,wheel_zoom,box_zoom,reset,save,box_select"
fig = figure(title="HNN Diple Plot", tools=TOOLS)
spkt = sim.allSimData['spkt']
spkid = sim.allSimData['spkid']
fig.scatter(spkt, spkid, size=1, legend="all spikes")
plot_layout = layout(fig, sizing_mode='scale_both')
html = file_html(plot_layout, CDN, title="HNN Dipole Plot (spikes for now!)")
return html
|
cb7e8faad37719e7e2522bc203a29cdbc67a22aa | pollirio/reactors/__init__.py | pollirio/reactors/__init__.py | # -*- coding: utf-8 -*-
from functools import wraps
from pollirio import reactors
import re
def expose(text, args=None):
def decorator(fn):
reactors[text] = {"func":fn, "args":args}
return fn
return decorator
def reactor_run(line, *args):
for k in reactors.keys():
if re.findall(k, line, re.IGNORECASE):
reactors.get(k)["func"](*args)
from markov import *
from users import *
from misc import *
| # -*- coding: utf-8 -*-
from functools import wraps
from pollirio import reactors
import re
def expose(text, args=None):
def decorator(fn):
reactors[text] = {"func":fn, "args":args}
return fn
return decorator
def reactor_run(line, *args):
for k in reactors.keys():
if re.findall(k, line, re.IGNORECASE):
reactors.get(k)["func"](*args)
#from markov import *
from users import *
from misc import *
| Disable markov until further optimization | Disable markov until further optimization
| Python | mit | dpaleino/pollirio,dpaleino/pollirio | # -*- coding: utf-8 -*-
from functools import wraps
from pollirio import reactors
import re
def expose(text, args=None):
def decorator(fn):
reactors[text] = {"func":fn, "args":args}
return fn
return decorator
def reactor_run(line, *args):
for k in reactors.keys():
if re.findall(k, line, re.IGNORECASE):
reactors.get(k)["func"](*args)
from markov import *
from users import *
from misc import *
Disable markov until further optimization | # -*- coding: utf-8 -*-
from functools import wraps
from pollirio import reactors
import re
def expose(text, args=None):
def decorator(fn):
reactors[text] = {"func":fn, "args":args}
return fn
return decorator
def reactor_run(line, *args):
for k in reactors.keys():
if re.findall(k, line, re.IGNORECASE):
reactors.get(k)["func"](*args)
#from markov import *
from users import *
from misc import *
| <commit_before># -*- coding: utf-8 -*-
from functools import wraps
from pollirio import reactors
import re
def expose(text, args=None):
def decorator(fn):
reactors[text] = {"func":fn, "args":args}
return fn
return decorator
def reactor_run(line, *args):
for k in reactors.keys():
if re.findall(k, line, re.IGNORECASE):
reactors.get(k)["func"](*args)
from markov import *
from users import *
from misc import *
<commit_msg>Disable markov until further optimization<commit_after> | # -*- coding: utf-8 -*-
from functools import wraps
from pollirio import reactors
import re
def expose(text, args=None):
def decorator(fn):
reactors[text] = {"func":fn, "args":args}
return fn
return decorator
def reactor_run(line, *args):
for k in reactors.keys():
if re.findall(k, line, re.IGNORECASE):
reactors.get(k)["func"](*args)
#from markov import *
from users import *
from misc import *
| # -*- coding: utf-8 -*-
from functools import wraps
from pollirio import reactors
import re
def expose(text, args=None):
def decorator(fn):
reactors[text] = {"func":fn, "args":args}
return fn
return decorator
def reactor_run(line, *args):
for k in reactors.keys():
if re.findall(k, line, re.IGNORECASE):
reactors.get(k)["func"](*args)
from markov import *
from users import *
from misc import *
Disable markov until further optimization# -*- coding: utf-8 -*-
from functools import wraps
from pollirio import reactors
import re
def expose(text, args=None):
def decorator(fn):
reactors[text] = {"func":fn, "args":args}
return fn
return decorator
def reactor_run(line, *args):
for k in reactors.keys():
if re.findall(k, line, re.IGNORECASE):
reactors.get(k)["func"](*args)
#from markov import *
from users import *
from misc import *
| <commit_before># -*- coding: utf-8 -*-
from functools import wraps
from pollirio import reactors
import re
def expose(text, args=None):
def decorator(fn):
reactors[text] = {"func":fn, "args":args}
return fn
return decorator
def reactor_run(line, *args):
for k in reactors.keys():
if re.findall(k, line, re.IGNORECASE):
reactors.get(k)["func"](*args)
from markov import *
from users import *
from misc import *
<commit_msg>Disable markov until further optimization<commit_after># -*- coding: utf-8 -*-
from functools import wraps
from pollirio import reactors
import re
def expose(text, args=None):
def decorator(fn):
reactors[text] = {"func":fn, "args":args}
return fn
return decorator
def reactor_run(line, *args):
for k in reactors.keys():
if re.findall(k, line, re.IGNORECASE):
reactors.get(k)["func"](*args)
#from markov import *
from users import *
from misc import *
|
e51a3f3af81ba0270b73baaf5df139c391b4004c | src/emulators/wit.py | src/emulators/wit.py |
class WitEmulator(object):
def __init__(self):
self.name='wit'
def normalise_request_json(self,data):
_data = {}
_data["text"]=data['q'][0]
return _data
def normalise_response_json(self,data):
print('plain response {0}'.format(data))
return [
{
"_text": data["text"],
"confidence": None,
"intent": data["intent"],
"entities" : {key:{"confidence":None,"type":"value","value":val} for key,val in data["entities"]}
}
]
|
class WitEmulator(object):
def __init__(self):
self.name='wit'
def normalise_request_json(self,data):
_data = {}
_data["text"]=data['q'][0]
return _data
def normalise_response_json(self,data):
print('plain response {0}'.format(data))
return [
{
"_text": data["text"],
"confidence": None,
"intent": data["intent"],
"entities" : {key:{"confidence":None,"type":"value","value":val} for key,val in data["entities"].items()}
}
]
| Revert "remove erroneous items() call" | Revert "remove erroneous items() call"
This reverts commit 8c6a79f668901dad2a0c47fa80a6ccbd1264066b.
| Python | apache-2.0 | verloop/rasa_nlu,PHLF/rasa_nlu,RasaHQ/rasa_nlu,beeva-fernandocerezal/rasa_nlu,RasaHQ/rasa_nlu,beeva-fernandocerezal/rasa_nlu,verloop/rasa_nlu,PHLF/rasa_nlu,RasaHQ/rasa_nlu |
class WitEmulator(object):
def __init__(self):
self.name='wit'
def normalise_request_json(self,data):
_data = {}
_data["text"]=data['q'][0]
return _data
def normalise_response_json(self,data):
print('plain response {0}'.format(data))
return [
{
"_text": data["text"],
"confidence": None,
"intent": data["intent"],
"entities" : {key:{"confidence":None,"type":"value","value":val} for key,val in data["entities"]}
}
]
Revert "remove erroneous items() call"
This reverts commit 8c6a79f668901dad2a0c47fa80a6ccbd1264066b. |
class WitEmulator(object):
def __init__(self):
self.name='wit'
def normalise_request_json(self,data):
_data = {}
_data["text"]=data['q'][0]
return _data
def normalise_response_json(self,data):
print('plain response {0}'.format(data))
return [
{
"_text": data["text"],
"confidence": None,
"intent": data["intent"],
"entities" : {key:{"confidence":None,"type":"value","value":val} for key,val in data["entities"].items()}
}
]
| <commit_before>
class WitEmulator(object):
def __init__(self):
self.name='wit'
def normalise_request_json(self,data):
_data = {}
_data["text"]=data['q'][0]
return _data
def normalise_response_json(self,data):
print('plain response {0}'.format(data))
return [
{
"_text": data["text"],
"confidence": None,
"intent": data["intent"],
"entities" : {key:{"confidence":None,"type":"value","value":val} for key,val in data["entities"]}
}
]
<commit_msg>Revert "remove erroneous items() call"
This reverts commit 8c6a79f668901dad2a0c47fa80a6ccbd1264066b.<commit_after> |
class WitEmulator(object):
def __init__(self):
self.name='wit'
def normalise_request_json(self,data):
_data = {}
_data["text"]=data['q'][0]
return _data
def normalise_response_json(self,data):
print('plain response {0}'.format(data))
return [
{
"_text": data["text"],
"confidence": None,
"intent": data["intent"],
"entities" : {key:{"confidence":None,"type":"value","value":val} for key,val in data["entities"].items()}
}
]
|
class WitEmulator(object):
def __init__(self):
self.name='wit'
def normalise_request_json(self,data):
_data = {}
_data["text"]=data['q'][0]
return _data
def normalise_response_json(self,data):
print('plain response {0}'.format(data))
return [
{
"_text": data["text"],
"confidence": None,
"intent": data["intent"],
"entities" : {key:{"confidence":None,"type":"value","value":val} for key,val in data["entities"]}
}
]
Revert "remove erroneous items() call"
This reverts commit 8c6a79f668901dad2a0c47fa80a6ccbd1264066b.
class WitEmulator(object):
def __init__(self):
self.name='wit'
def normalise_request_json(self,data):
_data = {}
_data["text"]=data['q'][0]
return _data
def normalise_response_json(self,data):
print('plain response {0}'.format(data))
return [
{
"_text": data["text"],
"confidence": None,
"intent": data["intent"],
"entities" : {key:{"confidence":None,"type":"value","value":val} for key,val in data["entities"].items()}
}
]
| <commit_before>
class WitEmulator(object):
def __init__(self):
self.name='wit'
def normalise_request_json(self,data):
_data = {}
_data["text"]=data['q'][0]
return _data
def normalise_response_json(self,data):
print('plain response {0}'.format(data))
return [
{
"_text": data["text"],
"confidence": None,
"intent": data["intent"],
"entities" : {key:{"confidence":None,"type":"value","value":val} for key,val in data["entities"]}
}
]
<commit_msg>Revert "remove erroneous items() call"
This reverts commit 8c6a79f668901dad2a0c47fa80a6ccbd1264066b.<commit_after>
class WitEmulator(object):
def __init__(self):
self.name='wit'
def normalise_request_json(self,data):
_data = {}
_data["text"]=data['q'][0]
return _data
def normalise_response_json(self,data):
print('plain response {0}'.format(data))
return [
{
"_text": data["text"],
"confidence": None,
"intent": data["intent"],
"entities" : {key:{"confidence":None,"type":"value","value":val} for key,val in data["entities"].items()}
}
]
|
d8c8b5ffc1f79fc106dc9e41cc6f1ae4f40d0535 | src/mpi4py/futures/_core.py | src/mpi4py/futures/_core.py | # Author: Lisandro Dalcin
# Contact: dalcinl@gmail.com
# pylint: disable=unused-import
# pylint: disable=redefined-builtin
# pylint: disable=missing-module-docstring
try:
from concurrent.futures import (
FIRST_COMPLETED,
FIRST_EXCEPTION,
ALL_COMPLETED,
CancelledError,
TimeoutError,
Future,
Executor,
wait,
as_completed,
)
try: # Python 3.7
from concurrent.futures import BrokenExecutor
except ImportError: # pragma: no cover
BrokenExecutor = RuntimeError
try: # Python 3.8
from concurrent.futures import InvalidStateError
except ImportError: # pragma: no cover
InvalidStateError = CancelledError.__base__
except ImportError: # pragma: no cover
from ._base import (
FIRST_COMPLETED,
FIRST_EXCEPTION,
ALL_COMPLETED,
CancelledError,
TimeoutError,
InvalidStateError,
BrokenExecutor,
Future,
Executor,
wait,
as_completed,
)
| # Author: Lisandro Dalcin
# Contact: dalcinl@gmail.com
# pylint: disable=unused-import
# pylint: disable=redefined-builtin
# pylint: disable=missing-module-docstring
try:
from concurrent.futures import (
FIRST_COMPLETED,
FIRST_EXCEPTION,
ALL_COMPLETED,
CancelledError,
TimeoutError,
Future,
Executor,
wait,
as_completed,
)
try: # Python 3.7
from concurrent.futures import BrokenExecutor
except ImportError: # pragma: no cover
class BrokenExecutor(RuntimeError):
"""The executor has become non-functional."""
try: # Python 3.8
from concurrent.futures import InvalidStateError
except ImportError: # pragma: no cover
# pylint: disable=too-few-public-methods
# pylint: disable=useless-object-inheritance
class InvalidStateError(CancelledError.__base__):
"""The operation is not allowed in this state."""
except ImportError: # pragma: no cover
from ._base import (
FIRST_COMPLETED,
FIRST_EXCEPTION,
ALL_COMPLETED,
CancelledError,
TimeoutError,
InvalidStateError,
BrokenExecutor,
Future,
Executor,
wait,
as_completed,
)
| Fix backward compatibility exception types | mpi4py.futures: Fix backward compatibility exception types
| Python | bsd-2-clause | mpi4py/mpi4py,mpi4py/mpi4py,mpi4py/mpi4py | # Author: Lisandro Dalcin
# Contact: dalcinl@gmail.com
# pylint: disable=unused-import
# pylint: disable=redefined-builtin
# pylint: disable=missing-module-docstring
try:
from concurrent.futures import (
FIRST_COMPLETED,
FIRST_EXCEPTION,
ALL_COMPLETED,
CancelledError,
TimeoutError,
Future,
Executor,
wait,
as_completed,
)
try: # Python 3.7
from concurrent.futures import BrokenExecutor
except ImportError: # pragma: no cover
BrokenExecutor = RuntimeError
try: # Python 3.8
from concurrent.futures import InvalidStateError
except ImportError: # pragma: no cover
InvalidStateError = CancelledError.__base__
except ImportError: # pragma: no cover
from ._base import (
FIRST_COMPLETED,
FIRST_EXCEPTION,
ALL_COMPLETED,
CancelledError,
TimeoutError,
InvalidStateError,
BrokenExecutor,
Future,
Executor,
wait,
as_completed,
)
mpi4py.futures: Fix backward compatibility exception types | # Author: Lisandro Dalcin
# Contact: dalcinl@gmail.com
# pylint: disable=unused-import
# pylint: disable=redefined-builtin
# pylint: disable=missing-module-docstring
try:
from concurrent.futures import (
FIRST_COMPLETED,
FIRST_EXCEPTION,
ALL_COMPLETED,
CancelledError,
TimeoutError,
Future,
Executor,
wait,
as_completed,
)
try: # Python 3.7
from concurrent.futures import BrokenExecutor
except ImportError: # pragma: no cover
class BrokenExecutor(RuntimeError):
"""The executor has become non-functional."""
try: # Python 3.8
from concurrent.futures import InvalidStateError
except ImportError: # pragma: no cover
# pylint: disable=too-few-public-methods
# pylint: disable=useless-object-inheritance
class InvalidStateError(CancelledError.__base__):
"""The operation is not allowed in this state."""
except ImportError: # pragma: no cover
from ._base import (
FIRST_COMPLETED,
FIRST_EXCEPTION,
ALL_COMPLETED,
CancelledError,
TimeoutError,
InvalidStateError,
BrokenExecutor,
Future,
Executor,
wait,
as_completed,
)
| <commit_before># Author: Lisandro Dalcin
# Contact: dalcinl@gmail.com
# pylint: disable=unused-import
# pylint: disable=redefined-builtin
# pylint: disable=missing-module-docstring
try:
from concurrent.futures import (
FIRST_COMPLETED,
FIRST_EXCEPTION,
ALL_COMPLETED,
CancelledError,
TimeoutError,
Future,
Executor,
wait,
as_completed,
)
try: # Python 3.7
from concurrent.futures import BrokenExecutor
except ImportError: # pragma: no cover
BrokenExecutor = RuntimeError
try: # Python 3.8
from concurrent.futures import InvalidStateError
except ImportError: # pragma: no cover
InvalidStateError = CancelledError.__base__
except ImportError: # pragma: no cover
from ._base import (
FIRST_COMPLETED,
FIRST_EXCEPTION,
ALL_COMPLETED,
CancelledError,
TimeoutError,
InvalidStateError,
BrokenExecutor,
Future,
Executor,
wait,
as_completed,
)
<commit_msg>mpi4py.futures: Fix backward compatibility exception types<commit_after> | # Author: Lisandro Dalcin
# Contact: dalcinl@gmail.com
# pylint: disable=unused-import
# pylint: disable=redefined-builtin
# pylint: disable=missing-module-docstring
try:
from concurrent.futures import (
FIRST_COMPLETED,
FIRST_EXCEPTION,
ALL_COMPLETED,
CancelledError,
TimeoutError,
Future,
Executor,
wait,
as_completed,
)
try: # Python 3.7
from concurrent.futures import BrokenExecutor
except ImportError: # pragma: no cover
class BrokenExecutor(RuntimeError):
"""The executor has become non-functional."""
try: # Python 3.8
from concurrent.futures import InvalidStateError
except ImportError: # pragma: no cover
# pylint: disable=too-few-public-methods
# pylint: disable=useless-object-inheritance
class InvalidStateError(CancelledError.__base__):
"""The operation is not allowed in this state."""
except ImportError: # pragma: no cover
from ._base import (
FIRST_COMPLETED,
FIRST_EXCEPTION,
ALL_COMPLETED,
CancelledError,
TimeoutError,
InvalidStateError,
BrokenExecutor,
Future,
Executor,
wait,
as_completed,
)
| # Author: Lisandro Dalcin
# Contact: dalcinl@gmail.com
# pylint: disable=unused-import
# pylint: disable=redefined-builtin
# pylint: disable=missing-module-docstring
try:
from concurrent.futures import (
FIRST_COMPLETED,
FIRST_EXCEPTION,
ALL_COMPLETED,
CancelledError,
TimeoutError,
Future,
Executor,
wait,
as_completed,
)
try: # Python 3.7
from concurrent.futures import BrokenExecutor
except ImportError: # pragma: no cover
BrokenExecutor = RuntimeError
try: # Python 3.8
from concurrent.futures import InvalidStateError
except ImportError: # pragma: no cover
InvalidStateError = CancelledError.__base__
except ImportError: # pragma: no cover
from ._base import (
FIRST_COMPLETED,
FIRST_EXCEPTION,
ALL_COMPLETED,
CancelledError,
TimeoutError,
InvalidStateError,
BrokenExecutor,
Future,
Executor,
wait,
as_completed,
)
mpi4py.futures: Fix backward compatibility exception types# Author: Lisandro Dalcin
# Contact: dalcinl@gmail.com
# pylint: disable=unused-import
# pylint: disable=redefined-builtin
# pylint: disable=missing-module-docstring
try:
from concurrent.futures import (
FIRST_COMPLETED,
FIRST_EXCEPTION,
ALL_COMPLETED,
CancelledError,
TimeoutError,
Future,
Executor,
wait,
as_completed,
)
try: # Python 3.7
from concurrent.futures import BrokenExecutor
except ImportError: # pragma: no cover
class BrokenExecutor(RuntimeError):
"""The executor has become non-functional."""
try: # Python 3.8
from concurrent.futures import InvalidStateError
except ImportError: # pragma: no cover
# pylint: disable=too-few-public-methods
# pylint: disable=useless-object-inheritance
class InvalidStateError(CancelledError.__base__):
"""The operation is not allowed in this state."""
except ImportError: # pragma: no cover
from ._base import (
FIRST_COMPLETED,
FIRST_EXCEPTION,
ALL_COMPLETED,
CancelledError,
TimeoutError,
InvalidStateError,
BrokenExecutor,
Future,
Executor,
wait,
as_completed,
)
| <commit_before># Author: Lisandro Dalcin
# Contact: dalcinl@gmail.com
# pylint: disable=unused-import
# pylint: disable=redefined-builtin
# pylint: disable=missing-module-docstring
try:
from concurrent.futures import (
FIRST_COMPLETED,
FIRST_EXCEPTION,
ALL_COMPLETED,
CancelledError,
TimeoutError,
Future,
Executor,
wait,
as_completed,
)
try: # Python 3.7
from concurrent.futures import BrokenExecutor
except ImportError: # pragma: no cover
BrokenExecutor = RuntimeError
try: # Python 3.8
from concurrent.futures import InvalidStateError
except ImportError: # pragma: no cover
InvalidStateError = CancelledError.__base__
except ImportError: # pragma: no cover
from ._base import (
FIRST_COMPLETED,
FIRST_EXCEPTION,
ALL_COMPLETED,
CancelledError,
TimeoutError,
InvalidStateError,
BrokenExecutor,
Future,
Executor,
wait,
as_completed,
)
<commit_msg>mpi4py.futures: Fix backward compatibility exception types<commit_after># Author: Lisandro Dalcin
# Contact: dalcinl@gmail.com
# pylint: disable=unused-import
# pylint: disable=redefined-builtin
# pylint: disable=missing-module-docstring
try:
from concurrent.futures import (
FIRST_COMPLETED,
FIRST_EXCEPTION,
ALL_COMPLETED,
CancelledError,
TimeoutError,
Future,
Executor,
wait,
as_completed,
)
try: # Python 3.7
from concurrent.futures import BrokenExecutor
except ImportError: # pragma: no cover
class BrokenExecutor(RuntimeError):
"""The executor has become non-functional."""
try: # Python 3.8
from concurrent.futures import InvalidStateError
except ImportError: # pragma: no cover
# pylint: disable=too-few-public-methods
# pylint: disable=useless-object-inheritance
class InvalidStateError(CancelledError.__base__):
"""The operation is not allowed in this state."""
except ImportError: # pragma: no cover
from ._base import (
FIRST_COMPLETED,
FIRST_EXCEPTION,
ALL_COMPLETED,
CancelledError,
TimeoutError,
InvalidStateError,
BrokenExecutor,
Future,
Executor,
wait,
as_completed,
)
|
65fcd98e65a5921dabf324e82a5e5925b1279a30 | alfred_db/migrations/versions/29a56dc34a2b_add_permissions.py | alfred_db/migrations/versions/29a56dc34a2b_add_permissions.py | """Add permissions
Revision ID: 29a56dc34a2b
Revises: 4fdf1059c4ba
Create Date: 2012-09-02 14:06:24.088307
"""
# revision identifiers, used by Alembic.
revision = '29a56dc34a2b'
down_revision = '4fdf1059c4ba'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table('permissions',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('repository_id', sa.Integer(), nullable=False),
sa.Column('admin', sa.Boolean(), nullable=False),
sa.Column('push', sa.Boolean(), nullable=False),
sa.Column('pull', sa.Boolean(), nullable=False),
sa.ForeignKeyConstraint(['repository_id'], ['repositories.id'], ),
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
sa.PrimaryKeyConstraint('id')
)
def downgrade():
op.drop_table('permissions')
| """Add permissions
Revision ID: 29a56dc34a2b
Revises: 4fdf1059c4ba
Create Date: 2012-09-02 14:06:24.088307
"""
# revision identifiers, used by Alembic.
revision = '29a56dc34a2b'
down_revision = '5245d0b46f8'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table('permissions',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('repository_id', sa.Integer(), nullable=False),
sa.Column('admin', sa.Boolean(), nullable=False),
sa.Column('push', sa.Boolean(), nullable=False),
sa.Column('pull', sa.Boolean(), nullable=False),
sa.ForeignKeyConstraint(
['repository_id'], ['repositories.id'], ondelete='CASCADE',
),
sa.ForeignKeyConstraint(
['user_id'], ['users.id'], ondelete='CASCADE',
),
sa.PrimaryKeyConstraint('id')
)
def downgrade():
op.drop_table('permissions')
| Fix permission table creation migration | Fix permission table creation migration
| Python | isc | alfredhq/alfred-db | """Add permissions
Revision ID: 29a56dc34a2b
Revises: 4fdf1059c4ba
Create Date: 2012-09-02 14:06:24.088307
"""
# revision identifiers, used by Alembic.
revision = '29a56dc34a2b'
down_revision = '4fdf1059c4ba'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table('permissions',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('repository_id', sa.Integer(), nullable=False),
sa.Column('admin', sa.Boolean(), nullable=False),
sa.Column('push', sa.Boolean(), nullable=False),
sa.Column('pull', sa.Boolean(), nullable=False),
sa.ForeignKeyConstraint(['repository_id'], ['repositories.id'], ),
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
sa.PrimaryKeyConstraint('id')
)
def downgrade():
op.drop_table('permissions')
Fix permission table creation migration | """Add permissions
Revision ID: 29a56dc34a2b
Revises: 4fdf1059c4ba
Create Date: 2012-09-02 14:06:24.088307
"""
# revision identifiers, used by Alembic.
revision = '29a56dc34a2b'
down_revision = '5245d0b46f8'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table('permissions',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('repository_id', sa.Integer(), nullable=False),
sa.Column('admin', sa.Boolean(), nullable=False),
sa.Column('push', sa.Boolean(), nullable=False),
sa.Column('pull', sa.Boolean(), nullable=False),
sa.ForeignKeyConstraint(
['repository_id'], ['repositories.id'], ondelete='CASCADE',
),
sa.ForeignKeyConstraint(
['user_id'], ['users.id'], ondelete='CASCADE',
),
sa.PrimaryKeyConstraint('id')
)
def downgrade():
op.drop_table('permissions')
| <commit_before>"""Add permissions
Revision ID: 29a56dc34a2b
Revises: 4fdf1059c4ba
Create Date: 2012-09-02 14:06:24.088307
"""
# revision identifiers, used by Alembic.
revision = '29a56dc34a2b'
down_revision = '4fdf1059c4ba'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table('permissions',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('repository_id', sa.Integer(), nullable=False),
sa.Column('admin', sa.Boolean(), nullable=False),
sa.Column('push', sa.Boolean(), nullable=False),
sa.Column('pull', sa.Boolean(), nullable=False),
sa.ForeignKeyConstraint(['repository_id'], ['repositories.id'], ),
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
sa.PrimaryKeyConstraint('id')
)
def downgrade():
op.drop_table('permissions')
<commit_msg>Fix permission table creation migration<commit_after> | """Add permissions
Revision ID: 29a56dc34a2b
Revises: 4fdf1059c4ba
Create Date: 2012-09-02 14:06:24.088307
"""
# revision identifiers, used by Alembic.
revision = '29a56dc34a2b'
down_revision = '5245d0b46f8'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table('permissions',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('repository_id', sa.Integer(), nullable=False),
sa.Column('admin', sa.Boolean(), nullable=False),
sa.Column('push', sa.Boolean(), nullable=False),
sa.Column('pull', sa.Boolean(), nullable=False),
sa.ForeignKeyConstraint(
['repository_id'], ['repositories.id'], ondelete='CASCADE',
),
sa.ForeignKeyConstraint(
['user_id'], ['users.id'], ondelete='CASCADE',
),
sa.PrimaryKeyConstraint('id')
)
def downgrade():
op.drop_table('permissions')
| """Add permissions
Revision ID: 29a56dc34a2b
Revises: 4fdf1059c4ba
Create Date: 2012-09-02 14:06:24.088307
"""
# revision identifiers, used by Alembic.
revision = '29a56dc34a2b'
down_revision = '4fdf1059c4ba'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table('permissions',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('repository_id', sa.Integer(), nullable=False),
sa.Column('admin', sa.Boolean(), nullable=False),
sa.Column('push', sa.Boolean(), nullable=False),
sa.Column('pull', sa.Boolean(), nullable=False),
sa.ForeignKeyConstraint(['repository_id'], ['repositories.id'], ),
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
sa.PrimaryKeyConstraint('id')
)
def downgrade():
op.drop_table('permissions')
Fix permission table creation migration"""Add permissions
Revision ID: 29a56dc34a2b
Revises: 4fdf1059c4ba
Create Date: 2012-09-02 14:06:24.088307
"""
# revision identifiers, used by Alembic.
revision = '29a56dc34a2b'
down_revision = '5245d0b46f8'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table('permissions',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('repository_id', sa.Integer(), nullable=False),
sa.Column('admin', sa.Boolean(), nullable=False),
sa.Column('push', sa.Boolean(), nullable=False),
sa.Column('pull', sa.Boolean(), nullable=False),
sa.ForeignKeyConstraint(
['repository_id'], ['repositories.id'], ondelete='CASCADE',
),
sa.ForeignKeyConstraint(
['user_id'], ['users.id'], ondelete='CASCADE',
),
sa.PrimaryKeyConstraint('id')
)
def downgrade():
op.drop_table('permissions')
| <commit_before>"""Add permissions
Revision ID: 29a56dc34a2b
Revises: 4fdf1059c4ba
Create Date: 2012-09-02 14:06:24.088307
"""
# revision identifiers, used by Alembic.
revision = '29a56dc34a2b'
down_revision = '4fdf1059c4ba'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table('permissions',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('repository_id', sa.Integer(), nullable=False),
sa.Column('admin', sa.Boolean(), nullable=False),
sa.Column('push', sa.Boolean(), nullable=False),
sa.Column('pull', sa.Boolean(), nullable=False),
sa.ForeignKeyConstraint(['repository_id'], ['repositories.id'], ),
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
sa.PrimaryKeyConstraint('id')
)
def downgrade():
op.drop_table('permissions')
<commit_msg>Fix permission table creation migration<commit_after>"""Add permissions
Revision ID: 29a56dc34a2b
Revises: 4fdf1059c4ba
Create Date: 2012-09-02 14:06:24.088307
"""
# revision identifiers, used by Alembic.
revision = '29a56dc34a2b'
down_revision = '5245d0b46f8'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table('permissions',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('repository_id', sa.Integer(), nullable=False),
sa.Column('admin', sa.Boolean(), nullable=False),
sa.Column('push', sa.Boolean(), nullable=False),
sa.Column('pull', sa.Boolean(), nullable=False),
sa.ForeignKeyConstraint(
['repository_id'], ['repositories.id'], ondelete='CASCADE',
),
sa.ForeignKeyConstraint(
['user_id'], ['users.id'], ondelete='CASCADE',
),
sa.PrimaryKeyConstraint('id')
)
def downgrade():
op.drop_table('permissions')
|
f85001b39f8f8097c20a197f8cbde70d7ec8e88b | tests/test_extension.py | tests/test_extension.py | import mock
from mopidy_spotify import Extension, backend as backend_lib
def test_get_default_config():
ext = Extension()
config = ext.get_default_config()
assert '[spotify]' in config
assert 'enabled = true' in config
def test_get_config_schema():
ext = Extension()
schema = ext.get_config_schema()
assert 'username' in schema
assert 'password' in schema
assert 'bitrate' in schema
assert 'timeout' in schema
assert 'cache_dir' in schema
def test_setup():
registry = mock.Mock()
ext = Extension()
ext.setup(registry)
registry.add.assert_called_with('backend', backend_lib.SpotifyBackend)
| import mock
from mopidy_spotify import Extension, backend as backend_lib
def test_get_default_config():
ext = Extension()
config = ext.get_default_config()
assert '[spotify]' in config
assert 'enabled = true' in config
def test_get_config_schema():
ext = Extension()
schema = ext.get_config_schema()
assert 'username' in schema
assert 'password' in schema
assert 'bitrate' in schema
assert 'timeout' in schema
assert 'cache_dir' in schema
assert 'settings_dir' in schema
assert 'toplist_countries' in schema
def test_setup():
registry = mock.Mock()
ext = Extension()
ext.setup(registry)
registry.add.assert_called_with('backend', backend_lib.SpotifyBackend)
| Test existing config schema members | Test existing config schema members
| Python | apache-2.0 | jodal/mopidy-spotify,kingosticks/mopidy-spotify,mopidy/mopidy-spotify | import mock
from mopidy_spotify import Extension, backend as backend_lib
def test_get_default_config():
ext = Extension()
config = ext.get_default_config()
assert '[spotify]' in config
assert 'enabled = true' in config
def test_get_config_schema():
ext = Extension()
schema = ext.get_config_schema()
assert 'username' in schema
assert 'password' in schema
assert 'bitrate' in schema
assert 'timeout' in schema
assert 'cache_dir' in schema
def test_setup():
registry = mock.Mock()
ext = Extension()
ext.setup(registry)
registry.add.assert_called_with('backend', backend_lib.SpotifyBackend)
Test existing config schema members | import mock
from mopidy_spotify import Extension, backend as backend_lib
def test_get_default_config():
ext = Extension()
config = ext.get_default_config()
assert '[spotify]' in config
assert 'enabled = true' in config
def test_get_config_schema():
ext = Extension()
schema = ext.get_config_schema()
assert 'username' in schema
assert 'password' in schema
assert 'bitrate' in schema
assert 'timeout' in schema
assert 'cache_dir' in schema
assert 'settings_dir' in schema
assert 'toplist_countries' in schema
def test_setup():
registry = mock.Mock()
ext = Extension()
ext.setup(registry)
registry.add.assert_called_with('backend', backend_lib.SpotifyBackend)
| <commit_before>import mock
from mopidy_spotify import Extension, backend as backend_lib
def test_get_default_config():
ext = Extension()
config = ext.get_default_config()
assert '[spotify]' in config
assert 'enabled = true' in config
def test_get_config_schema():
ext = Extension()
schema = ext.get_config_schema()
assert 'username' in schema
assert 'password' in schema
assert 'bitrate' in schema
assert 'timeout' in schema
assert 'cache_dir' in schema
def test_setup():
registry = mock.Mock()
ext = Extension()
ext.setup(registry)
registry.add.assert_called_with('backend', backend_lib.SpotifyBackend)
<commit_msg>Test existing config schema members<commit_after> | import mock
from mopidy_spotify import Extension, backend as backend_lib
def test_get_default_config():
ext = Extension()
config = ext.get_default_config()
assert '[spotify]' in config
assert 'enabled = true' in config
def test_get_config_schema():
ext = Extension()
schema = ext.get_config_schema()
assert 'username' in schema
assert 'password' in schema
assert 'bitrate' in schema
assert 'timeout' in schema
assert 'cache_dir' in schema
assert 'settings_dir' in schema
assert 'toplist_countries' in schema
def test_setup():
registry = mock.Mock()
ext = Extension()
ext.setup(registry)
registry.add.assert_called_with('backend', backend_lib.SpotifyBackend)
| import mock
from mopidy_spotify import Extension, backend as backend_lib
def test_get_default_config():
ext = Extension()
config = ext.get_default_config()
assert '[spotify]' in config
assert 'enabled = true' in config
def test_get_config_schema():
ext = Extension()
schema = ext.get_config_schema()
assert 'username' in schema
assert 'password' in schema
assert 'bitrate' in schema
assert 'timeout' in schema
assert 'cache_dir' in schema
def test_setup():
registry = mock.Mock()
ext = Extension()
ext.setup(registry)
registry.add.assert_called_with('backend', backend_lib.SpotifyBackend)
Test existing config schema membersimport mock
from mopidy_spotify import Extension, backend as backend_lib
def test_get_default_config():
ext = Extension()
config = ext.get_default_config()
assert '[spotify]' in config
assert 'enabled = true' in config
def test_get_config_schema():
ext = Extension()
schema = ext.get_config_schema()
assert 'username' in schema
assert 'password' in schema
assert 'bitrate' in schema
assert 'timeout' in schema
assert 'cache_dir' in schema
assert 'settings_dir' in schema
assert 'toplist_countries' in schema
def test_setup():
registry = mock.Mock()
ext = Extension()
ext.setup(registry)
registry.add.assert_called_with('backend', backend_lib.SpotifyBackend)
| <commit_before>import mock
from mopidy_spotify import Extension, backend as backend_lib
def test_get_default_config():
ext = Extension()
config = ext.get_default_config()
assert '[spotify]' in config
assert 'enabled = true' in config
def test_get_config_schema():
ext = Extension()
schema = ext.get_config_schema()
assert 'username' in schema
assert 'password' in schema
assert 'bitrate' in schema
assert 'timeout' in schema
assert 'cache_dir' in schema
def test_setup():
registry = mock.Mock()
ext = Extension()
ext.setup(registry)
registry.add.assert_called_with('backend', backend_lib.SpotifyBackend)
<commit_msg>Test existing config schema members<commit_after>import mock
from mopidy_spotify import Extension, backend as backend_lib
def test_get_default_config():
ext = Extension()
config = ext.get_default_config()
assert '[spotify]' in config
assert 'enabled = true' in config
def test_get_config_schema():
ext = Extension()
schema = ext.get_config_schema()
assert 'username' in schema
assert 'password' in schema
assert 'bitrate' in schema
assert 'timeout' in schema
assert 'cache_dir' in schema
assert 'settings_dir' in schema
assert 'toplist_countries' in schema
def test_setup():
registry = mock.Mock()
ext = Extension()
ext.setup(registry)
registry.add.assert_called_with('backend', backend_lib.SpotifyBackend)
|
71ef5d2994dbbf4aa993ba1110eb5404de1f6ac3 | test_graph.py | test_graph.py | from __future__ import unicode_literals
import pytest
from graph import Graph
@pytest.fixture()
def graph_empty():
g = Graph()
return g
@pytest.fixture()
def graph_filled():
g = Graph()
g.graph = {
5: set([10]),
10: set([5, 20, 15]),
15: set(),
20: set([5]),
25: set(),
30: set()
}
return g
def test_valid_constructor():
g = Graph()
assert isinstance(g, Graph)
assert isinstance(g.graph, dict)
assert len(g.graph) == 0 and len(g) == 0
def test_invalid_constructor():
with pytest.raises(TypeError):
Graph(10)
def test_add_node_to_empty(graph_empty):
graph_empty.add_node(10)
assert 10 in graph_empty
assert isinstance(graph_empty[10], set) and len(graph_empty[10]) == 0
| from __future__ import unicode_literals
import pytest
from graph import Graph
@pytest.fixture()
def graph_empty():
g = Graph()
return g
@pytest.fixture()
def graph_filled():
g = Graph()
g.graph = {
5: set([10]),
10: set([5, 20, 15]),
15: set(),
20: set([5]),
25: set(),
30: set()
}
return g
def test_valid_constructor():
g = Graph()
assert isinstance(g, Graph)
assert isinstance(g.graph, dict)
assert len(g.graph) == 0 and len(g) == 0
def test_invalid_constructor():
with pytest.raises(TypeError):
Graph(10)
def test_add_node_to_empty(graph_empty):
graph_empty.add_node(40)
assert 40 in graph_empty
assert isinstance(graph_empty[40], set) and len(graph_empty[40]) == 0
def test_add_node_to_filled(graph_filled):
graph_filled.add_node(40)
assert 40 in graph_filled
assert isinstance(graph_filled[40], set)
assert len(graph_filled[40]) == 0
def test_add_node_to_filled_existing_node(graph_filled):
with pytest.raises(KeyError):
graph_filled.add_node(5)
def test_add_node_wrong_type(graph_empty):
with pytest.raises(TypeError):
graph_empty.add_node([1, 2, 3])
| Add further tests for add_node | Add further tests for add_node
| Python | mit | jonathanstallings/data-structures,jay-tyler/data-structures | from __future__ import unicode_literals
import pytest
from graph import Graph
@pytest.fixture()
def graph_empty():
g = Graph()
return g
@pytest.fixture()
def graph_filled():
g = Graph()
g.graph = {
5: set([10]),
10: set([5, 20, 15]),
15: set(),
20: set([5]),
25: set(),
30: set()
}
return g
def test_valid_constructor():
g = Graph()
assert isinstance(g, Graph)
assert isinstance(g.graph, dict)
assert len(g.graph) == 0 and len(g) == 0
def test_invalid_constructor():
with pytest.raises(TypeError):
Graph(10)
def test_add_node_to_empty(graph_empty):
graph_empty.add_node(10)
assert 10 in graph_empty
assert isinstance(graph_empty[10], set) and len(graph_empty[10]) == 0
Add further tests for add_node | from __future__ import unicode_literals
import pytest
from graph import Graph
@pytest.fixture()
def graph_empty():
g = Graph()
return g
@pytest.fixture()
def graph_filled():
g = Graph()
g.graph = {
5: set([10]),
10: set([5, 20, 15]),
15: set(),
20: set([5]),
25: set(),
30: set()
}
return g
def test_valid_constructor():
g = Graph()
assert isinstance(g, Graph)
assert isinstance(g.graph, dict)
assert len(g.graph) == 0 and len(g) == 0
def test_invalid_constructor():
with pytest.raises(TypeError):
Graph(10)
def test_add_node_to_empty(graph_empty):
graph_empty.add_node(40)
assert 40 in graph_empty
assert isinstance(graph_empty[40], set) and len(graph_empty[40]) == 0
def test_add_node_to_filled(graph_filled):
graph_filled.add_node(40)
assert 40 in graph_filled
assert isinstance(graph_filled[40], set)
assert len(graph_filled[40]) == 0
def test_add_node_to_filled_existing_node(graph_filled):
with pytest.raises(KeyError):
graph_filled.add_node(5)
def test_add_node_wrong_type(graph_empty):
with pytest.raises(TypeError):
graph_empty.add_node([1, 2, 3])
| <commit_before>from __future__ import unicode_literals
import pytest
from graph import Graph
@pytest.fixture()
def graph_empty():
g = Graph()
return g
@pytest.fixture()
def graph_filled():
g = Graph()
g.graph = {
5: set([10]),
10: set([5, 20, 15]),
15: set(),
20: set([5]),
25: set(),
30: set()
}
return g
def test_valid_constructor():
g = Graph()
assert isinstance(g, Graph)
assert isinstance(g.graph, dict)
assert len(g.graph) == 0 and len(g) == 0
def test_invalid_constructor():
with pytest.raises(TypeError):
Graph(10)
def test_add_node_to_empty(graph_empty):
graph_empty.add_node(10)
assert 10 in graph_empty
assert isinstance(graph_empty[10], set) and len(graph_empty[10]) == 0
<commit_msg>Add further tests for add_node<commit_after> | from __future__ import unicode_literals
import pytest
from graph import Graph
@pytest.fixture()
def graph_empty():
g = Graph()
return g
@pytest.fixture()
def graph_filled():
g = Graph()
g.graph = {
5: set([10]),
10: set([5, 20, 15]),
15: set(),
20: set([5]),
25: set(),
30: set()
}
return g
def test_valid_constructor():
g = Graph()
assert isinstance(g, Graph)
assert isinstance(g.graph, dict)
assert len(g.graph) == 0 and len(g) == 0
def test_invalid_constructor():
with pytest.raises(TypeError):
Graph(10)
def test_add_node_to_empty(graph_empty):
graph_empty.add_node(40)
assert 40 in graph_empty
assert isinstance(graph_empty[40], set) and len(graph_empty[40]) == 0
def test_add_node_to_filled(graph_filled):
graph_filled.add_node(40)
assert 40 in graph_filled
assert isinstance(graph_filled[40], set)
assert len(graph_filled[40]) == 0
def test_add_node_to_filled_existing_node(graph_filled):
with pytest.raises(KeyError):
graph_filled.add_node(5)
def test_add_node_wrong_type(graph_empty):
with pytest.raises(TypeError):
graph_empty.add_node([1, 2, 3])
| from __future__ import unicode_literals
import pytest
from graph import Graph
@pytest.fixture()
def graph_empty():
g = Graph()
return g
@pytest.fixture()
def graph_filled():
g = Graph()
g.graph = {
5: set([10]),
10: set([5, 20, 15]),
15: set(),
20: set([5]),
25: set(),
30: set()
}
return g
def test_valid_constructor():
g = Graph()
assert isinstance(g, Graph)
assert isinstance(g.graph, dict)
assert len(g.graph) == 0 and len(g) == 0
def test_invalid_constructor():
with pytest.raises(TypeError):
Graph(10)
def test_add_node_to_empty(graph_empty):
graph_empty.add_node(10)
assert 10 in graph_empty
assert isinstance(graph_empty[10], set) and len(graph_empty[10]) == 0
Add further tests for add_nodefrom __future__ import unicode_literals
import pytest
from graph import Graph
@pytest.fixture()
def graph_empty():
g = Graph()
return g
@pytest.fixture()
def graph_filled():
g = Graph()
g.graph = {
5: set([10]),
10: set([5, 20, 15]),
15: set(),
20: set([5]),
25: set(),
30: set()
}
return g
def test_valid_constructor():
g = Graph()
assert isinstance(g, Graph)
assert isinstance(g.graph, dict)
assert len(g.graph) == 0 and len(g) == 0
def test_invalid_constructor():
with pytest.raises(TypeError):
Graph(10)
def test_add_node_to_empty(graph_empty):
graph_empty.add_node(40)
assert 40 in graph_empty
assert isinstance(graph_empty[40], set) and len(graph_empty[40]) == 0
def test_add_node_to_filled(graph_filled):
graph_filled.add_node(40)
assert 40 in graph_filled
assert isinstance(graph_filled[40], set)
assert len(graph_filled[40]) == 0
def test_add_node_to_filled_existing_node(graph_filled):
with pytest.raises(KeyError):
graph_filled.add_node(5)
def test_add_node_wrong_type(graph_empty):
with pytest.raises(TypeError):
graph_empty.add_node([1, 2, 3])
| <commit_before>from __future__ import unicode_literals
import pytest
from graph import Graph
@pytest.fixture()
def graph_empty():
g = Graph()
return g
@pytest.fixture()
def graph_filled():
g = Graph()
g.graph = {
5: set([10]),
10: set([5, 20, 15]),
15: set(),
20: set([5]),
25: set(),
30: set()
}
return g
def test_valid_constructor():
g = Graph()
assert isinstance(g, Graph)
assert isinstance(g.graph, dict)
assert len(g.graph) == 0 and len(g) == 0
def test_invalid_constructor():
with pytest.raises(TypeError):
Graph(10)
def test_add_node_to_empty(graph_empty):
graph_empty.add_node(10)
assert 10 in graph_empty
assert isinstance(graph_empty[10], set) and len(graph_empty[10]) == 0
<commit_msg>Add further tests for add_node<commit_after>from __future__ import unicode_literals
import pytest
from graph import Graph
@pytest.fixture()
def graph_empty():
g = Graph()
return g
@pytest.fixture()
def graph_filled():
g = Graph()
g.graph = {
5: set([10]),
10: set([5, 20, 15]),
15: set(),
20: set([5]),
25: set(),
30: set()
}
return g
def test_valid_constructor():
g = Graph()
assert isinstance(g, Graph)
assert isinstance(g.graph, dict)
assert len(g.graph) == 0 and len(g) == 0
def test_invalid_constructor():
with pytest.raises(TypeError):
Graph(10)
def test_add_node_to_empty(graph_empty):
graph_empty.add_node(40)
assert 40 in graph_empty
assert isinstance(graph_empty[40], set) and len(graph_empty[40]) == 0
def test_add_node_to_filled(graph_filled):
graph_filled.add_node(40)
assert 40 in graph_filled
assert isinstance(graph_filled[40], set)
assert len(graph_filled[40]) == 0
def test_add_node_to_filled_existing_node(graph_filled):
with pytest.raises(KeyError):
graph_filled.add_node(5)
def test_add_node_wrong_type(graph_empty):
with pytest.raises(TypeError):
graph_empty.add_node([1, 2, 3])
|
e948fa0c24ebfe83d2df81f729b5bcc9b4b971b4 | mygpo/data/models.py | mygpo/data/models.py | from datetime import datetime
from django.db import models
from mygpo.podcasts.models import Podcast
class PodcastUpdateResult(models.Model):
""" Results of a podcast update
Once an instance is stored, the update is assumed to be finished. """
# The podcast that was updated
podcast = models.ForeignKey(Podcast, on_delete=models.CASCADE)
# The timestamp at which the updated started to be executed
start = models.DateTimeField(default=datetime.utcnow)
# The duration of the update
duration = models.DurationField()
# A flad indicating whether the update was successful
successful = models.BooleanField()
# An error message. Should be empty if the update was successful
error_message = models.TextField()
# A flag indicating whether the update created the podcast
podcast_created = models.BooleanField()
# The number of episodes that were created by the update
episodes_added = models.IntegerField()
class Meta(object):
get_latest_by = 'start'
ordering = ['-start']
indexes = [
models.Index(fields=['podcast', 'start'])
]
| from datetime import datetime
from django.db import models
from mygpo.core.models import UUIDModel
from mygpo.podcasts.models import Podcast
class PodcastUpdateResult(UUIDModel):
""" Results of a podcast update
Once an instance is stored, the update is assumed to be finished. """
# The podcast that was updated
podcast = models.ForeignKey(Podcast, on_delete=models.CASCADE)
# The timestamp at which the updated started to be executed
start = models.DateTimeField(default=datetime.utcnow)
# The duration of the update
duration = models.DurationField()
# A flad indicating whether the update was successful
successful = models.BooleanField()
# An error message. Should be empty if the update was successful
error_message = models.TextField()
# A flag indicating whether the update created the podcast
podcast_created = models.BooleanField()
# The number of episodes that were created by the update
episodes_added = models.IntegerField()
class Meta(object):
get_latest_by = 'start'
ordering = ['-start']
indexes = [
models.Index(fields=['podcast', 'start'])
]
| Use UUID as primary key of PodcastUpdateResult | Use UUID as primary key of PodcastUpdateResult
| Python | agpl-3.0 | gpodder/mygpo,gpodder/mygpo,gpodder/mygpo,gpodder/mygpo | from datetime import datetime
from django.db import models
from mygpo.podcasts.models import Podcast
class PodcastUpdateResult(models.Model):
""" Results of a podcast update
Once an instance is stored, the update is assumed to be finished. """
# The podcast that was updated
podcast = models.ForeignKey(Podcast, on_delete=models.CASCADE)
# The timestamp at which the updated started to be executed
start = models.DateTimeField(default=datetime.utcnow)
# The duration of the update
duration = models.DurationField()
# A flad indicating whether the update was successful
successful = models.BooleanField()
# An error message. Should be empty if the update was successful
error_message = models.TextField()
# A flag indicating whether the update created the podcast
podcast_created = models.BooleanField()
# The number of episodes that were created by the update
episodes_added = models.IntegerField()
class Meta(object):
get_latest_by = 'start'
ordering = ['-start']
indexes = [
models.Index(fields=['podcast', 'start'])
]
Use UUID as primary key of PodcastUpdateResult | from datetime import datetime
from django.db import models
from mygpo.core.models import UUIDModel
from mygpo.podcasts.models import Podcast
class PodcastUpdateResult(UUIDModel):
""" Results of a podcast update
Once an instance is stored, the update is assumed to be finished. """
# The podcast that was updated
podcast = models.ForeignKey(Podcast, on_delete=models.CASCADE)
# The timestamp at which the updated started to be executed
start = models.DateTimeField(default=datetime.utcnow)
# The duration of the update
duration = models.DurationField()
# A flad indicating whether the update was successful
successful = models.BooleanField()
# An error message. Should be empty if the update was successful
error_message = models.TextField()
# A flag indicating whether the update created the podcast
podcast_created = models.BooleanField()
# The number of episodes that were created by the update
episodes_added = models.IntegerField()
class Meta(object):
get_latest_by = 'start'
ordering = ['-start']
indexes = [
models.Index(fields=['podcast', 'start'])
]
| <commit_before>from datetime import datetime
from django.db import models
from mygpo.podcasts.models import Podcast
class PodcastUpdateResult(models.Model):
""" Results of a podcast update
Once an instance is stored, the update is assumed to be finished. """
# The podcast that was updated
podcast = models.ForeignKey(Podcast, on_delete=models.CASCADE)
# The timestamp at which the updated started to be executed
start = models.DateTimeField(default=datetime.utcnow)
# The duration of the update
duration = models.DurationField()
# A flad indicating whether the update was successful
successful = models.BooleanField()
# An error message. Should be empty if the update was successful
error_message = models.TextField()
# A flag indicating whether the update created the podcast
podcast_created = models.BooleanField()
# The number of episodes that were created by the update
episodes_added = models.IntegerField()
class Meta(object):
get_latest_by = 'start'
ordering = ['-start']
indexes = [
models.Index(fields=['podcast', 'start'])
]
<commit_msg>Use UUID as primary key of PodcastUpdateResult<commit_after> | from datetime import datetime
from django.db import models
from mygpo.core.models import UUIDModel
from mygpo.podcasts.models import Podcast
class PodcastUpdateResult(UUIDModel):
""" Results of a podcast update
Once an instance is stored, the update is assumed to be finished. """
# The podcast that was updated
podcast = models.ForeignKey(Podcast, on_delete=models.CASCADE)
# The timestamp at which the updated started to be executed
start = models.DateTimeField(default=datetime.utcnow)
# The duration of the update
duration = models.DurationField()
# A flad indicating whether the update was successful
successful = models.BooleanField()
# An error message. Should be empty if the update was successful
error_message = models.TextField()
# A flag indicating whether the update created the podcast
podcast_created = models.BooleanField()
# The number of episodes that were created by the update
episodes_added = models.IntegerField()
class Meta(object):
get_latest_by = 'start'
ordering = ['-start']
indexes = [
models.Index(fields=['podcast', 'start'])
]
| from datetime import datetime
from django.db import models
from mygpo.podcasts.models import Podcast
class PodcastUpdateResult(models.Model):
""" Results of a podcast update
Once an instance is stored, the update is assumed to be finished. """
# The podcast that was updated
podcast = models.ForeignKey(Podcast, on_delete=models.CASCADE)
# The timestamp at which the updated started to be executed
start = models.DateTimeField(default=datetime.utcnow)
# The duration of the update
duration = models.DurationField()
# A flad indicating whether the update was successful
successful = models.BooleanField()
# An error message. Should be empty if the update was successful
error_message = models.TextField()
# A flag indicating whether the update created the podcast
podcast_created = models.BooleanField()
# The number of episodes that were created by the update
episodes_added = models.IntegerField()
class Meta(object):
get_latest_by = 'start'
ordering = ['-start']
indexes = [
models.Index(fields=['podcast', 'start'])
]
Use UUID as primary key of PodcastUpdateResultfrom datetime import datetime
from django.db import models
from mygpo.core.models import UUIDModel
from mygpo.podcasts.models import Podcast
class PodcastUpdateResult(UUIDModel):
""" Results of a podcast update
Once an instance is stored, the update is assumed to be finished. """
# The podcast that was updated
podcast = models.ForeignKey(Podcast, on_delete=models.CASCADE)
# The timestamp at which the updated started to be executed
start = models.DateTimeField(default=datetime.utcnow)
# The duration of the update
duration = models.DurationField()
# A flad indicating whether the update was successful
successful = models.BooleanField()
# An error message. Should be empty if the update was successful
error_message = models.TextField()
# A flag indicating whether the update created the podcast
podcast_created = models.BooleanField()
# The number of episodes that were created by the update
episodes_added = models.IntegerField()
class Meta(object):
get_latest_by = 'start'
ordering = ['-start']
indexes = [
models.Index(fields=['podcast', 'start'])
]
| <commit_before>from datetime import datetime
from django.db import models
from mygpo.podcasts.models import Podcast
class PodcastUpdateResult(models.Model):
""" Results of a podcast update
Once an instance is stored, the update is assumed to be finished. """
# The podcast that was updated
podcast = models.ForeignKey(Podcast, on_delete=models.CASCADE)
# The timestamp at which the updated started to be executed
start = models.DateTimeField(default=datetime.utcnow)
# The duration of the update
duration = models.DurationField()
# A flad indicating whether the update was successful
successful = models.BooleanField()
# An error message. Should be empty if the update was successful
error_message = models.TextField()
# A flag indicating whether the update created the podcast
podcast_created = models.BooleanField()
# The number of episodes that were created by the update
episodes_added = models.IntegerField()
class Meta(object):
get_latest_by = 'start'
ordering = ['-start']
indexes = [
models.Index(fields=['podcast', 'start'])
]
<commit_msg>Use UUID as primary key of PodcastUpdateResult<commit_after>from datetime import datetime
from django.db import models
from mygpo.core.models import UUIDModel
from mygpo.podcasts.models import Podcast
class PodcastUpdateResult(UUIDModel):
""" Results of a podcast update
Once an instance is stored, the update is assumed to be finished. """
# The podcast that was updated
podcast = models.ForeignKey(Podcast, on_delete=models.CASCADE)
# The timestamp at which the updated started to be executed
start = models.DateTimeField(default=datetime.utcnow)
# The duration of the update
duration = models.DurationField()
# A flad indicating whether the update was successful
successful = models.BooleanField()
# An error message. Should be empty if the update was successful
error_message = models.TextField()
# A flag indicating whether the update created the podcast
podcast_created = models.BooleanField()
# The number of episodes that were created by the update
episodes_added = models.IntegerField()
class Meta(object):
get_latest_by = 'start'
ordering = ['-start']
indexes = [
models.Index(fields=['podcast', 'start'])
]
|
5b9bc280a4a5806dbf87ec555fcfdf87ad8bdfd9 | raven/contrib/django/utils.py | raven/contrib/django/utils.py | def linebreak_iter(template_source):
yield 0
p = template_source.find('\n')
while p >= 0:
yield p + 1
p = template_source.find('\n', p + 1)
yield len(template_source) + 1
def get_data_from_template(source):
origin, (start, end) = source
template_source = origin.reload()
lineno = None
upto = 0
source_lines = []
for num, next in enumerate(linebreak_iter(template_source)):
if start >= upto and end <= next:
lineno = num
source_lines.append(template_source[upto:next])
upto = next
if not source_lines or lineno is None:
return {}
pre_context = source_lines[max(lineno - 3, 0):lineno]
post_context = source_lines[(lineno + 1):(lineno + 4)]
context_line = source_lines[lineno]
return {
'sentry.interfaces.Template': {
'filename': origin.name,
'pre_context': pre_context,
'context_line': context_line,
'lineno': lineno,
'post_context': post_context,
},
'culprit': origin.loadname,
}
| def linebreak_iter(template_source):
yield 0
p = template_source.find('\n')
while p >= 0:
yield p + 1
p = template_source.find('\n', p + 1)
yield len(template_source) + 1
def get_data_from_template(source):
origin, (start, end) = source
template_source = origin.reload()
lineno = None
upto = 0
source_lines = []
for num, next in enumerate(linebreak_iter(template_source)):
if start >= upto and end <= next:
lineno = num
source_lines.append(template_source[upto:next])
upto = next
if not source_lines or lineno is None:
return {}
pre_context = source_lines[max(lineno - 3, 0):lineno]
post_context = source_lines[(lineno + 1):(lineno + 4)]
context_line = source_lines[lineno]
return {
'sentry.interfaces.Template': {
'filename': origin.loadname,
'abs_path': origin.name,
'pre_context': pre_context,
'context_line': context_line,
'lineno': lineno,
'post_context': post_context,
},
'culprit': origin.loadname,
}
| Implement relative path (use loadname) for Templates | Implement relative path (use loadname) for Templates
| Python | bsd-3-clause | lepture/raven-python,someonehan/raven-python,dbravender/raven-python,jmp0xf/raven-python,ticosax/opbeat_python,icereval/raven-python,patrys/opbeat_python,tarkatronic/opbeat_python,lepture/raven-python,danriti/raven-python,Photonomie/raven-python,beniwohli/apm-agent-python,dirtycoder/opbeat_python,percipient/raven-python,akheron/raven-python,recht/raven-python,dbravender/raven-python,ronaldevers/raven-python,smarkets/raven-python,johansteffner/raven-python,Photonomie/raven-python,nikolas/raven-python,akheron/raven-python,getsentry/raven-python,johansteffner/raven-python,inspirehep/raven-python,patrys/opbeat_python,dirtycoder/opbeat_python,nikolas/raven-python,nikolas/raven-python,nikolas/raven-python,inspirehep/raven-python,daikeren/opbeat_python,ewdurbin/raven-python,getsentry/raven-python,tarkatronic/opbeat_python,smarkets/raven-python,ticosax/opbeat_python,jmagnusson/raven-python,arthurlogilab/raven-python,arthurlogilab/raven-python,icereval/raven-python,percipient/raven-python,danriti/raven-python,akalipetis/raven-python,ticosax/opbeat_python,Photonomie/raven-python,jmagnusson/raven-python,jmp0xf/raven-python,johansteffner/raven-python,jbarbuto/raven-python,percipient/raven-python,ronaldevers/raven-python,jmagnusson/raven-python,patrys/opbeat_python,patrys/opbeat_python,hzy/raven-python,recht/raven-python,alex/raven,beniwohli/apm-agent-python,jbarbuto/raven-python,beniwohli/apm-agent-python,collective/mr.poe,inspirehep/raven-python,ewdurbin/raven-python,Goldmund-Wyldebeast-Wunderliebe/raven-python,Goldmund-Wyldebeast-Wunderliebe/raven-python,smarkets/raven-python,smarkets/raven-python,daikeren/opbeat_python,ewdurbin/raven-python,getsentry/raven-python,someonehan/raven-python,tarkatronic/opbeat_python,akalipetis/raven-python,hzy/raven-python,arthurlogilab/raven-python,arthurlogilab/raven-python,hzy/raven-python,recht/raven-python,icereval/raven-python,dirtycoder/opbeat_python,Goldmund-Wyldebeast-Wunderliebe/raven-python,lopter/raven-python-old,jmp0xf/raven-python,akalipetis/raven-python,Goldmund-Wyldebeast-Wunderliebe/raven-python,icereval/raven-python,daikeren/opbeat_python,beniwohli/apm-agent-python,someonehan/raven-python,akheron/raven-python,jbarbuto/raven-python,ronaldevers/raven-python,openlabs/raven,lepture/raven-python,dbravender/raven-python,danriti/raven-python,inspirehep/raven-python,jbarbuto/raven-python | def linebreak_iter(template_source):
yield 0
p = template_source.find('\n')
while p >= 0:
yield p + 1
p = template_source.find('\n', p + 1)
yield len(template_source) + 1
def get_data_from_template(source):
origin, (start, end) = source
template_source = origin.reload()
lineno = None
upto = 0
source_lines = []
for num, next in enumerate(linebreak_iter(template_source)):
if start >= upto and end <= next:
lineno = num
source_lines.append(template_source[upto:next])
upto = next
if not source_lines or lineno is None:
return {}
pre_context = source_lines[max(lineno - 3, 0):lineno]
post_context = source_lines[(lineno + 1):(lineno + 4)]
context_line = source_lines[lineno]
return {
'sentry.interfaces.Template': {
'filename': origin.name,
'pre_context': pre_context,
'context_line': context_line,
'lineno': lineno,
'post_context': post_context,
},
'culprit': origin.loadname,
}
Implement relative path (use loadname) for Templates | def linebreak_iter(template_source):
yield 0
p = template_source.find('\n')
while p >= 0:
yield p + 1
p = template_source.find('\n', p + 1)
yield len(template_source) + 1
def get_data_from_template(source):
origin, (start, end) = source
template_source = origin.reload()
lineno = None
upto = 0
source_lines = []
for num, next in enumerate(linebreak_iter(template_source)):
if start >= upto and end <= next:
lineno = num
source_lines.append(template_source[upto:next])
upto = next
if not source_lines or lineno is None:
return {}
pre_context = source_lines[max(lineno - 3, 0):lineno]
post_context = source_lines[(lineno + 1):(lineno + 4)]
context_line = source_lines[lineno]
return {
'sentry.interfaces.Template': {
'filename': origin.loadname,
'abs_path': origin.name,
'pre_context': pre_context,
'context_line': context_line,
'lineno': lineno,
'post_context': post_context,
},
'culprit': origin.loadname,
}
| <commit_before>def linebreak_iter(template_source):
yield 0
p = template_source.find('\n')
while p >= 0:
yield p + 1
p = template_source.find('\n', p + 1)
yield len(template_source) + 1
def get_data_from_template(source):
origin, (start, end) = source
template_source = origin.reload()
lineno = None
upto = 0
source_lines = []
for num, next in enumerate(linebreak_iter(template_source)):
if start >= upto and end <= next:
lineno = num
source_lines.append(template_source[upto:next])
upto = next
if not source_lines or lineno is None:
return {}
pre_context = source_lines[max(lineno - 3, 0):lineno]
post_context = source_lines[(lineno + 1):(lineno + 4)]
context_line = source_lines[lineno]
return {
'sentry.interfaces.Template': {
'filename': origin.name,
'pre_context': pre_context,
'context_line': context_line,
'lineno': lineno,
'post_context': post_context,
},
'culprit': origin.loadname,
}
<commit_msg>Implement relative path (use loadname) for Templates<commit_after> | def linebreak_iter(template_source):
yield 0
p = template_source.find('\n')
while p >= 0:
yield p + 1
p = template_source.find('\n', p + 1)
yield len(template_source) + 1
def get_data_from_template(source):
origin, (start, end) = source
template_source = origin.reload()
lineno = None
upto = 0
source_lines = []
for num, next in enumerate(linebreak_iter(template_source)):
if start >= upto and end <= next:
lineno = num
source_lines.append(template_source[upto:next])
upto = next
if not source_lines or lineno is None:
return {}
pre_context = source_lines[max(lineno - 3, 0):lineno]
post_context = source_lines[(lineno + 1):(lineno + 4)]
context_line = source_lines[lineno]
return {
'sentry.interfaces.Template': {
'filename': origin.loadname,
'abs_path': origin.name,
'pre_context': pre_context,
'context_line': context_line,
'lineno': lineno,
'post_context': post_context,
},
'culprit': origin.loadname,
}
| def linebreak_iter(template_source):
yield 0
p = template_source.find('\n')
while p >= 0:
yield p + 1
p = template_source.find('\n', p + 1)
yield len(template_source) + 1
def get_data_from_template(source):
origin, (start, end) = source
template_source = origin.reload()
lineno = None
upto = 0
source_lines = []
for num, next in enumerate(linebreak_iter(template_source)):
if start >= upto and end <= next:
lineno = num
source_lines.append(template_source[upto:next])
upto = next
if not source_lines or lineno is None:
return {}
pre_context = source_lines[max(lineno - 3, 0):lineno]
post_context = source_lines[(lineno + 1):(lineno + 4)]
context_line = source_lines[lineno]
return {
'sentry.interfaces.Template': {
'filename': origin.name,
'pre_context': pre_context,
'context_line': context_line,
'lineno': lineno,
'post_context': post_context,
},
'culprit': origin.loadname,
}
Implement relative path (use loadname) for Templatesdef linebreak_iter(template_source):
yield 0
p = template_source.find('\n')
while p >= 0:
yield p + 1
p = template_source.find('\n', p + 1)
yield len(template_source) + 1
def get_data_from_template(source):
origin, (start, end) = source
template_source = origin.reload()
lineno = None
upto = 0
source_lines = []
for num, next in enumerate(linebreak_iter(template_source)):
if start >= upto and end <= next:
lineno = num
source_lines.append(template_source[upto:next])
upto = next
if not source_lines or lineno is None:
return {}
pre_context = source_lines[max(lineno - 3, 0):lineno]
post_context = source_lines[(lineno + 1):(lineno + 4)]
context_line = source_lines[lineno]
return {
'sentry.interfaces.Template': {
'filename': origin.loadname,
'abs_path': origin.name,
'pre_context': pre_context,
'context_line': context_line,
'lineno': lineno,
'post_context': post_context,
},
'culprit': origin.loadname,
}
| <commit_before>def linebreak_iter(template_source):
yield 0
p = template_source.find('\n')
while p >= 0:
yield p + 1
p = template_source.find('\n', p + 1)
yield len(template_source) + 1
def get_data_from_template(source):
origin, (start, end) = source
template_source = origin.reload()
lineno = None
upto = 0
source_lines = []
for num, next in enumerate(linebreak_iter(template_source)):
if start >= upto and end <= next:
lineno = num
source_lines.append(template_source[upto:next])
upto = next
if not source_lines or lineno is None:
return {}
pre_context = source_lines[max(lineno - 3, 0):lineno]
post_context = source_lines[(lineno + 1):(lineno + 4)]
context_line = source_lines[lineno]
return {
'sentry.interfaces.Template': {
'filename': origin.name,
'pre_context': pre_context,
'context_line': context_line,
'lineno': lineno,
'post_context': post_context,
},
'culprit': origin.loadname,
}
<commit_msg>Implement relative path (use loadname) for Templates<commit_after>def linebreak_iter(template_source):
yield 0
p = template_source.find('\n')
while p >= 0:
yield p + 1
p = template_source.find('\n', p + 1)
yield len(template_source) + 1
def get_data_from_template(source):
origin, (start, end) = source
template_source = origin.reload()
lineno = None
upto = 0
source_lines = []
for num, next in enumerate(linebreak_iter(template_source)):
if start >= upto and end <= next:
lineno = num
source_lines.append(template_source[upto:next])
upto = next
if not source_lines or lineno is None:
return {}
pre_context = source_lines[max(lineno - 3, 0):lineno]
post_context = source_lines[(lineno + 1):(lineno + 4)]
context_line = source_lines[lineno]
return {
'sentry.interfaces.Template': {
'filename': origin.loadname,
'abs_path': origin.name,
'pre_context': pre_context,
'context_line': context_line,
'lineno': lineno,
'post_context': post_context,
},
'culprit': origin.loadname,
}
|
ca37ff8b08d5b0dd6db1bd48912807aa40872aba | erpnext/patches/v4_0/customer_discount_to_pricing_rule.py | erpnext/patches/v4_0/customer_discount_to_pricing_rule.py | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils.nestedset import get_root_of
def execute():
frappe.reload_doc("accounts", "doctype", "pricing_rule")
frappe.db.auto_commit_on_many_writes = True
default_item_group = get_root_of("Item Group")
for d in frappe.db.sql("""select * from `tabCustomer Discount`
where ifnull(parent, '') != ''""", as_dict=1):
if not d.discount:
continue
frappe.get_doc({
"doctype": "Pricing Rule",
"apply_on": "Item Group",
"item_group": d.item_group or default_item_group,
"applicable_for": "Customer",
"customer": d.parent,
"price_or_discount": "Discount Percentage",
"discount_percentage": d.discount
}).insert()
frappe.db.auto_commit_on_many_writes = False
frappe.delete_doc("DocType", "Customer Discount")
| # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils.nestedset import get_root_of
def execute():
frappe.reload_doc("accounts", "doctype", "pricing_rule")
frappe.db.auto_commit_on_many_writes = True
default_item_group = get_root_of("Item Group")
for d in frappe.db.sql("""select * from `tabCustomer Discount`
where ifnull(parent, '') != ''""", as_dict=1):
if not d.discount:
continue
frappe.get_doc({
"doctype": "Pricing Rule",
"apply_on": "Item Group",
"item_group": d.item_group or default_item_group,
"applicable_for": "Customer",
"customer": d.parent,
"price_or_discount": "Discount Percentage",
"discount_percentage": d.discount,
"selling": 1
}).insert()
frappe.db.auto_commit_on_many_writes = False
frappe.delete_doc("DocType", "Customer Discount")
| Fix in pricing rule patch | Fix in pricing rule patch
| Python | agpl-3.0 | indictranstech/buyback-erp,Tejal011089/fbd_erpnext,Tejal011089/fbd_erpnext,indictranstech/phrerp,rohitwaghchaure/digitales_erpnext,indictranstech/biggift-erpnext,mbauskar/helpdesk-erpnext,njmube/erpnext,gangadharkadam/johnerp,gangadhar-kadam/verve_live_erp,fuhongliang/erpnext,rohitwaghchaure/GenieManager-erpnext,gangadharkadam/office_erp,sheafferusa/erpnext,mbauskar/sapphire-erpnext,indictranstech/reciphergroup-erpnext,geekroot/erpnext,rohitwaghchaure/erpnext_smart,suyashphadtare/vestasi-erp-final,rohitwaghchaure/GenieManager-erpnext,suyashphadtare/vestasi-update-erp,gangadharkadam/letzerp,gangadharkadam/vlinkerp,mbauskar/helpdesk-erpnext,Tejal011089/paypal_erpnext,gangadhar-kadam/laganerp,gmarke/erpnext,netfirms/erpnext,indictranstech/vestasi-erpnext,gangadhar-kadam/latestchurcherp,gangadhar-kadam/laganerp,njmube/erpnext,mbauskar/alec_frappe5_erpnext,shitolepriya/test-erp,gangadharkadam/saloon_erp_install,suyashphadtare/vestasi-erp-jan-end,mbauskar/omnitech-demo-erpnext,gangadharkadam/vlinkerp,pawaranand/phrerp,Tejal011089/paypal_erpnext,suyashphadtare/test,gsnbng/erpnext,gangadhar-kadam/helpdesk-erpnext,BhupeshGupta/erpnext,gangadharkadam/office_erp,gangadharkadam/contributionerp,rohitwaghchaure/New_Theme_Erp,gangadharkadam/v6_erp,gangadharkadam/saloon_erp,Tejal011089/paypal_erpnext,shft117/SteckerApp,gangadhar-kadam/verve_erp,Suninus/erpnext,saurabh6790/test-erp,Tejal011089/trufil-erpnext,indictranstech/vestasi-erpnext,meisterkleister/erpnext,suyashphadtare/gd-erp,hatwar/buyback-erpnext,rohitwaghchaure/digitales_erpnext,indictranstech/erpnext,Tejal011089/trufil-erpnext,gangadhar-kadam/verve_erp,susuchina/ERPNEXT,SPKian/Testing2,gangadharkadam/sterp,suyashphadtare/vestasi-erp-1,Tejal011089/digitales_erpnext,indictranstech/Das_Erpnext,SPKian/Testing2,rohitwaghchaure/GenieManager-erpnext,susuchina/ERPNEXT,gangadhar-kadam/verve-erp,indictranstech/buyback-erp,suyashphadtare/vestasi-erp-1,rohitwaghchaure/GenieManager-erpnext,hatwar/Das_erpnext,suyashphadtare/vestasi-erp-final,gangadhar-kadam/verve_erp,gangadharkadam/tailorerp,fuhongliang/erpnext,rohitwaghchaure/digitales_erpnext,meisterkleister/erpnext,gangadharkadam/letzerp,indictranstech/erpnext,mbauskar/sapphire-erpnext,gangadhar-kadam/verve-erp,indictranstech/osmosis-erpnext,gangadharkadam/v5_erp,indictranstech/reciphergroup-erpnext,gangadhar-kadam/verve_test_erp,gangadharkadam/v4_erp,gangadhar-kadam/latestchurcherp,ThiagoGarciaAlves/erpnext,geekroot/erpnext,Tejal011089/digitales_erpnext,gmarke/erpnext,gangadharkadam/v6_erp,suyashphadtare/vestasi-erp-jan-end,suyashphadtare/sajil-erp,hatwar/Das_erpnext,indictranstech/phrerp,mbauskar/phrerp,gangadharkadam/vlinkerp,susuchina/ERPNEXT,suyashphadtare/sajil-final-erp,hatwar/focal-erpnext,geekroot/erpnext,gangadhar-kadam/verve_live_erp,ShashaQin/erpnext,gangadharkadam/saloon_erp_install,indictranstech/reciphergroup-erpnext,Suninus/erpnext,4commerce-technologies-AG/erpnext,gangadharkadam/v4_erp,indictranstech/biggift-erpnext,gangadharkadam/verveerp,mbauskar/phrerp,suyashphadtare/test,rohitwaghchaure/digitales_erpnext,susuchina/ERPNEXT,shft117/SteckerApp,gangadharkadam/saloon_erp,gangadharkadam/letzerp,indictranstech/osmosis-erpnext,hatwar/focal-erpnext,indictranstech/fbd_erpnext,gangadharkadam/vlinkerp,suyashphadtare/vestasi-erp-jan-end,indictranstech/internal-erpnext,hernad/erpnext,rohitwaghchaure/erpnext-receipher,indictranstech/biggift-erpnext,gangadhar-kadam/laganerp,hanselke/erpnext-1,indictranstech/internal-erpnext,gangadharkadam/verveerp,fuhongliang/erpnext,MartinEnder/erpnext-de,gangadhar-kadam/smrterp,gangadhar-kadam/verve-erp,gangadharkadam/contributionerp,gangadhar-kadam/verve_test_erp,suyashphadtare/vestasi-erp-jan-end,mbauskar/omnitech-demo-erpnext,indictranstech/focal-erpnext,indictranstech/trufil-erpnext,gangadharkadam/saloon_erp_install,gangadharkadam/sterp,MartinEnder/erpnext-de,gangadharkadam/v5_erp,mbauskar/phrerp,shft117/SteckerApp,suyashphadtare/gd-erp,anandpdoshi/erpnext,indictranstech/Das_Erpnext,indictranstech/Das_Erpnext,suyashphadtare/vestasi-erp-final,gangadhar-kadam/helpdesk-erpnext,rohitwaghchaure/erpnext_smart,Tejal011089/osmosis_erpnext,mbauskar/omnitech-demo-erpnext,rohitwaghchaure/erpnext_smart,gangadharkadam/v4_erp,suyashphadtare/gd-erp,gangadharkadam/verveerp,njmube/erpnext,indictranstech/biggift-erpnext,Tejal011089/huntercamp_erpnext,mbauskar/omnitech-erpnext,hatwar/Das_erpnext,indictranstech/Das_Erpnext,Tejal011089/digitales_erpnext,rohitwaghchaure/New_Theme_Erp,Drooids/erpnext,sagar30051991/ozsmart-erp,sheafferusa/erpnext,indictranstech/reciphergroup-erpnext,Tejal011089/osmosis_erpnext,gsnbng/erpnext,indictranstech/focal-erpnext,mbauskar/omnitech-erpnext,mbauskar/omnitech-demo-erpnext,dieface/erpnext,mbauskar/alec_frappe5_erpnext,anandpdoshi/erpnext,gangadhar-kadam/latestchurcherp,suyashphadtare/vestasi-erp-1,suyashphadtare/vestasi-update-erp,mbauskar/phrerp,suyashphadtare/vestasi-update-erp,sheafferusa/erpnext,ThiagoGarciaAlves/erpnext,indictranstech/buyback-erp,saurabh6790/test-erp,shitolepriya/test-erp,gsnbng/erpnext,Suninus/erpnext,tmimori/erpnext,MartinEnder/erpnext-de,mbauskar/Das_Erpnext,treejames/erpnext,pawaranand/phrerp,indictranstech/trufil-erpnext,fuhongliang/erpnext,netfirms/erpnext,hatwar/buyback-erpnext,aruizramon/alec_erpnext,pombredanne/erpnext,suyashphadtare/test,meisterkleister/erpnext,gangadharkadam/v6_erp,dieface/erpnext,gangadharkadam/v5_erp,aruizramon/alec_erpnext,meisterkleister/erpnext,hernad/erpnext,gangadhar-kadam/verve_erp,SPKian/Testing,dieface/erpnext,SPKian/Testing,gangadharkadam/saloon_erp,BhupeshGupta/erpnext,indictranstech/internal-erpnext,4commerce-technologies-AG/erpnext,mbauskar/Das_Erpnext,sagar30051991/ozsmart-erp,saurabh6790/test-erp,indictranstech/trufil-erpnext,rohitwaghchaure/New_Theme_Erp,indictranstech/erpnext,gangadhar-kadam/verve_test_erp,pawaranand/phrerp,hernad/erpnext,shft117/SteckerApp,gangadharkadam/v5_erp,indictranstech/focal-erpnext,indictranstech/tele-erpnext,anandpdoshi/erpnext,pombredanne/erpnext,suyashphadtare/sajil-final-erp,aruizramon/alec_erpnext,suyashphadtare/gd-erp,SPKian/Testing2,gangadharkadam/sher,Tejal011089/digitales_erpnext,indictranstech/fbd_erpnext,geekroot/erpnext,mahabuber/erpnext,indictranstech/focal-erpnext,indictranstech/vestasi-erpnext,rohitwaghchaure/erpnext-receipher,shitolepriya/test-erp,tmimori/erpnext,gangadharkadam/office_erp,hatwar/buyback-erpnext,Tejal011089/trufil-erpnext,indictranstech/phrerp,saurabh6790/test-erp,MartinEnder/erpnext-de,hanselke/erpnext-1,hatwar/Das_erpnext,indictranstech/buyback-erp,treejames/erpnext,treejames/erpnext,ShashaQin/erpnext,Tejal011089/huntercamp_erpnext,ThiagoGarciaAlves/erpnext,hatwar/focal-erpnext,treejames/erpnext,BhupeshGupta/erpnext,suyashphadtare/sajil-erp,gangadhar-kadam/verve_live_erp,tmimori/erpnext,hatwar/focal-erpnext,gangadharkadam/smrterp,gangadhar-kadam/helpdesk-erpnext,mahabuber/erpnext,gmarke/erpnext,indictranstech/internal-erpnext,hatwar/buyback-erpnext,pawaranand/phrerp,gangadharkadam/v6_erp,anandpdoshi/erpnext,gangadharkadam/letzerp,netfirms/erpnext,suyashphadtare/sajil-erp,indictranstech/trufil-erpnext,mahabuber/erpnext,gangadhar-kadam/latestchurcherp,gangadharkadam/saloon_erp,mbauskar/sapphire-erpnext,indictranstech/fbd_erpnext,gangadharkadam/contributionerp,Drooids/erpnext,netfirms/erpnext,indictranstech/tele-erpnext,SPKian/Testing2,mbauskar/omnitech-erpnext,mahabuber/erpnext,aruizramon/alec_erpnext,gsnbng/erpnext,gangadharkadam/verveerp,mbauskar/Das_Erpnext,gangadhar-kadam/helpdesk-erpnext,gangadharkadam/v4_erp,gangadharkadam/saloon_erp_install,Tejal011089/osmosis_erpnext,indictranstech/erpnext,pombredanne/erpnext,dieface/erpnext,mbauskar/omnitech-erpnext,gangadhar-kadam/smrterp,Suninus/erpnext,mbauskar/helpdesk-erpnext,pombredanne/erpnext,ShashaQin/erpnext,ShashaQin/erpnext,gangadharkadam/tailorerp,hanselke/erpnext-1,indictranstech/tele-erpnext,shitolepriya/test-erp,mbauskar/helpdesk-erpnext,Tejal011089/huntercamp_erpnext,gangadharkadam/contributionerp,mbauskar/alec_frappe5_erpnext,tmimori/erpnext,gangadhar-kadam/verve_test_erp,gmarke/erpnext,rohitwaghchaure/erpnext-receipher,SPKian/Testing,indictranstech/fbd_erpnext,mbauskar/sapphire-erpnext,Tejal011089/trufil-erpnext,hanselke/erpnext-1,rohitwaghchaure/New_Theme_Erp,njmube/erpnext,Tejal011089/paypal_erpnext,indictranstech/osmosis-erpnext,mbauskar/Das_Erpnext,indictranstech/osmosis-erpnext,sheafferusa/erpnext,Aptitudetech/ERPNext,indictranstech/phrerp,gangadharkadam/smrterp,Tejal011089/osmosis_erpnext,Tejal011089/fbd_erpnext,ThiagoGarciaAlves/erpnext,gangadhar-kadam/verve_live_erp,BhupeshGupta/erpnext,indictranstech/vestasi-erpnext,Drooids/erpnext,gangadharkadam/johnerp,hernad/erpnext,suyashphadtare/sajil-final-erp,Tejal011089/huntercamp_erpnext,Drooids/erpnext,gangadharkadam/sher,SPKian/Testing,Tejal011089/fbd_erpnext,mbauskar/alec_frappe5_erpnext,4commerce-technologies-AG/erpnext,rohitwaghchaure/erpnext-receipher,indictranstech/tele-erpnext,sagar30051991/ozsmart-erp,sagar30051991/ozsmart-erp | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils.nestedset import get_root_of
def execute():
frappe.reload_doc("accounts", "doctype", "pricing_rule")
frappe.db.auto_commit_on_many_writes = True
default_item_group = get_root_of("Item Group")
for d in frappe.db.sql("""select * from `tabCustomer Discount`
where ifnull(parent, '') != ''""", as_dict=1):
if not d.discount:
continue
frappe.get_doc({
"doctype": "Pricing Rule",
"apply_on": "Item Group",
"item_group": d.item_group or default_item_group,
"applicable_for": "Customer",
"customer": d.parent,
"price_or_discount": "Discount Percentage",
"discount_percentage": d.discount
}).insert()
frappe.db.auto_commit_on_many_writes = False
frappe.delete_doc("DocType", "Customer Discount")
Fix in pricing rule patch | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils.nestedset import get_root_of
def execute():
frappe.reload_doc("accounts", "doctype", "pricing_rule")
frappe.db.auto_commit_on_many_writes = True
default_item_group = get_root_of("Item Group")
for d in frappe.db.sql("""select * from `tabCustomer Discount`
where ifnull(parent, '') != ''""", as_dict=1):
if not d.discount:
continue
frappe.get_doc({
"doctype": "Pricing Rule",
"apply_on": "Item Group",
"item_group": d.item_group or default_item_group,
"applicable_for": "Customer",
"customer": d.parent,
"price_or_discount": "Discount Percentage",
"discount_percentage": d.discount,
"selling": 1
}).insert()
frappe.db.auto_commit_on_many_writes = False
frappe.delete_doc("DocType", "Customer Discount")
| <commit_before># Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils.nestedset import get_root_of
def execute():
frappe.reload_doc("accounts", "doctype", "pricing_rule")
frappe.db.auto_commit_on_many_writes = True
default_item_group = get_root_of("Item Group")
for d in frappe.db.sql("""select * from `tabCustomer Discount`
where ifnull(parent, '') != ''""", as_dict=1):
if not d.discount:
continue
frappe.get_doc({
"doctype": "Pricing Rule",
"apply_on": "Item Group",
"item_group": d.item_group or default_item_group,
"applicable_for": "Customer",
"customer": d.parent,
"price_or_discount": "Discount Percentage",
"discount_percentage": d.discount
}).insert()
frappe.db.auto_commit_on_many_writes = False
frappe.delete_doc("DocType", "Customer Discount")
<commit_msg>Fix in pricing rule patch<commit_after> | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils.nestedset import get_root_of
def execute():
frappe.reload_doc("accounts", "doctype", "pricing_rule")
frappe.db.auto_commit_on_many_writes = True
default_item_group = get_root_of("Item Group")
for d in frappe.db.sql("""select * from `tabCustomer Discount`
where ifnull(parent, '') != ''""", as_dict=1):
if not d.discount:
continue
frappe.get_doc({
"doctype": "Pricing Rule",
"apply_on": "Item Group",
"item_group": d.item_group or default_item_group,
"applicable_for": "Customer",
"customer": d.parent,
"price_or_discount": "Discount Percentage",
"discount_percentage": d.discount,
"selling": 1
}).insert()
frappe.db.auto_commit_on_many_writes = False
frappe.delete_doc("DocType", "Customer Discount")
| # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils.nestedset import get_root_of
def execute():
frappe.reload_doc("accounts", "doctype", "pricing_rule")
frappe.db.auto_commit_on_many_writes = True
default_item_group = get_root_of("Item Group")
for d in frappe.db.sql("""select * from `tabCustomer Discount`
where ifnull(parent, '') != ''""", as_dict=1):
if not d.discount:
continue
frappe.get_doc({
"doctype": "Pricing Rule",
"apply_on": "Item Group",
"item_group": d.item_group or default_item_group,
"applicable_for": "Customer",
"customer": d.parent,
"price_or_discount": "Discount Percentage",
"discount_percentage": d.discount
}).insert()
frappe.db.auto_commit_on_many_writes = False
frappe.delete_doc("DocType", "Customer Discount")
Fix in pricing rule patch# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils.nestedset import get_root_of
def execute():
frappe.reload_doc("accounts", "doctype", "pricing_rule")
frappe.db.auto_commit_on_many_writes = True
default_item_group = get_root_of("Item Group")
for d in frappe.db.sql("""select * from `tabCustomer Discount`
where ifnull(parent, '') != ''""", as_dict=1):
if not d.discount:
continue
frappe.get_doc({
"doctype": "Pricing Rule",
"apply_on": "Item Group",
"item_group": d.item_group or default_item_group,
"applicable_for": "Customer",
"customer": d.parent,
"price_or_discount": "Discount Percentage",
"discount_percentage": d.discount,
"selling": 1
}).insert()
frappe.db.auto_commit_on_many_writes = False
frappe.delete_doc("DocType", "Customer Discount")
| <commit_before># Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils.nestedset import get_root_of
def execute():
frappe.reload_doc("accounts", "doctype", "pricing_rule")
frappe.db.auto_commit_on_many_writes = True
default_item_group = get_root_of("Item Group")
for d in frappe.db.sql("""select * from `tabCustomer Discount`
where ifnull(parent, '') != ''""", as_dict=1):
if not d.discount:
continue
frappe.get_doc({
"doctype": "Pricing Rule",
"apply_on": "Item Group",
"item_group": d.item_group or default_item_group,
"applicable_for": "Customer",
"customer": d.parent,
"price_or_discount": "Discount Percentage",
"discount_percentage": d.discount
}).insert()
frappe.db.auto_commit_on_many_writes = False
frappe.delete_doc("DocType", "Customer Discount")
<commit_msg>Fix in pricing rule patch<commit_after># Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils.nestedset import get_root_of
def execute():
frappe.reload_doc("accounts", "doctype", "pricing_rule")
frappe.db.auto_commit_on_many_writes = True
default_item_group = get_root_of("Item Group")
for d in frappe.db.sql("""select * from `tabCustomer Discount`
where ifnull(parent, '') != ''""", as_dict=1):
if not d.discount:
continue
frappe.get_doc({
"doctype": "Pricing Rule",
"apply_on": "Item Group",
"item_group": d.item_group or default_item_group,
"applicable_for": "Customer",
"customer": d.parent,
"price_or_discount": "Discount Percentage",
"discount_percentage": d.discount,
"selling": 1
}).insert()
frappe.db.auto_commit_on_many_writes = False
frappe.delete_doc("DocType", "Customer Discount")
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.