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
ed5f7ac5b6583c1e88e51f87bb73d6d50717b2f6
test/test_parameters.py
test/test_parameters.py
from __future__ import absolute_import, print_function from ..pyautoupdate.launcher import Launcher import pytest def test_check_urlslash(): launch = Launcher('not here', r'http://rlee287.github.io/pyautoupdate/testing/') launch2 = Launcher('why do I need to do this', r'http://rlee287.github.io/pyautoupdate/testing') assert launch.url == launch2.url def test_check_emptyfilepath(): with pytest.raises(ValueError): Launcher('','a url') def test_check_emptyURL(): with pytest.raises(ValueError): Launcher('a filepath','')
from __future__ import absolute_import, print_function from ..pyautoupdate.launcher import Launcher import os import pytest def test_check_urlslash(): launch = Launcher('not here', r'http://rlee287.github.io/pyautoupdate/testing/') launch2 = Launcher('why do I need to do this', r'http://rlee287.github.io/pyautoupdate/testing') assert launch.url == launch2.url def test_check_emptyfilepath(): with pytest.raises(ValueError): Launcher('','a url') def test_check_emptyURL(): with pytest.raises(ValueError): Launcher('a filepath','') @pytest.fixture(scope="function") def fixture_corrupt_log(request): with open("version_history.log","w") as log: log.write("invalid!gibberish") def teardown(): if os.path.isfile("version_history.log"): os.remove("version_history.log") request.addfinalizer(teardown) return fixture_corrupt_log @pytest.fixture(scope="function") def fixture_corrupt_vers(request): with open("version.txt","w") as vers_file: vers_file.write("invalid?version") def teardown(): if os.path.isfile("version.txt"): os.remove("version.txt") request.addfinalizer(teardown) return fixture_corrupt_vers def test_check_corrupted_log(fixture_corrupt_log): launch=Launcher("123","456") def test_check_corrupted_vers(fixture_corrupt_vers): launch=Launcher("123","456")
Write test for error checks
Write test for error checks
Python
lgpl-2.1
rlee287/pyautoupdate,rlee287/pyautoupdate
from __future__ import absolute_import, print_function from ..pyautoupdate.launcher import Launcher import pytest def test_check_urlslash(): launch = Launcher('not here', r'http://rlee287.github.io/pyautoupdate/testing/') launch2 = Launcher('why do I need to do this', r'http://rlee287.github.io/pyautoupdate/testing') assert launch.url == launch2.url def test_check_emptyfilepath(): with pytest.raises(ValueError): Launcher('','a url') def test_check_emptyURL(): with pytest.raises(ValueError): Launcher('a filepath','') Write test for error checks
from __future__ import absolute_import, print_function from ..pyautoupdate.launcher import Launcher import os import pytest def test_check_urlslash(): launch = Launcher('not here', r'http://rlee287.github.io/pyautoupdate/testing/') launch2 = Launcher('why do I need to do this', r'http://rlee287.github.io/pyautoupdate/testing') assert launch.url == launch2.url def test_check_emptyfilepath(): with pytest.raises(ValueError): Launcher('','a url') def test_check_emptyURL(): with pytest.raises(ValueError): Launcher('a filepath','') @pytest.fixture(scope="function") def fixture_corrupt_log(request): with open("version_history.log","w") as log: log.write("invalid!gibberish") def teardown(): if os.path.isfile("version_history.log"): os.remove("version_history.log") request.addfinalizer(teardown) return fixture_corrupt_log @pytest.fixture(scope="function") def fixture_corrupt_vers(request): with open("version.txt","w") as vers_file: vers_file.write("invalid?version") def teardown(): if os.path.isfile("version.txt"): os.remove("version.txt") request.addfinalizer(teardown) return fixture_corrupt_vers def test_check_corrupted_log(fixture_corrupt_log): launch=Launcher("123","456") def test_check_corrupted_vers(fixture_corrupt_vers): launch=Launcher("123","456")
<commit_before>from __future__ import absolute_import, print_function from ..pyautoupdate.launcher import Launcher import pytest def test_check_urlslash(): launch = Launcher('not here', r'http://rlee287.github.io/pyautoupdate/testing/') launch2 = Launcher('why do I need to do this', r'http://rlee287.github.io/pyautoupdate/testing') assert launch.url == launch2.url def test_check_emptyfilepath(): with pytest.raises(ValueError): Launcher('','a url') def test_check_emptyURL(): with pytest.raises(ValueError): Launcher('a filepath','') <commit_msg>Write test for error checks<commit_after>
from __future__ import absolute_import, print_function from ..pyautoupdate.launcher import Launcher import os import pytest def test_check_urlslash(): launch = Launcher('not here', r'http://rlee287.github.io/pyautoupdate/testing/') launch2 = Launcher('why do I need to do this', r'http://rlee287.github.io/pyautoupdate/testing') assert launch.url == launch2.url def test_check_emptyfilepath(): with pytest.raises(ValueError): Launcher('','a url') def test_check_emptyURL(): with pytest.raises(ValueError): Launcher('a filepath','') @pytest.fixture(scope="function") def fixture_corrupt_log(request): with open("version_history.log","w") as log: log.write("invalid!gibberish") def teardown(): if os.path.isfile("version_history.log"): os.remove("version_history.log") request.addfinalizer(teardown) return fixture_corrupt_log @pytest.fixture(scope="function") def fixture_corrupt_vers(request): with open("version.txt","w") as vers_file: vers_file.write("invalid?version") def teardown(): if os.path.isfile("version.txt"): os.remove("version.txt") request.addfinalizer(teardown) return fixture_corrupt_vers def test_check_corrupted_log(fixture_corrupt_log): launch=Launcher("123","456") def test_check_corrupted_vers(fixture_corrupt_vers): launch=Launcher("123","456")
from __future__ import absolute_import, print_function from ..pyautoupdate.launcher import Launcher import pytest def test_check_urlslash(): launch = Launcher('not here', r'http://rlee287.github.io/pyautoupdate/testing/') launch2 = Launcher('why do I need to do this', r'http://rlee287.github.io/pyautoupdate/testing') assert launch.url == launch2.url def test_check_emptyfilepath(): with pytest.raises(ValueError): Launcher('','a url') def test_check_emptyURL(): with pytest.raises(ValueError): Launcher('a filepath','') Write test for error checksfrom __future__ import absolute_import, print_function from ..pyautoupdate.launcher import Launcher import os import pytest def test_check_urlslash(): launch = Launcher('not here', r'http://rlee287.github.io/pyautoupdate/testing/') launch2 = Launcher('why do I need to do this', r'http://rlee287.github.io/pyautoupdate/testing') assert launch.url == launch2.url def test_check_emptyfilepath(): with pytest.raises(ValueError): Launcher('','a url') def test_check_emptyURL(): with pytest.raises(ValueError): Launcher('a filepath','') @pytest.fixture(scope="function") def fixture_corrupt_log(request): with open("version_history.log","w") as log: log.write("invalid!gibberish") def teardown(): if os.path.isfile("version_history.log"): os.remove("version_history.log") request.addfinalizer(teardown) return fixture_corrupt_log @pytest.fixture(scope="function") def fixture_corrupt_vers(request): with open("version.txt","w") as vers_file: vers_file.write("invalid?version") def teardown(): if os.path.isfile("version.txt"): os.remove("version.txt") request.addfinalizer(teardown) return fixture_corrupt_vers def test_check_corrupted_log(fixture_corrupt_log): launch=Launcher("123","456") def test_check_corrupted_vers(fixture_corrupt_vers): launch=Launcher("123","456")
<commit_before>from __future__ import absolute_import, print_function from ..pyautoupdate.launcher import Launcher import pytest def test_check_urlslash(): launch = Launcher('not here', r'http://rlee287.github.io/pyautoupdate/testing/') launch2 = Launcher('why do I need to do this', r'http://rlee287.github.io/pyautoupdate/testing') assert launch.url == launch2.url def test_check_emptyfilepath(): with pytest.raises(ValueError): Launcher('','a url') def test_check_emptyURL(): with pytest.raises(ValueError): Launcher('a filepath','') <commit_msg>Write test for error checks<commit_after>from __future__ import absolute_import, print_function from ..pyautoupdate.launcher import Launcher import os import pytest def test_check_urlslash(): launch = Launcher('not here', r'http://rlee287.github.io/pyautoupdate/testing/') launch2 = Launcher('why do I need to do this', r'http://rlee287.github.io/pyautoupdate/testing') assert launch.url == launch2.url def test_check_emptyfilepath(): with pytest.raises(ValueError): Launcher('','a url') def test_check_emptyURL(): with pytest.raises(ValueError): Launcher('a filepath','') @pytest.fixture(scope="function") def fixture_corrupt_log(request): with open("version_history.log","w") as log: log.write("invalid!gibberish") def teardown(): if os.path.isfile("version_history.log"): os.remove("version_history.log") request.addfinalizer(teardown) return fixture_corrupt_log @pytest.fixture(scope="function") def fixture_corrupt_vers(request): with open("version.txt","w") as vers_file: vers_file.write("invalid?version") def teardown(): if os.path.isfile("version.txt"): os.remove("version.txt") request.addfinalizer(teardown) return fixture_corrupt_vers def test_check_corrupted_log(fixture_corrupt_log): launch=Launcher("123","456") def test_check_corrupted_vers(fixture_corrupt_vers): launch=Launcher("123","456")
681e80bc1492c9df4e27fe1846ff311cb73506ee
apps/pig/src/pig/settings.py
apps/pig/src/pig/settings.py
# Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. DJANGO_APPS = ['pig'] NICE_NAME = 'Pig' MENU_INDEX = 12 ICON = '/pig/static/art/icon_pig_24.png' REQUIRES_HADOOP = False IS_URL_NAMESPACED = True
# Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. DJANGO_APPS = ['pig'] NICE_NAME = 'Pig Editor' MENU_INDEX = 12 ICON = '/pig/static/art/icon_pig_24.png' REQUIRES_HADOOP = False IS_URL_NAMESPACED = True
Rename app to Pig Editor
[pig] Rename app to Pig Editor
Python
apache-2.0
epssy/hue,cloudera/hue,vmax-feihu/hue,erickt/hue,fangxingli/hue,Peddle/hue,rahul67/hue,cloudera/hue,jayceyxc/hue,Peddle/hue,rahul67/hue,todaychi/hue,xiangel/hue,yoer/hue,cloudera/hue,vitan/hue,pwong-mapr/private-hue,vitan/hue,pratikmallya/hue,ahmed-mahran/hue,Peddle/hue,vitan/hue,jounex/hue,sanjeevtripurari/hue,yongshengwang/hue,lumig242/Hue-Integration-with-CDAP,cloudera/hue,pratikmallya/hue,x303597316/hue,ChenJunor/hue,sanjeevtripurari/hue,ChenJunor/hue,jayceyxc/hue,xq262144/hue,azureplus/hue,abhishek-ch/hue,abhishek-ch/hue,jayceyxc/hue,javachengwc/hue,sanjeevtripurari/hue,azureplus/hue,kawamon/hue,Peddle/hue,xiangel/hue,nvoron23/hue,mapr/hue,lumig242/Hue-Integration-with-CDAP,epssy/hue,kawamon/hue,Peddle/hue,javachengwc/hue,vmax-feihu/hue,x303597316/hue,hdinsight/hue,vitan/hue,hdinsight/hue,hdinsight/hue,mapr/hue,ChenJunor/hue,GitHublong/hue,yoer/hue,abhishek-ch/hue,mapr/hue,xiangel/hue,GitHublong/hue,kawamon/hue,azureplus/hue,x303597316/hue,jjmleiro/hue,ChenJunor/hue,sanjeevtripurari/hue,GitHublong/hue,yoer/hue,ahmed-mahran/hue,epssy/hue,ChenJunor/hue,kawamon/hue,fangxingli/hue,rahul67/hue,cloudera/hue,jayceyxc/hue,yongshengwang/hue,epssy/hue,jounex/hue,rahul67/hue,rahul67/hue,pwong-mapr/private-hue,ahmed-mahran/hue,vitan/hue,jounex/hue,lumig242/Hue-Integration-with-CDAP,kawamon/hue,xiangel/hue,Peddle/hue,azureplus/hue,dulems/hue,lumig242/Hue-Integration-with-CDAP,jounex/hue,nvoron23/hue,azureplus/hue,sanjeevtripurari/hue,kawamon/hue,nvoron23/hue,todaychi/hue,x303597316/hue,x303597316/hue,hdinsight/hue,yoer/hue,ahmed-mahran/hue,jayceyxc/hue,jjmleiro/hue,pwong-mapr/private-hue,xq262144/hue,todaychi/hue,lumig242/Hue-Integration-with-CDAP,vitan/hue,pwong-mapr/private-hue,abhishek-ch/hue,nvoron23/hue,jounex/hue,ahmed-mahran/hue,todaychi/hue,x303597316/hue,abhishek-ch/hue,xq262144/hue,jjmleiro/hue,cloudera/hue,epssy/hue,xq262144/hue,todaychi/hue,sanjeevtripurari/hue,epssy/hue,azureplus/hue,xiangel/hue,MobinRanjbar/hue,erickt/hue,kawamon/hue,GitHublong/hue,ahmed-mahran/hue,jayceyxc/hue,lumig242/Hue-Integration-with-CDAP,abhishek-ch/hue,hdinsight/hue,cloudera/hue,cloudera/hue,xq262144/hue,pratikmallya/hue,jjmleiro/hue,nvoron23/hue,mapr/hue,yoer/hue,cloudera/hue,epssy/hue,Peddle/hue,x303597316/hue,yoer/hue,Peddle/hue,lumig242/Hue-Integration-with-CDAP,ChenJunor/hue,xq262144/hue,xiangel/hue,cloudera/hue,hdinsight/hue,vmax-feihu/hue,GitHublong/hue,erickt/hue,kawamon/hue,MobinRanjbar/hue,kawamon/hue,yongshengwang/hue,fangxingli/hue,cloudera/hue,vmax-feihu/hue,fangxingli/hue,fangxingli/hue,javachengwc/hue,vitan/hue,vmax-feihu/hue,nvoron23/hue,pwong-mapr/private-hue,vitan/hue,ahmed-mahran/hue,fangxingli/hue,ChenJunor/hue,MobinRanjbar/hue,fangxingli/hue,jjmleiro/hue,fangxingli/hue,kawamon/hue,jjmleiro/hue,erickt/hue,erickt/hue,dulems/hue,epssy/hue,kawamon/hue,GitHublong/hue,javachengwc/hue,lumig242/Hue-Integration-with-CDAP,dulems/hue,cloudera/hue,javachengwc/hue,vmax-feihu/hue,abhishek-ch/hue,kawamon/hue,cloudera/hue,xq262144/hue,cloudera/hue,Peddle/hue,jjmleiro/hue,cloudera/hue,jjmleiro/hue,jayceyxc/hue,vmax-feihu/hue,jjmleiro/hue,pratikmallya/hue,kawamon/hue,todaychi/hue,azureplus/hue,jounex/hue,jayceyxc/hue,todaychi/hue,pratikmallya/hue,cloudera/hue,nvoron23/hue,xq262144/hue,cloudera/hue,dulems/hue,azureplus/hue,yoer/hue,GitHublong/hue,javachengwc/hue,cloudera/hue,pratikmallya/hue,pratikmallya/hue,xiangel/hue,kawamon/hue,kawamon/hue,jounex/hue,javachengwc/hue,MobinRanjbar/hue,dulems/hue,vmax-feihu/hue,hdinsight/hue,abhishek-ch/hue,GitHublong/hue,javachengwc/hue,nvoron23/hue,erickt/hue,jounex/hue,kawamon/hue,yongshengwang/hue,sanjeevtripurari/hue,xiangel/hue,mapr/hue,MobinRanjbar/hue,todaychi/hue,mapr/hue,pwong-mapr/private-hue,x303597316/hue,pwong-mapr/private-hue,hdinsight/hue,MobinRanjbar/hue,ahmed-mahran/hue,dulems/hue,yongshengwang/hue,xq262144/hue,rahul67/hue,MobinRanjbar/hue,MobinRanjbar/hue,yoer/hue,dulems/hue,lumig242/Hue-Integration-with-CDAP,todaychi/hue,kawamon/hue,yongshengwang/hue,rahul67/hue,sanjeevtripurari/hue,kawamon/hue,yongshengwang/hue,yongshengwang/hue,ChenJunor/hue,pratikmallya/hue,mapr/hue,rahul67/hue,erickt/hue,dulems/hue,erickt/hue,jayceyxc/hue
# Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. DJANGO_APPS = ['pig'] NICE_NAME = 'Pig' MENU_INDEX = 12 ICON = '/pig/static/art/icon_pig_24.png' REQUIRES_HADOOP = False IS_URL_NAMESPACED = True [pig] Rename app to Pig Editor
# Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. DJANGO_APPS = ['pig'] NICE_NAME = 'Pig Editor' MENU_INDEX = 12 ICON = '/pig/static/art/icon_pig_24.png' REQUIRES_HADOOP = False IS_URL_NAMESPACED = True
<commit_before># Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. DJANGO_APPS = ['pig'] NICE_NAME = 'Pig' MENU_INDEX = 12 ICON = '/pig/static/art/icon_pig_24.png' REQUIRES_HADOOP = False IS_URL_NAMESPACED = True <commit_msg>[pig] Rename app to Pig Editor<commit_after>
# Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. DJANGO_APPS = ['pig'] NICE_NAME = 'Pig Editor' MENU_INDEX = 12 ICON = '/pig/static/art/icon_pig_24.png' REQUIRES_HADOOP = False IS_URL_NAMESPACED = True
# Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. DJANGO_APPS = ['pig'] NICE_NAME = 'Pig' MENU_INDEX = 12 ICON = '/pig/static/art/icon_pig_24.png' REQUIRES_HADOOP = False IS_URL_NAMESPACED = True [pig] Rename app to Pig Editor# Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. DJANGO_APPS = ['pig'] NICE_NAME = 'Pig Editor' MENU_INDEX = 12 ICON = '/pig/static/art/icon_pig_24.png' REQUIRES_HADOOP = False IS_URL_NAMESPACED = True
<commit_before># Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. DJANGO_APPS = ['pig'] NICE_NAME = 'Pig' MENU_INDEX = 12 ICON = '/pig/static/art/icon_pig_24.png' REQUIRES_HADOOP = False IS_URL_NAMESPACED = True <commit_msg>[pig] Rename app to Pig Editor<commit_after># Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. DJANGO_APPS = ['pig'] NICE_NAME = 'Pig Editor' MENU_INDEX = 12 ICON = '/pig/static/art/icon_pig_24.png' REQUIRES_HADOOP = False IS_URL_NAMESPACED = True
0251d3d3956a75fbeb66a0d4466cbcefa2e49f93
examples/web_app.py
examples/web_app.py
""" Example for running Application using the `aiohttp.web` CLI. Run this app using:: $ python -m aiohttp.web web_app.init """ from aiohttp.web import Application, Response def hello_world(req): return Response(text="Hello World") def init(args): app = Application() app.router.add_route('GET', '/', hello_world) return app
""" Example of serving an Application using the `aiohttp.web` CLI. Serve this app using:: $ python -m aiohttp.web -H localhost -P 8080 --repeat 10 web_app.init \ > "Hello World" Here ``--repeat`` & ``"Hello World"`` are application specific command-line arguments. `aiohttp.web` only parses & consumes the command-line arguments it needs (i.e. ``-H``, ``-P`` & ``entry-func``) and passes on any additional arguments to the `web_app.init` function for processing. """ from aiohttp.web import Application, Response from argparse import ArgumentParser def display_message(req): args = req.app["args"] text = "\n".join([args.message] * args.repeat) return Response(text=text) def init(args): arg_parser = ArgumentParser( prog="aiohttp.web ...", description="Application CLI", add_help=False ) # Positional argument arg_parser.add_argument( "message", help="message to print" ) # Optional argument arg_parser.add_argument( "--repeat", help="number of times to repeat message", type=int, default="1" ) # Avoid conflict with -h from `aiohttp.web` CLI parser arg_parser.add_argument( "--app-help", help="show this message and exit", action="help" ) parsed_args = arg_parser.parse_args(args) app = Application() app["args"] = parsed_args app.router.add_route('GET', '/', display_message) return app
Update CLI example to use nested argparse
Update CLI example to use nested argparse
Python
apache-2.0
panda73111/aiohttp,elastic-coders/aiohttp,hellysmile/aiohttp,moden-py/aiohttp,mind1master/aiohttp,hellysmile/aiohttp,jashandeep-sohi/aiohttp,moden-py/aiohttp,AraHaanOrg/aiohttp,jettify/aiohttp,esaezgil/aiohttp,KeepSafe/aiohttp,jashandeep-sohi/aiohttp,decentfox/aiohttp,z2v/aiohttp,mind1master/aiohttp,KeepSafe/aiohttp,jettify/aiohttp,rutsky/aiohttp,jettify/aiohttp,elastic-coders/aiohttp,vaskalas/aiohttp,arthurdarcet/aiohttp,arthurdarcet/aiohttp,esaezgil/aiohttp,AraHaanOrg/aiohttp,singulared/aiohttp,alex-eri/aiohttp-1,Eyepea/aiohttp,jashandeep-sohi/aiohttp,rutsky/aiohttp,KeepSafe/aiohttp,arthurdarcet/aiohttp,juliatem/aiohttp,z2v/aiohttp,alex-eri/aiohttp-1,singulared/aiohttp,z2v/aiohttp,decentfox/aiohttp,mind1master/aiohttp,alex-eri/aiohttp-1,singulared/aiohttp,vaskalas/aiohttp,panda73111/aiohttp,juliatem/aiohttp,pfreixes/aiohttp,elastic-coders/aiohttp,rutsky/aiohttp,pfreixes/aiohttp,vaskalas/aiohttp,panda73111/aiohttp,playpauseandstop/aiohttp,decentfox/aiohttp,moden-py/aiohttp,esaezgil/aiohttp
""" Example for running Application using the `aiohttp.web` CLI. Run this app using:: $ python -m aiohttp.web web_app.init """ from aiohttp.web import Application, Response def hello_world(req): return Response(text="Hello World") def init(args): app = Application() app.router.add_route('GET', '/', hello_world) return app Update CLI example to use nested argparse
""" Example of serving an Application using the `aiohttp.web` CLI. Serve this app using:: $ python -m aiohttp.web -H localhost -P 8080 --repeat 10 web_app.init \ > "Hello World" Here ``--repeat`` & ``"Hello World"`` are application specific command-line arguments. `aiohttp.web` only parses & consumes the command-line arguments it needs (i.e. ``-H``, ``-P`` & ``entry-func``) and passes on any additional arguments to the `web_app.init` function for processing. """ from aiohttp.web import Application, Response from argparse import ArgumentParser def display_message(req): args = req.app["args"] text = "\n".join([args.message] * args.repeat) return Response(text=text) def init(args): arg_parser = ArgumentParser( prog="aiohttp.web ...", description="Application CLI", add_help=False ) # Positional argument arg_parser.add_argument( "message", help="message to print" ) # Optional argument arg_parser.add_argument( "--repeat", help="number of times to repeat message", type=int, default="1" ) # Avoid conflict with -h from `aiohttp.web` CLI parser arg_parser.add_argument( "--app-help", help="show this message and exit", action="help" ) parsed_args = arg_parser.parse_args(args) app = Application() app["args"] = parsed_args app.router.add_route('GET', '/', display_message) return app
<commit_before>""" Example for running Application using the `aiohttp.web` CLI. Run this app using:: $ python -m aiohttp.web web_app.init """ from aiohttp.web import Application, Response def hello_world(req): return Response(text="Hello World") def init(args): app = Application() app.router.add_route('GET', '/', hello_world) return app <commit_msg>Update CLI example to use nested argparse<commit_after>
""" Example of serving an Application using the `aiohttp.web` CLI. Serve this app using:: $ python -m aiohttp.web -H localhost -P 8080 --repeat 10 web_app.init \ > "Hello World" Here ``--repeat`` & ``"Hello World"`` are application specific command-line arguments. `aiohttp.web` only parses & consumes the command-line arguments it needs (i.e. ``-H``, ``-P`` & ``entry-func``) and passes on any additional arguments to the `web_app.init` function for processing. """ from aiohttp.web import Application, Response from argparse import ArgumentParser def display_message(req): args = req.app["args"] text = "\n".join([args.message] * args.repeat) return Response(text=text) def init(args): arg_parser = ArgumentParser( prog="aiohttp.web ...", description="Application CLI", add_help=False ) # Positional argument arg_parser.add_argument( "message", help="message to print" ) # Optional argument arg_parser.add_argument( "--repeat", help="number of times to repeat message", type=int, default="1" ) # Avoid conflict with -h from `aiohttp.web` CLI parser arg_parser.add_argument( "--app-help", help="show this message and exit", action="help" ) parsed_args = arg_parser.parse_args(args) app = Application() app["args"] = parsed_args app.router.add_route('GET', '/', display_message) return app
""" Example for running Application using the `aiohttp.web` CLI. Run this app using:: $ python -m aiohttp.web web_app.init """ from aiohttp.web import Application, Response def hello_world(req): return Response(text="Hello World") def init(args): app = Application() app.router.add_route('GET', '/', hello_world) return app Update CLI example to use nested argparse""" Example of serving an Application using the `aiohttp.web` CLI. Serve this app using:: $ python -m aiohttp.web -H localhost -P 8080 --repeat 10 web_app.init \ > "Hello World" Here ``--repeat`` & ``"Hello World"`` are application specific command-line arguments. `aiohttp.web` only parses & consumes the command-line arguments it needs (i.e. ``-H``, ``-P`` & ``entry-func``) and passes on any additional arguments to the `web_app.init` function for processing. """ from aiohttp.web import Application, Response from argparse import ArgumentParser def display_message(req): args = req.app["args"] text = "\n".join([args.message] * args.repeat) return Response(text=text) def init(args): arg_parser = ArgumentParser( prog="aiohttp.web ...", description="Application CLI", add_help=False ) # Positional argument arg_parser.add_argument( "message", help="message to print" ) # Optional argument arg_parser.add_argument( "--repeat", help="number of times to repeat message", type=int, default="1" ) # Avoid conflict with -h from `aiohttp.web` CLI parser arg_parser.add_argument( "--app-help", help="show this message and exit", action="help" ) parsed_args = arg_parser.parse_args(args) app = Application() app["args"] = parsed_args app.router.add_route('GET', '/', display_message) return app
<commit_before>""" Example for running Application using the `aiohttp.web` CLI. Run this app using:: $ python -m aiohttp.web web_app.init """ from aiohttp.web import Application, Response def hello_world(req): return Response(text="Hello World") def init(args): app = Application() app.router.add_route('GET', '/', hello_world) return app <commit_msg>Update CLI example to use nested argparse<commit_after>""" Example of serving an Application using the `aiohttp.web` CLI. Serve this app using:: $ python -m aiohttp.web -H localhost -P 8080 --repeat 10 web_app.init \ > "Hello World" Here ``--repeat`` & ``"Hello World"`` are application specific command-line arguments. `aiohttp.web` only parses & consumes the command-line arguments it needs (i.e. ``-H``, ``-P`` & ``entry-func``) and passes on any additional arguments to the `web_app.init` function for processing. """ from aiohttp.web import Application, Response from argparse import ArgumentParser def display_message(req): args = req.app["args"] text = "\n".join([args.message] * args.repeat) return Response(text=text) def init(args): arg_parser = ArgumentParser( prog="aiohttp.web ...", description="Application CLI", add_help=False ) # Positional argument arg_parser.add_argument( "message", help="message to print" ) # Optional argument arg_parser.add_argument( "--repeat", help="number of times to repeat message", type=int, default="1" ) # Avoid conflict with -h from `aiohttp.web` CLI parser arg_parser.add_argument( "--app-help", help="show this message and exit", action="help" ) parsed_args = arg_parser.parse_args(args) app = Application() app["args"] = parsed_args app.router.add_route('GET', '/', display_message) return app
e1e34233b9a91666ac3abd29dadb7235e5ea7dd3
setup.py
setup.py
from setuptools import setup, find_packages setup( name='fakeredis', version='0.1', description="Fake implementation of redis API for testing purposes.", license='BSD', url="https://github.com/jamesls/fakeredis", author='James Saryerwinnie', author_email='jlsnpi@gmail.com', py_modules=['fakeredis'], classifiers=[ 'Development Status :: 3 - Alpha', 'License :: OSI Approved :: BSD License', ], install_requires=[ 'redis', ] )
from setuptools import setup, find_packages setup( name='fakeredis', version='0.1', description="Fake implementation of redis API for testing purposes.", long_description=open(os.path.join(os.path.dirname(__file__), 'README.rst')).read(), license='BSD', url="https://github.com/jamesls/fakeredis", author='James Saryerwinnie', author_email='jlsnpi@gmail.com', py_modules=['fakeredis'], classifiers=[ 'Development Status :: 3 - Alpha', 'License :: OSI Approved :: BSD License', ], install_requires=[ 'redis', ] )
Add a long description based on README.rst
Add a long description based on README.rst
Python
bsd-3-clause
fatelei/fakeredis,Tinche/fakeredis,pindia/fakeredis,ze-phyr-us/fakeredis,sam-untapt/fakeredis,OnBeep/fakeredis
from setuptools import setup, find_packages setup( name='fakeredis', version='0.1', description="Fake implementation of redis API for testing purposes.", license='BSD', url="https://github.com/jamesls/fakeredis", author='James Saryerwinnie', author_email='jlsnpi@gmail.com', py_modules=['fakeredis'], classifiers=[ 'Development Status :: 3 - Alpha', 'License :: OSI Approved :: BSD License', ], install_requires=[ 'redis', ] ) Add a long description based on README.rst
from setuptools import setup, find_packages setup( name='fakeredis', version='0.1', description="Fake implementation of redis API for testing purposes.", long_description=open(os.path.join(os.path.dirname(__file__), 'README.rst')).read(), license='BSD', url="https://github.com/jamesls/fakeredis", author='James Saryerwinnie', author_email='jlsnpi@gmail.com', py_modules=['fakeredis'], classifiers=[ 'Development Status :: 3 - Alpha', 'License :: OSI Approved :: BSD License', ], install_requires=[ 'redis', ] )
<commit_before>from setuptools import setup, find_packages setup( name='fakeredis', version='0.1', description="Fake implementation of redis API for testing purposes.", license='BSD', url="https://github.com/jamesls/fakeredis", author='James Saryerwinnie', author_email='jlsnpi@gmail.com', py_modules=['fakeredis'], classifiers=[ 'Development Status :: 3 - Alpha', 'License :: OSI Approved :: BSD License', ], install_requires=[ 'redis', ] ) <commit_msg>Add a long description based on README.rst<commit_after>
from setuptools import setup, find_packages setup( name='fakeredis', version='0.1', description="Fake implementation of redis API for testing purposes.", long_description=open(os.path.join(os.path.dirname(__file__), 'README.rst')).read(), license='BSD', url="https://github.com/jamesls/fakeredis", author='James Saryerwinnie', author_email='jlsnpi@gmail.com', py_modules=['fakeredis'], classifiers=[ 'Development Status :: 3 - Alpha', 'License :: OSI Approved :: BSD License', ], install_requires=[ 'redis', ] )
from setuptools import setup, find_packages setup( name='fakeredis', version='0.1', description="Fake implementation of redis API for testing purposes.", license='BSD', url="https://github.com/jamesls/fakeredis", author='James Saryerwinnie', author_email='jlsnpi@gmail.com', py_modules=['fakeredis'], classifiers=[ 'Development Status :: 3 - Alpha', 'License :: OSI Approved :: BSD License', ], install_requires=[ 'redis', ] ) Add a long description based on README.rstfrom setuptools import setup, find_packages setup( name='fakeredis', version='0.1', description="Fake implementation of redis API for testing purposes.", long_description=open(os.path.join(os.path.dirname(__file__), 'README.rst')).read(), license='BSD', url="https://github.com/jamesls/fakeredis", author='James Saryerwinnie', author_email='jlsnpi@gmail.com', py_modules=['fakeredis'], classifiers=[ 'Development Status :: 3 - Alpha', 'License :: OSI Approved :: BSD License', ], install_requires=[ 'redis', ] )
<commit_before>from setuptools import setup, find_packages setup( name='fakeredis', version='0.1', description="Fake implementation of redis API for testing purposes.", license='BSD', url="https://github.com/jamesls/fakeredis", author='James Saryerwinnie', author_email='jlsnpi@gmail.com', py_modules=['fakeredis'], classifiers=[ 'Development Status :: 3 - Alpha', 'License :: OSI Approved :: BSD License', ], install_requires=[ 'redis', ] ) <commit_msg>Add a long description based on README.rst<commit_after>from setuptools import setup, find_packages setup( name='fakeredis', version='0.1', description="Fake implementation of redis API for testing purposes.", long_description=open(os.path.join(os.path.dirname(__file__), 'README.rst')).read(), license='BSD', url="https://github.com/jamesls/fakeredis", author='James Saryerwinnie', author_email='jlsnpi@gmail.com', py_modules=['fakeredis'], classifiers=[ 'Development Status :: 3 - Alpha', 'License :: OSI Approved :: BSD License', ], install_requires=[ 'redis', ] )
7e64bae593b70d24e1de22ee4530c9d8babe8c95
setup.py
setup.py
from setuptools import find_packages, setup setup( name='django-migration-testcase', version='0.0.14', author='Andrew Plummer', author_email='plummer574@gmail.com', description='For testing migrations in Django', url='https://github.com/plumdog/django_migration_testcase', packages=find_packages(), install_requires=['Django>=1.4'])
from setuptools import find_packages, setup setup( name='django-migration-testcase', version='0.0.14', author='Andrew Plummer', author_email='plummer574@gmail.com', description='For testing migrations in Django', url='https://github.com/plumdog/django_migration_testcase', packages=find_packages(), install_requires=['Django>=1.4'], classifiers=[ 'Programming Language :: Python', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', ] )
Add python version trove classifiers
Add python version trove classifiers
Python
mit
plumdog/django_migration_test,plumdog/django_migration_testcase,plumdog/django_migration_testcase,plumdog/django_migration_test
from setuptools import find_packages, setup setup( name='django-migration-testcase', version='0.0.14', author='Andrew Plummer', author_email='plummer574@gmail.com', description='For testing migrations in Django', url='https://github.com/plumdog/django_migration_testcase', packages=find_packages(), install_requires=['Django>=1.4']) Add python version trove classifiers
from setuptools import find_packages, setup setup( name='django-migration-testcase', version='0.0.14', author='Andrew Plummer', author_email='plummer574@gmail.com', description='For testing migrations in Django', url='https://github.com/plumdog/django_migration_testcase', packages=find_packages(), install_requires=['Django>=1.4'], classifiers=[ 'Programming Language :: Python', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', ] )
<commit_before>from setuptools import find_packages, setup setup( name='django-migration-testcase', version='0.0.14', author='Andrew Plummer', author_email='plummer574@gmail.com', description='For testing migrations in Django', url='https://github.com/plumdog/django_migration_testcase', packages=find_packages(), install_requires=['Django>=1.4']) <commit_msg>Add python version trove classifiers<commit_after>
from setuptools import find_packages, setup setup( name='django-migration-testcase', version='0.0.14', author='Andrew Plummer', author_email='plummer574@gmail.com', description='For testing migrations in Django', url='https://github.com/plumdog/django_migration_testcase', packages=find_packages(), install_requires=['Django>=1.4'], classifiers=[ 'Programming Language :: Python', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', ] )
from setuptools import find_packages, setup setup( name='django-migration-testcase', version='0.0.14', author='Andrew Plummer', author_email='plummer574@gmail.com', description='For testing migrations in Django', url='https://github.com/plumdog/django_migration_testcase', packages=find_packages(), install_requires=['Django>=1.4']) Add python version trove classifiersfrom setuptools import find_packages, setup setup( name='django-migration-testcase', version='0.0.14', author='Andrew Plummer', author_email='plummer574@gmail.com', description='For testing migrations in Django', url='https://github.com/plumdog/django_migration_testcase', packages=find_packages(), install_requires=['Django>=1.4'], classifiers=[ 'Programming Language :: Python', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', ] )
<commit_before>from setuptools import find_packages, setup setup( name='django-migration-testcase', version='0.0.14', author='Andrew Plummer', author_email='plummer574@gmail.com', description='For testing migrations in Django', url='https://github.com/plumdog/django_migration_testcase', packages=find_packages(), install_requires=['Django>=1.4']) <commit_msg>Add python version trove classifiers<commit_after>from setuptools import find_packages, setup setup( name='django-migration-testcase', version='0.0.14', author='Andrew Plummer', author_email='plummer574@gmail.com', description='For testing migrations in Django', url='https://github.com/plumdog/django_migration_testcase', packages=find_packages(), install_requires=['Django>=1.4'], classifiers=[ 'Programming Language :: Python', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', ] )
5a52dd4c47e3c2438694949a174f91989dce6674
setup.py
setup.py
from setuptools import setup setup( name='eclipsegen', version='0.1', description='Generate Eclipse instances in Python', url='http://github.com/Gohla/eclipsegen', author='Gabriel Konat', author_email='gabrielkonat@gmail.com', license='Apache 2.0', packages=['eclipsegen'], requires=['requests'], test_suite='nose.collector', tests_require=['nose'] )
from setuptools import setup setup( name='eclipsegen', version='0.1', description='Generate Eclipse instances in Python', url='http://github.com/Gohla/eclipsegen', author='Gabriel Konat', author_email='gabrielkonat@gmail.com', license='Apache 2.0', packages=['eclipsegen'], install_requires=['requests'], test_suite='nose.collector', tests_require=['nose'] )
Use install_requires instead of requires.
Use install_requires instead of requires.
Python
apache-2.0
Gohla/eclipsegen,Gohla/eclipsegen,Gohla/eclipsegen,Gohla/eclipsegen
from setuptools import setup setup( name='eclipsegen', version='0.1', description='Generate Eclipse instances in Python', url='http://github.com/Gohla/eclipsegen', author='Gabriel Konat', author_email='gabrielkonat@gmail.com', license='Apache 2.0', packages=['eclipsegen'], requires=['requests'], test_suite='nose.collector', tests_require=['nose'] ) Use install_requires instead of requires.
from setuptools import setup setup( name='eclipsegen', version='0.1', description='Generate Eclipse instances in Python', url='http://github.com/Gohla/eclipsegen', author='Gabriel Konat', author_email='gabrielkonat@gmail.com', license='Apache 2.0', packages=['eclipsegen'], install_requires=['requests'], test_suite='nose.collector', tests_require=['nose'] )
<commit_before>from setuptools import setup setup( name='eclipsegen', version='0.1', description='Generate Eclipse instances in Python', url='http://github.com/Gohla/eclipsegen', author='Gabriel Konat', author_email='gabrielkonat@gmail.com', license='Apache 2.0', packages=['eclipsegen'], requires=['requests'], test_suite='nose.collector', tests_require=['nose'] ) <commit_msg>Use install_requires instead of requires.<commit_after>
from setuptools import setup setup( name='eclipsegen', version='0.1', description='Generate Eclipse instances in Python', url='http://github.com/Gohla/eclipsegen', author='Gabriel Konat', author_email='gabrielkonat@gmail.com', license='Apache 2.0', packages=['eclipsegen'], install_requires=['requests'], test_suite='nose.collector', tests_require=['nose'] )
from setuptools import setup setup( name='eclipsegen', version='0.1', description='Generate Eclipse instances in Python', url='http://github.com/Gohla/eclipsegen', author='Gabriel Konat', author_email='gabrielkonat@gmail.com', license='Apache 2.0', packages=['eclipsegen'], requires=['requests'], test_suite='nose.collector', tests_require=['nose'] ) Use install_requires instead of requires.from setuptools import setup setup( name='eclipsegen', version='0.1', description='Generate Eclipse instances in Python', url='http://github.com/Gohla/eclipsegen', author='Gabriel Konat', author_email='gabrielkonat@gmail.com', license='Apache 2.0', packages=['eclipsegen'], install_requires=['requests'], test_suite='nose.collector', tests_require=['nose'] )
<commit_before>from setuptools import setup setup( name='eclipsegen', version='0.1', description='Generate Eclipse instances in Python', url='http://github.com/Gohla/eclipsegen', author='Gabriel Konat', author_email='gabrielkonat@gmail.com', license='Apache 2.0', packages=['eclipsegen'], requires=['requests'], test_suite='nose.collector', tests_require=['nose'] ) <commit_msg>Use install_requires instead of requires.<commit_after>from setuptools import setup setup( name='eclipsegen', version='0.1', description='Generate Eclipse instances in Python', url='http://github.com/Gohla/eclipsegen', author='Gabriel Konat', author_email='gabrielkonat@gmail.com', license='Apache 2.0', packages=['eclipsegen'], install_requires=['requests'], test_suite='nose.collector', tests_require=['nose'] )
0a4d3f5b837cfa0d41a927c193a831a1c00b51f5
setup.py
setup.py
#!/usr/bin/env python # # ============================== # Copyright 2011 Whamcloud, Inc. # ============================== from distutils.core import setup from hydra_agent import __version__ setup( name = 'hydra-agent', version = __version__, author = "Whamcloud, Inc.", author_email = "info@whamcloud.com", packages = ['hydra_agent', 'hydra_agent/cmds'], scripts = ['bin/hydra-agent.py', 'bin/hydra-rmmod.py'], data_files=[('/usr/lib/ocf/resource.d/hydra', ['Target'])], url = 'http://www.whamcloud.com/', license = 'Proprietary', description = 'The Whamcloud Lustre Monitoring and Adminisration Interface Agent', long_description = open('README.txt').read(), )
#!/usr/bin/env python # # ============================== # Copyright 2011 Whamcloud, Inc. # ============================== from distutils.core import setup from hydra_agent import __version__ setup( name = 'hydra-agent', version = __version__, author = "Whamcloud, Inc.", author_email = "info@whamcloud.com", packages = ['hydra_agent', 'hydra_agent/cmds', 'hydra_agent/audit', 'hydra_agent/audit/lustre'], scripts = ['bin/hydra-agent.py', 'bin/hydra-rmmod.py'], data_files=[('/usr/lib/ocf/resource.d/hydra', ['Target'])], url = 'http://www.whamcloud.com/', license = 'Proprietary', description = 'The Whamcloud Lustre Monitoring and Adminisration Interface Agent', long_description = open('README.txt').read(), )
Add new paths for audit/
Add new paths for audit/
Python
mit
intel-hpdd/intel-manager-for-lustre,intel-hpdd/intel-manager-for-lustre,intel-hpdd/intel-manager-for-lustre
#!/usr/bin/env python # # ============================== # Copyright 2011 Whamcloud, Inc. # ============================== from distutils.core import setup from hydra_agent import __version__ setup( name = 'hydra-agent', version = __version__, author = "Whamcloud, Inc.", author_email = "info@whamcloud.com", packages = ['hydra_agent', 'hydra_agent/cmds'], scripts = ['bin/hydra-agent.py', 'bin/hydra-rmmod.py'], data_files=[('/usr/lib/ocf/resource.d/hydra', ['Target'])], url = 'http://www.whamcloud.com/', license = 'Proprietary', description = 'The Whamcloud Lustre Monitoring and Adminisration Interface Agent', long_description = open('README.txt').read(), ) Add new paths for audit/
#!/usr/bin/env python # # ============================== # Copyright 2011 Whamcloud, Inc. # ============================== from distutils.core import setup from hydra_agent import __version__ setup( name = 'hydra-agent', version = __version__, author = "Whamcloud, Inc.", author_email = "info@whamcloud.com", packages = ['hydra_agent', 'hydra_agent/cmds', 'hydra_agent/audit', 'hydra_agent/audit/lustre'], scripts = ['bin/hydra-agent.py', 'bin/hydra-rmmod.py'], data_files=[('/usr/lib/ocf/resource.d/hydra', ['Target'])], url = 'http://www.whamcloud.com/', license = 'Proprietary', description = 'The Whamcloud Lustre Monitoring and Adminisration Interface Agent', long_description = open('README.txt').read(), )
<commit_before>#!/usr/bin/env python # # ============================== # Copyright 2011 Whamcloud, Inc. # ============================== from distutils.core import setup from hydra_agent import __version__ setup( name = 'hydra-agent', version = __version__, author = "Whamcloud, Inc.", author_email = "info@whamcloud.com", packages = ['hydra_agent', 'hydra_agent/cmds'], scripts = ['bin/hydra-agent.py', 'bin/hydra-rmmod.py'], data_files=[('/usr/lib/ocf/resource.d/hydra', ['Target'])], url = 'http://www.whamcloud.com/', license = 'Proprietary', description = 'The Whamcloud Lustre Monitoring and Adminisration Interface Agent', long_description = open('README.txt').read(), ) <commit_msg>Add new paths for audit/<commit_after>
#!/usr/bin/env python # # ============================== # Copyright 2011 Whamcloud, Inc. # ============================== from distutils.core import setup from hydra_agent import __version__ setup( name = 'hydra-agent', version = __version__, author = "Whamcloud, Inc.", author_email = "info@whamcloud.com", packages = ['hydra_agent', 'hydra_agent/cmds', 'hydra_agent/audit', 'hydra_agent/audit/lustre'], scripts = ['bin/hydra-agent.py', 'bin/hydra-rmmod.py'], data_files=[('/usr/lib/ocf/resource.d/hydra', ['Target'])], url = 'http://www.whamcloud.com/', license = 'Proprietary', description = 'The Whamcloud Lustre Monitoring and Adminisration Interface Agent', long_description = open('README.txt').read(), )
#!/usr/bin/env python # # ============================== # Copyright 2011 Whamcloud, Inc. # ============================== from distutils.core import setup from hydra_agent import __version__ setup( name = 'hydra-agent', version = __version__, author = "Whamcloud, Inc.", author_email = "info@whamcloud.com", packages = ['hydra_agent', 'hydra_agent/cmds'], scripts = ['bin/hydra-agent.py', 'bin/hydra-rmmod.py'], data_files=[('/usr/lib/ocf/resource.d/hydra', ['Target'])], url = 'http://www.whamcloud.com/', license = 'Proprietary', description = 'The Whamcloud Lustre Monitoring and Adminisration Interface Agent', long_description = open('README.txt').read(), ) Add new paths for audit/#!/usr/bin/env python # # ============================== # Copyright 2011 Whamcloud, Inc. # ============================== from distutils.core import setup from hydra_agent import __version__ setup( name = 'hydra-agent', version = __version__, author = "Whamcloud, Inc.", author_email = "info@whamcloud.com", packages = ['hydra_agent', 'hydra_agent/cmds', 'hydra_agent/audit', 'hydra_agent/audit/lustre'], scripts = ['bin/hydra-agent.py', 'bin/hydra-rmmod.py'], data_files=[('/usr/lib/ocf/resource.d/hydra', ['Target'])], url = 'http://www.whamcloud.com/', license = 'Proprietary', description = 'The Whamcloud Lustre Monitoring and Adminisration Interface Agent', long_description = open('README.txt').read(), )
<commit_before>#!/usr/bin/env python # # ============================== # Copyright 2011 Whamcloud, Inc. # ============================== from distutils.core import setup from hydra_agent import __version__ setup( name = 'hydra-agent', version = __version__, author = "Whamcloud, Inc.", author_email = "info@whamcloud.com", packages = ['hydra_agent', 'hydra_agent/cmds'], scripts = ['bin/hydra-agent.py', 'bin/hydra-rmmod.py'], data_files=[('/usr/lib/ocf/resource.d/hydra', ['Target'])], url = 'http://www.whamcloud.com/', license = 'Proprietary', description = 'The Whamcloud Lustre Monitoring and Adminisration Interface Agent', long_description = open('README.txt').read(), ) <commit_msg>Add new paths for audit/<commit_after>#!/usr/bin/env python # # ============================== # Copyright 2011 Whamcloud, Inc. # ============================== from distutils.core import setup from hydra_agent import __version__ setup( name = 'hydra-agent', version = __version__, author = "Whamcloud, Inc.", author_email = "info@whamcloud.com", packages = ['hydra_agent', 'hydra_agent/cmds', 'hydra_agent/audit', 'hydra_agent/audit/lustre'], scripts = ['bin/hydra-agent.py', 'bin/hydra-rmmod.py'], data_files=[('/usr/lib/ocf/resource.d/hydra', ['Target'])], url = 'http://www.whamcloud.com/', license = 'Proprietary', description = 'The Whamcloud Lustre Monitoring and Adminisration Interface Agent', long_description = open('README.txt').read(), )
8a4d265f3a83357297e4713098ea51b86b5a5cf8
setup.py
setup.py
import sys import setuptools from setuptools.command.test import test as TestCommand class PyTest(TestCommand): user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")] def initialize_options(self): TestCommand.initialize_options(self) self.pytest_args = [] def finalize_options(self): TestCommand.finalize_options(self) self.test_args = [] self.test_suite = True def run_tests(self): import pytest errno = pytest.main(self.pytest_args) sys.exit(errno) VERSION = '0.0.1' setuptools.setup( name='multihash', description='An implementation of Multihash in Python', author='bmcorser', author_email='bmcorser@gmail.com', version=VERSION, packages=setuptools.find_packages(), tests_require=['pytest'], install_requires=['six'], cmdclass={'test': PyTest}, )
import sys import setuptools from setuptools.command.test import test as TestCommand class PyTest(TestCommand): user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")] def initialize_options(self): TestCommand.initialize_options(self) self.pytest_args = [] def finalize_options(self): pass def run_tests(self): import pytest errno = pytest.main(self.pytest_args) sys.exit(errno) VERSION = '0.0.1' setuptools.setup( name='multihash', description='An implementation of Multihash in Python', author='bmcorser', author_email='bmcorser@gmail.com', version=VERSION, packages=setuptools.find_packages(), tests_require=['pytest'], install_requires=['six'], cmdclass={'test': PyTest}, )
Update to follow latest py.test recommendations
Update to follow latest py.test recommendations http://pytest.org/latest/goodpractises.html#integrating-with-setuptools-python-setup-py-test
Python
mit
bmcorser/py-multihash
import sys import setuptools from setuptools.command.test import test as TestCommand class PyTest(TestCommand): user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")] def initialize_options(self): TestCommand.initialize_options(self) self.pytest_args = [] def finalize_options(self): TestCommand.finalize_options(self) self.test_args = [] self.test_suite = True def run_tests(self): import pytest errno = pytest.main(self.pytest_args) sys.exit(errno) VERSION = '0.0.1' setuptools.setup( name='multihash', description='An implementation of Multihash in Python', author='bmcorser', author_email='bmcorser@gmail.com', version=VERSION, packages=setuptools.find_packages(), tests_require=['pytest'], install_requires=['six'], cmdclass={'test': PyTest}, ) Update to follow latest py.test recommendations http://pytest.org/latest/goodpractises.html#integrating-with-setuptools-python-setup-py-test
import sys import setuptools from setuptools.command.test import test as TestCommand class PyTest(TestCommand): user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")] def initialize_options(self): TestCommand.initialize_options(self) self.pytest_args = [] def finalize_options(self): pass def run_tests(self): import pytest errno = pytest.main(self.pytest_args) sys.exit(errno) VERSION = '0.0.1' setuptools.setup( name='multihash', description='An implementation of Multihash in Python', author='bmcorser', author_email='bmcorser@gmail.com', version=VERSION, packages=setuptools.find_packages(), tests_require=['pytest'], install_requires=['six'], cmdclass={'test': PyTest}, )
<commit_before>import sys import setuptools from setuptools.command.test import test as TestCommand class PyTest(TestCommand): user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")] def initialize_options(self): TestCommand.initialize_options(self) self.pytest_args = [] def finalize_options(self): TestCommand.finalize_options(self) self.test_args = [] self.test_suite = True def run_tests(self): import pytest errno = pytest.main(self.pytest_args) sys.exit(errno) VERSION = '0.0.1' setuptools.setup( name='multihash', description='An implementation of Multihash in Python', author='bmcorser', author_email='bmcorser@gmail.com', version=VERSION, packages=setuptools.find_packages(), tests_require=['pytest'], install_requires=['six'], cmdclass={'test': PyTest}, ) <commit_msg>Update to follow latest py.test recommendations http://pytest.org/latest/goodpractises.html#integrating-with-setuptools-python-setup-py-test<commit_after>
import sys import setuptools from setuptools.command.test import test as TestCommand class PyTest(TestCommand): user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")] def initialize_options(self): TestCommand.initialize_options(self) self.pytest_args = [] def finalize_options(self): pass def run_tests(self): import pytest errno = pytest.main(self.pytest_args) sys.exit(errno) VERSION = '0.0.1' setuptools.setup( name='multihash', description='An implementation of Multihash in Python', author='bmcorser', author_email='bmcorser@gmail.com', version=VERSION, packages=setuptools.find_packages(), tests_require=['pytest'], install_requires=['six'], cmdclass={'test': PyTest}, )
import sys import setuptools from setuptools.command.test import test as TestCommand class PyTest(TestCommand): user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")] def initialize_options(self): TestCommand.initialize_options(self) self.pytest_args = [] def finalize_options(self): TestCommand.finalize_options(self) self.test_args = [] self.test_suite = True def run_tests(self): import pytest errno = pytest.main(self.pytest_args) sys.exit(errno) VERSION = '0.0.1' setuptools.setup( name='multihash', description='An implementation of Multihash in Python', author='bmcorser', author_email='bmcorser@gmail.com', version=VERSION, packages=setuptools.find_packages(), tests_require=['pytest'], install_requires=['six'], cmdclass={'test': PyTest}, ) Update to follow latest py.test recommendations http://pytest.org/latest/goodpractises.html#integrating-with-setuptools-python-setup-py-testimport sys import setuptools from setuptools.command.test import test as TestCommand class PyTest(TestCommand): user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")] def initialize_options(self): TestCommand.initialize_options(self) self.pytest_args = [] def finalize_options(self): pass def run_tests(self): import pytest errno = pytest.main(self.pytest_args) sys.exit(errno) VERSION = '0.0.1' setuptools.setup( name='multihash', description='An implementation of Multihash in Python', author='bmcorser', author_email='bmcorser@gmail.com', version=VERSION, packages=setuptools.find_packages(), tests_require=['pytest'], install_requires=['six'], cmdclass={'test': PyTest}, )
<commit_before>import sys import setuptools from setuptools.command.test import test as TestCommand class PyTest(TestCommand): user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")] def initialize_options(self): TestCommand.initialize_options(self) self.pytest_args = [] def finalize_options(self): TestCommand.finalize_options(self) self.test_args = [] self.test_suite = True def run_tests(self): import pytest errno = pytest.main(self.pytest_args) sys.exit(errno) VERSION = '0.0.1' setuptools.setup( name='multihash', description='An implementation of Multihash in Python', author='bmcorser', author_email='bmcorser@gmail.com', version=VERSION, packages=setuptools.find_packages(), tests_require=['pytest'], install_requires=['six'], cmdclass={'test': PyTest}, ) <commit_msg>Update to follow latest py.test recommendations http://pytest.org/latest/goodpractises.html#integrating-with-setuptools-python-setup-py-test<commit_after>import sys import setuptools from setuptools.command.test import test as TestCommand class PyTest(TestCommand): user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")] def initialize_options(self): TestCommand.initialize_options(self) self.pytest_args = [] def finalize_options(self): pass def run_tests(self): import pytest errno = pytest.main(self.pytest_args) sys.exit(errno) VERSION = '0.0.1' setuptools.setup( name='multihash', description='An implementation of Multihash in Python', author='bmcorser', author_email='bmcorser@gmail.com', version=VERSION, packages=setuptools.find_packages(), tests_require=['pytest'], install_requires=['six'], cmdclass={'test': PyTest}, )
3c21ab2abb05b0eec35cbb6e279173bfdab519a8
setup.py
setup.py
import sys from setuptools import setup, find_packages INSTALL_REQUIRES = ['pytz', 'workalendar'] if sys.version_info < (2, 7): INSTALL_REQUIRES += ['backport_collections'] setup( name='enerdata', version='0.18.0', packages=find_packages(), url='http://code.gisce.net', license='MIT', author='GISCE-TI, S.L.', author_email='devel@gisce.net', install_requires=INSTALL_REQUIRES, description='' )
import sys from setuptools import setup, find_packages PACKAGES_DATA = {'enerdata': ['profiles/data/*.xlsx']} INSTALL_REQUIRES = ['pytz', 'workalendar'] if sys.version_info < (2, 7): INSTALL_REQUIRES += ['backport_collections'] setup( name='enerdata', version='0.18.0', packages=find_packages(), url='http://code.gisce.net', license='MIT', author='GISCE-TI, S.L.', author_email='devel@gisce.net', install_requires=INSTALL_REQUIRES, package_data=PACKAGES_DATA, description='' )
FIX no data in pip file
FIX no data in pip file
Python
mit
gisce/enerdata
import sys from setuptools import setup, find_packages INSTALL_REQUIRES = ['pytz', 'workalendar'] if sys.version_info < (2, 7): INSTALL_REQUIRES += ['backport_collections'] setup( name='enerdata', version='0.18.0', packages=find_packages(), url='http://code.gisce.net', license='MIT', author='GISCE-TI, S.L.', author_email='devel@gisce.net', install_requires=INSTALL_REQUIRES, description='' ) FIX no data in pip file
import sys from setuptools import setup, find_packages PACKAGES_DATA = {'enerdata': ['profiles/data/*.xlsx']} INSTALL_REQUIRES = ['pytz', 'workalendar'] if sys.version_info < (2, 7): INSTALL_REQUIRES += ['backport_collections'] setup( name='enerdata', version='0.18.0', packages=find_packages(), url='http://code.gisce.net', license='MIT', author='GISCE-TI, S.L.', author_email='devel@gisce.net', install_requires=INSTALL_REQUIRES, package_data=PACKAGES_DATA, description='' )
<commit_before>import sys from setuptools import setup, find_packages INSTALL_REQUIRES = ['pytz', 'workalendar'] if sys.version_info < (2, 7): INSTALL_REQUIRES += ['backport_collections'] setup( name='enerdata', version='0.18.0', packages=find_packages(), url='http://code.gisce.net', license='MIT', author='GISCE-TI, S.L.', author_email='devel@gisce.net', install_requires=INSTALL_REQUIRES, description='' ) <commit_msg>FIX no data in pip file<commit_after>
import sys from setuptools import setup, find_packages PACKAGES_DATA = {'enerdata': ['profiles/data/*.xlsx']} INSTALL_REQUIRES = ['pytz', 'workalendar'] if sys.version_info < (2, 7): INSTALL_REQUIRES += ['backport_collections'] setup( name='enerdata', version='0.18.0', packages=find_packages(), url='http://code.gisce.net', license='MIT', author='GISCE-TI, S.L.', author_email='devel@gisce.net', install_requires=INSTALL_REQUIRES, package_data=PACKAGES_DATA, description='' )
import sys from setuptools import setup, find_packages INSTALL_REQUIRES = ['pytz', 'workalendar'] if sys.version_info < (2, 7): INSTALL_REQUIRES += ['backport_collections'] setup( name='enerdata', version='0.18.0', packages=find_packages(), url='http://code.gisce.net', license='MIT', author='GISCE-TI, S.L.', author_email='devel@gisce.net', install_requires=INSTALL_REQUIRES, description='' ) FIX no data in pip fileimport sys from setuptools import setup, find_packages PACKAGES_DATA = {'enerdata': ['profiles/data/*.xlsx']} INSTALL_REQUIRES = ['pytz', 'workalendar'] if sys.version_info < (2, 7): INSTALL_REQUIRES += ['backport_collections'] setup( name='enerdata', version='0.18.0', packages=find_packages(), url='http://code.gisce.net', license='MIT', author='GISCE-TI, S.L.', author_email='devel@gisce.net', install_requires=INSTALL_REQUIRES, package_data=PACKAGES_DATA, description='' )
<commit_before>import sys from setuptools import setup, find_packages INSTALL_REQUIRES = ['pytz', 'workalendar'] if sys.version_info < (2, 7): INSTALL_REQUIRES += ['backport_collections'] setup( name='enerdata', version='0.18.0', packages=find_packages(), url='http://code.gisce.net', license='MIT', author='GISCE-TI, S.L.', author_email='devel@gisce.net', install_requires=INSTALL_REQUIRES, description='' ) <commit_msg>FIX no data in pip file<commit_after>import sys from setuptools import setup, find_packages PACKAGES_DATA = {'enerdata': ['profiles/data/*.xlsx']} INSTALL_REQUIRES = ['pytz', 'workalendar'] if sys.version_info < (2, 7): INSTALL_REQUIRES += ['backport_collections'] setup( name='enerdata', version='0.18.0', packages=find_packages(), url='http://code.gisce.net', license='MIT', author='GISCE-TI, S.L.', author_email='devel@gisce.net', install_requires=INSTALL_REQUIRES, package_data=PACKAGES_DATA, description='' )
7847b6c8cf811d7648a63278d3de753eadca212a
setup.py
setup.py
#!/usr/bin/env python import os from setuptools import setup ROOT_DIR = os.path.dirname(__file__) SOURCE_DIR = os.path.join(ROOT_DIR) requirements = [ 'six >= 1.4.0', ] version = None exec(open('dockerpycreds/version.py').read()) with open('./test-requirements.txt') as test_reqs_txt: test_requirements = [line for line in test_reqs_txt] setup( name="docker-pycreds", version=version, description="Python bindings for the docker credentials store API", url='https://github.com/shin-/dockerpy-creds', license='Apache License 2.0', packages=[ 'dockerpycreds', ], install_requires=requirements, tests_require=test_requirements, zip_safe=False, test_suite='tests', classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Other Environment', 'Intended Audience :: Developers', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Topic :: Utilities', 'License :: OSI Approved :: Apache Software License', ], )
#!/usr/bin/env python import os from setuptools import setup ROOT_DIR = os.path.dirname(__file__) SOURCE_DIR = os.path.join(ROOT_DIR) requirements = [ 'six >= 1.4.0', ] version = None exec(open('dockerpycreds/version.py').read()) with open('./test-requirements.txt') as test_reqs_txt: test_requirements = [line for line in test_reqs_txt] setup( name="docker-pycreds", version=version, description="Python bindings for the docker credentials store API", url='https://github.com/shin-/dockerpy-creds', license='Apache License 2.0', packages=[ 'dockerpycreds', ], install_requires=requirements, tests_require=test_requirements, zip_safe=False, test_suite='tests', python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*', classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Other Environment', 'Intended Audience :: Developers', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Topic :: Utilities', 'License :: OSI Approved :: Apache Software License', ], )
Drop support for EOL Python 2.6 and 3.3
Drop support for EOL Python 2.6 and 3.3
Python
apache-2.0
shin-/dockerpy-creds,shin-/dockerpy-creds
#!/usr/bin/env python import os from setuptools import setup ROOT_DIR = os.path.dirname(__file__) SOURCE_DIR = os.path.join(ROOT_DIR) requirements = [ 'six >= 1.4.0', ] version = None exec(open('dockerpycreds/version.py').read()) with open('./test-requirements.txt') as test_reqs_txt: test_requirements = [line for line in test_reqs_txt] setup( name="docker-pycreds", version=version, description="Python bindings for the docker credentials store API", url='https://github.com/shin-/dockerpy-creds', license='Apache License 2.0', packages=[ 'dockerpycreds', ], install_requires=requirements, tests_require=test_requirements, zip_safe=False, test_suite='tests', classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Other Environment', 'Intended Audience :: Developers', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Topic :: Utilities', 'License :: OSI Approved :: Apache Software License', ], ) Drop support for EOL Python 2.6 and 3.3
#!/usr/bin/env python import os from setuptools import setup ROOT_DIR = os.path.dirname(__file__) SOURCE_DIR = os.path.join(ROOT_DIR) requirements = [ 'six >= 1.4.0', ] version = None exec(open('dockerpycreds/version.py').read()) with open('./test-requirements.txt') as test_reqs_txt: test_requirements = [line for line in test_reqs_txt] setup( name="docker-pycreds", version=version, description="Python bindings for the docker credentials store API", url='https://github.com/shin-/dockerpy-creds', license='Apache License 2.0', packages=[ 'dockerpycreds', ], install_requires=requirements, tests_require=test_requirements, zip_safe=False, test_suite='tests', python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*', classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Other Environment', 'Intended Audience :: Developers', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Topic :: Utilities', 'License :: OSI Approved :: Apache Software License', ], )
<commit_before>#!/usr/bin/env python import os from setuptools import setup ROOT_DIR = os.path.dirname(__file__) SOURCE_DIR = os.path.join(ROOT_DIR) requirements = [ 'six >= 1.4.0', ] version = None exec(open('dockerpycreds/version.py').read()) with open('./test-requirements.txt') as test_reqs_txt: test_requirements = [line for line in test_reqs_txt] setup( name="docker-pycreds", version=version, description="Python bindings for the docker credentials store API", url='https://github.com/shin-/dockerpy-creds', license='Apache License 2.0', packages=[ 'dockerpycreds', ], install_requires=requirements, tests_require=test_requirements, zip_safe=False, test_suite='tests', classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Other Environment', 'Intended Audience :: Developers', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Topic :: Utilities', 'License :: OSI Approved :: Apache Software License', ], ) <commit_msg>Drop support for EOL Python 2.6 and 3.3<commit_after>
#!/usr/bin/env python import os from setuptools import setup ROOT_DIR = os.path.dirname(__file__) SOURCE_DIR = os.path.join(ROOT_DIR) requirements = [ 'six >= 1.4.0', ] version = None exec(open('dockerpycreds/version.py').read()) with open('./test-requirements.txt') as test_reqs_txt: test_requirements = [line for line in test_reqs_txt] setup( name="docker-pycreds", version=version, description="Python bindings for the docker credentials store API", url='https://github.com/shin-/dockerpy-creds', license='Apache License 2.0', packages=[ 'dockerpycreds', ], install_requires=requirements, tests_require=test_requirements, zip_safe=False, test_suite='tests', python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*', classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Other Environment', 'Intended Audience :: Developers', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Topic :: Utilities', 'License :: OSI Approved :: Apache Software License', ], )
#!/usr/bin/env python import os from setuptools import setup ROOT_DIR = os.path.dirname(__file__) SOURCE_DIR = os.path.join(ROOT_DIR) requirements = [ 'six >= 1.4.0', ] version = None exec(open('dockerpycreds/version.py').read()) with open('./test-requirements.txt') as test_reqs_txt: test_requirements = [line for line in test_reqs_txt] setup( name="docker-pycreds", version=version, description="Python bindings for the docker credentials store API", url='https://github.com/shin-/dockerpy-creds', license='Apache License 2.0', packages=[ 'dockerpycreds', ], install_requires=requirements, tests_require=test_requirements, zip_safe=False, test_suite='tests', classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Other Environment', 'Intended Audience :: Developers', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Topic :: Utilities', 'License :: OSI Approved :: Apache Software License', ], ) Drop support for EOL Python 2.6 and 3.3#!/usr/bin/env python import os from setuptools import setup ROOT_DIR = os.path.dirname(__file__) SOURCE_DIR = os.path.join(ROOT_DIR) requirements = [ 'six >= 1.4.0', ] version = None exec(open('dockerpycreds/version.py').read()) with open('./test-requirements.txt') as test_reqs_txt: test_requirements = [line for line in test_reqs_txt] setup( name="docker-pycreds", version=version, description="Python bindings for the docker credentials store API", url='https://github.com/shin-/dockerpy-creds', license='Apache License 2.0', packages=[ 'dockerpycreds', ], install_requires=requirements, tests_require=test_requirements, zip_safe=False, test_suite='tests', python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*', classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Other Environment', 'Intended Audience :: Developers', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Topic :: Utilities', 'License :: OSI Approved :: Apache Software License', ], )
<commit_before>#!/usr/bin/env python import os from setuptools import setup ROOT_DIR = os.path.dirname(__file__) SOURCE_DIR = os.path.join(ROOT_DIR) requirements = [ 'six >= 1.4.0', ] version = None exec(open('dockerpycreds/version.py').read()) with open('./test-requirements.txt') as test_reqs_txt: test_requirements = [line for line in test_reqs_txt] setup( name="docker-pycreds", version=version, description="Python bindings for the docker credentials store API", url='https://github.com/shin-/dockerpy-creds', license='Apache License 2.0', packages=[ 'dockerpycreds', ], install_requires=requirements, tests_require=test_requirements, zip_safe=False, test_suite='tests', classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Other Environment', 'Intended Audience :: Developers', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Topic :: Utilities', 'License :: OSI Approved :: Apache Software License', ], ) <commit_msg>Drop support for EOL Python 2.6 and 3.3<commit_after>#!/usr/bin/env python import os from setuptools import setup ROOT_DIR = os.path.dirname(__file__) SOURCE_DIR = os.path.join(ROOT_DIR) requirements = [ 'six >= 1.4.0', ] version = None exec(open('dockerpycreds/version.py').read()) with open('./test-requirements.txt') as test_reqs_txt: test_requirements = [line for line in test_reqs_txt] setup( name="docker-pycreds", version=version, description="Python bindings for the docker credentials store API", url='https://github.com/shin-/dockerpy-creds', license='Apache License 2.0', packages=[ 'dockerpycreds', ], install_requires=requirements, tests_require=test_requirements, zip_safe=False, test_suite='tests', python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*', classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Other Environment', 'Intended Audience :: Developers', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Topic :: Utilities', 'License :: OSI Approved :: Apache Software License', ], )
8d4c4f05b5394f8d4002a29c7925a8a4845093d4
setup.py
setup.py
from setuptools import setup, find_packages __version__ = '0.6.0' setup( name = 'metalearn', packages = find_packages(include=['metalearn', 'metalearn.*']), version = __version__, description = 'A package to aid in metalearning', author = 'Roland Laboulaye, Brandon Schoenfeld, Casey Davis', author_email = 'rlaboulaye@gmail.com, bjschoenfeld@gmail.com, caseykdavis@gmail.com', url = 'https://github.com/byu-dml/metalearn', download_url = 'https://github.com/byu-dml/metalearn/archive/{}.tar.gz'.format(__version__), keywords = ['metalearning', 'machine learning', 'metalearn'], install_requires = [ 'numpy<=1.17.3', 'scikit-learn<=0.21.3', 'pandas<=0.25.2' ], classifiers = [ 'Programming Language :: Python :: 3.6' ], python_requires='~=3.6', include_package_data=True, )
from setuptools import setup, find_packages __version__ = '0.6.0' setup( name = 'metalearn', packages = find_packages(include=['metalearn', 'metalearn.*']), version = __version__, description = 'A package to aid in metalearning', author = 'Roland Laboulaye, Brandon Schoenfeld, Casey Davis', author_email = 'rlaboulaye@gmail.com, bjschoenfeld@gmail.com, caseykdavis@gmail.com', url = 'https://github.com/byu-dml/metalearn', download_url = 'https://github.com/byu-dml/metalearn/archive/{}.tar.gz'.format(__version__), keywords = ['metalearning', 'machine learning', 'metalearn'], install_requires = [ 'numpy<=1.18.2', 'scikit-learn<=0.22.2.post1', 'pandas<=1.0.3' ], classifiers = [ 'Programming Language :: Python :: 3.6' ], python_requires='~=3.6', include_package_data=True, )
Bump deps to match d3m==v2020.5.18
Bump deps to match d3m==v2020.5.18
Python
mit
byu-dml/metalearn
from setuptools import setup, find_packages __version__ = '0.6.0' setup( name = 'metalearn', packages = find_packages(include=['metalearn', 'metalearn.*']), version = __version__, description = 'A package to aid in metalearning', author = 'Roland Laboulaye, Brandon Schoenfeld, Casey Davis', author_email = 'rlaboulaye@gmail.com, bjschoenfeld@gmail.com, caseykdavis@gmail.com', url = 'https://github.com/byu-dml/metalearn', download_url = 'https://github.com/byu-dml/metalearn/archive/{}.tar.gz'.format(__version__), keywords = ['metalearning', 'machine learning', 'metalearn'], install_requires = [ 'numpy<=1.17.3', 'scikit-learn<=0.21.3', 'pandas<=0.25.2' ], classifiers = [ 'Programming Language :: Python :: 3.6' ], python_requires='~=3.6', include_package_data=True, ) Bump deps to match d3m==v2020.5.18
from setuptools import setup, find_packages __version__ = '0.6.0' setup( name = 'metalearn', packages = find_packages(include=['metalearn', 'metalearn.*']), version = __version__, description = 'A package to aid in metalearning', author = 'Roland Laboulaye, Brandon Schoenfeld, Casey Davis', author_email = 'rlaboulaye@gmail.com, bjschoenfeld@gmail.com, caseykdavis@gmail.com', url = 'https://github.com/byu-dml/metalearn', download_url = 'https://github.com/byu-dml/metalearn/archive/{}.tar.gz'.format(__version__), keywords = ['metalearning', 'machine learning', 'metalearn'], install_requires = [ 'numpy<=1.18.2', 'scikit-learn<=0.22.2.post1', 'pandas<=1.0.3' ], classifiers = [ 'Programming Language :: Python :: 3.6' ], python_requires='~=3.6', include_package_data=True, )
<commit_before>from setuptools import setup, find_packages __version__ = '0.6.0' setup( name = 'metalearn', packages = find_packages(include=['metalearn', 'metalearn.*']), version = __version__, description = 'A package to aid in metalearning', author = 'Roland Laboulaye, Brandon Schoenfeld, Casey Davis', author_email = 'rlaboulaye@gmail.com, bjschoenfeld@gmail.com, caseykdavis@gmail.com', url = 'https://github.com/byu-dml/metalearn', download_url = 'https://github.com/byu-dml/metalearn/archive/{}.tar.gz'.format(__version__), keywords = ['metalearning', 'machine learning', 'metalearn'], install_requires = [ 'numpy<=1.17.3', 'scikit-learn<=0.21.3', 'pandas<=0.25.2' ], classifiers = [ 'Programming Language :: Python :: 3.6' ], python_requires='~=3.6', include_package_data=True, ) <commit_msg>Bump deps to match d3m==v2020.5.18<commit_after>
from setuptools import setup, find_packages __version__ = '0.6.0' setup( name = 'metalearn', packages = find_packages(include=['metalearn', 'metalearn.*']), version = __version__, description = 'A package to aid in metalearning', author = 'Roland Laboulaye, Brandon Schoenfeld, Casey Davis', author_email = 'rlaboulaye@gmail.com, bjschoenfeld@gmail.com, caseykdavis@gmail.com', url = 'https://github.com/byu-dml/metalearn', download_url = 'https://github.com/byu-dml/metalearn/archive/{}.tar.gz'.format(__version__), keywords = ['metalearning', 'machine learning', 'metalearn'], install_requires = [ 'numpy<=1.18.2', 'scikit-learn<=0.22.2.post1', 'pandas<=1.0.3' ], classifiers = [ 'Programming Language :: Python :: 3.6' ], python_requires='~=3.6', include_package_data=True, )
from setuptools import setup, find_packages __version__ = '0.6.0' setup( name = 'metalearn', packages = find_packages(include=['metalearn', 'metalearn.*']), version = __version__, description = 'A package to aid in metalearning', author = 'Roland Laboulaye, Brandon Schoenfeld, Casey Davis', author_email = 'rlaboulaye@gmail.com, bjschoenfeld@gmail.com, caseykdavis@gmail.com', url = 'https://github.com/byu-dml/metalearn', download_url = 'https://github.com/byu-dml/metalearn/archive/{}.tar.gz'.format(__version__), keywords = ['metalearning', 'machine learning', 'metalearn'], install_requires = [ 'numpy<=1.17.3', 'scikit-learn<=0.21.3', 'pandas<=0.25.2' ], classifiers = [ 'Programming Language :: Python :: 3.6' ], python_requires='~=3.6', include_package_data=True, ) Bump deps to match d3m==v2020.5.18from setuptools import setup, find_packages __version__ = '0.6.0' setup( name = 'metalearn', packages = find_packages(include=['metalearn', 'metalearn.*']), version = __version__, description = 'A package to aid in metalearning', author = 'Roland Laboulaye, Brandon Schoenfeld, Casey Davis', author_email = 'rlaboulaye@gmail.com, bjschoenfeld@gmail.com, caseykdavis@gmail.com', url = 'https://github.com/byu-dml/metalearn', download_url = 'https://github.com/byu-dml/metalearn/archive/{}.tar.gz'.format(__version__), keywords = ['metalearning', 'machine learning', 'metalearn'], install_requires = [ 'numpy<=1.18.2', 'scikit-learn<=0.22.2.post1', 'pandas<=1.0.3' ], classifiers = [ 'Programming Language :: Python :: 3.6' ], python_requires='~=3.6', include_package_data=True, )
<commit_before>from setuptools import setup, find_packages __version__ = '0.6.0' setup( name = 'metalearn', packages = find_packages(include=['metalearn', 'metalearn.*']), version = __version__, description = 'A package to aid in metalearning', author = 'Roland Laboulaye, Brandon Schoenfeld, Casey Davis', author_email = 'rlaboulaye@gmail.com, bjschoenfeld@gmail.com, caseykdavis@gmail.com', url = 'https://github.com/byu-dml/metalearn', download_url = 'https://github.com/byu-dml/metalearn/archive/{}.tar.gz'.format(__version__), keywords = ['metalearning', 'machine learning', 'metalearn'], install_requires = [ 'numpy<=1.17.3', 'scikit-learn<=0.21.3', 'pandas<=0.25.2' ], classifiers = [ 'Programming Language :: Python :: 3.6' ], python_requires='~=3.6', include_package_data=True, ) <commit_msg>Bump deps to match d3m==v2020.5.18<commit_after>from setuptools import setup, find_packages __version__ = '0.6.0' setup( name = 'metalearn', packages = find_packages(include=['metalearn', 'metalearn.*']), version = __version__, description = 'A package to aid in metalearning', author = 'Roland Laboulaye, Brandon Schoenfeld, Casey Davis', author_email = 'rlaboulaye@gmail.com, bjschoenfeld@gmail.com, caseykdavis@gmail.com', url = 'https://github.com/byu-dml/metalearn', download_url = 'https://github.com/byu-dml/metalearn/archive/{}.tar.gz'.format(__version__), keywords = ['metalearning', 'machine learning', 'metalearn'], install_requires = [ 'numpy<=1.18.2', 'scikit-learn<=0.22.2.post1', 'pandas<=1.0.3' ], classifiers = [ 'Programming Language :: Python :: 3.6' ], python_requires='~=3.6', include_package_data=True, )
1918dbe5902d8ddd5421a698dc8a35e744cf9c5c
setup.py
setup.py
#!/usr/bin/env python import subprocess from setuptools import setup, find_packages import os def git_version(): def _minimal_ext_cmd(cmd): # construct minimal environment env = {} for k in ['SYSTEMROOT', 'PATH']: v = os.environ.get(k) if v is not None: env[k] = v # LANGUAGE is used on win32 env['LANGUAGE'] = 'C' env['LANG'] = 'C' env['LC_ALL'] = 'C' out = subprocess.Popen( cmd, stdout=subprocess.PIPE, env=env).communicate()[0] return out try: out = _minimal_ext_cmd(['git', 'rev-parse', 'HEAD']) GIT_REVISION = out.strip().decode('ascii') except OSError: GIT_REVISION = "" return GIT_REVISION def getVersion(version, release=True): if os.path.exists('.git'): _git_version = git_version()[:7] else: _git_version = '' if release: return version else: return version + '-dev.' + _git_version setup(name='pymks', version=getVersion('0.2.3', release=True), description='Materials Knowledge Systems in Python (PyMKS)', author='David Brough, Daniel Wheeler', author_email='david.brough.0416@gmail.com', url='http://pymks.org', packages=find_packages(), package_data={'': ['tests/*.py']}, )
#!/usr/bin/env python import subprocess from setuptools import setup, find_packages import os def git_version(): def _minimal_ext_cmd(cmd): # construct minimal environment env = {} for k in ['SYSTEMROOT', 'PATH']: v = os.environ.get(k) if v is not None: env[k] = v # LANGUAGE is used on win32 env['LANGUAGE'] = 'C' env['LANG'] = 'C' env['LC_ALL'] = 'C' out = subprocess.Popen( cmd, stdout=subprocess.PIPE, env=env).communicate()[0] return out try: out = _minimal_ext_cmd(['git', 'rev-parse', 'HEAD']) GIT_REVISION = out.strip().decode('ascii') except OSError: GIT_REVISION = "" return GIT_REVISION def getVersion(version, release=True): if os.path.exists('.git'): _git_version = git_version()[:7] else: _git_version = '' if release: return version else: return version + '-dev.' + _git_version setup(name='pymks', version=getVersion('0.2.4', release=False), description='Materials Knowledge Systems in Python (PyMKS)', author='David Brough, Daniel Wheeler', author_email='david.brough.0416@gmail.com', url='http://pymks.org', packages=find_packages(), package_data={'': ['tests/*.py']}, )
Update to version number to 0.2.4
Update to version number to 0.2.4
Python
mit
davidbrough1/pymks,davidbrough1/pymks,awhite40/pymks
#!/usr/bin/env python import subprocess from setuptools import setup, find_packages import os def git_version(): def _minimal_ext_cmd(cmd): # construct minimal environment env = {} for k in ['SYSTEMROOT', 'PATH']: v = os.environ.get(k) if v is not None: env[k] = v # LANGUAGE is used on win32 env['LANGUAGE'] = 'C' env['LANG'] = 'C' env['LC_ALL'] = 'C' out = subprocess.Popen( cmd, stdout=subprocess.PIPE, env=env).communicate()[0] return out try: out = _minimal_ext_cmd(['git', 'rev-parse', 'HEAD']) GIT_REVISION = out.strip().decode('ascii') except OSError: GIT_REVISION = "" return GIT_REVISION def getVersion(version, release=True): if os.path.exists('.git'): _git_version = git_version()[:7] else: _git_version = '' if release: return version else: return version + '-dev.' + _git_version setup(name='pymks', version=getVersion('0.2.3', release=True), description='Materials Knowledge Systems in Python (PyMKS)', author='David Brough, Daniel Wheeler', author_email='david.brough.0416@gmail.com', url='http://pymks.org', packages=find_packages(), package_data={'': ['tests/*.py']}, ) Update to version number to 0.2.4
#!/usr/bin/env python import subprocess from setuptools import setup, find_packages import os def git_version(): def _minimal_ext_cmd(cmd): # construct minimal environment env = {} for k in ['SYSTEMROOT', 'PATH']: v = os.environ.get(k) if v is not None: env[k] = v # LANGUAGE is used on win32 env['LANGUAGE'] = 'C' env['LANG'] = 'C' env['LC_ALL'] = 'C' out = subprocess.Popen( cmd, stdout=subprocess.PIPE, env=env).communicate()[0] return out try: out = _minimal_ext_cmd(['git', 'rev-parse', 'HEAD']) GIT_REVISION = out.strip().decode('ascii') except OSError: GIT_REVISION = "" return GIT_REVISION def getVersion(version, release=True): if os.path.exists('.git'): _git_version = git_version()[:7] else: _git_version = '' if release: return version else: return version + '-dev.' + _git_version setup(name='pymks', version=getVersion('0.2.4', release=False), description='Materials Knowledge Systems in Python (PyMKS)', author='David Brough, Daniel Wheeler', author_email='david.brough.0416@gmail.com', url='http://pymks.org', packages=find_packages(), package_data={'': ['tests/*.py']}, )
<commit_before>#!/usr/bin/env python import subprocess from setuptools import setup, find_packages import os def git_version(): def _minimal_ext_cmd(cmd): # construct minimal environment env = {} for k in ['SYSTEMROOT', 'PATH']: v = os.environ.get(k) if v is not None: env[k] = v # LANGUAGE is used on win32 env['LANGUAGE'] = 'C' env['LANG'] = 'C' env['LC_ALL'] = 'C' out = subprocess.Popen( cmd, stdout=subprocess.PIPE, env=env).communicate()[0] return out try: out = _minimal_ext_cmd(['git', 'rev-parse', 'HEAD']) GIT_REVISION = out.strip().decode('ascii') except OSError: GIT_REVISION = "" return GIT_REVISION def getVersion(version, release=True): if os.path.exists('.git'): _git_version = git_version()[:7] else: _git_version = '' if release: return version else: return version + '-dev.' + _git_version setup(name='pymks', version=getVersion('0.2.3', release=True), description='Materials Knowledge Systems in Python (PyMKS)', author='David Brough, Daniel Wheeler', author_email='david.brough.0416@gmail.com', url='http://pymks.org', packages=find_packages(), package_data={'': ['tests/*.py']}, ) <commit_msg>Update to version number to 0.2.4<commit_after>
#!/usr/bin/env python import subprocess from setuptools import setup, find_packages import os def git_version(): def _minimal_ext_cmd(cmd): # construct minimal environment env = {} for k in ['SYSTEMROOT', 'PATH']: v = os.environ.get(k) if v is not None: env[k] = v # LANGUAGE is used on win32 env['LANGUAGE'] = 'C' env['LANG'] = 'C' env['LC_ALL'] = 'C' out = subprocess.Popen( cmd, stdout=subprocess.PIPE, env=env).communicate()[0] return out try: out = _minimal_ext_cmd(['git', 'rev-parse', 'HEAD']) GIT_REVISION = out.strip().decode('ascii') except OSError: GIT_REVISION = "" return GIT_REVISION def getVersion(version, release=True): if os.path.exists('.git'): _git_version = git_version()[:7] else: _git_version = '' if release: return version else: return version + '-dev.' + _git_version setup(name='pymks', version=getVersion('0.2.4', release=False), description='Materials Knowledge Systems in Python (PyMKS)', author='David Brough, Daniel Wheeler', author_email='david.brough.0416@gmail.com', url='http://pymks.org', packages=find_packages(), package_data={'': ['tests/*.py']}, )
#!/usr/bin/env python import subprocess from setuptools import setup, find_packages import os def git_version(): def _minimal_ext_cmd(cmd): # construct minimal environment env = {} for k in ['SYSTEMROOT', 'PATH']: v = os.environ.get(k) if v is not None: env[k] = v # LANGUAGE is used on win32 env['LANGUAGE'] = 'C' env['LANG'] = 'C' env['LC_ALL'] = 'C' out = subprocess.Popen( cmd, stdout=subprocess.PIPE, env=env).communicate()[0] return out try: out = _minimal_ext_cmd(['git', 'rev-parse', 'HEAD']) GIT_REVISION = out.strip().decode('ascii') except OSError: GIT_REVISION = "" return GIT_REVISION def getVersion(version, release=True): if os.path.exists('.git'): _git_version = git_version()[:7] else: _git_version = '' if release: return version else: return version + '-dev.' + _git_version setup(name='pymks', version=getVersion('0.2.3', release=True), description='Materials Knowledge Systems in Python (PyMKS)', author='David Brough, Daniel Wheeler', author_email='david.brough.0416@gmail.com', url='http://pymks.org', packages=find_packages(), package_data={'': ['tests/*.py']}, ) Update to version number to 0.2.4#!/usr/bin/env python import subprocess from setuptools import setup, find_packages import os def git_version(): def _minimal_ext_cmd(cmd): # construct minimal environment env = {} for k in ['SYSTEMROOT', 'PATH']: v = os.environ.get(k) if v is not None: env[k] = v # LANGUAGE is used on win32 env['LANGUAGE'] = 'C' env['LANG'] = 'C' env['LC_ALL'] = 'C' out = subprocess.Popen( cmd, stdout=subprocess.PIPE, env=env).communicate()[0] return out try: out = _minimal_ext_cmd(['git', 'rev-parse', 'HEAD']) GIT_REVISION = out.strip().decode('ascii') except OSError: GIT_REVISION = "" return GIT_REVISION def getVersion(version, release=True): if os.path.exists('.git'): _git_version = git_version()[:7] else: _git_version = '' if release: return version else: return version + '-dev.' + _git_version setup(name='pymks', version=getVersion('0.2.4', release=False), description='Materials Knowledge Systems in Python (PyMKS)', author='David Brough, Daniel Wheeler', author_email='david.brough.0416@gmail.com', url='http://pymks.org', packages=find_packages(), package_data={'': ['tests/*.py']}, )
<commit_before>#!/usr/bin/env python import subprocess from setuptools import setup, find_packages import os def git_version(): def _minimal_ext_cmd(cmd): # construct minimal environment env = {} for k in ['SYSTEMROOT', 'PATH']: v = os.environ.get(k) if v is not None: env[k] = v # LANGUAGE is used on win32 env['LANGUAGE'] = 'C' env['LANG'] = 'C' env['LC_ALL'] = 'C' out = subprocess.Popen( cmd, stdout=subprocess.PIPE, env=env).communicate()[0] return out try: out = _minimal_ext_cmd(['git', 'rev-parse', 'HEAD']) GIT_REVISION = out.strip().decode('ascii') except OSError: GIT_REVISION = "" return GIT_REVISION def getVersion(version, release=True): if os.path.exists('.git'): _git_version = git_version()[:7] else: _git_version = '' if release: return version else: return version + '-dev.' + _git_version setup(name='pymks', version=getVersion('0.2.3', release=True), description='Materials Knowledge Systems in Python (PyMKS)', author='David Brough, Daniel Wheeler', author_email='david.brough.0416@gmail.com', url='http://pymks.org', packages=find_packages(), package_data={'': ['tests/*.py']}, ) <commit_msg>Update to version number to 0.2.4<commit_after>#!/usr/bin/env python import subprocess from setuptools import setup, find_packages import os def git_version(): def _minimal_ext_cmd(cmd): # construct minimal environment env = {} for k in ['SYSTEMROOT', 'PATH']: v = os.environ.get(k) if v is not None: env[k] = v # LANGUAGE is used on win32 env['LANGUAGE'] = 'C' env['LANG'] = 'C' env['LC_ALL'] = 'C' out = subprocess.Popen( cmd, stdout=subprocess.PIPE, env=env).communicate()[0] return out try: out = _minimal_ext_cmd(['git', 'rev-parse', 'HEAD']) GIT_REVISION = out.strip().decode('ascii') except OSError: GIT_REVISION = "" return GIT_REVISION def getVersion(version, release=True): if os.path.exists('.git'): _git_version = git_version()[:7] else: _git_version = '' if release: return version else: return version + '-dev.' + _git_version setup(name='pymks', version=getVersion('0.2.4', release=False), description='Materials Knowledge Systems in Python (PyMKS)', author='David Brough, Daniel Wheeler', author_email='david.brough.0416@gmail.com', url='http://pymks.org', packages=find_packages(), package_data={'': ['tests/*.py']}, )
67eea1b9f0308a78371a6fb56274cbdce5f85fe5
setup.py
setup.py
from setuptools import setup VERSION = "0.2.0" setup( name="pusherclient", version=VERSION, description="Pusher websocket client for python", author="Erik Kulyk", author_email="e.kulyk@gmail.com", license="", url="", install_requires=["websocket-client"], packages=["pusherclient"], )
from setuptools import setup import sys VERSION = "0.2.0" if sys.version_info >= (3,): requirements = ["websocket-client-py3"] else: requirements = ["websocket-client"] setup( name="pusherclient", version=VERSION, description="Pusher websocket client for python", author="Erik Kulyk", author_email="e.kulyk@gmail.com", license="", url="", install_requires=requirements, packages=["pusherclient"], )
Support to Python 3: should use websocket-client-py3
Support to Python 3: should use websocket-client-py3
Python
mit
ekulyk/PythonPusherClient,bartbroere/PythonPusherClient,mattsunsjf/PythonPusherClient
from setuptools import setup VERSION = "0.2.0" setup( name="pusherclient", version=VERSION, description="Pusher websocket client for python", author="Erik Kulyk", author_email="e.kulyk@gmail.com", license="", url="", install_requires=["websocket-client"], packages=["pusherclient"], ) Support to Python 3: should use websocket-client-py3
from setuptools import setup import sys VERSION = "0.2.0" if sys.version_info >= (3,): requirements = ["websocket-client-py3"] else: requirements = ["websocket-client"] setup( name="pusherclient", version=VERSION, description="Pusher websocket client for python", author="Erik Kulyk", author_email="e.kulyk@gmail.com", license="", url="", install_requires=requirements, packages=["pusherclient"], )
<commit_before>from setuptools import setup VERSION = "0.2.0" setup( name="pusherclient", version=VERSION, description="Pusher websocket client for python", author="Erik Kulyk", author_email="e.kulyk@gmail.com", license="", url="", install_requires=["websocket-client"], packages=["pusherclient"], ) <commit_msg>Support to Python 3: should use websocket-client-py3<commit_after>
from setuptools import setup import sys VERSION = "0.2.0" if sys.version_info >= (3,): requirements = ["websocket-client-py3"] else: requirements = ["websocket-client"] setup( name="pusherclient", version=VERSION, description="Pusher websocket client for python", author="Erik Kulyk", author_email="e.kulyk@gmail.com", license="", url="", install_requires=requirements, packages=["pusherclient"], )
from setuptools import setup VERSION = "0.2.0" setup( name="pusherclient", version=VERSION, description="Pusher websocket client for python", author="Erik Kulyk", author_email="e.kulyk@gmail.com", license="", url="", install_requires=["websocket-client"], packages=["pusherclient"], ) Support to Python 3: should use websocket-client-py3from setuptools import setup import sys VERSION = "0.2.0" if sys.version_info >= (3,): requirements = ["websocket-client-py3"] else: requirements = ["websocket-client"] setup( name="pusherclient", version=VERSION, description="Pusher websocket client for python", author="Erik Kulyk", author_email="e.kulyk@gmail.com", license="", url="", install_requires=requirements, packages=["pusherclient"], )
<commit_before>from setuptools import setup VERSION = "0.2.0" setup( name="pusherclient", version=VERSION, description="Pusher websocket client for python", author="Erik Kulyk", author_email="e.kulyk@gmail.com", license="", url="", install_requires=["websocket-client"], packages=["pusherclient"], ) <commit_msg>Support to Python 3: should use websocket-client-py3<commit_after>from setuptools import setup import sys VERSION = "0.2.0" if sys.version_info >= (3,): requirements = ["websocket-client-py3"] else: requirements = ["websocket-client"] setup( name="pusherclient", version=VERSION, description="Pusher websocket client for python", author="Erik Kulyk", author_email="e.kulyk@gmail.com", license="", url="", install_requires=requirements, packages=["pusherclient"], )
3a1f45d00f2e031d2961b9fef1e0ea7c36f9e410
setup.py
setup.py
import os from setuptools import setup VERSION='1.0.0' # Install Bash completion script only if installation is run as root if os.geteuid() != 0: data_files = [] else: data_files = [('/etc/bash_completion.d', ['pick-from.sh'])] setup( name='pick-from', version=VERSION, author='Matthias Vogelgesang', author_email='matthias.vogelgesang@gmail.com', license='BSD', scripts=['pick-from'], data_files=data_files, description="Text user interface for git cherry-pick", long_description=open('README.md').read(), install_requires=['urwid'] )
import os from setuptools import setup VERSION='1.0.0' # Install Bash completion script only if installation is run as root if os.geteuid() != 0: data_files = [] else: data_files = [('/etc/bash_completion.d', ['pick-from.sh'])] setup( name='git-pick-from', version=VERSION, author='Matthias Vogelgesang', author_email='matthias.vogelgesang@gmail.com', license='BSD', scripts=['pick-from'], data_files=data_files, description="Text user interface for git cherry-pick", long_description=open('README.md').read(), install_requires=['urwid'] )
Change package name to git-pick-from
Change package name to git-pick-from
Python
bsd-2-clause
matze/git-pick-from
import os from setuptools import setup VERSION='1.0.0' # Install Bash completion script only if installation is run as root if os.geteuid() != 0: data_files = [] else: data_files = [('/etc/bash_completion.d', ['pick-from.sh'])] setup( name='pick-from', version=VERSION, author='Matthias Vogelgesang', author_email='matthias.vogelgesang@gmail.com', license='BSD', scripts=['pick-from'], data_files=data_files, description="Text user interface for git cherry-pick", long_description=open('README.md').read(), install_requires=['urwid'] ) Change package name to git-pick-from
import os from setuptools import setup VERSION='1.0.0' # Install Bash completion script only if installation is run as root if os.geteuid() != 0: data_files = [] else: data_files = [('/etc/bash_completion.d', ['pick-from.sh'])] setup( name='git-pick-from', version=VERSION, author='Matthias Vogelgesang', author_email='matthias.vogelgesang@gmail.com', license='BSD', scripts=['pick-from'], data_files=data_files, description="Text user interface for git cherry-pick", long_description=open('README.md').read(), install_requires=['urwid'] )
<commit_before>import os from setuptools import setup VERSION='1.0.0' # Install Bash completion script only if installation is run as root if os.geteuid() != 0: data_files = [] else: data_files = [('/etc/bash_completion.d', ['pick-from.sh'])] setup( name='pick-from', version=VERSION, author='Matthias Vogelgesang', author_email='matthias.vogelgesang@gmail.com', license='BSD', scripts=['pick-from'], data_files=data_files, description="Text user interface for git cherry-pick", long_description=open('README.md').read(), install_requires=['urwid'] ) <commit_msg>Change package name to git-pick-from<commit_after>
import os from setuptools import setup VERSION='1.0.0' # Install Bash completion script only if installation is run as root if os.geteuid() != 0: data_files = [] else: data_files = [('/etc/bash_completion.d', ['pick-from.sh'])] setup( name='git-pick-from', version=VERSION, author='Matthias Vogelgesang', author_email='matthias.vogelgesang@gmail.com', license='BSD', scripts=['pick-from'], data_files=data_files, description="Text user interface for git cherry-pick", long_description=open('README.md').read(), install_requires=['urwid'] )
import os from setuptools import setup VERSION='1.0.0' # Install Bash completion script only if installation is run as root if os.geteuid() != 0: data_files = [] else: data_files = [('/etc/bash_completion.d', ['pick-from.sh'])] setup( name='pick-from', version=VERSION, author='Matthias Vogelgesang', author_email='matthias.vogelgesang@gmail.com', license='BSD', scripts=['pick-from'], data_files=data_files, description="Text user interface for git cherry-pick", long_description=open('README.md').read(), install_requires=['urwid'] ) Change package name to git-pick-fromimport os from setuptools import setup VERSION='1.0.0' # Install Bash completion script only if installation is run as root if os.geteuid() != 0: data_files = [] else: data_files = [('/etc/bash_completion.d', ['pick-from.sh'])] setup( name='git-pick-from', version=VERSION, author='Matthias Vogelgesang', author_email='matthias.vogelgesang@gmail.com', license='BSD', scripts=['pick-from'], data_files=data_files, description="Text user interface for git cherry-pick", long_description=open('README.md').read(), install_requires=['urwid'] )
<commit_before>import os from setuptools import setup VERSION='1.0.0' # Install Bash completion script only if installation is run as root if os.geteuid() != 0: data_files = [] else: data_files = [('/etc/bash_completion.d', ['pick-from.sh'])] setup( name='pick-from', version=VERSION, author='Matthias Vogelgesang', author_email='matthias.vogelgesang@gmail.com', license='BSD', scripts=['pick-from'], data_files=data_files, description="Text user interface for git cherry-pick", long_description=open('README.md').read(), install_requires=['urwid'] ) <commit_msg>Change package name to git-pick-from<commit_after>import os from setuptools import setup VERSION='1.0.0' # Install Bash completion script only if installation is run as root if os.geteuid() != 0: data_files = [] else: data_files = [('/etc/bash_completion.d', ['pick-from.sh'])] setup( name='git-pick-from', version=VERSION, author='Matthias Vogelgesang', author_email='matthias.vogelgesang@gmail.com', license='BSD', scripts=['pick-from'], data_files=data_files, description="Text user interface for git cherry-pick", long_description=open('README.md').read(), install_requires=['urwid'] )
d5d46410270cbc4b8ebbc593ed1f8c4dfdeee1f4
setup.py
setup.py
import sys, os from setuptools import setup, find_packages import subprocess version = "0.3.3" base_reqs = [ "requests" ] setup( name="waybackpack", description="Command-line tool that lets you download the entire Wayback Machine archive for a given URL.", classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.1", "Programming Language :: Python :: 3.4" ], keywords="wayback machine archive", author="Jeremy Singer-Vine", author_email="jsvine@gmail.com", url="http://github.com/jsvine/waybackpack", license="MIT", version=version, packages=find_packages(exclude=["test",]), tests_require=[ "nose" ] + base_reqs, install_requires=base_reqs, entry_points={ "console_scripts": [ "waybackpack = waybackpack.cli:main" ] } )
import sys, os from setuptools import setup, find_packages import subprocess version = "0.3.3" base_reqs = [ "requests" ] setup( name="waybackpack", description="Command-line tool that lets you download the entire Wayback Machine archive for a given URL.", classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.1", "Programming Language :: Python :: 3.4" ], keywords="wayback machine archive", author="Jeremy Singer-Vine", author_email="jsvine@gmail.com", url="https://github.com/jsvine/waybackpack", license="MIT", version=version, packages=find_packages(exclude=["test",]), tests_require=[ "nose" ] + base_reqs, install_requires=base_reqs, entry_points={ "console_scripts": [ "waybackpack = waybackpack.cli:main" ] } )
Use HTTPS in homepage URL
Use HTTPS in homepage URL
Python
mit
jsvine/waybackpack
import sys, os from setuptools import setup, find_packages import subprocess version = "0.3.3" base_reqs = [ "requests" ] setup( name="waybackpack", description="Command-line tool that lets you download the entire Wayback Machine archive for a given URL.", classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.1", "Programming Language :: Python :: 3.4" ], keywords="wayback machine archive", author="Jeremy Singer-Vine", author_email="jsvine@gmail.com", url="http://github.com/jsvine/waybackpack", license="MIT", version=version, packages=find_packages(exclude=["test",]), tests_require=[ "nose" ] + base_reqs, install_requires=base_reqs, entry_points={ "console_scripts": [ "waybackpack = waybackpack.cli:main" ] } ) Use HTTPS in homepage URL
import sys, os from setuptools import setup, find_packages import subprocess version = "0.3.3" base_reqs = [ "requests" ] setup( name="waybackpack", description="Command-line tool that lets you download the entire Wayback Machine archive for a given URL.", classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.1", "Programming Language :: Python :: 3.4" ], keywords="wayback machine archive", author="Jeremy Singer-Vine", author_email="jsvine@gmail.com", url="https://github.com/jsvine/waybackpack", license="MIT", version=version, packages=find_packages(exclude=["test",]), tests_require=[ "nose" ] + base_reqs, install_requires=base_reqs, entry_points={ "console_scripts": [ "waybackpack = waybackpack.cli:main" ] } )
<commit_before>import sys, os from setuptools import setup, find_packages import subprocess version = "0.3.3" base_reqs = [ "requests" ] setup( name="waybackpack", description="Command-line tool that lets you download the entire Wayback Machine archive for a given URL.", classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.1", "Programming Language :: Python :: 3.4" ], keywords="wayback machine archive", author="Jeremy Singer-Vine", author_email="jsvine@gmail.com", url="http://github.com/jsvine/waybackpack", license="MIT", version=version, packages=find_packages(exclude=["test",]), tests_require=[ "nose" ] + base_reqs, install_requires=base_reqs, entry_points={ "console_scripts": [ "waybackpack = waybackpack.cli:main" ] } ) <commit_msg>Use HTTPS in homepage URL<commit_after>
import sys, os from setuptools import setup, find_packages import subprocess version = "0.3.3" base_reqs = [ "requests" ] setup( name="waybackpack", description="Command-line tool that lets you download the entire Wayback Machine archive for a given URL.", classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.1", "Programming Language :: Python :: 3.4" ], keywords="wayback machine archive", author="Jeremy Singer-Vine", author_email="jsvine@gmail.com", url="https://github.com/jsvine/waybackpack", license="MIT", version=version, packages=find_packages(exclude=["test",]), tests_require=[ "nose" ] + base_reqs, install_requires=base_reqs, entry_points={ "console_scripts": [ "waybackpack = waybackpack.cli:main" ] } )
import sys, os from setuptools import setup, find_packages import subprocess version = "0.3.3" base_reqs = [ "requests" ] setup( name="waybackpack", description="Command-line tool that lets you download the entire Wayback Machine archive for a given URL.", classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.1", "Programming Language :: Python :: 3.4" ], keywords="wayback machine archive", author="Jeremy Singer-Vine", author_email="jsvine@gmail.com", url="http://github.com/jsvine/waybackpack", license="MIT", version=version, packages=find_packages(exclude=["test",]), tests_require=[ "nose" ] + base_reqs, install_requires=base_reqs, entry_points={ "console_scripts": [ "waybackpack = waybackpack.cli:main" ] } ) Use HTTPS in homepage URLimport sys, os from setuptools import setup, find_packages import subprocess version = "0.3.3" base_reqs = [ "requests" ] setup( name="waybackpack", description="Command-line tool that lets you download the entire Wayback Machine archive for a given URL.", classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.1", "Programming Language :: Python :: 3.4" ], keywords="wayback machine archive", author="Jeremy Singer-Vine", author_email="jsvine@gmail.com", url="https://github.com/jsvine/waybackpack", license="MIT", version=version, packages=find_packages(exclude=["test",]), tests_require=[ "nose" ] + base_reqs, install_requires=base_reqs, entry_points={ "console_scripts": [ "waybackpack = waybackpack.cli:main" ] } )
<commit_before>import sys, os from setuptools import setup, find_packages import subprocess version = "0.3.3" base_reqs = [ "requests" ] setup( name="waybackpack", description="Command-line tool that lets you download the entire Wayback Machine archive for a given URL.", classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.1", "Programming Language :: Python :: 3.4" ], keywords="wayback machine archive", author="Jeremy Singer-Vine", author_email="jsvine@gmail.com", url="http://github.com/jsvine/waybackpack", license="MIT", version=version, packages=find_packages(exclude=["test",]), tests_require=[ "nose" ] + base_reqs, install_requires=base_reqs, entry_points={ "console_scripts": [ "waybackpack = waybackpack.cli:main" ] } ) <commit_msg>Use HTTPS in homepage URL<commit_after>import sys, os from setuptools import setup, find_packages import subprocess version = "0.3.3" base_reqs = [ "requests" ] setup( name="waybackpack", description="Command-line tool that lets you download the entire Wayback Machine archive for a given URL.", classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.1", "Programming Language :: Python :: 3.4" ], keywords="wayback machine archive", author="Jeremy Singer-Vine", author_email="jsvine@gmail.com", url="https://github.com/jsvine/waybackpack", license="MIT", version=version, packages=find_packages(exclude=["test",]), tests_require=[ "nose" ] + base_reqs, install_requires=base_reqs, entry_points={ "console_scripts": [ "waybackpack = waybackpack.cli:main" ] } )
9353deefa7cc31fc4e9d01f29f7dab8c37b73a78
setup.py
setup.py
from setuptools import setup, find_packages # Dynamically calculate the version based on dbsettings.VERSION version_tuple = (0, 4, None) if version_tuple[2] is not None: version = "%d.%d_%s" % version_tuple else: version = "%d.%d" % version_tuple[:2] setup( name='django-dbsettings', version=version, description='Application settings whose values can be updated while a project is up and running.', long_description=open('README.rst').read(), author='Samuel Cormier-Iijima', author_email='sciyoshi@gmail.com', maintainer='Jacek Tomaszewski', maintainer_email='jacek.tomek@gmail.com', url='http://github.com/zlorf/django-dbsettings', packages=find_packages(), include_package_data=True, license='BSD', classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Utilities' ], )
from setuptools import setup, find_packages # Dynamically calculate the version based on dbsettings.VERSION version_tuple = (0, 4, None) if version_tuple[2] is not None: if type(version_tuple[2]) == int: version = "%d.%d.%s" % version_tuple else: version = "%d.%d_%s" % version_tuple else: version = "%d.%d" % version_tuple[:2] setup( name='django-dbsettings', version=version, description='Application settings whose values can be updated while a project is up and running.', long_description=open('README.rst').read(), author='Samuel Cormier-Iijima', author_email='sciyoshi@gmail.com', maintainer='Jacek Tomaszewski', maintainer_email='jacek.tomek@gmail.com', url='http://github.com/zlorf/django-dbsettings', packages=find_packages(), include_package_data=True, license='BSD', classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Utilities' ], )
Allow version to have subrevision.
Allow version to have subrevision.
Python
bsd-3-clause
helber/django-dbsettings,sciyoshi/django-dbsettings,zlorf/django-dbsettings,helber/django-dbsettings,DjangoAdminHackers/django-dbsettings,winfieldco/django-dbsettings,MiriamSexton/django-dbsettings,nwaxiomatic/django-dbsettings,DjangoAdminHackers/django-dbsettings,nwaxiomatic/django-dbsettings,zlorf/django-dbsettings,johnpaulett/django-dbsettings,sciyoshi/django-dbsettings,winfieldco/django-dbsettings,johnpaulett/django-dbsettings
from setuptools import setup, find_packages # Dynamically calculate the version based on dbsettings.VERSION version_tuple = (0, 4, None) if version_tuple[2] is not None: version = "%d.%d_%s" % version_tuple else: version = "%d.%d" % version_tuple[:2] setup( name='django-dbsettings', version=version, description='Application settings whose values can be updated while a project is up and running.', long_description=open('README.rst').read(), author='Samuel Cormier-Iijima', author_email='sciyoshi@gmail.com', maintainer='Jacek Tomaszewski', maintainer_email='jacek.tomek@gmail.com', url='http://github.com/zlorf/django-dbsettings', packages=find_packages(), include_package_data=True, license='BSD', classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Utilities' ], ) Allow version to have subrevision.
from setuptools import setup, find_packages # Dynamically calculate the version based on dbsettings.VERSION version_tuple = (0, 4, None) if version_tuple[2] is not None: if type(version_tuple[2]) == int: version = "%d.%d.%s" % version_tuple else: version = "%d.%d_%s" % version_tuple else: version = "%d.%d" % version_tuple[:2] setup( name='django-dbsettings', version=version, description='Application settings whose values can be updated while a project is up and running.', long_description=open('README.rst').read(), author='Samuel Cormier-Iijima', author_email='sciyoshi@gmail.com', maintainer='Jacek Tomaszewski', maintainer_email='jacek.tomek@gmail.com', url='http://github.com/zlorf/django-dbsettings', packages=find_packages(), include_package_data=True, license='BSD', classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Utilities' ], )
<commit_before>from setuptools import setup, find_packages # Dynamically calculate the version based on dbsettings.VERSION version_tuple = (0, 4, None) if version_tuple[2] is not None: version = "%d.%d_%s" % version_tuple else: version = "%d.%d" % version_tuple[:2] setup( name='django-dbsettings', version=version, description='Application settings whose values can be updated while a project is up and running.', long_description=open('README.rst').read(), author='Samuel Cormier-Iijima', author_email='sciyoshi@gmail.com', maintainer='Jacek Tomaszewski', maintainer_email='jacek.tomek@gmail.com', url='http://github.com/zlorf/django-dbsettings', packages=find_packages(), include_package_data=True, license='BSD', classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Utilities' ], ) <commit_msg>Allow version to have subrevision.<commit_after>
from setuptools import setup, find_packages # Dynamically calculate the version based on dbsettings.VERSION version_tuple = (0, 4, None) if version_tuple[2] is not None: if type(version_tuple[2]) == int: version = "%d.%d.%s" % version_tuple else: version = "%d.%d_%s" % version_tuple else: version = "%d.%d" % version_tuple[:2] setup( name='django-dbsettings', version=version, description='Application settings whose values can be updated while a project is up and running.', long_description=open('README.rst').read(), author='Samuel Cormier-Iijima', author_email='sciyoshi@gmail.com', maintainer='Jacek Tomaszewski', maintainer_email='jacek.tomek@gmail.com', url='http://github.com/zlorf/django-dbsettings', packages=find_packages(), include_package_data=True, license='BSD', classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Utilities' ], )
from setuptools import setup, find_packages # Dynamically calculate the version based on dbsettings.VERSION version_tuple = (0, 4, None) if version_tuple[2] is not None: version = "%d.%d_%s" % version_tuple else: version = "%d.%d" % version_tuple[:2] setup( name='django-dbsettings', version=version, description='Application settings whose values can be updated while a project is up and running.', long_description=open('README.rst').read(), author='Samuel Cormier-Iijima', author_email='sciyoshi@gmail.com', maintainer='Jacek Tomaszewski', maintainer_email='jacek.tomek@gmail.com', url='http://github.com/zlorf/django-dbsettings', packages=find_packages(), include_package_data=True, license='BSD', classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Utilities' ], ) Allow version to have subrevision.from setuptools import setup, find_packages # Dynamically calculate the version based on dbsettings.VERSION version_tuple = (0, 4, None) if version_tuple[2] is not None: if type(version_tuple[2]) == int: version = "%d.%d.%s" % version_tuple else: version = "%d.%d_%s" % version_tuple else: version = "%d.%d" % version_tuple[:2] setup( name='django-dbsettings', version=version, description='Application settings whose values can be updated while a project is up and running.', long_description=open('README.rst').read(), author='Samuel Cormier-Iijima', author_email='sciyoshi@gmail.com', maintainer='Jacek Tomaszewski', maintainer_email='jacek.tomek@gmail.com', url='http://github.com/zlorf/django-dbsettings', packages=find_packages(), include_package_data=True, license='BSD', classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Utilities' ], )
<commit_before>from setuptools import setup, find_packages # Dynamically calculate the version based on dbsettings.VERSION version_tuple = (0, 4, None) if version_tuple[2] is not None: version = "%d.%d_%s" % version_tuple else: version = "%d.%d" % version_tuple[:2] setup( name='django-dbsettings', version=version, description='Application settings whose values can be updated while a project is up and running.', long_description=open('README.rst').read(), author='Samuel Cormier-Iijima', author_email='sciyoshi@gmail.com', maintainer='Jacek Tomaszewski', maintainer_email='jacek.tomek@gmail.com', url='http://github.com/zlorf/django-dbsettings', packages=find_packages(), include_package_data=True, license='BSD', classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Utilities' ], ) <commit_msg>Allow version to have subrevision.<commit_after>from setuptools import setup, find_packages # Dynamically calculate the version based on dbsettings.VERSION version_tuple = (0, 4, None) if version_tuple[2] is not None: if type(version_tuple[2]) == int: version = "%d.%d.%s" % version_tuple else: version = "%d.%d_%s" % version_tuple else: version = "%d.%d" % version_tuple[:2] setup( name='django-dbsettings', version=version, description='Application settings whose values can be updated while a project is up and running.', long_description=open('README.rst').read(), author='Samuel Cormier-Iijima', author_email='sciyoshi@gmail.com', maintainer='Jacek Tomaszewski', maintainer_email='jacek.tomek@gmail.com', url='http://github.com/zlorf/django-dbsettings', packages=find_packages(), include_package_data=True, license='BSD', classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Utilities' ], )
830c3d7ac451805286bca32a04d6ba25db39b58d
setup.py
setup.py
from __future__ import absolute_import, division, print_function, unicode_literals from setuptools import setup setup( name='lifecycle' , author='Gittip, LLC' , author_email='support@gittip.com' , description="This library models a process lifecycle as a list of functions." , url='http://lifecycle-py.readthedocs.org' , version='0.0.0-dev' , py_modules=['lifecycle'] , classifiers=[ 'Development Status :: 5 - Production/Stable' , 'Intended Audience :: Developers' , 'License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication' , 'Operating System :: OS Independent' , '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' , 'Topic :: Software Development :: Libraries :: Python Modules' ] )
from __future__ import absolute_import, division, print_function, unicode_literals from setuptools import setup setup( name='lifecycle' , author='Gittip, LLC' , author_email='support@gittip.com' , description="This library models a process lifecycle as a list of functions." , url='http://lifecycle-py.readthedocs.org' , version='0.0.0-dev' , py_modules=['lifecycle'] , install_requires=['dependency_injection'] , classifiers=[ 'Development Status :: 5 - Production/Stable' , 'Intended Audience :: Developers' , 'License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication' , 'Operating System :: OS Independent' , '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' , 'Topic :: Software Development :: Libraries :: Python Modules' ] )
Add install_requires so we can build at RTD
Add install_requires so we can build at RTD
Python
mit
techtonik/algorithm.py,gratipay/algorithm.py,techtonik/algorithm.py,AspenWeb/algorithm.py,gratipay/algorithm.py
from __future__ import absolute_import, division, print_function, unicode_literals from setuptools import setup setup( name='lifecycle' , author='Gittip, LLC' , author_email='support@gittip.com' , description="This library models a process lifecycle as a list of functions." , url='http://lifecycle-py.readthedocs.org' , version='0.0.0-dev' , py_modules=['lifecycle'] , classifiers=[ 'Development Status :: 5 - Production/Stable' , 'Intended Audience :: Developers' , 'License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication' , 'Operating System :: OS Independent' , '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' , 'Topic :: Software Development :: Libraries :: Python Modules' ] ) Add install_requires so we can build at RTD
from __future__ import absolute_import, division, print_function, unicode_literals from setuptools import setup setup( name='lifecycle' , author='Gittip, LLC' , author_email='support@gittip.com' , description="This library models a process lifecycle as a list of functions." , url='http://lifecycle-py.readthedocs.org' , version='0.0.0-dev' , py_modules=['lifecycle'] , install_requires=['dependency_injection'] , classifiers=[ 'Development Status :: 5 - Production/Stable' , 'Intended Audience :: Developers' , 'License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication' , 'Operating System :: OS Independent' , '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' , 'Topic :: Software Development :: Libraries :: Python Modules' ] )
<commit_before>from __future__ import absolute_import, division, print_function, unicode_literals from setuptools import setup setup( name='lifecycle' , author='Gittip, LLC' , author_email='support@gittip.com' , description="This library models a process lifecycle as a list of functions." , url='http://lifecycle-py.readthedocs.org' , version='0.0.0-dev' , py_modules=['lifecycle'] , classifiers=[ 'Development Status :: 5 - Production/Stable' , 'Intended Audience :: Developers' , 'License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication' , 'Operating System :: OS Independent' , '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' , 'Topic :: Software Development :: Libraries :: Python Modules' ] ) <commit_msg>Add install_requires so we can build at RTD<commit_after>
from __future__ import absolute_import, division, print_function, unicode_literals from setuptools import setup setup( name='lifecycle' , author='Gittip, LLC' , author_email='support@gittip.com' , description="This library models a process lifecycle as a list of functions." , url='http://lifecycle-py.readthedocs.org' , version='0.0.0-dev' , py_modules=['lifecycle'] , install_requires=['dependency_injection'] , classifiers=[ 'Development Status :: 5 - Production/Stable' , 'Intended Audience :: Developers' , 'License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication' , 'Operating System :: OS Independent' , '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' , 'Topic :: Software Development :: Libraries :: Python Modules' ] )
from __future__ import absolute_import, division, print_function, unicode_literals from setuptools import setup setup( name='lifecycle' , author='Gittip, LLC' , author_email='support@gittip.com' , description="This library models a process lifecycle as a list of functions." , url='http://lifecycle-py.readthedocs.org' , version='0.0.0-dev' , py_modules=['lifecycle'] , classifiers=[ 'Development Status :: 5 - Production/Stable' , 'Intended Audience :: Developers' , 'License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication' , 'Operating System :: OS Independent' , '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' , 'Topic :: Software Development :: Libraries :: Python Modules' ] ) Add install_requires so we can build at RTDfrom __future__ import absolute_import, division, print_function, unicode_literals from setuptools import setup setup( name='lifecycle' , author='Gittip, LLC' , author_email='support@gittip.com' , description="This library models a process lifecycle as a list of functions." , url='http://lifecycle-py.readthedocs.org' , version='0.0.0-dev' , py_modules=['lifecycle'] , install_requires=['dependency_injection'] , classifiers=[ 'Development Status :: 5 - Production/Stable' , 'Intended Audience :: Developers' , 'License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication' , 'Operating System :: OS Independent' , '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' , 'Topic :: Software Development :: Libraries :: Python Modules' ] )
<commit_before>from __future__ import absolute_import, division, print_function, unicode_literals from setuptools import setup setup( name='lifecycle' , author='Gittip, LLC' , author_email='support@gittip.com' , description="This library models a process lifecycle as a list of functions." , url='http://lifecycle-py.readthedocs.org' , version='0.0.0-dev' , py_modules=['lifecycle'] , classifiers=[ 'Development Status :: 5 - Production/Stable' , 'Intended Audience :: Developers' , 'License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication' , 'Operating System :: OS Independent' , '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' , 'Topic :: Software Development :: Libraries :: Python Modules' ] ) <commit_msg>Add install_requires so we can build at RTD<commit_after>from __future__ import absolute_import, division, print_function, unicode_literals from setuptools import setup setup( name='lifecycle' , author='Gittip, LLC' , author_email='support@gittip.com' , description="This library models a process lifecycle as a list of functions." , url='http://lifecycle-py.readthedocs.org' , version='0.0.0-dev' , py_modules=['lifecycle'] , install_requires=['dependency_injection'] , classifiers=[ 'Development Status :: 5 - Production/Stable' , 'Intended Audience :: Developers' , 'License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication' , 'Operating System :: OS Independent' , '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' , 'Topic :: Software Development :: Libraries :: Python Modules' ] )
3e4707a3f25f3a2f84f811394d738cebc1ca9f19
mygpo/search/models.py
mygpo/search/models.py
""" Wrappers for the results of a search """ class PodcastResult(object): """ Wrapper for a Podcast search result """ @classmethod def from_doc(cls, doc): """ Construct a PodcastResult from a search result """ obj = cls() for key, val in doc['_source'].items(): setattr(obj, key, val) obj.id = doc['_id'] return obj @property def slug(self): return next(iter(self.slugs), None) @property def url(self): return next(iter(self.urls), None) def get_id(self): return self.id @property def display_title(self): return self.title
""" Wrappers for the results of a search """ import uuid class PodcastResult(object): """ Wrapper for a Podcast search result """ @classmethod def from_doc(cls, doc): """ Construct a PodcastResult from a search result """ obj = cls() for key, val in doc['_source'].items(): setattr(obj, key, val) obj.id = uuid.UUID(doc['_id']).hex return obj @property def slug(self): return next(iter(self.slugs), None) @property def url(self): return next(iter(self.urls), None) def get_id(self): return self.id @property def display_title(self): return self.title
Fix parsing UUID in search results
Fix parsing UUID in search results
Python
agpl-3.0
gpodder/mygpo,gpodder/mygpo,gpodder/mygpo,gpodder/mygpo
""" Wrappers for the results of a search """ class PodcastResult(object): """ Wrapper for a Podcast search result """ @classmethod def from_doc(cls, doc): """ Construct a PodcastResult from a search result """ obj = cls() for key, val in doc['_source'].items(): setattr(obj, key, val) obj.id = doc['_id'] return obj @property def slug(self): return next(iter(self.slugs), None) @property def url(self): return next(iter(self.urls), None) def get_id(self): return self.id @property def display_title(self): return self.title Fix parsing UUID in search results
""" Wrappers for the results of a search """ import uuid class PodcastResult(object): """ Wrapper for a Podcast search result """ @classmethod def from_doc(cls, doc): """ Construct a PodcastResult from a search result """ obj = cls() for key, val in doc['_source'].items(): setattr(obj, key, val) obj.id = uuid.UUID(doc['_id']).hex return obj @property def slug(self): return next(iter(self.slugs), None) @property def url(self): return next(iter(self.urls), None) def get_id(self): return self.id @property def display_title(self): return self.title
<commit_before>""" Wrappers for the results of a search """ class PodcastResult(object): """ Wrapper for a Podcast search result """ @classmethod def from_doc(cls, doc): """ Construct a PodcastResult from a search result """ obj = cls() for key, val in doc['_source'].items(): setattr(obj, key, val) obj.id = doc['_id'] return obj @property def slug(self): return next(iter(self.slugs), None) @property def url(self): return next(iter(self.urls), None) def get_id(self): return self.id @property def display_title(self): return self.title <commit_msg>Fix parsing UUID in search results<commit_after>
""" Wrappers for the results of a search """ import uuid class PodcastResult(object): """ Wrapper for a Podcast search result """ @classmethod def from_doc(cls, doc): """ Construct a PodcastResult from a search result """ obj = cls() for key, val in doc['_source'].items(): setattr(obj, key, val) obj.id = uuid.UUID(doc['_id']).hex return obj @property def slug(self): return next(iter(self.slugs), None) @property def url(self): return next(iter(self.urls), None) def get_id(self): return self.id @property def display_title(self): return self.title
""" Wrappers for the results of a search """ class PodcastResult(object): """ Wrapper for a Podcast search result """ @classmethod def from_doc(cls, doc): """ Construct a PodcastResult from a search result """ obj = cls() for key, val in doc['_source'].items(): setattr(obj, key, val) obj.id = doc['_id'] return obj @property def slug(self): return next(iter(self.slugs), None) @property def url(self): return next(iter(self.urls), None) def get_id(self): return self.id @property def display_title(self): return self.title Fix parsing UUID in search results""" Wrappers for the results of a search """ import uuid class PodcastResult(object): """ Wrapper for a Podcast search result """ @classmethod def from_doc(cls, doc): """ Construct a PodcastResult from a search result """ obj = cls() for key, val in doc['_source'].items(): setattr(obj, key, val) obj.id = uuid.UUID(doc['_id']).hex return obj @property def slug(self): return next(iter(self.slugs), None) @property def url(self): return next(iter(self.urls), None) def get_id(self): return self.id @property def display_title(self): return self.title
<commit_before>""" Wrappers for the results of a search """ class PodcastResult(object): """ Wrapper for a Podcast search result """ @classmethod def from_doc(cls, doc): """ Construct a PodcastResult from a search result """ obj = cls() for key, val in doc['_source'].items(): setattr(obj, key, val) obj.id = doc['_id'] return obj @property def slug(self): return next(iter(self.slugs), None) @property def url(self): return next(iter(self.urls), None) def get_id(self): return self.id @property def display_title(self): return self.title <commit_msg>Fix parsing UUID in search results<commit_after>""" Wrappers for the results of a search """ import uuid class PodcastResult(object): """ Wrapper for a Podcast search result """ @classmethod def from_doc(cls, doc): """ Construct a PodcastResult from a search result """ obj = cls() for key, val in doc['_source'].items(): setattr(obj, key, val) obj.id = uuid.UUID(doc['_id']).hex return obj @property def slug(self): return next(iter(self.slugs), None) @property def url(self): return next(iter(self.urls), None) def get_id(self): return self.id @property def display_title(self): return self.title
0d3b11648af33b57671f3a722b41e04625b7d984
tests/test_fragments.py
tests/test_fragments.py
import sci_parameter_utils.fragment as frag class TestInputInt: def test_create(self): name = 'test' fmt = "{}" elem = frag.TemplateElem.elem_by_type('int', name, {} ) assert elem.name == name assert elem.fmt == fmt def test_create_w_fmt(self): name = 'test' fmt = "{:g}" elem = frag.TemplateElem.elem_by_type('int', name, {'fmt': fmt} ) assert elem.name == name assert elem.fmt == fmt
import sci_parameter_utils.fragment as frag class TestInputInt: tstr = 'int' def test_create(self): name = 'test' fmt = "{}" elem = frag.TemplateElem.elem_by_type(self.tstr, name, {} ) assert elem.name == name assert elem.fmt == fmt def test_create_w_fmt(self): name = 'test' fmt = "{:g}" elem = frag.TemplateElem.elem_by_type(self.tstr, name, {'fmt': fmt} ) assert elem.name == name assert elem.fmt == fmt class TestInputFloat: tstr = 'float' def test_create(self): name = 'test' fmt = "{}" elem = frag.TemplateElem.elem_by_type(self.tstr, name, {} ) assert elem.name == name assert elem.fmt == fmt def test_create_w_fmt(self): name = 'test' fmt = "{:g}" elem = frag.TemplateElem.elem_by_type(self.tstr, name, {'fmt': fmt} ) assert elem.name == name assert elem.fmt == fmt class TestInputStr: tstr = 'str' def test_create(self): name = 'test' fmt = "{}" elem = frag.TemplateElem.elem_by_type(self.tstr, name, {} ) assert elem.name == name assert elem.fmt == fmt def test_create_w_fmt(self): name = 'test' fmt = "{:g}" elem = frag.TemplateElem.elem_by_type(self.tstr, name, {'fmt': fmt} ) assert elem.name == name assert elem.fmt == fmt
Add tests for all input elements
Add tests for all input elements
Python
mit
class4kayaker/Parameter_Utils
import sci_parameter_utils.fragment as frag class TestInputInt: def test_create(self): name = 'test' fmt = "{}" elem = frag.TemplateElem.elem_by_type('int', name, {} ) assert elem.name == name assert elem.fmt == fmt def test_create_w_fmt(self): name = 'test' fmt = "{:g}" elem = frag.TemplateElem.elem_by_type('int', name, {'fmt': fmt} ) assert elem.name == name assert elem.fmt == fmt Add tests for all input elements
import sci_parameter_utils.fragment as frag class TestInputInt: tstr = 'int' def test_create(self): name = 'test' fmt = "{}" elem = frag.TemplateElem.elem_by_type(self.tstr, name, {} ) assert elem.name == name assert elem.fmt == fmt def test_create_w_fmt(self): name = 'test' fmt = "{:g}" elem = frag.TemplateElem.elem_by_type(self.tstr, name, {'fmt': fmt} ) assert elem.name == name assert elem.fmt == fmt class TestInputFloat: tstr = 'float' def test_create(self): name = 'test' fmt = "{}" elem = frag.TemplateElem.elem_by_type(self.tstr, name, {} ) assert elem.name == name assert elem.fmt == fmt def test_create_w_fmt(self): name = 'test' fmt = "{:g}" elem = frag.TemplateElem.elem_by_type(self.tstr, name, {'fmt': fmt} ) assert elem.name == name assert elem.fmt == fmt class TestInputStr: tstr = 'str' def test_create(self): name = 'test' fmt = "{}" elem = frag.TemplateElem.elem_by_type(self.tstr, name, {} ) assert elem.name == name assert elem.fmt == fmt def test_create_w_fmt(self): name = 'test' fmt = "{:g}" elem = frag.TemplateElem.elem_by_type(self.tstr, name, {'fmt': fmt} ) assert elem.name == name assert elem.fmt == fmt
<commit_before>import sci_parameter_utils.fragment as frag class TestInputInt: def test_create(self): name = 'test' fmt = "{}" elem = frag.TemplateElem.elem_by_type('int', name, {} ) assert elem.name == name assert elem.fmt == fmt def test_create_w_fmt(self): name = 'test' fmt = "{:g}" elem = frag.TemplateElem.elem_by_type('int', name, {'fmt': fmt} ) assert elem.name == name assert elem.fmt == fmt <commit_msg>Add tests for all input elements<commit_after>
import sci_parameter_utils.fragment as frag class TestInputInt: tstr = 'int' def test_create(self): name = 'test' fmt = "{}" elem = frag.TemplateElem.elem_by_type(self.tstr, name, {} ) assert elem.name == name assert elem.fmt == fmt def test_create_w_fmt(self): name = 'test' fmt = "{:g}" elem = frag.TemplateElem.elem_by_type(self.tstr, name, {'fmt': fmt} ) assert elem.name == name assert elem.fmt == fmt class TestInputFloat: tstr = 'float' def test_create(self): name = 'test' fmt = "{}" elem = frag.TemplateElem.elem_by_type(self.tstr, name, {} ) assert elem.name == name assert elem.fmt == fmt def test_create_w_fmt(self): name = 'test' fmt = "{:g}" elem = frag.TemplateElem.elem_by_type(self.tstr, name, {'fmt': fmt} ) assert elem.name == name assert elem.fmt == fmt class TestInputStr: tstr = 'str' def test_create(self): name = 'test' fmt = "{}" elem = frag.TemplateElem.elem_by_type(self.tstr, name, {} ) assert elem.name == name assert elem.fmt == fmt def test_create_w_fmt(self): name = 'test' fmt = "{:g}" elem = frag.TemplateElem.elem_by_type(self.tstr, name, {'fmt': fmt} ) assert elem.name == name assert elem.fmt == fmt
import sci_parameter_utils.fragment as frag class TestInputInt: def test_create(self): name = 'test' fmt = "{}" elem = frag.TemplateElem.elem_by_type('int', name, {} ) assert elem.name == name assert elem.fmt == fmt def test_create_w_fmt(self): name = 'test' fmt = "{:g}" elem = frag.TemplateElem.elem_by_type('int', name, {'fmt': fmt} ) assert elem.name == name assert elem.fmt == fmt Add tests for all input elementsimport sci_parameter_utils.fragment as frag class TestInputInt: tstr = 'int' def test_create(self): name = 'test' fmt = "{}" elem = frag.TemplateElem.elem_by_type(self.tstr, name, {} ) assert elem.name == name assert elem.fmt == fmt def test_create_w_fmt(self): name = 'test' fmt = "{:g}" elem = frag.TemplateElem.elem_by_type(self.tstr, name, {'fmt': fmt} ) assert elem.name == name assert elem.fmt == fmt class TestInputFloat: tstr = 'float' def test_create(self): name = 'test' fmt = "{}" elem = frag.TemplateElem.elem_by_type(self.tstr, name, {} ) assert elem.name == name assert elem.fmt == fmt def test_create_w_fmt(self): name = 'test' fmt = "{:g}" elem = frag.TemplateElem.elem_by_type(self.tstr, name, {'fmt': fmt} ) assert elem.name == name assert elem.fmt == fmt class TestInputStr: tstr = 'str' def test_create(self): name = 'test' fmt = "{}" elem = frag.TemplateElem.elem_by_type(self.tstr, name, {} ) assert elem.name == name assert elem.fmt == fmt def test_create_w_fmt(self): name = 'test' fmt = "{:g}" elem = frag.TemplateElem.elem_by_type(self.tstr, name, {'fmt': fmt} ) assert elem.name == name assert elem.fmt == fmt
<commit_before>import sci_parameter_utils.fragment as frag class TestInputInt: def test_create(self): name = 'test' fmt = "{}" elem = frag.TemplateElem.elem_by_type('int', name, {} ) assert elem.name == name assert elem.fmt == fmt def test_create_w_fmt(self): name = 'test' fmt = "{:g}" elem = frag.TemplateElem.elem_by_type('int', name, {'fmt': fmt} ) assert elem.name == name assert elem.fmt == fmt <commit_msg>Add tests for all input elements<commit_after>import sci_parameter_utils.fragment as frag class TestInputInt: tstr = 'int' def test_create(self): name = 'test' fmt = "{}" elem = frag.TemplateElem.elem_by_type(self.tstr, name, {} ) assert elem.name == name assert elem.fmt == fmt def test_create_w_fmt(self): name = 'test' fmt = "{:g}" elem = frag.TemplateElem.elem_by_type(self.tstr, name, {'fmt': fmt} ) assert elem.name == name assert elem.fmt == fmt class TestInputFloat: tstr = 'float' def test_create(self): name = 'test' fmt = "{}" elem = frag.TemplateElem.elem_by_type(self.tstr, name, {} ) assert elem.name == name assert elem.fmt == fmt def test_create_w_fmt(self): name = 'test' fmt = "{:g}" elem = frag.TemplateElem.elem_by_type(self.tstr, name, {'fmt': fmt} ) assert elem.name == name assert elem.fmt == fmt class TestInputStr: tstr = 'str' def test_create(self): name = 'test' fmt = "{}" elem = frag.TemplateElem.elem_by_type(self.tstr, name, {} ) assert elem.name == name assert elem.fmt == fmt def test_create_w_fmt(self): name = 'test' fmt = "{:g}" elem = frag.TemplateElem.elem_by_type(self.tstr, name, {'fmt': fmt} ) assert elem.name == name assert elem.fmt == fmt
01d665bc295c48d5d805a3b1292b6116cf854d8a
setup.py
setup.py
from setuptools import setup, find_packages version = '1.0a5.dev0' setup( name='robotframework-djangolibrary', version=version, description="A robot framework library for Django.", long_description="""\ """, classifiers=[ 'Development Status :: 3 - Alpha', 'License :: OSI Approved :: Apache Software License', 'Environment :: Web Environment', 'Framework :: Robot Framework', 'Framework :: Django', 'Framework :: Django :: 1.5', 'Framework :: Django :: 1.6', 'Framework :: Django :: 1.7', 'Framework :: Django :: 1.8', 'Framework :: Django :: 1.9', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: Implementation :: CPython', ], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers keywords='robotframework django test', author='Timo Stollenwerk', author_email='stollenwerk@kitconcept.com', url='http://kitconcept.com', license='Apache License 2.0', packages=find_packages( exclude=['ez_setup', 'examples', 'tests'] ), include_package_data=True, zip_safe=False, install_requires=[ 'Django', 'robotframework', 'robotframework-selenium2library', 'robotframework-debuglibrary', ], entry_points=""" # -*- Entry points: -*- """, )
from setuptools import setup, find_packages version = '1.0a5.dev0' long_description = ( open('README.rst').read() + '\n' + '\n' + open('CHANGES.rst').read() + '\n') setup( name='robotframework-djangolibrary', version=version, description="A robot framework library for Django.", long_description=long_description, classifiers=[ 'Development Status :: 3 - Alpha', 'License :: OSI Approved :: Apache Software License', 'Environment :: Web Environment', 'Framework :: Robot Framework', 'Framework :: Django', 'Framework :: Django :: 1.5', 'Framework :: Django :: 1.6', 'Framework :: Django :: 1.7', 'Framework :: Django :: 1.8', 'Framework :: Django :: 1.9', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: Implementation :: CPython', ], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers keywords='robotframework django test', author='Timo Stollenwerk', author_email='stollenwerk@kitconcept.com', url='http://kitconcept.com', license='Apache License 2.0', packages=find_packages( exclude=['ez_setup', 'examples', 'tests'] ), include_package_data=True, zip_safe=False, install_requires=[ 'Django', 'robotframework', 'robotframework-selenium2library', 'robotframework-debuglibrary', ], entry_points=""" # -*- Entry points: -*- """, )
Include CHANGES.rst in long description.
Include CHANGES.rst in long description.
Python
apache-2.0
kitconcept/robotframework-djangolibrary
from setuptools import setup, find_packages version = '1.0a5.dev0' setup( name='robotframework-djangolibrary', version=version, description="A robot framework library for Django.", long_description="""\ """, classifiers=[ 'Development Status :: 3 - Alpha', 'License :: OSI Approved :: Apache Software License', 'Environment :: Web Environment', 'Framework :: Robot Framework', 'Framework :: Django', 'Framework :: Django :: 1.5', 'Framework :: Django :: 1.6', 'Framework :: Django :: 1.7', 'Framework :: Django :: 1.8', 'Framework :: Django :: 1.9', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: Implementation :: CPython', ], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers keywords='robotframework django test', author='Timo Stollenwerk', author_email='stollenwerk@kitconcept.com', url='http://kitconcept.com', license='Apache License 2.0', packages=find_packages( exclude=['ez_setup', 'examples', 'tests'] ), include_package_data=True, zip_safe=False, install_requires=[ 'Django', 'robotframework', 'robotframework-selenium2library', 'robotframework-debuglibrary', ], entry_points=""" # -*- Entry points: -*- """, ) Include CHANGES.rst in long description.
from setuptools import setup, find_packages version = '1.0a5.dev0' long_description = ( open('README.rst').read() + '\n' + '\n' + open('CHANGES.rst').read() + '\n') setup( name='robotframework-djangolibrary', version=version, description="A robot framework library for Django.", long_description=long_description, classifiers=[ 'Development Status :: 3 - Alpha', 'License :: OSI Approved :: Apache Software License', 'Environment :: Web Environment', 'Framework :: Robot Framework', 'Framework :: Django', 'Framework :: Django :: 1.5', 'Framework :: Django :: 1.6', 'Framework :: Django :: 1.7', 'Framework :: Django :: 1.8', 'Framework :: Django :: 1.9', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: Implementation :: CPython', ], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers keywords='robotframework django test', author='Timo Stollenwerk', author_email='stollenwerk@kitconcept.com', url='http://kitconcept.com', license='Apache License 2.0', packages=find_packages( exclude=['ez_setup', 'examples', 'tests'] ), include_package_data=True, zip_safe=False, install_requires=[ 'Django', 'robotframework', 'robotframework-selenium2library', 'robotframework-debuglibrary', ], entry_points=""" # -*- Entry points: -*- """, )
<commit_before>from setuptools import setup, find_packages version = '1.0a5.dev0' setup( name='robotframework-djangolibrary', version=version, description="A robot framework library for Django.", long_description="""\ """, classifiers=[ 'Development Status :: 3 - Alpha', 'License :: OSI Approved :: Apache Software License', 'Environment :: Web Environment', 'Framework :: Robot Framework', 'Framework :: Django', 'Framework :: Django :: 1.5', 'Framework :: Django :: 1.6', 'Framework :: Django :: 1.7', 'Framework :: Django :: 1.8', 'Framework :: Django :: 1.9', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: Implementation :: CPython', ], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers keywords='robotframework django test', author='Timo Stollenwerk', author_email='stollenwerk@kitconcept.com', url='http://kitconcept.com', license='Apache License 2.0', packages=find_packages( exclude=['ez_setup', 'examples', 'tests'] ), include_package_data=True, zip_safe=False, install_requires=[ 'Django', 'robotframework', 'robotframework-selenium2library', 'robotframework-debuglibrary', ], entry_points=""" # -*- Entry points: -*- """, ) <commit_msg>Include CHANGES.rst in long description.<commit_after>
from setuptools import setup, find_packages version = '1.0a5.dev0' long_description = ( open('README.rst').read() + '\n' + '\n' + open('CHANGES.rst').read() + '\n') setup( name='robotframework-djangolibrary', version=version, description="A robot framework library for Django.", long_description=long_description, classifiers=[ 'Development Status :: 3 - Alpha', 'License :: OSI Approved :: Apache Software License', 'Environment :: Web Environment', 'Framework :: Robot Framework', 'Framework :: Django', 'Framework :: Django :: 1.5', 'Framework :: Django :: 1.6', 'Framework :: Django :: 1.7', 'Framework :: Django :: 1.8', 'Framework :: Django :: 1.9', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: Implementation :: CPython', ], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers keywords='robotframework django test', author='Timo Stollenwerk', author_email='stollenwerk@kitconcept.com', url='http://kitconcept.com', license='Apache License 2.0', packages=find_packages( exclude=['ez_setup', 'examples', 'tests'] ), include_package_data=True, zip_safe=False, install_requires=[ 'Django', 'robotframework', 'robotframework-selenium2library', 'robotframework-debuglibrary', ], entry_points=""" # -*- Entry points: -*- """, )
from setuptools import setup, find_packages version = '1.0a5.dev0' setup( name='robotframework-djangolibrary', version=version, description="A robot framework library for Django.", long_description="""\ """, classifiers=[ 'Development Status :: 3 - Alpha', 'License :: OSI Approved :: Apache Software License', 'Environment :: Web Environment', 'Framework :: Robot Framework', 'Framework :: Django', 'Framework :: Django :: 1.5', 'Framework :: Django :: 1.6', 'Framework :: Django :: 1.7', 'Framework :: Django :: 1.8', 'Framework :: Django :: 1.9', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: Implementation :: CPython', ], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers keywords='robotframework django test', author='Timo Stollenwerk', author_email='stollenwerk@kitconcept.com', url='http://kitconcept.com', license='Apache License 2.0', packages=find_packages( exclude=['ez_setup', 'examples', 'tests'] ), include_package_data=True, zip_safe=False, install_requires=[ 'Django', 'robotframework', 'robotframework-selenium2library', 'robotframework-debuglibrary', ], entry_points=""" # -*- Entry points: -*- """, ) Include CHANGES.rst in long description.from setuptools import setup, find_packages version = '1.0a5.dev0' long_description = ( open('README.rst').read() + '\n' + '\n' + open('CHANGES.rst').read() + '\n') setup( name='robotframework-djangolibrary', version=version, description="A robot framework library for Django.", long_description=long_description, classifiers=[ 'Development Status :: 3 - Alpha', 'License :: OSI Approved :: Apache Software License', 'Environment :: Web Environment', 'Framework :: Robot Framework', 'Framework :: Django', 'Framework :: Django :: 1.5', 'Framework :: Django :: 1.6', 'Framework :: Django :: 1.7', 'Framework :: Django :: 1.8', 'Framework :: Django :: 1.9', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: Implementation :: CPython', ], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers keywords='robotframework django test', author='Timo Stollenwerk', author_email='stollenwerk@kitconcept.com', url='http://kitconcept.com', license='Apache License 2.0', packages=find_packages( exclude=['ez_setup', 'examples', 'tests'] ), include_package_data=True, zip_safe=False, install_requires=[ 'Django', 'robotframework', 'robotframework-selenium2library', 'robotframework-debuglibrary', ], entry_points=""" # -*- Entry points: -*- """, )
<commit_before>from setuptools import setup, find_packages version = '1.0a5.dev0' setup( name='robotframework-djangolibrary', version=version, description="A robot framework library for Django.", long_description="""\ """, classifiers=[ 'Development Status :: 3 - Alpha', 'License :: OSI Approved :: Apache Software License', 'Environment :: Web Environment', 'Framework :: Robot Framework', 'Framework :: Django', 'Framework :: Django :: 1.5', 'Framework :: Django :: 1.6', 'Framework :: Django :: 1.7', 'Framework :: Django :: 1.8', 'Framework :: Django :: 1.9', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: Implementation :: CPython', ], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers keywords='robotframework django test', author='Timo Stollenwerk', author_email='stollenwerk@kitconcept.com', url='http://kitconcept.com', license='Apache License 2.0', packages=find_packages( exclude=['ez_setup', 'examples', 'tests'] ), include_package_data=True, zip_safe=False, install_requires=[ 'Django', 'robotframework', 'robotframework-selenium2library', 'robotframework-debuglibrary', ], entry_points=""" # -*- Entry points: -*- """, ) <commit_msg>Include CHANGES.rst in long description.<commit_after>from setuptools import setup, find_packages version = '1.0a5.dev0' long_description = ( open('README.rst').read() + '\n' + '\n' + open('CHANGES.rst').read() + '\n') setup( name='robotframework-djangolibrary', version=version, description="A robot framework library for Django.", long_description=long_description, classifiers=[ 'Development Status :: 3 - Alpha', 'License :: OSI Approved :: Apache Software License', 'Environment :: Web Environment', 'Framework :: Robot Framework', 'Framework :: Django', 'Framework :: Django :: 1.5', 'Framework :: Django :: 1.6', 'Framework :: Django :: 1.7', 'Framework :: Django :: 1.8', 'Framework :: Django :: 1.9', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: Implementation :: CPython', ], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers keywords='robotframework django test', author='Timo Stollenwerk', author_email='stollenwerk@kitconcept.com', url='http://kitconcept.com', license='Apache License 2.0', packages=find_packages( exclude=['ez_setup', 'examples', 'tests'] ), include_package_data=True, zip_safe=False, install_requires=[ 'Django', 'robotframework', 'robotframework-selenium2library', 'robotframework-debuglibrary', ], entry_points=""" # -*- Entry points: -*- """, )
12dab867a97241e27eeca44b3919113d379c1850
setup.py
setup.py
try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages setup( name='porick', version='0.1', description='', author='', author_email='', url='', install_requires=[ "Pylons>=1.0.1rc1", "SQLAlchemy==0.6.8", ], setup_requires=["PasteScript>=1.6.3"], packages=find_packages(exclude=['ez_setup']), include_package_data=True, test_suite='nose.collector', package_data={'porick': ['i18n/*/LC_MESSAGES/*.mo']}, #message_extractors={'porick': [ # ('**.py', 'python', None), # ('templates/**.mako', 'mako', {'input_encoding': 'utf-8'}), # ('public/**', 'ignore', None)]}, zip_safe=False, paster_plugins=['PasteScript', 'Pylons'], entry_points=""" [paste.app_factory] main = porick.config.middleware:make_app [paste.app_install] main = pylons.util:PylonsInstaller """, )
try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages setup( name='porick', version='0.1', description='', author='', author_email='', url='', install_requires=[ "Pylons>=1.0.1rc1", "SQLAlchemy==0.7.7", ], setup_requires=["PasteScript>=1.6.3"], packages=find_packages(exclude=['ez_setup']), include_package_data=True, test_suite='nose.collector', package_data={'porick': ['i18n/*/LC_MESSAGES/*.mo']}, #message_extractors={'porick': [ # ('**.py', 'python', None), # ('templates/**.mako', 'mako', {'input_encoding': 'utf-8'}), # ('public/**', 'ignore', None)]}, zip_safe=False, paster_plugins=['PasteScript', 'Pylons'], entry_points=""" [paste.app_factory] main = porick.config.middleware:make_app [paste.app_install] main = pylons.util:PylonsInstaller """, )
Use sqlalchemy 0.7.7 instead of 0.6
Use sqlalchemy 0.7.7 instead of 0.6
Python
apache-2.0
kopf/porick,kopf/porick,kopf/porick
try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages setup( name='porick', version='0.1', description='', author='', author_email='', url='', install_requires=[ "Pylons>=1.0.1rc1", "SQLAlchemy==0.6.8", ], setup_requires=["PasteScript>=1.6.3"], packages=find_packages(exclude=['ez_setup']), include_package_data=True, test_suite='nose.collector', package_data={'porick': ['i18n/*/LC_MESSAGES/*.mo']}, #message_extractors={'porick': [ # ('**.py', 'python', None), # ('templates/**.mako', 'mako', {'input_encoding': 'utf-8'}), # ('public/**', 'ignore', None)]}, zip_safe=False, paster_plugins=['PasteScript', 'Pylons'], entry_points=""" [paste.app_factory] main = porick.config.middleware:make_app [paste.app_install] main = pylons.util:PylonsInstaller """, ) Use sqlalchemy 0.7.7 instead of 0.6
try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages setup( name='porick', version='0.1', description='', author='', author_email='', url='', install_requires=[ "Pylons>=1.0.1rc1", "SQLAlchemy==0.7.7", ], setup_requires=["PasteScript>=1.6.3"], packages=find_packages(exclude=['ez_setup']), include_package_data=True, test_suite='nose.collector', package_data={'porick': ['i18n/*/LC_MESSAGES/*.mo']}, #message_extractors={'porick': [ # ('**.py', 'python', None), # ('templates/**.mako', 'mako', {'input_encoding': 'utf-8'}), # ('public/**', 'ignore', None)]}, zip_safe=False, paster_plugins=['PasteScript', 'Pylons'], entry_points=""" [paste.app_factory] main = porick.config.middleware:make_app [paste.app_install] main = pylons.util:PylonsInstaller """, )
<commit_before>try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages setup( name='porick', version='0.1', description='', author='', author_email='', url='', install_requires=[ "Pylons>=1.0.1rc1", "SQLAlchemy==0.6.8", ], setup_requires=["PasteScript>=1.6.3"], packages=find_packages(exclude=['ez_setup']), include_package_data=True, test_suite='nose.collector', package_data={'porick': ['i18n/*/LC_MESSAGES/*.mo']}, #message_extractors={'porick': [ # ('**.py', 'python', None), # ('templates/**.mako', 'mako', {'input_encoding': 'utf-8'}), # ('public/**', 'ignore', None)]}, zip_safe=False, paster_plugins=['PasteScript', 'Pylons'], entry_points=""" [paste.app_factory] main = porick.config.middleware:make_app [paste.app_install] main = pylons.util:PylonsInstaller """, ) <commit_msg>Use sqlalchemy 0.7.7 instead of 0.6<commit_after>
try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages setup( name='porick', version='0.1', description='', author='', author_email='', url='', install_requires=[ "Pylons>=1.0.1rc1", "SQLAlchemy==0.7.7", ], setup_requires=["PasteScript>=1.6.3"], packages=find_packages(exclude=['ez_setup']), include_package_data=True, test_suite='nose.collector', package_data={'porick': ['i18n/*/LC_MESSAGES/*.mo']}, #message_extractors={'porick': [ # ('**.py', 'python', None), # ('templates/**.mako', 'mako', {'input_encoding': 'utf-8'}), # ('public/**', 'ignore', None)]}, zip_safe=False, paster_plugins=['PasteScript', 'Pylons'], entry_points=""" [paste.app_factory] main = porick.config.middleware:make_app [paste.app_install] main = pylons.util:PylonsInstaller """, )
try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages setup( name='porick', version='0.1', description='', author='', author_email='', url='', install_requires=[ "Pylons>=1.0.1rc1", "SQLAlchemy==0.6.8", ], setup_requires=["PasteScript>=1.6.3"], packages=find_packages(exclude=['ez_setup']), include_package_data=True, test_suite='nose.collector', package_data={'porick': ['i18n/*/LC_MESSAGES/*.mo']}, #message_extractors={'porick': [ # ('**.py', 'python', None), # ('templates/**.mako', 'mako', {'input_encoding': 'utf-8'}), # ('public/**', 'ignore', None)]}, zip_safe=False, paster_plugins=['PasteScript', 'Pylons'], entry_points=""" [paste.app_factory] main = porick.config.middleware:make_app [paste.app_install] main = pylons.util:PylonsInstaller """, ) Use sqlalchemy 0.7.7 instead of 0.6try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages setup( name='porick', version='0.1', description='', author='', author_email='', url='', install_requires=[ "Pylons>=1.0.1rc1", "SQLAlchemy==0.7.7", ], setup_requires=["PasteScript>=1.6.3"], packages=find_packages(exclude=['ez_setup']), include_package_data=True, test_suite='nose.collector', package_data={'porick': ['i18n/*/LC_MESSAGES/*.mo']}, #message_extractors={'porick': [ # ('**.py', 'python', None), # ('templates/**.mako', 'mako', {'input_encoding': 'utf-8'}), # ('public/**', 'ignore', None)]}, zip_safe=False, paster_plugins=['PasteScript', 'Pylons'], entry_points=""" [paste.app_factory] main = porick.config.middleware:make_app [paste.app_install] main = pylons.util:PylonsInstaller """, )
<commit_before>try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages setup( name='porick', version='0.1', description='', author='', author_email='', url='', install_requires=[ "Pylons>=1.0.1rc1", "SQLAlchemy==0.6.8", ], setup_requires=["PasteScript>=1.6.3"], packages=find_packages(exclude=['ez_setup']), include_package_data=True, test_suite='nose.collector', package_data={'porick': ['i18n/*/LC_MESSAGES/*.mo']}, #message_extractors={'porick': [ # ('**.py', 'python', None), # ('templates/**.mako', 'mako', {'input_encoding': 'utf-8'}), # ('public/**', 'ignore', None)]}, zip_safe=False, paster_plugins=['PasteScript', 'Pylons'], entry_points=""" [paste.app_factory] main = porick.config.middleware:make_app [paste.app_install] main = pylons.util:PylonsInstaller """, ) <commit_msg>Use sqlalchemy 0.7.7 instead of 0.6<commit_after>try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages setup( name='porick', version='0.1', description='', author='', author_email='', url='', install_requires=[ "Pylons>=1.0.1rc1", "SQLAlchemy==0.7.7", ], setup_requires=["PasteScript>=1.6.3"], packages=find_packages(exclude=['ez_setup']), include_package_data=True, test_suite='nose.collector', package_data={'porick': ['i18n/*/LC_MESSAGES/*.mo']}, #message_extractors={'porick': [ # ('**.py', 'python', None), # ('templates/**.mako', 'mako', {'input_encoding': 'utf-8'}), # ('public/**', 'ignore', None)]}, zip_safe=False, paster_plugins=['PasteScript', 'Pylons'], entry_points=""" [paste.app_factory] main = porick.config.middleware:make_app [paste.app_install] main = pylons.util:PylonsInstaller """, )
21082912755b95f539bd1c6359303917e4066554
setup.py
setup.py
#!/usr/bin/env python # Setuptools is a slightly nicer distribution utility that can create 'eggs'. from setuptools import setup, find_packages setup( name='django-cleaver', author='Kevin Williams', author_email='kevin@weblivion.com', version='0.1', license='BSD', url='https://github.com/isolationism/django-cleaver', download_url='https://github.com/isolationism/django-cleaver/tarball/master', description='Integrates CleverCSS with Django with built-in support for franchise customisations', packages=find_packages(), include_package_data = False, install_requires = ['django', 'clevercss'], )
#!/usr/bin/env python # Setuptools is a slightly nicer distribution utility that can create 'eggs'. from setuptools import setup, find_packages setup( name='django-cleaver', author='Kevin Williams', author_email='kevin@weblivion.com', version='0.1', license='BSD', url='https://github.com/isolationism/django-cleaver', download_url='https://github.com/isolationism/django-cleaver/tarball/master', description='Integrates CleverCSS with Django with built-in support for franchise customisations', packages=find_packages(), include_package_data = False, install_requires = ['django', 'clevercss>=0.3'], )
Move to require version 0.3 or better of CleverCSS
Move to require version 0.3 or better of CleverCSS
Python
bsd-3-clause
isolationism/django-cleaver
#!/usr/bin/env python # Setuptools is a slightly nicer distribution utility that can create 'eggs'. from setuptools import setup, find_packages setup( name='django-cleaver', author='Kevin Williams', author_email='kevin@weblivion.com', version='0.1', license='BSD', url='https://github.com/isolationism/django-cleaver', download_url='https://github.com/isolationism/django-cleaver/tarball/master', description='Integrates CleverCSS with Django with built-in support for franchise customisations', packages=find_packages(), include_package_data = False, install_requires = ['django', 'clevercss'], ) Move to require version 0.3 or better of CleverCSS
#!/usr/bin/env python # Setuptools is a slightly nicer distribution utility that can create 'eggs'. from setuptools import setup, find_packages setup( name='django-cleaver', author='Kevin Williams', author_email='kevin@weblivion.com', version='0.1', license='BSD', url='https://github.com/isolationism/django-cleaver', download_url='https://github.com/isolationism/django-cleaver/tarball/master', description='Integrates CleverCSS with Django with built-in support for franchise customisations', packages=find_packages(), include_package_data = False, install_requires = ['django', 'clevercss>=0.3'], )
<commit_before>#!/usr/bin/env python # Setuptools is a slightly nicer distribution utility that can create 'eggs'. from setuptools import setup, find_packages setup( name='django-cleaver', author='Kevin Williams', author_email='kevin@weblivion.com', version='0.1', license='BSD', url='https://github.com/isolationism/django-cleaver', download_url='https://github.com/isolationism/django-cleaver/tarball/master', description='Integrates CleverCSS with Django with built-in support for franchise customisations', packages=find_packages(), include_package_data = False, install_requires = ['django', 'clevercss'], ) <commit_msg>Move to require version 0.3 or better of CleverCSS<commit_after>
#!/usr/bin/env python # Setuptools is a slightly nicer distribution utility that can create 'eggs'. from setuptools import setup, find_packages setup( name='django-cleaver', author='Kevin Williams', author_email='kevin@weblivion.com', version='0.1', license='BSD', url='https://github.com/isolationism/django-cleaver', download_url='https://github.com/isolationism/django-cleaver/tarball/master', description='Integrates CleverCSS with Django with built-in support for franchise customisations', packages=find_packages(), include_package_data = False, install_requires = ['django', 'clevercss>=0.3'], )
#!/usr/bin/env python # Setuptools is a slightly nicer distribution utility that can create 'eggs'. from setuptools import setup, find_packages setup( name='django-cleaver', author='Kevin Williams', author_email='kevin@weblivion.com', version='0.1', license='BSD', url='https://github.com/isolationism/django-cleaver', download_url='https://github.com/isolationism/django-cleaver/tarball/master', description='Integrates CleverCSS with Django with built-in support for franchise customisations', packages=find_packages(), include_package_data = False, install_requires = ['django', 'clevercss'], ) Move to require version 0.3 or better of CleverCSS#!/usr/bin/env python # Setuptools is a slightly nicer distribution utility that can create 'eggs'. from setuptools import setup, find_packages setup( name='django-cleaver', author='Kevin Williams', author_email='kevin@weblivion.com', version='0.1', license='BSD', url='https://github.com/isolationism/django-cleaver', download_url='https://github.com/isolationism/django-cleaver/tarball/master', description='Integrates CleverCSS with Django with built-in support for franchise customisations', packages=find_packages(), include_package_data = False, install_requires = ['django', 'clevercss>=0.3'], )
<commit_before>#!/usr/bin/env python # Setuptools is a slightly nicer distribution utility that can create 'eggs'. from setuptools import setup, find_packages setup( name='django-cleaver', author='Kevin Williams', author_email='kevin@weblivion.com', version='0.1', license='BSD', url='https://github.com/isolationism/django-cleaver', download_url='https://github.com/isolationism/django-cleaver/tarball/master', description='Integrates CleverCSS with Django with built-in support for franchise customisations', packages=find_packages(), include_package_data = False, install_requires = ['django', 'clevercss'], ) <commit_msg>Move to require version 0.3 or better of CleverCSS<commit_after>#!/usr/bin/env python # Setuptools is a slightly nicer distribution utility that can create 'eggs'. from setuptools import setup, find_packages setup( name='django-cleaver', author='Kevin Williams', author_email='kevin@weblivion.com', version='0.1', license='BSD', url='https://github.com/isolationism/django-cleaver', download_url='https://github.com/isolationism/django-cleaver/tarball/master', description='Integrates CleverCSS with Django with built-in support for franchise customisations', packages=find_packages(), include_package_data = False, install_requires = ['django', 'clevercss>=0.3'], )
d36b5e36883306bbae80a034dc80543da54a08cd
setup.py
setup.py
import os from setuptools import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).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 = "UCLDC Deep Harvester", version = "0.0.3", description = ("deep harvester code for the UCLDC project"), long_description=read('README.md'), author='Barbara Hui', author_email='barbara.hui@ucop.edu', dependency_links=[ 'https://github.com/ucldc/pynux/archive/master.zip#egg=pynux', 'https://github.com/mredar/jsonpath/archive/master.zip#egg=jsonpath', 'https://github.com/barbarahui/ucldc-iiif/archive/master.zip#egg=ucldc-iiif' ], install_requires=[ 'argparse', 'boto', 'pynux', 'python-magic', 'couchdb', 'jsonpath', 'akara', 'ucldc-iiif' ], packages=['deepharvest', 's3stash'], test_suite='tests' ) ### note: dpla-ingestion code is a dependency ###pip_main(['install', ### 'git+ssh://git@bitbucket.org/mredar/dpla-ingestion.git@ucldc'])
import os from setuptools import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).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 = "UCLDC Deep Harvester", version = "0.0.3", description = ("deep harvester code for the UCLDC project"), long_description=read('README.md'), author='Barbara Hui', author_email='barbara.hui@ucop.edu', dependency_links=[ 'https://github.com/ucldc/pynux/archive/master.zip#egg=pynux', 'https://github.com/mredar/jsonpath/archive/master.zip#egg=jsonpath', 'https://github.com/mredar/ucldc-iiif/archive/master.zip#egg=ucldc-iiif' ], install_requires=[ 'argparse', 'boto', 'pynux', 'python-magic', 'couchdb', 'jsonpath', 'akara', 'ucldc-iiif' ], packages=['deepharvest', 's3stash'], test_suite='tests' ) ### note: dpla-ingestion code is a dependency ###pip_main(['install', ### 'git+ssh://git@bitbucket.org/mredar/dpla-ingestion.git@ucldc'])
Change to mredar repo of ucldc-iiif while working on this
Change to mredar repo of ucldc-iiif while working on this Needed to change ucldc-iiif to work with different paths, not yet merged to barbara's main repo
Python
bsd-3-clause
barbarahui/nuxeo-calisphere,barbarahui/nuxeo-calisphere
import os from setuptools import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).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 = "UCLDC Deep Harvester", version = "0.0.3", description = ("deep harvester code for the UCLDC project"), long_description=read('README.md'), author='Barbara Hui', author_email='barbara.hui@ucop.edu', dependency_links=[ 'https://github.com/ucldc/pynux/archive/master.zip#egg=pynux', 'https://github.com/mredar/jsonpath/archive/master.zip#egg=jsonpath', 'https://github.com/barbarahui/ucldc-iiif/archive/master.zip#egg=ucldc-iiif' ], install_requires=[ 'argparse', 'boto', 'pynux', 'python-magic', 'couchdb', 'jsonpath', 'akara', 'ucldc-iiif' ], packages=['deepharvest', 's3stash'], test_suite='tests' ) ### note: dpla-ingestion code is a dependency ###pip_main(['install', ### 'git+ssh://git@bitbucket.org/mredar/dpla-ingestion.git@ucldc']) Change to mredar repo of ucldc-iiif while working on this Needed to change ucldc-iiif to work with different paths, not yet merged to barbara's main repo
import os from setuptools import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).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 = "UCLDC Deep Harvester", version = "0.0.3", description = ("deep harvester code for the UCLDC project"), long_description=read('README.md'), author='Barbara Hui', author_email='barbara.hui@ucop.edu', dependency_links=[ 'https://github.com/ucldc/pynux/archive/master.zip#egg=pynux', 'https://github.com/mredar/jsonpath/archive/master.zip#egg=jsonpath', 'https://github.com/mredar/ucldc-iiif/archive/master.zip#egg=ucldc-iiif' ], install_requires=[ 'argparse', 'boto', 'pynux', 'python-magic', 'couchdb', 'jsonpath', 'akara', 'ucldc-iiif' ], packages=['deepharvest', 's3stash'], test_suite='tests' ) ### note: dpla-ingestion code is a dependency ###pip_main(['install', ### 'git+ssh://git@bitbucket.org/mredar/dpla-ingestion.git@ucldc'])
<commit_before>import os from setuptools import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).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 = "UCLDC Deep Harvester", version = "0.0.3", description = ("deep harvester code for the UCLDC project"), long_description=read('README.md'), author='Barbara Hui', author_email='barbara.hui@ucop.edu', dependency_links=[ 'https://github.com/ucldc/pynux/archive/master.zip#egg=pynux', 'https://github.com/mredar/jsonpath/archive/master.zip#egg=jsonpath', 'https://github.com/barbarahui/ucldc-iiif/archive/master.zip#egg=ucldc-iiif' ], install_requires=[ 'argparse', 'boto', 'pynux', 'python-magic', 'couchdb', 'jsonpath', 'akara', 'ucldc-iiif' ], packages=['deepharvest', 's3stash'], test_suite='tests' ) ### note: dpla-ingestion code is a dependency ###pip_main(['install', ### 'git+ssh://git@bitbucket.org/mredar/dpla-ingestion.git@ucldc']) <commit_msg>Change to mredar repo of ucldc-iiif while working on this Needed to change ucldc-iiif to work with different paths, not yet merged to barbara's main repo<commit_after>
import os from setuptools import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).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 = "UCLDC Deep Harvester", version = "0.0.3", description = ("deep harvester code for the UCLDC project"), long_description=read('README.md'), author='Barbara Hui', author_email='barbara.hui@ucop.edu', dependency_links=[ 'https://github.com/ucldc/pynux/archive/master.zip#egg=pynux', 'https://github.com/mredar/jsonpath/archive/master.zip#egg=jsonpath', 'https://github.com/mredar/ucldc-iiif/archive/master.zip#egg=ucldc-iiif' ], install_requires=[ 'argparse', 'boto', 'pynux', 'python-magic', 'couchdb', 'jsonpath', 'akara', 'ucldc-iiif' ], packages=['deepharvest', 's3stash'], test_suite='tests' ) ### note: dpla-ingestion code is a dependency ###pip_main(['install', ### 'git+ssh://git@bitbucket.org/mredar/dpla-ingestion.git@ucldc'])
import os from setuptools import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).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 = "UCLDC Deep Harvester", version = "0.0.3", description = ("deep harvester code for the UCLDC project"), long_description=read('README.md'), author='Barbara Hui', author_email='barbara.hui@ucop.edu', dependency_links=[ 'https://github.com/ucldc/pynux/archive/master.zip#egg=pynux', 'https://github.com/mredar/jsonpath/archive/master.zip#egg=jsonpath', 'https://github.com/barbarahui/ucldc-iiif/archive/master.zip#egg=ucldc-iiif' ], install_requires=[ 'argparse', 'boto', 'pynux', 'python-magic', 'couchdb', 'jsonpath', 'akara', 'ucldc-iiif' ], packages=['deepharvest', 's3stash'], test_suite='tests' ) ### note: dpla-ingestion code is a dependency ###pip_main(['install', ### 'git+ssh://git@bitbucket.org/mredar/dpla-ingestion.git@ucldc']) Change to mredar repo of ucldc-iiif while working on this Needed to change ucldc-iiif to work with different paths, not yet merged to barbara's main repoimport os from setuptools import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).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 = "UCLDC Deep Harvester", version = "0.0.3", description = ("deep harvester code for the UCLDC project"), long_description=read('README.md'), author='Barbara Hui', author_email='barbara.hui@ucop.edu', dependency_links=[ 'https://github.com/ucldc/pynux/archive/master.zip#egg=pynux', 'https://github.com/mredar/jsonpath/archive/master.zip#egg=jsonpath', 'https://github.com/mredar/ucldc-iiif/archive/master.zip#egg=ucldc-iiif' ], install_requires=[ 'argparse', 'boto', 'pynux', 'python-magic', 'couchdb', 'jsonpath', 'akara', 'ucldc-iiif' ], packages=['deepharvest', 's3stash'], test_suite='tests' ) ### note: dpla-ingestion code is a dependency ###pip_main(['install', ### 'git+ssh://git@bitbucket.org/mredar/dpla-ingestion.git@ucldc'])
<commit_before>import os from setuptools import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).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 = "UCLDC Deep Harvester", version = "0.0.3", description = ("deep harvester code for the UCLDC project"), long_description=read('README.md'), author='Barbara Hui', author_email='barbara.hui@ucop.edu', dependency_links=[ 'https://github.com/ucldc/pynux/archive/master.zip#egg=pynux', 'https://github.com/mredar/jsonpath/archive/master.zip#egg=jsonpath', 'https://github.com/barbarahui/ucldc-iiif/archive/master.zip#egg=ucldc-iiif' ], install_requires=[ 'argparse', 'boto', 'pynux', 'python-magic', 'couchdb', 'jsonpath', 'akara', 'ucldc-iiif' ], packages=['deepharvest', 's3stash'], test_suite='tests' ) ### note: dpla-ingestion code is a dependency ###pip_main(['install', ### 'git+ssh://git@bitbucket.org/mredar/dpla-ingestion.git@ucldc']) <commit_msg>Change to mredar repo of ucldc-iiif while working on this Needed to change ucldc-iiif to work with different paths, not yet merged to barbara's main repo<commit_after>import os from setuptools import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).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 = "UCLDC Deep Harvester", version = "0.0.3", description = ("deep harvester code for the UCLDC project"), long_description=read('README.md'), author='Barbara Hui', author_email='barbara.hui@ucop.edu', dependency_links=[ 'https://github.com/ucldc/pynux/archive/master.zip#egg=pynux', 'https://github.com/mredar/jsonpath/archive/master.zip#egg=jsonpath', 'https://github.com/mredar/ucldc-iiif/archive/master.zip#egg=ucldc-iiif' ], install_requires=[ 'argparse', 'boto', 'pynux', 'python-magic', 'couchdb', 'jsonpath', 'akara', 'ucldc-iiif' ], packages=['deepharvest', 's3stash'], test_suite='tests' ) ### note: dpla-ingestion code is a dependency ###pip_main(['install', ### 'git+ssh://git@bitbucket.org/mredar/dpla-ingestion.git@ucldc'])
eca6ee4e1f247c8262694e8ad722cc62d9edaf27
setup.py
setup.py
#!/usr/bin/env python # encoding: utf-8 try: from setuptools import setup except ImportError: from distutils.core import setup import re with open('nonstdlib/__init__.py') as file: version_pattern = re.compile("__version__ = '(.*)'") version = version_pattern.search(file.read()).group(1) with open('README.rst') as file: readme = file.read() setup( name='nonstdlib', version=version, author='Kale Kundert', author_email='kale@thekunderts.net', description='A collection of general-purpose utilities', long_description=readme, url='https://github.com/kalekundert/nonstdlib', packages=[ 'nonstdlib', ], include_package_data=True, install_requires=[ 'six', ], license='MIT', zip_safe=False, keywords=[ 'nonstdlib', ], classifiers=[ 'Development Status :: 2 - Pre-Alpha', '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.0', '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', 'Topic :: Software Development :: Libraries', ], )
#!/usr/bin/env python # encoding: utf-8 try: from setuptools import setup except ImportError: from distutils.core import setup import re with open('nonstdlib/__init__.py') as file: version_pattern = re.compile("__version__ = '(.*)'") version = version_pattern.search(file.read()).group(1) with open('README.rst') as file: readme = file.read() setup( name='nonstdlib', version=version, author='Kale Kundert', author_email='kale@thekunderts.net', description='A collection of general-purpose utilities', long_description=readme, url='https://github.com/kalekundert/nonstdlib', packages=[ 'nonstdlib', ], include_package_data=True, install_requires=[ 'six', ], license='MIT', zip_safe=False, keywords=[ 'nonstdlib', ], classifiers=[ 'Development Status :: 2 - Pre-Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Programming Language :: Python :: 3', 'Topic :: Software Development :: Libraries', ], )
Remove trove classifiers for python2.
Remove trove classifiers for python2.
Python
mit
KenKundert/nonstdlib,KenKundert/nonstdlib,kalekundert/nonstdlib,kalekundert/nonstdlib
#!/usr/bin/env python # encoding: utf-8 try: from setuptools import setup except ImportError: from distutils.core import setup import re with open('nonstdlib/__init__.py') as file: version_pattern = re.compile("__version__ = '(.*)'") version = version_pattern.search(file.read()).group(1) with open('README.rst') as file: readme = file.read() setup( name='nonstdlib', version=version, author='Kale Kundert', author_email='kale@thekunderts.net', description='A collection of general-purpose utilities', long_description=readme, url='https://github.com/kalekundert/nonstdlib', packages=[ 'nonstdlib', ], include_package_data=True, install_requires=[ 'six', ], license='MIT', zip_safe=False, keywords=[ 'nonstdlib', ], classifiers=[ 'Development Status :: 2 - Pre-Alpha', '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.0', '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', 'Topic :: Software Development :: Libraries', ], ) Remove trove classifiers for python2.
#!/usr/bin/env python # encoding: utf-8 try: from setuptools import setup except ImportError: from distutils.core import setup import re with open('nonstdlib/__init__.py') as file: version_pattern = re.compile("__version__ = '(.*)'") version = version_pattern.search(file.read()).group(1) with open('README.rst') as file: readme = file.read() setup( name='nonstdlib', version=version, author='Kale Kundert', author_email='kale@thekunderts.net', description='A collection of general-purpose utilities', long_description=readme, url='https://github.com/kalekundert/nonstdlib', packages=[ 'nonstdlib', ], include_package_data=True, install_requires=[ 'six', ], license='MIT', zip_safe=False, keywords=[ 'nonstdlib', ], classifiers=[ 'Development Status :: 2 - Pre-Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Programming Language :: Python :: 3', 'Topic :: Software Development :: Libraries', ], )
<commit_before>#!/usr/bin/env python # encoding: utf-8 try: from setuptools import setup except ImportError: from distutils.core import setup import re with open('nonstdlib/__init__.py') as file: version_pattern = re.compile("__version__ = '(.*)'") version = version_pattern.search(file.read()).group(1) with open('README.rst') as file: readme = file.read() setup( name='nonstdlib', version=version, author='Kale Kundert', author_email='kale@thekunderts.net', description='A collection of general-purpose utilities', long_description=readme, url='https://github.com/kalekundert/nonstdlib', packages=[ 'nonstdlib', ], include_package_data=True, install_requires=[ 'six', ], license='MIT', zip_safe=False, keywords=[ 'nonstdlib', ], classifiers=[ 'Development Status :: 2 - Pre-Alpha', '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.0', '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', 'Topic :: Software Development :: Libraries', ], ) <commit_msg>Remove trove classifiers for python2.<commit_after>
#!/usr/bin/env python # encoding: utf-8 try: from setuptools import setup except ImportError: from distutils.core import setup import re with open('nonstdlib/__init__.py') as file: version_pattern = re.compile("__version__ = '(.*)'") version = version_pattern.search(file.read()).group(1) with open('README.rst') as file: readme = file.read() setup( name='nonstdlib', version=version, author='Kale Kundert', author_email='kale@thekunderts.net', description='A collection of general-purpose utilities', long_description=readme, url='https://github.com/kalekundert/nonstdlib', packages=[ 'nonstdlib', ], include_package_data=True, install_requires=[ 'six', ], license='MIT', zip_safe=False, keywords=[ 'nonstdlib', ], classifiers=[ 'Development Status :: 2 - Pre-Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Programming Language :: Python :: 3', 'Topic :: Software Development :: Libraries', ], )
#!/usr/bin/env python # encoding: utf-8 try: from setuptools import setup except ImportError: from distutils.core import setup import re with open('nonstdlib/__init__.py') as file: version_pattern = re.compile("__version__ = '(.*)'") version = version_pattern.search(file.read()).group(1) with open('README.rst') as file: readme = file.read() setup( name='nonstdlib', version=version, author='Kale Kundert', author_email='kale@thekunderts.net', description='A collection of general-purpose utilities', long_description=readme, url='https://github.com/kalekundert/nonstdlib', packages=[ 'nonstdlib', ], include_package_data=True, install_requires=[ 'six', ], license='MIT', zip_safe=False, keywords=[ 'nonstdlib', ], classifiers=[ 'Development Status :: 2 - Pre-Alpha', '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.0', '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', 'Topic :: Software Development :: Libraries', ], ) Remove trove classifiers for python2.#!/usr/bin/env python # encoding: utf-8 try: from setuptools import setup except ImportError: from distutils.core import setup import re with open('nonstdlib/__init__.py') as file: version_pattern = re.compile("__version__ = '(.*)'") version = version_pattern.search(file.read()).group(1) with open('README.rst') as file: readme = file.read() setup( name='nonstdlib', version=version, author='Kale Kundert', author_email='kale@thekunderts.net', description='A collection of general-purpose utilities', long_description=readme, url='https://github.com/kalekundert/nonstdlib', packages=[ 'nonstdlib', ], include_package_data=True, install_requires=[ 'six', ], license='MIT', zip_safe=False, keywords=[ 'nonstdlib', ], classifiers=[ 'Development Status :: 2 - Pre-Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Programming Language :: Python :: 3', 'Topic :: Software Development :: Libraries', ], )
<commit_before>#!/usr/bin/env python # encoding: utf-8 try: from setuptools import setup except ImportError: from distutils.core import setup import re with open('nonstdlib/__init__.py') as file: version_pattern = re.compile("__version__ = '(.*)'") version = version_pattern.search(file.read()).group(1) with open('README.rst') as file: readme = file.read() setup( name='nonstdlib', version=version, author='Kale Kundert', author_email='kale@thekunderts.net', description='A collection of general-purpose utilities', long_description=readme, url='https://github.com/kalekundert/nonstdlib', packages=[ 'nonstdlib', ], include_package_data=True, install_requires=[ 'six', ], license='MIT', zip_safe=False, keywords=[ 'nonstdlib', ], classifiers=[ 'Development Status :: 2 - Pre-Alpha', '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.0', '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', 'Topic :: Software Development :: Libraries', ], ) <commit_msg>Remove trove classifiers for python2.<commit_after>#!/usr/bin/env python # encoding: utf-8 try: from setuptools import setup except ImportError: from distutils.core import setup import re with open('nonstdlib/__init__.py') as file: version_pattern = re.compile("__version__ = '(.*)'") version = version_pattern.search(file.read()).group(1) with open('README.rst') as file: readme = file.read() setup( name='nonstdlib', version=version, author='Kale Kundert', author_email='kale@thekunderts.net', description='A collection of general-purpose utilities', long_description=readme, url='https://github.com/kalekundert/nonstdlib', packages=[ 'nonstdlib', ], include_package_data=True, install_requires=[ 'six', ], license='MIT', zip_safe=False, keywords=[ 'nonstdlib', ], classifiers=[ 'Development Status :: 2 - Pre-Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Programming Language :: Python :: 3', 'Topic :: Software Development :: Libraries', ], )
ca953b2ef7662e4a70eba386e66ed6d66fad4eec
setup.py
setup.py
#!/usr/bin/env python # encoding: utf-8 """ setup.py Setup the Keyring Lib for Python. """ import sys from distutils.core import setup, Extension from extensions import get_extensions setup(name = 'keyring', version = "0.1", description = "Store and access your passwords safely.", url = "http://keyring-python.org/", keywords = "keyring Keychain GnomeKeyring Kwallet password storage", maintainer = "Kang Zhang", maintainer_email = "jobo.zh@gmail.com", license="PSF", long_description = open('README.txt').read(), platforms = ["Many"], packages = ['keyring'], ext_modules = get_extensions() )
#!/usr/bin/env python # encoding: utf-8 """ setup.py Setup the Keyring Lib for Python. """ import sys from distutils.core import setup, Extension from extensions import get_extensions setup(name = 'keyring', version = "0.1", description = "Store and access your passwords safely.", url = "http://home.python-keyring.org/", keywords = "keyring Keychain GnomeKeyring Kwallet password storage", maintainer = "Kang Zhang", maintainer_email = "jobo.zh@gmail.com", license="PSF", long_description = open('README.txt').read(), platforms = ["Many"], packages = ['keyring'], ext_modules = get_extensions() )
Fix the error in the home page URL.
Fix the error in the home page URL.
Python
mit
jaraco/keyring
#!/usr/bin/env python # encoding: utf-8 """ setup.py Setup the Keyring Lib for Python. """ import sys from distutils.core import setup, Extension from extensions import get_extensions setup(name = 'keyring', version = "0.1", description = "Store and access your passwords safely.", url = "http://keyring-python.org/", keywords = "keyring Keychain GnomeKeyring Kwallet password storage", maintainer = "Kang Zhang", maintainer_email = "jobo.zh@gmail.com", license="PSF", long_description = open('README.txt').read(), platforms = ["Many"], packages = ['keyring'], ext_modules = get_extensions() ) Fix the error in the home page URL.
#!/usr/bin/env python # encoding: utf-8 """ setup.py Setup the Keyring Lib for Python. """ import sys from distutils.core import setup, Extension from extensions import get_extensions setup(name = 'keyring', version = "0.1", description = "Store and access your passwords safely.", url = "http://home.python-keyring.org/", keywords = "keyring Keychain GnomeKeyring Kwallet password storage", maintainer = "Kang Zhang", maintainer_email = "jobo.zh@gmail.com", license="PSF", long_description = open('README.txt').read(), platforms = ["Many"], packages = ['keyring'], ext_modules = get_extensions() )
<commit_before>#!/usr/bin/env python # encoding: utf-8 """ setup.py Setup the Keyring Lib for Python. """ import sys from distutils.core import setup, Extension from extensions import get_extensions setup(name = 'keyring', version = "0.1", description = "Store and access your passwords safely.", url = "http://keyring-python.org/", keywords = "keyring Keychain GnomeKeyring Kwallet password storage", maintainer = "Kang Zhang", maintainer_email = "jobo.zh@gmail.com", license="PSF", long_description = open('README.txt').read(), platforms = ["Many"], packages = ['keyring'], ext_modules = get_extensions() ) <commit_msg>Fix the error in the home page URL.<commit_after>
#!/usr/bin/env python # encoding: utf-8 """ setup.py Setup the Keyring Lib for Python. """ import sys from distutils.core import setup, Extension from extensions import get_extensions setup(name = 'keyring', version = "0.1", description = "Store and access your passwords safely.", url = "http://home.python-keyring.org/", keywords = "keyring Keychain GnomeKeyring Kwallet password storage", maintainer = "Kang Zhang", maintainer_email = "jobo.zh@gmail.com", license="PSF", long_description = open('README.txt').read(), platforms = ["Many"], packages = ['keyring'], ext_modules = get_extensions() )
#!/usr/bin/env python # encoding: utf-8 """ setup.py Setup the Keyring Lib for Python. """ import sys from distutils.core import setup, Extension from extensions import get_extensions setup(name = 'keyring', version = "0.1", description = "Store and access your passwords safely.", url = "http://keyring-python.org/", keywords = "keyring Keychain GnomeKeyring Kwallet password storage", maintainer = "Kang Zhang", maintainer_email = "jobo.zh@gmail.com", license="PSF", long_description = open('README.txt').read(), platforms = ["Many"], packages = ['keyring'], ext_modules = get_extensions() ) Fix the error in the home page URL.#!/usr/bin/env python # encoding: utf-8 """ setup.py Setup the Keyring Lib for Python. """ import sys from distutils.core import setup, Extension from extensions import get_extensions setup(name = 'keyring', version = "0.1", description = "Store and access your passwords safely.", url = "http://home.python-keyring.org/", keywords = "keyring Keychain GnomeKeyring Kwallet password storage", maintainer = "Kang Zhang", maintainer_email = "jobo.zh@gmail.com", license="PSF", long_description = open('README.txt').read(), platforms = ["Many"], packages = ['keyring'], ext_modules = get_extensions() )
<commit_before>#!/usr/bin/env python # encoding: utf-8 """ setup.py Setup the Keyring Lib for Python. """ import sys from distutils.core import setup, Extension from extensions import get_extensions setup(name = 'keyring', version = "0.1", description = "Store and access your passwords safely.", url = "http://keyring-python.org/", keywords = "keyring Keychain GnomeKeyring Kwallet password storage", maintainer = "Kang Zhang", maintainer_email = "jobo.zh@gmail.com", license="PSF", long_description = open('README.txt').read(), platforms = ["Many"], packages = ['keyring'], ext_modules = get_extensions() ) <commit_msg>Fix the error in the home page URL.<commit_after>#!/usr/bin/env python # encoding: utf-8 """ setup.py Setup the Keyring Lib for Python. """ import sys from distutils.core import setup, Extension from extensions import get_extensions setup(name = 'keyring', version = "0.1", description = "Store and access your passwords safely.", url = "http://home.python-keyring.org/", keywords = "keyring Keychain GnomeKeyring Kwallet password storage", maintainer = "Kang Zhang", maintainer_email = "jobo.zh@gmail.com", license="PSF", long_description = open('README.txt').read(), platforms = ["Many"], packages = ['keyring'], ext_modules = get_extensions() )
5152d92ee9475533d4d79b8555ed3d9789376957
setup.py
setup.py
from setuptools import setup, find_packages setup( name = "pyRFC3339", version = "0.1", author = "Kurt Raschke", author_email = "kurt@kurtraschke.com", description = "Generate and parse RFC 3339 timestamps", keywords = "rfc 3339 timestamp", license = "MIT", classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Topic :: Internet" ], packages = find_packages(), install_requires = ['pytz'], test_suite = 'nose.collector', tests_require = ['nose'] )
from setuptools import setup, find_packages setup( name = "pyRFC3339", version = "0.2", author = "Kurt Raschke", author_email = "kurt@kurtraschke.com", description = "Generate and parse RFC 3339 timestamps", keywords = "rfc 3339 timestamp", license = "MIT", classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Topic :: Internet" ], packages = find_packages(), install_requires = ['pytz'], test_suite = 'nose.collector', tests_require = ['nose'] )
Bump version for new release with Python 3 compatibility.
Bump version for new release with Python 3 compatibility.
Python
mit
kurtraschke/pyRFC3339
from setuptools import setup, find_packages setup( name = "pyRFC3339", version = "0.1", author = "Kurt Raschke", author_email = "kurt@kurtraschke.com", description = "Generate and parse RFC 3339 timestamps", keywords = "rfc 3339 timestamp", license = "MIT", classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Topic :: Internet" ], packages = find_packages(), install_requires = ['pytz'], test_suite = 'nose.collector', tests_require = ['nose'] ) Bump version for new release with Python 3 compatibility.
from setuptools import setup, find_packages setup( name = "pyRFC3339", version = "0.2", author = "Kurt Raschke", author_email = "kurt@kurtraschke.com", description = "Generate and parse RFC 3339 timestamps", keywords = "rfc 3339 timestamp", license = "MIT", classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Topic :: Internet" ], packages = find_packages(), install_requires = ['pytz'], test_suite = 'nose.collector', tests_require = ['nose'] )
<commit_before>from setuptools import setup, find_packages setup( name = "pyRFC3339", version = "0.1", author = "Kurt Raschke", author_email = "kurt@kurtraschke.com", description = "Generate and parse RFC 3339 timestamps", keywords = "rfc 3339 timestamp", license = "MIT", classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Topic :: Internet" ], packages = find_packages(), install_requires = ['pytz'], test_suite = 'nose.collector', tests_require = ['nose'] ) <commit_msg>Bump version for new release with Python 3 compatibility.<commit_after>
from setuptools import setup, find_packages setup( name = "pyRFC3339", version = "0.2", author = "Kurt Raschke", author_email = "kurt@kurtraschke.com", description = "Generate and parse RFC 3339 timestamps", keywords = "rfc 3339 timestamp", license = "MIT", classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Topic :: Internet" ], packages = find_packages(), install_requires = ['pytz'], test_suite = 'nose.collector', tests_require = ['nose'] )
from setuptools import setup, find_packages setup( name = "pyRFC3339", version = "0.1", author = "Kurt Raschke", author_email = "kurt@kurtraschke.com", description = "Generate and parse RFC 3339 timestamps", keywords = "rfc 3339 timestamp", license = "MIT", classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Topic :: Internet" ], packages = find_packages(), install_requires = ['pytz'], test_suite = 'nose.collector', tests_require = ['nose'] ) Bump version for new release with Python 3 compatibility.from setuptools import setup, find_packages setup( name = "pyRFC3339", version = "0.2", author = "Kurt Raschke", author_email = "kurt@kurtraschke.com", description = "Generate and parse RFC 3339 timestamps", keywords = "rfc 3339 timestamp", license = "MIT", classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Topic :: Internet" ], packages = find_packages(), install_requires = ['pytz'], test_suite = 'nose.collector', tests_require = ['nose'] )
<commit_before>from setuptools import setup, find_packages setup( name = "pyRFC3339", version = "0.1", author = "Kurt Raschke", author_email = "kurt@kurtraschke.com", description = "Generate and parse RFC 3339 timestamps", keywords = "rfc 3339 timestamp", license = "MIT", classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Topic :: Internet" ], packages = find_packages(), install_requires = ['pytz'], test_suite = 'nose.collector', tests_require = ['nose'] ) <commit_msg>Bump version for new release with Python 3 compatibility.<commit_after>from setuptools import setup, find_packages setup( name = "pyRFC3339", version = "0.2", author = "Kurt Raschke", author_email = "kurt@kurtraschke.com", description = "Generate and parse RFC 3339 timestamps", keywords = "rfc 3339 timestamp", license = "MIT", classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Topic :: Internet" ], packages = find_packages(), install_requires = ['pytz'], test_suite = 'nose.collector', tests_require = ['nose'] )
36605a7906ac3cd7d9d8fee1f1dc92ca272e16f3
setup.py
setup.py
from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'DESCRIPTION.rst'), encoding='utf-8') as f: long_description = f.read() setup( name='octohat', version='0.1.32', description='Non-code contribution groker for GitHub', long_description=long_description, url='https://github.com/glasnt/octohat', author='Katie McLaughlin', author_email='katie@glasnt.com', license='MIT', classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 2.7', #'Programming Language :: Python :: 3', ], keywords='octohat github contributions non-code', install_requires=['requests'], entry_points={ 'console_scripts': [ "octohat = octohat:main" ] }, packages=find_packages() )
from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'DESCRIPTION.rst'), encoding='utf-8') as f: long_description = f.read() setup( name='octohat', version='0.0.1', description='Non-code contribution groker for GitHub', long_description=long_description, url='https://github.com/glasnt/octohat', author='Katie McLaughlin', author_email='katie@glasnt.com', license='MIT', classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 2.7', #'Programming Language :: Python :: 3', ], keywords='octohat github contributions non-code', install_requires=['requests'], entry_points={ 'console_scripts': [ "octohat = octohat:main" ] }, packages=find_packages() )
Revert to pypi production version tracking
Revert to pypi production version tracking
Python
bsd-3-clause
glasnt/octohat,LABHR/octohatrack
from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'DESCRIPTION.rst'), encoding='utf-8') as f: long_description = f.read() setup( name='octohat', version='0.1.32', description='Non-code contribution groker for GitHub', long_description=long_description, url='https://github.com/glasnt/octohat', author='Katie McLaughlin', author_email='katie@glasnt.com', license='MIT', classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 2.7', #'Programming Language :: Python :: 3', ], keywords='octohat github contributions non-code', install_requires=['requests'], entry_points={ 'console_scripts': [ "octohat = octohat:main" ] }, packages=find_packages() ) Revert to pypi production version tracking
from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'DESCRIPTION.rst'), encoding='utf-8') as f: long_description = f.read() setup( name='octohat', version='0.0.1', description='Non-code contribution groker for GitHub', long_description=long_description, url='https://github.com/glasnt/octohat', author='Katie McLaughlin', author_email='katie@glasnt.com', license='MIT', classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 2.7', #'Programming Language :: Python :: 3', ], keywords='octohat github contributions non-code', install_requires=['requests'], entry_points={ 'console_scripts': [ "octohat = octohat:main" ] }, packages=find_packages() )
<commit_before>from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'DESCRIPTION.rst'), encoding='utf-8') as f: long_description = f.read() setup( name='octohat', version='0.1.32', description='Non-code contribution groker for GitHub', long_description=long_description, url='https://github.com/glasnt/octohat', author='Katie McLaughlin', author_email='katie@glasnt.com', license='MIT', classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 2.7', #'Programming Language :: Python :: 3', ], keywords='octohat github contributions non-code', install_requires=['requests'], entry_points={ 'console_scripts': [ "octohat = octohat:main" ] }, packages=find_packages() ) <commit_msg>Revert to pypi production version tracking<commit_after>
from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'DESCRIPTION.rst'), encoding='utf-8') as f: long_description = f.read() setup( name='octohat', version='0.0.1', description='Non-code contribution groker for GitHub', long_description=long_description, url='https://github.com/glasnt/octohat', author='Katie McLaughlin', author_email='katie@glasnt.com', license='MIT', classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 2.7', #'Programming Language :: Python :: 3', ], keywords='octohat github contributions non-code', install_requires=['requests'], entry_points={ 'console_scripts': [ "octohat = octohat:main" ] }, packages=find_packages() )
from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'DESCRIPTION.rst'), encoding='utf-8') as f: long_description = f.read() setup( name='octohat', version='0.1.32', description='Non-code contribution groker for GitHub', long_description=long_description, url='https://github.com/glasnt/octohat', author='Katie McLaughlin', author_email='katie@glasnt.com', license='MIT', classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 2.7', #'Programming Language :: Python :: 3', ], keywords='octohat github contributions non-code', install_requires=['requests'], entry_points={ 'console_scripts': [ "octohat = octohat:main" ] }, packages=find_packages() ) Revert to pypi production version trackingfrom setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'DESCRIPTION.rst'), encoding='utf-8') as f: long_description = f.read() setup( name='octohat', version='0.0.1', description='Non-code contribution groker for GitHub', long_description=long_description, url='https://github.com/glasnt/octohat', author='Katie McLaughlin', author_email='katie@glasnt.com', license='MIT', classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 2.7', #'Programming Language :: Python :: 3', ], keywords='octohat github contributions non-code', install_requires=['requests'], entry_points={ 'console_scripts': [ "octohat = octohat:main" ] }, packages=find_packages() )
<commit_before>from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'DESCRIPTION.rst'), encoding='utf-8') as f: long_description = f.read() setup( name='octohat', version='0.1.32', description='Non-code contribution groker for GitHub', long_description=long_description, url='https://github.com/glasnt/octohat', author='Katie McLaughlin', author_email='katie@glasnt.com', license='MIT', classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 2.7', #'Programming Language :: Python :: 3', ], keywords='octohat github contributions non-code', install_requires=['requests'], entry_points={ 'console_scripts': [ "octohat = octohat:main" ] }, packages=find_packages() ) <commit_msg>Revert to pypi production version tracking<commit_after>from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'DESCRIPTION.rst'), encoding='utf-8') as f: long_description = f.read() setup( name='octohat', version='0.0.1', description='Non-code contribution groker for GitHub', long_description=long_description, url='https://github.com/glasnt/octohat', author='Katie McLaughlin', author_email='katie@glasnt.com', license='MIT', classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 2.7', #'Programming Language :: Python :: 3', ], keywords='octohat github contributions non-code', install_requires=['requests'], entry_points={ 'console_scripts': [ "octohat = octohat:main" ] }, packages=find_packages() )
60ecda35d0a529842b30315594a605e296b119df
setup.py
setup.py
import os from setuptools import setup setup( name = "augur", version = "0.1.0", author = "nextstrain developers", author_email = "trevor@bedford.io, richard.neher@unibas.ch", description = ("Pipelines for real-time phylogenetic analysis"), license = "MIT", keywords = "nextstrain, molecular epidemiology", url = "https://github.com/nextstrain/augur", packages=['augur'], install_requires = [ "biopython >=1.69, ==1.*", "boto >=2.38, ==2.*", "cvxopt >=1.1.8, ==1.1.*", "ipdb >=0.10.1, ==0.10.*", "matplotlib >=2.0, ==2.*", "pandas >=0.16.2, <0.18.0", "pytest >=3.2.1, ==3.*", "seaborn >=0.6.0, ==0.6.*", "tox >=2.8.2, ==2.*", "treetime ==0.3.0" ], dependency_links = [ "https://api.github.com/repos/neherlab/treetime/tarball/py3#egg=treetime-0.3.0" ], classifiers=[ "Development Status :: 3 - Alpha", "Topic :: Science", "License :: OSI Approved :: MIT License", ], scripts=['bin/augur'] )
import os from setuptools import setup setup( name = "augur", version = "0.1.0", author = "nextstrain developers", author_email = "trevor@bedford.io, richard.neher@unibas.ch", description = ("Pipelines for real-time phylogenetic analysis"), license = "MIT", keywords = "nextstrain, molecular epidemiology", url = "https://github.com/nextstrain/augur", packages=['augur'], install_requires = [ "biopython >=1.69, ==1.*", "boto >=2.38, ==2.*", "cvxopt >=1.1.8, ==1.1.*", "ipdb >=0.10.1, ==0.10.*", "matplotlib >=2.0, ==2.*", "pandas >=0.16.2, <0.18.0", "pytest >=3.2.1, ==3.*", "seaborn >=0.6.0, ==0.6.*", "tox >=2.8.2, ==2.*", "treetime ==0.4.0" ], dependency_links = [ "https://api.github.com/repos/neherlab/treetime/tarball/py3#egg=treetime-0.4.0" ], classifiers=[ "Development Status :: 3 - Alpha", "Topic :: Science", "License :: OSI Approved :: MIT License", ], scripts=['bin/augur'] )
Bump modular augur's TreeTime version requirement to match remote
Bump modular augur's TreeTime version requirement to match remote Now distinguished from the Python 2 version of TreeTime.
Python
agpl-3.0
blab/nextstrain-augur,nextstrain/augur,nextstrain/augur,nextstrain/augur
import os from setuptools import setup setup( name = "augur", version = "0.1.0", author = "nextstrain developers", author_email = "trevor@bedford.io, richard.neher@unibas.ch", description = ("Pipelines for real-time phylogenetic analysis"), license = "MIT", keywords = "nextstrain, molecular epidemiology", url = "https://github.com/nextstrain/augur", packages=['augur'], install_requires = [ "biopython >=1.69, ==1.*", "boto >=2.38, ==2.*", "cvxopt >=1.1.8, ==1.1.*", "ipdb >=0.10.1, ==0.10.*", "matplotlib >=2.0, ==2.*", "pandas >=0.16.2, <0.18.0", "pytest >=3.2.1, ==3.*", "seaborn >=0.6.0, ==0.6.*", "tox >=2.8.2, ==2.*", "treetime ==0.3.0" ], dependency_links = [ "https://api.github.com/repos/neherlab/treetime/tarball/py3#egg=treetime-0.3.0" ], classifiers=[ "Development Status :: 3 - Alpha", "Topic :: Science", "License :: OSI Approved :: MIT License", ], scripts=['bin/augur'] ) Bump modular augur's TreeTime version requirement to match remote Now distinguished from the Python 2 version of TreeTime.
import os from setuptools import setup setup( name = "augur", version = "0.1.0", author = "nextstrain developers", author_email = "trevor@bedford.io, richard.neher@unibas.ch", description = ("Pipelines for real-time phylogenetic analysis"), license = "MIT", keywords = "nextstrain, molecular epidemiology", url = "https://github.com/nextstrain/augur", packages=['augur'], install_requires = [ "biopython >=1.69, ==1.*", "boto >=2.38, ==2.*", "cvxopt >=1.1.8, ==1.1.*", "ipdb >=0.10.1, ==0.10.*", "matplotlib >=2.0, ==2.*", "pandas >=0.16.2, <0.18.0", "pytest >=3.2.1, ==3.*", "seaborn >=0.6.0, ==0.6.*", "tox >=2.8.2, ==2.*", "treetime ==0.4.0" ], dependency_links = [ "https://api.github.com/repos/neherlab/treetime/tarball/py3#egg=treetime-0.4.0" ], classifiers=[ "Development Status :: 3 - Alpha", "Topic :: Science", "License :: OSI Approved :: MIT License", ], scripts=['bin/augur'] )
<commit_before>import os from setuptools import setup setup( name = "augur", version = "0.1.0", author = "nextstrain developers", author_email = "trevor@bedford.io, richard.neher@unibas.ch", description = ("Pipelines for real-time phylogenetic analysis"), license = "MIT", keywords = "nextstrain, molecular epidemiology", url = "https://github.com/nextstrain/augur", packages=['augur'], install_requires = [ "biopython >=1.69, ==1.*", "boto >=2.38, ==2.*", "cvxopt >=1.1.8, ==1.1.*", "ipdb >=0.10.1, ==0.10.*", "matplotlib >=2.0, ==2.*", "pandas >=0.16.2, <0.18.0", "pytest >=3.2.1, ==3.*", "seaborn >=0.6.0, ==0.6.*", "tox >=2.8.2, ==2.*", "treetime ==0.3.0" ], dependency_links = [ "https://api.github.com/repos/neherlab/treetime/tarball/py3#egg=treetime-0.3.0" ], classifiers=[ "Development Status :: 3 - Alpha", "Topic :: Science", "License :: OSI Approved :: MIT License", ], scripts=['bin/augur'] ) <commit_msg>Bump modular augur's TreeTime version requirement to match remote Now distinguished from the Python 2 version of TreeTime.<commit_after>
import os from setuptools import setup setup( name = "augur", version = "0.1.0", author = "nextstrain developers", author_email = "trevor@bedford.io, richard.neher@unibas.ch", description = ("Pipelines for real-time phylogenetic analysis"), license = "MIT", keywords = "nextstrain, molecular epidemiology", url = "https://github.com/nextstrain/augur", packages=['augur'], install_requires = [ "biopython >=1.69, ==1.*", "boto >=2.38, ==2.*", "cvxopt >=1.1.8, ==1.1.*", "ipdb >=0.10.1, ==0.10.*", "matplotlib >=2.0, ==2.*", "pandas >=0.16.2, <0.18.0", "pytest >=3.2.1, ==3.*", "seaborn >=0.6.0, ==0.6.*", "tox >=2.8.2, ==2.*", "treetime ==0.4.0" ], dependency_links = [ "https://api.github.com/repos/neherlab/treetime/tarball/py3#egg=treetime-0.4.0" ], classifiers=[ "Development Status :: 3 - Alpha", "Topic :: Science", "License :: OSI Approved :: MIT License", ], scripts=['bin/augur'] )
import os from setuptools import setup setup( name = "augur", version = "0.1.0", author = "nextstrain developers", author_email = "trevor@bedford.io, richard.neher@unibas.ch", description = ("Pipelines for real-time phylogenetic analysis"), license = "MIT", keywords = "nextstrain, molecular epidemiology", url = "https://github.com/nextstrain/augur", packages=['augur'], install_requires = [ "biopython >=1.69, ==1.*", "boto >=2.38, ==2.*", "cvxopt >=1.1.8, ==1.1.*", "ipdb >=0.10.1, ==0.10.*", "matplotlib >=2.0, ==2.*", "pandas >=0.16.2, <0.18.0", "pytest >=3.2.1, ==3.*", "seaborn >=0.6.0, ==0.6.*", "tox >=2.8.2, ==2.*", "treetime ==0.3.0" ], dependency_links = [ "https://api.github.com/repos/neherlab/treetime/tarball/py3#egg=treetime-0.3.0" ], classifiers=[ "Development Status :: 3 - Alpha", "Topic :: Science", "License :: OSI Approved :: MIT License", ], scripts=['bin/augur'] ) Bump modular augur's TreeTime version requirement to match remote Now distinguished from the Python 2 version of TreeTime.import os from setuptools import setup setup( name = "augur", version = "0.1.0", author = "nextstrain developers", author_email = "trevor@bedford.io, richard.neher@unibas.ch", description = ("Pipelines for real-time phylogenetic analysis"), license = "MIT", keywords = "nextstrain, molecular epidemiology", url = "https://github.com/nextstrain/augur", packages=['augur'], install_requires = [ "biopython >=1.69, ==1.*", "boto >=2.38, ==2.*", "cvxopt >=1.1.8, ==1.1.*", "ipdb >=0.10.1, ==0.10.*", "matplotlib >=2.0, ==2.*", "pandas >=0.16.2, <0.18.0", "pytest >=3.2.1, ==3.*", "seaborn >=0.6.0, ==0.6.*", "tox >=2.8.2, ==2.*", "treetime ==0.4.0" ], dependency_links = [ "https://api.github.com/repos/neherlab/treetime/tarball/py3#egg=treetime-0.4.0" ], classifiers=[ "Development Status :: 3 - Alpha", "Topic :: Science", "License :: OSI Approved :: MIT License", ], scripts=['bin/augur'] )
<commit_before>import os from setuptools import setup setup( name = "augur", version = "0.1.0", author = "nextstrain developers", author_email = "trevor@bedford.io, richard.neher@unibas.ch", description = ("Pipelines for real-time phylogenetic analysis"), license = "MIT", keywords = "nextstrain, molecular epidemiology", url = "https://github.com/nextstrain/augur", packages=['augur'], install_requires = [ "biopython >=1.69, ==1.*", "boto >=2.38, ==2.*", "cvxopt >=1.1.8, ==1.1.*", "ipdb >=0.10.1, ==0.10.*", "matplotlib >=2.0, ==2.*", "pandas >=0.16.2, <0.18.0", "pytest >=3.2.1, ==3.*", "seaborn >=0.6.0, ==0.6.*", "tox >=2.8.2, ==2.*", "treetime ==0.3.0" ], dependency_links = [ "https://api.github.com/repos/neherlab/treetime/tarball/py3#egg=treetime-0.3.0" ], classifiers=[ "Development Status :: 3 - Alpha", "Topic :: Science", "License :: OSI Approved :: MIT License", ], scripts=['bin/augur'] ) <commit_msg>Bump modular augur's TreeTime version requirement to match remote Now distinguished from the Python 2 version of TreeTime.<commit_after>import os from setuptools import setup setup( name = "augur", version = "0.1.0", author = "nextstrain developers", author_email = "trevor@bedford.io, richard.neher@unibas.ch", description = ("Pipelines for real-time phylogenetic analysis"), license = "MIT", keywords = "nextstrain, molecular epidemiology", url = "https://github.com/nextstrain/augur", packages=['augur'], install_requires = [ "biopython >=1.69, ==1.*", "boto >=2.38, ==2.*", "cvxopt >=1.1.8, ==1.1.*", "ipdb >=0.10.1, ==0.10.*", "matplotlib >=2.0, ==2.*", "pandas >=0.16.2, <0.18.0", "pytest >=3.2.1, ==3.*", "seaborn >=0.6.0, ==0.6.*", "tox >=2.8.2, ==2.*", "treetime ==0.4.0" ], dependency_links = [ "https://api.github.com/repos/neherlab/treetime/tarball/py3#egg=treetime-0.4.0" ], classifiers=[ "Development Status :: 3 - Alpha", "Topic :: Science", "License :: OSI Approved :: MIT License", ], scripts=['bin/augur'] )
fa6c5d438730ce27ee4e6410b7f106cb4c90d27b
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup setup(name='django_emarsys', version='0.34', description='Django glue for Emarsys events', license="MIT", author='Markus Bertheau', author_email='mbertheau@gmail.com', long_description=open('README.md').read(), packages=['django_emarsys', 'django_emarsys.management', 'django_emarsys.management.commands', 'django_emarsys.migrations' ], include_package_data=True, install_requires=[ 'python-emarsys==0.2', 'jsonfield==1.0.3', ])
#!/usr/bin/env python from setuptools import setup setup(name='django_emarsys', version='0.34', description='Django glue for Emarsys events', license="MIT", author='Markus Bertheau', author_email='mbertheau@gmail.com', long_description=open('README.md').read(), packages=['django_emarsys', 'django_emarsys.management', 'django_emarsys.management.commands', 'django_emarsys.migrations' ], include_package_data=True, install_requires=[ 'python-emarsys==0.2', 'jsonfield==2.0.2', ])
Update install_requires to support future django versions
Update install_requires to support future django versions
Python
mit
machtfit/django-emarsys,machtfit/django-emarsys
#!/usr/bin/env python from setuptools import setup setup(name='django_emarsys', version='0.34', description='Django glue for Emarsys events', license="MIT", author='Markus Bertheau', author_email='mbertheau@gmail.com', long_description=open('README.md').read(), packages=['django_emarsys', 'django_emarsys.management', 'django_emarsys.management.commands', 'django_emarsys.migrations' ], include_package_data=True, install_requires=[ 'python-emarsys==0.2', 'jsonfield==1.0.3', ]) Update install_requires to support future django versions
#!/usr/bin/env python from setuptools import setup setup(name='django_emarsys', version='0.34', description='Django glue for Emarsys events', license="MIT", author='Markus Bertheau', author_email='mbertheau@gmail.com', long_description=open('README.md').read(), packages=['django_emarsys', 'django_emarsys.management', 'django_emarsys.management.commands', 'django_emarsys.migrations' ], include_package_data=True, install_requires=[ 'python-emarsys==0.2', 'jsonfield==2.0.2', ])
<commit_before>#!/usr/bin/env python from setuptools import setup setup(name='django_emarsys', version='0.34', description='Django glue for Emarsys events', license="MIT", author='Markus Bertheau', author_email='mbertheau@gmail.com', long_description=open('README.md').read(), packages=['django_emarsys', 'django_emarsys.management', 'django_emarsys.management.commands', 'django_emarsys.migrations' ], include_package_data=True, install_requires=[ 'python-emarsys==0.2', 'jsonfield==1.0.3', ]) <commit_msg>Update install_requires to support future django versions<commit_after>
#!/usr/bin/env python from setuptools import setup setup(name='django_emarsys', version='0.34', description='Django glue for Emarsys events', license="MIT", author='Markus Bertheau', author_email='mbertheau@gmail.com', long_description=open('README.md').read(), packages=['django_emarsys', 'django_emarsys.management', 'django_emarsys.management.commands', 'django_emarsys.migrations' ], include_package_data=True, install_requires=[ 'python-emarsys==0.2', 'jsonfield==2.0.2', ])
#!/usr/bin/env python from setuptools import setup setup(name='django_emarsys', version='0.34', description='Django glue for Emarsys events', license="MIT", author='Markus Bertheau', author_email='mbertheau@gmail.com', long_description=open('README.md').read(), packages=['django_emarsys', 'django_emarsys.management', 'django_emarsys.management.commands', 'django_emarsys.migrations' ], include_package_data=True, install_requires=[ 'python-emarsys==0.2', 'jsonfield==1.0.3', ]) Update install_requires to support future django versions#!/usr/bin/env python from setuptools import setup setup(name='django_emarsys', version='0.34', description='Django glue for Emarsys events', license="MIT", author='Markus Bertheau', author_email='mbertheau@gmail.com', long_description=open('README.md').read(), packages=['django_emarsys', 'django_emarsys.management', 'django_emarsys.management.commands', 'django_emarsys.migrations' ], include_package_data=True, install_requires=[ 'python-emarsys==0.2', 'jsonfield==2.0.2', ])
<commit_before>#!/usr/bin/env python from setuptools import setup setup(name='django_emarsys', version='0.34', description='Django glue for Emarsys events', license="MIT", author='Markus Bertheau', author_email='mbertheau@gmail.com', long_description=open('README.md').read(), packages=['django_emarsys', 'django_emarsys.management', 'django_emarsys.management.commands', 'django_emarsys.migrations' ], include_package_data=True, install_requires=[ 'python-emarsys==0.2', 'jsonfield==1.0.3', ]) <commit_msg>Update install_requires to support future django versions<commit_after>#!/usr/bin/env python from setuptools import setup setup(name='django_emarsys', version='0.34', description='Django glue for Emarsys events', license="MIT", author='Markus Bertheau', author_email='mbertheau@gmail.com', long_description=open('README.md').read(), packages=['django_emarsys', 'django_emarsys.management', 'django_emarsys.management.commands', 'django_emarsys.migrations' ], include_package_data=True, install_requires=[ 'python-emarsys==0.2', 'jsonfield==2.0.2', ])
9e89eb44bb1878c98d3dc82e97ccbef2011adc87
formapi/__init__.py
formapi/__init__.py
VERSION = (0, 1, 0, 'dev') # Dynamically calculate the version based on VERSION tuple if len(VERSION) > 2 and VERSION[2] is not None: if isinstance(VERSION[2], int): str_version = "%s.%s.%s" % VERSION[:3] else: str_version = "%s.%s_%s" % VERSION[:3] else: str_version = "%s.%s" % VERSION[:2] __version__ = str_version
VERSION = (0, 1, 0, 'final') # Dynamically calculate the version based on VERSION tuple if len(VERSION) > 2 and VERSION[2] is not None: if isinstance(VERSION[2], int): str_version = "%s.%s.%s" % VERSION[:3] else: str_version = "%s.%s_%s" % VERSION[:3] else: str_version = "%s.%s" % VERSION[:2] __version__ = str_version
Mark version 0.1.0 as final
Mark version 0.1.0 as final
Python
mit
andreif/django-formapi,5monkeys/django-formapi,andreif/django-formapi,5monkeys/django-formapi
VERSION = (0, 1, 0, 'dev') # Dynamically calculate the version based on VERSION tuple if len(VERSION) > 2 and VERSION[2] is not None: if isinstance(VERSION[2], int): str_version = "%s.%s.%s" % VERSION[:3] else: str_version = "%s.%s_%s" % VERSION[:3] else: str_version = "%s.%s" % VERSION[:2] __version__ = str_version Mark version 0.1.0 as final
VERSION = (0, 1, 0, 'final') # Dynamically calculate the version based on VERSION tuple if len(VERSION) > 2 and VERSION[2] is not None: if isinstance(VERSION[2], int): str_version = "%s.%s.%s" % VERSION[:3] else: str_version = "%s.%s_%s" % VERSION[:3] else: str_version = "%s.%s" % VERSION[:2] __version__ = str_version
<commit_before>VERSION = (0, 1, 0, 'dev') # Dynamically calculate the version based on VERSION tuple if len(VERSION) > 2 and VERSION[2] is not None: if isinstance(VERSION[2], int): str_version = "%s.%s.%s" % VERSION[:3] else: str_version = "%s.%s_%s" % VERSION[:3] else: str_version = "%s.%s" % VERSION[:2] __version__ = str_version <commit_msg>Mark version 0.1.0 as final<commit_after>
VERSION = (0, 1, 0, 'final') # Dynamically calculate the version based on VERSION tuple if len(VERSION) > 2 and VERSION[2] is not None: if isinstance(VERSION[2], int): str_version = "%s.%s.%s" % VERSION[:3] else: str_version = "%s.%s_%s" % VERSION[:3] else: str_version = "%s.%s" % VERSION[:2] __version__ = str_version
VERSION = (0, 1, 0, 'dev') # Dynamically calculate the version based on VERSION tuple if len(VERSION) > 2 and VERSION[2] is not None: if isinstance(VERSION[2], int): str_version = "%s.%s.%s" % VERSION[:3] else: str_version = "%s.%s_%s" % VERSION[:3] else: str_version = "%s.%s" % VERSION[:2] __version__ = str_version Mark version 0.1.0 as finalVERSION = (0, 1, 0, 'final') # Dynamically calculate the version based on VERSION tuple if len(VERSION) > 2 and VERSION[2] is not None: if isinstance(VERSION[2], int): str_version = "%s.%s.%s" % VERSION[:3] else: str_version = "%s.%s_%s" % VERSION[:3] else: str_version = "%s.%s" % VERSION[:2] __version__ = str_version
<commit_before>VERSION = (0, 1, 0, 'dev') # Dynamically calculate the version based on VERSION tuple if len(VERSION) > 2 and VERSION[2] is not None: if isinstance(VERSION[2], int): str_version = "%s.%s.%s" % VERSION[:3] else: str_version = "%s.%s_%s" % VERSION[:3] else: str_version = "%s.%s" % VERSION[:2] __version__ = str_version <commit_msg>Mark version 0.1.0 as final<commit_after>VERSION = (0, 1, 0, 'final') # Dynamically calculate the version based on VERSION tuple if len(VERSION) > 2 and VERSION[2] is not None: if isinstance(VERSION[2], int): str_version = "%s.%s.%s" % VERSION[:3] else: str_version = "%s.%s_%s" % VERSION[:3] else: str_version = "%s.%s" % VERSION[:2] __version__ = str_version
ef2c1115fdebfacea76d19b3fac6bbde7f0cbbf2
gitlab_tests/test_v91/test_tags.py
gitlab_tests/test_v91/test_tags.py
import responses from gitlab.exceptions import HttpError from gitlab_tests.base import BaseTest from response_data.tags import * class TestDeleteRepositoryTag(BaseTest): @responses.activate def test_delete_repository_tag(self): responses.add( responses.DELETE, self.gitlab.api_url + '/projects/5/repository/tags/test', json=delete_repository_tag, status=200, content_type='application/json') self.assertEqual(delete_repository_tag, self.gitlab.delete_repository_tag(5, 'test')) @responses.activate def test_delete_repository_tag_exception(self): responses.add( responses.DELETE, self.gitlab.api_url + '/projects/5/repository/tags/test', json='{"message":"No such tag"}', status=404, content_type='application/json') self.assertRaises(HttpError, self.gitlab.delete_repository_tag, 5, 'test')
import responses from requests.exceptions import HTTPError from gitlab_tests.base import BaseTest from response_data.tags import * class TestDeleteRepositoryTag(BaseTest): @responses.activate def test_delete_repository_tag(self): responses.add( responses.DELETE, self.gitlab.api_url + '/projects/5/repository/tags/test', json=delete_repository_tag, status=200, content_type='application/json') self.assertEqual(delete_repository_tag, self.gitlab.delete_repository_tag(5, 'test')) @responses.activate def test_delete_repository_tag_exception(self): responses.add( responses.DELETE, self.gitlab.api_url + '/projects/5/repository/tags/test', json='{"message":"No such tag"}', status=404, content_type='application/json') self.gitlab.suppress_http_error = False self.assertRaises(HTTPError, self.gitlab.delete_repository_tag, 5, 'test') self.gitlab.suppress_http_error = True
Update Tags cases for new behaviour
tests: Update Tags cases for new behaviour See also: #193
Python
apache-2.0
pyapi-gitlab/pyapi-gitlab,Itxaka/pyapi-gitlab,Itxaka/pyapi-gitlab,pyapi-gitlab/pyapi-gitlab
import responses from gitlab.exceptions import HttpError from gitlab_tests.base import BaseTest from response_data.tags import * class TestDeleteRepositoryTag(BaseTest): @responses.activate def test_delete_repository_tag(self): responses.add( responses.DELETE, self.gitlab.api_url + '/projects/5/repository/tags/test', json=delete_repository_tag, status=200, content_type='application/json') self.assertEqual(delete_repository_tag, self.gitlab.delete_repository_tag(5, 'test')) @responses.activate def test_delete_repository_tag_exception(self): responses.add( responses.DELETE, self.gitlab.api_url + '/projects/5/repository/tags/test', json='{"message":"No such tag"}', status=404, content_type='application/json') self.assertRaises(HttpError, self.gitlab.delete_repository_tag, 5, 'test') tests: Update Tags cases for new behaviour See also: #193
import responses from requests.exceptions import HTTPError from gitlab_tests.base import BaseTest from response_data.tags import * class TestDeleteRepositoryTag(BaseTest): @responses.activate def test_delete_repository_tag(self): responses.add( responses.DELETE, self.gitlab.api_url + '/projects/5/repository/tags/test', json=delete_repository_tag, status=200, content_type='application/json') self.assertEqual(delete_repository_tag, self.gitlab.delete_repository_tag(5, 'test')) @responses.activate def test_delete_repository_tag_exception(self): responses.add( responses.DELETE, self.gitlab.api_url + '/projects/5/repository/tags/test', json='{"message":"No such tag"}', status=404, content_type='application/json') self.gitlab.suppress_http_error = False self.assertRaises(HTTPError, self.gitlab.delete_repository_tag, 5, 'test') self.gitlab.suppress_http_error = True
<commit_before>import responses from gitlab.exceptions import HttpError from gitlab_tests.base import BaseTest from response_data.tags import * class TestDeleteRepositoryTag(BaseTest): @responses.activate def test_delete_repository_tag(self): responses.add( responses.DELETE, self.gitlab.api_url + '/projects/5/repository/tags/test', json=delete_repository_tag, status=200, content_type='application/json') self.assertEqual(delete_repository_tag, self.gitlab.delete_repository_tag(5, 'test')) @responses.activate def test_delete_repository_tag_exception(self): responses.add( responses.DELETE, self.gitlab.api_url + '/projects/5/repository/tags/test', json='{"message":"No such tag"}', status=404, content_type='application/json') self.assertRaises(HttpError, self.gitlab.delete_repository_tag, 5, 'test') <commit_msg>tests: Update Tags cases for new behaviour See also: #193<commit_after>
import responses from requests.exceptions import HTTPError from gitlab_tests.base import BaseTest from response_data.tags import * class TestDeleteRepositoryTag(BaseTest): @responses.activate def test_delete_repository_tag(self): responses.add( responses.DELETE, self.gitlab.api_url + '/projects/5/repository/tags/test', json=delete_repository_tag, status=200, content_type='application/json') self.assertEqual(delete_repository_tag, self.gitlab.delete_repository_tag(5, 'test')) @responses.activate def test_delete_repository_tag_exception(self): responses.add( responses.DELETE, self.gitlab.api_url + '/projects/5/repository/tags/test', json='{"message":"No such tag"}', status=404, content_type='application/json') self.gitlab.suppress_http_error = False self.assertRaises(HTTPError, self.gitlab.delete_repository_tag, 5, 'test') self.gitlab.suppress_http_error = True
import responses from gitlab.exceptions import HttpError from gitlab_tests.base import BaseTest from response_data.tags import * class TestDeleteRepositoryTag(BaseTest): @responses.activate def test_delete_repository_tag(self): responses.add( responses.DELETE, self.gitlab.api_url + '/projects/5/repository/tags/test', json=delete_repository_tag, status=200, content_type='application/json') self.assertEqual(delete_repository_tag, self.gitlab.delete_repository_tag(5, 'test')) @responses.activate def test_delete_repository_tag_exception(self): responses.add( responses.DELETE, self.gitlab.api_url + '/projects/5/repository/tags/test', json='{"message":"No such tag"}', status=404, content_type='application/json') self.assertRaises(HttpError, self.gitlab.delete_repository_tag, 5, 'test') tests: Update Tags cases for new behaviour See also: #193import responses from requests.exceptions import HTTPError from gitlab_tests.base import BaseTest from response_data.tags import * class TestDeleteRepositoryTag(BaseTest): @responses.activate def test_delete_repository_tag(self): responses.add( responses.DELETE, self.gitlab.api_url + '/projects/5/repository/tags/test', json=delete_repository_tag, status=200, content_type='application/json') self.assertEqual(delete_repository_tag, self.gitlab.delete_repository_tag(5, 'test')) @responses.activate def test_delete_repository_tag_exception(self): responses.add( responses.DELETE, self.gitlab.api_url + '/projects/5/repository/tags/test', json='{"message":"No such tag"}', status=404, content_type='application/json') self.gitlab.suppress_http_error = False self.assertRaises(HTTPError, self.gitlab.delete_repository_tag, 5, 'test') self.gitlab.suppress_http_error = True
<commit_before>import responses from gitlab.exceptions import HttpError from gitlab_tests.base import BaseTest from response_data.tags import * class TestDeleteRepositoryTag(BaseTest): @responses.activate def test_delete_repository_tag(self): responses.add( responses.DELETE, self.gitlab.api_url + '/projects/5/repository/tags/test', json=delete_repository_tag, status=200, content_type='application/json') self.assertEqual(delete_repository_tag, self.gitlab.delete_repository_tag(5, 'test')) @responses.activate def test_delete_repository_tag_exception(self): responses.add( responses.DELETE, self.gitlab.api_url + '/projects/5/repository/tags/test', json='{"message":"No such tag"}', status=404, content_type='application/json') self.assertRaises(HttpError, self.gitlab.delete_repository_tag, 5, 'test') <commit_msg>tests: Update Tags cases for new behaviour See also: #193<commit_after>import responses from requests.exceptions import HTTPError from gitlab_tests.base import BaseTest from response_data.tags import * class TestDeleteRepositoryTag(BaseTest): @responses.activate def test_delete_repository_tag(self): responses.add( responses.DELETE, self.gitlab.api_url + '/projects/5/repository/tags/test', json=delete_repository_tag, status=200, content_type='application/json') self.assertEqual(delete_repository_tag, self.gitlab.delete_repository_tag(5, 'test')) @responses.activate def test_delete_repository_tag_exception(self): responses.add( responses.DELETE, self.gitlab.api_url + '/projects/5/repository/tags/test', json='{"message":"No such tag"}', status=404, content_type='application/json') self.gitlab.suppress_http_error = False self.assertRaises(HTTPError, self.gitlab.delete_repository_tag, 5, 'test') self.gitlab.suppress_http_error = True
c39260e64c8820bad9243c35f10b352419425810
marble/tests/test_exposure.py
marble/tests/test_exposure.py
""" Tests for the exposure computation """ from nose.tools import * import marble as mb # Test maximum value of exposure # Test maximum value of isolation # Test minimum of exposure # Test minimum of isolation
""" Tests for the exposure computation """ from __future__ import division from nose.tools import * import itertools import marble as mb # # Synthetic data for tests # def segregated_city(): """ perfect segregation """ city = {"A":{1:7, 2:0, 3:0}, "B":{1:0, 2:0, 3:14}, "C":{1:0, 2:42, 3:0}} return city def two_way_city(): """ perfect two-way exposure for 1 and 2 """ city = {"A":{1:7, 2:13, 3:0}, "B":{1:7, 2:13, 3:0}, "C":{1:0, 2:0, 3:37}} return city def uniform_city(): """ Uniform representation """ city = {"A":{1:1, 2:10, 3:7}, "B":{1:2, 2:20, 3:14}, "C":{1:4, 2:40, 3:28}} return city # # Test # class TestExposure(object): def test_maximum_isolation(city): city = segregated_city() exp = mb.exposure(city) N_cl = {i: sum([city[au][i] for au in city]) for i in [1,2,3]} N_tot = sum(N_cl.values()) for c in exp: assert_almost_equal(exp[c][c][0], N_tot/N_cl[c], places=3) def test_minimum_exposure(city): city = segregated_city() exp = mb.exposure(city) for c0,c1 in itertools.permutations([1,2,3], 2): assert_almost_equal(exp[c0][c1][0], 0.0) def test_maximum_exposure(city): city = two_way_city() exp = mb.exposure(city) N_cl = {i: sum([city[au][i] for au in city]) for i in [1,2,3]} N_tot = sum(N_cl.values()) assert_almost_equal(exp[2][1][0], N_tot/(N_cl[1]+N_cl[2]), places=3) def test_minimum_isolation(city): city = uniform_city() exp = mb.exposure(city) for c in [1,2,3]: assert_almost_equal(exp[c][c][0], 1.0, places=3)
Write tests for the exposure
Write tests for the exposure
Python
bsd-3-clause
walkerke/marble,scities/marble
""" Tests for the exposure computation """ from nose.tools import * import marble as mb # Test maximum value of exposure # Test maximum value of isolation # Test minimum of exposure # Test minimum of isolation Write tests for the exposure
""" Tests for the exposure computation """ from __future__ import division from nose.tools import * import itertools import marble as mb # # Synthetic data for tests # def segregated_city(): """ perfect segregation """ city = {"A":{1:7, 2:0, 3:0}, "B":{1:0, 2:0, 3:14}, "C":{1:0, 2:42, 3:0}} return city def two_way_city(): """ perfect two-way exposure for 1 and 2 """ city = {"A":{1:7, 2:13, 3:0}, "B":{1:7, 2:13, 3:0}, "C":{1:0, 2:0, 3:37}} return city def uniform_city(): """ Uniform representation """ city = {"A":{1:1, 2:10, 3:7}, "B":{1:2, 2:20, 3:14}, "C":{1:4, 2:40, 3:28}} return city # # Test # class TestExposure(object): def test_maximum_isolation(city): city = segregated_city() exp = mb.exposure(city) N_cl = {i: sum([city[au][i] for au in city]) for i in [1,2,3]} N_tot = sum(N_cl.values()) for c in exp: assert_almost_equal(exp[c][c][0], N_tot/N_cl[c], places=3) def test_minimum_exposure(city): city = segregated_city() exp = mb.exposure(city) for c0,c1 in itertools.permutations([1,2,3], 2): assert_almost_equal(exp[c0][c1][0], 0.0) def test_maximum_exposure(city): city = two_way_city() exp = mb.exposure(city) N_cl = {i: sum([city[au][i] for au in city]) for i in [1,2,3]} N_tot = sum(N_cl.values()) assert_almost_equal(exp[2][1][0], N_tot/(N_cl[1]+N_cl[2]), places=3) def test_minimum_isolation(city): city = uniform_city() exp = mb.exposure(city) for c in [1,2,3]: assert_almost_equal(exp[c][c][0], 1.0, places=3)
<commit_before>""" Tests for the exposure computation """ from nose.tools import * import marble as mb # Test maximum value of exposure # Test maximum value of isolation # Test minimum of exposure # Test minimum of isolation <commit_msg>Write tests for the exposure<commit_after>
""" Tests for the exposure computation """ from __future__ import division from nose.tools import * import itertools import marble as mb # # Synthetic data for tests # def segregated_city(): """ perfect segregation """ city = {"A":{1:7, 2:0, 3:0}, "B":{1:0, 2:0, 3:14}, "C":{1:0, 2:42, 3:0}} return city def two_way_city(): """ perfect two-way exposure for 1 and 2 """ city = {"A":{1:7, 2:13, 3:0}, "B":{1:7, 2:13, 3:0}, "C":{1:0, 2:0, 3:37}} return city def uniform_city(): """ Uniform representation """ city = {"A":{1:1, 2:10, 3:7}, "B":{1:2, 2:20, 3:14}, "C":{1:4, 2:40, 3:28}} return city # # Test # class TestExposure(object): def test_maximum_isolation(city): city = segregated_city() exp = mb.exposure(city) N_cl = {i: sum([city[au][i] for au in city]) for i in [1,2,3]} N_tot = sum(N_cl.values()) for c in exp: assert_almost_equal(exp[c][c][0], N_tot/N_cl[c], places=3) def test_minimum_exposure(city): city = segregated_city() exp = mb.exposure(city) for c0,c1 in itertools.permutations([1,2,3], 2): assert_almost_equal(exp[c0][c1][0], 0.0) def test_maximum_exposure(city): city = two_way_city() exp = mb.exposure(city) N_cl = {i: sum([city[au][i] for au in city]) for i in [1,2,3]} N_tot = sum(N_cl.values()) assert_almost_equal(exp[2][1][0], N_tot/(N_cl[1]+N_cl[2]), places=3) def test_minimum_isolation(city): city = uniform_city() exp = mb.exposure(city) for c in [1,2,3]: assert_almost_equal(exp[c][c][0], 1.0, places=3)
""" Tests for the exposure computation """ from nose.tools import * import marble as mb # Test maximum value of exposure # Test maximum value of isolation # Test minimum of exposure # Test minimum of isolation Write tests for the exposure""" Tests for the exposure computation """ from __future__ import division from nose.tools import * import itertools import marble as mb # # Synthetic data for tests # def segregated_city(): """ perfect segregation """ city = {"A":{1:7, 2:0, 3:0}, "B":{1:0, 2:0, 3:14}, "C":{1:0, 2:42, 3:0}} return city def two_way_city(): """ perfect two-way exposure for 1 and 2 """ city = {"A":{1:7, 2:13, 3:0}, "B":{1:7, 2:13, 3:0}, "C":{1:0, 2:0, 3:37}} return city def uniform_city(): """ Uniform representation """ city = {"A":{1:1, 2:10, 3:7}, "B":{1:2, 2:20, 3:14}, "C":{1:4, 2:40, 3:28}} return city # # Test # class TestExposure(object): def test_maximum_isolation(city): city = segregated_city() exp = mb.exposure(city) N_cl = {i: sum([city[au][i] for au in city]) for i in [1,2,3]} N_tot = sum(N_cl.values()) for c in exp: assert_almost_equal(exp[c][c][0], N_tot/N_cl[c], places=3) def test_minimum_exposure(city): city = segregated_city() exp = mb.exposure(city) for c0,c1 in itertools.permutations([1,2,3], 2): assert_almost_equal(exp[c0][c1][0], 0.0) def test_maximum_exposure(city): city = two_way_city() exp = mb.exposure(city) N_cl = {i: sum([city[au][i] for au in city]) for i in [1,2,3]} N_tot = sum(N_cl.values()) assert_almost_equal(exp[2][1][0], N_tot/(N_cl[1]+N_cl[2]), places=3) def test_minimum_isolation(city): city = uniform_city() exp = mb.exposure(city) for c in [1,2,3]: assert_almost_equal(exp[c][c][0], 1.0, places=3)
<commit_before>""" Tests for the exposure computation """ from nose.tools import * import marble as mb # Test maximum value of exposure # Test maximum value of isolation # Test minimum of exposure # Test minimum of isolation <commit_msg>Write tests for the exposure<commit_after>""" Tests for the exposure computation """ from __future__ import division from nose.tools import * import itertools import marble as mb # # Synthetic data for tests # def segregated_city(): """ perfect segregation """ city = {"A":{1:7, 2:0, 3:0}, "B":{1:0, 2:0, 3:14}, "C":{1:0, 2:42, 3:0}} return city def two_way_city(): """ perfect two-way exposure for 1 and 2 """ city = {"A":{1:7, 2:13, 3:0}, "B":{1:7, 2:13, 3:0}, "C":{1:0, 2:0, 3:37}} return city def uniform_city(): """ Uniform representation """ city = {"A":{1:1, 2:10, 3:7}, "B":{1:2, 2:20, 3:14}, "C":{1:4, 2:40, 3:28}} return city # # Test # class TestExposure(object): def test_maximum_isolation(city): city = segregated_city() exp = mb.exposure(city) N_cl = {i: sum([city[au][i] for au in city]) for i in [1,2,3]} N_tot = sum(N_cl.values()) for c in exp: assert_almost_equal(exp[c][c][0], N_tot/N_cl[c], places=3) def test_minimum_exposure(city): city = segregated_city() exp = mb.exposure(city) for c0,c1 in itertools.permutations([1,2,3], 2): assert_almost_equal(exp[c0][c1][0], 0.0) def test_maximum_exposure(city): city = two_way_city() exp = mb.exposure(city) N_cl = {i: sum([city[au][i] for au in city]) for i in [1,2,3]} N_tot = sum(N_cl.values()) assert_almost_equal(exp[2][1][0], N_tot/(N_cl[1]+N_cl[2]), places=3) def test_minimum_isolation(city): city = uniform_city() exp = mb.exposure(city) for c in [1,2,3]: assert_almost_equal(exp[c][c][0], 1.0, places=3)
4d7aea55408e96946a2a12fc75fb00fe62d9cfec
conftest.py
conftest.py
import tempfile import pytest import photomosaic as pm @pytest.fixture(scope='module') def pool(): pool_dir = tempfile.mkdtemp() pm.generate_tile_pool(pool_dir) pool = pm.make_pool(pool_dir)
import tempfile import shutil import pytest import photomosaic as pm @pytest.fixture(scope='module') def pool(): tempdirname = tempfile.mkdtemp() pm.generate_tile_pool(tempdirname) pool = pm.make_pool(tempdirname) shutil.rmtree(tempdirname)
Clean up temp pool dir after tests.
TST: Clean up temp pool dir after tests.
Python
bsd-3-clause
danielballan/photomosaic
import tempfile import pytest import photomosaic as pm @pytest.fixture(scope='module') def pool(): pool_dir = tempfile.mkdtemp() pm.generate_tile_pool(pool_dir) pool = pm.make_pool(pool_dir) TST: Clean up temp pool dir after tests.
import tempfile import shutil import pytest import photomosaic as pm @pytest.fixture(scope='module') def pool(): tempdirname = tempfile.mkdtemp() pm.generate_tile_pool(tempdirname) pool = pm.make_pool(tempdirname) shutil.rmtree(tempdirname)
<commit_before>import tempfile import pytest import photomosaic as pm @pytest.fixture(scope='module') def pool(): pool_dir = tempfile.mkdtemp() pm.generate_tile_pool(pool_dir) pool = pm.make_pool(pool_dir) <commit_msg>TST: Clean up temp pool dir after tests.<commit_after>
import tempfile import shutil import pytest import photomosaic as pm @pytest.fixture(scope='module') def pool(): tempdirname = tempfile.mkdtemp() pm.generate_tile_pool(tempdirname) pool = pm.make_pool(tempdirname) shutil.rmtree(tempdirname)
import tempfile import pytest import photomosaic as pm @pytest.fixture(scope='module') def pool(): pool_dir = tempfile.mkdtemp() pm.generate_tile_pool(pool_dir) pool = pm.make_pool(pool_dir) TST: Clean up temp pool dir after tests.import tempfile import shutil import pytest import photomosaic as pm @pytest.fixture(scope='module') def pool(): tempdirname = tempfile.mkdtemp() pm.generate_tile_pool(tempdirname) pool = pm.make_pool(tempdirname) shutil.rmtree(tempdirname)
<commit_before>import tempfile import pytest import photomosaic as pm @pytest.fixture(scope='module') def pool(): pool_dir = tempfile.mkdtemp() pm.generate_tile_pool(pool_dir) pool = pm.make_pool(pool_dir) <commit_msg>TST: Clean up temp pool dir after tests.<commit_after>import tempfile import shutil import pytest import photomosaic as pm @pytest.fixture(scope='module') def pool(): tempdirname = tempfile.mkdtemp() pm.generate_tile_pool(tempdirname) pool = pm.make_pool(tempdirname) shutil.rmtree(tempdirname)
0b63ff4339d9dec1e50c6275b5e8566abb59fdfe
src/core/dev_settings.py
src/core/dev_settings.py
# SECURITY WARNING: keep the secret key used in production secret! # You should change this key before you go live! DEBUG = True SECRET_KEY = 'uxprsdhk^gzd-r=_287byolxn)$k6tsd8_cepl^s^tms2w1qrv' # This is the default redirect if no other sites are found. DEFAULT_HOST = 'https://www.example.org' EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' URL_CONFIG = 'path' # path or domain MIDDLEWARE_CLASSES = ( 'utils.middleware.TimeMonitoring', 'debug_toolbar.middleware.DebugToolbarMiddleware' ) INSTALLED_APPS = ['debug_toolbar', 'django_nose'] def show_toolbar(request): return True DEBUG_TOOLBAR_CONFIG = { "SHOW_TOOLBAR_CALLBACK": show_toolbar, } TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
# SECURITY WARNING: keep the secret key used in production secret! # You should change this key before you go live! DEBUG = True SECRET_KEY = 'uxprsdhk^gzd-r=_287byolxn)$k6tsd8_cepl^s^tms2w1qrv' # This is the default redirect if no other sites are found. DEFAULT_HOST = 'https://www.example.org' EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' URL_CONFIG = 'path' # path or domain MIDDLEWARE_CLASSES = ( 'utils.middleware.TimeMonitoring', 'debug_toolbar.middleware.DebugToolbarMiddleware' ) INSTALLED_APPS = ['debug_toolbar', 'django_nose'] def show_toolbar(request): return True DEBUG_TOOLBAR_CONFIG = { "SHOW_TOOLBAR_CALLBACK": show_toolbar, } TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
Set dev email backend back to consol
Set dev email backend back to consol
Python
agpl-3.0
BirkbeckCTP/janeway,BirkbeckCTP/janeway,BirkbeckCTP/janeway,BirkbeckCTP/janeway
# SECURITY WARNING: keep the secret key used in production secret! # You should change this key before you go live! DEBUG = True SECRET_KEY = 'uxprsdhk^gzd-r=_287byolxn)$k6tsd8_cepl^s^tms2w1qrv' # This is the default redirect if no other sites are found. DEFAULT_HOST = 'https://www.example.org' EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' URL_CONFIG = 'path' # path or domain MIDDLEWARE_CLASSES = ( 'utils.middleware.TimeMonitoring', 'debug_toolbar.middleware.DebugToolbarMiddleware' ) INSTALLED_APPS = ['debug_toolbar', 'django_nose'] def show_toolbar(request): return True DEBUG_TOOLBAR_CONFIG = { "SHOW_TOOLBAR_CALLBACK": show_toolbar, } TEST_RUNNER = 'django_nose.NoseTestSuiteRunner' Set dev email backend back to consol
# SECURITY WARNING: keep the secret key used in production secret! # You should change this key before you go live! DEBUG = True SECRET_KEY = 'uxprsdhk^gzd-r=_287byolxn)$k6tsd8_cepl^s^tms2w1qrv' # This is the default redirect if no other sites are found. DEFAULT_HOST = 'https://www.example.org' EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' URL_CONFIG = 'path' # path or domain MIDDLEWARE_CLASSES = ( 'utils.middleware.TimeMonitoring', 'debug_toolbar.middleware.DebugToolbarMiddleware' ) INSTALLED_APPS = ['debug_toolbar', 'django_nose'] def show_toolbar(request): return True DEBUG_TOOLBAR_CONFIG = { "SHOW_TOOLBAR_CALLBACK": show_toolbar, } TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
<commit_before># SECURITY WARNING: keep the secret key used in production secret! # You should change this key before you go live! DEBUG = True SECRET_KEY = 'uxprsdhk^gzd-r=_287byolxn)$k6tsd8_cepl^s^tms2w1qrv' # This is the default redirect if no other sites are found. DEFAULT_HOST = 'https://www.example.org' EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' URL_CONFIG = 'path' # path or domain MIDDLEWARE_CLASSES = ( 'utils.middleware.TimeMonitoring', 'debug_toolbar.middleware.DebugToolbarMiddleware' ) INSTALLED_APPS = ['debug_toolbar', 'django_nose'] def show_toolbar(request): return True DEBUG_TOOLBAR_CONFIG = { "SHOW_TOOLBAR_CALLBACK": show_toolbar, } TEST_RUNNER = 'django_nose.NoseTestSuiteRunner' <commit_msg>Set dev email backend back to consol<commit_after>
# SECURITY WARNING: keep the secret key used in production secret! # You should change this key before you go live! DEBUG = True SECRET_KEY = 'uxprsdhk^gzd-r=_287byolxn)$k6tsd8_cepl^s^tms2w1qrv' # This is the default redirect if no other sites are found. DEFAULT_HOST = 'https://www.example.org' EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' URL_CONFIG = 'path' # path or domain MIDDLEWARE_CLASSES = ( 'utils.middleware.TimeMonitoring', 'debug_toolbar.middleware.DebugToolbarMiddleware' ) INSTALLED_APPS = ['debug_toolbar', 'django_nose'] def show_toolbar(request): return True DEBUG_TOOLBAR_CONFIG = { "SHOW_TOOLBAR_CALLBACK": show_toolbar, } TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
# SECURITY WARNING: keep the secret key used in production secret! # You should change this key before you go live! DEBUG = True SECRET_KEY = 'uxprsdhk^gzd-r=_287byolxn)$k6tsd8_cepl^s^tms2w1qrv' # This is the default redirect if no other sites are found. DEFAULT_HOST = 'https://www.example.org' EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' URL_CONFIG = 'path' # path or domain MIDDLEWARE_CLASSES = ( 'utils.middleware.TimeMonitoring', 'debug_toolbar.middleware.DebugToolbarMiddleware' ) INSTALLED_APPS = ['debug_toolbar', 'django_nose'] def show_toolbar(request): return True DEBUG_TOOLBAR_CONFIG = { "SHOW_TOOLBAR_CALLBACK": show_toolbar, } TEST_RUNNER = 'django_nose.NoseTestSuiteRunner' Set dev email backend back to consol# SECURITY WARNING: keep the secret key used in production secret! # You should change this key before you go live! DEBUG = True SECRET_KEY = 'uxprsdhk^gzd-r=_287byolxn)$k6tsd8_cepl^s^tms2w1qrv' # This is the default redirect if no other sites are found. DEFAULT_HOST = 'https://www.example.org' EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' URL_CONFIG = 'path' # path or domain MIDDLEWARE_CLASSES = ( 'utils.middleware.TimeMonitoring', 'debug_toolbar.middleware.DebugToolbarMiddleware' ) INSTALLED_APPS = ['debug_toolbar', 'django_nose'] def show_toolbar(request): return True DEBUG_TOOLBAR_CONFIG = { "SHOW_TOOLBAR_CALLBACK": show_toolbar, } TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
<commit_before># SECURITY WARNING: keep the secret key used in production secret! # You should change this key before you go live! DEBUG = True SECRET_KEY = 'uxprsdhk^gzd-r=_287byolxn)$k6tsd8_cepl^s^tms2w1qrv' # This is the default redirect if no other sites are found. DEFAULT_HOST = 'https://www.example.org' EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' URL_CONFIG = 'path' # path or domain MIDDLEWARE_CLASSES = ( 'utils.middleware.TimeMonitoring', 'debug_toolbar.middleware.DebugToolbarMiddleware' ) INSTALLED_APPS = ['debug_toolbar', 'django_nose'] def show_toolbar(request): return True DEBUG_TOOLBAR_CONFIG = { "SHOW_TOOLBAR_CALLBACK": show_toolbar, } TEST_RUNNER = 'django_nose.NoseTestSuiteRunner' <commit_msg>Set dev email backend back to consol<commit_after># SECURITY WARNING: keep the secret key used in production secret! # You should change this key before you go live! DEBUG = True SECRET_KEY = 'uxprsdhk^gzd-r=_287byolxn)$k6tsd8_cepl^s^tms2w1qrv' # This is the default redirect if no other sites are found. DEFAULT_HOST = 'https://www.example.org' EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' URL_CONFIG = 'path' # path or domain MIDDLEWARE_CLASSES = ( 'utils.middleware.TimeMonitoring', 'debug_toolbar.middleware.DebugToolbarMiddleware' ) INSTALLED_APPS = ['debug_toolbar', 'django_nose'] def show_toolbar(request): return True DEBUG_TOOLBAR_CONFIG = { "SHOW_TOOLBAR_CALLBACK": show_toolbar, } TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
d9b43099c114f2398e82bd2631555c2807610a06
homebrew/printer.py
homebrew/printer.py
UNDERLINE_SYMBOL = "-" def print_title(logline): print(logline) print(len(logline) * UNDERLINE_SYMBOL) def print_blank_line(): print("") def print_overview( installed, packages_not_needed_by_other, packages_needed_by_other, package_dependencies, ): print_title("Installed packages:") print(", ".join(sorted(installed))) print_blank_line() print_title("No package depends on these packages:") print(", ".join(sorted(packages_not_needed_by_other))) print_blank_line() print_title("These packages are needed by other packages:") for package, needed_by in sorted(packages_needed_by_other.items()): print(f"Package {package} is needed by: {', '.join(needed_by)}") print_blank_line() print_title("These packages depend on other packages:") for package, package_dependencies in sorted(package_dependencies.items()): print( f"Package {package} depends on: {', '.join(package_dependencies)}", ) print_blank_line()
UNDERLINE_SYMBOL = "-" def print_title(logline): print(logline) print(len(logline) * UNDERLINE_SYMBOL) def print_blank_line(): print("") def print_overview( installed, packages_not_needed_by_other, packages_needed_by_other, package_dependencies): print_title("Installed packages:") print(", ".join(sorted(installed))) print_blank_line() print_title("No package depends on these packages:") print(", ".join(sorted(packages_not_needed_by_other))) print_blank_line() print_title("These packages are needed by other packages:") for package, needed_by in sorted(packages_needed_by_other.items()): print(f"Package {package} is needed by: {', '.join(needed_by)}") print_blank_line() print_title("These packages depend on other packages:") for package, package_dependencies in sorted(package_dependencies.items()): print( f"Package {package} depends on: {', '.join(package_dependencies)}", ) print_blank_line()
Use and extra level of indentation for funcion arguments
Use and extra level of indentation for funcion arguments See: https://www.python.org/dev/peps/pep-0008/#indentation
Python
isc
igroen/homebrew
UNDERLINE_SYMBOL = "-" def print_title(logline): print(logline) print(len(logline) * UNDERLINE_SYMBOL) def print_blank_line(): print("") def print_overview( installed, packages_not_needed_by_other, packages_needed_by_other, package_dependencies, ): print_title("Installed packages:") print(", ".join(sorted(installed))) print_blank_line() print_title("No package depends on these packages:") print(", ".join(sorted(packages_not_needed_by_other))) print_blank_line() print_title("These packages are needed by other packages:") for package, needed_by in sorted(packages_needed_by_other.items()): print(f"Package {package} is needed by: {', '.join(needed_by)}") print_blank_line() print_title("These packages depend on other packages:") for package, package_dependencies in sorted(package_dependencies.items()): print( f"Package {package} depends on: {', '.join(package_dependencies)}", ) print_blank_line() Use and extra level of indentation for funcion arguments See: https://www.python.org/dev/peps/pep-0008/#indentation
UNDERLINE_SYMBOL = "-" def print_title(logline): print(logline) print(len(logline) * UNDERLINE_SYMBOL) def print_blank_line(): print("") def print_overview( installed, packages_not_needed_by_other, packages_needed_by_other, package_dependencies): print_title("Installed packages:") print(", ".join(sorted(installed))) print_blank_line() print_title("No package depends on these packages:") print(", ".join(sorted(packages_not_needed_by_other))) print_blank_line() print_title("These packages are needed by other packages:") for package, needed_by in sorted(packages_needed_by_other.items()): print(f"Package {package} is needed by: {', '.join(needed_by)}") print_blank_line() print_title("These packages depend on other packages:") for package, package_dependencies in sorted(package_dependencies.items()): print( f"Package {package} depends on: {', '.join(package_dependencies)}", ) print_blank_line()
<commit_before>UNDERLINE_SYMBOL = "-" def print_title(logline): print(logline) print(len(logline) * UNDERLINE_SYMBOL) def print_blank_line(): print("") def print_overview( installed, packages_not_needed_by_other, packages_needed_by_other, package_dependencies, ): print_title("Installed packages:") print(", ".join(sorted(installed))) print_blank_line() print_title("No package depends on these packages:") print(", ".join(sorted(packages_not_needed_by_other))) print_blank_line() print_title("These packages are needed by other packages:") for package, needed_by in sorted(packages_needed_by_other.items()): print(f"Package {package} is needed by: {', '.join(needed_by)}") print_blank_line() print_title("These packages depend on other packages:") for package, package_dependencies in sorted(package_dependencies.items()): print( f"Package {package} depends on: {', '.join(package_dependencies)}", ) print_blank_line() <commit_msg>Use and extra level of indentation for funcion arguments See: https://www.python.org/dev/peps/pep-0008/#indentation<commit_after>
UNDERLINE_SYMBOL = "-" def print_title(logline): print(logline) print(len(logline) * UNDERLINE_SYMBOL) def print_blank_line(): print("") def print_overview( installed, packages_not_needed_by_other, packages_needed_by_other, package_dependencies): print_title("Installed packages:") print(", ".join(sorted(installed))) print_blank_line() print_title("No package depends on these packages:") print(", ".join(sorted(packages_not_needed_by_other))) print_blank_line() print_title("These packages are needed by other packages:") for package, needed_by in sorted(packages_needed_by_other.items()): print(f"Package {package} is needed by: {', '.join(needed_by)}") print_blank_line() print_title("These packages depend on other packages:") for package, package_dependencies in sorted(package_dependencies.items()): print( f"Package {package} depends on: {', '.join(package_dependencies)}", ) print_blank_line()
UNDERLINE_SYMBOL = "-" def print_title(logline): print(logline) print(len(logline) * UNDERLINE_SYMBOL) def print_blank_line(): print("") def print_overview( installed, packages_not_needed_by_other, packages_needed_by_other, package_dependencies, ): print_title("Installed packages:") print(", ".join(sorted(installed))) print_blank_line() print_title("No package depends on these packages:") print(", ".join(sorted(packages_not_needed_by_other))) print_blank_line() print_title("These packages are needed by other packages:") for package, needed_by in sorted(packages_needed_by_other.items()): print(f"Package {package} is needed by: {', '.join(needed_by)}") print_blank_line() print_title("These packages depend on other packages:") for package, package_dependencies in sorted(package_dependencies.items()): print( f"Package {package} depends on: {', '.join(package_dependencies)}", ) print_blank_line() Use and extra level of indentation for funcion arguments See: https://www.python.org/dev/peps/pep-0008/#indentationUNDERLINE_SYMBOL = "-" def print_title(logline): print(logline) print(len(logline) * UNDERLINE_SYMBOL) def print_blank_line(): print("") def print_overview( installed, packages_not_needed_by_other, packages_needed_by_other, package_dependencies): print_title("Installed packages:") print(", ".join(sorted(installed))) print_blank_line() print_title("No package depends on these packages:") print(", ".join(sorted(packages_not_needed_by_other))) print_blank_line() print_title("These packages are needed by other packages:") for package, needed_by in sorted(packages_needed_by_other.items()): print(f"Package {package} is needed by: {', '.join(needed_by)}") print_blank_line() print_title("These packages depend on other packages:") for package, package_dependencies in sorted(package_dependencies.items()): print( f"Package {package} depends on: {', '.join(package_dependencies)}", ) print_blank_line()
<commit_before>UNDERLINE_SYMBOL = "-" def print_title(logline): print(logline) print(len(logline) * UNDERLINE_SYMBOL) def print_blank_line(): print("") def print_overview( installed, packages_not_needed_by_other, packages_needed_by_other, package_dependencies, ): print_title("Installed packages:") print(", ".join(sorted(installed))) print_blank_line() print_title("No package depends on these packages:") print(", ".join(sorted(packages_not_needed_by_other))) print_blank_line() print_title("These packages are needed by other packages:") for package, needed_by in sorted(packages_needed_by_other.items()): print(f"Package {package} is needed by: {', '.join(needed_by)}") print_blank_line() print_title("These packages depend on other packages:") for package, package_dependencies in sorted(package_dependencies.items()): print( f"Package {package} depends on: {', '.join(package_dependencies)}", ) print_blank_line() <commit_msg>Use and extra level of indentation for funcion arguments See: https://www.python.org/dev/peps/pep-0008/#indentation<commit_after>UNDERLINE_SYMBOL = "-" def print_title(logline): print(logline) print(len(logline) * UNDERLINE_SYMBOL) def print_blank_line(): print("") def print_overview( installed, packages_not_needed_by_other, packages_needed_by_other, package_dependencies): print_title("Installed packages:") print(", ".join(sorted(installed))) print_blank_line() print_title("No package depends on these packages:") print(", ".join(sorted(packages_not_needed_by_other))) print_blank_line() print_title("These packages are needed by other packages:") for package, needed_by in sorted(packages_needed_by_other.items()): print(f"Package {package} is needed by: {', '.join(needed_by)}") print_blank_line() print_title("These packages depend on other packages:") for package, package_dependencies in sorted(package_dependencies.items()): print( f"Package {package} depends on: {', '.join(package_dependencies)}", ) print_blank_line()
38a6b7b4e190905ef935eec29fae761130dbef35
employees/admin.py
employees/admin.py
from django.contrib import admin from .models import Employee, Role class RoleAdmin(admin.ModelAdmin): list_display = ("name",) class EmployeeAdmin(admin.ModelAdmin): list_display = ("username", "email",) fieldsets = ( (None, {'fields': ('username', 'email', 'password')}), ('Personal info', {'fields': ('first_name', 'last_name', 'role', 'skype_id', 'avatar')}), ('Personal score', {'fields': ('last_month_score', 'current_month_score', 'level', 'total_score')}), ('Permissions', {'fields': ('groups', 'user_permissions', 'is_superuser', 'is_staff', 'is_active',)}), ('History', {'fields': ('date_joined', 'last_login')}) ) admin.site.register(Employee, EmployeeAdmin) admin.site.register(Role, RoleAdmin)
from django.contrib import admin from .models import Employee, Role class RoleAdmin(admin.ModelAdmin): list_display = ("name",) class EmployeeAdmin(admin.ModelAdmin): list_display = ("username", "first_name", "last_name", "email",) fieldsets = ( (None, {'fields': ('username', 'email', 'password')}), ('Personal info', {'fields': ('first_name', 'last_name', 'role', 'skype_id', 'avatar')}), ('Personal score', {'fields': ('last_month_score', 'current_month_score', 'level', 'total_score')}), ('Permissions', {'fields': ('groups', 'user_permissions', 'is_superuser', 'is_staff', 'is_active',)}), ('History', {'fields': ('date_joined', 'last_login')}) ) admin.site.register(Employee, EmployeeAdmin) admin.site.register(Role, RoleAdmin)
Add first name and last name to Admin employee list
Add first name and last name to Admin employee list
Python
mit
neosergio/allstars
from django.contrib import admin from .models import Employee, Role class RoleAdmin(admin.ModelAdmin): list_display = ("name",) class EmployeeAdmin(admin.ModelAdmin): list_display = ("username", "email",) fieldsets = ( (None, {'fields': ('username', 'email', 'password')}), ('Personal info', {'fields': ('first_name', 'last_name', 'role', 'skype_id', 'avatar')}), ('Personal score', {'fields': ('last_month_score', 'current_month_score', 'level', 'total_score')}), ('Permissions', {'fields': ('groups', 'user_permissions', 'is_superuser', 'is_staff', 'is_active',)}), ('History', {'fields': ('date_joined', 'last_login')}) ) admin.site.register(Employee, EmployeeAdmin) admin.site.register(Role, RoleAdmin)Add first name and last name to Admin employee list
from django.contrib import admin from .models import Employee, Role class RoleAdmin(admin.ModelAdmin): list_display = ("name",) class EmployeeAdmin(admin.ModelAdmin): list_display = ("username", "first_name", "last_name", "email",) fieldsets = ( (None, {'fields': ('username', 'email', 'password')}), ('Personal info', {'fields': ('first_name', 'last_name', 'role', 'skype_id', 'avatar')}), ('Personal score', {'fields': ('last_month_score', 'current_month_score', 'level', 'total_score')}), ('Permissions', {'fields': ('groups', 'user_permissions', 'is_superuser', 'is_staff', 'is_active',)}), ('History', {'fields': ('date_joined', 'last_login')}) ) admin.site.register(Employee, EmployeeAdmin) admin.site.register(Role, RoleAdmin)
<commit_before>from django.contrib import admin from .models import Employee, Role class RoleAdmin(admin.ModelAdmin): list_display = ("name",) class EmployeeAdmin(admin.ModelAdmin): list_display = ("username", "email",) fieldsets = ( (None, {'fields': ('username', 'email', 'password')}), ('Personal info', {'fields': ('first_name', 'last_name', 'role', 'skype_id', 'avatar')}), ('Personal score', {'fields': ('last_month_score', 'current_month_score', 'level', 'total_score')}), ('Permissions', {'fields': ('groups', 'user_permissions', 'is_superuser', 'is_staff', 'is_active',)}), ('History', {'fields': ('date_joined', 'last_login')}) ) admin.site.register(Employee, EmployeeAdmin) admin.site.register(Role, RoleAdmin)<commit_msg>Add first name and last name to Admin employee list<commit_after>
from django.contrib import admin from .models import Employee, Role class RoleAdmin(admin.ModelAdmin): list_display = ("name",) class EmployeeAdmin(admin.ModelAdmin): list_display = ("username", "first_name", "last_name", "email",) fieldsets = ( (None, {'fields': ('username', 'email', 'password')}), ('Personal info', {'fields': ('first_name', 'last_name', 'role', 'skype_id', 'avatar')}), ('Personal score', {'fields': ('last_month_score', 'current_month_score', 'level', 'total_score')}), ('Permissions', {'fields': ('groups', 'user_permissions', 'is_superuser', 'is_staff', 'is_active',)}), ('History', {'fields': ('date_joined', 'last_login')}) ) admin.site.register(Employee, EmployeeAdmin) admin.site.register(Role, RoleAdmin)
from django.contrib import admin from .models import Employee, Role class RoleAdmin(admin.ModelAdmin): list_display = ("name",) class EmployeeAdmin(admin.ModelAdmin): list_display = ("username", "email",) fieldsets = ( (None, {'fields': ('username', 'email', 'password')}), ('Personal info', {'fields': ('first_name', 'last_name', 'role', 'skype_id', 'avatar')}), ('Personal score', {'fields': ('last_month_score', 'current_month_score', 'level', 'total_score')}), ('Permissions', {'fields': ('groups', 'user_permissions', 'is_superuser', 'is_staff', 'is_active',)}), ('History', {'fields': ('date_joined', 'last_login')}) ) admin.site.register(Employee, EmployeeAdmin) admin.site.register(Role, RoleAdmin)Add first name and last name to Admin employee listfrom django.contrib import admin from .models import Employee, Role class RoleAdmin(admin.ModelAdmin): list_display = ("name",) class EmployeeAdmin(admin.ModelAdmin): list_display = ("username", "first_name", "last_name", "email",) fieldsets = ( (None, {'fields': ('username', 'email', 'password')}), ('Personal info', {'fields': ('first_name', 'last_name', 'role', 'skype_id', 'avatar')}), ('Personal score', {'fields': ('last_month_score', 'current_month_score', 'level', 'total_score')}), ('Permissions', {'fields': ('groups', 'user_permissions', 'is_superuser', 'is_staff', 'is_active',)}), ('History', {'fields': ('date_joined', 'last_login')}) ) admin.site.register(Employee, EmployeeAdmin) admin.site.register(Role, RoleAdmin)
<commit_before>from django.contrib import admin from .models import Employee, Role class RoleAdmin(admin.ModelAdmin): list_display = ("name",) class EmployeeAdmin(admin.ModelAdmin): list_display = ("username", "email",) fieldsets = ( (None, {'fields': ('username', 'email', 'password')}), ('Personal info', {'fields': ('first_name', 'last_name', 'role', 'skype_id', 'avatar')}), ('Personal score', {'fields': ('last_month_score', 'current_month_score', 'level', 'total_score')}), ('Permissions', {'fields': ('groups', 'user_permissions', 'is_superuser', 'is_staff', 'is_active',)}), ('History', {'fields': ('date_joined', 'last_login')}) ) admin.site.register(Employee, EmployeeAdmin) admin.site.register(Role, RoleAdmin)<commit_msg>Add first name and last name to Admin employee list<commit_after>from django.contrib import admin from .models import Employee, Role class RoleAdmin(admin.ModelAdmin): list_display = ("name",) class EmployeeAdmin(admin.ModelAdmin): list_display = ("username", "first_name", "last_name", "email",) fieldsets = ( (None, {'fields': ('username', 'email', 'password')}), ('Personal info', {'fields': ('first_name', 'last_name', 'role', 'skype_id', 'avatar')}), ('Personal score', {'fields': ('last_month_score', 'current_month_score', 'level', 'total_score')}), ('Permissions', {'fields': ('groups', 'user_permissions', 'is_superuser', 'is_staff', 'is_active',)}), ('History', {'fields': ('date_joined', 'last_login')}) ) admin.site.register(Employee, EmployeeAdmin) admin.site.register(Role, RoleAdmin)
d66b9ecd1a28042ab6511c99b4cba38480b1b96e
fpsd/test/test_sketchy_sites.py
fpsd/test/test_sketchy_sites.py
#!/usr/bin/env python3.5 # This test crawls some sets that have triggered http.client.RemoteDisconnected # exceptions import unittest from crawler import Crawler class CrawlBadSitesTest(unittest.TestCase): bad_sites = ["http://jlve2diknf45qwjv.onion/", "http://money2mxtcfcauot.onion", "http://22222222aziwzse2.onion"] def test_crawl_of_bad_sites(self): with Crawler(restart_on_sketchy_exception=True) as crawler: crawler.collect_set_of_traces(self.bad_sites) if __name__ == "__main__": unittest.main()
#!/usr/bin/env python3.5 # This test crawls some sets that have triggered http.client.RemoteDisconnected # exceptions import unittest from crawler import Crawler class CrawlBadSitesTest(unittest.TestCase): bad_sites = ["http://jlve2diknf45qwjv.onion/", "http://money2mxtcfcauot.onion", "http://22222222aziwzse2.onion", "http://xnsoeplvch4fhk3s.onion", "http://uptgsidhuvcsquoi.onion", "http://cubie3atuvex2gdw.onion"] def test_crawl_of_bad_sites(self): with Crawler(restart_on_sketchy_exception=True) as crawler: crawler.collect_set_of_traces(self.bad_sites) if __name__ == "__main__": unittest.main()
Add more sites that cause unusual errors
Add more sites that cause unusual errors
Python
agpl-3.0
freedomofpress/fingerprint-securedrop,freedomofpress/FingerprintSecureDrop,freedomofpress/FingerprintSecureDrop,freedomofpress/fingerprint-securedrop,freedomofpress/fingerprint-securedrop
#!/usr/bin/env python3.5 # This test crawls some sets that have triggered http.client.RemoteDisconnected # exceptions import unittest from crawler import Crawler class CrawlBadSitesTest(unittest.TestCase): bad_sites = ["http://jlve2diknf45qwjv.onion/", "http://money2mxtcfcauot.onion", "http://22222222aziwzse2.onion"] def test_crawl_of_bad_sites(self): with Crawler(restart_on_sketchy_exception=True) as crawler: crawler.collect_set_of_traces(self.bad_sites) if __name__ == "__main__": unittest.main() Add more sites that cause unusual errors
#!/usr/bin/env python3.5 # This test crawls some sets that have triggered http.client.RemoteDisconnected # exceptions import unittest from crawler import Crawler class CrawlBadSitesTest(unittest.TestCase): bad_sites = ["http://jlve2diknf45qwjv.onion/", "http://money2mxtcfcauot.onion", "http://22222222aziwzse2.onion", "http://xnsoeplvch4fhk3s.onion", "http://uptgsidhuvcsquoi.onion", "http://cubie3atuvex2gdw.onion"] def test_crawl_of_bad_sites(self): with Crawler(restart_on_sketchy_exception=True) as crawler: crawler.collect_set_of_traces(self.bad_sites) if __name__ == "__main__": unittest.main()
<commit_before>#!/usr/bin/env python3.5 # This test crawls some sets that have triggered http.client.RemoteDisconnected # exceptions import unittest from crawler import Crawler class CrawlBadSitesTest(unittest.TestCase): bad_sites = ["http://jlve2diknf45qwjv.onion/", "http://money2mxtcfcauot.onion", "http://22222222aziwzse2.onion"] def test_crawl_of_bad_sites(self): with Crawler(restart_on_sketchy_exception=True) as crawler: crawler.collect_set_of_traces(self.bad_sites) if __name__ == "__main__": unittest.main() <commit_msg>Add more sites that cause unusual errors<commit_after>
#!/usr/bin/env python3.5 # This test crawls some sets that have triggered http.client.RemoteDisconnected # exceptions import unittest from crawler import Crawler class CrawlBadSitesTest(unittest.TestCase): bad_sites = ["http://jlve2diknf45qwjv.onion/", "http://money2mxtcfcauot.onion", "http://22222222aziwzse2.onion", "http://xnsoeplvch4fhk3s.onion", "http://uptgsidhuvcsquoi.onion", "http://cubie3atuvex2gdw.onion"] def test_crawl_of_bad_sites(self): with Crawler(restart_on_sketchy_exception=True) as crawler: crawler.collect_set_of_traces(self.bad_sites) if __name__ == "__main__": unittest.main()
#!/usr/bin/env python3.5 # This test crawls some sets that have triggered http.client.RemoteDisconnected # exceptions import unittest from crawler import Crawler class CrawlBadSitesTest(unittest.TestCase): bad_sites = ["http://jlve2diknf45qwjv.onion/", "http://money2mxtcfcauot.onion", "http://22222222aziwzse2.onion"] def test_crawl_of_bad_sites(self): with Crawler(restart_on_sketchy_exception=True) as crawler: crawler.collect_set_of_traces(self.bad_sites) if __name__ == "__main__": unittest.main() Add more sites that cause unusual errors#!/usr/bin/env python3.5 # This test crawls some sets that have triggered http.client.RemoteDisconnected # exceptions import unittest from crawler import Crawler class CrawlBadSitesTest(unittest.TestCase): bad_sites = ["http://jlve2diknf45qwjv.onion/", "http://money2mxtcfcauot.onion", "http://22222222aziwzse2.onion", "http://xnsoeplvch4fhk3s.onion", "http://uptgsidhuvcsquoi.onion", "http://cubie3atuvex2gdw.onion"] def test_crawl_of_bad_sites(self): with Crawler(restart_on_sketchy_exception=True) as crawler: crawler.collect_set_of_traces(self.bad_sites) if __name__ == "__main__": unittest.main()
<commit_before>#!/usr/bin/env python3.5 # This test crawls some sets that have triggered http.client.RemoteDisconnected # exceptions import unittest from crawler import Crawler class CrawlBadSitesTest(unittest.TestCase): bad_sites = ["http://jlve2diknf45qwjv.onion/", "http://money2mxtcfcauot.onion", "http://22222222aziwzse2.onion"] def test_crawl_of_bad_sites(self): with Crawler(restart_on_sketchy_exception=True) as crawler: crawler.collect_set_of_traces(self.bad_sites) if __name__ == "__main__": unittest.main() <commit_msg>Add more sites that cause unusual errors<commit_after>#!/usr/bin/env python3.5 # This test crawls some sets that have triggered http.client.RemoteDisconnected # exceptions import unittest from crawler import Crawler class CrawlBadSitesTest(unittest.TestCase): bad_sites = ["http://jlve2diknf45qwjv.onion/", "http://money2mxtcfcauot.onion", "http://22222222aziwzse2.onion", "http://xnsoeplvch4fhk3s.onion", "http://uptgsidhuvcsquoi.onion", "http://cubie3atuvex2gdw.onion"] def test_crawl_of_bad_sites(self): with Crawler(restart_on_sketchy_exception=True) as crawler: crawler.collect_set_of_traces(self.bad_sites) if __name__ == "__main__": unittest.main()
790b8850599a80cbb7dda0bcadb34cdb41dd5423
st2client/st2client/__init__.py
st2client/st2client/__init__.py
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. __version__ = '0.10dev'
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. __version__ = '0.13dev'
Update st2client version to 0.13dev
Update st2client version to 0.13dev
Python
apache-2.0
tonybaloney/st2,peak6/st2,peak6/st2,Itxaka/st2,Plexxi/st2,nzlosh/st2,nzlosh/st2,StackStorm/st2,StackStorm/st2,Itxaka/st2,Plexxi/st2,Itxaka/st2,tonybaloney/st2,pixelrebel/st2,armab/st2,dennybaa/st2,Plexxi/st2,armab/st2,pixelrebel/st2,alfasin/st2,nzlosh/st2,punalpatel/st2,emedvedev/st2,punalpatel/st2,pixelrebel/st2,emedvedev/st2,peak6/st2,nzlosh/st2,Plexxi/st2,dennybaa/st2,StackStorm/st2,armab/st2,emedvedev/st2,StackStorm/st2,tonybaloney/st2,punalpatel/st2,lakshmi-kannan/st2,lakshmi-kannan/st2,alfasin/st2,alfasin/st2,lakshmi-kannan/st2,dennybaa/st2
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. __version__ = '0.10dev' Update st2client version to 0.13dev
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. __version__ = '0.13dev'
<commit_before># Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. __version__ = '0.10dev' <commit_msg>Update st2client version to 0.13dev<commit_after>
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. __version__ = '0.13dev'
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. __version__ = '0.10dev' Update st2client version to 0.13dev# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. __version__ = '0.13dev'
<commit_before># Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. __version__ = '0.10dev' <commit_msg>Update st2client version to 0.13dev<commit_after># Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. __version__ = '0.13dev'
efb82776d08e8f8003d8038a4fcac52094bd8f86
readthedocs/core/management/commands/symlink.py
readthedocs/core/management/commands/symlink.py
import logging from django.core.management.base import BaseCommand from django.conf import settings from projects import tasks from tastyapi import apiv2 as api import redis log = logging.getLogger(__name__) def symlink(slug): version_data = api.version().get(project=slug, slug='latest')['results'][0] v = tasks.make_api_version(version_data) log.info("Symlinking %s" % v) tasks.symlink_subprojects(v) tasks.symlink_cnames(v) tasks.symlink_translations(v) class Command(BaseCommand): def handle(self, *args, **options): if len(args): for slug in args: symlink(slug) else: redis_conn = redis.Redis(**settings.REDIS) slugs = redis_conn.keys('rtd_slug:v1:*') for slug in slugs: log.info("Got slug from redis: %s" % slug) symlink(slug)
import logging from django.core.management.base import BaseCommand from django.conf import settings from projects import tasks from tastyapi import apiv2 as api import redis log = logging.getLogger(__name__) def symlink(slug): version_data = api.version().get(project=slug, slug='latest')['results'][0] v = tasks.make_api_version(version_data) log.info("Symlinking %s" % v) tasks.symlink_subprojects(v) tasks.symlink_cnames(v) tasks.symlink_translations(v) class Command(BaseCommand): def handle(self, *args, **options): if len(args): for slug in args: symlink(slug) else: redis_conn = redis.Redis(**settings.REDIS) slugs = redis_conn.keys('rtd_slug:v1:*') slugs = [slug.replace("rtd_slug:v1:", "") for slug in slugs] for slug in slugs: try: log.info("Got slug from redis: %s" % slug) symlink(slug) except Exception, e: print e
Handle exceptions and use proper slug
Handle exceptions and use proper slug
Python
mit
clarkperkins/readthedocs.org,rtfd/readthedocs.org,SteveViss/readthedocs.org,mrshoki/readthedocs.org,CedarLogic/readthedocs.org,sid-kap/readthedocs.org,sid-kap/readthedocs.org,hach-que/readthedocs.org,kenshinthebattosai/readthedocs.org,nikolas/readthedocs.org,GovReady/readthedocs.org,davidfischer/readthedocs.org,nyergler/pythonslides,asampat3090/readthedocs.org,wijerasa/readthedocs.org,atsuyim/readthedocs.org,espdev/readthedocs.org,emawind84/readthedocs.org,nikolas/readthedocs.org,CedarLogic/readthedocs.org,SteveViss/readthedocs.org,hach-que/readthedocs.org,SteveViss/readthedocs.org,d0ugal/readthedocs.org,istresearch/readthedocs.org,dirn/readthedocs.org,sils1297/readthedocs.org,pombredanne/readthedocs.org,gjtorikian/readthedocs.org,rtfd/readthedocs.org,SteveViss/readthedocs.org,titiushko/readthedocs.org,GovReady/readthedocs.org,michaelmcandrew/readthedocs.org,kdkeyser/readthedocs.org,clarkperkins/readthedocs.org,atsuyim/readthedocs.org,singingwolfboy/readthedocs.org,KamranMackey/readthedocs.org,dirn/readthedocs.org,safwanrahman/readthedocs.org,singingwolfboy/readthedocs.org,fujita-shintaro/readthedocs.org,Tazer/readthedocs.org,raven47git/readthedocs.org,soulshake/readthedocs.org,sunnyzwh/readthedocs.org,agjohnson/readthedocs.org,cgourlay/readthedocs.org,titiushko/readthedocs.org,davidfischer/readthedocs.org,espdev/readthedocs.org,raven47git/readthedocs.org,espdev/readthedocs.org,kdkeyser/readthedocs.org,kenshinthebattosai/readthedocs.org,singingwolfboy/readthedocs.org,davidfischer/readthedocs.org,soulshake/readthedocs.org,CedarLogic/readthedocs.org,agjohnson/readthedocs.org,d0ugal/readthedocs.org,kenwang76/readthedocs.org,royalwang/readthedocs.org,pombredanne/readthedocs.org,jerel/readthedocs.org,clarkperkins/readthedocs.org,istresearch/readthedocs.org,asampat3090/readthedocs.org,takluyver/readthedocs.org,royalwang/readthedocs.org,kenshinthebattosai/readthedocs.org,stevepiercy/readthedocs.org,attakei/readthedocs-oauth,mrshoki/readthedocs.org,cgourlay/readthedocs.org,raven47git/readthedocs.org,cgourlay/readthedocs.org,Carreau/readthedocs.org,mrshoki/readthedocs.org,GovReady/readthedocs.org,istresearch/readthedocs.org,Tazer/readthedocs.org,mhils/readthedocs.org,Carreau/readthedocs.org,clarkperkins/readthedocs.org,laplaceliu/readthedocs.org,Carreau/readthedocs.org,atsuyim/readthedocs.org,kenwang76/readthedocs.org,kenwang76/readthedocs.org,hach-que/readthedocs.org,mhils/readthedocs.org,agjohnson/readthedocs.org,fujita-shintaro/readthedocs.org,LukasBoersma/readthedocs.org,stevepiercy/readthedocs.org,attakei/readthedocs-oauth,kdkeyser/readthedocs.org,soulshake/readthedocs.org,hach-que/readthedocs.org,sid-kap/readthedocs.org,VishvajitP/readthedocs.org,gjtorikian/readthedocs.org,tddv/readthedocs.org,KamranMackey/readthedocs.org,takluyver/readthedocs.org,titiushko/readthedocs.org,sid-kap/readthedocs.org,KamranMackey/readthedocs.org,laplaceliu/readthedocs.org,VishvajitP/readthedocs.org,nyergler/pythonslides,asampat3090/readthedocs.org,Carreau/readthedocs.org,GovReady/readthedocs.org,emawind84/readthedocs.org,jerel/readthedocs.org,sils1297/readthedocs.org,laplaceliu/readthedocs.org,LukasBoersma/readthedocs.org,CedarLogic/readthedocs.org,raven47git/readthedocs.org,kdkeyser/readthedocs.org,sunnyzwh/readthedocs.org,wijerasa/readthedocs.org,wanghaven/readthedocs.org,techtonik/readthedocs.org,nikolas/readthedocs.org,rtfd/readthedocs.org,mhils/readthedocs.org,techtonik/readthedocs.org,emawind84/readthedocs.org,gjtorikian/readthedocs.org,gjtorikian/readthedocs.org,cgourlay/readthedocs.org,wanghaven/readthedocs.org,rtfd/readthedocs.org,takluyver/readthedocs.org,tddv/readthedocs.org,pombredanne/readthedocs.org,VishvajitP/readthedocs.org,wijerasa/readthedocs.org,LukasBoersma/readthedocs.org,mrshoki/readthedocs.org,Tazer/readthedocs.org,wijerasa/readthedocs.org,michaelmcandrew/readthedocs.org,kenshinthebattosai/readthedocs.org,d0ugal/readthedocs.org,titiushko/readthedocs.org,techtonik/readthedocs.org,techtonik/readthedocs.org,stevepiercy/readthedocs.org,davidfischer/readthedocs.org,dirn/readthedocs.org,attakei/readthedocs-oauth,asampat3090/readthedocs.org,sils1297/readthedocs.org,kenwang76/readthedocs.org,nikolas/readthedocs.org,sunnyzwh/readthedocs.org,fujita-shintaro/readthedocs.org,istresearch/readthedocs.org,attakei/readthedocs-oauth,KamranMackey/readthedocs.org,tddv/readthedocs.org,agjohnson/readthedocs.org,fujita-shintaro/readthedocs.org,LukasBoersma/readthedocs.org,sils1297/readthedocs.org,michaelmcandrew/readthedocs.org,dirn/readthedocs.org,espdev/readthedocs.org,stevepiercy/readthedocs.org,royalwang/readthedocs.org,singingwolfboy/readthedocs.org,royalwang/readthedocs.org,wanghaven/readthedocs.org,emawind84/readthedocs.org,laplaceliu/readthedocs.org,soulshake/readthedocs.org,mhils/readthedocs.org,safwanrahman/readthedocs.org,sunnyzwh/readthedocs.org,wanghaven/readthedocs.org,atsuyim/readthedocs.org,Tazer/readthedocs.org,nyergler/pythonslides,jerel/readthedocs.org,safwanrahman/readthedocs.org,nyergler/pythonslides,michaelmcandrew/readthedocs.org,safwanrahman/readthedocs.org,VishvajitP/readthedocs.org,jerel/readthedocs.org,d0ugal/readthedocs.org,espdev/readthedocs.org,takluyver/readthedocs.org
import logging from django.core.management.base import BaseCommand from django.conf import settings from projects import tasks from tastyapi import apiv2 as api import redis log = logging.getLogger(__name__) def symlink(slug): version_data = api.version().get(project=slug, slug='latest')['results'][0] v = tasks.make_api_version(version_data) log.info("Symlinking %s" % v) tasks.symlink_subprojects(v) tasks.symlink_cnames(v) tasks.symlink_translations(v) class Command(BaseCommand): def handle(self, *args, **options): if len(args): for slug in args: symlink(slug) else: redis_conn = redis.Redis(**settings.REDIS) slugs = redis_conn.keys('rtd_slug:v1:*') for slug in slugs: log.info("Got slug from redis: %s" % slug) symlink(slug) Handle exceptions and use proper slug
import logging from django.core.management.base import BaseCommand from django.conf import settings from projects import tasks from tastyapi import apiv2 as api import redis log = logging.getLogger(__name__) def symlink(slug): version_data = api.version().get(project=slug, slug='latest')['results'][0] v = tasks.make_api_version(version_data) log.info("Symlinking %s" % v) tasks.symlink_subprojects(v) tasks.symlink_cnames(v) tasks.symlink_translations(v) class Command(BaseCommand): def handle(self, *args, **options): if len(args): for slug in args: symlink(slug) else: redis_conn = redis.Redis(**settings.REDIS) slugs = redis_conn.keys('rtd_slug:v1:*') slugs = [slug.replace("rtd_slug:v1:", "") for slug in slugs] for slug in slugs: try: log.info("Got slug from redis: %s" % slug) symlink(slug) except Exception, e: print e
<commit_before>import logging from django.core.management.base import BaseCommand from django.conf import settings from projects import tasks from tastyapi import apiv2 as api import redis log = logging.getLogger(__name__) def symlink(slug): version_data = api.version().get(project=slug, slug='latest')['results'][0] v = tasks.make_api_version(version_data) log.info("Symlinking %s" % v) tasks.symlink_subprojects(v) tasks.symlink_cnames(v) tasks.symlink_translations(v) class Command(BaseCommand): def handle(self, *args, **options): if len(args): for slug in args: symlink(slug) else: redis_conn = redis.Redis(**settings.REDIS) slugs = redis_conn.keys('rtd_slug:v1:*') for slug in slugs: log.info("Got slug from redis: %s" % slug) symlink(slug) <commit_msg>Handle exceptions and use proper slug<commit_after>
import logging from django.core.management.base import BaseCommand from django.conf import settings from projects import tasks from tastyapi import apiv2 as api import redis log = logging.getLogger(__name__) def symlink(slug): version_data = api.version().get(project=slug, slug='latest')['results'][0] v = tasks.make_api_version(version_data) log.info("Symlinking %s" % v) tasks.symlink_subprojects(v) tasks.symlink_cnames(v) tasks.symlink_translations(v) class Command(BaseCommand): def handle(self, *args, **options): if len(args): for slug in args: symlink(slug) else: redis_conn = redis.Redis(**settings.REDIS) slugs = redis_conn.keys('rtd_slug:v1:*') slugs = [slug.replace("rtd_slug:v1:", "") for slug in slugs] for slug in slugs: try: log.info("Got slug from redis: %s" % slug) symlink(slug) except Exception, e: print e
import logging from django.core.management.base import BaseCommand from django.conf import settings from projects import tasks from tastyapi import apiv2 as api import redis log = logging.getLogger(__name__) def symlink(slug): version_data = api.version().get(project=slug, slug='latest')['results'][0] v = tasks.make_api_version(version_data) log.info("Symlinking %s" % v) tasks.symlink_subprojects(v) tasks.symlink_cnames(v) tasks.symlink_translations(v) class Command(BaseCommand): def handle(self, *args, **options): if len(args): for slug in args: symlink(slug) else: redis_conn = redis.Redis(**settings.REDIS) slugs = redis_conn.keys('rtd_slug:v1:*') for slug in slugs: log.info("Got slug from redis: %s" % slug) symlink(slug) Handle exceptions and use proper slugimport logging from django.core.management.base import BaseCommand from django.conf import settings from projects import tasks from tastyapi import apiv2 as api import redis log = logging.getLogger(__name__) def symlink(slug): version_data = api.version().get(project=slug, slug='latest')['results'][0] v = tasks.make_api_version(version_data) log.info("Symlinking %s" % v) tasks.symlink_subprojects(v) tasks.symlink_cnames(v) tasks.symlink_translations(v) class Command(BaseCommand): def handle(self, *args, **options): if len(args): for slug in args: symlink(slug) else: redis_conn = redis.Redis(**settings.REDIS) slugs = redis_conn.keys('rtd_slug:v1:*') slugs = [slug.replace("rtd_slug:v1:", "") for slug in slugs] for slug in slugs: try: log.info("Got slug from redis: %s" % slug) symlink(slug) except Exception, e: print e
<commit_before>import logging from django.core.management.base import BaseCommand from django.conf import settings from projects import tasks from tastyapi import apiv2 as api import redis log = logging.getLogger(__name__) def symlink(slug): version_data = api.version().get(project=slug, slug='latest')['results'][0] v = tasks.make_api_version(version_data) log.info("Symlinking %s" % v) tasks.symlink_subprojects(v) tasks.symlink_cnames(v) tasks.symlink_translations(v) class Command(BaseCommand): def handle(self, *args, **options): if len(args): for slug in args: symlink(slug) else: redis_conn = redis.Redis(**settings.REDIS) slugs = redis_conn.keys('rtd_slug:v1:*') for slug in slugs: log.info("Got slug from redis: %s" % slug) symlink(slug) <commit_msg>Handle exceptions and use proper slug<commit_after>import logging from django.core.management.base import BaseCommand from django.conf import settings from projects import tasks from tastyapi import apiv2 as api import redis log = logging.getLogger(__name__) def symlink(slug): version_data = api.version().get(project=slug, slug='latest')['results'][0] v = tasks.make_api_version(version_data) log.info("Symlinking %s" % v) tasks.symlink_subprojects(v) tasks.symlink_cnames(v) tasks.symlink_translations(v) class Command(BaseCommand): def handle(self, *args, **options): if len(args): for slug in args: symlink(slug) else: redis_conn = redis.Redis(**settings.REDIS) slugs = redis_conn.keys('rtd_slug:v1:*') slugs = [slug.replace("rtd_slug:v1:", "") for slug in slugs] for slug in slugs: try: log.info("Got slug from redis: %s" % slug) symlink(slug) except Exception, e: print e
446680c789ad970316209eeecc947d8e5afddeb7
jenny/__init__.py
jenny/__init__.py
# coding=utf8 """ Copyright 2015 jenny """ import pandoc import subprocess def compile(content, input_format, output_format, *args): subprocess_arguments = ['pandoc', '--from=%s' % input_format, '--to=%s' % output_format] subprocess_arguments.extend(args) p = subprocess.Popen( subprocess_arguments, stdin=subprocess.PIPE, stdout=subprocess.PIPE ) return p.communicate(content)[0]
# coding=utf8 """ Copyright 2015 jenny """ import six import pandoc import subprocess def compile(content, input_format, output_format, *args): if six.PY2 and isinstance(content, unicode): content = content.encode("utf8") subprocess_arguments = ['pandoc', '--from=%s' % input_format, '--to=%s' % output_format] subprocess_arguments.extend(args) p = subprocess.Popen( subprocess_arguments, stdin=subprocess.PIPE, stdout=subprocess.PIPE ) return p.communicate(content)[0]
Fix a bug on encoding.
Fix a bug on encoding.
Python
mit
docloud/jenny
# coding=utf8 """ Copyright 2015 jenny """ import pandoc import subprocess def compile(content, input_format, output_format, *args): subprocess_arguments = ['pandoc', '--from=%s' % input_format, '--to=%s' % output_format] subprocess_arguments.extend(args) p = subprocess.Popen( subprocess_arguments, stdin=subprocess.PIPE, stdout=subprocess.PIPE ) return p.communicate(content)[0] Fix a bug on encoding.
# coding=utf8 """ Copyright 2015 jenny """ import six import pandoc import subprocess def compile(content, input_format, output_format, *args): if six.PY2 and isinstance(content, unicode): content = content.encode("utf8") subprocess_arguments = ['pandoc', '--from=%s' % input_format, '--to=%s' % output_format] subprocess_arguments.extend(args) p = subprocess.Popen( subprocess_arguments, stdin=subprocess.PIPE, stdout=subprocess.PIPE ) return p.communicate(content)[0]
<commit_before># coding=utf8 """ Copyright 2015 jenny """ import pandoc import subprocess def compile(content, input_format, output_format, *args): subprocess_arguments = ['pandoc', '--from=%s' % input_format, '--to=%s' % output_format] subprocess_arguments.extend(args) p = subprocess.Popen( subprocess_arguments, stdin=subprocess.PIPE, stdout=subprocess.PIPE ) return p.communicate(content)[0] <commit_msg>Fix a bug on encoding.<commit_after>
# coding=utf8 """ Copyright 2015 jenny """ import six import pandoc import subprocess def compile(content, input_format, output_format, *args): if six.PY2 and isinstance(content, unicode): content = content.encode("utf8") subprocess_arguments = ['pandoc', '--from=%s' % input_format, '--to=%s' % output_format] subprocess_arguments.extend(args) p = subprocess.Popen( subprocess_arguments, stdin=subprocess.PIPE, stdout=subprocess.PIPE ) return p.communicate(content)[0]
# coding=utf8 """ Copyright 2015 jenny """ import pandoc import subprocess def compile(content, input_format, output_format, *args): subprocess_arguments = ['pandoc', '--from=%s' % input_format, '--to=%s' % output_format] subprocess_arguments.extend(args) p = subprocess.Popen( subprocess_arguments, stdin=subprocess.PIPE, stdout=subprocess.PIPE ) return p.communicate(content)[0] Fix a bug on encoding.# coding=utf8 """ Copyright 2015 jenny """ import six import pandoc import subprocess def compile(content, input_format, output_format, *args): if six.PY2 and isinstance(content, unicode): content = content.encode("utf8") subprocess_arguments = ['pandoc', '--from=%s' % input_format, '--to=%s' % output_format] subprocess_arguments.extend(args) p = subprocess.Popen( subprocess_arguments, stdin=subprocess.PIPE, stdout=subprocess.PIPE ) return p.communicate(content)[0]
<commit_before># coding=utf8 """ Copyright 2015 jenny """ import pandoc import subprocess def compile(content, input_format, output_format, *args): subprocess_arguments = ['pandoc', '--from=%s' % input_format, '--to=%s' % output_format] subprocess_arguments.extend(args) p = subprocess.Popen( subprocess_arguments, stdin=subprocess.PIPE, stdout=subprocess.PIPE ) return p.communicate(content)[0] <commit_msg>Fix a bug on encoding.<commit_after># coding=utf8 """ Copyright 2015 jenny """ import six import pandoc import subprocess def compile(content, input_format, output_format, *args): if six.PY2 and isinstance(content, unicode): content = content.encode("utf8") subprocess_arguments = ['pandoc', '--from=%s' % input_format, '--to=%s' % output_format] subprocess_arguments.extend(args) p = subprocess.Popen( subprocess_arguments, stdin=subprocess.PIPE, stdout=subprocess.PIPE ) return p.communicate(content)[0]
41d9f8494bd7003f92af94b8b45bc78c9ac96e05
linter.py
linter.py
# # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Drew Brokke # Copyright (c) 2015 Drew Brokke # # License: MIT # """This module exports the CheckSourceFormatting plugin class.""" from SublimeLinter.lint import NodeLinter, util class CheckSourceFormatting(NodeLinter): """Provides an interface to check-source-formatting.""" syntax = ('javascript', 'html', 'css', 'velocity', 'freemarker', 'java server pages (jsp)', 'sass') cmd = 'check_sf @ --no-color' version_args = '--version' version_re = r'(?P<version>\d+\.\d+\.\d+)' version_requirement = '>= 1.0' regex = r'^.+?(?P<line>\d+): (?P<message>.+)' multiline = False line_col_base = (1, 1) tempfile_suffix = '-' error_stream = util.STREAM_BOTH comment_re = r'\s*/[/*]'
# # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Drew Brokke # Copyright (c) 2015 Drew Brokke # # License: MIT # """This module exports the CheckSourceFormatting plugin class.""" from SublimeLinter.lint import NodeLinter, util class CheckSourceFormatting(NodeLinter): """Provides an interface to check-source-formatting.""" syntax = ('javascript', 'html', 'css', 'velocity', 'freemarker', 'java server pages (jsp)', 'sass') cmd = 'check_sf @ --no-color' version_args = '--version' version_re = r'(?P<version>\d+\.\d+\.\d+)' version_requirement = '>= 1.0' regex = r'^.+?(?P<line>\d+).*?: (?P<message>.+)' multiline = False line_col_base = (1, 1) tempfile_suffix = '-' error_stream = util.STREAM_BOTH comment_re = r'\s*/[/*]'
Include possible additional lines in output
Include possible additional lines in output
Python
mit
drewbrokke/SublimeLinter-contrib-check-source-formatting
# # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Drew Brokke # Copyright (c) 2015 Drew Brokke # # License: MIT # """This module exports the CheckSourceFormatting plugin class.""" from SublimeLinter.lint import NodeLinter, util class CheckSourceFormatting(NodeLinter): """Provides an interface to check-source-formatting.""" syntax = ('javascript', 'html', 'css', 'velocity', 'freemarker', 'java server pages (jsp)', 'sass') cmd = 'check_sf @ --no-color' version_args = '--version' version_re = r'(?P<version>\d+\.\d+\.\d+)' version_requirement = '>= 1.0' regex = r'^.+?(?P<line>\d+): (?P<message>.+)' multiline = False line_col_base = (1, 1) tempfile_suffix = '-' error_stream = util.STREAM_BOTH comment_re = r'\s*/[/*]' Include possible additional lines in output
# # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Drew Brokke # Copyright (c) 2015 Drew Brokke # # License: MIT # """This module exports the CheckSourceFormatting plugin class.""" from SublimeLinter.lint import NodeLinter, util class CheckSourceFormatting(NodeLinter): """Provides an interface to check-source-formatting.""" syntax = ('javascript', 'html', 'css', 'velocity', 'freemarker', 'java server pages (jsp)', 'sass') cmd = 'check_sf @ --no-color' version_args = '--version' version_re = r'(?P<version>\d+\.\d+\.\d+)' version_requirement = '>= 1.0' regex = r'^.+?(?P<line>\d+).*?: (?P<message>.+)' multiline = False line_col_base = (1, 1) tempfile_suffix = '-' error_stream = util.STREAM_BOTH comment_re = r'\s*/[/*]'
<commit_before># # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Drew Brokke # Copyright (c) 2015 Drew Brokke # # License: MIT # """This module exports the CheckSourceFormatting plugin class.""" from SublimeLinter.lint import NodeLinter, util class CheckSourceFormatting(NodeLinter): """Provides an interface to check-source-formatting.""" syntax = ('javascript', 'html', 'css', 'velocity', 'freemarker', 'java server pages (jsp)', 'sass') cmd = 'check_sf @ --no-color' version_args = '--version' version_re = r'(?P<version>\d+\.\d+\.\d+)' version_requirement = '>= 1.0' regex = r'^.+?(?P<line>\d+): (?P<message>.+)' multiline = False line_col_base = (1, 1) tempfile_suffix = '-' error_stream = util.STREAM_BOTH comment_re = r'\s*/[/*]' <commit_msg>Include possible additional lines in output<commit_after>
# # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Drew Brokke # Copyright (c) 2015 Drew Brokke # # License: MIT # """This module exports the CheckSourceFormatting plugin class.""" from SublimeLinter.lint import NodeLinter, util class CheckSourceFormatting(NodeLinter): """Provides an interface to check-source-formatting.""" syntax = ('javascript', 'html', 'css', 'velocity', 'freemarker', 'java server pages (jsp)', 'sass') cmd = 'check_sf @ --no-color' version_args = '--version' version_re = r'(?P<version>\d+\.\d+\.\d+)' version_requirement = '>= 1.0' regex = r'^.+?(?P<line>\d+).*?: (?P<message>.+)' multiline = False line_col_base = (1, 1) tempfile_suffix = '-' error_stream = util.STREAM_BOTH comment_re = r'\s*/[/*]'
# # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Drew Brokke # Copyright (c) 2015 Drew Brokke # # License: MIT # """This module exports the CheckSourceFormatting plugin class.""" from SublimeLinter.lint import NodeLinter, util class CheckSourceFormatting(NodeLinter): """Provides an interface to check-source-formatting.""" syntax = ('javascript', 'html', 'css', 'velocity', 'freemarker', 'java server pages (jsp)', 'sass') cmd = 'check_sf @ --no-color' version_args = '--version' version_re = r'(?P<version>\d+\.\d+\.\d+)' version_requirement = '>= 1.0' regex = r'^.+?(?P<line>\d+): (?P<message>.+)' multiline = False line_col_base = (1, 1) tempfile_suffix = '-' error_stream = util.STREAM_BOTH comment_re = r'\s*/[/*]' Include possible additional lines in output# # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Drew Brokke # Copyright (c) 2015 Drew Brokke # # License: MIT # """This module exports the CheckSourceFormatting plugin class.""" from SublimeLinter.lint import NodeLinter, util class CheckSourceFormatting(NodeLinter): """Provides an interface to check-source-formatting.""" syntax = ('javascript', 'html', 'css', 'velocity', 'freemarker', 'java server pages (jsp)', 'sass') cmd = 'check_sf @ --no-color' version_args = '--version' version_re = r'(?P<version>\d+\.\d+\.\d+)' version_requirement = '>= 1.0' regex = r'^.+?(?P<line>\d+).*?: (?P<message>.+)' multiline = False line_col_base = (1, 1) tempfile_suffix = '-' error_stream = util.STREAM_BOTH comment_re = r'\s*/[/*]'
<commit_before># # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Drew Brokke # Copyright (c) 2015 Drew Brokke # # License: MIT # """This module exports the CheckSourceFormatting plugin class.""" from SublimeLinter.lint import NodeLinter, util class CheckSourceFormatting(NodeLinter): """Provides an interface to check-source-formatting.""" syntax = ('javascript', 'html', 'css', 'velocity', 'freemarker', 'java server pages (jsp)', 'sass') cmd = 'check_sf @ --no-color' version_args = '--version' version_re = r'(?P<version>\d+\.\d+\.\d+)' version_requirement = '>= 1.0' regex = r'^.+?(?P<line>\d+): (?P<message>.+)' multiline = False line_col_base = (1, 1) tempfile_suffix = '-' error_stream = util.STREAM_BOTH comment_re = r'\s*/[/*]' <commit_msg>Include possible additional lines in output<commit_after># # linter.py # Linter for SublimeLinter3, a code checking framework for Sublime Text 3 # # Written by Drew Brokke # Copyright (c) 2015 Drew Brokke # # License: MIT # """This module exports the CheckSourceFormatting plugin class.""" from SublimeLinter.lint import NodeLinter, util class CheckSourceFormatting(NodeLinter): """Provides an interface to check-source-formatting.""" syntax = ('javascript', 'html', 'css', 'velocity', 'freemarker', 'java server pages (jsp)', 'sass') cmd = 'check_sf @ --no-color' version_args = '--version' version_re = r'(?P<version>\d+\.\d+\.\d+)' version_requirement = '>= 1.0' regex = r'^.+?(?P<line>\d+).*?: (?P<message>.+)' multiline = False line_col_base = (1, 1) tempfile_suffix = '-' error_stream = util.STREAM_BOTH comment_re = r'\s*/[/*]'
24ca48098777d89835cf169ee2b4f06db50ec9f1
koans/triangle.py
koans/triangle.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Triangle Project Code. # Triangle analyzes the lengths of the sides of a triangle # (represented by a, b and c) and returns the type of triangle. # # It returns: # 'equilateral' if all sides are equal # 'isosceles' if exactly 2 sides are equal # 'scalene' if no sides are equal # # The tests for this method can be found in # about_triangle_project.py # and # about_triangle_project_2.py # def triangle(a, b, c): if (a <= 0 or b <= 0 and c <= 0): raise TriangleError() if (a == b and b == c and c == a): return 'equilateral' elif (a == b or b == c or c == a): return 'isosceles' elif (a != b and b != c and c != a): return 'scalene' # Error class used in part 2. No need to change this code. class TriangleError(Exception): pass
#!/usr/bin/env python # -*- coding: utf-8 -*- # Triangle Project Code. # Triangle analyzes the lengths of the sides of a triangle # (represented by a, b and c) and returns the type of triangle. # # It returns: # 'equilateral' if all sides are equal # 'isosceles' if exactly 2 sides are equal # 'scalene' if no sides are equal # # The tests for this method can be found in # about_triangle_project.py # and # about_triangle_project_2.py # def triangle(a, b, c): if (a <= 0 or b <= 0 and c <= 0): raise TriangleError() if (a == b and b == c): return 'equilateral' elif (a == b or b == c or c == a): return 'isosceles' else: return 'scalene' # Error class used in part 2. No need to change this code. class TriangleError(Exception): pass
Simplify logic conditionals as tests still pass.
Simplify logic conditionals as tests still pass.
Python
mit
javierjulio/python-koans-completed,javierjulio/python-koans-completed
#!/usr/bin/env python # -*- coding: utf-8 -*- # Triangle Project Code. # Triangle analyzes the lengths of the sides of a triangle # (represented by a, b and c) and returns the type of triangle. # # It returns: # 'equilateral' if all sides are equal # 'isosceles' if exactly 2 sides are equal # 'scalene' if no sides are equal # # The tests for this method can be found in # about_triangle_project.py # and # about_triangle_project_2.py # def triangle(a, b, c): if (a <= 0 or b <= 0 and c <= 0): raise TriangleError() if (a == b and b == c and c == a): return 'equilateral' elif (a == b or b == c or c == a): return 'isosceles' elif (a != b and b != c and c != a): return 'scalene' # Error class used in part 2. No need to change this code. class TriangleError(Exception): pass Simplify logic conditionals as tests still pass.
#!/usr/bin/env python # -*- coding: utf-8 -*- # Triangle Project Code. # Triangle analyzes the lengths of the sides of a triangle # (represented by a, b and c) and returns the type of triangle. # # It returns: # 'equilateral' if all sides are equal # 'isosceles' if exactly 2 sides are equal # 'scalene' if no sides are equal # # The tests for this method can be found in # about_triangle_project.py # and # about_triangle_project_2.py # def triangle(a, b, c): if (a <= 0 or b <= 0 and c <= 0): raise TriangleError() if (a == b and b == c): return 'equilateral' elif (a == b or b == c or c == a): return 'isosceles' else: return 'scalene' # Error class used in part 2. No need to change this code. class TriangleError(Exception): pass
<commit_before>#!/usr/bin/env python # -*- coding: utf-8 -*- # Triangle Project Code. # Triangle analyzes the lengths of the sides of a triangle # (represented by a, b and c) and returns the type of triangle. # # It returns: # 'equilateral' if all sides are equal # 'isosceles' if exactly 2 sides are equal # 'scalene' if no sides are equal # # The tests for this method can be found in # about_triangle_project.py # and # about_triangle_project_2.py # def triangle(a, b, c): if (a <= 0 or b <= 0 and c <= 0): raise TriangleError() if (a == b and b == c and c == a): return 'equilateral' elif (a == b or b == c or c == a): return 'isosceles' elif (a != b and b != c and c != a): return 'scalene' # Error class used in part 2. No need to change this code. class TriangleError(Exception): pass <commit_msg>Simplify logic conditionals as tests still pass.<commit_after>
#!/usr/bin/env python # -*- coding: utf-8 -*- # Triangle Project Code. # Triangle analyzes the lengths of the sides of a triangle # (represented by a, b and c) and returns the type of triangle. # # It returns: # 'equilateral' if all sides are equal # 'isosceles' if exactly 2 sides are equal # 'scalene' if no sides are equal # # The tests for this method can be found in # about_triangle_project.py # and # about_triangle_project_2.py # def triangle(a, b, c): if (a <= 0 or b <= 0 and c <= 0): raise TriangleError() if (a == b and b == c): return 'equilateral' elif (a == b or b == c or c == a): return 'isosceles' else: return 'scalene' # Error class used in part 2. No need to change this code. class TriangleError(Exception): pass
#!/usr/bin/env python # -*- coding: utf-8 -*- # Triangle Project Code. # Triangle analyzes the lengths of the sides of a triangle # (represented by a, b and c) and returns the type of triangle. # # It returns: # 'equilateral' if all sides are equal # 'isosceles' if exactly 2 sides are equal # 'scalene' if no sides are equal # # The tests for this method can be found in # about_triangle_project.py # and # about_triangle_project_2.py # def triangle(a, b, c): if (a <= 0 or b <= 0 and c <= 0): raise TriangleError() if (a == b and b == c and c == a): return 'equilateral' elif (a == b or b == c or c == a): return 'isosceles' elif (a != b and b != c and c != a): return 'scalene' # Error class used in part 2. No need to change this code. class TriangleError(Exception): pass Simplify logic conditionals as tests still pass.#!/usr/bin/env python # -*- coding: utf-8 -*- # Triangle Project Code. # Triangle analyzes the lengths of the sides of a triangle # (represented by a, b and c) and returns the type of triangle. # # It returns: # 'equilateral' if all sides are equal # 'isosceles' if exactly 2 sides are equal # 'scalene' if no sides are equal # # The tests for this method can be found in # about_triangle_project.py # and # about_triangle_project_2.py # def triangle(a, b, c): if (a <= 0 or b <= 0 and c <= 0): raise TriangleError() if (a == b and b == c): return 'equilateral' elif (a == b or b == c or c == a): return 'isosceles' else: return 'scalene' # Error class used in part 2. No need to change this code. class TriangleError(Exception): pass
<commit_before>#!/usr/bin/env python # -*- coding: utf-8 -*- # Triangle Project Code. # Triangle analyzes the lengths of the sides of a triangle # (represented by a, b and c) and returns the type of triangle. # # It returns: # 'equilateral' if all sides are equal # 'isosceles' if exactly 2 sides are equal # 'scalene' if no sides are equal # # The tests for this method can be found in # about_triangle_project.py # and # about_triangle_project_2.py # def triangle(a, b, c): if (a <= 0 or b <= 0 and c <= 0): raise TriangleError() if (a == b and b == c and c == a): return 'equilateral' elif (a == b or b == c or c == a): return 'isosceles' elif (a != b and b != c and c != a): return 'scalene' # Error class used in part 2. No need to change this code. class TriangleError(Exception): pass <commit_msg>Simplify logic conditionals as tests still pass.<commit_after>#!/usr/bin/env python # -*- coding: utf-8 -*- # Triangle Project Code. # Triangle analyzes the lengths of the sides of a triangle # (represented by a, b and c) and returns the type of triangle. # # It returns: # 'equilateral' if all sides are equal # 'isosceles' if exactly 2 sides are equal # 'scalene' if no sides are equal # # The tests for this method can be found in # about_triangle_project.py # and # about_triangle_project_2.py # def triangle(a, b, c): if (a <= 0 or b <= 0 and c <= 0): raise TriangleError() if (a == b and b == c): return 'equilateral' elif (a == b or b == c or c == a): return 'isosceles' else: return 'scalene' # Error class used in part 2. No need to change this code. class TriangleError(Exception): pass
35c4f76ff099ac79f70e8b977e2ffb5b51b6f120
healthcheck/__init__.py
healthcheck/__init__.py
__doc__ = 'Health Checker for Yola Services' __version__ = '0.0.3' __url__ = 'https://github.com/yola/healthcheck' from healthcheck import (HealthChecker, HealthCheck, ListHealthCheck, DjangoDBsHealthCheck, FilesExistHealthCheck, FilesDontExistHealthCheck)
__doc__ = 'Health Checker for Yola Services' __version__ = '0.0.3' __url__ = 'https://github.com/yola/healthcheck' from healthcheck import (HealthChecker, HealthCheck, ListHealthCheck, DjangoDBsHealthCheck, FilesExistHealthCheck, FilesDontExistHealthCheck)
Remove blank line at end of file
Remove blank line at end of file
Python
mit
yola/healthcheck
__doc__ = 'Health Checker for Yola Services' __version__ = '0.0.3' __url__ = 'https://github.com/yola/healthcheck' from healthcheck import (HealthChecker, HealthCheck, ListHealthCheck, DjangoDBsHealthCheck, FilesExistHealthCheck, FilesDontExistHealthCheck) Remove blank line at end of file
__doc__ = 'Health Checker for Yola Services' __version__ = '0.0.3' __url__ = 'https://github.com/yola/healthcheck' from healthcheck import (HealthChecker, HealthCheck, ListHealthCheck, DjangoDBsHealthCheck, FilesExistHealthCheck, FilesDontExistHealthCheck)
<commit_before>__doc__ = 'Health Checker for Yola Services' __version__ = '0.0.3' __url__ = 'https://github.com/yola/healthcheck' from healthcheck import (HealthChecker, HealthCheck, ListHealthCheck, DjangoDBsHealthCheck, FilesExistHealthCheck, FilesDontExistHealthCheck) <commit_msg>Remove blank line at end of file<commit_after>
__doc__ = 'Health Checker for Yola Services' __version__ = '0.0.3' __url__ = 'https://github.com/yola/healthcheck' from healthcheck import (HealthChecker, HealthCheck, ListHealthCheck, DjangoDBsHealthCheck, FilesExistHealthCheck, FilesDontExistHealthCheck)
__doc__ = 'Health Checker for Yola Services' __version__ = '0.0.3' __url__ = 'https://github.com/yola/healthcheck' from healthcheck import (HealthChecker, HealthCheck, ListHealthCheck, DjangoDBsHealthCheck, FilesExistHealthCheck, FilesDontExistHealthCheck) Remove blank line at end of file__doc__ = 'Health Checker for Yola Services' __version__ = '0.0.3' __url__ = 'https://github.com/yola/healthcheck' from healthcheck import (HealthChecker, HealthCheck, ListHealthCheck, DjangoDBsHealthCheck, FilesExistHealthCheck, FilesDontExistHealthCheck)
<commit_before>__doc__ = 'Health Checker for Yola Services' __version__ = '0.0.3' __url__ = 'https://github.com/yola/healthcheck' from healthcheck import (HealthChecker, HealthCheck, ListHealthCheck, DjangoDBsHealthCheck, FilesExistHealthCheck, FilesDontExistHealthCheck) <commit_msg>Remove blank line at end of file<commit_after>__doc__ = 'Health Checker for Yola Services' __version__ = '0.0.3' __url__ = 'https://github.com/yola/healthcheck' from healthcheck import (HealthChecker, HealthCheck, ListHealthCheck, DjangoDBsHealthCheck, FilesExistHealthCheck, FilesDontExistHealthCheck)
ce279fa1000f3212c25c6fcbe04e8849abed9bb7
pyp2rpmlib/package_data.py
pyp2rpmlib/package_data.py
class PackageData(object): def __init__(self, local_file, name, version): self.local_file = local_file self.name = name self.version = version def __getattr__(self, name): if name in self.__dict__: return self.__dict__[name] return 'TODO:' @property def pkg_name(self, name): if self.name.lower().find('py') != -1: return self.name else: return 'python-%s' class PypiData(PackageData): def __init__(self, local_file, name, version, md5, url): super(PackageData, self).__init__(local_file, name, version) self.md5 = md5 self.url = url class LocalData(PackageData): def __init__(self, local_file, name, version): super(PackageData, self).__init__(local_file, name, version)
import subprocess import time class PackageData(object): def __init__(self, local_file, name, version): self.local_file = local_file self.name = name self.version = version def __getattr__(self, name): if name in self.__dict__: return self.__dict__[name] return 'TODO:' @property def pkg_name(self, name): if self.name.lower().find('py') != -1: return self.name else: return 'python-%s' @property def changelog_date_packager(self): packager = subprocess.Popen('rpmdev-packager', stdout = subprocess.PIPE).communicate()[0].strip() date_str = time.strftime('%a %b %d %Y', time.gmtime()) return "%s %s" % (date_str, packager) class PypiData(PackageData): def __init__(self, local_file, name, version, md5, url): super(PackageData, self).__init__(local_file, name, version) self.md5 = md5 self.url = url class LocalData(PackageData): def __init__(self, local_file, name, version): super(PackageData, self).__init__(local_file, name, version)
Add functionality to construct changelog entries
Add functionality to construct changelog entries
Python
mit
joequant/pyp2rpm,MichaelMraka/pyp2rpm,fedora-python/pyp2rpm,yuokada/pyp2rpm,pombredanne/pyp2rpm,henrysher/spec4pypi,mcyprian/pyp2rpm
class PackageData(object): def __init__(self, local_file, name, version): self.local_file = local_file self.name = name self.version = version def __getattr__(self, name): if name in self.__dict__: return self.__dict__[name] return 'TODO:' @property def pkg_name(self, name): if self.name.lower().find('py') != -1: return self.name else: return 'python-%s' class PypiData(PackageData): def __init__(self, local_file, name, version, md5, url): super(PackageData, self).__init__(local_file, name, version) self.md5 = md5 self.url = url class LocalData(PackageData): def __init__(self, local_file, name, version): super(PackageData, self).__init__(local_file, name, version) Add functionality to construct changelog entries
import subprocess import time class PackageData(object): def __init__(self, local_file, name, version): self.local_file = local_file self.name = name self.version = version def __getattr__(self, name): if name in self.__dict__: return self.__dict__[name] return 'TODO:' @property def pkg_name(self, name): if self.name.lower().find('py') != -1: return self.name else: return 'python-%s' @property def changelog_date_packager(self): packager = subprocess.Popen('rpmdev-packager', stdout = subprocess.PIPE).communicate()[0].strip() date_str = time.strftime('%a %b %d %Y', time.gmtime()) return "%s %s" % (date_str, packager) class PypiData(PackageData): def __init__(self, local_file, name, version, md5, url): super(PackageData, self).__init__(local_file, name, version) self.md5 = md5 self.url = url class LocalData(PackageData): def __init__(self, local_file, name, version): super(PackageData, self).__init__(local_file, name, version)
<commit_before>class PackageData(object): def __init__(self, local_file, name, version): self.local_file = local_file self.name = name self.version = version def __getattr__(self, name): if name in self.__dict__: return self.__dict__[name] return 'TODO:' @property def pkg_name(self, name): if self.name.lower().find('py') != -1: return self.name else: return 'python-%s' class PypiData(PackageData): def __init__(self, local_file, name, version, md5, url): super(PackageData, self).__init__(local_file, name, version) self.md5 = md5 self.url = url class LocalData(PackageData): def __init__(self, local_file, name, version): super(PackageData, self).__init__(local_file, name, version) <commit_msg>Add functionality to construct changelog entries<commit_after>
import subprocess import time class PackageData(object): def __init__(self, local_file, name, version): self.local_file = local_file self.name = name self.version = version def __getattr__(self, name): if name in self.__dict__: return self.__dict__[name] return 'TODO:' @property def pkg_name(self, name): if self.name.lower().find('py') != -1: return self.name else: return 'python-%s' @property def changelog_date_packager(self): packager = subprocess.Popen('rpmdev-packager', stdout = subprocess.PIPE).communicate()[0].strip() date_str = time.strftime('%a %b %d %Y', time.gmtime()) return "%s %s" % (date_str, packager) class PypiData(PackageData): def __init__(self, local_file, name, version, md5, url): super(PackageData, self).__init__(local_file, name, version) self.md5 = md5 self.url = url class LocalData(PackageData): def __init__(self, local_file, name, version): super(PackageData, self).__init__(local_file, name, version)
class PackageData(object): def __init__(self, local_file, name, version): self.local_file = local_file self.name = name self.version = version def __getattr__(self, name): if name in self.__dict__: return self.__dict__[name] return 'TODO:' @property def pkg_name(self, name): if self.name.lower().find('py') != -1: return self.name else: return 'python-%s' class PypiData(PackageData): def __init__(self, local_file, name, version, md5, url): super(PackageData, self).__init__(local_file, name, version) self.md5 = md5 self.url = url class LocalData(PackageData): def __init__(self, local_file, name, version): super(PackageData, self).__init__(local_file, name, version) Add functionality to construct changelog entriesimport subprocess import time class PackageData(object): def __init__(self, local_file, name, version): self.local_file = local_file self.name = name self.version = version def __getattr__(self, name): if name in self.__dict__: return self.__dict__[name] return 'TODO:' @property def pkg_name(self, name): if self.name.lower().find('py') != -1: return self.name else: return 'python-%s' @property def changelog_date_packager(self): packager = subprocess.Popen('rpmdev-packager', stdout = subprocess.PIPE).communicate()[0].strip() date_str = time.strftime('%a %b %d %Y', time.gmtime()) return "%s %s" % (date_str, packager) class PypiData(PackageData): def __init__(self, local_file, name, version, md5, url): super(PackageData, self).__init__(local_file, name, version) self.md5 = md5 self.url = url class LocalData(PackageData): def __init__(self, local_file, name, version): super(PackageData, self).__init__(local_file, name, version)
<commit_before>class PackageData(object): def __init__(self, local_file, name, version): self.local_file = local_file self.name = name self.version = version def __getattr__(self, name): if name in self.__dict__: return self.__dict__[name] return 'TODO:' @property def pkg_name(self, name): if self.name.lower().find('py') != -1: return self.name else: return 'python-%s' class PypiData(PackageData): def __init__(self, local_file, name, version, md5, url): super(PackageData, self).__init__(local_file, name, version) self.md5 = md5 self.url = url class LocalData(PackageData): def __init__(self, local_file, name, version): super(PackageData, self).__init__(local_file, name, version) <commit_msg>Add functionality to construct changelog entries<commit_after>import subprocess import time class PackageData(object): def __init__(self, local_file, name, version): self.local_file = local_file self.name = name self.version = version def __getattr__(self, name): if name in self.__dict__: return self.__dict__[name] return 'TODO:' @property def pkg_name(self, name): if self.name.lower().find('py') != -1: return self.name else: return 'python-%s' @property def changelog_date_packager(self): packager = subprocess.Popen('rpmdev-packager', stdout = subprocess.PIPE).communicate()[0].strip() date_str = time.strftime('%a %b %d %Y', time.gmtime()) return "%s %s" % (date_str, packager) class PypiData(PackageData): def __init__(self, local_file, name, version, md5, url): super(PackageData, self).__init__(local_file, name, version) self.md5 = md5 self.url = url class LocalData(PackageData): def __init__(self, local_file, name, version): super(PackageData, self).__init__(local_file, name, version)
eb5294f0df32442dbd7431fd9200388ca4c63d62
tests/builtins/test_reversed.py
tests/builtins/test_reversed.py
from .. utils import TranspileTestCase, BuiltinFunctionTestCase class ReversedTests(TranspileTestCase): pass class BuiltinReversedFunctionTests(BuiltinFunctionTestCase, TranspileTestCase): functions = ["reversed"] not_implemented = [ 'test_range', ]
from .. utils import SAMPLE_DATA, TranspileTestCase, BuiltinFunctionTestCase def _iterate_test(datatype): def test_func(self): code = '\n'.join([ '\nfor x in {value}:\n print(x)\n'.format(value=value) for value in SAMPLE_DATA[datatype] ]) self.assertCodeExecution(code) return test_func class ReversedTests(TranspileTestCase): # test_iterate_bytearray = _iterate_test('bytearray') test_iterate_bytes = _iterate_test('bytes') test_iterate_list = _iterate_test('list') test_iterate_range = _iterate_test('range') test_iterate_str = _iterate_test('str') test_iterate_tuple = _iterate_test('tuple') class BuiltinReversedFunctionTests(BuiltinFunctionTestCase, TranspileTestCase): functions = ["reversed"] not_implemented = [ 'test_range', ]
Add iteration tests for reversed type
Add iteration tests for reversed type
Python
bsd-3-clause
cflee/voc,cflee/voc,freakboy3742/voc,freakboy3742/voc
from .. utils import TranspileTestCase, BuiltinFunctionTestCase class ReversedTests(TranspileTestCase): pass class BuiltinReversedFunctionTests(BuiltinFunctionTestCase, TranspileTestCase): functions = ["reversed"] not_implemented = [ 'test_range', ] Add iteration tests for reversed type
from .. utils import SAMPLE_DATA, TranspileTestCase, BuiltinFunctionTestCase def _iterate_test(datatype): def test_func(self): code = '\n'.join([ '\nfor x in {value}:\n print(x)\n'.format(value=value) for value in SAMPLE_DATA[datatype] ]) self.assertCodeExecution(code) return test_func class ReversedTests(TranspileTestCase): # test_iterate_bytearray = _iterate_test('bytearray') test_iterate_bytes = _iterate_test('bytes') test_iterate_list = _iterate_test('list') test_iterate_range = _iterate_test('range') test_iterate_str = _iterate_test('str') test_iterate_tuple = _iterate_test('tuple') class BuiltinReversedFunctionTests(BuiltinFunctionTestCase, TranspileTestCase): functions = ["reversed"] not_implemented = [ 'test_range', ]
<commit_before>from .. utils import TranspileTestCase, BuiltinFunctionTestCase class ReversedTests(TranspileTestCase): pass class BuiltinReversedFunctionTests(BuiltinFunctionTestCase, TranspileTestCase): functions = ["reversed"] not_implemented = [ 'test_range', ] <commit_msg>Add iteration tests for reversed type<commit_after>
from .. utils import SAMPLE_DATA, TranspileTestCase, BuiltinFunctionTestCase def _iterate_test(datatype): def test_func(self): code = '\n'.join([ '\nfor x in {value}:\n print(x)\n'.format(value=value) for value in SAMPLE_DATA[datatype] ]) self.assertCodeExecution(code) return test_func class ReversedTests(TranspileTestCase): # test_iterate_bytearray = _iterate_test('bytearray') test_iterate_bytes = _iterate_test('bytes') test_iterate_list = _iterate_test('list') test_iterate_range = _iterate_test('range') test_iterate_str = _iterate_test('str') test_iterate_tuple = _iterate_test('tuple') class BuiltinReversedFunctionTests(BuiltinFunctionTestCase, TranspileTestCase): functions = ["reversed"] not_implemented = [ 'test_range', ]
from .. utils import TranspileTestCase, BuiltinFunctionTestCase class ReversedTests(TranspileTestCase): pass class BuiltinReversedFunctionTests(BuiltinFunctionTestCase, TranspileTestCase): functions = ["reversed"] not_implemented = [ 'test_range', ] Add iteration tests for reversed typefrom .. utils import SAMPLE_DATA, TranspileTestCase, BuiltinFunctionTestCase def _iterate_test(datatype): def test_func(self): code = '\n'.join([ '\nfor x in {value}:\n print(x)\n'.format(value=value) for value in SAMPLE_DATA[datatype] ]) self.assertCodeExecution(code) return test_func class ReversedTests(TranspileTestCase): # test_iterate_bytearray = _iterate_test('bytearray') test_iterate_bytes = _iterate_test('bytes') test_iterate_list = _iterate_test('list') test_iterate_range = _iterate_test('range') test_iterate_str = _iterate_test('str') test_iterate_tuple = _iterate_test('tuple') class BuiltinReversedFunctionTests(BuiltinFunctionTestCase, TranspileTestCase): functions = ["reversed"] not_implemented = [ 'test_range', ]
<commit_before>from .. utils import TranspileTestCase, BuiltinFunctionTestCase class ReversedTests(TranspileTestCase): pass class BuiltinReversedFunctionTests(BuiltinFunctionTestCase, TranspileTestCase): functions = ["reversed"] not_implemented = [ 'test_range', ] <commit_msg>Add iteration tests for reversed type<commit_after>from .. utils import SAMPLE_DATA, TranspileTestCase, BuiltinFunctionTestCase def _iterate_test(datatype): def test_func(self): code = '\n'.join([ '\nfor x in {value}:\n print(x)\n'.format(value=value) for value in SAMPLE_DATA[datatype] ]) self.assertCodeExecution(code) return test_func class ReversedTests(TranspileTestCase): # test_iterate_bytearray = _iterate_test('bytearray') test_iterate_bytes = _iterate_test('bytes') test_iterate_list = _iterate_test('list') test_iterate_range = _iterate_test('range') test_iterate_str = _iterate_test('str') test_iterate_tuple = _iterate_test('tuple') class BuiltinReversedFunctionTests(BuiltinFunctionTestCase, TranspileTestCase): functions = ["reversed"] not_implemented = [ 'test_range', ]
41217b13d6a59b6919f72a0d8b24a86d16f2f22c
quotedb/serializers.py
quotedb/serializers.py
from rest_framework import serializers from quotedb.models import Quote class QuoteSerializer(serializers.ModelSerializer): owner = serializers.ReadOnlyField(source='owner.username') class Meta: model = Quote fields = ('body', 'owner', 'created', 'approved')
from rest_framework import serializers from quotedb.models import Quote class QuoteSerializer(serializers.ModelSerializer): owner = serializers.ReadOnlyField(source='owner.username') class Meta: model = Quote fields = ('id', 'body', 'owner', 'created', 'approved') read_only = ('id',)
Add id to api results
Add id to api results
Python
mit
kfdm/django-qdb,kfdm/django-qdb
from rest_framework import serializers from quotedb.models import Quote class QuoteSerializer(serializers.ModelSerializer): owner = serializers.ReadOnlyField(source='owner.username') class Meta: model = Quote fields = ('body', 'owner', 'created', 'approved') Add id to api results
from rest_framework import serializers from quotedb.models import Quote class QuoteSerializer(serializers.ModelSerializer): owner = serializers.ReadOnlyField(source='owner.username') class Meta: model = Quote fields = ('id', 'body', 'owner', 'created', 'approved') read_only = ('id',)
<commit_before>from rest_framework import serializers from quotedb.models import Quote class QuoteSerializer(serializers.ModelSerializer): owner = serializers.ReadOnlyField(source='owner.username') class Meta: model = Quote fields = ('body', 'owner', 'created', 'approved') <commit_msg>Add id to api results<commit_after>
from rest_framework import serializers from quotedb.models import Quote class QuoteSerializer(serializers.ModelSerializer): owner = serializers.ReadOnlyField(source='owner.username') class Meta: model = Quote fields = ('id', 'body', 'owner', 'created', 'approved') read_only = ('id',)
from rest_framework import serializers from quotedb.models import Quote class QuoteSerializer(serializers.ModelSerializer): owner = serializers.ReadOnlyField(source='owner.username') class Meta: model = Quote fields = ('body', 'owner', 'created', 'approved') Add id to api resultsfrom rest_framework import serializers from quotedb.models import Quote class QuoteSerializer(serializers.ModelSerializer): owner = serializers.ReadOnlyField(source='owner.username') class Meta: model = Quote fields = ('id', 'body', 'owner', 'created', 'approved') read_only = ('id',)
<commit_before>from rest_framework import serializers from quotedb.models import Quote class QuoteSerializer(serializers.ModelSerializer): owner = serializers.ReadOnlyField(source='owner.username') class Meta: model = Quote fields = ('body', 'owner', 'created', 'approved') <commit_msg>Add id to api results<commit_after>from rest_framework import serializers from quotedb.models import Quote class QuoteSerializer(serializers.ModelSerializer): owner = serializers.ReadOnlyField(source='owner.username') class Meta: model = Quote fields = ('id', 'body', 'owner', 'created', 'approved') read_only = ('id',)
16c8baf99b90abe5f8f273647f02604b6e11f8b2
humbug/test_settings.py
humbug/test_settings.py
from settings import * DATABASES['default']["NAME"] = "zephyr/tests/zephyrdb.test"
from settings import * DATABASES["default"] = {"NAME": "zephyr/tests/zephyrdb.test", "ENGINE": "django.db.backends.sqlite3", "OPTIONS": { "timeout": 20, },}
Fix running tests when the default database is MySQL.
Fix running tests when the default database is MySQL. (imported from commit b692b64219fb67792cdfd3bd208df2c6103d23ad)
Python
apache-2.0
MayB/zulip,samatdav/zulip,willingc/zulip,easyfmxu/zulip,TigorC/zulip,natanovia/zulip,Cheppers/zulip,vaidap/zulip,MayB/zulip,Galexrt/zulip,ipernet/zulip,esander91/zulip,yuvipanda/zulip,eastlhu/zulip,joyhchen/zulip,noroot/zulip,jessedhillon/zulip,TigorC/zulip,timabbott/zulip,LeeRisk/zulip,zwily/zulip,udxxabp/zulip,praveenaki/zulip,bastianh/zulip,xuxiao/zulip,RobotCaleb/zulip,udxxabp/zulip,brainwane/zulip,hj3938/zulip,isht3/zulip,amanharitsh123/zulip,ikasumiwt/zulip,zofuthan/zulip,souravbadami/zulip,MariaFaBella85/zulip,jessedhillon/zulip,ufosky-server/zulip,he15his/zulip,itnihao/zulip,atomic-labs/zulip,jimmy54/zulip,dxq-git/zulip,Jianchun1/zulip,xuxiao/zulip,tdr130/zulip,qq1012803704/zulip,Juanvulcano/zulip,Frouk/zulip,glovebx/zulip,samatdav/zulip,souravbadami/zulip,brainwane/zulip,he15his/zulip,SmartPeople/zulip,Galexrt/zulip,codeKonami/zulip,bluesea/zulip,zwily/zulip,mdavid/zulip,rishig/zulip,Batterfii/zulip,dotcool/zulip,vakila/zulip,noroot/zulip,DazWorrall/zulip,zhaoweigg/zulip,susansls/zulip,dawran6/zulip,souravbadami/zulip,JanzTam/zulip,aliceriot/zulip,ufosky-server/zulip,suxinde2009/zulip,codeKonami/zulip,bssrdf/zulip,reyha/zulip,tbutter/zulip,so0k/zulip,AZtheAsian/zulip,aps-sids/zulip,isht3/zulip,saitodisse/zulip,adnanh/zulip,amanharitsh123/zulip,shaunstanislaus/zulip,alliejones/zulip,verma-varsha/zulip,he15his/zulip,mansilladev/zulip,tommyip/zulip,fw1121/zulip,saitodisse/zulip,hj3938/zulip,shrikrishnaholla/zulip,LeeRisk/zulip,codeKonami/zulip,andersk/zulip,dotcool/zulip,gkotian/zulip,reyha/zulip,codeKonami/zulip,wdaher/zulip,zachallaun/zulip,paxapy/zulip,dawran6/zulip,zachallaun/zulip,suxinde2009/zulip,hustlzp/zulip,technicalpickles/zulip,brockwhittaker/zulip,LeeRisk/zulip,ApsOps/zulip,thomasboyt/zulip,xuxiao/zulip,zwily/zulip,peiwei/zulip,EasonYi/zulip,gkotian/zulip,verma-varsha/zulip,JPJPJPOPOP/zulip,calvinleenyc/zulip,qq1012803704/zulip,peiwei/zulip,zacps/zulip,aps-sids/zulip,amallia/zulip,littledogboy/zulip,niftynei/zulip,xuanhan863/zulip,kaiyuanheshang/zulip,jackrzhang/zulip,swinghu/zulip,kokoar/zulip,Cheppers/zulip,rishig/zulip,PhilSk/zulip,grave-w-grave/zulip,Drooids/zulip,zachallaun/zulip,johnnygaddarr/zulip,showell/zulip,zacps/zulip,Drooids/zulip,deer-hope/zulip,tommyip/zulip,wangdeshui/zulip,Suninus/zulip,shrikrishnaholla/zulip,Frouk/zulip,pradiptad/zulip,lfranchi/zulip,guiquanz/zulip,niftynei/zulip,reyha/zulip,zorojean/zulip,jeffcao/zulip,hackerkid/zulip,gigawhitlocks/zulip,technicalpickles/zulip,udxxabp/zulip,moria/zulip,RobotCaleb/zulip,calvinleenyc/zulip,EasonYi/zulip,schatt/zulip,ryansnowboarder/zulip,kou/zulip,Cheppers/zulip,dotcool/zulip,tiansiyuan/zulip,arpitpanwar/zulip,jainayush975/zulip,joyhchen/zulip,amyliu345/zulip,arpitpanwar/zulip,aps-sids/zulip,j831/zulip,hengqujushi/zulip,dotcool/zulip,LAndreas/zulip,showell/zulip,zofuthan/zulip,AZtheAsian/zulip,bowlofstew/zulip,so0k/zulip,shubhamdhama/zulip,zofuthan/zulip,zwily/zulip,PaulPetring/zulip,aliceriot/zulip,Vallher/zulip,punchagan/zulip,eeshangarg/zulip,bitemyapp/zulip,mansilladev/zulip,jainayush975/zulip,pradiptad/zulip,hayderimran7/zulip,swinghu/zulip,bluesea/zulip,aps-sids/zulip,JPJPJPOPOP/zulip,zofuthan/zulip,rht/zulip,Juanvulcano/zulip,niftynei/zulip,m1ssou/zulip,ashwinirudrappa/zulip,vikas-parashar/zulip,Drooids/zulip,Diptanshu8/zulip,bluesea/zulip,zhaoweigg/zulip,cosmicAsymmetry/zulip,Vallher/zulip,proliming/zulip,umkay/zulip,ryanbackman/zulip,punchagan/zulip,bowlofstew/zulip,SmartPeople/zulip,RobotCaleb/zulip,easyfmxu/zulip,fw1121/zulip,huangkebo/zulip,DazWorrall/zulip,arpitpanwar/zulip,avastu/zulip,punchagan/zulip,ApsOps/zulip,JanzTam/zulip,huangkebo/zulip,KJin99/zulip,sharmaeklavya2/zulip,jimmy54/zulip,karamcnair/zulip,brainwane/zulip,hafeez3000/zulip,j831/zulip,PaulPetring/zulip,RobotCaleb/zulip,suxinde2009/zulip,xuanhan863/zulip,hustlzp/zulip,rht/zulip,alliejones/zulip,dwrpayne/zulip,xuanhan863/zulip,vaidap/zulip,gigawhitlocks/zulip,luyifan/zulip,zhaoweigg/zulip,timabbott/zulip,hengqujushi/zulip,hengqujushi/zulip,luyifan/zulip,technicalpickles/zulip,proliming/zulip,AZtheAsian/zulip,tommyip/zulip,krtkmj/zulip,Suninus/zulip,reyha/zulip,alliejones/zulip,Batterfii/zulip,umkay/zulip,sharmaeklavya2/zulip,Drooids/zulip,dotcool/zulip,jphilipsen05/zulip,praveenaki/zulip,MayB/zulip,wweiradio/zulip,kou/zulip,isht3/zulip,KJin99/zulip,thomasboyt/zulip,punchagan/zulip,gkotian/zulip,sonali0901/zulip,karamcnair/zulip,MariaFaBella85/zulip,bastianh/zulip,nicholasbs/zulip,qq1012803704/zulip,jimmy54/zulip,hj3938/zulip,andersk/zulip,hafeez3000/zulip,yocome/zulip,ericzhou2008/zulip,hengqujushi/zulip,amyliu345/zulip,brockwhittaker/zulip,moria/zulip,mdavid/zulip,JPJPJPOPOP/zulip,verma-varsha/zulip,jphilipsen05/zulip,johnny9/zulip,Suninus/zulip,luyifan/zulip,bssrdf/zulip,RobotCaleb/zulip,tommyip/zulip,wweiradio/zulip,akuseru/zulip,showell/zulip,yocome/zulip,developerfm/zulip,jeffcao/zulip,akuseru/zulip,alliejones/zulip,hj3938/zulip,thomasboyt/zulip,zorojean/zulip,hengqujushi/zulip,Suninus/zulip,wavelets/zulip,rishig/zulip,bitemyapp/zulip,AZtheAsian/zulip,ericzhou2008/zulip,eastlhu/zulip,vakila/zulip,zulip/zulip,levixie/zulip,PaulPetring/zulip,developerfm/zulip,levixie/zulip,hafeez3000/zulip,itnihao/zulip,kou/zulip,jackrzhang/zulip,rht/zulip,Qgap/zulip,willingc/zulip,JanzTam/zulip,dnmfarrell/zulip,DazWorrall/zulip,isht3/zulip,Batterfii/zulip,hackerkid/zulip,levixie/zulip,johnnygaddarr/zulip,itnihao/zulip,blaze225/zulip,lfranchi/zulip,RobotCaleb/zulip,schatt/zulip,RobotCaleb/zulip,gigawhitlocks/zulip,themass/zulip,PhilSk/zulip,voidException/zulip,xuxiao/zulip,hackerkid/zulip,peiwei/zulip,Gabriel0402/zulip,avastu/zulip,mohsenSy/zulip,jrowan/zulip,cosmicAsymmetry/zulip,zulip/zulip,cosmicAsymmetry/zulip,amallia/zulip,schatt/zulip,joshisa/zulip,dattatreya303/zulip,tiansiyuan/zulip,wweiradio/zulip,praveenaki/zulip,dhcrzf/zulip,glovebx/zulip,susansls/zulip,proliming/zulip,nicholasbs/zulip,glovebx/zulip,vabs22/zulip,adnanh/zulip,atomic-labs/zulip,yocome/zulip,mansilladev/zulip,eastlhu/zulip,vabs22/zulip,avastu/zulip,Jianchun1/zulip,amallia/zulip,aps-sids/zulip,krtkmj/zulip,kokoar/zulip,jrowan/zulip,ufosky-server/zulip,tommyip/zulip,christi3k/zulip,bssrdf/zulip,hj3938/zulip,jphilipsen05/zulip,yuvipanda/zulip,Galexrt/zulip,glovebx/zulip,eeshangarg/zulip,fw1121/zulip,KJin99/zulip,avastu/zulip,ryansnowboarder/zulip,Jianchun1/zulip,stamhe/zulip,ericzhou2008/zulip,dawran6/zulip,firstblade/zulip,hustlzp/zulip,bitemyapp/zulip,ikasumiwt/zulip,mdavid/zulip,joshisa/zulip,jessedhillon/zulip,hayderimran7/zulip,kou/zulip,mohsenSy/zulip,johnny9/zulip,dattatreya303/zulip,avastu/zulip,moria/zulip,jphilipsen05/zulip,JPJPJPOPOP/zulip,PhilSk/zulip,lfranchi/zulip,deer-hope/zulip,Juanvulcano/zulip,hackerkid/zulip,ashwinirudrappa/zulip,thomasboyt/zulip,AZtheAsian/zulip,ericzhou2008/zulip,KingxBanana/zulip,Suninus/zulip,bastianh/zulip,hustlzp/zulip,mohsenSy/zulip,willingc/zulip,esander91/zulip,thomasboyt/zulip,tiansiyuan/zulip,LAndreas/zulip,yocome/zulip,rishig/zulip,niftynei/zulip,yuvipanda/zulip,j831/zulip,Vallher/zulip,aliceriot/zulip,avastu/zulip,andersk/zulip,pradiptad/zulip,he15his/zulip,bitemyapp/zulip,yuvipanda/zulip,gigawhitlocks/zulip,ahmadassaf/zulip,mohsenSy/zulip,tbutter/zulip,pradiptad/zulip,stamhe/zulip,dxq-git/zulip,umkay/zulip,zwily/zulip,LeeRisk/zulip,Suninus/zulip,bowlofstew/zulip,shrikrishnaholla/zulip,zofuthan/zulip,vakila/zulip,glovebx/zulip,hafeez3000/zulip,krtkmj/zulip,levixie/zulip,eeshangarg/zulip,jimmy54/zulip,akuseru/zulip,dattatreya303/zulip,sonali0901/zulip,vikas-parashar/zulip,grave-w-grave/zulip,m1ssou/zulip,bowlofstew/zulip,deer-hope/zulip,dotcool/zulip,swinghu/zulip,codeKonami/zulip,jessedhillon/zulip,umkay/zulip,eastlhu/zulip,dwrpayne/zulip,nicholasbs/zulip,jerryge/zulip,firstblade/zulip,zhaoweigg/zulip,armooo/zulip,Gabriel0402/zulip,grave-w-grave/zulip,itnihao/zulip,TigorC/zulip,KJin99/zulip,ahmadassaf/zulip,dwrpayne/zulip,huangkebo/zulip,zachallaun/zulip,thomasboyt/zulip,wavelets/zulip,arpitpanwar/zulip,nicholasbs/zulip,bastianh/zulip,firstblade/zulip,huangkebo/zulip,ryansnowboarder/zulip,sonali0901/zulip,jimmy54/zulip,saitodisse/zulip,levixie/zulip,grave-w-grave/zulip,lfranchi/zulip,wangdeshui/zulip,grave-w-grave/zulip,ericzhou2008/zulip,hayderimran7/zulip,mahim97/zulip,babbage/zulip,udxxabp/zulip,zofuthan/zulip,esander91/zulip,paxapy/zulip,akuseru/zulip,dhcrzf/zulip,shubhamdhama/zulip,MariaFaBella85/zulip,gkotian/zulip,stamhe/zulip,eeshangarg/zulip,sharmaeklavya2/zulip,ApsOps/zulip,DazWorrall/zulip,johnnygaddarr/zulip,JPJPJPOPOP/zulip,voidException/zulip,MariaFaBella85/zulip,bssrdf/zulip,armooo/zulip,tdr130/zulip,ryanbackman/zulip,rht/zulip,jonesgithub/zulip,moria/zulip,he15his/zulip,timabbott/zulip,jackrzhang/zulip,wavelets/zulip,zachallaun/zulip,guiquanz/zulip,dattatreya303/zulip,tdr130/zulip,calvinleenyc/zulip,ahmadassaf/zulip,technicalpickles/zulip,ikasumiwt/zulip,kokoar/zulip,dawran6/zulip,paxapy/zulip,bssrdf/zulip,jerryge/zulip,rht/zulip,TigorC/zulip,ryanbackman/zulip,hengqujushi/zulip,vakila/zulip,shubhamdhama/zulip,tiansiyuan/zulip,karamcnair/zulip,JanzTam/zulip,amyliu345/zulip,brockwhittaker/zulip,Drooids/zulip,jonesgithub/zulip,amyliu345/zulip,babbage/zulip,bluesea/zulip,punchagan/zulip,zacps/zulip,atomic-labs/zulip,pradiptad/zulip,fw1121/zulip,showell/zulip,voidException/zulip,nicholasbs/zulip,johnnygaddarr/zulip,Galexrt/zulip,vabs22/zulip,bowlofstew/zulip,ufosky-server/zulip,jerryge/zulip,adnanh/zulip,sup95/zulip,Juanvulcano/zulip,shaunstanislaus/zulip,yocome/zulip,swinghu/zulip,jrowan/zulip,calvinleenyc/zulip,calvinleenyc/zulip,peguin40/zulip,Jianchun1/zulip,karamcnair/zulip,joshisa/zulip,souravbadami/zulip,jeffcao/zulip,PaulPetring/zulip,voidException/zulip,wangdeshui/zulip,kokoar/zulip,amanharitsh123/zulip,christi3k/zulip,shaunstanislaus/zulip,Frouk/zulip,natanovia/zulip,hackerkid/zulip,EasonYi/zulip,JPJPJPOPOP/zulip,ikasumiwt/zulip,akuseru/zulip,tiansiyuan/zulip,natanovia/zulip,DazWorrall/zulip,zwily/zulip,adnanh/zulip,jphilipsen05/zulip,eastlhu/zulip,wavelets/zulip,SmartPeople/zulip,karamcnair/zulip,KingxBanana/zulip,j831/zulip,ikasumiwt/zulip,LeeRisk/zulip,willingc/zulip,LAndreas/zulip,reyha/zulip,ahmadassaf/zulip,vabs22/zulip,mohsenSy/zulip,bastianh/zulip,aliceriot/zulip,vabs22/zulip,johnny9/zulip,shaunstanislaus/zulip,zulip/zulip,moria/zulip,deer-hope/zulip,voidException/zulip,mahim97/zulip,kou/zulip,mdavid/zulip,punchagan/zulip,udxxabp/zulip,ipernet/zulip,ApsOps/zulip,ryansnowboarder/zulip,developerfm/zulip,luyifan/zulip,guiquanz/zulip,dxq-git/zulip,qq1012803704/zulip,firstblade/zulip,jessedhillon/zulip,ipernet/zulip,voidException/zulip,brockwhittaker/zulip,niftynei/zulip,hafeez3000/zulip,deer-hope/zulip,zorojean/zulip,mdavid/zulip,vikas-parashar/zulip,christi3k/zulip,esander91/zulip,dxq-git/zulip,wweiradio/zulip,peiwei/zulip,johnny9/zulip,seapasulli/zulip,dhcrzf/zulip,easyfmxu/zulip,guiquanz/zulip,bitemyapp/zulip,zhaoweigg/zulip,krtkmj/zulip,xuanhan863/zulip,shrikrishnaholla/zulip,technicalpickles/zulip,Qgap/zulip,Qgap/zulip,noroot/zulip,MayB/zulip,peguin40/zulip,yuvipanda/zulip,dawran6/zulip,fw1121/zulip,j831/zulip,zachallaun/zulip,jonesgithub/zulip,johnnygaddarr/zulip,isht3/zulip,yocome/zulip,noroot/zulip,jerryge/zulip,eeshangarg/zulip,jrowan/zulip,arpith/zulip,mahim97/zulip,shrikrishnaholla/zulip,andersk/zulip,shaunstanislaus/zulip,synicalsyntax/zulip,developerfm/zulip,Batterfii/zulip,kaiyuanheshang/zulip,deer-hope/zulip,Gabriel0402/zulip,bastianh/zulip,bitemyapp/zulip,dotcool/zulip,dhcrzf/zulip,sup95/zulip,xuxiao/zulip,dnmfarrell/zulip,proliming/zulip,developerfm/zulip,Jianchun1/zulip,dawran6/zulip,Juanvulcano/zulip,verma-varsha/zulip,wweiradio/zulip,aps-sids/zulip,littledogboy/zulip,jeffcao/zulip,arpith/zulip,levixie/zulip,hustlzp/zulip,fw1121/zulip,itnihao/zulip,Cheppers/zulip,Batterfii/zulip,gkotian/zulip,Vallher/zulip,Batterfii/zulip,codeKonami/zulip,dnmfarrell/zulip,stamhe/zulip,reyha/zulip,kokoar/zulip,seapasulli/zulip,babbage/zulip,aakash-cr7/zulip,dxq-git/zulip,wangdeshui/zulip,dwrpayne/zulip,ashwinirudrappa/zulip,cosmicAsymmetry/zulip,natanovia/zulip,zofuthan/zulip,mahim97/zulip,aliceriot/zulip,andersk/zulip,xuanhan863/zulip,aakash-cr7/zulip,vaidap/zulip,TigorC/zulip,showell/zulip,Suninus/zulip,susansls/zulip,jainayush975/zulip,praveenaki/zulip,stamhe/zulip,ryanbackman/zulip,tommyip/zulip,ericzhou2008/zulip,AZtheAsian/zulip,PhilSk/zulip,saitodisse/zulip,Gabriel0402/zulip,LeeRisk/zulip,vaidap/zulip,vakila/zulip,KJin99/zulip,stamhe/zulip,guiquanz/zulip,arpitpanwar/zulip,zorojean/zulip,ashwinirudrappa/zulip,hafeez3000/zulip,Qgap/zulip,xuxiao/zulip,Frouk/zulip,hackerkid/zulip,PhilSk/zulip,vikas-parashar/zulip,tbutter/zulip,vikas-parashar/zulip,proliming/zulip,tdr130/zulip,esander91/zulip,saitodisse/zulip,andersk/zulip,tdr130/zulip,Qgap/zulip,noroot/zulip,DazWorrall/zulip,shrikrishnaholla/zulip,fw1121/zulip,qq1012803704/zulip,bssrdf/zulip,LAndreas/zulip,m1ssou/zulip,alliejones/zulip,sup95/zulip,gkotian/zulip,peguin40/zulip,udxxabp/zulip,arpith/zulip,pradiptad/zulip,zacps/zulip,esander91/zulip,synicalsyntax/zulip,hj3938/zulip,armooo/zulip,mohsenSy/zulip,blaze225/zulip,johnnygaddarr/zulip,yocome/zulip,atomic-labs/zulip,bluesea/zulip,arpith/zulip,JanzTam/zulip,adnanh/zulip,Galexrt/zulip,amanharitsh123/zulip,nicholasbs/zulip,armooo/zulip,hayderimran7/zulip,zachallaun/zulip,saitodisse/zulip,KingxBanana/zulip,christi3k/zulip,m1ssou/zulip,jonesgithub/zulip,grave-w-grave/zulip,zacps/zulip,stamhe/zulip,Galexrt/zulip,hj3938/zulip,jonesgithub/zulip,arpitpanwar/zulip,natanovia/zulip,he15his/zulip,KJin99/zulip,KingxBanana/zulip,ericzhou2008/zulip,bastianh/zulip,ipernet/zulip,themass/zulip,amallia/zulip,ahmadassaf/zulip,noroot/zulip,ryansnowboarder/zulip,proliming/zulip,zhaoweigg/zulip,themass/zulip,joyhchen/zulip,brainwane/zulip,zorojean/zulip,ryanbackman/zulip,kaiyuanheshang/zulip,proliming/zulip,jerryge/zulip,joyhchen/zulip,synicalsyntax/zulip,huangkebo/zulip,dwrpayne/zulip,developerfm/zulip,jeffcao/zulip,jackrzhang/zulip,dxq-git/zulip,wdaher/zulip,Vallher/zulip,MayB/zulip,dhcrzf/zulip,ahmadassaf/zulip,saitodisse/zulip,lfranchi/zulip,amallia/zulip,bowlofstew/zulip,arpith/zulip,littledogboy/zulip,Drooids/zulip,levixie/zulip,jimmy54/zulip,EasonYi/zulip,rishig/zulip,Frouk/zulip,cosmicAsymmetry/zulip,KingxBanana/zulip,Cheppers/zulip,suxinde2009/zulip,KingxBanana/zulip,amyliu345/zulip,isht3/zulip,wavelets/zulip,eeshangarg/zulip,dnmfarrell/zulip,susansls/zulip,JanzTam/zulip,KJin99/zulip,jeffcao/zulip,zulip/zulip,wweiradio/zulip,so0k/zulip,sharmaeklavya2/zulip,sonali0901/zulip,thomasboyt/zulip,bluesea/zulip,moria/zulip,timabbott/zulip,themass/zulip,ryansnowboarder/zulip,sharmaeklavya2/zulip,themass/zulip,niftynei/zulip,xuxiao/zulip,ipernet/zulip,rht/zulip,praveenaki/zulip,developerfm/zulip,seapasulli/zulip,akuseru/zulip,umkay/zulip,shubhamdhama/zulip,blaze225/zulip,hackerkid/zulip,praveenaki/zulip,punchagan/zulip,udxxabp/zulip,brockwhittaker/zulip,Gabriel0402/zulip,sup95/zulip,themass/zulip,susansls/zulip,jrowan/zulip,swinghu/zulip,verma-varsha/zulip,sup95/zulip,tdr130/zulip,mdavid/zulip,ashwinirudrappa/zulip,SmartPeople/zulip,aliceriot/zulip,suxinde2009/zulip,Qgap/zulip,vakila/zulip,Cheppers/zulip,jonesgithub/zulip,jackrzhang/zulip,calvinleenyc/zulip,tiansiyuan/zulip,PhilSk/zulip,souravbadami/zulip,tbutter/zulip,mansilladev/zulip,littledogboy/zulip,j831/zulip,tdr130/zulip,easyfmxu/zulip,brainwane/zulip,hayderimran7/zulip,seapasulli/zulip,EasonYi/zulip,amanharitsh123/zulip,lfranchi/zulip,voidException/zulip,rishig/zulip,vaidap/zulip,joshisa/zulip,he15his/zulip,showell/zulip,dwrpayne/zulip,xuanhan863/zulip,so0k/zulip,paxapy/zulip,samatdav/zulip,noroot/zulip,m1ssou/zulip,synicalsyntax/zulip,kokoar/zulip,hengqujushi/zulip,avastu/zulip,swinghu/zulip,TigorC/zulip,ahmadassaf/zulip,sup95/zulip,krtkmj/zulip,yuvipanda/zulip,Diptanshu8/zulip,Qgap/zulip,Diptanshu8/zulip,jerryge/zulip,SmartPeople/zulip,tommyip/zulip,zorojean/zulip,paxapy/zulip,Galexrt/zulip,technicalpickles/zulip,moria/zulip,xuanhan863/zulip,guiquanz/zulip,Diptanshu8/zulip,synicalsyntax/zulip,amyliu345/zulip,MayB/zulip,firstblade/zulip,dhcrzf/zulip,seapasulli/zulip,kaiyuanheshang/zulip,samatdav/zulip,joshisa/zulip,zwily/zulip,esander91/zulip,sonali0901/zulip,Frouk/zulip,qq1012803704/zulip,gigawhitlocks/zulip,technicalpickles/zulip,blaze225/zulip,codeKonami/zulip,babbage/zulip,vikas-parashar/zulip,dwrpayne/zulip,johnny9/zulip,brainwane/zulip,tbutter/zulip,bowlofstew/zulip,PaulPetring/zulip,Batterfii/zulip,vaidap/zulip,kokoar/zulip,Drooids/zulip,adnanh/zulip,firstblade/zulip,eastlhu/zulip,aakash-cr7/zulip,armooo/zulip,easyfmxu/zulip,samatdav/zulip,glovebx/zulip,amallia/zulip,wdaher/zulip,Juanvulcano/zulip,ashwinirudrappa/zulip,JanzTam/zulip,wweiradio/zulip,wdaher/zulip,luyifan/zulip,littledogboy/zulip,joyhchen/zulip,joyhchen/zulip,schatt/zulip,guiquanz/zulip,armooo/zulip,MariaFaBella85/zulip,ufosky-server/zulip,wdaher/zulip,hayderimran7/zulip,jphilipsen05/zulip,ApsOps/zulip,yuvipanda/zulip,wdaher/zulip,ryanbackman/zulip,brockwhittaker/zulip,MariaFaBella85/zulip,jainayush975/zulip,aliceriot/zulip,karamcnair/zulip,ufosky-server/zulip,EasonYi/zulip,paxapy/zulip,schatt/zulip,zacps/zulip,schatt/zulip,vabs22/zulip,mahim97/zulip,itnihao/zulip,mdavid/zulip,praveenaki/zulip,mansilladev/zulip,jimmy54/zulip,Diptanshu8/zulip,so0k/zulip,jeffcao/zulip,aps-sids/zulip,dattatreya303/zulip,rishig/zulip,pradiptad/zulip,dhcrzf/zulip,gigawhitlocks/zulip,hayderimran7/zulip,LeeRisk/zulip,kaiyuanheshang/zulip,peiwei/zulip,nicholasbs/zulip,shaunstanislaus/zulip,themass/zulip,jainayush975/zulip,deer-hope/zulip,aakash-cr7/zulip,kou/zulip,tiansiyuan/zulip,DazWorrall/zulip,ikasumiwt/zulip,huangkebo/zulip,SmartPeople/zulip,shrikrishnaholla/zulip,zorojean/zulip,willingc/zulip,wdaher/zulip,wavelets/zulip,kaiyuanheshang/zulip,so0k/zulip,aakash-cr7/zulip,verma-varsha/zulip,swinghu/zulip,joshisa/zulip,eeshangarg/zulip,peguin40/zulip,qq1012803704/zulip,jerryge/zulip,hustlzp/zulip,tbutter/zulip,shubhamdhama/zulip,wangdeshui/zulip,babbage/zulip,seapasulli/zulip,tbutter/zulip,atomic-labs/zulip,MariaFaBella85/zulip,blaze225/zulip,aakash-cr7/zulip,wangdeshui/zulip,huangkebo/zulip,itnihao/zulip,so0k/zulip,ufosky-server/zulip,timabbott/zulip,hustlzp/zulip,EasonYi/zulip,johnny9/zulip,armooo/zulip,dxq-git/zulip,dnmfarrell/zulip,bitemyapp/zulip,samatdav/zulip,sonali0901/zulip,natanovia/zulip,timabbott/zulip,ikasumiwt/zulip,krtkmj/zulip,gkotian/zulip,jackrzhang/zulip,bssrdf/zulip,schatt/zulip,hafeez3000/zulip,peiwei/zulip,babbage/zulip,ApsOps/zulip,LAndreas/zulip,eastlhu/zulip,blaze225/zulip,johnnygaddarr/zulip,willingc/zulip,easyfmxu/zulip,akuseru/zulip,gigawhitlocks/zulip,mansilladev/zulip,willingc/zulip,andersk/zulip,jonesgithub/zulip,peiwei/zulip,Vallher/zulip,mansilladev/zulip,susansls/zulip,jessedhillon/zulip,Frouk/zulip,alliejones/zulip,LAndreas/zulip,LAndreas/zulip,jainayush975/zulip,kaiyuanheshang/zulip,babbage/zulip,brainwane/zulip,ApsOps/zulip,zulip/zulip,johnny9/zulip,lfranchi/zulip,Vallher/zulip,Diptanshu8/zulip,m1ssou/zulip,alliejones/zulip,cosmicAsymmetry/zulip,peguin40/zulip,dnmfarrell/zulip,christi3k/zulip,atomic-labs/zulip,mahim97/zulip,umkay/zulip,umkay/zulip,dnmfarrell/zulip,littledogboy/zulip,PaulPetring/zulip,wangdeshui/zulip,ryansnowboarder/zulip,arpitpanwar/zulip,karamcnair/zulip,PaulPetring/zulip,vakila/zulip,zulip/zulip,Cheppers/zulip,MayB/zulip,ipernet/zulip,suxinde2009/zulip,wavelets/zulip,rht/zulip,glovebx/zulip,shubhamdhama/zulip,zhaoweigg/zulip,jackrzhang/zulip,dattatreya303/zulip,synicalsyntax/zulip,zulip/zulip,showell/zulip,adnanh/zulip,kou/zulip,firstblade/zulip,bluesea/zulip,suxinde2009/zulip,Gabriel0402/zulip,m1ssou/zulip,synicalsyntax/zulip,Gabriel0402/zulip,amallia/zulip,sharmaeklavya2/zulip,ashwinirudrappa/zulip,jrowan/zulip,luyifan/zulip,shaunstanislaus/zulip,seapasulli/zulip,joshisa/zulip,littledogboy/zulip,Jianchun1/zulip,easyfmxu/zulip,peguin40/zulip,krtkmj/zulip,timabbott/zulip,natanovia/zulip,shubhamdhama/zulip,atomic-labs/zulip,jessedhillon/zulip,souravbadami/zulip,arpith/zulip,ipernet/zulip,christi3k/zulip,luyifan/zulip,amanharitsh123/zulip
from settings import * DATABASES['default']["NAME"] = "zephyr/tests/zephyrdb.test" Fix running tests when the default database is MySQL. (imported from commit b692b64219fb67792cdfd3bd208df2c6103d23ad)
from settings import * DATABASES["default"] = {"NAME": "zephyr/tests/zephyrdb.test", "ENGINE": "django.db.backends.sqlite3", "OPTIONS": { "timeout": 20, },}
<commit_before>from settings import * DATABASES['default']["NAME"] = "zephyr/tests/zephyrdb.test" <commit_msg>Fix running tests when the default database is MySQL. (imported from commit b692b64219fb67792cdfd3bd208df2c6103d23ad)<commit_after>
from settings import * DATABASES["default"] = {"NAME": "zephyr/tests/zephyrdb.test", "ENGINE": "django.db.backends.sqlite3", "OPTIONS": { "timeout": 20, },}
from settings import * DATABASES['default']["NAME"] = "zephyr/tests/zephyrdb.test" Fix running tests when the default database is MySQL. (imported from commit b692b64219fb67792cdfd3bd208df2c6103d23ad)from settings import * DATABASES["default"] = {"NAME": "zephyr/tests/zephyrdb.test", "ENGINE": "django.db.backends.sqlite3", "OPTIONS": { "timeout": 20, },}
<commit_before>from settings import * DATABASES['default']["NAME"] = "zephyr/tests/zephyrdb.test" <commit_msg>Fix running tests when the default database is MySQL. (imported from commit b692b64219fb67792cdfd3bd208df2c6103d23ad)<commit_after>from settings import * DATABASES["default"] = {"NAME": "zephyr/tests/zephyrdb.test", "ENGINE": "django.db.backends.sqlite3", "OPTIONS": { "timeout": 20, },}
a17b3f1b84d9c87ef3e469a140896dc4dabf9a2b
examples/vhosts.py
examples/vhosts.py
from sanic import response from sanic import Sanic from sanic.blueprints import Blueprint # Usage # curl -H "Host: example.com" localhost:8000 # curl -H "Host: sub.example.com" localhost:8000 # curl -H "Host: bp.example.com" localhost:8000/question # curl -H "Host: bp.example.com" localhost:8000/answer app = Sanic() bp = Blueprint("bp", host="bp.example.com") @app.route('/', host=["example.com", "somethingelse.com", "therestofyourdomains.com"]) async def hello(request): return response.text("Some defaults") @app.route('/', host="example.com") async def hello(request): return response.text("Answer") @app.route('/', host="sub.example.com") async def hello(request): return response.text("42") @bp.route("/question") async def hello(request): return response.text("What is the meaning of life?") @bp.route("/answer") async def hello(request): return response.text("42") app.register_blueprint(bp) if __name__ == '__main__': app.run(host="0.0.0.0", port=8000)
from sanic import response from sanic import Sanic from sanic.blueprints import Blueprint # Usage # curl -H "Host: example.com" localhost:8000 # curl -H "Host: sub.example.com" localhost:8000 # curl -H "Host: bp.example.com" localhost:8000/question # curl -H "Host: bp.example.com" localhost:8000/answer app = Sanic() bp = Blueprint("bp", host="bp.example.com") @app.route('/', host=["example.com", "somethingelse.com", "therestofyourdomains.com"]) async def hello(request): return response.text("Some defaults") @app.route('/', host="sub.example.com") async def hello(request): return response.text("42") @bp.route("/question") async def hello(request): return response.text("What is the meaning of life?") @bp.route("/answer") async def hello(request): return response.text("42") app.blueprint(bp) if __name__ == '__main__': app.run(host="0.0.0.0", port=8000)
Use of register_blueprint will be deprecated, why not upgrade?
Use of register_blueprint will be deprecated, why not upgrade?
Python
mit
channelcat/sanic,channelcat/sanic,Tim-Erwin/sanic,ashleysommer/sanic,yunstanford/sanic,ashleysommer/sanic,lixxu/sanic,Tim-Erwin/sanic,lixxu/sanic,r0fls/sanic,lixxu/sanic,channelcat/sanic,ashleysommer/sanic,jrocketfingers/sanic,r0fls/sanic,jrocketfingers/sanic,yunstanford/sanic,lixxu/sanic,channelcat/sanic,yunstanford/sanic,yunstanford/sanic
from sanic import response from sanic import Sanic from sanic.blueprints import Blueprint # Usage # curl -H "Host: example.com" localhost:8000 # curl -H "Host: sub.example.com" localhost:8000 # curl -H "Host: bp.example.com" localhost:8000/question # curl -H "Host: bp.example.com" localhost:8000/answer app = Sanic() bp = Blueprint("bp", host="bp.example.com") @app.route('/', host=["example.com", "somethingelse.com", "therestofyourdomains.com"]) async def hello(request): return response.text("Some defaults") @app.route('/', host="example.com") async def hello(request): return response.text("Answer") @app.route('/', host="sub.example.com") async def hello(request): return response.text("42") @bp.route("/question") async def hello(request): return response.text("What is the meaning of life?") @bp.route("/answer") async def hello(request): return response.text("42") app.register_blueprint(bp) if __name__ == '__main__': app.run(host="0.0.0.0", port=8000)Use of register_blueprint will be deprecated, why not upgrade?
from sanic import response from sanic import Sanic from sanic.blueprints import Blueprint # Usage # curl -H "Host: example.com" localhost:8000 # curl -H "Host: sub.example.com" localhost:8000 # curl -H "Host: bp.example.com" localhost:8000/question # curl -H "Host: bp.example.com" localhost:8000/answer app = Sanic() bp = Blueprint("bp", host="bp.example.com") @app.route('/', host=["example.com", "somethingelse.com", "therestofyourdomains.com"]) async def hello(request): return response.text("Some defaults") @app.route('/', host="sub.example.com") async def hello(request): return response.text("42") @bp.route("/question") async def hello(request): return response.text("What is the meaning of life?") @bp.route("/answer") async def hello(request): return response.text("42") app.blueprint(bp) if __name__ == '__main__': app.run(host="0.0.0.0", port=8000)
<commit_before>from sanic import response from sanic import Sanic from sanic.blueprints import Blueprint # Usage # curl -H "Host: example.com" localhost:8000 # curl -H "Host: sub.example.com" localhost:8000 # curl -H "Host: bp.example.com" localhost:8000/question # curl -H "Host: bp.example.com" localhost:8000/answer app = Sanic() bp = Blueprint("bp", host="bp.example.com") @app.route('/', host=["example.com", "somethingelse.com", "therestofyourdomains.com"]) async def hello(request): return response.text("Some defaults") @app.route('/', host="example.com") async def hello(request): return response.text("Answer") @app.route('/', host="sub.example.com") async def hello(request): return response.text("42") @bp.route("/question") async def hello(request): return response.text("What is the meaning of life?") @bp.route("/answer") async def hello(request): return response.text("42") app.register_blueprint(bp) if __name__ == '__main__': app.run(host="0.0.0.0", port=8000)<commit_msg>Use of register_blueprint will be deprecated, why not upgrade?<commit_after>
from sanic import response from sanic import Sanic from sanic.blueprints import Blueprint # Usage # curl -H "Host: example.com" localhost:8000 # curl -H "Host: sub.example.com" localhost:8000 # curl -H "Host: bp.example.com" localhost:8000/question # curl -H "Host: bp.example.com" localhost:8000/answer app = Sanic() bp = Blueprint("bp", host="bp.example.com") @app.route('/', host=["example.com", "somethingelse.com", "therestofyourdomains.com"]) async def hello(request): return response.text("Some defaults") @app.route('/', host="sub.example.com") async def hello(request): return response.text("42") @bp.route("/question") async def hello(request): return response.text("What is the meaning of life?") @bp.route("/answer") async def hello(request): return response.text("42") app.blueprint(bp) if __name__ == '__main__': app.run(host="0.0.0.0", port=8000)
from sanic import response from sanic import Sanic from sanic.blueprints import Blueprint # Usage # curl -H "Host: example.com" localhost:8000 # curl -H "Host: sub.example.com" localhost:8000 # curl -H "Host: bp.example.com" localhost:8000/question # curl -H "Host: bp.example.com" localhost:8000/answer app = Sanic() bp = Blueprint("bp", host="bp.example.com") @app.route('/', host=["example.com", "somethingelse.com", "therestofyourdomains.com"]) async def hello(request): return response.text("Some defaults") @app.route('/', host="example.com") async def hello(request): return response.text("Answer") @app.route('/', host="sub.example.com") async def hello(request): return response.text("42") @bp.route("/question") async def hello(request): return response.text("What is the meaning of life?") @bp.route("/answer") async def hello(request): return response.text("42") app.register_blueprint(bp) if __name__ == '__main__': app.run(host="0.0.0.0", port=8000)Use of register_blueprint will be deprecated, why not upgrade?from sanic import response from sanic import Sanic from sanic.blueprints import Blueprint # Usage # curl -H "Host: example.com" localhost:8000 # curl -H "Host: sub.example.com" localhost:8000 # curl -H "Host: bp.example.com" localhost:8000/question # curl -H "Host: bp.example.com" localhost:8000/answer app = Sanic() bp = Blueprint("bp", host="bp.example.com") @app.route('/', host=["example.com", "somethingelse.com", "therestofyourdomains.com"]) async def hello(request): return response.text("Some defaults") @app.route('/', host="sub.example.com") async def hello(request): return response.text("42") @bp.route("/question") async def hello(request): return response.text("What is the meaning of life?") @bp.route("/answer") async def hello(request): return response.text("42") app.blueprint(bp) if __name__ == '__main__': app.run(host="0.0.0.0", port=8000)
<commit_before>from sanic import response from sanic import Sanic from sanic.blueprints import Blueprint # Usage # curl -H "Host: example.com" localhost:8000 # curl -H "Host: sub.example.com" localhost:8000 # curl -H "Host: bp.example.com" localhost:8000/question # curl -H "Host: bp.example.com" localhost:8000/answer app = Sanic() bp = Blueprint("bp", host="bp.example.com") @app.route('/', host=["example.com", "somethingelse.com", "therestofyourdomains.com"]) async def hello(request): return response.text("Some defaults") @app.route('/', host="example.com") async def hello(request): return response.text("Answer") @app.route('/', host="sub.example.com") async def hello(request): return response.text("42") @bp.route("/question") async def hello(request): return response.text("What is the meaning of life?") @bp.route("/answer") async def hello(request): return response.text("42") app.register_blueprint(bp) if __name__ == '__main__': app.run(host="0.0.0.0", port=8000)<commit_msg>Use of register_blueprint will be deprecated, why not upgrade?<commit_after>from sanic import response from sanic import Sanic from sanic.blueprints import Blueprint # Usage # curl -H "Host: example.com" localhost:8000 # curl -H "Host: sub.example.com" localhost:8000 # curl -H "Host: bp.example.com" localhost:8000/question # curl -H "Host: bp.example.com" localhost:8000/answer app = Sanic() bp = Blueprint("bp", host="bp.example.com") @app.route('/', host=["example.com", "somethingelse.com", "therestofyourdomains.com"]) async def hello(request): return response.text("Some defaults") @app.route('/', host="sub.example.com") async def hello(request): return response.text("42") @bp.route("/question") async def hello(request): return response.text("What is the meaning of life?") @bp.route("/answer") async def hello(request): return response.text("42") app.blueprint(bp) if __name__ == '__main__': app.run(host="0.0.0.0", port=8000)
d3837972d5aff2812ea534e053695373497192d5
cheroot/__init__.py
cheroot/__init__.py
try: import pkg_resources __version__ = pkg_resources.get_distribution('cheroot').version except ImportError: __version__ = 'unknown'
try: import pkg_resources __version__ = pkg_resources.get_distribution('cheroot').version except (ImportError, pkg_resources.DistributionNotFound): __version__ = 'unknown'
Handle DistributionNotFound when getting version
Handle DistributionNotFound when getting version When frozen with e.g. cx_Freeze, cheroot will be importable, but not discoverable by pkg_resources.
Python
bsd-3-clause
cherrypy/cheroot
try: import pkg_resources __version__ = pkg_resources.get_distribution('cheroot').version except ImportError: __version__ = 'unknown' Handle DistributionNotFound when getting version When frozen with e.g. cx_Freeze, cheroot will be importable, but not discoverable by pkg_resources.
try: import pkg_resources __version__ = pkg_resources.get_distribution('cheroot').version except (ImportError, pkg_resources.DistributionNotFound): __version__ = 'unknown'
<commit_before>try: import pkg_resources __version__ = pkg_resources.get_distribution('cheroot').version except ImportError: __version__ = 'unknown' <commit_msg>Handle DistributionNotFound when getting version When frozen with e.g. cx_Freeze, cheroot will be importable, but not discoverable by pkg_resources.<commit_after>
try: import pkg_resources __version__ = pkg_resources.get_distribution('cheroot').version except (ImportError, pkg_resources.DistributionNotFound): __version__ = 'unknown'
try: import pkg_resources __version__ = pkg_resources.get_distribution('cheroot').version except ImportError: __version__ = 'unknown' Handle DistributionNotFound when getting version When frozen with e.g. cx_Freeze, cheroot will be importable, but not discoverable by pkg_resources.try: import pkg_resources __version__ = pkg_resources.get_distribution('cheroot').version except (ImportError, pkg_resources.DistributionNotFound): __version__ = 'unknown'
<commit_before>try: import pkg_resources __version__ = pkg_resources.get_distribution('cheroot').version except ImportError: __version__ = 'unknown' <commit_msg>Handle DistributionNotFound when getting version When frozen with e.g. cx_Freeze, cheroot will be importable, but not discoverable by pkg_resources.<commit_after>try: import pkg_resources __version__ = pkg_resources.get_distribution('cheroot').version except (ImportError, pkg_resources.DistributionNotFound): __version__ = 'unknown'
0e02b72c8c37fa5c51a0036ba67a57c99bc1da86
housecanary/__init__.py
housecanary/__init__.py
from housecanary.apiclient import ApiClient from housecanary.excel import export_analytics_data_to_excel from housecanary.excel import export_analytics_data_to_csv from housecanary.excel import concat_excel_reports from housecanary.excel import utilities __version__ = '0.6.5'
__version__ = '0.6.5' from housecanary.apiclient import ApiClient from housecanary.excel import export_analytics_data_to_excel from housecanary.excel import export_analytics_data_to_csv from housecanary.excel import concat_excel_reports from housecanary.excel import utilities
Revert moving the __version__ declaration which broke things
Revert moving the __version__ declaration which broke things
Python
mit
housecanary/hc-api-python
from housecanary.apiclient import ApiClient from housecanary.excel import export_analytics_data_to_excel from housecanary.excel import export_analytics_data_to_csv from housecanary.excel import concat_excel_reports from housecanary.excel import utilities __version__ = '0.6.5' Revert moving the __version__ declaration which broke things
__version__ = '0.6.5' from housecanary.apiclient import ApiClient from housecanary.excel import export_analytics_data_to_excel from housecanary.excel import export_analytics_data_to_csv from housecanary.excel import concat_excel_reports from housecanary.excel import utilities
<commit_before>from housecanary.apiclient import ApiClient from housecanary.excel import export_analytics_data_to_excel from housecanary.excel import export_analytics_data_to_csv from housecanary.excel import concat_excel_reports from housecanary.excel import utilities __version__ = '0.6.5' <commit_msg>Revert moving the __version__ declaration which broke things<commit_after>
__version__ = '0.6.5' from housecanary.apiclient import ApiClient from housecanary.excel import export_analytics_data_to_excel from housecanary.excel import export_analytics_data_to_csv from housecanary.excel import concat_excel_reports from housecanary.excel import utilities
from housecanary.apiclient import ApiClient from housecanary.excel import export_analytics_data_to_excel from housecanary.excel import export_analytics_data_to_csv from housecanary.excel import concat_excel_reports from housecanary.excel import utilities __version__ = '0.6.5' Revert moving the __version__ declaration which broke things__version__ = '0.6.5' from housecanary.apiclient import ApiClient from housecanary.excel import export_analytics_data_to_excel from housecanary.excel import export_analytics_data_to_csv from housecanary.excel import concat_excel_reports from housecanary.excel import utilities
<commit_before>from housecanary.apiclient import ApiClient from housecanary.excel import export_analytics_data_to_excel from housecanary.excel import export_analytics_data_to_csv from housecanary.excel import concat_excel_reports from housecanary.excel import utilities __version__ = '0.6.5' <commit_msg>Revert moving the __version__ declaration which broke things<commit_after>__version__ = '0.6.5' from housecanary.apiclient import ApiClient from housecanary.excel import export_analytics_data_to_excel from housecanary.excel import export_analytics_data_to_csv from housecanary.excel import concat_excel_reports from housecanary.excel import utilities
31af6fefec9770e1ca6663fafe397465732fbf4d
lc0023_merge_k_sorted_lists.py
lc0023_merge_k_sorted_lists.py
"""Leetcode 23. Merge k Sorted Lists Hard URL: https://leetcode.com/problems/merge-k-sorted-lists/ Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Example: Input: [ 1->4->5, 1->3->4, 2->6 ] Output: 1->1->2->3->4->4->5->6 """ # Definition for singly-linked list. class ListNode(object): def __init__(self, val): self.val = val self.next = None class Solution(object): def mergeKLists(self, lists): """ :type lists: List[ListNode] :rtype: ListNode """ pass def main(): pass if __name__ == '__main__': main()
"""Leetcode 23. Merge k Sorted Lists Hard URL: https://leetcode.com/problems/merge-k-sorted-lists/ Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Example: Input: [ 1->4->5, 1->3->4, 2->6 ] Output: 1->1->2->3->4->4->5->6 """ # Definition for singly-linked list. class ListNode(object): def __init__(self, val): self.val = val self.next = None class SolutionSort(object): def mergeKLists(self, lists): """ :type lists: List[ListNode] :rtype: ListNode Time complexity: O(nk*log(nk)), where - n is the number of nodes, - k is the length of lists. Space complexity: O(nk). """ # Collect all nodes from list. nodes = [] for head in lists: current = head while current: nodes.append(current) current = current.next # Sort all nodes by their values. sorted_nodes = sorted(nodes, key=lambda x: x.val) # Link nodes in sorted_nodes. pre_head = ListNode(None) current = pre_head for node in sorted_nodes: current.next = node current = current.next return pre_head.next def show(head): ls = [] current = head while current: ls.append(current.val) current = current.next print ls def main(): # Input: # [ # 1->4->5, # 1->3->4, # 2->6 # ] # Output: 1->1->2->3->4->4->5->6 head1 = ListNode(1) head1.next = ListNode(4) head1.next.next = ListNode(5) head2 = ListNode(1) head2.next = ListNode(3) head2.next.next = ListNode(4) head3 = ListNode(2) head3.next = ListNode(6) lists = [head1, head2, head3] head = SolutionSort().mergeKLists(lists) show(head) if __name__ == '__main__': main()
Complete sort sol w/ time/space complexity
Complete sort sol w/ time/space complexity
Python
bsd-2-clause
bowen0701/algorithms_data_structures
"""Leetcode 23. Merge k Sorted Lists Hard URL: https://leetcode.com/problems/merge-k-sorted-lists/ Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Example: Input: [ 1->4->5, 1->3->4, 2->6 ] Output: 1->1->2->3->4->4->5->6 """ # Definition for singly-linked list. class ListNode(object): def __init__(self, val): self.val = val self.next = None class Solution(object): def mergeKLists(self, lists): """ :type lists: List[ListNode] :rtype: ListNode """ pass def main(): pass if __name__ == '__main__': main() Complete sort sol w/ time/space complexity
"""Leetcode 23. Merge k Sorted Lists Hard URL: https://leetcode.com/problems/merge-k-sorted-lists/ Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Example: Input: [ 1->4->5, 1->3->4, 2->6 ] Output: 1->1->2->3->4->4->5->6 """ # Definition for singly-linked list. class ListNode(object): def __init__(self, val): self.val = val self.next = None class SolutionSort(object): def mergeKLists(self, lists): """ :type lists: List[ListNode] :rtype: ListNode Time complexity: O(nk*log(nk)), where - n is the number of nodes, - k is the length of lists. Space complexity: O(nk). """ # Collect all nodes from list. nodes = [] for head in lists: current = head while current: nodes.append(current) current = current.next # Sort all nodes by their values. sorted_nodes = sorted(nodes, key=lambda x: x.val) # Link nodes in sorted_nodes. pre_head = ListNode(None) current = pre_head for node in sorted_nodes: current.next = node current = current.next return pre_head.next def show(head): ls = [] current = head while current: ls.append(current.val) current = current.next print ls def main(): # Input: # [ # 1->4->5, # 1->3->4, # 2->6 # ] # Output: 1->1->2->3->4->4->5->6 head1 = ListNode(1) head1.next = ListNode(4) head1.next.next = ListNode(5) head2 = ListNode(1) head2.next = ListNode(3) head2.next.next = ListNode(4) head3 = ListNode(2) head3.next = ListNode(6) lists = [head1, head2, head3] head = SolutionSort().mergeKLists(lists) show(head) if __name__ == '__main__': main()
<commit_before>"""Leetcode 23. Merge k Sorted Lists Hard URL: https://leetcode.com/problems/merge-k-sorted-lists/ Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Example: Input: [ 1->4->5, 1->3->4, 2->6 ] Output: 1->1->2->3->4->4->5->6 """ # Definition for singly-linked list. class ListNode(object): def __init__(self, val): self.val = val self.next = None class Solution(object): def mergeKLists(self, lists): """ :type lists: List[ListNode] :rtype: ListNode """ pass def main(): pass if __name__ == '__main__': main() <commit_msg>Complete sort sol w/ time/space complexity<commit_after>
"""Leetcode 23. Merge k Sorted Lists Hard URL: https://leetcode.com/problems/merge-k-sorted-lists/ Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Example: Input: [ 1->4->5, 1->3->4, 2->6 ] Output: 1->1->2->3->4->4->5->6 """ # Definition for singly-linked list. class ListNode(object): def __init__(self, val): self.val = val self.next = None class SolutionSort(object): def mergeKLists(self, lists): """ :type lists: List[ListNode] :rtype: ListNode Time complexity: O(nk*log(nk)), where - n is the number of nodes, - k is the length of lists. Space complexity: O(nk). """ # Collect all nodes from list. nodes = [] for head in lists: current = head while current: nodes.append(current) current = current.next # Sort all nodes by their values. sorted_nodes = sorted(nodes, key=lambda x: x.val) # Link nodes in sorted_nodes. pre_head = ListNode(None) current = pre_head for node in sorted_nodes: current.next = node current = current.next return pre_head.next def show(head): ls = [] current = head while current: ls.append(current.val) current = current.next print ls def main(): # Input: # [ # 1->4->5, # 1->3->4, # 2->6 # ] # Output: 1->1->2->3->4->4->5->6 head1 = ListNode(1) head1.next = ListNode(4) head1.next.next = ListNode(5) head2 = ListNode(1) head2.next = ListNode(3) head2.next.next = ListNode(4) head3 = ListNode(2) head3.next = ListNode(6) lists = [head1, head2, head3] head = SolutionSort().mergeKLists(lists) show(head) if __name__ == '__main__': main()
"""Leetcode 23. Merge k Sorted Lists Hard URL: https://leetcode.com/problems/merge-k-sorted-lists/ Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Example: Input: [ 1->4->5, 1->3->4, 2->6 ] Output: 1->1->2->3->4->4->5->6 """ # Definition for singly-linked list. class ListNode(object): def __init__(self, val): self.val = val self.next = None class Solution(object): def mergeKLists(self, lists): """ :type lists: List[ListNode] :rtype: ListNode """ pass def main(): pass if __name__ == '__main__': main() Complete sort sol w/ time/space complexity"""Leetcode 23. Merge k Sorted Lists Hard URL: https://leetcode.com/problems/merge-k-sorted-lists/ Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Example: Input: [ 1->4->5, 1->3->4, 2->6 ] Output: 1->1->2->3->4->4->5->6 """ # Definition for singly-linked list. class ListNode(object): def __init__(self, val): self.val = val self.next = None class SolutionSort(object): def mergeKLists(self, lists): """ :type lists: List[ListNode] :rtype: ListNode Time complexity: O(nk*log(nk)), where - n is the number of nodes, - k is the length of lists. Space complexity: O(nk). """ # Collect all nodes from list. nodes = [] for head in lists: current = head while current: nodes.append(current) current = current.next # Sort all nodes by their values. sorted_nodes = sorted(nodes, key=lambda x: x.val) # Link nodes in sorted_nodes. pre_head = ListNode(None) current = pre_head for node in sorted_nodes: current.next = node current = current.next return pre_head.next def show(head): ls = [] current = head while current: ls.append(current.val) current = current.next print ls def main(): # Input: # [ # 1->4->5, # 1->3->4, # 2->6 # ] # Output: 1->1->2->3->4->4->5->6 head1 = ListNode(1) head1.next = ListNode(4) head1.next.next = ListNode(5) head2 = ListNode(1) head2.next = ListNode(3) head2.next.next = ListNode(4) head3 = ListNode(2) head3.next = ListNode(6) lists = [head1, head2, head3] head = SolutionSort().mergeKLists(lists) show(head) if __name__ == '__main__': main()
<commit_before>"""Leetcode 23. Merge k Sorted Lists Hard URL: https://leetcode.com/problems/merge-k-sorted-lists/ Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Example: Input: [ 1->4->5, 1->3->4, 2->6 ] Output: 1->1->2->3->4->4->5->6 """ # Definition for singly-linked list. class ListNode(object): def __init__(self, val): self.val = val self.next = None class Solution(object): def mergeKLists(self, lists): """ :type lists: List[ListNode] :rtype: ListNode """ pass def main(): pass if __name__ == '__main__': main() <commit_msg>Complete sort sol w/ time/space complexity<commit_after>"""Leetcode 23. Merge k Sorted Lists Hard URL: https://leetcode.com/problems/merge-k-sorted-lists/ Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Example: Input: [ 1->4->5, 1->3->4, 2->6 ] Output: 1->1->2->3->4->4->5->6 """ # Definition for singly-linked list. class ListNode(object): def __init__(self, val): self.val = val self.next = None class SolutionSort(object): def mergeKLists(self, lists): """ :type lists: List[ListNode] :rtype: ListNode Time complexity: O(nk*log(nk)), where - n is the number of nodes, - k is the length of lists. Space complexity: O(nk). """ # Collect all nodes from list. nodes = [] for head in lists: current = head while current: nodes.append(current) current = current.next # Sort all nodes by their values. sorted_nodes = sorted(nodes, key=lambda x: x.val) # Link nodes in sorted_nodes. pre_head = ListNode(None) current = pre_head for node in sorted_nodes: current.next = node current = current.next return pre_head.next def show(head): ls = [] current = head while current: ls.append(current.val) current = current.next print ls def main(): # Input: # [ # 1->4->5, # 1->3->4, # 2->6 # ] # Output: 1->1->2->3->4->4->5->6 head1 = ListNode(1) head1.next = ListNode(4) head1.next.next = ListNode(5) head2 = ListNode(1) head2.next = ListNode(3) head2.next.next = ListNode(4) head3 = ListNode(2) head3.next = ListNode(6) lists = [head1, head2, head3] head = SolutionSort().mergeKLists(lists) show(head) if __name__ == '__main__': main()
cd69ef8d72c28b8eec4a5612502dfd6b687da23e
donations/__init__.py
donations/__init__.py
# -*- coding: utf-8 -*- __version__ = '0.1.3' __version_info__ = tuple([int(num) if num.isdigit() else num for num in __version__.replace('-', '.', 1).split('.')])
# -*- coding: utf-8 -*- __version__ = '0.2.0' __version_info__ = tuple([int(num) if num.isdigit() else num for num in __version__.replace('-', '.', 1).split('.')])
Bump version to prepare release v0.2.0
Bump version to prepare release v0.2.0
Python
bsd-3-clause
founders4schools/django-donations,founders4schools/django-donations
# -*- coding: utf-8 -*- __version__ = '0.1.3' __version_info__ = tuple([int(num) if num.isdigit() else num for num in __version__.replace('-', '.', 1).split('.')]) Bump version to prepare release v0.2.0
# -*- coding: utf-8 -*- __version__ = '0.2.0' __version_info__ = tuple([int(num) if num.isdigit() else num for num in __version__.replace('-', '.', 1).split('.')])
<commit_before># -*- coding: utf-8 -*- __version__ = '0.1.3' __version_info__ = tuple([int(num) if num.isdigit() else num for num in __version__.replace('-', '.', 1).split('.')]) <commit_msg>Bump version to prepare release v0.2.0<commit_after>
# -*- coding: utf-8 -*- __version__ = '0.2.0' __version_info__ = tuple([int(num) if num.isdigit() else num for num in __version__.replace('-', '.', 1).split('.')])
# -*- coding: utf-8 -*- __version__ = '0.1.3' __version_info__ = tuple([int(num) if num.isdigit() else num for num in __version__.replace('-', '.', 1).split('.')]) Bump version to prepare release v0.2.0# -*- coding: utf-8 -*- __version__ = '0.2.0' __version_info__ = tuple([int(num) if num.isdigit() else num for num in __version__.replace('-', '.', 1).split('.')])
<commit_before># -*- coding: utf-8 -*- __version__ = '0.1.3' __version_info__ = tuple([int(num) if num.isdigit() else num for num in __version__.replace('-', '.', 1).split('.')]) <commit_msg>Bump version to prepare release v0.2.0<commit_after># -*- coding: utf-8 -*- __version__ = '0.2.0' __version_info__ = tuple([int(num) if num.isdigit() else num for num in __version__.replace('-', '.', 1).split('.')])
98dc8375bcfeecc5106940a02395599ea1e60152
core/settings/contrib.py
core/settings/contrib.py
from .base import * INSTALLED_APPS += ( 'django_hstore', 'provider', 'provider.oauth2', 'south', 'easy_thumbnails', 'kronos', )
from .base import * INSTALLED_APPS += ( 'django_hstore', 'provider', 'provider.oauth2', 'south', 'easy_thumbnails', )
Remove kronos from installed apps
Remove kronos from installed apps
Python
apache-2.0
nagyistoce/geokey,nagyistoce/geokey,nagyistoce/geokey
from .base import * INSTALLED_APPS += ( 'django_hstore', 'provider', 'provider.oauth2', 'south', 'easy_thumbnails', 'kronos', ) Remove kronos from installed apps
from .base import * INSTALLED_APPS += ( 'django_hstore', 'provider', 'provider.oauth2', 'south', 'easy_thumbnails', )
<commit_before>from .base import * INSTALLED_APPS += ( 'django_hstore', 'provider', 'provider.oauth2', 'south', 'easy_thumbnails', 'kronos', ) <commit_msg>Remove kronos from installed apps<commit_after>
from .base import * INSTALLED_APPS += ( 'django_hstore', 'provider', 'provider.oauth2', 'south', 'easy_thumbnails', )
from .base import * INSTALLED_APPS += ( 'django_hstore', 'provider', 'provider.oauth2', 'south', 'easy_thumbnails', 'kronos', ) Remove kronos from installed appsfrom .base import * INSTALLED_APPS += ( 'django_hstore', 'provider', 'provider.oauth2', 'south', 'easy_thumbnails', )
<commit_before>from .base import * INSTALLED_APPS += ( 'django_hstore', 'provider', 'provider.oauth2', 'south', 'easy_thumbnails', 'kronos', ) <commit_msg>Remove kronos from installed apps<commit_after>from .base import * INSTALLED_APPS += ( 'django_hstore', 'provider', 'provider.oauth2', 'south', 'easy_thumbnails', )
ecb7366c1d1ee4a58806dacd2158dc67313cf991
test/integration/memcached_suite.py
test/integration/memcached_suite.py
#!/usr/bin/python import os, subprocess from test_common import * def test(opts, port): # The test scripts now get the port as an environment variable (instead of running the server themselves). os.environ["RUN_PORT"] = str(port) os.environ["PERLLIB"] = os.path.abspath(os.getcwd()) + "/integration/memcached_suite/lib:" + os.getenv("PERLLIB", "") proc = subprocess.Popen(opts["suite-test"]) assert proc.wait() == 0 if __name__ == "__main__": op = make_option_parser() op["suite-test"] = StringFlag("--suite-test") auto_server_test_main(test, op.parse(sys.argv), timeout=180)
#!/usr/bin/python import os, subprocess from test_common import * def test(opts, port): # The test scripts now get the port as an environment variable (instead of running the server themselves). os.environ["RUN_PORT"] = str(port) os.environ["PERLLIB"] = os.path.abspath(os.getcwd()) + "/integration/memcached_suite/lib:" + os.getenv("PERLLIB", "") proc = subprocess.Popen(opts["suite-test"]) assert proc.wait() == 0 if __name__ == "__main__": op = make_option_parser() op["suite-test"] = StringFlag("--suite-test") auto_server_test_main(test, op.parse(sys.argv), timeout=360)
Increase getset.t timeout to 6 minutes (because it was still timing out under valgrind).
Increase getset.t timeout to 6 minutes (because it was still timing out under valgrind).
Python
apache-2.0
elkingtonmcb/rethinkdb,sontek/rethinkdb,matthaywardwebdesign/rethinkdb,scripni/rethinkdb,ayumilong/rethinkdb,Wilbeibi/rethinkdb,grandquista/rethinkdb,jmptrader/rethinkdb,grandquista/rethinkdb,sbusso/rethinkdb,catroot/rethinkdb,matthaywardwebdesign/rethinkdb,eliangidoni/rethinkdb,yakovenkodenis/rethinkdb,marshall007/rethinkdb,rrampage/rethinkdb,AtnNn/rethinkdb,captainpete/rethinkdb,jfriedly/rethinkdb,eliangidoni/rethinkdb,ayumilong/rethinkdb,wkennington/rethinkdb,ayumilong/rethinkdb,yaolinz/rethinkdb,gdi2290/rethinkdb,AtnNn/rethinkdb,bpradipt/rethinkdb,wkennington/rethinkdb,AntouanK/rethinkdb,JackieXie168/rethinkdb,RubenKelevra/rethinkdb,gavioto/rethinkdb,elkingtonmcb/rethinkdb,victorbriz/rethinkdb,AntouanK/rethinkdb,mcanthony/rethinkdb,RubenKelevra/rethinkdb,gdi2290/rethinkdb,bchavez/rethinkdb,gavioto/rethinkdb,alash3al/rethinkdb,bpradipt/rethinkdb,4talesa/rethinkdb,ayumilong/rethinkdb,sbusso/rethinkdb,eliangidoni/rethinkdb,urandu/rethinkdb,nviennot/rethinkdb,nviennot/rethinkdb,bpradipt/rethinkdb,gdi2290/rethinkdb,jesseditson/rethinkdb,gavioto/rethinkdb,KSanthanam/rethinkdb,greyhwndz/rethinkdb,Qinusty/rethinkdb,robertjpayne/rethinkdb,bchavez/rethinkdb,urandu/rethinkdb,JackieXie168/rethinkdb,yakovenkodenis/rethinkdb,dparnell/rethinkdb,mquandalle/rethinkdb,grandquista/rethinkdb,yakovenkodenis/rethinkdb,dparnell/rethinkdb,mquandalle/rethinkdb,robertjpayne/rethinkdb,mcanthony/rethinkdb,bchavez/rethinkdb,bchavez/rethinkdb,bpradipt/rethinkdb,captainpete/rethinkdb,niieani/rethinkdb,yaolinz/rethinkdb,nviennot/rethinkdb,lenstr/rethinkdb,rrampage/rethinkdb,matthaywardwebdesign/rethinkdb,wkennington/rethinkdb,sebadiaz/rethinkdb,lenstr/rethinkdb,niieani/rethinkdb,AntouanK/rethinkdb,catroot/rethinkdb,sontek/rethinkdb,rrampage/rethinkdb,marshall007/rethinkdb,scripni/rethinkdb,mquandalle/rethinkdb,victorbriz/rethinkdb,elkingtonmcb/rethinkdb,bchavez/rethinkdb,yaolinz/rethinkdb,nviennot/rethinkdb,jmptrader/rethinkdb,spblightadv/rethinkdb,niieani/rethinkdb,mquandalle/rethinkdb,jesseditson/rethinkdb,mcanthony/rethinkdb,wkennington/rethinkdb,sbusso/rethinkdb,pap/rethinkdb,spblightadv/rethinkdb,matthaywardwebdesign/rethinkdb,dparnell/rethinkdb,lenstr/rethinkdb,AntouanK/rethinkdb,jfriedly/rethinkdb,4talesa/rethinkdb,KSanthanam/rethinkdb,wujf/rethinkdb,mbroadst/rethinkdb,RubenKelevra/rethinkdb,wojons/rethinkdb,Wilbeibi/rethinkdb,mbroadst/rethinkdb,mquandalle/rethinkdb,grandquista/rethinkdb,robertjpayne/rethinkdb,pap/rethinkdb,yakovenkodenis/rethinkdb,rrampage/rethinkdb,captainpete/rethinkdb,urandu/rethinkdb,ayumilong/rethinkdb,eliangidoni/rethinkdb,wojons/rethinkdb,sbusso/rethinkdb,bpradipt/rethinkdb,matthaywardwebdesign/rethinkdb,sbusso/rethinkdb,pap/rethinkdb,catroot/rethinkdb,yakovenkodenis/rethinkdb,KSanthanam/rethinkdb,KSanthanam/rethinkdb,scripni/rethinkdb,alash3al/rethinkdb,grandquista/rethinkdb,gavioto/rethinkdb,mbroadst/rethinkdb,ajose01/rethinkdb,spblightadv/rethinkdb,jfriedly/rethinkdb,elkingtonmcb/rethinkdb,matthaywardwebdesign/rethinkdb,marshall007/rethinkdb,yakovenkodenis/rethinkdb,jesseditson/rethinkdb,scripni/rethinkdb,ayumilong/rethinkdb,bchavez/rethinkdb,alash3al/rethinkdb,scripni/rethinkdb,dparnell/rethinkdb,wujf/rethinkdb,alash3al/rethinkdb,dparnell/rethinkdb,yaolinz/rethinkdb,robertjpayne/rethinkdb,gavioto/rethinkdb,tempbottle/rethinkdb,mbroadst/rethinkdb,robertjpayne/rethinkdb,losywee/rethinkdb,losywee/rethinkdb,robertjpayne/rethinkdb,jfriedly/rethinkdb,ajose01/rethinkdb,dparnell/rethinkdb,wujf/rethinkdb,scripni/rethinkdb,wujf/rethinkdb,mbroadst/rethinkdb,Qinusty/rethinkdb,RubenKelevra/rethinkdb,yakovenkodenis/rethinkdb,jfriedly/rethinkdb,sontek/rethinkdb,wkennington/rethinkdb,losywee/rethinkdb,RubenKelevra/rethinkdb,sebadiaz/rethinkdb,wojons/rethinkdb,niieani/rethinkdb,spblightadv/rethinkdb,bpradipt/rethinkdb,rrampage/rethinkdb,AtnNn/rethinkdb,dparnell/rethinkdb,grandquista/rethinkdb,losywee/rethinkdb,JackieXie168/rethinkdb,elkingtonmcb/rethinkdb,RubenKelevra/rethinkdb,Wilbeibi/rethinkdb,sontek/rethinkdb,captainpete/rethinkdb,catroot/rethinkdb,gdi2290/rethinkdb,lenstr/rethinkdb,greyhwndz/rethinkdb,AtnNn/rethinkdb,alash3al/rethinkdb,AtnNn/rethinkdb,spblightadv/rethinkdb,Qinusty/rethinkdb,ajose01/rethinkdb,dparnell/rethinkdb,scripni/rethinkdb,robertjpayne/rethinkdb,JackieXie168/rethinkdb,wujf/rethinkdb,rrampage/rethinkdb,eliangidoni/rethinkdb,spblightadv/rethinkdb,bchavez/rethinkdb,sbusso/rethinkdb,captainpete/rethinkdb,tempbottle/rethinkdb,KSanthanam/rethinkdb,marshall007/rethinkdb,tempbottle/rethinkdb,matthaywardwebdesign/rethinkdb,eliangidoni/rethinkdb,Qinusty/rethinkdb,wojons/rethinkdb,niieani/rethinkdb,niieani/rethinkdb,tempbottle/rethinkdb,AntouanK/rethinkdb,ajose01/rethinkdb,wujf/rethinkdb,jfriedly/rethinkdb,yaolinz/rethinkdb,jmptrader/rethinkdb,4talesa/rethinkdb,sbusso/rethinkdb,bchavez/rethinkdb,wojons/rethinkdb,RubenKelevra/rethinkdb,jesseditson/rethinkdb,wkennington/rethinkdb,4talesa/rethinkdb,captainpete/rethinkdb,bpradipt/rethinkdb,grandquista/rethinkdb,alash3al/rethinkdb,rrampage/rethinkdb,wujf/rethinkdb,sontek/rethinkdb,ajose01/rethinkdb,sontek/rethinkdb,AtnNn/rethinkdb,lenstr/rethinkdb,elkingtonmcb/rethinkdb,KSanthanam/rethinkdb,jmptrader/rethinkdb,greyhwndz/rethinkdb,jesseditson/rethinkdb,ajose01/rethinkdb,wojons/rethinkdb,sontek/rethinkdb,RubenKelevra/rethinkdb,catroot/rethinkdb,4talesa/rethinkdb,Qinusty/rethinkdb,wkennington/rethinkdb,matthaywardwebdesign/rethinkdb,yaolinz/rethinkdb,Qinusty/rethinkdb,grandquista/rethinkdb,pap/rethinkdb,gdi2290/rethinkdb,Wilbeibi/rethinkdb,mbroadst/rethinkdb,jmptrader/rethinkdb,tempbottle/rethinkdb,JackieXie168/rethinkdb,niieani/rethinkdb,4talesa/rethinkdb,sbusso/rethinkdb,scripni/rethinkdb,nviennot/rethinkdb,gavioto/rethinkdb,ayumilong/rethinkdb,4talesa/rethinkdb,marshall007/rethinkdb,JackieXie168/rethinkdb,bchavez/rethinkdb,elkingtonmcb/rethinkdb,gdi2290/rethinkdb,Wilbeibi/rethinkdb,yakovenkodenis/rethinkdb,sebadiaz/rethinkdb,greyhwndz/rethinkdb,mquandalle/rethinkdb,4talesa/rethinkdb,elkingtonmcb/rethinkdb,catroot/rethinkdb,greyhwndz/rethinkdb,KSanthanam/rethinkdb,mcanthony/rethinkdb,mbroadst/rethinkdb,bpradipt/rethinkdb,Qinusty/rethinkdb,sebadiaz/rethinkdb,catroot/rethinkdb,victorbriz/rethinkdb,victorbriz/rethinkdb,Wilbeibi/rethinkdb,captainpete/rethinkdb,mcanthony/rethinkdb,marshall007/rethinkdb,alash3al/rethinkdb,urandu/rethinkdb,jfriedly/rethinkdb,victorbriz/rethinkdb,niieani/rethinkdb,losywee/rethinkdb,dparnell/rethinkdb,Wilbeibi/rethinkdb,urandu/rethinkdb,jesseditson/rethinkdb,spblightadv/rethinkdb,marshall007/rethinkdb,sebadiaz/rethinkdb,wkennington/rethinkdb,losywee/rethinkdb,Qinusty/rethinkdb,ajose01/rethinkdb,pap/rethinkdb,urandu/rethinkdb,sebadiaz/rethinkdb,pap/rethinkdb,JackieXie168/rethinkdb,mbroadst/rethinkdb,greyhwndz/rethinkdb,bpradipt/rethinkdb,spblightadv/rethinkdb,urandu/rethinkdb,captainpete/rethinkdb,wojons/rethinkdb,nviennot/rethinkdb,Qinusty/rethinkdb,alash3al/rethinkdb,eliangidoni/rethinkdb,sebadiaz/rethinkdb,wojons/rethinkdb,nviennot/rethinkdb,mcanthony/rethinkdb,jesseditson/rethinkdb,pap/rethinkdb,AntouanK/rethinkdb,robertjpayne/rethinkdb,mcanthony/rethinkdb,tempbottle/rethinkdb,mcanthony/rethinkdb,victorbriz/rethinkdb,grandquista/rethinkdb,AntouanK/rethinkdb,tempbottle/rethinkdb,AntouanK/rethinkdb,lenstr/rethinkdb,greyhwndz/rethinkdb,urandu/rethinkdb,greyhwndz/rethinkdb,yaolinz/rethinkdb,losywee/rethinkdb,gavioto/rethinkdb,gavioto/rethinkdb,sebadiaz/rethinkdb,eliangidoni/rethinkdb,mquandalle/rethinkdb,jmptrader/rethinkdb,tempbottle/rethinkdb,yaolinz/rethinkdb,JackieXie168/rethinkdb,KSanthanam/rethinkdb,ayumilong/rethinkdb,robertjpayne/rethinkdb,mquandalle/rethinkdb,ajose01/rethinkdb,AtnNn/rethinkdb,jesseditson/rethinkdb,lenstr/rethinkdb,marshall007/rethinkdb,gdi2290/rethinkdb,pap/rethinkdb,sontek/rethinkdb,nviennot/rethinkdb,eliangidoni/rethinkdb,AtnNn/rethinkdb,catroot/rethinkdb,victorbriz/rethinkdb,jfriedly/rethinkdb,rrampage/rethinkdb,jmptrader/rethinkdb,JackieXie168/rethinkdb,losywee/rethinkdb,mbroadst/rethinkdb,jmptrader/rethinkdb,victorbriz/rethinkdb,lenstr/rethinkdb,Wilbeibi/rethinkdb
#!/usr/bin/python import os, subprocess from test_common import * def test(opts, port): # The test scripts now get the port as an environment variable (instead of running the server themselves). os.environ["RUN_PORT"] = str(port) os.environ["PERLLIB"] = os.path.abspath(os.getcwd()) + "/integration/memcached_suite/lib:" + os.getenv("PERLLIB", "") proc = subprocess.Popen(opts["suite-test"]) assert proc.wait() == 0 if __name__ == "__main__": op = make_option_parser() op["suite-test"] = StringFlag("--suite-test") auto_server_test_main(test, op.parse(sys.argv), timeout=180) Increase getset.t timeout to 6 minutes (because it was still timing out under valgrind).
#!/usr/bin/python import os, subprocess from test_common import * def test(opts, port): # The test scripts now get the port as an environment variable (instead of running the server themselves). os.environ["RUN_PORT"] = str(port) os.environ["PERLLIB"] = os.path.abspath(os.getcwd()) + "/integration/memcached_suite/lib:" + os.getenv("PERLLIB", "") proc = subprocess.Popen(opts["suite-test"]) assert proc.wait() == 0 if __name__ == "__main__": op = make_option_parser() op["suite-test"] = StringFlag("--suite-test") auto_server_test_main(test, op.parse(sys.argv), timeout=360)
<commit_before>#!/usr/bin/python import os, subprocess from test_common import * def test(opts, port): # The test scripts now get the port as an environment variable (instead of running the server themselves). os.environ["RUN_PORT"] = str(port) os.environ["PERLLIB"] = os.path.abspath(os.getcwd()) + "/integration/memcached_suite/lib:" + os.getenv("PERLLIB", "") proc = subprocess.Popen(opts["suite-test"]) assert proc.wait() == 0 if __name__ == "__main__": op = make_option_parser() op["suite-test"] = StringFlag("--suite-test") auto_server_test_main(test, op.parse(sys.argv), timeout=180) <commit_msg>Increase getset.t timeout to 6 minutes (because it was still timing out under valgrind).<commit_after>
#!/usr/bin/python import os, subprocess from test_common import * def test(opts, port): # The test scripts now get the port as an environment variable (instead of running the server themselves). os.environ["RUN_PORT"] = str(port) os.environ["PERLLIB"] = os.path.abspath(os.getcwd()) + "/integration/memcached_suite/lib:" + os.getenv("PERLLIB", "") proc = subprocess.Popen(opts["suite-test"]) assert proc.wait() == 0 if __name__ == "__main__": op = make_option_parser() op["suite-test"] = StringFlag("--suite-test") auto_server_test_main(test, op.parse(sys.argv), timeout=360)
#!/usr/bin/python import os, subprocess from test_common import * def test(opts, port): # The test scripts now get the port as an environment variable (instead of running the server themselves). os.environ["RUN_PORT"] = str(port) os.environ["PERLLIB"] = os.path.abspath(os.getcwd()) + "/integration/memcached_suite/lib:" + os.getenv("PERLLIB", "") proc = subprocess.Popen(opts["suite-test"]) assert proc.wait() == 0 if __name__ == "__main__": op = make_option_parser() op["suite-test"] = StringFlag("--suite-test") auto_server_test_main(test, op.parse(sys.argv), timeout=180) Increase getset.t timeout to 6 minutes (because it was still timing out under valgrind).#!/usr/bin/python import os, subprocess from test_common import * def test(opts, port): # The test scripts now get the port as an environment variable (instead of running the server themselves). os.environ["RUN_PORT"] = str(port) os.environ["PERLLIB"] = os.path.abspath(os.getcwd()) + "/integration/memcached_suite/lib:" + os.getenv("PERLLIB", "") proc = subprocess.Popen(opts["suite-test"]) assert proc.wait() == 0 if __name__ == "__main__": op = make_option_parser() op["suite-test"] = StringFlag("--suite-test") auto_server_test_main(test, op.parse(sys.argv), timeout=360)
<commit_before>#!/usr/bin/python import os, subprocess from test_common import * def test(opts, port): # The test scripts now get the port as an environment variable (instead of running the server themselves). os.environ["RUN_PORT"] = str(port) os.environ["PERLLIB"] = os.path.abspath(os.getcwd()) + "/integration/memcached_suite/lib:" + os.getenv("PERLLIB", "") proc = subprocess.Popen(opts["suite-test"]) assert proc.wait() == 0 if __name__ == "__main__": op = make_option_parser() op["suite-test"] = StringFlag("--suite-test") auto_server_test_main(test, op.parse(sys.argv), timeout=180) <commit_msg>Increase getset.t timeout to 6 minutes (because it was still timing out under valgrind).<commit_after>#!/usr/bin/python import os, subprocess from test_common import * def test(opts, port): # The test scripts now get the port as an environment variable (instead of running the server themselves). os.environ["RUN_PORT"] = str(port) os.environ["PERLLIB"] = os.path.abspath(os.getcwd()) + "/integration/memcached_suite/lib:" + os.getenv("PERLLIB", "") proc = subprocess.Popen(opts["suite-test"]) assert proc.wait() == 0 if __name__ == "__main__": op = make_option_parser() op["suite-test"] = StringFlag("--suite-test") auto_server_test_main(test, op.parse(sys.argv), timeout=360)
a81186cdad8ac878c4968c8e2563d9aeae6f1c58
tests/test_design_patterns.py
tests/test_design_patterns.py
__author__ = 'Shyue Ping Ong' __copyright__ = 'Copyright 2014, The Materials Virtual Lab' __version__ = '0.1' __maintainer__ = 'Shyue Ping Ong' __email__ = 'ongsp@ucsd.edu' __date__ = '1/24/14' import unittest from monty.design_patterns import singleton, cached_class class SingletonTest(unittest.TestCase): def test_singleton(self): @singleton class A(): pass a1 = A() a2 = A() self.assertEqual(id(a1), id(a2)) class CachedClassTest(unittest.TestCase): def test_cached_class(self): @cached_class class A(object): def __init__(self, val): self.val = val a1a = A(1) a1b = A(1) a2 = A(2) self.assertEqual(id(a1a), id(a1b)) self.assertNotEqual(id(a1a), id(a2)) if __name__ == "__main__": unittest.main()
__author__ = 'Shyue Ping Ong' __copyright__ = 'Copyright 2014, The Materials Virtual Lab' __version__ = '0.1' __maintainer__ = 'Shyue Ping Ong' __email__ = 'ongsp@ucsd.edu' __date__ = '1/24/14' import unittest import pickle from monty.design_patterns import singleton, cached_class class SingletonTest(unittest.TestCase): def test_singleton(self): @singleton class A(): pass a1 = A() a2 = A() self.assertEqual(id(a1), id(a2)) @cached_class class A(object): def __init__(self, val): self.val = val def __getinitargs__(self): return self.val, def __getnewargs__(self): return self.val, class CachedClassTest(unittest.TestCase): def test_cached_class(self): a1a = A(1) a1b = A(1) a2 = A(2) self.assertEqual(id(a1a), id(a1b)) self.assertNotEqual(id(a1a), id(a2)) def test_pickle(self): a = A(2) o = pickle.dumps(a) self.assertEqual(a, pickle.loads(o)) if __name__ == "__main__": unittest.main()
Add pickle test for monty cached_class decorator.
Add pickle test for monty cached_class decorator.
Python
mit
gmatteo/monty,yanikou19/monty,gmatteo/monty,materialsvirtuallab/monty,davidwaroquiers/monty,gpetretto/monty,materialsvirtuallab/monty,davidwaroquiers/monty
__author__ = 'Shyue Ping Ong' __copyright__ = 'Copyright 2014, The Materials Virtual Lab' __version__ = '0.1' __maintainer__ = 'Shyue Ping Ong' __email__ = 'ongsp@ucsd.edu' __date__ = '1/24/14' import unittest from monty.design_patterns import singleton, cached_class class SingletonTest(unittest.TestCase): def test_singleton(self): @singleton class A(): pass a1 = A() a2 = A() self.assertEqual(id(a1), id(a2)) class CachedClassTest(unittest.TestCase): def test_cached_class(self): @cached_class class A(object): def __init__(self, val): self.val = val a1a = A(1) a1b = A(1) a2 = A(2) self.assertEqual(id(a1a), id(a1b)) self.assertNotEqual(id(a1a), id(a2)) if __name__ == "__main__": unittest.main() Add pickle test for monty cached_class decorator.
__author__ = 'Shyue Ping Ong' __copyright__ = 'Copyright 2014, The Materials Virtual Lab' __version__ = '0.1' __maintainer__ = 'Shyue Ping Ong' __email__ = 'ongsp@ucsd.edu' __date__ = '1/24/14' import unittest import pickle from monty.design_patterns import singleton, cached_class class SingletonTest(unittest.TestCase): def test_singleton(self): @singleton class A(): pass a1 = A() a2 = A() self.assertEqual(id(a1), id(a2)) @cached_class class A(object): def __init__(self, val): self.val = val def __getinitargs__(self): return self.val, def __getnewargs__(self): return self.val, class CachedClassTest(unittest.TestCase): def test_cached_class(self): a1a = A(1) a1b = A(1) a2 = A(2) self.assertEqual(id(a1a), id(a1b)) self.assertNotEqual(id(a1a), id(a2)) def test_pickle(self): a = A(2) o = pickle.dumps(a) self.assertEqual(a, pickle.loads(o)) if __name__ == "__main__": unittest.main()
<commit_before>__author__ = 'Shyue Ping Ong' __copyright__ = 'Copyright 2014, The Materials Virtual Lab' __version__ = '0.1' __maintainer__ = 'Shyue Ping Ong' __email__ = 'ongsp@ucsd.edu' __date__ = '1/24/14' import unittest from monty.design_patterns import singleton, cached_class class SingletonTest(unittest.TestCase): def test_singleton(self): @singleton class A(): pass a1 = A() a2 = A() self.assertEqual(id(a1), id(a2)) class CachedClassTest(unittest.TestCase): def test_cached_class(self): @cached_class class A(object): def __init__(self, val): self.val = val a1a = A(1) a1b = A(1) a2 = A(2) self.assertEqual(id(a1a), id(a1b)) self.assertNotEqual(id(a1a), id(a2)) if __name__ == "__main__": unittest.main() <commit_msg>Add pickle test for monty cached_class decorator.<commit_after>
__author__ = 'Shyue Ping Ong' __copyright__ = 'Copyright 2014, The Materials Virtual Lab' __version__ = '0.1' __maintainer__ = 'Shyue Ping Ong' __email__ = 'ongsp@ucsd.edu' __date__ = '1/24/14' import unittest import pickle from monty.design_patterns import singleton, cached_class class SingletonTest(unittest.TestCase): def test_singleton(self): @singleton class A(): pass a1 = A() a2 = A() self.assertEqual(id(a1), id(a2)) @cached_class class A(object): def __init__(self, val): self.val = val def __getinitargs__(self): return self.val, def __getnewargs__(self): return self.val, class CachedClassTest(unittest.TestCase): def test_cached_class(self): a1a = A(1) a1b = A(1) a2 = A(2) self.assertEqual(id(a1a), id(a1b)) self.assertNotEqual(id(a1a), id(a2)) def test_pickle(self): a = A(2) o = pickle.dumps(a) self.assertEqual(a, pickle.loads(o)) if __name__ == "__main__": unittest.main()
__author__ = 'Shyue Ping Ong' __copyright__ = 'Copyright 2014, The Materials Virtual Lab' __version__ = '0.1' __maintainer__ = 'Shyue Ping Ong' __email__ = 'ongsp@ucsd.edu' __date__ = '1/24/14' import unittest from monty.design_patterns import singleton, cached_class class SingletonTest(unittest.TestCase): def test_singleton(self): @singleton class A(): pass a1 = A() a2 = A() self.assertEqual(id(a1), id(a2)) class CachedClassTest(unittest.TestCase): def test_cached_class(self): @cached_class class A(object): def __init__(self, val): self.val = val a1a = A(1) a1b = A(1) a2 = A(2) self.assertEqual(id(a1a), id(a1b)) self.assertNotEqual(id(a1a), id(a2)) if __name__ == "__main__": unittest.main() Add pickle test for monty cached_class decorator.__author__ = 'Shyue Ping Ong' __copyright__ = 'Copyright 2014, The Materials Virtual Lab' __version__ = '0.1' __maintainer__ = 'Shyue Ping Ong' __email__ = 'ongsp@ucsd.edu' __date__ = '1/24/14' import unittest import pickle from monty.design_patterns import singleton, cached_class class SingletonTest(unittest.TestCase): def test_singleton(self): @singleton class A(): pass a1 = A() a2 = A() self.assertEqual(id(a1), id(a2)) @cached_class class A(object): def __init__(self, val): self.val = val def __getinitargs__(self): return self.val, def __getnewargs__(self): return self.val, class CachedClassTest(unittest.TestCase): def test_cached_class(self): a1a = A(1) a1b = A(1) a2 = A(2) self.assertEqual(id(a1a), id(a1b)) self.assertNotEqual(id(a1a), id(a2)) def test_pickle(self): a = A(2) o = pickle.dumps(a) self.assertEqual(a, pickle.loads(o)) if __name__ == "__main__": unittest.main()
<commit_before>__author__ = 'Shyue Ping Ong' __copyright__ = 'Copyright 2014, The Materials Virtual Lab' __version__ = '0.1' __maintainer__ = 'Shyue Ping Ong' __email__ = 'ongsp@ucsd.edu' __date__ = '1/24/14' import unittest from monty.design_patterns import singleton, cached_class class SingletonTest(unittest.TestCase): def test_singleton(self): @singleton class A(): pass a1 = A() a2 = A() self.assertEqual(id(a1), id(a2)) class CachedClassTest(unittest.TestCase): def test_cached_class(self): @cached_class class A(object): def __init__(self, val): self.val = val a1a = A(1) a1b = A(1) a2 = A(2) self.assertEqual(id(a1a), id(a1b)) self.assertNotEqual(id(a1a), id(a2)) if __name__ == "__main__": unittest.main() <commit_msg>Add pickle test for monty cached_class decorator.<commit_after>__author__ = 'Shyue Ping Ong' __copyright__ = 'Copyright 2014, The Materials Virtual Lab' __version__ = '0.1' __maintainer__ = 'Shyue Ping Ong' __email__ = 'ongsp@ucsd.edu' __date__ = '1/24/14' import unittest import pickle from monty.design_patterns import singleton, cached_class class SingletonTest(unittest.TestCase): def test_singleton(self): @singleton class A(): pass a1 = A() a2 = A() self.assertEqual(id(a1), id(a2)) @cached_class class A(object): def __init__(self, val): self.val = val def __getinitargs__(self): return self.val, def __getnewargs__(self): return self.val, class CachedClassTest(unittest.TestCase): def test_cached_class(self): a1a = A(1) a1b = A(1) a2 = A(2) self.assertEqual(id(a1a), id(a1b)) self.assertNotEqual(id(a1a), id(a2)) def test_pickle(self): a = A(2) o = pickle.dumps(a) self.assertEqual(a, pickle.loads(o)) if __name__ == "__main__": unittest.main()
c135e9ac8fead8e9e58d2f34e5aa66354bd1b996
tests/test_route_requester.py
tests/test_route_requester.py
import unittest from pydirections.route_requester import DirectionsRequest from pydirections.exceptions import InvalidModeError, InvalidAPIKeyError, InvalidAlternativeError requester = DirectionsRequest(origin="San Francisco, CA", destination="Palo Alto, CA") class TestOptionalParameters(unittest.TestCase): def test_invalid_mode(self): """ Tests the is_valid_mode function for an invalid input """ with self.assertRaises(InvalidModeError): requester.set_mode("flying") def test_invalid_alternative(self): """ Tests for error handling when an invalid value is provided to the set_alternative function """ with self.assertRaises(InvalidAlternativeError): requester.set_alternatives('False') def test_invalid_restrictions(self): """ Tests for invalid route restrictions """ with self.assertRaises(ValueError): requester.set_route_restrictions("freeways", "railways") class TestAPIKey(unittest.TestCase): def test_invalid_api_key(self): invalid_key = 123456 with self.assertRaises(InvalidAPIKeyError): requester.set_api_key(invalid_key) if __name__ == '__main__': unittest.main()
import unittest from pydirections.route_requester import DirectionsRequest from pydirections.exceptions import InvalidModeError, InvalidAPIKeyError, InvalidAlternativeError import os MAPS_API_KEY = os.environ['MAPS_API_KEY'] class TestOptionalParameters(unittest.TestCase): def test_invalid_mode(self): """ Tests the is_valid_mode function for an invalid input """ requester = DirectionsRequest(origin="San Francisco, CA", destination="Palo Alto, CA", key=MAPS_API_KEY) with self.assertRaises(InvalidModeError): requester.set_mode("flying") def test_invalid_alternative(self): """ Tests for error handling when an invalid value is provided to the set_alternative function """ requester = DirectionsRequest(origin="San Francisco, CA", destination="Palo Alto, CA", key=MAPS_API_KEY) with self.assertRaises(InvalidAlternativeError): requester.set_alternatives('False') def test_invalid_restrictions(self): """ Tests for invalid route restrictions """ requester = DirectionsRequest(origin="San Francisco, CA", destination="Palo Alto, CA", key=MAPS_API_KEY) with self.assertRaises(ValueError): requester.set_route_restrictions("freeways", "railways") class TestAPIKey(unittest.TestCase): def test_invalid_api_key(self): requester = DirectionsRequest(origin="San Francisco, CA", destination="Palo Alto, CA", key=MAPS_API_KEY) invalid_key = 123456 with self.assertRaises(InvalidAPIKeyError): requester.set_api_key(invalid_key) if __name__ == '__main__': unittest.main()
Refactor tests to include API KEY
Refactor tests to include API KEY
Python
apache-2.0
apranav19/pydirections
import unittest from pydirections.route_requester import DirectionsRequest from pydirections.exceptions import InvalidModeError, InvalidAPIKeyError, InvalidAlternativeError requester = DirectionsRequest(origin="San Francisco, CA", destination="Palo Alto, CA") class TestOptionalParameters(unittest.TestCase): def test_invalid_mode(self): """ Tests the is_valid_mode function for an invalid input """ with self.assertRaises(InvalidModeError): requester.set_mode("flying") def test_invalid_alternative(self): """ Tests for error handling when an invalid value is provided to the set_alternative function """ with self.assertRaises(InvalidAlternativeError): requester.set_alternatives('False') def test_invalid_restrictions(self): """ Tests for invalid route restrictions """ with self.assertRaises(ValueError): requester.set_route_restrictions("freeways", "railways") class TestAPIKey(unittest.TestCase): def test_invalid_api_key(self): invalid_key = 123456 with self.assertRaises(InvalidAPIKeyError): requester.set_api_key(invalid_key) if __name__ == '__main__': unittest.main()Refactor tests to include API KEY
import unittest from pydirections.route_requester import DirectionsRequest from pydirections.exceptions import InvalidModeError, InvalidAPIKeyError, InvalidAlternativeError import os MAPS_API_KEY = os.environ['MAPS_API_KEY'] class TestOptionalParameters(unittest.TestCase): def test_invalid_mode(self): """ Tests the is_valid_mode function for an invalid input """ requester = DirectionsRequest(origin="San Francisco, CA", destination="Palo Alto, CA", key=MAPS_API_KEY) with self.assertRaises(InvalidModeError): requester.set_mode("flying") def test_invalid_alternative(self): """ Tests for error handling when an invalid value is provided to the set_alternative function """ requester = DirectionsRequest(origin="San Francisco, CA", destination="Palo Alto, CA", key=MAPS_API_KEY) with self.assertRaises(InvalidAlternativeError): requester.set_alternatives('False') def test_invalid_restrictions(self): """ Tests for invalid route restrictions """ requester = DirectionsRequest(origin="San Francisco, CA", destination="Palo Alto, CA", key=MAPS_API_KEY) with self.assertRaises(ValueError): requester.set_route_restrictions("freeways", "railways") class TestAPIKey(unittest.TestCase): def test_invalid_api_key(self): requester = DirectionsRequest(origin="San Francisco, CA", destination="Palo Alto, CA", key=MAPS_API_KEY) invalid_key = 123456 with self.assertRaises(InvalidAPIKeyError): requester.set_api_key(invalid_key) if __name__ == '__main__': unittest.main()
<commit_before>import unittest from pydirections.route_requester import DirectionsRequest from pydirections.exceptions import InvalidModeError, InvalidAPIKeyError, InvalidAlternativeError requester = DirectionsRequest(origin="San Francisco, CA", destination="Palo Alto, CA") class TestOptionalParameters(unittest.TestCase): def test_invalid_mode(self): """ Tests the is_valid_mode function for an invalid input """ with self.assertRaises(InvalidModeError): requester.set_mode("flying") def test_invalid_alternative(self): """ Tests for error handling when an invalid value is provided to the set_alternative function """ with self.assertRaises(InvalidAlternativeError): requester.set_alternatives('False') def test_invalid_restrictions(self): """ Tests for invalid route restrictions """ with self.assertRaises(ValueError): requester.set_route_restrictions("freeways", "railways") class TestAPIKey(unittest.TestCase): def test_invalid_api_key(self): invalid_key = 123456 with self.assertRaises(InvalidAPIKeyError): requester.set_api_key(invalid_key) if __name__ == '__main__': unittest.main()<commit_msg>Refactor tests to include API KEY<commit_after>
import unittest from pydirections.route_requester import DirectionsRequest from pydirections.exceptions import InvalidModeError, InvalidAPIKeyError, InvalidAlternativeError import os MAPS_API_KEY = os.environ['MAPS_API_KEY'] class TestOptionalParameters(unittest.TestCase): def test_invalid_mode(self): """ Tests the is_valid_mode function for an invalid input """ requester = DirectionsRequest(origin="San Francisco, CA", destination="Palo Alto, CA", key=MAPS_API_KEY) with self.assertRaises(InvalidModeError): requester.set_mode("flying") def test_invalid_alternative(self): """ Tests for error handling when an invalid value is provided to the set_alternative function """ requester = DirectionsRequest(origin="San Francisco, CA", destination="Palo Alto, CA", key=MAPS_API_KEY) with self.assertRaises(InvalidAlternativeError): requester.set_alternatives('False') def test_invalid_restrictions(self): """ Tests for invalid route restrictions """ requester = DirectionsRequest(origin="San Francisco, CA", destination="Palo Alto, CA", key=MAPS_API_KEY) with self.assertRaises(ValueError): requester.set_route_restrictions("freeways", "railways") class TestAPIKey(unittest.TestCase): def test_invalid_api_key(self): requester = DirectionsRequest(origin="San Francisco, CA", destination="Palo Alto, CA", key=MAPS_API_KEY) invalid_key = 123456 with self.assertRaises(InvalidAPIKeyError): requester.set_api_key(invalid_key) if __name__ == '__main__': unittest.main()
import unittest from pydirections.route_requester import DirectionsRequest from pydirections.exceptions import InvalidModeError, InvalidAPIKeyError, InvalidAlternativeError requester = DirectionsRequest(origin="San Francisco, CA", destination="Palo Alto, CA") class TestOptionalParameters(unittest.TestCase): def test_invalid_mode(self): """ Tests the is_valid_mode function for an invalid input """ with self.assertRaises(InvalidModeError): requester.set_mode("flying") def test_invalid_alternative(self): """ Tests for error handling when an invalid value is provided to the set_alternative function """ with self.assertRaises(InvalidAlternativeError): requester.set_alternatives('False') def test_invalid_restrictions(self): """ Tests for invalid route restrictions """ with self.assertRaises(ValueError): requester.set_route_restrictions("freeways", "railways") class TestAPIKey(unittest.TestCase): def test_invalid_api_key(self): invalid_key = 123456 with self.assertRaises(InvalidAPIKeyError): requester.set_api_key(invalid_key) if __name__ == '__main__': unittest.main()Refactor tests to include API KEYimport unittest from pydirections.route_requester import DirectionsRequest from pydirections.exceptions import InvalidModeError, InvalidAPIKeyError, InvalidAlternativeError import os MAPS_API_KEY = os.environ['MAPS_API_KEY'] class TestOptionalParameters(unittest.TestCase): def test_invalid_mode(self): """ Tests the is_valid_mode function for an invalid input """ requester = DirectionsRequest(origin="San Francisco, CA", destination="Palo Alto, CA", key=MAPS_API_KEY) with self.assertRaises(InvalidModeError): requester.set_mode("flying") def test_invalid_alternative(self): """ Tests for error handling when an invalid value is provided to the set_alternative function """ requester = DirectionsRequest(origin="San Francisco, CA", destination="Palo Alto, CA", key=MAPS_API_KEY) with self.assertRaises(InvalidAlternativeError): requester.set_alternatives('False') def test_invalid_restrictions(self): """ Tests for invalid route restrictions """ requester = DirectionsRequest(origin="San Francisco, CA", destination="Palo Alto, CA", key=MAPS_API_KEY) with self.assertRaises(ValueError): requester.set_route_restrictions("freeways", "railways") class TestAPIKey(unittest.TestCase): def test_invalid_api_key(self): requester = DirectionsRequest(origin="San Francisco, CA", destination="Palo Alto, CA", key=MAPS_API_KEY) invalid_key = 123456 with self.assertRaises(InvalidAPIKeyError): requester.set_api_key(invalid_key) if __name__ == '__main__': unittest.main()
<commit_before>import unittest from pydirections.route_requester import DirectionsRequest from pydirections.exceptions import InvalidModeError, InvalidAPIKeyError, InvalidAlternativeError requester = DirectionsRequest(origin="San Francisco, CA", destination="Palo Alto, CA") class TestOptionalParameters(unittest.TestCase): def test_invalid_mode(self): """ Tests the is_valid_mode function for an invalid input """ with self.assertRaises(InvalidModeError): requester.set_mode("flying") def test_invalid_alternative(self): """ Tests for error handling when an invalid value is provided to the set_alternative function """ with self.assertRaises(InvalidAlternativeError): requester.set_alternatives('False') def test_invalid_restrictions(self): """ Tests for invalid route restrictions """ with self.assertRaises(ValueError): requester.set_route_restrictions("freeways", "railways") class TestAPIKey(unittest.TestCase): def test_invalid_api_key(self): invalid_key = 123456 with self.assertRaises(InvalidAPIKeyError): requester.set_api_key(invalid_key) if __name__ == '__main__': unittest.main()<commit_msg>Refactor tests to include API KEY<commit_after>import unittest from pydirections.route_requester import DirectionsRequest from pydirections.exceptions import InvalidModeError, InvalidAPIKeyError, InvalidAlternativeError import os MAPS_API_KEY = os.environ['MAPS_API_KEY'] class TestOptionalParameters(unittest.TestCase): def test_invalid_mode(self): """ Tests the is_valid_mode function for an invalid input """ requester = DirectionsRequest(origin="San Francisco, CA", destination="Palo Alto, CA", key=MAPS_API_KEY) with self.assertRaises(InvalidModeError): requester.set_mode("flying") def test_invalid_alternative(self): """ Tests for error handling when an invalid value is provided to the set_alternative function """ requester = DirectionsRequest(origin="San Francisco, CA", destination="Palo Alto, CA", key=MAPS_API_KEY) with self.assertRaises(InvalidAlternativeError): requester.set_alternatives('False') def test_invalid_restrictions(self): """ Tests for invalid route restrictions """ requester = DirectionsRequest(origin="San Francisco, CA", destination="Palo Alto, CA", key=MAPS_API_KEY) with self.assertRaises(ValueError): requester.set_route_restrictions("freeways", "railways") class TestAPIKey(unittest.TestCase): def test_invalid_api_key(self): requester = DirectionsRequest(origin="San Francisco, CA", destination="Palo Alto, CA", key=MAPS_API_KEY) invalid_key = 123456 with self.assertRaises(InvalidAPIKeyError): requester.set_api_key(invalid_key) if __name__ == '__main__': unittest.main()
c3db5ba2860dc4ddf034aa036be573dd75093473
tests/test_barebones.py
tests/test_barebones.py
# -*- coding: utf-8 -*- """ Tests for the barebones example project """ import os import py.path from tarbell.app import TarbellSite PATH = os.path.realpath('examples/barebones') def test_get_site(): site = TarbellSite(PATH) assert os.path.realpath(site.path) == os.path.realpath(PATH) assert site.project.name == "barebones" def test_generate_site(tmpdir): "Generate a static site matching what's in _site" site = TarbellSite(PATH) built = os.path.join(PATH, '_site') site.generate_static_site(str(tmpdir)) files = set(f.basename for f in tmpdir.listdir()) assert files == set(['data.json', 'index.html'])
# -*- coding: utf-8 -*- """ Tests for the barebones example project """ import os import py.path from tarbell.app import EXCLUDES, TarbellSite PATH = os.path.realpath('examples/barebones') def test_get_site(): site = TarbellSite(PATH) assert os.path.realpath(site.path) == os.path.realpath(PATH) assert site.project.name == "barebones" def test_default_excludes(): "Ensure a basic set of excluded files" site = TarbellSite(PATH) assert site.project.EXCLUDES == EXCLUDES def test_generate_site(tmpdir): "Generate a static site matching what's in _site" site = TarbellSite(PATH) built = os.path.join(PATH, '_site') site.generate_static_site(str(tmpdir)) files = set(f.basename for f in tmpdir.listdir()) assert files == set(['data.json', 'index.html'])
Add a test for default excludes, which is failing
Add a test for default excludes, which is failing
Python
bsd-3-clause
eyeseast/tarbell,eyeseast/tarbell,tarbell-project/tarbell,tarbell-project/tarbell
# -*- coding: utf-8 -*- """ Tests for the barebones example project """ import os import py.path from tarbell.app import TarbellSite PATH = os.path.realpath('examples/barebones') def test_get_site(): site = TarbellSite(PATH) assert os.path.realpath(site.path) == os.path.realpath(PATH) assert site.project.name == "barebones" def test_generate_site(tmpdir): "Generate a static site matching what's in _site" site = TarbellSite(PATH) built = os.path.join(PATH, '_site') site.generate_static_site(str(tmpdir)) files = set(f.basename for f in tmpdir.listdir()) assert files == set(['data.json', 'index.html'])Add a test for default excludes, which is failing
# -*- coding: utf-8 -*- """ Tests for the barebones example project """ import os import py.path from tarbell.app import EXCLUDES, TarbellSite PATH = os.path.realpath('examples/barebones') def test_get_site(): site = TarbellSite(PATH) assert os.path.realpath(site.path) == os.path.realpath(PATH) assert site.project.name == "barebones" def test_default_excludes(): "Ensure a basic set of excluded files" site = TarbellSite(PATH) assert site.project.EXCLUDES == EXCLUDES def test_generate_site(tmpdir): "Generate a static site matching what's in _site" site = TarbellSite(PATH) built = os.path.join(PATH, '_site') site.generate_static_site(str(tmpdir)) files = set(f.basename for f in tmpdir.listdir()) assert files == set(['data.json', 'index.html'])
<commit_before># -*- coding: utf-8 -*- """ Tests for the barebones example project """ import os import py.path from tarbell.app import TarbellSite PATH = os.path.realpath('examples/barebones') def test_get_site(): site = TarbellSite(PATH) assert os.path.realpath(site.path) == os.path.realpath(PATH) assert site.project.name == "barebones" def test_generate_site(tmpdir): "Generate a static site matching what's in _site" site = TarbellSite(PATH) built = os.path.join(PATH, '_site') site.generate_static_site(str(tmpdir)) files = set(f.basename for f in tmpdir.listdir()) assert files == set(['data.json', 'index.html'])<commit_msg>Add a test for default excludes, which is failing<commit_after>
# -*- coding: utf-8 -*- """ Tests for the barebones example project """ import os import py.path from tarbell.app import EXCLUDES, TarbellSite PATH = os.path.realpath('examples/barebones') def test_get_site(): site = TarbellSite(PATH) assert os.path.realpath(site.path) == os.path.realpath(PATH) assert site.project.name == "barebones" def test_default_excludes(): "Ensure a basic set of excluded files" site = TarbellSite(PATH) assert site.project.EXCLUDES == EXCLUDES def test_generate_site(tmpdir): "Generate a static site matching what's in _site" site = TarbellSite(PATH) built = os.path.join(PATH, '_site') site.generate_static_site(str(tmpdir)) files = set(f.basename for f in tmpdir.listdir()) assert files == set(['data.json', 'index.html'])
# -*- coding: utf-8 -*- """ Tests for the barebones example project """ import os import py.path from tarbell.app import TarbellSite PATH = os.path.realpath('examples/barebones') def test_get_site(): site = TarbellSite(PATH) assert os.path.realpath(site.path) == os.path.realpath(PATH) assert site.project.name == "barebones" def test_generate_site(tmpdir): "Generate a static site matching what's in _site" site = TarbellSite(PATH) built = os.path.join(PATH, '_site') site.generate_static_site(str(tmpdir)) files = set(f.basename for f in tmpdir.listdir()) assert files == set(['data.json', 'index.html'])Add a test for default excludes, which is failing# -*- coding: utf-8 -*- """ Tests for the barebones example project """ import os import py.path from tarbell.app import EXCLUDES, TarbellSite PATH = os.path.realpath('examples/barebones') def test_get_site(): site = TarbellSite(PATH) assert os.path.realpath(site.path) == os.path.realpath(PATH) assert site.project.name == "barebones" def test_default_excludes(): "Ensure a basic set of excluded files" site = TarbellSite(PATH) assert site.project.EXCLUDES == EXCLUDES def test_generate_site(tmpdir): "Generate a static site matching what's in _site" site = TarbellSite(PATH) built = os.path.join(PATH, '_site') site.generate_static_site(str(tmpdir)) files = set(f.basename for f in tmpdir.listdir()) assert files == set(['data.json', 'index.html'])
<commit_before># -*- coding: utf-8 -*- """ Tests for the barebones example project """ import os import py.path from tarbell.app import TarbellSite PATH = os.path.realpath('examples/barebones') def test_get_site(): site = TarbellSite(PATH) assert os.path.realpath(site.path) == os.path.realpath(PATH) assert site.project.name == "barebones" def test_generate_site(tmpdir): "Generate a static site matching what's in _site" site = TarbellSite(PATH) built = os.path.join(PATH, '_site') site.generate_static_site(str(tmpdir)) files = set(f.basename for f in tmpdir.listdir()) assert files == set(['data.json', 'index.html'])<commit_msg>Add a test for default excludes, which is failing<commit_after># -*- coding: utf-8 -*- """ Tests for the barebones example project """ import os import py.path from tarbell.app import EXCLUDES, TarbellSite PATH = os.path.realpath('examples/barebones') def test_get_site(): site = TarbellSite(PATH) assert os.path.realpath(site.path) == os.path.realpath(PATH) assert site.project.name == "barebones" def test_default_excludes(): "Ensure a basic set of excluded files" site = TarbellSite(PATH) assert site.project.EXCLUDES == EXCLUDES def test_generate_site(tmpdir): "Generate a static site matching what's in _site" site = TarbellSite(PATH) built = os.path.join(PATH, '_site') site.generate_static_site(str(tmpdir)) files = set(f.basename for f in tmpdir.listdir()) assert files == set(['data.json', 'index.html'])
c16006cd8983bbd73f52921c63a51aa6f29b9e88
ituro/accounts/tests.py
ituro/accounts/tests.py
from django.test import TestCase # Create your tests here.
from django.test import TestCase from django.utils import timezone from accounts.models import CustomUser, CustomUserManager class UserCreateTestCase(TestCase): def test_create_user_correctly(self): "Creating users correctly" new_user = CustomUser.objects.create( email="participant@gmail.com", name="Participant Name", phone="09876543210", school="Some University", is_staff="False", is_active="True", date_joined=timezone.now()) self.assertTrue(isinstance(new_user, CustomUser)) self.assertEqual(new_user.get_full_name(), "Participant Name") self.assertEqual(new_user.get_short_name(), "Participant Name")
Add test for creating accounts
Add test for creating accounts
Python
mit
bilbeyt/ituro,ITURO/ituro,bilbeyt/ituro,bilbeyt/ituro,ITURO/ituro,ITURO/ituro
from django.test import TestCase # Create your tests here. Add test for creating accounts
from django.test import TestCase from django.utils import timezone from accounts.models import CustomUser, CustomUserManager class UserCreateTestCase(TestCase): def test_create_user_correctly(self): "Creating users correctly" new_user = CustomUser.objects.create( email="participant@gmail.com", name="Participant Name", phone="09876543210", school="Some University", is_staff="False", is_active="True", date_joined=timezone.now()) self.assertTrue(isinstance(new_user, CustomUser)) self.assertEqual(new_user.get_full_name(), "Participant Name") self.assertEqual(new_user.get_short_name(), "Participant Name")
<commit_before>from django.test import TestCase # Create your tests here. <commit_msg>Add test for creating accounts<commit_after>
from django.test import TestCase from django.utils import timezone from accounts.models import CustomUser, CustomUserManager class UserCreateTestCase(TestCase): def test_create_user_correctly(self): "Creating users correctly" new_user = CustomUser.objects.create( email="participant@gmail.com", name="Participant Name", phone="09876543210", school="Some University", is_staff="False", is_active="True", date_joined=timezone.now()) self.assertTrue(isinstance(new_user, CustomUser)) self.assertEqual(new_user.get_full_name(), "Participant Name") self.assertEqual(new_user.get_short_name(), "Participant Name")
from django.test import TestCase # Create your tests here. Add test for creating accountsfrom django.test import TestCase from django.utils import timezone from accounts.models import CustomUser, CustomUserManager class UserCreateTestCase(TestCase): def test_create_user_correctly(self): "Creating users correctly" new_user = CustomUser.objects.create( email="participant@gmail.com", name="Participant Name", phone="09876543210", school="Some University", is_staff="False", is_active="True", date_joined=timezone.now()) self.assertTrue(isinstance(new_user, CustomUser)) self.assertEqual(new_user.get_full_name(), "Participant Name") self.assertEqual(new_user.get_short_name(), "Participant Name")
<commit_before>from django.test import TestCase # Create your tests here. <commit_msg>Add test for creating accounts<commit_after>from django.test import TestCase from django.utils import timezone from accounts.models import CustomUser, CustomUserManager class UserCreateTestCase(TestCase): def test_create_user_correctly(self): "Creating users correctly" new_user = CustomUser.objects.create( email="participant@gmail.com", name="Participant Name", phone="09876543210", school="Some University", is_staff="False", is_active="True", date_joined=timezone.now()) self.assertTrue(isinstance(new_user, CustomUser)) self.assertEqual(new_user.get_full_name(), "Participant Name") self.assertEqual(new_user.get_short_name(), "Participant Name")
0315f2b47261cfabe11b2668225ec1bc19e5493c
vispy_volume/tests/test_vispy_widget.py
vispy_volume/tests/test_vispy_widget.py
import numpy as np from ..vispy_widget import QtVispyWidget from glue.qt import get_qapp class Event(object): def __init__(self, text): self.text = text def test_widget(): # Make sure QApplication is started get_qapp() # Create fake data data = np.arange(1000).reshape((10,10,10)) # Set up widget w = QtVispyWidget() w.set_data(data) w.set_canvas() w.canvas.render() # Test changing colormap w.set_colormap() # Test key presses w.on_key_press(Event(text='1')) w.on_key_press(Event(text='2')) w.on_key_press(Event(text='3')) #Test mouse_wheel w.on_mouse_wheel(Event(type=mouse_wheel)
import numpy as np from ..vispy_widget import QtVispyWidget from glue.qt import get_qapp class KeyEvent(object): def __init__(self, text): self.text = text class MouseEvent(object): def __init__(self, delta, type): self.type = type self.delta = delta def test_widget(): # Make sure QApplication is started get_qapp() # Create fake data data = np.arange(1000).reshape((10,10,10)) # Set up widget w = QtVispyWidget() w.set_data(data) w.set_canvas() w.canvas.render() # Test changing colormap w.set_colormap() # Test key presses w.on_key_press(KeyEvent(text='1')) w.on_key_press(KeyEvent(text='2')) w.on_key_press(KeyEvent(text='3')) #Test mouse_wheel w.on_mouse_wheel(MouseEvent(type='mouse_wheel', delta=(0, 0.5))) w.on_mouse_wheel(MouseEvent(type='mouse_wheel', delta=(0, -0.3)))
Fix the mouse_wheel test unit
Fix the mouse_wheel test unit
Python
bsd-2-clause
astrofrog/glue-3d-viewer,PennyQ/astro-vispy,PennyQ/glue-3d-viewer,astrofrog/glue-vispy-viewers,glue-viz/glue-3d-viewer,glue-viz/glue-vispy-viewers
import numpy as np from ..vispy_widget import QtVispyWidget from glue.qt import get_qapp class Event(object): def __init__(self, text): self.text = text def test_widget(): # Make sure QApplication is started get_qapp() # Create fake data data = np.arange(1000).reshape((10,10,10)) # Set up widget w = QtVispyWidget() w.set_data(data) w.set_canvas() w.canvas.render() # Test changing colormap w.set_colormap() # Test key presses w.on_key_press(Event(text='1')) w.on_key_press(Event(text='2')) w.on_key_press(Event(text='3')) #Test mouse_wheel w.on_mouse_wheel(Event(type=mouse_wheel) Fix the mouse_wheel test unit
import numpy as np from ..vispy_widget import QtVispyWidget from glue.qt import get_qapp class KeyEvent(object): def __init__(self, text): self.text = text class MouseEvent(object): def __init__(self, delta, type): self.type = type self.delta = delta def test_widget(): # Make sure QApplication is started get_qapp() # Create fake data data = np.arange(1000).reshape((10,10,10)) # Set up widget w = QtVispyWidget() w.set_data(data) w.set_canvas() w.canvas.render() # Test changing colormap w.set_colormap() # Test key presses w.on_key_press(KeyEvent(text='1')) w.on_key_press(KeyEvent(text='2')) w.on_key_press(KeyEvent(text='3')) #Test mouse_wheel w.on_mouse_wheel(MouseEvent(type='mouse_wheel', delta=(0, 0.5))) w.on_mouse_wheel(MouseEvent(type='mouse_wheel', delta=(0, -0.3)))
<commit_before>import numpy as np from ..vispy_widget import QtVispyWidget from glue.qt import get_qapp class Event(object): def __init__(self, text): self.text = text def test_widget(): # Make sure QApplication is started get_qapp() # Create fake data data = np.arange(1000).reshape((10,10,10)) # Set up widget w = QtVispyWidget() w.set_data(data) w.set_canvas() w.canvas.render() # Test changing colormap w.set_colormap() # Test key presses w.on_key_press(Event(text='1')) w.on_key_press(Event(text='2')) w.on_key_press(Event(text='3')) #Test mouse_wheel w.on_mouse_wheel(Event(type=mouse_wheel) <commit_msg>Fix the mouse_wheel test unit<commit_after>
import numpy as np from ..vispy_widget import QtVispyWidget from glue.qt import get_qapp class KeyEvent(object): def __init__(self, text): self.text = text class MouseEvent(object): def __init__(self, delta, type): self.type = type self.delta = delta def test_widget(): # Make sure QApplication is started get_qapp() # Create fake data data = np.arange(1000).reshape((10,10,10)) # Set up widget w = QtVispyWidget() w.set_data(data) w.set_canvas() w.canvas.render() # Test changing colormap w.set_colormap() # Test key presses w.on_key_press(KeyEvent(text='1')) w.on_key_press(KeyEvent(text='2')) w.on_key_press(KeyEvent(text='3')) #Test mouse_wheel w.on_mouse_wheel(MouseEvent(type='mouse_wheel', delta=(0, 0.5))) w.on_mouse_wheel(MouseEvent(type='mouse_wheel', delta=(0, -0.3)))
import numpy as np from ..vispy_widget import QtVispyWidget from glue.qt import get_qapp class Event(object): def __init__(self, text): self.text = text def test_widget(): # Make sure QApplication is started get_qapp() # Create fake data data = np.arange(1000).reshape((10,10,10)) # Set up widget w = QtVispyWidget() w.set_data(data) w.set_canvas() w.canvas.render() # Test changing colormap w.set_colormap() # Test key presses w.on_key_press(Event(text='1')) w.on_key_press(Event(text='2')) w.on_key_press(Event(text='3')) #Test mouse_wheel w.on_mouse_wheel(Event(type=mouse_wheel) Fix the mouse_wheel test unitimport numpy as np from ..vispy_widget import QtVispyWidget from glue.qt import get_qapp class KeyEvent(object): def __init__(self, text): self.text = text class MouseEvent(object): def __init__(self, delta, type): self.type = type self.delta = delta def test_widget(): # Make sure QApplication is started get_qapp() # Create fake data data = np.arange(1000).reshape((10,10,10)) # Set up widget w = QtVispyWidget() w.set_data(data) w.set_canvas() w.canvas.render() # Test changing colormap w.set_colormap() # Test key presses w.on_key_press(KeyEvent(text='1')) w.on_key_press(KeyEvent(text='2')) w.on_key_press(KeyEvent(text='3')) #Test mouse_wheel w.on_mouse_wheel(MouseEvent(type='mouse_wheel', delta=(0, 0.5))) w.on_mouse_wheel(MouseEvent(type='mouse_wheel', delta=(0, -0.3)))
<commit_before>import numpy as np from ..vispy_widget import QtVispyWidget from glue.qt import get_qapp class Event(object): def __init__(self, text): self.text = text def test_widget(): # Make sure QApplication is started get_qapp() # Create fake data data = np.arange(1000).reshape((10,10,10)) # Set up widget w = QtVispyWidget() w.set_data(data) w.set_canvas() w.canvas.render() # Test changing colormap w.set_colormap() # Test key presses w.on_key_press(Event(text='1')) w.on_key_press(Event(text='2')) w.on_key_press(Event(text='3')) #Test mouse_wheel w.on_mouse_wheel(Event(type=mouse_wheel) <commit_msg>Fix the mouse_wheel test unit<commit_after>import numpy as np from ..vispy_widget import QtVispyWidget from glue.qt import get_qapp class KeyEvent(object): def __init__(self, text): self.text = text class MouseEvent(object): def __init__(self, delta, type): self.type = type self.delta = delta def test_widget(): # Make sure QApplication is started get_qapp() # Create fake data data = np.arange(1000).reshape((10,10,10)) # Set up widget w = QtVispyWidget() w.set_data(data) w.set_canvas() w.canvas.render() # Test changing colormap w.set_colormap() # Test key presses w.on_key_press(KeyEvent(text='1')) w.on_key_press(KeyEvent(text='2')) w.on_key_press(KeyEvent(text='3')) #Test mouse_wheel w.on_mouse_wheel(MouseEvent(type='mouse_wheel', delta=(0, 0.5))) w.on_mouse_wheel(MouseEvent(type='mouse_wheel', delta=(0, -0.3)))
4b4f07f4bf9d81ab1829ccdf6562dc95d75ab7d4
tests/test_objectify.py
tests/test_objectify.py
import copy import unittest import utils class ObjectifyTestCase(unittest.TestCase): def setUp(self): self.o = utils.Objectify() def test_bool_empty(self): self.assertFalse(self.o) def test_bool_not_empty(self): self.o['hello'] = 'world' self.assertTrue(self.o) def test_bool_false(self): self.o['hello'] = 'world' self.o['_bool'] = False self.assertFalse(self.o) def test_bool_true(self): self.o['_bool'] = True self.assertTrue(self.o) def test_dict(self): d = {'hello': 'world', 'thanks': 'mom'} o = utils.Objectify(copy.deepcopy(d)) self.assertEqual(len(o), len(d)) for key, value in d.items(): self.assertEqual(o[key], value) self.assertEqual(getattr(o, key), value) self.assertEqual(unicode(o), unicode(d)) self.assertEqual(str(o), str(d)) if __name__ == '__main__': unittest.main()
import copy import unittest import utils class ObjectifyTestCase(unittest.TestCase): def setUp(self): self.o = utils.objectify() def test_bool_empty(self): self.assertFalse(self.o) def test_bool_not_empty(self): self.o['hello'] = 'world' self.assertTrue(self.o) def test_bool_false(self): self.o['hello'] = 'world' self.o['_bool'] = False self.assertFalse(self.o) def test_bool_true(self): self.o['_bool'] = True self.assertTrue(self.o) def test_dict(self): d = {'hello': 'world', 'thanks': 'mom'} o = utils.objectify(copy.deepcopy(d)) self.assertEqual(len(o), len(d)) for key, value in d.items(): self.assertEqual(o[key], value) self.assertEqual(getattr(o, key), value) self.assertEqual(unicode(o), unicode(d)) self.assertEqual(str(o), str(d)) if __name__ == '__main__': unittest.main()
Fix naming issue in objectify test case
Fix naming issue in objectify test case
Python
mit
silas/ops
import copy import unittest import utils class ObjectifyTestCase(unittest.TestCase): def setUp(self): self.o = utils.Objectify() def test_bool_empty(self): self.assertFalse(self.o) def test_bool_not_empty(self): self.o['hello'] = 'world' self.assertTrue(self.o) def test_bool_false(self): self.o['hello'] = 'world' self.o['_bool'] = False self.assertFalse(self.o) def test_bool_true(self): self.o['_bool'] = True self.assertTrue(self.o) def test_dict(self): d = {'hello': 'world', 'thanks': 'mom'} o = utils.Objectify(copy.deepcopy(d)) self.assertEqual(len(o), len(d)) for key, value in d.items(): self.assertEqual(o[key], value) self.assertEqual(getattr(o, key), value) self.assertEqual(unicode(o), unicode(d)) self.assertEqual(str(o), str(d)) if __name__ == '__main__': unittest.main() Fix naming issue in objectify test case
import copy import unittest import utils class ObjectifyTestCase(unittest.TestCase): def setUp(self): self.o = utils.objectify() def test_bool_empty(self): self.assertFalse(self.o) def test_bool_not_empty(self): self.o['hello'] = 'world' self.assertTrue(self.o) def test_bool_false(self): self.o['hello'] = 'world' self.o['_bool'] = False self.assertFalse(self.o) def test_bool_true(self): self.o['_bool'] = True self.assertTrue(self.o) def test_dict(self): d = {'hello': 'world', 'thanks': 'mom'} o = utils.objectify(copy.deepcopy(d)) self.assertEqual(len(o), len(d)) for key, value in d.items(): self.assertEqual(o[key], value) self.assertEqual(getattr(o, key), value) self.assertEqual(unicode(o), unicode(d)) self.assertEqual(str(o), str(d)) if __name__ == '__main__': unittest.main()
<commit_before>import copy import unittest import utils class ObjectifyTestCase(unittest.TestCase): def setUp(self): self.o = utils.Objectify() def test_bool_empty(self): self.assertFalse(self.o) def test_bool_not_empty(self): self.o['hello'] = 'world' self.assertTrue(self.o) def test_bool_false(self): self.o['hello'] = 'world' self.o['_bool'] = False self.assertFalse(self.o) def test_bool_true(self): self.o['_bool'] = True self.assertTrue(self.o) def test_dict(self): d = {'hello': 'world', 'thanks': 'mom'} o = utils.Objectify(copy.deepcopy(d)) self.assertEqual(len(o), len(d)) for key, value in d.items(): self.assertEqual(o[key], value) self.assertEqual(getattr(o, key), value) self.assertEqual(unicode(o), unicode(d)) self.assertEqual(str(o), str(d)) if __name__ == '__main__': unittest.main() <commit_msg>Fix naming issue in objectify test case<commit_after>
import copy import unittest import utils class ObjectifyTestCase(unittest.TestCase): def setUp(self): self.o = utils.objectify() def test_bool_empty(self): self.assertFalse(self.o) def test_bool_not_empty(self): self.o['hello'] = 'world' self.assertTrue(self.o) def test_bool_false(self): self.o['hello'] = 'world' self.o['_bool'] = False self.assertFalse(self.o) def test_bool_true(self): self.o['_bool'] = True self.assertTrue(self.o) def test_dict(self): d = {'hello': 'world', 'thanks': 'mom'} o = utils.objectify(copy.deepcopy(d)) self.assertEqual(len(o), len(d)) for key, value in d.items(): self.assertEqual(o[key], value) self.assertEqual(getattr(o, key), value) self.assertEqual(unicode(o), unicode(d)) self.assertEqual(str(o), str(d)) if __name__ == '__main__': unittest.main()
import copy import unittest import utils class ObjectifyTestCase(unittest.TestCase): def setUp(self): self.o = utils.Objectify() def test_bool_empty(self): self.assertFalse(self.o) def test_bool_not_empty(self): self.o['hello'] = 'world' self.assertTrue(self.o) def test_bool_false(self): self.o['hello'] = 'world' self.o['_bool'] = False self.assertFalse(self.o) def test_bool_true(self): self.o['_bool'] = True self.assertTrue(self.o) def test_dict(self): d = {'hello': 'world', 'thanks': 'mom'} o = utils.Objectify(copy.deepcopy(d)) self.assertEqual(len(o), len(d)) for key, value in d.items(): self.assertEqual(o[key], value) self.assertEqual(getattr(o, key), value) self.assertEqual(unicode(o), unicode(d)) self.assertEqual(str(o), str(d)) if __name__ == '__main__': unittest.main() Fix naming issue in objectify test caseimport copy import unittest import utils class ObjectifyTestCase(unittest.TestCase): def setUp(self): self.o = utils.objectify() def test_bool_empty(self): self.assertFalse(self.o) def test_bool_not_empty(self): self.o['hello'] = 'world' self.assertTrue(self.o) def test_bool_false(self): self.o['hello'] = 'world' self.o['_bool'] = False self.assertFalse(self.o) def test_bool_true(self): self.o['_bool'] = True self.assertTrue(self.o) def test_dict(self): d = {'hello': 'world', 'thanks': 'mom'} o = utils.objectify(copy.deepcopy(d)) self.assertEqual(len(o), len(d)) for key, value in d.items(): self.assertEqual(o[key], value) self.assertEqual(getattr(o, key), value) self.assertEqual(unicode(o), unicode(d)) self.assertEqual(str(o), str(d)) if __name__ == '__main__': unittest.main()
<commit_before>import copy import unittest import utils class ObjectifyTestCase(unittest.TestCase): def setUp(self): self.o = utils.Objectify() def test_bool_empty(self): self.assertFalse(self.o) def test_bool_not_empty(self): self.o['hello'] = 'world' self.assertTrue(self.o) def test_bool_false(self): self.o['hello'] = 'world' self.o['_bool'] = False self.assertFalse(self.o) def test_bool_true(self): self.o['_bool'] = True self.assertTrue(self.o) def test_dict(self): d = {'hello': 'world', 'thanks': 'mom'} o = utils.Objectify(copy.deepcopy(d)) self.assertEqual(len(o), len(d)) for key, value in d.items(): self.assertEqual(o[key], value) self.assertEqual(getattr(o, key), value) self.assertEqual(unicode(o), unicode(d)) self.assertEqual(str(o), str(d)) if __name__ == '__main__': unittest.main() <commit_msg>Fix naming issue in objectify test case<commit_after>import copy import unittest import utils class ObjectifyTestCase(unittest.TestCase): def setUp(self): self.o = utils.objectify() def test_bool_empty(self): self.assertFalse(self.o) def test_bool_not_empty(self): self.o['hello'] = 'world' self.assertTrue(self.o) def test_bool_false(self): self.o['hello'] = 'world' self.o['_bool'] = False self.assertFalse(self.o) def test_bool_true(self): self.o['_bool'] = True self.assertTrue(self.o) def test_dict(self): d = {'hello': 'world', 'thanks': 'mom'} o = utils.objectify(copy.deepcopy(d)) self.assertEqual(len(o), len(d)) for key, value in d.items(): self.assertEqual(o[key], value) self.assertEqual(getattr(o, key), value) self.assertEqual(unicode(o), unicode(d)) self.assertEqual(str(o), str(d)) if __name__ == '__main__': unittest.main()
1c216c833d42b648e4d38298eac1616d8748c76d
tests/test_pathutils.py
tests/test_pathutils.py
from os.path import join import sublime import sys from unittest import TestCase from unittest.mock import patch version = sublime.version() if version < '3000': from libsass import pathutils else: from sublime_libsass.libsass import pathutils class TestPathutils(TestCase): @classmethod def setUpClass(cls): super(TestPathutils, cls).setUpClass() import time time.sleep(3) # Fix for Python3 async importing? Some race condition. def test_subpaths(self): path = join('/foo','bar','baz') exprmt = pathutils.subpaths(path) expect = [ join('/foo','bar','baz'), join('/foo','bar'), join('/foo'), join('/') ] self.assertEqual(exprmt, expect) @patch('pathutils.os') def test_grep_r(self, mock_os): mock_os.walk = lambda x: [('/tmp','',['file.scss'])] self.assertEqual(pathutils.find_type_dirs('anything', '.scss'), ['/tmp']) self.assertEqual(pathutils.find_type_dirs('anything', ['.scss', '.sass']), ['/tmp']) self.assertEqual(pathutils.find_type_dirs('anything', '.sass'), []) self.assertEqual(pathutils.find_type_dirs('anything', ['.txt', '.csv']), [])
from os.path import join import sublime import sys from unittest import TestCase from unittest.mock import patch version = sublime.version() class TestPathutils(TestCase): @classmethod def setUpClass(cls): super(TestPathutils, cls).setUpClass() if version < '3000': from libsass import pathutils else: from sublime_libsass.libsass import pathutils def test_subpaths(self): path = join('/foo','bar','baz') exprmt = pathutils.subpaths(path) expect = [ join('/foo','bar','baz'), join('/foo','bar'), join('/foo'), join('/') ] self.assertEqual(exprmt, expect) @patch('pathutils.os') def test_grep_r(self, mock_os): mock_os.walk = lambda x: [('/tmp','',['file.scss'])] self.assertEqual(pathutils.find_type_dirs('anything', '.scss'), ['/tmp']) self.assertEqual(pathutils.find_type_dirs('anything', ['.scss', '.sass']), ['/tmp']) self.assertEqual(pathutils.find_type_dirs('anything', '.sass'), []) self.assertEqual(pathutils.find_type_dirs('anything', ['.txt', '.csv']), [])
Move importing of source to class setup
Move importing of source to class setup
Python
mit
blitzrk/sublime_libsass,blitzrk/sublime_libsass
from os.path import join import sublime import sys from unittest import TestCase from unittest.mock import patch version = sublime.version() if version < '3000': from libsass import pathutils else: from sublime_libsass.libsass import pathutils class TestPathutils(TestCase): @classmethod def setUpClass(cls): super(TestPathutils, cls).setUpClass() import time time.sleep(3) # Fix for Python3 async importing? Some race condition. def test_subpaths(self): path = join('/foo','bar','baz') exprmt = pathutils.subpaths(path) expect = [ join('/foo','bar','baz'), join('/foo','bar'), join('/foo'), join('/') ] self.assertEqual(exprmt, expect) @patch('pathutils.os') def test_grep_r(self, mock_os): mock_os.walk = lambda x: [('/tmp','',['file.scss'])] self.assertEqual(pathutils.find_type_dirs('anything', '.scss'), ['/tmp']) self.assertEqual(pathutils.find_type_dirs('anything', ['.scss', '.sass']), ['/tmp']) self.assertEqual(pathutils.find_type_dirs('anything', '.sass'), []) self.assertEqual(pathutils.find_type_dirs('anything', ['.txt', '.csv']), []) Move importing of source to class setup
from os.path import join import sublime import sys from unittest import TestCase from unittest.mock import patch version = sublime.version() class TestPathutils(TestCase): @classmethod def setUpClass(cls): super(TestPathutils, cls).setUpClass() if version < '3000': from libsass import pathutils else: from sublime_libsass.libsass import pathutils def test_subpaths(self): path = join('/foo','bar','baz') exprmt = pathutils.subpaths(path) expect = [ join('/foo','bar','baz'), join('/foo','bar'), join('/foo'), join('/') ] self.assertEqual(exprmt, expect) @patch('pathutils.os') def test_grep_r(self, mock_os): mock_os.walk = lambda x: [('/tmp','',['file.scss'])] self.assertEqual(pathutils.find_type_dirs('anything', '.scss'), ['/tmp']) self.assertEqual(pathutils.find_type_dirs('anything', ['.scss', '.sass']), ['/tmp']) self.assertEqual(pathutils.find_type_dirs('anything', '.sass'), []) self.assertEqual(pathutils.find_type_dirs('anything', ['.txt', '.csv']), [])
<commit_before>from os.path import join import sublime import sys from unittest import TestCase from unittest.mock import patch version = sublime.version() if version < '3000': from libsass import pathutils else: from sublime_libsass.libsass import pathutils class TestPathutils(TestCase): @classmethod def setUpClass(cls): super(TestPathutils, cls).setUpClass() import time time.sleep(3) # Fix for Python3 async importing? Some race condition. def test_subpaths(self): path = join('/foo','bar','baz') exprmt = pathutils.subpaths(path) expect = [ join('/foo','bar','baz'), join('/foo','bar'), join('/foo'), join('/') ] self.assertEqual(exprmt, expect) @patch('pathutils.os') def test_grep_r(self, mock_os): mock_os.walk = lambda x: [('/tmp','',['file.scss'])] self.assertEqual(pathutils.find_type_dirs('anything', '.scss'), ['/tmp']) self.assertEqual(pathutils.find_type_dirs('anything', ['.scss', '.sass']), ['/tmp']) self.assertEqual(pathutils.find_type_dirs('anything', '.sass'), []) self.assertEqual(pathutils.find_type_dirs('anything', ['.txt', '.csv']), []) <commit_msg>Move importing of source to class setup<commit_after>
from os.path import join import sublime import sys from unittest import TestCase from unittest.mock import patch version = sublime.version() class TestPathutils(TestCase): @classmethod def setUpClass(cls): super(TestPathutils, cls).setUpClass() if version < '3000': from libsass import pathutils else: from sublime_libsass.libsass import pathutils def test_subpaths(self): path = join('/foo','bar','baz') exprmt = pathutils.subpaths(path) expect = [ join('/foo','bar','baz'), join('/foo','bar'), join('/foo'), join('/') ] self.assertEqual(exprmt, expect) @patch('pathutils.os') def test_grep_r(self, mock_os): mock_os.walk = lambda x: [('/tmp','',['file.scss'])] self.assertEqual(pathutils.find_type_dirs('anything', '.scss'), ['/tmp']) self.assertEqual(pathutils.find_type_dirs('anything', ['.scss', '.sass']), ['/tmp']) self.assertEqual(pathutils.find_type_dirs('anything', '.sass'), []) self.assertEqual(pathutils.find_type_dirs('anything', ['.txt', '.csv']), [])
from os.path import join import sublime import sys from unittest import TestCase from unittest.mock import patch version = sublime.version() if version < '3000': from libsass import pathutils else: from sublime_libsass.libsass import pathutils class TestPathutils(TestCase): @classmethod def setUpClass(cls): super(TestPathutils, cls).setUpClass() import time time.sleep(3) # Fix for Python3 async importing? Some race condition. def test_subpaths(self): path = join('/foo','bar','baz') exprmt = pathutils.subpaths(path) expect = [ join('/foo','bar','baz'), join('/foo','bar'), join('/foo'), join('/') ] self.assertEqual(exprmt, expect) @patch('pathutils.os') def test_grep_r(self, mock_os): mock_os.walk = lambda x: [('/tmp','',['file.scss'])] self.assertEqual(pathutils.find_type_dirs('anything', '.scss'), ['/tmp']) self.assertEqual(pathutils.find_type_dirs('anything', ['.scss', '.sass']), ['/tmp']) self.assertEqual(pathutils.find_type_dirs('anything', '.sass'), []) self.assertEqual(pathutils.find_type_dirs('anything', ['.txt', '.csv']), []) Move importing of source to class setupfrom os.path import join import sublime import sys from unittest import TestCase from unittest.mock import patch version = sublime.version() class TestPathutils(TestCase): @classmethod def setUpClass(cls): super(TestPathutils, cls).setUpClass() if version < '3000': from libsass import pathutils else: from sublime_libsass.libsass import pathutils def test_subpaths(self): path = join('/foo','bar','baz') exprmt = pathutils.subpaths(path) expect = [ join('/foo','bar','baz'), join('/foo','bar'), join('/foo'), join('/') ] self.assertEqual(exprmt, expect) @patch('pathutils.os') def test_grep_r(self, mock_os): mock_os.walk = lambda x: [('/tmp','',['file.scss'])] self.assertEqual(pathutils.find_type_dirs('anything', '.scss'), ['/tmp']) self.assertEqual(pathutils.find_type_dirs('anything', ['.scss', '.sass']), ['/tmp']) self.assertEqual(pathutils.find_type_dirs('anything', '.sass'), []) self.assertEqual(pathutils.find_type_dirs('anything', ['.txt', '.csv']), [])
<commit_before>from os.path import join import sublime import sys from unittest import TestCase from unittest.mock import patch version = sublime.version() if version < '3000': from libsass import pathutils else: from sublime_libsass.libsass import pathutils class TestPathutils(TestCase): @classmethod def setUpClass(cls): super(TestPathutils, cls).setUpClass() import time time.sleep(3) # Fix for Python3 async importing? Some race condition. def test_subpaths(self): path = join('/foo','bar','baz') exprmt = pathutils.subpaths(path) expect = [ join('/foo','bar','baz'), join('/foo','bar'), join('/foo'), join('/') ] self.assertEqual(exprmt, expect) @patch('pathutils.os') def test_grep_r(self, mock_os): mock_os.walk = lambda x: [('/tmp','',['file.scss'])] self.assertEqual(pathutils.find_type_dirs('anything', '.scss'), ['/tmp']) self.assertEqual(pathutils.find_type_dirs('anything', ['.scss', '.sass']), ['/tmp']) self.assertEqual(pathutils.find_type_dirs('anything', '.sass'), []) self.assertEqual(pathutils.find_type_dirs('anything', ['.txt', '.csv']), []) <commit_msg>Move importing of source to class setup<commit_after>from os.path import join import sublime import sys from unittest import TestCase from unittest.mock import patch version = sublime.version() class TestPathutils(TestCase): @classmethod def setUpClass(cls): super(TestPathutils, cls).setUpClass() if version < '3000': from libsass import pathutils else: from sublime_libsass.libsass import pathutils def test_subpaths(self): path = join('/foo','bar','baz') exprmt = pathutils.subpaths(path) expect = [ join('/foo','bar','baz'), join('/foo','bar'), join('/foo'), join('/') ] self.assertEqual(exprmt, expect) @patch('pathutils.os') def test_grep_r(self, mock_os): mock_os.walk = lambda x: [('/tmp','',['file.scss'])] self.assertEqual(pathutils.find_type_dirs('anything', '.scss'), ['/tmp']) self.assertEqual(pathutils.find_type_dirs('anything', ['.scss', '.sass']), ['/tmp']) self.assertEqual(pathutils.find_type_dirs('anything', '.sass'), []) self.assertEqual(pathutils.find_type_dirs('anything', ['.txt', '.csv']), [])
78410c7cd8b5ff2907d9db8a672c663552c62a1c
src/ekklesia_portal/concepts/ballot/ballot_contracts.py
src/ekklesia_portal/concepts/ballot/ballot_contracts.py
from colander import Length from deform.widget import Select2Widget, TextAreaWidget from ekklesia_common.contract import Form, Schema, int_property, json_property, string_property from ekklesia_common.translation import _ class BallotSchema(Schema): name = string_property(title=_('name'), validator=Length(min=2, max=23), missing='') election = int_property(title=_('election_positions'), missing=0) result = json_property(title=_('voting_result'), missing={}) area_id = int_property(title=_('subject_area'), missing=None) voting_id = int_property(title=('voting_phase'), missing=None) proposition_type_id = int_property(title=('proposition_type'), missing=None) class BallotForm(Form): def __init__(self, request, action): super().__init__(BallotSchema(), request, action, buttons=("submit", )) def prepare_for_render(self, items_for_selects): widgets = { 'result': TextAreaWidget(rows=4), 'area_id': Select2Widget(values=items_for_selects['area']), 'voting_id': Select2Widget(values=items_for_selects['voting']), 'proposition_type_id': Select2Widget(values=items_for_selects['proposition_type']) } self.set_widgets(widgets)
from colander import Length from deform.widget import Select2Widget, TextAreaWidget from ekklesia_common.contract import Form, Schema, int_property, json_property, string_property from ekklesia_common.translation import _ class BallotSchema(Schema): name = string_property(title=_('name'), validator=Length(min=2, max=23), missing='') election = int_property(title=_('election_positions'), missing=0) result = json_property(title=_('voting_result'), missing={}) area_id = int_property(title=_('subject_area'), missing=None) voting_id = int_property(title=_('voting_phase'), missing=None) proposition_type_id = int_property(title=_('proposition_type'), missing=None) class BallotForm(Form): def __init__(self, request, action): super().__init__(BallotSchema(), request, action, buttons=("submit", )) def prepare_for_render(self, items_for_selects): widgets = { 'result': TextAreaWidget(rows=4), 'area_id': Select2Widget(values=items_for_selects['area']), 'voting_id': Select2Widget(values=items_for_selects['voting']), 'proposition_type_id': Select2Widget(values=items_for_selects['proposition_type']) } self.set_widgets(widgets)
Fix missing translations in ballot form
Fix missing translations in ballot form
Python
agpl-3.0
dpausp/arguments,dpausp/arguments,dpausp/arguments,dpausp/arguments
from colander import Length from deform.widget import Select2Widget, TextAreaWidget from ekklesia_common.contract import Form, Schema, int_property, json_property, string_property from ekklesia_common.translation import _ class BallotSchema(Schema): name = string_property(title=_('name'), validator=Length(min=2, max=23), missing='') election = int_property(title=_('election_positions'), missing=0) result = json_property(title=_('voting_result'), missing={}) area_id = int_property(title=_('subject_area'), missing=None) voting_id = int_property(title=('voting_phase'), missing=None) proposition_type_id = int_property(title=('proposition_type'), missing=None) class BallotForm(Form): def __init__(self, request, action): super().__init__(BallotSchema(), request, action, buttons=("submit", )) def prepare_for_render(self, items_for_selects): widgets = { 'result': TextAreaWidget(rows=4), 'area_id': Select2Widget(values=items_for_selects['area']), 'voting_id': Select2Widget(values=items_for_selects['voting']), 'proposition_type_id': Select2Widget(values=items_for_selects['proposition_type']) } self.set_widgets(widgets) Fix missing translations in ballot form
from colander import Length from deform.widget import Select2Widget, TextAreaWidget from ekklesia_common.contract import Form, Schema, int_property, json_property, string_property from ekklesia_common.translation import _ class BallotSchema(Schema): name = string_property(title=_('name'), validator=Length(min=2, max=23), missing='') election = int_property(title=_('election_positions'), missing=0) result = json_property(title=_('voting_result'), missing={}) area_id = int_property(title=_('subject_area'), missing=None) voting_id = int_property(title=_('voting_phase'), missing=None) proposition_type_id = int_property(title=_('proposition_type'), missing=None) class BallotForm(Form): def __init__(self, request, action): super().__init__(BallotSchema(), request, action, buttons=("submit", )) def prepare_for_render(self, items_for_selects): widgets = { 'result': TextAreaWidget(rows=4), 'area_id': Select2Widget(values=items_for_selects['area']), 'voting_id': Select2Widget(values=items_for_selects['voting']), 'proposition_type_id': Select2Widget(values=items_for_selects['proposition_type']) } self.set_widgets(widgets)
<commit_before>from colander import Length from deform.widget import Select2Widget, TextAreaWidget from ekklesia_common.contract import Form, Schema, int_property, json_property, string_property from ekklesia_common.translation import _ class BallotSchema(Schema): name = string_property(title=_('name'), validator=Length(min=2, max=23), missing='') election = int_property(title=_('election_positions'), missing=0) result = json_property(title=_('voting_result'), missing={}) area_id = int_property(title=_('subject_area'), missing=None) voting_id = int_property(title=('voting_phase'), missing=None) proposition_type_id = int_property(title=('proposition_type'), missing=None) class BallotForm(Form): def __init__(self, request, action): super().__init__(BallotSchema(), request, action, buttons=("submit", )) def prepare_for_render(self, items_for_selects): widgets = { 'result': TextAreaWidget(rows=4), 'area_id': Select2Widget(values=items_for_selects['area']), 'voting_id': Select2Widget(values=items_for_selects['voting']), 'proposition_type_id': Select2Widget(values=items_for_selects['proposition_type']) } self.set_widgets(widgets) <commit_msg>Fix missing translations in ballot form<commit_after>
from colander import Length from deform.widget import Select2Widget, TextAreaWidget from ekklesia_common.contract import Form, Schema, int_property, json_property, string_property from ekklesia_common.translation import _ class BallotSchema(Schema): name = string_property(title=_('name'), validator=Length(min=2, max=23), missing='') election = int_property(title=_('election_positions'), missing=0) result = json_property(title=_('voting_result'), missing={}) area_id = int_property(title=_('subject_area'), missing=None) voting_id = int_property(title=_('voting_phase'), missing=None) proposition_type_id = int_property(title=_('proposition_type'), missing=None) class BallotForm(Form): def __init__(self, request, action): super().__init__(BallotSchema(), request, action, buttons=("submit", )) def prepare_for_render(self, items_for_selects): widgets = { 'result': TextAreaWidget(rows=4), 'area_id': Select2Widget(values=items_for_selects['area']), 'voting_id': Select2Widget(values=items_for_selects['voting']), 'proposition_type_id': Select2Widget(values=items_for_selects['proposition_type']) } self.set_widgets(widgets)
from colander import Length from deform.widget import Select2Widget, TextAreaWidget from ekklesia_common.contract import Form, Schema, int_property, json_property, string_property from ekklesia_common.translation import _ class BallotSchema(Schema): name = string_property(title=_('name'), validator=Length(min=2, max=23), missing='') election = int_property(title=_('election_positions'), missing=0) result = json_property(title=_('voting_result'), missing={}) area_id = int_property(title=_('subject_area'), missing=None) voting_id = int_property(title=('voting_phase'), missing=None) proposition_type_id = int_property(title=('proposition_type'), missing=None) class BallotForm(Form): def __init__(self, request, action): super().__init__(BallotSchema(), request, action, buttons=("submit", )) def prepare_for_render(self, items_for_selects): widgets = { 'result': TextAreaWidget(rows=4), 'area_id': Select2Widget(values=items_for_selects['area']), 'voting_id': Select2Widget(values=items_for_selects['voting']), 'proposition_type_id': Select2Widget(values=items_for_selects['proposition_type']) } self.set_widgets(widgets) Fix missing translations in ballot formfrom colander import Length from deform.widget import Select2Widget, TextAreaWidget from ekklesia_common.contract import Form, Schema, int_property, json_property, string_property from ekklesia_common.translation import _ class BallotSchema(Schema): name = string_property(title=_('name'), validator=Length(min=2, max=23), missing='') election = int_property(title=_('election_positions'), missing=0) result = json_property(title=_('voting_result'), missing={}) area_id = int_property(title=_('subject_area'), missing=None) voting_id = int_property(title=_('voting_phase'), missing=None) proposition_type_id = int_property(title=_('proposition_type'), missing=None) class BallotForm(Form): def __init__(self, request, action): super().__init__(BallotSchema(), request, action, buttons=("submit", )) def prepare_for_render(self, items_for_selects): widgets = { 'result': TextAreaWidget(rows=4), 'area_id': Select2Widget(values=items_for_selects['area']), 'voting_id': Select2Widget(values=items_for_selects['voting']), 'proposition_type_id': Select2Widget(values=items_for_selects['proposition_type']) } self.set_widgets(widgets)
<commit_before>from colander import Length from deform.widget import Select2Widget, TextAreaWidget from ekklesia_common.contract import Form, Schema, int_property, json_property, string_property from ekklesia_common.translation import _ class BallotSchema(Schema): name = string_property(title=_('name'), validator=Length(min=2, max=23), missing='') election = int_property(title=_('election_positions'), missing=0) result = json_property(title=_('voting_result'), missing={}) area_id = int_property(title=_('subject_area'), missing=None) voting_id = int_property(title=('voting_phase'), missing=None) proposition_type_id = int_property(title=('proposition_type'), missing=None) class BallotForm(Form): def __init__(self, request, action): super().__init__(BallotSchema(), request, action, buttons=("submit", )) def prepare_for_render(self, items_for_selects): widgets = { 'result': TextAreaWidget(rows=4), 'area_id': Select2Widget(values=items_for_selects['area']), 'voting_id': Select2Widget(values=items_for_selects['voting']), 'proposition_type_id': Select2Widget(values=items_for_selects['proposition_type']) } self.set_widgets(widgets) <commit_msg>Fix missing translations in ballot form<commit_after>from colander import Length from deform.widget import Select2Widget, TextAreaWidget from ekklesia_common.contract import Form, Schema, int_property, json_property, string_property from ekklesia_common.translation import _ class BallotSchema(Schema): name = string_property(title=_('name'), validator=Length(min=2, max=23), missing='') election = int_property(title=_('election_positions'), missing=0) result = json_property(title=_('voting_result'), missing={}) area_id = int_property(title=_('subject_area'), missing=None) voting_id = int_property(title=_('voting_phase'), missing=None) proposition_type_id = int_property(title=_('proposition_type'), missing=None) class BallotForm(Form): def __init__(self, request, action): super().__init__(BallotSchema(), request, action, buttons=("submit", )) def prepare_for_render(self, items_for_selects): widgets = { 'result': TextAreaWidget(rows=4), 'area_id': Select2Widget(values=items_for_selects['area']), 'voting_id': Select2Widget(values=items_for_selects['voting']), 'proposition_type_id': Select2Widget(values=items_for_selects['proposition_type']) } self.set_widgets(widgets)
d20e916a23974f92ae4ea82226eef98a7c00de9e
ds_stack.py
ds_stack.py
from __future__ import absolute_import from __future__ import print_function from __future__ import division class Stack(object): """Stack class.""" def __init__(self): self.items = [] def is_empty(self): return self.items == [] def push(self, item): self.items.append(item) def pop(self): return self.items.pop() def peek(self): return self.items[len(self.items) - 1] def size(self): return len(self.items) def show(self): return self.items def main(): s = Stack() print(s.is_empty()) s.push(4) s.push('dog') print(s.peek()) s.push(True) print(s.size()) print(s.is_empty()) s.push(8.4) print(s.pop()) print(s.pop()) print(s.size()) print(s.show()) if __name__ == '__main__': main()
from __future__ import absolute_import from __future__ import print_function from __future__ import division class Stack(object): """Stack class.""" def __init__(self): self.items = [] def is_empty(self): return self.items == [] def peek(self): return self.items[-1] def push(self, item): self.items.append(item) def pop(self): return self.items.pop() def size(self): return len(self.items) def show(self): return self.items def main(): s = Stack() print('Is empty: {}'.format(s.is_empty())) s.push(4) s.push('dog') print('Peek: {}'.format(s.peek())) s.push(True) print('Size: {}'.format(s.size())) print('Is empty: {}'.format(s.is_empty())) s.push(8.4) print('Pop: {}'.format(s.pop())) print('Pop: {}'.format(s.pop())) print('Size: {}'.format(s.size())) print('Show: {}'.format(s.show())) if __name__ == '__main__': main()
Add peek() and revise main()
Add peek() and revise main()
Python
bsd-2-clause
bowen0701/algorithms_data_structures
from __future__ import absolute_import from __future__ import print_function from __future__ import division class Stack(object): """Stack class.""" def __init__(self): self.items = [] def is_empty(self): return self.items == [] def push(self, item): self.items.append(item) def pop(self): return self.items.pop() def peek(self): return self.items[len(self.items) - 1] def size(self): return len(self.items) def show(self): return self.items def main(): s = Stack() print(s.is_empty()) s.push(4) s.push('dog') print(s.peek()) s.push(True) print(s.size()) print(s.is_empty()) s.push(8.4) print(s.pop()) print(s.pop()) print(s.size()) print(s.show()) if __name__ == '__main__': main() Add peek() and revise main()
from __future__ import absolute_import from __future__ import print_function from __future__ import division class Stack(object): """Stack class.""" def __init__(self): self.items = [] def is_empty(self): return self.items == [] def peek(self): return self.items[-1] def push(self, item): self.items.append(item) def pop(self): return self.items.pop() def size(self): return len(self.items) def show(self): return self.items def main(): s = Stack() print('Is empty: {}'.format(s.is_empty())) s.push(4) s.push('dog') print('Peek: {}'.format(s.peek())) s.push(True) print('Size: {}'.format(s.size())) print('Is empty: {}'.format(s.is_empty())) s.push(8.4) print('Pop: {}'.format(s.pop())) print('Pop: {}'.format(s.pop())) print('Size: {}'.format(s.size())) print('Show: {}'.format(s.show())) if __name__ == '__main__': main()
<commit_before>from __future__ import absolute_import from __future__ import print_function from __future__ import division class Stack(object): """Stack class.""" def __init__(self): self.items = [] def is_empty(self): return self.items == [] def push(self, item): self.items.append(item) def pop(self): return self.items.pop() def peek(self): return self.items[len(self.items) - 1] def size(self): return len(self.items) def show(self): return self.items def main(): s = Stack() print(s.is_empty()) s.push(4) s.push('dog') print(s.peek()) s.push(True) print(s.size()) print(s.is_empty()) s.push(8.4) print(s.pop()) print(s.pop()) print(s.size()) print(s.show()) if __name__ == '__main__': main() <commit_msg>Add peek() and revise main()<commit_after>
from __future__ import absolute_import from __future__ import print_function from __future__ import division class Stack(object): """Stack class.""" def __init__(self): self.items = [] def is_empty(self): return self.items == [] def peek(self): return self.items[-1] def push(self, item): self.items.append(item) def pop(self): return self.items.pop() def size(self): return len(self.items) def show(self): return self.items def main(): s = Stack() print('Is empty: {}'.format(s.is_empty())) s.push(4) s.push('dog') print('Peek: {}'.format(s.peek())) s.push(True) print('Size: {}'.format(s.size())) print('Is empty: {}'.format(s.is_empty())) s.push(8.4) print('Pop: {}'.format(s.pop())) print('Pop: {}'.format(s.pop())) print('Size: {}'.format(s.size())) print('Show: {}'.format(s.show())) if __name__ == '__main__': main()
from __future__ import absolute_import from __future__ import print_function from __future__ import division class Stack(object): """Stack class.""" def __init__(self): self.items = [] def is_empty(self): return self.items == [] def push(self, item): self.items.append(item) def pop(self): return self.items.pop() def peek(self): return self.items[len(self.items) - 1] def size(self): return len(self.items) def show(self): return self.items def main(): s = Stack() print(s.is_empty()) s.push(4) s.push('dog') print(s.peek()) s.push(True) print(s.size()) print(s.is_empty()) s.push(8.4) print(s.pop()) print(s.pop()) print(s.size()) print(s.show()) if __name__ == '__main__': main() Add peek() and revise main()from __future__ import absolute_import from __future__ import print_function from __future__ import division class Stack(object): """Stack class.""" def __init__(self): self.items = [] def is_empty(self): return self.items == [] def peek(self): return self.items[-1] def push(self, item): self.items.append(item) def pop(self): return self.items.pop() def size(self): return len(self.items) def show(self): return self.items def main(): s = Stack() print('Is empty: {}'.format(s.is_empty())) s.push(4) s.push('dog') print('Peek: {}'.format(s.peek())) s.push(True) print('Size: {}'.format(s.size())) print('Is empty: {}'.format(s.is_empty())) s.push(8.4) print('Pop: {}'.format(s.pop())) print('Pop: {}'.format(s.pop())) print('Size: {}'.format(s.size())) print('Show: {}'.format(s.show())) if __name__ == '__main__': main()
<commit_before>from __future__ import absolute_import from __future__ import print_function from __future__ import division class Stack(object): """Stack class.""" def __init__(self): self.items = [] def is_empty(self): return self.items == [] def push(self, item): self.items.append(item) def pop(self): return self.items.pop() def peek(self): return self.items[len(self.items) - 1] def size(self): return len(self.items) def show(self): return self.items def main(): s = Stack() print(s.is_empty()) s.push(4) s.push('dog') print(s.peek()) s.push(True) print(s.size()) print(s.is_empty()) s.push(8.4) print(s.pop()) print(s.pop()) print(s.size()) print(s.show()) if __name__ == '__main__': main() <commit_msg>Add peek() and revise main()<commit_after>from __future__ import absolute_import from __future__ import print_function from __future__ import division class Stack(object): """Stack class.""" def __init__(self): self.items = [] def is_empty(self): return self.items == [] def peek(self): return self.items[-1] def push(self, item): self.items.append(item) def pop(self): return self.items.pop() def size(self): return len(self.items) def show(self): return self.items def main(): s = Stack() print('Is empty: {}'.format(s.is_empty())) s.push(4) s.push('dog') print('Peek: {}'.format(s.peek())) s.push(True) print('Size: {}'.format(s.size())) print('Is empty: {}'.format(s.is_empty())) s.push(8.4) print('Pop: {}'.format(s.pop())) print('Pop: {}'.format(s.pop())) print('Size: {}'.format(s.size())) print('Show: {}'.format(s.show())) if __name__ == '__main__': main()
7d605d762b204cb608553a27ec51925d0e3bfcb6
scripts/export-tutorial.py
scripts/export-tutorial.py
""" Exports tutorial materials written in Jupyter notebooks in the ../notebooks/tutorial folder to RST pages and their support files in the ../docs/tutorial folder. """ import subprocess import os # Get the list of tutorial notebooks. tutorial_notebooks = [f for f in os.listdir("../notebooks/tutorial") if (".ipynb" in f) and ("checkpoints" not in f)] # Run them in-place. # import pdb; pdb.set_trace() for notebook in tutorial_notebooks: print(" ".join(["jupyter", "nbconvert", "--to", "rst", "../notebooks/tutorial/{0}".format(notebook), "--output", "../docs/tutorial/{0}".format(notebook.replace(".ipynb", ".rst"))])) subprocess.run(["jupyter", "nbconvert", "--to", "rst", "../notebooks/tutorial/{0}".format(notebook), "--output", "../../docs/tutorial/{0}".format(notebook.replace(".ipynb", ".rst").lower())]) # # Get the list of generated files. # gened_files = [f for f in os.listdir(".") if (".py" not in f)] # # # Move them to where they need to be. Lowercase the filenames along the way, otherwise it causes issues once the # # files are hosted. # for file in gened_files: # with open(file, "r") as f: # buffer = f.read() # title = file.title()[:-4] # # import pdb; pdb.set_trace() # with open(file, "w") as f: # f.write(buffer.replace("/scripts/{0}".format(title), "/docs/tutorial/{0}".format(title))) # os.rename(file, "../docs/tutorial/{0}".format(file.lower()))
""" Exports tutorial materials written in Jupyter notebooks in the ../notebooks/tutorial folder to RST pages and their support files in the ../docs/tutorial folder. """ import subprocess import os # Get the list of tutorial notebooks. tutorial_notebooks = [f for f in os.listdir("../notebooks/tutorial") if (".ipynb" in f) and ("checkpoints" not in f)] # Run them in-place. for notebook in tutorial_notebooks: print(" ".join(["jupyter", "nbconvert", "--to", "rst", "../notebooks/tutorial/{0}".format(notebook), "--output", "../docs/tutorial/{0}".format(notebook.replace(".ipynb", ".rst"))])) subprocess.run(["jupyter", "nbconvert", "--to", "rst", "../notebooks/tutorial/{0}".format(notebook), "--output", "../../docs/tutorial/{0}".format(notebook.replace(".ipynb", ".rst").lower())])
Add docs README; remove unused assets.
Add docs README; remove unused assets.
Python
mit
ResidentMario/geoplot
""" Exports tutorial materials written in Jupyter notebooks in the ../notebooks/tutorial folder to RST pages and their support files in the ../docs/tutorial folder. """ import subprocess import os # Get the list of tutorial notebooks. tutorial_notebooks = [f for f in os.listdir("../notebooks/tutorial") if (".ipynb" in f) and ("checkpoints" not in f)] # Run them in-place. # import pdb; pdb.set_trace() for notebook in tutorial_notebooks: print(" ".join(["jupyter", "nbconvert", "--to", "rst", "../notebooks/tutorial/{0}".format(notebook), "--output", "../docs/tutorial/{0}".format(notebook.replace(".ipynb", ".rst"))])) subprocess.run(["jupyter", "nbconvert", "--to", "rst", "../notebooks/tutorial/{0}".format(notebook), "--output", "../../docs/tutorial/{0}".format(notebook.replace(".ipynb", ".rst").lower())]) # # Get the list of generated files. # gened_files = [f for f in os.listdir(".") if (".py" not in f)] # # # Move them to where they need to be. Lowercase the filenames along the way, otherwise it causes issues once the # # files are hosted. # for file in gened_files: # with open(file, "r") as f: # buffer = f.read() # title = file.title()[:-4] # # import pdb; pdb.set_trace() # with open(file, "w") as f: # f.write(buffer.replace("/scripts/{0}".format(title), "/docs/tutorial/{0}".format(title))) # os.rename(file, "../docs/tutorial/{0}".format(file.lower())) Add docs README; remove unused assets.
""" Exports tutorial materials written in Jupyter notebooks in the ../notebooks/tutorial folder to RST pages and their support files in the ../docs/tutorial folder. """ import subprocess import os # Get the list of tutorial notebooks. tutorial_notebooks = [f for f in os.listdir("../notebooks/tutorial") if (".ipynb" in f) and ("checkpoints" not in f)] # Run them in-place. for notebook in tutorial_notebooks: print(" ".join(["jupyter", "nbconvert", "--to", "rst", "../notebooks/tutorial/{0}".format(notebook), "--output", "../docs/tutorial/{0}".format(notebook.replace(".ipynb", ".rst"))])) subprocess.run(["jupyter", "nbconvert", "--to", "rst", "../notebooks/tutorial/{0}".format(notebook), "--output", "../../docs/tutorial/{0}".format(notebook.replace(".ipynb", ".rst").lower())])
<commit_before>""" Exports tutorial materials written in Jupyter notebooks in the ../notebooks/tutorial folder to RST pages and their support files in the ../docs/tutorial folder. """ import subprocess import os # Get the list of tutorial notebooks. tutorial_notebooks = [f for f in os.listdir("../notebooks/tutorial") if (".ipynb" in f) and ("checkpoints" not in f)] # Run them in-place. # import pdb; pdb.set_trace() for notebook in tutorial_notebooks: print(" ".join(["jupyter", "nbconvert", "--to", "rst", "../notebooks/tutorial/{0}".format(notebook), "--output", "../docs/tutorial/{0}".format(notebook.replace(".ipynb", ".rst"))])) subprocess.run(["jupyter", "nbconvert", "--to", "rst", "../notebooks/tutorial/{0}".format(notebook), "--output", "../../docs/tutorial/{0}".format(notebook.replace(".ipynb", ".rst").lower())]) # # Get the list of generated files. # gened_files = [f for f in os.listdir(".") if (".py" not in f)] # # # Move them to where they need to be. Lowercase the filenames along the way, otherwise it causes issues once the # # files are hosted. # for file in gened_files: # with open(file, "r") as f: # buffer = f.read() # title = file.title()[:-4] # # import pdb; pdb.set_trace() # with open(file, "w") as f: # f.write(buffer.replace("/scripts/{0}".format(title), "/docs/tutorial/{0}".format(title))) # os.rename(file, "../docs/tutorial/{0}".format(file.lower())) <commit_msg>Add docs README; remove unused assets.<commit_after>
""" Exports tutorial materials written in Jupyter notebooks in the ../notebooks/tutorial folder to RST pages and their support files in the ../docs/tutorial folder. """ import subprocess import os # Get the list of tutorial notebooks. tutorial_notebooks = [f for f in os.listdir("../notebooks/tutorial") if (".ipynb" in f) and ("checkpoints" not in f)] # Run them in-place. for notebook in tutorial_notebooks: print(" ".join(["jupyter", "nbconvert", "--to", "rst", "../notebooks/tutorial/{0}".format(notebook), "--output", "../docs/tutorial/{0}".format(notebook.replace(".ipynb", ".rst"))])) subprocess.run(["jupyter", "nbconvert", "--to", "rst", "../notebooks/tutorial/{0}".format(notebook), "--output", "../../docs/tutorial/{0}".format(notebook.replace(".ipynb", ".rst").lower())])
""" Exports tutorial materials written in Jupyter notebooks in the ../notebooks/tutorial folder to RST pages and their support files in the ../docs/tutorial folder. """ import subprocess import os # Get the list of tutorial notebooks. tutorial_notebooks = [f for f in os.listdir("../notebooks/tutorial") if (".ipynb" in f) and ("checkpoints" not in f)] # Run them in-place. # import pdb; pdb.set_trace() for notebook in tutorial_notebooks: print(" ".join(["jupyter", "nbconvert", "--to", "rst", "../notebooks/tutorial/{0}".format(notebook), "--output", "../docs/tutorial/{0}".format(notebook.replace(".ipynb", ".rst"))])) subprocess.run(["jupyter", "nbconvert", "--to", "rst", "../notebooks/tutorial/{0}".format(notebook), "--output", "../../docs/tutorial/{0}".format(notebook.replace(".ipynb", ".rst").lower())]) # # Get the list of generated files. # gened_files = [f for f in os.listdir(".") if (".py" not in f)] # # # Move them to where they need to be. Lowercase the filenames along the way, otherwise it causes issues once the # # files are hosted. # for file in gened_files: # with open(file, "r") as f: # buffer = f.read() # title = file.title()[:-4] # # import pdb; pdb.set_trace() # with open(file, "w") as f: # f.write(buffer.replace("/scripts/{0}".format(title), "/docs/tutorial/{0}".format(title))) # os.rename(file, "../docs/tutorial/{0}".format(file.lower())) Add docs README; remove unused assets.""" Exports tutorial materials written in Jupyter notebooks in the ../notebooks/tutorial folder to RST pages and their support files in the ../docs/tutorial folder. """ import subprocess import os # Get the list of tutorial notebooks. tutorial_notebooks = [f for f in os.listdir("../notebooks/tutorial") if (".ipynb" in f) and ("checkpoints" not in f)] # Run them in-place. for notebook in tutorial_notebooks: print(" ".join(["jupyter", "nbconvert", "--to", "rst", "../notebooks/tutorial/{0}".format(notebook), "--output", "../docs/tutorial/{0}".format(notebook.replace(".ipynb", ".rst"))])) subprocess.run(["jupyter", "nbconvert", "--to", "rst", "../notebooks/tutorial/{0}".format(notebook), "--output", "../../docs/tutorial/{0}".format(notebook.replace(".ipynb", ".rst").lower())])
<commit_before>""" Exports tutorial materials written in Jupyter notebooks in the ../notebooks/tutorial folder to RST pages and their support files in the ../docs/tutorial folder. """ import subprocess import os # Get the list of tutorial notebooks. tutorial_notebooks = [f for f in os.listdir("../notebooks/tutorial") if (".ipynb" in f) and ("checkpoints" not in f)] # Run them in-place. # import pdb; pdb.set_trace() for notebook in tutorial_notebooks: print(" ".join(["jupyter", "nbconvert", "--to", "rst", "../notebooks/tutorial/{0}".format(notebook), "--output", "../docs/tutorial/{0}".format(notebook.replace(".ipynb", ".rst"))])) subprocess.run(["jupyter", "nbconvert", "--to", "rst", "../notebooks/tutorial/{0}".format(notebook), "--output", "../../docs/tutorial/{0}".format(notebook.replace(".ipynb", ".rst").lower())]) # # Get the list of generated files. # gened_files = [f for f in os.listdir(".") if (".py" not in f)] # # # Move them to where they need to be. Lowercase the filenames along the way, otherwise it causes issues once the # # files are hosted. # for file in gened_files: # with open(file, "r") as f: # buffer = f.read() # title = file.title()[:-4] # # import pdb; pdb.set_trace() # with open(file, "w") as f: # f.write(buffer.replace("/scripts/{0}".format(title), "/docs/tutorial/{0}".format(title))) # os.rename(file, "../docs/tutorial/{0}".format(file.lower())) <commit_msg>Add docs README; remove unused assets.<commit_after>""" Exports tutorial materials written in Jupyter notebooks in the ../notebooks/tutorial folder to RST pages and their support files in the ../docs/tutorial folder. """ import subprocess import os # Get the list of tutorial notebooks. tutorial_notebooks = [f for f in os.listdir("../notebooks/tutorial") if (".ipynb" in f) and ("checkpoints" not in f)] # Run them in-place. for notebook in tutorial_notebooks: print(" ".join(["jupyter", "nbconvert", "--to", "rst", "../notebooks/tutorial/{0}".format(notebook), "--output", "../docs/tutorial/{0}".format(notebook.replace(".ipynb", ".rst"))])) subprocess.run(["jupyter", "nbconvert", "--to", "rst", "../notebooks/tutorial/{0}".format(notebook), "--output", "../../docs/tutorial/{0}".format(notebook.replace(".ipynb", ".rst").lower())])
214b74d4cf3902456ed274f756f4827f18c0c988
logster/server.py
logster/server.py
import os from tornado.ioloop import IOLoop from tornado.web import Application from tornado.httpserver import HTTPServer from . import handlers class LogsterApplication(Application): handlers = [ (r'/', handlers.IndexHandler), ] settings = { 'template_path': os.path.join( os.path.dirname(__file__), '../templates') } def __init__(self): super(LogsterApplication, self).__init__( handlers=self.handlers, **self.settings ) def run_server(): app = LogsterApplication() server = HTTPServer(app) server.listen(8888) IOLoop.current().start()
import os from tornado.ioloop import IOLoop from tornado.web import Application from tornado.httpserver import HTTPServer from . import handlers from .conf import config class LogsterApplication(Application): handlers = [ (r'/', handlers.IndexHandler), ] settings = { 'template_path': os.path.join( os.path.dirname(__file__), '../templates') } def __init__(self): super(LogsterApplication, self).__init__( handlers=self.handlers, **self.settings ) def run_server(): app = LogsterApplication() server = HTTPServer(app) server.listen(config['app']['port']) IOLoop.current().start()
Use post value from config
Use post value from config
Python
mit
irvind/logster,irvind/logster,irvind/logster
import os from tornado.ioloop import IOLoop from tornado.web import Application from tornado.httpserver import HTTPServer from . import handlers class LogsterApplication(Application): handlers = [ (r'/', handlers.IndexHandler), ] settings = { 'template_path': os.path.join( os.path.dirname(__file__), '../templates') } def __init__(self): super(LogsterApplication, self).__init__( handlers=self.handlers, **self.settings ) def run_server(): app = LogsterApplication() server = HTTPServer(app) server.listen(8888) IOLoop.current().start() Use post value from config
import os from tornado.ioloop import IOLoop from tornado.web import Application from tornado.httpserver import HTTPServer from . import handlers from .conf import config class LogsterApplication(Application): handlers = [ (r'/', handlers.IndexHandler), ] settings = { 'template_path': os.path.join( os.path.dirname(__file__), '../templates') } def __init__(self): super(LogsterApplication, self).__init__( handlers=self.handlers, **self.settings ) def run_server(): app = LogsterApplication() server = HTTPServer(app) server.listen(config['app']['port']) IOLoop.current().start()
<commit_before>import os from tornado.ioloop import IOLoop from tornado.web import Application from tornado.httpserver import HTTPServer from . import handlers class LogsterApplication(Application): handlers = [ (r'/', handlers.IndexHandler), ] settings = { 'template_path': os.path.join( os.path.dirname(__file__), '../templates') } def __init__(self): super(LogsterApplication, self).__init__( handlers=self.handlers, **self.settings ) def run_server(): app = LogsterApplication() server = HTTPServer(app) server.listen(8888) IOLoop.current().start() <commit_msg>Use post value from config<commit_after>
import os from tornado.ioloop import IOLoop from tornado.web import Application from tornado.httpserver import HTTPServer from . import handlers from .conf import config class LogsterApplication(Application): handlers = [ (r'/', handlers.IndexHandler), ] settings = { 'template_path': os.path.join( os.path.dirname(__file__), '../templates') } def __init__(self): super(LogsterApplication, self).__init__( handlers=self.handlers, **self.settings ) def run_server(): app = LogsterApplication() server = HTTPServer(app) server.listen(config['app']['port']) IOLoop.current().start()
import os from tornado.ioloop import IOLoop from tornado.web import Application from tornado.httpserver import HTTPServer from . import handlers class LogsterApplication(Application): handlers = [ (r'/', handlers.IndexHandler), ] settings = { 'template_path': os.path.join( os.path.dirname(__file__), '../templates') } def __init__(self): super(LogsterApplication, self).__init__( handlers=self.handlers, **self.settings ) def run_server(): app = LogsterApplication() server = HTTPServer(app) server.listen(8888) IOLoop.current().start() Use post value from configimport os from tornado.ioloop import IOLoop from tornado.web import Application from tornado.httpserver import HTTPServer from . import handlers from .conf import config class LogsterApplication(Application): handlers = [ (r'/', handlers.IndexHandler), ] settings = { 'template_path': os.path.join( os.path.dirname(__file__), '../templates') } def __init__(self): super(LogsterApplication, self).__init__( handlers=self.handlers, **self.settings ) def run_server(): app = LogsterApplication() server = HTTPServer(app) server.listen(config['app']['port']) IOLoop.current().start()
<commit_before>import os from tornado.ioloop import IOLoop from tornado.web import Application from tornado.httpserver import HTTPServer from . import handlers class LogsterApplication(Application): handlers = [ (r'/', handlers.IndexHandler), ] settings = { 'template_path': os.path.join( os.path.dirname(__file__), '../templates') } def __init__(self): super(LogsterApplication, self).__init__( handlers=self.handlers, **self.settings ) def run_server(): app = LogsterApplication() server = HTTPServer(app) server.listen(8888) IOLoop.current().start() <commit_msg>Use post value from config<commit_after>import os from tornado.ioloop import IOLoop from tornado.web import Application from tornado.httpserver import HTTPServer from . import handlers from .conf import config class LogsterApplication(Application): handlers = [ (r'/', handlers.IndexHandler), ] settings = { 'template_path': os.path.join( os.path.dirname(__file__), '../templates') } def __init__(self): super(LogsterApplication, self).__init__( handlers=self.handlers, **self.settings ) def run_server(): app = LogsterApplication() server = HTTPServer(app) server.listen(config['app']['port']) IOLoop.current().start()
cde4bc1112f2ceb45f42de21c45d46d96097d5bc
app/forms.py
app/forms.py
from flask_wtf import Form from wtforms import TextField from wtforms.validators import InputRequired, Length, Regexp class SignupForm(Form): username = TextField(validators=[InputRequired(), Length(min=1, max=30), Regexp("^[a-zA-Z0-9]+$")]) publicKey = TextField(validators=[InputRequired()]) # Add Length and Regexp as required
from flask_wtf import Form from wtforms import TextField, DateTimeField from wtforms.validators import InputRequired, Length, Regexp class SignupForm(Form): username = TextField(validators=[InputRequired(), Length(min=1, max=30), Regexp("^[a-zA-Z0-9]+$")]) publicKey = TextField(validators=[InputRequired()]) # Add Length and Regexp as required class AddEventForm(Form): name = TextField(validators=[InputRequired(), Length(min=1, max=30), Regexp("^[a-zA-Z0-9]+$")]) start = DateTimeField(format='%Y-%m-%dT%H:%M:00.000+0000', validators=[InputRequired()]) end = DateTimeField(format='%Y-%m-%dT%H:%M:00.000+0000', validators=[InputRequired()]) description = TextField(validators=[InputRequired(), Length(min=0, max=1000)])
Add basic AddEvent form with datetime conversion.
Add basic AddEvent form with datetime conversion.
Python
agpl-3.0
mitclap/backend
from flask_wtf import Form from wtforms import TextField from wtforms.validators import InputRequired, Length, Regexp class SignupForm(Form): username = TextField(validators=[InputRequired(), Length(min=1, max=30), Regexp("^[a-zA-Z0-9]+$")]) publicKey = TextField(validators=[InputRequired()]) # Add Length and Regexp as required Add basic AddEvent form with datetime conversion.
from flask_wtf import Form from wtforms import TextField, DateTimeField from wtforms.validators import InputRequired, Length, Regexp class SignupForm(Form): username = TextField(validators=[InputRequired(), Length(min=1, max=30), Regexp("^[a-zA-Z0-9]+$")]) publicKey = TextField(validators=[InputRequired()]) # Add Length and Regexp as required class AddEventForm(Form): name = TextField(validators=[InputRequired(), Length(min=1, max=30), Regexp("^[a-zA-Z0-9]+$")]) start = DateTimeField(format='%Y-%m-%dT%H:%M:00.000+0000', validators=[InputRequired()]) end = DateTimeField(format='%Y-%m-%dT%H:%M:00.000+0000', validators=[InputRequired()]) description = TextField(validators=[InputRequired(), Length(min=0, max=1000)])
<commit_before>from flask_wtf import Form from wtforms import TextField from wtforms.validators import InputRequired, Length, Regexp class SignupForm(Form): username = TextField(validators=[InputRequired(), Length(min=1, max=30), Regexp("^[a-zA-Z0-9]+$")]) publicKey = TextField(validators=[InputRequired()]) # Add Length and Regexp as required <commit_msg>Add basic AddEvent form with datetime conversion.<commit_after>
from flask_wtf import Form from wtforms import TextField, DateTimeField from wtforms.validators import InputRequired, Length, Regexp class SignupForm(Form): username = TextField(validators=[InputRequired(), Length(min=1, max=30), Regexp("^[a-zA-Z0-9]+$")]) publicKey = TextField(validators=[InputRequired()]) # Add Length and Regexp as required class AddEventForm(Form): name = TextField(validators=[InputRequired(), Length(min=1, max=30), Regexp("^[a-zA-Z0-9]+$")]) start = DateTimeField(format='%Y-%m-%dT%H:%M:00.000+0000', validators=[InputRequired()]) end = DateTimeField(format='%Y-%m-%dT%H:%M:00.000+0000', validators=[InputRequired()]) description = TextField(validators=[InputRequired(), Length(min=0, max=1000)])
from flask_wtf import Form from wtforms import TextField from wtforms.validators import InputRequired, Length, Regexp class SignupForm(Form): username = TextField(validators=[InputRequired(), Length(min=1, max=30), Regexp("^[a-zA-Z0-9]+$")]) publicKey = TextField(validators=[InputRequired()]) # Add Length and Regexp as required Add basic AddEvent form with datetime conversion.from flask_wtf import Form from wtforms import TextField, DateTimeField from wtforms.validators import InputRequired, Length, Regexp class SignupForm(Form): username = TextField(validators=[InputRequired(), Length(min=1, max=30), Regexp("^[a-zA-Z0-9]+$")]) publicKey = TextField(validators=[InputRequired()]) # Add Length and Regexp as required class AddEventForm(Form): name = TextField(validators=[InputRequired(), Length(min=1, max=30), Regexp("^[a-zA-Z0-9]+$")]) start = DateTimeField(format='%Y-%m-%dT%H:%M:00.000+0000', validators=[InputRequired()]) end = DateTimeField(format='%Y-%m-%dT%H:%M:00.000+0000', validators=[InputRequired()]) description = TextField(validators=[InputRequired(), Length(min=0, max=1000)])
<commit_before>from flask_wtf import Form from wtforms import TextField from wtforms.validators import InputRequired, Length, Regexp class SignupForm(Form): username = TextField(validators=[InputRequired(), Length(min=1, max=30), Regexp("^[a-zA-Z0-9]+$")]) publicKey = TextField(validators=[InputRequired()]) # Add Length and Regexp as required <commit_msg>Add basic AddEvent form with datetime conversion.<commit_after>from flask_wtf import Form from wtforms import TextField, DateTimeField from wtforms.validators import InputRequired, Length, Regexp class SignupForm(Form): username = TextField(validators=[InputRequired(), Length(min=1, max=30), Regexp("^[a-zA-Z0-9]+$")]) publicKey = TextField(validators=[InputRequired()]) # Add Length and Regexp as required class AddEventForm(Form): name = TextField(validators=[InputRequired(), Length(min=1, max=30), Regexp("^[a-zA-Z0-9]+$")]) start = DateTimeField(format='%Y-%m-%dT%H:%M:00.000+0000', validators=[InputRequired()]) end = DateTimeField(format='%Y-%m-%dT%H:%M:00.000+0000', validators=[InputRequired()]) description = TextField(validators=[InputRequired(), Length(min=0, max=1000)])
235430ef759068f5f3e82ad547e37f68e4af217e
fuzz/afl-server.py
fuzz/afl-server.py
# Invariant tested: No matter what random garbage a client throws at us, we # either successfully parse it, or else throw a RemoteProtocolError, never any # other error. import sys import os import afl import h11 if sys.version_info[0] >= 3: in_file = sys.stdin.detach() else: in_file = sys.stdin afl.init() data = in_file.read() # one big chunk server1 = h11.Connection(h11.SERVER) try: server1.receive_data(data) server1.receive_data(b"") except h11.RemoteProtocolError: pass # byte at a time server2 = h11.Connection(h11.SERVER) for i in range(len(data)): try: server2.receive_data(data[i:i + 1]) except h11.RemoteProtocolError: pass try: server2.receive_data(b"") except h11.RemoteProtocolError: pass # Suggested by the afl-python docs -- this substantially speeds up fuzzing, at # the risk of missing bugs that would cause the interpreter to crash on # exit. h11 is pure python, so I'm pretty sure h11 doesn't have any bugs that # would cause the interpreter to crash on exit. os._exit(0)
# Invariant tested: No matter what random garbage a client throws at us, we # either successfully parse it, or else throw a RemoteProtocolError, never any # other error. import sys import os import afl import h11 if sys.version_info[0] >= 3: in_file = sys.stdin.detach() else: in_file = sys.stdin def process_all(c): while True: event = c.next_event() if event is h11.NEED_DATA or event is h11.PAUSED: break if type(event) is h11.ConnectionClosed: break afl.init() data = in_file.read() # one big chunk server1 = h11.Connection(h11.SERVER) try: server1.receive_data(data) process_all(server1) server1.receive_data(b"") process_all(server1) except h11.RemoteProtocolError: pass # byte at a time server2 = h11.Connection(h11.SERVER) try: for i in range(len(data)): server2.receive_data(data[i:i + 1]) process_all(server2) server2.receive_data(b"") process_all(server2) except h11.RemoteProtocolError: pass # Suggested by the afl-python docs -- this substantially speeds up fuzzing, at # the risk of missing bugs that would cause the interpreter to crash on # exit. h11 is pure python, so I'm pretty sure h11 doesn't have any bugs that # would cause the interpreter to crash on exit. os._exit(0)
Update fuzz harness for new receive API
Update fuzz harness for new receive API
Python
mit
njsmith/h11,python-hyper/h11
# Invariant tested: No matter what random garbage a client throws at us, we # either successfully parse it, or else throw a RemoteProtocolError, never any # other error. import sys import os import afl import h11 if sys.version_info[0] >= 3: in_file = sys.stdin.detach() else: in_file = sys.stdin afl.init() data = in_file.read() # one big chunk server1 = h11.Connection(h11.SERVER) try: server1.receive_data(data) server1.receive_data(b"") except h11.RemoteProtocolError: pass # byte at a time server2 = h11.Connection(h11.SERVER) for i in range(len(data)): try: server2.receive_data(data[i:i + 1]) except h11.RemoteProtocolError: pass try: server2.receive_data(b"") except h11.RemoteProtocolError: pass # Suggested by the afl-python docs -- this substantially speeds up fuzzing, at # the risk of missing bugs that would cause the interpreter to crash on # exit. h11 is pure python, so I'm pretty sure h11 doesn't have any bugs that # would cause the interpreter to crash on exit. os._exit(0) Update fuzz harness for new receive API
# Invariant tested: No matter what random garbage a client throws at us, we # either successfully parse it, or else throw a RemoteProtocolError, never any # other error. import sys import os import afl import h11 if sys.version_info[0] >= 3: in_file = sys.stdin.detach() else: in_file = sys.stdin def process_all(c): while True: event = c.next_event() if event is h11.NEED_DATA or event is h11.PAUSED: break if type(event) is h11.ConnectionClosed: break afl.init() data = in_file.read() # one big chunk server1 = h11.Connection(h11.SERVER) try: server1.receive_data(data) process_all(server1) server1.receive_data(b"") process_all(server1) except h11.RemoteProtocolError: pass # byte at a time server2 = h11.Connection(h11.SERVER) try: for i in range(len(data)): server2.receive_data(data[i:i + 1]) process_all(server2) server2.receive_data(b"") process_all(server2) except h11.RemoteProtocolError: pass # Suggested by the afl-python docs -- this substantially speeds up fuzzing, at # the risk of missing bugs that would cause the interpreter to crash on # exit. h11 is pure python, so I'm pretty sure h11 doesn't have any bugs that # would cause the interpreter to crash on exit. os._exit(0)
<commit_before># Invariant tested: No matter what random garbage a client throws at us, we # either successfully parse it, or else throw a RemoteProtocolError, never any # other error. import sys import os import afl import h11 if sys.version_info[0] >= 3: in_file = sys.stdin.detach() else: in_file = sys.stdin afl.init() data = in_file.read() # one big chunk server1 = h11.Connection(h11.SERVER) try: server1.receive_data(data) server1.receive_data(b"") except h11.RemoteProtocolError: pass # byte at a time server2 = h11.Connection(h11.SERVER) for i in range(len(data)): try: server2.receive_data(data[i:i + 1]) except h11.RemoteProtocolError: pass try: server2.receive_data(b"") except h11.RemoteProtocolError: pass # Suggested by the afl-python docs -- this substantially speeds up fuzzing, at # the risk of missing bugs that would cause the interpreter to crash on # exit. h11 is pure python, so I'm pretty sure h11 doesn't have any bugs that # would cause the interpreter to crash on exit. os._exit(0) <commit_msg>Update fuzz harness for new receive API<commit_after>
# Invariant tested: No matter what random garbage a client throws at us, we # either successfully parse it, or else throw a RemoteProtocolError, never any # other error. import sys import os import afl import h11 if sys.version_info[0] >= 3: in_file = sys.stdin.detach() else: in_file = sys.stdin def process_all(c): while True: event = c.next_event() if event is h11.NEED_DATA or event is h11.PAUSED: break if type(event) is h11.ConnectionClosed: break afl.init() data = in_file.read() # one big chunk server1 = h11.Connection(h11.SERVER) try: server1.receive_data(data) process_all(server1) server1.receive_data(b"") process_all(server1) except h11.RemoteProtocolError: pass # byte at a time server2 = h11.Connection(h11.SERVER) try: for i in range(len(data)): server2.receive_data(data[i:i + 1]) process_all(server2) server2.receive_data(b"") process_all(server2) except h11.RemoteProtocolError: pass # Suggested by the afl-python docs -- this substantially speeds up fuzzing, at # the risk of missing bugs that would cause the interpreter to crash on # exit. h11 is pure python, so I'm pretty sure h11 doesn't have any bugs that # would cause the interpreter to crash on exit. os._exit(0)
# Invariant tested: No matter what random garbage a client throws at us, we # either successfully parse it, or else throw a RemoteProtocolError, never any # other error. import sys import os import afl import h11 if sys.version_info[0] >= 3: in_file = sys.stdin.detach() else: in_file = sys.stdin afl.init() data = in_file.read() # one big chunk server1 = h11.Connection(h11.SERVER) try: server1.receive_data(data) server1.receive_data(b"") except h11.RemoteProtocolError: pass # byte at a time server2 = h11.Connection(h11.SERVER) for i in range(len(data)): try: server2.receive_data(data[i:i + 1]) except h11.RemoteProtocolError: pass try: server2.receive_data(b"") except h11.RemoteProtocolError: pass # Suggested by the afl-python docs -- this substantially speeds up fuzzing, at # the risk of missing bugs that would cause the interpreter to crash on # exit. h11 is pure python, so I'm pretty sure h11 doesn't have any bugs that # would cause the interpreter to crash on exit. os._exit(0) Update fuzz harness for new receive API# Invariant tested: No matter what random garbage a client throws at us, we # either successfully parse it, or else throw a RemoteProtocolError, never any # other error. import sys import os import afl import h11 if sys.version_info[0] >= 3: in_file = sys.stdin.detach() else: in_file = sys.stdin def process_all(c): while True: event = c.next_event() if event is h11.NEED_DATA or event is h11.PAUSED: break if type(event) is h11.ConnectionClosed: break afl.init() data = in_file.read() # one big chunk server1 = h11.Connection(h11.SERVER) try: server1.receive_data(data) process_all(server1) server1.receive_data(b"") process_all(server1) except h11.RemoteProtocolError: pass # byte at a time server2 = h11.Connection(h11.SERVER) try: for i in range(len(data)): server2.receive_data(data[i:i + 1]) process_all(server2) server2.receive_data(b"") process_all(server2) except h11.RemoteProtocolError: pass # Suggested by the afl-python docs -- this substantially speeds up fuzzing, at # the risk of missing bugs that would cause the interpreter to crash on # exit. h11 is pure python, so I'm pretty sure h11 doesn't have any bugs that # would cause the interpreter to crash on exit. os._exit(0)
<commit_before># Invariant tested: No matter what random garbage a client throws at us, we # either successfully parse it, or else throw a RemoteProtocolError, never any # other error. import sys import os import afl import h11 if sys.version_info[0] >= 3: in_file = sys.stdin.detach() else: in_file = sys.stdin afl.init() data = in_file.read() # one big chunk server1 = h11.Connection(h11.SERVER) try: server1.receive_data(data) server1.receive_data(b"") except h11.RemoteProtocolError: pass # byte at a time server2 = h11.Connection(h11.SERVER) for i in range(len(data)): try: server2.receive_data(data[i:i + 1]) except h11.RemoteProtocolError: pass try: server2.receive_data(b"") except h11.RemoteProtocolError: pass # Suggested by the afl-python docs -- this substantially speeds up fuzzing, at # the risk of missing bugs that would cause the interpreter to crash on # exit. h11 is pure python, so I'm pretty sure h11 doesn't have any bugs that # would cause the interpreter to crash on exit. os._exit(0) <commit_msg>Update fuzz harness for new receive API<commit_after># Invariant tested: No matter what random garbage a client throws at us, we # either successfully parse it, or else throw a RemoteProtocolError, never any # other error. import sys import os import afl import h11 if sys.version_info[0] >= 3: in_file = sys.stdin.detach() else: in_file = sys.stdin def process_all(c): while True: event = c.next_event() if event is h11.NEED_DATA or event is h11.PAUSED: break if type(event) is h11.ConnectionClosed: break afl.init() data = in_file.read() # one big chunk server1 = h11.Connection(h11.SERVER) try: server1.receive_data(data) process_all(server1) server1.receive_data(b"") process_all(server1) except h11.RemoteProtocolError: pass # byte at a time server2 = h11.Connection(h11.SERVER) try: for i in range(len(data)): server2.receive_data(data[i:i + 1]) process_all(server2) server2.receive_data(b"") process_all(server2) except h11.RemoteProtocolError: pass # Suggested by the afl-python docs -- this substantially speeds up fuzzing, at # the risk of missing bugs that would cause the interpreter to crash on # exit. h11 is pure python, so I'm pretty sure h11 doesn't have any bugs that # would cause the interpreter to crash on exit. os._exit(0)
9e0e8f37942b85d9ebd86b2da05bb8eb54c99e7d
src/minerva/storage/trend/engine.py
src/minerva/storage/trend/engine.py
from contextlib import closing from minerva.directory import EntityType from minerva.storage import Engine from minerva.storage.trend import TableTrendStore class TrendEngine(Engine): @staticmethod def store(package): """ Return a function to bind a data source to the store command. :param package: A DataPackageBase subclass instance :return: function that can bind a data source to the store command :rtype: (data_source) -> (conn) -> None """ def bind_data_source(data_source): def execute(conn): entity_type_name = package.entity_type_name() with closing(conn.cursor()) as cursor: entity_type = EntityType.get_by_name(entity_type_name)( cursor ) trend_store = TableTrendStore.get( data_source, entity_type, package.granularity )(cursor) trend_store.store(package).run(conn) return execute return bind_data_source
from contextlib import closing from minerva.util import k, identity from minerva.directory import EntityType from minerva.storage import Engine from minerva.storage.trend import TableTrendStore class TrendEngine(Engine): @staticmethod def store(package, filter_package=k(identity)): """ Return a function to bind a data source to the store command. :param package: A DataPackageBase subclass instance :return: function that can bind a data source to the store command :rtype: (data_source) -> (conn) -> None """ def bind_data_source(data_source): def execute(conn): entity_type_name = package.entity_type_name() with closing(conn.cursor()) as cursor: entity_type = EntityType.get_by_name(entity_type_name)( cursor ) trend_store = TableTrendStore.get( data_source, entity_type, package.granularity )(cursor) trend_store.store( filter_package(trend_store)(package) ).run(conn) return execute return bind_data_source
Add functionality to filter a data package before storing
Add functionality to filter a data package before storing
Python
agpl-3.0
hendrikx-itc/minerva,hendrikx-itc/minerva
from contextlib import closing from minerva.directory import EntityType from minerva.storage import Engine from minerva.storage.trend import TableTrendStore class TrendEngine(Engine): @staticmethod def store(package): """ Return a function to bind a data source to the store command. :param package: A DataPackageBase subclass instance :return: function that can bind a data source to the store command :rtype: (data_source) -> (conn) -> None """ def bind_data_source(data_source): def execute(conn): entity_type_name = package.entity_type_name() with closing(conn.cursor()) as cursor: entity_type = EntityType.get_by_name(entity_type_name)( cursor ) trend_store = TableTrendStore.get( data_source, entity_type, package.granularity )(cursor) trend_store.store(package).run(conn) return execute return bind_data_sourceAdd functionality to filter a data package before storing
from contextlib import closing from minerva.util import k, identity from minerva.directory import EntityType from minerva.storage import Engine from minerva.storage.trend import TableTrendStore class TrendEngine(Engine): @staticmethod def store(package, filter_package=k(identity)): """ Return a function to bind a data source to the store command. :param package: A DataPackageBase subclass instance :return: function that can bind a data source to the store command :rtype: (data_source) -> (conn) -> None """ def bind_data_source(data_source): def execute(conn): entity_type_name = package.entity_type_name() with closing(conn.cursor()) as cursor: entity_type = EntityType.get_by_name(entity_type_name)( cursor ) trend_store = TableTrendStore.get( data_source, entity_type, package.granularity )(cursor) trend_store.store( filter_package(trend_store)(package) ).run(conn) return execute return bind_data_source
<commit_before>from contextlib import closing from minerva.directory import EntityType from minerva.storage import Engine from minerva.storage.trend import TableTrendStore class TrendEngine(Engine): @staticmethod def store(package): """ Return a function to bind a data source to the store command. :param package: A DataPackageBase subclass instance :return: function that can bind a data source to the store command :rtype: (data_source) -> (conn) -> None """ def bind_data_source(data_source): def execute(conn): entity_type_name = package.entity_type_name() with closing(conn.cursor()) as cursor: entity_type = EntityType.get_by_name(entity_type_name)( cursor ) trend_store = TableTrendStore.get( data_source, entity_type, package.granularity )(cursor) trend_store.store(package).run(conn) return execute return bind_data_source<commit_msg>Add functionality to filter a data package before storing<commit_after>
from contextlib import closing from minerva.util import k, identity from minerva.directory import EntityType from minerva.storage import Engine from minerva.storage.trend import TableTrendStore class TrendEngine(Engine): @staticmethod def store(package, filter_package=k(identity)): """ Return a function to bind a data source to the store command. :param package: A DataPackageBase subclass instance :return: function that can bind a data source to the store command :rtype: (data_source) -> (conn) -> None """ def bind_data_source(data_source): def execute(conn): entity_type_name = package.entity_type_name() with closing(conn.cursor()) as cursor: entity_type = EntityType.get_by_name(entity_type_name)( cursor ) trend_store = TableTrendStore.get( data_source, entity_type, package.granularity )(cursor) trend_store.store( filter_package(trend_store)(package) ).run(conn) return execute return bind_data_source
from contextlib import closing from minerva.directory import EntityType from minerva.storage import Engine from minerva.storage.trend import TableTrendStore class TrendEngine(Engine): @staticmethod def store(package): """ Return a function to bind a data source to the store command. :param package: A DataPackageBase subclass instance :return: function that can bind a data source to the store command :rtype: (data_source) -> (conn) -> None """ def bind_data_source(data_source): def execute(conn): entity_type_name = package.entity_type_name() with closing(conn.cursor()) as cursor: entity_type = EntityType.get_by_name(entity_type_name)( cursor ) trend_store = TableTrendStore.get( data_source, entity_type, package.granularity )(cursor) trend_store.store(package).run(conn) return execute return bind_data_sourceAdd functionality to filter a data package before storingfrom contextlib import closing from minerva.util import k, identity from minerva.directory import EntityType from minerva.storage import Engine from minerva.storage.trend import TableTrendStore class TrendEngine(Engine): @staticmethod def store(package, filter_package=k(identity)): """ Return a function to bind a data source to the store command. :param package: A DataPackageBase subclass instance :return: function that can bind a data source to the store command :rtype: (data_source) -> (conn) -> None """ def bind_data_source(data_source): def execute(conn): entity_type_name = package.entity_type_name() with closing(conn.cursor()) as cursor: entity_type = EntityType.get_by_name(entity_type_name)( cursor ) trend_store = TableTrendStore.get( data_source, entity_type, package.granularity )(cursor) trend_store.store( filter_package(trend_store)(package) ).run(conn) return execute return bind_data_source
<commit_before>from contextlib import closing from minerva.directory import EntityType from minerva.storage import Engine from minerva.storage.trend import TableTrendStore class TrendEngine(Engine): @staticmethod def store(package): """ Return a function to bind a data source to the store command. :param package: A DataPackageBase subclass instance :return: function that can bind a data source to the store command :rtype: (data_source) -> (conn) -> None """ def bind_data_source(data_source): def execute(conn): entity_type_name = package.entity_type_name() with closing(conn.cursor()) as cursor: entity_type = EntityType.get_by_name(entity_type_name)( cursor ) trend_store = TableTrendStore.get( data_source, entity_type, package.granularity )(cursor) trend_store.store(package).run(conn) return execute return bind_data_source<commit_msg>Add functionality to filter a data package before storing<commit_after>from contextlib import closing from minerva.util import k, identity from minerva.directory import EntityType from minerva.storage import Engine from minerva.storage.trend import TableTrendStore class TrendEngine(Engine): @staticmethod def store(package, filter_package=k(identity)): """ Return a function to bind a data source to the store command. :param package: A DataPackageBase subclass instance :return: function that can bind a data source to the store command :rtype: (data_source) -> (conn) -> None """ def bind_data_source(data_source): def execute(conn): entity_type_name = package.entity_type_name() with closing(conn.cursor()) as cursor: entity_type = EntityType.get_by_name(entity_type_name)( cursor ) trend_store = TableTrendStore.get( data_source, entity_type, package.granularity )(cursor) trend_store.store( filter_package(trend_store)(package) ).run(conn) return execute return bind_data_source
842007194a9a5736d8e33d6152cd1bfe934e24bc
smashcache/cache/filler.py
smashcache/cache/filler.py
# Copyright (c) 2015 Sachi King # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. import requests def getHeaders(url): r = requests.head(url) if r.status_code != 200: print("Server returned" + r.status_code) return None return r.headers def fetchRangeToFile(url, byte_range, destination_path): print("Fetching: %s range: %s to: %s" % (url, byte_range, destination_path)) headers = {'Range': ("bytes=%s-%s" % (byte_range[0], byte_range[1]))} r = requests.get(url, headers=headers, stream=True) with open(destination_path, 'wb') as f: for chunk in r.iter_content(chunk_size=1024): if chunk: f.write(chunk) f.flush()
# Copyright (c) 2015 Sachi King # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. import requests def getHeaders(url): r = requests.head(url) if r.status_code != 200: print("Server returned %s" % r.status_code) return None return r.headers def fetchRangeToFile(url, byte_range, destination_path): print("Fetching: %s range: %s to: %s" % (url, byte_range, destination_path)) headers = {'Range': ("bytes=%s-%s" % (byte_range[0], byte_range[1]))} r = requests.get(url, headers=headers, stream=True) with open(destination_path, 'wb') as f: for chunk in r.iter_content(chunk_size=1024): if chunk: f.write(chunk) f.flush()
Fix print with subsition instead of concat
Fix print with subsition instead of concat
Python
apache-2.0
nakato/smashcache
# Copyright (c) 2015 Sachi King # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. import requests def getHeaders(url): r = requests.head(url) if r.status_code != 200: print("Server returned" + r.status_code) return None return r.headers def fetchRangeToFile(url, byte_range, destination_path): print("Fetching: %s range: %s to: %s" % (url, byte_range, destination_path)) headers = {'Range': ("bytes=%s-%s" % (byte_range[0], byte_range[1]))} r = requests.get(url, headers=headers, stream=True) with open(destination_path, 'wb') as f: for chunk in r.iter_content(chunk_size=1024): if chunk: f.write(chunk) f.flush() Fix print with subsition instead of concat
# Copyright (c) 2015 Sachi King # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. import requests def getHeaders(url): r = requests.head(url) if r.status_code != 200: print("Server returned %s" % r.status_code) return None return r.headers def fetchRangeToFile(url, byte_range, destination_path): print("Fetching: %s range: %s to: %s" % (url, byte_range, destination_path)) headers = {'Range': ("bytes=%s-%s" % (byte_range[0], byte_range[1]))} r = requests.get(url, headers=headers, stream=True) with open(destination_path, 'wb') as f: for chunk in r.iter_content(chunk_size=1024): if chunk: f.write(chunk) f.flush()
<commit_before># Copyright (c) 2015 Sachi King # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. import requests def getHeaders(url): r = requests.head(url) if r.status_code != 200: print("Server returned" + r.status_code) return None return r.headers def fetchRangeToFile(url, byte_range, destination_path): print("Fetching: %s range: %s to: %s" % (url, byte_range, destination_path)) headers = {'Range': ("bytes=%s-%s" % (byte_range[0], byte_range[1]))} r = requests.get(url, headers=headers, stream=True) with open(destination_path, 'wb') as f: for chunk in r.iter_content(chunk_size=1024): if chunk: f.write(chunk) f.flush() <commit_msg>Fix print with subsition instead of concat<commit_after>
# Copyright (c) 2015 Sachi King # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. import requests def getHeaders(url): r = requests.head(url) if r.status_code != 200: print("Server returned %s" % r.status_code) return None return r.headers def fetchRangeToFile(url, byte_range, destination_path): print("Fetching: %s range: %s to: %s" % (url, byte_range, destination_path)) headers = {'Range': ("bytes=%s-%s" % (byte_range[0], byte_range[1]))} r = requests.get(url, headers=headers, stream=True) with open(destination_path, 'wb') as f: for chunk in r.iter_content(chunk_size=1024): if chunk: f.write(chunk) f.flush()
# Copyright (c) 2015 Sachi King # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. import requests def getHeaders(url): r = requests.head(url) if r.status_code != 200: print("Server returned" + r.status_code) return None return r.headers def fetchRangeToFile(url, byte_range, destination_path): print("Fetching: %s range: %s to: %s" % (url, byte_range, destination_path)) headers = {'Range': ("bytes=%s-%s" % (byte_range[0], byte_range[1]))} r = requests.get(url, headers=headers, stream=True) with open(destination_path, 'wb') as f: for chunk in r.iter_content(chunk_size=1024): if chunk: f.write(chunk) f.flush() Fix print with subsition instead of concat# Copyright (c) 2015 Sachi King # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. import requests def getHeaders(url): r = requests.head(url) if r.status_code != 200: print("Server returned %s" % r.status_code) return None return r.headers def fetchRangeToFile(url, byte_range, destination_path): print("Fetching: %s range: %s to: %s" % (url, byte_range, destination_path)) headers = {'Range': ("bytes=%s-%s" % (byte_range[0], byte_range[1]))} r = requests.get(url, headers=headers, stream=True) with open(destination_path, 'wb') as f: for chunk in r.iter_content(chunk_size=1024): if chunk: f.write(chunk) f.flush()
<commit_before># Copyright (c) 2015 Sachi King # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. import requests def getHeaders(url): r = requests.head(url) if r.status_code != 200: print("Server returned" + r.status_code) return None return r.headers def fetchRangeToFile(url, byte_range, destination_path): print("Fetching: %s range: %s to: %s" % (url, byte_range, destination_path)) headers = {'Range': ("bytes=%s-%s" % (byte_range[0], byte_range[1]))} r = requests.get(url, headers=headers, stream=True) with open(destination_path, 'wb') as f: for chunk in r.iter_content(chunk_size=1024): if chunk: f.write(chunk) f.flush() <commit_msg>Fix print with subsition instead of concat<commit_after># Copyright (c) 2015 Sachi King # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. import requests def getHeaders(url): r = requests.head(url) if r.status_code != 200: print("Server returned %s" % r.status_code) return None return r.headers def fetchRangeToFile(url, byte_range, destination_path): print("Fetching: %s range: %s to: %s" % (url, byte_range, destination_path)) headers = {'Range': ("bytes=%s-%s" % (byte_range[0], byte_range[1]))} r = requests.get(url, headers=headers, stream=True) with open(destination_path, 'wb') as f: for chunk in r.iter_content(chunk_size=1024): if chunk: f.write(chunk) f.flush()
e955cebb8872f5d073739c43936aebd100636c49
grako/rendering.py
grako/rendering.py
# -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import, unicode_literals import itertools from .util import trim def render(item, **fields): """ Render the given item """ if item is None: return '' elif isinstance(item, Renderer): return item.render(**fields) elif isinstance(item, list): return ''.join(render(e) for e in item) else: return str(item) class Renderer(object): template = '' _counter = itertools.count() def __init__(self, template=None): if template is not None: self.template = template def counter(self): return next(self._counter) def render_fields(self, fields): pass def render(self, **fields): fields.update({k:v for k, v in vars(self).items() if not k.startswith('_')}) self.render_fields(fields) fields = {k:render(v) for k, v in fields.items()} try: return trim(self.template).format(**fields) except KeyError as e: raise KeyError(str(e), type(self))
# -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import, unicode_literals import itertools from .util import trim def render(item, **fields): """ Render the given item """ if item is None: return '' elif isinstance(item, Renderer): return item.render(**fields) elif isinstance(item, list): return ''.join(render(e) for e in item) else: return str(item) class Renderer(object): template = '' _counter = itertools.count() def __init__(self, template=None): if template is not None: self.template = template def counter(self): return next(self._counter) def render_fields(self, fields): pass def render(self, template=None, **fields): if template is None: template = self.template fields.update({k:v for k, v in vars(self).items() if not k.startswith('_')}) self.render_fields(fields) fields = {k:render(v) for k, v in fields.items()} try: return trim(template).format(**fields) except KeyError as e: raise KeyError(str(e), type(self))
Allow render to take a template different from the default one.
Allow render to take a template different from the default one.
Python
bsd-2-clause
vmuriart/grako,frnknglrt/grako
# -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import, unicode_literals import itertools from .util import trim def render(item, **fields): """ Render the given item """ if item is None: return '' elif isinstance(item, Renderer): return item.render(**fields) elif isinstance(item, list): return ''.join(render(e) for e in item) else: return str(item) class Renderer(object): template = '' _counter = itertools.count() def __init__(self, template=None): if template is not None: self.template = template def counter(self): return next(self._counter) def render_fields(self, fields): pass def render(self, **fields): fields.update({k:v for k, v in vars(self).items() if not k.startswith('_')}) self.render_fields(fields) fields = {k:render(v) for k, v in fields.items()} try: return trim(self.template).format(**fields) except KeyError as e: raise KeyError(str(e), type(self)) Allow render to take a template different from the default one.
# -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import, unicode_literals import itertools from .util import trim def render(item, **fields): """ Render the given item """ if item is None: return '' elif isinstance(item, Renderer): return item.render(**fields) elif isinstance(item, list): return ''.join(render(e) for e in item) else: return str(item) class Renderer(object): template = '' _counter = itertools.count() def __init__(self, template=None): if template is not None: self.template = template def counter(self): return next(self._counter) def render_fields(self, fields): pass def render(self, template=None, **fields): if template is None: template = self.template fields.update({k:v for k, v in vars(self).items() if not k.startswith('_')}) self.render_fields(fields) fields = {k:render(v) for k, v in fields.items()} try: return trim(template).format(**fields) except KeyError as e: raise KeyError(str(e), type(self))
<commit_before># -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import, unicode_literals import itertools from .util import trim def render(item, **fields): """ Render the given item """ if item is None: return '' elif isinstance(item, Renderer): return item.render(**fields) elif isinstance(item, list): return ''.join(render(e) for e in item) else: return str(item) class Renderer(object): template = '' _counter = itertools.count() def __init__(self, template=None): if template is not None: self.template = template def counter(self): return next(self._counter) def render_fields(self, fields): pass def render(self, **fields): fields.update({k:v for k, v in vars(self).items() if not k.startswith('_')}) self.render_fields(fields) fields = {k:render(v) for k, v in fields.items()} try: return trim(self.template).format(**fields) except KeyError as e: raise KeyError(str(e), type(self)) <commit_msg>Allow render to take a template different from the default one.<commit_after>
# -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import, unicode_literals import itertools from .util import trim def render(item, **fields): """ Render the given item """ if item is None: return '' elif isinstance(item, Renderer): return item.render(**fields) elif isinstance(item, list): return ''.join(render(e) for e in item) else: return str(item) class Renderer(object): template = '' _counter = itertools.count() def __init__(self, template=None): if template is not None: self.template = template def counter(self): return next(self._counter) def render_fields(self, fields): pass def render(self, template=None, **fields): if template is None: template = self.template fields.update({k:v for k, v in vars(self).items() if not k.startswith('_')}) self.render_fields(fields) fields = {k:render(v) for k, v in fields.items()} try: return trim(template).format(**fields) except KeyError as e: raise KeyError(str(e), type(self))
# -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import, unicode_literals import itertools from .util import trim def render(item, **fields): """ Render the given item """ if item is None: return '' elif isinstance(item, Renderer): return item.render(**fields) elif isinstance(item, list): return ''.join(render(e) for e in item) else: return str(item) class Renderer(object): template = '' _counter = itertools.count() def __init__(self, template=None): if template is not None: self.template = template def counter(self): return next(self._counter) def render_fields(self, fields): pass def render(self, **fields): fields.update({k:v for k, v in vars(self).items() if not k.startswith('_')}) self.render_fields(fields) fields = {k:render(v) for k, v in fields.items()} try: return trim(self.template).format(**fields) except KeyError as e: raise KeyError(str(e), type(self)) Allow render to take a template different from the default one.# -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import, unicode_literals import itertools from .util import trim def render(item, **fields): """ Render the given item """ if item is None: return '' elif isinstance(item, Renderer): return item.render(**fields) elif isinstance(item, list): return ''.join(render(e) for e in item) else: return str(item) class Renderer(object): template = '' _counter = itertools.count() def __init__(self, template=None): if template is not None: self.template = template def counter(self): return next(self._counter) def render_fields(self, fields): pass def render(self, template=None, **fields): if template is None: template = self.template fields.update({k:v for k, v in vars(self).items() if not k.startswith('_')}) self.render_fields(fields) fields = {k:render(v) for k, v in fields.items()} try: return trim(template).format(**fields) except KeyError as e: raise KeyError(str(e), type(self))
<commit_before># -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import, unicode_literals import itertools from .util import trim def render(item, **fields): """ Render the given item """ if item is None: return '' elif isinstance(item, Renderer): return item.render(**fields) elif isinstance(item, list): return ''.join(render(e) for e in item) else: return str(item) class Renderer(object): template = '' _counter = itertools.count() def __init__(self, template=None): if template is not None: self.template = template def counter(self): return next(self._counter) def render_fields(self, fields): pass def render(self, **fields): fields.update({k:v for k, v in vars(self).items() if not k.startswith('_')}) self.render_fields(fields) fields = {k:render(v) for k, v in fields.items()} try: return trim(self.template).format(**fields) except KeyError as e: raise KeyError(str(e), type(self)) <commit_msg>Allow render to take a template different from the default one.<commit_after># -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import, unicode_literals import itertools from .util import trim def render(item, **fields): """ Render the given item """ if item is None: return '' elif isinstance(item, Renderer): return item.render(**fields) elif isinstance(item, list): return ''.join(render(e) for e in item) else: return str(item) class Renderer(object): template = '' _counter = itertools.count() def __init__(self, template=None): if template is not None: self.template = template def counter(self): return next(self._counter) def render_fields(self, fields): pass def render(self, template=None, **fields): if template is None: template = self.template fields.update({k:v for k, v in vars(self).items() if not k.startswith('_')}) self.render_fields(fields) fields = {k:render(v) for k, v in fields.items()} try: return trim(template).format(**fields) except KeyError as e: raise KeyError(str(e), type(self))
f9409c5e14dc38047365b30da7d1ee2f2084fc72
numpy/fft/info.py
numpy/fft/info.py
"""\ Core FFT routines ================== Standard FFTs fft ifft fft2 ifft2 fftn ifftn Real FFTs refft irefft refft2 irefft2 refftn irefftn Hermite FFTs hfft ihfft """ depends = ['core']
"""\ Core FFT routines ================== Standard FFTs fft ifft fft2 ifft2 fftn ifftn Real FFTs rfft irfft rfft2 irfft2 rfftn irfftn Hermite FFTs hfft ihfft """ depends = ['core']
Fix documentation of fft sub-package to eliminate references to refft.
Fix documentation of fft sub-package to eliminate references to refft.
Python
bsd-3-clause
MaPePeR/numpy,kirillzhuravlev/numpy,jakirkham/numpy,gmcastil/numpy,nguyentu1602/numpy,Linkid/numpy,jakirkham/numpy,pyparallel/numpy,jankoslavic/numpy,yiakwy/numpy,nguyentu1602/numpy,kiwifb/numpy,naritta/numpy,grlee77/numpy,numpy/numpy-refactor,bertrand-l/numpy,mhvk/numpy,ahaldane/numpy,astrofrog/numpy,ewmoore/numpy,skwbc/numpy,jorisvandenbossche/numpy,mathdd/numpy,NextThought/pypy-numpy,dwillmer/numpy,ChristopherHogan/numpy,mindw/numpy,ViralLeadership/numpy,b-carter/numpy,anntzer/numpy,mattip/numpy,astrofrog/numpy,jschueller/numpy,trankmichael/numpy,chiffa/numpy,jschueller/numpy,Dapid/numpy,ssanderson/numpy,rudimeier/numpy,simongibbons/numpy,ogrisel/numpy,Yusa95/numpy,Eric89GXL/numpy,andsor/numpy,dato-code/numpy,jakirkham/numpy,ogrisel/numpy,rherault-insa/numpy,stuarteberg/numpy,b-carter/numpy,ahaldane/numpy,maniteja123/numpy,mortada/numpy,tdsmith/numpy,kiwifb/numpy,numpy/numpy,pdebuyl/numpy,numpy/numpy,dwf/numpy,embray/numpy,cjermain/numpy,rajathkumarmp/numpy,MSeifert04/numpy,kirillzhuravlev/numpy,jonathanunderwood/numpy,hainm/numpy,anntzer/numpy,MaPePeR/numpy,ogrisel/numpy,naritta/numpy,madphysicist/numpy,BabeNovelty/numpy,CMartelLML/numpy,rgommers/numpy,mattip/numpy,leifdenby/numpy,pizzathief/numpy,NextThought/pypy-numpy,seberg/numpy,pizzathief/numpy,embray/numpy,ContinuumIO/numpy,solarjoe/numpy,b-carter/numpy,rherault-insa/numpy,yiakwy/numpy,numpy/numpy-refactor,dwillmer/numpy,sigma-random/numpy,Linkid/numpy,leifdenby/numpy,sinhrks/numpy,bmorris3/numpy,has2k1/numpy,ContinuumIO/numpy,Yusa95/numpy,mattip/numpy,sonnyhu/numpy,simongibbons/numpy,rajathkumarmp/numpy,skymanaditya1/numpy,stuarteberg/numpy,felipebetancur/numpy,hainm/numpy,sigma-random/numpy,MichaelAquilina/numpy,mingwpy/numpy,GaZ3ll3/numpy,Srisai85/numpy,ChanderG/numpy,rajathkumarmp/numpy,AustereCuriosity/numpy,stefanv/numpy,dimasad/numpy,SiccarPoint/numpy,dato-code/numpy,behzadnouri/numpy,Srisai85/numpy,mhvk/numpy,bringingheavendown/numpy,Eric89GXL/numpy,ddasilva/numpy,mathdd/numpy,andsor/numpy,cowlicks/numpy,brandon-rhodes/numpy,astrofrog/numpy,musically-ut/numpy,pyparallel/numpy,Yusa95/numpy,NextThought/pypy-numpy,brandon-rhodes/numpy,brandon-rhodes/numpy,shoyer/numpy,dimasad/numpy,drasmuss/numpy,leifdenby/numpy,madphysicist/numpy,ESSS/numpy,jonathanunderwood/numpy,tynn/numpy,pelson/numpy,Dapid/numpy,rudimeier/numpy,pizzathief/numpy,mwiebe/numpy,cjermain/numpy,MaPePeR/numpy,dch312/numpy,argriffing/numpy,numpy/numpy-refactor,endolith/numpy,mattip/numpy,endolith/numpy,chatcannon/numpy,rmcgibbo/numpy,cowlicks/numpy,Eric89GXL/numpy,ContinuumIO/numpy,nguyentu1602/numpy,stuarteberg/numpy,madphysicist/numpy,BMJHayward/numpy,utke1/numpy,NextThought/pypy-numpy,jorisvandenbossche/numpy,rhythmsosad/numpy,skwbc/numpy,WarrenWeckesser/numpy,empeeu/numpy,ViralLeadership/numpy,ahaldane/numpy,behzadnouri/numpy,larsmans/numpy,tdsmith/numpy,bertrand-l/numpy,skymanaditya1/numpy,Srisai85/numpy,joferkington/numpy,andsor/numpy,dwf/numpy,pizzathief/numpy,rhythmsosad/numpy,dwf/numpy,jorisvandenbossche/numpy,MSeifert04/numpy,tacaswell/numpy,abalkin/numpy,empeeu/numpy,stuarteberg/numpy,hainm/numpy,pizzathief/numpy,grlee77/numpy,ewmoore/numpy,ajdawson/numpy,mwiebe/numpy,skwbc/numpy,tynn/numpy,mindw/numpy,MichaelAquilina/numpy,madphysicist/numpy,charris/numpy,rmcgibbo/numpy,tacaswell/numpy,ChanderG/numpy,SiccarPoint/numpy,tacaswell/numpy,SiccarPoint/numpy,nbeaver/numpy,musically-ut/numpy,immerrr/numpy,ogrisel/numpy,drasmuss/numpy,SiccarPoint/numpy,gfyoung/numpy,pelson/numpy,SunghanKim/numpy,githubmlai/numpy,stefanv/numpy,seberg/numpy,ChanderG/numpy,njase/numpy,shoyer/numpy,GrimDerp/numpy,shoyer/numpy,utke1/numpy,musically-ut/numpy,ekalosak/numpy,pbrod/numpy,groutr/numpy,KaelChen/numpy,yiakwy/numpy,jankoslavic/numpy,MSeifert04/numpy,immerrr/numpy,GrimDerp/numpy,naritta/numpy,chatcannon/numpy,stefanv/numpy,argriffing/numpy,ESSS/numpy,groutr/numpy,dato-code/numpy,cjermain/numpy,githubmlai/numpy,Linkid/numpy,seberg/numpy,ewmoore/numpy,rgommers/numpy,has2k1/numpy,jankoslavic/numpy,madphysicist/numpy,pdebuyl/numpy,matthew-brett/numpy,trankmichael/numpy,sinhrks/numpy,charris/numpy,dwillmer/numpy,ssanderson/numpy,immerrr/numpy,WarrenWeckesser/numpy,mhvk/numpy,pelson/numpy,jonathanunderwood/numpy,utke1/numpy,mortada/numpy,WarrenWeckesser/numpy,GrimDerp/numpy,ajdawson/numpy,njase/numpy,githubmlai/numpy,chiffa/numpy,tdsmith/numpy,jakirkham/numpy,WillieMaddox/numpy,bmorris3/numpy,mathdd/numpy,ekalosak/numpy,sigma-random/numpy,naritta/numpy,MSeifert04/numpy,has2k1/numpy,ssanderson/numpy,bmorris3/numpy,jschueller/numpy,embray/numpy,hainm/numpy,Anwesh43/numpy,ekalosak/numpy,solarjoe/numpy,moreati/numpy,gmcastil/numpy,simongibbons/numpy,GaZ3ll3/numpy,ajdawson/numpy,BabeNovelty/numpy,rajathkumarmp/numpy,numpy/numpy,dch312/numpy,BMJHayward/numpy,nbeaver/numpy,behzadnouri/numpy,dch312/numpy,anntzer/numpy,mindw/numpy,ChristopherHogan/numpy,endolith/numpy,MaPePeR/numpy,sonnyhu/numpy,astrofrog/numpy,tdsmith/numpy,musically-ut/numpy,jorisvandenbossche/numpy,trankmichael/numpy,stefanv/numpy,pyparallel/numpy,maniteja123/numpy,ahaldane/numpy,WillieMaddox/numpy,larsmans/numpy,numpy/numpy,sigma-random/numpy,jorisvandenbossche/numpy,bertrand-l/numpy,andsor/numpy,empeeu/numpy,Linkid/numpy,ewmoore/numpy,githubmlai/numpy,astrofrog/numpy,KaelChen/numpy,immerrr/numpy,pelson/numpy,stefanv/numpy,dimasad/numpy,WillieMaddox/numpy,matthew-brett/numpy,trankmichael/numpy,groutr/numpy,mingwpy/numpy,pbrod/numpy,AustereCuriosity/numpy,GrimDerp/numpy,dch312/numpy,dwillmer/numpy,BabeNovelty/numpy,ahaldane/numpy,ddasilva/numpy,rudimeier/numpy,CMartelLML/numpy,Srisai85/numpy,Anwesh43/numpy,kirillzhuravlev/numpy,embray/numpy,BMJHayward/numpy,Eric89GXL/numpy,cowlicks/numpy,ChristopherHogan/numpy,brandon-rhodes/numpy,pdebuyl/numpy,BMJHayward/numpy,ewmoore/numpy,sinhrks/numpy,skymanaditya1/numpy,endolith/numpy,simongibbons/numpy,mhvk/numpy,jschueller/numpy,cowlicks/numpy,rhythmsosad/numpy,bmorris3/numpy,chiffa/numpy,dato-code/numpy,chatcannon/numpy,charris/numpy,cjermain/numpy,dwf/numpy,gfyoung/numpy,pbrod/numpy,CMartelLML/numpy,yiakwy/numpy,Dapid/numpy,abalkin/numpy,larsmans/numpy,GaZ3ll3/numpy,charris/numpy,jankoslavic/numpy,njase/numpy,pbrod/numpy,nguyentu1602/numpy,ESSS/numpy,kirillzhuravlev/numpy,rgommers/numpy,moreati/numpy,CMartelLML/numpy,BabeNovelty/numpy,ddasilva/numpy,mindw/numpy,tynn/numpy,drasmuss/numpy,rhythmsosad/numpy,embray/numpy,numpy/numpy-refactor,abalkin/numpy,felipebetancur/numpy,shoyer/numpy,simongibbons/numpy,skymanaditya1/numpy,kiwifb/numpy,dwf/numpy,solarjoe/numpy,KaelChen/numpy,WarrenWeckesser/numpy,Anwesh43/numpy,matthew-brett/numpy,joferkington/numpy,shoyer/numpy,ajdawson/numpy,grlee77/numpy,SunghanKim/numpy,felipebetancur/numpy,KaelChen/numpy,rudimeier/numpy,seberg/numpy,mortada/numpy,Yusa95/numpy,SunghanKim/numpy,anntzer/numpy,dimasad/numpy,sinhrks/numpy,grlee77/numpy,WarrenWeckesser/numpy,ViralLeadership/numpy,rmcgibbo/numpy,gmcastil/numpy,empeeu/numpy,AustereCuriosity/numpy,maniteja123/numpy,rgommers/numpy,mortada/numpy,rherault-insa/numpy,pbrod/numpy,bringingheavendown/numpy,joferkington/numpy,MichaelAquilina/numpy,GaZ3ll3/numpy,ChristopherHogan/numpy,has2k1/numpy,MichaelAquilina/numpy,pelson/numpy,larsmans/numpy,felipebetancur/numpy,sonnyhu/numpy,ekalosak/numpy,MSeifert04/numpy,ChanderG/numpy,pdebuyl/numpy,mathdd/numpy,matthew-brett/numpy,ogrisel/numpy,mhvk/numpy,jakirkham/numpy,matthew-brett/numpy,numpy/numpy-refactor,mwiebe/numpy,moreati/numpy,argriffing/numpy,joferkington/numpy,SunghanKim/numpy,nbeaver/numpy,gfyoung/numpy,Anwesh43/numpy,sonnyhu/numpy,rmcgibbo/numpy,grlee77/numpy,mingwpy/numpy,mingwpy/numpy,bringingheavendown/numpy
"""\ Core FFT routines ================== Standard FFTs fft ifft fft2 ifft2 fftn ifftn Real FFTs refft irefft refft2 irefft2 refftn irefftn Hermite FFTs hfft ihfft """ depends = ['core'] Fix documentation of fft sub-package to eliminate references to refft.
"""\ Core FFT routines ================== Standard FFTs fft ifft fft2 ifft2 fftn ifftn Real FFTs rfft irfft rfft2 irfft2 rfftn irfftn Hermite FFTs hfft ihfft """ depends = ['core']
<commit_before>"""\ Core FFT routines ================== Standard FFTs fft ifft fft2 ifft2 fftn ifftn Real FFTs refft irefft refft2 irefft2 refftn irefftn Hermite FFTs hfft ihfft """ depends = ['core'] <commit_msg>Fix documentation of fft sub-package to eliminate references to refft.<commit_after>
"""\ Core FFT routines ================== Standard FFTs fft ifft fft2 ifft2 fftn ifftn Real FFTs rfft irfft rfft2 irfft2 rfftn irfftn Hermite FFTs hfft ihfft """ depends = ['core']
"""\ Core FFT routines ================== Standard FFTs fft ifft fft2 ifft2 fftn ifftn Real FFTs refft irefft refft2 irefft2 refftn irefftn Hermite FFTs hfft ihfft """ depends = ['core'] Fix documentation of fft sub-package to eliminate references to refft."""\ Core FFT routines ================== Standard FFTs fft ifft fft2 ifft2 fftn ifftn Real FFTs rfft irfft rfft2 irfft2 rfftn irfftn Hermite FFTs hfft ihfft """ depends = ['core']
<commit_before>"""\ Core FFT routines ================== Standard FFTs fft ifft fft2 ifft2 fftn ifftn Real FFTs refft irefft refft2 irefft2 refftn irefftn Hermite FFTs hfft ihfft """ depends = ['core'] <commit_msg>Fix documentation of fft sub-package to eliminate references to refft.<commit_after>"""\ Core FFT routines ================== Standard FFTs fft ifft fft2 ifft2 fftn ifftn Real FFTs rfft irfft rfft2 irfft2 rfftn irfftn Hermite FFTs hfft ihfft """ depends = ['core']
013a3f11453787e18f7acd08c7e54fede59b1b01
letsencrypt/__init__.py
letsencrypt/__init__.py
"""Let's Encrypt client.""" # version number like 1.2.3a0, must have at least 2 parts, like 1.2 __version__ = '0.1.0.dev0'
"""Let's Encrypt client.""" # version number like 1.2.3a0, must have at least 2 parts, like 1.2 # '0.1.0.dev0' __version__ = '0.1.0'
Switch to "next production release" as the version in the tree
Switch to "next production release" as the version in the tree
Python
apache-2.0
mitnk/letsencrypt,brentdax/letsencrypt,brentdax/letsencrypt,goofwear/letsencrypt,jtl999/certbot,dietsche/letsencrypt,lmcro/letsencrypt,TheBoegl/letsencrypt,xgin/letsencrypt,letsencrypt/letsencrypt,wteiken/letsencrypt,wteiken/letsencrypt,thanatos/lets-encrypt-preview,VladimirTyrin/letsencrypt,jtl999/certbot,twstrike/le_for_patching,thanatos/lets-encrypt-preview,stweil/letsencrypt,twstrike/le_for_patching,DavidGarciaCat/letsencrypt,mitnk/letsencrypt,VladimirTyrin/letsencrypt,jsha/letsencrypt,goofwear/letsencrypt,kuba/letsencrypt,lmcro/letsencrypt,jsha/letsencrypt,bsmr-misc-forks/letsencrypt,bsmr-misc-forks/letsencrypt,DavidGarciaCat/letsencrypt,dietsche/letsencrypt,stweil/letsencrypt,letsencrypt/letsencrypt,kuba/letsencrypt,xgin/letsencrypt,TheBoegl/letsencrypt
"""Let's Encrypt client.""" # version number like 1.2.3a0, must have at least 2 parts, like 1.2 __version__ = '0.1.0.dev0' Switch to "next production release" as the version in the tree
"""Let's Encrypt client.""" # version number like 1.2.3a0, must have at least 2 parts, like 1.2 # '0.1.0.dev0' __version__ = '0.1.0'
<commit_before>"""Let's Encrypt client.""" # version number like 1.2.3a0, must have at least 2 parts, like 1.2 __version__ = '0.1.0.dev0' <commit_msg>Switch to "next production release" as the version in the tree<commit_after>
"""Let's Encrypt client.""" # version number like 1.2.3a0, must have at least 2 parts, like 1.2 # '0.1.0.dev0' __version__ = '0.1.0'
"""Let's Encrypt client.""" # version number like 1.2.3a0, must have at least 2 parts, like 1.2 __version__ = '0.1.0.dev0' Switch to "next production release" as the version in the tree"""Let's Encrypt client.""" # version number like 1.2.3a0, must have at least 2 parts, like 1.2 # '0.1.0.dev0' __version__ = '0.1.0'
<commit_before>"""Let's Encrypt client.""" # version number like 1.2.3a0, must have at least 2 parts, like 1.2 __version__ = '0.1.0.dev0' <commit_msg>Switch to "next production release" as the version in the tree<commit_after>"""Let's Encrypt client.""" # version number like 1.2.3a0, must have at least 2 parts, like 1.2 # '0.1.0.dev0' __version__ = '0.1.0'
a564f572bdccbd2370b2eb1026c47e367556fff9
test/integration_test.py
test/integration_test.py
import sys from subprocess import Popen, PIPE from time import sleep import requests def get_with_retries(url): n = 0 while True: try: return requests.get(url) except requests.ConnectionError: if n < 5: n += 1 sleep(0.1) else: raise def test_standalone_serves_html(): process = Popen([sys.executable, '-c', 'from jasmine.entry_points import standalone; standalone()', '--config', 'test/fixture_files/jasmine.yml']) try: req = get_with_retries('http://localhost:8888/') assert req.status_code == 200 assert 'main.js' in req.text assert 'main.css' in req.text assert '__spec__/someSpec.js' in req.text finally: process.terminate() def test_ci(): process = Popen([sys.executable, '-c', 'from jasmine.entry_points import continuous_integration; continuous_integration()', '--config', 'test/fixture_files/jasmine.yml'], stdout=PIPE) output = process.communicate()[0] process.wait() assert process.returncode == 0 assert '1 specs, 0 failed' in str(output)
import sys from subprocess import Popen, PIPE from time import sleep import requests def get_with_retries(url): n = 0 while True: try: return requests.get(url) except requests.ConnectionError: if n < 20: n += 1 sleep(0.1) else: raise def test_standalone_serves_html(): process = Popen([sys.executable, '-c', 'from jasmine.entry_points import standalone; standalone()', '--config', 'test/fixture_files/jasmine.yml']) try: req = get_with_retries('http://localhost:8888/') assert req.status_code == 200 assert 'main.js' in req.text assert 'main.css' in req.text assert '__spec__/someSpec.js' in req.text finally: process.terminate() def test_ci(): process = Popen([sys.executable, '-c', 'from jasmine.entry_points import continuous_integration; continuous_integration()', '--config', 'test/fixture_files/jasmine.yml'], stdout=PIPE) output = process.communicate()[0] process.wait() assert process.returncode == 0 assert '1 specs, 0 failed' in str(output)
Allow more time for jasmine to start up in tests
Allow more time for jasmine to start up in tests
Python
mit
jasmine/jasmine-py,jasmine/jasmine-py,jasmine/jasmine-py
import sys from subprocess import Popen, PIPE from time import sleep import requests def get_with_retries(url): n = 0 while True: try: return requests.get(url) except requests.ConnectionError: if n < 5: n += 1 sleep(0.1) else: raise def test_standalone_serves_html(): process = Popen([sys.executable, '-c', 'from jasmine.entry_points import standalone; standalone()', '--config', 'test/fixture_files/jasmine.yml']) try: req = get_with_retries('http://localhost:8888/') assert req.status_code == 200 assert 'main.js' in req.text assert 'main.css' in req.text assert '__spec__/someSpec.js' in req.text finally: process.terminate() def test_ci(): process = Popen([sys.executable, '-c', 'from jasmine.entry_points import continuous_integration; continuous_integration()', '--config', 'test/fixture_files/jasmine.yml'], stdout=PIPE) output = process.communicate()[0] process.wait() assert process.returncode == 0 assert '1 specs, 0 failed' in str(output) Allow more time for jasmine to start up in tests
import sys from subprocess import Popen, PIPE from time import sleep import requests def get_with_retries(url): n = 0 while True: try: return requests.get(url) except requests.ConnectionError: if n < 20: n += 1 sleep(0.1) else: raise def test_standalone_serves_html(): process = Popen([sys.executable, '-c', 'from jasmine.entry_points import standalone; standalone()', '--config', 'test/fixture_files/jasmine.yml']) try: req = get_with_retries('http://localhost:8888/') assert req.status_code == 200 assert 'main.js' in req.text assert 'main.css' in req.text assert '__spec__/someSpec.js' in req.text finally: process.terminate() def test_ci(): process = Popen([sys.executable, '-c', 'from jasmine.entry_points import continuous_integration; continuous_integration()', '--config', 'test/fixture_files/jasmine.yml'], stdout=PIPE) output = process.communicate()[0] process.wait() assert process.returncode == 0 assert '1 specs, 0 failed' in str(output)
<commit_before>import sys from subprocess import Popen, PIPE from time import sleep import requests def get_with_retries(url): n = 0 while True: try: return requests.get(url) except requests.ConnectionError: if n < 5: n += 1 sleep(0.1) else: raise def test_standalone_serves_html(): process = Popen([sys.executable, '-c', 'from jasmine.entry_points import standalone; standalone()', '--config', 'test/fixture_files/jasmine.yml']) try: req = get_with_retries('http://localhost:8888/') assert req.status_code == 200 assert 'main.js' in req.text assert 'main.css' in req.text assert '__spec__/someSpec.js' in req.text finally: process.terminate() def test_ci(): process = Popen([sys.executable, '-c', 'from jasmine.entry_points import continuous_integration; continuous_integration()', '--config', 'test/fixture_files/jasmine.yml'], stdout=PIPE) output = process.communicate()[0] process.wait() assert process.returncode == 0 assert '1 specs, 0 failed' in str(output) <commit_msg>Allow more time for jasmine to start up in tests<commit_after>
import sys from subprocess import Popen, PIPE from time import sleep import requests def get_with_retries(url): n = 0 while True: try: return requests.get(url) except requests.ConnectionError: if n < 20: n += 1 sleep(0.1) else: raise def test_standalone_serves_html(): process = Popen([sys.executable, '-c', 'from jasmine.entry_points import standalone; standalone()', '--config', 'test/fixture_files/jasmine.yml']) try: req = get_with_retries('http://localhost:8888/') assert req.status_code == 200 assert 'main.js' in req.text assert 'main.css' in req.text assert '__spec__/someSpec.js' in req.text finally: process.terminate() def test_ci(): process = Popen([sys.executable, '-c', 'from jasmine.entry_points import continuous_integration; continuous_integration()', '--config', 'test/fixture_files/jasmine.yml'], stdout=PIPE) output = process.communicate()[0] process.wait() assert process.returncode == 0 assert '1 specs, 0 failed' in str(output)
import sys from subprocess import Popen, PIPE from time import sleep import requests def get_with_retries(url): n = 0 while True: try: return requests.get(url) except requests.ConnectionError: if n < 5: n += 1 sleep(0.1) else: raise def test_standalone_serves_html(): process = Popen([sys.executable, '-c', 'from jasmine.entry_points import standalone; standalone()', '--config', 'test/fixture_files/jasmine.yml']) try: req = get_with_retries('http://localhost:8888/') assert req.status_code == 200 assert 'main.js' in req.text assert 'main.css' in req.text assert '__spec__/someSpec.js' in req.text finally: process.terminate() def test_ci(): process = Popen([sys.executable, '-c', 'from jasmine.entry_points import continuous_integration; continuous_integration()', '--config', 'test/fixture_files/jasmine.yml'], stdout=PIPE) output = process.communicate()[0] process.wait() assert process.returncode == 0 assert '1 specs, 0 failed' in str(output) Allow more time for jasmine to start up in testsimport sys from subprocess import Popen, PIPE from time import sleep import requests def get_with_retries(url): n = 0 while True: try: return requests.get(url) except requests.ConnectionError: if n < 20: n += 1 sleep(0.1) else: raise def test_standalone_serves_html(): process = Popen([sys.executable, '-c', 'from jasmine.entry_points import standalone; standalone()', '--config', 'test/fixture_files/jasmine.yml']) try: req = get_with_retries('http://localhost:8888/') assert req.status_code == 200 assert 'main.js' in req.text assert 'main.css' in req.text assert '__spec__/someSpec.js' in req.text finally: process.terminate() def test_ci(): process = Popen([sys.executable, '-c', 'from jasmine.entry_points import continuous_integration; continuous_integration()', '--config', 'test/fixture_files/jasmine.yml'], stdout=PIPE) output = process.communicate()[0] process.wait() assert process.returncode == 0 assert '1 specs, 0 failed' in str(output)
<commit_before>import sys from subprocess import Popen, PIPE from time import sleep import requests def get_with_retries(url): n = 0 while True: try: return requests.get(url) except requests.ConnectionError: if n < 5: n += 1 sleep(0.1) else: raise def test_standalone_serves_html(): process = Popen([sys.executable, '-c', 'from jasmine.entry_points import standalone; standalone()', '--config', 'test/fixture_files/jasmine.yml']) try: req = get_with_retries('http://localhost:8888/') assert req.status_code == 200 assert 'main.js' in req.text assert 'main.css' in req.text assert '__spec__/someSpec.js' in req.text finally: process.terminate() def test_ci(): process = Popen([sys.executable, '-c', 'from jasmine.entry_points import continuous_integration; continuous_integration()', '--config', 'test/fixture_files/jasmine.yml'], stdout=PIPE) output = process.communicate()[0] process.wait() assert process.returncode == 0 assert '1 specs, 0 failed' in str(output) <commit_msg>Allow more time for jasmine to start up in tests<commit_after>import sys from subprocess import Popen, PIPE from time import sleep import requests def get_with_retries(url): n = 0 while True: try: return requests.get(url) except requests.ConnectionError: if n < 20: n += 1 sleep(0.1) else: raise def test_standalone_serves_html(): process = Popen([sys.executable, '-c', 'from jasmine.entry_points import standalone; standalone()', '--config', 'test/fixture_files/jasmine.yml']) try: req = get_with_retries('http://localhost:8888/') assert req.status_code == 200 assert 'main.js' in req.text assert 'main.css' in req.text assert '__spec__/someSpec.js' in req.text finally: process.terminate() def test_ci(): process = Popen([sys.executable, '-c', 'from jasmine.entry_points import continuous_integration; continuous_integration()', '--config', 'test/fixture_files/jasmine.yml'], stdout=PIPE) output = process.communicate()[0] process.wait() assert process.returncode == 0 assert '1 specs, 0 failed' in str(output)
468e82418ceec8eb453054c1b3fbce433a27240f
keyring/__init__.py
keyring/__init__.py
from __future__ import absolute_import from .core import (set_keyring, get_keyring, set_password, get_password, delete_password) from .getpassbackend import get_password as get_pass_get_password try: import pkg_resources __version__ = pkg_resources.get_distribution('keyring').version except Exception: __version__ = 'unknown' __all__ = ( 'set_keyring', 'get_keyring', 'set_password', 'get_password', 'delete_password', 'get_pass_get_password', )
from __future__ import absolute_import from .core import (set_keyring, get_keyring, set_password, get_password, delete_password) from .getpassbackend import get_password as get_pass_get_password __all__ = ( 'set_keyring', 'get_keyring', 'set_password', 'get_password', 'delete_password', 'get_pass_get_password', )
Remove usage of pkg_resources, which has huge import overhead.
Remove usage of pkg_resources, which has huge import overhead.
Python
mit
jaraco/keyring
from __future__ import absolute_import from .core import (set_keyring, get_keyring, set_password, get_password, delete_password) from .getpassbackend import get_password as get_pass_get_password try: import pkg_resources __version__ = pkg_resources.get_distribution('keyring').version except Exception: __version__ = 'unknown' __all__ = ( 'set_keyring', 'get_keyring', 'set_password', 'get_password', 'delete_password', 'get_pass_get_password', ) Remove usage of pkg_resources, which has huge import overhead.
from __future__ import absolute_import from .core import (set_keyring, get_keyring, set_password, get_password, delete_password) from .getpassbackend import get_password as get_pass_get_password __all__ = ( 'set_keyring', 'get_keyring', 'set_password', 'get_password', 'delete_password', 'get_pass_get_password', )
<commit_before>from __future__ import absolute_import from .core import (set_keyring, get_keyring, set_password, get_password, delete_password) from .getpassbackend import get_password as get_pass_get_password try: import pkg_resources __version__ = pkg_resources.get_distribution('keyring').version except Exception: __version__ = 'unknown' __all__ = ( 'set_keyring', 'get_keyring', 'set_password', 'get_password', 'delete_password', 'get_pass_get_password', ) <commit_msg>Remove usage of pkg_resources, which has huge import overhead.<commit_after>
from __future__ import absolute_import from .core import (set_keyring, get_keyring, set_password, get_password, delete_password) from .getpassbackend import get_password as get_pass_get_password __all__ = ( 'set_keyring', 'get_keyring', 'set_password', 'get_password', 'delete_password', 'get_pass_get_password', )
from __future__ import absolute_import from .core import (set_keyring, get_keyring, set_password, get_password, delete_password) from .getpassbackend import get_password as get_pass_get_password try: import pkg_resources __version__ = pkg_resources.get_distribution('keyring').version except Exception: __version__ = 'unknown' __all__ = ( 'set_keyring', 'get_keyring', 'set_password', 'get_password', 'delete_password', 'get_pass_get_password', ) Remove usage of pkg_resources, which has huge import overhead.from __future__ import absolute_import from .core import (set_keyring, get_keyring, set_password, get_password, delete_password) from .getpassbackend import get_password as get_pass_get_password __all__ = ( 'set_keyring', 'get_keyring', 'set_password', 'get_password', 'delete_password', 'get_pass_get_password', )
<commit_before>from __future__ import absolute_import from .core import (set_keyring, get_keyring, set_password, get_password, delete_password) from .getpassbackend import get_password as get_pass_get_password try: import pkg_resources __version__ = pkg_resources.get_distribution('keyring').version except Exception: __version__ = 'unknown' __all__ = ( 'set_keyring', 'get_keyring', 'set_password', 'get_password', 'delete_password', 'get_pass_get_password', ) <commit_msg>Remove usage of pkg_resources, which has huge import overhead.<commit_after>from __future__ import absolute_import from .core import (set_keyring, get_keyring, set_password, get_password, delete_password) from .getpassbackend import get_password as get_pass_get_password __all__ = ( 'set_keyring', 'get_keyring', 'set_password', 'get_password', 'delete_password', 'get_pass_get_password', )
8fbd999bb6d4db865cd04e428533ea97ce139a23
tests/test_exceptions.py
tests/test_exceptions.py
import unittest import os import battlenet PUBLIC_KEY = os.environ.get('BNET_PUBLIC_KEY') PRIVATE_KEY = os.environ.get('BNET_PRIVATE_KEY') class ExceptionTest(unittest.TestCase): def setUp(self): self.connection = battlenet.Connection(public_key=PUBLIC_KEY, private_key=PRIVATE_KEY) def test_character_not_found(self): self.assertRaises(battlenet.CharacterNotFound, lambda: self.connection.get_character(battlenet.UNITED_STATES, 'Fake Realm', 'Fake Character')) def test_guild_not_found(self): self.assertRaises(battlenet.GuildNotFound, lambda: self.connection.get_guild(battlenet.UNITED_STATES, 'Fake Realm', 'Fake Guild')) def test_realm_not_found(self): self.assertRaises(battlenet.RealmNotFound, lambda: self.connection.get_realm(battlenet.EUROPE, 'Fake Realm')) def tearDown(self): del self.connection if __name__ == '__main__': unittest.main()
import sys if sys.version_info < (2, 7): import unittest2 as unittest else: import unittest as unittest import os import battlenet PUBLIC_KEY = os.environ.get('BNET_PUBLIC_KEY') PRIVATE_KEY = os.environ.get('BNET_PRIVATE_KEY') class ExceptionTest(unittest.TestCase): def setUp(self): self.connection = battlenet.Connection(public_key=PUBLIC_KEY, private_key=PRIVATE_KEY) def test_character_not_found(self): self.assertRaises(battlenet.CharacterNotFound, lambda: self.connection.get_character(battlenet.UNITED_STATES, 'Fake Realm', 'Fake Character')) def test_guild_not_found(self): self.assertRaises(battlenet.GuildNotFound, lambda: self.connection.get_guild(battlenet.UNITED_STATES, 'Fake Realm', 'Fake Guild')) def test_realm_not_found(self): self.assertRaises(battlenet.RealmNotFound, lambda: self.connection.get_realm(battlenet.EUROPE, 'Fake Realm')) def tearDown(self): del self.connection if __name__ == '__main__': unittest.main()
Use unittest2 when python version is less than 2.7.
Use unittest2 when python version is less than 2.7. In Google App Engine (GAE) you have to use unittest2 if the unit test code uses any of the capabilities added in Python 2.7 to the unittest module.
Python
mit
PuckCh/battlenet,vishnevskiy/battlenet
import unittest import os import battlenet PUBLIC_KEY = os.environ.get('BNET_PUBLIC_KEY') PRIVATE_KEY = os.environ.get('BNET_PRIVATE_KEY') class ExceptionTest(unittest.TestCase): def setUp(self): self.connection = battlenet.Connection(public_key=PUBLIC_KEY, private_key=PRIVATE_KEY) def test_character_not_found(self): self.assertRaises(battlenet.CharacterNotFound, lambda: self.connection.get_character(battlenet.UNITED_STATES, 'Fake Realm', 'Fake Character')) def test_guild_not_found(self): self.assertRaises(battlenet.GuildNotFound, lambda: self.connection.get_guild(battlenet.UNITED_STATES, 'Fake Realm', 'Fake Guild')) def test_realm_not_found(self): self.assertRaises(battlenet.RealmNotFound, lambda: self.connection.get_realm(battlenet.EUROPE, 'Fake Realm')) def tearDown(self): del self.connection if __name__ == '__main__': unittest.main() Use unittest2 when python version is less than 2.7. In Google App Engine (GAE) you have to use unittest2 if the unit test code uses any of the capabilities added in Python 2.7 to the unittest module.
import sys if sys.version_info < (2, 7): import unittest2 as unittest else: import unittest as unittest import os import battlenet PUBLIC_KEY = os.environ.get('BNET_PUBLIC_KEY') PRIVATE_KEY = os.environ.get('BNET_PRIVATE_KEY') class ExceptionTest(unittest.TestCase): def setUp(self): self.connection = battlenet.Connection(public_key=PUBLIC_KEY, private_key=PRIVATE_KEY) def test_character_not_found(self): self.assertRaises(battlenet.CharacterNotFound, lambda: self.connection.get_character(battlenet.UNITED_STATES, 'Fake Realm', 'Fake Character')) def test_guild_not_found(self): self.assertRaises(battlenet.GuildNotFound, lambda: self.connection.get_guild(battlenet.UNITED_STATES, 'Fake Realm', 'Fake Guild')) def test_realm_not_found(self): self.assertRaises(battlenet.RealmNotFound, lambda: self.connection.get_realm(battlenet.EUROPE, 'Fake Realm')) def tearDown(self): del self.connection if __name__ == '__main__': unittest.main()
<commit_before>import unittest import os import battlenet PUBLIC_KEY = os.environ.get('BNET_PUBLIC_KEY') PRIVATE_KEY = os.environ.get('BNET_PRIVATE_KEY') class ExceptionTest(unittest.TestCase): def setUp(self): self.connection = battlenet.Connection(public_key=PUBLIC_KEY, private_key=PRIVATE_KEY) def test_character_not_found(self): self.assertRaises(battlenet.CharacterNotFound, lambda: self.connection.get_character(battlenet.UNITED_STATES, 'Fake Realm', 'Fake Character')) def test_guild_not_found(self): self.assertRaises(battlenet.GuildNotFound, lambda: self.connection.get_guild(battlenet.UNITED_STATES, 'Fake Realm', 'Fake Guild')) def test_realm_not_found(self): self.assertRaises(battlenet.RealmNotFound, lambda: self.connection.get_realm(battlenet.EUROPE, 'Fake Realm')) def tearDown(self): del self.connection if __name__ == '__main__': unittest.main() <commit_msg>Use unittest2 when python version is less than 2.7. In Google App Engine (GAE) you have to use unittest2 if the unit test code uses any of the capabilities added in Python 2.7 to the unittest module. <commit_after>
import sys if sys.version_info < (2, 7): import unittest2 as unittest else: import unittest as unittest import os import battlenet PUBLIC_KEY = os.environ.get('BNET_PUBLIC_KEY') PRIVATE_KEY = os.environ.get('BNET_PRIVATE_KEY') class ExceptionTest(unittest.TestCase): def setUp(self): self.connection = battlenet.Connection(public_key=PUBLIC_KEY, private_key=PRIVATE_KEY) def test_character_not_found(self): self.assertRaises(battlenet.CharacterNotFound, lambda: self.connection.get_character(battlenet.UNITED_STATES, 'Fake Realm', 'Fake Character')) def test_guild_not_found(self): self.assertRaises(battlenet.GuildNotFound, lambda: self.connection.get_guild(battlenet.UNITED_STATES, 'Fake Realm', 'Fake Guild')) def test_realm_not_found(self): self.assertRaises(battlenet.RealmNotFound, lambda: self.connection.get_realm(battlenet.EUROPE, 'Fake Realm')) def tearDown(self): del self.connection if __name__ == '__main__': unittest.main()
import unittest import os import battlenet PUBLIC_KEY = os.environ.get('BNET_PUBLIC_KEY') PRIVATE_KEY = os.environ.get('BNET_PRIVATE_KEY') class ExceptionTest(unittest.TestCase): def setUp(self): self.connection = battlenet.Connection(public_key=PUBLIC_KEY, private_key=PRIVATE_KEY) def test_character_not_found(self): self.assertRaises(battlenet.CharacterNotFound, lambda: self.connection.get_character(battlenet.UNITED_STATES, 'Fake Realm', 'Fake Character')) def test_guild_not_found(self): self.assertRaises(battlenet.GuildNotFound, lambda: self.connection.get_guild(battlenet.UNITED_STATES, 'Fake Realm', 'Fake Guild')) def test_realm_not_found(self): self.assertRaises(battlenet.RealmNotFound, lambda: self.connection.get_realm(battlenet.EUROPE, 'Fake Realm')) def tearDown(self): del self.connection if __name__ == '__main__': unittest.main() Use unittest2 when python version is less than 2.7. In Google App Engine (GAE) you have to use unittest2 if the unit test code uses any of the capabilities added in Python 2.7 to the unittest module. import sys if sys.version_info < (2, 7): import unittest2 as unittest else: import unittest as unittest import os import battlenet PUBLIC_KEY = os.environ.get('BNET_PUBLIC_KEY') PRIVATE_KEY = os.environ.get('BNET_PRIVATE_KEY') class ExceptionTest(unittest.TestCase): def setUp(self): self.connection = battlenet.Connection(public_key=PUBLIC_KEY, private_key=PRIVATE_KEY) def test_character_not_found(self): self.assertRaises(battlenet.CharacterNotFound, lambda: self.connection.get_character(battlenet.UNITED_STATES, 'Fake Realm', 'Fake Character')) def test_guild_not_found(self): self.assertRaises(battlenet.GuildNotFound, lambda: self.connection.get_guild(battlenet.UNITED_STATES, 'Fake Realm', 'Fake Guild')) def test_realm_not_found(self): self.assertRaises(battlenet.RealmNotFound, lambda: self.connection.get_realm(battlenet.EUROPE, 'Fake Realm')) def tearDown(self): del self.connection if __name__ == '__main__': unittest.main()
<commit_before>import unittest import os import battlenet PUBLIC_KEY = os.environ.get('BNET_PUBLIC_KEY') PRIVATE_KEY = os.environ.get('BNET_PRIVATE_KEY') class ExceptionTest(unittest.TestCase): def setUp(self): self.connection = battlenet.Connection(public_key=PUBLIC_KEY, private_key=PRIVATE_KEY) def test_character_not_found(self): self.assertRaises(battlenet.CharacterNotFound, lambda: self.connection.get_character(battlenet.UNITED_STATES, 'Fake Realm', 'Fake Character')) def test_guild_not_found(self): self.assertRaises(battlenet.GuildNotFound, lambda: self.connection.get_guild(battlenet.UNITED_STATES, 'Fake Realm', 'Fake Guild')) def test_realm_not_found(self): self.assertRaises(battlenet.RealmNotFound, lambda: self.connection.get_realm(battlenet.EUROPE, 'Fake Realm')) def tearDown(self): del self.connection if __name__ == '__main__': unittest.main() <commit_msg>Use unittest2 when python version is less than 2.7. In Google App Engine (GAE) you have to use unittest2 if the unit test code uses any of the capabilities added in Python 2.7 to the unittest module. <commit_after>import sys if sys.version_info < (2, 7): import unittest2 as unittest else: import unittest as unittest import os import battlenet PUBLIC_KEY = os.environ.get('BNET_PUBLIC_KEY') PRIVATE_KEY = os.environ.get('BNET_PRIVATE_KEY') class ExceptionTest(unittest.TestCase): def setUp(self): self.connection = battlenet.Connection(public_key=PUBLIC_KEY, private_key=PRIVATE_KEY) def test_character_not_found(self): self.assertRaises(battlenet.CharacterNotFound, lambda: self.connection.get_character(battlenet.UNITED_STATES, 'Fake Realm', 'Fake Character')) def test_guild_not_found(self): self.assertRaises(battlenet.GuildNotFound, lambda: self.connection.get_guild(battlenet.UNITED_STATES, 'Fake Realm', 'Fake Guild')) def test_realm_not_found(self): self.assertRaises(battlenet.RealmNotFound, lambda: self.connection.get_realm(battlenet.EUROPE, 'Fake Realm')) def tearDown(self): del self.connection if __name__ == '__main__': unittest.main()
25b0164b78298475513a45e7a6d5574d32c280f7
tests/test_naivebayes.py
tests/test_naivebayes.py
import ML.naivebayes as naivebayes import data import numpy as np def test_gaussian_naive_bayes(): X, y = data.categorical_2Dmatrix_data() nb = naivebayes.GaussianNaiveBayes() nb.fit(X, y) for index, row in enumerate(X): predicted_y = nb.predict(row) assert predicted_y == y[index] def test_gaussian_naive_bayes(): X, y = data.categorical_2Dmatrix_data() nb = naivebayes.GaussianNaiveBayes() nb.fit(X, y) y_probabilities = nb.predict(X[0], probabilities=True) assert y_probabilities[y[0]] == 1.0 def test_bernoulli_naive_bayes(): X, y = data.categorical_2Dmatrix_data() nb = naivebayes.BernoulliNaiveBayes() nb.fit(X, y) for index, row in enumerate(X): predicted_y = nb.predict(row) assert predicted_y == y[index] def test_bernoulli_naive_bayes(): X, y = data.categorical_2Dmatrix_bernoulli_data() nb = naivebayes.BernoulliNaiveBayes() nb.fit(X, y) y_probabilities = nb.predict(X[0], probabilities=True) assert y_probabilities[y[0]] == 1.0
import ML.naivebayes as naivebayes import data def test_gaussian_naive_bayes(): X, y = data.categorical_2Dmatrix_data() nb = naivebayes.GaussianNaiveBayes() nb.fit(X, y) for index, row in enumerate(X): predicted_y = nb.predict(row) assert predicted_y == y[index] def test_gaussian_naive_bayes_probs(): X, y = data.categorical_2Dmatrix_data() nb = naivebayes.GaussianNaiveBayes() nb.fit(X, y) y_probabilities = nb.predict(X[0], probabilities=True) assert y_probabilities[y[0]] == 1.0 def test_bernoulli_naive_bayes(): X, y = data.categorical_2Dmatrix_data() nb = naivebayes.BernoulliNaiveBayes() nb.fit(X, y) for index, row in enumerate(X): predicted_y = nb.predict(row) assert predicted_y == y[index] def test_bernoulli_naive_bayes_probs(): X, y = data.categorical_2Dmatrix_bernoulli_data() nb = naivebayes.BernoulliNaiveBayes() nb.fit(X, y) y_probabilities = nb.predict(X[0], probabilities=True) assert y_probabilities[y[0]] == 1.0
Rename tests to avoid name re-use
Rename tests to avoid name re-use
Python
mit
christopherjenness/ML-lib
import ML.naivebayes as naivebayes import data import numpy as np def test_gaussian_naive_bayes(): X, y = data.categorical_2Dmatrix_data() nb = naivebayes.GaussianNaiveBayes() nb.fit(X, y) for index, row in enumerate(X): predicted_y = nb.predict(row) assert predicted_y == y[index] def test_gaussian_naive_bayes(): X, y = data.categorical_2Dmatrix_data() nb = naivebayes.GaussianNaiveBayes() nb.fit(X, y) y_probabilities = nb.predict(X[0], probabilities=True) assert y_probabilities[y[0]] == 1.0 def test_bernoulli_naive_bayes(): X, y = data.categorical_2Dmatrix_data() nb = naivebayes.BernoulliNaiveBayes() nb.fit(X, y) for index, row in enumerate(X): predicted_y = nb.predict(row) assert predicted_y == y[index] def test_bernoulli_naive_bayes(): X, y = data.categorical_2Dmatrix_bernoulli_data() nb = naivebayes.BernoulliNaiveBayes() nb.fit(X, y) y_probabilities = nb.predict(X[0], probabilities=True) assert y_probabilities[y[0]] == 1.0 Rename tests to avoid name re-use
import ML.naivebayes as naivebayes import data def test_gaussian_naive_bayes(): X, y = data.categorical_2Dmatrix_data() nb = naivebayes.GaussianNaiveBayes() nb.fit(X, y) for index, row in enumerate(X): predicted_y = nb.predict(row) assert predicted_y == y[index] def test_gaussian_naive_bayes_probs(): X, y = data.categorical_2Dmatrix_data() nb = naivebayes.GaussianNaiveBayes() nb.fit(X, y) y_probabilities = nb.predict(X[0], probabilities=True) assert y_probabilities[y[0]] == 1.0 def test_bernoulli_naive_bayes(): X, y = data.categorical_2Dmatrix_data() nb = naivebayes.BernoulliNaiveBayes() nb.fit(X, y) for index, row in enumerate(X): predicted_y = nb.predict(row) assert predicted_y == y[index] def test_bernoulli_naive_bayes_probs(): X, y = data.categorical_2Dmatrix_bernoulli_data() nb = naivebayes.BernoulliNaiveBayes() nb.fit(X, y) y_probabilities = nb.predict(X[0], probabilities=True) assert y_probabilities[y[0]] == 1.0
<commit_before>import ML.naivebayes as naivebayes import data import numpy as np def test_gaussian_naive_bayes(): X, y = data.categorical_2Dmatrix_data() nb = naivebayes.GaussianNaiveBayes() nb.fit(X, y) for index, row in enumerate(X): predicted_y = nb.predict(row) assert predicted_y == y[index] def test_gaussian_naive_bayes(): X, y = data.categorical_2Dmatrix_data() nb = naivebayes.GaussianNaiveBayes() nb.fit(X, y) y_probabilities = nb.predict(X[0], probabilities=True) assert y_probabilities[y[0]] == 1.0 def test_bernoulli_naive_bayes(): X, y = data.categorical_2Dmatrix_data() nb = naivebayes.BernoulliNaiveBayes() nb.fit(X, y) for index, row in enumerate(X): predicted_y = nb.predict(row) assert predicted_y == y[index] def test_bernoulli_naive_bayes(): X, y = data.categorical_2Dmatrix_bernoulli_data() nb = naivebayes.BernoulliNaiveBayes() nb.fit(X, y) y_probabilities = nb.predict(X[0], probabilities=True) assert y_probabilities[y[0]] == 1.0 <commit_msg>Rename tests to avoid name re-use<commit_after>
import ML.naivebayes as naivebayes import data def test_gaussian_naive_bayes(): X, y = data.categorical_2Dmatrix_data() nb = naivebayes.GaussianNaiveBayes() nb.fit(X, y) for index, row in enumerate(X): predicted_y = nb.predict(row) assert predicted_y == y[index] def test_gaussian_naive_bayes_probs(): X, y = data.categorical_2Dmatrix_data() nb = naivebayes.GaussianNaiveBayes() nb.fit(X, y) y_probabilities = nb.predict(X[0], probabilities=True) assert y_probabilities[y[0]] == 1.0 def test_bernoulli_naive_bayes(): X, y = data.categorical_2Dmatrix_data() nb = naivebayes.BernoulliNaiveBayes() nb.fit(X, y) for index, row in enumerate(X): predicted_y = nb.predict(row) assert predicted_y == y[index] def test_bernoulli_naive_bayes_probs(): X, y = data.categorical_2Dmatrix_bernoulli_data() nb = naivebayes.BernoulliNaiveBayes() nb.fit(X, y) y_probabilities = nb.predict(X[0], probabilities=True) assert y_probabilities[y[0]] == 1.0
import ML.naivebayes as naivebayes import data import numpy as np def test_gaussian_naive_bayes(): X, y = data.categorical_2Dmatrix_data() nb = naivebayes.GaussianNaiveBayes() nb.fit(X, y) for index, row in enumerate(X): predicted_y = nb.predict(row) assert predicted_y == y[index] def test_gaussian_naive_bayes(): X, y = data.categorical_2Dmatrix_data() nb = naivebayes.GaussianNaiveBayes() nb.fit(X, y) y_probabilities = nb.predict(X[0], probabilities=True) assert y_probabilities[y[0]] == 1.0 def test_bernoulli_naive_bayes(): X, y = data.categorical_2Dmatrix_data() nb = naivebayes.BernoulliNaiveBayes() nb.fit(X, y) for index, row in enumerate(X): predicted_y = nb.predict(row) assert predicted_y == y[index] def test_bernoulli_naive_bayes(): X, y = data.categorical_2Dmatrix_bernoulli_data() nb = naivebayes.BernoulliNaiveBayes() nb.fit(X, y) y_probabilities = nb.predict(X[0], probabilities=True) assert y_probabilities[y[0]] == 1.0 Rename tests to avoid name re-useimport ML.naivebayes as naivebayes import data def test_gaussian_naive_bayes(): X, y = data.categorical_2Dmatrix_data() nb = naivebayes.GaussianNaiveBayes() nb.fit(X, y) for index, row in enumerate(X): predicted_y = nb.predict(row) assert predicted_y == y[index] def test_gaussian_naive_bayes_probs(): X, y = data.categorical_2Dmatrix_data() nb = naivebayes.GaussianNaiveBayes() nb.fit(X, y) y_probabilities = nb.predict(X[0], probabilities=True) assert y_probabilities[y[0]] == 1.0 def test_bernoulli_naive_bayes(): X, y = data.categorical_2Dmatrix_data() nb = naivebayes.BernoulliNaiveBayes() nb.fit(X, y) for index, row in enumerate(X): predicted_y = nb.predict(row) assert predicted_y == y[index] def test_bernoulli_naive_bayes_probs(): X, y = data.categorical_2Dmatrix_bernoulli_data() nb = naivebayes.BernoulliNaiveBayes() nb.fit(X, y) y_probabilities = nb.predict(X[0], probabilities=True) assert y_probabilities[y[0]] == 1.0
<commit_before>import ML.naivebayes as naivebayes import data import numpy as np def test_gaussian_naive_bayes(): X, y = data.categorical_2Dmatrix_data() nb = naivebayes.GaussianNaiveBayes() nb.fit(X, y) for index, row in enumerate(X): predicted_y = nb.predict(row) assert predicted_y == y[index] def test_gaussian_naive_bayes(): X, y = data.categorical_2Dmatrix_data() nb = naivebayes.GaussianNaiveBayes() nb.fit(X, y) y_probabilities = nb.predict(X[0], probabilities=True) assert y_probabilities[y[0]] == 1.0 def test_bernoulli_naive_bayes(): X, y = data.categorical_2Dmatrix_data() nb = naivebayes.BernoulliNaiveBayes() nb.fit(X, y) for index, row in enumerate(X): predicted_y = nb.predict(row) assert predicted_y == y[index] def test_bernoulli_naive_bayes(): X, y = data.categorical_2Dmatrix_bernoulli_data() nb = naivebayes.BernoulliNaiveBayes() nb.fit(X, y) y_probabilities = nb.predict(X[0], probabilities=True) assert y_probabilities[y[0]] == 1.0 <commit_msg>Rename tests to avoid name re-use<commit_after>import ML.naivebayes as naivebayes import data def test_gaussian_naive_bayes(): X, y = data.categorical_2Dmatrix_data() nb = naivebayes.GaussianNaiveBayes() nb.fit(X, y) for index, row in enumerate(X): predicted_y = nb.predict(row) assert predicted_y == y[index] def test_gaussian_naive_bayes_probs(): X, y = data.categorical_2Dmatrix_data() nb = naivebayes.GaussianNaiveBayes() nb.fit(X, y) y_probabilities = nb.predict(X[0], probabilities=True) assert y_probabilities[y[0]] == 1.0 def test_bernoulli_naive_bayes(): X, y = data.categorical_2Dmatrix_data() nb = naivebayes.BernoulliNaiveBayes() nb.fit(X, y) for index, row in enumerate(X): predicted_y = nb.predict(row) assert predicted_y == y[index] def test_bernoulli_naive_bayes_probs(): X, y = data.categorical_2Dmatrix_bernoulli_data() nb = naivebayes.BernoulliNaiveBayes() nb.fit(X, y) y_probabilities = nb.predict(X[0], probabilities=True) assert y_probabilities[y[0]] == 1.0
a6bca7eb3825e9c9722f3fc2dcff2a09dfd47f99
runserver.py
runserver.py
#!/usr/bin/env python3 from argparse import ArgumentParser from argparse import FileType from os.path import dirname from os.path import join from connexion import App from opwen_email_server.utils.imports import can_import try: # noinspection PyUnresolvedReferences from dotenv import load_dotenv load_dotenv(join(dirname(__file__), '.env')) except ImportError: pass servers = list(filter(can_import, ('tornado', 'gevent', 'flask'))) hosts = ['127.0.0.1', '0.0.0.0'] parser = ArgumentParser() parser.add_argument('--host', choices=hosts, default=hosts[0]) parser.add_argument('--port', type=int, default=8080) parser.add_argument('--server', choices=servers, default=servers[0]) parser.add_argument('--ui', action='store_true', default=False) parser.add_argument('apis', nargs='+', type=FileType('r')) args = parser.parse_args() app = App(__name__, host=args.host, port=args.port, server=args.server, swagger_ui=args.ui) for api in args.apis: api.close() app.add_api(api.name) app.run()
#!/usr/bin/env python3 from connexion import App from opwen_email_server.utils.imports import can_import _servers = list(filter(can_import, ('tornado', 'gevent', 'flask'))) _hosts = ['127.0.0.1', '0.0.0.0'] _server = _servers[0] _host = _hosts[0] _port = 8080 _ui = False def build_app(apis, host=_host, port=_port, server=_server, ui=_ui): app = App(__name__, host=host, port=port, server=server, swagger_ui=ui) for api in apis: app.add_api(api) return app if __name__ == '__main__': from argparse import ArgumentParser from argparse import FileType from os.path import dirname from os.path import join try: # noinspection PyUnresolvedReferences from dotenv import load_dotenv load_dotenv(join(dirname(__file__), '.env')) except ImportError: pass parser = ArgumentParser() parser.add_argument('--host', choices=_hosts, default=_host) parser.add_argument('--port', type=int, default=_port) parser.add_argument('--server', choices=_servers, default=_server) parser.add_argument('--ui', action='store_true', default=_ui) parser.add_argument('apis', nargs='+', type=FileType('r')) args = parser.parse_args() build_app([api.name for api in args.apis], args.host, args.port, args.server, args.ui).run()
Make script importable without side-effects
Make script importable without side-effects This enables for example wrapping the runserver script in a wsgi server like gunicorn that doesn't support passing args to the downstream app.
Python
apache-2.0
ascoderu/opwen-cloudserver,ascoderu/opwen-cloudserver
#!/usr/bin/env python3 from argparse import ArgumentParser from argparse import FileType from os.path import dirname from os.path import join from connexion import App from opwen_email_server.utils.imports import can_import try: # noinspection PyUnresolvedReferences from dotenv import load_dotenv load_dotenv(join(dirname(__file__), '.env')) except ImportError: pass servers = list(filter(can_import, ('tornado', 'gevent', 'flask'))) hosts = ['127.0.0.1', '0.0.0.0'] parser = ArgumentParser() parser.add_argument('--host', choices=hosts, default=hosts[0]) parser.add_argument('--port', type=int, default=8080) parser.add_argument('--server', choices=servers, default=servers[0]) parser.add_argument('--ui', action='store_true', default=False) parser.add_argument('apis', nargs='+', type=FileType('r')) args = parser.parse_args() app = App(__name__, host=args.host, port=args.port, server=args.server, swagger_ui=args.ui) for api in args.apis: api.close() app.add_api(api.name) app.run() Make script importable without side-effects This enables for example wrapping the runserver script in a wsgi server like gunicorn that doesn't support passing args to the downstream app.
#!/usr/bin/env python3 from connexion import App from opwen_email_server.utils.imports import can_import _servers = list(filter(can_import, ('tornado', 'gevent', 'flask'))) _hosts = ['127.0.0.1', '0.0.0.0'] _server = _servers[0] _host = _hosts[0] _port = 8080 _ui = False def build_app(apis, host=_host, port=_port, server=_server, ui=_ui): app = App(__name__, host=host, port=port, server=server, swagger_ui=ui) for api in apis: app.add_api(api) return app if __name__ == '__main__': from argparse import ArgumentParser from argparse import FileType from os.path import dirname from os.path import join try: # noinspection PyUnresolvedReferences from dotenv import load_dotenv load_dotenv(join(dirname(__file__), '.env')) except ImportError: pass parser = ArgumentParser() parser.add_argument('--host', choices=_hosts, default=_host) parser.add_argument('--port', type=int, default=_port) parser.add_argument('--server', choices=_servers, default=_server) parser.add_argument('--ui', action='store_true', default=_ui) parser.add_argument('apis', nargs='+', type=FileType('r')) args = parser.parse_args() build_app([api.name for api in args.apis], args.host, args.port, args.server, args.ui).run()
<commit_before>#!/usr/bin/env python3 from argparse import ArgumentParser from argparse import FileType from os.path import dirname from os.path import join from connexion import App from opwen_email_server.utils.imports import can_import try: # noinspection PyUnresolvedReferences from dotenv import load_dotenv load_dotenv(join(dirname(__file__), '.env')) except ImportError: pass servers = list(filter(can_import, ('tornado', 'gevent', 'flask'))) hosts = ['127.0.0.1', '0.0.0.0'] parser = ArgumentParser() parser.add_argument('--host', choices=hosts, default=hosts[0]) parser.add_argument('--port', type=int, default=8080) parser.add_argument('--server', choices=servers, default=servers[0]) parser.add_argument('--ui', action='store_true', default=False) parser.add_argument('apis', nargs='+', type=FileType('r')) args = parser.parse_args() app = App(__name__, host=args.host, port=args.port, server=args.server, swagger_ui=args.ui) for api in args.apis: api.close() app.add_api(api.name) app.run() <commit_msg>Make script importable without side-effects This enables for example wrapping the runserver script in a wsgi server like gunicorn that doesn't support passing args to the downstream app.<commit_after>
#!/usr/bin/env python3 from connexion import App from opwen_email_server.utils.imports import can_import _servers = list(filter(can_import, ('tornado', 'gevent', 'flask'))) _hosts = ['127.0.0.1', '0.0.0.0'] _server = _servers[0] _host = _hosts[0] _port = 8080 _ui = False def build_app(apis, host=_host, port=_port, server=_server, ui=_ui): app = App(__name__, host=host, port=port, server=server, swagger_ui=ui) for api in apis: app.add_api(api) return app if __name__ == '__main__': from argparse import ArgumentParser from argparse import FileType from os.path import dirname from os.path import join try: # noinspection PyUnresolvedReferences from dotenv import load_dotenv load_dotenv(join(dirname(__file__), '.env')) except ImportError: pass parser = ArgumentParser() parser.add_argument('--host', choices=_hosts, default=_host) parser.add_argument('--port', type=int, default=_port) parser.add_argument('--server', choices=_servers, default=_server) parser.add_argument('--ui', action='store_true', default=_ui) parser.add_argument('apis', nargs='+', type=FileType('r')) args = parser.parse_args() build_app([api.name for api in args.apis], args.host, args.port, args.server, args.ui).run()
#!/usr/bin/env python3 from argparse import ArgumentParser from argparse import FileType from os.path import dirname from os.path import join from connexion import App from opwen_email_server.utils.imports import can_import try: # noinspection PyUnresolvedReferences from dotenv import load_dotenv load_dotenv(join(dirname(__file__), '.env')) except ImportError: pass servers = list(filter(can_import, ('tornado', 'gevent', 'flask'))) hosts = ['127.0.0.1', '0.0.0.0'] parser = ArgumentParser() parser.add_argument('--host', choices=hosts, default=hosts[0]) parser.add_argument('--port', type=int, default=8080) parser.add_argument('--server', choices=servers, default=servers[0]) parser.add_argument('--ui', action='store_true', default=False) parser.add_argument('apis', nargs='+', type=FileType('r')) args = parser.parse_args() app = App(__name__, host=args.host, port=args.port, server=args.server, swagger_ui=args.ui) for api in args.apis: api.close() app.add_api(api.name) app.run() Make script importable without side-effects This enables for example wrapping the runserver script in a wsgi server like gunicorn that doesn't support passing args to the downstream app.#!/usr/bin/env python3 from connexion import App from opwen_email_server.utils.imports import can_import _servers = list(filter(can_import, ('tornado', 'gevent', 'flask'))) _hosts = ['127.0.0.1', '0.0.0.0'] _server = _servers[0] _host = _hosts[0] _port = 8080 _ui = False def build_app(apis, host=_host, port=_port, server=_server, ui=_ui): app = App(__name__, host=host, port=port, server=server, swagger_ui=ui) for api in apis: app.add_api(api) return app if __name__ == '__main__': from argparse import ArgumentParser from argparse import FileType from os.path import dirname from os.path import join try: # noinspection PyUnresolvedReferences from dotenv import load_dotenv load_dotenv(join(dirname(__file__), '.env')) except ImportError: pass parser = ArgumentParser() parser.add_argument('--host', choices=_hosts, default=_host) parser.add_argument('--port', type=int, default=_port) parser.add_argument('--server', choices=_servers, default=_server) parser.add_argument('--ui', action='store_true', default=_ui) parser.add_argument('apis', nargs='+', type=FileType('r')) args = parser.parse_args() build_app([api.name for api in args.apis], args.host, args.port, args.server, args.ui).run()
<commit_before>#!/usr/bin/env python3 from argparse import ArgumentParser from argparse import FileType from os.path import dirname from os.path import join from connexion import App from opwen_email_server.utils.imports import can_import try: # noinspection PyUnresolvedReferences from dotenv import load_dotenv load_dotenv(join(dirname(__file__), '.env')) except ImportError: pass servers = list(filter(can_import, ('tornado', 'gevent', 'flask'))) hosts = ['127.0.0.1', '0.0.0.0'] parser = ArgumentParser() parser.add_argument('--host', choices=hosts, default=hosts[0]) parser.add_argument('--port', type=int, default=8080) parser.add_argument('--server', choices=servers, default=servers[0]) parser.add_argument('--ui', action='store_true', default=False) parser.add_argument('apis', nargs='+', type=FileType('r')) args = parser.parse_args() app = App(__name__, host=args.host, port=args.port, server=args.server, swagger_ui=args.ui) for api in args.apis: api.close() app.add_api(api.name) app.run() <commit_msg>Make script importable without side-effects This enables for example wrapping the runserver script in a wsgi server like gunicorn that doesn't support passing args to the downstream app.<commit_after>#!/usr/bin/env python3 from connexion import App from opwen_email_server.utils.imports import can_import _servers = list(filter(can_import, ('tornado', 'gevent', 'flask'))) _hosts = ['127.0.0.1', '0.0.0.0'] _server = _servers[0] _host = _hosts[0] _port = 8080 _ui = False def build_app(apis, host=_host, port=_port, server=_server, ui=_ui): app = App(__name__, host=host, port=port, server=server, swagger_ui=ui) for api in apis: app.add_api(api) return app if __name__ == '__main__': from argparse import ArgumentParser from argparse import FileType from os.path import dirname from os.path import join try: # noinspection PyUnresolvedReferences from dotenv import load_dotenv load_dotenv(join(dirname(__file__), '.env')) except ImportError: pass parser = ArgumentParser() parser.add_argument('--host', choices=_hosts, default=_host) parser.add_argument('--port', type=int, default=_port) parser.add_argument('--server', choices=_servers, default=_server) parser.add_argument('--ui', action='store_true', default=_ui) parser.add_argument('apis', nargs='+', type=FileType('r')) args = parser.parse_args() build_app([api.name for api in args.apis], args.host, args.port, args.server, args.ui).run()
921df8b8309b40e7a69c2fa0434a51c1cce82c28
examples/rpc_pipeline.py
examples/rpc_pipeline.py
import asyncio import aiozmq.rpc class Handler(aiozmq.rpc.AttrHandler): @aiozmq.rpc.method def handle_some_event(self, a: int, b: int): pass @asyncio.coroutine def go(): listener = yield from aiozmq.rpc.serve_pipeline( Handler(), bind='tcp://*:*') listener_addr = next(iter(listener.transport.bindings())) notifier = yield from aiozmq.rpc.connect_pipeline( connect=listener_addr) yield from notifier.notify.handle_some_event(1, 2) listener.close() notifier.close() def main(): asyncio.get_event_loop().run_until_complete(go()) print("DONE") if __name__ == '__main__': main()
import asyncio import aiozmq.rpc from itertools import count class Handler(aiozmq.rpc.AttrHandler): def __init__(self): self.connected = False @aiozmq.rpc.method def remote_func(self, step, a: int, b: int): self.connected = True print("HANDLER", step, a, b) @asyncio.coroutine def go(): handler = Handler() listener = yield from aiozmq.rpc.serve_pipeline( handler, bind='tcp://*:*') listener_addr = next(iter(listener.transport.bindings())) notifier = yield from aiozmq.rpc.connect_pipeline( connect=listener_addr) for step in count(0): yield from notifier.notify.remote_func(step, 1, 2) if handler.connected: break else: yield from asyncio.sleep(0.01) listener.close() yield from listener.wait_closed() notifier.close() yield from notifier.wait_closed() def main(): asyncio.get_event_loop().run_until_complete(go()) print("DONE") if __name__ == '__main__': main()
Make rpc pipeine example stable
Make rpc pipeine example stable
Python
bsd-2-clause
claws/aiozmq,MetaMemoryT/aiozmq,asteven/aiozmq,aio-libs/aiozmq
import asyncio import aiozmq.rpc class Handler(aiozmq.rpc.AttrHandler): @aiozmq.rpc.method def handle_some_event(self, a: int, b: int): pass @asyncio.coroutine def go(): listener = yield from aiozmq.rpc.serve_pipeline( Handler(), bind='tcp://*:*') listener_addr = next(iter(listener.transport.bindings())) notifier = yield from aiozmq.rpc.connect_pipeline( connect=listener_addr) yield from notifier.notify.handle_some_event(1, 2) listener.close() notifier.close() def main(): asyncio.get_event_loop().run_until_complete(go()) print("DONE") if __name__ == '__main__': main() Make rpc pipeine example stable
import asyncio import aiozmq.rpc from itertools import count class Handler(aiozmq.rpc.AttrHandler): def __init__(self): self.connected = False @aiozmq.rpc.method def remote_func(self, step, a: int, b: int): self.connected = True print("HANDLER", step, a, b) @asyncio.coroutine def go(): handler = Handler() listener = yield from aiozmq.rpc.serve_pipeline( handler, bind='tcp://*:*') listener_addr = next(iter(listener.transport.bindings())) notifier = yield from aiozmq.rpc.connect_pipeline( connect=listener_addr) for step in count(0): yield from notifier.notify.remote_func(step, 1, 2) if handler.connected: break else: yield from asyncio.sleep(0.01) listener.close() yield from listener.wait_closed() notifier.close() yield from notifier.wait_closed() def main(): asyncio.get_event_loop().run_until_complete(go()) print("DONE") if __name__ == '__main__': main()
<commit_before>import asyncio import aiozmq.rpc class Handler(aiozmq.rpc.AttrHandler): @aiozmq.rpc.method def handle_some_event(self, a: int, b: int): pass @asyncio.coroutine def go(): listener = yield from aiozmq.rpc.serve_pipeline( Handler(), bind='tcp://*:*') listener_addr = next(iter(listener.transport.bindings())) notifier = yield from aiozmq.rpc.connect_pipeline( connect=listener_addr) yield from notifier.notify.handle_some_event(1, 2) listener.close() notifier.close() def main(): asyncio.get_event_loop().run_until_complete(go()) print("DONE") if __name__ == '__main__': main() <commit_msg>Make rpc pipeine example stable<commit_after>
import asyncio import aiozmq.rpc from itertools import count class Handler(aiozmq.rpc.AttrHandler): def __init__(self): self.connected = False @aiozmq.rpc.method def remote_func(self, step, a: int, b: int): self.connected = True print("HANDLER", step, a, b) @asyncio.coroutine def go(): handler = Handler() listener = yield from aiozmq.rpc.serve_pipeline( handler, bind='tcp://*:*') listener_addr = next(iter(listener.transport.bindings())) notifier = yield from aiozmq.rpc.connect_pipeline( connect=listener_addr) for step in count(0): yield from notifier.notify.remote_func(step, 1, 2) if handler.connected: break else: yield from asyncio.sleep(0.01) listener.close() yield from listener.wait_closed() notifier.close() yield from notifier.wait_closed() def main(): asyncio.get_event_loop().run_until_complete(go()) print("DONE") if __name__ == '__main__': main()
import asyncio import aiozmq.rpc class Handler(aiozmq.rpc.AttrHandler): @aiozmq.rpc.method def handle_some_event(self, a: int, b: int): pass @asyncio.coroutine def go(): listener = yield from aiozmq.rpc.serve_pipeline( Handler(), bind='tcp://*:*') listener_addr = next(iter(listener.transport.bindings())) notifier = yield from aiozmq.rpc.connect_pipeline( connect=listener_addr) yield from notifier.notify.handle_some_event(1, 2) listener.close() notifier.close() def main(): asyncio.get_event_loop().run_until_complete(go()) print("DONE") if __name__ == '__main__': main() Make rpc pipeine example stableimport asyncio import aiozmq.rpc from itertools import count class Handler(aiozmq.rpc.AttrHandler): def __init__(self): self.connected = False @aiozmq.rpc.method def remote_func(self, step, a: int, b: int): self.connected = True print("HANDLER", step, a, b) @asyncio.coroutine def go(): handler = Handler() listener = yield from aiozmq.rpc.serve_pipeline( handler, bind='tcp://*:*') listener_addr = next(iter(listener.transport.bindings())) notifier = yield from aiozmq.rpc.connect_pipeline( connect=listener_addr) for step in count(0): yield from notifier.notify.remote_func(step, 1, 2) if handler.connected: break else: yield from asyncio.sleep(0.01) listener.close() yield from listener.wait_closed() notifier.close() yield from notifier.wait_closed() def main(): asyncio.get_event_loop().run_until_complete(go()) print("DONE") if __name__ == '__main__': main()
<commit_before>import asyncio import aiozmq.rpc class Handler(aiozmq.rpc.AttrHandler): @aiozmq.rpc.method def handle_some_event(self, a: int, b: int): pass @asyncio.coroutine def go(): listener = yield from aiozmq.rpc.serve_pipeline( Handler(), bind='tcp://*:*') listener_addr = next(iter(listener.transport.bindings())) notifier = yield from aiozmq.rpc.connect_pipeline( connect=listener_addr) yield from notifier.notify.handle_some_event(1, 2) listener.close() notifier.close() def main(): asyncio.get_event_loop().run_until_complete(go()) print("DONE") if __name__ == '__main__': main() <commit_msg>Make rpc pipeine example stable<commit_after>import asyncio import aiozmq.rpc from itertools import count class Handler(aiozmq.rpc.AttrHandler): def __init__(self): self.connected = False @aiozmq.rpc.method def remote_func(self, step, a: int, b: int): self.connected = True print("HANDLER", step, a, b) @asyncio.coroutine def go(): handler = Handler() listener = yield from aiozmq.rpc.serve_pipeline( handler, bind='tcp://*:*') listener_addr = next(iter(listener.transport.bindings())) notifier = yield from aiozmq.rpc.connect_pipeline( connect=listener_addr) for step in count(0): yield from notifier.notify.remote_func(step, 1, 2) if handler.connected: break else: yield from asyncio.sleep(0.01) listener.close() yield from listener.wait_closed() notifier.close() yield from notifier.wait_closed() def main(): asyncio.get_event_loop().run_until_complete(go()) print("DONE") if __name__ == '__main__': main()
c5fd251736d586840563979231ff4065a4e225f1
data_collection/h5manager.py
data_collection/h5manager.py
# -*- coding:utf-8 -*- import tables import os def init_data_h5(filename): """Initialize a data HDF5 file""" # Raise en error if the file already exists try: os.open(filename, os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0644) except OSError, e: raise e # Else, continue by creating the file else: with tables.openFile(filename, 'w') as f: setattr(f.root._v_attrs, 'n_simu', 0) def new_simu(filename, data): """Put the simulation data into the HDF5 file""" with tables.openFile(filename, 'a') as f: n_simu = getattr(f.root._v_attrs, 'n_simu') # parse data and put them in a new group simu_group = f.createGroup('/', 'simu' + str(n_simu)) # TODO change value of n_simu
# -*- coding:utf-8 -*- import tables import os def init_data_h5(filename): """Initialize a data HDF5 file""" if not file_exists(filename): with tables.openFile(filename, 'w') as f: setattr(f.root._v_attrs, 'n_simu', 0) def file_exists(filename): """Check if a file `filename` exists.""" file_exists = False try: fd = os.open(filename, os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0644) os.close(fd) os.remove(filename) except OSError, e: file_exists = True raise e return file_exists def new_simu(filename, data): """Put the simulation data into the HDF5 file""" with tables.openFile(filename, 'a') as f: n_simu = getattr(f.root._v_attrs, 'n_simu') # parse data and put them in a new group simu_group = f.createGroup('/', 'simu' + str(n_simu)) # TODO change value of n_simu
Add a function to check if a file exists
Add a function to check if a file exists
Python
mit
neuro-lyon/multiglom-model,neuro-lyon/multiglom-model
# -*- coding:utf-8 -*- import tables import os def init_data_h5(filename): """Initialize a data HDF5 file""" # Raise en error if the file already exists try: os.open(filename, os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0644) except OSError, e: raise e # Else, continue by creating the file else: with tables.openFile(filename, 'w') as f: setattr(f.root._v_attrs, 'n_simu', 0) def new_simu(filename, data): """Put the simulation data into the HDF5 file""" with tables.openFile(filename, 'a') as f: n_simu = getattr(f.root._v_attrs, 'n_simu') # parse data and put them in a new group simu_group = f.createGroup('/', 'simu' + str(n_simu)) # TODO change value of n_simu Add a function to check if a file exists
# -*- coding:utf-8 -*- import tables import os def init_data_h5(filename): """Initialize a data HDF5 file""" if not file_exists(filename): with tables.openFile(filename, 'w') as f: setattr(f.root._v_attrs, 'n_simu', 0) def file_exists(filename): """Check if a file `filename` exists.""" file_exists = False try: fd = os.open(filename, os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0644) os.close(fd) os.remove(filename) except OSError, e: file_exists = True raise e return file_exists def new_simu(filename, data): """Put the simulation data into the HDF5 file""" with tables.openFile(filename, 'a') as f: n_simu = getattr(f.root._v_attrs, 'n_simu') # parse data and put them in a new group simu_group = f.createGroup('/', 'simu' + str(n_simu)) # TODO change value of n_simu
<commit_before># -*- coding:utf-8 -*- import tables import os def init_data_h5(filename): """Initialize a data HDF5 file""" # Raise en error if the file already exists try: os.open(filename, os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0644) except OSError, e: raise e # Else, continue by creating the file else: with tables.openFile(filename, 'w') as f: setattr(f.root._v_attrs, 'n_simu', 0) def new_simu(filename, data): """Put the simulation data into the HDF5 file""" with tables.openFile(filename, 'a') as f: n_simu = getattr(f.root._v_attrs, 'n_simu') # parse data and put them in a new group simu_group = f.createGroup('/', 'simu' + str(n_simu)) # TODO change value of n_simu <commit_msg>Add a function to check if a file exists<commit_after>
# -*- coding:utf-8 -*- import tables import os def init_data_h5(filename): """Initialize a data HDF5 file""" if not file_exists(filename): with tables.openFile(filename, 'w') as f: setattr(f.root._v_attrs, 'n_simu', 0) def file_exists(filename): """Check if a file `filename` exists.""" file_exists = False try: fd = os.open(filename, os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0644) os.close(fd) os.remove(filename) except OSError, e: file_exists = True raise e return file_exists def new_simu(filename, data): """Put the simulation data into the HDF5 file""" with tables.openFile(filename, 'a') as f: n_simu = getattr(f.root._v_attrs, 'n_simu') # parse data and put them in a new group simu_group = f.createGroup('/', 'simu' + str(n_simu)) # TODO change value of n_simu
# -*- coding:utf-8 -*- import tables import os def init_data_h5(filename): """Initialize a data HDF5 file""" # Raise en error if the file already exists try: os.open(filename, os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0644) except OSError, e: raise e # Else, continue by creating the file else: with tables.openFile(filename, 'w') as f: setattr(f.root._v_attrs, 'n_simu', 0) def new_simu(filename, data): """Put the simulation data into the HDF5 file""" with tables.openFile(filename, 'a') as f: n_simu = getattr(f.root._v_attrs, 'n_simu') # parse data and put them in a new group simu_group = f.createGroup('/', 'simu' + str(n_simu)) # TODO change value of n_simu Add a function to check if a file exists# -*- coding:utf-8 -*- import tables import os def init_data_h5(filename): """Initialize a data HDF5 file""" if not file_exists(filename): with tables.openFile(filename, 'w') as f: setattr(f.root._v_attrs, 'n_simu', 0) def file_exists(filename): """Check if a file `filename` exists.""" file_exists = False try: fd = os.open(filename, os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0644) os.close(fd) os.remove(filename) except OSError, e: file_exists = True raise e return file_exists def new_simu(filename, data): """Put the simulation data into the HDF5 file""" with tables.openFile(filename, 'a') as f: n_simu = getattr(f.root._v_attrs, 'n_simu') # parse data and put them in a new group simu_group = f.createGroup('/', 'simu' + str(n_simu)) # TODO change value of n_simu
<commit_before># -*- coding:utf-8 -*- import tables import os def init_data_h5(filename): """Initialize a data HDF5 file""" # Raise en error if the file already exists try: os.open(filename, os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0644) except OSError, e: raise e # Else, continue by creating the file else: with tables.openFile(filename, 'w') as f: setattr(f.root._v_attrs, 'n_simu', 0) def new_simu(filename, data): """Put the simulation data into the HDF5 file""" with tables.openFile(filename, 'a') as f: n_simu = getattr(f.root._v_attrs, 'n_simu') # parse data and put them in a new group simu_group = f.createGroup('/', 'simu' + str(n_simu)) # TODO change value of n_simu <commit_msg>Add a function to check if a file exists<commit_after># -*- coding:utf-8 -*- import tables import os def init_data_h5(filename): """Initialize a data HDF5 file""" if not file_exists(filename): with tables.openFile(filename, 'w') as f: setattr(f.root._v_attrs, 'n_simu', 0) def file_exists(filename): """Check if a file `filename` exists.""" file_exists = False try: fd = os.open(filename, os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0644) os.close(fd) os.remove(filename) except OSError, e: file_exists = True raise e return file_exists def new_simu(filename, data): """Put the simulation data into the HDF5 file""" with tables.openFile(filename, 'a') as f: n_simu = getattr(f.root._v_attrs, 'n_simu') # parse data and put them in a new group simu_group = f.createGroup('/', 'simu' + str(n_simu)) # TODO change value of n_simu
b17472c86ffca7811246080cf3b4b3f3b84e36b1
common/src/tests/common/components/test_command.py
common/src/tests/common/components/test_command.py
#!/usr/bin/python3 import unittest from gosa.common.components.command import * class CommandTestCase(unittest.TestCase): """Docs""" @Command(__help__="TEST") def test_command(self): pass """Docs""" @Command() def test_command2(self): pass # agent and client terms still in use in command.py
#!/usr/bin/python3 import unittest from gosa.common.components.command import * class CommandTestCase(unittest.TestCase): @Command(__help__="TEST") def test_command(self): pass @Command() def test_command2(self): """Docs""" pass # agent and client terms still in use in command.py
Fix in tests: Docstring at wrong location
Fix in tests: Docstring at wrong location
Python
lgpl-2.1
gonicus/gosa,gonicus/gosa,gonicus/gosa,gonicus/gosa
#!/usr/bin/python3 import unittest from gosa.common.components.command import * class CommandTestCase(unittest.TestCase): """Docs""" @Command(__help__="TEST") def test_command(self): pass """Docs""" @Command() def test_command2(self): pass # agent and client terms still in use in command.py Fix in tests: Docstring at wrong location
#!/usr/bin/python3 import unittest from gosa.common.components.command import * class CommandTestCase(unittest.TestCase): @Command(__help__="TEST") def test_command(self): pass @Command() def test_command2(self): """Docs""" pass # agent and client terms still in use in command.py
<commit_before>#!/usr/bin/python3 import unittest from gosa.common.components.command import * class CommandTestCase(unittest.TestCase): """Docs""" @Command(__help__="TEST") def test_command(self): pass """Docs""" @Command() def test_command2(self): pass # agent and client terms still in use in command.py <commit_msg>Fix in tests: Docstring at wrong location<commit_after>
#!/usr/bin/python3 import unittest from gosa.common.components.command import * class CommandTestCase(unittest.TestCase): @Command(__help__="TEST") def test_command(self): pass @Command() def test_command2(self): """Docs""" pass # agent and client terms still in use in command.py
#!/usr/bin/python3 import unittest from gosa.common.components.command import * class CommandTestCase(unittest.TestCase): """Docs""" @Command(__help__="TEST") def test_command(self): pass """Docs""" @Command() def test_command2(self): pass # agent and client terms still in use in command.py Fix in tests: Docstring at wrong location#!/usr/bin/python3 import unittest from gosa.common.components.command import * class CommandTestCase(unittest.TestCase): @Command(__help__="TEST") def test_command(self): pass @Command() def test_command2(self): """Docs""" pass # agent and client terms still in use in command.py
<commit_before>#!/usr/bin/python3 import unittest from gosa.common.components.command import * class CommandTestCase(unittest.TestCase): """Docs""" @Command(__help__="TEST") def test_command(self): pass """Docs""" @Command() def test_command2(self): pass # agent and client terms still in use in command.py <commit_msg>Fix in tests: Docstring at wrong location<commit_after>#!/usr/bin/python3 import unittest from gosa.common.components.command import * class CommandTestCase(unittest.TestCase): @Command(__help__="TEST") def test_command(self): pass @Command() def test_command2(self): """Docs""" pass # agent and client terms still in use in command.py
502e01be7fdf427e3fbbf03887bbb323d8c74d43
src/pi/pushrpc.py
src/pi/pushrpc.py
"""Pusher intergration for messages from the cloud.""" import json import logging import Queue import sys from common import creds from pusherclient import Pusher class PushRPC(object): """Wrapper for pusher integration.""" def __init__(self): self._queue = Queue.Queue() self._pusher = Pusher(creds.pusher_key) self._pusher.connection.bind('pusher:connection_established', self._connect_handler) self._pusher.connect() def _connect_handler(self, _): channel = self._pusher.subscribe('test') channel.bind('event', self._callback_handler) def _callback_handler(self, data): """Callback for when messages are recieved from pusher.""" try: data = json.loads(data) except ValueError: logging.error('Error parsing message', exc_info=sys.exc_info()) return self._queue.put(data) def events(self): while True: yield self._queue.get(block=True)
"""Pusher intergration for messages from the cloud.""" import json import logging import Queue import sys from common import creds from pusherclient import Pusher class PushRPC(object): """Wrapper for pusher integration.""" def __init__(self): self._queue = Queue.Queue() self._pusher = Pusher(creds.pusher_key) self._pusher.connection.bind('pusher:connection_established', self._connect_handler) self._pusher.connect() def _connect_handler(self, _): channel = self._pusher.subscribe('test') channel.bind('event', self._callback_handler) def _callback_handler(self, data): """Callback for when messages are recieved from pusher.""" try: data = json.loads(data) except ValueError: logging.error('Error parsing message', exc_info=sys.exc_info()) return self._queue.put(data) def events(self): while True: # if we specify a timeout, queues become keyboard interruptable try: yield self._queue.get(block=True, timeout=1000) except Queue.Empty: pass
Make the script respond to ctrl-c
Make the script respond to ctrl-c
Python
mit
tomwilkie/awesomation,tomwilkie/awesomation,tomwilkie/awesomation,tomwilkie/awesomation,tomwilkie/awesomation
"""Pusher intergration for messages from the cloud.""" import json import logging import Queue import sys from common import creds from pusherclient import Pusher class PushRPC(object): """Wrapper for pusher integration.""" def __init__(self): self._queue = Queue.Queue() self._pusher = Pusher(creds.pusher_key) self._pusher.connection.bind('pusher:connection_established', self._connect_handler) self._pusher.connect() def _connect_handler(self, _): channel = self._pusher.subscribe('test') channel.bind('event', self._callback_handler) def _callback_handler(self, data): """Callback for when messages are recieved from pusher.""" try: data = json.loads(data) except ValueError: logging.error('Error parsing message', exc_info=sys.exc_info()) return self._queue.put(data) def events(self): while True: yield self._queue.get(block=True) Make the script respond to ctrl-c
"""Pusher intergration for messages from the cloud.""" import json import logging import Queue import sys from common import creds from pusherclient import Pusher class PushRPC(object): """Wrapper for pusher integration.""" def __init__(self): self._queue = Queue.Queue() self._pusher = Pusher(creds.pusher_key) self._pusher.connection.bind('pusher:connection_established', self._connect_handler) self._pusher.connect() def _connect_handler(self, _): channel = self._pusher.subscribe('test') channel.bind('event', self._callback_handler) def _callback_handler(self, data): """Callback for when messages are recieved from pusher.""" try: data = json.loads(data) except ValueError: logging.error('Error parsing message', exc_info=sys.exc_info()) return self._queue.put(data) def events(self): while True: # if we specify a timeout, queues become keyboard interruptable try: yield self._queue.get(block=True, timeout=1000) except Queue.Empty: pass
<commit_before>"""Pusher intergration for messages from the cloud.""" import json import logging import Queue import sys from common import creds from pusherclient import Pusher class PushRPC(object): """Wrapper for pusher integration.""" def __init__(self): self._queue = Queue.Queue() self._pusher = Pusher(creds.pusher_key) self._pusher.connection.bind('pusher:connection_established', self._connect_handler) self._pusher.connect() def _connect_handler(self, _): channel = self._pusher.subscribe('test') channel.bind('event', self._callback_handler) def _callback_handler(self, data): """Callback for when messages are recieved from pusher.""" try: data = json.loads(data) except ValueError: logging.error('Error parsing message', exc_info=sys.exc_info()) return self._queue.put(data) def events(self): while True: yield self._queue.get(block=True) <commit_msg>Make the script respond to ctrl-c<commit_after>
"""Pusher intergration for messages from the cloud.""" import json import logging import Queue import sys from common import creds from pusherclient import Pusher class PushRPC(object): """Wrapper for pusher integration.""" def __init__(self): self._queue = Queue.Queue() self._pusher = Pusher(creds.pusher_key) self._pusher.connection.bind('pusher:connection_established', self._connect_handler) self._pusher.connect() def _connect_handler(self, _): channel = self._pusher.subscribe('test') channel.bind('event', self._callback_handler) def _callback_handler(self, data): """Callback for when messages are recieved from pusher.""" try: data = json.loads(data) except ValueError: logging.error('Error parsing message', exc_info=sys.exc_info()) return self._queue.put(data) def events(self): while True: # if we specify a timeout, queues become keyboard interruptable try: yield self._queue.get(block=True, timeout=1000) except Queue.Empty: pass
"""Pusher intergration for messages from the cloud.""" import json import logging import Queue import sys from common import creds from pusherclient import Pusher class PushRPC(object): """Wrapper for pusher integration.""" def __init__(self): self._queue = Queue.Queue() self._pusher = Pusher(creds.pusher_key) self._pusher.connection.bind('pusher:connection_established', self._connect_handler) self._pusher.connect() def _connect_handler(self, _): channel = self._pusher.subscribe('test') channel.bind('event', self._callback_handler) def _callback_handler(self, data): """Callback for when messages are recieved from pusher.""" try: data = json.loads(data) except ValueError: logging.error('Error parsing message', exc_info=sys.exc_info()) return self._queue.put(data) def events(self): while True: yield self._queue.get(block=True) Make the script respond to ctrl-c"""Pusher intergration for messages from the cloud.""" import json import logging import Queue import sys from common import creds from pusherclient import Pusher class PushRPC(object): """Wrapper for pusher integration.""" def __init__(self): self._queue = Queue.Queue() self._pusher = Pusher(creds.pusher_key) self._pusher.connection.bind('pusher:connection_established', self._connect_handler) self._pusher.connect() def _connect_handler(self, _): channel = self._pusher.subscribe('test') channel.bind('event', self._callback_handler) def _callback_handler(self, data): """Callback for when messages are recieved from pusher.""" try: data = json.loads(data) except ValueError: logging.error('Error parsing message', exc_info=sys.exc_info()) return self._queue.put(data) def events(self): while True: # if we specify a timeout, queues become keyboard interruptable try: yield self._queue.get(block=True, timeout=1000) except Queue.Empty: pass
<commit_before>"""Pusher intergration for messages from the cloud.""" import json import logging import Queue import sys from common import creds from pusherclient import Pusher class PushRPC(object): """Wrapper for pusher integration.""" def __init__(self): self._queue = Queue.Queue() self._pusher = Pusher(creds.pusher_key) self._pusher.connection.bind('pusher:connection_established', self._connect_handler) self._pusher.connect() def _connect_handler(self, _): channel = self._pusher.subscribe('test') channel.bind('event', self._callback_handler) def _callback_handler(self, data): """Callback for when messages are recieved from pusher.""" try: data = json.loads(data) except ValueError: logging.error('Error parsing message', exc_info=sys.exc_info()) return self._queue.put(data) def events(self): while True: yield self._queue.get(block=True) <commit_msg>Make the script respond to ctrl-c<commit_after>"""Pusher intergration for messages from the cloud.""" import json import logging import Queue import sys from common import creds from pusherclient import Pusher class PushRPC(object): """Wrapper for pusher integration.""" def __init__(self): self._queue = Queue.Queue() self._pusher = Pusher(creds.pusher_key) self._pusher.connection.bind('pusher:connection_established', self._connect_handler) self._pusher.connect() def _connect_handler(self, _): channel = self._pusher.subscribe('test') channel.bind('event', self._callback_handler) def _callback_handler(self, data): """Callback for when messages are recieved from pusher.""" try: data = json.loads(data) except ValueError: logging.error('Error parsing message', exc_info=sys.exc_info()) return self._queue.put(data) def events(self): while True: # if we specify a timeout, queues become keyboard interruptable try: yield self._queue.get(block=True, timeout=1000) except Queue.Empty: pass
0f3cd463a2c6920cf4b727c01d0768fdb225acc4
rl-rc-car/sensor_server.py
rl-rc-car/sensor_server.py
""" This runs continuously and serves our sensor readings when requested. Base script from: http://ilab.cs.byu.edu/python/socket/echoserver.html """ import socket from sensors import Sensors class SensorServer: def __init__(self, host='', port=8888, size=1024, backlog=5): self.host = host self.port = port self.size = size self.backlog = backlog self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.s.bind((host, port)) self.s.listen(backlog) def serve_readings(self, sensors): client, address = self.s.accept() data = str(sensors.get_all_readings()) try: print("Sending: %s" % str(data)) client.send(data.encode(encoding='utf_8')) except: print("Couldn't send data.") client.close() if __name__ == '__main__': # Input pins. ir_pins = [24, 21] sonar_pins = [[25, 8]] # Get objects. sensors = Sensors(ir_pins, sonar_pins) ss = SensorServer() while 1: ss.serve_readings(sensors) sensors.cleanup_gpio()
""" This runs continuously and serves our sensor readings when requested. Base script from: http://ilab.cs.byu.edu/python/socket/echoserver.html """ import socket import json class SensorServer: def __init__(self, host='', port=8888, size=1024, backlog=5): self.host = host self.port = port self.size = size self.backlog = backlog self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.s.bind((host, port)) self.s.listen(backlog) def serve_readings(self): client, address = self.s.accept() with open('readings.json') as f: data = json.load(f) try: print("Sending: %s" % str(data)) client.send(data.encode(encoding='utf_8')) except: print("Couldn't send data.") client.close() if __name__ == '__main__': input("Start sensors.py in the background then hit enter to start server.") ss = SensorServer while 1: ss.serve_readings()
Update sensor server to grab from disk.
Update sensor server to grab from disk.
Python
mit
harvitronix/rl-rc-car
""" This runs continuously and serves our sensor readings when requested. Base script from: http://ilab.cs.byu.edu/python/socket/echoserver.html """ import socket from sensors import Sensors class SensorServer: def __init__(self, host='', port=8888, size=1024, backlog=5): self.host = host self.port = port self.size = size self.backlog = backlog self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.s.bind((host, port)) self.s.listen(backlog) def serve_readings(self, sensors): client, address = self.s.accept() data = str(sensors.get_all_readings()) try: print("Sending: %s" % str(data)) client.send(data.encode(encoding='utf_8')) except: print("Couldn't send data.") client.close() if __name__ == '__main__': # Input pins. ir_pins = [24, 21] sonar_pins = [[25, 8]] # Get objects. sensors = Sensors(ir_pins, sonar_pins) ss = SensorServer() while 1: ss.serve_readings(sensors) sensors.cleanup_gpio() Update sensor server to grab from disk.
""" This runs continuously and serves our sensor readings when requested. Base script from: http://ilab.cs.byu.edu/python/socket/echoserver.html """ import socket import json class SensorServer: def __init__(self, host='', port=8888, size=1024, backlog=5): self.host = host self.port = port self.size = size self.backlog = backlog self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.s.bind((host, port)) self.s.listen(backlog) def serve_readings(self): client, address = self.s.accept() with open('readings.json') as f: data = json.load(f) try: print("Sending: %s" % str(data)) client.send(data.encode(encoding='utf_8')) except: print("Couldn't send data.") client.close() if __name__ == '__main__': input("Start sensors.py in the background then hit enter to start server.") ss = SensorServer while 1: ss.serve_readings()
<commit_before>""" This runs continuously and serves our sensor readings when requested. Base script from: http://ilab.cs.byu.edu/python/socket/echoserver.html """ import socket from sensors import Sensors class SensorServer: def __init__(self, host='', port=8888, size=1024, backlog=5): self.host = host self.port = port self.size = size self.backlog = backlog self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.s.bind((host, port)) self.s.listen(backlog) def serve_readings(self, sensors): client, address = self.s.accept() data = str(sensors.get_all_readings()) try: print("Sending: %s" % str(data)) client.send(data.encode(encoding='utf_8')) except: print("Couldn't send data.") client.close() if __name__ == '__main__': # Input pins. ir_pins = [24, 21] sonar_pins = [[25, 8]] # Get objects. sensors = Sensors(ir_pins, sonar_pins) ss = SensorServer() while 1: ss.serve_readings(sensors) sensors.cleanup_gpio() <commit_msg>Update sensor server to grab from disk.<commit_after>
""" This runs continuously and serves our sensor readings when requested. Base script from: http://ilab.cs.byu.edu/python/socket/echoserver.html """ import socket import json class SensorServer: def __init__(self, host='', port=8888, size=1024, backlog=5): self.host = host self.port = port self.size = size self.backlog = backlog self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.s.bind((host, port)) self.s.listen(backlog) def serve_readings(self): client, address = self.s.accept() with open('readings.json') as f: data = json.load(f) try: print("Sending: %s" % str(data)) client.send(data.encode(encoding='utf_8')) except: print("Couldn't send data.") client.close() if __name__ == '__main__': input("Start sensors.py in the background then hit enter to start server.") ss = SensorServer while 1: ss.serve_readings()
""" This runs continuously and serves our sensor readings when requested. Base script from: http://ilab.cs.byu.edu/python/socket/echoserver.html """ import socket from sensors import Sensors class SensorServer: def __init__(self, host='', port=8888, size=1024, backlog=5): self.host = host self.port = port self.size = size self.backlog = backlog self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.s.bind((host, port)) self.s.listen(backlog) def serve_readings(self, sensors): client, address = self.s.accept() data = str(sensors.get_all_readings()) try: print("Sending: %s" % str(data)) client.send(data.encode(encoding='utf_8')) except: print("Couldn't send data.") client.close() if __name__ == '__main__': # Input pins. ir_pins = [24, 21] sonar_pins = [[25, 8]] # Get objects. sensors = Sensors(ir_pins, sonar_pins) ss = SensorServer() while 1: ss.serve_readings(sensors) sensors.cleanup_gpio() Update sensor server to grab from disk.""" This runs continuously and serves our sensor readings when requested. Base script from: http://ilab.cs.byu.edu/python/socket/echoserver.html """ import socket import json class SensorServer: def __init__(self, host='', port=8888, size=1024, backlog=5): self.host = host self.port = port self.size = size self.backlog = backlog self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.s.bind((host, port)) self.s.listen(backlog) def serve_readings(self): client, address = self.s.accept() with open('readings.json') as f: data = json.load(f) try: print("Sending: %s" % str(data)) client.send(data.encode(encoding='utf_8')) except: print("Couldn't send data.") client.close() if __name__ == '__main__': input("Start sensors.py in the background then hit enter to start server.") ss = SensorServer while 1: ss.serve_readings()
<commit_before>""" This runs continuously and serves our sensor readings when requested. Base script from: http://ilab.cs.byu.edu/python/socket/echoserver.html """ import socket from sensors import Sensors class SensorServer: def __init__(self, host='', port=8888, size=1024, backlog=5): self.host = host self.port = port self.size = size self.backlog = backlog self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.s.bind((host, port)) self.s.listen(backlog) def serve_readings(self, sensors): client, address = self.s.accept() data = str(sensors.get_all_readings()) try: print("Sending: %s" % str(data)) client.send(data.encode(encoding='utf_8')) except: print("Couldn't send data.") client.close() if __name__ == '__main__': # Input pins. ir_pins = [24, 21] sonar_pins = [[25, 8]] # Get objects. sensors = Sensors(ir_pins, sonar_pins) ss = SensorServer() while 1: ss.serve_readings(sensors) sensors.cleanup_gpio() <commit_msg>Update sensor server to grab from disk.<commit_after>""" This runs continuously and serves our sensor readings when requested. Base script from: http://ilab.cs.byu.edu/python/socket/echoserver.html """ import socket import json class SensorServer: def __init__(self, host='', port=8888, size=1024, backlog=5): self.host = host self.port = port self.size = size self.backlog = backlog self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.s.bind((host, port)) self.s.listen(backlog) def serve_readings(self): client, address = self.s.accept() with open('readings.json') as f: data = json.load(f) try: print("Sending: %s" % str(data)) client.send(data.encode(encoding='utf_8')) except: print("Couldn't send data.") client.close() if __name__ == '__main__': input("Start sensors.py in the background then hit enter to start server.") ss = SensorServer while 1: ss.serve_readings()
2007c7190f95a2656715e99af7ca632bbb98b313
linkatos/firebase.py
linkatos/firebase.py
import pyrebase def initialise(api_key, project_name): config = { "apiKey": api_key, "authDomain": "{}.firebaseapp.com".format(project_name), "databaseURL": "https://{}.firebaseio.com".format(project_name), "storageBucket": "{}.appspot.com".format(project_name), } return pyrebase.initialize_app(config) def authenticate_user(username, password, auth): user = auth.sign_in_with_email_and_password(username, password) return user def get_db(firebase): return firebase.database() def get_token(user): return user['idToken'] def store_url(url, db, token): return db.child("users").push(to_data(url), token) def get_auth(firebase): return firebase.auth() def to_data(url): return {"url": url} def connect_to_fb_and_store_url(url, username, password, firebase): # the function should only be called if we need to store the url auth = get_auth(firebase) user = authenticate_user(username, password, auth) token = get_token(user) data = to_data(url) db = get_db(firebase) store_url(url, db, token)
import pyrebase def initialise(api_key, project_name): config = { "apiKey": api_key, "authDomain": "{}.firebaseapp.com".format(project_name), "databaseURL": "https://{}.firebaseio.com".format(project_name), "storageBucket": "{}.appspot.com".format(project_name), } return pyrebase.initialize_app(config) def authenticate(username, password, auth): user = auth.sign_in_with_email_and_password(username, password) return user def get_token(user): return user['idToken'] def store_url(url, db, token): return db.child("users").push(to_data(url), token) def to_data(url): return {"url": url} def connect_to_fb_and_store_url(url, username, password, firebase): # the function should only be called if we need to store the url auth = firebase.auth() user = authenticate(username, password, auth) token = get_token(user) db = firebase.database() store_url(url, db, token)
Change based on PR comments
refactor: Change based on PR comments
Python
mit
iwi/linkatos,iwi/linkatos
import pyrebase def initialise(api_key, project_name): config = { "apiKey": api_key, "authDomain": "{}.firebaseapp.com".format(project_name), "databaseURL": "https://{}.firebaseio.com".format(project_name), "storageBucket": "{}.appspot.com".format(project_name), } return pyrebase.initialize_app(config) def authenticate_user(username, password, auth): user = auth.sign_in_with_email_and_password(username, password) return user def get_db(firebase): return firebase.database() def get_token(user): return user['idToken'] def store_url(url, db, token): return db.child("users").push(to_data(url), token) def get_auth(firebase): return firebase.auth() def to_data(url): return {"url": url} def connect_to_fb_and_store_url(url, username, password, firebase): # the function should only be called if we need to store the url auth = get_auth(firebase) user = authenticate_user(username, password, auth) token = get_token(user) data = to_data(url) db = get_db(firebase) store_url(url, db, token) refactor: Change based on PR comments
import pyrebase def initialise(api_key, project_name): config = { "apiKey": api_key, "authDomain": "{}.firebaseapp.com".format(project_name), "databaseURL": "https://{}.firebaseio.com".format(project_name), "storageBucket": "{}.appspot.com".format(project_name), } return pyrebase.initialize_app(config) def authenticate(username, password, auth): user = auth.sign_in_with_email_and_password(username, password) return user def get_token(user): return user['idToken'] def store_url(url, db, token): return db.child("users").push(to_data(url), token) def to_data(url): return {"url": url} def connect_to_fb_and_store_url(url, username, password, firebase): # the function should only be called if we need to store the url auth = firebase.auth() user = authenticate(username, password, auth) token = get_token(user) db = firebase.database() store_url(url, db, token)
<commit_before>import pyrebase def initialise(api_key, project_name): config = { "apiKey": api_key, "authDomain": "{}.firebaseapp.com".format(project_name), "databaseURL": "https://{}.firebaseio.com".format(project_name), "storageBucket": "{}.appspot.com".format(project_name), } return pyrebase.initialize_app(config) def authenticate_user(username, password, auth): user = auth.sign_in_with_email_and_password(username, password) return user def get_db(firebase): return firebase.database() def get_token(user): return user['idToken'] def store_url(url, db, token): return db.child("users").push(to_data(url), token) def get_auth(firebase): return firebase.auth() def to_data(url): return {"url": url} def connect_to_fb_and_store_url(url, username, password, firebase): # the function should only be called if we need to store the url auth = get_auth(firebase) user = authenticate_user(username, password, auth) token = get_token(user) data = to_data(url) db = get_db(firebase) store_url(url, db, token) <commit_msg>refactor: Change based on PR comments<commit_after>
import pyrebase def initialise(api_key, project_name): config = { "apiKey": api_key, "authDomain": "{}.firebaseapp.com".format(project_name), "databaseURL": "https://{}.firebaseio.com".format(project_name), "storageBucket": "{}.appspot.com".format(project_name), } return pyrebase.initialize_app(config) def authenticate(username, password, auth): user = auth.sign_in_with_email_and_password(username, password) return user def get_token(user): return user['idToken'] def store_url(url, db, token): return db.child("users").push(to_data(url), token) def to_data(url): return {"url": url} def connect_to_fb_and_store_url(url, username, password, firebase): # the function should only be called if we need to store the url auth = firebase.auth() user = authenticate(username, password, auth) token = get_token(user) db = firebase.database() store_url(url, db, token)
import pyrebase def initialise(api_key, project_name): config = { "apiKey": api_key, "authDomain": "{}.firebaseapp.com".format(project_name), "databaseURL": "https://{}.firebaseio.com".format(project_name), "storageBucket": "{}.appspot.com".format(project_name), } return pyrebase.initialize_app(config) def authenticate_user(username, password, auth): user = auth.sign_in_with_email_and_password(username, password) return user def get_db(firebase): return firebase.database() def get_token(user): return user['idToken'] def store_url(url, db, token): return db.child("users").push(to_data(url), token) def get_auth(firebase): return firebase.auth() def to_data(url): return {"url": url} def connect_to_fb_and_store_url(url, username, password, firebase): # the function should only be called if we need to store the url auth = get_auth(firebase) user = authenticate_user(username, password, auth) token = get_token(user) data = to_data(url) db = get_db(firebase) store_url(url, db, token) refactor: Change based on PR commentsimport pyrebase def initialise(api_key, project_name): config = { "apiKey": api_key, "authDomain": "{}.firebaseapp.com".format(project_name), "databaseURL": "https://{}.firebaseio.com".format(project_name), "storageBucket": "{}.appspot.com".format(project_name), } return pyrebase.initialize_app(config) def authenticate(username, password, auth): user = auth.sign_in_with_email_and_password(username, password) return user def get_token(user): return user['idToken'] def store_url(url, db, token): return db.child("users").push(to_data(url), token) def to_data(url): return {"url": url} def connect_to_fb_and_store_url(url, username, password, firebase): # the function should only be called if we need to store the url auth = firebase.auth() user = authenticate(username, password, auth) token = get_token(user) db = firebase.database() store_url(url, db, token)
<commit_before>import pyrebase def initialise(api_key, project_name): config = { "apiKey": api_key, "authDomain": "{}.firebaseapp.com".format(project_name), "databaseURL": "https://{}.firebaseio.com".format(project_name), "storageBucket": "{}.appspot.com".format(project_name), } return pyrebase.initialize_app(config) def authenticate_user(username, password, auth): user = auth.sign_in_with_email_and_password(username, password) return user def get_db(firebase): return firebase.database() def get_token(user): return user['idToken'] def store_url(url, db, token): return db.child("users").push(to_data(url), token) def get_auth(firebase): return firebase.auth() def to_data(url): return {"url": url} def connect_to_fb_and_store_url(url, username, password, firebase): # the function should only be called if we need to store the url auth = get_auth(firebase) user = authenticate_user(username, password, auth) token = get_token(user) data = to_data(url) db = get_db(firebase) store_url(url, db, token) <commit_msg>refactor: Change based on PR comments<commit_after>import pyrebase def initialise(api_key, project_name): config = { "apiKey": api_key, "authDomain": "{}.firebaseapp.com".format(project_name), "databaseURL": "https://{}.firebaseio.com".format(project_name), "storageBucket": "{}.appspot.com".format(project_name), } return pyrebase.initialize_app(config) def authenticate(username, password, auth): user = auth.sign_in_with_email_and_password(username, password) return user def get_token(user): return user['idToken'] def store_url(url, db, token): return db.child("users").push(to_data(url), token) def to_data(url): return {"url": url} def connect_to_fb_and_store_url(url, username, password, firebase): # the function should only be called if we need to store the url auth = firebase.auth() user = authenticate(username, password, auth) token = get_token(user) db = firebase.database() store_url(url, db, token)
abc25f1c510e4792b2de324d12e2fc639e795378
src/AmpliconAnalysisTyping.py
src/AmpliconAnalysisTyping.py
#! /usr/bin/env python from pbhla.typing.sequences import type_sequences if __name__ == '__main__': import argparse parser = argparse.ArgumentParser() add = parser.add_argument add('amplicon_analysis', metavar='INPUT', help="Fasta/Fastq/Folder of Amplicon Analysis output") add('-g', '--grouping', metavar='METHOD', default='all', help="BasH5 or FOFN of sequence data") add('-e', '--exon_reference', metavar='REFERENCE', default=None, help='Dictionary file of Locus-specific exon references') add('-n', '--nucleotide_reference', metavar='FASTA', default=None, help='File of FASTA sequences from nucleotide references') add('-c', '--cDNA_reference', metavar='FASTA', default=None, help='File of FASTA sequences from cDNA references') add('--debug', action='store_true', help="Flag to enable Debug mode") args = parser.parse_args() type_sequences( args.amplicon_analysis, args.grouping, args.exon_reference, args.nucleotide_reference, args.cDNA_reference )
#! /usr/bin/env python from pbhla.typing.sequences import type_sequences if __name__ == '__main__': import argparse parser = argparse.ArgumentParser() add = parser.add_argument add('amplicon_analysis', metavar='INPUT', help="Fasta/Fastq/Folder of Amplicon Analysis output") add('-g', '--grouping', metavar='METHOD', default='both', help="Method of selecting output sequences {locus, barcode, both, all} default=both") add('-e', '--exon_reference', metavar='REFERENCE', default=None, help='Dictionary file of Locus-specific exon references') add('-n', '--nucleotide_reference', metavar='FASTA', default=None, help='File of FASTA sequences from nucleotide references') add('-c', '--cDNA_reference', metavar='FASTA', default=None, help='File of FASTA sequences from cDNA references') add('--debug', action='store_true', help="Flag to enable Debug mode") args = parser.parse_args() type_sequences( args.amplicon_analysis, args.grouping, args.exon_reference, args.nucleotide_reference, args.cDNA_reference )
Fix default of grouping option for AAT
Fix default of grouping option for AAT
Python
bsd-3-clause
bnbowman/HlaTools
#! /usr/bin/env python from pbhla.typing.sequences import type_sequences if __name__ == '__main__': import argparse parser = argparse.ArgumentParser() add = parser.add_argument add('amplicon_analysis', metavar='INPUT', help="Fasta/Fastq/Folder of Amplicon Analysis output") add('-g', '--grouping', metavar='METHOD', default='all', help="BasH5 or FOFN of sequence data") add('-e', '--exon_reference', metavar='REFERENCE', default=None, help='Dictionary file of Locus-specific exon references') add('-n', '--nucleotide_reference', metavar='FASTA', default=None, help='File of FASTA sequences from nucleotide references') add('-c', '--cDNA_reference', metavar='FASTA', default=None, help='File of FASTA sequences from cDNA references') add('--debug', action='store_true', help="Flag to enable Debug mode") args = parser.parse_args() type_sequences( args.amplicon_analysis, args.grouping, args.exon_reference, args.nucleotide_reference, args.cDNA_reference ) Fix default of grouping option for AAT
#! /usr/bin/env python from pbhla.typing.sequences import type_sequences if __name__ == '__main__': import argparse parser = argparse.ArgumentParser() add = parser.add_argument add('amplicon_analysis', metavar='INPUT', help="Fasta/Fastq/Folder of Amplicon Analysis output") add('-g', '--grouping', metavar='METHOD', default='both', help="Method of selecting output sequences {locus, barcode, both, all} default=both") add('-e', '--exon_reference', metavar='REFERENCE', default=None, help='Dictionary file of Locus-specific exon references') add('-n', '--nucleotide_reference', metavar='FASTA', default=None, help='File of FASTA sequences from nucleotide references') add('-c', '--cDNA_reference', metavar='FASTA', default=None, help='File of FASTA sequences from cDNA references') add('--debug', action='store_true', help="Flag to enable Debug mode") args = parser.parse_args() type_sequences( args.amplicon_analysis, args.grouping, args.exon_reference, args.nucleotide_reference, args.cDNA_reference )
<commit_before>#! /usr/bin/env python from pbhla.typing.sequences import type_sequences if __name__ == '__main__': import argparse parser = argparse.ArgumentParser() add = parser.add_argument add('amplicon_analysis', metavar='INPUT', help="Fasta/Fastq/Folder of Amplicon Analysis output") add('-g', '--grouping', metavar='METHOD', default='all', help="BasH5 or FOFN of sequence data") add('-e', '--exon_reference', metavar='REFERENCE', default=None, help='Dictionary file of Locus-specific exon references') add('-n', '--nucleotide_reference', metavar='FASTA', default=None, help='File of FASTA sequences from nucleotide references') add('-c', '--cDNA_reference', metavar='FASTA', default=None, help='File of FASTA sequences from cDNA references') add('--debug', action='store_true', help="Flag to enable Debug mode") args = parser.parse_args() type_sequences( args.amplicon_analysis, args.grouping, args.exon_reference, args.nucleotide_reference, args.cDNA_reference ) <commit_msg>Fix default of grouping option for AAT<commit_after>
#! /usr/bin/env python from pbhla.typing.sequences import type_sequences if __name__ == '__main__': import argparse parser = argparse.ArgumentParser() add = parser.add_argument add('amplicon_analysis', metavar='INPUT', help="Fasta/Fastq/Folder of Amplicon Analysis output") add('-g', '--grouping', metavar='METHOD', default='both', help="Method of selecting output sequences {locus, barcode, both, all} default=both") add('-e', '--exon_reference', metavar='REFERENCE', default=None, help='Dictionary file of Locus-specific exon references') add('-n', '--nucleotide_reference', metavar='FASTA', default=None, help='File of FASTA sequences from nucleotide references') add('-c', '--cDNA_reference', metavar='FASTA', default=None, help='File of FASTA sequences from cDNA references') add('--debug', action='store_true', help="Flag to enable Debug mode") args = parser.parse_args() type_sequences( args.amplicon_analysis, args.grouping, args.exon_reference, args.nucleotide_reference, args.cDNA_reference )
#! /usr/bin/env python from pbhla.typing.sequences import type_sequences if __name__ == '__main__': import argparse parser = argparse.ArgumentParser() add = parser.add_argument add('amplicon_analysis', metavar='INPUT', help="Fasta/Fastq/Folder of Amplicon Analysis output") add('-g', '--grouping', metavar='METHOD', default='all', help="BasH5 or FOFN of sequence data") add('-e', '--exon_reference', metavar='REFERENCE', default=None, help='Dictionary file of Locus-specific exon references') add('-n', '--nucleotide_reference', metavar='FASTA', default=None, help='File of FASTA sequences from nucleotide references') add('-c', '--cDNA_reference', metavar='FASTA', default=None, help='File of FASTA sequences from cDNA references') add('--debug', action='store_true', help="Flag to enable Debug mode") args = parser.parse_args() type_sequences( args.amplicon_analysis, args.grouping, args.exon_reference, args.nucleotide_reference, args.cDNA_reference ) Fix default of grouping option for AAT#! /usr/bin/env python from pbhla.typing.sequences import type_sequences if __name__ == '__main__': import argparse parser = argparse.ArgumentParser() add = parser.add_argument add('amplicon_analysis', metavar='INPUT', help="Fasta/Fastq/Folder of Amplicon Analysis output") add('-g', '--grouping', metavar='METHOD', default='both', help="Method of selecting output sequences {locus, barcode, both, all} default=both") add('-e', '--exon_reference', metavar='REFERENCE', default=None, help='Dictionary file of Locus-specific exon references') add('-n', '--nucleotide_reference', metavar='FASTA', default=None, help='File of FASTA sequences from nucleotide references') add('-c', '--cDNA_reference', metavar='FASTA', default=None, help='File of FASTA sequences from cDNA references') add('--debug', action='store_true', help="Flag to enable Debug mode") args = parser.parse_args() type_sequences( args.amplicon_analysis, args.grouping, args.exon_reference, args.nucleotide_reference, args.cDNA_reference )
<commit_before>#! /usr/bin/env python from pbhla.typing.sequences import type_sequences if __name__ == '__main__': import argparse parser = argparse.ArgumentParser() add = parser.add_argument add('amplicon_analysis', metavar='INPUT', help="Fasta/Fastq/Folder of Amplicon Analysis output") add('-g', '--grouping', metavar='METHOD', default='all', help="BasH5 or FOFN of sequence data") add('-e', '--exon_reference', metavar='REFERENCE', default=None, help='Dictionary file of Locus-specific exon references') add('-n', '--nucleotide_reference', metavar='FASTA', default=None, help='File of FASTA sequences from nucleotide references') add('-c', '--cDNA_reference', metavar='FASTA', default=None, help='File of FASTA sequences from cDNA references') add('--debug', action='store_true', help="Flag to enable Debug mode") args = parser.parse_args() type_sequences( args.amplicon_analysis, args.grouping, args.exon_reference, args.nucleotide_reference, args.cDNA_reference ) <commit_msg>Fix default of grouping option for AAT<commit_after>#! /usr/bin/env python from pbhla.typing.sequences import type_sequences if __name__ == '__main__': import argparse parser = argparse.ArgumentParser() add = parser.add_argument add('amplicon_analysis', metavar='INPUT', help="Fasta/Fastq/Folder of Amplicon Analysis output") add('-g', '--grouping', metavar='METHOD', default='both', help="Method of selecting output sequences {locus, barcode, both, all} default=both") add('-e', '--exon_reference', metavar='REFERENCE', default=None, help='Dictionary file of Locus-specific exon references') add('-n', '--nucleotide_reference', metavar='FASTA', default=None, help='File of FASTA sequences from nucleotide references') add('-c', '--cDNA_reference', metavar='FASTA', default=None, help='File of FASTA sequences from cDNA references') add('--debug', action='store_true', help="Flag to enable Debug mode") args = parser.parse_args() type_sequences( args.amplicon_analysis, args.grouping, args.exon_reference, args.nucleotide_reference, args.cDNA_reference )
9876500ca8a897489e40c1b4e0c6379e18f9e985
corehq/apps/userreports/transforms/custom/numeric.py
corehq/apps/userreports/transforms/custom/numeric.py
def get_short_decimal_display(num): return round(num, 2)
def get_short_decimal_display(num): try: return round(num, 2) except: return num
Return num if rounding fails
Return num if rounding fails
Python
bsd-3-clause
qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq
def get_short_decimal_display(num): return round(num, 2) Return num if rounding fails
def get_short_decimal_display(num): try: return round(num, 2) except: return num
<commit_before>def get_short_decimal_display(num): return round(num, 2) <commit_msg>Return num if rounding fails<commit_after>
def get_short_decimal_display(num): try: return round(num, 2) except: return num
def get_short_decimal_display(num): return round(num, 2) Return num if rounding failsdef get_short_decimal_display(num): try: return round(num, 2) except: return num
<commit_before>def get_short_decimal_display(num): return round(num, 2) <commit_msg>Return num if rounding fails<commit_after>def get_short_decimal_display(num): try: return round(num, 2) except: return num
75a598e2b9cf237448cd1b1934d3d58d093808ec
server/scraper/util.py
server/scraper/util.py
import os import re import sys import json def parse_money(moneystring): # Sometimes 0 is O :( moneystring = moneystring.replace("O", "0") return re.sub("[^0-9,]", "", str(moneystring)).replace(',', '.') def stderr_print(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) def write_json_to_file(obj, path): """ Write an object to JSON at the specified path. """ directory = os.path.dirname(path) os.makedirs(directory, exist_ok=True) with open(path, mode='w') as f: json.dump(obj, f, sort_keys=True) def split_price(meal): price = meal.split('-')[-1].strip() name = '-'.join(meal.split('-')[:-1]).strip() return name, price
import os import re import sys import json def parse_money(moneystring): # Sometimes 0 is O :( moneystring = moneystring.replace("O", "0") return re.sub("[^0-9,]", "", str(moneystring)).replace(',', '.') def stderr_print(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) def write_json_to_file(obj, path): """ Write an object to JSON at the specified path. """ directory = os.path.dirname(path) os.makedirs(directory, exist_ok=True) with open(path, mode='w') as f: json.dump(obj, f, sort_keys=True) def split_price(meal): if "-" in meal: price = meal.split('-')[-1].strip() name = '-'.join(meal.split('-')[:-1]).strip() return name, price else: return meal.strip(), ""
Fix price in de brug
Fix price in de brug
Python
mit
ZeusWPI/hydra,ZeusWPI/hydra,ZeusWPI/hydra
import os import re import sys import json def parse_money(moneystring): # Sometimes 0 is O :( moneystring = moneystring.replace("O", "0") return re.sub("[^0-9,]", "", str(moneystring)).replace(',', '.') def stderr_print(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) def write_json_to_file(obj, path): """ Write an object to JSON at the specified path. """ directory = os.path.dirname(path) os.makedirs(directory, exist_ok=True) with open(path, mode='w') as f: json.dump(obj, f, sort_keys=True) def split_price(meal): price = meal.split('-')[-1].strip() name = '-'.join(meal.split('-')[:-1]).strip() return name, price Fix price in de brug
import os import re import sys import json def parse_money(moneystring): # Sometimes 0 is O :( moneystring = moneystring.replace("O", "0") return re.sub("[^0-9,]", "", str(moneystring)).replace(',', '.') def stderr_print(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) def write_json_to_file(obj, path): """ Write an object to JSON at the specified path. """ directory = os.path.dirname(path) os.makedirs(directory, exist_ok=True) with open(path, mode='w') as f: json.dump(obj, f, sort_keys=True) def split_price(meal): if "-" in meal: price = meal.split('-')[-1].strip() name = '-'.join(meal.split('-')[:-1]).strip() return name, price else: return meal.strip(), ""
<commit_before>import os import re import sys import json def parse_money(moneystring): # Sometimes 0 is O :( moneystring = moneystring.replace("O", "0") return re.sub("[^0-9,]", "", str(moneystring)).replace(',', '.') def stderr_print(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) def write_json_to_file(obj, path): """ Write an object to JSON at the specified path. """ directory = os.path.dirname(path) os.makedirs(directory, exist_ok=True) with open(path, mode='w') as f: json.dump(obj, f, sort_keys=True) def split_price(meal): price = meal.split('-')[-1].strip() name = '-'.join(meal.split('-')[:-1]).strip() return name, price <commit_msg>Fix price in de brug<commit_after>
import os import re import sys import json def parse_money(moneystring): # Sometimes 0 is O :( moneystring = moneystring.replace("O", "0") return re.sub("[^0-9,]", "", str(moneystring)).replace(',', '.') def stderr_print(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) def write_json_to_file(obj, path): """ Write an object to JSON at the specified path. """ directory = os.path.dirname(path) os.makedirs(directory, exist_ok=True) with open(path, mode='w') as f: json.dump(obj, f, sort_keys=True) def split_price(meal): if "-" in meal: price = meal.split('-')[-1].strip() name = '-'.join(meal.split('-')[:-1]).strip() return name, price else: return meal.strip(), ""
import os import re import sys import json def parse_money(moneystring): # Sometimes 0 is O :( moneystring = moneystring.replace("O", "0") return re.sub("[^0-9,]", "", str(moneystring)).replace(',', '.') def stderr_print(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) def write_json_to_file(obj, path): """ Write an object to JSON at the specified path. """ directory = os.path.dirname(path) os.makedirs(directory, exist_ok=True) with open(path, mode='w') as f: json.dump(obj, f, sort_keys=True) def split_price(meal): price = meal.split('-')[-1].strip() name = '-'.join(meal.split('-')[:-1]).strip() return name, price Fix price in de brugimport os import re import sys import json def parse_money(moneystring): # Sometimes 0 is O :( moneystring = moneystring.replace("O", "0") return re.sub("[^0-9,]", "", str(moneystring)).replace(',', '.') def stderr_print(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) def write_json_to_file(obj, path): """ Write an object to JSON at the specified path. """ directory = os.path.dirname(path) os.makedirs(directory, exist_ok=True) with open(path, mode='w') as f: json.dump(obj, f, sort_keys=True) def split_price(meal): if "-" in meal: price = meal.split('-')[-1].strip() name = '-'.join(meal.split('-')[:-1]).strip() return name, price else: return meal.strip(), ""
<commit_before>import os import re import sys import json def parse_money(moneystring): # Sometimes 0 is O :( moneystring = moneystring.replace("O", "0") return re.sub("[^0-9,]", "", str(moneystring)).replace(',', '.') def stderr_print(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) def write_json_to_file(obj, path): """ Write an object to JSON at the specified path. """ directory = os.path.dirname(path) os.makedirs(directory, exist_ok=True) with open(path, mode='w') as f: json.dump(obj, f, sort_keys=True) def split_price(meal): price = meal.split('-')[-1].strip() name = '-'.join(meal.split('-')[:-1]).strip() return name, price <commit_msg>Fix price in de brug<commit_after>import os import re import sys import json def parse_money(moneystring): # Sometimes 0 is O :( moneystring = moneystring.replace("O", "0") return re.sub("[^0-9,]", "", str(moneystring)).replace(',', '.') def stderr_print(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) def write_json_to_file(obj, path): """ Write an object to JSON at the specified path. """ directory = os.path.dirname(path) os.makedirs(directory, exist_ok=True) with open(path, mode='w') as f: json.dump(obj, f, sort_keys=True) def split_price(meal): if "-" in meal: price = meal.split('-')[-1].strip() name = '-'.join(meal.split('-')[:-1]).strip() return name, price else: return meal.strip(), ""
85612f6c512ae5769465050563c4ff0d3d2e7a2b
docs/source/conf.py
docs/source/conf.py
# -*- coding: utf-8 -*- import sphinx_rtd_theme extensions = [ # 'sphinx.ext.autodoc', # 'sphinx.ext.intersphinx', # 'sphinx.ext.autosummary', # 'sphinx.ext.viewcode', # 'sphinx.ext.napoleon', # 'jupyter_sphinx.embed_widgets', ] templates_path = ['_templates'] def setup(app): app.add_javascript("https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js") app.add_javascript("https://unpkg.com/@jupyter-widgets/html-manager@0.15.0/dist/embed-amd.js") app.add_stylesheet("main_stylesheet.css") master_doc = 'index' source_suffix = '.rst' # General information about the project. project = 'ipyleaflet' copyright = '(c) Jupyter Development Team' author = 'Jupyter Development Team' exclude_patterns = [] highlight_language = 'python' pygments_style = 'sphinx' # Output file base name for HTML help builder. html_theme = "sphinx_rtd_theme" html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] htmlhelp_basename = 'ipyleafletdoc' html_static_path = ['_static']
# -*- coding: utf-8 -*- import sphinx_rtd_theme extensions = [ # 'sphinx.ext.autodoc', # 'sphinx.ext.intersphinx', # 'sphinx.ext.autosummary', # 'sphinx.ext.viewcode', # 'sphinx.ext.napoleon', # 'jupyter_sphinx.embed_widgets', ] templates_path = ['_templates'] def setup(app): app.add_javascript("https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js") app.add_javascript("https://unpkg.com/@jupyter-widgets/html-manager@0.18.4/dist/embed-amd.js") app.add_stylesheet("main_stylesheet.css") master_doc = 'index' source_suffix = '.rst' # General information about the project. project = 'ipyleaflet' copyright = '(c) Jupyter Development Team' author = 'Jupyter Development Team' exclude_patterns = [] highlight_language = 'python' pygments_style = 'sphinx' # Output file base name for HTML help builder. html_theme = "sphinx_rtd_theme" html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] htmlhelp_basename = 'ipyleafletdoc' html_static_path = ['_static']
Update HTMLManager in the documentation
Update HTMLManager in the documentation Signed-off-by: martinRenou <a8278cece597ec79cc59974d3d55dbb79bb38416@gmail.com>
Python
mit
ellisonbg/leafletwidget,ellisonbg/leafletwidget
# -*- coding: utf-8 -*- import sphinx_rtd_theme extensions = [ # 'sphinx.ext.autodoc', # 'sphinx.ext.intersphinx', # 'sphinx.ext.autosummary', # 'sphinx.ext.viewcode', # 'sphinx.ext.napoleon', # 'jupyter_sphinx.embed_widgets', ] templates_path = ['_templates'] def setup(app): app.add_javascript("https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js") app.add_javascript("https://unpkg.com/@jupyter-widgets/html-manager@0.15.0/dist/embed-amd.js") app.add_stylesheet("main_stylesheet.css") master_doc = 'index' source_suffix = '.rst' # General information about the project. project = 'ipyleaflet' copyright = '(c) Jupyter Development Team' author = 'Jupyter Development Team' exclude_patterns = [] highlight_language = 'python' pygments_style = 'sphinx' # Output file base name for HTML help builder. html_theme = "sphinx_rtd_theme" html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] htmlhelp_basename = 'ipyleafletdoc' html_static_path = ['_static'] Update HTMLManager in the documentation Signed-off-by: martinRenou <a8278cece597ec79cc59974d3d55dbb79bb38416@gmail.com>
# -*- coding: utf-8 -*- import sphinx_rtd_theme extensions = [ # 'sphinx.ext.autodoc', # 'sphinx.ext.intersphinx', # 'sphinx.ext.autosummary', # 'sphinx.ext.viewcode', # 'sphinx.ext.napoleon', # 'jupyter_sphinx.embed_widgets', ] templates_path = ['_templates'] def setup(app): app.add_javascript("https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js") app.add_javascript("https://unpkg.com/@jupyter-widgets/html-manager@0.18.4/dist/embed-amd.js") app.add_stylesheet("main_stylesheet.css") master_doc = 'index' source_suffix = '.rst' # General information about the project. project = 'ipyleaflet' copyright = '(c) Jupyter Development Team' author = 'Jupyter Development Team' exclude_patterns = [] highlight_language = 'python' pygments_style = 'sphinx' # Output file base name for HTML help builder. html_theme = "sphinx_rtd_theme" html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] htmlhelp_basename = 'ipyleafletdoc' html_static_path = ['_static']
<commit_before># -*- coding: utf-8 -*- import sphinx_rtd_theme extensions = [ # 'sphinx.ext.autodoc', # 'sphinx.ext.intersphinx', # 'sphinx.ext.autosummary', # 'sphinx.ext.viewcode', # 'sphinx.ext.napoleon', # 'jupyter_sphinx.embed_widgets', ] templates_path = ['_templates'] def setup(app): app.add_javascript("https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js") app.add_javascript("https://unpkg.com/@jupyter-widgets/html-manager@0.15.0/dist/embed-amd.js") app.add_stylesheet("main_stylesheet.css") master_doc = 'index' source_suffix = '.rst' # General information about the project. project = 'ipyleaflet' copyright = '(c) Jupyter Development Team' author = 'Jupyter Development Team' exclude_patterns = [] highlight_language = 'python' pygments_style = 'sphinx' # Output file base name for HTML help builder. html_theme = "sphinx_rtd_theme" html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] htmlhelp_basename = 'ipyleafletdoc' html_static_path = ['_static'] <commit_msg>Update HTMLManager in the documentation Signed-off-by: martinRenou <a8278cece597ec79cc59974d3d55dbb79bb38416@gmail.com><commit_after>
# -*- coding: utf-8 -*- import sphinx_rtd_theme extensions = [ # 'sphinx.ext.autodoc', # 'sphinx.ext.intersphinx', # 'sphinx.ext.autosummary', # 'sphinx.ext.viewcode', # 'sphinx.ext.napoleon', # 'jupyter_sphinx.embed_widgets', ] templates_path = ['_templates'] def setup(app): app.add_javascript("https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js") app.add_javascript("https://unpkg.com/@jupyter-widgets/html-manager@0.18.4/dist/embed-amd.js") app.add_stylesheet("main_stylesheet.css") master_doc = 'index' source_suffix = '.rst' # General information about the project. project = 'ipyleaflet' copyright = '(c) Jupyter Development Team' author = 'Jupyter Development Team' exclude_patterns = [] highlight_language = 'python' pygments_style = 'sphinx' # Output file base name for HTML help builder. html_theme = "sphinx_rtd_theme" html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] htmlhelp_basename = 'ipyleafletdoc' html_static_path = ['_static']
# -*- coding: utf-8 -*- import sphinx_rtd_theme extensions = [ # 'sphinx.ext.autodoc', # 'sphinx.ext.intersphinx', # 'sphinx.ext.autosummary', # 'sphinx.ext.viewcode', # 'sphinx.ext.napoleon', # 'jupyter_sphinx.embed_widgets', ] templates_path = ['_templates'] def setup(app): app.add_javascript("https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js") app.add_javascript("https://unpkg.com/@jupyter-widgets/html-manager@0.15.0/dist/embed-amd.js") app.add_stylesheet("main_stylesheet.css") master_doc = 'index' source_suffix = '.rst' # General information about the project. project = 'ipyleaflet' copyright = '(c) Jupyter Development Team' author = 'Jupyter Development Team' exclude_patterns = [] highlight_language = 'python' pygments_style = 'sphinx' # Output file base name for HTML help builder. html_theme = "sphinx_rtd_theme" html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] htmlhelp_basename = 'ipyleafletdoc' html_static_path = ['_static'] Update HTMLManager in the documentation Signed-off-by: martinRenou <a8278cece597ec79cc59974d3d55dbb79bb38416@gmail.com># -*- coding: utf-8 -*- import sphinx_rtd_theme extensions = [ # 'sphinx.ext.autodoc', # 'sphinx.ext.intersphinx', # 'sphinx.ext.autosummary', # 'sphinx.ext.viewcode', # 'sphinx.ext.napoleon', # 'jupyter_sphinx.embed_widgets', ] templates_path = ['_templates'] def setup(app): app.add_javascript("https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js") app.add_javascript("https://unpkg.com/@jupyter-widgets/html-manager@0.18.4/dist/embed-amd.js") app.add_stylesheet("main_stylesheet.css") master_doc = 'index' source_suffix = '.rst' # General information about the project. project = 'ipyleaflet' copyright = '(c) Jupyter Development Team' author = 'Jupyter Development Team' exclude_patterns = [] highlight_language = 'python' pygments_style = 'sphinx' # Output file base name for HTML help builder. html_theme = "sphinx_rtd_theme" html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] htmlhelp_basename = 'ipyleafletdoc' html_static_path = ['_static']
<commit_before># -*- coding: utf-8 -*- import sphinx_rtd_theme extensions = [ # 'sphinx.ext.autodoc', # 'sphinx.ext.intersphinx', # 'sphinx.ext.autosummary', # 'sphinx.ext.viewcode', # 'sphinx.ext.napoleon', # 'jupyter_sphinx.embed_widgets', ] templates_path = ['_templates'] def setup(app): app.add_javascript("https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js") app.add_javascript("https://unpkg.com/@jupyter-widgets/html-manager@0.15.0/dist/embed-amd.js") app.add_stylesheet("main_stylesheet.css") master_doc = 'index' source_suffix = '.rst' # General information about the project. project = 'ipyleaflet' copyright = '(c) Jupyter Development Team' author = 'Jupyter Development Team' exclude_patterns = [] highlight_language = 'python' pygments_style = 'sphinx' # Output file base name for HTML help builder. html_theme = "sphinx_rtd_theme" html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] htmlhelp_basename = 'ipyleafletdoc' html_static_path = ['_static'] <commit_msg>Update HTMLManager in the documentation Signed-off-by: martinRenou <a8278cece597ec79cc59974d3d55dbb79bb38416@gmail.com><commit_after># -*- coding: utf-8 -*- import sphinx_rtd_theme extensions = [ # 'sphinx.ext.autodoc', # 'sphinx.ext.intersphinx', # 'sphinx.ext.autosummary', # 'sphinx.ext.viewcode', # 'sphinx.ext.napoleon', # 'jupyter_sphinx.embed_widgets', ] templates_path = ['_templates'] def setup(app): app.add_javascript("https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js") app.add_javascript("https://unpkg.com/@jupyter-widgets/html-manager@0.18.4/dist/embed-amd.js") app.add_stylesheet("main_stylesheet.css") master_doc = 'index' source_suffix = '.rst' # General information about the project. project = 'ipyleaflet' copyright = '(c) Jupyter Development Team' author = 'Jupyter Development Team' exclude_patterns = [] highlight_language = 'python' pygments_style = 'sphinx' # Output file base name for HTML help builder. html_theme = "sphinx_rtd_theme" html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] htmlhelp_basename = 'ipyleafletdoc' html_static_path = ['_static']
157c08a6ccd738d5bccfe8145c2a1f1e9d21ba82
madlib_web_client.py
madlib_web_client.py
import os from flask import Flask import psycopg2 from urllib.parse import urlparse url = urlparse(os.environ["DATABASE_URL"]) # Connect to a database conn = psycopg2.connect( database=url.path[1:], user=url.username, password=url.password, host=url.hostname, port=url.port ) # Open a cursor to perform database operations cur = conn.cursor() # Create a table cur.execute("CREATE TABLE test (id serial PRIMARY KEY, num integer, data varchar);") # Insert test data cur.execute("INSERT INTO test (num, data) VALUES (%s, %s)",(100, "abc'def")) # Query the database and obtain data as Python objects cur.execute("SELECT * FROM test;") print(cur.fetchone()) # Make the changes to the database persistent conn.commit() # Close the cursor and the connection to the database cur.close() conn.close() app = Flask(__name__) @app.route("/") def hello(): return "Hello world!" if __name__ == "__main__": port = int(os.environ.get("PORT", 5000)) app.run(host='0.0.0.0', port=port)
import os from flask import Flask import psycopg2 from urllib.parse import urlparse url = urlparse(os.environ["DATABASE_URL"]) # Connect to a database conn = psycopg2.connect( database=url.path[1:], user=url.username, password=url.password, host=url.hostname, port=url.port ) # Open a cursor to perform database operations cur = conn.cursor() # Drop table if it already exists cur.execute("DROP TABLE test;") # Create a table cur.execute("CREATE TABLE test (id serial PRIMARY KEY, num integer, data varchar);") # Insert test data cur.execute("INSERT INTO test (num, data) VALUES (%s, %s)", (100, "abc'def")) # Query the database and obtain data as Python objects cur.execute("SELECT * FROM test;") print(cur.fetchone()) # Make the changes to the database persistent conn.commit() # Close the cursor and the connection to the database cur.close() conn.close() app = Flask(__name__) @app.route("/") def hello(): return "Hello world!" if __name__ == "__main__": port = int(os.environ.get("PORT", 5000)) app.run(host='0.0.0.0', port=port)
Add a drop table for testing.
Add a drop table for testing.
Python
isc
appletonmakerspace/madlib,mikeputnam/madlib
import os from flask import Flask import psycopg2 from urllib.parse import urlparse url = urlparse(os.environ["DATABASE_URL"]) # Connect to a database conn = psycopg2.connect( database=url.path[1:], user=url.username, password=url.password, host=url.hostname, port=url.port ) # Open a cursor to perform database operations cur = conn.cursor() # Create a table cur.execute("CREATE TABLE test (id serial PRIMARY KEY, num integer, data varchar);") # Insert test data cur.execute("INSERT INTO test (num, data) VALUES (%s, %s)",(100, "abc'def")) # Query the database and obtain data as Python objects cur.execute("SELECT * FROM test;") print(cur.fetchone()) # Make the changes to the database persistent conn.commit() # Close the cursor and the connection to the database cur.close() conn.close() app = Flask(__name__) @app.route("/") def hello(): return "Hello world!" if __name__ == "__main__": port = int(os.environ.get("PORT", 5000)) app.run(host='0.0.0.0', port=port) Add a drop table for testing.
import os from flask import Flask import psycopg2 from urllib.parse import urlparse url = urlparse(os.environ["DATABASE_URL"]) # Connect to a database conn = psycopg2.connect( database=url.path[1:], user=url.username, password=url.password, host=url.hostname, port=url.port ) # Open a cursor to perform database operations cur = conn.cursor() # Drop table if it already exists cur.execute("DROP TABLE test;") # Create a table cur.execute("CREATE TABLE test (id serial PRIMARY KEY, num integer, data varchar);") # Insert test data cur.execute("INSERT INTO test (num, data) VALUES (%s, %s)", (100, "abc'def")) # Query the database and obtain data as Python objects cur.execute("SELECT * FROM test;") print(cur.fetchone()) # Make the changes to the database persistent conn.commit() # Close the cursor and the connection to the database cur.close() conn.close() app = Flask(__name__) @app.route("/") def hello(): return "Hello world!" if __name__ == "__main__": port = int(os.environ.get("PORT", 5000)) app.run(host='0.0.0.0', port=port)
<commit_before>import os from flask import Flask import psycopg2 from urllib.parse import urlparse url = urlparse(os.environ["DATABASE_URL"]) # Connect to a database conn = psycopg2.connect( database=url.path[1:], user=url.username, password=url.password, host=url.hostname, port=url.port ) # Open a cursor to perform database operations cur = conn.cursor() # Create a table cur.execute("CREATE TABLE test (id serial PRIMARY KEY, num integer, data varchar);") # Insert test data cur.execute("INSERT INTO test (num, data) VALUES (%s, %s)",(100, "abc'def")) # Query the database and obtain data as Python objects cur.execute("SELECT * FROM test;") print(cur.fetchone()) # Make the changes to the database persistent conn.commit() # Close the cursor and the connection to the database cur.close() conn.close() app = Flask(__name__) @app.route("/") def hello(): return "Hello world!" if __name__ == "__main__": port = int(os.environ.get("PORT", 5000)) app.run(host='0.0.0.0', port=port) <commit_msg>Add a drop table for testing.<commit_after>
import os from flask import Flask import psycopg2 from urllib.parse import urlparse url = urlparse(os.environ["DATABASE_URL"]) # Connect to a database conn = psycopg2.connect( database=url.path[1:], user=url.username, password=url.password, host=url.hostname, port=url.port ) # Open a cursor to perform database operations cur = conn.cursor() # Drop table if it already exists cur.execute("DROP TABLE test;") # Create a table cur.execute("CREATE TABLE test (id serial PRIMARY KEY, num integer, data varchar);") # Insert test data cur.execute("INSERT INTO test (num, data) VALUES (%s, %s)", (100, "abc'def")) # Query the database and obtain data as Python objects cur.execute("SELECT * FROM test;") print(cur.fetchone()) # Make the changes to the database persistent conn.commit() # Close the cursor and the connection to the database cur.close() conn.close() app = Flask(__name__) @app.route("/") def hello(): return "Hello world!" if __name__ == "__main__": port = int(os.environ.get("PORT", 5000)) app.run(host='0.0.0.0', port=port)
import os from flask import Flask import psycopg2 from urllib.parse import urlparse url = urlparse(os.environ["DATABASE_URL"]) # Connect to a database conn = psycopg2.connect( database=url.path[1:], user=url.username, password=url.password, host=url.hostname, port=url.port ) # Open a cursor to perform database operations cur = conn.cursor() # Create a table cur.execute("CREATE TABLE test (id serial PRIMARY KEY, num integer, data varchar);") # Insert test data cur.execute("INSERT INTO test (num, data) VALUES (%s, %s)",(100, "abc'def")) # Query the database and obtain data as Python objects cur.execute("SELECT * FROM test;") print(cur.fetchone()) # Make the changes to the database persistent conn.commit() # Close the cursor and the connection to the database cur.close() conn.close() app = Flask(__name__) @app.route("/") def hello(): return "Hello world!" if __name__ == "__main__": port = int(os.environ.get("PORT", 5000)) app.run(host='0.0.0.0', port=port) Add a drop table for testing.import os from flask import Flask import psycopg2 from urllib.parse import urlparse url = urlparse(os.environ["DATABASE_URL"]) # Connect to a database conn = psycopg2.connect( database=url.path[1:], user=url.username, password=url.password, host=url.hostname, port=url.port ) # Open a cursor to perform database operations cur = conn.cursor() # Drop table if it already exists cur.execute("DROP TABLE test;") # Create a table cur.execute("CREATE TABLE test (id serial PRIMARY KEY, num integer, data varchar);") # Insert test data cur.execute("INSERT INTO test (num, data) VALUES (%s, %s)", (100, "abc'def")) # Query the database and obtain data as Python objects cur.execute("SELECT * FROM test;") print(cur.fetchone()) # Make the changes to the database persistent conn.commit() # Close the cursor and the connection to the database cur.close() conn.close() app = Flask(__name__) @app.route("/") def hello(): return "Hello world!" if __name__ == "__main__": port = int(os.environ.get("PORT", 5000)) app.run(host='0.0.0.0', port=port)
<commit_before>import os from flask import Flask import psycopg2 from urllib.parse import urlparse url = urlparse(os.environ["DATABASE_URL"]) # Connect to a database conn = psycopg2.connect( database=url.path[1:], user=url.username, password=url.password, host=url.hostname, port=url.port ) # Open a cursor to perform database operations cur = conn.cursor() # Create a table cur.execute("CREATE TABLE test (id serial PRIMARY KEY, num integer, data varchar);") # Insert test data cur.execute("INSERT INTO test (num, data) VALUES (%s, %s)",(100, "abc'def")) # Query the database and obtain data as Python objects cur.execute("SELECT * FROM test;") print(cur.fetchone()) # Make the changes to the database persistent conn.commit() # Close the cursor and the connection to the database cur.close() conn.close() app = Flask(__name__) @app.route("/") def hello(): return "Hello world!" if __name__ == "__main__": port = int(os.environ.get("PORT", 5000)) app.run(host='0.0.0.0', port=port) <commit_msg>Add a drop table for testing.<commit_after>import os from flask import Flask import psycopg2 from urllib.parse import urlparse url = urlparse(os.environ["DATABASE_URL"]) # Connect to a database conn = psycopg2.connect( database=url.path[1:], user=url.username, password=url.password, host=url.hostname, port=url.port ) # Open a cursor to perform database operations cur = conn.cursor() # Drop table if it already exists cur.execute("DROP TABLE test;") # Create a table cur.execute("CREATE TABLE test (id serial PRIMARY KEY, num integer, data varchar);") # Insert test data cur.execute("INSERT INTO test (num, data) VALUES (%s, %s)", (100, "abc'def")) # Query the database and obtain data as Python objects cur.execute("SELECT * FROM test;") print(cur.fetchone()) # Make the changes to the database persistent conn.commit() # Close the cursor and the connection to the database cur.close() conn.close() app = Flask(__name__) @app.route("/") def hello(): return "Hello world!" if __name__ == "__main__": port = int(os.environ.get("PORT", 5000)) app.run(host='0.0.0.0', port=port)
e1c549fde8f57dcbdf995a165dc8409da8f23c64
magol/consolegol.py
magol/consolegol.py
#!/usr/bin/python2 from __future__ import print_function from board import Board import sys class GameOfLifeConsole: def __init__(self): print('Welcome to PyGol') print('What board size do you want?') board_size = raw_input() while not board_size.isdigit(): print('Please enter a number for the board size:') board_size = raw_input() self.board = Board(int(board_size)) self.board.randomise_grid() self.mainloop() def mainloop(self): while True: print('How many turns do you want to run (0 to stop)?') num_turns = raw_input() while not num_turns.isdigit(): print('Please enter a number for the amount of turns:') num_turns = raw_input() num_turns = int(num_turns) if num_turns <= 0: print('Goodbye') sys.exit() self.board.run_turns(num_turns) for row in self.board.grid: for col in row: if col: print('0', end='') else: print('1', end='') print() GameOfLifeConsole()
#!/usr/bin/python2 from __future__ import print_function from board import Board import sys class GameOfLifeConsole: def __init__(self): print('Welcome to MaGol') print('What board size do you want?') board_size = raw_input() while not board_size.isdigit(): print('Please enter a number for the board size:') board_size = raw_input() self.board = Board(int(board_size)) self.board.randomise_grid() self.mainloop() def mainloop(self): while True: print('How many turns do you want to run (0 to stop)?') num_turns = raw_input() while not num_turns.isdigit(): print('Please enter a number for the amount of turns:') num_turns = raw_input() num_turns = int(num_turns) if num_turns <= 0: print('Goodbye') sys.exit() self.board.run_turns(num_turns) for row in self.board.grid: for col in row: if col: print('0', end='') else: print('1', end='') print() GameOfLifeConsole()
Update text references in the console version.
Update text references in the console version.
Python
mit
Macha/MaGol
#!/usr/bin/python2 from __future__ import print_function from board import Board import sys class GameOfLifeConsole: def __init__(self): print('Welcome to PyGol') print('What board size do you want?') board_size = raw_input() while not board_size.isdigit(): print('Please enter a number for the board size:') board_size = raw_input() self.board = Board(int(board_size)) self.board.randomise_grid() self.mainloop() def mainloop(self): while True: print('How many turns do you want to run (0 to stop)?') num_turns = raw_input() while not num_turns.isdigit(): print('Please enter a number for the amount of turns:') num_turns = raw_input() num_turns = int(num_turns) if num_turns <= 0: print('Goodbye') sys.exit() self.board.run_turns(num_turns) for row in self.board.grid: for col in row: if col: print('0', end='') else: print('1', end='') print() GameOfLifeConsole() Update text references in the console version.
#!/usr/bin/python2 from __future__ import print_function from board import Board import sys class GameOfLifeConsole: def __init__(self): print('Welcome to MaGol') print('What board size do you want?') board_size = raw_input() while not board_size.isdigit(): print('Please enter a number for the board size:') board_size = raw_input() self.board = Board(int(board_size)) self.board.randomise_grid() self.mainloop() def mainloop(self): while True: print('How many turns do you want to run (0 to stop)?') num_turns = raw_input() while not num_turns.isdigit(): print('Please enter a number for the amount of turns:') num_turns = raw_input() num_turns = int(num_turns) if num_turns <= 0: print('Goodbye') sys.exit() self.board.run_turns(num_turns) for row in self.board.grid: for col in row: if col: print('0', end='') else: print('1', end='') print() GameOfLifeConsole()
<commit_before>#!/usr/bin/python2 from __future__ import print_function from board import Board import sys class GameOfLifeConsole: def __init__(self): print('Welcome to PyGol') print('What board size do you want?') board_size = raw_input() while not board_size.isdigit(): print('Please enter a number for the board size:') board_size = raw_input() self.board = Board(int(board_size)) self.board.randomise_grid() self.mainloop() def mainloop(self): while True: print('How many turns do you want to run (0 to stop)?') num_turns = raw_input() while not num_turns.isdigit(): print('Please enter a number for the amount of turns:') num_turns = raw_input() num_turns = int(num_turns) if num_turns <= 0: print('Goodbye') sys.exit() self.board.run_turns(num_turns) for row in self.board.grid: for col in row: if col: print('0', end='') else: print('1', end='') print() GameOfLifeConsole() <commit_msg>Update text references in the console version.<commit_after>
#!/usr/bin/python2 from __future__ import print_function from board import Board import sys class GameOfLifeConsole: def __init__(self): print('Welcome to MaGol') print('What board size do you want?') board_size = raw_input() while not board_size.isdigit(): print('Please enter a number for the board size:') board_size = raw_input() self.board = Board(int(board_size)) self.board.randomise_grid() self.mainloop() def mainloop(self): while True: print('How many turns do you want to run (0 to stop)?') num_turns = raw_input() while not num_turns.isdigit(): print('Please enter a number for the amount of turns:') num_turns = raw_input() num_turns = int(num_turns) if num_turns <= 0: print('Goodbye') sys.exit() self.board.run_turns(num_turns) for row in self.board.grid: for col in row: if col: print('0', end='') else: print('1', end='') print() GameOfLifeConsole()
#!/usr/bin/python2 from __future__ import print_function from board import Board import sys class GameOfLifeConsole: def __init__(self): print('Welcome to PyGol') print('What board size do you want?') board_size = raw_input() while not board_size.isdigit(): print('Please enter a number for the board size:') board_size = raw_input() self.board = Board(int(board_size)) self.board.randomise_grid() self.mainloop() def mainloop(self): while True: print('How many turns do you want to run (0 to stop)?') num_turns = raw_input() while not num_turns.isdigit(): print('Please enter a number for the amount of turns:') num_turns = raw_input() num_turns = int(num_turns) if num_turns <= 0: print('Goodbye') sys.exit() self.board.run_turns(num_turns) for row in self.board.grid: for col in row: if col: print('0', end='') else: print('1', end='') print() GameOfLifeConsole() Update text references in the console version.#!/usr/bin/python2 from __future__ import print_function from board import Board import sys class GameOfLifeConsole: def __init__(self): print('Welcome to MaGol') print('What board size do you want?') board_size = raw_input() while not board_size.isdigit(): print('Please enter a number for the board size:') board_size = raw_input() self.board = Board(int(board_size)) self.board.randomise_grid() self.mainloop() def mainloop(self): while True: print('How many turns do you want to run (0 to stop)?') num_turns = raw_input() while not num_turns.isdigit(): print('Please enter a number for the amount of turns:') num_turns = raw_input() num_turns = int(num_turns) if num_turns <= 0: print('Goodbye') sys.exit() self.board.run_turns(num_turns) for row in self.board.grid: for col in row: if col: print('0', end='') else: print('1', end='') print() GameOfLifeConsole()
<commit_before>#!/usr/bin/python2 from __future__ import print_function from board import Board import sys class GameOfLifeConsole: def __init__(self): print('Welcome to PyGol') print('What board size do you want?') board_size = raw_input() while not board_size.isdigit(): print('Please enter a number for the board size:') board_size = raw_input() self.board = Board(int(board_size)) self.board.randomise_grid() self.mainloop() def mainloop(self): while True: print('How many turns do you want to run (0 to stop)?') num_turns = raw_input() while not num_turns.isdigit(): print('Please enter a number for the amount of turns:') num_turns = raw_input() num_turns = int(num_turns) if num_turns <= 0: print('Goodbye') sys.exit() self.board.run_turns(num_turns) for row in self.board.grid: for col in row: if col: print('0', end='') else: print('1', end='') print() GameOfLifeConsole() <commit_msg>Update text references in the console version.<commit_after>#!/usr/bin/python2 from __future__ import print_function from board import Board import sys class GameOfLifeConsole: def __init__(self): print('Welcome to MaGol') print('What board size do you want?') board_size = raw_input() while not board_size.isdigit(): print('Please enter a number for the board size:') board_size = raw_input() self.board = Board(int(board_size)) self.board.randomise_grid() self.mainloop() def mainloop(self): while True: print('How many turns do you want to run (0 to stop)?') num_turns = raw_input() while not num_turns.isdigit(): print('Please enter a number for the amount of turns:') num_turns = raw_input() num_turns = int(num_turns) if num_turns <= 0: print('Goodbye') sys.exit() self.board.run_turns(num_turns) for row in self.board.grid: for col in row: if col: print('0', end='') else: print('1', end='') print() GameOfLifeConsole()
5e47f95bcc147a9735083f32a15df362bb6dcacd
pcs/packets/__init__.py
pcs/packets/__init__.py
__revision__ = "$Id: __init__.py,v 1.3 2006/06/27 14:45:43 gnn Exp $" all = ['ethernet', 'loopback', 'ipv4', 'ipv6', 'icmpv4', 'tcp', 'udp', 'data']
__revision__ = "$Id: __init__.py,v 1.3 2006/06/27 14:45:43 gnn Exp $" all = ['ethernet', 'loopback', 'ipv4', 'ipv6', 'icmpv4', 'igmpv2', 'igmpv3', 'tcp', 'udp', 'data']
Connect IGMP to the build.
Connect IGMP to the build.
Python
bsd-3-clause
gvnn3/PCS,gvnn3/PCS
__revision__ = "$Id: __init__.py,v 1.3 2006/06/27 14:45:43 gnn Exp $" all = ['ethernet', 'loopback', 'ipv4', 'ipv6', 'icmpv4', 'tcp', 'udp', 'data'] Connect IGMP to the build.
__revision__ = "$Id: __init__.py,v 1.3 2006/06/27 14:45:43 gnn Exp $" all = ['ethernet', 'loopback', 'ipv4', 'ipv6', 'icmpv4', 'igmpv2', 'igmpv3', 'tcp', 'udp', 'data']
<commit_before>__revision__ = "$Id: __init__.py,v 1.3 2006/06/27 14:45:43 gnn Exp $" all = ['ethernet', 'loopback', 'ipv4', 'ipv6', 'icmpv4', 'tcp', 'udp', 'data'] <commit_msg>Connect IGMP to the build.<commit_after>
__revision__ = "$Id: __init__.py,v 1.3 2006/06/27 14:45:43 gnn Exp $" all = ['ethernet', 'loopback', 'ipv4', 'ipv6', 'icmpv4', 'igmpv2', 'igmpv3', 'tcp', 'udp', 'data']
__revision__ = "$Id: __init__.py,v 1.3 2006/06/27 14:45:43 gnn Exp $" all = ['ethernet', 'loopback', 'ipv4', 'ipv6', 'icmpv4', 'tcp', 'udp', 'data'] Connect IGMP to the build.__revision__ = "$Id: __init__.py,v 1.3 2006/06/27 14:45:43 gnn Exp $" all = ['ethernet', 'loopback', 'ipv4', 'ipv6', 'icmpv4', 'igmpv2', 'igmpv3', 'tcp', 'udp', 'data']
<commit_before>__revision__ = "$Id: __init__.py,v 1.3 2006/06/27 14:45:43 gnn Exp $" all = ['ethernet', 'loopback', 'ipv4', 'ipv6', 'icmpv4', 'tcp', 'udp', 'data'] <commit_msg>Connect IGMP to the build.<commit_after>__revision__ = "$Id: __init__.py,v 1.3 2006/06/27 14:45:43 gnn Exp $" all = ['ethernet', 'loopback', 'ipv4', 'ipv6', 'icmpv4', 'igmpv2', 'igmpv3', 'tcp', 'udp', 'data']
c848a5a1d94da7919b3272e9e0ee9748091ba04a
md/data/__init__.py
md/data/__init__.py
DEFAULT_URL = "https://s3-us-west-2.amazonaws.com/openpolicingdata/Maryland-Traffic-Stop-Data-2013.zip" # noqa DATASET_BASENAME = 'PIALog_16-0806' # DATASET_BASENAME = 'Small-0806'
DEFAULT_URL = 'https://s3-us-west-2.amazonaws.com/openpolicingdata/PIALog_16-0806.zip' # noqa DATASET_BASENAME = 'PIALog_16-0806' # DATASET_BASENAME = 'Small-0806'
Fix URL to current MD dataset on S3
Fix URL to current MD dataset on S3
Python
mit
OpenDataPolicingNC/Traffic-Stops,OpenDataPolicingNC/Traffic-Stops,OpenDataPolicingNC/Traffic-Stops,OpenDataPolicingNC/Traffic-Stops
DEFAULT_URL = "https://s3-us-west-2.amazonaws.com/openpolicingdata/Maryland-Traffic-Stop-Data-2013.zip" # noqa DATASET_BASENAME = 'PIALog_16-0806' # DATASET_BASENAME = 'Small-0806' Fix URL to current MD dataset on S3
DEFAULT_URL = 'https://s3-us-west-2.amazonaws.com/openpolicingdata/PIALog_16-0806.zip' # noqa DATASET_BASENAME = 'PIALog_16-0806' # DATASET_BASENAME = 'Small-0806'
<commit_before>DEFAULT_URL = "https://s3-us-west-2.amazonaws.com/openpolicingdata/Maryland-Traffic-Stop-Data-2013.zip" # noqa DATASET_BASENAME = 'PIALog_16-0806' # DATASET_BASENAME = 'Small-0806' <commit_msg>Fix URL to current MD dataset on S3<commit_after>
DEFAULT_URL = 'https://s3-us-west-2.amazonaws.com/openpolicingdata/PIALog_16-0806.zip' # noqa DATASET_BASENAME = 'PIALog_16-0806' # DATASET_BASENAME = 'Small-0806'
DEFAULT_URL = "https://s3-us-west-2.amazonaws.com/openpolicingdata/Maryland-Traffic-Stop-Data-2013.zip" # noqa DATASET_BASENAME = 'PIALog_16-0806' # DATASET_BASENAME = 'Small-0806' Fix URL to current MD dataset on S3DEFAULT_URL = 'https://s3-us-west-2.amazonaws.com/openpolicingdata/PIALog_16-0806.zip' # noqa DATASET_BASENAME = 'PIALog_16-0806' # DATASET_BASENAME = 'Small-0806'
<commit_before>DEFAULT_URL = "https://s3-us-west-2.amazonaws.com/openpolicingdata/Maryland-Traffic-Stop-Data-2013.zip" # noqa DATASET_BASENAME = 'PIALog_16-0806' # DATASET_BASENAME = 'Small-0806' <commit_msg>Fix URL to current MD dataset on S3<commit_after>DEFAULT_URL = 'https://s3-us-west-2.amazonaws.com/openpolicingdata/PIALog_16-0806.zip' # noqa DATASET_BASENAME = 'PIALog_16-0806' # DATASET_BASENAME = 'Small-0806'
66fdc9b0732b083f6f9bbb7142c8e07f1dd964ff
tests/__init__.py
tests/__init__.py
import threading import time from ..send_self import ( WeakGeneratorWrapper, StrongGeneratorWrapper ) default_sleep = 0.1 class CustomError(Exception): pass def defer(callback, *args, sleep=default_sleep, expected_return=None, call=True, **kwargs): def func(): time.sleep(sleep) if call: assert expected_return == callback(*args, **kwargs) else: print("generator is not re-called") t = threading.Thread(target=func) t.start() def wait_until_finished(wrapper, timeout=None, sleep=default_sleep, defer_calls=1): # Can not be called with StrongGeneratorWrapper, likely because it will be # bound in some frame and thus its reference won't get gc'd when it would # otherwise. TOCHECK assert type(wrapper) is WeakGeneratorWrapper if not timeout: timeout = defer_calls * default_sleep + 1 ref = wrapper.weak_generator start_time = time.time() while time.time() < start_time + timeout: if wrapper.has_terminated(): return time.sleep(sleep) else: if ref() is None: return raise RuntimeError("Has not been collected within %ss" % timeout)
import threading import time from ..send_self import WeakGeneratorWrapper DEFAULT_SLEEP = 0.01 class CustomError(Exception): pass def defer(callback, *args, sleep=DEFAULT_SLEEP, expected_return=None, call=True, **kwargs): def func(): time.sleep(sleep) if call: assert expected_return == callback(*args, **kwargs) else: print("generator is not re-called") t = threading.Thread(target=func) t.start() def wait_until_finished(wrapper, timeout=1, sleep=DEFAULT_SLEEP, defer_calls=1): # Can not be called with StrongGeneratorWrapper, # likely because it will be bound in some frame # and thus its reference won't get gc'd # when it would otherwise. # TOCHECK # assert type(wrapper) is WeakGeneratorWrapper if not timeout: timeout = defer_calls * DEFAULT_SLEEP + 1 ref = wrapper.weak_generator start_time = time.time() while time.time() < start_time + timeout: if wrapper.has_terminated(): return time.sleep(sleep) else: if ref() is None: return raise RuntimeError("Has not been collected within %ss" % timeout)
Reduce test runtime by decreasing default sleep
Reduce test runtime by decreasing default sleep Also remove WeakGeneratorWrapper check until gc tests are implemented.
Python
mit
FichteFoll/resumeback
import threading import time from ..send_self import ( WeakGeneratorWrapper, StrongGeneratorWrapper ) default_sleep = 0.1 class CustomError(Exception): pass def defer(callback, *args, sleep=default_sleep, expected_return=None, call=True, **kwargs): def func(): time.sleep(sleep) if call: assert expected_return == callback(*args, **kwargs) else: print("generator is not re-called") t = threading.Thread(target=func) t.start() def wait_until_finished(wrapper, timeout=None, sleep=default_sleep, defer_calls=1): # Can not be called with StrongGeneratorWrapper, likely because it will be # bound in some frame and thus its reference won't get gc'd when it would # otherwise. TOCHECK assert type(wrapper) is WeakGeneratorWrapper if not timeout: timeout = defer_calls * default_sleep + 1 ref = wrapper.weak_generator start_time = time.time() while time.time() < start_time + timeout: if wrapper.has_terminated(): return time.sleep(sleep) else: if ref() is None: return raise RuntimeError("Has not been collected within %ss" % timeout) Reduce test runtime by decreasing default sleep Also remove WeakGeneratorWrapper check until gc tests are implemented.
import threading import time from ..send_self import WeakGeneratorWrapper DEFAULT_SLEEP = 0.01 class CustomError(Exception): pass def defer(callback, *args, sleep=DEFAULT_SLEEP, expected_return=None, call=True, **kwargs): def func(): time.sleep(sleep) if call: assert expected_return == callback(*args, **kwargs) else: print("generator is not re-called") t = threading.Thread(target=func) t.start() def wait_until_finished(wrapper, timeout=1, sleep=DEFAULT_SLEEP, defer_calls=1): # Can not be called with StrongGeneratorWrapper, # likely because it will be bound in some frame # and thus its reference won't get gc'd # when it would otherwise. # TOCHECK # assert type(wrapper) is WeakGeneratorWrapper if not timeout: timeout = defer_calls * DEFAULT_SLEEP + 1 ref = wrapper.weak_generator start_time = time.time() while time.time() < start_time + timeout: if wrapper.has_terminated(): return time.sleep(sleep) else: if ref() is None: return raise RuntimeError("Has not been collected within %ss" % timeout)
<commit_before>import threading import time from ..send_self import ( WeakGeneratorWrapper, StrongGeneratorWrapper ) default_sleep = 0.1 class CustomError(Exception): pass def defer(callback, *args, sleep=default_sleep, expected_return=None, call=True, **kwargs): def func(): time.sleep(sleep) if call: assert expected_return == callback(*args, **kwargs) else: print("generator is not re-called") t = threading.Thread(target=func) t.start() def wait_until_finished(wrapper, timeout=None, sleep=default_sleep, defer_calls=1): # Can not be called with StrongGeneratorWrapper, likely because it will be # bound in some frame and thus its reference won't get gc'd when it would # otherwise. TOCHECK assert type(wrapper) is WeakGeneratorWrapper if not timeout: timeout = defer_calls * default_sleep + 1 ref = wrapper.weak_generator start_time = time.time() while time.time() < start_time + timeout: if wrapper.has_terminated(): return time.sleep(sleep) else: if ref() is None: return raise RuntimeError("Has not been collected within %ss" % timeout) <commit_msg>Reduce test runtime by decreasing default sleep Also remove WeakGeneratorWrapper check until gc tests are implemented.<commit_after>
import threading import time from ..send_self import WeakGeneratorWrapper DEFAULT_SLEEP = 0.01 class CustomError(Exception): pass def defer(callback, *args, sleep=DEFAULT_SLEEP, expected_return=None, call=True, **kwargs): def func(): time.sleep(sleep) if call: assert expected_return == callback(*args, **kwargs) else: print("generator is not re-called") t = threading.Thread(target=func) t.start() def wait_until_finished(wrapper, timeout=1, sleep=DEFAULT_SLEEP, defer_calls=1): # Can not be called with StrongGeneratorWrapper, # likely because it will be bound in some frame # and thus its reference won't get gc'd # when it would otherwise. # TOCHECK # assert type(wrapper) is WeakGeneratorWrapper if not timeout: timeout = defer_calls * DEFAULT_SLEEP + 1 ref = wrapper.weak_generator start_time = time.time() while time.time() < start_time + timeout: if wrapper.has_terminated(): return time.sleep(sleep) else: if ref() is None: return raise RuntimeError("Has not been collected within %ss" % timeout)
import threading import time from ..send_self import ( WeakGeneratorWrapper, StrongGeneratorWrapper ) default_sleep = 0.1 class CustomError(Exception): pass def defer(callback, *args, sleep=default_sleep, expected_return=None, call=True, **kwargs): def func(): time.sleep(sleep) if call: assert expected_return == callback(*args, **kwargs) else: print("generator is not re-called") t = threading.Thread(target=func) t.start() def wait_until_finished(wrapper, timeout=None, sleep=default_sleep, defer_calls=1): # Can not be called with StrongGeneratorWrapper, likely because it will be # bound in some frame and thus its reference won't get gc'd when it would # otherwise. TOCHECK assert type(wrapper) is WeakGeneratorWrapper if not timeout: timeout = defer_calls * default_sleep + 1 ref = wrapper.weak_generator start_time = time.time() while time.time() < start_time + timeout: if wrapper.has_terminated(): return time.sleep(sleep) else: if ref() is None: return raise RuntimeError("Has not been collected within %ss" % timeout) Reduce test runtime by decreasing default sleep Also remove WeakGeneratorWrapper check until gc tests are implemented.import threading import time from ..send_self import WeakGeneratorWrapper DEFAULT_SLEEP = 0.01 class CustomError(Exception): pass def defer(callback, *args, sleep=DEFAULT_SLEEP, expected_return=None, call=True, **kwargs): def func(): time.sleep(sleep) if call: assert expected_return == callback(*args, **kwargs) else: print("generator is not re-called") t = threading.Thread(target=func) t.start() def wait_until_finished(wrapper, timeout=1, sleep=DEFAULT_SLEEP, defer_calls=1): # Can not be called with StrongGeneratorWrapper, # likely because it will be bound in some frame # and thus its reference won't get gc'd # when it would otherwise. # TOCHECK # assert type(wrapper) is WeakGeneratorWrapper if not timeout: timeout = defer_calls * DEFAULT_SLEEP + 1 ref = wrapper.weak_generator start_time = time.time() while time.time() < start_time + timeout: if wrapper.has_terminated(): return time.sleep(sleep) else: if ref() is None: return raise RuntimeError("Has not been collected within %ss" % timeout)
<commit_before>import threading import time from ..send_self import ( WeakGeneratorWrapper, StrongGeneratorWrapper ) default_sleep = 0.1 class CustomError(Exception): pass def defer(callback, *args, sleep=default_sleep, expected_return=None, call=True, **kwargs): def func(): time.sleep(sleep) if call: assert expected_return == callback(*args, **kwargs) else: print("generator is not re-called") t = threading.Thread(target=func) t.start() def wait_until_finished(wrapper, timeout=None, sleep=default_sleep, defer_calls=1): # Can not be called with StrongGeneratorWrapper, likely because it will be # bound in some frame and thus its reference won't get gc'd when it would # otherwise. TOCHECK assert type(wrapper) is WeakGeneratorWrapper if not timeout: timeout = defer_calls * default_sleep + 1 ref = wrapper.weak_generator start_time = time.time() while time.time() < start_time + timeout: if wrapper.has_terminated(): return time.sleep(sleep) else: if ref() is None: return raise RuntimeError("Has not been collected within %ss" % timeout) <commit_msg>Reduce test runtime by decreasing default sleep Also remove WeakGeneratorWrapper check until gc tests are implemented.<commit_after>import threading import time from ..send_self import WeakGeneratorWrapper DEFAULT_SLEEP = 0.01 class CustomError(Exception): pass def defer(callback, *args, sleep=DEFAULT_SLEEP, expected_return=None, call=True, **kwargs): def func(): time.sleep(sleep) if call: assert expected_return == callback(*args, **kwargs) else: print("generator is not re-called") t = threading.Thread(target=func) t.start() def wait_until_finished(wrapper, timeout=1, sleep=DEFAULT_SLEEP, defer_calls=1): # Can not be called with StrongGeneratorWrapper, # likely because it will be bound in some frame # and thus its reference won't get gc'd # when it would otherwise. # TOCHECK # assert type(wrapper) is WeakGeneratorWrapper if not timeout: timeout = defer_calls * DEFAULT_SLEEP + 1 ref = wrapper.weak_generator start_time = time.time() while time.time() < start_time + timeout: if wrapper.has_terminated(): return time.sleep(sleep) else: if ref() is None: return raise RuntimeError("Has not been collected within %ss" % timeout)
bc0c460bf6d1cae2e7675e2f484bdac8e84f376e
tools/python/readLogFile.py
tools/python/readLogFile.py
#!/usr/bin/env python import sys import subprocess import signal def printMsg(msgDict): print msgDict['name'] print '\t','type: ',msgDict['type'] print '\t','subtype: ',msgDict['subtype'] for key,value in msgDict.items(): if ((key != 'name') and (key != 'type') and (key != 'subtype')): print '\t',key,': ',value print '' logString = sys.argv[1] logFile = sys.argv[2] targetMsg = "" if (len(sys.argv) > 3): targetMsg = sys.argv[3] output = subprocess.check_output(['zgrep', logString, logFile]) lines = output.split("\n") for thisLine in lines: splitLine = thisLine.split("{") if (len(splitLine) > 1): thisMsg = splitLine[1] thisMsg = thisMsg[:-1] # print thisMsg splitMsg = thisMsg.split(", ") msgDict = {} for thisSplitMsg in splitMsg: # print thisSplitMsg keyValuePair = thisSplitMsg.split("=") msgDict[keyValuePair[0]] = keyValuePair[1] if ((targetMsg == "") or ((msgDict['name'].find(targetMsg)) != -1)): printMsg(msgDict)
#!/usr/bin/env python import sys import subprocess import signal # example usage: # ./readLogFile.py "INFO: headers" /projects/databridge/howard/DataBridge/log/ingest.log Insert.Metadata # to find and display all of the Insert.Metadata.* messages. # # ./readLogFile.py "INFO: headers" /projects/databridge/howard/DataBridge/log/ingest.log # to read and display all messages in the ingest.log. # Note that this also works on gzipped files since it is using zgrep def printMsg(msgDict): print msgDict['name'] print '\t','type: ',msgDict['type'] print '\t','subtype: ',msgDict['subtype'] for key,value in msgDict.items(): if ((key != 'name') and (key != 'type') and (key != 'subtype')): print '\t',key,': ',value print '' logString = sys.argv[1] logFile = sys.argv[2] targetMsg = "" if (len(sys.argv) > 3): targetMsg = sys.argv[3] output = subprocess.check_output(['zgrep', logString, logFile]) lines = output.split("\n") for thisLine in lines: splitLine = thisLine.split("{") if (len(splitLine) > 1): thisMsg = splitLine[1] thisMsg = thisMsg[:-1] # print thisMsg splitMsg = thisMsg.split(", ") msgDict = {} for thisSplitMsg in splitMsg: # print thisSplitMsg keyValuePair = thisSplitMsg.split("=") msgDict[keyValuePair[0]] = keyValuePair[1] if ((targetMsg == "") or ((msgDict['name'].find(targetMsg)) != -1)): printMsg(msgDict)
Add some documentation about how to use this file.
Add some documentation about how to use this file.
Python
bsd-3-clause
HowardLander/DataBridge,HowardLander/DataBridge,HowardLander/DataBridge,HowardLander/DataBridge
#!/usr/bin/env python import sys import subprocess import signal def printMsg(msgDict): print msgDict['name'] print '\t','type: ',msgDict['type'] print '\t','subtype: ',msgDict['subtype'] for key,value in msgDict.items(): if ((key != 'name') and (key != 'type') and (key != 'subtype')): print '\t',key,': ',value print '' logString = sys.argv[1] logFile = sys.argv[2] targetMsg = "" if (len(sys.argv) > 3): targetMsg = sys.argv[3] output = subprocess.check_output(['zgrep', logString, logFile]) lines = output.split("\n") for thisLine in lines: splitLine = thisLine.split("{") if (len(splitLine) > 1): thisMsg = splitLine[1] thisMsg = thisMsg[:-1] # print thisMsg splitMsg = thisMsg.split(", ") msgDict = {} for thisSplitMsg in splitMsg: # print thisSplitMsg keyValuePair = thisSplitMsg.split("=") msgDict[keyValuePair[0]] = keyValuePair[1] if ((targetMsg == "") or ((msgDict['name'].find(targetMsg)) != -1)): printMsg(msgDict) Add some documentation about how to use this file.
#!/usr/bin/env python import sys import subprocess import signal # example usage: # ./readLogFile.py "INFO: headers" /projects/databridge/howard/DataBridge/log/ingest.log Insert.Metadata # to find and display all of the Insert.Metadata.* messages. # # ./readLogFile.py "INFO: headers" /projects/databridge/howard/DataBridge/log/ingest.log # to read and display all messages in the ingest.log. # Note that this also works on gzipped files since it is using zgrep def printMsg(msgDict): print msgDict['name'] print '\t','type: ',msgDict['type'] print '\t','subtype: ',msgDict['subtype'] for key,value in msgDict.items(): if ((key != 'name') and (key != 'type') and (key != 'subtype')): print '\t',key,': ',value print '' logString = sys.argv[1] logFile = sys.argv[2] targetMsg = "" if (len(sys.argv) > 3): targetMsg = sys.argv[3] output = subprocess.check_output(['zgrep', logString, logFile]) lines = output.split("\n") for thisLine in lines: splitLine = thisLine.split("{") if (len(splitLine) > 1): thisMsg = splitLine[1] thisMsg = thisMsg[:-1] # print thisMsg splitMsg = thisMsg.split(", ") msgDict = {} for thisSplitMsg in splitMsg: # print thisSplitMsg keyValuePair = thisSplitMsg.split("=") msgDict[keyValuePair[0]] = keyValuePair[1] if ((targetMsg == "") or ((msgDict['name'].find(targetMsg)) != -1)): printMsg(msgDict)
<commit_before>#!/usr/bin/env python import sys import subprocess import signal def printMsg(msgDict): print msgDict['name'] print '\t','type: ',msgDict['type'] print '\t','subtype: ',msgDict['subtype'] for key,value in msgDict.items(): if ((key != 'name') and (key != 'type') and (key != 'subtype')): print '\t',key,': ',value print '' logString = sys.argv[1] logFile = sys.argv[2] targetMsg = "" if (len(sys.argv) > 3): targetMsg = sys.argv[3] output = subprocess.check_output(['zgrep', logString, logFile]) lines = output.split("\n") for thisLine in lines: splitLine = thisLine.split("{") if (len(splitLine) > 1): thisMsg = splitLine[1] thisMsg = thisMsg[:-1] # print thisMsg splitMsg = thisMsg.split(", ") msgDict = {} for thisSplitMsg in splitMsg: # print thisSplitMsg keyValuePair = thisSplitMsg.split("=") msgDict[keyValuePair[0]] = keyValuePair[1] if ((targetMsg == "") or ((msgDict['name'].find(targetMsg)) != -1)): printMsg(msgDict) <commit_msg>Add some documentation about how to use this file.<commit_after>
#!/usr/bin/env python import sys import subprocess import signal # example usage: # ./readLogFile.py "INFO: headers" /projects/databridge/howard/DataBridge/log/ingest.log Insert.Metadata # to find and display all of the Insert.Metadata.* messages. # # ./readLogFile.py "INFO: headers" /projects/databridge/howard/DataBridge/log/ingest.log # to read and display all messages in the ingest.log. # Note that this also works on gzipped files since it is using zgrep def printMsg(msgDict): print msgDict['name'] print '\t','type: ',msgDict['type'] print '\t','subtype: ',msgDict['subtype'] for key,value in msgDict.items(): if ((key != 'name') and (key != 'type') and (key != 'subtype')): print '\t',key,': ',value print '' logString = sys.argv[1] logFile = sys.argv[2] targetMsg = "" if (len(sys.argv) > 3): targetMsg = sys.argv[3] output = subprocess.check_output(['zgrep', logString, logFile]) lines = output.split("\n") for thisLine in lines: splitLine = thisLine.split("{") if (len(splitLine) > 1): thisMsg = splitLine[1] thisMsg = thisMsg[:-1] # print thisMsg splitMsg = thisMsg.split(", ") msgDict = {} for thisSplitMsg in splitMsg: # print thisSplitMsg keyValuePair = thisSplitMsg.split("=") msgDict[keyValuePair[0]] = keyValuePair[1] if ((targetMsg == "") or ((msgDict['name'].find(targetMsg)) != -1)): printMsg(msgDict)
#!/usr/bin/env python import sys import subprocess import signal def printMsg(msgDict): print msgDict['name'] print '\t','type: ',msgDict['type'] print '\t','subtype: ',msgDict['subtype'] for key,value in msgDict.items(): if ((key != 'name') and (key != 'type') and (key != 'subtype')): print '\t',key,': ',value print '' logString = sys.argv[1] logFile = sys.argv[2] targetMsg = "" if (len(sys.argv) > 3): targetMsg = sys.argv[3] output = subprocess.check_output(['zgrep', logString, logFile]) lines = output.split("\n") for thisLine in lines: splitLine = thisLine.split("{") if (len(splitLine) > 1): thisMsg = splitLine[1] thisMsg = thisMsg[:-1] # print thisMsg splitMsg = thisMsg.split(", ") msgDict = {} for thisSplitMsg in splitMsg: # print thisSplitMsg keyValuePair = thisSplitMsg.split("=") msgDict[keyValuePair[0]] = keyValuePair[1] if ((targetMsg == "") or ((msgDict['name'].find(targetMsg)) != -1)): printMsg(msgDict) Add some documentation about how to use this file.#!/usr/bin/env python import sys import subprocess import signal # example usage: # ./readLogFile.py "INFO: headers" /projects/databridge/howard/DataBridge/log/ingest.log Insert.Metadata # to find and display all of the Insert.Metadata.* messages. # # ./readLogFile.py "INFO: headers" /projects/databridge/howard/DataBridge/log/ingest.log # to read and display all messages in the ingest.log. # Note that this also works on gzipped files since it is using zgrep def printMsg(msgDict): print msgDict['name'] print '\t','type: ',msgDict['type'] print '\t','subtype: ',msgDict['subtype'] for key,value in msgDict.items(): if ((key != 'name') and (key != 'type') and (key != 'subtype')): print '\t',key,': ',value print '' logString = sys.argv[1] logFile = sys.argv[2] targetMsg = "" if (len(sys.argv) > 3): targetMsg = sys.argv[3] output = subprocess.check_output(['zgrep', logString, logFile]) lines = output.split("\n") for thisLine in lines: splitLine = thisLine.split("{") if (len(splitLine) > 1): thisMsg = splitLine[1] thisMsg = thisMsg[:-1] # print thisMsg splitMsg = thisMsg.split(", ") msgDict = {} for thisSplitMsg in splitMsg: # print thisSplitMsg keyValuePair = thisSplitMsg.split("=") msgDict[keyValuePair[0]] = keyValuePair[1] if ((targetMsg == "") or ((msgDict['name'].find(targetMsg)) != -1)): printMsg(msgDict)
<commit_before>#!/usr/bin/env python import sys import subprocess import signal def printMsg(msgDict): print msgDict['name'] print '\t','type: ',msgDict['type'] print '\t','subtype: ',msgDict['subtype'] for key,value in msgDict.items(): if ((key != 'name') and (key != 'type') and (key != 'subtype')): print '\t',key,': ',value print '' logString = sys.argv[1] logFile = sys.argv[2] targetMsg = "" if (len(sys.argv) > 3): targetMsg = sys.argv[3] output = subprocess.check_output(['zgrep', logString, logFile]) lines = output.split("\n") for thisLine in lines: splitLine = thisLine.split("{") if (len(splitLine) > 1): thisMsg = splitLine[1] thisMsg = thisMsg[:-1] # print thisMsg splitMsg = thisMsg.split(", ") msgDict = {} for thisSplitMsg in splitMsg: # print thisSplitMsg keyValuePair = thisSplitMsg.split("=") msgDict[keyValuePair[0]] = keyValuePair[1] if ((targetMsg == "") or ((msgDict['name'].find(targetMsg)) != -1)): printMsg(msgDict) <commit_msg>Add some documentation about how to use this file.<commit_after>#!/usr/bin/env python import sys import subprocess import signal # example usage: # ./readLogFile.py "INFO: headers" /projects/databridge/howard/DataBridge/log/ingest.log Insert.Metadata # to find and display all of the Insert.Metadata.* messages. # # ./readLogFile.py "INFO: headers" /projects/databridge/howard/DataBridge/log/ingest.log # to read and display all messages in the ingest.log. # Note that this also works on gzipped files since it is using zgrep def printMsg(msgDict): print msgDict['name'] print '\t','type: ',msgDict['type'] print '\t','subtype: ',msgDict['subtype'] for key,value in msgDict.items(): if ((key != 'name') and (key != 'type') and (key != 'subtype')): print '\t',key,': ',value print '' logString = sys.argv[1] logFile = sys.argv[2] targetMsg = "" if (len(sys.argv) > 3): targetMsg = sys.argv[3] output = subprocess.check_output(['zgrep', logString, logFile]) lines = output.split("\n") for thisLine in lines: splitLine = thisLine.split("{") if (len(splitLine) > 1): thisMsg = splitLine[1] thisMsg = thisMsg[:-1] # print thisMsg splitMsg = thisMsg.split(", ") msgDict = {} for thisSplitMsg in splitMsg: # print thisSplitMsg keyValuePair = thisSplitMsg.split("=") msgDict[keyValuePair[0]] = keyValuePair[1] if ((targetMsg == "") or ((msgDict['name'].find(targetMsg)) != -1)): printMsg(msgDict)
d626fd1e9f808c42df5a9147bcbeb5050b923c93
tests/conftest.py
tests/conftest.py
import os import sys from pathlib import Path import pytest if sys.version_info < (3, 4): print("Requires Python 3.4+") sys.exit(1) TESTS_ROOT = os.path.abspath(os.path.dirname(__file__)) PROJECT_ROOT = os.path.dirname(TESTS_ROOT) @pytest.fixture(scope="session") def resources(): return Path(TESTS_ROOT) / 'resources' @pytest.fixture(scope="function") def outdir(tmp_path): return tmp_path @pytest.fixture(scope="function") def outpdf(tmp_path): return tmp_path / 'out.pdf'
import os import sys from pathlib import Path import pytest if sys.version_info < (3, 6): print("Requires Python 3.6+") sys.exit(1) TESTS_ROOT = os.path.abspath(os.path.dirname(__file__)) PROJECT_ROOT = os.path.dirname(TESTS_ROOT) @pytest.fixture(scope="session") def resources(): return Path(TESTS_ROOT) / 'resources' @pytest.fixture(scope="function") def outdir(tmp_path): return tmp_path @pytest.fixture(scope="function") def outpdf(tmp_path): return tmp_path / 'out.pdf'
Test suite: don't try to run on Python < 3.6 anymore
Test suite: don't try to run on Python < 3.6 anymore
Python
mpl-2.0
pikepdf/pikepdf,pikepdf/pikepdf,pikepdf/pikepdf
import os import sys from pathlib import Path import pytest if sys.version_info < (3, 4): print("Requires Python 3.4+") sys.exit(1) TESTS_ROOT = os.path.abspath(os.path.dirname(__file__)) PROJECT_ROOT = os.path.dirname(TESTS_ROOT) @pytest.fixture(scope="session") def resources(): return Path(TESTS_ROOT) / 'resources' @pytest.fixture(scope="function") def outdir(tmp_path): return tmp_path @pytest.fixture(scope="function") def outpdf(tmp_path): return tmp_path / 'out.pdf' Test suite: don't try to run on Python < 3.6 anymore
import os import sys from pathlib import Path import pytest if sys.version_info < (3, 6): print("Requires Python 3.6+") sys.exit(1) TESTS_ROOT = os.path.abspath(os.path.dirname(__file__)) PROJECT_ROOT = os.path.dirname(TESTS_ROOT) @pytest.fixture(scope="session") def resources(): return Path(TESTS_ROOT) / 'resources' @pytest.fixture(scope="function") def outdir(tmp_path): return tmp_path @pytest.fixture(scope="function") def outpdf(tmp_path): return tmp_path / 'out.pdf'
<commit_before>import os import sys from pathlib import Path import pytest if sys.version_info < (3, 4): print("Requires Python 3.4+") sys.exit(1) TESTS_ROOT = os.path.abspath(os.path.dirname(__file__)) PROJECT_ROOT = os.path.dirname(TESTS_ROOT) @pytest.fixture(scope="session") def resources(): return Path(TESTS_ROOT) / 'resources' @pytest.fixture(scope="function") def outdir(tmp_path): return tmp_path @pytest.fixture(scope="function") def outpdf(tmp_path): return tmp_path / 'out.pdf' <commit_msg>Test suite: don't try to run on Python < 3.6 anymore<commit_after>
import os import sys from pathlib import Path import pytest if sys.version_info < (3, 6): print("Requires Python 3.6+") sys.exit(1) TESTS_ROOT = os.path.abspath(os.path.dirname(__file__)) PROJECT_ROOT = os.path.dirname(TESTS_ROOT) @pytest.fixture(scope="session") def resources(): return Path(TESTS_ROOT) / 'resources' @pytest.fixture(scope="function") def outdir(tmp_path): return tmp_path @pytest.fixture(scope="function") def outpdf(tmp_path): return tmp_path / 'out.pdf'
import os import sys from pathlib import Path import pytest if sys.version_info < (3, 4): print("Requires Python 3.4+") sys.exit(1) TESTS_ROOT = os.path.abspath(os.path.dirname(__file__)) PROJECT_ROOT = os.path.dirname(TESTS_ROOT) @pytest.fixture(scope="session") def resources(): return Path(TESTS_ROOT) / 'resources' @pytest.fixture(scope="function") def outdir(tmp_path): return tmp_path @pytest.fixture(scope="function") def outpdf(tmp_path): return tmp_path / 'out.pdf' Test suite: don't try to run on Python < 3.6 anymoreimport os import sys from pathlib import Path import pytest if sys.version_info < (3, 6): print("Requires Python 3.6+") sys.exit(1) TESTS_ROOT = os.path.abspath(os.path.dirname(__file__)) PROJECT_ROOT = os.path.dirname(TESTS_ROOT) @pytest.fixture(scope="session") def resources(): return Path(TESTS_ROOT) / 'resources' @pytest.fixture(scope="function") def outdir(tmp_path): return tmp_path @pytest.fixture(scope="function") def outpdf(tmp_path): return tmp_path / 'out.pdf'
<commit_before>import os import sys from pathlib import Path import pytest if sys.version_info < (3, 4): print("Requires Python 3.4+") sys.exit(1) TESTS_ROOT = os.path.abspath(os.path.dirname(__file__)) PROJECT_ROOT = os.path.dirname(TESTS_ROOT) @pytest.fixture(scope="session") def resources(): return Path(TESTS_ROOT) / 'resources' @pytest.fixture(scope="function") def outdir(tmp_path): return tmp_path @pytest.fixture(scope="function") def outpdf(tmp_path): return tmp_path / 'out.pdf' <commit_msg>Test suite: don't try to run on Python < 3.6 anymore<commit_after>import os import sys from pathlib import Path import pytest if sys.version_info < (3, 6): print("Requires Python 3.6+") sys.exit(1) TESTS_ROOT = os.path.abspath(os.path.dirname(__file__)) PROJECT_ROOT = os.path.dirname(TESTS_ROOT) @pytest.fixture(scope="session") def resources(): return Path(TESTS_ROOT) / 'resources' @pytest.fixture(scope="function") def outdir(tmp_path): return tmp_path @pytest.fixture(scope="function") def outpdf(tmp_path): return tmp_path / 'out.pdf'
2a3f4ff6686f1630348a73dd62d7ad8e3215dff5
tests/conftest.py
tests/conftest.py
import pytest from cattr import Converter @pytest.fixture() def converter(): return Converter()
import platform import pytest from hypothesis import HealthCheck, settings from cattr import Converter @pytest.fixture() def converter(): return Converter() if platform.python_implementation() == 'PyPy': settings.default.suppress_health_check.append(HealthCheck.too_slow)
Disable Hypothesis health check for PyPy.
Disable Hypothesis health check for PyPy.
Python
mit
python-attrs/cattrs,Tinche/cattrs
import pytest from cattr import Converter @pytest.fixture() def converter(): return Converter() Disable Hypothesis health check for PyPy.
import platform import pytest from hypothesis import HealthCheck, settings from cattr import Converter @pytest.fixture() def converter(): return Converter() if platform.python_implementation() == 'PyPy': settings.default.suppress_health_check.append(HealthCheck.too_slow)
<commit_before>import pytest from cattr import Converter @pytest.fixture() def converter(): return Converter() <commit_msg>Disable Hypothesis health check for PyPy.<commit_after>
import platform import pytest from hypothesis import HealthCheck, settings from cattr import Converter @pytest.fixture() def converter(): return Converter() if platform.python_implementation() == 'PyPy': settings.default.suppress_health_check.append(HealthCheck.too_slow)
import pytest from cattr import Converter @pytest.fixture() def converter(): return Converter() Disable Hypothesis health check for PyPy.import platform import pytest from hypothesis import HealthCheck, settings from cattr import Converter @pytest.fixture() def converter(): return Converter() if platform.python_implementation() == 'PyPy': settings.default.suppress_health_check.append(HealthCheck.too_slow)
<commit_before>import pytest from cattr import Converter @pytest.fixture() def converter(): return Converter() <commit_msg>Disable Hypothesis health check for PyPy.<commit_after>import platform import pytest from hypothesis import HealthCheck, settings from cattr import Converter @pytest.fixture() def converter(): return Converter() if platform.python_implementation() == 'PyPy': settings.default.suppress_health_check.append(HealthCheck.too_slow)
caaa5d9030dacacdc940bc2750a98eaabb82d0a7
src/engine/request_handler.py
src/engine/request_handler.py
import Queue import json import EBQP from . import world from . import types from . import consts class GameRequestHandler: def __init__(self): self.world = None self.responses = { EBQP.new: self.respond_new, } def process(self, request): request_pieces = request.split(EBQP.packet_delimiter, 1) command = request_pieces[0] params = request_pieces[1].strip() if len(request_pieces) > 1 else '' try: json_args = json.loads(params) except Exception as e: return "process:failure:bad json" if command in self.responses: return self.responses[command](json_args) else: return "process:failure:unsupported command" def respond_new(self, args): uids = args['uids'] self.world = world.World(uids) self.world.add_unit(uid1, types.new_unit('Tank', consts.RED)) self.responses = { EBQP.view: self.respond_view, EBQP.move: self.respond_move, } return 'new:success' def respond_view(self, args): return 'view:success:%s' % self.world.to_json() #TODO def respond_move(self, args): return 'move:failure:unimplemented'
import Queue import json import EBQP from . import world from . import types from . import consts class GameRequestHandler: def __init__(self): self.world = None self.responses = { EBQP.new: self.respond_new, } def process(self, request): request_pieces = request.split(EBQP.packet_delimiter, 1) command = request_pieces[0] params = request_pieces[1].strip() if len(request_pieces) > 1 else '' try: json_args = json.loads(params) except Exception as e: return "process:failure:bad json" if command in self.responses: return self.responses[command](json_args) else: return "process:failure:unsupported command" def respond_new(self, args): uids = args['uids'] self.world = world.World(uids) self.world.add_unit(uids[0], types.new_unit('Tank', consts.RED)) self.responses = { EBQP.view: self.respond_view, EBQP.move: self.respond_move, } return 'new:success' def respond_view(self, args): return 'view:success:%s' % self.world.to_json() #TODO def respond_move(self, args): return 'move:failure:unimplemented'
Fix crash on game creation
Fix crash on game creation
Python
mit
Tactique/game_engine,Tactique/game_engine
import Queue import json import EBQP from . import world from . import types from . import consts class GameRequestHandler: def __init__(self): self.world = None self.responses = { EBQP.new: self.respond_new, } def process(self, request): request_pieces = request.split(EBQP.packet_delimiter, 1) command = request_pieces[0] params = request_pieces[1].strip() if len(request_pieces) > 1 else '' try: json_args = json.loads(params) except Exception as e: return "process:failure:bad json" if command in self.responses: return self.responses[command](json_args) else: return "process:failure:unsupported command" def respond_new(self, args): uids = args['uids'] self.world = world.World(uids) self.world.add_unit(uid1, types.new_unit('Tank', consts.RED)) self.responses = { EBQP.view: self.respond_view, EBQP.move: self.respond_move, } return 'new:success' def respond_view(self, args): return 'view:success:%s' % self.world.to_json() #TODO def respond_move(self, args): return 'move:failure:unimplemented' Fix crash on game creation
import Queue import json import EBQP from . import world from . import types from . import consts class GameRequestHandler: def __init__(self): self.world = None self.responses = { EBQP.new: self.respond_new, } def process(self, request): request_pieces = request.split(EBQP.packet_delimiter, 1) command = request_pieces[0] params = request_pieces[1].strip() if len(request_pieces) > 1 else '' try: json_args = json.loads(params) except Exception as e: return "process:failure:bad json" if command in self.responses: return self.responses[command](json_args) else: return "process:failure:unsupported command" def respond_new(self, args): uids = args['uids'] self.world = world.World(uids) self.world.add_unit(uids[0], types.new_unit('Tank', consts.RED)) self.responses = { EBQP.view: self.respond_view, EBQP.move: self.respond_move, } return 'new:success' def respond_view(self, args): return 'view:success:%s' % self.world.to_json() #TODO def respond_move(self, args): return 'move:failure:unimplemented'
<commit_before>import Queue import json import EBQP from . import world from . import types from . import consts class GameRequestHandler: def __init__(self): self.world = None self.responses = { EBQP.new: self.respond_new, } def process(self, request): request_pieces = request.split(EBQP.packet_delimiter, 1) command = request_pieces[0] params = request_pieces[1].strip() if len(request_pieces) > 1 else '' try: json_args = json.loads(params) except Exception as e: return "process:failure:bad json" if command in self.responses: return self.responses[command](json_args) else: return "process:failure:unsupported command" def respond_new(self, args): uids = args['uids'] self.world = world.World(uids) self.world.add_unit(uid1, types.new_unit('Tank', consts.RED)) self.responses = { EBQP.view: self.respond_view, EBQP.move: self.respond_move, } return 'new:success' def respond_view(self, args): return 'view:success:%s' % self.world.to_json() #TODO def respond_move(self, args): return 'move:failure:unimplemented' <commit_msg>Fix crash on game creation<commit_after>
import Queue import json import EBQP from . import world from . import types from . import consts class GameRequestHandler: def __init__(self): self.world = None self.responses = { EBQP.new: self.respond_new, } def process(self, request): request_pieces = request.split(EBQP.packet_delimiter, 1) command = request_pieces[0] params = request_pieces[1].strip() if len(request_pieces) > 1 else '' try: json_args = json.loads(params) except Exception as e: return "process:failure:bad json" if command in self.responses: return self.responses[command](json_args) else: return "process:failure:unsupported command" def respond_new(self, args): uids = args['uids'] self.world = world.World(uids) self.world.add_unit(uids[0], types.new_unit('Tank', consts.RED)) self.responses = { EBQP.view: self.respond_view, EBQP.move: self.respond_move, } return 'new:success' def respond_view(self, args): return 'view:success:%s' % self.world.to_json() #TODO def respond_move(self, args): return 'move:failure:unimplemented'
import Queue import json import EBQP from . import world from . import types from . import consts class GameRequestHandler: def __init__(self): self.world = None self.responses = { EBQP.new: self.respond_new, } def process(self, request): request_pieces = request.split(EBQP.packet_delimiter, 1) command = request_pieces[0] params = request_pieces[1].strip() if len(request_pieces) > 1 else '' try: json_args = json.loads(params) except Exception as e: return "process:failure:bad json" if command in self.responses: return self.responses[command](json_args) else: return "process:failure:unsupported command" def respond_new(self, args): uids = args['uids'] self.world = world.World(uids) self.world.add_unit(uid1, types.new_unit('Tank', consts.RED)) self.responses = { EBQP.view: self.respond_view, EBQP.move: self.respond_move, } return 'new:success' def respond_view(self, args): return 'view:success:%s' % self.world.to_json() #TODO def respond_move(self, args): return 'move:failure:unimplemented' Fix crash on game creationimport Queue import json import EBQP from . import world from . import types from . import consts class GameRequestHandler: def __init__(self): self.world = None self.responses = { EBQP.new: self.respond_new, } def process(self, request): request_pieces = request.split(EBQP.packet_delimiter, 1) command = request_pieces[0] params = request_pieces[1].strip() if len(request_pieces) > 1 else '' try: json_args = json.loads(params) except Exception as e: return "process:failure:bad json" if command in self.responses: return self.responses[command](json_args) else: return "process:failure:unsupported command" def respond_new(self, args): uids = args['uids'] self.world = world.World(uids) self.world.add_unit(uids[0], types.new_unit('Tank', consts.RED)) self.responses = { EBQP.view: self.respond_view, EBQP.move: self.respond_move, } return 'new:success' def respond_view(self, args): return 'view:success:%s' % self.world.to_json() #TODO def respond_move(self, args): return 'move:failure:unimplemented'
<commit_before>import Queue import json import EBQP from . import world from . import types from . import consts class GameRequestHandler: def __init__(self): self.world = None self.responses = { EBQP.new: self.respond_new, } def process(self, request): request_pieces = request.split(EBQP.packet_delimiter, 1) command = request_pieces[0] params = request_pieces[1].strip() if len(request_pieces) > 1 else '' try: json_args = json.loads(params) except Exception as e: return "process:failure:bad json" if command in self.responses: return self.responses[command](json_args) else: return "process:failure:unsupported command" def respond_new(self, args): uids = args['uids'] self.world = world.World(uids) self.world.add_unit(uid1, types.new_unit('Tank', consts.RED)) self.responses = { EBQP.view: self.respond_view, EBQP.move: self.respond_move, } return 'new:success' def respond_view(self, args): return 'view:success:%s' % self.world.to_json() #TODO def respond_move(self, args): return 'move:failure:unimplemented' <commit_msg>Fix crash on game creation<commit_after>import Queue import json import EBQP from . import world from . import types from . import consts class GameRequestHandler: def __init__(self): self.world = None self.responses = { EBQP.new: self.respond_new, } def process(self, request): request_pieces = request.split(EBQP.packet_delimiter, 1) command = request_pieces[0] params = request_pieces[1].strip() if len(request_pieces) > 1 else '' try: json_args = json.loads(params) except Exception as e: return "process:failure:bad json" if command in self.responses: return self.responses[command](json_args) else: return "process:failure:unsupported command" def respond_new(self, args): uids = args['uids'] self.world = world.World(uids) self.world.add_unit(uids[0], types.new_unit('Tank', consts.RED)) self.responses = { EBQP.view: self.respond_view, EBQP.move: self.respond_move, } return 'new:success' def respond_view(self, args): return 'view:success:%s' % self.world.to_json() #TODO def respond_move(self, args): return 'move:failure:unimplemented'
b40adb2a54d7022e3ca13edea332e6c5b26feed8
start_bot.py
start_bot.py
#!/usr/bin/env python3 import logging from lrrbot.main import bot, log from common.config import config logging.basicConfig(level=config['loglevel'], format="[%(asctime)s] %(levelname)s:%(name)s:%(message)s") if config['logfile'] is not None: fileHandler = logging.FileHandler(config['logfile'], 'a', 'utf-8') fileHandler.formatter = logging.root.handlers[0].formatter logging.root.addHandler(fileHandler) import lrrbot.commands import lrrbot.serverevents bot.compile() try: log.info("Bot startup") bot.start() except (KeyboardInterrupt, SystemExit): pass finally: log.info("Bot shutdown") logging.shutdown()
#!/usr/bin/env python3 import logging from lrrbot.main import bot, log from common.config import config logging.basicConfig(level=config['loglevel'], format="[%(asctime)s] %(levelname)s:%(name)s:%(message)s") if config['logfile'] is not None: fileHandler = logging.FileHandler(config['logfile'], 'a', 'utf-8') fileHandler.formatter = logging.root.handlers[0].formatter logging.root.addHandler(fileHandler) logging.getLogger("requests").setLevel(logging.ERROR) import lrrbot.commands import lrrbot.serverevents bot.compile() try: log.info("Bot startup") bot.start() except (KeyboardInterrupt, SystemExit): pass finally: log.info("Bot shutdown") logging.shutdown()
Reduce some pubnub log noise
Reduce some pubnub log noise
Python
apache-2.0
mrphlip/lrrbot,andreasots/lrrbot,mrphlip/lrrbot,mrphlip/lrrbot,andreasots/lrrbot,andreasots/lrrbot
#!/usr/bin/env python3 import logging from lrrbot.main import bot, log from common.config import config logging.basicConfig(level=config['loglevel'], format="[%(asctime)s] %(levelname)s:%(name)s:%(message)s") if config['logfile'] is not None: fileHandler = logging.FileHandler(config['logfile'], 'a', 'utf-8') fileHandler.formatter = logging.root.handlers[0].formatter logging.root.addHandler(fileHandler) import lrrbot.commands import lrrbot.serverevents bot.compile() try: log.info("Bot startup") bot.start() except (KeyboardInterrupt, SystemExit): pass finally: log.info("Bot shutdown") logging.shutdown() Reduce some pubnub log noise
#!/usr/bin/env python3 import logging from lrrbot.main import bot, log from common.config import config logging.basicConfig(level=config['loglevel'], format="[%(asctime)s] %(levelname)s:%(name)s:%(message)s") if config['logfile'] is not None: fileHandler = logging.FileHandler(config['logfile'], 'a', 'utf-8') fileHandler.formatter = logging.root.handlers[0].formatter logging.root.addHandler(fileHandler) logging.getLogger("requests").setLevel(logging.ERROR) import lrrbot.commands import lrrbot.serverevents bot.compile() try: log.info("Bot startup") bot.start() except (KeyboardInterrupt, SystemExit): pass finally: log.info("Bot shutdown") logging.shutdown()
<commit_before>#!/usr/bin/env python3 import logging from lrrbot.main import bot, log from common.config import config logging.basicConfig(level=config['loglevel'], format="[%(asctime)s] %(levelname)s:%(name)s:%(message)s") if config['logfile'] is not None: fileHandler = logging.FileHandler(config['logfile'], 'a', 'utf-8') fileHandler.formatter = logging.root.handlers[0].formatter logging.root.addHandler(fileHandler) import lrrbot.commands import lrrbot.serverevents bot.compile() try: log.info("Bot startup") bot.start() except (KeyboardInterrupt, SystemExit): pass finally: log.info("Bot shutdown") logging.shutdown() <commit_msg>Reduce some pubnub log noise<commit_after>
#!/usr/bin/env python3 import logging from lrrbot.main import bot, log from common.config import config logging.basicConfig(level=config['loglevel'], format="[%(asctime)s] %(levelname)s:%(name)s:%(message)s") if config['logfile'] is not None: fileHandler = logging.FileHandler(config['logfile'], 'a', 'utf-8') fileHandler.formatter = logging.root.handlers[0].formatter logging.root.addHandler(fileHandler) logging.getLogger("requests").setLevel(logging.ERROR) import lrrbot.commands import lrrbot.serverevents bot.compile() try: log.info("Bot startup") bot.start() except (KeyboardInterrupt, SystemExit): pass finally: log.info("Bot shutdown") logging.shutdown()
#!/usr/bin/env python3 import logging from lrrbot.main import bot, log from common.config import config logging.basicConfig(level=config['loglevel'], format="[%(asctime)s] %(levelname)s:%(name)s:%(message)s") if config['logfile'] is not None: fileHandler = logging.FileHandler(config['logfile'], 'a', 'utf-8') fileHandler.formatter = logging.root.handlers[0].formatter logging.root.addHandler(fileHandler) import lrrbot.commands import lrrbot.serverevents bot.compile() try: log.info("Bot startup") bot.start() except (KeyboardInterrupt, SystemExit): pass finally: log.info("Bot shutdown") logging.shutdown() Reduce some pubnub log noise#!/usr/bin/env python3 import logging from lrrbot.main import bot, log from common.config import config logging.basicConfig(level=config['loglevel'], format="[%(asctime)s] %(levelname)s:%(name)s:%(message)s") if config['logfile'] is not None: fileHandler = logging.FileHandler(config['logfile'], 'a', 'utf-8') fileHandler.formatter = logging.root.handlers[0].formatter logging.root.addHandler(fileHandler) logging.getLogger("requests").setLevel(logging.ERROR) import lrrbot.commands import lrrbot.serverevents bot.compile() try: log.info("Bot startup") bot.start() except (KeyboardInterrupt, SystemExit): pass finally: log.info("Bot shutdown") logging.shutdown()
<commit_before>#!/usr/bin/env python3 import logging from lrrbot.main import bot, log from common.config import config logging.basicConfig(level=config['loglevel'], format="[%(asctime)s] %(levelname)s:%(name)s:%(message)s") if config['logfile'] is not None: fileHandler = logging.FileHandler(config['logfile'], 'a', 'utf-8') fileHandler.formatter = logging.root.handlers[0].formatter logging.root.addHandler(fileHandler) import lrrbot.commands import lrrbot.serverevents bot.compile() try: log.info("Bot startup") bot.start() except (KeyboardInterrupt, SystemExit): pass finally: log.info("Bot shutdown") logging.shutdown() <commit_msg>Reduce some pubnub log noise<commit_after>#!/usr/bin/env python3 import logging from lrrbot.main import bot, log from common.config import config logging.basicConfig(level=config['loglevel'], format="[%(asctime)s] %(levelname)s:%(name)s:%(message)s") if config['logfile'] is not None: fileHandler = logging.FileHandler(config['logfile'], 'a', 'utf-8') fileHandler.formatter = logging.root.handlers[0].formatter logging.root.addHandler(fileHandler) logging.getLogger("requests").setLevel(logging.ERROR) import lrrbot.commands import lrrbot.serverevents bot.compile() try: log.info("Bot startup") bot.start() except (KeyboardInterrupt, SystemExit): pass finally: log.info("Bot shutdown") logging.shutdown()
3d48f181f90995bd66dc436acccde9d18c5cfa3c
tests/settings.py
tests/settings.py
import django DATABASE_ENGINE = 'sqlite3' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', } } INSTALLED_APPS = [ 'django.contrib.sessions', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sites', 'django.contrib.comments', 'avatar', ] ROOT_URLCONF = 'tests.urls' SITE_ID = 1 SECRET_KEY = 'something-something' if django.VERSION[:2] < (1, 6): TEST_RUNNER = 'discover_runner.DiscoverRunner' ROOT_URLCONF = 'tests.urls' STATIC_URL = '/site_media/static/' AVATAR_ALLOWED_FILE_EXTS = ('.jpg', '.png') AVATAR_MAX_SIZE = 1024 * 1024 AVATAR_MAX_AVATARS_PER_USER = 20
import django DATABASE_ENGINE = 'sqlite3' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', } } INSTALLED_APPS = [ 'django.contrib.sessions', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sites', 'avatar', ] MIDDLEWARE_CLASSES = ( "django.middleware.common.BrokenLinkEmailsMiddleware", "django.middleware.common.CommonMiddleware", "django.contrib.sessions.middleware.SessionMiddleware", "django.middleware.csrf.CsrfViewMiddleware", "django.contrib.auth.middleware.AuthenticationMiddleware", "django.contrib.messages.middleware.MessageMiddleware", ) ROOT_URLCONF = 'tests.urls' SITE_ID = 1 SECRET_KEY = 'something-something' if django.VERSION[:2] < (1, 6): TEST_RUNNER = 'discover_runner.DiscoverRunner' ROOT_URLCONF = 'tests.urls' STATIC_URL = '/site_media/static/' AVATAR_ALLOWED_FILE_EXTS = ('.jpg', '.png') AVATAR_MAX_SIZE = 1024 * 1024 AVATAR_MAX_AVATARS_PER_USER = 20
Remove django.contrib.comments and add MIDDLEWARE_CLASSES
Remove django.contrib.comments and add MIDDLEWARE_CLASSES
Python
bsd-3-clause
imgmix/django-avatar,barbuza/django-avatar,grantmcconnaughey/django-avatar,ad-m/django-avatar,jezdez/django-avatar,MachineandMagic/django-avatar,barbuza/django-avatar,ad-m/django-avatar,grantmcconnaughey/django-avatar,dannybrowne86/django-avatar,dannybrowne86/django-avatar,therocode/django-avatar,therocode/django-avatar,MachineandMagic/django-avatar,imgmix/django-avatar,brajeshvit/avatarmodule,brajeshvit/avatarmodule,jezdez/django-avatar
import django DATABASE_ENGINE = 'sqlite3' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', } } INSTALLED_APPS = [ 'django.contrib.sessions', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sites', 'django.contrib.comments', 'avatar', ] ROOT_URLCONF = 'tests.urls' SITE_ID = 1 SECRET_KEY = 'something-something' if django.VERSION[:2] < (1, 6): TEST_RUNNER = 'discover_runner.DiscoverRunner' ROOT_URLCONF = 'tests.urls' STATIC_URL = '/site_media/static/' AVATAR_ALLOWED_FILE_EXTS = ('.jpg', '.png') AVATAR_MAX_SIZE = 1024 * 1024 AVATAR_MAX_AVATARS_PER_USER = 20 Remove django.contrib.comments and add MIDDLEWARE_CLASSES
import django DATABASE_ENGINE = 'sqlite3' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', } } INSTALLED_APPS = [ 'django.contrib.sessions', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sites', 'avatar', ] MIDDLEWARE_CLASSES = ( "django.middleware.common.BrokenLinkEmailsMiddleware", "django.middleware.common.CommonMiddleware", "django.contrib.sessions.middleware.SessionMiddleware", "django.middleware.csrf.CsrfViewMiddleware", "django.contrib.auth.middleware.AuthenticationMiddleware", "django.contrib.messages.middleware.MessageMiddleware", ) ROOT_URLCONF = 'tests.urls' SITE_ID = 1 SECRET_KEY = 'something-something' if django.VERSION[:2] < (1, 6): TEST_RUNNER = 'discover_runner.DiscoverRunner' ROOT_URLCONF = 'tests.urls' STATIC_URL = '/site_media/static/' AVATAR_ALLOWED_FILE_EXTS = ('.jpg', '.png') AVATAR_MAX_SIZE = 1024 * 1024 AVATAR_MAX_AVATARS_PER_USER = 20
<commit_before>import django DATABASE_ENGINE = 'sqlite3' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', } } INSTALLED_APPS = [ 'django.contrib.sessions', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sites', 'django.contrib.comments', 'avatar', ] ROOT_URLCONF = 'tests.urls' SITE_ID = 1 SECRET_KEY = 'something-something' if django.VERSION[:2] < (1, 6): TEST_RUNNER = 'discover_runner.DiscoverRunner' ROOT_URLCONF = 'tests.urls' STATIC_URL = '/site_media/static/' AVATAR_ALLOWED_FILE_EXTS = ('.jpg', '.png') AVATAR_MAX_SIZE = 1024 * 1024 AVATAR_MAX_AVATARS_PER_USER = 20 <commit_msg>Remove django.contrib.comments and add MIDDLEWARE_CLASSES<commit_after>
import django DATABASE_ENGINE = 'sqlite3' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', } } INSTALLED_APPS = [ 'django.contrib.sessions', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sites', 'avatar', ] MIDDLEWARE_CLASSES = ( "django.middleware.common.BrokenLinkEmailsMiddleware", "django.middleware.common.CommonMiddleware", "django.contrib.sessions.middleware.SessionMiddleware", "django.middleware.csrf.CsrfViewMiddleware", "django.contrib.auth.middleware.AuthenticationMiddleware", "django.contrib.messages.middleware.MessageMiddleware", ) ROOT_URLCONF = 'tests.urls' SITE_ID = 1 SECRET_KEY = 'something-something' if django.VERSION[:2] < (1, 6): TEST_RUNNER = 'discover_runner.DiscoverRunner' ROOT_URLCONF = 'tests.urls' STATIC_URL = '/site_media/static/' AVATAR_ALLOWED_FILE_EXTS = ('.jpg', '.png') AVATAR_MAX_SIZE = 1024 * 1024 AVATAR_MAX_AVATARS_PER_USER = 20
import django DATABASE_ENGINE = 'sqlite3' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', } } INSTALLED_APPS = [ 'django.contrib.sessions', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sites', 'django.contrib.comments', 'avatar', ] ROOT_URLCONF = 'tests.urls' SITE_ID = 1 SECRET_KEY = 'something-something' if django.VERSION[:2] < (1, 6): TEST_RUNNER = 'discover_runner.DiscoverRunner' ROOT_URLCONF = 'tests.urls' STATIC_URL = '/site_media/static/' AVATAR_ALLOWED_FILE_EXTS = ('.jpg', '.png') AVATAR_MAX_SIZE = 1024 * 1024 AVATAR_MAX_AVATARS_PER_USER = 20 Remove django.contrib.comments and add MIDDLEWARE_CLASSESimport django DATABASE_ENGINE = 'sqlite3' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', } } INSTALLED_APPS = [ 'django.contrib.sessions', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sites', 'avatar', ] MIDDLEWARE_CLASSES = ( "django.middleware.common.BrokenLinkEmailsMiddleware", "django.middleware.common.CommonMiddleware", "django.contrib.sessions.middleware.SessionMiddleware", "django.middleware.csrf.CsrfViewMiddleware", "django.contrib.auth.middleware.AuthenticationMiddleware", "django.contrib.messages.middleware.MessageMiddleware", ) ROOT_URLCONF = 'tests.urls' SITE_ID = 1 SECRET_KEY = 'something-something' if django.VERSION[:2] < (1, 6): TEST_RUNNER = 'discover_runner.DiscoverRunner' ROOT_URLCONF = 'tests.urls' STATIC_URL = '/site_media/static/' AVATAR_ALLOWED_FILE_EXTS = ('.jpg', '.png') AVATAR_MAX_SIZE = 1024 * 1024 AVATAR_MAX_AVATARS_PER_USER = 20
<commit_before>import django DATABASE_ENGINE = 'sqlite3' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', } } INSTALLED_APPS = [ 'django.contrib.sessions', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sites', 'django.contrib.comments', 'avatar', ] ROOT_URLCONF = 'tests.urls' SITE_ID = 1 SECRET_KEY = 'something-something' if django.VERSION[:2] < (1, 6): TEST_RUNNER = 'discover_runner.DiscoverRunner' ROOT_URLCONF = 'tests.urls' STATIC_URL = '/site_media/static/' AVATAR_ALLOWED_FILE_EXTS = ('.jpg', '.png') AVATAR_MAX_SIZE = 1024 * 1024 AVATAR_MAX_AVATARS_PER_USER = 20 <commit_msg>Remove django.contrib.comments and add MIDDLEWARE_CLASSES<commit_after>import django DATABASE_ENGINE = 'sqlite3' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', } } INSTALLED_APPS = [ 'django.contrib.sessions', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sites', 'avatar', ] MIDDLEWARE_CLASSES = ( "django.middleware.common.BrokenLinkEmailsMiddleware", "django.middleware.common.CommonMiddleware", "django.contrib.sessions.middleware.SessionMiddleware", "django.middleware.csrf.CsrfViewMiddleware", "django.contrib.auth.middleware.AuthenticationMiddleware", "django.contrib.messages.middleware.MessageMiddleware", ) ROOT_URLCONF = 'tests.urls' SITE_ID = 1 SECRET_KEY = 'something-something' if django.VERSION[:2] < (1, 6): TEST_RUNNER = 'discover_runner.DiscoverRunner' ROOT_URLCONF = 'tests.urls' STATIC_URL = '/site_media/static/' AVATAR_ALLOWED_FILE_EXTS = ('.jpg', '.png') AVATAR_MAX_SIZE = 1024 * 1024 AVATAR_MAX_AVATARS_PER_USER = 20
f8d3fb9e30d18a9ea5a749083aea1862092af2c4
tests/test_cli.py
tests/test_cli.py
from plim import syntax from plim.console import plimc from plim.util import PY3K from . import TestCaseBase class TestCLI(TestCaseBase): def setUp(self): super(TestCLI, self).setUp() self.mako_syntax = syntax.Mako() if PY3K: from io import BytesIO self.stdout = BytesIO() else: from StringIO import StringIO self.stdout = StringIO() def test_cli_mako_output(self): plimc(['tests/fixtures/unicode_attributes_test.plim'], stdout=self.stdout) def test_cli_html_output(self): plimc(['--html', 'tests/fixtures/unicode_attributes_test.plim'], stdout=self.stdout)
from plim import syntax from plim.console import plimc from plim.util import PY3K from . import TestCaseBase class TestCLI(TestCaseBase): def setUp(self): super(TestCLI, self).setUp() self.mako_syntax = syntax.Mako() if PY3K: from io import BytesIO self.stdout = BytesIO() else: from StringIO import StringIO self.stdout = StringIO() def test_cli_mako_output(self): plimc(['tests/fixtures/unicode_attributes_test.plim'], stdout=self.stdout) def test_cli_html_output(self): plimc(['--html', 'tests/fixtures/unicode_attributes_test.plim'], stdout=self.stdout)
Add cli tests, fix related bugs
Add cli tests, fix related bugs
Python
mit
kxxoling/Plim
from plim import syntax from plim.console import plimc from plim.util import PY3K from . import TestCaseBase class TestCLI(TestCaseBase): def setUp(self): super(TestCLI, self).setUp() self.mako_syntax = syntax.Mako() if PY3K: from io import BytesIO self.stdout = BytesIO() else: from StringIO import StringIO self.stdout = StringIO() def test_cli_mako_output(self): plimc(['tests/fixtures/unicode_attributes_test.plim'], stdout=self.stdout) def test_cli_html_output(self): plimc(['--html', 'tests/fixtures/unicode_attributes_test.plim'], stdout=self.stdout) Add cli tests, fix related bugs
from plim import syntax from plim.console import plimc from plim.util import PY3K from . import TestCaseBase class TestCLI(TestCaseBase): def setUp(self): super(TestCLI, self).setUp() self.mako_syntax = syntax.Mako() if PY3K: from io import BytesIO self.stdout = BytesIO() else: from StringIO import StringIO self.stdout = StringIO() def test_cli_mako_output(self): plimc(['tests/fixtures/unicode_attributes_test.plim'], stdout=self.stdout) def test_cli_html_output(self): plimc(['--html', 'tests/fixtures/unicode_attributes_test.plim'], stdout=self.stdout)
<commit_before>from plim import syntax from plim.console import plimc from plim.util import PY3K from . import TestCaseBase class TestCLI(TestCaseBase): def setUp(self): super(TestCLI, self).setUp() self.mako_syntax = syntax.Mako() if PY3K: from io import BytesIO self.stdout = BytesIO() else: from StringIO import StringIO self.stdout = StringIO() def test_cli_mako_output(self): plimc(['tests/fixtures/unicode_attributes_test.plim'], stdout=self.stdout) def test_cli_html_output(self): plimc(['--html', 'tests/fixtures/unicode_attributes_test.plim'], stdout=self.stdout) <commit_msg>Add cli tests, fix related bugs<commit_after>
from plim import syntax from plim.console import plimc from plim.util import PY3K from . import TestCaseBase class TestCLI(TestCaseBase): def setUp(self): super(TestCLI, self).setUp() self.mako_syntax = syntax.Mako() if PY3K: from io import BytesIO self.stdout = BytesIO() else: from StringIO import StringIO self.stdout = StringIO() def test_cli_mako_output(self): plimc(['tests/fixtures/unicode_attributes_test.plim'], stdout=self.stdout) def test_cli_html_output(self): plimc(['--html', 'tests/fixtures/unicode_attributes_test.plim'], stdout=self.stdout)
from plim import syntax from plim.console import plimc from plim.util import PY3K from . import TestCaseBase class TestCLI(TestCaseBase): def setUp(self): super(TestCLI, self).setUp() self.mako_syntax = syntax.Mako() if PY3K: from io import BytesIO self.stdout = BytesIO() else: from StringIO import StringIO self.stdout = StringIO() def test_cli_mako_output(self): plimc(['tests/fixtures/unicode_attributes_test.plim'], stdout=self.stdout) def test_cli_html_output(self): plimc(['--html', 'tests/fixtures/unicode_attributes_test.plim'], stdout=self.stdout) Add cli tests, fix related bugsfrom plim import syntax from plim.console import plimc from plim.util import PY3K from . import TestCaseBase class TestCLI(TestCaseBase): def setUp(self): super(TestCLI, self).setUp() self.mako_syntax = syntax.Mako() if PY3K: from io import BytesIO self.stdout = BytesIO() else: from StringIO import StringIO self.stdout = StringIO() def test_cli_mako_output(self): plimc(['tests/fixtures/unicode_attributes_test.plim'], stdout=self.stdout) def test_cli_html_output(self): plimc(['--html', 'tests/fixtures/unicode_attributes_test.plim'], stdout=self.stdout)
<commit_before>from plim import syntax from plim.console import plimc from plim.util import PY3K from . import TestCaseBase class TestCLI(TestCaseBase): def setUp(self): super(TestCLI, self).setUp() self.mako_syntax = syntax.Mako() if PY3K: from io import BytesIO self.stdout = BytesIO() else: from StringIO import StringIO self.stdout = StringIO() def test_cli_mako_output(self): plimc(['tests/fixtures/unicode_attributes_test.plim'], stdout=self.stdout) def test_cli_html_output(self): plimc(['--html', 'tests/fixtures/unicode_attributes_test.plim'], stdout=self.stdout) <commit_msg>Add cli tests, fix related bugs<commit_after>from plim import syntax from plim.console import plimc from plim.util import PY3K from . import TestCaseBase class TestCLI(TestCaseBase): def setUp(self): super(TestCLI, self).setUp() self.mako_syntax = syntax.Mako() if PY3K: from io import BytesIO self.stdout = BytesIO() else: from StringIO import StringIO self.stdout = StringIO() def test_cli_mako_output(self): plimc(['tests/fixtures/unicode_attributes_test.plim'], stdout=self.stdout) def test_cli_html_output(self): plimc(['--html', 'tests/fixtures/unicode_attributes_test.plim'], stdout=self.stdout)
2da853601e9746663aed35b51db3bfc7640dc9c3
publisher/middleware.py
publisher/middleware.py
from threading import current_thread class PublisherMiddleware(object): _draft_status = {} @staticmethod def is_draft(request): authenticated = request.user.is_authenticated() and request.user.is_staff is_draft = 'edit' in request.GET and authenticated return is_draft def process_request(self, request): PublisherMiddleware._draft_status[current_thread()] = self.is_draft(request) @staticmethod def process_response(request, response): try: del PublisherMiddleware._draft_status[current_thread()] except KeyError: pass return response @staticmethod def get_draft_status(): try: return PublisherMiddleware._draft_status[current_thread()] except KeyError: return False def get_draft_status(): return PublisherMiddleware.get_draft_status()
from threading import current_thread class PublisherMiddleware(object): _draft_status = {} @staticmethod def is_draft(request): authenticated = request.user.is_authenticated() and request.user.is_staff is_draft = 'edit' in request.GET and authenticated return is_draft def process_request(self, request): PublisherMiddleware._draft_status[current_thread()] = self.is_draft(request) @staticmethod def process_response(request, response): del PublisherMiddleware._draft_status[current_thread()] return response @staticmethod def get_draft_status(): try: return PublisherMiddleware._draft_status[current_thread()] except KeyError: return False def get_draft_status(): return PublisherMiddleware.get_draft_status()
Remove unecessary try.. except.. block from PublisherMiddleware.process_response().
Remove unecessary try.. except.. block from PublisherMiddleware.process_response(). The key should always be set by process_request(), which should always be called before process_response().
Python
bsd-3-clause
wearehoods/django-model-publisher-ai,wearehoods/django-model-publisher-ai,jp74/django-model-publisher,jp74/django-model-publisher,wearehoods/django-model-publisher-ai,jp74/django-model-publisher
from threading import current_thread class PublisherMiddleware(object): _draft_status = {} @staticmethod def is_draft(request): authenticated = request.user.is_authenticated() and request.user.is_staff is_draft = 'edit' in request.GET and authenticated return is_draft def process_request(self, request): PublisherMiddleware._draft_status[current_thread()] = self.is_draft(request) @staticmethod def process_response(request, response): try: del PublisherMiddleware._draft_status[current_thread()] except KeyError: pass return response @staticmethod def get_draft_status(): try: return PublisherMiddleware._draft_status[current_thread()] except KeyError: return False def get_draft_status(): return PublisherMiddleware.get_draft_status() Remove unecessary try.. except.. block from PublisherMiddleware.process_response(). The key should always be set by process_request(), which should always be called before process_response().
from threading import current_thread class PublisherMiddleware(object): _draft_status = {} @staticmethod def is_draft(request): authenticated = request.user.is_authenticated() and request.user.is_staff is_draft = 'edit' in request.GET and authenticated return is_draft def process_request(self, request): PublisherMiddleware._draft_status[current_thread()] = self.is_draft(request) @staticmethod def process_response(request, response): del PublisherMiddleware._draft_status[current_thread()] return response @staticmethod def get_draft_status(): try: return PublisherMiddleware._draft_status[current_thread()] except KeyError: return False def get_draft_status(): return PublisherMiddleware.get_draft_status()
<commit_before>from threading import current_thread class PublisherMiddleware(object): _draft_status = {} @staticmethod def is_draft(request): authenticated = request.user.is_authenticated() and request.user.is_staff is_draft = 'edit' in request.GET and authenticated return is_draft def process_request(self, request): PublisherMiddleware._draft_status[current_thread()] = self.is_draft(request) @staticmethod def process_response(request, response): try: del PublisherMiddleware._draft_status[current_thread()] except KeyError: pass return response @staticmethod def get_draft_status(): try: return PublisherMiddleware._draft_status[current_thread()] except KeyError: return False def get_draft_status(): return PublisherMiddleware.get_draft_status() <commit_msg>Remove unecessary try.. except.. block from PublisherMiddleware.process_response(). The key should always be set by process_request(), which should always be called before process_response().<commit_after>
from threading import current_thread class PublisherMiddleware(object): _draft_status = {} @staticmethod def is_draft(request): authenticated = request.user.is_authenticated() and request.user.is_staff is_draft = 'edit' in request.GET and authenticated return is_draft def process_request(self, request): PublisherMiddleware._draft_status[current_thread()] = self.is_draft(request) @staticmethod def process_response(request, response): del PublisherMiddleware._draft_status[current_thread()] return response @staticmethod def get_draft_status(): try: return PublisherMiddleware._draft_status[current_thread()] except KeyError: return False def get_draft_status(): return PublisherMiddleware.get_draft_status()
from threading import current_thread class PublisherMiddleware(object): _draft_status = {} @staticmethod def is_draft(request): authenticated = request.user.is_authenticated() and request.user.is_staff is_draft = 'edit' in request.GET and authenticated return is_draft def process_request(self, request): PublisherMiddleware._draft_status[current_thread()] = self.is_draft(request) @staticmethod def process_response(request, response): try: del PublisherMiddleware._draft_status[current_thread()] except KeyError: pass return response @staticmethod def get_draft_status(): try: return PublisherMiddleware._draft_status[current_thread()] except KeyError: return False def get_draft_status(): return PublisherMiddleware.get_draft_status() Remove unecessary try.. except.. block from PublisherMiddleware.process_response(). The key should always be set by process_request(), which should always be called before process_response().from threading import current_thread class PublisherMiddleware(object): _draft_status = {} @staticmethod def is_draft(request): authenticated = request.user.is_authenticated() and request.user.is_staff is_draft = 'edit' in request.GET and authenticated return is_draft def process_request(self, request): PublisherMiddleware._draft_status[current_thread()] = self.is_draft(request) @staticmethod def process_response(request, response): del PublisherMiddleware._draft_status[current_thread()] return response @staticmethod def get_draft_status(): try: return PublisherMiddleware._draft_status[current_thread()] except KeyError: return False def get_draft_status(): return PublisherMiddleware.get_draft_status()
<commit_before>from threading import current_thread class PublisherMiddleware(object): _draft_status = {} @staticmethod def is_draft(request): authenticated = request.user.is_authenticated() and request.user.is_staff is_draft = 'edit' in request.GET and authenticated return is_draft def process_request(self, request): PublisherMiddleware._draft_status[current_thread()] = self.is_draft(request) @staticmethod def process_response(request, response): try: del PublisherMiddleware._draft_status[current_thread()] except KeyError: pass return response @staticmethod def get_draft_status(): try: return PublisherMiddleware._draft_status[current_thread()] except KeyError: return False def get_draft_status(): return PublisherMiddleware.get_draft_status() <commit_msg>Remove unecessary try.. except.. block from PublisherMiddleware.process_response(). The key should always be set by process_request(), which should always be called before process_response().<commit_after>from threading import current_thread class PublisherMiddleware(object): _draft_status = {} @staticmethod def is_draft(request): authenticated = request.user.is_authenticated() and request.user.is_staff is_draft = 'edit' in request.GET and authenticated return is_draft def process_request(self, request): PublisherMiddleware._draft_status[current_thread()] = self.is_draft(request) @staticmethod def process_response(request, response): del PublisherMiddleware._draft_status[current_thread()] return response @staticmethod def get_draft_status(): try: return PublisherMiddleware._draft_status[current_thread()] except KeyError: return False def get_draft_status(): return PublisherMiddleware.get_draft_status()