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
4eca24ce59e9bffd0b8eb56ed75a16ccf9dfed89
tensorflow_datasets/proto/__init__.py
tensorflow_datasets/proto/__init__.py
# coding=utf-8 # Copyright 2021 The TensorFlow Datasets Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # 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. """Public API of the proto package.""" # pylint: disable=g-import-not-at-top,g-importing-member, import-outside-toplevel try: # pylint: disable=g-statement-before-imports from waymo_open_dataset import waymo_dataset_pb2 except ImportError: # If original waymo proto is not found, fallback to the pre-generated proto from tensorflow_datasets.proto import waymo_dataset_generated_pb2 as waymo_dataset_pb2 # pylint: disable=line-too-long
# coding=utf-8 # Copyright 2021 The TensorFlow Datasets Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # 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. """Public API of the proto package.""" # pylint: disable=g-import-not-at-top,g-importing-member, import-outside-toplevel try: # pylint: disable=g-statement-before-imports from waymo_open_dataset import dataset_pb2 as waymo_dataset_pb2 except ImportError: # If original waymo proto is not found, fallback to the pre-generated proto from tensorflow_datasets.proto import waymo_dataset_generated_pb2 as waymo_dataset_pb2 # pylint: disable=line-too-long
Fix waymo open dataset proto import.
Fix waymo open dataset proto import. PiperOrigin-RevId: 355350302
Python
apache-2.0
tensorflow/datasets,tensorflow/datasets,tensorflow/datasets,tensorflow/datasets,tensorflow/datasets
# coding=utf-8 # Copyright 2021 The TensorFlow Datasets Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # 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. """Public API of the proto package.""" # pylint: disable=g-import-not-at-top,g-importing-member, import-outside-toplevel try: # pylint: disable=g-statement-before-imports from waymo_open_dataset import waymo_dataset_pb2 except ImportError: # If original waymo proto is not found, fallback to the pre-generated proto from tensorflow_datasets.proto import waymo_dataset_generated_pb2 as waymo_dataset_pb2 # pylint: disable=line-too-long Fix waymo open dataset proto import. PiperOrigin-RevId: 355350302
# coding=utf-8 # Copyright 2021 The TensorFlow Datasets Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # 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. """Public API of the proto package.""" # pylint: disable=g-import-not-at-top,g-importing-member, import-outside-toplevel try: # pylint: disable=g-statement-before-imports from waymo_open_dataset import dataset_pb2 as waymo_dataset_pb2 except ImportError: # If original waymo proto is not found, fallback to the pre-generated proto from tensorflow_datasets.proto import waymo_dataset_generated_pb2 as waymo_dataset_pb2 # pylint: disable=line-too-long
<commit_before># coding=utf-8 # Copyright 2021 The TensorFlow Datasets Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # 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. """Public API of the proto package.""" # pylint: disable=g-import-not-at-top,g-importing-member, import-outside-toplevel try: # pylint: disable=g-statement-before-imports from waymo_open_dataset import waymo_dataset_pb2 except ImportError: # If original waymo proto is not found, fallback to the pre-generated proto from tensorflow_datasets.proto import waymo_dataset_generated_pb2 as waymo_dataset_pb2 # pylint: disable=line-too-long <commit_msg>Fix waymo open dataset proto import. PiperOrigin-RevId: 355350302<commit_after>
# coding=utf-8 # Copyright 2021 The TensorFlow Datasets Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # 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. """Public API of the proto package.""" # pylint: disable=g-import-not-at-top,g-importing-member, import-outside-toplevel try: # pylint: disable=g-statement-before-imports from waymo_open_dataset import dataset_pb2 as waymo_dataset_pb2 except ImportError: # If original waymo proto is not found, fallback to the pre-generated proto from tensorflow_datasets.proto import waymo_dataset_generated_pb2 as waymo_dataset_pb2 # pylint: disable=line-too-long
# coding=utf-8 # Copyright 2021 The TensorFlow Datasets Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # 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. """Public API of the proto package.""" # pylint: disable=g-import-not-at-top,g-importing-member, import-outside-toplevel try: # pylint: disable=g-statement-before-imports from waymo_open_dataset import waymo_dataset_pb2 except ImportError: # If original waymo proto is not found, fallback to the pre-generated proto from tensorflow_datasets.proto import waymo_dataset_generated_pb2 as waymo_dataset_pb2 # pylint: disable=line-too-long Fix waymo open dataset proto import. PiperOrigin-RevId: 355350302# coding=utf-8 # Copyright 2021 The TensorFlow Datasets Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # 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. """Public API of the proto package.""" # pylint: disable=g-import-not-at-top,g-importing-member, import-outside-toplevel try: # pylint: disable=g-statement-before-imports from waymo_open_dataset import dataset_pb2 as waymo_dataset_pb2 except ImportError: # If original waymo proto is not found, fallback to the pre-generated proto from tensorflow_datasets.proto import waymo_dataset_generated_pb2 as waymo_dataset_pb2 # pylint: disable=line-too-long
<commit_before># coding=utf-8 # Copyright 2021 The TensorFlow Datasets Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # 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. """Public API of the proto package.""" # pylint: disable=g-import-not-at-top,g-importing-member, import-outside-toplevel try: # pylint: disable=g-statement-before-imports from waymo_open_dataset import waymo_dataset_pb2 except ImportError: # If original waymo proto is not found, fallback to the pre-generated proto from tensorflow_datasets.proto import waymo_dataset_generated_pb2 as waymo_dataset_pb2 # pylint: disable=line-too-long <commit_msg>Fix waymo open dataset proto import. PiperOrigin-RevId: 355350302<commit_after># coding=utf-8 # Copyright 2021 The TensorFlow Datasets Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # 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. """Public API of the proto package.""" # pylint: disable=g-import-not-at-top,g-importing-member, import-outside-toplevel try: # pylint: disable=g-statement-before-imports from waymo_open_dataset import dataset_pb2 as waymo_dataset_pb2 except ImportError: # If original waymo proto is not found, fallback to the pre-generated proto from tensorflow_datasets.proto import waymo_dataset_generated_pb2 as waymo_dataset_pb2 # pylint: disable=line-too-long
64f43c5b78d667054f288b382a98dc55710216de
units/calculation.py
units/calculation.py
import operator from pyparsing import Forward, Group, Literal, nums, Suppress, Word expression_stack = [] def push_first(tokens): expression_stack.append(tokens[0]) """ atom :: '0'..'9'+ | '(' expression ')' term :: atom [ ('*' | '/') atom ]* expression :: term [ ('+' | '-') term ]* """ expression = Forward() atom = (Word(nums)).setParseAction(push_first) | Group(Suppress('(') + expression + Suppress(')')) term = atom + ((Literal('*') | Literal('/')) + atom).setParseAction(push_first)[...] expression <<= term + ((Literal('+') | Literal('-')) + term).setParseAction(push_first)[...] operations = { '+': operator.add, '-': operator.sub, '*': operator.mul, '/': operator.truediv } def evaluate_stack(stack): token = stack.pop() if token in "+-*/": # Operands are pushed onto the stack in reverse order operand_2 = evaluate_stack(stack) operand_1 = evaluate_stack(stack) return operations[token](operand_1, operand_2) else: return int(token) def calculate(input_string): expression_stack.clear() expression.parseString(input_string, parseAll=True) # can raise pyparsing.ParseException return evaluate_stack(expression_stack) # can raise ZeroDivisionError
import operator from pyparsing import Forward, Group, Literal, nums, Suppress, Word expression_stack = [] def push_first(tokens): expression_stack.append(tokens[0]) """ atom :: '0'..'9'+ | '(' expression ')' term :: atom [ ('*' | '/') atom ]* expression :: term [ ('+' | '-') term ]* """ expression = Forward() atom = (Word(nums)).setParseAction(push_first) | Group(Suppress('(') + expression + Suppress(')')) term = atom + ((Literal('*') | Literal('/')) + atom).setParseAction(push_first)[...] expression <<= term + ((Literal('+') | Literal('-')) + term).setParseAction(push_first)[...] operations = { '+': operator.add, '-': operator.sub, '*': operator.mul, '/': operator.truediv } def evaluate_stack(stack): token = stack.pop() if token in "+-*/": # Operands are pushed onto the stack in reverse order operand_2 = evaluate_stack(stack) operand_1 = evaluate_stack(stack) return operations[token](operand_1, operand_2) else: return int(token) def calculate(input_string: str): expression_stack.clear() expression.parseString(input_string, parseAll=True) # can raise pyparsing.ParseException return evaluate_stack(expression_stack) # can raise ZeroDivisionError
Add type hint to calculate function
[Units] Add type hint to calculate function
Python
mit
Harmon758/Harmonbot,Harmon758/Harmonbot
import operator from pyparsing import Forward, Group, Literal, nums, Suppress, Word expression_stack = [] def push_first(tokens): expression_stack.append(tokens[0]) """ atom :: '0'..'9'+ | '(' expression ')' term :: atom [ ('*' | '/') atom ]* expression :: term [ ('+' | '-') term ]* """ expression = Forward() atom = (Word(nums)).setParseAction(push_first) | Group(Suppress('(') + expression + Suppress(')')) term = atom + ((Literal('*') | Literal('/')) + atom).setParseAction(push_first)[...] expression <<= term + ((Literal('+') | Literal('-')) + term).setParseAction(push_first)[...] operations = { '+': operator.add, '-': operator.sub, '*': operator.mul, '/': operator.truediv } def evaluate_stack(stack): token = stack.pop() if token in "+-*/": # Operands are pushed onto the stack in reverse order operand_2 = evaluate_stack(stack) operand_1 = evaluate_stack(stack) return operations[token](operand_1, operand_2) else: return int(token) def calculate(input_string): expression_stack.clear() expression.parseString(input_string, parseAll=True) # can raise pyparsing.ParseException return evaluate_stack(expression_stack) # can raise ZeroDivisionError [Units] Add type hint to calculate function
import operator from pyparsing import Forward, Group, Literal, nums, Suppress, Word expression_stack = [] def push_first(tokens): expression_stack.append(tokens[0]) """ atom :: '0'..'9'+ | '(' expression ')' term :: atom [ ('*' | '/') atom ]* expression :: term [ ('+' | '-') term ]* """ expression = Forward() atom = (Word(nums)).setParseAction(push_first) | Group(Suppress('(') + expression + Suppress(')')) term = atom + ((Literal('*') | Literal('/')) + atom).setParseAction(push_first)[...] expression <<= term + ((Literal('+') | Literal('-')) + term).setParseAction(push_first)[...] operations = { '+': operator.add, '-': operator.sub, '*': operator.mul, '/': operator.truediv } def evaluate_stack(stack): token = stack.pop() if token in "+-*/": # Operands are pushed onto the stack in reverse order operand_2 = evaluate_stack(stack) operand_1 = evaluate_stack(stack) return operations[token](operand_1, operand_2) else: return int(token) def calculate(input_string: str): expression_stack.clear() expression.parseString(input_string, parseAll=True) # can raise pyparsing.ParseException return evaluate_stack(expression_stack) # can raise ZeroDivisionError
<commit_before> import operator from pyparsing import Forward, Group, Literal, nums, Suppress, Word expression_stack = [] def push_first(tokens): expression_stack.append(tokens[0]) """ atom :: '0'..'9'+ | '(' expression ')' term :: atom [ ('*' | '/') atom ]* expression :: term [ ('+' | '-') term ]* """ expression = Forward() atom = (Word(nums)).setParseAction(push_first) | Group(Suppress('(') + expression + Suppress(')')) term = atom + ((Literal('*') | Literal('/')) + atom).setParseAction(push_first)[...] expression <<= term + ((Literal('+') | Literal('-')) + term).setParseAction(push_first)[...] operations = { '+': operator.add, '-': operator.sub, '*': operator.mul, '/': operator.truediv } def evaluate_stack(stack): token = stack.pop() if token in "+-*/": # Operands are pushed onto the stack in reverse order operand_2 = evaluate_stack(stack) operand_1 = evaluate_stack(stack) return operations[token](operand_1, operand_2) else: return int(token) def calculate(input_string): expression_stack.clear() expression.parseString(input_string, parseAll=True) # can raise pyparsing.ParseException return evaluate_stack(expression_stack) # can raise ZeroDivisionError <commit_msg>[Units] Add type hint to calculate function<commit_after>
import operator from pyparsing import Forward, Group, Literal, nums, Suppress, Word expression_stack = [] def push_first(tokens): expression_stack.append(tokens[0]) """ atom :: '0'..'9'+ | '(' expression ')' term :: atom [ ('*' | '/') atom ]* expression :: term [ ('+' | '-') term ]* """ expression = Forward() atom = (Word(nums)).setParseAction(push_first) | Group(Suppress('(') + expression + Suppress(')')) term = atom + ((Literal('*') | Literal('/')) + atom).setParseAction(push_first)[...] expression <<= term + ((Literal('+') | Literal('-')) + term).setParseAction(push_first)[...] operations = { '+': operator.add, '-': operator.sub, '*': operator.mul, '/': operator.truediv } def evaluate_stack(stack): token = stack.pop() if token in "+-*/": # Operands are pushed onto the stack in reverse order operand_2 = evaluate_stack(stack) operand_1 = evaluate_stack(stack) return operations[token](operand_1, operand_2) else: return int(token) def calculate(input_string: str): expression_stack.clear() expression.parseString(input_string, parseAll=True) # can raise pyparsing.ParseException return evaluate_stack(expression_stack) # can raise ZeroDivisionError
import operator from pyparsing import Forward, Group, Literal, nums, Suppress, Word expression_stack = [] def push_first(tokens): expression_stack.append(tokens[0]) """ atom :: '0'..'9'+ | '(' expression ')' term :: atom [ ('*' | '/') atom ]* expression :: term [ ('+' | '-') term ]* """ expression = Forward() atom = (Word(nums)).setParseAction(push_first) | Group(Suppress('(') + expression + Suppress(')')) term = atom + ((Literal('*') | Literal('/')) + atom).setParseAction(push_first)[...] expression <<= term + ((Literal('+') | Literal('-')) + term).setParseAction(push_first)[...] operations = { '+': operator.add, '-': operator.sub, '*': operator.mul, '/': operator.truediv } def evaluate_stack(stack): token = stack.pop() if token in "+-*/": # Operands are pushed onto the stack in reverse order operand_2 = evaluate_stack(stack) operand_1 = evaluate_stack(stack) return operations[token](operand_1, operand_2) else: return int(token) def calculate(input_string): expression_stack.clear() expression.parseString(input_string, parseAll=True) # can raise pyparsing.ParseException return evaluate_stack(expression_stack) # can raise ZeroDivisionError [Units] Add type hint to calculate function import operator from pyparsing import Forward, Group, Literal, nums, Suppress, Word expression_stack = [] def push_first(tokens): expression_stack.append(tokens[0]) """ atom :: '0'..'9'+ | '(' expression ')' term :: atom [ ('*' | '/') atom ]* expression :: term [ ('+' | '-') term ]* """ expression = Forward() atom = (Word(nums)).setParseAction(push_first) | Group(Suppress('(') + expression + Suppress(')')) term = atom + ((Literal('*') | Literal('/')) + atom).setParseAction(push_first)[...] expression <<= term + ((Literal('+') | Literal('-')) + term).setParseAction(push_first)[...] operations = { '+': operator.add, '-': operator.sub, '*': operator.mul, '/': operator.truediv } def evaluate_stack(stack): token = stack.pop() if token in "+-*/": # Operands are pushed onto the stack in reverse order operand_2 = evaluate_stack(stack) operand_1 = evaluate_stack(stack) return operations[token](operand_1, operand_2) else: return int(token) def calculate(input_string: str): expression_stack.clear() expression.parseString(input_string, parseAll=True) # can raise pyparsing.ParseException return evaluate_stack(expression_stack) # can raise ZeroDivisionError
<commit_before> import operator from pyparsing import Forward, Group, Literal, nums, Suppress, Word expression_stack = [] def push_first(tokens): expression_stack.append(tokens[0]) """ atom :: '0'..'9'+ | '(' expression ')' term :: atom [ ('*' | '/') atom ]* expression :: term [ ('+' | '-') term ]* """ expression = Forward() atom = (Word(nums)).setParseAction(push_first) | Group(Suppress('(') + expression + Suppress(')')) term = atom + ((Literal('*') | Literal('/')) + atom).setParseAction(push_first)[...] expression <<= term + ((Literal('+') | Literal('-')) + term).setParseAction(push_first)[...] operations = { '+': operator.add, '-': operator.sub, '*': operator.mul, '/': operator.truediv } def evaluate_stack(stack): token = stack.pop() if token in "+-*/": # Operands are pushed onto the stack in reverse order operand_2 = evaluate_stack(stack) operand_1 = evaluate_stack(stack) return operations[token](operand_1, operand_2) else: return int(token) def calculate(input_string): expression_stack.clear() expression.parseString(input_string, parseAll=True) # can raise pyparsing.ParseException return evaluate_stack(expression_stack) # can raise ZeroDivisionError <commit_msg>[Units] Add type hint to calculate function<commit_after> import operator from pyparsing import Forward, Group, Literal, nums, Suppress, Word expression_stack = [] def push_first(tokens): expression_stack.append(tokens[0]) """ atom :: '0'..'9'+ | '(' expression ')' term :: atom [ ('*' | '/') atom ]* expression :: term [ ('+' | '-') term ]* """ expression = Forward() atom = (Word(nums)).setParseAction(push_first) | Group(Suppress('(') + expression + Suppress(')')) term = atom + ((Literal('*') | Literal('/')) + atom).setParseAction(push_first)[...] expression <<= term + ((Literal('+') | Literal('-')) + term).setParseAction(push_first)[...] operations = { '+': operator.add, '-': operator.sub, '*': operator.mul, '/': operator.truediv } def evaluate_stack(stack): token = stack.pop() if token in "+-*/": # Operands are pushed onto the stack in reverse order operand_2 = evaluate_stack(stack) operand_1 = evaluate_stack(stack) return operations[token](operand_1, operand_2) else: return int(token) def calculate(input_string: str): expression_stack.clear() expression.parseString(input_string, parseAll=True) # can raise pyparsing.ParseException return evaluate_stack(expression_stack) # can raise ZeroDivisionError
121c886dfe02ed8cd71075a03e268d51bcb137fc
institutions/respondants/search_indexes.py
institutions/respondants/search_indexes.py
from haystack import indexes from respondants.models import Institution class InstitutionIndex(indexes.SearchIndex, indexes.Indexable): """Search Index associated with an institution. Allows for searching by name or lender id""" text = indexes.CharField(document=True, model_attr='name') text_auto = indexes.EdgeNgramField(model_attr='name') lender_id = indexes.CharField() assets = indexes.IntegerField(model_attr='assets') num_loans = indexes.IntegerField(model_attr='num_loans') def get_model(self): return Institution def index_queryset(self, using=None): """To account for the somewhat complicated count query, we need to add an "extra" annotation""" subquery_tail = """ FROM hmda_hmdarecord WHERE year = 2013 AND hmda_hmdarecord.lender = CAST(respondants_institution.agency_id AS VARCHAR(1)) || respondants_institution.ffiec_id""" return self.get_model().objects.extra( select={"num_loans": "SELECT COUNT(*) " + subquery_tail}, where=["SELECT COUNT(*) > 0 " + subquery_tail]) def read_queryset(self, using=None): """A more efficient query than the index query -- makes use of select related and does not include the num_loans calculation.""" return self.get_model().objects.select_related('zip_code', 'agency') def prepare_lender_id(self, institution): return str(institution.agency_id) + institution.ffiec_id
from haystack import indexes from respondants.models import Institution class InstitutionIndex(indexes.SearchIndex, indexes.Indexable): """Search Index associated with an institution. Allows for searching by name or lender id""" text = indexes.CharField(document=True, model_attr='name') text_auto = indexes.EdgeNgramField(model_attr='name') lender_id = indexes.CharField() assets = indexes.IntegerField(model_attr='assets') num_loans = indexes.IntegerField(model_attr='num_loans') def get_model(self): return Institution def index_queryset(self, using=None): """To account for the somewhat complicated count query, we need to add an "extra" annotation""" subquery_tail = """ FROM hmda_hmdarecord WHERE hmda_hmdarecord.lender = CAST(respondants_institution.agency_id AS VARCHAR(1)) || respondants_institution.ffiec_id""" return self.get_model().objects.extra( select={"num_loans": "SELECT COUNT(*) " + subquery_tail}, where=["SELECT COUNT(*) > 0 " + subquery_tail]) def read_queryset(self, using=None): """A more efficient query than the index query -- makes use of select related and does not include the num_loans calculation.""" return self.get_model().objects.select_related('zip_code', 'agency') def prepare_lender_id(self, institution): return str(institution.agency_id) + institution.ffiec_id
Revert "adding 2013 to search query"
Revert "adding 2013 to search query"
Python
cc0-1.0
mehtadev17/mapusaurus,mehtadev17/mapusaurus,mehtadev17/mapusaurus
from haystack import indexes from respondants.models import Institution class InstitutionIndex(indexes.SearchIndex, indexes.Indexable): """Search Index associated with an institution. Allows for searching by name or lender id""" text = indexes.CharField(document=True, model_attr='name') text_auto = indexes.EdgeNgramField(model_attr='name') lender_id = indexes.CharField() assets = indexes.IntegerField(model_attr='assets') num_loans = indexes.IntegerField(model_attr='num_loans') def get_model(self): return Institution def index_queryset(self, using=None): """To account for the somewhat complicated count query, we need to add an "extra" annotation""" subquery_tail = """ FROM hmda_hmdarecord WHERE year = 2013 AND hmda_hmdarecord.lender = CAST(respondants_institution.agency_id AS VARCHAR(1)) || respondants_institution.ffiec_id""" return self.get_model().objects.extra( select={"num_loans": "SELECT COUNT(*) " + subquery_tail}, where=["SELECT COUNT(*) > 0 " + subquery_tail]) def read_queryset(self, using=None): """A more efficient query than the index query -- makes use of select related and does not include the num_loans calculation.""" return self.get_model().objects.select_related('zip_code', 'agency') def prepare_lender_id(self, institution): return str(institution.agency_id) + institution.ffiec_id Revert "adding 2013 to search query"
from haystack import indexes from respondants.models import Institution class InstitutionIndex(indexes.SearchIndex, indexes.Indexable): """Search Index associated with an institution. Allows for searching by name or lender id""" text = indexes.CharField(document=True, model_attr='name') text_auto = indexes.EdgeNgramField(model_attr='name') lender_id = indexes.CharField() assets = indexes.IntegerField(model_attr='assets') num_loans = indexes.IntegerField(model_attr='num_loans') def get_model(self): return Institution def index_queryset(self, using=None): """To account for the somewhat complicated count query, we need to add an "extra" annotation""" subquery_tail = """ FROM hmda_hmdarecord WHERE hmda_hmdarecord.lender = CAST(respondants_institution.agency_id AS VARCHAR(1)) || respondants_institution.ffiec_id""" return self.get_model().objects.extra( select={"num_loans": "SELECT COUNT(*) " + subquery_tail}, where=["SELECT COUNT(*) > 0 " + subquery_tail]) def read_queryset(self, using=None): """A more efficient query than the index query -- makes use of select related and does not include the num_loans calculation.""" return self.get_model().objects.select_related('zip_code', 'agency') def prepare_lender_id(self, institution): return str(institution.agency_id) + institution.ffiec_id
<commit_before>from haystack import indexes from respondants.models import Institution class InstitutionIndex(indexes.SearchIndex, indexes.Indexable): """Search Index associated with an institution. Allows for searching by name or lender id""" text = indexes.CharField(document=True, model_attr='name') text_auto = indexes.EdgeNgramField(model_attr='name') lender_id = indexes.CharField() assets = indexes.IntegerField(model_attr='assets') num_loans = indexes.IntegerField(model_attr='num_loans') def get_model(self): return Institution def index_queryset(self, using=None): """To account for the somewhat complicated count query, we need to add an "extra" annotation""" subquery_tail = """ FROM hmda_hmdarecord WHERE year = 2013 AND hmda_hmdarecord.lender = CAST(respondants_institution.agency_id AS VARCHAR(1)) || respondants_institution.ffiec_id""" return self.get_model().objects.extra( select={"num_loans": "SELECT COUNT(*) " + subquery_tail}, where=["SELECT COUNT(*) > 0 " + subquery_tail]) def read_queryset(self, using=None): """A more efficient query than the index query -- makes use of select related and does not include the num_loans calculation.""" return self.get_model().objects.select_related('zip_code', 'agency') def prepare_lender_id(self, institution): return str(institution.agency_id) + institution.ffiec_id <commit_msg>Revert "adding 2013 to search query"<commit_after>
from haystack import indexes from respondants.models import Institution class InstitutionIndex(indexes.SearchIndex, indexes.Indexable): """Search Index associated with an institution. Allows for searching by name or lender id""" text = indexes.CharField(document=True, model_attr='name') text_auto = indexes.EdgeNgramField(model_attr='name') lender_id = indexes.CharField() assets = indexes.IntegerField(model_attr='assets') num_loans = indexes.IntegerField(model_attr='num_loans') def get_model(self): return Institution def index_queryset(self, using=None): """To account for the somewhat complicated count query, we need to add an "extra" annotation""" subquery_tail = """ FROM hmda_hmdarecord WHERE hmda_hmdarecord.lender = CAST(respondants_institution.agency_id AS VARCHAR(1)) || respondants_institution.ffiec_id""" return self.get_model().objects.extra( select={"num_loans": "SELECT COUNT(*) " + subquery_tail}, where=["SELECT COUNT(*) > 0 " + subquery_tail]) def read_queryset(self, using=None): """A more efficient query than the index query -- makes use of select related and does not include the num_loans calculation.""" return self.get_model().objects.select_related('zip_code', 'agency') def prepare_lender_id(self, institution): return str(institution.agency_id) + institution.ffiec_id
from haystack import indexes from respondants.models import Institution class InstitutionIndex(indexes.SearchIndex, indexes.Indexable): """Search Index associated with an institution. Allows for searching by name or lender id""" text = indexes.CharField(document=True, model_attr='name') text_auto = indexes.EdgeNgramField(model_attr='name') lender_id = indexes.CharField() assets = indexes.IntegerField(model_attr='assets') num_loans = indexes.IntegerField(model_attr='num_loans') def get_model(self): return Institution def index_queryset(self, using=None): """To account for the somewhat complicated count query, we need to add an "extra" annotation""" subquery_tail = """ FROM hmda_hmdarecord WHERE year = 2013 AND hmda_hmdarecord.lender = CAST(respondants_institution.agency_id AS VARCHAR(1)) || respondants_institution.ffiec_id""" return self.get_model().objects.extra( select={"num_loans": "SELECT COUNT(*) " + subquery_tail}, where=["SELECT COUNT(*) > 0 " + subquery_tail]) def read_queryset(self, using=None): """A more efficient query than the index query -- makes use of select related and does not include the num_loans calculation.""" return self.get_model().objects.select_related('zip_code', 'agency') def prepare_lender_id(self, institution): return str(institution.agency_id) + institution.ffiec_id Revert "adding 2013 to search query"from haystack import indexes from respondants.models import Institution class InstitutionIndex(indexes.SearchIndex, indexes.Indexable): """Search Index associated with an institution. Allows for searching by name or lender id""" text = indexes.CharField(document=True, model_attr='name') text_auto = indexes.EdgeNgramField(model_attr='name') lender_id = indexes.CharField() assets = indexes.IntegerField(model_attr='assets') num_loans = indexes.IntegerField(model_attr='num_loans') def get_model(self): return Institution def index_queryset(self, using=None): """To account for the somewhat complicated count query, we need to add an "extra" annotation""" subquery_tail = """ FROM hmda_hmdarecord WHERE hmda_hmdarecord.lender = CAST(respondants_institution.agency_id AS VARCHAR(1)) || respondants_institution.ffiec_id""" return self.get_model().objects.extra( select={"num_loans": "SELECT COUNT(*) " + subquery_tail}, where=["SELECT COUNT(*) > 0 " + subquery_tail]) def read_queryset(self, using=None): """A more efficient query than the index query -- makes use of select related and does not include the num_loans calculation.""" return self.get_model().objects.select_related('zip_code', 'agency') def prepare_lender_id(self, institution): return str(institution.agency_id) + institution.ffiec_id
<commit_before>from haystack import indexes from respondants.models import Institution class InstitutionIndex(indexes.SearchIndex, indexes.Indexable): """Search Index associated with an institution. Allows for searching by name or lender id""" text = indexes.CharField(document=True, model_attr='name') text_auto = indexes.EdgeNgramField(model_attr='name') lender_id = indexes.CharField() assets = indexes.IntegerField(model_attr='assets') num_loans = indexes.IntegerField(model_attr='num_loans') def get_model(self): return Institution def index_queryset(self, using=None): """To account for the somewhat complicated count query, we need to add an "extra" annotation""" subquery_tail = """ FROM hmda_hmdarecord WHERE year = 2013 AND hmda_hmdarecord.lender = CAST(respondants_institution.agency_id AS VARCHAR(1)) || respondants_institution.ffiec_id""" return self.get_model().objects.extra( select={"num_loans": "SELECT COUNT(*) " + subquery_tail}, where=["SELECT COUNT(*) > 0 " + subquery_tail]) def read_queryset(self, using=None): """A more efficient query than the index query -- makes use of select related and does not include the num_loans calculation.""" return self.get_model().objects.select_related('zip_code', 'agency') def prepare_lender_id(self, institution): return str(institution.agency_id) + institution.ffiec_id <commit_msg>Revert "adding 2013 to search query"<commit_after>from haystack import indexes from respondants.models import Institution class InstitutionIndex(indexes.SearchIndex, indexes.Indexable): """Search Index associated with an institution. Allows for searching by name or lender id""" text = indexes.CharField(document=True, model_attr='name') text_auto = indexes.EdgeNgramField(model_attr='name') lender_id = indexes.CharField() assets = indexes.IntegerField(model_attr='assets') num_loans = indexes.IntegerField(model_attr='num_loans') def get_model(self): return Institution def index_queryset(self, using=None): """To account for the somewhat complicated count query, we need to add an "extra" annotation""" subquery_tail = """ FROM hmda_hmdarecord WHERE hmda_hmdarecord.lender = CAST(respondants_institution.agency_id AS VARCHAR(1)) || respondants_institution.ffiec_id""" return self.get_model().objects.extra( select={"num_loans": "SELECT COUNT(*) " + subquery_tail}, where=["SELECT COUNT(*) > 0 " + subquery_tail]) def read_queryset(self, using=None): """A more efficient query than the index query -- makes use of select related and does not include the num_loans calculation.""" return self.get_model().objects.select_related('zip_code', 'agency') def prepare_lender_id(self, institution): return str(institution.agency_id) + institution.ffiec_id
09f429e76a7b2cd49ea66b70d314bb4510971a5f
gui.py
gui.py
import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk class MainWindow(Gtk.Window): def __init__(self): Gtk.Window.__init__(self, title="") win = MainWindow() win.connect("delete-event", Gtk.main_quit) win.show_all() Gtk.main()
import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk class MainWindow(Gtk.Window): def __init__(self): Gtk.Window.__init__(self, title="Text Playing Game") self.set_border_width(10) self.set_size_request(500, 400) win = MainWindow() win.connect("delete-event", Gtk.main_quit) win.show_all() Gtk.main()
Set GUI title and size
Set GUI title and size
Python
mit
Giovanni21M/Text-Playing-Game
import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk class MainWindow(Gtk.Window): def __init__(self): Gtk.Window.__init__(self, title="") win = MainWindow() win.connect("delete-event", Gtk.main_quit) win.show_all() Gtk.main() Set GUI title and size
import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk class MainWindow(Gtk.Window): def __init__(self): Gtk.Window.__init__(self, title="Text Playing Game") self.set_border_width(10) self.set_size_request(500, 400) win = MainWindow() win.connect("delete-event", Gtk.main_quit) win.show_all() Gtk.main()
<commit_before>import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk class MainWindow(Gtk.Window): def __init__(self): Gtk.Window.__init__(self, title="") win = MainWindow() win.connect("delete-event", Gtk.main_quit) win.show_all() Gtk.main() <commit_msg>Set GUI title and size<commit_after>
import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk class MainWindow(Gtk.Window): def __init__(self): Gtk.Window.__init__(self, title="Text Playing Game") self.set_border_width(10) self.set_size_request(500, 400) win = MainWindow() win.connect("delete-event", Gtk.main_quit) win.show_all() Gtk.main()
import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk class MainWindow(Gtk.Window): def __init__(self): Gtk.Window.__init__(self, title="") win = MainWindow() win.connect("delete-event", Gtk.main_quit) win.show_all() Gtk.main() Set GUI title and sizeimport gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk class MainWindow(Gtk.Window): def __init__(self): Gtk.Window.__init__(self, title="Text Playing Game") self.set_border_width(10) self.set_size_request(500, 400) win = MainWindow() win.connect("delete-event", Gtk.main_quit) win.show_all() Gtk.main()
<commit_before>import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk class MainWindow(Gtk.Window): def __init__(self): Gtk.Window.__init__(self, title="") win = MainWindow() win.connect("delete-event", Gtk.main_quit) win.show_all() Gtk.main() <commit_msg>Set GUI title and size<commit_after>import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk class MainWindow(Gtk.Window): def __init__(self): Gtk.Window.__init__(self, title="Text Playing Game") self.set_border_width(10) self.set_size_request(500, 400) win = MainWindow() win.connect("delete-event", Gtk.main_quit) win.show_all() Gtk.main()
e1d2dcf05d4f22168a567d6460bba467ccb0e28c
bbb/adc.py
bbb/adc.py
""" Access ADCs vias SysFS interface """ import glob class adc(object): def __init__(self, num): self.num = num # need to read a glob here, since numbering is not consistent # TODO: verify num is reasonable (0-6) self.sysfs = glob.glob('/sys/devices/ocp.*/helper.*/AIN' + str(num))[0] def __str__(self): out = "ADC#%d (%s)" % (self.num, self.sysfs) return out def read(self): val = None while not val: try: with open(self.sysfs, 'r') as f: val = f.read() except: pass # No longer seems to be necessary with the bone26+ kernels? # val = None # # Read a second time to ensure we get the current value (bug in ADC driver) # while not val: # try: # with open(self.sysfs, 'r') as f: # val = f.read() # except: # pass return int(val)
""" Access ADCs vias SysFS interface """ import glob class adc(object): def __init__(self, num, repeat=8): self.num = num # need to read a glob here, since numbering is not consistent # TODO: verify num is reasonable (0-6) self.sysfs = glob.glob('/sys/devices/ocp.*/helper.*/AIN' + str(num))[0] self.repeat = repeat def __str__(self): out = "ADC#%d (%s)" % (self.num, self.sysfs) return out def read(self, repeat=None): if not repeat: repeat = self.repeat for i in range(repeat): val = None while not val: try: with open(self.sysfs, 'r') as f: val = f.read() except: pass return int(val)
Add parameter to specificy ADC read repeats
Add parameter to specificy ADC read repeats
Python
mit
IEEERobotics/pybbb,jschornick/pybbb
""" Access ADCs vias SysFS interface """ import glob class adc(object): def __init__(self, num): self.num = num # need to read a glob here, since numbering is not consistent # TODO: verify num is reasonable (0-6) self.sysfs = glob.glob('/sys/devices/ocp.*/helper.*/AIN' + str(num))[0] def __str__(self): out = "ADC#%d (%s)" % (self.num, self.sysfs) return out def read(self): val = None while not val: try: with open(self.sysfs, 'r') as f: val = f.read() except: pass # No longer seems to be necessary with the bone26+ kernels? # val = None # # Read a second time to ensure we get the current value (bug in ADC driver) # while not val: # try: # with open(self.sysfs, 'r') as f: # val = f.read() # except: # pass return int(val) Add parameter to specificy ADC read repeats
""" Access ADCs vias SysFS interface """ import glob class adc(object): def __init__(self, num, repeat=8): self.num = num # need to read a glob here, since numbering is not consistent # TODO: verify num is reasonable (0-6) self.sysfs = glob.glob('/sys/devices/ocp.*/helper.*/AIN' + str(num))[0] self.repeat = repeat def __str__(self): out = "ADC#%d (%s)" % (self.num, self.sysfs) return out def read(self, repeat=None): if not repeat: repeat = self.repeat for i in range(repeat): val = None while not val: try: with open(self.sysfs, 'r') as f: val = f.read() except: pass return int(val)
<commit_before>""" Access ADCs vias SysFS interface """ import glob class adc(object): def __init__(self, num): self.num = num # need to read a glob here, since numbering is not consistent # TODO: verify num is reasonable (0-6) self.sysfs = glob.glob('/sys/devices/ocp.*/helper.*/AIN' + str(num))[0] def __str__(self): out = "ADC#%d (%s)" % (self.num, self.sysfs) return out def read(self): val = None while not val: try: with open(self.sysfs, 'r') as f: val = f.read() except: pass # No longer seems to be necessary with the bone26+ kernels? # val = None # # Read a second time to ensure we get the current value (bug in ADC driver) # while not val: # try: # with open(self.sysfs, 'r') as f: # val = f.read() # except: # pass return int(val) <commit_msg>Add parameter to specificy ADC read repeats<commit_after>
""" Access ADCs vias SysFS interface """ import glob class adc(object): def __init__(self, num, repeat=8): self.num = num # need to read a glob here, since numbering is not consistent # TODO: verify num is reasonable (0-6) self.sysfs = glob.glob('/sys/devices/ocp.*/helper.*/AIN' + str(num))[0] self.repeat = repeat def __str__(self): out = "ADC#%d (%s)" % (self.num, self.sysfs) return out def read(self, repeat=None): if not repeat: repeat = self.repeat for i in range(repeat): val = None while not val: try: with open(self.sysfs, 'r') as f: val = f.read() except: pass return int(val)
""" Access ADCs vias SysFS interface """ import glob class adc(object): def __init__(self, num): self.num = num # need to read a glob here, since numbering is not consistent # TODO: verify num is reasonable (0-6) self.sysfs = glob.glob('/sys/devices/ocp.*/helper.*/AIN' + str(num))[0] def __str__(self): out = "ADC#%d (%s)" % (self.num, self.sysfs) return out def read(self): val = None while not val: try: with open(self.sysfs, 'r') as f: val = f.read() except: pass # No longer seems to be necessary with the bone26+ kernels? # val = None # # Read a second time to ensure we get the current value (bug in ADC driver) # while not val: # try: # with open(self.sysfs, 'r') as f: # val = f.read() # except: # pass return int(val) Add parameter to specificy ADC read repeats""" Access ADCs vias SysFS interface """ import glob class adc(object): def __init__(self, num, repeat=8): self.num = num # need to read a glob here, since numbering is not consistent # TODO: verify num is reasonable (0-6) self.sysfs = glob.glob('/sys/devices/ocp.*/helper.*/AIN' + str(num))[0] self.repeat = repeat def __str__(self): out = "ADC#%d (%s)" % (self.num, self.sysfs) return out def read(self, repeat=None): if not repeat: repeat = self.repeat for i in range(repeat): val = None while not val: try: with open(self.sysfs, 'r') as f: val = f.read() except: pass return int(val)
<commit_before>""" Access ADCs vias SysFS interface """ import glob class adc(object): def __init__(self, num): self.num = num # need to read a glob here, since numbering is not consistent # TODO: verify num is reasonable (0-6) self.sysfs = glob.glob('/sys/devices/ocp.*/helper.*/AIN' + str(num))[0] def __str__(self): out = "ADC#%d (%s)" % (self.num, self.sysfs) return out def read(self): val = None while not val: try: with open(self.sysfs, 'r') as f: val = f.read() except: pass # No longer seems to be necessary with the bone26+ kernels? # val = None # # Read a second time to ensure we get the current value (bug in ADC driver) # while not val: # try: # with open(self.sysfs, 'r') as f: # val = f.read() # except: # pass return int(val) <commit_msg>Add parameter to specificy ADC read repeats<commit_after>""" Access ADCs vias SysFS interface """ import glob class adc(object): def __init__(self, num, repeat=8): self.num = num # need to read a glob here, since numbering is not consistent # TODO: verify num is reasonable (0-6) self.sysfs = glob.glob('/sys/devices/ocp.*/helper.*/AIN' + str(num))[0] self.repeat = repeat def __str__(self): out = "ADC#%d (%s)" % (self.num, self.sysfs) return out def read(self, repeat=None): if not repeat: repeat = self.repeat for i in range(repeat): val = None while not val: try: with open(self.sysfs, 'r') as f: val = f.read() except: pass return int(val)
f08997e6395c268d47acc39f1a53bf9365dcb94f
noxfile.py
noxfile.py
"""Automation using nox. """ import nox nox.options.sessions = ["dev"] nox.options.reuse_existing_virtualenvs = True nox.options.error_on_external_run = True @nox.session(python="3.5") def dev(session): session.install("-r", "requirements.txt") session.run("python", "manage.py", *session.posargs) @nox.session(python=["3.5", "3.6", "3.7", "3.8"]) def test(session): session.install("-r", "requirements.txt") session.install("-r", "tools/requirements-test.txt") session.run("pytest", "--cov", "-v", "--tb=native") session.run("coverage", "report", "-m") @nox.session(python=["3.5", "3.6", "3.7", "3.8"]) def lint(session): session.install("pre-commit") session.run("pre-commit", "run", "--all-files") @nox.session(python="3.5") def docs(session): session.install("-r", "tools/requirements-docs.txt") def get_sphinx_build_command(kind): return [ "sphinx-build", "-W", "-d", "docs/build/_doctrees/" + kind, "-b", kind, "docs/source", "docs/build/" + kind, ] session.run(*get_sphinx_build_command("html"))
"""Automation using nox. """ import nox nox.options.sessions = ["dev"] nox.options.reuse_existing_virtualenvs = True nox.options.error_on_external_run = True @nox.session(python="3.5") def dev(session): session.install("-r", "requirements.txt") session.run("python", "manage.py", *session.posargs) @nox.session(python=["2.7", "3.5", "3.6", "3.7", "3.8"]) def test(session): session.install("-r", "requirements.txt") session.install("-r", "tools/requirements-test.txt") session.run("pytest", "--cov", "-v", "--tb=native") session.run("coverage", "report", "-m") @nox.session(python=["3.5", "3.6", "3.7", "3.8"]) def lint(session): session.install("pre-commit") session.run("pre-commit", "run", "--all-files") @nox.session(python="3.5") def docs(session): session.install("-r", "tools/requirements-docs.txt") def get_sphinx_build_command(kind): return [ "sphinx-build", "-W", "-d", "docs/build/_doctrees/" + kind, "-b", kind, "docs/source", "docs/build/" + kind, ] session.run(*get_sphinx_build_command("html"))
Add Python 2.7 to nox test environment
test: Add Python 2.7 to nox test environment It is needed for sanity checking the code against the current deployment environment. Signed-off-by: Nabarun Pal <46a782cbd1e9f752958998187886c2b51fda054c@gmail.com>
Python
mit
pythonindia/junction,pythonindia/junction,pythonindia/junction,pythonindia/junction
"""Automation using nox. """ import nox nox.options.sessions = ["dev"] nox.options.reuse_existing_virtualenvs = True nox.options.error_on_external_run = True @nox.session(python="3.5") def dev(session): session.install("-r", "requirements.txt") session.run("python", "manage.py", *session.posargs) @nox.session(python=["3.5", "3.6", "3.7", "3.8"]) def test(session): session.install("-r", "requirements.txt") session.install("-r", "tools/requirements-test.txt") session.run("pytest", "--cov", "-v", "--tb=native") session.run("coverage", "report", "-m") @nox.session(python=["3.5", "3.6", "3.7", "3.8"]) def lint(session): session.install("pre-commit") session.run("pre-commit", "run", "--all-files") @nox.session(python="3.5") def docs(session): session.install("-r", "tools/requirements-docs.txt") def get_sphinx_build_command(kind): return [ "sphinx-build", "-W", "-d", "docs/build/_doctrees/" + kind, "-b", kind, "docs/source", "docs/build/" + kind, ] session.run(*get_sphinx_build_command("html")) test: Add Python 2.7 to nox test environment It is needed for sanity checking the code against the current deployment environment. Signed-off-by: Nabarun Pal <46a782cbd1e9f752958998187886c2b51fda054c@gmail.com>
"""Automation using nox. """ import nox nox.options.sessions = ["dev"] nox.options.reuse_existing_virtualenvs = True nox.options.error_on_external_run = True @nox.session(python="3.5") def dev(session): session.install("-r", "requirements.txt") session.run("python", "manage.py", *session.posargs) @nox.session(python=["2.7", "3.5", "3.6", "3.7", "3.8"]) def test(session): session.install("-r", "requirements.txt") session.install("-r", "tools/requirements-test.txt") session.run("pytest", "--cov", "-v", "--tb=native") session.run("coverage", "report", "-m") @nox.session(python=["3.5", "3.6", "3.7", "3.8"]) def lint(session): session.install("pre-commit") session.run("pre-commit", "run", "--all-files") @nox.session(python="3.5") def docs(session): session.install("-r", "tools/requirements-docs.txt") def get_sphinx_build_command(kind): return [ "sphinx-build", "-W", "-d", "docs/build/_doctrees/" + kind, "-b", kind, "docs/source", "docs/build/" + kind, ] session.run(*get_sphinx_build_command("html"))
<commit_before>"""Automation using nox. """ import nox nox.options.sessions = ["dev"] nox.options.reuse_existing_virtualenvs = True nox.options.error_on_external_run = True @nox.session(python="3.5") def dev(session): session.install("-r", "requirements.txt") session.run("python", "manage.py", *session.posargs) @nox.session(python=["3.5", "3.6", "3.7", "3.8"]) def test(session): session.install("-r", "requirements.txt") session.install("-r", "tools/requirements-test.txt") session.run("pytest", "--cov", "-v", "--tb=native") session.run("coverage", "report", "-m") @nox.session(python=["3.5", "3.6", "3.7", "3.8"]) def lint(session): session.install("pre-commit") session.run("pre-commit", "run", "--all-files") @nox.session(python="3.5") def docs(session): session.install("-r", "tools/requirements-docs.txt") def get_sphinx_build_command(kind): return [ "sphinx-build", "-W", "-d", "docs/build/_doctrees/" + kind, "-b", kind, "docs/source", "docs/build/" + kind, ] session.run(*get_sphinx_build_command("html")) <commit_msg>test: Add Python 2.7 to nox test environment It is needed for sanity checking the code against the current deployment environment. Signed-off-by: Nabarun Pal <46a782cbd1e9f752958998187886c2b51fda054c@gmail.com><commit_after>
"""Automation using nox. """ import nox nox.options.sessions = ["dev"] nox.options.reuse_existing_virtualenvs = True nox.options.error_on_external_run = True @nox.session(python="3.5") def dev(session): session.install("-r", "requirements.txt") session.run("python", "manage.py", *session.posargs) @nox.session(python=["2.7", "3.5", "3.6", "3.7", "3.8"]) def test(session): session.install("-r", "requirements.txt") session.install("-r", "tools/requirements-test.txt") session.run("pytest", "--cov", "-v", "--tb=native") session.run("coverage", "report", "-m") @nox.session(python=["3.5", "3.6", "3.7", "3.8"]) def lint(session): session.install("pre-commit") session.run("pre-commit", "run", "--all-files") @nox.session(python="3.5") def docs(session): session.install("-r", "tools/requirements-docs.txt") def get_sphinx_build_command(kind): return [ "sphinx-build", "-W", "-d", "docs/build/_doctrees/" + kind, "-b", kind, "docs/source", "docs/build/" + kind, ] session.run(*get_sphinx_build_command("html"))
"""Automation using nox. """ import nox nox.options.sessions = ["dev"] nox.options.reuse_existing_virtualenvs = True nox.options.error_on_external_run = True @nox.session(python="3.5") def dev(session): session.install("-r", "requirements.txt") session.run("python", "manage.py", *session.posargs) @nox.session(python=["3.5", "3.6", "3.7", "3.8"]) def test(session): session.install("-r", "requirements.txt") session.install("-r", "tools/requirements-test.txt") session.run("pytest", "--cov", "-v", "--tb=native") session.run("coverage", "report", "-m") @nox.session(python=["3.5", "3.6", "3.7", "3.8"]) def lint(session): session.install("pre-commit") session.run("pre-commit", "run", "--all-files") @nox.session(python="3.5") def docs(session): session.install("-r", "tools/requirements-docs.txt") def get_sphinx_build_command(kind): return [ "sphinx-build", "-W", "-d", "docs/build/_doctrees/" + kind, "-b", kind, "docs/source", "docs/build/" + kind, ] session.run(*get_sphinx_build_command("html")) test: Add Python 2.7 to nox test environment It is needed for sanity checking the code against the current deployment environment. Signed-off-by: Nabarun Pal <46a782cbd1e9f752958998187886c2b51fda054c@gmail.com>"""Automation using nox. """ import nox nox.options.sessions = ["dev"] nox.options.reuse_existing_virtualenvs = True nox.options.error_on_external_run = True @nox.session(python="3.5") def dev(session): session.install("-r", "requirements.txt") session.run("python", "manage.py", *session.posargs) @nox.session(python=["2.7", "3.5", "3.6", "3.7", "3.8"]) def test(session): session.install("-r", "requirements.txt") session.install("-r", "tools/requirements-test.txt") session.run("pytest", "--cov", "-v", "--tb=native") session.run("coverage", "report", "-m") @nox.session(python=["3.5", "3.6", "3.7", "3.8"]) def lint(session): session.install("pre-commit") session.run("pre-commit", "run", "--all-files") @nox.session(python="3.5") def docs(session): session.install("-r", "tools/requirements-docs.txt") def get_sphinx_build_command(kind): return [ "sphinx-build", "-W", "-d", "docs/build/_doctrees/" + kind, "-b", kind, "docs/source", "docs/build/" + kind, ] session.run(*get_sphinx_build_command("html"))
<commit_before>"""Automation using nox. """ import nox nox.options.sessions = ["dev"] nox.options.reuse_existing_virtualenvs = True nox.options.error_on_external_run = True @nox.session(python="3.5") def dev(session): session.install("-r", "requirements.txt") session.run("python", "manage.py", *session.posargs) @nox.session(python=["3.5", "3.6", "3.7", "3.8"]) def test(session): session.install("-r", "requirements.txt") session.install("-r", "tools/requirements-test.txt") session.run("pytest", "--cov", "-v", "--tb=native") session.run("coverage", "report", "-m") @nox.session(python=["3.5", "3.6", "3.7", "3.8"]) def lint(session): session.install("pre-commit") session.run("pre-commit", "run", "--all-files") @nox.session(python="3.5") def docs(session): session.install("-r", "tools/requirements-docs.txt") def get_sphinx_build_command(kind): return [ "sphinx-build", "-W", "-d", "docs/build/_doctrees/" + kind, "-b", kind, "docs/source", "docs/build/" + kind, ] session.run(*get_sphinx_build_command("html")) <commit_msg>test: Add Python 2.7 to nox test environment It is needed for sanity checking the code against the current deployment environment. Signed-off-by: Nabarun Pal <46a782cbd1e9f752958998187886c2b51fda054c@gmail.com><commit_after>"""Automation using nox. """ import nox nox.options.sessions = ["dev"] nox.options.reuse_existing_virtualenvs = True nox.options.error_on_external_run = True @nox.session(python="3.5") def dev(session): session.install("-r", "requirements.txt") session.run("python", "manage.py", *session.posargs) @nox.session(python=["2.7", "3.5", "3.6", "3.7", "3.8"]) def test(session): session.install("-r", "requirements.txt") session.install("-r", "tools/requirements-test.txt") session.run("pytest", "--cov", "-v", "--tb=native") session.run("coverage", "report", "-m") @nox.session(python=["3.5", "3.6", "3.7", "3.8"]) def lint(session): session.install("pre-commit") session.run("pre-commit", "run", "--all-files") @nox.session(python="3.5") def docs(session): session.install("-r", "tools/requirements-docs.txt") def get_sphinx_build_command(kind): return [ "sphinx-build", "-W", "-d", "docs/build/_doctrees/" + kind, "-b", kind, "docs/source", "docs/build/" + kind, ] session.run(*get_sphinx_build_command("html"))
c1e5c98995898148396d5a3d19cd6f390aa681de
is_irred.py
is_irred.py
# tests to determine whether a polynomial is irreducible over a finite field import numpy def eisenstein(poly, p): """ returns true if poly is irreducible by Eisenstein's sufficient condition: p is prime p does not divide the leading coefficient p divides every other coefficient p squared does not divide the constant term note that if Eisenstein's condition is not met, ie returns false, this does not necessarily imply that poly is reducible :param poly: numpy.polynomial.polynomial :param p: int :return: Bool """ return all(poly[0] % p != 0, poly[0] % p**2 != 0, all(poly[x] % p == 0 for x in range(1, len(poly))))
# tests to determine whether a polynomial is irreducible over Q[x] from fractions import Fraction import numpy def is_prime(num): """ return True if num is a prime :param num: int :return: Bool """ return True def rational_root(poly): """ rational root test :param poly: numpy.polynomial.polynomial :return: Bool """ return True def eisenstein(poly, p): """ returns True if poly is irreducible by Eisenstein's sufficient condition: p is prime p does not divide the leading coefficient p divides every other coefficient p squared does not divide the constant term note that if Eisenstein's condition is not met, ie returns False, this does not necessarily imply that poly is reducible :param poly: numpy.polynomial.polynomial :param p: int :return: Bool """ return all(is_prime(p), poly[0] % p != 0, poly[0] % p**2 != 0, all(poly[x] % p == 0 for x in range(1, len(poly))))
Add rational root test stub
Add rational root test stub
Python
mit
richardmillson/galois
# tests to determine whether a polynomial is irreducible over a finite field import numpy def eisenstein(poly, p): """ returns true if poly is irreducible by Eisenstein's sufficient condition: p is prime p does not divide the leading coefficient p divides every other coefficient p squared does not divide the constant term note that if Eisenstein's condition is not met, ie returns false, this does not necessarily imply that poly is reducible :param poly: numpy.polynomial.polynomial :param p: int :return: Bool """ return all(poly[0] % p != 0, poly[0] % p**2 != 0, all(poly[x] % p == 0 for x in range(1, len(poly)))) Add rational root test stub
# tests to determine whether a polynomial is irreducible over Q[x] from fractions import Fraction import numpy def is_prime(num): """ return True if num is a prime :param num: int :return: Bool """ return True def rational_root(poly): """ rational root test :param poly: numpy.polynomial.polynomial :return: Bool """ return True def eisenstein(poly, p): """ returns True if poly is irreducible by Eisenstein's sufficient condition: p is prime p does not divide the leading coefficient p divides every other coefficient p squared does not divide the constant term note that if Eisenstein's condition is not met, ie returns False, this does not necessarily imply that poly is reducible :param poly: numpy.polynomial.polynomial :param p: int :return: Bool """ return all(is_prime(p), poly[0] % p != 0, poly[0] % p**2 != 0, all(poly[x] % p == 0 for x in range(1, len(poly))))
<commit_before># tests to determine whether a polynomial is irreducible over a finite field import numpy def eisenstein(poly, p): """ returns true if poly is irreducible by Eisenstein's sufficient condition: p is prime p does not divide the leading coefficient p divides every other coefficient p squared does not divide the constant term note that if Eisenstein's condition is not met, ie returns false, this does not necessarily imply that poly is reducible :param poly: numpy.polynomial.polynomial :param p: int :return: Bool """ return all(poly[0] % p != 0, poly[0] % p**2 != 0, all(poly[x] % p == 0 for x in range(1, len(poly)))) <commit_msg>Add rational root test stub<commit_after>
# tests to determine whether a polynomial is irreducible over Q[x] from fractions import Fraction import numpy def is_prime(num): """ return True if num is a prime :param num: int :return: Bool """ return True def rational_root(poly): """ rational root test :param poly: numpy.polynomial.polynomial :return: Bool """ return True def eisenstein(poly, p): """ returns True if poly is irreducible by Eisenstein's sufficient condition: p is prime p does not divide the leading coefficient p divides every other coefficient p squared does not divide the constant term note that if Eisenstein's condition is not met, ie returns False, this does not necessarily imply that poly is reducible :param poly: numpy.polynomial.polynomial :param p: int :return: Bool """ return all(is_prime(p), poly[0] % p != 0, poly[0] % p**2 != 0, all(poly[x] % p == 0 for x in range(1, len(poly))))
# tests to determine whether a polynomial is irreducible over a finite field import numpy def eisenstein(poly, p): """ returns true if poly is irreducible by Eisenstein's sufficient condition: p is prime p does not divide the leading coefficient p divides every other coefficient p squared does not divide the constant term note that if Eisenstein's condition is not met, ie returns false, this does not necessarily imply that poly is reducible :param poly: numpy.polynomial.polynomial :param p: int :return: Bool """ return all(poly[0] % p != 0, poly[0] % p**2 != 0, all(poly[x] % p == 0 for x in range(1, len(poly)))) Add rational root test stub# tests to determine whether a polynomial is irreducible over Q[x] from fractions import Fraction import numpy def is_prime(num): """ return True if num is a prime :param num: int :return: Bool """ return True def rational_root(poly): """ rational root test :param poly: numpy.polynomial.polynomial :return: Bool """ return True def eisenstein(poly, p): """ returns True if poly is irreducible by Eisenstein's sufficient condition: p is prime p does not divide the leading coefficient p divides every other coefficient p squared does not divide the constant term note that if Eisenstein's condition is not met, ie returns False, this does not necessarily imply that poly is reducible :param poly: numpy.polynomial.polynomial :param p: int :return: Bool """ return all(is_prime(p), poly[0] % p != 0, poly[0] % p**2 != 0, all(poly[x] % p == 0 for x in range(1, len(poly))))
<commit_before># tests to determine whether a polynomial is irreducible over a finite field import numpy def eisenstein(poly, p): """ returns true if poly is irreducible by Eisenstein's sufficient condition: p is prime p does not divide the leading coefficient p divides every other coefficient p squared does not divide the constant term note that if Eisenstein's condition is not met, ie returns false, this does not necessarily imply that poly is reducible :param poly: numpy.polynomial.polynomial :param p: int :return: Bool """ return all(poly[0] % p != 0, poly[0] % p**2 != 0, all(poly[x] % p == 0 for x in range(1, len(poly)))) <commit_msg>Add rational root test stub<commit_after># tests to determine whether a polynomial is irreducible over Q[x] from fractions import Fraction import numpy def is_prime(num): """ return True if num is a prime :param num: int :return: Bool """ return True def rational_root(poly): """ rational root test :param poly: numpy.polynomial.polynomial :return: Bool """ return True def eisenstein(poly, p): """ returns True if poly is irreducible by Eisenstein's sufficient condition: p is prime p does not divide the leading coefficient p divides every other coefficient p squared does not divide the constant term note that if Eisenstein's condition is not met, ie returns False, this does not necessarily imply that poly is reducible :param poly: numpy.polynomial.polynomial :param p: int :return: Bool """ return all(is_prime(p), poly[0] % p != 0, poly[0] % p**2 != 0, all(poly[x] % p == 0 for x in range(1, len(poly))))
26bd5e00cf30446860438cc5796ec348aecf7e2b
product_configurator/models/stock.py
product_configurator/models/stock.py
# -*- coding: utf-8 -*- from odoo import models, fields class StockMove(models.Model): _inherit = 'stock.move' product_id = fields.Many2one(domain=[('config_ok', '=', False)])
# -*- coding: utf-8 -*- from ast import literal_eval from odoo import models, fields class StockMove(models.Model): _inherit = 'stock.move' def _get_product_domain(self): if literal_eval(self.env['ir.config_parameter'].sudo().get_param('product_configurator.product_selectable', default='False')): return [] else: return [('config_ok', '=', False)] product_id = fields.Many2one(domain=_get_product_domain)
Put configurable product in Picking list
Put configurable product in Picking list
Python
agpl-3.0
microcom/odoo-product-configurator,microcom/odoo-product-configurator,microcom/odoo-product-configurator
# -*- coding: utf-8 -*- from odoo import models, fields class StockMove(models.Model): _inherit = 'stock.move' product_id = fields.Many2one(domain=[('config_ok', '=', False)]) Put configurable product in Picking list
# -*- coding: utf-8 -*- from ast import literal_eval from odoo import models, fields class StockMove(models.Model): _inherit = 'stock.move' def _get_product_domain(self): if literal_eval(self.env['ir.config_parameter'].sudo().get_param('product_configurator.product_selectable', default='False')): return [] else: return [('config_ok', '=', False)] product_id = fields.Many2one(domain=_get_product_domain)
<commit_before># -*- coding: utf-8 -*- from odoo import models, fields class StockMove(models.Model): _inherit = 'stock.move' product_id = fields.Many2one(domain=[('config_ok', '=', False)]) <commit_msg>Put configurable product in Picking list<commit_after>
# -*- coding: utf-8 -*- from ast import literal_eval from odoo import models, fields class StockMove(models.Model): _inherit = 'stock.move' def _get_product_domain(self): if literal_eval(self.env['ir.config_parameter'].sudo().get_param('product_configurator.product_selectable', default='False')): return [] else: return [('config_ok', '=', False)] product_id = fields.Many2one(domain=_get_product_domain)
# -*- coding: utf-8 -*- from odoo import models, fields class StockMove(models.Model): _inherit = 'stock.move' product_id = fields.Many2one(domain=[('config_ok', '=', False)]) Put configurable product in Picking list# -*- coding: utf-8 -*- from ast import literal_eval from odoo import models, fields class StockMove(models.Model): _inherit = 'stock.move' def _get_product_domain(self): if literal_eval(self.env['ir.config_parameter'].sudo().get_param('product_configurator.product_selectable', default='False')): return [] else: return [('config_ok', '=', False)] product_id = fields.Many2one(domain=_get_product_domain)
<commit_before># -*- coding: utf-8 -*- from odoo import models, fields class StockMove(models.Model): _inherit = 'stock.move' product_id = fields.Many2one(domain=[('config_ok', '=', False)]) <commit_msg>Put configurable product in Picking list<commit_after># -*- coding: utf-8 -*- from ast import literal_eval from odoo import models, fields class StockMove(models.Model): _inherit = 'stock.move' def _get_product_domain(self): if literal_eval(self.env['ir.config_parameter'].sudo().get_param('product_configurator.product_selectable', default='False')): return [] else: return [('config_ok', '=', False)] product_id = fields.Many2one(domain=_get_product_domain)
453e95de00317329234a600f33613d4aecd8254d
enocean/consolelogger.py
enocean/consolelogger.py
# -*- encoding: utf-8 -*- from __future__ import print_function, unicode_literals, division import logging def init_logging(level=logging.DEBUG,logsize=1024,logcount=5): formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') logger = logging.getLogger('enocean') logger.setLevel(level) stream_handler = logging.StreamHandler() stream_handler.setLevel(level) stream_handler.setFormatter(formatter) logger.addHandler(stream_handler) file_handler = RotatingFileHandler('encoean.log', 'a', logsize*1000 , logcount) file_handler.setLevel(level) file_handler.setFormatter(formatter) logger.addHandler(file_handler)
# -*- encoding: utf-8 -*- from __future__ import print_function, unicode_literals, division import logging def init_logging(level=logging.DEBUG, log_to_file=False, logsize=1024, logcount=5): formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') logger = logging.getLogger('enocean') logger.setLevel(level) stream_handler = logging.StreamHandler() stream_handler.setLevel(level) stream_handler.setFormatter(formatter) logger.addHandler(stream_handler) if log_to_file: file_handler = logging.handlers.RotatingFileHandler('enocean.log', 'a', logsize*1000, logcount) file_handler.setLevel(level) file_handler.setFormatter(formatter) logger.addHandler(file_handler)
Make logging to file optional, PEP8-fixes.
Make logging to file optional, PEP8-fixes.
Python
mit
Ethal/enocean,kipe/enocean,kipe/enocean,Ethal/enocean
# -*- encoding: utf-8 -*- from __future__ import print_function, unicode_literals, division import logging def init_logging(level=logging.DEBUG,logsize=1024,logcount=5): formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') logger = logging.getLogger('enocean') logger.setLevel(level) stream_handler = logging.StreamHandler() stream_handler.setLevel(level) stream_handler.setFormatter(formatter) logger.addHandler(stream_handler) file_handler = RotatingFileHandler('encoean.log', 'a', logsize*1000 , logcount) file_handler.setLevel(level) file_handler.setFormatter(formatter) logger.addHandler(file_handler) Make logging to file optional, PEP8-fixes.
# -*- encoding: utf-8 -*- from __future__ import print_function, unicode_literals, division import logging def init_logging(level=logging.DEBUG, log_to_file=False, logsize=1024, logcount=5): formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') logger = logging.getLogger('enocean') logger.setLevel(level) stream_handler = logging.StreamHandler() stream_handler.setLevel(level) stream_handler.setFormatter(formatter) logger.addHandler(stream_handler) if log_to_file: file_handler = logging.handlers.RotatingFileHandler('enocean.log', 'a', logsize*1000, logcount) file_handler.setLevel(level) file_handler.setFormatter(formatter) logger.addHandler(file_handler)
<commit_before># -*- encoding: utf-8 -*- from __future__ import print_function, unicode_literals, division import logging def init_logging(level=logging.DEBUG,logsize=1024,logcount=5): formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') logger = logging.getLogger('enocean') logger.setLevel(level) stream_handler = logging.StreamHandler() stream_handler.setLevel(level) stream_handler.setFormatter(formatter) logger.addHandler(stream_handler) file_handler = RotatingFileHandler('encoean.log', 'a', logsize*1000 , logcount) file_handler.setLevel(level) file_handler.setFormatter(formatter) logger.addHandler(file_handler) <commit_msg>Make logging to file optional, PEP8-fixes.<commit_after>
# -*- encoding: utf-8 -*- from __future__ import print_function, unicode_literals, division import logging def init_logging(level=logging.DEBUG, log_to_file=False, logsize=1024, logcount=5): formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') logger = logging.getLogger('enocean') logger.setLevel(level) stream_handler = logging.StreamHandler() stream_handler.setLevel(level) stream_handler.setFormatter(formatter) logger.addHandler(stream_handler) if log_to_file: file_handler = logging.handlers.RotatingFileHandler('enocean.log', 'a', logsize*1000, logcount) file_handler.setLevel(level) file_handler.setFormatter(formatter) logger.addHandler(file_handler)
# -*- encoding: utf-8 -*- from __future__ import print_function, unicode_literals, division import logging def init_logging(level=logging.DEBUG,logsize=1024,logcount=5): formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') logger = logging.getLogger('enocean') logger.setLevel(level) stream_handler = logging.StreamHandler() stream_handler.setLevel(level) stream_handler.setFormatter(formatter) logger.addHandler(stream_handler) file_handler = RotatingFileHandler('encoean.log', 'a', logsize*1000 , logcount) file_handler.setLevel(level) file_handler.setFormatter(formatter) logger.addHandler(file_handler) Make logging to file optional, PEP8-fixes.# -*- encoding: utf-8 -*- from __future__ import print_function, unicode_literals, division import logging def init_logging(level=logging.DEBUG, log_to_file=False, logsize=1024, logcount=5): formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') logger = logging.getLogger('enocean') logger.setLevel(level) stream_handler = logging.StreamHandler() stream_handler.setLevel(level) stream_handler.setFormatter(formatter) logger.addHandler(stream_handler) if log_to_file: file_handler = logging.handlers.RotatingFileHandler('enocean.log', 'a', logsize*1000, logcount) file_handler.setLevel(level) file_handler.setFormatter(formatter) logger.addHandler(file_handler)
<commit_before># -*- encoding: utf-8 -*- from __future__ import print_function, unicode_literals, division import logging def init_logging(level=logging.DEBUG,logsize=1024,logcount=5): formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') logger = logging.getLogger('enocean') logger.setLevel(level) stream_handler = logging.StreamHandler() stream_handler.setLevel(level) stream_handler.setFormatter(formatter) logger.addHandler(stream_handler) file_handler = RotatingFileHandler('encoean.log', 'a', logsize*1000 , logcount) file_handler.setLevel(level) file_handler.setFormatter(formatter) logger.addHandler(file_handler) <commit_msg>Make logging to file optional, PEP8-fixes.<commit_after># -*- encoding: utf-8 -*- from __future__ import print_function, unicode_literals, division import logging def init_logging(level=logging.DEBUG, log_to_file=False, logsize=1024, logcount=5): formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') logger = logging.getLogger('enocean') logger.setLevel(level) stream_handler = logging.StreamHandler() stream_handler.setLevel(level) stream_handler.setFormatter(formatter) logger.addHandler(stream_handler) if log_to_file: file_handler = logging.handlers.RotatingFileHandler('enocean.log', 'a', logsize*1000, logcount) file_handler.setLevel(level) file_handler.setFormatter(formatter) logger.addHandler(file_handler)
6c143fd230aa37d6cb3f7a023b97cc32fc3b9369
yunity/models/entities.py
yunity/models/entities.py
from django.db.models import TextField, ForeignKey, FloatField, DateTimeField, ManyToManyField from yunity.models.utils import BaseModel, MaxLengthCharField class Versionable(BaseModel): pass class Metadata(BaseModel): key = MaxLengthCharField() value = TextField() class Category(BaseModel): name = MaxLengthCharField() parent = ForeignKey('yunity.Category', null=True, related_name='children') class Contact(BaseModel): value = MaxLengthCharField() type = MaxLengthCharField() class Location(BaseModel): latitude = FloatField() longitude = FloatField() class User(BaseModel): name = TextField() contact = ManyToManyField(Contact, through='yunity.UserContact') location = ManyToManyField(Location, null=True, through='yunity.UserLocation') class Message(BaseModel): content = TextField() type = MaxLengthCharField() createdAt = DateTimeField(auto_now=True) class Mappable(Versionable): provenance = MaxLengthCharField() name = TextField() metadata = ForeignKey(Metadata, null=True) category = ForeignKey(Category) location = ManyToManyField(Location, through='yunity.MappableLocation') contact = ManyToManyField(Contact) wall = ManyToManyField(Message, null=True) responsible = ManyToManyField(User, through='yunity.MappableResponsibility') class Event(BaseModel): type = MaxLengthCharField() time = DateTimeField(auto_now=True) initiator = ForeignKey(User) target = ForeignKey(Versionable)
from django.db.models import TextField, ForeignKey, FloatField, DateTimeField, ManyToManyField from yunity.models.utils import BaseModel, MaxLengthCharField class Versionable(BaseModel): pass class Metadata(BaseModel): key = MaxLengthCharField() value = TextField() class Category(BaseModel): name = MaxLengthCharField() parent = ForeignKey('yunity.Category', null=True, related_name='children') class Contact(BaseModel): value = MaxLengthCharField() type = MaxLengthCharField() class Location(BaseModel): latitude = FloatField() longitude = FloatField() class User(BaseModel): name = TextField() contact = ManyToManyField(Contact, through='yunity.UserContact') location = ManyToManyField(Location, null=True, through='yunity.UserLocation') class Message(BaseModel): content = TextField() type = MaxLengthCharField() createdAt = DateTimeField(auto_now=True) class Mappable(Versionable): provenance = MaxLengthCharField() name = TextField() metadata = ForeignKey(Metadata, null=True) category = ForeignKey(Category) location = ManyToManyField(Location, through='yunity.MappableLocation') contact = ManyToManyField(Contact) wall = ManyToManyField(Message, null=True) responsible = ManyToManyField(User, through='yunity.MappableResponsibility') class Event(BaseModel): type = MaxLengthCharField() time = DateTimeField(auto_now=True) initiator = ForeignKey(User) target = ForeignKey(Versionable)
Revert "Remove some trailing whitespace"
Revert "Remove some trailing whitespace" This reverts commit bb4dc625bb0e2317ca15528f517a2d56a91ab32d.
Python
agpl-3.0
yunity/yunity-core,yunity/foodsaving-backend,yunity/foodsaving-backend,yunity/foodsaving-backend,yunity/yunity-core
from django.db.models import TextField, ForeignKey, FloatField, DateTimeField, ManyToManyField from yunity.models.utils import BaseModel, MaxLengthCharField class Versionable(BaseModel): pass class Metadata(BaseModel): key = MaxLengthCharField() value = TextField() class Category(BaseModel): name = MaxLengthCharField() parent = ForeignKey('yunity.Category', null=True, related_name='children') class Contact(BaseModel): value = MaxLengthCharField() type = MaxLengthCharField() class Location(BaseModel): latitude = FloatField() longitude = FloatField() class User(BaseModel): name = TextField() contact = ManyToManyField(Contact, through='yunity.UserContact') location = ManyToManyField(Location, null=True, through='yunity.UserLocation') class Message(BaseModel): content = TextField() type = MaxLengthCharField() createdAt = DateTimeField(auto_now=True) class Mappable(Versionable): provenance = MaxLengthCharField() name = TextField() metadata = ForeignKey(Metadata, null=True) category = ForeignKey(Category) location = ManyToManyField(Location, through='yunity.MappableLocation') contact = ManyToManyField(Contact) wall = ManyToManyField(Message, null=True) responsible = ManyToManyField(User, through='yunity.MappableResponsibility') class Event(BaseModel): type = MaxLengthCharField() time = DateTimeField(auto_now=True) initiator = ForeignKey(User) target = ForeignKey(Versionable) Revert "Remove some trailing whitespace" This reverts commit bb4dc625bb0e2317ca15528f517a2d56a91ab32d.
from django.db.models import TextField, ForeignKey, FloatField, DateTimeField, ManyToManyField from yunity.models.utils import BaseModel, MaxLengthCharField class Versionable(BaseModel): pass class Metadata(BaseModel): key = MaxLengthCharField() value = TextField() class Category(BaseModel): name = MaxLengthCharField() parent = ForeignKey('yunity.Category', null=True, related_name='children') class Contact(BaseModel): value = MaxLengthCharField() type = MaxLengthCharField() class Location(BaseModel): latitude = FloatField() longitude = FloatField() class User(BaseModel): name = TextField() contact = ManyToManyField(Contact, through='yunity.UserContact') location = ManyToManyField(Location, null=True, through='yunity.UserLocation') class Message(BaseModel): content = TextField() type = MaxLengthCharField() createdAt = DateTimeField(auto_now=True) class Mappable(Versionable): provenance = MaxLengthCharField() name = TextField() metadata = ForeignKey(Metadata, null=True) category = ForeignKey(Category) location = ManyToManyField(Location, through='yunity.MappableLocation') contact = ManyToManyField(Contact) wall = ManyToManyField(Message, null=True) responsible = ManyToManyField(User, through='yunity.MappableResponsibility') class Event(BaseModel): type = MaxLengthCharField() time = DateTimeField(auto_now=True) initiator = ForeignKey(User) target = ForeignKey(Versionable)
<commit_before>from django.db.models import TextField, ForeignKey, FloatField, DateTimeField, ManyToManyField from yunity.models.utils import BaseModel, MaxLengthCharField class Versionable(BaseModel): pass class Metadata(BaseModel): key = MaxLengthCharField() value = TextField() class Category(BaseModel): name = MaxLengthCharField() parent = ForeignKey('yunity.Category', null=True, related_name='children') class Contact(BaseModel): value = MaxLengthCharField() type = MaxLengthCharField() class Location(BaseModel): latitude = FloatField() longitude = FloatField() class User(BaseModel): name = TextField() contact = ManyToManyField(Contact, through='yunity.UserContact') location = ManyToManyField(Location, null=True, through='yunity.UserLocation') class Message(BaseModel): content = TextField() type = MaxLengthCharField() createdAt = DateTimeField(auto_now=True) class Mappable(Versionable): provenance = MaxLengthCharField() name = TextField() metadata = ForeignKey(Metadata, null=True) category = ForeignKey(Category) location = ManyToManyField(Location, through='yunity.MappableLocation') contact = ManyToManyField(Contact) wall = ManyToManyField(Message, null=True) responsible = ManyToManyField(User, through='yunity.MappableResponsibility') class Event(BaseModel): type = MaxLengthCharField() time = DateTimeField(auto_now=True) initiator = ForeignKey(User) target = ForeignKey(Versionable) <commit_msg>Revert "Remove some trailing whitespace" This reverts commit bb4dc625bb0e2317ca15528f517a2d56a91ab32d.<commit_after>
from django.db.models import TextField, ForeignKey, FloatField, DateTimeField, ManyToManyField from yunity.models.utils import BaseModel, MaxLengthCharField class Versionable(BaseModel): pass class Metadata(BaseModel): key = MaxLengthCharField() value = TextField() class Category(BaseModel): name = MaxLengthCharField() parent = ForeignKey('yunity.Category', null=True, related_name='children') class Contact(BaseModel): value = MaxLengthCharField() type = MaxLengthCharField() class Location(BaseModel): latitude = FloatField() longitude = FloatField() class User(BaseModel): name = TextField() contact = ManyToManyField(Contact, through='yunity.UserContact') location = ManyToManyField(Location, null=True, through='yunity.UserLocation') class Message(BaseModel): content = TextField() type = MaxLengthCharField() createdAt = DateTimeField(auto_now=True) class Mappable(Versionable): provenance = MaxLengthCharField() name = TextField() metadata = ForeignKey(Metadata, null=True) category = ForeignKey(Category) location = ManyToManyField(Location, through='yunity.MappableLocation') contact = ManyToManyField(Contact) wall = ManyToManyField(Message, null=True) responsible = ManyToManyField(User, through='yunity.MappableResponsibility') class Event(BaseModel): type = MaxLengthCharField() time = DateTimeField(auto_now=True) initiator = ForeignKey(User) target = ForeignKey(Versionable)
from django.db.models import TextField, ForeignKey, FloatField, DateTimeField, ManyToManyField from yunity.models.utils import BaseModel, MaxLengthCharField class Versionable(BaseModel): pass class Metadata(BaseModel): key = MaxLengthCharField() value = TextField() class Category(BaseModel): name = MaxLengthCharField() parent = ForeignKey('yunity.Category', null=True, related_name='children') class Contact(BaseModel): value = MaxLengthCharField() type = MaxLengthCharField() class Location(BaseModel): latitude = FloatField() longitude = FloatField() class User(BaseModel): name = TextField() contact = ManyToManyField(Contact, through='yunity.UserContact') location = ManyToManyField(Location, null=True, through='yunity.UserLocation') class Message(BaseModel): content = TextField() type = MaxLengthCharField() createdAt = DateTimeField(auto_now=True) class Mappable(Versionable): provenance = MaxLengthCharField() name = TextField() metadata = ForeignKey(Metadata, null=True) category = ForeignKey(Category) location = ManyToManyField(Location, through='yunity.MappableLocation') contact = ManyToManyField(Contact) wall = ManyToManyField(Message, null=True) responsible = ManyToManyField(User, through='yunity.MappableResponsibility') class Event(BaseModel): type = MaxLengthCharField() time = DateTimeField(auto_now=True) initiator = ForeignKey(User) target = ForeignKey(Versionable) Revert "Remove some trailing whitespace" This reverts commit bb4dc625bb0e2317ca15528f517a2d56a91ab32d.from django.db.models import TextField, ForeignKey, FloatField, DateTimeField, ManyToManyField from yunity.models.utils import BaseModel, MaxLengthCharField class Versionable(BaseModel): pass class Metadata(BaseModel): key = MaxLengthCharField() value = TextField() class Category(BaseModel): name = MaxLengthCharField() parent = ForeignKey('yunity.Category', null=True, related_name='children') class Contact(BaseModel): value = MaxLengthCharField() type = MaxLengthCharField() class Location(BaseModel): latitude = FloatField() longitude = FloatField() class User(BaseModel): name = TextField() contact = ManyToManyField(Contact, through='yunity.UserContact') location = ManyToManyField(Location, null=True, through='yunity.UserLocation') class Message(BaseModel): content = TextField() type = MaxLengthCharField() createdAt = DateTimeField(auto_now=True) class Mappable(Versionable): provenance = MaxLengthCharField() name = TextField() metadata = ForeignKey(Metadata, null=True) category = ForeignKey(Category) location = ManyToManyField(Location, through='yunity.MappableLocation') contact = ManyToManyField(Contact) wall = ManyToManyField(Message, null=True) responsible = ManyToManyField(User, through='yunity.MappableResponsibility') class Event(BaseModel): type = MaxLengthCharField() time = DateTimeField(auto_now=True) initiator = ForeignKey(User) target = ForeignKey(Versionable)
<commit_before>from django.db.models import TextField, ForeignKey, FloatField, DateTimeField, ManyToManyField from yunity.models.utils import BaseModel, MaxLengthCharField class Versionable(BaseModel): pass class Metadata(BaseModel): key = MaxLengthCharField() value = TextField() class Category(BaseModel): name = MaxLengthCharField() parent = ForeignKey('yunity.Category', null=True, related_name='children') class Contact(BaseModel): value = MaxLengthCharField() type = MaxLengthCharField() class Location(BaseModel): latitude = FloatField() longitude = FloatField() class User(BaseModel): name = TextField() contact = ManyToManyField(Contact, through='yunity.UserContact') location = ManyToManyField(Location, null=True, through='yunity.UserLocation') class Message(BaseModel): content = TextField() type = MaxLengthCharField() createdAt = DateTimeField(auto_now=True) class Mappable(Versionable): provenance = MaxLengthCharField() name = TextField() metadata = ForeignKey(Metadata, null=True) category = ForeignKey(Category) location = ManyToManyField(Location, through='yunity.MappableLocation') contact = ManyToManyField(Contact) wall = ManyToManyField(Message, null=True) responsible = ManyToManyField(User, through='yunity.MappableResponsibility') class Event(BaseModel): type = MaxLengthCharField() time = DateTimeField(auto_now=True) initiator = ForeignKey(User) target = ForeignKey(Versionable) <commit_msg>Revert "Remove some trailing whitespace" This reverts commit bb4dc625bb0e2317ca15528f517a2d56a91ab32d.<commit_after>from django.db.models import TextField, ForeignKey, FloatField, DateTimeField, ManyToManyField from yunity.models.utils import BaseModel, MaxLengthCharField class Versionable(BaseModel): pass class Metadata(BaseModel): key = MaxLengthCharField() value = TextField() class Category(BaseModel): name = MaxLengthCharField() parent = ForeignKey('yunity.Category', null=True, related_name='children') class Contact(BaseModel): value = MaxLengthCharField() type = MaxLengthCharField() class Location(BaseModel): latitude = FloatField() longitude = FloatField() class User(BaseModel): name = TextField() contact = ManyToManyField(Contact, through='yunity.UserContact') location = ManyToManyField(Location, null=True, through='yunity.UserLocation') class Message(BaseModel): content = TextField() type = MaxLengthCharField() createdAt = DateTimeField(auto_now=True) class Mappable(Versionable): provenance = MaxLengthCharField() name = TextField() metadata = ForeignKey(Metadata, null=True) category = ForeignKey(Category) location = ManyToManyField(Location, through='yunity.MappableLocation') contact = ManyToManyField(Contact) wall = ManyToManyField(Message, null=True) responsible = ManyToManyField(User, through='yunity.MappableResponsibility') class Event(BaseModel): type = MaxLengthCharField() time = DateTimeField(auto_now=True) initiator = ForeignKey(User) target = ForeignKey(Versionable)
311989f227278ce9d433ab2852b50ffcdee188d6
npc.py
npc.py
#!/usr/bin/env python3.5 import npc import sys if __name__ == '__main__': npc.cli(sys.argv[1:])
#!/usr/bin/env python3.5 """ Executable entry point for the NPC CLI interface. """ import sys import npc if __name__ == '__main__': npc.cli(sys.argv[1:])
Add module docstring and reorder imports
Add module docstring and reorder imports
Python
mit
aurule/npc,aurule/npc
#!/usr/bin/env python3.5 import npc import sys if __name__ == '__main__': npc.cli(sys.argv[1:]) Add module docstring and reorder imports
#!/usr/bin/env python3.5 """ Executable entry point for the NPC CLI interface. """ import sys import npc if __name__ == '__main__': npc.cli(sys.argv[1:])
<commit_before>#!/usr/bin/env python3.5 import npc import sys if __name__ == '__main__': npc.cli(sys.argv[1:]) <commit_msg>Add module docstring and reorder imports<commit_after>
#!/usr/bin/env python3.5 """ Executable entry point for the NPC CLI interface. """ import sys import npc if __name__ == '__main__': npc.cli(sys.argv[1:])
#!/usr/bin/env python3.5 import npc import sys if __name__ == '__main__': npc.cli(sys.argv[1:]) Add module docstring and reorder imports#!/usr/bin/env python3.5 """ Executable entry point for the NPC CLI interface. """ import sys import npc if __name__ == '__main__': npc.cli(sys.argv[1:])
<commit_before>#!/usr/bin/env python3.5 import npc import sys if __name__ == '__main__': npc.cli(sys.argv[1:]) <commit_msg>Add module docstring and reorder imports<commit_after>#!/usr/bin/env python3.5 """ Executable entry point for the NPC CLI interface. """ import sys import npc if __name__ == '__main__': npc.cli(sys.argv[1:])
9825d76b6bff7e04d1e277539ece6bda928b648b
wtl/wtlib/forms.py
wtl/wtlib/forms.py
from django import forms from wtl.wtgithub.worker import GithubWorker class AnalyzeForm(forms.Form): git_url = forms.CharField() def analyze(self): worker = GithubWorker() self.repository, self.project = worker.analyze_repo(self.cleaned_data['git_url']) return self.repository, self.project
from django import forms from django.forms.util import ErrorList from django.utils.translation import ugettext_lazy as _ from github import UnknownObjectException from wtl.wtgithub.worker import GithubWorker class AnalyzeForm(forms.Form): git_url = forms.CharField() def analyze(self): if 'git_url' not in self._errors: self._errors['git_url'] = ErrorList() worker = GithubWorker() try: self.repository, self.project = worker.analyze_repo( self.cleaned_data['git_url']) return self.repository, self.project except UnknownObjectException: self._errors['git_url'].append(_('Repository not found.'))
Validate repo exists in `AnalyzeForm`
Validate repo exists in `AnalyzeForm`
Python
mit
elegion/djangodash2013,elegion/djangodash2013
from django import forms from wtl.wtgithub.worker import GithubWorker class AnalyzeForm(forms.Form): git_url = forms.CharField() def analyze(self): worker = GithubWorker() self.repository, self.project = worker.analyze_repo(self.cleaned_data['git_url']) return self.repository, self.project Validate repo exists in `AnalyzeForm`
from django import forms from django.forms.util import ErrorList from django.utils.translation import ugettext_lazy as _ from github import UnknownObjectException from wtl.wtgithub.worker import GithubWorker class AnalyzeForm(forms.Form): git_url = forms.CharField() def analyze(self): if 'git_url' not in self._errors: self._errors['git_url'] = ErrorList() worker = GithubWorker() try: self.repository, self.project = worker.analyze_repo( self.cleaned_data['git_url']) return self.repository, self.project except UnknownObjectException: self._errors['git_url'].append(_('Repository not found.'))
<commit_before>from django import forms from wtl.wtgithub.worker import GithubWorker class AnalyzeForm(forms.Form): git_url = forms.CharField() def analyze(self): worker = GithubWorker() self.repository, self.project = worker.analyze_repo(self.cleaned_data['git_url']) return self.repository, self.project <commit_msg>Validate repo exists in `AnalyzeForm`<commit_after>
from django import forms from django.forms.util import ErrorList from django.utils.translation import ugettext_lazy as _ from github import UnknownObjectException from wtl.wtgithub.worker import GithubWorker class AnalyzeForm(forms.Form): git_url = forms.CharField() def analyze(self): if 'git_url' not in self._errors: self._errors['git_url'] = ErrorList() worker = GithubWorker() try: self.repository, self.project = worker.analyze_repo( self.cleaned_data['git_url']) return self.repository, self.project except UnknownObjectException: self._errors['git_url'].append(_('Repository not found.'))
from django import forms from wtl.wtgithub.worker import GithubWorker class AnalyzeForm(forms.Form): git_url = forms.CharField() def analyze(self): worker = GithubWorker() self.repository, self.project = worker.analyze_repo(self.cleaned_data['git_url']) return self.repository, self.project Validate repo exists in `AnalyzeForm`from django import forms from django.forms.util import ErrorList from django.utils.translation import ugettext_lazy as _ from github import UnknownObjectException from wtl.wtgithub.worker import GithubWorker class AnalyzeForm(forms.Form): git_url = forms.CharField() def analyze(self): if 'git_url' not in self._errors: self._errors['git_url'] = ErrorList() worker = GithubWorker() try: self.repository, self.project = worker.analyze_repo( self.cleaned_data['git_url']) return self.repository, self.project except UnknownObjectException: self._errors['git_url'].append(_('Repository not found.'))
<commit_before>from django import forms from wtl.wtgithub.worker import GithubWorker class AnalyzeForm(forms.Form): git_url = forms.CharField() def analyze(self): worker = GithubWorker() self.repository, self.project = worker.analyze_repo(self.cleaned_data['git_url']) return self.repository, self.project <commit_msg>Validate repo exists in `AnalyzeForm`<commit_after>from django import forms from django.forms.util import ErrorList from django.utils.translation import ugettext_lazy as _ from github import UnknownObjectException from wtl.wtgithub.worker import GithubWorker class AnalyzeForm(forms.Form): git_url = forms.CharField() def analyze(self): if 'git_url' not in self._errors: self._errors['git_url'] = ErrorList() worker = GithubWorker() try: self.repository, self.project = worker.analyze_repo( self.cleaned_data['git_url']) return self.repository, self.project except UnknownObjectException: self._errors['git_url'].append(_('Repository not found.'))
8132a4320425045b3642fa6a1d1343d1a4aa6463
tests/testinfra/test_installation.py
tests/testinfra/test_installation.py
""" Role tests """ import pytest # To run all the tests on given docker images: pytestmark = pytest.mark.docker_images( 'infopen/ubuntu-trusty-ssh:0.1.0', 'infopen/ubuntu-xenial-ssh-py27:0.2.0' ) def test_packages(SystemInfo, Package): assert Package('ntp').is_installed
""" Role tests """ import pytest # To run all the tests on given docker images: pytestmark = pytest.mark.docker_images( 'infopen/ubuntu-trusty-ssh:0.1.0', 'infopen/ubuntu-xenial-ssh-py27:develop' ) def test_packages(SystemInfo, Package): assert Package('ntp').is_installed
Add Updated docker image with iproute2 package
Add Updated docker image with iproute2 package
Python
mit
infOpen/ansible-role-ntp
""" Role tests """ import pytest # To run all the tests on given docker images: pytestmark = pytest.mark.docker_images( 'infopen/ubuntu-trusty-ssh:0.1.0', 'infopen/ubuntu-xenial-ssh-py27:0.2.0' ) def test_packages(SystemInfo, Package): assert Package('ntp').is_installed Add Updated docker image with iproute2 package
""" Role tests """ import pytest # To run all the tests on given docker images: pytestmark = pytest.mark.docker_images( 'infopen/ubuntu-trusty-ssh:0.1.0', 'infopen/ubuntu-xenial-ssh-py27:develop' ) def test_packages(SystemInfo, Package): assert Package('ntp').is_installed
<commit_before>""" Role tests """ import pytest # To run all the tests on given docker images: pytestmark = pytest.mark.docker_images( 'infopen/ubuntu-trusty-ssh:0.1.0', 'infopen/ubuntu-xenial-ssh-py27:0.2.0' ) def test_packages(SystemInfo, Package): assert Package('ntp').is_installed <commit_msg>Add Updated docker image with iproute2 package<commit_after>
""" Role tests """ import pytest # To run all the tests on given docker images: pytestmark = pytest.mark.docker_images( 'infopen/ubuntu-trusty-ssh:0.1.0', 'infopen/ubuntu-xenial-ssh-py27:develop' ) def test_packages(SystemInfo, Package): assert Package('ntp').is_installed
""" Role tests """ import pytest # To run all the tests on given docker images: pytestmark = pytest.mark.docker_images( 'infopen/ubuntu-trusty-ssh:0.1.0', 'infopen/ubuntu-xenial-ssh-py27:0.2.0' ) def test_packages(SystemInfo, Package): assert Package('ntp').is_installed Add Updated docker image with iproute2 package""" Role tests """ import pytest # To run all the tests on given docker images: pytestmark = pytest.mark.docker_images( 'infopen/ubuntu-trusty-ssh:0.1.0', 'infopen/ubuntu-xenial-ssh-py27:develop' ) def test_packages(SystemInfo, Package): assert Package('ntp').is_installed
<commit_before>""" Role tests """ import pytest # To run all the tests on given docker images: pytestmark = pytest.mark.docker_images( 'infopen/ubuntu-trusty-ssh:0.1.0', 'infopen/ubuntu-xenial-ssh-py27:0.2.0' ) def test_packages(SystemInfo, Package): assert Package('ntp').is_installed <commit_msg>Add Updated docker image with iproute2 package<commit_after>""" Role tests """ import pytest # To run all the tests on given docker images: pytestmark = pytest.mark.docker_images( 'infopen/ubuntu-trusty-ssh:0.1.0', 'infopen/ubuntu-xenial-ssh-py27:develop' ) def test_packages(SystemInfo, Package): assert Package('ntp').is_installed
43135538ac08a6a64ae8da935e188224999a1a16
indy_node/server/validator_info_tool.py
indy_node/server/validator_info_tool.py
import importlib from indy_node.__metadata__ import __version__ as node_pgk_version from plenum.server.validator_info_tool import none_on_fail, \ ValidatorNodeInfoTool as PlenumValidatorNodeInfoTool class ValidatorNodeInfoTool(PlenumValidatorNodeInfoTool): @property def info(self): info = super().info info['metrics']['transaction-count'].update( config=self.__config_ledger_size ) info.update( software={ 'indy-node': self.__node_pkg_version, 'sovrin': self.__sovrin_pkg_version, } ) return info @property @none_on_fail def __config_ledger_size(self): return self._node.configLedger.size @property @none_on_fail def __node_pkg_version(self): return node_pgk_version @property @none_on_fail def __sovrin_pkg_version(self): return importlib.import_module('sovrin').__version__
import importlib from indy_node.__metadata__ import __version__ as node_pgk_version from plenum.server.validator_info_tool import none_on_fail, \ ValidatorNodeInfoTool as PlenumValidatorNodeInfoTool class ValidatorNodeInfoTool(PlenumValidatorNodeInfoTool): @property def info(self): info = super().info if 'Node_info' in info: if 'Metrics' in info['Node_info']: info['Node_info']['Metrics']['transaction-count'].update( config=self.__config_ledger_size ) if 'Software' in info: info['Software'].update( { 'indy-node': self.__node_pkg_version, 'sovrin': self.__sovrin_pkg_version, } ) return info @property @none_on_fail def __config_ledger_size(self): return self._node.configLedger.size @property @none_on_fail def __node_pkg_version(self): return node_pgk_version @property @none_on_fail def __sovrin_pkg_version(self): return importlib.import_module('sovrin').__version__
Add new dict format into node validator-info
[INDY-1175] Add new dict format into node validator-info Signed-off-by: Andrew Nikitin <3988702a677b83abef1980fca266e406bb150845@dsr-corporation.com>
Python
apache-2.0
spivachuk/sovrin-node,spivachuk/sovrin-node,spivachuk/sovrin-node,spivachuk/sovrin-node
import importlib from indy_node.__metadata__ import __version__ as node_pgk_version from plenum.server.validator_info_tool import none_on_fail, \ ValidatorNodeInfoTool as PlenumValidatorNodeInfoTool class ValidatorNodeInfoTool(PlenumValidatorNodeInfoTool): @property def info(self): info = super().info info['metrics']['transaction-count'].update( config=self.__config_ledger_size ) info.update( software={ 'indy-node': self.__node_pkg_version, 'sovrin': self.__sovrin_pkg_version, } ) return info @property @none_on_fail def __config_ledger_size(self): return self._node.configLedger.size @property @none_on_fail def __node_pkg_version(self): return node_pgk_version @property @none_on_fail def __sovrin_pkg_version(self): return importlib.import_module('sovrin').__version__ [INDY-1175] Add new dict format into node validator-info Signed-off-by: Andrew Nikitin <3988702a677b83abef1980fca266e406bb150845@dsr-corporation.com>
import importlib from indy_node.__metadata__ import __version__ as node_pgk_version from plenum.server.validator_info_tool import none_on_fail, \ ValidatorNodeInfoTool as PlenumValidatorNodeInfoTool class ValidatorNodeInfoTool(PlenumValidatorNodeInfoTool): @property def info(self): info = super().info if 'Node_info' in info: if 'Metrics' in info['Node_info']: info['Node_info']['Metrics']['transaction-count'].update( config=self.__config_ledger_size ) if 'Software' in info: info['Software'].update( { 'indy-node': self.__node_pkg_version, 'sovrin': self.__sovrin_pkg_version, } ) return info @property @none_on_fail def __config_ledger_size(self): return self._node.configLedger.size @property @none_on_fail def __node_pkg_version(self): return node_pgk_version @property @none_on_fail def __sovrin_pkg_version(self): return importlib.import_module('sovrin').__version__
<commit_before>import importlib from indy_node.__metadata__ import __version__ as node_pgk_version from plenum.server.validator_info_tool import none_on_fail, \ ValidatorNodeInfoTool as PlenumValidatorNodeInfoTool class ValidatorNodeInfoTool(PlenumValidatorNodeInfoTool): @property def info(self): info = super().info info['metrics']['transaction-count'].update( config=self.__config_ledger_size ) info.update( software={ 'indy-node': self.__node_pkg_version, 'sovrin': self.__sovrin_pkg_version, } ) return info @property @none_on_fail def __config_ledger_size(self): return self._node.configLedger.size @property @none_on_fail def __node_pkg_version(self): return node_pgk_version @property @none_on_fail def __sovrin_pkg_version(self): return importlib.import_module('sovrin').__version__ <commit_msg>[INDY-1175] Add new dict format into node validator-info Signed-off-by: Andrew Nikitin <3988702a677b83abef1980fca266e406bb150845@dsr-corporation.com><commit_after>
import importlib from indy_node.__metadata__ import __version__ as node_pgk_version from plenum.server.validator_info_tool import none_on_fail, \ ValidatorNodeInfoTool as PlenumValidatorNodeInfoTool class ValidatorNodeInfoTool(PlenumValidatorNodeInfoTool): @property def info(self): info = super().info if 'Node_info' in info: if 'Metrics' in info['Node_info']: info['Node_info']['Metrics']['transaction-count'].update( config=self.__config_ledger_size ) if 'Software' in info: info['Software'].update( { 'indy-node': self.__node_pkg_version, 'sovrin': self.__sovrin_pkg_version, } ) return info @property @none_on_fail def __config_ledger_size(self): return self._node.configLedger.size @property @none_on_fail def __node_pkg_version(self): return node_pgk_version @property @none_on_fail def __sovrin_pkg_version(self): return importlib.import_module('sovrin').__version__
import importlib from indy_node.__metadata__ import __version__ as node_pgk_version from plenum.server.validator_info_tool import none_on_fail, \ ValidatorNodeInfoTool as PlenumValidatorNodeInfoTool class ValidatorNodeInfoTool(PlenumValidatorNodeInfoTool): @property def info(self): info = super().info info['metrics']['transaction-count'].update( config=self.__config_ledger_size ) info.update( software={ 'indy-node': self.__node_pkg_version, 'sovrin': self.__sovrin_pkg_version, } ) return info @property @none_on_fail def __config_ledger_size(self): return self._node.configLedger.size @property @none_on_fail def __node_pkg_version(self): return node_pgk_version @property @none_on_fail def __sovrin_pkg_version(self): return importlib.import_module('sovrin').__version__ [INDY-1175] Add new dict format into node validator-info Signed-off-by: Andrew Nikitin <3988702a677b83abef1980fca266e406bb150845@dsr-corporation.com>import importlib from indy_node.__metadata__ import __version__ as node_pgk_version from plenum.server.validator_info_tool import none_on_fail, \ ValidatorNodeInfoTool as PlenumValidatorNodeInfoTool class ValidatorNodeInfoTool(PlenumValidatorNodeInfoTool): @property def info(self): info = super().info if 'Node_info' in info: if 'Metrics' in info['Node_info']: info['Node_info']['Metrics']['transaction-count'].update( config=self.__config_ledger_size ) if 'Software' in info: info['Software'].update( { 'indy-node': self.__node_pkg_version, 'sovrin': self.__sovrin_pkg_version, } ) return info @property @none_on_fail def __config_ledger_size(self): return self._node.configLedger.size @property @none_on_fail def __node_pkg_version(self): return node_pgk_version @property @none_on_fail def __sovrin_pkg_version(self): return importlib.import_module('sovrin').__version__
<commit_before>import importlib from indy_node.__metadata__ import __version__ as node_pgk_version from plenum.server.validator_info_tool import none_on_fail, \ ValidatorNodeInfoTool as PlenumValidatorNodeInfoTool class ValidatorNodeInfoTool(PlenumValidatorNodeInfoTool): @property def info(self): info = super().info info['metrics']['transaction-count'].update( config=self.__config_ledger_size ) info.update( software={ 'indy-node': self.__node_pkg_version, 'sovrin': self.__sovrin_pkg_version, } ) return info @property @none_on_fail def __config_ledger_size(self): return self._node.configLedger.size @property @none_on_fail def __node_pkg_version(self): return node_pgk_version @property @none_on_fail def __sovrin_pkg_version(self): return importlib.import_module('sovrin').__version__ <commit_msg>[INDY-1175] Add new dict format into node validator-info Signed-off-by: Andrew Nikitin <3988702a677b83abef1980fca266e406bb150845@dsr-corporation.com><commit_after>import importlib from indy_node.__metadata__ import __version__ as node_pgk_version from plenum.server.validator_info_tool import none_on_fail, \ ValidatorNodeInfoTool as PlenumValidatorNodeInfoTool class ValidatorNodeInfoTool(PlenumValidatorNodeInfoTool): @property def info(self): info = super().info if 'Node_info' in info: if 'Metrics' in info['Node_info']: info['Node_info']['Metrics']['transaction-count'].update( config=self.__config_ledger_size ) if 'Software' in info: info['Software'].update( { 'indy-node': self.__node_pkg_version, 'sovrin': self.__sovrin_pkg_version, } ) return info @property @none_on_fail def __config_ledger_size(self): return self._node.configLedger.size @property @none_on_fail def __node_pkg_version(self): return node_pgk_version @property @none_on_fail def __sovrin_pkg_version(self): return importlib.import_module('sovrin').__version__
5b9024ea424abe6494f6e26f72f7838c189eea3c
kuryr/common/exceptions.py
kuryr/common/exceptions.py
# 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. class KuryrException(Exception): """Default Kuryr exception""" def __init__(self, msg): """ :param msg: the message for the cause of the exception """ self.msg = msg def __repr__(self): return repr(self.msg) class DuplicatedResourceException(KuryrException): """Exception represents there're multiple resources for the ID. This exception is thrown when you query the Neutron resouce associated with the ID and you get multiple resources. """
# 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. class KuryrException(Exception): """Default Kuryr exception""" class DuplicatedResourceException(KuryrException): """Exception represents there're multiple resources for the ID. This exception is thrown when you query the Neutron resouce associated with the ID and you get multiple resources. """
Modify KuryrException extend Exception appropriately
Modify KuryrException extend Exception appropriately This patch modifies KuryrException call the initializer of the super class. This fixes Kuryr not to return the empty error response. Change-Id: I728a24df6f20a81090c98aac46be22f3d27cd884 Signed-off-by: Taku Fukushima <d385cb54d860d8a5dcc6157b54cf213091772451@gmail.com> Closes-Bug: #1503518
Python
apache-2.0
midonet/kuryr,celebdor/kuryr-libnetwork,celebdor/kuryr,celebdor/kuryr-libnetwork,celebdor/kuryr,openstack/kuryr,openstack/kuryr,midonet/kuryr,celebdor/kuryr-libnetwork,midonet/kuryr
# 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. class KuryrException(Exception): """Default Kuryr exception""" def __init__(self, msg): """ :param msg: the message for the cause of the exception """ self.msg = msg def __repr__(self): return repr(self.msg) class DuplicatedResourceException(KuryrException): """Exception represents there're multiple resources for the ID. This exception is thrown when you query the Neutron resouce associated with the ID and you get multiple resources. """ Modify KuryrException extend Exception appropriately This patch modifies KuryrException call the initializer of the super class. This fixes Kuryr not to return the empty error response. Change-Id: I728a24df6f20a81090c98aac46be22f3d27cd884 Signed-off-by: Taku Fukushima <d385cb54d860d8a5dcc6157b54cf213091772451@gmail.com> Closes-Bug: #1503518
# 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. class KuryrException(Exception): """Default Kuryr exception""" class DuplicatedResourceException(KuryrException): """Exception represents there're multiple resources for the ID. This exception is thrown when you query the Neutron resouce associated with the ID and you get multiple resources. """
<commit_before># 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. class KuryrException(Exception): """Default Kuryr exception""" def __init__(self, msg): """ :param msg: the message for the cause of the exception """ self.msg = msg def __repr__(self): return repr(self.msg) class DuplicatedResourceException(KuryrException): """Exception represents there're multiple resources for the ID. This exception is thrown when you query the Neutron resouce associated with the ID and you get multiple resources. """ <commit_msg>Modify KuryrException extend Exception appropriately This patch modifies KuryrException call the initializer of the super class. This fixes Kuryr not to return the empty error response. Change-Id: I728a24df6f20a81090c98aac46be22f3d27cd884 Signed-off-by: Taku Fukushima <d385cb54d860d8a5dcc6157b54cf213091772451@gmail.com> Closes-Bug: #1503518<commit_after>
# 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. class KuryrException(Exception): """Default Kuryr exception""" class DuplicatedResourceException(KuryrException): """Exception represents there're multiple resources for the ID. This exception is thrown when you query the Neutron resouce associated with the ID and you get multiple resources. """
# 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. class KuryrException(Exception): """Default Kuryr exception""" def __init__(self, msg): """ :param msg: the message for the cause of the exception """ self.msg = msg def __repr__(self): return repr(self.msg) class DuplicatedResourceException(KuryrException): """Exception represents there're multiple resources for the ID. This exception is thrown when you query the Neutron resouce associated with the ID and you get multiple resources. """ Modify KuryrException extend Exception appropriately This patch modifies KuryrException call the initializer of the super class. This fixes Kuryr not to return the empty error response. Change-Id: I728a24df6f20a81090c98aac46be22f3d27cd884 Signed-off-by: Taku Fukushima <d385cb54d860d8a5dcc6157b54cf213091772451@gmail.com> Closes-Bug: #1503518# 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. class KuryrException(Exception): """Default Kuryr exception""" class DuplicatedResourceException(KuryrException): """Exception represents there're multiple resources for the ID. This exception is thrown when you query the Neutron resouce associated with the ID and you get multiple resources. """
<commit_before># 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. class KuryrException(Exception): """Default Kuryr exception""" def __init__(self, msg): """ :param msg: the message for the cause of the exception """ self.msg = msg def __repr__(self): return repr(self.msg) class DuplicatedResourceException(KuryrException): """Exception represents there're multiple resources for the ID. This exception is thrown when you query the Neutron resouce associated with the ID and you get multiple resources. """ <commit_msg>Modify KuryrException extend Exception appropriately This patch modifies KuryrException call the initializer of the super class. This fixes Kuryr not to return the empty error response. Change-Id: I728a24df6f20a81090c98aac46be22f3d27cd884 Signed-off-by: Taku Fukushima <d385cb54d860d8a5dcc6157b54cf213091772451@gmail.com> Closes-Bug: #1503518<commit_after># 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. class KuryrException(Exception): """Default Kuryr exception""" class DuplicatedResourceException(KuryrException): """Exception represents there're multiple resources for the ID. This exception is thrown when you query the Neutron resouce associated with the ID and you get multiple resources. """
ea287349360f6102369df3bdc8efb64a684a95ca
program/templatetags/timeslots.py
program/templatetags/timeslots.py
from django import template from datetime import datetime, time, timedelta register = template.Library() @register.simple_tag def height(start, end): if start.year == 2020 and int(start.strftime('%V')) >= 5 and start.hour == 12 and start.minute == 0: return '30' else: return '%d' % ((end - start).seconds / 60) @register.simple_tag def height_until(end): start = datetime.combine(end.date(), time(6, 0)) return '%d' % ((end - start).seconds / 60) @register.simple_tag def height_since(start): if start.time() < time(23, 59): end = datetime.combine(start.date() + timedelta(days=1), time(6, 0)) else: end = datetime.combine(start.date(), time(6, 0)) return '%d' % ((end - start).seconds / 60)
from django import template from datetime import datetime, time, timedelta register = template.Library() @register.simple_tag def height(start, end): if start.year == 2020 and int(start.strftime('%V')) >= 5 and start.hour == 12 and start.minute == 0: if end.minute == 5: return '30' return '%d' % (((end - start).seconds / 60) + 25) else: return '%d' % ((end - start).seconds / 60) @register.simple_tag def height_until(end): start = datetime.combine(end.date(), time(6, 0)) return '%d' % ((end - start).seconds / 60) @register.simple_tag def height_since(start): if start.time() < time(23, 59): end = datetime.combine(start.date() + timedelta(days=1), time(6, 0)) else: end = datetime.combine(start.date(), time(6, 0)) return '%d' % ((end - start).seconds / 60)
Add exception to to return extended height of the show
Add exception to to return extended height of the show
Python
unknown
radio-helsinki-graz/pv,radio-helsinki-graz/pv,nnrcschmdt/helsinki,radio-helsinki-graz/pv,nnrcschmdt/helsinki,nnrcschmdt/helsinki
from django import template from datetime import datetime, time, timedelta register = template.Library() @register.simple_tag def height(start, end): if start.year == 2020 and int(start.strftime('%V')) >= 5 and start.hour == 12 and start.minute == 0: return '30' else: return '%d' % ((end - start).seconds / 60) @register.simple_tag def height_until(end): start = datetime.combine(end.date(), time(6, 0)) return '%d' % ((end - start).seconds / 60) @register.simple_tag def height_since(start): if start.time() < time(23, 59): end = datetime.combine(start.date() + timedelta(days=1), time(6, 0)) else: end = datetime.combine(start.date(), time(6, 0)) return '%d' % ((end - start).seconds / 60) Add exception to to return extended height of the show
from django import template from datetime import datetime, time, timedelta register = template.Library() @register.simple_tag def height(start, end): if start.year == 2020 and int(start.strftime('%V')) >= 5 and start.hour == 12 and start.minute == 0: if end.minute == 5: return '30' return '%d' % (((end - start).seconds / 60) + 25) else: return '%d' % ((end - start).seconds / 60) @register.simple_tag def height_until(end): start = datetime.combine(end.date(), time(6, 0)) return '%d' % ((end - start).seconds / 60) @register.simple_tag def height_since(start): if start.time() < time(23, 59): end = datetime.combine(start.date() + timedelta(days=1), time(6, 0)) else: end = datetime.combine(start.date(), time(6, 0)) return '%d' % ((end - start).seconds / 60)
<commit_before>from django import template from datetime import datetime, time, timedelta register = template.Library() @register.simple_tag def height(start, end): if start.year == 2020 and int(start.strftime('%V')) >= 5 and start.hour == 12 and start.minute == 0: return '30' else: return '%d' % ((end - start).seconds / 60) @register.simple_tag def height_until(end): start = datetime.combine(end.date(), time(6, 0)) return '%d' % ((end - start).seconds / 60) @register.simple_tag def height_since(start): if start.time() < time(23, 59): end = datetime.combine(start.date() + timedelta(days=1), time(6, 0)) else: end = datetime.combine(start.date(), time(6, 0)) return '%d' % ((end - start).seconds / 60) <commit_msg>Add exception to to return extended height of the show<commit_after>
from django import template from datetime import datetime, time, timedelta register = template.Library() @register.simple_tag def height(start, end): if start.year == 2020 and int(start.strftime('%V')) >= 5 and start.hour == 12 and start.minute == 0: if end.minute == 5: return '30' return '%d' % (((end - start).seconds / 60) + 25) else: return '%d' % ((end - start).seconds / 60) @register.simple_tag def height_until(end): start = datetime.combine(end.date(), time(6, 0)) return '%d' % ((end - start).seconds / 60) @register.simple_tag def height_since(start): if start.time() < time(23, 59): end = datetime.combine(start.date() + timedelta(days=1), time(6, 0)) else: end = datetime.combine(start.date(), time(6, 0)) return '%d' % ((end - start).seconds / 60)
from django import template from datetime import datetime, time, timedelta register = template.Library() @register.simple_tag def height(start, end): if start.year == 2020 and int(start.strftime('%V')) >= 5 and start.hour == 12 and start.minute == 0: return '30' else: return '%d' % ((end - start).seconds / 60) @register.simple_tag def height_until(end): start = datetime.combine(end.date(), time(6, 0)) return '%d' % ((end - start).seconds / 60) @register.simple_tag def height_since(start): if start.time() < time(23, 59): end = datetime.combine(start.date() + timedelta(days=1), time(6, 0)) else: end = datetime.combine(start.date(), time(6, 0)) return '%d' % ((end - start).seconds / 60) Add exception to to return extended height of the showfrom django import template from datetime import datetime, time, timedelta register = template.Library() @register.simple_tag def height(start, end): if start.year == 2020 and int(start.strftime('%V')) >= 5 and start.hour == 12 and start.minute == 0: if end.minute == 5: return '30' return '%d' % (((end - start).seconds / 60) + 25) else: return '%d' % ((end - start).seconds / 60) @register.simple_tag def height_until(end): start = datetime.combine(end.date(), time(6, 0)) return '%d' % ((end - start).seconds / 60) @register.simple_tag def height_since(start): if start.time() < time(23, 59): end = datetime.combine(start.date() + timedelta(days=1), time(6, 0)) else: end = datetime.combine(start.date(), time(6, 0)) return '%d' % ((end - start).seconds / 60)
<commit_before>from django import template from datetime import datetime, time, timedelta register = template.Library() @register.simple_tag def height(start, end): if start.year == 2020 and int(start.strftime('%V')) >= 5 and start.hour == 12 and start.minute == 0: return '30' else: return '%d' % ((end - start).seconds / 60) @register.simple_tag def height_until(end): start = datetime.combine(end.date(), time(6, 0)) return '%d' % ((end - start).seconds / 60) @register.simple_tag def height_since(start): if start.time() < time(23, 59): end = datetime.combine(start.date() + timedelta(days=1), time(6, 0)) else: end = datetime.combine(start.date(), time(6, 0)) return '%d' % ((end - start).seconds / 60) <commit_msg>Add exception to to return extended height of the show<commit_after>from django import template from datetime import datetime, time, timedelta register = template.Library() @register.simple_tag def height(start, end): if start.year == 2020 and int(start.strftime('%V')) >= 5 and start.hour == 12 and start.minute == 0: if end.minute == 5: return '30' return '%d' % (((end - start).seconds / 60) + 25) else: return '%d' % ((end - start).seconds / 60) @register.simple_tag def height_until(end): start = datetime.combine(end.date(), time(6, 0)) return '%d' % ((end - start).seconds / 60) @register.simple_tag def height_since(start): if start.time() < time(23, 59): end = datetime.combine(start.date() + timedelta(days=1), time(6, 0)) else: end = datetime.combine(start.date(), time(6, 0)) return '%d' % ((end - start).seconds / 60)
aa6e5e93406cc614d1935f0ee61f28dbc955c2c0
forms.py
forms.py
from flask_wtf import Form from flask_wtf.csrf import CsrfProtect from wtforms import StringField, IntegerField, SelectField, BooleanField csrf = CsrfProtect() class Submission(Form): submission = StringField('Submission URL') comments = BooleanField('Include comments') comments_style = SelectField('Comments style', choices=[('quotes', 'quotes'), ('numbers', 'numbers')]) email = StringField('Kindle email address') kindle_address = SelectField('Kindle address', choices=[('normal', '@kindle.com'), ('free', '@free.kindle.com')]) class Subreddit(Form): subreddit = StringField('Subreddit') comments = BooleanField('Include comments') comments_style = SelectField('Comments style', choices=[('quotes', 'quotes'), ('numbers', 'numbers')]) time = SelectField('Time period', choices=[('all', 'all'), ('year', 'year'), ('month', 'month'), ('week', 'week'), ('day', 'day'), ('hour', 'hour')]) limit = IntegerField('Number of posts') email = StringField('Kindle email address') kindle_address = SelectField('Kindle address', choices=[('normal', '@kindle.com'), ('free', '@free.kindle.com')])
from flask_wtf import Form from flask_wtf.csrf import CsrfProtect from wtforms import StringField, IntegerField, SelectField, BooleanField csrf = CsrfProtect() class Submission(Form): submission = StringField('Submission URL') comments = BooleanField('Include comments') comments_style = SelectField('Comments style', choices=[('numbers', 'numbers'), ('quotes', 'quotes')]) email = StringField('Kindle email address') kindle_address = SelectField('Kindle address', choices=[('normal', '@kindle.com'), ('free', '@free.kindle.com')]) class Subreddit(Form): subreddit = StringField('Subreddit') comments = BooleanField('Include comments') comments_style = SelectField('Comments style', choices=[('numbers', 'numbers'), ('quotes', 'quotes')]) time = SelectField('Time period', choices=[('all', 'all'), ('year', 'year'), ('month', 'month'), ('week', 'week'), ('day', 'day'), ('hour', 'hour')]) limit = IntegerField('Number of posts') email = StringField('Kindle email address') kindle_address = SelectField('Kindle address', choices=[('normal', '@kindle.com'), ('free', '@free.kindle.com')])
Make numbers the default comments style
Make numbers the default comments style
Python
mit
JamieMagee/reddit2kindle,JamieMagee/reddit2kindle
from flask_wtf import Form from flask_wtf.csrf import CsrfProtect from wtforms import StringField, IntegerField, SelectField, BooleanField csrf = CsrfProtect() class Submission(Form): submission = StringField('Submission URL') comments = BooleanField('Include comments') comments_style = SelectField('Comments style', choices=[('quotes', 'quotes'), ('numbers', 'numbers')]) email = StringField('Kindle email address') kindle_address = SelectField('Kindle address', choices=[('normal', '@kindle.com'), ('free', '@free.kindle.com')]) class Subreddit(Form): subreddit = StringField('Subreddit') comments = BooleanField('Include comments') comments_style = SelectField('Comments style', choices=[('quotes', 'quotes'), ('numbers', 'numbers')]) time = SelectField('Time period', choices=[('all', 'all'), ('year', 'year'), ('month', 'month'), ('week', 'week'), ('day', 'day'), ('hour', 'hour')]) limit = IntegerField('Number of posts') email = StringField('Kindle email address') kindle_address = SelectField('Kindle address', choices=[('normal', '@kindle.com'), ('free', '@free.kindle.com')]) Make numbers the default comments style
from flask_wtf import Form from flask_wtf.csrf import CsrfProtect from wtforms import StringField, IntegerField, SelectField, BooleanField csrf = CsrfProtect() class Submission(Form): submission = StringField('Submission URL') comments = BooleanField('Include comments') comments_style = SelectField('Comments style', choices=[('numbers', 'numbers'), ('quotes', 'quotes')]) email = StringField('Kindle email address') kindle_address = SelectField('Kindle address', choices=[('normal', '@kindle.com'), ('free', '@free.kindle.com')]) class Subreddit(Form): subreddit = StringField('Subreddit') comments = BooleanField('Include comments') comments_style = SelectField('Comments style', choices=[('numbers', 'numbers'), ('quotes', 'quotes')]) time = SelectField('Time period', choices=[('all', 'all'), ('year', 'year'), ('month', 'month'), ('week', 'week'), ('day', 'day'), ('hour', 'hour')]) limit = IntegerField('Number of posts') email = StringField('Kindle email address') kindle_address = SelectField('Kindle address', choices=[('normal', '@kindle.com'), ('free', '@free.kindle.com')])
<commit_before>from flask_wtf import Form from flask_wtf.csrf import CsrfProtect from wtforms import StringField, IntegerField, SelectField, BooleanField csrf = CsrfProtect() class Submission(Form): submission = StringField('Submission URL') comments = BooleanField('Include comments') comments_style = SelectField('Comments style', choices=[('quotes', 'quotes'), ('numbers', 'numbers')]) email = StringField('Kindle email address') kindle_address = SelectField('Kindle address', choices=[('normal', '@kindle.com'), ('free', '@free.kindle.com')]) class Subreddit(Form): subreddit = StringField('Subreddit') comments = BooleanField('Include comments') comments_style = SelectField('Comments style', choices=[('quotes', 'quotes'), ('numbers', 'numbers')]) time = SelectField('Time period', choices=[('all', 'all'), ('year', 'year'), ('month', 'month'), ('week', 'week'), ('day', 'day'), ('hour', 'hour')]) limit = IntegerField('Number of posts') email = StringField('Kindle email address') kindle_address = SelectField('Kindle address', choices=[('normal', '@kindle.com'), ('free', '@free.kindle.com')]) <commit_msg>Make numbers the default comments style<commit_after>
from flask_wtf import Form from flask_wtf.csrf import CsrfProtect from wtforms import StringField, IntegerField, SelectField, BooleanField csrf = CsrfProtect() class Submission(Form): submission = StringField('Submission URL') comments = BooleanField('Include comments') comments_style = SelectField('Comments style', choices=[('numbers', 'numbers'), ('quotes', 'quotes')]) email = StringField('Kindle email address') kindle_address = SelectField('Kindle address', choices=[('normal', '@kindle.com'), ('free', '@free.kindle.com')]) class Subreddit(Form): subreddit = StringField('Subreddit') comments = BooleanField('Include comments') comments_style = SelectField('Comments style', choices=[('numbers', 'numbers'), ('quotes', 'quotes')]) time = SelectField('Time period', choices=[('all', 'all'), ('year', 'year'), ('month', 'month'), ('week', 'week'), ('day', 'day'), ('hour', 'hour')]) limit = IntegerField('Number of posts') email = StringField('Kindle email address') kindle_address = SelectField('Kindle address', choices=[('normal', '@kindle.com'), ('free', '@free.kindle.com')])
from flask_wtf import Form from flask_wtf.csrf import CsrfProtect from wtforms import StringField, IntegerField, SelectField, BooleanField csrf = CsrfProtect() class Submission(Form): submission = StringField('Submission URL') comments = BooleanField('Include comments') comments_style = SelectField('Comments style', choices=[('quotes', 'quotes'), ('numbers', 'numbers')]) email = StringField('Kindle email address') kindle_address = SelectField('Kindle address', choices=[('normal', '@kindle.com'), ('free', '@free.kindle.com')]) class Subreddit(Form): subreddit = StringField('Subreddit') comments = BooleanField('Include comments') comments_style = SelectField('Comments style', choices=[('quotes', 'quotes'), ('numbers', 'numbers')]) time = SelectField('Time period', choices=[('all', 'all'), ('year', 'year'), ('month', 'month'), ('week', 'week'), ('day', 'day'), ('hour', 'hour')]) limit = IntegerField('Number of posts') email = StringField('Kindle email address') kindle_address = SelectField('Kindle address', choices=[('normal', '@kindle.com'), ('free', '@free.kindle.com')]) Make numbers the default comments stylefrom flask_wtf import Form from flask_wtf.csrf import CsrfProtect from wtforms import StringField, IntegerField, SelectField, BooleanField csrf = CsrfProtect() class Submission(Form): submission = StringField('Submission URL') comments = BooleanField('Include comments') comments_style = SelectField('Comments style', choices=[('numbers', 'numbers'), ('quotes', 'quotes')]) email = StringField('Kindle email address') kindle_address = SelectField('Kindle address', choices=[('normal', '@kindle.com'), ('free', '@free.kindle.com')]) class Subreddit(Form): subreddit = StringField('Subreddit') comments = BooleanField('Include comments') comments_style = SelectField('Comments style', choices=[('numbers', 'numbers'), ('quotes', 'quotes')]) time = SelectField('Time period', choices=[('all', 'all'), ('year', 'year'), ('month', 'month'), ('week', 'week'), ('day', 'day'), ('hour', 'hour')]) limit = IntegerField('Number of posts') email = StringField('Kindle email address') kindle_address = SelectField('Kindle address', choices=[('normal', '@kindle.com'), ('free', '@free.kindle.com')])
<commit_before>from flask_wtf import Form from flask_wtf.csrf import CsrfProtect from wtforms import StringField, IntegerField, SelectField, BooleanField csrf = CsrfProtect() class Submission(Form): submission = StringField('Submission URL') comments = BooleanField('Include comments') comments_style = SelectField('Comments style', choices=[('quotes', 'quotes'), ('numbers', 'numbers')]) email = StringField('Kindle email address') kindle_address = SelectField('Kindle address', choices=[('normal', '@kindle.com'), ('free', '@free.kindle.com')]) class Subreddit(Form): subreddit = StringField('Subreddit') comments = BooleanField('Include comments') comments_style = SelectField('Comments style', choices=[('quotes', 'quotes'), ('numbers', 'numbers')]) time = SelectField('Time period', choices=[('all', 'all'), ('year', 'year'), ('month', 'month'), ('week', 'week'), ('day', 'day'), ('hour', 'hour')]) limit = IntegerField('Number of posts') email = StringField('Kindle email address') kindle_address = SelectField('Kindle address', choices=[('normal', '@kindle.com'), ('free', '@free.kindle.com')]) <commit_msg>Make numbers the default comments style<commit_after>from flask_wtf import Form from flask_wtf.csrf import CsrfProtect from wtforms import StringField, IntegerField, SelectField, BooleanField csrf = CsrfProtect() class Submission(Form): submission = StringField('Submission URL') comments = BooleanField('Include comments') comments_style = SelectField('Comments style', choices=[('numbers', 'numbers'), ('quotes', 'quotes')]) email = StringField('Kindle email address') kindle_address = SelectField('Kindle address', choices=[('normal', '@kindle.com'), ('free', '@free.kindle.com')]) class Subreddit(Form): subreddit = StringField('Subreddit') comments = BooleanField('Include comments') comments_style = SelectField('Comments style', choices=[('numbers', 'numbers'), ('quotes', 'quotes')]) time = SelectField('Time period', choices=[('all', 'all'), ('year', 'year'), ('month', 'month'), ('week', 'week'), ('day', 'day'), ('hour', 'hour')]) limit = IntegerField('Number of posts') email = StringField('Kindle email address') kindle_address = SelectField('Kindle address', choices=[('normal', '@kindle.com'), ('free', '@free.kindle.com')])
e3bbaf9421bdc5e0ac538c57a9821b5dba0382ef
dataviva/apps/title/models.py
dataviva/apps/title/models.py
from dataviva import db class GraphTitle(db.Model): __tablename__ = 'graph_title' id = db.Column(db.Integer, primary_key=True) title_en = db.Column(db.String(255)) subtitle_en = db.Column(db.String(255)) title_pt = db.Column(db.String(255)) subtitle_pt = db.Column(db.String(255)) dataset = db.Column(db.String(45)) graph = db.Column(db.String(45)) shapes = db.Column(db.String(45)) type = db.Column(db.String(45)) product = db.Column(db.Boolean) partner = db.Column(db.Boolean) location = db.Column(db.Boolean) industry = db.Column(db.Boolean) occupation = db.Column(db.Boolean) establishment = db.Column(db.Boolean) hedu_course = db.Column(db.Boolean) university = db.Column(db.Boolean) sc_course = db.Column(db.Boolean)
from dataviva import db class GraphTitle(db.Model): __tablename__ = 'graph_title' id = db.Column(db.Integer, primary_key=True) title_en = db.Column(db.String(255)) subtitle_en = db.Column(db.String(255)) title_pt = db.Column(db.String(255)) subtitle_pt = db.Column(db.String(255)) dataset = db.Column(db.String(45)) graph = db.Column(db.String(45)) shapes = db.Column(db.String(45)) type = db.Column(db.String(45)) product = db.Column(db.Boolean) partner = db.Column(db.Boolean) location = db.Column(db.Boolean) industry = db.Column(db.Boolean) occupation = db.Column(db.Boolean) establishment = db.Column(db.Boolean) hedu_course = db.Column(db.Boolean) university = db.Column(db.Boolean) sc_course = db.Column(db.Boolean) sc_course_field = db.Column(db.Boolean)
Add column to title model
Add column to title model
Python
mit
DataViva/dataviva-site,DataViva/dataviva-site,DataViva/dataviva-site,DataViva/dataviva-site
from dataviva import db class GraphTitle(db.Model): __tablename__ = 'graph_title' id = db.Column(db.Integer, primary_key=True) title_en = db.Column(db.String(255)) subtitle_en = db.Column(db.String(255)) title_pt = db.Column(db.String(255)) subtitle_pt = db.Column(db.String(255)) dataset = db.Column(db.String(45)) graph = db.Column(db.String(45)) shapes = db.Column(db.String(45)) type = db.Column(db.String(45)) product = db.Column(db.Boolean) partner = db.Column(db.Boolean) location = db.Column(db.Boolean) industry = db.Column(db.Boolean) occupation = db.Column(db.Boolean) establishment = db.Column(db.Boolean) hedu_course = db.Column(db.Boolean) university = db.Column(db.Boolean) sc_course = db.Column(db.Boolean) Add column to title model
from dataviva import db class GraphTitle(db.Model): __tablename__ = 'graph_title' id = db.Column(db.Integer, primary_key=True) title_en = db.Column(db.String(255)) subtitle_en = db.Column(db.String(255)) title_pt = db.Column(db.String(255)) subtitle_pt = db.Column(db.String(255)) dataset = db.Column(db.String(45)) graph = db.Column(db.String(45)) shapes = db.Column(db.String(45)) type = db.Column(db.String(45)) product = db.Column(db.Boolean) partner = db.Column(db.Boolean) location = db.Column(db.Boolean) industry = db.Column(db.Boolean) occupation = db.Column(db.Boolean) establishment = db.Column(db.Boolean) hedu_course = db.Column(db.Boolean) university = db.Column(db.Boolean) sc_course = db.Column(db.Boolean) sc_course_field = db.Column(db.Boolean)
<commit_before>from dataviva import db class GraphTitle(db.Model): __tablename__ = 'graph_title' id = db.Column(db.Integer, primary_key=True) title_en = db.Column(db.String(255)) subtitle_en = db.Column(db.String(255)) title_pt = db.Column(db.String(255)) subtitle_pt = db.Column(db.String(255)) dataset = db.Column(db.String(45)) graph = db.Column(db.String(45)) shapes = db.Column(db.String(45)) type = db.Column(db.String(45)) product = db.Column(db.Boolean) partner = db.Column(db.Boolean) location = db.Column(db.Boolean) industry = db.Column(db.Boolean) occupation = db.Column(db.Boolean) establishment = db.Column(db.Boolean) hedu_course = db.Column(db.Boolean) university = db.Column(db.Boolean) sc_course = db.Column(db.Boolean) <commit_msg>Add column to title model<commit_after>
from dataviva import db class GraphTitle(db.Model): __tablename__ = 'graph_title' id = db.Column(db.Integer, primary_key=True) title_en = db.Column(db.String(255)) subtitle_en = db.Column(db.String(255)) title_pt = db.Column(db.String(255)) subtitle_pt = db.Column(db.String(255)) dataset = db.Column(db.String(45)) graph = db.Column(db.String(45)) shapes = db.Column(db.String(45)) type = db.Column(db.String(45)) product = db.Column(db.Boolean) partner = db.Column(db.Boolean) location = db.Column(db.Boolean) industry = db.Column(db.Boolean) occupation = db.Column(db.Boolean) establishment = db.Column(db.Boolean) hedu_course = db.Column(db.Boolean) university = db.Column(db.Boolean) sc_course = db.Column(db.Boolean) sc_course_field = db.Column(db.Boolean)
from dataviva import db class GraphTitle(db.Model): __tablename__ = 'graph_title' id = db.Column(db.Integer, primary_key=True) title_en = db.Column(db.String(255)) subtitle_en = db.Column(db.String(255)) title_pt = db.Column(db.String(255)) subtitle_pt = db.Column(db.String(255)) dataset = db.Column(db.String(45)) graph = db.Column(db.String(45)) shapes = db.Column(db.String(45)) type = db.Column(db.String(45)) product = db.Column(db.Boolean) partner = db.Column(db.Boolean) location = db.Column(db.Boolean) industry = db.Column(db.Boolean) occupation = db.Column(db.Boolean) establishment = db.Column(db.Boolean) hedu_course = db.Column(db.Boolean) university = db.Column(db.Boolean) sc_course = db.Column(db.Boolean) Add column to title modelfrom dataviva import db class GraphTitle(db.Model): __tablename__ = 'graph_title' id = db.Column(db.Integer, primary_key=True) title_en = db.Column(db.String(255)) subtitle_en = db.Column(db.String(255)) title_pt = db.Column(db.String(255)) subtitle_pt = db.Column(db.String(255)) dataset = db.Column(db.String(45)) graph = db.Column(db.String(45)) shapes = db.Column(db.String(45)) type = db.Column(db.String(45)) product = db.Column(db.Boolean) partner = db.Column(db.Boolean) location = db.Column(db.Boolean) industry = db.Column(db.Boolean) occupation = db.Column(db.Boolean) establishment = db.Column(db.Boolean) hedu_course = db.Column(db.Boolean) university = db.Column(db.Boolean) sc_course = db.Column(db.Boolean) sc_course_field = db.Column(db.Boolean)
<commit_before>from dataviva import db class GraphTitle(db.Model): __tablename__ = 'graph_title' id = db.Column(db.Integer, primary_key=True) title_en = db.Column(db.String(255)) subtitle_en = db.Column(db.String(255)) title_pt = db.Column(db.String(255)) subtitle_pt = db.Column(db.String(255)) dataset = db.Column(db.String(45)) graph = db.Column(db.String(45)) shapes = db.Column(db.String(45)) type = db.Column(db.String(45)) product = db.Column(db.Boolean) partner = db.Column(db.Boolean) location = db.Column(db.Boolean) industry = db.Column(db.Boolean) occupation = db.Column(db.Boolean) establishment = db.Column(db.Boolean) hedu_course = db.Column(db.Boolean) university = db.Column(db.Boolean) sc_course = db.Column(db.Boolean) <commit_msg>Add column to title model<commit_after>from dataviva import db class GraphTitle(db.Model): __tablename__ = 'graph_title' id = db.Column(db.Integer, primary_key=True) title_en = db.Column(db.String(255)) subtitle_en = db.Column(db.String(255)) title_pt = db.Column(db.String(255)) subtitle_pt = db.Column(db.String(255)) dataset = db.Column(db.String(45)) graph = db.Column(db.String(45)) shapes = db.Column(db.String(45)) type = db.Column(db.String(45)) product = db.Column(db.Boolean) partner = db.Column(db.Boolean) location = db.Column(db.Boolean) industry = db.Column(db.Boolean) occupation = db.Column(db.Boolean) establishment = db.Column(db.Boolean) hedu_course = db.Column(db.Boolean) university = db.Column(db.Boolean) sc_course = db.Column(db.Boolean) sc_course_field = db.Column(db.Boolean)
1ac468723c4b94840f8f4799b289709554264b58
src/job_api/python/cloudi_job_api.py
src/job_api/python/cloudi_job_api.py
# -*- coding: utf-8; Mode: python; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # ex: set softtabstop=4 tabstop=4 shiftwidth=4 expandtab fileencoding=utf-8: import sys, os sys.path.append( os.path.sep.join( os.path.dirname(os.path.abspath(__file__)) .split(os.path.sep) + ['jsonrpclib'] ) ) import jsonrpclib class CloudI(object): # initialize with configuration file defaults def __init__(self, host = 'localhost', port = 6465): address = 'http://%s:%d/cloudi/api/json_rpc/' % (host, port) self.__server = jsonrpclib.Server(address) def __getattr__(self, name): if name == 'jobs': return self.__jobs return self.__server.__getattr__(name) def __jobs(self): raw = self.__server.jobs() def split_tuple(s): entry = s.split('>>,\n ') return ('<<' + entry[0] + '>>', entry[1]) return map(split_tuple, raw[1:-1].split(',\n {<<'))
# -*- coding: utf-8; Mode: python; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # ex: set softtabstop=4 tabstop=4 shiftwidth=4 expandtab fileencoding=utf-8: import sys, os sys.path.append( os.path.sep.join( os.path.dirname(os.path.abspath(__file__)) .split(os.path.sep) + ['jsonrpclib'] ) ) import jsonrpclib class CloudI(object): # initialize with configuration file defaults def __init__(self, host = 'localhost', port = 6464): address = 'http://%s:%d/cloudi/api/json_rpc/' % (host, port) self.__server = jsonrpclib.Server(address) def __getattr__(self, name): if name == 'jobs': return self.__jobs return self.__server.__getattr__(name) def __jobs(self): raw = self.__server.jobs() def split_tuple(s): entry = s.split('>>,\n ') return ('<<' + entry[0] + '>>', entry[1]) return map(split_tuple, raw[1:-1].split(',\n {<<'))
Switch the CloudI Job API to use the binary output misultin job, instead of the list output one... both work.
Switch the CloudI Job API to use the binary output misultin job, instead of the list output one... both work.
Python
mit
CloudI/CloudI,CloudI/CloudI,CloudI/CloudI,CloudI/CloudI,CloudI/CloudI,CloudI/CloudI,CloudI/CloudI,CloudI/CloudI,CloudI/CloudI,CloudI/CloudI,CloudI/CloudI
# -*- coding: utf-8; Mode: python; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # ex: set softtabstop=4 tabstop=4 shiftwidth=4 expandtab fileencoding=utf-8: import sys, os sys.path.append( os.path.sep.join( os.path.dirname(os.path.abspath(__file__)) .split(os.path.sep) + ['jsonrpclib'] ) ) import jsonrpclib class CloudI(object): # initialize with configuration file defaults def __init__(self, host = 'localhost', port = 6465): address = 'http://%s:%d/cloudi/api/json_rpc/' % (host, port) self.__server = jsonrpclib.Server(address) def __getattr__(self, name): if name == 'jobs': return self.__jobs return self.__server.__getattr__(name) def __jobs(self): raw = self.__server.jobs() def split_tuple(s): entry = s.split('>>,\n ') return ('<<' + entry[0] + '>>', entry[1]) return map(split_tuple, raw[1:-1].split(',\n {<<')) Switch the CloudI Job API to use the binary output misultin job, instead of the list output one... both work.
# -*- coding: utf-8; Mode: python; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # ex: set softtabstop=4 tabstop=4 shiftwidth=4 expandtab fileencoding=utf-8: import sys, os sys.path.append( os.path.sep.join( os.path.dirname(os.path.abspath(__file__)) .split(os.path.sep) + ['jsonrpclib'] ) ) import jsonrpclib class CloudI(object): # initialize with configuration file defaults def __init__(self, host = 'localhost', port = 6464): address = 'http://%s:%d/cloudi/api/json_rpc/' % (host, port) self.__server = jsonrpclib.Server(address) def __getattr__(self, name): if name == 'jobs': return self.__jobs return self.__server.__getattr__(name) def __jobs(self): raw = self.__server.jobs() def split_tuple(s): entry = s.split('>>,\n ') return ('<<' + entry[0] + '>>', entry[1]) return map(split_tuple, raw[1:-1].split(',\n {<<'))
<commit_before># -*- coding: utf-8; Mode: python; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # ex: set softtabstop=4 tabstop=4 shiftwidth=4 expandtab fileencoding=utf-8: import sys, os sys.path.append( os.path.sep.join( os.path.dirname(os.path.abspath(__file__)) .split(os.path.sep) + ['jsonrpclib'] ) ) import jsonrpclib class CloudI(object): # initialize with configuration file defaults def __init__(self, host = 'localhost', port = 6465): address = 'http://%s:%d/cloudi/api/json_rpc/' % (host, port) self.__server = jsonrpclib.Server(address) def __getattr__(self, name): if name == 'jobs': return self.__jobs return self.__server.__getattr__(name) def __jobs(self): raw = self.__server.jobs() def split_tuple(s): entry = s.split('>>,\n ') return ('<<' + entry[0] + '>>', entry[1]) return map(split_tuple, raw[1:-1].split(',\n {<<')) <commit_msg>Switch the CloudI Job API to use the binary output misultin job, instead of the list output one... both work.<commit_after>
# -*- coding: utf-8; Mode: python; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # ex: set softtabstop=4 tabstop=4 shiftwidth=4 expandtab fileencoding=utf-8: import sys, os sys.path.append( os.path.sep.join( os.path.dirname(os.path.abspath(__file__)) .split(os.path.sep) + ['jsonrpclib'] ) ) import jsonrpclib class CloudI(object): # initialize with configuration file defaults def __init__(self, host = 'localhost', port = 6464): address = 'http://%s:%d/cloudi/api/json_rpc/' % (host, port) self.__server = jsonrpclib.Server(address) def __getattr__(self, name): if name == 'jobs': return self.__jobs return self.__server.__getattr__(name) def __jobs(self): raw = self.__server.jobs() def split_tuple(s): entry = s.split('>>,\n ') return ('<<' + entry[0] + '>>', entry[1]) return map(split_tuple, raw[1:-1].split(',\n {<<'))
# -*- coding: utf-8; Mode: python; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # ex: set softtabstop=4 tabstop=4 shiftwidth=4 expandtab fileencoding=utf-8: import sys, os sys.path.append( os.path.sep.join( os.path.dirname(os.path.abspath(__file__)) .split(os.path.sep) + ['jsonrpclib'] ) ) import jsonrpclib class CloudI(object): # initialize with configuration file defaults def __init__(self, host = 'localhost', port = 6465): address = 'http://%s:%d/cloudi/api/json_rpc/' % (host, port) self.__server = jsonrpclib.Server(address) def __getattr__(self, name): if name == 'jobs': return self.__jobs return self.__server.__getattr__(name) def __jobs(self): raw = self.__server.jobs() def split_tuple(s): entry = s.split('>>,\n ') return ('<<' + entry[0] + '>>', entry[1]) return map(split_tuple, raw[1:-1].split(',\n {<<')) Switch the CloudI Job API to use the binary output misultin job, instead of the list output one... both work.# -*- coding: utf-8; Mode: python; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # ex: set softtabstop=4 tabstop=4 shiftwidth=4 expandtab fileencoding=utf-8: import sys, os sys.path.append( os.path.sep.join( os.path.dirname(os.path.abspath(__file__)) .split(os.path.sep) + ['jsonrpclib'] ) ) import jsonrpclib class CloudI(object): # initialize with configuration file defaults def __init__(self, host = 'localhost', port = 6464): address = 'http://%s:%d/cloudi/api/json_rpc/' % (host, port) self.__server = jsonrpclib.Server(address) def __getattr__(self, name): if name == 'jobs': return self.__jobs return self.__server.__getattr__(name) def __jobs(self): raw = self.__server.jobs() def split_tuple(s): entry = s.split('>>,\n ') return ('<<' + entry[0] + '>>', entry[1]) return map(split_tuple, raw[1:-1].split(',\n {<<'))
<commit_before># -*- coding: utf-8; Mode: python; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # ex: set softtabstop=4 tabstop=4 shiftwidth=4 expandtab fileencoding=utf-8: import sys, os sys.path.append( os.path.sep.join( os.path.dirname(os.path.abspath(__file__)) .split(os.path.sep) + ['jsonrpclib'] ) ) import jsonrpclib class CloudI(object): # initialize with configuration file defaults def __init__(self, host = 'localhost', port = 6465): address = 'http://%s:%d/cloudi/api/json_rpc/' % (host, port) self.__server = jsonrpclib.Server(address) def __getattr__(self, name): if name == 'jobs': return self.__jobs return self.__server.__getattr__(name) def __jobs(self): raw = self.__server.jobs() def split_tuple(s): entry = s.split('>>,\n ') return ('<<' + entry[0] + '>>', entry[1]) return map(split_tuple, raw[1:-1].split(',\n {<<')) <commit_msg>Switch the CloudI Job API to use the binary output misultin job, instead of the list output one... both work.<commit_after># -*- coding: utf-8; Mode: python; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # ex: set softtabstop=4 tabstop=4 shiftwidth=4 expandtab fileencoding=utf-8: import sys, os sys.path.append( os.path.sep.join( os.path.dirname(os.path.abspath(__file__)) .split(os.path.sep) + ['jsonrpclib'] ) ) import jsonrpclib class CloudI(object): # initialize with configuration file defaults def __init__(self, host = 'localhost', port = 6464): address = 'http://%s:%d/cloudi/api/json_rpc/' % (host, port) self.__server = jsonrpclib.Server(address) def __getattr__(self, name): if name == 'jobs': return self.__jobs return self.__server.__getattr__(name) def __jobs(self): raw = self.__server.jobs() def split_tuple(s): entry = s.split('>>,\n ') return ('<<' + entry[0] + '>>', entry[1]) return map(split_tuple, raw[1:-1].split(',\n {<<'))
2f055184a3832d4a44b151f6c3caf4089e80aa6d
devicehive/device_hive_api.py
devicehive/device_hive_api.py
from devicehive.handler import Handler from devicehive.device_hive import DeviceHive class ApiCallHandler(Handler): """Api call handler class.""" def __init__(self, api, call, *call_args, **call_kwargs): super(ApiCallHandler, self).__init__(api) self._call = call self._call_args = call_args self._call_kwargs = call_kwargs self._call_result = None @property def call_result(self): return self._call_result def handle_connect(self): self._call_result = getattr(self.api, self._call)(*self._call_args, **self._call_kwargs) self.api.disconnect() class DeviceHiveApi(object): """Device hive api class.""" def __init__(self, transport_url, **options): self._transport_url = transport_url self._options = options def _call(self, call, *call_args, **call_kwargs): device_hive = DeviceHive(ApiCallHandler, call, *call_args, **call_kwargs) device_hive.connect(self._transport_url, **self._options) return device_hive.transport.handler.handler.call_result def get_info(self): return self._call('get_info') def get_cluster_info(self): return self._call('get_cluster_info')
from devicehive.handler import Handler from devicehive.device_hive import DeviceHive class ApiCallHandler(Handler): """Api call handler class.""" def __init__(self, api, call, *call_args, **call_kwargs): super(ApiCallHandler, self).__init__(api) self._call = call self._call_args = call_args self._call_kwargs = call_kwargs self._call_result = None @property def call_result(self): return self._call_result def handle_connect(self): self._call_result = getattr(self.api, self._call)(*self._call_args, **self._call_kwargs) self.api.disconnect() class DeviceHiveApi(object): """Device hive api class.""" def __init__(self, transport_url, **options): self._transport_url = transport_url self._options = options def _call(self, call, *call_args, **call_kwargs): device_hive = DeviceHive(ApiCallHandler, call, *call_args, **call_kwargs) device_hive.connect(self._transport_url, **self._options) return device_hive.transport.handler.handler.call_result def get_info(self): return self._call('get_info') def get_cluster_info(self): return self._call('get_cluster_info') def get_property(self, name): return self._call('get_property', name) def set_property(self, name, value): return self._call('set_property', name, value) def delete_property(self, name): return self._call('delete_property', name)
Add get_property, set_property and delete_property functions
Add get_property, set_property and delete_property functions
Python
apache-2.0
devicehive/devicehive-python
from devicehive.handler import Handler from devicehive.device_hive import DeviceHive class ApiCallHandler(Handler): """Api call handler class.""" def __init__(self, api, call, *call_args, **call_kwargs): super(ApiCallHandler, self).__init__(api) self._call = call self._call_args = call_args self._call_kwargs = call_kwargs self._call_result = None @property def call_result(self): return self._call_result def handle_connect(self): self._call_result = getattr(self.api, self._call)(*self._call_args, **self._call_kwargs) self.api.disconnect() class DeviceHiveApi(object): """Device hive api class.""" def __init__(self, transport_url, **options): self._transport_url = transport_url self._options = options def _call(self, call, *call_args, **call_kwargs): device_hive = DeviceHive(ApiCallHandler, call, *call_args, **call_kwargs) device_hive.connect(self._transport_url, **self._options) return device_hive.transport.handler.handler.call_result def get_info(self): return self._call('get_info') def get_cluster_info(self): return self._call('get_cluster_info') Add get_property, set_property and delete_property functions
from devicehive.handler import Handler from devicehive.device_hive import DeviceHive class ApiCallHandler(Handler): """Api call handler class.""" def __init__(self, api, call, *call_args, **call_kwargs): super(ApiCallHandler, self).__init__(api) self._call = call self._call_args = call_args self._call_kwargs = call_kwargs self._call_result = None @property def call_result(self): return self._call_result def handle_connect(self): self._call_result = getattr(self.api, self._call)(*self._call_args, **self._call_kwargs) self.api.disconnect() class DeviceHiveApi(object): """Device hive api class.""" def __init__(self, transport_url, **options): self._transport_url = transport_url self._options = options def _call(self, call, *call_args, **call_kwargs): device_hive = DeviceHive(ApiCallHandler, call, *call_args, **call_kwargs) device_hive.connect(self._transport_url, **self._options) return device_hive.transport.handler.handler.call_result def get_info(self): return self._call('get_info') def get_cluster_info(self): return self._call('get_cluster_info') def get_property(self, name): return self._call('get_property', name) def set_property(self, name, value): return self._call('set_property', name, value) def delete_property(self, name): return self._call('delete_property', name)
<commit_before>from devicehive.handler import Handler from devicehive.device_hive import DeviceHive class ApiCallHandler(Handler): """Api call handler class.""" def __init__(self, api, call, *call_args, **call_kwargs): super(ApiCallHandler, self).__init__(api) self._call = call self._call_args = call_args self._call_kwargs = call_kwargs self._call_result = None @property def call_result(self): return self._call_result def handle_connect(self): self._call_result = getattr(self.api, self._call)(*self._call_args, **self._call_kwargs) self.api.disconnect() class DeviceHiveApi(object): """Device hive api class.""" def __init__(self, transport_url, **options): self._transport_url = transport_url self._options = options def _call(self, call, *call_args, **call_kwargs): device_hive = DeviceHive(ApiCallHandler, call, *call_args, **call_kwargs) device_hive.connect(self._transport_url, **self._options) return device_hive.transport.handler.handler.call_result def get_info(self): return self._call('get_info') def get_cluster_info(self): return self._call('get_cluster_info') <commit_msg>Add get_property, set_property and delete_property functions<commit_after>
from devicehive.handler import Handler from devicehive.device_hive import DeviceHive class ApiCallHandler(Handler): """Api call handler class.""" def __init__(self, api, call, *call_args, **call_kwargs): super(ApiCallHandler, self).__init__(api) self._call = call self._call_args = call_args self._call_kwargs = call_kwargs self._call_result = None @property def call_result(self): return self._call_result def handle_connect(self): self._call_result = getattr(self.api, self._call)(*self._call_args, **self._call_kwargs) self.api.disconnect() class DeviceHiveApi(object): """Device hive api class.""" def __init__(self, transport_url, **options): self._transport_url = transport_url self._options = options def _call(self, call, *call_args, **call_kwargs): device_hive = DeviceHive(ApiCallHandler, call, *call_args, **call_kwargs) device_hive.connect(self._transport_url, **self._options) return device_hive.transport.handler.handler.call_result def get_info(self): return self._call('get_info') def get_cluster_info(self): return self._call('get_cluster_info') def get_property(self, name): return self._call('get_property', name) def set_property(self, name, value): return self._call('set_property', name, value) def delete_property(self, name): return self._call('delete_property', name)
from devicehive.handler import Handler from devicehive.device_hive import DeviceHive class ApiCallHandler(Handler): """Api call handler class.""" def __init__(self, api, call, *call_args, **call_kwargs): super(ApiCallHandler, self).__init__(api) self._call = call self._call_args = call_args self._call_kwargs = call_kwargs self._call_result = None @property def call_result(self): return self._call_result def handle_connect(self): self._call_result = getattr(self.api, self._call)(*self._call_args, **self._call_kwargs) self.api.disconnect() class DeviceHiveApi(object): """Device hive api class.""" def __init__(self, transport_url, **options): self._transport_url = transport_url self._options = options def _call(self, call, *call_args, **call_kwargs): device_hive = DeviceHive(ApiCallHandler, call, *call_args, **call_kwargs) device_hive.connect(self._transport_url, **self._options) return device_hive.transport.handler.handler.call_result def get_info(self): return self._call('get_info') def get_cluster_info(self): return self._call('get_cluster_info') Add get_property, set_property and delete_property functionsfrom devicehive.handler import Handler from devicehive.device_hive import DeviceHive class ApiCallHandler(Handler): """Api call handler class.""" def __init__(self, api, call, *call_args, **call_kwargs): super(ApiCallHandler, self).__init__(api) self._call = call self._call_args = call_args self._call_kwargs = call_kwargs self._call_result = None @property def call_result(self): return self._call_result def handle_connect(self): self._call_result = getattr(self.api, self._call)(*self._call_args, **self._call_kwargs) self.api.disconnect() class DeviceHiveApi(object): """Device hive api class.""" def __init__(self, transport_url, **options): self._transport_url = transport_url self._options = options def _call(self, call, *call_args, **call_kwargs): device_hive = DeviceHive(ApiCallHandler, call, *call_args, **call_kwargs) device_hive.connect(self._transport_url, **self._options) return device_hive.transport.handler.handler.call_result def get_info(self): return self._call('get_info') def get_cluster_info(self): return self._call('get_cluster_info') def get_property(self, name): return self._call('get_property', name) def set_property(self, name, value): return self._call('set_property', name, value) def delete_property(self, name): return self._call('delete_property', name)
<commit_before>from devicehive.handler import Handler from devicehive.device_hive import DeviceHive class ApiCallHandler(Handler): """Api call handler class.""" def __init__(self, api, call, *call_args, **call_kwargs): super(ApiCallHandler, self).__init__(api) self._call = call self._call_args = call_args self._call_kwargs = call_kwargs self._call_result = None @property def call_result(self): return self._call_result def handle_connect(self): self._call_result = getattr(self.api, self._call)(*self._call_args, **self._call_kwargs) self.api.disconnect() class DeviceHiveApi(object): """Device hive api class.""" def __init__(self, transport_url, **options): self._transport_url = transport_url self._options = options def _call(self, call, *call_args, **call_kwargs): device_hive = DeviceHive(ApiCallHandler, call, *call_args, **call_kwargs) device_hive.connect(self._transport_url, **self._options) return device_hive.transport.handler.handler.call_result def get_info(self): return self._call('get_info') def get_cluster_info(self): return self._call('get_cluster_info') <commit_msg>Add get_property, set_property and delete_property functions<commit_after>from devicehive.handler import Handler from devicehive.device_hive import DeviceHive class ApiCallHandler(Handler): """Api call handler class.""" def __init__(self, api, call, *call_args, **call_kwargs): super(ApiCallHandler, self).__init__(api) self._call = call self._call_args = call_args self._call_kwargs = call_kwargs self._call_result = None @property def call_result(self): return self._call_result def handle_connect(self): self._call_result = getattr(self.api, self._call)(*self._call_args, **self._call_kwargs) self.api.disconnect() class DeviceHiveApi(object): """Device hive api class.""" def __init__(self, transport_url, **options): self._transport_url = transport_url self._options = options def _call(self, call, *call_args, **call_kwargs): device_hive = DeviceHive(ApiCallHandler, call, *call_args, **call_kwargs) device_hive.connect(self._transport_url, **self._options) return device_hive.transport.handler.handler.call_result def get_info(self): return self._call('get_info') def get_cluster_info(self): return self._call('get_cluster_info') def get_property(self, name): return self._call('get_property', name) def set_property(self, name, value): return self._call('set_property', name, value) def delete_property(self, name): return self._call('delete_property', name)
e435832edccd3444a90763386d8c81ab9f595cf7
tests/test_cli_search.py
tests/test_cli_search.py
# -*- coding: utf-8 -*- import pathlib import json import pytest @pytest.fixture def templates_file(): return 'tests/templates.json' def scenarios(): yield ['django', 'docker'], ['cookiecutter-django'] yield ['pytest'], [ 'cookiecutter-pylibrary', 'cookiecutter-pypackage', 'cookiecutter-pytest-plugin', ] yield ['api'], ['cookiecutter-tapioca'] @pytest.mark.parametrize('tags, templates', scenarios()) def test_search_templates(cli_runner, tmp_rc, templates_file, tags, templates): result = cli_runner([ '-c', tmp_rc, 'search', '--load-file', templates_file, *tags ]) assert result.exit_code == 0 for template in templates: assert template in result.output
# -*- coding: utf-8 -*- import pathlib import json import pytest @pytest.fixture def templates_file(): return 'tests/templates.json' def scenarios(): yield ['django', 'docker'], ['cookiecutter-django'] yield ['pytest'], [ 'cookiecutter-pylibrary', 'cookiecutter-pypackage', 'cookiecutter-pytest-plugin', ] yield ['api'], ['cookiecutter-tapioca'] @pytest.mark.parametrize('tags, templates', scenarios()) def test_search_templates(cli_runner, tmp_rc, templates_file, tags, templates): result = cli_runner([ '-c', tmp_rc, 'search', '--load-file', templates_file, *tags ]) assert result.exit_code == 0 for template in templates: assert template in result.output def test_search_cant_find_match(cli_runner, tmp_rc, templates_file): result = cli_runner([ '-c', tmp_rc, 'search', '--load-file', templates_file, 'NopeNopeNope' ]) assert result.exit_code == 0 assert 'No match for "NopeNopeNope"' in result.output
Implement a search test for when there is no matching template
Implement a search test for when there is no matching template
Python
bsd-3-clause
hackebrot/cibopath
# -*- coding: utf-8 -*- import pathlib import json import pytest @pytest.fixture def templates_file(): return 'tests/templates.json' def scenarios(): yield ['django', 'docker'], ['cookiecutter-django'] yield ['pytest'], [ 'cookiecutter-pylibrary', 'cookiecutter-pypackage', 'cookiecutter-pytest-plugin', ] yield ['api'], ['cookiecutter-tapioca'] @pytest.mark.parametrize('tags, templates', scenarios()) def test_search_templates(cli_runner, tmp_rc, templates_file, tags, templates): result = cli_runner([ '-c', tmp_rc, 'search', '--load-file', templates_file, *tags ]) assert result.exit_code == 0 for template in templates: assert template in result.output Implement a search test for when there is no matching template
# -*- coding: utf-8 -*- import pathlib import json import pytest @pytest.fixture def templates_file(): return 'tests/templates.json' def scenarios(): yield ['django', 'docker'], ['cookiecutter-django'] yield ['pytest'], [ 'cookiecutter-pylibrary', 'cookiecutter-pypackage', 'cookiecutter-pytest-plugin', ] yield ['api'], ['cookiecutter-tapioca'] @pytest.mark.parametrize('tags, templates', scenarios()) def test_search_templates(cli_runner, tmp_rc, templates_file, tags, templates): result = cli_runner([ '-c', tmp_rc, 'search', '--load-file', templates_file, *tags ]) assert result.exit_code == 0 for template in templates: assert template in result.output def test_search_cant_find_match(cli_runner, tmp_rc, templates_file): result = cli_runner([ '-c', tmp_rc, 'search', '--load-file', templates_file, 'NopeNopeNope' ]) assert result.exit_code == 0 assert 'No match for "NopeNopeNope"' in result.output
<commit_before># -*- coding: utf-8 -*- import pathlib import json import pytest @pytest.fixture def templates_file(): return 'tests/templates.json' def scenarios(): yield ['django', 'docker'], ['cookiecutter-django'] yield ['pytest'], [ 'cookiecutter-pylibrary', 'cookiecutter-pypackage', 'cookiecutter-pytest-plugin', ] yield ['api'], ['cookiecutter-tapioca'] @pytest.mark.parametrize('tags, templates', scenarios()) def test_search_templates(cli_runner, tmp_rc, templates_file, tags, templates): result = cli_runner([ '-c', tmp_rc, 'search', '--load-file', templates_file, *tags ]) assert result.exit_code == 0 for template in templates: assert template in result.output <commit_msg>Implement a search test for when there is no matching template<commit_after>
# -*- coding: utf-8 -*- import pathlib import json import pytest @pytest.fixture def templates_file(): return 'tests/templates.json' def scenarios(): yield ['django', 'docker'], ['cookiecutter-django'] yield ['pytest'], [ 'cookiecutter-pylibrary', 'cookiecutter-pypackage', 'cookiecutter-pytest-plugin', ] yield ['api'], ['cookiecutter-tapioca'] @pytest.mark.parametrize('tags, templates', scenarios()) def test_search_templates(cli_runner, tmp_rc, templates_file, tags, templates): result = cli_runner([ '-c', tmp_rc, 'search', '--load-file', templates_file, *tags ]) assert result.exit_code == 0 for template in templates: assert template in result.output def test_search_cant_find_match(cli_runner, tmp_rc, templates_file): result = cli_runner([ '-c', tmp_rc, 'search', '--load-file', templates_file, 'NopeNopeNope' ]) assert result.exit_code == 0 assert 'No match for "NopeNopeNope"' in result.output
# -*- coding: utf-8 -*- import pathlib import json import pytest @pytest.fixture def templates_file(): return 'tests/templates.json' def scenarios(): yield ['django', 'docker'], ['cookiecutter-django'] yield ['pytest'], [ 'cookiecutter-pylibrary', 'cookiecutter-pypackage', 'cookiecutter-pytest-plugin', ] yield ['api'], ['cookiecutter-tapioca'] @pytest.mark.parametrize('tags, templates', scenarios()) def test_search_templates(cli_runner, tmp_rc, templates_file, tags, templates): result = cli_runner([ '-c', tmp_rc, 'search', '--load-file', templates_file, *tags ]) assert result.exit_code == 0 for template in templates: assert template in result.output Implement a search test for when there is no matching template# -*- coding: utf-8 -*- import pathlib import json import pytest @pytest.fixture def templates_file(): return 'tests/templates.json' def scenarios(): yield ['django', 'docker'], ['cookiecutter-django'] yield ['pytest'], [ 'cookiecutter-pylibrary', 'cookiecutter-pypackage', 'cookiecutter-pytest-plugin', ] yield ['api'], ['cookiecutter-tapioca'] @pytest.mark.parametrize('tags, templates', scenarios()) def test_search_templates(cli_runner, tmp_rc, templates_file, tags, templates): result = cli_runner([ '-c', tmp_rc, 'search', '--load-file', templates_file, *tags ]) assert result.exit_code == 0 for template in templates: assert template in result.output def test_search_cant_find_match(cli_runner, tmp_rc, templates_file): result = cli_runner([ '-c', tmp_rc, 'search', '--load-file', templates_file, 'NopeNopeNope' ]) assert result.exit_code == 0 assert 'No match for "NopeNopeNope"' in result.output
<commit_before># -*- coding: utf-8 -*- import pathlib import json import pytest @pytest.fixture def templates_file(): return 'tests/templates.json' def scenarios(): yield ['django', 'docker'], ['cookiecutter-django'] yield ['pytest'], [ 'cookiecutter-pylibrary', 'cookiecutter-pypackage', 'cookiecutter-pytest-plugin', ] yield ['api'], ['cookiecutter-tapioca'] @pytest.mark.parametrize('tags, templates', scenarios()) def test_search_templates(cli_runner, tmp_rc, templates_file, tags, templates): result = cli_runner([ '-c', tmp_rc, 'search', '--load-file', templates_file, *tags ]) assert result.exit_code == 0 for template in templates: assert template in result.output <commit_msg>Implement a search test for when there is no matching template<commit_after># -*- coding: utf-8 -*- import pathlib import json import pytest @pytest.fixture def templates_file(): return 'tests/templates.json' def scenarios(): yield ['django', 'docker'], ['cookiecutter-django'] yield ['pytest'], [ 'cookiecutter-pylibrary', 'cookiecutter-pypackage', 'cookiecutter-pytest-plugin', ] yield ['api'], ['cookiecutter-tapioca'] @pytest.mark.parametrize('tags, templates', scenarios()) def test_search_templates(cli_runner, tmp_rc, templates_file, tags, templates): result = cli_runner([ '-c', tmp_rc, 'search', '--load-file', templates_file, *tags ]) assert result.exit_code == 0 for template in templates: assert template in result.output def test_search_cant_find_match(cli_runner, tmp_rc, templates_file): result = cli_runner([ '-c', tmp_rc, 'search', '--load-file', templates_file, 'NopeNopeNope' ]) assert result.exit_code == 0 assert 'No match for "NopeNopeNope"' in result.output
e3145b956b8e77bc214c699749460bba2d394fef
tests/viewport-widget.py
tests/viewport-widget.py
#!/usr/bin/env python3 import pyglet import glooey window = pyglet.window.Window() batch = pyglet.graphics.Batch() cursor = pyglet.image.load('cursor-image.png') hotspot = 4, 24 root = glooey.PanningGui(window, cursor, hotspot, batch=batch) viewport = glooey.Viewport() content = glooey.Grid(5, 5, padding=50) menu = glooey.PlaceHolder(height=200, color=glooey.drawing.purple) vbox = glooey.VBox() for row, col in content.yield_cells(): if row == col: style = dict(color=glooey.drawing.yellow) WidgetClass = glooey.EventLogger else: style = dict(color=glooey.drawing.green) WidgetClass = glooey.PlaceHolder content[row, col] = WidgetClass(width=300, height=300, **style) viewport.add(content) vbox.add(viewport, expand=True) vbox.add(menu) root.add(vbox) center_of_view = content[2, 2].rect.center viewport.set_center_of_view(center_of_view) pyglet.app.run()
#!/usr/bin/env python3 import pyglet import glooey window = pyglet.window.Window() batch = pyglet.graphics.Batch() cursor = pyglet.image.load('cursor-image.png') hotspot = 4, 24 root = glooey.PanningGui(window, cursor, hotspot, batch=batch) viewport = glooey.Viewport() content = glooey.Grid(5, 5, padding=50) menu = glooey.PlaceHolder(height=200, color=glooey.drawing.purple) vbox = glooey.VBox() for row, col in content.yield_cells(): if row == col: style = dict(color=glooey.drawing.yellow) WidgetClass = glooey.EventLogger else: style = dict(color=glooey.drawing.green) WidgetClass = glooey.PlaceHolder content[row, col] = WidgetClass(width=300, height=200, **style) viewport.add(content) vbox.add(viewport, expand=True) vbox.add(menu) root.add(vbox) center_of_view = content[2, 2].rect.center viewport.set_center_of_view(center_of_view) pyglet.app.run()
Test a non-square Viewport child.
Test a non-square Viewport child.
Python
mit
kxgames/glooey,kxgames/glooey
#!/usr/bin/env python3 import pyglet import glooey window = pyglet.window.Window() batch = pyglet.graphics.Batch() cursor = pyglet.image.load('cursor-image.png') hotspot = 4, 24 root = glooey.PanningGui(window, cursor, hotspot, batch=batch) viewport = glooey.Viewport() content = glooey.Grid(5, 5, padding=50) menu = glooey.PlaceHolder(height=200, color=glooey.drawing.purple) vbox = glooey.VBox() for row, col in content.yield_cells(): if row == col: style = dict(color=glooey.drawing.yellow) WidgetClass = glooey.EventLogger else: style = dict(color=glooey.drawing.green) WidgetClass = glooey.PlaceHolder content[row, col] = WidgetClass(width=300, height=300, **style) viewport.add(content) vbox.add(viewport, expand=True) vbox.add(menu) root.add(vbox) center_of_view = content[2, 2].rect.center viewport.set_center_of_view(center_of_view) pyglet.app.run() Test a non-square Viewport child.
#!/usr/bin/env python3 import pyglet import glooey window = pyglet.window.Window() batch = pyglet.graphics.Batch() cursor = pyglet.image.load('cursor-image.png') hotspot = 4, 24 root = glooey.PanningGui(window, cursor, hotspot, batch=batch) viewport = glooey.Viewport() content = glooey.Grid(5, 5, padding=50) menu = glooey.PlaceHolder(height=200, color=glooey.drawing.purple) vbox = glooey.VBox() for row, col in content.yield_cells(): if row == col: style = dict(color=glooey.drawing.yellow) WidgetClass = glooey.EventLogger else: style = dict(color=glooey.drawing.green) WidgetClass = glooey.PlaceHolder content[row, col] = WidgetClass(width=300, height=200, **style) viewport.add(content) vbox.add(viewport, expand=True) vbox.add(menu) root.add(vbox) center_of_view = content[2, 2].rect.center viewport.set_center_of_view(center_of_view) pyglet.app.run()
<commit_before>#!/usr/bin/env python3 import pyglet import glooey window = pyglet.window.Window() batch = pyglet.graphics.Batch() cursor = pyglet.image.load('cursor-image.png') hotspot = 4, 24 root = glooey.PanningGui(window, cursor, hotspot, batch=batch) viewport = glooey.Viewport() content = glooey.Grid(5, 5, padding=50) menu = glooey.PlaceHolder(height=200, color=glooey.drawing.purple) vbox = glooey.VBox() for row, col in content.yield_cells(): if row == col: style = dict(color=glooey.drawing.yellow) WidgetClass = glooey.EventLogger else: style = dict(color=glooey.drawing.green) WidgetClass = glooey.PlaceHolder content[row, col] = WidgetClass(width=300, height=300, **style) viewport.add(content) vbox.add(viewport, expand=True) vbox.add(menu) root.add(vbox) center_of_view = content[2, 2].rect.center viewport.set_center_of_view(center_of_view) pyglet.app.run() <commit_msg>Test a non-square Viewport child.<commit_after>
#!/usr/bin/env python3 import pyglet import glooey window = pyglet.window.Window() batch = pyglet.graphics.Batch() cursor = pyglet.image.load('cursor-image.png') hotspot = 4, 24 root = glooey.PanningGui(window, cursor, hotspot, batch=batch) viewport = glooey.Viewport() content = glooey.Grid(5, 5, padding=50) menu = glooey.PlaceHolder(height=200, color=glooey.drawing.purple) vbox = glooey.VBox() for row, col in content.yield_cells(): if row == col: style = dict(color=glooey.drawing.yellow) WidgetClass = glooey.EventLogger else: style = dict(color=glooey.drawing.green) WidgetClass = glooey.PlaceHolder content[row, col] = WidgetClass(width=300, height=200, **style) viewport.add(content) vbox.add(viewport, expand=True) vbox.add(menu) root.add(vbox) center_of_view = content[2, 2].rect.center viewport.set_center_of_view(center_of_view) pyglet.app.run()
#!/usr/bin/env python3 import pyglet import glooey window = pyglet.window.Window() batch = pyglet.graphics.Batch() cursor = pyglet.image.load('cursor-image.png') hotspot = 4, 24 root = glooey.PanningGui(window, cursor, hotspot, batch=batch) viewport = glooey.Viewport() content = glooey.Grid(5, 5, padding=50) menu = glooey.PlaceHolder(height=200, color=glooey.drawing.purple) vbox = glooey.VBox() for row, col in content.yield_cells(): if row == col: style = dict(color=glooey.drawing.yellow) WidgetClass = glooey.EventLogger else: style = dict(color=glooey.drawing.green) WidgetClass = glooey.PlaceHolder content[row, col] = WidgetClass(width=300, height=300, **style) viewport.add(content) vbox.add(viewport, expand=True) vbox.add(menu) root.add(vbox) center_of_view = content[2, 2].rect.center viewport.set_center_of_view(center_of_view) pyglet.app.run() Test a non-square Viewport child.#!/usr/bin/env python3 import pyglet import glooey window = pyglet.window.Window() batch = pyglet.graphics.Batch() cursor = pyglet.image.load('cursor-image.png') hotspot = 4, 24 root = glooey.PanningGui(window, cursor, hotspot, batch=batch) viewport = glooey.Viewport() content = glooey.Grid(5, 5, padding=50) menu = glooey.PlaceHolder(height=200, color=glooey.drawing.purple) vbox = glooey.VBox() for row, col in content.yield_cells(): if row == col: style = dict(color=glooey.drawing.yellow) WidgetClass = glooey.EventLogger else: style = dict(color=glooey.drawing.green) WidgetClass = glooey.PlaceHolder content[row, col] = WidgetClass(width=300, height=200, **style) viewport.add(content) vbox.add(viewport, expand=True) vbox.add(menu) root.add(vbox) center_of_view = content[2, 2].rect.center viewport.set_center_of_view(center_of_view) pyglet.app.run()
<commit_before>#!/usr/bin/env python3 import pyglet import glooey window = pyglet.window.Window() batch = pyglet.graphics.Batch() cursor = pyglet.image.load('cursor-image.png') hotspot = 4, 24 root = glooey.PanningGui(window, cursor, hotspot, batch=batch) viewport = glooey.Viewport() content = glooey.Grid(5, 5, padding=50) menu = glooey.PlaceHolder(height=200, color=glooey.drawing.purple) vbox = glooey.VBox() for row, col in content.yield_cells(): if row == col: style = dict(color=glooey.drawing.yellow) WidgetClass = glooey.EventLogger else: style = dict(color=glooey.drawing.green) WidgetClass = glooey.PlaceHolder content[row, col] = WidgetClass(width=300, height=300, **style) viewport.add(content) vbox.add(viewport, expand=True) vbox.add(menu) root.add(vbox) center_of_view = content[2, 2].rect.center viewport.set_center_of_view(center_of_view) pyglet.app.run() <commit_msg>Test a non-square Viewport child.<commit_after>#!/usr/bin/env python3 import pyglet import glooey window = pyglet.window.Window() batch = pyglet.graphics.Batch() cursor = pyglet.image.load('cursor-image.png') hotspot = 4, 24 root = glooey.PanningGui(window, cursor, hotspot, batch=batch) viewport = glooey.Viewport() content = glooey.Grid(5, 5, padding=50) menu = glooey.PlaceHolder(height=200, color=glooey.drawing.purple) vbox = glooey.VBox() for row, col in content.yield_cells(): if row == col: style = dict(color=glooey.drawing.yellow) WidgetClass = glooey.EventLogger else: style = dict(color=glooey.drawing.green) WidgetClass = glooey.PlaceHolder content[row, col] = WidgetClass(width=300, height=200, **style) viewport.add(content) vbox.add(viewport, expand=True) vbox.add(menu) root.add(vbox) center_of_view = content[2, 2].rect.center viewport.set_center_of_view(center_of_view) pyglet.app.run()
c6cd8ae243c07fa80d54207c334883585eca0d97
var/spack/packages/libffi/package.py
var/spack/packages/libffi/package.py
from spack import * class Libffi(Package): """The libffi library provides a portable, high level programming interface to various calling conventions. This allows a programmer to call any function specified by a call interface description at run time.""" homepage = "https://sourceware.org/libffi/" url = "ftp://sourceware.org/pub/libffi/libffi-3.1.tar.gz" version('3.1', 'f5898b29bbfd70502831a212d9249d10') def install(self, spec, prefix): configure("--prefix=%s" % prefix) make() make("install")
from spack import * class Libffi(Package): """The libffi library provides a portable, high level programming interface to various calling conventions. This allows a programmer to call any function specified by a call interface description at run time.""" homepage = "https://sourceware.org/libffi/" version('3.2.1','83b89587607e3eb65c70d361f13bab43',url = "ftp://sourceware.org/pub/libffi/libffi-3.2.1.tar.gz") #version('3.1', 'f5898b29bbfd70502831a212d9249d10',url = "ftp://sourceware.org/pub/libffi/libffi-3.1.tar.gz") # Has a bug $(lib64) instead of ${lib64} in libffi.pc def install(self, spec, prefix): configure("--prefix=%s" % prefix) make() make("install")
Use more recent version of libffi. 3.1 has a known bug that is fixed in current version
Use more recent version of libffi. 3.1 has a known bug that is fixed in current version
Python
lgpl-2.1
krafczyk/spack,LLNL/spack,matthiasdiener/spack,mfherbst/spack,iulian787/spack,iulian787/spack,tmerrick1/spack,lgarren/spack,EmreAtes/spack,tmerrick1/spack,LLNL/spack,iulian787/spack,krafczyk/spack,TheTimmy/spack,TheTimmy/spack,LLNL/spack,EmreAtes/spack,mfherbst/spack,tmerrick1/spack,iulian787/spack,matthiasdiener/spack,skosukhin/spack,tmerrick1/spack,LLNL/spack,lgarren/spack,LLNL/spack,TheTimmy/spack,matthiasdiener/spack,EmreAtes/spack,EmreAtes/spack,matthiasdiener/spack,mfherbst/spack,EmreAtes/spack,TheTimmy/spack,lgarren/spack,lgarren/spack,krafczyk/spack,mfherbst/spack,krafczyk/spack,skosukhin/spack,iulian787/spack,skosukhin/spack,TheTimmy/spack,mfherbst/spack,tmerrick1/spack,skosukhin/spack,lgarren/spack,krafczyk/spack,skosukhin/spack,matthiasdiener/spack
from spack import * class Libffi(Package): """The libffi library provides a portable, high level programming interface to various calling conventions. This allows a programmer to call any function specified by a call interface description at run time.""" homepage = "https://sourceware.org/libffi/" url = "ftp://sourceware.org/pub/libffi/libffi-3.1.tar.gz" version('3.1', 'f5898b29bbfd70502831a212d9249d10') def install(self, spec, prefix): configure("--prefix=%s" % prefix) make() make("install") Use more recent version of libffi. 3.1 has a known bug that is fixed in current version
from spack import * class Libffi(Package): """The libffi library provides a portable, high level programming interface to various calling conventions. This allows a programmer to call any function specified by a call interface description at run time.""" homepage = "https://sourceware.org/libffi/" version('3.2.1','83b89587607e3eb65c70d361f13bab43',url = "ftp://sourceware.org/pub/libffi/libffi-3.2.1.tar.gz") #version('3.1', 'f5898b29bbfd70502831a212d9249d10',url = "ftp://sourceware.org/pub/libffi/libffi-3.1.tar.gz") # Has a bug $(lib64) instead of ${lib64} in libffi.pc def install(self, spec, prefix): configure("--prefix=%s" % prefix) make() make("install")
<commit_before>from spack import * class Libffi(Package): """The libffi library provides a portable, high level programming interface to various calling conventions. This allows a programmer to call any function specified by a call interface description at run time.""" homepage = "https://sourceware.org/libffi/" url = "ftp://sourceware.org/pub/libffi/libffi-3.1.tar.gz" version('3.1', 'f5898b29bbfd70502831a212d9249d10') def install(self, spec, prefix): configure("--prefix=%s" % prefix) make() make("install") <commit_msg>Use more recent version of libffi. 3.1 has a known bug that is fixed in current version<commit_after>
from spack import * class Libffi(Package): """The libffi library provides a portable, high level programming interface to various calling conventions. This allows a programmer to call any function specified by a call interface description at run time.""" homepage = "https://sourceware.org/libffi/" version('3.2.1','83b89587607e3eb65c70d361f13bab43',url = "ftp://sourceware.org/pub/libffi/libffi-3.2.1.tar.gz") #version('3.1', 'f5898b29bbfd70502831a212d9249d10',url = "ftp://sourceware.org/pub/libffi/libffi-3.1.tar.gz") # Has a bug $(lib64) instead of ${lib64} in libffi.pc def install(self, spec, prefix): configure("--prefix=%s" % prefix) make() make("install")
from spack import * class Libffi(Package): """The libffi library provides a portable, high level programming interface to various calling conventions. This allows a programmer to call any function specified by a call interface description at run time.""" homepage = "https://sourceware.org/libffi/" url = "ftp://sourceware.org/pub/libffi/libffi-3.1.tar.gz" version('3.1', 'f5898b29bbfd70502831a212d9249d10') def install(self, spec, prefix): configure("--prefix=%s" % prefix) make() make("install") Use more recent version of libffi. 3.1 has a known bug that is fixed in current versionfrom spack import * class Libffi(Package): """The libffi library provides a portable, high level programming interface to various calling conventions. This allows a programmer to call any function specified by a call interface description at run time.""" homepage = "https://sourceware.org/libffi/" version('3.2.1','83b89587607e3eb65c70d361f13bab43',url = "ftp://sourceware.org/pub/libffi/libffi-3.2.1.tar.gz") #version('3.1', 'f5898b29bbfd70502831a212d9249d10',url = "ftp://sourceware.org/pub/libffi/libffi-3.1.tar.gz") # Has a bug $(lib64) instead of ${lib64} in libffi.pc def install(self, spec, prefix): configure("--prefix=%s" % prefix) make() make("install")
<commit_before>from spack import * class Libffi(Package): """The libffi library provides a portable, high level programming interface to various calling conventions. This allows a programmer to call any function specified by a call interface description at run time.""" homepage = "https://sourceware.org/libffi/" url = "ftp://sourceware.org/pub/libffi/libffi-3.1.tar.gz" version('3.1', 'f5898b29bbfd70502831a212d9249d10') def install(self, spec, prefix): configure("--prefix=%s" % prefix) make() make("install") <commit_msg>Use more recent version of libffi. 3.1 has a known bug that is fixed in current version<commit_after>from spack import * class Libffi(Package): """The libffi library provides a portable, high level programming interface to various calling conventions. This allows a programmer to call any function specified by a call interface description at run time.""" homepage = "https://sourceware.org/libffi/" version('3.2.1','83b89587607e3eb65c70d361f13bab43',url = "ftp://sourceware.org/pub/libffi/libffi-3.2.1.tar.gz") #version('3.1', 'f5898b29bbfd70502831a212d9249d10',url = "ftp://sourceware.org/pub/libffi/libffi-3.1.tar.gz") # Has a bug $(lib64) instead of ${lib64} in libffi.pc def install(self, spec, prefix): configure("--prefix=%s" % prefix) make() make("install")
debcec2e64e85aafec3a11860042401e9d9955a7
metafunctions/tests/test_star.py
metafunctions/tests/test_star.py
from metafunctions.util import node, star from metafunctions.tests.util import BaseTestCase class TestUnit(BaseTestCase): def test_simple_star(self): @node def f(*args): return args cmp = (a | b) | star(f) self.assertEqual(cmp('_'), ('_', 'a', 'b')) def test_str_repr(self): @node def f(*args): return args @star @node def g(*x): return x @node @star def h(*x): return x cmp = (a | b) | star(f) star_a = star(a) self.assertEqual(str(cmp), '(a | b | star(f))') self.assertEqual(str(star_a), 'star(a)') self.assertEqual(str(g), 'star(g)') self.assertEqual(str(h), 'h') @node def a(x): return x + 'a' @node def b(x): return x + 'b'
from metafunctions.util import node, star from metafunctions.tests.util import BaseTestCase class TestUnit(BaseTestCase): def test_simple_star(self): @node def f(*args): return args cmp = (a | b) | star(f) self.assertEqual(cmp('_'), ('_', 'a', 'b')) def test_str_repr(self): @node def f(*args): return args @star @node def g(*x): return x @node @star def h(*x): return x cmp = (a | b) | star(f) star_a = star(a) merge_star = star(a+b) chain_star = star(a|b) self.assertEqual(str(cmp), '(a | b | star(f))') self.assertEqual(str(star_a), 'star(a)') self.assertEqual(str(g), 'star(g)') self.assertEqual(str(h), 'h') self.assertEqual(str(merge_star), 'star(a + b)') self.assertEqual(str(h), 'star(a | b)') @node def a(x): return x + 'a' @node def b(x): return x + 'b'
Add more expected star str
Add more expected star str
Python
mit
ForeverWintr/metafunctions
from metafunctions.util import node, star from metafunctions.tests.util import BaseTestCase class TestUnit(BaseTestCase): def test_simple_star(self): @node def f(*args): return args cmp = (a | b) | star(f) self.assertEqual(cmp('_'), ('_', 'a', 'b')) def test_str_repr(self): @node def f(*args): return args @star @node def g(*x): return x @node @star def h(*x): return x cmp = (a | b) | star(f) star_a = star(a) self.assertEqual(str(cmp), '(a | b | star(f))') self.assertEqual(str(star_a), 'star(a)') self.assertEqual(str(g), 'star(g)') self.assertEqual(str(h), 'h') @node def a(x): return x + 'a' @node def b(x): return x + 'b' Add more expected star str
from metafunctions.util import node, star from metafunctions.tests.util import BaseTestCase class TestUnit(BaseTestCase): def test_simple_star(self): @node def f(*args): return args cmp = (a | b) | star(f) self.assertEqual(cmp('_'), ('_', 'a', 'b')) def test_str_repr(self): @node def f(*args): return args @star @node def g(*x): return x @node @star def h(*x): return x cmp = (a | b) | star(f) star_a = star(a) merge_star = star(a+b) chain_star = star(a|b) self.assertEqual(str(cmp), '(a | b | star(f))') self.assertEqual(str(star_a), 'star(a)') self.assertEqual(str(g), 'star(g)') self.assertEqual(str(h), 'h') self.assertEqual(str(merge_star), 'star(a + b)') self.assertEqual(str(h), 'star(a | b)') @node def a(x): return x + 'a' @node def b(x): return x + 'b'
<commit_before>from metafunctions.util import node, star from metafunctions.tests.util import BaseTestCase class TestUnit(BaseTestCase): def test_simple_star(self): @node def f(*args): return args cmp = (a | b) | star(f) self.assertEqual(cmp('_'), ('_', 'a', 'b')) def test_str_repr(self): @node def f(*args): return args @star @node def g(*x): return x @node @star def h(*x): return x cmp = (a | b) | star(f) star_a = star(a) self.assertEqual(str(cmp), '(a | b | star(f))') self.assertEqual(str(star_a), 'star(a)') self.assertEqual(str(g), 'star(g)') self.assertEqual(str(h), 'h') @node def a(x): return x + 'a' @node def b(x): return x + 'b' <commit_msg>Add more expected star str<commit_after>
from metafunctions.util import node, star from metafunctions.tests.util import BaseTestCase class TestUnit(BaseTestCase): def test_simple_star(self): @node def f(*args): return args cmp = (a | b) | star(f) self.assertEqual(cmp('_'), ('_', 'a', 'b')) def test_str_repr(self): @node def f(*args): return args @star @node def g(*x): return x @node @star def h(*x): return x cmp = (a | b) | star(f) star_a = star(a) merge_star = star(a+b) chain_star = star(a|b) self.assertEqual(str(cmp), '(a | b | star(f))') self.assertEqual(str(star_a), 'star(a)') self.assertEqual(str(g), 'star(g)') self.assertEqual(str(h), 'h') self.assertEqual(str(merge_star), 'star(a + b)') self.assertEqual(str(h), 'star(a | b)') @node def a(x): return x + 'a' @node def b(x): return x + 'b'
from metafunctions.util import node, star from metafunctions.tests.util import BaseTestCase class TestUnit(BaseTestCase): def test_simple_star(self): @node def f(*args): return args cmp = (a | b) | star(f) self.assertEqual(cmp('_'), ('_', 'a', 'b')) def test_str_repr(self): @node def f(*args): return args @star @node def g(*x): return x @node @star def h(*x): return x cmp = (a | b) | star(f) star_a = star(a) self.assertEqual(str(cmp), '(a | b | star(f))') self.assertEqual(str(star_a), 'star(a)') self.assertEqual(str(g), 'star(g)') self.assertEqual(str(h), 'h') @node def a(x): return x + 'a' @node def b(x): return x + 'b' Add more expected star strfrom metafunctions.util import node, star from metafunctions.tests.util import BaseTestCase class TestUnit(BaseTestCase): def test_simple_star(self): @node def f(*args): return args cmp = (a | b) | star(f) self.assertEqual(cmp('_'), ('_', 'a', 'b')) def test_str_repr(self): @node def f(*args): return args @star @node def g(*x): return x @node @star def h(*x): return x cmp = (a | b) | star(f) star_a = star(a) merge_star = star(a+b) chain_star = star(a|b) self.assertEqual(str(cmp), '(a | b | star(f))') self.assertEqual(str(star_a), 'star(a)') self.assertEqual(str(g), 'star(g)') self.assertEqual(str(h), 'h') self.assertEqual(str(merge_star), 'star(a + b)') self.assertEqual(str(h), 'star(a | b)') @node def a(x): return x + 'a' @node def b(x): return x + 'b'
<commit_before>from metafunctions.util import node, star from metafunctions.tests.util import BaseTestCase class TestUnit(BaseTestCase): def test_simple_star(self): @node def f(*args): return args cmp = (a | b) | star(f) self.assertEqual(cmp('_'), ('_', 'a', 'b')) def test_str_repr(self): @node def f(*args): return args @star @node def g(*x): return x @node @star def h(*x): return x cmp = (a | b) | star(f) star_a = star(a) self.assertEqual(str(cmp), '(a | b | star(f))') self.assertEqual(str(star_a), 'star(a)') self.assertEqual(str(g), 'star(g)') self.assertEqual(str(h), 'h') @node def a(x): return x + 'a' @node def b(x): return x + 'b' <commit_msg>Add more expected star str<commit_after>from metafunctions.util import node, star from metafunctions.tests.util import BaseTestCase class TestUnit(BaseTestCase): def test_simple_star(self): @node def f(*args): return args cmp = (a | b) | star(f) self.assertEqual(cmp('_'), ('_', 'a', 'b')) def test_str_repr(self): @node def f(*args): return args @star @node def g(*x): return x @node @star def h(*x): return x cmp = (a | b) | star(f) star_a = star(a) merge_star = star(a+b) chain_star = star(a|b) self.assertEqual(str(cmp), '(a | b | star(f))') self.assertEqual(str(star_a), 'star(a)') self.assertEqual(str(g), 'star(g)') self.assertEqual(str(h), 'h') self.assertEqual(str(merge_star), 'star(a + b)') self.assertEqual(str(h), 'star(a | b)') @node def a(x): return x + 'a' @node def b(x): return x + 'b'
1cff4ec8cdac7253be979936a1b06c5bc8264195
misc/sample_project/ser/snake.py
misc/sample_project/ser/snake.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals __all__ = ('is_snake',) def is_snake(word): if not word.isalpha(): raise ValueError("String '{}' is not a word") if word.lower() == 'python': return True if word.lower() == 'питон': return True return False def _parse_args(args=None): """Parse command line arguments""" parser = argparse.ArgumentParser(description='Check if animal is snake') parser.add_argument('word', help='an animal to check') namespace = parser.parse_args() return namespace def main(): """Entry-point for ser module""" word = _parse_args().word if is_snake(word): print('{} is a snake'.format(word)) return print('{} is not a snake'.format(word)) def plot(): """Plot a snake""" import math import matplotlib.pyplot as plt x = [i / 10 for i in range(100)] plt.plot(x, [math.sin(a) for a in x]) plt.show() plt.close()
# -*- coding: utf-8 -*- from __future__ import unicode_literals __all__ = ('is_snake',) def is_snake(word): """Checks if an animal is a snake Parameters ---------- word : str Animal name Returns ------- bool Example ------- Check if a bear is a snake >>> from ser.snake import is_snake >>> >>> if is_snake('bear'): ... print('Shhhh') ... else: ... print('Argh') Argh """ if not word.isalpha(): raise ValueError("String '{}' is not a word") if word.lower() == 'python': return True if word.lower() == 'питон': return True return False def _parse_args(args=None): """Parse command line arguments""" parser = argparse.ArgumentParser(description='Check if animal is snake') parser.add_argument('word', help='an animal to check') namespace = parser.parse_args() return namespace def main(): """Entry-point for ser module""" word = _parse_args().word if is_snake(word): print('{} is a snake'.format(word)) return print('{} is not a snake'.format(word)) def plot(): """Plot a snake""" import math import matplotlib.pyplot as plt x = [i / 10 for i in range(100)] plt.plot(x, [math.sin(a) for a in x]) plt.show() plt.close()
Add doctest to the sample project
Add doctest to the sample project
Python
mit
hombit/scientific_python,hombit/scientific_python,hombit/scientific_python,hombit/scientific_python,hombit/scientific_python
# -*- coding: utf-8 -*- from __future__ import unicode_literals __all__ = ('is_snake',) def is_snake(word): if not word.isalpha(): raise ValueError("String '{}' is not a word") if word.lower() == 'python': return True if word.lower() == 'питон': return True return False def _parse_args(args=None): """Parse command line arguments""" parser = argparse.ArgumentParser(description='Check if animal is snake') parser.add_argument('word', help='an animal to check') namespace = parser.parse_args() return namespace def main(): """Entry-point for ser module""" word = _parse_args().word if is_snake(word): print('{} is a snake'.format(word)) return print('{} is not a snake'.format(word)) def plot(): """Plot a snake""" import math import matplotlib.pyplot as plt x = [i / 10 for i in range(100)] plt.plot(x, [math.sin(a) for a in x]) plt.show() plt.close() Add doctest to the sample project
# -*- coding: utf-8 -*- from __future__ import unicode_literals __all__ = ('is_snake',) def is_snake(word): """Checks if an animal is a snake Parameters ---------- word : str Animal name Returns ------- bool Example ------- Check if a bear is a snake >>> from ser.snake import is_snake >>> >>> if is_snake('bear'): ... print('Shhhh') ... else: ... print('Argh') Argh """ if not word.isalpha(): raise ValueError("String '{}' is not a word") if word.lower() == 'python': return True if word.lower() == 'питон': return True return False def _parse_args(args=None): """Parse command line arguments""" parser = argparse.ArgumentParser(description='Check if animal is snake') parser.add_argument('word', help='an animal to check') namespace = parser.parse_args() return namespace def main(): """Entry-point for ser module""" word = _parse_args().word if is_snake(word): print('{} is a snake'.format(word)) return print('{} is not a snake'.format(word)) def plot(): """Plot a snake""" import math import matplotlib.pyplot as plt x = [i / 10 for i in range(100)] plt.plot(x, [math.sin(a) for a in x]) plt.show() plt.close()
<commit_before># -*- coding: utf-8 -*- from __future__ import unicode_literals __all__ = ('is_snake',) def is_snake(word): if not word.isalpha(): raise ValueError("String '{}' is not a word") if word.lower() == 'python': return True if word.lower() == 'питон': return True return False def _parse_args(args=None): """Parse command line arguments""" parser = argparse.ArgumentParser(description='Check if animal is snake') parser.add_argument('word', help='an animal to check') namespace = parser.parse_args() return namespace def main(): """Entry-point for ser module""" word = _parse_args().word if is_snake(word): print('{} is a snake'.format(word)) return print('{} is not a snake'.format(word)) def plot(): """Plot a snake""" import math import matplotlib.pyplot as plt x = [i / 10 for i in range(100)] plt.plot(x, [math.sin(a) for a in x]) plt.show() plt.close() <commit_msg>Add doctest to the sample project<commit_after>
# -*- coding: utf-8 -*- from __future__ import unicode_literals __all__ = ('is_snake',) def is_snake(word): """Checks if an animal is a snake Parameters ---------- word : str Animal name Returns ------- bool Example ------- Check if a bear is a snake >>> from ser.snake import is_snake >>> >>> if is_snake('bear'): ... print('Shhhh') ... else: ... print('Argh') Argh """ if not word.isalpha(): raise ValueError("String '{}' is not a word") if word.lower() == 'python': return True if word.lower() == 'питон': return True return False def _parse_args(args=None): """Parse command line arguments""" parser = argparse.ArgumentParser(description='Check if animal is snake') parser.add_argument('word', help='an animal to check') namespace = parser.parse_args() return namespace def main(): """Entry-point for ser module""" word = _parse_args().word if is_snake(word): print('{} is a snake'.format(word)) return print('{} is not a snake'.format(word)) def plot(): """Plot a snake""" import math import matplotlib.pyplot as plt x = [i / 10 for i in range(100)] plt.plot(x, [math.sin(a) for a in x]) plt.show() plt.close()
# -*- coding: utf-8 -*- from __future__ import unicode_literals __all__ = ('is_snake',) def is_snake(word): if not word.isalpha(): raise ValueError("String '{}' is not a word") if word.lower() == 'python': return True if word.lower() == 'питон': return True return False def _parse_args(args=None): """Parse command line arguments""" parser = argparse.ArgumentParser(description='Check if animal is snake') parser.add_argument('word', help='an animal to check') namespace = parser.parse_args() return namespace def main(): """Entry-point for ser module""" word = _parse_args().word if is_snake(word): print('{} is a snake'.format(word)) return print('{} is not a snake'.format(word)) def plot(): """Plot a snake""" import math import matplotlib.pyplot as plt x = [i / 10 for i in range(100)] plt.plot(x, [math.sin(a) for a in x]) plt.show() plt.close() Add doctest to the sample project# -*- coding: utf-8 -*- from __future__ import unicode_literals __all__ = ('is_snake',) def is_snake(word): """Checks if an animal is a snake Parameters ---------- word : str Animal name Returns ------- bool Example ------- Check if a bear is a snake >>> from ser.snake import is_snake >>> >>> if is_snake('bear'): ... print('Shhhh') ... else: ... print('Argh') Argh """ if not word.isalpha(): raise ValueError("String '{}' is not a word") if word.lower() == 'python': return True if word.lower() == 'питон': return True return False def _parse_args(args=None): """Parse command line arguments""" parser = argparse.ArgumentParser(description='Check if animal is snake') parser.add_argument('word', help='an animal to check') namespace = parser.parse_args() return namespace def main(): """Entry-point for ser module""" word = _parse_args().word if is_snake(word): print('{} is a snake'.format(word)) return print('{} is not a snake'.format(word)) def plot(): """Plot a snake""" import math import matplotlib.pyplot as plt x = [i / 10 for i in range(100)] plt.plot(x, [math.sin(a) for a in x]) plt.show() plt.close()
<commit_before># -*- coding: utf-8 -*- from __future__ import unicode_literals __all__ = ('is_snake',) def is_snake(word): if not word.isalpha(): raise ValueError("String '{}' is not a word") if word.lower() == 'python': return True if word.lower() == 'питон': return True return False def _parse_args(args=None): """Parse command line arguments""" parser = argparse.ArgumentParser(description='Check if animal is snake') parser.add_argument('word', help='an animal to check') namespace = parser.parse_args() return namespace def main(): """Entry-point for ser module""" word = _parse_args().word if is_snake(word): print('{} is a snake'.format(word)) return print('{} is not a snake'.format(word)) def plot(): """Plot a snake""" import math import matplotlib.pyplot as plt x = [i / 10 for i in range(100)] plt.plot(x, [math.sin(a) for a in x]) plt.show() plt.close() <commit_msg>Add doctest to the sample project<commit_after># -*- coding: utf-8 -*- from __future__ import unicode_literals __all__ = ('is_snake',) def is_snake(word): """Checks if an animal is a snake Parameters ---------- word : str Animal name Returns ------- bool Example ------- Check if a bear is a snake >>> from ser.snake import is_snake >>> >>> if is_snake('bear'): ... print('Shhhh') ... else: ... print('Argh') Argh """ if not word.isalpha(): raise ValueError("String '{}' is not a word") if word.lower() == 'python': return True if word.lower() == 'питон': return True return False def _parse_args(args=None): """Parse command line arguments""" parser = argparse.ArgumentParser(description='Check if animal is snake') parser.add_argument('word', help='an animal to check') namespace = parser.parse_args() return namespace def main(): """Entry-point for ser module""" word = _parse_args().word if is_snake(word): print('{} is a snake'.format(word)) return print('{} is not a snake'.format(word)) def plot(): """Plot a snake""" import math import matplotlib.pyplot as plt x = [i / 10 for i in range(100)] plt.plot(x, [math.sin(a) for a in x]) plt.show() plt.close()
57cc05d5cf61779994656aaacc53f8fcccc25ca3
ade25/assetmanager/tool.py
ade25/assetmanager/tool.py
# -*- coding: utf-8 -*- """Module providing an image asset asignment factory.""" class AssetAssignmentTool(object): """ Factory providing CRUD oparations for project assets """
# -*- coding: utf-8 -*- """Module providing an image asset asignment factory.""" import json import time from plone import api from Products.CMFPlone.utils import safe_unicode from zope.lifecycleevent import modified class AssetAssignmentTool(object): """ Factory providing CRUD oparations for project assets """ def create(self, uuid, data): item = api.content.get(UID=uuid) start = time.time() initial_data = self._create_record(uuid, data) end = time.time() initial_data.update(dict(_runtime=end-start)) json_data = json.dumps(initial_data) setattr(item, 'assets', json_data) modified(item) item.reindexObject(idxs='modified') return uuid def safe_encode(self, value): """Return safe unicode version of value. """ su = safe_unicode(value) return su.encode('utf-8')
Move create method as example implementation
Move create method as example implementation Copy method/function from exusting tool integration for reference concerning the layout of the json object
Python
mit
ade25/ade25.assetmanager
# -*- coding: utf-8 -*- """Module providing an image asset asignment factory.""" class AssetAssignmentTool(object): """ Factory providing CRUD oparations for project assets """ Move create method as example implementation Copy method/function from exusting tool integration for reference concerning the layout of the json object
# -*- coding: utf-8 -*- """Module providing an image asset asignment factory.""" import json import time from plone import api from Products.CMFPlone.utils import safe_unicode from zope.lifecycleevent import modified class AssetAssignmentTool(object): """ Factory providing CRUD oparations for project assets """ def create(self, uuid, data): item = api.content.get(UID=uuid) start = time.time() initial_data = self._create_record(uuid, data) end = time.time() initial_data.update(dict(_runtime=end-start)) json_data = json.dumps(initial_data) setattr(item, 'assets', json_data) modified(item) item.reindexObject(idxs='modified') return uuid def safe_encode(self, value): """Return safe unicode version of value. """ su = safe_unicode(value) return su.encode('utf-8')
<commit_before># -*- coding: utf-8 -*- """Module providing an image asset asignment factory.""" class AssetAssignmentTool(object): """ Factory providing CRUD oparations for project assets """ <commit_msg>Move create method as example implementation Copy method/function from exusting tool integration for reference concerning the layout of the json object<commit_after>
# -*- coding: utf-8 -*- """Module providing an image asset asignment factory.""" import json import time from plone import api from Products.CMFPlone.utils import safe_unicode from zope.lifecycleevent import modified class AssetAssignmentTool(object): """ Factory providing CRUD oparations for project assets """ def create(self, uuid, data): item = api.content.get(UID=uuid) start = time.time() initial_data = self._create_record(uuid, data) end = time.time() initial_data.update(dict(_runtime=end-start)) json_data = json.dumps(initial_data) setattr(item, 'assets', json_data) modified(item) item.reindexObject(idxs='modified') return uuid def safe_encode(self, value): """Return safe unicode version of value. """ su = safe_unicode(value) return su.encode('utf-8')
# -*- coding: utf-8 -*- """Module providing an image asset asignment factory.""" class AssetAssignmentTool(object): """ Factory providing CRUD oparations for project assets """ Move create method as example implementation Copy method/function from exusting tool integration for reference concerning the layout of the json object# -*- coding: utf-8 -*- """Module providing an image asset asignment factory.""" import json import time from plone import api from Products.CMFPlone.utils import safe_unicode from zope.lifecycleevent import modified class AssetAssignmentTool(object): """ Factory providing CRUD oparations for project assets """ def create(self, uuid, data): item = api.content.get(UID=uuid) start = time.time() initial_data = self._create_record(uuid, data) end = time.time() initial_data.update(dict(_runtime=end-start)) json_data = json.dumps(initial_data) setattr(item, 'assets', json_data) modified(item) item.reindexObject(idxs='modified') return uuid def safe_encode(self, value): """Return safe unicode version of value. """ su = safe_unicode(value) return su.encode('utf-8')
<commit_before># -*- coding: utf-8 -*- """Module providing an image asset asignment factory.""" class AssetAssignmentTool(object): """ Factory providing CRUD oparations for project assets """ <commit_msg>Move create method as example implementation Copy method/function from exusting tool integration for reference concerning the layout of the json object<commit_after># -*- coding: utf-8 -*- """Module providing an image asset asignment factory.""" import json import time from plone import api from Products.CMFPlone.utils import safe_unicode from zope.lifecycleevent import modified class AssetAssignmentTool(object): """ Factory providing CRUD oparations for project assets """ def create(self, uuid, data): item = api.content.get(UID=uuid) start = time.time() initial_data = self._create_record(uuid, data) end = time.time() initial_data.update(dict(_runtime=end-start)) json_data = json.dumps(initial_data) setattr(item, 'assets', json_data) modified(item) item.reindexObject(idxs='modified') return uuid def safe_encode(self, value): """Return safe unicode version of value. """ su = safe_unicode(value) return su.encode('utf-8')
7f396cfd88fd08466db2f9cd77bf40e91345d2a2
nodeconductor/core/authentication.py
nodeconductor/core/authentication.py
from __future__ import unicode_literals import nodeconductor.logging.middleware import rest_framework.authentication def user_capturing_auth(auth): class CapturingAuthentication(auth): def authenticate(self, request): result = super(CapturingAuthentication, self).authenticate(request) if result is not None: user, _ = result nodeconductor.logging.middleware.set_current_user(user) return result return CapturingAuthentication SessionAuthentication = user_capturing_auth(rest_framework.authentication.SessionAuthentication) TokenAuthentication = user_capturing_auth(rest_framework.authentication.TokenAuthentication)
from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ import rest_framework.authentication from rest_framework import exceptions import nodeconductor.logging.middleware TOKEN_KEY = 'x-auth-token' class TokenAuthentication(rest_framework.authentication.TokenAuthentication): """ Custom token-based authentication. Use TOKEN_KEY from request query parameters if authentication token was not found in header. """ def get_authorization_value(self, request): auth = rest_framework.authentication.get_authorization_header(request) if not auth: auth = request.query_params.get(TOKEN_KEY, '') return auth def authenticate(self, request): auth = self.get_authorization_value(request).split() if not auth or auth[0].lower() != b'token': return None if len(auth) == 1: msg = _('Invalid token. No credentials provided.') raise exceptions.AuthenticationFailed(msg) elif len(auth) > 2: msg = _('Invalid token. Token string should not contain spaces.') raise exceptions.AuthenticationFailed(msg) return self.authenticate_credentials(auth[1]) def user_capturing_auth(auth): class CapturingAuthentication(auth): def authenticate(self, request): result = super(CapturingAuthentication, self).authenticate(request) if result is not None: user, _ = result nodeconductor.logging.middleware.set_current_user(user) return result return CapturingAuthentication SessionAuthentication = user_capturing_auth(rest_framework.authentication.SessionAuthentication) TokenAuthentication = user_capturing_auth(TokenAuthentication)
Use get parameter in token auth (nc-544)
Use get parameter in token auth (nc-544)
Python
mit
opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor
from __future__ import unicode_literals import nodeconductor.logging.middleware import rest_framework.authentication def user_capturing_auth(auth): class CapturingAuthentication(auth): def authenticate(self, request): result = super(CapturingAuthentication, self).authenticate(request) if result is not None: user, _ = result nodeconductor.logging.middleware.set_current_user(user) return result return CapturingAuthentication SessionAuthentication = user_capturing_auth(rest_framework.authentication.SessionAuthentication) TokenAuthentication = user_capturing_auth(rest_framework.authentication.TokenAuthentication) Use get parameter in token auth (nc-544)
from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ import rest_framework.authentication from rest_framework import exceptions import nodeconductor.logging.middleware TOKEN_KEY = 'x-auth-token' class TokenAuthentication(rest_framework.authentication.TokenAuthentication): """ Custom token-based authentication. Use TOKEN_KEY from request query parameters if authentication token was not found in header. """ def get_authorization_value(self, request): auth = rest_framework.authentication.get_authorization_header(request) if not auth: auth = request.query_params.get(TOKEN_KEY, '') return auth def authenticate(self, request): auth = self.get_authorization_value(request).split() if not auth or auth[0].lower() != b'token': return None if len(auth) == 1: msg = _('Invalid token. No credentials provided.') raise exceptions.AuthenticationFailed(msg) elif len(auth) > 2: msg = _('Invalid token. Token string should not contain spaces.') raise exceptions.AuthenticationFailed(msg) return self.authenticate_credentials(auth[1]) def user_capturing_auth(auth): class CapturingAuthentication(auth): def authenticate(self, request): result = super(CapturingAuthentication, self).authenticate(request) if result is not None: user, _ = result nodeconductor.logging.middleware.set_current_user(user) return result return CapturingAuthentication SessionAuthentication = user_capturing_auth(rest_framework.authentication.SessionAuthentication) TokenAuthentication = user_capturing_auth(TokenAuthentication)
<commit_before>from __future__ import unicode_literals import nodeconductor.logging.middleware import rest_framework.authentication def user_capturing_auth(auth): class CapturingAuthentication(auth): def authenticate(self, request): result = super(CapturingAuthentication, self).authenticate(request) if result is not None: user, _ = result nodeconductor.logging.middleware.set_current_user(user) return result return CapturingAuthentication SessionAuthentication = user_capturing_auth(rest_framework.authentication.SessionAuthentication) TokenAuthentication = user_capturing_auth(rest_framework.authentication.TokenAuthentication) <commit_msg>Use get parameter in token auth (nc-544)<commit_after>
from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ import rest_framework.authentication from rest_framework import exceptions import nodeconductor.logging.middleware TOKEN_KEY = 'x-auth-token' class TokenAuthentication(rest_framework.authentication.TokenAuthentication): """ Custom token-based authentication. Use TOKEN_KEY from request query parameters if authentication token was not found in header. """ def get_authorization_value(self, request): auth = rest_framework.authentication.get_authorization_header(request) if not auth: auth = request.query_params.get(TOKEN_KEY, '') return auth def authenticate(self, request): auth = self.get_authorization_value(request).split() if not auth or auth[0].lower() != b'token': return None if len(auth) == 1: msg = _('Invalid token. No credentials provided.') raise exceptions.AuthenticationFailed(msg) elif len(auth) > 2: msg = _('Invalid token. Token string should not contain spaces.') raise exceptions.AuthenticationFailed(msg) return self.authenticate_credentials(auth[1]) def user_capturing_auth(auth): class CapturingAuthentication(auth): def authenticate(self, request): result = super(CapturingAuthentication, self).authenticate(request) if result is not None: user, _ = result nodeconductor.logging.middleware.set_current_user(user) return result return CapturingAuthentication SessionAuthentication = user_capturing_auth(rest_framework.authentication.SessionAuthentication) TokenAuthentication = user_capturing_auth(TokenAuthentication)
from __future__ import unicode_literals import nodeconductor.logging.middleware import rest_framework.authentication def user_capturing_auth(auth): class CapturingAuthentication(auth): def authenticate(self, request): result = super(CapturingAuthentication, self).authenticate(request) if result is not None: user, _ = result nodeconductor.logging.middleware.set_current_user(user) return result return CapturingAuthentication SessionAuthentication = user_capturing_auth(rest_framework.authentication.SessionAuthentication) TokenAuthentication = user_capturing_auth(rest_framework.authentication.TokenAuthentication) Use get parameter in token auth (nc-544)from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ import rest_framework.authentication from rest_framework import exceptions import nodeconductor.logging.middleware TOKEN_KEY = 'x-auth-token' class TokenAuthentication(rest_framework.authentication.TokenAuthentication): """ Custom token-based authentication. Use TOKEN_KEY from request query parameters if authentication token was not found in header. """ def get_authorization_value(self, request): auth = rest_framework.authentication.get_authorization_header(request) if not auth: auth = request.query_params.get(TOKEN_KEY, '') return auth def authenticate(self, request): auth = self.get_authorization_value(request).split() if not auth or auth[0].lower() != b'token': return None if len(auth) == 1: msg = _('Invalid token. No credentials provided.') raise exceptions.AuthenticationFailed(msg) elif len(auth) > 2: msg = _('Invalid token. Token string should not contain spaces.') raise exceptions.AuthenticationFailed(msg) return self.authenticate_credentials(auth[1]) def user_capturing_auth(auth): class CapturingAuthentication(auth): def authenticate(self, request): result = super(CapturingAuthentication, self).authenticate(request) if result is not None: user, _ = result nodeconductor.logging.middleware.set_current_user(user) return result return CapturingAuthentication SessionAuthentication = user_capturing_auth(rest_framework.authentication.SessionAuthentication) TokenAuthentication = user_capturing_auth(TokenAuthentication)
<commit_before>from __future__ import unicode_literals import nodeconductor.logging.middleware import rest_framework.authentication def user_capturing_auth(auth): class CapturingAuthentication(auth): def authenticate(self, request): result = super(CapturingAuthentication, self).authenticate(request) if result is not None: user, _ = result nodeconductor.logging.middleware.set_current_user(user) return result return CapturingAuthentication SessionAuthentication = user_capturing_auth(rest_framework.authentication.SessionAuthentication) TokenAuthentication = user_capturing_auth(rest_framework.authentication.TokenAuthentication) <commit_msg>Use get parameter in token auth (nc-544)<commit_after>from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ import rest_framework.authentication from rest_framework import exceptions import nodeconductor.logging.middleware TOKEN_KEY = 'x-auth-token' class TokenAuthentication(rest_framework.authentication.TokenAuthentication): """ Custom token-based authentication. Use TOKEN_KEY from request query parameters if authentication token was not found in header. """ def get_authorization_value(self, request): auth = rest_framework.authentication.get_authorization_header(request) if not auth: auth = request.query_params.get(TOKEN_KEY, '') return auth def authenticate(self, request): auth = self.get_authorization_value(request).split() if not auth or auth[0].lower() != b'token': return None if len(auth) == 1: msg = _('Invalid token. No credentials provided.') raise exceptions.AuthenticationFailed(msg) elif len(auth) > 2: msg = _('Invalid token. Token string should not contain spaces.') raise exceptions.AuthenticationFailed(msg) return self.authenticate_credentials(auth[1]) def user_capturing_auth(auth): class CapturingAuthentication(auth): def authenticate(self, request): result = super(CapturingAuthentication, self).authenticate(request) if result is not None: user, _ = result nodeconductor.logging.middleware.set_current_user(user) return result return CapturingAuthentication SessionAuthentication = user_capturing_auth(rest_framework.authentication.SessionAuthentication) TokenAuthentication = user_capturing_auth(TokenAuthentication)
2c204e02607e75d0cfb696a1dfbaa1b7997fbb55
sections/transportation/ferrys.py
sections/transportation/ferrys.py
# from . import has_required_data_maker, obtain_data_maker PATH = 'ferry_paths.json' def has_required_data(data_dir): return False # def obtain_data(data_dir): # with open(join(data_dir, PATH), 'w') as fh: # json.dump(get_paths(['Railways']).tolist(), fh)
import requests from ..image_provider import ImageProvider PATH = 'ferry_paths.json' BASE = 'http://journeyplanner.silverrailtech.com/JourneyPlannerService/V2' DATASET = 'PerthRestricted' class FerryImageProvider(ImageProvider): def has_required_data(self): return self.data_dir_exists(PATH) def obtain_data(self): url = BASE + "/rest/DataSets/{dataset}/RouteMap".format_map(locals()) api_key = "eac7a147-0831-4fcf-8fa8-a5e8ffcfa039" routeTimetableGroupUid = 'PerthRestricted:3' r = requests.get( url, params={ 'ApiKey': api_key, 'Route': routeTimetableGroupUid, 'MappingDataRequired': True, 'transactionId': 0, 'format': 'json' } ) data = r.json() return self.save_json( PATH, [ [ tuple(map(float, point.split(','))) for point in path['Polyline'].split(';') ] for path in data['MapSegments'] ] )
Work on ferry routes display
Work on ferry routes display Will either need to pull data from google, or aggregate if we want to do all those in australia
Python
mit
Mause/statistical_atlas_of_au
# from . import has_required_data_maker, obtain_data_maker PATH = 'ferry_paths.json' def has_required_data(data_dir): return False # def obtain_data(data_dir): # with open(join(data_dir, PATH), 'w') as fh: # json.dump(get_paths(['Railways']).tolist(), fh) Work on ferry routes display Will either need to pull data from google, or aggregate if we want to do all those in australia
import requests from ..image_provider import ImageProvider PATH = 'ferry_paths.json' BASE = 'http://journeyplanner.silverrailtech.com/JourneyPlannerService/V2' DATASET = 'PerthRestricted' class FerryImageProvider(ImageProvider): def has_required_data(self): return self.data_dir_exists(PATH) def obtain_data(self): url = BASE + "/rest/DataSets/{dataset}/RouteMap".format_map(locals()) api_key = "eac7a147-0831-4fcf-8fa8-a5e8ffcfa039" routeTimetableGroupUid = 'PerthRestricted:3' r = requests.get( url, params={ 'ApiKey': api_key, 'Route': routeTimetableGroupUid, 'MappingDataRequired': True, 'transactionId': 0, 'format': 'json' } ) data = r.json() return self.save_json( PATH, [ [ tuple(map(float, point.split(','))) for point in path['Polyline'].split(';') ] for path in data['MapSegments'] ] )
<commit_before># from . import has_required_data_maker, obtain_data_maker PATH = 'ferry_paths.json' def has_required_data(data_dir): return False # def obtain_data(data_dir): # with open(join(data_dir, PATH), 'w') as fh: # json.dump(get_paths(['Railways']).tolist(), fh) <commit_msg>Work on ferry routes display Will either need to pull data from google, or aggregate if we want to do all those in australia<commit_after>
import requests from ..image_provider import ImageProvider PATH = 'ferry_paths.json' BASE = 'http://journeyplanner.silverrailtech.com/JourneyPlannerService/V2' DATASET = 'PerthRestricted' class FerryImageProvider(ImageProvider): def has_required_data(self): return self.data_dir_exists(PATH) def obtain_data(self): url = BASE + "/rest/DataSets/{dataset}/RouteMap".format_map(locals()) api_key = "eac7a147-0831-4fcf-8fa8-a5e8ffcfa039" routeTimetableGroupUid = 'PerthRestricted:3' r = requests.get( url, params={ 'ApiKey': api_key, 'Route': routeTimetableGroupUid, 'MappingDataRequired': True, 'transactionId': 0, 'format': 'json' } ) data = r.json() return self.save_json( PATH, [ [ tuple(map(float, point.split(','))) for point in path['Polyline'].split(';') ] for path in data['MapSegments'] ] )
# from . import has_required_data_maker, obtain_data_maker PATH = 'ferry_paths.json' def has_required_data(data_dir): return False # def obtain_data(data_dir): # with open(join(data_dir, PATH), 'w') as fh: # json.dump(get_paths(['Railways']).tolist(), fh) Work on ferry routes display Will either need to pull data from google, or aggregate if we want to do all those in australiaimport requests from ..image_provider import ImageProvider PATH = 'ferry_paths.json' BASE = 'http://journeyplanner.silverrailtech.com/JourneyPlannerService/V2' DATASET = 'PerthRestricted' class FerryImageProvider(ImageProvider): def has_required_data(self): return self.data_dir_exists(PATH) def obtain_data(self): url = BASE + "/rest/DataSets/{dataset}/RouteMap".format_map(locals()) api_key = "eac7a147-0831-4fcf-8fa8-a5e8ffcfa039" routeTimetableGroupUid = 'PerthRestricted:3' r = requests.get( url, params={ 'ApiKey': api_key, 'Route': routeTimetableGroupUid, 'MappingDataRequired': True, 'transactionId': 0, 'format': 'json' } ) data = r.json() return self.save_json( PATH, [ [ tuple(map(float, point.split(','))) for point in path['Polyline'].split(';') ] for path in data['MapSegments'] ] )
<commit_before># from . import has_required_data_maker, obtain_data_maker PATH = 'ferry_paths.json' def has_required_data(data_dir): return False # def obtain_data(data_dir): # with open(join(data_dir, PATH), 'w') as fh: # json.dump(get_paths(['Railways']).tolist(), fh) <commit_msg>Work on ferry routes display Will either need to pull data from google, or aggregate if we want to do all those in australia<commit_after>import requests from ..image_provider import ImageProvider PATH = 'ferry_paths.json' BASE = 'http://journeyplanner.silverrailtech.com/JourneyPlannerService/V2' DATASET = 'PerthRestricted' class FerryImageProvider(ImageProvider): def has_required_data(self): return self.data_dir_exists(PATH) def obtain_data(self): url = BASE + "/rest/DataSets/{dataset}/RouteMap".format_map(locals()) api_key = "eac7a147-0831-4fcf-8fa8-a5e8ffcfa039" routeTimetableGroupUid = 'PerthRestricted:3' r = requests.get( url, params={ 'ApiKey': api_key, 'Route': routeTimetableGroupUid, 'MappingDataRequired': True, 'transactionId': 0, 'format': 'json' } ) data = r.json() return self.save_json( PATH, [ [ tuple(map(float, point.split(','))) for point in path['Polyline'].split(';') ] for path in data['MapSegments'] ] )
2bd8b3ad7eeb9a08f726e2e28582612e83bce9ab
ac_mediator/local_settings.example.py
ac_mediator/local_settings.example.py
DEBUG = True ALLOWED_HOSTS = [] SECRET_KEY = '090d2#wtg&q2@o+l%cvc&4)r4x5fr9o#r^qz3%0bemyecshn31' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'ac_mediator', 'USER': '', 'PASSWORD': '', } } BASE_URL = 'http://localhost:8000'
import os DEBUG = True ALLOWED_HOSTS = [] SECRET_KEY = '090d2#wtg&q2@o+l%cvc&4)r4x5fr9o#r^qz3%0bemyecshn31' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'ac_mediator', 'USER': 'postgres', 'PASSWORD': 'postgres', 'HOST': os.getenv('DOCKER_DB_HOST', '127.0.0.1') } } BASE_URL = 'http://localhost:8000'
Update local settings for compatibility with docker
Update local settings for compatibility with docker
Python
apache-2.0
AudioCommons/ac-mediator,AudioCommons/ac-mediator,AudioCommons/ac-mediator
DEBUG = True ALLOWED_HOSTS = [] SECRET_KEY = '090d2#wtg&q2@o+l%cvc&4)r4x5fr9o#r^qz3%0bemyecshn31' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'ac_mediator', 'USER': '', 'PASSWORD': '', } } BASE_URL = 'http://localhost:8000' Update local settings for compatibility with docker
import os DEBUG = True ALLOWED_HOSTS = [] SECRET_KEY = '090d2#wtg&q2@o+l%cvc&4)r4x5fr9o#r^qz3%0bemyecshn31' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'ac_mediator', 'USER': 'postgres', 'PASSWORD': 'postgres', 'HOST': os.getenv('DOCKER_DB_HOST', '127.0.0.1') } } BASE_URL = 'http://localhost:8000'
<commit_before>DEBUG = True ALLOWED_HOSTS = [] SECRET_KEY = '090d2#wtg&q2@o+l%cvc&4)r4x5fr9o#r^qz3%0bemyecshn31' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'ac_mediator', 'USER': '', 'PASSWORD': '', } } BASE_URL = 'http://localhost:8000' <commit_msg>Update local settings for compatibility with docker<commit_after>
import os DEBUG = True ALLOWED_HOSTS = [] SECRET_KEY = '090d2#wtg&q2@o+l%cvc&4)r4x5fr9o#r^qz3%0bemyecshn31' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'ac_mediator', 'USER': 'postgres', 'PASSWORD': 'postgres', 'HOST': os.getenv('DOCKER_DB_HOST', '127.0.0.1') } } BASE_URL = 'http://localhost:8000'
DEBUG = True ALLOWED_HOSTS = [] SECRET_KEY = '090d2#wtg&q2@o+l%cvc&4)r4x5fr9o#r^qz3%0bemyecshn31' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'ac_mediator', 'USER': '', 'PASSWORD': '', } } BASE_URL = 'http://localhost:8000' Update local settings for compatibility with dockerimport os DEBUG = True ALLOWED_HOSTS = [] SECRET_KEY = '090d2#wtg&q2@o+l%cvc&4)r4x5fr9o#r^qz3%0bemyecshn31' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'ac_mediator', 'USER': 'postgres', 'PASSWORD': 'postgres', 'HOST': os.getenv('DOCKER_DB_HOST', '127.0.0.1') } } BASE_URL = 'http://localhost:8000'
<commit_before>DEBUG = True ALLOWED_HOSTS = [] SECRET_KEY = '090d2#wtg&q2@o+l%cvc&4)r4x5fr9o#r^qz3%0bemyecshn31' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'ac_mediator', 'USER': '', 'PASSWORD': '', } } BASE_URL = 'http://localhost:8000' <commit_msg>Update local settings for compatibility with docker<commit_after>import os DEBUG = True ALLOWED_HOSTS = [] SECRET_KEY = '090d2#wtg&q2@o+l%cvc&4)r4x5fr9o#r^qz3%0bemyecshn31' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'ac_mediator', 'USER': 'postgres', 'PASSWORD': 'postgres', 'HOST': os.getenv('DOCKER_DB_HOST', '127.0.0.1') } } BASE_URL = 'http://localhost:8000'
ff23541ce41bb20f5f535026238d8dd879e8a894
drf_enum_field/fields.py
drf_enum_field/fields.py
from rest_framework.fields import ChoiceField class EnumField(ChoiceField): default_error_messages = { 'invalid': ("No matching enum type.",) } def __init__(self, **kwargs): self.enum_type = kwargs.pop("enum_type") kwargs.pop("choices", None) super(EnumField, self).__init__(self.enum_type.choices(), **kwargs) def to_internal_value(self, data): for choice in self.enum_type: if choice.name == data or choice.value == data: return choice self.fail('invalid') def to_representation(self, value): if not value: return None return value.name
from django.utils.translation import ugettext_lazy as _ from rest_framework.fields import ChoiceField class EnumField(ChoiceField): default_error_messages = { 'invalid': _("No matching enum type.") } def __init__(self, **kwargs): self.enum_type = kwargs.pop("enum_type") kwargs.pop("choices", None) super(EnumField, self).__init__(self.enum_type.choices(), **kwargs) def to_internal_value(self, data): for choice in self.enum_type: if choice.name == data or choice.value == data: return choice self.fail('invalid') def to_representation(self, value): if not value: return None return value.name
Return translation instead of tuple
Return translation instead of tuple Fixes Attributerror: 'tuple' object has no attribute 'format' when POSTing with no value for an Enum field.
Python
mit
seebass/drf-enum-field
from rest_framework.fields import ChoiceField class EnumField(ChoiceField): default_error_messages = { 'invalid': ("No matching enum type.",) } def __init__(self, **kwargs): self.enum_type = kwargs.pop("enum_type") kwargs.pop("choices", None) super(EnumField, self).__init__(self.enum_type.choices(), **kwargs) def to_internal_value(self, data): for choice in self.enum_type: if choice.name == data or choice.value == data: return choice self.fail('invalid') def to_representation(self, value): if not value: return None return value.name Return translation instead of tuple Fixes Attributerror: 'tuple' object has no attribute 'format' when POSTing with no value for an Enum field.
from django.utils.translation import ugettext_lazy as _ from rest_framework.fields import ChoiceField class EnumField(ChoiceField): default_error_messages = { 'invalid': _("No matching enum type.") } def __init__(self, **kwargs): self.enum_type = kwargs.pop("enum_type") kwargs.pop("choices", None) super(EnumField, self).__init__(self.enum_type.choices(), **kwargs) def to_internal_value(self, data): for choice in self.enum_type: if choice.name == data or choice.value == data: return choice self.fail('invalid') def to_representation(self, value): if not value: return None return value.name
<commit_before>from rest_framework.fields import ChoiceField class EnumField(ChoiceField): default_error_messages = { 'invalid': ("No matching enum type.",) } def __init__(self, **kwargs): self.enum_type = kwargs.pop("enum_type") kwargs.pop("choices", None) super(EnumField, self).__init__(self.enum_type.choices(), **kwargs) def to_internal_value(self, data): for choice in self.enum_type: if choice.name == data or choice.value == data: return choice self.fail('invalid') def to_representation(self, value): if not value: return None return value.name <commit_msg>Return translation instead of tuple Fixes Attributerror: 'tuple' object has no attribute 'format' when POSTing with no value for an Enum field.<commit_after>
from django.utils.translation import ugettext_lazy as _ from rest_framework.fields import ChoiceField class EnumField(ChoiceField): default_error_messages = { 'invalid': _("No matching enum type.") } def __init__(self, **kwargs): self.enum_type = kwargs.pop("enum_type") kwargs.pop("choices", None) super(EnumField, self).__init__(self.enum_type.choices(), **kwargs) def to_internal_value(self, data): for choice in self.enum_type: if choice.name == data or choice.value == data: return choice self.fail('invalid') def to_representation(self, value): if not value: return None return value.name
from rest_framework.fields import ChoiceField class EnumField(ChoiceField): default_error_messages = { 'invalid': ("No matching enum type.",) } def __init__(self, **kwargs): self.enum_type = kwargs.pop("enum_type") kwargs.pop("choices", None) super(EnumField, self).__init__(self.enum_type.choices(), **kwargs) def to_internal_value(self, data): for choice in self.enum_type: if choice.name == data or choice.value == data: return choice self.fail('invalid') def to_representation(self, value): if not value: return None return value.name Return translation instead of tuple Fixes Attributerror: 'tuple' object has no attribute 'format' when POSTing with no value for an Enum field.from django.utils.translation import ugettext_lazy as _ from rest_framework.fields import ChoiceField class EnumField(ChoiceField): default_error_messages = { 'invalid': _("No matching enum type.") } def __init__(self, **kwargs): self.enum_type = kwargs.pop("enum_type") kwargs.pop("choices", None) super(EnumField, self).__init__(self.enum_type.choices(), **kwargs) def to_internal_value(self, data): for choice in self.enum_type: if choice.name == data or choice.value == data: return choice self.fail('invalid') def to_representation(self, value): if not value: return None return value.name
<commit_before>from rest_framework.fields import ChoiceField class EnumField(ChoiceField): default_error_messages = { 'invalid': ("No matching enum type.",) } def __init__(self, **kwargs): self.enum_type = kwargs.pop("enum_type") kwargs.pop("choices", None) super(EnumField, self).__init__(self.enum_type.choices(), **kwargs) def to_internal_value(self, data): for choice in self.enum_type: if choice.name == data or choice.value == data: return choice self.fail('invalid') def to_representation(self, value): if not value: return None return value.name <commit_msg>Return translation instead of tuple Fixes Attributerror: 'tuple' object has no attribute 'format' when POSTing with no value for an Enum field.<commit_after>from django.utils.translation import ugettext_lazy as _ from rest_framework.fields import ChoiceField class EnumField(ChoiceField): default_error_messages = { 'invalid': _("No matching enum type.") } def __init__(self, **kwargs): self.enum_type = kwargs.pop("enum_type") kwargs.pop("choices", None) super(EnumField, self).__init__(self.enum_type.choices(), **kwargs) def to_internal_value(self, data): for choice in self.enum_type: if choice.name == data or choice.value == data: return choice self.fail('invalid') def to_representation(self, value): if not value: return None return value.name
3814db4e512fb0822b455afc77566e526a3a6afe
examples/example_helper.py
examples/example_helper.py
import json import os import shutil from scipy_data_fitting import Plot def save_example_fit(fit): """ Save fit result to a json file and a plot to an svg file. """ json_directory = os.path.join('examples', 'json') plot_directory = os.path.join('examples', 'plots') if not os.path.isdir(json_directory): os.makedirs(json_directory) if not os.path.isdir(plot_directory): os.makedirs(plot_directory) fit.to_json(os.path.join(json_directory, fit.name + '.json'), meta=fit.metadata) plot = Plot(fit) plot.save(os.path.join(plot_directory, fit.name + '.svg')) plot.close() def reset_directory(directory): """ Remove `directory` if it exists, then create it if it doesn't exist. """ if os.path.isdir(directory): shutil.rmtree(directory) if not os.path.isdir(directory): os.makedirs(directory)
import json import os import shutil import sys sys.path.insert(0, os.path.abspath('.')) from scipy_data_fitting import Plot def save_example_fit(fit): """ Save fit result to a json file and a plot to an svg file. """ json_directory = os.path.join('examples', 'json') plot_directory = os.path.join('examples', 'plots') if not os.path.isdir(json_directory): os.makedirs(json_directory) if not os.path.isdir(plot_directory): os.makedirs(plot_directory) fit.to_json(os.path.join(json_directory, fit.name + '.json'), meta=fit.metadata) plot = Plot(fit) plot.save(os.path.join(plot_directory, fit.name + '.svg')) plot.close() def reset_directory(directory): """ Remove `directory` if it exists, then create it if it doesn't exist. """ if os.path.isdir(directory): shutil.rmtree(directory) if not os.path.isdir(directory): os.makedirs(directory)
Fix examples by adding package to path
Fix examples by adding package to path
Python
mit
razor-x/scipy-data_fitting
import json import os import shutil from scipy_data_fitting import Plot def save_example_fit(fit): """ Save fit result to a json file and a plot to an svg file. """ json_directory = os.path.join('examples', 'json') plot_directory = os.path.join('examples', 'plots') if not os.path.isdir(json_directory): os.makedirs(json_directory) if not os.path.isdir(plot_directory): os.makedirs(plot_directory) fit.to_json(os.path.join(json_directory, fit.name + '.json'), meta=fit.metadata) plot = Plot(fit) plot.save(os.path.join(plot_directory, fit.name + '.svg')) plot.close() def reset_directory(directory): """ Remove `directory` if it exists, then create it if it doesn't exist. """ if os.path.isdir(directory): shutil.rmtree(directory) if not os.path.isdir(directory): os.makedirs(directory) Fix examples by adding package to path
import json import os import shutil import sys sys.path.insert(0, os.path.abspath('.')) from scipy_data_fitting import Plot def save_example_fit(fit): """ Save fit result to a json file and a plot to an svg file. """ json_directory = os.path.join('examples', 'json') plot_directory = os.path.join('examples', 'plots') if not os.path.isdir(json_directory): os.makedirs(json_directory) if not os.path.isdir(plot_directory): os.makedirs(plot_directory) fit.to_json(os.path.join(json_directory, fit.name + '.json'), meta=fit.metadata) plot = Plot(fit) plot.save(os.path.join(plot_directory, fit.name + '.svg')) plot.close() def reset_directory(directory): """ Remove `directory` if it exists, then create it if it doesn't exist. """ if os.path.isdir(directory): shutil.rmtree(directory) if not os.path.isdir(directory): os.makedirs(directory)
<commit_before>import json import os import shutil from scipy_data_fitting import Plot def save_example_fit(fit): """ Save fit result to a json file and a plot to an svg file. """ json_directory = os.path.join('examples', 'json') plot_directory = os.path.join('examples', 'plots') if not os.path.isdir(json_directory): os.makedirs(json_directory) if not os.path.isdir(plot_directory): os.makedirs(plot_directory) fit.to_json(os.path.join(json_directory, fit.name + '.json'), meta=fit.metadata) plot = Plot(fit) plot.save(os.path.join(plot_directory, fit.name + '.svg')) plot.close() def reset_directory(directory): """ Remove `directory` if it exists, then create it if it doesn't exist. """ if os.path.isdir(directory): shutil.rmtree(directory) if not os.path.isdir(directory): os.makedirs(directory) <commit_msg>Fix examples by adding package to path<commit_after>
import json import os import shutil import sys sys.path.insert(0, os.path.abspath('.')) from scipy_data_fitting import Plot def save_example_fit(fit): """ Save fit result to a json file and a plot to an svg file. """ json_directory = os.path.join('examples', 'json') plot_directory = os.path.join('examples', 'plots') if not os.path.isdir(json_directory): os.makedirs(json_directory) if not os.path.isdir(plot_directory): os.makedirs(plot_directory) fit.to_json(os.path.join(json_directory, fit.name + '.json'), meta=fit.metadata) plot = Plot(fit) plot.save(os.path.join(plot_directory, fit.name + '.svg')) plot.close() def reset_directory(directory): """ Remove `directory` if it exists, then create it if it doesn't exist. """ if os.path.isdir(directory): shutil.rmtree(directory) if not os.path.isdir(directory): os.makedirs(directory)
import json import os import shutil from scipy_data_fitting import Plot def save_example_fit(fit): """ Save fit result to a json file and a plot to an svg file. """ json_directory = os.path.join('examples', 'json') plot_directory = os.path.join('examples', 'plots') if not os.path.isdir(json_directory): os.makedirs(json_directory) if not os.path.isdir(plot_directory): os.makedirs(plot_directory) fit.to_json(os.path.join(json_directory, fit.name + '.json'), meta=fit.metadata) plot = Plot(fit) plot.save(os.path.join(plot_directory, fit.name + '.svg')) plot.close() def reset_directory(directory): """ Remove `directory` if it exists, then create it if it doesn't exist. """ if os.path.isdir(directory): shutil.rmtree(directory) if not os.path.isdir(directory): os.makedirs(directory) Fix examples by adding package to pathimport json import os import shutil import sys sys.path.insert(0, os.path.abspath('.')) from scipy_data_fitting import Plot def save_example_fit(fit): """ Save fit result to a json file and a plot to an svg file. """ json_directory = os.path.join('examples', 'json') plot_directory = os.path.join('examples', 'plots') if not os.path.isdir(json_directory): os.makedirs(json_directory) if not os.path.isdir(plot_directory): os.makedirs(plot_directory) fit.to_json(os.path.join(json_directory, fit.name + '.json'), meta=fit.metadata) plot = Plot(fit) plot.save(os.path.join(plot_directory, fit.name + '.svg')) plot.close() def reset_directory(directory): """ Remove `directory` if it exists, then create it if it doesn't exist. """ if os.path.isdir(directory): shutil.rmtree(directory) if not os.path.isdir(directory): os.makedirs(directory)
<commit_before>import json import os import shutil from scipy_data_fitting import Plot def save_example_fit(fit): """ Save fit result to a json file and a plot to an svg file. """ json_directory = os.path.join('examples', 'json') plot_directory = os.path.join('examples', 'plots') if not os.path.isdir(json_directory): os.makedirs(json_directory) if not os.path.isdir(plot_directory): os.makedirs(plot_directory) fit.to_json(os.path.join(json_directory, fit.name + '.json'), meta=fit.metadata) plot = Plot(fit) plot.save(os.path.join(plot_directory, fit.name + '.svg')) plot.close() def reset_directory(directory): """ Remove `directory` if it exists, then create it if it doesn't exist. """ if os.path.isdir(directory): shutil.rmtree(directory) if not os.path.isdir(directory): os.makedirs(directory) <commit_msg>Fix examples by adding package to path<commit_after>import json import os import shutil import sys sys.path.insert(0, os.path.abspath('.')) from scipy_data_fitting import Plot def save_example_fit(fit): """ Save fit result to a json file and a plot to an svg file. """ json_directory = os.path.join('examples', 'json') plot_directory = os.path.join('examples', 'plots') if not os.path.isdir(json_directory): os.makedirs(json_directory) if not os.path.isdir(plot_directory): os.makedirs(plot_directory) fit.to_json(os.path.join(json_directory, fit.name + '.json'), meta=fit.metadata) plot = Plot(fit) plot.save(os.path.join(plot_directory, fit.name + '.svg')) plot.close() def reset_directory(directory): """ Remove `directory` if it exists, then create it if it doesn't exist. """ if os.path.isdir(directory): shutil.rmtree(directory) if not os.path.isdir(directory): os.makedirs(directory)
6b204b6013b516c1f312ac19097dcdc068f85b93
tools/grit/grit/extern/FP.py
tools/grit/grit/extern/FP.py
#!/usr/bin/python2.2 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import md5 """64-bit fingerprint support for strings. Usage: from extern import FP print 'Fingerprint is %ld' % FP.FingerPrint('Hello world!') """ def UnsignedFingerPrint(str, encoding='utf-8'): """Generate a 64-bit fingerprint by taking the first half of the md5 of the string.""" hex128 = md5.new(str).hexdigest() int64 = long(hex128[:16], 16) return int64 def FingerPrint(str, encoding='utf-8'): fp = UnsignedFingerPrint(str, encoding=encoding) # interpret fingerprint as signed longs if fp & 0x8000000000000000L: fp = - ((~fp & 0xFFFFFFFFFFFFFFFFL) + 1) return fp
#!/usr/bin/python # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import md5 """64-bit fingerprint support for strings. Usage: from extern import FP print 'Fingerprint is %ld' % FP.FingerPrint('Hello world!') """ def UnsignedFingerPrint(str, encoding='utf-8'): """Generate a 64-bit fingerprint by taking the first half of the md5 of the string.""" hex128 = md5.new(str).hexdigest() int64 = long(hex128[:16], 16) return int64 def FingerPrint(str, encoding='utf-8'): fp = UnsignedFingerPrint(str, encoding=encoding) # interpret fingerprint as signed longs if fp & 0x8000000000000000L: fp = - ((~fp & 0xFFFFFFFFFFFFFFFFL) + 1) return fp
Remove version number from Python shebang.
Remove version number from Python shebang. On special request from someone trying to purge python2.2 from code indexed internally at Google. git-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@7071 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Python
bsd-3-clause
wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser
#!/usr/bin/python2.2 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import md5 """64-bit fingerprint support for strings. Usage: from extern import FP print 'Fingerprint is %ld' % FP.FingerPrint('Hello world!') """ def UnsignedFingerPrint(str, encoding='utf-8'): """Generate a 64-bit fingerprint by taking the first half of the md5 of the string.""" hex128 = md5.new(str).hexdigest() int64 = long(hex128[:16], 16) return int64 def FingerPrint(str, encoding='utf-8'): fp = UnsignedFingerPrint(str, encoding=encoding) # interpret fingerprint as signed longs if fp & 0x8000000000000000L: fp = - ((~fp & 0xFFFFFFFFFFFFFFFFL) + 1) return fp Remove version number from Python shebang. On special request from someone trying to purge python2.2 from code indexed internally at Google. git-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@7071 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
#!/usr/bin/python # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import md5 """64-bit fingerprint support for strings. Usage: from extern import FP print 'Fingerprint is %ld' % FP.FingerPrint('Hello world!') """ def UnsignedFingerPrint(str, encoding='utf-8'): """Generate a 64-bit fingerprint by taking the first half of the md5 of the string.""" hex128 = md5.new(str).hexdigest() int64 = long(hex128[:16], 16) return int64 def FingerPrint(str, encoding='utf-8'): fp = UnsignedFingerPrint(str, encoding=encoding) # interpret fingerprint as signed longs if fp & 0x8000000000000000L: fp = - ((~fp & 0xFFFFFFFFFFFFFFFFL) + 1) return fp
<commit_before>#!/usr/bin/python2.2 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import md5 """64-bit fingerprint support for strings. Usage: from extern import FP print 'Fingerprint is %ld' % FP.FingerPrint('Hello world!') """ def UnsignedFingerPrint(str, encoding='utf-8'): """Generate a 64-bit fingerprint by taking the first half of the md5 of the string.""" hex128 = md5.new(str).hexdigest() int64 = long(hex128[:16], 16) return int64 def FingerPrint(str, encoding='utf-8'): fp = UnsignedFingerPrint(str, encoding=encoding) # interpret fingerprint as signed longs if fp & 0x8000000000000000L: fp = - ((~fp & 0xFFFFFFFFFFFFFFFFL) + 1) return fp <commit_msg>Remove version number from Python shebang. On special request from someone trying to purge python2.2 from code indexed internally at Google. git-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@7071 4ff67af0-8c30-449e-8e8b-ad334ec8d88c<commit_after>
#!/usr/bin/python # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import md5 """64-bit fingerprint support for strings. Usage: from extern import FP print 'Fingerprint is %ld' % FP.FingerPrint('Hello world!') """ def UnsignedFingerPrint(str, encoding='utf-8'): """Generate a 64-bit fingerprint by taking the first half of the md5 of the string.""" hex128 = md5.new(str).hexdigest() int64 = long(hex128[:16], 16) return int64 def FingerPrint(str, encoding='utf-8'): fp = UnsignedFingerPrint(str, encoding=encoding) # interpret fingerprint as signed longs if fp & 0x8000000000000000L: fp = - ((~fp & 0xFFFFFFFFFFFFFFFFL) + 1) return fp
#!/usr/bin/python2.2 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import md5 """64-bit fingerprint support for strings. Usage: from extern import FP print 'Fingerprint is %ld' % FP.FingerPrint('Hello world!') """ def UnsignedFingerPrint(str, encoding='utf-8'): """Generate a 64-bit fingerprint by taking the first half of the md5 of the string.""" hex128 = md5.new(str).hexdigest() int64 = long(hex128[:16], 16) return int64 def FingerPrint(str, encoding='utf-8'): fp = UnsignedFingerPrint(str, encoding=encoding) # interpret fingerprint as signed longs if fp & 0x8000000000000000L: fp = - ((~fp & 0xFFFFFFFFFFFFFFFFL) + 1) return fp Remove version number from Python shebang. On special request from someone trying to purge python2.2 from code indexed internally at Google. git-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@7071 4ff67af0-8c30-449e-8e8b-ad334ec8d88c#!/usr/bin/python # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import md5 """64-bit fingerprint support for strings. Usage: from extern import FP print 'Fingerprint is %ld' % FP.FingerPrint('Hello world!') """ def UnsignedFingerPrint(str, encoding='utf-8'): """Generate a 64-bit fingerprint by taking the first half of the md5 of the string.""" hex128 = md5.new(str).hexdigest() int64 = long(hex128[:16], 16) return int64 def FingerPrint(str, encoding='utf-8'): fp = UnsignedFingerPrint(str, encoding=encoding) # interpret fingerprint as signed longs if fp & 0x8000000000000000L: fp = - ((~fp & 0xFFFFFFFFFFFFFFFFL) + 1) return fp
<commit_before>#!/usr/bin/python2.2 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import md5 """64-bit fingerprint support for strings. Usage: from extern import FP print 'Fingerprint is %ld' % FP.FingerPrint('Hello world!') """ def UnsignedFingerPrint(str, encoding='utf-8'): """Generate a 64-bit fingerprint by taking the first half of the md5 of the string.""" hex128 = md5.new(str).hexdigest() int64 = long(hex128[:16], 16) return int64 def FingerPrint(str, encoding='utf-8'): fp = UnsignedFingerPrint(str, encoding=encoding) # interpret fingerprint as signed longs if fp & 0x8000000000000000L: fp = - ((~fp & 0xFFFFFFFFFFFFFFFFL) + 1) return fp <commit_msg>Remove version number from Python shebang. On special request from someone trying to purge python2.2 from code indexed internally at Google. git-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@7071 4ff67af0-8c30-449e-8e8b-ad334ec8d88c<commit_after>#!/usr/bin/python # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import md5 """64-bit fingerprint support for strings. Usage: from extern import FP print 'Fingerprint is %ld' % FP.FingerPrint('Hello world!') """ def UnsignedFingerPrint(str, encoding='utf-8'): """Generate a 64-bit fingerprint by taking the first half of the md5 of the string.""" hex128 = md5.new(str).hexdigest() int64 = long(hex128[:16], 16) return int64 def FingerPrint(str, encoding='utf-8'): fp = UnsignedFingerPrint(str, encoding=encoding) # interpret fingerprint as signed longs if fp & 0x8000000000000000L: fp = - ((~fp & 0xFFFFFFFFFFFFFFFFL) + 1) return fp
0056d2e4667810af45a820e6b8893c49e2f1cf49
salt/utils/verify.py
salt/utils/verify.py
''' A few checks to make sure the environment is sane ''' # Original Author: Jeff Schroeder <jeffschroeder@computer.org> import logging log = logging.getLogger(__name__) __all__ = ('zmq_version', 'run') def zmq_version(): '''ZeroMQ python bindings >= 2.1.9 are required''' import zmq ver = zmq.__version__ ver_int = int(ver.replace('.', '')) if not ver_int >= 219: log.critical("ZeroMQ python bindings >= 2.1.9 are required") return False return True def check_root(): ''' Most of the salt scripts need to run as root, this function will simply verify that root is the user before the application discovers it. ''' if os.getuid(): print ('Sorry, the salt must run as root, it needs to operate ' 'in a privileged environment to do what it does.\n' 'http://xkcd.com/838/') sys.exit(1) def run(): for func in __all__: if func == "run": continue if not locals().get(func)(): sys.exit(1)
''' A few checks to make sure the environment is sane ''' # Original Author: Jeff Schroeder <jeffschroeder@computer.org> import logging log = logging.getLogger(__name__) __all__ = ('zmq_version', 'check_root', 'run') def zmq_version(): '''ZeroMQ python bindings >= 2.1.9 are required''' import zmq ver = zmq.__version__ ver_int = int(ver.replace('.', '')) if not ver_int >= 219: log.critical("ZeroMQ python bindings >= 2.1.9 are required") return False return True def check_root(): ''' Most of the salt scripts need to run as root, this function will simply verify that root is the user before the application discovers it. ''' if os.getuid(): log.critical('Sorry, the salt must run as root. It needs to operate in a privileged environment to do what it does. http://xkcd.com/838/') return False return True def run(): for func in __all__: if func == "run": continue if not locals().get(func)(): sys.exit(1)
Make check_root use proper logging and exit cleanly
Make check_root use proper logging and exit cleanly
Python
apache-2.0
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
''' A few checks to make sure the environment is sane ''' # Original Author: Jeff Schroeder <jeffschroeder@computer.org> import logging log = logging.getLogger(__name__) __all__ = ('zmq_version', 'run') def zmq_version(): '''ZeroMQ python bindings >= 2.1.9 are required''' import zmq ver = zmq.__version__ ver_int = int(ver.replace('.', '')) if not ver_int >= 219: log.critical("ZeroMQ python bindings >= 2.1.9 are required") return False return True def check_root(): ''' Most of the salt scripts need to run as root, this function will simply verify that root is the user before the application discovers it. ''' if os.getuid(): print ('Sorry, the salt must run as root, it needs to operate ' 'in a privileged environment to do what it does.\n' 'http://xkcd.com/838/') sys.exit(1) def run(): for func in __all__: if func == "run": continue if not locals().get(func)(): sys.exit(1) Make check_root use proper logging and exit cleanly
''' A few checks to make sure the environment is sane ''' # Original Author: Jeff Schroeder <jeffschroeder@computer.org> import logging log = logging.getLogger(__name__) __all__ = ('zmq_version', 'check_root', 'run') def zmq_version(): '''ZeroMQ python bindings >= 2.1.9 are required''' import zmq ver = zmq.__version__ ver_int = int(ver.replace('.', '')) if not ver_int >= 219: log.critical("ZeroMQ python bindings >= 2.1.9 are required") return False return True def check_root(): ''' Most of the salt scripts need to run as root, this function will simply verify that root is the user before the application discovers it. ''' if os.getuid(): log.critical('Sorry, the salt must run as root. It needs to operate in a privileged environment to do what it does. http://xkcd.com/838/') return False return True def run(): for func in __all__: if func == "run": continue if not locals().get(func)(): sys.exit(1)
<commit_before>''' A few checks to make sure the environment is sane ''' # Original Author: Jeff Schroeder <jeffschroeder@computer.org> import logging log = logging.getLogger(__name__) __all__ = ('zmq_version', 'run') def zmq_version(): '''ZeroMQ python bindings >= 2.1.9 are required''' import zmq ver = zmq.__version__ ver_int = int(ver.replace('.', '')) if not ver_int >= 219: log.critical("ZeroMQ python bindings >= 2.1.9 are required") return False return True def check_root(): ''' Most of the salt scripts need to run as root, this function will simply verify that root is the user before the application discovers it. ''' if os.getuid(): print ('Sorry, the salt must run as root, it needs to operate ' 'in a privileged environment to do what it does.\n' 'http://xkcd.com/838/') sys.exit(1) def run(): for func in __all__: if func == "run": continue if not locals().get(func)(): sys.exit(1) <commit_msg>Make check_root use proper logging and exit cleanly<commit_after>
''' A few checks to make sure the environment is sane ''' # Original Author: Jeff Schroeder <jeffschroeder@computer.org> import logging log = logging.getLogger(__name__) __all__ = ('zmq_version', 'check_root', 'run') def zmq_version(): '''ZeroMQ python bindings >= 2.1.9 are required''' import zmq ver = zmq.__version__ ver_int = int(ver.replace('.', '')) if not ver_int >= 219: log.critical("ZeroMQ python bindings >= 2.1.9 are required") return False return True def check_root(): ''' Most of the salt scripts need to run as root, this function will simply verify that root is the user before the application discovers it. ''' if os.getuid(): log.critical('Sorry, the salt must run as root. It needs to operate in a privileged environment to do what it does. http://xkcd.com/838/') return False return True def run(): for func in __all__: if func == "run": continue if not locals().get(func)(): sys.exit(1)
''' A few checks to make sure the environment is sane ''' # Original Author: Jeff Schroeder <jeffschroeder@computer.org> import logging log = logging.getLogger(__name__) __all__ = ('zmq_version', 'run') def zmq_version(): '''ZeroMQ python bindings >= 2.1.9 are required''' import zmq ver = zmq.__version__ ver_int = int(ver.replace('.', '')) if not ver_int >= 219: log.critical("ZeroMQ python bindings >= 2.1.9 are required") return False return True def check_root(): ''' Most of the salt scripts need to run as root, this function will simply verify that root is the user before the application discovers it. ''' if os.getuid(): print ('Sorry, the salt must run as root, it needs to operate ' 'in a privileged environment to do what it does.\n' 'http://xkcd.com/838/') sys.exit(1) def run(): for func in __all__: if func == "run": continue if not locals().get(func)(): sys.exit(1) Make check_root use proper logging and exit cleanly''' A few checks to make sure the environment is sane ''' # Original Author: Jeff Schroeder <jeffschroeder@computer.org> import logging log = logging.getLogger(__name__) __all__ = ('zmq_version', 'check_root', 'run') def zmq_version(): '''ZeroMQ python bindings >= 2.1.9 are required''' import zmq ver = zmq.__version__ ver_int = int(ver.replace('.', '')) if not ver_int >= 219: log.critical("ZeroMQ python bindings >= 2.1.9 are required") return False return True def check_root(): ''' Most of the salt scripts need to run as root, this function will simply verify that root is the user before the application discovers it. ''' if os.getuid(): log.critical('Sorry, the salt must run as root. It needs to operate in a privileged environment to do what it does. http://xkcd.com/838/') return False return True def run(): for func in __all__: if func == "run": continue if not locals().get(func)(): sys.exit(1)
<commit_before>''' A few checks to make sure the environment is sane ''' # Original Author: Jeff Schroeder <jeffschroeder@computer.org> import logging log = logging.getLogger(__name__) __all__ = ('zmq_version', 'run') def zmq_version(): '''ZeroMQ python bindings >= 2.1.9 are required''' import zmq ver = zmq.__version__ ver_int = int(ver.replace('.', '')) if not ver_int >= 219: log.critical("ZeroMQ python bindings >= 2.1.9 are required") return False return True def check_root(): ''' Most of the salt scripts need to run as root, this function will simply verify that root is the user before the application discovers it. ''' if os.getuid(): print ('Sorry, the salt must run as root, it needs to operate ' 'in a privileged environment to do what it does.\n' 'http://xkcd.com/838/') sys.exit(1) def run(): for func in __all__: if func == "run": continue if not locals().get(func)(): sys.exit(1) <commit_msg>Make check_root use proper logging and exit cleanly<commit_after>''' A few checks to make sure the environment is sane ''' # Original Author: Jeff Schroeder <jeffschroeder@computer.org> import logging log = logging.getLogger(__name__) __all__ = ('zmq_version', 'check_root', 'run') def zmq_version(): '''ZeroMQ python bindings >= 2.1.9 are required''' import zmq ver = zmq.__version__ ver_int = int(ver.replace('.', '')) if not ver_int >= 219: log.critical("ZeroMQ python bindings >= 2.1.9 are required") return False return True def check_root(): ''' Most of the salt scripts need to run as root, this function will simply verify that root is the user before the application discovers it. ''' if os.getuid(): log.critical('Sorry, the salt must run as root. It needs to operate in a privileged environment to do what it does. http://xkcd.com/838/') return False return True def run(): for func in __all__: if func == "run": continue if not locals().get(func)(): sys.exit(1)
476c97edf8489be59d5e96ce36aa9214ae4ca00c
run_tracker.py
run_tracker.py
import sys, json from cloudtracker import main as tracker_main def run_tracker(input): print( " Running the cloud-tracking algorithm... " ) print( " Input dir: \"" + input + "\" \n" ) # Read .json configuration file with open('model_config.json', 'r') as json_file: config = json.load(json_file) tracker_main.main(input, config) print( "\n Entrainment analysis completed " ) if __name__ == '__main__': if len(sys.argv) == 1: run_tracker("./data/") elif len(sys.argv) == 2: run_tracker(sys.argv[1]) else: print( " Invalid input " )
import sys, json from cloudtracker.main import main from cloudtracker.load_config import config from cloudtracker.load_config import c def run_tracker(): print( " Running the cloud-tracking algorithm... " ) # Print out model parameters from config.json print( " \n Model parameters: " ) print( " \t Case name: {}".format(config.case_name) ) print( " \t Model Domain {}x{}x{}".format(c.nx, c.ny, c.nz) ) print( " \t {} model time steps \n".format(c.nt) ) main() print( "\n Entrainment analysis completed " ) if __name__ == '__main__': run_tracker()
Read model parameters and output at the beginning
Read model parameters and output at the beginning
Python
bsd-2-clause
lorenghoh/loh_tracker
import sys, json from cloudtracker import main as tracker_main def run_tracker(input): print( " Running the cloud-tracking algorithm... " ) print( " Input dir: \"" + input + "\" \n" ) # Read .json configuration file with open('model_config.json', 'r') as json_file: config = json.load(json_file) tracker_main.main(input, config) print( "\n Entrainment analysis completed " ) if __name__ == '__main__': if len(sys.argv) == 1: run_tracker("./data/") elif len(sys.argv) == 2: run_tracker(sys.argv[1]) else: print( " Invalid input " ) Read model parameters and output at the beginning
import sys, json from cloudtracker.main import main from cloudtracker.load_config import config from cloudtracker.load_config import c def run_tracker(): print( " Running the cloud-tracking algorithm... " ) # Print out model parameters from config.json print( " \n Model parameters: " ) print( " \t Case name: {}".format(config.case_name) ) print( " \t Model Domain {}x{}x{}".format(c.nx, c.ny, c.nz) ) print( " \t {} model time steps \n".format(c.nt) ) main() print( "\n Entrainment analysis completed " ) if __name__ == '__main__': run_tracker()
<commit_before>import sys, json from cloudtracker import main as tracker_main def run_tracker(input): print( " Running the cloud-tracking algorithm... " ) print( " Input dir: \"" + input + "\" \n" ) # Read .json configuration file with open('model_config.json', 'r') as json_file: config = json.load(json_file) tracker_main.main(input, config) print( "\n Entrainment analysis completed " ) if __name__ == '__main__': if len(sys.argv) == 1: run_tracker("./data/") elif len(sys.argv) == 2: run_tracker(sys.argv[1]) else: print( " Invalid input " ) <commit_msg>Read model parameters and output at the beginning<commit_after>
import sys, json from cloudtracker.main import main from cloudtracker.load_config import config from cloudtracker.load_config import c def run_tracker(): print( " Running the cloud-tracking algorithm... " ) # Print out model parameters from config.json print( " \n Model parameters: " ) print( " \t Case name: {}".format(config.case_name) ) print( " \t Model Domain {}x{}x{}".format(c.nx, c.ny, c.nz) ) print( " \t {} model time steps \n".format(c.nt) ) main() print( "\n Entrainment analysis completed " ) if __name__ == '__main__': run_tracker()
import sys, json from cloudtracker import main as tracker_main def run_tracker(input): print( " Running the cloud-tracking algorithm... " ) print( " Input dir: \"" + input + "\" \n" ) # Read .json configuration file with open('model_config.json', 'r') as json_file: config = json.load(json_file) tracker_main.main(input, config) print( "\n Entrainment analysis completed " ) if __name__ == '__main__': if len(sys.argv) == 1: run_tracker("./data/") elif len(sys.argv) == 2: run_tracker(sys.argv[1]) else: print( " Invalid input " ) Read model parameters and output at the beginningimport sys, json from cloudtracker.main import main from cloudtracker.load_config import config from cloudtracker.load_config import c def run_tracker(): print( " Running the cloud-tracking algorithm... " ) # Print out model parameters from config.json print( " \n Model parameters: " ) print( " \t Case name: {}".format(config.case_name) ) print( " \t Model Domain {}x{}x{}".format(c.nx, c.ny, c.nz) ) print( " \t {} model time steps \n".format(c.nt) ) main() print( "\n Entrainment analysis completed " ) if __name__ == '__main__': run_tracker()
<commit_before>import sys, json from cloudtracker import main as tracker_main def run_tracker(input): print( " Running the cloud-tracking algorithm... " ) print( " Input dir: \"" + input + "\" \n" ) # Read .json configuration file with open('model_config.json', 'r') as json_file: config = json.load(json_file) tracker_main.main(input, config) print( "\n Entrainment analysis completed " ) if __name__ == '__main__': if len(sys.argv) == 1: run_tracker("./data/") elif len(sys.argv) == 2: run_tracker(sys.argv[1]) else: print( " Invalid input " ) <commit_msg>Read model parameters and output at the beginning<commit_after>import sys, json from cloudtracker.main import main from cloudtracker.load_config import config from cloudtracker.load_config import c def run_tracker(): print( " Running the cloud-tracking algorithm... " ) # Print out model parameters from config.json print( " \n Model parameters: " ) print( " \t Case name: {}".format(config.case_name) ) print( " \t Model Domain {}x{}x{}".format(c.nx, c.ny, c.nz) ) print( " \t {} model time steps \n".format(c.nt) ) main() print( "\n Entrainment analysis completed " ) if __name__ == '__main__': run_tracker()
f312b856046cb46255971bcd30b8c418d7040455
__openerp__.py
__openerp__.py
# -*- coding: utf-8 -*- { 'name': 'Human Employee Streamline', 'version': '1.2', 'author': 'XCG Consulting', 'category': 'Human Resources', 'description': """ enchancements to the hr module to streamline its usage """, 'website': 'http://www.openerp-experts.com', 'depends': [ 'base', 'hr', ], 'data': [ 'security/ir.model.access.csv', 'security/record_rules.xml', 'admin_doc.xml', 'hr_employee.xml', ], 'test': [ ], 'installable': True, }
# -*- coding: utf-8 -*- { 'name': 'Human Employee Streamline', 'version': '1.2', 'author': 'XCG Consulting', 'category': 'Human Resources', 'description': """ enchancements to the hr module to streamline its usage """, 'website': 'http://www.openerp-experts.com', 'depends': [ 'base', 'hr', 'hr_contract', ], 'data': [ 'security/ir.model.access.csv', 'security/record_rules.xml', 'admin_doc.xml', 'hr_employee.xml', ], 'test': [ ], 'installable': True, }
Add dependencies on hr_contract as it should have been done
Add dependencies on hr_contract as it should have been done
Python
agpl-3.0
xcgd/hr_streamline
# -*- coding: utf-8 -*- { 'name': 'Human Employee Streamline', 'version': '1.2', 'author': 'XCG Consulting', 'category': 'Human Resources', 'description': """ enchancements to the hr module to streamline its usage """, 'website': 'http://www.openerp-experts.com', 'depends': [ 'base', 'hr', ], 'data': [ 'security/ir.model.access.csv', 'security/record_rules.xml', 'admin_doc.xml', 'hr_employee.xml', ], 'test': [ ], 'installable': True, } Add dependencies on hr_contract as it should have been done
# -*- coding: utf-8 -*- { 'name': 'Human Employee Streamline', 'version': '1.2', 'author': 'XCG Consulting', 'category': 'Human Resources', 'description': """ enchancements to the hr module to streamline its usage """, 'website': 'http://www.openerp-experts.com', 'depends': [ 'base', 'hr', 'hr_contract', ], 'data': [ 'security/ir.model.access.csv', 'security/record_rules.xml', 'admin_doc.xml', 'hr_employee.xml', ], 'test': [ ], 'installable': True, }
<commit_before># -*- coding: utf-8 -*- { 'name': 'Human Employee Streamline', 'version': '1.2', 'author': 'XCG Consulting', 'category': 'Human Resources', 'description': """ enchancements to the hr module to streamline its usage """, 'website': 'http://www.openerp-experts.com', 'depends': [ 'base', 'hr', ], 'data': [ 'security/ir.model.access.csv', 'security/record_rules.xml', 'admin_doc.xml', 'hr_employee.xml', ], 'test': [ ], 'installable': True, } <commit_msg>Add dependencies on hr_contract as it should have been done<commit_after>
# -*- coding: utf-8 -*- { 'name': 'Human Employee Streamline', 'version': '1.2', 'author': 'XCG Consulting', 'category': 'Human Resources', 'description': """ enchancements to the hr module to streamline its usage """, 'website': 'http://www.openerp-experts.com', 'depends': [ 'base', 'hr', 'hr_contract', ], 'data': [ 'security/ir.model.access.csv', 'security/record_rules.xml', 'admin_doc.xml', 'hr_employee.xml', ], 'test': [ ], 'installable': True, }
# -*- coding: utf-8 -*- { 'name': 'Human Employee Streamline', 'version': '1.2', 'author': 'XCG Consulting', 'category': 'Human Resources', 'description': """ enchancements to the hr module to streamline its usage """, 'website': 'http://www.openerp-experts.com', 'depends': [ 'base', 'hr', ], 'data': [ 'security/ir.model.access.csv', 'security/record_rules.xml', 'admin_doc.xml', 'hr_employee.xml', ], 'test': [ ], 'installable': True, } Add dependencies on hr_contract as it should have been done# -*- coding: utf-8 -*- { 'name': 'Human Employee Streamline', 'version': '1.2', 'author': 'XCG Consulting', 'category': 'Human Resources', 'description': """ enchancements to the hr module to streamline its usage """, 'website': 'http://www.openerp-experts.com', 'depends': [ 'base', 'hr', 'hr_contract', ], 'data': [ 'security/ir.model.access.csv', 'security/record_rules.xml', 'admin_doc.xml', 'hr_employee.xml', ], 'test': [ ], 'installable': True, }
<commit_before># -*- coding: utf-8 -*- { 'name': 'Human Employee Streamline', 'version': '1.2', 'author': 'XCG Consulting', 'category': 'Human Resources', 'description': """ enchancements to the hr module to streamline its usage """, 'website': 'http://www.openerp-experts.com', 'depends': [ 'base', 'hr', ], 'data': [ 'security/ir.model.access.csv', 'security/record_rules.xml', 'admin_doc.xml', 'hr_employee.xml', ], 'test': [ ], 'installable': True, } <commit_msg>Add dependencies on hr_contract as it should have been done<commit_after># -*- coding: utf-8 -*- { 'name': 'Human Employee Streamline', 'version': '1.2', 'author': 'XCG Consulting', 'category': 'Human Resources', 'description': """ enchancements to the hr module to streamline its usage """, 'website': 'http://www.openerp-experts.com', 'depends': [ 'base', 'hr', 'hr_contract', ], 'data': [ 'security/ir.model.access.csv', 'security/record_rules.xml', 'admin_doc.xml', 'hr_employee.xml', ], 'test': [ ], 'installable': True, }
206c687570233c4d71063f1c688c25bbbd9847ab
tests/test_system.py
tests/test_system.py
import datetime from decimal import Decimal from mock import Mock import ubersmith.order # TODO: setup/teardown module with default request handler # TODO: mock out requests library vs mocking out request handler def test_order_list(): handler = Mock() response = { "60": { "client_id": "50", "activity": "1272400333", "ts": "1272400333", "total": "33.22", "order_id": "60", }, } handler.process_request.return_value = response expected = { 60: { u'client_id': 50, u'activity': datetime.datetime.fromtimestamp(float("1272400333")), u'ts': datetime.datetime.fromtimestamp(float("1272400333")), u'total': Decimal('33.22'), u'order_id': 60, } } result = ubersmith.order.list(client_id=50, request_handler=handler) assert expected == result
import datetime from decimal import Decimal import json from mock import Mock import ubersmith import ubersmith.api import ubersmith.order def setup_module(): ubersmith.init(**{ 'base_url': '', 'username': '', 'password': '', }) def teardown_module(): ubersmith.api._DEFAULT_REQUEST_HANDLER = None def test_order_list(monkeypatch): requests = Mock() monkeypatch.setattr(ubersmith.api, 'requests', requests) response = Mock() response.headers = { 'content-type': 'application/json', } response.text = json.dumps({ "status": True, "error_code": None, "error_message": "", "data": { "60": { "client_id": "50", "activity": "1272400333", "ts": "1272400333", "total": "33.22", "order_id": "60", }, }, }) requests.post.return_value = response expected = { 60: { u'client_id': 50, u'activity': datetime.datetime.fromtimestamp(float("1272400333")), u'ts': datetime.datetime.fromtimestamp(float("1272400333")), u'total': Decimal('33.22'), u'order_id': 60, } } result = ubersmith.order.list(client_id=50) assert expected == result
Refactor system tests to mock out requests library vs mocking out request handler.
Refactor system tests to mock out requests library vs mocking out request handler.
Python
mit
jasonkeene/python-ubersmith,hivelocity/python-ubersmith,jasonkeene/python-ubersmith,hivelocity/python-ubersmith
import datetime from decimal import Decimal from mock import Mock import ubersmith.order # TODO: setup/teardown module with default request handler # TODO: mock out requests library vs mocking out request handler def test_order_list(): handler = Mock() response = { "60": { "client_id": "50", "activity": "1272400333", "ts": "1272400333", "total": "33.22", "order_id": "60", }, } handler.process_request.return_value = response expected = { 60: { u'client_id': 50, u'activity': datetime.datetime.fromtimestamp(float("1272400333")), u'ts': datetime.datetime.fromtimestamp(float("1272400333")), u'total': Decimal('33.22'), u'order_id': 60, } } result = ubersmith.order.list(client_id=50, request_handler=handler) assert expected == result Refactor system tests to mock out requests library vs mocking out request handler.
import datetime from decimal import Decimal import json from mock import Mock import ubersmith import ubersmith.api import ubersmith.order def setup_module(): ubersmith.init(**{ 'base_url': '', 'username': '', 'password': '', }) def teardown_module(): ubersmith.api._DEFAULT_REQUEST_HANDLER = None def test_order_list(monkeypatch): requests = Mock() monkeypatch.setattr(ubersmith.api, 'requests', requests) response = Mock() response.headers = { 'content-type': 'application/json', } response.text = json.dumps({ "status": True, "error_code": None, "error_message": "", "data": { "60": { "client_id": "50", "activity": "1272400333", "ts": "1272400333", "total": "33.22", "order_id": "60", }, }, }) requests.post.return_value = response expected = { 60: { u'client_id': 50, u'activity': datetime.datetime.fromtimestamp(float("1272400333")), u'ts': datetime.datetime.fromtimestamp(float("1272400333")), u'total': Decimal('33.22'), u'order_id': 60, } } result = ubersmith.order.list(client_id=50) assert expected == result
<commit_before>import datetime from decimal import Decimal from mock import Mock import ubersmith.order # TODO: setup/teardown module with default request handler # TODO: mock out requests library vs mocking out request handler def test_order_list(): handler = Mock() response = { "60": { "client_id": "50", "activity": "1272400333", "ts": "1272400333", "total": "33.22", "order_id": "60", }, } handler.process_request.return_value = response expected = { 60: { u'client_id': 50, u'activity': datetime.datetime.fromtimestamp(float("1272400333")), u'ts': datetime.datetime.fromtimestamp(float("1272400333")), u'total': Decimal('33.22'), u'order_id': 60, } } result = ubersmith.order.list(client_id=50, request_handler=handler) assert expected == result <commit_msg>Refactor system tests to mock out requests library vs mocking out request handler.<commit_after>
import datetime from decimal import Decimal import json from mock import Mock import ubersmith import ubersmith.api import ubersmith.order def setup_module(): ubersmith.init(**{ 'base_url': '', 'username': '', 'password': '', }) def teardown_module(): ubersmith.api._DEFAULT_REQUEST_HANDLER = None def test_order_list(monkeypatch): requests = Mock() monkeypatch.setattr(ubersmith.api, 'requests', requests) response = Mock() response.headers = { 'content-type': 'application/json', } response.text = json.dumps({ "status": True, "error_code": None, "error_message": "", "data": { "60": { "client_id": "50", "activity": "1272400333", "ts": "1272400333", "total": "33.22", "order_id": "60", }, }, }) requests.post.return_value = response expected = { 60: { u'client_id': 50, u'activity': datetime.datetime.fromtimestamp(float("1272400333")), u'ts': datetime.datetime.fromtimestamp(float("1272400333")), u'total': Decimal('33.22'), u'order_id': 60, } } result = ubersmith.order.list(client_id=50) assert expected == result
import datetime from decimal import Decimal from mock import Mock import ubersmith.order # TODO: setup/teardown module with default request handler # TODO: mock out requests library vs mocking out request handler def test_order_list(): handler = Mock() response = { "60": { "client_id": "50", "activity": "1272400333", "ts": "1272400333", "total": "33.22", "order_id": "60", }, } handler.process_request.return_value = response expected = { 60: { u'client_id': 50, u'activity': datetime.datetime.fromtimestamp(float("1272400333")), u'ts': datetime.datetime.fromtimestamp(float("1272400333")), u'total': Decimal('33.22'), u'order_id': 60, } } result = ubersmith.order.list(client_id=50, request_handler=handler) assert expected == result Refactor system tests to mock out requests library vs mocking out request handler.import datetime from decimal import Decimal import json from mock import Mock import ubersmith import ubersmith.api import ubersmith.order def setup_module(): ubersmith.init(**{ 'base_url': '', 'username': '', 'password': '', }) def teardown_module(): ubersmith.api._DEFAULT_REQUEST_HANDLER = None def test_order_list(monkeypatch): requests = Mock() monkeypatch.setattr(ubersmith.api, 'requests', requests) response = Mock() response.headers = { 'content-type': 'application/json', } response.text = json.dumps({ "status": True, "error_code": None, "error_message": "", "data": { "60": { "client_id": "50", "activity": "1272400333", "ts": "1272400333", "total": "33.22", "order_id": "60", }, }, }) requests.post.return_value = response expected = { 60: { u'client_id': 50, u'activity': datetime.datetime.fromtimestamp(float("1272400333")), u'ts': datetime.datetime.fromtimestamp(float("1272400333")), u'total': Decimal('33.22'), u'order_id': 60, } } result = ubersmith.order.list(client_id=50) assert expected == result
<commit_before>import datetime from decimal import Decimal from mock import Mock import ubersmith.order # TODO: setup/teardown module with default request handler # TODO: mock out requests library vs mocking out request handler def test_order_list(): handler = Mock() response = { "60": { "client_id": "50", "activity": "1272400333", "ts": "1272400333", "total": "33.22", "order_id": "60", }, } handler.process_request.return_value = response expected = { 60: { u'client_id': 50, u'activity': datetime.datetime.fromtimestamp(float("1272400333")), u'ts': datetime.datetime.fromtimestamp(float("1272400333")), u'total': Decimal('33.22'), u'order_id': 60, } } result = ubersmith.order.list(client_id=50, request_handler=handler) assert expected == result <commit_msg>Refactor system tests to mock out requests library vs mocking out request handler.<commit_after>import datetime from decimal import Decimal import json from mock import Mock import ubersmith import ubersmith.api import ubersmith.order def setup_module(): ubersmith.init(**{ 'base_url': '', 'username': '', 'password': '', }) def teardown_module(): ubersmith.api._DEFAULT_REQUEST_HANDLER = None def test_order_list(monkeypatch): requests = Mock() monkeypatch.setattr(ubersmith.api, 'requests', requests) response = Mock() response.headers = { 'content-type': 'application/json', } response.text = json.dumps({ "status": True, "error_code": None, "error_message": "", "data": { "60": { "client_id": "50", "activity": "1272400333", "ts": "1272400333", "total": "33.22", "order_id": "60", }, }, }) requests.post.return_value = response expected = { 60: { u'client_id': 50, u'activity': datetime.datetime.fromtimestamp(float("1272400333")), u'ts': datetime.datetime.fromtimestamp(float("1272400333")), u'total': Decimal('33.22'), u'order_id': 60, } } result = ubersmith.order.list(client_id=50) assert expected == result
238d03c83431c60011d1aad1759acefc9d5c218e
index.py
index.py
# the lolbot core # (c) 2017 S Stewart under MIT License # -*- coding: utf-8 -*- # obviously, logging import json import logging import time import subprocess import aiohttp import discord from discord.ext import commands logging.basicConfig(format='[%(levelname)s] - %(message)s', level=logging.INFO) try: config = json.load(open('config.json')) except: logging.debug('Something happened...') description = '''Just a bot :)''' exts = ['donate', 'fun', 'owner', 'stats', 'utility'] bot = commands.AutoShardedBot(command_prefix='^', description=description) @bot.event async def on_ready(): logging.info('lolbot - ready') await bot.change_presence(game=discord.Game(name='^help | v6.2')) logging.info('Playing status changed') if __name__ == '__main__': for ext in exts: try: bot.load_extension(f'cogs.{ext}') except Exception: logging.error(f'Error while loading {ext}', exc_info=True) bot.run(config['token'])
# the lolbot core # (c) 2017 S Stewart under MIT License # -*- coding: utf-8 -*- # built in modules go first. import json import logging import time # import the rest import aiohttp import discord from discord.ext import commands logging.basicConfig(format='[%(levelname)s] - %(message)s', level=logging.INFO) try: config = json.load(open('config.json')) except: logging.debug('Something happened...') description = '''Just a bot :)''' exts = ['donate', 'fun', 'owner', 'stats', 'utility'] bot = commands.AutoShardedBot(command_prefix='^', description=description) @bot.event async def on_ready(): logging.info('lolbot - ready') await bot.change_presence(game=discord.Game(name='^help | v6.2')) logging.info('Playing status changed') if __name__ == '__main__': for ext in exts: try: bot.load_extension(f'cogs.{ext}') except Exception: logging.error(f'Error while loading {ext}', exc_info=True) bot.run(config['token'])
Merge manually, because vim exec is retarded
[merge] Merge manually, because vim exec is retarded
Python
mit
tilda/lolbot,xshotD/lolbot,xshotD/lolbot,tilda/lolbot,tilda/lolbot,xshotD/lolbot
# the lolbot core # (c) 2017 S Stewart under MIT License # -*- coding: utf-8 -*- # obviously, logging import json import logging import time import subprocess import aiohttp import discord from discord.ext import commands logging.basicConfig(format='[%(levelname)s] - %(message)s', level=logging.INFO) try: config = json.load(open('config.json')) except: logging.debug('Something happened...') description = '''Just a bot :)''' exts = ['donate', 'fun', 'owner', 'stats', 'utility'] bot = commands.AutoShardedBot(command_prefix='^', description=description) @bot.event async def on_ready(): logging.info('lolbot - ready') await bot.change_presence(game=discord.Game(name='^help | v6.2')) logging.info('Playing status changed') if __name__ == '__main__': for ext in exts: try: bot.load_extension(f'cogs.{ext}') except Exception: logging.error(f'Error while loading {ext}', exc_info=True) bot.run(config['token']) [merge] Merge manually, because vim exec is retarded
# the lolbot core # (c) 2017 S Stewart under MIT License # -*- coding: utf-8 -*- # built in modules go first. import json import logging import time # import the rest import aiohttp import discord from discord.ext import commands logging.basicConfig(format='[%(levelname)s] - %(message)s', level=logging.INFO) try: config = json.load(open('config.json')) except: logging.debug('Something happened...') description = '''Just a bot :)''' exts = ['donate', 'fun', 'owner', 'stats', 'utility'] bot = commands.AutoShardedBot(command_prefix='^', description=description) @bot.event async def on_ready(): logging.info('lolbot - ready') await bot.change_presence(game=discord.Game(name='^help | v6.2')) logging.info('Playing status changed') if __name__ == '__main__': for ext in exts: try: bot.load_extension(f'cogs.{ext}') except Exception: logging.error(f'Error while loading {ext}', exc_info=True) bot.run(config['token'])
<commit_before># the lolbot core # (c) 2017 S Stewart under MIT License # -*- coding: utf-8 -*- # obviously, logging import json import logging import time import subprocess import aiohttp import discord from discord.ext import commands logging.basicConfig(format='[%(levelname)s] - %(message)s', level=logging.INFO) try: config = json.load(open('config.json')) except: logging.debug('Something happened...') description = '''Just a bot :)''' exts = ['donate', 'fun', 'owner', 'stats', 'utility'] bot = commands.AutoShardedBot(command_prefix='^', description=description) @bot.event async def on_ready(): logging.info('lolbot - ready') await bot.change_presence(game=discord.Game(name='^help | v6.2')) logging.info('Playing status changed') if __name__ == '__main__': for ext in exts: try: bot.load_extension(f'cogs.{ext}') except Exception: logging.error(f'Error while loading {ext}', exc_info=True) bot.run(config['token']) <commit_msg>[merge] Merge manually, because vim exec is retarded<commit_after>
# the lolbot core # (c) 2017 S Stewart under MIT License # -*- coding: utf-8 -*- # built in modules go first. import json import logging import time # import the rest import aiohttp import discord from discord.ext import commands logging.basicConfig(format='[%(levelname)s] - %(message)s', level=logging.INFO) try: config = json.load(open('config.json')) except: logging.debug('Something happened...') description = '''Just a bot :)''' exts = ['donate', 'fun', 'owner', 'stats', 'utility'] bot = commands.AutoShardedBot(command_prefix='^', description=description) @bot.event async def on_ready(): logging.info('lolbot - ready') await bot.change_presence(game=discord.Game(name='^help | v6.2')) logging.info('Playing status changed') if __name__ == '__main__': for ext in exts: try: bot.load_extension(f'cogs.{ext}') except Exception: logging.error(f'Error while loading {ext}', exc_info=True) bot.run(config['token'])
# the lolbot core # (c) 2017 S Stewart under MIT License # -*- coding: utf-8 -*- # obviously, logging import json import logging import time import subprocess import aiohttp import discord from discord.ext import commands logging.basicConfig(format='[%(levelname)s] - %(message)s', level=logging.INFO) try: config = json.load(open('config.json')) except: logging.debug('Something happened...') description = '''Just a bot :)''' exts = ['donate', 'fun', 'owner', 'stats', 'utility'] bot = commands.AutoShardedBot(command_prefix='^', description=description) @bot.event async def on_ready(): logging.info('lolbot - ready') await bot.change_presence(game=discord.Game(name='^help | v6.2')) logging.info('Playing status changed') if __name__ == '__main__': for ext in exts: try: bot.load_extension(f'cogs.{ext}') except Exception: logging.error(f'Error while loading {ext}', exc_info=True) bot.run(config['token']) [merge] Merge manually, because vim exec is retarded# the lolbot core # (c) 2017 S Stewart under MIT License # -*- coding: utf-8 -*- # built in modules go first. import json import logging import time # import the rest import aiohttp import discord from discord.ext import commands logging.basicConfig(format='[%(levelname)s] - %(message)s', level=logging.INFO) try: config = json.load(open('config.json')) except: logging.debug('Something happened...') description = '''Just a bot :)''' exts = ['donate', 'fun', 'owner', 'stats', 'utility'] bot = commands.AutoShardedBot(command_prefix='^', description=description) @bot.event async def on_ready(): logging.info('lolbot - ready') await bot.change_presence(game=discord.Game(name='^help | v6.2')) logging.info('Playing status changed') if __name__ == '__main__': for ext in exts: try: bot.load_extension(f'cogs.{ext}') except Exception: logging.error(f'Error while loading {ext}', exc_info=True) bot.run(config['token'])
<commit_before># the lolbot core # (c) 2017 S Stewart under MIT License # -*- coding: utf-8 -*- # obviously, logging import json import logging import time import subprocess import aiohttp import discord from discord.ext import commands logging.basicConfig(format='[%(levelname)s] - %(message)s', level=logging.INFO) try: config = json.load(open('config.json')) except: logging.debug('Something happened...') description = '''Just a bot :)''' exts = ['donate', 'fun', 'owner', 'stats', 'utility'] bot = commands.AutoShardedBot(command_prefix='^', description=description) @bot.event async def on_ready(): logging.info('lolbot - ready') await bot.change_presence(game=discord.Game(name='^help | v6.2')) logging.info('Playing status changed') if __name__ == '__main__': for ext in exts: try: bot.load_extension(f'cogs.{ext}') except Exception: logging.error(f'Error while loading {ext}', exc_info=True) bot.run(config['token']) <commit_msg>[merge] Merge manually, because vim exec is retarded<commit_after># the lolbot core # (c) 2017 S Stewart under MIT License # -*- coding: utf-8 -*- # built in modules go first. import json import logging import time # import the rest import aiohttp import discord from discord.ext import commands logging.basicConfig(format='[%(levelname)s] - %(message)s', level=logging.INFO) try: config = json.load(open('config.json')) except: logging.debug('Something happened...') description = '''Just a bot :)''' exts = ['donate', 'fun', 'owner', 'stats', 'utility'] bot = commands.AutoShardedBot(command_prefix='^', description=description) @bot.event async def on_ready(): logging.info('lolbot - ready') await bot.change_presence(game=discord.Game(name='^help | v6.2')) logging.info('Playing status changed') if __name__ == '__main__': for ext in exts: try: bot.load_extension(f'cogs.{ext}') except Exception: logging.error(f'Error while loading {ext}', exc_info=True) bot.run(config['token'])
adcd6637da7fd545683a6b89ad49ed22669b33dd
repeatMacro.py
repeatMacro.py
# # Sivakumar Kailasam and lowliet # import sublime, sublime_plugin class RepeatMacroCommand(sublime_plugin.TextCommand): def run(self, edit): self.view.window().show_input_panel("Repeat count or [Enter] to run till end of file", "", self.__execute, None, None) def __execute(self, text): if not text.isdigit() and len(text) > 0: print("Repeat Macro | Wrong number") elif len(text) > 0 and int(text) > (self.__get_last_line() - self.__get_current_line()): print("Repeat Macro | Number too big (bigger than number of lines in file)") else: current_line = self.__get_current_line() last_line = current_line + int(text) if len(text) > 0 else self.__get_last_line() for i in range(current_line, last_line): self.view.run_command("run_macro") def __get_current_line(self): return self.view.rowcol(self.view.sel()[0].begin())[0] + 1 def __get_last_line(self): return self.view.rowcol(self.view.size())[0] + 2
# # Sivakumar Kailasam and lowliet # import sublime, sublime_plugin class RepeatMacroCommand(sublime_plugin.TextCommand): def run(self, edit): self.view.window().show_input_panel("Repeat count or [Enter] to run till end of file", "", self.__execute, None, None) def __execute(self, text): if not text.isdigit() and len(text) > 0: print("Repeat Macro | Wrong number") # elif len(text) > 0 and int(text) > (self.__get_last_line() - self.__get_current_line()): # print("Repeat Macro | Number too big (bigger than number of lines in file)") else: current_line = self.__get_current_line() last_line = current_line + int(text) if len(text) > 0 else self.__get_last_line() for i in range(current_line, last_line): self.view.run_command("run_macro") def __get_current_line(self): return self.view.rowcol(self.view.sel()[0].begin())[0] + 1 def __get_last_line(self): return self.view.rowcol(self.view.size())[0] + 2
Fix 'Number too big' weirdness
Fix 'Number too big' weirdness
Python
mit
sivakumar-kailasam/Repeat-Macro
# # Sivakumar Kailasam and lowliet # import sublime, sublime_plugin class RepeatMacroCommand(sublime_plugin.TextCommand): def run(self, edit): self.view.window().show_input_panel("Repeat count or [Enter] to run till end of file", "", self.__execute, None, None) def __execute(self, text): if not text.isdigit() and len(text) > 0: print("Repeat Macro | Wrong number") elif len(text) > 0 and int(text) > (self.__get_last_line() - self.__get_current_line()): print("Repeat Macro | Number too big (bigger than number of lines in file)") else: current_line = self.__get_current_line() last_line = current_line + int(text) if len(text) > 0 else self.__get_last_line() for i in range(current_line, last_line): self.view.run_command("run_macro") def __get_current_line(self): return self.view.rowcol(self.view.sel()[0].begin())[0] + 1 def __get_last_line(self): return self.view.rowcol(self.view.size())[0] + 2Fix 'Number too big' weirdness
# # Sivakumar Kailasam and lowliet # import sublime, sublime_plugin class RepeatMacroCommand(sublime_plugin.TextCommand): def run(self, edit): self.view.window().show_input_panel("Repeat count or [Enter] to run till end of file", "", self.__execute, None, None) def __execute(self, text): if not text.isdigit() and len(text) > 0: print("Repeat Macro | Wrong number") # elif len(text) > 0 and int(text) > (self.__get_last_line() - self.__get_current_line()): # print("Repeat Macro | Number too big (bigger than number of lines in file)") else: current_line = self.__get_current_line() last_line = current_line + int(text) if len(text) > 0 else self.__get_last_line() for i in range(current_line, last_line): self.view.run_command("run_macro") def __get_current_line(self): return self.view.rowcol(self.view.sel()[0].begin())[0] + 1 def __get_last_line(self): return self.view.rowcol(self.view.size())[0] + 2
<commit_before># # Sivakumar Kailasam and lowliet # import sublime, sublime_plugin class RepeatMacroCommand(sublime_plugin.TextCommand): def run(self, edit): self.view.window().show_input_panel("Repeat count or [Enter] to run till end of file", "", self.__execute, None, None) def __execute(self, text): if not text.isdigit() and len(text) > 0: print("Repeat Macro | Wrong number") elif len(text) > 0 and int(text) > (self.__get_last_line() - self.__get_current_line()): print("Repeat Macro | Number too big (bigger than number of lines in file)") else: current_line = self.__get_current_line() last_line = current_line + int(text) if len(text) > 0 else self.__get_last_line() for i in range(current_line, last_line): self.view.run_command("run_macro") def __get_current_line(self): return self.view.rowcol(self.view.sel()[0].begin())[0] + 1 def __get_last_line(self): return self.view.rowcol(self.view.size())[0] + 2<commit_msg>Fix 'Number too big' weirdness<commit_after>
# # Sivakumar Kailasam and lowliet # import sublime, sublime_plugin class RepeatMacroCommand(sublime_plugin.TextCommand): def run(self, edit): self.view.window().show_input_panel("Repeat count or [Enter] to run till end of file", "", self.__execute, None, None) def __execute(self, text): if not text.isdigit() and len(text) > 0: print("Repeat Macro | Wrong number") # elif len(text) > 0 and int(text) > (self.__get_last_line() - self.__get_current_line()): # print("Repeat Macro | Number too big (bigger than number of lines in file)") else: current_line = self.__get_current_line() last_line = current_line + int(text) if len(text) > 0 else self.__get_last_line() for i in range(current_line, last_line): self.view.run_command("run_macro") def __get_current_line(self): return self.view.rowcol(self.view.sel()[0].begin())[0] + 1 def __get_last_line(self): return self.view.rowcol(self.view.size())[0] + 2
# # Sivakumar Kailasam and lowliet # import sublime, sublime_plugin class RepeatMacroCommand(sublime_plugin.TextCommand): def run(self, edit): self.view.window().show_input_panel("Repeat count or [Enter] to run till end of file", "", self.__execute, None, None) def __execute(self, text): if not text.isdigit() and len(text) > 0: print("Repeat Macro | Wrong number") elif len(text) > 0 and int(text) > (self.__get_last_line() - self.__get_current_line()): print("Repeat Macro | Number too big (bigger than number of lines in file)") else: current_line = self.__get_current_line() last_line = current_line + int(text) if len(text) > 0 else self.__get_last_line() for i in range(current_line, last_line): self.view.run_command("run_macro") def __get_current_line(self): return self.view.rowcol(self.view.sel()[0].begin())[0] + 1 def __get_last_line(self): return self.view.rowcol(self.view.size())[0] + 2Fix 'Number too big' weirdness# # Sivakumar Kailasam and lowliet # import sublime, sublime_plugin class RepeatMacroCommand(sublime_plugin.TextCommand): def run(self, edit): self.view.window().show_input_panel("Repeat count or [Enter] to run till end of file", "", self.__execute, None, None) def __execute(self, text): if not text.isdigit() and len(text) > 0: print("Repeat Macro | Wrong number") # elif len(text) > 0 and int(text) > (self.__get_last_line() - self.__get_current_line()): # print("Repeat Macro | Number too big (bigger than number of lines in file)") else: current_line = self.__get_current_line() last_line = current_line + int(text) if len(text) > 0 else self.__get_last_line() for i in range(current_line, last_line): self.view.run_command("run_macro") def __get_current_line(self): return self.view.rowcol(self.view.sel()[0].begin())[0] + 1 def __get_last_line(self): return self.view.rowcol(self.view.size())[0] + 2
<commit_before># # Sivakumar Kailasam and lowliet # import sublime, sublime_plugin class RepeatMacroCommand(sublime_plugin.TextCommand): def run(self, edit): self.view.window().show_input_panel("Repeat count or [Enter] to run till end of file", "", self.__execute, None, None) def __execute(self, text): if not text.isdigit() and len(text) > 0: print("Repeat Macro | Wrong number") elif len(text) > 0 and int(text) > (self.__get_last_line() - self.__get_current_line()): print("Repeat Macro | Number too big (bigger than number of lines in file)") else: current_line = self.__get_current_line() last_line = current_line + int(text) if len(text) > 0 else self.__get_last_line() for i in range(current_line, last_line): self.view.run_command("run_macro") def __get_current_line(self): return self.view.rowcol(self.view.sel()[0].begin())[0] + 1 def __get_last_line(self): return self.view.rowcol(self.view.size())[0] + 2<commit_msg>Fix 'Number too big' weirdness<commit_after># # Sivakumar Kailasam and lowliet # import sublime, sublime_plugin class RepeatMacroCommand(sublime_plugin.TextCommand): def run(self, edit): self.view.window().show_input_panel("Repeat count or [Enter] to run till end of file", "", self.__execute, None, None) def __execute(self, text): if not text.isdigit() and len(text) > 0: print("Repeat Macro | Wrong number") # elif len(text) > 0 and int(text) > (self.__get_last_line() - self.__get_current_line()): # print("Repeat Macro | Number too big (bigger than number of lines in file)") else: current_line = self.__get_current_line() last_line = current_line + int(text) if len(text) > 0 else self.__get_last_line() for i in range(current_line, last_line): self.view.run_command("run_macro") def __get_current_line(self): return self.view.rowcol(self.view.sel()[0].begin())[0] + 1 def __get_last_line(self): return self.view.rowcol(self.view.size())[0] + 2
254a1a0b0c438c0f913b80af16b96fc54b3a58bd
app/tests/test_fixtures.py
app/tests/test_fixtures.py
""" Test fixtures. :copyright: (c) 2017 Derek M. Frank :license: MPL-2.0 """ from flask import Flask # type: ignore def test_simple_app(app): """Verify basic application.""" assert isinstance(app, Flask) def test_simple_config(config): """Verify basic application configuration.""" assert isinstance(config, dict) def test_webdriver_current_url(webdriver): """ Verify data URL. Chrome: 'data:,' Firefox: 'about:blank' """ assert webdriver.current_url in ['data:,', 'about:blank'] def test_webdriver_valid_service(webdriver, services=('chrome', 'firefox')): """Make sure valid service is being used.""" assert webdriver.name in services def test_webdriver_get_google(webdriver): """If google is down, something bad has happened.""" webdriver.get('http://google.com/') assert 'Google' in webdriver.title def test_page_proxies_webdriver(page): """Verify webdriver proxying.""" assert page.title == page.driver.title assert page.current_url == page.driver.current_url assert page.get == page.driver.get
""" Test fixtures. :copyright: (c) 2017 Derek M. Frank :license: MPL-2.0 """ from flask import Flask # type: ignore def test_simple_app(app): """Verify basic application.""" assert isinstance(app, Flask) def test_simple_config(config): """Verify basic application configuration.""" assert isinstance(config, dict) def test_webdriver_current_url(webdriver): """ Verify data URL. Chrome: 'data:,' Firefox: 'about:blank' """ assert webdriver.name in ['chrome', 'firefox'] assert webdriver.current_url in ['data:,', 'about:blank'] def test_webdriver_get_google(webdriver): """If google is down, something bad has happened.""" webdriver.get('http://google.com/') assert 'Google' in webdriver.title def test_page_proxies_webdriver(page): """Verify webdriver proxying.""" assert page.title == page.driver.title assert page.current_url == page.driver.current_url assert page.get == page.driver.get
Merge fixture tests to reduce live servers and time
refactor(app-tests): Merge fixture tests to reduce live servers and time
Python
mpl-2.0
defrank/roshi
""" Test fixtures. :copyright: (c) 2017 Derek M. Frank :license: MPL-2.0 """ from flask import Flask # type: ignore def test_simple_app(app): """Verify basic application.""" assert isinstance(app, Flask) def test_simple_config(config): """Verify basic application configuration.""" assert isinstance(config, dict) def test_webdriver_current_url(webdriver): """ Verify data URL. Chrome: 'data:,' Firefox: 'about:blank' """ assert webdriver.current_url in ['data:,', 'about:blank'] def test_webdriver_valid_service(webdriver, services=('chrome', 'firefox')): """Make sure valid service is being used.""" assert webdriver.name in services def test_webdriver_get_google(webdriver): """If google is down, something bad has happened.""" webdriver.get('http://google.com/') assert 'Google' in webdriver.title def test_page_proxies_webdriver(page): """Verify webdriver proxying.""" assert page.title == page.driver.title assert page.current_url == page.driver.current_url assert page.get == page.driver.get refactor(app-tests): Merge fixture tests to reduce live servers and time
""" Test fixtures. :copyright: (c) 2017 Derek M. Frank :license: MPL-2.0 """ from flask import Flask # type: ignore def test_simple_app(app): """Verify basic application.""" assert isinstance(app, Flask) def test_simple_config(config): """Verify basic application configuration.""" assert isinstance(config, dict) def test_webdriver_current_url(webdriver): """ Verify data URL. Chrome: 'data:,' Firefox: 'about:blank' """ assert webdriver.name in ['chrome', 'firefox'] assert webdriver.current_url in ['data:,', 'about:blank'] def test_webdriver_get_google(webdriver): """If google is down, something bad has happened.""" webdriver.get('http://google.com/') assert 'Google' in webdriver.title def test_page_proxies_webdriver(page): """Verify webdriver proxying.""" assert page.title == page.driver.title assert page.current_url == page.driver.current_url assert page.get == page.driver.get
<commit_before>""" Test fixtures. :copyright: (c) 2017 Derek M. Frank :license: MPL-2.0 """ from flask import Flask # type: ignore def test_simple_app(app): """Verify basic application.""" assert isinstance(app, Flask) def test_simple_config(config): """Verify basic application configuration.""" assert isinstance(config, dict) def test_webdriver_current_url(webdriver): """ Verify data URL. Chrome: 'data:,' Firefox: 'about:blank' """ assert webdriver.current_url in ['data:,', 'about:blank'] def test_webdriver_valid_service(webdriver, services=('chrome', 'firefox')): """Make sure valid service is being used.""" assert webdriver.name in services def test_webdriver_get_google(webdriver): """If google is down, something bad has happened.""" webdriver.get('http://google.com/') assert 'Google' in webdriver.title def test_page_proxies_webdriver(page): """Verify webdriver proxying.""" assert page.title == page.driver.title assert page.current_url == page.driver.current_url assert page.get == page.driver.get <commit_msg>refactor(app-tests): Merge fixture tests to reduce live servers and time<commit_after>
""" Test fixtures. :copyright: (c) 2017 Derek M. Frank :license: MPL-2.0 """ from flask import Flask # type: ignore def test_simple_app(app): """Verify basic application.""" assert isinstance(app, Flask) def test_simple_config(config): """Verify basic application configuration.""" assert isinstance(config, dict) def test_webdriver_current_url(webdriver): """ Verify data URL. Chrome: 'data:,' Firefox: 'about:blank' """ assert webdriver.name in ['chrome', 'firefox'] assert webdriver.current_url in ['data:,', 'about:blank'] def test_webdriver_get_google(webdriver): """If google is down, something bad has happened.""" webdriver.get('http://google.com/') assert 'Google' in webdriver.title def test_page_proxies_webdriver(page): """Verify webdriver proxying.""" assert page.title == page.driver.title assert page.current_url == page.driver.current_url assert page.get == page.driver.get
""" Test fixtures. :copyright: (c) 2017 Derek M. Frank :license: MPL-2.0 """ from flask import Flask # type: ignore def test_simple_app(app): """Verify basic application.""" assert isinstance(app, Flask) def test_simple_config(config): """Verify basic application configuration.""" assert isinstance(config, dict) def test_webdriver_current_url(webdriver): """ Verify data URL. Chrome: 'data:,' Firefox: 'about:blank' """ assert webdriver.current_url in ['data:,', 'about:blank'] def test_webdriver_valid_service(webdriver, services=('chrome', 'firefox')): """Make sure valid service is being used.""" assert webdriver.name in services def test_webdriver_get_google(webdriver): """If google is down, something bad has happened.""" webdriver.get('http://google.com/') assert 'Google' in webdriver.title def test_page_proxies_webdriver(page): """Verify webdriver proxying.""" assert page.title == page.driver.title assert page.current_url == page.driver.current_url assert page.get == page.driver.get refactor(app-tests): Merge fixture tests to reduce live servers and time""" Test fixtures. :copyright: (c) 2017 Derek M. Frank :license: MPL-2.0 """ from flask import Flask # type: ignore def test_simple_app(app): """Verify basic application.""" assert isinstance(app, Flask) def test_simple_config(config): """Verify basic application configuration.""" assert isinstance(config, dict) def test_webdriver_current_url(webdriver): """ Verify data URL. Chrome: 'data:,' Firefox: 'about:blank' """ assert webdriver.name in ['chrome', 'firefox'] assert webdriver.current_url in ['data:,', 'about:blank'] def test_webdriver_get_google(webdriver): """If google is down, something bad has happened.""" webdriver.get('http://google.com/') assert 'Google' in webdriver.title def test_page_proxies_webdriver(page): """Verify webdriver proxying.""" assert page.title == page.driver.title assert page.current_url == page.driver.current_url assert page.get == page.driver.get
<commit_before>""" Test fixtures. :copyright: (c) 2017 Derek M. Frank :license: MPL-2.0 """ from flask import Flask # type: ignore def test_simple_app(app): """Verify basic application.""" assert isinstance(app, Flask) def test_simple_config(config): """Verify basic application configuration.""" assert isinstance(config, dict) def test_webdriver_current_url(webdriver): """ Verify data URL. Chrome: 'data:,' Firefox: 'about:blank' """ assert webdriver.current_url in ['data:,', 'about:blank'] def test_webdriver_valid_service(webdriver, services=('chrome', 'firefox')): """Make sure valid service is being used.""" assert webdriver.name in services def test_webdriver_get_google(webdriver): """If google is down, something bad has happened.""" webdriver.get('http://google.com/') assert 'Google' in webdriver.title def test_page_proxies_webdriver(page): """Verify webdriver proxying.""" assert page.title == page.driver.title assert page.current_url == page.driver.current_url assert page.get == page.driver.get <commit_msg>refactor(app-tests): Merge fixture tests to reduce live servers and time<commit_after>""" Test fixtures. :copyright: (c) 2017 Derek M. Frank :license: MPL-2.0 """ from flask import Flask # type: ignore def test_simple_app(app): """Verify basic application.""" assert isinstance(app, Flask) def test_simple_config(config): """Verify basic application configuration.""" assert isinstance(config, dict) def test_webdriver_current_url(webdriver): """ Verify data URL. Chrome: 'data:,' Firefox: 'about:blank' """ assert webdriver.name in ['chrome', 'firefox'] assert webdriver.current_url in ['data:,', 'about:blank'] def test_webdriver_get_google(webdriver): """If google is down, something bad has happened.""" webdriver.get('http://google.com/') assert 'Google' in webdriver.title def test_page_proxies_webdriver(page): """Verify webdriver proxying.""" assert page.title == page.driver.title assert page.current_url == page.driver.current_url assert page.get == page.driver.get
0da7c7931f7abc8775087aab5054cfea63120f60
scripts/dumpcmaps.py
scripts/dumpcmaps.py
import numpy as np import Image def makeImage(cmap, fname): cmarr = (cmap*255).astype(np.uint8) im = Image.fromarray(cmarr[np.newaxis]) im.save(fname) def cmList(additional): cmaps = {} values = np.linspace(0, 1, 256) from matplotlib import cm, colors for cmname in dir(cm): cmap = getattr(cm, cmname) if isinstance(cmap, colors.Colormap): cmaps[cmname] = cmap(values) for name, cmap in additional.items(): cmaps[name] = colors.LinearSegmentedColormap.from_list(name, cmap)(values) return cmaps if __name__ == "__main__": import os import sys path = sys.argv[1] matfile = sio.loadmat("/auto/k2/share/mritools_store/colormaps.mat") del matfile['__globals__'] del matfile['__header__'] del matfile['__version__'] for name, cm in cmList(matfile).items(): fname = os.path.join(path, "%s.png"%name) makeImage(cm, fname)
import numpy as np import Image import scipy.io as sio def makeImage(cmap, fname): cmarr = (cmap*255).astype(np.uint8) im = Image.fromarray(cmarr[np.newaxis]) im.save(fname) def cmList(additional): cmaps = {} values = np.linspace(0, 1, 256) from matplotlib import cm, colors for cmname in dir(cm): cmap = getattr(cm, cmname) if isinstance(cmap, colors.Colormap): cmaps[cmname] = cmap(values) for name, cmap in additional.items(): cmaps[name] = colors.LinearSegmentedColormap.from_list(name, cmap)(values) return cmaps if __name__ == "__main__": import os import sys path = sys.argv[1] matfile = sio.loadmat("/auto/k2/share/mritools_store/colormaps.mat") del matfile['__globals__'] del matfile['__header__'] del matfile['__version__'] for name, cm in cmList(matfile).items(): fname = os.path.join(path, "%s.png"%name) makeImage(cm, fname)
Add all the J* colormaps
Add all the J* colormaps
Python
bsd-2-clause
gallantlab/pycortex,smerdis/pycortex,smerdis/pycortex,CVML/pycortex,gallantlab/pycortex,CVML/pycortex,smerdis/pycortex,CVML/pycortex,CVML/pycortex,CVML/pycortex,gallantlab/pycortex,smerdis/pycortex,smerdis/pycortex,gallantlab/pycortex,gallantlab/pycortex
import numpy as np import Image def makeImage(cmap, fname): cmarr = (cmap*255).astype(np.uint8) im = Image.fromarray(cmarr[np.newaxis]) im.save(fname) def cmList(additional): cmaps = {} values = np.linspace(0, 1, 256) from matplotlib import cm, colors for cmname in dir(cm): cmap = getattr(cm, cmname) if isinstance(cmap, colors.Colormap): cmaps[cmname] = cmap(values) for name, cmap in additional.items(): cmaps[name] = colors.LinearSegmentedColormap.from_list(name, cmap)(values) return cmaps if __name__ == "__main__": import os import sys path = sys.argv[1] matfile = sio.loadmat("/auto/k2/share/mritools_store/colormaps.mat") del matfile['__globals__'] del matfile['__header__'] del matfile['__version__'] for name, cm in cmList(matfile).items(): fname = os.path.join(path, "%s.png"%name) makeImage(cm, fname)Add all the J* colormaps
import numpy as np import Image import scipy.io as sio def makeImage(cmap, fname): cmarr = (cmap*255).astype(np.uint8) im = Image.fromarray(cmarr[np.newaxis]) im.save(fname) def cmList(additional): cmaps = {} values = np.linspace(0, 1, 256) from matplotlib import cm, colors for cmname in dir(cm): cmap = getattr(cm, cmname) if isinstance(cmap, colors.Colormap): cmaps[cmname] = cmap(values) for name, cmap in additional.items(): cmaps[name] = colors.LinearSegmentedColormap.from_list(name, cmap)(values) return cmaps if __name__ == "__main__": import os import sys path = sys.argv[1] matfile = sio.loadmat("/auto/k2/share/mritools_store/colormaps.mat") del matfile['__globals__'] del matfile['__header__'] del matfile['__version__'] for name, cm in cmList(matfile).items(): fname = os.path.join(path, "%s.png"%name) makeImage(cm, fname)
<commit_before>import numpy as np import Image def makeImage(cmap, fname): cmarr = (cmap*255).astype(np.uint8) im = Image.fromarray(cmarr[np.newaxis]) im.save(fname) def cmList(additional): cmaps = {} values = np.linspace(0, 1, 256) from matplotlib import cm, colors for cmname in dir(cm): cmap = getattr(cm, cmname) if isinstance(cmap, colors.Colormap): cmaps[cmname] = cmap(values) for name, cmap in additional.items(): cmaps[name] = colors.LinearSegmentedColormap.from_list(name, cmap)(values) return cmaps if __name__ == "__main__": import os import sys path = sys.argv[1] matfile = sio.loadmat("/auto/k2/share/mritools_store/colormaps.mat") del matfile['__globals__'] del matfile['__header__'] del matfile['__version__'] for name, cm in cmList(matfile).items(): fname = os.path.join(path, "%s.png"%name) makeImage(cm, fname)<commit_msg>Add all the J* colormaps<commit_after>
import numpy as np import Image import scipy.io as sio def makeImage(cmap, fname): cmarr = (cmap*255).astype(np.uint8) im = Image.fromarray(cmarr[np.newaxis]) im.save(fname) def cmList(additional): cmaps = {} values = np.linspace(0, 1, 256) from matplotlib import cm, colors for cmname in dir(cm): cmap = getattr(cm, cmname) if isinstance(cmap, colors.Colormap): cmaps[cmname] = cmap(values) for name, cmap in additional.items(): cmaps[name] = colors.LinearSegmentedColormap.from_list(name, cmap)(values) return cmaps if __name__ == "__main__": import os import sys path = sys.argv[1] matfile = sio.loadmat("/auto/k2/share/mritools_store/colormaps.mat") del matfile['__globals__'] del matfile['__header__'] del matfile['__version__'] for name, cm in cmList(matfile).items(): fname = os.path.join(path, "%s.png"%name) makeImage(cm, fname)
import numpy as np import Image def makeImage(cmap, fname): cmarr = (cmap*255).astype(np.uint8) im = Image.fromarray(cmarr[np.newaxis]) im.save(fname) def cmList(additional): cmaps = {} values = np.linspace(0, 1, 256) from matplotlib import cm, colors for cmname in dir(cm): cmap = getattr(cm, cmname) if isinstance(cmap, colors.Colormap): cmaps[cmname] = cmap(values) for name, cmap in additional.items(): cmaps[name] = colors.LinearSegmentedColormap.from_list(name, cmap)(values) return cmaps if __name__ == "__main__": import os import sys path = sys.argv[1] matfile = sio.loadmat("/auto/k2/share/mritools_store/colormaps.mat") del matfile['__globals__'] del matfile['__header__'] del matfile['__version__'] for name, cm in cmList(matfile).items(): fname = os.path.join(path, "%s.png"%name) makeImage(cm, fname)Add all the J* colormapsimport numpy as np import Image import scipy.io as sio def makeImage(cmap, fname): cmarr = (cmap*255).astype(np.uint8) im = Image.fromarray(cmarr[np.newaxis]) im.save(fname) def cmList(additional): cmaps = {} values = np.linspace(0, 1, 256) from matplotlib import cm, colors for cmname in dir(cm): cmap = getattr(cm, cmname) if isinstance(cmap, colors.Colormap): cmaps[cmname] = cmap(values) for name, cmap in additional.items(): cmaps[name] = colors.LinearSegmentedColormap.from_list(name, cmap)(values) return cmaps if __name__ == "__main__": import os import sys path = sys.argv[1] matfile = sio.loadmat("/auto/k2/share/mritools_store/colormaps.mat") del matfile['__globals__'] del matfile['__header__'] del matfile['__version__'] for name, cm in cmList(matfile).items(): fname = os.path.join(path, "%s.png"%name) makeImage(cm, fname)
<commit_before>import numpy as np import Image def makeImage(cmap, fname): cmarr = (cmap*255).astype(np.uint8) im = Image.fromarray(cmarr[np.newaxis]) im.save(fname) def cmList(additional): cmaps = {} values = np.linspace(0, 1, 256) from matplotlib import cm, colors for cmname in dir(cm): cmap = getattr(cm, cmname) if isinstance(cmap, colors.Colormap): cmaps[cmname] = cmap(values) for name, cmap in additional.items(): cmaps[name] = colors.LinearSegmentedColormap.from_list(name, cmap)(values) return cmaps if __name__ == "__main__": import os import sys path = sys.argv[1] matfile = sio.loadmat("/auto/k2/share/mritools_store/colormaps.mat") del matfile['__globals__'] del matfile['__header__'] del matfile['__version__'] for name, cm in cmList(matfile).items(): fname = os.path.join(path, "%s.png"%name) makeImage(cm, fname)<commit_msg>Add all the J* colormaps<commit_after>import numpy as np import Image import scipy.io as sio def makeImage(cmap, fname): cmarr = (cmap*255).astype(np.uint8) im = Image.fromarray(cmarr[np.newaxis]) im.save(fname) def cmList(additional): cmaps = {} values = np.linspace(0, 1, 256) from matplotlib import cm, colors for cmname in dir(cm): cmap = getattr(cm, cmname) if isinstance(cmap, colors.Colormap): cmaps[cmname] = cmap(values) for name, cmap in additional.items(): cmaps[name] = colors.LinearSegmentedColormap.from_list(name, cmap)(values) return cmaps if __name__ == "__main__": import os import sys path = sys.argv[1] matfile = sio.loadmat("/auto/k2/share/mritools_store/colormaps.mat") del matfile['__globals__'] del matfile['__header__'] del matfile['__version__'] for name, cm in cmList(matfile).items(): fname = os.path.join(path, "%s.png"%name) makeImage(cm, fname)
b470cb1825f5d54ff4a48875a216dbb0cdf44eb7
apps/innovate/tests/test_views.py
apps/innovate/tests/test_views.py
from django.core.urlresolvers import reverse from django.test import Client from projects.models import Project from innovate import urls def test_routes(): c = Client() for pattern in urls.urlpatterns: response = c.get(reverse(pattern.name)) assert response.status_code == 301 assert response.has_header('location') location = response.get('location', None) assert location is not None response = c.get(location) assert response.status_code == 200 def test_featured(): project = Project.objects.create( name=u'Test Project', slug=u'test-project', description=u'Blah', featured=True ) c = Client() response = c.get('/en-US/') assert response.status_code == 200 assert project.name in response.content
from django.core.urlresolvers import reverse from django.test import Client from django.test.client import RequestFactory from projects.models import Project from innovate import urls from innovate.views import handle404, handle500 def test_routes(): c = Client() for pattern in urls.urlpatterns: response = c.get(reverse(pattern.name)) assert response.status_code == 301 assert response.has_header('location') location = response.get('location', None) assert location is not None response = c.get(location) assert response.status_code == 200 def test_featured(): project = Project.objects.create( name=u'Test Project', slug=u'test-project', description=u'Blah', featured=True ) c = Client() response = c.get('/en-US/') assert response.status_code == 200 assert project.name in response.content def test_404_handler(): """Test that the 404 error handler renders and gives the correct code.""" response = handle404(RequestFactory().get('/not/a/real/path/')) assert response.status_code == 404 def test_500_handler(): """Test that the 500 error handler renders and gives the correct code.""" response = handle500(RequestFactory().get('/not/a/real/path/')) assert response.status_code == 500
Add tests for the 404 and 500 error handlers.
Add tests for the 404 and 500 error handlers.
Python
bsd-3-clause
mozilla/betafarm,mozilla/betafarm,mozilla/betafarm,mozilla/betafarm
from django.core.urlresolvers import reverse from django.test import Client from projects.models import Project from innovate import urls def test_routes(): c = Client() for pattern in urls.urlpatterns: response = c.get(reverse(pattern.name)) assert response.status_code == 301 assert response.has_header('location') location = response.get('location', None) assert location is not None response = c.get(location) assert response.status_code == 200 def test_featured(): project = Project.objects.create( name=u'Test Project', slug=u'test-project', description=u'Blah', featured=True ) c = Client() response = c.get('/en-US/') assert response.status_code == 200 assert project.name in response.content Add tests for the 404 and 500 error handlers.
from django.core.urlresolvers import reverse from django.test import Client from django.test.client import RequestFactory from projects.models import Project from innovate import urls from innovate.views import handle404, handle500 def test_routes(): c = Client() for pattern in urls.urlpatterns: response = c.get(reverse(pattern.name)) assert response.status_code == 301 assert response.has_header('location') location = response.get('location', None) assert location is not None response = c.get(location) assert response.status_code == 200 def test_featured(): project = Project.objects.create( name=u'Test Project', slug=u'test-project', description=u'Blah', featured=True ) c = Client() response = c.get('/en-US/') assert response.status_code == 200 assert project.name in response.content def test_404_handler(): """Test that the 404 error handler renders and gives the correct code.""" response = handle404(RequestFactory().get('/not/a/real/path/')) assert response.status_code == 404 def test_500_handler(): """Test that the 500 error handler renders and gives the correct code.""" response = handle500(RequestFactory().get('/not/a/real/path/')) assert response.status_code == 500
<commit_before>from django.core.urlresolvers import reverse from django.test import Client from projects.models import Project from innovate import urls def test_routes(): c = Client() for pattern in urls.urlpatterns: response = c.get(reverse(pattern.name)) assert response.status_code == 301 assert response.has_header('location') location = response.get('location', None) assert location is not None response = c.get(location) assert response.status_code == 200 def test_featured(): project = Project.objects.create( name=u'Test Project', slug=u'test-project', description=u'Blah', featured=True ) c = Client() response = c.get('/en-US/') assert response.status_code == 200 assert project.name in response.content <commit_msg>Add tests for the 404 and 500 error handlers.<commit_after>
from django.core.urlresolvers import reverse from django.test import Client from django.test.client import RequestFactory from projects.models import Project from innovate import urls from innovate.views import handle404, handle500 def test_routes(): c = Client() for pattern in urls.urlpatterns: response = c.get(reverse(pattern.name)) assert response.status_code == 301 assert response.has_header('location') location = response.get('location', None) assert location is not None response = c.get(location) assert response.status_code == 200 def test_featured(): project = Project.objects.create( name=u'Test Project', slug=u'test-project', description=u'Blah', featured=True ) c = Client() response = c.get('/en-US/') assert response.status_code == 200 assert project.name in response.content def test_404_handler(): """Test that the 404 error handler renders and gives the correct code.""" response = handle404(RequestFactory().get('/not/a/real/path/')) assert response.status_code == 404 def test_500_handler(): """Test that the 500 error handler renders and gives the correct code.""" response = handle500(RequestFactory().get('/not/a/real/path/')) assert response.status_code == 500
from django.core.urlresolvers import reverse from django.test import Client from projects.models import Project from innovate import urls def test_routes(): c = Client() for pattern in urls.urlpatterns: response = c.get(reverse(pattern.name)) assert response.status_code == 301 assert response.has_header('location') location = response.get('location', None) assert location is not None response = c.get(location) assert response.status_code == 200 def test_featured(): project = Project.objects.create( name=u'Test Project', slug=u'test-project', description=u'Blah', featured=True ) c = Client() response = c.get('/en-US/') assert response.status_code == 200 assert project.name in response.content Add tests for the 404 and 500 error handlers.from django.core.urlresolvers import reverse from django.test import Client from django.test.client import RequestFactory from projects.models import Project from innovate import urls from innovate.views import handle404, handle500 def test_routes(): c = Client() for pattern in urls.urlpatterns: response = c.get(reverse(pattern.name)) assert response.status_code == 301 assert response.has_header('location') location = response.get('location', None) assert location is not None response = c.get(location) assert response.status_code == 200 def test_featured(): project = Project.objects.create( name=u'Test Project', slug=u'test-project', description=u'Blah', featured=True ) c = Client() response = c.get('/en-US/') assert response.status_code == 200 assert project.name in response.content def test_404_handler(): """Test that the 404 error handler renders and gives the correct code.""" response = handle404(RequestFactory().get('/not/a/real/path/')) assert response.status_code == 404 def test_500_handler(): """Test that the 500 error handler renders and gives the correct code.""" response = handle500(RequestFactory().get('/not/a/real/path/')) assert response.status_code == 500
<commit_before>from django.core.urlresolvers import reverse from django.test import Client from projects.models import Project from innovate import urls def test_routes(): c = Client() for pattern in urls.urlpatterns: response = c.get(reverse(pattern.name)) assert response.status_code == 301 assert response.has_header('location') location = response.get('location', None) assert location is not None response = c.get(location) assert response.status_code == 200 def test_featured(): project = Project.objects.create( name=u'Test Project', slug=u'test-project', description=u'Blah', featured=True ) c = Client() response = c.get('/en-US/') assert response.status_code == 200 assert project.name in response.content <commit_msg>Add tests for the 404 and 500 error handlers.<commit_after>from django.core.urlresolvers import reverse from django.test import Client from django.test.client import RequestFactory from projects.models import Project from innovate import urls from innovate.views import handle404, handle500 def test_routes(): c = Client() for pattern in urls.urlpatterns: response = c.get(reverse(pattern.name)) assert response.status_code == 301 assert response.has_header('location') location = response.get('location', None) assert location is not None response = c.get(location) assert response.status_code == 200 def test_featured(): project = Project.objects.create( name=u'Test Project', slug=u'test-project', description=u'Blah', featured=True ) c = Client() response = c.get('/en-US/') assert response.status_code == 200 assert project.name in response.content def test_404_handler(): """Test that the 404 error handler renders and gives the correct code.""" response = handle404(RequestFactory().get('/not/a/real/path/')) assert response.status_code == 404 def test_500_handler(): """Test that the 500 error handler renders and gives the correct code.""" response = handle500(RequestFactory().get('/not/a/real/path/')) assert response.status_code == 500
307a125dc21e31fdf06862dafb30f8283db6c8a2
python/custom_type.py
python/custom_type.py
import math class Circle: def __init__(self, radius): self.radius = radius def area(self): return math.pi * self.radius * self.radius c = Circle(10) assert(type(c) == Circle) assert(type(Circle) == type) assert(str(type(Circle.area)) == "<class 'function'>") assert(str(type(c.area)) == "<class 'method'>") assert(c.area() == math.pi * 100) # A method call... assert(Circle.area(c) == c.area()) # ...is just sugar
import math class Circle: def __init__(self, radius): self.radius = radius def area(self): return math.pi * self.radius * self.radius c = Circle(10) assert(type(c) == Circle) # Circle is a type! assert(type(Circle) == type) # It really is! assert(str(type(Circle.area)) == "<class 'function'>") assert(str(type(c.area)) == "<class 'method'>") assert(c.area() == math.pi * 100) # A method call... assert(Circle.area(c) == c.area()) # ...is just sugar
Tidy up Python class example
Tidy up Python class example
Python
mit
rtoal/polyglot,rtoal/polyglot,rtoal/polyglot,rtoal/polyglot,rtoal/polyglot,rtoal/polyglot,rtoal/ple,rtoal/polyglot,rtoal/ple,rtoal/ple,rtoal/ple,rtoal/ple,rtoal/polyglot,rtoal/polyglot,rtoal/polyglot,rtoal/polyglot,rtoal/polyglot,rtoal/ple,rtoal/ple,rtoal/ple,rtoal/ple,rtoal/ple,rtoal/ple,rtoal/polyglot,rtoal/ple,rtoal/polyglot,rtoal/ple,rtoal/ple,rtoal/polyglot,rtoal/ple,rtoal/ple
import math class Circle: def __init__(self, radius): self.radius = radius def area(self): return math.pi * self.radius * self.radius c = Circle(10) assert(type(c) == Circle) assert(type(Circle) == type) assert(str(type(Circle.area)) == "<class 'function'>") assert(str(type(c.area)) == "<class 'method'>") assert(c.area() == math.pi * 100) # A method call... assert(Circle.area(c) == c.area()) # ...is just sugar Tidy up Python class example
import math class Circle: def __init__(self, radius): self.radius = radius def area(self): return math.pi * self.radius * self.radius c = Circle(10) assert(type(c) == Circle) # Circle is a type! assert(type(Circle) == type) # It really is! assert(str(type(Circle.area)) == "<class 'function'>") assert(str(type(c.area)) == "<class 'method'>") assert(c.area() == math.pi * 100) # A method call... assert(Circle.area(c) == c.area()) # ...is just sugar
<commit_before>import math class Circle: def __init__(self, radius): self.radius = radius def area(self): return math.pi * self.radius * self.radius c = Circle(10) assert(type(c) == Circle) assert(type(Circle) == type) assert(str(type(Circle.area)) == "<class 'function'>") assert(str(type(c.area)) == "<class 'method'>") assert(c.area() == math.pi * 100) # A method call... assert(Circle.area(c) == c.area()) # ...is just sugar <commit_msg>Tidy up Python class example<commit_after>
import math class Circle: def __init__(self, radius): self.radius = radius def area(self): return math.pi * self.radius * self.radius c = Circle(10) assert(type(c) == Circle) # Circle is a type! assert(type(Circle) == type) # It really is! assert(str(type(Circle.area)) == "<class 'function'>") assert(str(type(c.area)) == "<class 'method'>") assert(c.area() == math.pi * 100) # A method call... assert(Circle.area(c) == c.area()) # ...is just sugar
import math class Circle: def __init__(self, radius): self.radius = radius def area(self): return math.pi * self.radius * self.radius c = Circle(10) assert(type(c) == Circle) assert(type(Circle) == type) assert(str(type(Circle.area)) == "<class 'function'>") assert(str(type(c.area)) == "<class 'method'>") assert(c.area() == math.pi * 100) # A method call... assert(Circle.area(c) == c.area()) # ...is just sugar Tidy up Python class exampleimport math class Circle: def __init__(self, radius): self.radius = radius def area(self): return math.pi * self.radius * self.radius c = Circle(10) assert(type(c) == Circle) # Circle is a type! assert(type(Circle) == type) # It really is! assert(str(type(Circle.area)) == "<class 'function'>") assert(str(type(c.area)) == "<class 'method'>") assert(c.area() == math.pi * 100) # A method call... assert(Circle.area(c) == c.area()) # ...is just sugar
<commit_before>import math class Circle: def __init__(self, radius): self.radius = radius def area(self): return math.pi * self.radius * self.radius c = Circle(10) assert(type(c) == Circle) assert(type(Circle) == type) assert(str(type(Circle.area)) == "<class 'function'>") assert(str(type(c.area)) == "<class 'method'>") assert(c.area() == math.pi * 100) # A method call... assert(Circle.area(c) == c.area()) # ...is just sugar <commit_msg>Tidy up Python class example<commit_after>import math class Circle: def __init__(self, radius): self.radius = radius def area(self): return math.pi * self.radius * self.radius c = Circle(10) assert(type(c) == Circle) # Circle is a type! assert(type(Circle) == type) # It really is! assert(str(type(Circle.area)) == "<class 'function'>") assert(str(type(c.area)) == "<class 'method'>") assert(c.area() == math.pi * 100) # A method call... assert(Circle.area(c) == c.area()) # ...is just sugar
cd9e0d6226f9a37a9a99062a42f21aaa53e0351f
heufybot/connection.py
heufybot/connection.py
from twisted.words.protocols import irc class HeufyBotConnection(irc.IRC): def __init__(self, protocol): self.protocol = protocol self.nick = "PyHeufyBot" # TODO This will be set by a configuration at some point self.ident = "PyHeufyBot" # TODO This will be set by a configuration at some point self.gecos = "PyHeufyBot IRC Bot" # TODO This will be set by a configuration at some point self.channels = {} self.usermodes = {} def connectionMade(self): self.cmdNICK(self.nick) self.cmdUSER(self.ident, self.gecos) def connectionLost(self, reason=""): print reason def handleCommand(self, command, prefix, params): print prefix, command, " ".join(params) def sendMessage(self, command, *parameter_list, **prefix): print command, " ".join(parameter_list) irc.IRC.sendMessage(self, command, *parameter_list, **prefix) def cmdNICK(self, nick): self.sendMessage("NICK", nick) def cmdUSER(self, ident, gecos): # RFC2812 allows usermodes to be set, but this isn't implemented much in IRCds at all. # Pass 0 for usermodes instead. self.sendMessage("USER", ident, "0", "*", ":{}".format(gecos))
from twisted.words.protocols import irc class HeufyBotConnection(irc.IRC): def __init__(self, protocol): self.protocol = protocol self.nick = "PyHeufyBot" # TODO This will be set by a configuration at some point self.ident = "PyHeufyBot" # TODO This will be set by a configuration at some point self.gecos = "PyHeufyBot IRC Bot" # TODO This will be set by a configuration at some point self.channels = {} self.usermodes = {} def connectionMade(self): self.cmdNICK(self.nick) self.cmdUSER(self.ident, self.gecos) def connectionLost(self, reason=""): print reason def handleCommand(self, command, prefix, params): print prefix, command, " ".join(params) def sendMessage(self, command, *parameter_list, **prefix): print command, " ".join(parameter_list) irc.IRC.sendMessage(self, command, *parameter_list, **prefix) def cmdNICK(self, nick): self.sendMessage("NICK", nick) def cmdUSER(self, ident, gecos): # RFC2812 allows usermodes to be set, but this isn't implemented much in IRCds at all. # Pass 0 for usermodes instead. self.sendMessage("USER", ident, "0", "*", ":{}".format(gecos)) def cmdQUIT(self, reason): self.sendMessage("QUIT", ":{}".format(reason)) def disconnect(self, reason="Quitting..."): # TODO Make sure full quits don't cause reconnection self.cmdQUIT(reason) self.transport.loseConnection()
Implement the QUIT command and disconnect
Implement the QUIT command and disconnect
Python
mit
Heufneutje/PyHeufyBot,Heufneutje/PyHeufyBot
from twisted.words.protocols import irc class HeufyBotConnection(irc.IRC): def __init__(self, protocol): self.protocol = protocol self.nick = "PyHeufyBot" # TODO This will be set by a configuration at some point self.ident = "PyHeufyBot" # TODO This will be set by a configuration at some point self.gecos = "PyHeufyBot IRC Bot" # TODO This will be set by a configuration at some point self.channels = {} self.usermodes = {} def connectionMade(self): self.cmdNICK(self.nick) self.cmdUSER(self.ident, self.gecos) def connectionLost(self, reason=""): print reason def handleCommand(self, command, prefix, params): print prefix, command, " ".join(params) def sendMessage(self, command, *parameter_list, **prefix): print command, " ".join(parameter_list) irc.IRC.sendMessage(self, command, *parameter_list, **prefix) def cmdNICK(self, nick): self.sendMessage("NICK", nick) def cmdUSER(self, ident, gecos): # RFC2812 allows usermodes to be set, but this isn't implemented much in IRCds at all. # Pass 0 for usermodes instead. self.sendMessage("USER", ident, "0", "*", ":{}".format(gecos)) Implement the QUIT command and disconnect
from twisted.words.protocols import irc class HeufyBotConnection(irc.IRC): def __init__(self, protocol): self.protocol = protocol self.nick = "PyHeufyBot" # TODO This will be set by a configuration at some point self.ident = "PyHeufyBot" # TODO This will be set by a configuration at some point self.gecos = "PyHeufyBot IRC Bot" # TODO This will be set by a configuration at some point self.channels = {} self.usermodes = {} def connectionMade(self): self.cmdNICK(self.nick) self.cmdUSER(self.ident, self.gecos) def connectionLost(self, reason=""): print reason def handleCommand(self, command, prefix, params): print prefix, command, " ".join(params) def sendMessage(self, command, *parameter_list, **prefix): print command, " ".join(parameter_list) irc.IRC.sendMessage(self, command, *parameter_list, **prefix) def cmdNICK(self, nick): self.sendMessage("NICK", nick) def cmdUSER(self, ident, gecos): # RFC2812 allows usermodes to be set, but this isn't implemented much in IRCds at all. # Pass 0 for usermodes instead. self.sendMessage("USER", ident, "0", "*", ":{}".format(gecos)) def cmdQUIT(self, reason): self.sendMessage("QUIT", ":{}".format(reason)) def disconnect(self, reason="Quitting..."): # TODO Make sure full quits don't cause reconnection self.cmdQUIT(reason) self.transport.loseConnection()
<commit_before>from twisted.words.protocols import irc class HeufyBotConnection(irc.IRC): def __init__(self, protocol): self.protocol = protocol self.nick = "PyHeufyBot" # TODO This will be set by a configuration at some point self.ident = "PyHeufyBot" # TODO This will be set by a configuration at some point self.gecos = "PyHeufyBot IRC Bot" # TODO This will be set by a configuration at some point self.channels = {} self.usermodes = {} def connectionMade(self): self.cmdNICK(self.nick) self.cmdUSER(self.ident, self.gecos) def connectionLost(self, reason=""): print reason def handleCommand(self, command, prefix, params): print prefix, command, " ".join(params) def sendMessage(self, command, *parameter_list, **prefix): print command, " ".join(parameter_list) irc.IRC.sendMessage(self, command, *parameter_list, **prefix) def cmdNICK(self, nick): self.sendMessage("NICK", nick) def cmdUSER(self, ident, gecos): # RFC2812 allows usermodes to be set, but this isn't implemented much in IRCds at all. # Pass 0 for usermodes instead. self.sendMessage("USER", ident, "0", "*", ":{}".format(gecos)) <commit_msg>Implement the QUIT command and disconnect<commit_after>
from twisted.words.protocols import irc class HeufyBotConnection(irc.IRC): def __init__(self, protocol): self.protocol = protocol self.nick = "PyHeufyBot" # TODO This will be set by a configuration at some point self.ident = "PyHeufyBot" # TODO This will be set by a configuration at some point self.gecos = "PyHeufyBot IRC Bot" # TODO This will be set by a configuration at some point self.channels = {} self.usermodes = {} def connectionMade(self): self.cmdNICK(self.nick) self.cmdUSER(self.ident, self.gecos) def connectionLost(self, reason=""): print reason def handleCommand(self, command, prefix, params): print prefix, command, " ".join(params) def sendMessage(self, command, *parameter_list, **prefix): print command, " ".join(parameter_list) irc.IRC.sendMessage(self, command, *parameter_list, **prefix) def cmdNICK(self, nick): self.sendMessage("NICK", nick) def cmdUSER(self, ident, gecos): # RFC2812 allows usermodes to be set, but this isn't implemented much in IRCds at all. # Pass 0 for usermodes instead. self.sendMessage("USER", ident, "0", "*", ":{}".format(gecos)) def cmdQUIT(self, reason): self.sendMessage("QUIT", ":{}".format(reason)) def disconnect(self, reason="Quitting..."): # TODO Make sure full quits don't cause reconnection self.cmdQUIT(reason) self.transport.loseConnection()
from twisted.words.protocols import irc class HeufyBotConnection(irc.IRC): def __init__(self, protocol): self.protocol = protocol self.nick = "PyHeufyBot" # TODO This will be set by a configuration at some point self.ident = "PyHeufyBot" # TODO This will be set by a configuration at some point self.gecos = "PyHeufyBot IRC Bot" # TODO This will be set by a configuration at some point self.channels = {} self.usermodes = {} def connectionMade(self): self.cmdNICK(self.nick) self.cmdUSER(self.ident, self.gecos) def connectionLost(self, reason=""): print reason def handleCommand(self, command, prefix, params): print prefix, command, " ".join(params) def sendMessage(self, command, *parameter_list, **prefix): print command, " ".join(parameter_list) irc.IRC.sendMessage(self, command, *parameter_list, **prefix) def cmdNICK(self, nick): self.sendMessage("NICK", nick) def cmdUSER(self, ident, gecos): # RFC2812 allows usermodes to be set, but this isn't implemented much in IRCds at all. # Pass 0 for usermodes instead. self.sendMessage("USER", ident, "0", "*", ":{}".format(gecos)) Implement the QUIT command and disconnectfrom twisted.words.protocols import irc class HeufyBotConnection(irc.IRC): def __init__(self, protocol): self.protocol = protocol self.nick = "PyHeufyBot" # TODO This will be set by a configuration at some point self.ident = "PyHeufyBot" # TODO This will be set by a configuration at some point self.gecos = "PyHeufyBot IRC Bot" # TODO This will be set by a configuration at some point self.channels = {} self.usermodes = {} def connectionMade(self): self.cmdNICK(self.nick) self.cmdUSER(self.ident, self.gecos) def connectionLost(self, reason=""): print reason def handleCommand(self, command, prefix, params): print prefix, command, " ".join(params) def sendMessage(self, command, *parameter_list, **prefix): print command, " ".join(parameter_list) irc.IRC.sendMessage(self, command, *parameter_list, **prefix) def cmdNICK(self, nick): self.sendMessage("NICK", nick) def cmdUSER(self, ident, gecos): # RFC2812 allows usermodes to be set, but this isn't implemented much in IRCds at all. # Pass 0 for usermodes instead. self.sendMessage("USER", ident, "0", "*", ":{}".format(gecos)) def cmdQUIT(self, reason): self.sendMessage("QUIT", ":{}".format(reason)) def disconnect(self, reason="Quitting..."): # TODO Make sure full quits don't cause reconnection self.cmdQUIT(reason) self.transport.loseConnection()
<commit_before>from twisted.words.protocols import irc class HeufyBotConnection(irc.IRC): def __init__(self, protocol): self.protocol = protocol self.nick = "PyHeufyBot" # TODO This will be set by a configuration at some point self.ident = "PyHeufyBot" # TODO This will be set by a configuration at some point self.gecos = "PyHeufyBot IRC Bot" # TODO This will be set by a configuration at some point self.channels = {} self.usermodes = {} def connectionMade(self): self.cmdNICK(self.nick) self.cmdUSER(self.ident, self.gecos) def connectionLost(self, reason=""): print reason def handleCommand(self, command, prefix, params): print prefix, command, " ".join(params) def sendMessage(self, command, *parameter_list, **prefix): print command, " ".join(parameter_list) irc.IRC.sendMessage(self, command, *parameter_list, **prefix) def cmdNICK(self, nick): self.sendMessage("NICK", nick) def cmdUSER(self, ident, gecos): # RFC2812 allows usermodes to be set, but this isn't implemented much in IRCds at all. # Pass 0 for usermodes instead. self.sendMessage("USER", ident, "0", "*", ":{}".format(gecos)) <commit_msg>Implement the QUIT command and disconnect<commit_after>from twisted.words.protocols import irc class HeufyBotConnection(irc.IRC): def __init__(self, protocol): self.protocol = protocol self.nick = "PyHeufyBot" # TODO This will be set by a configuration at some point self.ident = "PyHeufyBot" # TODO This will be set by a configuration at some point self.gecos = "PyHeufyBot IRC Bot" # TODO This will be set by a configuration at some point self.channels = {} self.usermodes = {} def connectionMade(self): self.cmdNICK(self.nick) self.cmdUSER(self.ident, self.gecos) def connectionLost(self, reason=""): print reason def handleCommand(self, command, prefix, params): print prefix, command, " ".join(params) def sendMessage(self, command, *parameter_list, **prefix): print command, " ".join(parameter_list) irc.IRC.sendMessage(self, command, *parameter_list, **prefix) def cmdNICK(self, nick): self.sendMessage("NICK", nick) def cmdUSER(self, ident, gecos): # RFC2812 allows usermodes to be set, but this isn't implemented much in IRCds at all. # Pass 0 for usermodes instead. self.sendMessage("USER", ident, "0", "*", ":{}".format(gecos)) def cmdQUIT(self, reason): self.sendMessage("QUIT", ":{}".format(reason)) def disconnect(self, reason="Quitting..."): # TODO Make sure full quits don't cause reconnection self.cmdQUIT(reason) self.transport.loseConnection()
860ab088e081390ca21b29029af1f398a97c7913
astroquery/tests/test_besancon.py
astroquery/tests/test_besancon.py
from astroquery import besancon import asciitable from astropy.io.ascii.tests.common import assert_equal # SKIP - don't run tests because Besancon folks don't want them (based on the fact that your@email.net is now rejected) # def test_besancon_reader(): # #assert os.path.exists('besancon_test.txt') # B = asciitable.read('t/besancon_test.txt',Reader=besancon.BesanconFixed,guess=False) # assert_equal(len(B),12) # # def test_basic(): # besancon_model = besancon.request_besancon('your@email.net',10.5,0.0) # B = asciitable.read(besancon_model,Reader=besancon.BesanconFixed,guess=False) # B.pprint()
#from astroquery import besancon #import asciitable #from astropy.io.ascii.tests.common import assert_equal # SKIP - don't run tests because Besancon folks don't want them (based on the fact that your@email.net is now rejected) # def test_besancon_reader(): # #assert os.path.exists('besancon_test.txt') # B = asciitable.read('t/besancon_test.txt',Reader=besancon.BesanconFixed,guess=False) # assert_equal(len(B),12) # # def test_basic(): # besancon_model = besancon.request_besancon('your@email.net',10.5,0.0) # B = asciitable.read(besancon_model,Reader=besancon.BesanconFixed,guess=False) # B.pprint()
Resolve 58; no tests for besancon
Resolve 58; no tests for besancon
Python
bsd-3-clause
ceb8/astroquery,imbasimba/astroquery,ceb8/astroquery,imbasimba/astroquery
from astroquery import besancon import asciitable from astropy.io.ascii.tests.common import assert_equal # SKIP - don't run tests because Besancon folks don't want them (based on the fact that your@email.net is now rejected) # def test_besancon_reader(): # #assert os.path.exists('besancon_test.txt') # B = asciitable.read('t/besancon_test.txt',Reader=besancon.BesanconFixed,guess=False) # assert_equal(len(B),12) # # def test_basic(): # besancon_model = besancon.request_besancon('your@email.net',10.5,0.0) # B = asciitable.read(besancon_model,Reader=besancon.BesanconFixed,guess=False) # B.pprint() Resolve 58; no tests for besancon
#from astroquery import besancon #import asciitable #from astropy.io.ascii.tests.common import assert_equal # SKIP - don't run tests because Besancon folks don't want them (based on the fact that your@email.net is now rejected) # def test_besancon_reader(): # #assert os.path.exists('besancon_test.txt') # B = asciitable.read('t/besancon_test.txt',Reader=besancon.BesanconFixed,guess=False) # assert_equal(len(B),12) # # def test_basic(): # besancon_model = besancon.request_besancon('your@email.net',10.5,0.0) # B = asciitable.read(besancon_model,Reader=besancon.BesanconFixed,guess=False) # B.pprint()
<commit_before>from astroquery import besancon import asciitable from astropy.io.ascii.tests.common import assert_equal # SKIP - don't run tests because Besancon folks don't want them (based on the fact that your@email.net is now rejected) # def test_besancon_reader(): # #assert os.path.exists('besancon_test.txt') # B = asciitable.read('t/besancon_test.txt',Reader=besancon.BesanconFixed,guess=False) # assert_equal(len(B),12) # # def test_basic(): # besancon_model = besancon.request_besancon('your@email.net',10.5,0.0) # B = asciitable.read(besancon_model,Reader=besancon.BesanconFixed,guess=False) # B.pprint() <commit_msg>Resolve 58; no tests for besancon<commit_after>
#from astroquery import besancon #import asciitable #from astropy.io.ascii.tests.common import assert_equal # SKIP - don't run tests because Besancon folks don't want them (based on the fact that your@email.net is now rejected) # def test_besancon_reader(): # #assert os.path.exists('besancon_test.txt') # B = asciitable.read('t/besancon_test.txt',Reader=besancon.BesanconFixed,guess=False) # assert_equal(len(B),12) # # def test_basic(): # besancon_model = besancon.request_besancon('your@email.net',10.5,0.0) # B = asciitable.read(besancon_model,Reader=besancon.BesanconFixed,guess=False) # B.pprint()
from astroquery import besancon import asciitable from astropy.io.ascii.tests.common import assert_equal # SKIP - don't run tests because Besancon folks don't want them (based on the fact that your@email.net is now rejected) # def test_besancon_reader(): # #assert os.path.exists('besancon_test.txt') # B = asciitable.read('t/besancon_test.txt',Reader=besancon.BesanconFixed,guess=False) # assert_equal(len(B),12) # # def test_basic(): # besancon_model = besancon.request_besancon('your@email.net',10.5,0.0) # B = asciitable.read(besancon_model,Reader=besancon.BesanconFixed,guess=False) # B.pprint() Resolve 58; no tests for besancon#from astroquery import besancon #import asciitable #from astropy.io.ascii.tests.common import assert_equal # SKIP - don't run tests because Besancon folks don't want them (based on the fact that your@email.net is now rejected) # def test_besancon_reader(): # #assert os.path.exists('besancon_test.txt') # B = asciitable.read('t/besancon_test.txt',Reader=besancon.BesanconFixed,guess=False) # assert_equal(len(B),12) # # def test_basic(): # besancon_model = besancon.request_besancon('your@email.net',10.5,0.0) # B = asciitable.read(besancon_model,Reader=besancon.BesanconFixed,guess=False) # B.pprint()
<commit_before>from astroquery import besancon import asciitable from astropy.io.ascii.tests.common import assert_equal # SKIP - don't run tests because Besancon folks don't want them (based on the fact that your@email.net is now rejected) # def test_besancon_reader(): # #assert os.path.exists('besancon_test.txt') # B = asciitable.read('t/besancon_test.txt',Reader=besancon.BesanconFixed,guess=False) # assert_equal(len(B),12) # # def test_basic(): # besancon_model = besancon.request_besancon('your@email.net',10.5,0.0) # B = asciitable.read(besancon_model,Reader=besancon.BesanconFixed,guess=False) # B.pprint() <commit_msg>Resolve 58; no tests for besancon<commit_after>#from astroquery import besancon #import asciitable #from astropy.io.ascii.tests.common import assert_equal # SKIP - don't run tests because Besancon folks don't want them (based on the fact that your@email.net is now rejected) # def test_besancon_reader(): # #assert os.path.exists('besancon_test.txt') # B = asciitable.read('t/besancon_test.txt',Reader=besancon.BesanconFixed,guess=False) # assert_equal(len(B),12) # # def test_basic(): # besancon_model = besancon.request_besancon('your@email.net',10.5,0.0) # B = asciitable.read(besancon_model,Reader=besancon.BesanconFixed,guess=False) # B.pprint()
2e1b189727616b4c93ad4244299530c738304428
httpobs/scanner/utils.py
httpobs/scanner/utils.py
import socket import tld def valid_hostname(hostname: str) -> bool: """ :param hostname: The hostname requested in the scan :return: True if it's a valid hostname (fqdn in DNS that's not an IP address), False otherwise """ # First, let's try to see if it's an IPv4 address try: socket.inet_aton(hostname) # inet_aton() will throw an exception if hostname is not a valid IP address return False # If we get this far, it's an IP address and therefore not a valid fqdn except: pass # And IPv6 try: socket.inet_pton(socket.AF_INET6, hostname) # same as inet_aton(), but for IPv6 return False except: pass # Then, let's see if it's a TLD; this includes things fuel.aero or co.uk that look like fqdns but aren't if hostname in tld.get_tld_names(): return False # Then, try to do a lookup on the hostname; this should return at least one entry and should be the first time # that the validator is making a network connection -- the same that requests would make. try: hostname_ips = socket.getaddrinfo(hostname, 443) if len(hostname_ips) < 1: return False except: return False # If we've made it this far, then everything is good to go! Woohoo! return True
import socket def valid_hostname(hostname: str): """ :param hostname: The hostname requested in the scan :return: Hostname if it's valid, otherwise None """ # First, let's try to see if it's an IPv4 address try: socket.inet_aton(hostname) # inet_aton() will throw an exception if hostname is not a valid IP address return None # If we get this far, it's an IP address and therefore not a valid fqdn except: pass # And IPv6 try: socket.inet_pton(socket.AF_INET6, hostname) # same as inet_aton(), but for IPv6 return None except: pass # Then, try to do a lookup on the hostname; this should return at least one entry and should be the first time # that the validator is making a network connection -- the same that requests would make. try: hostname_ips = socket.getaddrinfo(hostname, 443) if len(hostname_ips) < 1: return None except: return None # If we've made it this far, then everything is good to go! Woohoo! return hostname
Remove TLD check, allow for www
Remove TLD check, allow for www
Python
mpl-2.0
april/http-observatory,april/http-observatory,april/http-observatory,mozilla/http-observatory,mozilla/http-observatory,mozilla/http-observatory
import socket import tld def valid_hostname(hostname: str) -> bool: """ :param hostname: The hostname requested in the scan :return: True if it's a valid hostname (fqdn in DNS that's not an IP address), False otherwise """ # First, let's try to see if it's an IPv4 address try: socket.inet_aton(hostname) # inet_aton() will throw an exception if hostname is not a valid IP address return False # If we get this far, it's an IP address and therefore not a valid fqdn except: pass # And IPv6 try: socket.inet_pton(socket.AF_INET6, hostname) # same as inet_aton(), but for IPv6 return False except: pass # Then, let's see if it's a TLD; this includes things fuel.aero or co.uk that look like fqdns but aren't if hostname in tld.get_tld_names(): return False # Then, try to do a lookup on the hostname; this should return at least one entry and should be the first time # that the validator is making a network connection -- the same that requests would make. try: hostname_ips = socket.getaddrinfo(hostname, 443) if len(hostname_ips) < 1: return False except: return False # If we've made it this far, then everything is good to go! Woohoo! return True Remove TLD check, allow for www
import socket def valid_hostname(hostname: str): """ :param hostname: The hostname requested in the scan :return: Hostname if it's valid, otherwise None """ # First, let's try to see if it's an IPv4 address try: socket.inet_aton(hostname) # inet_aton() will throw an exception if hostname is not a valid IP address return None # If we get this far, it's an IP address and therefore not a valid fqdn except: pass # And IPv6 try: socket.inet_pton(socket.AF_INET6, hostname) # same as inet_aton(), but for IPv6 return None except: pass # Then, try to do a lookup on the hostname; this should return at least one entry and should be the first time # that the validator is making a network connection -- the same that requests would make. try: hostname_ips = socket.getaddrinfo(hostname, 443) if len(hostname_ips) < 1: return None except: return None # If we've made it this far, then everything is good to go! Woohoo! return hostname
<commit_before>import socket import tld def valid_hostname(hostname: str) -> bool: """ :param hostname: The hostname requested in the scan :return: True if it's a valid hostname (fqdn in DNS that's not an IP address), False otherwise """ # First, let's try to see if it's an IPv4 address try: socket.inet_aton(hostname) # inet_aton() will throw an exception if hostname is not a valid IP address return False # If we get this far, it's an IP address and therefore not a valid fqdn except: pass # And IPv6 try: socket.inet_pton(socket.AF_INET6, hostname) # same as inet_aton(), but for IPv6 return False except: pass # Then, let's see if it's a TLD; this includes things fuel.aero or co.uk that look like fqdns but aren't if hostname in tld.get_tld_names(): return False # Then, try to do a lookup on the hostname; this should return at least one entry and should be the first time # that the validator is making a network connection -- the same that requests would make. try: hostname_ips = socket.getaddrinfo(hostname, 443) if len(hostname_ips) < 1: return False except: return False # If we've made it this far, then everything is good to go! Woohoo! return True <commit_msg>Remove TLD check, allow for www<commit_after>
import socket def valid_hostname(hostname: str): """ :param hostname: The hostname requested in the scan :return: Hostname if it's valid, otherwise None """ # First, let's try to see if it's an IPv4 address try: socket.inet_aton(hostname) # inet_aton() will throw an exception if hostname is not a valid IP address return None # If we get this far, it's an IP address and therefore not a valid fqdn except: pass # And IPv6 try: socket.inet_pton(socket.AF_INET6, hostname) # same as inet_aton(), but for IPv6 return None except: pass # Then, try to do a lookup on the hostname; this should return at least one entry and should be the first time # that the validator is making a network connection -- the same that requests would make. try: hostname_ips = socket.getaddrinfo(hostname, 443) if len(hostname_ips) < 1: return None except: return None # If we've made it this far, then everything is good to go! Woohoo! return hostname
import socket import tld def valid_hostname(hostname: str) -> bool: """ :param hostname: The hostname requested in the scan :return: True if it's a valid hostname (fqdn in DNS that's not an IP address), False otherwise """ # First, let's try to see if it's an IPv4 address try: socket.inet_aton(hostname) # inet_aton() will throw an exception if hostname is not a valid IP address return False # If we get this far, it's an IP address and therefore not a valid fqdn except: pass # And IPv6 try: socket.inet_pton(socket.AF_INET6, hostname) # same as inet_aton(), but for IPv6 return False except: pass # Then, let's see if it's a TLD; this includes things fuel.aero or co.uk that look like fqdns but aren't if hostname in tld.get_tld_names(): return False # Then, try to do a lookup on the hostname; this should return at least one entry and should be the first time # that the validator is making a network connection -- the same that requests would make. try: hostname_ips = socket.getaddrinfo(hostname, 443) if len(hostname_ips) < 1: return False except: return False # If we've made it this far, then everything is good to go! Woohoo! return True Remove TLD check, allow for wwwimport socket def valid_hostname(hostname: str): """ :param hostname: The hostname requested in the scan :return: Hostname if it's valid, otherwise None """ # First, let's try to see if it's an IPv4 address try: socket.inet_aton(hostname) # inet_aton() will throw an exception if hostname is not a valid IP address return None # If we get this far, it's an IP address and therefore not a valid fqdn except: pass # And IPv6 try: socket.inet_pton(socket.AF_INET6, hostname) # same as inet_aton(), but for IPv6 return None except: pass # Then, try to do a lookup on the hostname; this should return at least one entry and should be the first time # that the validator is making a network connection -- the same that requests would make. try: hostname_ips = socket.getaddrinfo(hostname, 443) if len(hostname_ips) < 1: return None except: return None # If we've made it this far, then everything is good to go! Woohoo! return hostname
<commit_before>import socket import tld def valid_hostname(hostname: str) -> bool: """ :param hostname: The hostname requested in the scan :return: True if it's a valid hostname (fqdn in DNS that's not an IP address), False otherwise """ # First, let's try to see if it's an IPv4 address try: socket.inet_aton(hostname) # inet_aton() will throw an exception if hostname is not a valid IP address return False # If we get this far, it's an IP address and therefore not a valid fqdn except: pass # And IPv6 try: socket.inet_pton(socket.AF_INET6, hostname) # same as inet_aton(), but for IPv6 return False except: pass # Then, let's see if it's a TLD; this includes things fuel.aero or co.uk that look like fqdns but aren't if hostname in tld.get_tld_names(): return False # Then, try to do a lookup on the hostname; this should return at least one entry and should be the first time # that the validator is making a network connection -- the same that requests would make. try: hostname_ips = socket.getaddrinfo(hostname, 443) if len(hostname_ips) < 1: return False except: return False # If we've made it this far, then everything is good to go! Woohoo! return True <commit_msg>Remove TLD check, allow for www<commit_after>import socket def valid_hostname(hostname: str): """ :param hostname: The hostname requested in the scan :return: Hostname if it's valid, otherwise None """ # First, let's try to see if it's an IPv4 address try: socket.inet_aton(hostname) # inet_aton() will throw an exception if hostname is not a valid IP address return None # If we get this far, it's an IP address and therefore not a valid fqdn except: pass # And IPv6 try: socket.inet_pton(socket.AF_INET6, hostname) # same as inet_aton(), but for IPv6 return None except: pass # Then, try to do a lookup on the hostname; this should return at least one entry and should be the first time # that the validator is making a network connection -- the same that requests would make. try: hostname_ips = socket.getaddrinfo(hostname, 443) if len(hostname_ips) < 1: return None except: return None # If we've made it this far, then everything is good to go! Woohoo! return hostname
2b48e786c3e2439876ff41fc82bd814b42d40ca4
app.py
app.py
from flask import Flask import socket app = Flask(__name__) @app.route("/") def index(): return "Hello from FLASK. My Hostname is: %s \n" % (socket.gethostname()) if __name__ == "__main__": app.run(host='0.0.0.0')
#!/usr/bin/env python from flask import Flask app = Flask(__name__) @app.route("/") def index(): return "Hello from FLASK" if __name__ == "__main__": app.run(host='0.0.0.0')
Revert "Added the output for hostname"
Revert "Added the output for hostname" This reverts commit 490fa2d10d8a61ede28b794ed446e569f2f30318.
Python
bsd-2-clause
vioan/minflask
from flask import Flask import socket app = Flask(__name__) @app.route("/") def index(): return "Hello from FLASK. My Hostname is: %s \n" % (socket.gethostname()) if __name__ == "__main__": app.run(host='0.0.0.0') Revert "Added the output for hostname" This reverts commit 490fa2d10d8a61ede28b794ed446e569f2f30318.
#!/usr/bin/env python from flask import Flask app = Flask(__name__) @app.route("/") def index(): return "Hello from FLASK" if __name__ == "__main__": app.run(host='0.0.0.0')
<commit_before>from flask import Flask import socket app = Flask(__name__) @app.route("/") def index(): return "Hello from FLASK. My Hostname is: %s \n" % (socket.gethostname()) if __name__ == "__main__": app.run(host='0.0.0.0') <commit_msg>Revert "Added the output for hostname" This reverts commit 490fa2d10d8a61ede28b794ed446e569f2f30318.<commit_after>
#!/usr/bin/env python from flask import Flask app = Flask(__name__) @app.route("/") def index(): return "Hello from FLASK" if __name__ == "__main__": app.run(host='0.0.0.0')
from flask import Flask import socket app = Flask(__name__) @app.route("/") def index(): return "Hello from FLASK. My Hostname is: %s \n" % (socket.gethostname()) if __name__ == "__main__": app.run(host='0.0.0.0') Revert "Added the output for hostname" This reverts commit 490fa2d10d8a61ede28b794ed446e569f2f30318.#!/usr/bin/env python from flask import Flask app = Flask(__name__) @app.route("/") def index(): return "Hello from FLASK" if __name__ == "__main__": app.run(host='0.0.0.0')
<commit_before>from flask import Flask import socket app = Flask(__name__) @app.route("/") def index(): return "Hello from FLASK. My Hostname is: %s \n" % (socket.gethostname()) if __name__ == "__main__": app.run(host='0.0.0.0') <commit_msg>Revert "Added the output for hostname" This reverts commit 490fa2d10d8a61ede28b794ed446e569f2f30318.<commit_after>#!/usr/bin/env python from flask import Flask app = Flask(__name__) @app.route("/") def index(): return "Hello from FLASK" if __name__ == "__main__": app.run(host='0.0.0.0')
c7a424cb3fb0a037cda04c30d44606515aed829d
chrome/test/functional/test_pyauto.py
chrome/test/functional/test_pyauto.py
#!/usr/bin/env python # Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import unittest import pyauto_functional # Must be imported before pyauto import pyauto class PyAutoTest(pyauto.PyUITest): """Test functionality of the PyAuto framework.""" _EXTRA_CHROME_FLAGS = [ '--scooby-doo=123', '--donald-duck=cool', '--super-mario', '--marvin-the-martian', ] def ExtraChromeFlags(self): """Ensures Chrome is launched with some custom flags. Overrides the default list of extra flags passed to Chrome. See ExtraChromeFlags() in pyauto.py. """ return self._EXTRA_CHROME_FLAGS def testSetCustomChromeFlags(self): """Ensures that Chrome can be launched with custom flags.""" self.NavigateToURL('about://version') for flag in self._EXTRA_CHROME_FLAGS: self.assertEqual(self.FindInPage(flag)['match_count'], 1, msg='Missing expected Chrome flag "%s"' % flag) if __name__ == '__main__': pyauto_functional.Main()
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import unittest import pyauto_functional # Must be imported before pyauto import pyauto class PyAutoTest(pyauto.PyUITest): """Test functionality of the PyAuto framework.""" _EXTRA_CHROME_FLAGS = [ '--scooby-doo=123', '--donald-duck=cool', '--super-mario', '--marvin-the-martian', ] def ExtraChromeFlags(self): """Ensures Chrome is launched with some custom flags. Overrides the default list of extra flags passed to Chrome. See ExtraChromeFlags() in pyauto.py. """ return pyauto.PyUITest.ExtraChromeFlags(self) + self._EXTRA_CHROME_FLAGS def testSetCustomChromeFlags(self): """Ensures that Chrome can be launched with custom flags.""" self.NavigateToURL('about://version') for flag in self._EXTRA_CHROME_FLAGS: self.assertEqual(self.FindInPage(flag)['match_count'], 1, msg='Missing expected Chrome flag "%s"' % flag) if __name__ == '__main__': pyauto_functional.Main()
Update testSetCustomChromeFlags to only append to chrome flags, not override
Update testSetCustomChromeFlags to only append to chrome flags, not override This is in keeping with the spirit of the ExtraChromeFlags() method. Whenever it's overridden, it should only ever append to the list of chrome flags, never completely override it. BUG=None TEST=None R=dennisjeffrey@chromium.org Review URL: https://chromiumcodereview.appspot.com/10041001 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@131597 0039d316-1c4b-4281-b951-d872f2087c98
Python
bsd-3-clause
Jonekee/chromium.src,pozdnyakov/chromium-crosswalk,timopulkkinen/BubbleFish,patrickm/chromium.src,littlstar/chromium.src,hujiajie/pa-chromium,jaruba/chromium.src,hgl888/chromium-crosswalk,hujiajie/pa-chromium,junmin-zhu/chromium-rivertrail,PeterWangIntel/chromium-crosswalk,keishi/chromium,jaruba/chromium.src,junmin-zhu/chromium-rivertrail,bright-sparks/chromium-spacewalk,jaruba/chromium.src,crosswalk-project/chromium-crosswalk-efl,littlstar/chromium.src,jaruba/chromium.src,anirudhSK/chromium,crosswalk-project/chromium-crosswalk-efl,jaruba/chromium.src,robclark/chromium,ChromiumWebApps/chromium,TheTypoMaster/chromium-crosswalk,timopulkkinen/BubbleFish,markYoungH/chromium.src,hgl888/chromium-crosswalk,ondra-novak/chromium.src,chuan9/chromium-crosswalk,robclark/chromium,hujiajie/pa-chromium,hgl888/chromium-crosswalk,markYoungH/chromium.src,chuan9/chromium-crosswalk,Jonekee/chromium.src,ltilve/chromium,hgl888/chromium-crosswalk-efl,ChromiumWebApps/chromium,PeterWangIntel/chromium-crosswalk,hgl888/chromium-crosswalk,keishi/chromium,Chilledheart/chromium,jaruba/chromium.src,zcbenz/cefode-chromium,axinging/chromium-crosswalk,fujunwei/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,pozdnyakov/chromium-crosswalk,hujiajie/pa-chromium,nacl-webkit/chrome_deps,hgl888/chromium-crosswalk-efl,PeterWangIntel/chromium-crosswalk,dushu1203/chromium.src,M4sse/chromium.src,PeterWangIntel/chromium-crosswalk,patrickm/chromium.src,mohamed--abdel-maksoud/chromium.src,krieger-od/nwjs_chromium.src,mohamed--abdel-maksoud/chromium.src,chuan9/chromium-crosswalk,junmin-zhu/chromium-rivertrail,PeterWangIntel/chromium-crosswalk,krieger-od/nwjs_chromium.src,anirudhSK/chromium,mohamed--abdel-maksoud/chromium.src,chuan9/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,axinging/chromium-crosswalk,axinging/chromium-crosswalk,timopulkkinen/BubbleFish,mohamed--abdel-maksoud/chromium.src,Fireblend/chromium-crosswalk,hujiajie/pa-chromium,anirudhSK/chromium,markYoungH/chromium.src,mogoweb/chromium-crosswalk,Chilledheart/chromium,nacl-webkit/chrome_deps,hgl888/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,Just-D/chromium-1,ChromiumWebApps/chromium,hujiajie/pa-chromium,axinging/chromium-crosswalk,ChromiumWebApps/chromium,markYoungH/chromium.src,ondra-novak/chromium.src,keishi/chromium,ondra-novak/chromium.src,pozdnyakov/chromium-crosswalk,bright-sparks/chromium-spacewalk,Pluto-tv/chromium-crosswalk,M4sse/chromium.src,timopulkkinen/BubbleFish,timopulkkinen/BubbleFish,Jonekee/chromium.src,Just-D/chromium-1,dushu1203/chromium.src,krieger-od/nwjs_chromium.src,keishi/chromium,junmin-zhu/chromium-rivertrail,hgl888/chromium-crosswalk-efl,Chilledheart/chromium,M4sse/chromium.src,chuan9/chromium-crosswalk,dednal/chromium.src,ChromiumWebApps/chromium,mohamed--abdel-maksoud/chromium.src,nacl-webkit/chrome_deps,ondra-novak/chromium.src,Pluto-tv/chromium-crosswalk,Just-D/chromium-1,PeterWangIntel/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,ondra-novak/chromium.src,markYoungH/chromium.src,littlstar/chromium.src,robclark/chromium,ltilve/chromium,ondra-novak/chromium.src,markYoungH/chromium.src,Chilledheart/chromium,robclark/chromium,hgl888/chromium-crosswalk-efl,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,mogoweb/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Jonekee/chromium.src,M4sse/chromium.src,pozdnyakov/chromium-crosswalk,hgl888/chromium-crosswalk,bright-sparks/chromium-spacewalk,dednal/chromium.src,zcbenz/cefode-chromium,Chilledheart/chromium,crosswalk-project/chromium-crosswalk-efl,mogoweb/chromium-crosswalk,Chilledheart/chromium,nacl-webkit/chrome_deps,dushu1203/chromium.src,zcbenz/cefode-chromium,krieger-od/nwjs_chromium.src,hgl888/chromium-crosswalk,junmin-zhu/chromium-rivertrail,Fireblend/chromium-crosswalk,patrickm/chromium.src,fujunwei/chromium-crosswalk,timopulkkinen/BubbleFish,PeterWangIntel/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,nacl-webkit/chrome_deps,M4sse/chromium.src,zcbenz/cefode-chromium,ondra-novak/chromium.src,dednal/chromium.src,bright-sparks/chromium-spacewalk,axinging/chromium-crosswalk,keishi/chromium,Fireblend/chromium-crosswalk,junmin-zhu/chromium-rivertrail,junmin-zhu/chromium-rivertrail,dushu1203/chromium.src,keishi/chromium,robclark/chromium,fujunwei/chromium-crosswalk,markYoungH/chromium.src,hgl888/chromium-crosswalk,ltilve/chromium,patrickm/chromium.src,Just-D/chromium-1,mogoweb/chromium-crosswalk,hujiajie/pa-chromium,PeterWangIntel/chromium-crosswalk,hujiajie/pa-chromium,chuan9/chromium-crosswalk,dednal/chromium.src,Chilledheart/chromium,crosswalk-project/chromium-crosswalk-efl,anirudhSK/chromium,mohamed--abdel-maksoud/chromium.src,junmin-zhu/chromium-rivertrail,littlstar/chromium.src,anirudhSK/chromium,zcbenz/cefode-chromium,krieger-od/nwjs_chromium.src,keishi/chromium,pozdnyakov/chromium-crosswalk,timopulkkinen/BubbleFish,M4sse/chromium.src,dushu1203/chromium.src,ChromiumWebApps/chromium,jaruba/chromium.src,Pluto-tv/chromium-crosswalk,nacl-webkit/chrome_deps,fujunwei/chromium-crosswalk,zcbenz/cefode-chromium,M4sse/chromium.src,krieger-od/nwjs_chromium.src,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk-efl,nacl-webkit/chrome_deps,patrickm/chromium.src,axinging/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,patrickm/chromium.src,Jonekee/chromium.src,anirudhSK/chromium,hgl888/chromium-crosswalk-efl,pozdnyakov/chromium-crosswalk,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,dushu1203/chromium.src,patrickm/chromium.src,Fireblend/chromium-crosswalk,bright-sparks/chromium-spacewalk,ChromiumWebApps/chromium,keishi/chromium,TheTypoMaster/chromium-crosswalk,jaruba/chromium.src,anirudhSK/chromium,hgl888/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,anirudhSK/chromium,Chilledheart/chromium,hujiajie/pa-chromium,keishi/chromium,robclark/chromium,robclark/chromium,Fireblend/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,keishi/chromium,robclark/chromium,hgl888/chromium-crosswalk-efl,Pluto-tv/chromium-crosswalk,dednal/chromium.src,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk-efl,fujunwei/chromium-crosswalk,Fireblend/chromium-crosswalk,ltilve/chromium,krieger-od/nwjs_chromium.src,hgl888/chromium-crosswalk,littlstar/chromium.src,Jonekee/chromium.src,Just-D/chromium-1,M4sse/chromium.src,Pluto-tv/chromium-crosswalk,mogoweb/chromium-crosswalk,nacl-webkit/chrome_deps,ChromiumWebApps/chromium,keishi/chromium,mogoweb/chromium-crosswalk,Jonekee/chromium.src,fujunwei/chromium-crosswalk,dushu1203/chromium.src,anirudhSK/chromium,zcbenz/cefode-chromium,mohamed--abdel-maksoud/chromium.src,littlstar/chromium.src,ltilve/chromium,dednal/chromium.src,axinging/chromium-crosswalk,jaruba/chromium.src,krieger-od/nwjs_chromium.src,TheTypoMaster/chromium-crosswalk,mogoweb/chromium-crosswalk,chuan9/chromium-crosswalk,pozdnyakov/chromium-crosswalk,Pluto-tv/chromium-crosswalk,ChromiumWebApps/chromium,bright-sparks/chromium-spacewalk,Jonekee/chromium.src,jaruba/chromium.src,Just-D/chromium-1,littlstar/chromium.src,mogoweb/chromium-crosswalk,markYoungH/chromium.src,nacl-webkit/chrome_deps,pozdnyakov/chromium-crosswalk,ChromiumWebApps/chromium,Just-D/chromium-1,mogoweb/chromium-crosswalk,dushu1203/chromium.src,Jonekee/chromium.src,bright-sparks/chromium-spacewalk,junmin-zhu/chromium-rivertrail,TheTypoMaster/chromium-crosswalk,dushu1203/chromium.src,ChromiumWebApps/chromium,junmin-zhu/chromium-rivertrail,dushu1203/chromium.src,zcbenz/cefode-chromium,hgl888/chromium-crosswalk-efl,littlstar/chromium.src,crosswalk-project/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,dednal/chromium.src,nacl-webkit/chrome_deps,anirudhSK/chromium,markYoungH/chromium.src,M4sse/chromium.src,TheTypoMaster/chromium-crosswalk,krieger-od/nwjs_chromium.src,M4sse/chromium.src,chuan9/chromium-crosswalk,pozdnyakov/chromium-crosswalk,timopulkkinen/BubbleFish,zcbenz/cefode-chromium,Just-D/chromium-1,ltilve/chromium,ondra-novak/chromium.src,dednal/chromium.src,ltilve/chromium,M4sse/chromium.src,ondra-novak/chromium.src,jaruba/chromium.src,fujunwei/chromium-crosswalk,Jonekee/chromium.src,TheTypoMaster/chromium-crosswalk,markYoungH/chromium.src,Fireblend/chromium-crosswalk,ltilve/chromium,robclark/chromium,patrickm/chromium.src,dednal/chromium.src,anirudhSK/chromium,Jonekee/chromium.src,pozdnyakov/chromium-crosswalk,Chilledheart/chromium,ChromiumWebApps/chromium,zcbenz/cefode-chromium,timopulkkinen/BubbleFish,axinging/chromium-crosswalk,krieger-od/nwjs_chromium.src,anirudhSK/chromium,Pluto-tv/chromium-crosswalk,nacl-webkit/chrome_deps,ltilve/chromium,crosswalk-project/chromium-crosswalk-efl,fujunwei/chromium-crosswalk,timopulkkinen/BubbleFish,axinging/chromium-crosswalk,dednal/chromium.src,hujiajie/pa-chromium,timopulkkinen/BubbleFish,pozdnyakov/chromium-crosswalk,Pluto-tv/chromium-crosswalk,junmin-zhu/chromium-rivertrail,krieger-od/nwjs_chromium.src,zcbenz/cefode-chromium,robclark/chromium,markYoungH/chromium.src,hujiajie/pa-chromium,dushu1203/chromium.src,fujunwei/chromium-crosswalk,Pluto-tv/chromium-crosswalk,bright-sparks/chromium-spacewalk,patrickm/chromium.src,dednal/chromium.src,Just-D/chromium-1,bright-sparks/chromium-spacewalk
#!/usr/bin/env python # Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import unittest import pyauto_functional # Must be imported before pyauto import pyauto class PyAutoTest(pyauto.PyUITest): """Test functionality of the PyAuto framework.""" _EXTRA_CHROME_FLAGS = [ '--scooby-doo=123', '--donald-duck=cool', '--super-mario', '--marvin-the-martian', ] def ExtraChromeFlags(self): """Ensures Chrome is launched with some custom flags. Overrides the default list of extra flags passed to Chrome. See ExtraChromeFlags() in pyauto.py. """ return self._EXTRA_CHROME_FLAGS def testSetCustomChromeFlags(self): """Ensures that Chrome can be launched with custom flags.""" self.NavigateToURL('about://version') for flag in self._EXTRA_CHROME_FLAGS: self.assertEqual(self.FindInPage(flag)['match_count'], 1, msg='Missing expected Chrome flag "%s"' % flag) if __name__ == '__main__': pyauto_functional.Main() Update testSetCustomChromeFlags to only append to chrome flags, not override This is in keeping with the spirit of the ExtraChromeFlags() method. Whenever it's overridden, it should only ever append to the list of chrome flags, never completely override it. BUG=None TEST=None R=dennisjeffrey@chromium.org Review URL: https://chromiumcodereview.appspot.com/10041001 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@131597 0039d316-1c4b-4281-b951-d872f2087c98
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import unittest import pyauto_functional # Must be imported before pyauto import pyauto class PyAutoTest(pyauto.PyUITest): """Test functionality of the PyAuto framework.""" _EXTRA_CHROME_FLAGS = [ '--scooby-doo=123', '--donald-duck=cool', '--super-mario', '--marvin-the-martian', ] def ExtraChromeFlags(self): """Ensures Chrome is launched with some custom flags. Overrides the default list of extra flags passed to Chrome. See ExtraChromeFlags() in pyauto.py. """ return pyauto.PyUITest.ExtraChromeFlags(self) + self._EXTRA_CHROME_FLAGS def testSetCustomChromeFlags(self): """Ensures that Chrome can be launched with custom flags.""" self.NavigateToURL('about://version') for flag in self._EXTRA_CHROME_FLAGS: self.assertEqual(self.FindInPage(flag)['match_count'], 1, msg='Missing expected Chrome flag "%s"' % flag) if __name__ == '__main__': pyauto_functional.Main()
<commit_before>#!/usr/bin/env python # Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import unittest import pyauto_functional # Must be imported before pyauto import pyauto class PyAutoTest(pyauto.PyUITest): """Test functionality of the PyAuto framework.""" _EXTRA_CHROME_FLAGS = [ '--scooby-doo=123', '--donald-duck=cool', '--super-mario', '--marvin-the-martian', ] def ExtraChromeFlags(self): """Ensures Chrome is launched with some custom flags. Overrides the default list of extra flags passed to Chrome. See ExtraChromeFlags() in pyauto.py. """ return self._EXTRA_CHROME_FLAGS def testSetCustomChromeFlags(self): """Ensures that Chrome can be launched with custom flags.""" self.NavigateToURL('about://version') for flag in self._EXTRA_CHROME_FLAGS: self.assertEqual(self.FindInPage(flag)['match_count'], 1, msg='Missing expected Chrome flag "%s"' % flag) if __name__ == '__main__': pyauto_functional.Main() <commit_msg>Update testSetCustomChromeFlags to only append to chrome flags, not override This is in keeping with the spirit of the ExtraChromeFlags() method. Whenever it's overridden, it should only ever append to the list of chrome flags, never completely override it. BUG=None TEST=None R=dennisjeffrey@chromium.org Review URL: https://chromiumcodereview.appspot.com/10041001 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@131597 0039d316-1c4b-4281-b951-d872f2087c98<commit_after>
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import unittest import pyauto_functional # Must be imported before pyauto import pyauto class PyAutoTest(pyauto.PyUITest): """Test functionality of the PyAuto framework.""" _EXTRA_CHROME_FLAGS = [ '--scooby-doo=123', '--donald-duck=cool', '--super-mario', '--marvin-the-martian', ] def ExtraChromeFlags(self): """Ensures Chrome is launched with some custom flags. Overrides the default list of extra flags passed to Chrome. See ExtraChromeFlags() in pyauto.py. """ return pyauto.PyUITest.ExtraChromeFlags(self) + self._EXTRA_CHROME_FLAGS def testSetCustomChromeFlags(self): """Ensures that Chrome can be launched with custom flags.""" self.NavigateToURL('about://version') for flag in self._EXTRA_CHROME_FLAGS: self.assertEqual(self.FindInPage(flag)['match_count'], 1, msg='Missing expected Chrome flag "%s"' % flag) if __name__ == '__main__': pyauto_functional.Main()
#!/usr/bin/env python # Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import unittest import pyauto_functional # Must be imported before pyauto import pyauto class PyAutoTest(pyauto.PyUITest): """Test functionality of the PyAuto framework.""" _EXTRA_CHROME_FLAGS = [ '--scooby-doo=123', '--donald-duck=cool', '--super-mario', '--marvin-the-martian', ] def ExtraChromeFlags(self): """Ensures Chrome is launched with some custom flags. Overrides the default list of extra flags passed to Chrome. See ExtraChromeFlags() in pyauto.py. """ return self._EXTRA_CHROME_FLAGS def testSetCustomChromeFlags(self): """Ensures that Chrome can be launched with custom flags.""" self.NavigateToURL('about://version') for flag in self._EXTRA_CHROME_FLAGS: self.assertEqual(self.FindInPage(flag)['match_count'], 1, msg='Missing expected Chrome flag "%s"' % flag) if __name__ == '__main__': pyauto_functional.Main() Update testSetCustomChromeFlags to only append to chrome flags, not override This is in keeping with the spirit of the ExtraChromeFlags() method. Whenever it's overridden, it should only ever append to the list of chrome flags, never completely override it. BUG=None TEST=None R=dennisjeffrey@chromium.org Review URL: https://chromiumcodereview.appspot.com/10041001 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@131597 0039d316-1c4b-4281-b951-d872f2087c98#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import unittest import pyauto_functional # Must be imported before pyauto import pyauto class PyAutoTest(pyauto.PyUITest): """Test functionality of the PyAuto framework.""" _EXTRA_CHROME_FLAGS = [ '--scooby-doo=123', '--donald-duck=cool', '--super-mario', '--marvin-the-martian', ] def ExtraChromeFlags(self): """Ensures Chrome is launched with some custom flags. Overrides the default list of extra flags passed to Chrome. See ExtraChromeFlags() in pyauto.py. """ return pyauto.PyUITest.ExtraChromeFlags(self) + self._EXTRA_CHROME_FLAGS def testSetCustomChromeFlags(self): """Ensures that Chrome can be launched with custom flags.""" self.NavigateToURL('about://version') for flag in self._EXTRA_CHROME_FLAGS: self.assertEqual(self.FindInPage(flag)['match_count'], 1, msg='Missing expected Chrome flag "%s"' % flag) if __name__ == '__main__': pyauto_functional.Main()
<commit_before>#!/usr/bin/env python # Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import unittest import pyauto_functional # Must be imported before pyauto import pyauto class PyAutoTest(pyauto.PyUITest): """Test functionality of the PyAuto framework.""" _EXTRA_CHROME_FLAGS = [ '--scooby-doo=123', '--donald-duck=cool', '--super-mario', '--marvin-the-martian', ] def ExtraChromeFlags(self): """Ensures Chrome is launched with some custom flags. Overrides the default list of extra flags passed to Chrome. See ExtraChromeFlags() in pyauto.py. """ return self._EXTRA_CHROME_FLAGS def testSetCustomChromeFlags(self): """Ensures that Chrome can be launched with custom flags.""" self.NavigateToURL('about://version') for flag in self._EXTRA_CHROME_FLAGS: self.assertEqual(self.FindInPage(flag)['match_count'], 1, msg='Missing expected Chrome flag "%s"' % flag) if __name__ == '__main__': pyauto_functional.Main() <commit_msg>Update testSetCustomChromeFlags to only append to chrome flags, not override This is in keeping with the spirit of the ExtraChromeFlags() method. Whenever it's overridden, it should only ever append to the list of chrome flags, never completely override it. BUG=None TEST=None R=dennisjeffrey@chromium.org Review URL: https://chromiumcodereview.appspot.com/10041001 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@131597 0039d316-1c4b-4281-b951-d872f2087c98<commit_after>#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import unittest import pyauto_functional # Must be imported before pyauto import pyauto class PyAutoTest(pyauto.PyUITest): """Test functionality of the PyAuto framework.""" _EXTRA_CHROME_FLAGS = [ '--scooby-doo=123', '--donald-duck=cool', '--super-mario', '--marvin-the-martian', ] def ExtraChromeFlags(self): """Ensures Chrome is launched with some custom flags. Overrides the default list of extra flags passed to Chrome. See ExtraChromeFlags() in pyauto.py. """ return pyauto.PyUITest.ExtraChromeFlags(self) + self._EXTRA_CHROME_FLAGS def testSetCustomChromeFlags(self): """Ensures that Chrome can be launched with custom flags.""" self.NavigateToURL('about://version') for flag in self._EXTRA_CHROME_FLAGS: self.assertEqual(self.FindInPage(flag)['match_count'], 1, msg='Missing expected Chrome flag "%s"' % flag) if __name__ == '__main__': pyauto_functional.Main()
6c03955a7ef5cea7733daae0aa4895607b40de97
src/collectors/heartbeat/heartbeat.py
src/collectors/heartbeat/heartbeat.py
# coding=utf-8 """ Send a value of 1 as a heartbeat every time this collector is invoked. #### Dependencies None #### Usage Add the collector config as : enabled = True path = netuitive Metrics are collected as : - metrics.heartbeat Netuitive Change History ======================== DVG 2016/11/14 Initial version. """ import diamond.collector class HeartbeatCollector(diamond.collector.Collector): def collect(self): self.publish_gauge("metrics.heartbeat", 1)
# coding=utf-8 """ Send a value of 1 as a heartbeat every time this collector is invoked. #### Dependencies None #### Usage Add the collector config as : enabled = True path = netuitive Metrics are collected as : - metrics.heartbeat Netuitive Change History ======================== DVG 2016/11/14 Initial version. """ import diamond.collector from diamond.utils.config import load_config as load_server_config try: import netuitive except ImportError: netuitive = None class HeartbeatCollector(diamond.collector.Collector): def __init__(self, *args, **kwargs): super(HeartbeatCollector, self).__init__(*args, **kwargs) self.hostname = self.get_hostname() self.interval = self.config['interval'] if not netuitive: self.log.error('netuitive import failed. Heartbeat collector disabled') self.enabled = False return try: self.version = self._get_version() self.api = netuitive.Client(self.config['url'], self.config['api_key'], self.version) except Exception as e: self.log.debug(e) def collect(self): check = netuitive.Check('heartbeat', self.hostname, self.interval) self.api.post_check(check)
Update the HeartbeatCollector to send in Metricly checks
Update the HeartbeatCollector to send in Metricly checks
Python
mit
Netuitive/netuitive-diamond,Netuitive/netuitive-diamond,Netuitive/netuitive-diamond,Netuitive/netuitive-diamond
# coding=utf-8 """ Send a value of 1 as a heartbeat every time this collector is invoked. #### Dependencies None #### Usage Add the collector config as : enabled = True path = netuitive Metrics are collected as : - metrics.heartbeat Netuitive Change History ======================== DVG 2016/11/14 Initial version. """ import diamond.collector class HeartbeatCollector(diamond.collector.Collector): def collect(self): self.publish_gauge("metrics.heartbeat", 1)Update the HeartbeatCollector to send in Metricly checks
# coding=utf-8 """ Send a value of 1 as a heartbeat every time this collector is invoked. #### Dependencies None #### Usage Add the collector config as : enabled = True path = netuitive Metrics are collected as : - metrics.heartbeat Netuitive Change History ======================== DVG 2016/11/14 Initial version. """ import diamond.collector from diamond.utils.config import load_config as load_server_config try: import netuitive except ImportError: netuitive = None class HeartbeatCollector(diamond.collector.Collector): def __init__(self, *args, **kwargs): super(HeartbeatCollector, self).__init__(*args, **kwargs) self.hostname = self.get_hostname() self.interval = self.config['interval'] if not netuitive: self.log.error('netuitive import failed. Heartbeat collector disabled') self.enabled = False return try: self.version = self._get_version() self.api = netuitive.Client(self.config['url'], self.config['api_key'], self.version) except Exception as e: self.log.debug(e) def collect(self): check = netuitive.Check('heartbeat', self.hostname, self.interval) self.api.post_check(check)
<commit_before># coding=utf-8 """ Send a value of 1 as a heartbeat every time this collector is invoked. #### Dependencies None #### Usage Add the collector config as : enabled = True path = netuitive Metrics are collected as : - metrics.heartbeat Netuitive Change History ======================== DVG 2016/11/14 Initial version. """ import diamond.collector class HeartbeatCollector(diamond.collector.Collector): def collect(self): self.publish_gauge("metrics.heartbeat", 1)<commit_msg>Update the HeartbeatCollector to send in Metricly checks<commit_after>
# coding=utf-8 """ Send a value of 1 as a heartbeat every time this collector is invoked. #### Dependencies None #### Usage Add the collector config as : enabled = True path = netuitive Metrics are collected as : - metrics.heartbeat Netuitive Change History ======================== DVG 2016/11/14 Initial version. """ import diamond.collector from diamond.utils.config import load_config as load_server_config try: import netuitive except ImportError: netuitive = None class HeartbeatCollector(diamond.collector.Collector): def __init__(self, *args, **kwargs): super(HeartbeatCollector, self).__init__(*args, **kwargs) self.hostname = self.get_hostname() self.interval = self.config['interval'] if not netuitive: self.log.error('netuitive import failed. Heartbeat collector disabled') self.enabled = False return try: self.version = self._get_version() self.api = netuitive.Client(self.config['url'], self.config['api_key'], self.version) except Exception as e: self.log.debug(e) def collect(self): check = netuitive.Check('heartbeat', self.hostname, self.interval) self.api.post_check(check)
# coding=utf-8 """ Send a value of 1 as a heartbeat every time this collector is invoked. #### Dependencies None #### Usage Add the collector config as : enabled = True path = netuitive Metrics are collected as : - metrics.heartbeat Netuitive Change History ======================== DVG 2016/11/14 Initial version. """ import diamond.collector class HeartbeatCollector(diamond.collector.Collector): def collect(self): self.publish_gauge("metrics.heartbeat", 1)Update the HeartbeatCollector to send in Metricly checks# coding=utf-8 """ Send a value of 1 as a heartbeat every time this collector is invoked. #### Dependencies None #### Usage Add the collector config as : enabled = True path = netuitive Metrics are collected as : - metrics.heartbeat Netuitive Change History ======================== DVG 2016/11/14 Initial version. """ import diamond.collector from diamond.utils.config import load_config as load_server_config try: import netuitive except ImportError: netuitive = None class HeartbeatCollector(diamond.collector.Collector): def __init__(self, *args, **kwargs): super(HeartbeatCollector, self).__init__(*args, **kwargs) self.hostname = self.get_hostname() self.interval = self.config['interval'] if not netuitive: self.log.error('netuitive import failed. Heartbeat collector disabled') self.enabled = False return try: self.version = self._get_version() self.api = netuitive.Client(self.config['url'], self.config['api_key'], self.version) except Exception as e: self.log.debug(e) def collect(self): check = netuitive.Check('heartbeat', self.hostname, self.interval) self.api.post_check(check)
<commit_before># coding=utf-8 """ Send a value of 1 as a heartbeat every time this collector is invoked. #### Dependencies None #### Usage Add the collector config as : enabled = True path = netuitive Metrics are collected as : - metrics.heartbeat Netuitive Change History ======================== DVG 2016/11/14 Initial version. """ import diamond.collector class HeartbeatCollector(diamond.collector.Collector): def collect(self): self.publish_gauge("metrics.heartbeat", 1)<commit_msg>Update the HeartbeatCollector to send in Metricly checks<commit_after># coding=utf-8 """ Send a value of 1 as a heartbeat every time this collector is invoked. #### Dependencies None #### Usage Add the collector config as : enabled = True path = netuitive Metrics are collected as : - metrics.heartbeat Netuitive Change History ======================== DVG 2016/11/14 Initial version. """ import diamond.collector from diamond.utils.config import load_config as load_server_config try: import netuitive except ImportError: netuitive = None class HeartbeatCollector(diamond.collector.Collector): def __init__(self, *args, **kwargs): super(HeartbeatCollector, self).__init__(*args, **kwargs) self.hostname = self.get_hostname() self.interval = self.config['interval'] if not netuitive: self.log.error('netuitive import failed. Heartbeat collector disabled') self.enabled = False return try: self.version = self._get_version() self.api = netuitive.Client(self.config['url'], self.config['api_key'], self.version) except Exception as e: self.log.debug(e) def collect(self): check = netuitive.Check('heartbeat', self.hostname, self.interval) self.api.post_check(check)
03d7ac3697d19b387287d8bcbf166f5cdc7e97f3
spec/object_mother.py
spec/object_mother.py
from functools import partial from mamba.example_group import ExampleGroup, PendingExampleGroup from mamba.example import Example, PendingExample IRRELEVANT_SUBJECT='irrelevant subject' def an_example_group(subject=IRRELEVANT_SUBJECT): return ExampleGroup(IRRELEVANT_SUBJECT) def a_pending_example_group(subject=IRRELEVANT_SUBJECT): return PendingExampleGroup(IRRELEVANT_SUBJECT) def an_example(context): return Example(partial(_successful_test, context)) def a_pending_example(context): return PendingExample(partial(_successful_test, context)) def _successful_test(context): context.was_run = True def a_failing_example(): return Example(_failing_test) def _failing_test(): raise ValueError()
from functools import partial from mamba.example_group import ExampleGroup, PendingExampleGroup from mamba.example import Example, PendingExample IRRELEVANT_SUBJECT='irrelevant subject' def an_example_group(subject=IRRELEVANT_SUBJECT): return ExampleGroup(IRRELEVANT_SUBJECT) def a_pending_example_group(subject=IRRELEVANT_SUBJECT): return PendingExampleGroup(IRRELEVANT_SUBJECT) def an_example(context): return Example(partial(_successful_test, context)) def a_pending_example(context): return PendingExample(partial(_successful_test, context)) def _successful_test(context): context.was_run = True def a_failing_example(): return Example(_failing_test) def _failing_test(): raise ValueError()
Add a line to end of file
Add a line to end of file
Python
mit
eferro/mamba,jaimegildesagredo/mamba,markng/mamba,dex4er/mamba,alejandrodob/mamba,nestorsalceda/mamba,angelsanz/mamba
from functools import partial from mamba.example_group import ExampleGroup, PendingExampleGroup from mamba.example import Example, PendingExample IRRELEVANT_SUBJECT='irrelevant subject' def an_example_group(subject=IRRELEVANT_SUBJECT): return ExampleGroup(IRRELEVANT_SUBJECT) def a_pending_example_group(subject=IRRELEVANT_SUBJECT): return PendingExampleGroup(IRRELEVANT_SUBJECT) def an_example(context): return Example(partial(_successful_test, context)) def a_pending_example(context): return PendingExample(partial(_successful_test, context)) def _successful_test(context): context.was_run = True def a_failing_example(): return Example(_failing_test) def _failing_test(): raise ValueError() Add a line to end of file
from functools import partial from mamba.example_group import ExampleGroup, PendingExampleGroup from mamba.example import Example, PendingExample IRRELEVANT_SUBJECT='irrelevant subject' def an_example_group(subject=IRRELEVANT_SUBJECT): return ExampleGroup(IRRELEVANT_SUBJECT) def a_pending_example_group(subject=IRRELEVANT_SUBJECT): return PendingExampleGroup(IRRELEVANT_SUBJECT) def an_example(context): return Example(partial(_successful_test, context)) def a_pending_example(context): return PendingExample(partial(_successful_test, context)) def _successful_test(context): context.was_run = True def a_failing_example(): return Example(_failing_test) def _failing_test(): raise ValueError()
<commit_before>from functools import partial from mamba.example_group import ExampleGroup, PendingExampleGroup from mamba.example import Example, PendingExample IRRELEVANT_SUBJECT='irrelevant subject' def an_example_group(subject=IRRELEVANT_SUBJECT): return ExampleGroup(IRRELEVANT_SUBJECT) def a_pending_example_group(subject=IRRELEVANT_SUBJECT): return PendingExampleGroup(IRRELEVANT_SUBJECT) def an_example(context): return Example(partial(_successful_test, context)) def a_pending_example(context): return PendingExample(partial(_successful_test, context)) def _successful_test(context): context.was_run = True def a_failing_example(): return Example(_failing_test) def _failing_test(): raise ValueError() <commit_msg>Add a line to end of file<commit_after>
from functools import partial from mamba.example_group import ExampleGroup, PendingExampleGroup from mamba.example import Example, PendingExample IRRELEVANT_SUBJECT='irrelevant subject' def an_example_group(subject=IRRELEVANT_SUBJECT): return ExampleGroup(IRRELEVANT_SUBJECT) def a_pending_example_group(subject=IRRELEVANT_SUBJECT): return PendingExampleGroup(IRRELEVANT_SUBJECT) def an_example(context): return Example(partial(_successful_test, context)) def a_pending_example(context): return PendingExample(partial(_successful_test, context)) def _successful_test(context): context.was_run = True def a_failing_example(): return Example(_failing_test) def _failing_test(): raise ValueError()
from functools import partial from mamba.example_group import ExampleGroup, PendingExampleGroup from mamba.example import Example, PendingExample IRRELEVANT_SUBJECT='irrelevant subject' def an_example_group(subject=IRRELEVANT_SUBJECT): return ExampleGroup(IRRELEVANT_SUBJECT) def a_pending_example_group(subject=IRRELEVANT_SUBJECT): return PendingExampleGroup(IRRELEVANT_SUBJECT) def an_example(context): return Example(partial(_successful_test, context)) def a_pending_example(context): return PendingExample(partial(_successful_test, context)) def _successful_test(context): context.was_run = True def a_failing_example(): return Example(_failing_test) def _failing_test(): raise ValueError() Add a line to end of filefrom functools import partial from mamba.example_group import ExampleGroup, PendingExampleGroup from mamba.example import Example, PendingExample IRRELEVANT_SUBJECT='irrelevant subject' def an_example_group(subject=IRRELEVANT_SUBJECT): return ExampleGroup(IRRELEVANT_SUBJECT) def a_pending_example_group(subject=IRRELEVANT_SUBJECT): return PendingExampleGroup(IRRELEVANT_SUBJECT) def an_example(context): return Example(partial(_successful_test, context)) def a_pending_example(context): return PendingExample(partial(_successful_test, context)) def _successful_test(context): context.was_run = True def a_failing_example(): return Example(_failing_test) def _failing_test(): raise ValueError()
<commit_before>from functools import partial from mamba.example_group import ExampleGroup, PendingExampleGroup from mamba.example import Example, PendingExample IRRELEVANT_SUBJECT='irrelevant subject' def an_example_group(subject=IRRELEVANT_SUBJECT): return ExampleGroup(IRRELEVANT_SUBJECT) def a_pending_example_group(subject=IRRELEVANT_SUBJECT): return PendingExampleGroup(IRRELEVANT_SUBJECT) def an_example(context): return Example(partial(_successful_test, context)) def a_pending_example(context): return PendingExample(partial(_successful_test, context)) def _successful_test(context): context.was_run = True def a_failing_example(): return Example(_failing_test) def _failing_test(): raise ValueError() <commit_msg>Add a line to end of file<commit_after>from functools import partial from mamba.example_group import ExampleGroup, PendingExampleGroup from mamba.example import Example, PendingExample IRRELEVANT_SUBJECT='irrelevant subject' def an_example_group(subject=IRRELEVANT_SUBJECT): return ExampleGroup(IRRELEVANT_SUBJECT) def a_pending_example_group(subject=IRRELEVANT_SUBJECT): return PendingExampleGroup(IRRELEVANT_SUBJECT) def an_example(context): return Example(partial(_successful_test, context)) def a_pending_example(context): return PendingExample(partial(_successful_test, context)) def _successful_test(context): context.was_run = True def a_failing_example(): return Example(_failing_test) def _failing_test(): raise ValueError()
8831254691cec37266282b89e9a603f98142ead0
sessionhack.py
sessionhack.py
import traceback import sys class SessionHackException(Exception): """ Raised when something goes wrong. """ class SessionHack(object): """ The SessionHack middleware is used to catch any exceptions that occur; this makes debugging easier. Typically debugging can be painful because the trace and error is only shown in the web page. """ def __init__(self, app, render_call): self.app = app self.render_call = render_call def __call__(self, env, start_response): error = False try: ret = self.app(env, start_response) except Exception, e: print 'Exception in SessionHack:', e.message print '-' * 60 traceback.print_exc(file=sys.stdout) print '-' * 60 ret = self.render_call(env, str(e)) #raise SessionHackException(e.message) error = True finally: pass if error: start_response('200 OK', [('Content-Type', 'text/html')]) return ret
import traceback import sys class SessionHackException(Exception): """ Raised when something goes wrong. """ class SessionHack(object): """ The SessionHack middleware is used to catch any exceptions that occur; this makes debugging easier. Typically debugging can be painful because the trace and error is only shown in the web page. """ def __init__(self, app, render_call): self.app = app self.render_call = render_call def __call__(self, env, start_response): error = False try: ret = self.app(env, start_response) except Exception, e: print 'Exception in SessionHack:', e.message print '-' * 60 traceback.print_exc(file=sys.stdout) print '-' * 60 ret = self.render_call(env, str(e)) #raise SessionHackException(e.message) error = True finally: pass if error: start_response('200 OK', [('Content-Type', 'text/html;charset=utf8')]) return ret
Fix encoding on error page.
pyroTorrent: Fix encoding on error page.
Python
agpl-3.0
MerlijnWajer/pyroTorrent,MerlijnWajer/pyroTorrent
import traceback import sys class SessionHackException(Exception): """ Raised when something goes wrong. """ class SessionHack(object): """ The SessionHack middleware is used to catch any exceptions that occur; this makes debugging easier. Typically debugging can be painful because the trace and error is only shown in the web page. """ def __init__(self, app, render_call): self.app = app self.render_call = render_call def __call__(self, env, start_response): error = False try: ret = self.app(env, start_response) except Exception, e: print 'Exception in SessionHack:', e.message print '-' * 60 traceback.print_exc(file=sys.stdout) print '-' * 60 ret = self.render_call(env, str(e)) #raise SessionHackException(e.message) error = True finally: pass if error: start_response('200 OK', [('Content-Type', 'text/html')]) return ret pyroTorrent: Fix encoding on error page.
import traceback import sys class SessionHackException(Exception): """ Raised when something goes wrong. """ class SessionHack(object): """ The SessionHack middleware is used to catch any exceptions that occur; this makes debugging easier. Typically debugging can be painful because the trace and error is only shown in the web page. """ def __init__(self, app, render_call): self.app = app self.render_call = render_call def __call__(self, env, start_response): error = False try: ret = self.app(env, start_response) except Exception, e: print 'Exception in SessionHack:', e.message print '-' * 60 traceback.print_exc(file=sys.stdout) print '-' * 60 ret = self.render_call(env, str(e)) #raise SessionHackException(e.message) error = True finally: pass if error: start_response('200 OK', [('Content-Type', 'text/html;charset=utf8')]) return ret
<commit_before>import traceback import sys class SessionHackException(Exception): """ Raised when something goes wrong. """ class SessionHack(object): """ The SessionHack middleware is used to catch any exceptions that occur; this makes debugging easier. Typically debugging can be painful because the trace and error is only shown in the web page. """ def __init__(self, app, render_call): self.app = app self.render_call = render_call def __call__(self, env, start_response): error = False try: ret = self.app(env, start_response) except Exception, e: print 'Exception in SessionHack:', e.message print '-' * 60 traceback.print_exc(file=sys.stdout) print '-' * 60 ret = self.render_call(env, str(e)) #raise SessionHackException(e.message) error = True finally: pass if error: start_response('200 OK', [('Content-Type', 'text/html')]) return ret <commit_msg>pyroTorrent: Fix encoding on error page.<commit_after>
import traceback import sys class SessionHackException(Exception): """ Raised when something goes wrong. """ class SessionHack(object): """ The SessionHack middleware is used to catch any exceptions that occur; this makes debugging easier. Typically debugging can be painful because the trace and error is only shown in the web page. """ def __init__(self, app, render_call): self.app = app self.render_call = render_call def __call__(self, env, start_response): error = False try: ret = self.app(env, start_response) except Exception, e: print 'Exception in SessionHack:', e.message print '-' * 60 traceback.print_exc(file=sys.stdout) print '-' * 60 ret = self.render_call(env, str(e)) #raise SessionHackException(e.message) error = True finally: pass if error: start_response('200 OK', [('Content-Type', 'text/html;charset=utf8')]) return ret
import traceback import sys class SessionHackException(Exception): """ Raised when something goes wrong. """ class SessionHack(object): """ The SessionHack middleware is used to catch any exceptions that occur; this makes debugging easier. Typically debugging can be painful because the trace and error is only shown in the web page. """ def __init__(self, app, render_call): self.app = app self.render_call = render_call def __call__(self, env, start_response): error = False try: ret = self.app(env, start_response) except Exception, e: print 'Exception in SessionHack:', e.message print '-' * 60 traceback.print_exc(file=sys.stdout) print '-' * 60 ret = self.render_call(env, str(e)) #raise SessionHackException(e.message) error = True finally: pass if error: start_response('200 OK', [('Content-Type', 'text/html')]) return ret pyroTorrent: Fix encoding on error page.import traceback import sys class SessionHackException(Exception): """ Raised when something goes wrong. """ class SessionHack(object): """ The SessionHack middleware is used to catch any exceptions that occur; this makes debugging easier. Typically debugging can be painful because the trace and error is only shown in the web page. """ def __init__(self, app, render_call): self.app = app self.render_call = render_call def __call__(self, env, start_response): error = False try: ret = self.app(env, start_response) except Exception, e: print 'Exception in SessionHack:', e.message print '-' * 60 traceback.print_exc(file=sys.stdout) print '-' * 60 ret = self.render_call(env, str(e)) #raise SessionHackException(e.message) error = True finally: pass if error: start_response('200 OK', [('Content-Type', 'text/html;charset=utf8')]) return ret
<commit_before>import traceback import sys class SessionHackException(Exception): """ Raised when something goes wrong. """ class SessionHack(object): """ The SessionHack middleware is used to catch any exceptions that occur; this makes debugging easier. Typically debugging can be painful because the trace and error is only shown in the web page. """ def __init__(self, app, render_call): self.app = app self.render_call = render_call def __call__(self, env, start_response): error = False try: ret = self.app(env, start_response) except Exception, e: print 'Exception in SessionHack:', e.message print '-' * 60 traceback.print_exc(file=sys.stdout) print '-' * 60 ret = self.render_call(env, str(e)) #raise SessionHackException(e.message) error = True finally: pass if error: start_response('200 OK', [('Content-Type', 'text/html')]) return ret <commit_msg>pyroTorrent: Fix encoding on error page.<commit_after>import traceback import sys class SessionHackException(Exception): """ Raised when something goes wrong. """ class SessionHack(object): """ The SessionHack middleware is used to catch any exceptions that occur; this makes debugging easier. Typically debugging can be painful because the trace and error is only shown in the web page. """ def __init__(self, app, render_call): self.app = app self.render_call = render_call def __call__(self, env, start_response): error = False try: ret = self.app(env, start_response) except Exception, e: print 'Exception in SessionHack:', e.message print '-' * 60 traceback.print_exc(file=sys.stdout) print '-' * 60 ret = self.render_call(env, str(e)) #raise SessionHackException(e.message) error = True finally: pass if error: start_response('200 OK', [('Content-Type', 'text/html;charset=utf8')]) return ret
6440680668d10f2d135914532d34249d96ec75c5
registration/forms.py
registration/forms.py
from django import forms from registration import constants class CompanyForm(forms.Form): company_number = forms.CharField( label='Company number', help_text=('This is the 8-digit number on the company certificate of ' 'incorporation.'), max_length=8, min_length=8, ) class CompanyBasicInfoForm(forms.Form): company_name = forms.CharField() website = forms.URLField() description = forms.CharField(widget=forms.Textarea) class AimsForm(forms.Form): aim_one = forms.ChoiceField(choices=constants.AIMS) aim_two = forms.ChoiceField(choices=constants.AIMS) class UserForm(forms.Form): name = forms.CharField(label='Full name') email = forms.EmailField(label='Email address') password = forms.CharField(widget=forms.PasswordInput()) terms_agreed = forms.BooleanField() referrer = forms.CharField(required=False, widget=forms.HiddenInput())
from django import forms from registration import constants class CompanyForm(forms.Form): company_number = forms.CharField( label='Company number', help_text=('This is the 8-digit number on the company certificate of ' 'incorporation.'), max_length=8, min_length=8, ) class CompanyBasicInfoForm(forms.Form): # TODO: ED-145 # Make sure all fields have char limits once the models are defined company_name = forms.CharField() website = forms.URLField() description = forms.CharField(widget=forms.Textarea) class AimsForm(forms.Form): aim_one = forms.ChoiceField(choices=constants.AIMS) aim_two = forms.ChoiceField(choices=constants.AIMS) class UserForm(forms.Form): name = forms.CharField(label='Full name') email = forms.EmailField(label='Email address') password = forms.CharField(widget=forms.PasswordInput()) terms_agreed = forms.BooleanField() referrer = forms.CharField(required=False, widget=forms.HiddenInput())
Add TODO comment for char limits
Add TODO comment for char limits
Python
mit
uktrade/directory-ui-supplier,uktrade/directory-ui-supplier,uktrade/directory-ui-supplier
from django import forms from registration import constants class CompanyForm(forms.Form): company_number = forms.CharField( label='Company number', help_text=('This is the 8-digit number on the company certificate of ' 'incorporation.'), max_length=8, min_length=8, ) class CompanyBasicInfoForm(forms.Form): company_name = forms.CharField() website = forms.URLField() description = forms.CharField(widget=forms.Textarea) class AimsForm(forms.Form): aim_one = forms.ChoiceField(choices=constants.AIMS) aim_two = forms.ChoiceField(choices=constants.AIMS) class UserForm(forms.Form): name = forms.CharField(label='Full name') email = forms.EmailField(label='Email address') password = forms.CharField(widget=forms.PasswordInput()) terms_agreed = forms.BooleanField() referrer = forms.CharField(required=False, widget=forms.HiddenInput()) Add TODO comment for char limits
from django import forms from registration import constants class CompanyForm(forms.Form): company_number = forms.CharField( label='Company number', help_text=('This is the 8-digit number on the company certificate of ' 'incorporation.'), max_length=8, min_length=8, ) class CompanyBasicInfoForm(forms.Form): # TODO: ED-145 # Make sure all fields have char limits once the models are defined company_name = forms.CharField() website = forms.URLField() description = forms.CharField(widget=forms.Textarea) class AimsForm(forms.Form): aim_one = forms.ChoiceField(choices=constants.AIMS) aim_two = forms.ChoiceField(choices=constants.AIMS) class UserForm(forms.Form): name = forms.CharField(label='Full name') email = forms.EmailField(label='Email address') password = forms.CharField(widget=forms.PasswordInput()) terms_agreed = forms.BooleanField() referrer = forms.CharField(required=False, widget=forms.HiddenInput())
<commit_before>from django import forms from registration import constants class CompanyForm(forms.Form): company_number = forms.CharField( label='Company number', help_text=('This is the 8-digit number on the company certificate of ' 'incorporation.'), max_length=8, min_length=8, ) class CompanyBasicInfoForm(forms.Form): company_name = forms.CharField() website = forms.URLField() description = forms.CharField(widget=forms.Textarea) class AimsForm(forms.Form): aim_one = forms.ChoiceField(choices=constants.AIMS) aim_two = forms.ChoiceField(choices=constants.AIMS) class UserForm(forms.Form): name = forms.CharField(label='Full name') email = forms.EmailField(label='Email address') password = forms.CharField(widget=forms.PasswordInput()) terms_agreed = forms.BooleanField() referrer = forms.CharField(required=False, widget=forms.HiddenInput()) <commit_msg>Add TODO comment for char limits<commit_after>
from django import forms from registration import constants class CompanyForm(forms.Form): company_number = forms.CharField( label='Company number', help_text=('This is the 8-digit number on the company certificate of ' 'incorporation.'), max_length=8, min_length=8, ) class CompanyBasicInfoForm(forms.Form): # TODO: ED-145 # Make sure all fields have char limits once the models are defined company_name = forms.CharField() website = forms.URLField() description = forms.CharField(widget=forms.Textarea) class AimsForm(forms.Form): aim_one = forms.ChoiceField(choices=constants.AIMS) aim_two = forms.ChoiceField(choices=constants.AIMS) class UserForm(forms.Form): name = forms.CharField(label='Full name') email = forms.EmailField(label='Email address') password = forms.CharField(widget=forms.PasswordInput()) terms_agreed = forms.BooleanField() referrer = forms.CharField(required=False, widget=forms.HiddenInput())
from django import forms from registration import constants class CompanyForm(forms.Form): company_number = forms.CharField( label='Company number', help_text=('This is the 8-digit number on the company certificate of ' 'incorporation.'), max_length=8, min_length=8, ) class CompanyBasicInfoForm(forms.Form): company_name = forms.CharField() website = forms.URLField() description = forms.CharField(widget=forms.Textarea) class AimsForm(forms.Form): aim_one = forms.ChoiceField(choices=constants.AIMS) aim_two = forms.ChoiceField(choices=constants.AIMS) class UserForm(forms.Form): name = forms.CharField(label='Full name') email = forms.EmailField(label='Email address') password = forms.CharField(widget=forms.PasswordInput()) terms_agreed = forms.BooleanField() referrer = forms.CharField(required=False, widget=forms.HiddenInput()) Add TODO comment for char limitsfrom django import forms from registration import constants class CompanyForm(forms.Form): company_number = forms.CharField( label='Company number', help_text=('This is the 8-digit number on the company certificate of ' 'incorporation.'), max_length=8, min_length=8, ) class CompanyBasicInfoForm(forms.Form): # TODO: ED-145 # Make sure all fields have char limits once the models are defined company_name = forms.CharField() website = forms.URLField() description = forms.CharField(widget=forms.Textarea) class AimsForm(forms.Form): aim_one = forms.ChoiceField(choices=constants.AIMS) aim_two = forms.ChoiceField(choices=constants.AIMS) class UserForm(forms.Form): name = forms.CharField(label='Full name') email = forms.EmailField(label='Email address') password = forms.CharField(widget=forms.PasswordInput()) terms_agreed = forms.BooleanField() referrer = forms.CharField(required=False, widget=forms.HiddenInput())
<commit_before>from django import forms from registration import constants class CompanyForm(forms.Form): company_number = forms.CharField( label='Company number', help_text=('This is the 8-digit number on the company certificate of ' 'incorporation.'), max_length=8, min_length=8, ) class CompanyBasicInfoForm(forms.Form): company_name = forms.CharField() website = forms.URLField() description = forms.CharField(widget=forms.Textarea) class AimsForm(forms.Form): aim_one = forms.ChoiceField(choices=constants.AIMS) aim_two = forms.ChoiceField(choices=constants.AIMS) class UserForm(forms.Form): name = forms.CharField(label='Full name') email = forms.EmailField(label='Email address') password = forms.CharField(widget=forms.PasswordInput()) terms_agreed = forms.BooleanField() referrer = forms.CharField(required=False, widget=forms.HiddenInput()) <commit_msg>Add TODO comment for char limits<commit_after>from django import forms from registration import constants class CompanyForm(forms.Form): company_number = forms.CharField( label='Company number', help_text=('This is the 8-digit number on the company certificate of ' 'incorporation.'), max_length=8, min_length=8, ) class CompanyBasicInfoForm(forms.Form): # TODO: ED-145 # Make sure all fields have char limits once the models are defined company_name = forms.CharField() website = forms.URLField() description = forms.CharField(widget=forms.Textarea) class AimsForm(forms.Form): aim_one = forms.ChoiceField(choices=constants.AIMS) aim_two = forms.ChoiceField(choices=constants.AIMS) class UserForm(forms.Form): name = forms.CharField(label='Full name') email = forms.EmailField(label='Email address') password = forms.CharField(widget=forms.PasswordInput()) terms_agreed = forms.BooleanField() referrer = forms.CharField(required=False, widget=forms.HiddenInput())
d5ff70922ca22673cbdbadcd8cf745f81f47e7c1
app.py
app.py
#!/usr/bin/env python3 import os import flask class BlogAPI: def __init__(self): self.app = flask.Flask(__name__) self.log = self.app.logger self.app.config.update(dict( DATABASE=os.path.join(self.app.root_path, 'blog.db'), PORT=8080, )) @self.app.route("/post", methods=['POST']) def add_post(): return "POST" @self.app.route("/posts", methods=['GET']) def get_posts(): return "GET" if __name__ == '__main__': api = BlogAPI() api.app.run(port=8080)
#!/usr/bin/env python3 import os import flask import sqlite3 from flask import request import json class BlogAPI: def __init__(self): self.app = flask.Flask(__name__) self.log = self.app.logger self.app.config.update(dict( DATABASE=os.path.join(self.app.root_path, 'blog.db'), PORT=8080, )) self.context = self.app.app_context().g self.app.add_url_rule("/post", view_func=self.add_post, methods=['POST']) self.app.add_url_rule("/posts", view_func=self.get_posts(), methods=['GET']) def get_posts(self): c = self.get_db().cursor() return json.dumps({list(c.execute("SELECT * FROM posts"))}), 200 def add_post(self): c = self.get_db().cursor() data = json.loads(request.data) # TODO: How does flask populate this? c.execute("INSERT INTO posts (post_id, title, body) VALUES (?, ?, ?)", (data["post_id"], data["title"], data["body"])) self.log.info("Created post '" + data["title"] + "'") return '', 201 def get_db(self): if not hasattr(self.context, 'blog_db'): self.context.blog_db = sqlite3.connect(self.app.config['DATABASE']) return self.context.blog_db if __name__ == '__main__': api = BlogAPI() api.app.run(port=8080)
Implement API endpoints with flask
Implement API endpoints with flask
Python
mit
stormbeta/blogapi-example,stormbeta/blogapi-example
#!/usr/bin/env python3 import os import flask class BlogAPI: def __init__(self): self.app = flask.Flask(__name__) self.log = self.app.logger self.app.config.update(dict( DATABASE=os.path.join(self.app.root_path, 'blog.db'), PORT=8080, )) @self.app.route("/post", methods=['POST']) def add_post(): return "POST" @self.app.route("/posts", methods=['GET']) def get_posts(): return "GET" if __name__ == '__main__': api = BlogAPI() api.app.run(port=8080) Implement API endpoints with flask
#!/usr/bin/env python3 import os import flask import sqlite3 from flask import request import json class BlogAPI: def __init__(self): self.app = flask.Flask(__name__) self.log = self.app.logger self.app.config.update(dict( DATABASE=os.path.join(self.app.root_path, 'blog.db'), PORT=8080, )) self.context = self.app.app_context().g self.app.add_url_rule("/post", view_func=self.add_post, methods=['POST']) self.app.add_url_rule("/posts", view_func=self.get_posts(), methods=['GET']) def get_posts(self): c = self.get_db().cursor() return json.dumps({list(c.execute("SELECT * FROM posts"))}), 200 def add_post(self): c = self.get_db().cursor() data = json.loads(request.data) # TODO: How does flask populate this? c.execute("INSERT INTO posts (post_id, title, body) VALUES (?, ?, ?)", (data["post_id"], data["title"], data["body"])) self.log.info("Created post '" + data["title"] + "'") return '', 201 def get_db(self): if not hasattr(self.context, 'blog_db'): self.context.blog_db = sqlite3.connect(self.app.config['DATABASE']) return self.context.blog_db if __name__ == '__main__': api = BlogAPI() api.app.run(port=8080)
<commit_before>#!/usr/bin/env python3 import os import flask class BlogAPI: def __init__(self): self.app = flask.Flask(__name__) self.log = self.app.logger self.app.config.update(dict( DATABASE=os.path.join(self.app.root_path, 'blog.db'), PORT=8080, )) @self.app.route("/post", methods=['POST']) def add_post(): return "POST" @self.app.route("/posts", methods=['GET']) def get_posts(): return "GET" if __name__ == '__main__': api = BlogAPI() api.app.run(port=8080) <commit_msg>Implement API endpoints with flask<commit_after>
#!/usr/bin/env python3 import os import flask import sqlite3 from flask import request import json class BlogAPI: def __init__(self): self.app = flask.Flask(__name__) self.log = self.app.logger self.app.config.update(dict( DATABASE=os.path.join(self.app.root_path, 'blog.db'), PORT=8080, )) self.context = self.app.app_context().g self.app.add_url_rule("/post", view_func=self.add_post, methods=['POST']) self.app.add_url_rule("/posts", view_func=self.get_posts(), methods=['GET']) def get_posts(self): c = self.get_db().cursor() return json.dumps({list(c.execute("SELECT * FROM posts"))}), 200 def add_post(self): c = self.get_db().cursor() data = json.loads(request.data) # TODO: How does flask populate this? c.execute("INSERT INTO posts (post_id, title, body) VALUES (?, ?, ?)", (data["post_id"], data["title"], data["body"])) self.log.info("Created post '" + data["title"] + "'") return '', 201 def get_db(self): if not hasattr(self.context, 'blog_db'): self.context.blog_db = sqlite3.connect(self.app.config['DATABASE']) return self.context.blog_db if __name__ == '__main__': api = BlogAPI() api.app.run(port=8080)
#!/usr/bin/env python3 import os import flask class BlogAPI: def __init__(self): self.app = flask.Flask(__name__) self.log = self.app.logger self.app.config.update(dict( DATABASE=os.path.join(self.app.root_path, 'blog.db'), PORT=8080, )) @self.app.route("/post", methods=['POST']) def add_post(): return "POST" @self.app.route("/posts", methods=['GET']) def get_posts(): return "GET" if __name__ == '__main__': api = BlogAPI() api.app.run(port=8080) Implement API endpoints with flask#!/usr/bin/env python3 import os import flask import sqlite3 from flask import request import json class BlogAPI: def __init__(self): self.app = flask.Flask(__name__) self.log = self.app.logger self.app.config.update(dict( DATABASE=os.path.join(self.app.root_path, 'blog.db'), PORT=8080, )) self.context = self.app.app_context().g self.app.add_url_rule("/post", view_func=self.add_post, methods=['POST']) self.app.add_url_rule("/posts", view_func=self.get_posts(), methods=['GET']) def get_posts(self): c = self.get_db().cursor() return json.dumps({list(c.execute("SELECT * FROM posts"))}), 200 def add_post(self): c = self.get_db().cursor() data = json.loads(request.data) # TODO: How does flask populate this? c.execute("INSERT INTO posts (post_id, title, body) VALUES (?, ?, ?)", (data["post_id"], data["title"], data["body"])) self.log.info("Created post '" + data["title"] + "'") return '', 201 def get_db(self): if not hasattr(self.context, 'blog_db'): self.context.blog_db = sqlite3.connect(self.app.config['DATABASE']) return self.context.blog_db if __name__ == '__main__': api = BlogAPI() api.app.run(port=8080)
<commit_before>#!/usr/bin/env python3 import os import flask class BlogAPI: def __init__(self): self.app = flask.Flask(__name__) self.log = self.app.logger self.app.config.update(dict( DATABASE=os.path.join(self.app.root_path, 'blog.db'), PORT=8080, )) @self.app.route("/post", methods=['POST']) def add_post(): return "POST" @self.app.route("/posts", methods=['GET']) def get_posts(): return "GET" if __name__ == '__main__': api = BlogAPI() api.app.run(port=8080) <commit_msg>Implement API endpoints with flask<commit_after>#!/usr/bin/env python3 import os import flask import sqlite3 from flask import request import json class BlogAPI: def __init__(self): self.app = flask.Flask(__name__) self.log = self.app.logger self.app.config.update(dict( DATABASE=os.path.join(self.app.root_path, 'blog.db'), PORT=8080, )) self.context = self.app.app_context().g self.app.add_url_rule("/post", view_func=self.add_post, methods=['POST']) self.app.add_url_rule("/posts", view_func=self.get_posts(), methods=['GET']) def get_posts(self): c = self.get_db().cursor() return json.dumps({list(c.execute("SELECT * FROM posts"))}), 200 def add_post(self): c = self.get_db().cursor() data = json.loads(request.data) # TODO: How does flask populate this? c.execute("INSERT INTO posts (post_id, title, body) VALUES (?, ?, ?)", (data["post_id"], data["title"], data["body"])) self.log.info("Created post '" + data["title"] + "'") return '', 201 def get_db(self): if not hasattr(self.context, 'blog_db'): self.context.blog_db = sqlite3.connect(self.app.config['DATABASE']) return self.context.blog_db if __name__ == '__main__': api = BlogAPI() api.app.run(port=8080)
e28f0accf06462ba365151de571d3d781e62fa9a
skylines/__init__.py
skylines/__init__.py
from flask import Flask from flask.ext.babel import Babel from flask.ext.assets import Environment def create_app(): app = Flask(__name__, static_folder='public') babel = Babel(app) assets = Environment(app) return app app = create_app() import skylines.views
from flask import Flask from flask.ext.babel import Babel from flask.ext.assets import Environment from webassets.loaders import PythonLoader def create_app(): app = Flask(__name__, static_folder='public') babel = Babel(app) bundles = PythonLoader('skylines.assets.bundles').load_bundles() assets = Environment(app) assets.register(bundles) return app app = create_app() import skylines.views
Load asset bundles into webassets environment
flask: Load asset bundles into webassets environment
Python
agpl-3.0
Turbo87/skylines,snip/skylines,TobiasLohner/SkyLines,RBE-Avionik/skylines,kerel-fs/skylines,Harry-R/skylines,Harry-R/skylines,RBE-Avionik/skylines,TobiasLohner/SkyLines,RBE-Avionik/skylines,TobiasLohner/SkyLines,Turbo87/skylines,kerel-fs/skylines,snip/skylines,Turbo87/skylines,snip/skylines,Harry-R/skylines,RBE-Avionik/skylines,Turbo87/skylines,shadowoneau/skylines,shadowoneau/skylines,skylines-project/skylines,skylines-project/skylines,skylines-project/skylines,kerel-fs/skylines,shadowoneau/skylines,shadowoneau/skylines,Harry-R/skylines,skylines-project/skylines
from flask import Flask from flask.ext.babel import Babel from flask.ext.assets import Environment def create_app(): app = Flask(__name__, static_folder='public') babel = Babel(app) assets = Environment(app) return app app = create_app() import skylines.views flask: Load asset bundles into webassets environment
from flask import Flask from flask.ext.babel import Babel from flask.ext.assets import Environment from webassets.loaders import PythonLoader def create_app(): app = Flask(__name__, static_folder='public') babel = Babel(app) bundles = PythonLoader('skylines.assets.bundles').load_bundles() assets = Environment(app) assets.register(bundles) return app app = create_app() import skylines.views
<commit_before>from flask import Flask from flask.ext.babel import Babel from flask.ext.assets import Environment def create_app(): app = Flask(__name__, static_folder='public') babel = Babel(app) assets = Environment(app) return app app = create_app() import skylines.views <commit_msg>flask: Load asset bundles into webassets environment<commit_after>
from flask import Flask from flask.ext.babel import Babel from flask.ext.assets import Environment from webassets.loaders import PythonLoader def create_app(): app = Flask(__name__, static_folder='public') babel = Babel(app) bundles = PythonLoader('skylines.assets.bundles').load_bundles() assets = Environment(app) assets.register(bundles) return app app = create_app() import skylines.views
from flask import Flask from flask.ext.babel import Babel from flask.ext.assets import Environment def create_app(): app = Flask(__name__, static_folder='public') babel = Babel(app) assets = Environment(app) return app app = create_app() import skylines.views flask: Load asset bundles into webassets environmentfrom flask import Flask from flask.ext.babel import Babel from flask.ext.assets import Environment from webassets.loaders import PythonLoader def create_app(): app = Flask(__name__, static_folder='public') babel = Babel(app) bundles = PythonLoader('skylines.assets.bundles').load_bundles() assets = Environment(app) assets.register(bundles) return app app = create_app() import skylines.views
<commit_before>from flask import Flask from flask.ext.babel import Babel from flask.ext.assets import Environment def create_app(): app = Flask(__name__, static_folder='public') babel = Babel(app) assets = Environment(app) return app app = create_app() import skylines.views <commit_msg>flask: Load asset bundles into webassets environment<commit_after>from flask import Flask from flask.ext.babel import Babel from flask.ext.assets import Environment from webassets.loaders import PythonLoader def create_app(): app = Flask(__name__, static_folder='public') babel = Babel(app) bundles = PythonLoader('skylines.assets.bundles').load_bundles() assets = Environment(app) assets.register(bundles) return app app = create_app() import skylines.views
9291216b1b2dde182f29cecfc7b6288ade60608b
spec/helper.py
spec/helper.py
from pygametemplate import Game from example_view import ExampleView class TestGame(Game): """An altered Game class for testing purposes.""" def __init__(self, StartingView, resolution): super(TestGame, self).__init__(StartingView, resolution) game = TestGame(ExampleView, (1280, 720))
from pygametemplate import Game from example_view import ExampleView class TestGame(Game): # TODO: remove this useless class """An altered Game class for testing purposes.""" def __init__(self, StartingView, resolution): super(TestGame, self).__init__(StartingView, resolution) game = TestGame(ExampleView, (1280, 720))
Add TODO comment for removing TestGame class (doesn't do anything now)
Add TODO comment for removing TestGame class (doesn't do anything now)
Python
mit
AndyDeany/pygame-template
from pygametemplate import Game from example_view import ExampleView class TestGame(Game): """An altered Game class for testing purposes.""" def __init__(self, StartingView, resolution): super(TestGame, self).__init__(StartingView, resolution) game = TestGame(ExampleView, (1280, 720)) Add TODO comment for removing TestGame class (doesn't do anything now)
from pygametemplate import Game from example_view import ExampleView class TestGame(Game): # TODO: remove this useless class """An altered Game class for testing purposes.""" def __init__(self, StartingView, resolution): super(TestGame, self).__init__(StartingView, resolution) game = TestGame(ExampleView, (1280, 720))
<commit_before>from pygametemplate import Game from example_view import ExampleView class TestGame(Game): """An altered Game class for testing purposes.""" def __init__(self, StartingView, resolution): super(TestGame, self).__init__(StartingView, resolution) game = TestGame(ExampleView, (1280, 720)) <commit_msg>Add TODO comment for removing TestGame class (doesn't do anything now)<commit_after>
from pygametemplate import Game from example_view import ExampleView class TestGame(Game): # TODO: remove this useless class """An altered Game class for testing purposes.""" def __init__(self, StartingView, resolution): super(TestGame, self).__init__(StartingView, resolution) game = TestGame(ExampleView, (1280, 720))
from pygametemplate import Game from example_view import ExampleView class TestGame(Game): """An altered Game class for testing purposes.""" def __init__(self, StartingView, resolution): super(TestGame, self).__init__(StartingView, resolution) game = TestGame(ExampleView, (1280, 720)) Add TODO comment for removing TestGame class (doesn't do anything now)from pygametemplate import Game from example_view import ExampleView class TestGame(Game): # TODO: remove this useless class """An altered Game class for testing purposes.""" def __init__(self, StartingView, resolution): super(TestGame, self).__init__(StartingView, resolution) game = TestGame(ExampleView, (1280, 720))
<commit_before>from pygametemplate import Game from example_view import ExampleView class TestGame(Game): """An altered Game class for testing purposes.""" def __init__(self, StartingView, resolution): super(TestGame, self).__init__(StartingView, resolution) game = TestGame(ExampleView, (1280, 720)) <commit_msg>Add TODO comment for removing TestGame class (doesn't do anything now)<commit_after>from pygametemplate import Game from example_view import ExampleView class TestGame(Game): # TODO: remove this useless class """An altered Game class for testing purposes.""" def __init__(self, StartingView, resolution): super(TestGame, self).__init__(StartingView, resolution) game = TestGame(ExampleView, (1280, 720))
ae3d07788bb5f95127d83c837976e46d369f0629
salt/runners/state.py
salt/runners/state.py
''' Execute overstate functions ''' # Import salt libs import salt.overstate import salt.output def over(env='base', os_fn=None): ''' Execute an overstate sequence to orchestrate the executing of states over a group of systems ''' overstate = salt.overstate.OverState(__opts__, env, os_fn) for stage in overstate.stages_iter(): if isinstance(stage, dict): # This is highstate data for key, val in stage.items(): salt.output.display_output( {key: val}, 'highstate', opts=__opts__) elif isinstance(stage, list): # This is a stage salt.output.display_output(stage, 'overstatestage', opts=__opts__) return overstate.over_run def show_stages(env='base', os_fn=None): ''' Display the stage data to be executed ''' overstate = salt.overstate.OverState(__opts__, env, os_fn) salt.output.display_output( overstate.over, 'overstatestage', opts=__opts__) return overstate.over
''' Execute overstate functions ''' # Import salt libs import salt.overstate import salt.output def over(env='base', os_fn=None): ''' Execute an overstate sequence to orchestrate the executing of states over a group of systems ''' stage_num = 0 overstate = salt.overstate.OverState(__opts__, env, os_fn) for stage in overstate.stages_iter(): if isinstance(stage, dict): # This is highstate data print('Stage execution results:') for key, val in stage.items(): salt.output.display_output( {key: val}, 'highstate', opts=__opts__) elif isinstance(stage, list): # This is a stage if stage_num == 0: print('Executing the following Over State:') else: print('Executed Stage:') salt.output.display_output(stage, 'overstatestage', opts=__opts__) stage_num += 1 return overstate.over_run def show_stages(env='base', os_fn=None): ''' Display the stage data to be executed ''' overstate = salt.overstate.OverState(__opts__, env, os_fn) salt.output.display_output( overstate.over, 'overstatestage', opts=__opts__) return overstate.over
Make output data cleaner on the eyes :)
Make output data cleaner on the eyes :)
Python
apache-2.0
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
''' Execute overstate functions ''' # Import salt libs import salt.overstate import salt.output def over(env='base', os_fn=None): ''' Execute an overstate sequence to orchestrate the executing of states over a group of systems ''' overstate = salt.overstate.OverState(__opts__, env, os_fn) for stage in overstate.stages_iter(): if isinstance(stage, dict): # This is highstate data for key, val in stage.items(): salt.output.display_output( {key: val}, 'highstate', opts=__opts__) elif isinstance(stage, list): # This is a stage salt.output.display_output(stage, 'overstatestage', opts=__opts__) return overstate.over_run def show_stages(env='base', os_fn=None): ''' Display the stage data to be executed ''' overstate = salt.overstate.OverState(__opts__, env, os_fn) salt.output.display_output( overstate.over, 'overstatestage', opts=__opts__) return overstate.over Make output data cleaner on the eyes :)
''' Execute overstate functions ''' # Import salt libs import salt.overstate import salt.output def over(env='base', os_fn=None): ''' Execute an overstate sequence to orchestrate the executing of states over a group of systems ''' stage_num = 0 overstate = salt.overstate.OverState(__opts__, env, os_fn) for stage in overstate.stages_iter(): if isinstance(stage, dict): # This is highstate data print('Stage execution results:') for key, val in stage.items(): salt.output.display_output( {key: val}, 'highstate', opts=__opts__) elif isinstance(stage, list): # This is a stage if stage_num == 0: print('Executing the following Over State:') else: print('Executed Stage:') salt.output.display_output(stage, 'overstatestage', opts=__opts__) stage_num += 1 return overstate.over_run def show_stages(env='base', os_fn=None): ''' Display the stage data to be executed ''' overstate = salt.overstate.OverState(__opts__, env, os_fn) salt.output.display_output( overstate.over, 'overstatestage', opts=__opts__) return overstate.over
<commit_before>''' Execute overstate functions ''' # Import salt libs import salt.overstate import salt.output def over(env='base', os_fn=None): ''' Execute an overstate sequence to orchestrate the executing of states over a group of systems ''' overstate = salt.overstate.OverState(__opts__, env, os_fn) for stage in overstate.stages_iter(): if isinstance(stage, dict): # This is highstate data for key, val in stage.items(): salt.output.display_output( {key: val}, 'highstate', opts=__opts__) elif isinstance(stage, list): # This is a stage salt.output.display_output(stage, 'overstatestage', opts=__opts__) return overstate.over_run def show_stages(env='base', os_fn=None): ''' Display the stage data to be executed ''' overstate = salt.overstate.OverState(__opts__, env, os_fn) salt.output.display_output( overstate.over, 'overstatestage', opts=__opts__) return overstate.over <commit_msg>Make output data cleaner on the eyes :)<commit_after>
''' Execute overstate functions ''' # Import salt libs import salt.overstate import salt.output def over(env='base', os_fn=None): ''' Execute an overstate sequence to orchestrate the executing of states over a group of systems ''' stage_num = 0 overstate = salt.overstate.OverState(__opts__, env, os_fn) for stage in overstate.stages_iter(): if isinstance(stage, dict): # This is highstate data print('Stage execution results:') for key, val in stage.items(): salt.output.display_output( {key: val}, 'highstate', opts=__opts__) elif isinstance(stage, list): # This is a stage if stage_num == 0: print('Executing the following Over State:') else: print('Executed Stage:') salt.output.display_output(stage, 'overstatestage', opts=__opts__) stage_num += 1 return overstate.over_run def show_stages(env='base', os_fn=None): ''' Display the stage data to be executed ''' overstate = salt.overstate.OverState(__opts__, env, os_fn) salt.output.display_output( overstate.over, 'overstatestage', opts=__opts__) return overstate.over
''' Execute overstate functions ''' # Import salt libs import salt.overstate import salt.output def over(env='base', os_fn=None): ''' Execute an overstate sequence to orchestrate the executing of states over a group of systems ''' overstate = salt.overstate.OverState(__opts__, env, os_fn) for stage in overstate.stages_iter(): if isinstance(stage, dict): # This is highstate data for key, val in stage.items(): salt.output.display_output( {key: val}, 'highstate', opts=__opts__) elif isinstance(stage, list): # This is a stage salt.output.display_output(stage, 'overstatestage', opts=__opts__) return overstate.over_run def show_stages(env='base', os_fn=None): ''' Display the stage data to be executed ''' overstate = salt.overstate.OverState(__opts__, env, os_fn) salt.output.display_output( overstate.over, 'overstatestage', opts=__opts__) return overstate.over Make output data cleaner on the eyes :)''' Execute overstate functions ''' # Import salt libs import salt.overstate import salt.output def over(env='base', os_fn=None): ''' Execute an overstate sequence to orchestrate the executing of states over a group of systems ''' stage_num = 0 overstate = salt.overstate.OverState(__opts__, env, os_fn) for stage in overstate.stages_iter(): if isinstance(stage, dict): # This is highstate data print('Stage execution results:') for key, val in stage.items(): salt.output.display_output( {key: val}, 'highstate', opts=__opts__) elif isinstance(stage, list): # This is a stage if stage_num == 0: print('Executing the following Over State:') else: print('Executed Stage:') salt.output.display_output(stage, 'overstatestage', opts=__opts__) stage_num += 1 return overstate.over_run def show_stages(env='base', os_fn=None): ''' Display the stage data to be executed ''' overstate = salt.overstate.OverState(__opts__, env, os_fn) salt.output.display_output( overstate.over, 'overstatestage', opts=__opts__) return overstate.over
<commit_before>''' Execute overstate functions ''' # Import salt libs import salt.overstate import salt.output def over(env='base', os_fn=None): ''' Execute an overstate sequence to orchestrate the executing of states over a group of systems ''' overstate = salt.overstate.OverState(__opts__, env, os_fn) for stage in overstate.stages_iter(): if isinstance(stage, dict): # This is highstate data for key, val in stage.items(): salt.output.display_output( {key: val}, 'highstate', opts=__opts__) elif isinstance(stage, list): # This is a stage salt.output.display_output(stage, 'overstatestage', opts=__opts__) return overstate.over_run def show_stages(env='base', os_fn=None): ''' Display the stage data to be executed ''' overstate = salt.overstate.OverState(__opts__, env, os_fn) salt.output.display_output( overstate.over, 'overstatestage', opts=__opts__) return overstate.over <commit_msg>Make output data cleaner on the eyes :)<commit_after>''' Execute overstate functions ''' # Import salt libs import salt.overstate import salt.output def over(env='base', os_fn=None): ''' Execute an overstate sequence to orchestrate the executing of states over a group of systems ''' stage_num = 0 overstate = salt.overstate.OverState(__opts__, env, os_fn) for stage in overstate.stages_iter(): if isinstance(stage, dict): # This is highstate data print('Stage execution results:') for key, val in stage.items(): salt.output.display_output( {key: val}, 'highstate', opts=__opts__) elif isinstance(stage, list): # This is a stage if stage_num == 0: print('Executing the following Over State:') else: print('Executed Stage:') salt.output.display_output(stage, 'overstatestage', opts=__opts__) stage_num += 1 return overstate.over_run def show_stages(env='base', os_fn=None): ''' Display the stage data to be executed ''' overstate = salt.overstate.OverState(__opts__, env, os_fn) salt.output.display_output( overstate.over, 'overstatestage', opts=__opts__) return overstate.over
38a4629e034f00c65979910109b34499c077687b
plasmapy/utils/import_helpers.py
plasmapy/utils/import_helpers.py
import importlib import warnings from distutils.version import LooseVersion def check_versions(minimum_versions): """Raises an ImportError if a dependent package is not installed and at the required version number, or provides a warning if the version of the dependent package cannot be found.""" for module_name in minimum_versions.keys(): minimum_version = LooseVersion(minimum_versions[module_name]) try: module = importlib.import_module(module_name) module_version = LooseVersion(module.__version__) except ImportError: raise ImportError(f"Unable to import {module_name} while " "importing PlasmaPy.") from None except AttributeError: # coveralls: ignore warnings.warn(f"{module_name} version {minimum_version.vstring} " "is required for PlasmaPy. However, the version of " f"{module_name} could not be determined to check if " "this requirement is met.") else: if minimum_version > module_version: raise ImportError( f"{module_name} {minimum_version} or newer is required " "for PlasmaPy. The currently installed version is " f"{module_version}.") from None
import importlib import warnings import distutils.version as dv def check_versions(minimum_versions): """Raises an ImportError if a dependent package is not installed and at the required version number, or provides a warning if the version of the dependent package cannot be found.""" for module_name in minimum_versions.keys(): minimum_version = dv.LooseVersion(minimum_versions[module_name]) try: module = importlib.import_module(module_name) module_version = dv.LooseVersion(module.__version__) except ImportError: raise ImportError(f"Unable to import {module_name} while " "importing PlasmaPy.") from None except AttributeError: # coveralls: ignore warnings.warn(f"{module_name} version {minimum_version.vstring} " "is required for PlasmaPy. However, the version of " f"{module_name} could not be determined to check if " "this requirement is met.") else: if minimum_version > module_version: raise ImportError( f"{module_name} {minimum_version} or newer is required " "for PlasmaPy. The currently installed version is " f"{module_version}.") from None
Make namespaces more clear in input_helpers.py
Make namespaces more clear in input_helpers.py
Python
bsd-3-clause
StanczakDominik/PlasmaPy
import importlib import warnings from distutils.version import LooseVersion def check_versions(minimum_versions): """Raises an ImportError if a dependent package is not installed and at the required version number, or provides a warning if the version of the dependent package cannot be found.""" for module_name in minimum_versions.keys(): minimum_version = LooseVersion(minimum_versions[module_name]) try: module = importlib.import_module(module_name) module_version = LooseVersion(module.__version__) except ImportError: raise ImportError(f"Unable to import {module_name} while " "importing PlasmaPy.") from None except AttributeError: # coveralls: ignore warnings.warn(f"{module_name} version {minimum_version.vstring} " "is required for PlasmaPy. However, the version of " f"{module_name} could not be determined to check if " "this requirement is met.") else: if minimum_version > module_version: raise ImportError( f"{module_name} {minimum_version} or newer is required " "for PlasmaPy. The currently installed version is " f"{module_version}.") from None Make namespaces more clear in input_helpers.py
import importlib import warnings import distutils.version as dv def check_versions(minimum_versions): """Raises an ImportError if a dependent package is not installed and at the required version number, or provides a warning if the version of the dependent package cannot be found.""" for module_name in minimum_versions.keys(): minimum_version = dv.LooseVersion(minimum_versions[module_name]) try: module = importlib.import_module(module_name) module_version = dv.LooseVersion(module.__version__) except ImportError: raise ImportError(f"Unable to import {module_name} while " "importing PlasmaPy.") from None except AttributeError: # coveralls: ignore warnings.warn(f"{module_name} version {minimum_version.vstring} " "is required for PlasmaPy. However, the version of " f"{module_name} could not be determined to check if " "this requirement is met.") else: if minimum_version > module_version: raise ImportError( f"{module_name} {minimum_version} or newer is required " "for PlasmaPy. The currently installed version is " f"{module_version}.") from None
<commit_before>import importlib import warnings from distutils.version import LooseVersion def check_versions(minimum_versions): """Raises an ImportError if a dependent package is not installed and at the required version number, or provides a warning if the version of the dependent package cannot be found.""" for module_name in minimum_versions.keys(): minimum_version = LooseVersion(minimum_versions[module_name]) try: module = importlib.import_module(module_name) module_version = LooseVersion(module.__version__) except ImportError: raise ImportError(f"Unable to import {module_name} while " "importing PlasmaPy.") from None except AttributeError: # coveralls: ignore warnings.warn(f"{module_name} version {minimum_version.vstring} " "is required for PlasmaPy. However, the version of " f"{module_name} could not be determined to check if " "this requirement is met.") else: if minimum_version > module_version: raise ImportError( f"{module_name} {minimum_version} or newer is required " "for PlasmaPy. The currently installed version is " f"{module_version}.") from None <commit_msg>Make namespaces more clear in input_helpers.py<commit_after>
import importlib import warnings import distutils.version as dv def check_versions(minimum_versions): """Raises an ImportError if a dependent package is not installed and at the required version number, or provides a warning if the version of the dependent package cannot be found.""" for module_name in minimum_versions.keys(): minimum_version = dv.LooseVersion(minimum_versions[module_name]) try: module = importlib.import_module(module_name) module_version = dv.LooseVersion(module.__version__) except ImportError: raise ImportError(f"Unable to import {module_name} while " "importing PlasmaPy.") from None except AttributeError: # coveralls: ignore warnings.warn(f"{module_name} version {minimum_version.vstring} " "is required for PlasmaPy. However, the version of " f"{module_name} could not be determined to check if " "this requirement is met.") else: if minimum_version > module_version: raise ImportError( f"{module_name} {minimum_version} or newer is required " "for PlasmaPy. The currently installed version is " f"{module_version}.") from None
import importlib import warnings from distutils.version import LooseVersion def check_versions(minimum_versions): """Raises an ImportError if a dependent package is not installed and at the required version number, or provides a warning if the version of the dependent package cannot be found.""" for module_name in minimum_versions.keys(): minimum_version = LooseVersion(minimum_versions[module_name]) try: module = importlib.import_module(module_name) module_version = LooseVersion(module.__version__) except ImportError: raise ImportError(f"Unable to import {module_name} while " "importing PlasmaPy.") from None except AttributeError: # coveralls: ignore warnings.warn(f"{module_name} version {minimum_version.vstring} " "is required for PlasmaPy. However, the version of " f"{module_name} could not be determined to check if " "this requirement is met.") else: if minimum_version > module_version: raise ImportError( f"{module_name} {minimum_version} or newer is required " "for PlasmaPy. The currently installed version is " f"{module_version}.") from None Make namespaces more clear in input_helpers.pyimport importlib import warnings import distutils.version as dv def check_versions(minimum_versions): """Raises an ImportError if a dependent package is not installed and at the required version number, or provides a warning if the version of the dependent package cannot be found.""" for module_name in minimum_versions.keys(): minimum_version = dv.LooseVersion(minimum_versions[module_name]) try: module = importlib.import_module(module_name) module_version = dv.LooseVersion(module.__version__) except ImportError: raise ImportError(f"Unable to import {module_name} while " "importing PlasmaPy.") from None except AttributeError: # coveralls: ignore warnings.warn(f"{module_name} version {minimum_version.vstring} " "is required for PlasmaPy. However, the version of " f"{module_name} could not be determined to check if " "this requirement is met.") else: if minimum_version > module_version: raise ImportError( f"{module_name} {minimum_version} or newer is required " "for PlasmaPy. The currently installed version is " f"{module_version}.") from None
<commit_before>import importlib import warnings from distutils.version import LooseVersion def check_versions(minimum_versions): """Raises an ImportError if a dependent package is not installed and at the required version number, or provides a warning if the version of the dependent package cannot be found.""" for module_name in minimum_versions.keys(): minimum_version = LooseVersion(minimum_versions[module_name]) try: module = importlib.import_module(module_name) module_version = LooseVersion(module.__version__) except ImportError: raise ImportError(f"Unable to import {module_name} while " "importing PlasmaPy.") from None except AttributeError: # coveralls: ignore warnings.warn(f"{module_name} version {minimum_version.vstring} " "is required for PlasmaPy. However, the version of " f"{module_name} could not be determined to check if " "this requirement is met.") else: if minimum_version > module_version: raise ImportError( f"{module_name} {minimum_version} or newer is required " "for PlasmaPy. The currently installed version is " f"{module_version}.") from None <commit_msg>Make namespaces more clear in input_helpers.py<commit_after>import importlib import warnings import distutils.version as dv def check_versions(minimum_versions): """Raises an ImportError if a dependent package is not installed and at the required version number, or provides a warning if the version of the dependent package cannot be found.""" for module_name in minimum_versions.keys(): minimum_version = dv.LooseVersion(minimum_versions[module_name]) try: module = importlib.import_module(module_name) module_version = dv.LooseVersion(module.__version__) except ImportError: raise ImportError(f"Unable to import {module_name} while " "importing PlasmaPy.") from None except AttributeError: # coveralls: ignore warnings.warn(f"{module_name} version {minimum_version.vstring} " "is required for PlasmaPy. However, the version of " f"{module_name} could not be determined to check if " "this requirement is met.") else: if minimum_version > module_version: raise ImportError( f"{module_name} {minimum_version} or newer is required " "for PlasmaPy. The currently installed version is " f"{module_version}.") from None
8348cf481dc098cb5cf583dd86a6923c9c03d5f5
freight/utils/auth.py
freight/utils/auth.py
from __future__ import absolute_import from flask import current_app, request, session from freight.models import User from freight.testutils.fixtures import Fixtures NOT_SET = object() def get_current_user(): """ Return the currently authenticated user based on their active session. Will return a dummy user if in development mode. """ if getattr(request, 'current_user', NOT_SET) is NOT_SET: if current_app.config.get('DEV'): request.current_user = User.query.filter( User.name == 'Freight', ).first() if not request.current_user: request.current_user = Fixtures().create_user( name='Freight', ) elif session.get('uid') is None: request.current_user = None else: request.current_user = User.query.get(session['uid']) if request.current_user is None: del session['uid'] return request.current_user
from __future__ import absolute_import from flask import current_app, request, session from freight.models import User NOT_SET = object() def get_current_user(): """ Return the currently authenticated user based on their active session. Will return a dummy user if in development mode. """ if getattr(request, 'current_user', NOT_SET) is NOT_SET: if current_app.config.get('DEV'): from freight.testutils.fixtures import Fixtures request.current_user = User.query.filter( User.name == 'Freight', ).first() if not request.current_user: request.current_user = Fixtures().create_user( name='Freight', ) elif session.get('uid') is None: request.current_user = None else: request.current_user = User.query.get(session['uid']) if request.current_user is None: del session['uid'] return request.current_user
Move fixture import to only be in DEV
Move fixture import to only be in DEV
Python
apache-2.0
getsentry/freight,getsentry/freight,getsentry/freight,getsentry/freight,getsentry/freight
from __future__ import absolute_import from flask import current_app, request, session from freight.models import User from freight.testutils.fixtures import Fixtures NOT_SET = object() def get_current_user(): """ Return the currently authenticated user based on their active session. Will return a dummy user if in development mode. """ if getattr(request, 'current_user', NOT_SET) is NOT_SET: if current_app.config.get('DEV'): request.current_user = User.query.filter( User.name == 'Freight', ).first() if not request.current_user: request.current_user = Fixtures().create_user( name='Freight', ) elif session.get('uid') is None: request.current_user = None else: request.current_user = User.query.get(session['uid']) if request.current_user is None: del session['uid'] return request.current_user Move fixture import to only be in DEV
from __future__ import absolute_import from flask import current_app, request, session from freight.models import User NOT_SET = object() def get_current_user(): """ Return the currently authenticated user based on their active session. Will return a dummy user if in development mode. """ if getattr(request, 'current_user', NOT_SET) is NOT_SET: if current_app.config.get('DEV'): from freight.testutils.fixtures import Fixtures request.current_user = User.query.filter( User.name == 'Freight', ).first() if not request.current_user: request.current_user = Fixtures().create_user( name='Freight', ) elif session.get('uid') is None: request.current_user = None else: request.current_user = User.query.get(session['uid']) if request.current_user is None: del session['uid'] return request.current_user
<commit_before>from __future__ import absolute_import from flask import current_app, request, session from freight.models import User from freight.testutils.fixtures import Fixtures NOT_SET = object() def get_current_user(): """ Return the currently authenticated user based on their active session. Will return a dummy user if in development mode. """ if getattr(request, 'current_user', NOT_SET) is NOT_SET: if current_app.config.get('DEV'): request.current_user = User.query.filter( User.name == 'Freight', ).first() if not request.current_user: request.current_user = Fixtures().create_user( name='Freight', ) elif session.get('uid') is None: request.current_user = None else: request.current_user = User.query.get(session['uid']) if request.current_user is None: del session['uid'] return request.current_user <commit_msg>Move fixture import to only be in DEV<commit_after>
from __future__ import absolute_import from flask import current_app, request, session from freight.models import User NOT_SET = object() def get_current_user(): """ Return the currently authenticated user based on their active session. Will return a dummy user if in development mode. """ if getattr(request, 'current_user', NOT_SET) is NOT_SET: if current_app.config.get('DEV'): from freight.testutils.fixtures import Fixtures request.current_user = User.query.filter( User.name == 'Freight', ).first() if not request.current_user: request.current_user = Fixtures().create_user( name='Freight', ) elif session.get('uid') is None: request.current_user = None else: request.current_user = User.query.get(session['uid']) if request.current_user is None: del session['uid'] return request.current_user
from __future__ import absolute_import from flask import current_app, request, session from freight.models import User from freight.testutils.fixtures import Fixtures NOT_SET = object() def get_current_user(): """ Return the currently authenticated user based on their active session. Will return a dummy user if in development mode. """ if getattr(request, 'current_user', NOT_SET) is NOT_SET: if current_app.config.get('DEV'): request.current_user = User.query.filter( User.name == 'Freight', ).first() if not request.current_user: request.current_user = Fixtures().create_user( name='Freight', ) elif session.get('uid') is None: request.current_user = None else: request.current_user = User.query.get(session['uid']) if request.current_user is None: del session['uid'] return request.current_user Move fixture import to only be in DEVfrom __future__ import absolute_import from flask import current_app, request, session from freight.models import User NOT_SET = object() def get_current_user(): """ Return the currently authenticated user based on their active session. Will return a dummy user if in development mode. """ if getattr(request, 'current_user', NOT_SET) is NOT_SET: if current_app.config.get('DEV'): from freight.testutils.fixtures import Fixtures request.current_user = User.query.filter( User.name == 'Freight', ).first() if not request.current_user: request.current_user = Fixtures().create_user( name='Freight', ) elif session.get('uid') is None: request.current_user = None else: request.current_user = User.query.get(session['uid']) if request.current_user is None: del session['uid'] return request.current_user
<commit_before>from __future__ import absolute_import from flask import current_app, request, session from freight.models import User from freight.testutils.fixtures import Fixtures NOT_SET = object() def get_current_user(): """ Return the currently authenticated user based on their active session. Will return a dummy user if in development mode. """ if getattr(request, 'current_user', NOT_SET) is NOT_SET: if current_app.config.get('DEV'): request.current_user = User.query.filter( User.name == 'Freight', ).first() if not request.current_user: request.current_user = Fixtures().create_user( name='Freight', ) elif session.get('uid') is None: request.current_user = None else: request.current_user = User.query.get(session['uid']) if request.current_user is None: del session['uid'] return request.current_user <commit_msg>Move fixture import to only be in DEV<commit_after>from __future__ import absolute_import from flask import current_app, request, session from freight.models import User NOT_SET = object() def get_current_user(): """ Return the currently authenticated user based on their active session. Will return a dummy user if in development mode. """ if getattr(request, 'current_user', NOT_SET) is NOT_SET: if current_app.config.get('DEV'): from freight.testutils.fixtures import Fixtures request.current_user = User.query.filter( User.name == 'Freight', ).first() if not request.current_user: request.current_user = Fixtures().create_user( name='Freight', ) elif session.get('uid') is None: request.current_user = None else: request.current_user = User.query.get(session['uid']) if request.current_user is None: del session['uid'] return request.current_user
310ed88c1e0e5014d28f9221363693fe3d729d6b
irrigator_pro/common/views.py
irrigator_pro/common/views.py
from django.shortcuts import render # Create your views here.
from django.forms import ModelForm from common.models import Audit class AuditForm(ModelForm): class Meta: model = Audit exclude = ( 'cdate', 'mdate', 'cuser', 'muser', ) def save(self, *args, **kwargs): kwargs['commit']=False obj = super(AuditForm, self).save(*args, **kwargs) if not 'cuser' in self.cleaned_data: self.cleaned_data['cuser'] = request.user self.cleaned_data['muser'] = request.user obj.save() def save_audit_model(self, modelform, instance): obj = super(AuditForm, self).save(instance, commit=False) if not obj.cuser: obj.cuser = request.user obj.muser = request.user obj.save()
Create abstract AuditForm class to be used by Forms by classes that inherit from Audit model.
Create abstract AuditForm class to be used by Forms by classes that inherit from Audit model.
Python
mit
warnes/irrigatorpro,warnes/irrigatorpro,warnes/irrigatorpro,warnes/irrigatorpro
from django.shortcuts import render # Create your views here. Create abstract AuditForm class to be used by Forms by classes that inherit from Audit model.
from django.forms import ModelForm from common.models import Audit class AuditForm(ModelForm): class Meta: model = Audit exclude = ( 'cdate', 'mdate', 'cuser', 'muser', ) def save(self, *args, **kwargs): kwargs['commit']=False obj = super(AuditForm, self).save(*args, **kwargs) if not 'cuser' in self.cleaned_data: self.cleaned_data['cuser'] = request.user self.cleaned_data['muser'] = request.user obj.save() def save_audit_model(self, modelform, instance): obj = super(AuditForm, self).save(instance, commit=False) if not obj.cuser: obj.cuser = request.user obj.muser = request.user obj.save()
<commit_before>from django.shortcuts import render # Create your views here. <commit_msg>Create abstract AuditForm class to be used by Forms by classes that inherit from Audit model.<commit_after>
from django.forms import ModelForm from common.models import Audit class AuditForm(ModelForm): class Meta: model = Audit exclude = ( 'cdate', 'mdate', 'cuser', 'muser', ) def save(self, *args, **kwargs): kwargs['commit']=False obj = super(AuditForm, self).save(*args, **kwargs) if not 'cuser' in self.cleaned_data: self.cleaned_data['cuser'] = request.user self.cleaned_data['muser'] = request.user obj.save() def save_audit_model(self, modelform, instance): obj = super(AuditForm, self).save(instance, commit=False) if not obj.cuser: obj.cuser = request.user obj.muser = request.user obj.save()
from django.shortcuts import render # Create your views here. Create abstract AuditForm class to be used by Forms by classes that inherit from Audit model.from django.forms import ModelForm from common.models import Audit class AuditForm(ModelForm): class Meta: model = Audit exclude = ( 'cdate', 'mdate', 'cuser', 'muser', ) def save(self, *args, **kwargs): kwargs['commit']=False obj = super(AuditForm, self).save(*args, **kwargs) if not 'cuser' in self.cleaned_data: self.cleaned_data['cuser'] = request.user self.cleaned_data['muser'] = request.user obj.save() def save_audit_model(self, modelform, instance): obj = super(AuditForm, self).save(instance, commit=False) if not obj.cuser: obj.cuser = request.user obj.muser = request.user obj.save()
<commit_before>from django.shortcuts import render # Create your views here. <commit_msg>Create abstract AuditForm class to be used by Forms by classes that inherit from Audit model.<commit_after>from django.forms import ModelForm from common.models import Audit class AuditForm(ModelForm): class Meta: model = Audit exclude = ( 'cdate', 'mdate', 'cuser', 'muser', ) def save(self, *args, **kwargs): kwargs['commit']=False obj = super(AuditForm, self).save(*args, **kwargs) if not 'cuser' in self.cleaned_data: self.cleaned_data['cuser'] = request.user self.cleaned_data['muser'] = request.user obj.save() def save_audit_model(self, modelform, instance): obj = super(AuditForm, self).save(instance, commit=False) if not obj.cuser: obj.cuser = request.user obj.muser = request.user obj.save()
15c60a2380498706a973f23c745a109094670888
arches/__init__.py
arches/__init__.py
from __future__ import absolute_import from arches.setup import get_version try: from .celery import app as celery_app except ModuleNotFoundError as e: print(e) VERSION = (6, 0, 0, "beta", 0) # VERSION[3] options = "alpha", "beta", "rc", or "final" __version__ = get_version(VERSION) # This will make sure the app is always imported when # Django starts so that shared_task will use this app. __all__ = ("celery_app",)
from __future__ import absolute_import from arches.setup import get_version try: from .celery import app as celery_app except ModuleNotFoundError as e: print(e) VERSION = (6, 0, 0, "final", 0) # VERSION[3] options = "alpha", "beta", "rc", or "final" __version__ = get_version(VERSION) # This will make sure the app is always imported when # Django starts so that shared_task will use this app. __all__ = ("celery_app",)
Make release version final for 6.0.0
Make release version final for 6.0.0
Python
agpl-3.0
archesproject/arches,archesproject/arches,archesproject/arches,archesproject/arches
from __future__ import absolute_import from arches.setup import get_version try: from .celery import app as celery_app except ModuleNotFoundError as e: print(e) VERSION = (6, 0, 0, "beta", 0) # VERSION[3] options = "alpha", "beta", "rc", or "final" __version__ = get_version(VERSION) # This will make sure the app is always imported when # Django starts so that shared_task will use this app. __all__ = ("celery_app",) Make release version final for 6.0.0
from __future__ import absolute_import from arches.setup import get_version try: from .celery import app as celery_app except ModuleNotFoundError as e: print(e) VERSION = (6, 0, 0, "final", 0) # VERSION[3] options = "alpha", "beta", "rc", or "final" __version__ = get_version(VERSION) # This will make sure the app is always imported when # Django starts so that shared_task will use this app. __all__ = ("celery_app",)
<commit_before>from __future__ import absolute_import from arches.setup import get_version try: from .celery import app as celery_app except ModuleNotFoundError as e: print(e) VERSION = (6, 0, 0, "beta", 0) # VERSION[3] options = "alpha", "beta", "rc", or "final" __version__ = get_version(VERSION) # This will make sure the app is always imported when # Django starts so that shared_task will use this app. __all__ = ("celery_app",) <commit_msg>Make release version final for 6.0.0<commit_after>
from __future__ import absolute_import from arches.setup import get_version try: from .celery import app as celery_app except ModuleNotFoundError as e: print(e) VERSION = (6, 0, 0, "final", 0) # VERSION[3] options = "alpha", "beta", "rc", or "final" __version__ = get_version(VERSION) # This will make sure the app is always imported when # Django starts so that shared_task will use this app. __all__ = ("celery_app",)
from __future__ import absolute_import from arches.setup import get_version try: from .celery import app as celery_app except ModuleNotFoundError as e: print(e) VERSION = (6, 0, 0, "beta", 0) # VERSION[3] options = "alpha", "beta", "rc", or "final" __version__ = get_version(VERSION) # This will make sure the app is always imported when # Django starts so that shared_task will use this app. __all__ = ("celery_app",) Make release version final for 6.0.0from __future__ import absolute_import from arches.setup import get_version try: from .celery import app as celery_app except ModuleNotFoundError as e: print(e) VERSION = (6, 0, 0, "final", 0) # VERSION[3] options = "alpha", "beta", "rc", or "final" __version__ = get_version(VERSION) # This will make sure the app is always imported when # Django starts so that shared_task will use this app. __all__ = ("celery_app",)
<commit_before>from __future__ import absolute_import from arches.setup import get_version try: from .celery import app as celery_app except ModuleNotFoundError as e: print(e) VERSION = (6, 0, 0, "beta", 0) # VERSION[3] options = "alpha", "beta", "rc", or "final" __version__ = get_version(VERSION) # This will make sure the app is always imported when # Django starts so that shared_task will use this app. __all__ = ("celery_app",) <commit_msg>Make release version final for 6.0.0<commit_after>from __future__ import absolute_import from arches.setup import get_version try: from .celery import app as celery_app except ModuleNotFoundError as e: print(e) VERSION = (6, 0, 0, "final", 0) # VERSION[3] options = "alpha", "beta", "rc", or "final" __version__ = get_version(VERSION) # This will make sure the app is always imported when # Django starts so that shared_task will use this app. __all__ = ("celery_app",)
98b5cc41ac2eab72cd312c3f5af94053c3c0d420
pycket/impersonators/__init__.py
pycket/impersonators/__init__.py
from pycket import config if not config.hidden_classes: from pycket.impersonators.hidden_classes import * else: from pycket.impersonators.baseline import *
from pycket import config if config.hidden_classes: from pycket.impersonators.hidden_classes import * else: from pycket.impersonators.baseline import *
Use hidden classes by default
Use hidden classes by default
Python
mit
samth/pycket,pycket/pycket,pycket/pycket,samth/pycket,cderici/pycket,magnusmorton/pycket,magnusmorton/pycket,cderici/pycket,cderici/pycket,samth/pycket,pycket/pycket,magnusmorton/pycket
from pycket import config if not config.hidden_classes: from pycket.impersonators.hidden_classes import * else: from pycket.impersonators.baseline import * Use hidden classes by default
from pycket import config if config.hidden_classes: from pycket.impersonators.hidden_classes import * else: from pycket.impersonators.baseline import *
<commit_before> from pycket import config if not config.hidden_classes: from pycket.impersonators.hidden_classes import * else: from pycket.impersonators.baseline import * <commit_msg>Use hidden classes by default<commit_after>
from pycket import config if config.hidden_classes: from pycket.impersonators.hidden_classes import * else: from pycket.impersonators.baseline import *
from pycket import config if not config.hidden_classes: from pycket.impersonators.hidden_classes import * else: from pycket.impersonators.baseline import * Use hidden classes by default from pycket import config if config.hidden_classes: from pycket.impersonators.hidden_classes import * else: from pycket.impersonators.baseline import *
<commit_before> from pycket import config if not config.hidden_classes: from pycket.impersonators.hidden_classes import * else: from pycket.impersonators.baseline import * <commit_msg>Use hidden classes by default<commit_after> from pycket import config if config.hidden_classes: from pycket.impersonators.hidden_classes import * else: from pycket.impersonators.baseline import *
4e1b5e0df263e1d7746cf44c1896c9452f0454e4
src/filmyou/models.py
src/filmyou/models.py
from django.db import models class Person(models.Model): name = models.CharField(max_length=80) def __unicode__(self): return self.name class Genre(models.Model): name = models.CharField(max_length=40) def __unicode__(self): return self.name class Movie(models.Model): movie_id = models.CharField(max_length=7, primary_key=True) title = models.CharField(max_length=60) year = models.PositiveSmallIntegerField() runtime = models.PositiveSmallIntegerField() rating = models.CharField(max_length=12) director = models.ManyToManyField(Person, related_name="director") writer = models.ManyToManyField(Person, related_name="writer") cast = models.ManyToManyField(Person, related_name="cast") genre = models.ManyToManyField(Genre) released = models.DateField() plot = models.TextField() fullplot = models.TextField() poster = models.URLField() def __unicode__(self): return self.title
from django.db import models class Person(models.Model): person_id = models.PositiveIntegerField(primary_key=True) name = models.CharField(max_length=120) def __unicode__(self): return self.name class Genre(models.Model): genre_id = models.PositiveIntegerField(primary_key=True) name = models.CharField(max_length=40) def __unicode__(self): return self.name class Movie(models.Model): movie_id = models.PositiveIntegerField(primary_key=True) title = models.CharField(max_length=250) year = models.PositiveSmallIntegerField(null=True) runtime = models.PositiveSmallIntegerField(null=True) rating = models.CharField(max_length=24, null=True) released = models.DateField(null=True) plot = models.TextField(null=True) fullplot = models.TextField(null=True) poster = models.URLField(null=True) director = models.ManyToManyField(Person, related_name="director") writer = models.ManyToManyField(Person, related_name="writer") cast = models.ManyToManyField(Person, related_name="cast") genre = models.ManyToManyField(Genre) def __unicode__(self): return self.title
Update model to fit data properly.
Update model to fit data properly. There are some huge titles...
Python
apache-2.0
dvalcarce/filmyou-web,dvalcarce/filmyou-web,dvalcarce/filmyou-web
from django.db import models class Person(models.Model): name = models.CharField(max_length=80) def __unicode__(self): return self.name class Genre(models.Model): name = models.CharField(max_length=40) def __unicode__(self): return self.name class Movie(models.Model): movie_id = models.CharField(max_length=7, primary_key=True) title = models.CharField(max_length=60) year = models.PositiveSmallIntegerField() runtime = models.PositiveSmallIntegerField() rating = models.CharField(max_length=12) director = models.ManyToManyField(Person, related_name="director") writer = models.ManyToManyField(Person, related_name="writer") cast = models.ManyToManyField(Person, related_name="cast") genre = models.ManyToManyField(Genre) released = models.DateField() plot = models.TextField() fullplot = models.TextField() poster = models.URLField() def __unicode__(self): return self.title Update model to fit data properly. There are some huge titles...
from django.db import models class Person(models.Model): person_id = models.PositiveIntegerField(primary_key=True) name = models.CharField(max_length=120) def __unicode__(self): return self.name class Genre(models.Model): genre_id = models.PositiveIntegerField(primary_key=True) name = models.CharField(max_length=40) def __unicode__(self): return self.name class Movie(models.Model): movie_id = models.PositiveIntegerField(primary_key=True) title = models.CharField(max_length=250) year = models.PositiveSmallIntegerField(null=True) runtime = models.PositiveSmallIntegerField(null=True) rating = models.CharField(max_length=24, null=True) released = models.DateField(null=True) plot = models.TextField(null=True) fullplot = models.TextField(null=True) poster = models.URLField(null=True) director = models.ManyToManyField(Person, related_name="director") writer = models.ManyToManyField(Person, related_name="writer") cast = models.ManyToManyField(Person, related_name="cast") genre = models.ManyToManyField(Genre) def __unicode__(self): return self.title
<commit_before>from django.db import models class Person(models.Model): name = models.CharField(max_length=80) def __unicode__(self): return self.name class Genre(models.Model): name = models.CharField(max_length=40) def __unicode__(self): return self.name class Movie(models.Model): movie_id = models.CharField(max_length=7, primary_key=True) title = models.CharField(max_length=60) year = models.PositiveSmallIntegerField() runtime = models.PositiveSmallIntegerField() rating = models.CharField(max_length=12) director = models.ManyToManyField(Person, related_name="director") writer = models.ManyToManyField(Person, related_name="writer") cast = models.ManyToManyField(Person, related_name="cast") genre = models.ManyToManyField(Genre) released = models.DateField() plot = models.TextField() fullplot = models.TextField() poster = models.URLField() def __unicode__(self): return self.title <commit_msg>Update model to fit data properly. There are some huge titles...<commit_after>
from django.db import models class Person(models.Model): person_id = models.PositiveIntegerField(primary_key=True) name = models.CharField(max_length=120) def __unicode__(self): return self.name class Genre(models.Model): genre_id = models.PositiveIntegerField(primary_key=True) name = models.CharField(max_length=40) def __unicode__(self): return self.name class Movie(models.Model): movie_id = models.PositiveIntegerField(primary_key=True) title = models.CharField(max_length=250) year = models.PositiveSmallIntegerField(null=True) runtime = models.PositiveSmallIntegerField(null=True) rating = models.CharField(max_length=24, null=True) released = models.DateField(null=True) plot = models.TextField(null=True) fullplot = models.TextField(null=True) poster = models.URLField(null=True) director = models.ManyToManyField(Person, related_name="director") writer = models.ManyToManyField(Person, related_name="writer") cast = models.ManyToManyField(Person, related_name="cast") genre = models.ManyToManyField(Genre) def __unicode__(self): return self.title
from django.db import models class Person(models.Model): name = models.CharField(max_length=80) def __unicode__(self): return self.name class Genre(models.Model): name = models.CharField(max_length=40) def __unicode__(self): return self.name class Movie(models.Model): movie_id = models.CharField(max_length=7, primary_key=True) title = models.CharField(max_length=60) year = models.PositiveSmallIntegerField() runtime = models.PositiveSmallIntegerField() rating = models.CharField(max_length=12) director = models.ManyToManyField(Person, related_name="director") writer = models.ManyToManyField(Person, related_name="writer") cast = models.ManyToManyField(Person, related_name="cast") genre = models.ManyToManyField(Genre) released = models.DateField() plot = models.TextField() fullplot = models.TextField() poster = models.URLField() def __unicode__(self): return self.title Update model to fit data properly. There are some huge titles...from django.db import models class Person(models.Model): person_id = models.PositiveIntegerField(primary_key=True) name = models.CharField(max_length=120) def __unicode__(self): return self.name class Genre(models.Model): genre_id = models.PositiveIntegerField(primary_key=True) name = models.CharField(max_length=40) def __unicode__(self): return self.name class Movie(models.Model): movie_id = models.PositiveIntegerField(primary_key=True) title = models.CharField(max_length=250) year = models.PositiveSmallIntegerField(null=True) runtime = models.PositiveSmallIntegerField(null=True) rating = models.CharField(max_length=24, null=True) released = models.DateField(null=True) plot = models.TextField(null=True) fullplot = models.TextField(null=True) poster = models.URLField(null=True) director = models.ManyToManyField(Person, related_name="director") writer = models.ManyToManyField(Person, related_name="writer") cast = models.ManyToManyField(Person, related_name="cast") genre = models.ManyToManyField(Genre) def __unicode__(self): return self.title
<commit_before>from django.db import models class Person(models.Model): name = models.CharField(max_length=80) def __unicode__(self): return self.name class Genre(models.Model): name = models.CharField(max_length=40) def __unicode__(self): return self.name class Movie(models.Model): movie_id = models.CharField(max_length=7, primary_key=True) title = models.CharField(max_length=60) year = models.PositiveSmallIntegerField() runtime = models.PositiveSmallIntegerField() rating = models.CharField(max_length=12) director = models.ManyToManyField(Person, related_name="director") writer = models.ManyToManyField(Person, related_name="writer") cast = models.ManyToManyField(Person, related_name="cast") genre = models.ManyToManyField(Genre) released = models.DateField() plot = models.TextField() fullplot = models.TextField() poster = models.URLField() def __unicode__(self): return self.title <commit_msg>Update model to fit data properly. There are some huge titles...<commit_after>from django.db import models class Person(models.Model): person_id = models.PositiveIntegerField(primary_key=True) name = models.CharField(max_length=120) def __unicode__(self): return self.name class Genre(models.Model): genre_id = models.PositiveIntegerField(primary_key=True) name = models.CharField(max_length=40) def __unicode__(self): return self.name class Movie(models.Model): movie_id = models.PositiveIntegerField(primary_key=True) title = models.CharField(max_length=250) year = models.PositiveSmallIntegerField(null=True) runtime = models.PositiveSmallIntegerField(null=True) rating = models.CharField(max_length=24, null=True) released = models.DateField(null=True) plot = models.TextField(null=True) fullplot = models.TextField(null=True) poster = models.URLField(null=True) director = models.ManyToManyField(Person, related_name="director") writer = models.ManyToManyField(Person, related_name="writer") cast = models.ManyToManyField(Person, related_name="cast") genre = models.ManyToManyField(Genre) def __unicode__(self): return self.title
00680e5b6b6a5d1a16e8563c4ed2b5ca5e751901
shopping_app/utils/helpers.py
shopping_app/utils/helpers.py
import os import random import string from datetime import date, datetime def random_name(): return ''.join([random.choice(string.ascii_lowercase + string.digits) for n in range(20)]) def json_serial(obj): """JSON serializer for objects not serializable by default json code""" if isinstance(obj, (datetime, date)): return obj.isoformat() raise TypeError("Type %s not serializable" % type(obj)) def secret_key_gen(): filepath = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + '/secret.txt' generated_key = ''.join([random.SystemRandom().choice(string.ascii_letters + string.digits + string.punctuation) for _ in range(50)]) with open(filepath, 'w') as secret_file: secret_file.write( '%(key)s' % dict(key=generated_key) ) print('Find your secret key at %(path)s' % dict(path=filepath))
import os import random import string from datetime import date, datetime def random_name(): return ''.join([random.choice(string.ascii_lowercase + string.digits) for n in range(20)]) def json_serial(obj): """JSON serializer for objects not serializable by default json code""" if isinstance(obj, (datetime, date)): return obj.isoformat() raise TypeError("Type %s not serializable" % type(obj)) def secret_key_gen(): filepath = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + '/secret.txt' generated_key = ''.join([random.SystemRandom().choice(string.ascii_letters + string.digits) for _ in range(50)]) with open(filepath, 'w') as secret_file: secret_file.write( '%(key)s' % dict(key=generated_key) ) print('Find your secret key at %(path)s' % dict(path=filepath))
Update secret key generator to exclude pantuations
Update secret key generator to exclude pantuations
Python
mit
gr1d99/shopping-list,gr1d99/shopping-list,gr1d99/shopping-list
import os import random import string from datetime import date, datetime def random_name(): return ''.join([random.choice(string.ascii_lowercase + string.digits) for n in range(20)]) def json_serial(obj): """JSON serializer for objects not serializable by default json code""" if isinstance(obj, (datetime, date)): return obj.isoformat() raise TypeError("Type %s not serializable" % type(obj)) def secret_key_gen(): filepath = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + '/secret.txt' generated_key = ''.join([random.SystemRandom().choice(string.ascii_letters + string.digits + string.punctuation) for _ in range(50)]) with open(filepath, 'w') as secret_file: secret_file.write( '%(key)s' % dict(key=generated_key) ) print('Find your secret key at %(path)s' % dict(path=filepath)) Update secret key generator to exclude pantuations
import os import random import string from datetime import date, datetime def random_name(): return ''.join([random.choice(string.ascii_lowercase + string.digits) for n in range(20)]) def json_serial(obj): """JSON serializer for objects not serializable by default json code""" if isinstance(obj, (datetime, date)): return obj.isoformat() raise TypeError("Type %s not serializable" % type(obj)) def secret_key_gen(): filepath = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + '/secret.txt' generated_key = ''.join([random.SystemRandom().choice(string.ascii_letters + string.digits) for _ in range(50)]) with open(filepath, 'w') as secret_file: secret_file.write( '%(key)s' % dict(key=generated_key) ) print('Find your secret key at %(path)s' % dict(path=filepath))
<commit_before>import os import random import string from datetime import date, datetime def random_name(): return ''.join([random.choice(string.ascii_lowercase + string.digits) for n in range(20)]) def json_serial(obj): """JSON serializer for objects not serializable by default json code""" if isinstance(obj, (datetime, date)): return obj.isoformat() raise TypeError("Type %s not serializable" % type(obj)) def secret_key_gen(): filepath = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + '/secret.txt' generated_key = ''.join([random.SystemRandom().choice(string.ascii_letters + string.digits + string.punctuation) for _ in range(50)]) with open(filepath, 'w') as secret_file: secret_file.write( '%(key)s' % dict(key=generated_key) ) print('Find your secret key at %(path)s' % dict(path=filepath)) <commit_msg>Update secret key generator to exclude pantuations<commit_after>
import os import random import string from datetime import date, datetime def random_name(): return ''.join([random.choice(string.ascii_lowercase + string.digits) for n in range(20)]) def json_serial(obj): """JSON serializer for objects not serializable by default json code""" if isinstance(obj, (datetime, date)): return obj.isoformat() raise TypeError("Type %s not serializable" % type(obj)) def secret_key_gen(): filepath = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + '/secret.txt' generated_key = ''.join([random.SystemRandom().choice(string.ascii_letters + string.digits) for _ in range(50)]) with open(filepath, 'w') as secret_file: secret_file.write( '%(key)s' % dict(key=generated_key) ) print('Find your secret key at %(path)s' % dict(path=filepath))
import os import random import string from datetime import date, datetime def random_name(): return ''.join([random.choice(string.ascii_lowercase + string.digits) for n in range(20)]) def json_serial(obj): """JSON serializer for objects not serializable by default json code""" if isinstance(obj, (datetime, date)): return obj.isoformat() raise TypeError("Type %s not serializable" % type(obj)) def secret_key_gen(): filepath = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + '/secret.txt' generated_key = ''.join([random.SystemRandom().choice(string.ascii_letters + string.digits + string.punctuation) for _ in range(50)]) with open(filepath, 'w') as secret_file: secret_file.write( '%(key)s' % dict(key=generated_key) ) print('Find your secret key at %(path)s' % dict(path=filepath)) Update secret key generator to exclude pantuationsimport os import random import string from datetime import date, datetime def random_name(): return ''.join([random.choice(string.ascii_lowercase + string.digits) for n in range(20)]) def json_serial(obj): """JSON serializer for objects not serializable by default json code""" if isinstance(obj, (datetime, date)): return obj.isoformat() raise TypeError("Type %s not serializable" % type(obj)) def secret_key_gen(): filepath = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + '/secret.txt' generated_key = ''.join([random.SystemRandom().choice(string.ascii_letters + string.digits) for _ in range(50)]) with open(filepath, 'w') as secret_file: secret_file.write( '%(key)s' % dict(key=generated_key) ) print('Find your secret key at %(path)s' % dict(path=filepath))
<commit_before>import os import random import string from datetime import date, datetime def random_name(): return ''.join([random.choice(string.ascii_lowercase + string.digits) for n in range(20)]) def json_serial(obj): """JSON serializer for objects not serializable by default json code""" if isinstance(obj, (datetime, date)): return obj.isoformat() raise TypeError("Type %s not serializable" % type(obj)) def secret_key_gen(): filepath = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + '/secret.txt' generated_key = ''.join([random.SystemRandom().choice(string.ascii_letters + string.digits + string.punctuation) for _ in range(50)]) with open(filepath, 'w') as secret_file: secret_file.write( '%(key)s' % dict(key=generated_key) ) print('Find your secret key at %(path)s' % dict(path=filepath)) <commit_msg>Update secret key generator to exclude pantuations<commit_after>import os import random import string from datetime import date, datetime def random_name(): return ''.join([random.choice(string.ascii_lowercase + string.digits) for n in range(20)]) def json_serial(obj): """JSON serializer for objects not serializable by default json code""" if isinstance(obj, (datetime, date)): return obj.isoformat() raise TypeError("Type %s not serializable" % type(obj)) def secret_key_gen(): filepath = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + '/secret.txt' generated_key = ''.join([random.SystemRandom().choice(string.ascii_letters + string.digits) for _ in range(50)]) with open(filepath, 'w') as secret_file: secret_file.write( '%(key)s' % dict(key=generated_key) ) print('Find your secret key at %(path)s' % dict(path=filepath))
6e8e84fad2036b7df32376b617c97cb1a2144e94
shopping_app/utils/helpers.py
shopping_app/utils/helpers.py
import os import random import string from datetime import date, datetime def random_name(): return ''.join([random.choice(string.ascii_lowercase + string.digits) for n in range(20)]) def json_serial(obj): """JSON serializer for objects not serializable by default json code""" if isinstance(obj, (datetime, date)): return obj.isoformat() raise TypeError("Type %s not serializable" % type(obj)) def secret_key_gen(): filepath = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + '/secret.ini' generated_key = ''.join([random.SystemRandom().choice(string.ascii_letters + string.digits + string.punctuation) for _ in range(50)]) with open(filepath, 'w') as secret_file: secret_file.write( '[SECRET_KEY]\nKEY= %(key)s' % dict(key=generated_key) ) print('Find your secret key at %(path)s' % dict(path=filepath))
import os import random import string from datetime import date, datetime def random_name(): return ''.join([random.choice(string.ascii_lowercase + string.digits) for n in range(20)]) def json_serial(obj): """JSON serializer for objects not serializable by default json code""" if isinstance(obj, (datetime, date)): return obj.isoformat() raise TypeError("Type %s not serializable" % type(obj)) def secret_key_gen(): filepath = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + '/secret.txt' generated_key = ''.join([random.SystemRandom().choice(string.ascii_letters + string.digits + string.punctuation) for _ in range(50)]) with open(filepath, 'w') as secret_file: secret_file.write( '%(key)s' % dict(key=generated_key) ) print('Find your secret key at %(path)s' % dict(path=filepath))
Update secret file from to
Update secret file from to
Python
mit
gr1d99/shopping-list,gr1d99/shopping-list,gr1d99/shopping-list
import os import random import string from datetime import date, datetime def random_name(): return ''.join([random.choice(string.ascii_lowercase + string.digits) for n in range(20)]) def json_serial(obj): """JSON serializer for objects not serializable by default json code""" if isinstance(obj, (datetime, date)): return obj.isoformat() raise TypeError("Type %s not serializable" % type(obj)) def secret_key_gen(): filepath = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + '/secret.ini' generated_key = ''.join([random.SystemRandom().choice(string.ascii_letters + string.digits + string.punctuation) for _ in range(50)]) with open(filepath, 'w') as secret_file: secret_file.write( '[SECRET_KEY]\nKEY= %(key)s' % dict(key=generated_key) ) print('Find your secret key at %(path)s' % dict(path=filepath)) Update secret file from to
import os import random import string from datetime import date, datetime def random_name(): return ''.join([random.choice(string.ascii_lowercase + string.digits) for n in range(20)]) def json_serial(obj): """JSON serializer for objects not serializable by default json code""" if isinstance(obj, (datetime, date)): return obj.isoformat() raise TypeError("Type %s not serializable" % type(obj)) def secret_key_gen(): filepath = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + '/secret.txt' generated_key = ''.join([random.SystemRandom().choice(string.ascii_letters + string.digits + string.punctuation) for _ in range(50)]) with open(filepath, 'w') as secret_file: secret_file.write( '%(key)s' % dict(key=generated_key) ) print('Find your secret key at %(path)s' % dict(path=filepath))
<commit_before>import os import random import string from datetime import date, datetime def random_name(): return ''.join([random.choice(string.ascii_lowercase + string.digits) for n in range(20)]) def json_serial(obj): """JSON serializer for objects not serializable by default json code""" if isinstance(obj, (datetime, date)): return obj.isoformat() raise TypeError("Type %s not serializable" % type(obj)) def secret_key_gen(): filepath = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + '/secret.ini' generated_key = ''.join([random.SystemRandom().choice(string.ascii_letters + string.digits + string.punctuation) for _ in range(50)]) with open(filepath, 'w') as secret_file: secret_file.write( '[SECRET_KEY]\nKEY= %(key)s' % dict(key=generated_key) ) print('Find your secret key at %(path)s' % dict(path=filepath)) <commit_msg>Update secret file from to<commit_after>
import os import random import string from datetime import date, datetime def random_name(): return ''.join([random.choice(string.ascii_lowercase + string.digits) for n in range(20)]) def json_serial(obj): """JSON serializer for objects not serializable by default json code""" if isinstance(obj, (datetime, date)): return obj.isoformat() raise TypeError("Type %s not serializable" % type(obj)) def secret_key_gen(): filepath = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + '/secret.txt' generated_key = ''.join([random.SystemRandom().choice(string.ascii_letters + string.digits + string.punctuation) for _ in range(50)]) with open(filepath, 'w') as secret_file: secret_file.write( '%(key)s' % dict(key=generated_key) ) print('Find your secret key at %(path)s' % dict(path=filepath))
import os import random import string from datetime import date, datetime def random_name(): return ''.join([random.choice(string.ascii_lowercase + string.digits) for n in range(20)]) def json_serial(obj): """JSON serializer for objects not serializable by default json code""" if isinstance(obj, (datetime, date)): return obj.isoformat() raise TypeError("Type %s not serializable" % type(obj)) def secret_key_gen(): filepath = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + '/secret.ini' generated_key = ''.join([random.SystemRandom().choice(string.ascii_letters + string.digits + string.punctuation) for _ in range(50)]) with open(filepath, 'w') as secret_file: secret_file.write( '[SECRET_KEY]\nKEY= %(key)s' % dict(key=generated_key) ) print('Find your secret key at %(path)s' % dict(path=filepath)) Update secret file from toimport os import random import string from datetime import date, datetime def random_name(): return ''.join([random.choice(string.ascii_lowercase + string.digits) for n in range(20)]) def json_serial(obj): """JSON serializer for objects not serializable by default json code""" if isinstance(obj, (datetime, date)): return obj.isoformat() raise TypeError("Type %s not serializable" % type(obj)) def secret_key_gen(): filepath = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + '/secret.txt' generated_key = ''.join([random.SystemRandom().choice(string.ascii_letters + string.digits + string.punctuation) for _ in range(50)]) with open(filepath, 'w') as secret_file: secret_file.write( '%(key)s' % dict(key=generated_key) ) print('Find your secret key at %(path)s' % dict(path=filepath))
<commit_before>import os import random import string from datetime import date, datetime def random_name(): return ''.join([random.choice(string.ascii_lowercase + string.digits) for n in range(20)]) def json_serial(obj): """JSON serializer for objects not serializable by default json code""" if isinstance(obj, (datetime, date)): return obj.isoformat() raise TypeError("Type %s not serializable" % type(obj)) def secret_key_gen(): filepath = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + '/secret.ini' generated_key = ''.join([random.SystemRandom().choice(string.ascii_letters + string.digits + string.punctuation) for _ in range(50)]) with open(filepath, 'w') as secret_file: secret_file.write( '[SECRET_KEY]\nKEY= %(key)s' % dict(key=generated_key) ) print('Find your secret key at %(path)s' % dict(path=filepath)) <commit_msg>Update secret file from to<commit_after>import os import random import string from datetime import date, datetime def random_name(): return ''.join([random.choice(string.ascii_lowercase + string.digits) for n in range(20)]) def json_serial(obj): """JSON serializer for objects not serializable by default json code""" if isinstance(obj, (datetime, date)): return obj.isoformat() raise TypeError("Type %s not serializable" % type(obj)) def secret_key_gen(): filepath = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + '/secret.txt' generated_key = ''.join([random.SystemRandom().choice(string.ascii_letters + string.digits + string.punctuation) for _ in range(50)]) with open(filepath, 'w') as secret_file: secret_file.write( '%(key)s' % dict(key=generated_key) ) print('Find your secret key at %(path)s' % dict(path=filepath))
e1b1b4ce02b3504c406208e77df01cf9a047924c
src/ansible/views.py
src/ansible/views.py
from django.shortcuts import get_object_or_404, render from django.http import HttpResponseRedirect, HttpResponse from formtools.wizard.views import SessionWizardView from ansible.models import Github def index(request): return HttpResponse("200") class PlaybookWizard(SessionWizardView): def get_form_initial(self, step): initial = {} if step == '1': prev_data = self.storage.get_step_data('0') initial['name'] = prev_data['0-repository'] return self.initial_dict.get(step, initial) return self.initial_dict.get(step, {}) def done(self, form_list, **kwargs): form_data = {} for form in form_list: form.save() return HttpResponseRedirect('/ansible')
from django.shortcuts import get_object_or_404, render from django.http import HttpResponseRedirect, HttpResponse from formtools.wizard.views import SessionWizardView from ansible.models import Github, Playbook import sys def index(request): return HttpResponse("200") class PlaybookWizard(SessionWizardView): def get_form_initial(self, step): initial = {} if step == '1': prev_data = self.storage.get_step_data('0') initial['name'] = prev_data['0-repository'] return self.initial_dict.get(step, initial) return self.initial_dict.get(step, {}) def get_form_step_data(self, form): data = {} if self.get_form_prefix() == '0': github = Github() github.repository = form.data.dict()['0-repository'] github.username = form.data.dict()['0-username'] github.save() if self.get_form_prefix() == '1': playbook = Playbook() playbook.name = form.data.dict()['1-name'] playbook.inventory = form.data.dict()['1-inventory'] playbook.user = form.data.dict()['1-user'] playbook.save() return form.data def done(self, form_list, **kwargs): return HttpResponseRedirect('/ansible')
Save form data to DB on each step
Save form data to DB on each step
Python
bsd-3-clause
lozadaOmr/ansible-admin,lozadaOmr/ansible-admin,lozadaOmr/ansible-admin
from django.shortcuts import get_object_or_404, render from django.http import HttpResponseRedirect, HttpResponse from formtools.wizard.views import SessionWizardView from ansible.models import Github def index(request): return HttpResponse("200") class PlaybookWizard(SessionWizardView): def get_form_initial(self, step): initial = {} if step == '1': prev_data = self.storage.get_step_data('0') initial['name'] = prev_data['0-repository'] return self.initial_dict.get(step, initial) return self.initial_dict.get(step, {}) def done(self, form_list, **kwargs): form_data = {} for form in form_list: form.save() return HttpResponseRedirect('/ansible') Save form data to DB on each step
from django.shortcuts import get_object_or_404, render from django.http import HttpResponseRedirect, HttpResponse from formtools.wizard.views import SessionWizardView from ansible.models import Github, Playbook import sys def index(request): return HttpResponse("200") class PlaybookWizard(SessionWizardView): def get_form_initial(self, step): initial = {} if step == '1': prev_data = self.storage.get_step_data('0') initial['name'] = prev_data['0-repository'] return self.initial_dict.get(step, initial) return self.initial_dict.get(step, {}) def get_form_step_data(self, form): data = {} if self.get_form_prefix() == '0': github = Github() github.repository = form.data.dict()['0-repository'] github.username = form.data.dict()['0-username'] github.save() if self.get_form_prefix() == '1': playbook = Playbook() playbook.name = form.data.dict()['1-name'] playbook.inventory = form.data.dict()['1-inventory'] playbook.user = form.data.dict()['1-user'] playbook.save() return form.data def done(self, form_list, **kwargs): return HttpResponseRedirect('/ansible')
<commit_before>from django.shortcuts import get_object_or_404, render from django.http import HttpResponseRedirect, HttpResponse from formtools.wizard.views import SessionWizardView from ansible.models import Github def index(request): return HttpResponse("200") class PlaybookWizard(SessionWizardView): def get_form_initial(self, step): initial = {} if step == '1': prev_data = self.storage.get_step_data('0') initial['name'] = prev_data['0-repository'] return self.initial_dict.get(step, initial) return self.initial_dict.get(step, {}) def done(self, form_list, **kwargs): form_data = {} for form in form_list: form.save() return HttpResponseRedirect('/ansible') <commit_msg>Save form data to DB on each step<commit_after>
from django.shortcuts import get_object_or_404, render from django.http import HttpResponseRedirect, HttpResponse from formtools.wizard.views import SessionWizardView from ansible.models import Github, Playbook import sys def index(request): return HttpResponse("200") class PlaybookWizard(SessionWizardView): def get_form_initial(self, step): initial = {} if step == '1': prev_data = self.storage.get_step_data('0') initial['name'] = prev_data['0-repository'] return self.initial_dict.get(step, initial) return self.initial_dict.get(step, {}) def get_form_step_data(self, form): data = {} if self.get_form_prefix() == '0': github = Github() github.repository = form.data.dict()['0-repository'] github.username = form.data.dict()['0-username'] github.save() if self.get_form_prefix() == '1': playbook = Playbook() playbook.name = form.data.dict()['1-name'] playbook.inventory = form.data.dict()['1-inventory'] playbook.user = form.data.dict()['1-user'] playbook.save() return form.data def done(self, form_list, **kwargs): return HttpResponseRedirect('/ansible')
from django.shortcuts import get_object_or_404, render from django.http import HttpResponseRedirect, HttpResponse from formtools.wizard.views import SessionWizardView from ansible.models import Github def index(request): return HttpResponse("200") class PlaybookWizard(SessionWizardView): def get_form_initial(self, step): initial = {} if step == '1': prev_data = self.storage.get_step_data('0') initial['name'] = prev_data['0-repository'] return self.initial_dict.get(step, initial) return self.initial_dict.get(step, {}) def done(self, form_list, **kwargs): form_data = {} for form in form_list: form.save() return HttpResponseRedirect('/ansible') Save form data to DB on each stepfrom django.shortcuts import get_object_or_404, render from django.http import HttpResponseRedirect, HttpResponse from formtools.wizard.views import SessionWizardView from ansible.models import Github, Playbook import sys def index(request): return HttpResponse("200") class PlaybookWizard(SessionWizardView): def get_form_initial(self, step): initial = {} if step == '1': prev_data = self.storage.get_step_data('0') initial['name'] = prev_data['0-repository'] return self.initial_dict.get(step, initial) return self.initial_dict.get(step, {}) def get_form_step_data(self, form): data = {} if self.get_form_prefix() == '0': github = Github() github.repository = form.data.dict()['0-repository'] github.username = form.data.dict()['0-username'] github.save() if self.get_form_prefix() == '1': playbook = Playbook() playbook.name = form.data.dict()['1-name'] playbook.inventory = form.data.dict()['1-inventory'] playbook.user = form.data.dict()['1-user'] playbook.save() return form.data def done(self, form_list, **kwargs): return HttpResponseRedirect('/ansible')
<commit_before>from django.shortcuts import get_object_or_404, render from django.http import HttpResponseRedirect, HttpResponse from formtools.wizard.views import SessionWizardView from ansible.models import Github def index(request): return HttpResponse("200") class PlaybookWizard(SessionWizardView): def get_form_initial(self, step): initial = {} if step == '1': prev_data = self.storage.get_step_data('0') initial['name'] = prev_data['0-repository'] return self.initial_dict.get(step, initial) return self.initial_dict.get(step, {}) def done(self, form_list, **kwargs): form_data = {} for form in form_list: form.save() return HttpResponseRedirect('/ansible') <commit_msg>Save form data to DB on each step<commit_after>from django.shortcuts import get_object_or_404, render from django.http import HttpResponseRedirect, HttpResponse from formtools.wizard.views import SessionWizardView from ansible.models import Github, Playbook import sys def index(request): return HttpResponse("200") class PlaybookWizard(SessionWizardView): def get_form_initial(self, step): initial = {} if step == '1': prev_data = self.storage.get_step_data('0') initial['name'] = prev_data['0-repository'] return self.initial_dict.get(step, initial) return self.initial_dict.get(step, {}) def get_form_step_data(self, form): data = {} if self.get_form_prefix() == '0': github = Github() github.repository = form.data.dict()['0-repository'] github.username = form.data.dict()['0-username'] github.save() if self.get_form_prefix() == '1': playbook = Playbook() playbook.name = form.data.dict()['1-name'] playbook.inventory = form.data.dict()['1-inventory'] playbook.user = form.data.dict()['1-user'] playbook.save() return form.data def done(self, form_list, **kwargs): return HttpResponseRedirect('/ansible')
8155ecbb94696f5ffe1990948f0a60dcc0552ec3
odbc2csv.py
odbc2csv.py
import pypyodbc import csv conn = pypyodbc.connect("DSN=") cur = conn.cursor() tables = [] cur.execute("select * from sys.tables") for row in cur.fetchall(): tables.append(row[0]) for table in tables: cur.execute("select * from %s" % table) column_names = [] for d in cur.description: column_names.append(d[0]) file = open("%s.csv" % table, "w") writer = csv.writer(file) writer.writerow(column_names) for row in cur.fetchall(): writer.writerow(row) file.close()
import pypyodbc import csv conn = pypyodbc.connect("DSN=") cur = conn.cursor() tables = [] cur.execute("select * from sys.tables") for row in cur.fetchall(): tables.append(row[0]) for table in tables: cur.execute("select * from %s" % table) column_names = [] for d in cur.description: column_names.append(d[0]) file = open("%s.csv" % table, "wb") writer = csv.writer(file) writer.writerow(column_names) for row in cur.fetchall(): writer.writerow(row) file.close()
Write binary for CSV file.
Write binary for CSV file.
Python
isc
wablair/misc_scripts,wablair/misc_scripts,wablair/misc_scripts,wablair/misc_scripts
import pypyodbc import csv conn = pypyodbc.connect("DSN=") cur = conn.cursor() tables = [] cur.execute("select * from sys.tables") for row in cur.fetchall(): tables.append(row[0]) for table in tables: cur.execute("select * from %s" % table) column_names = [] for d in cur.description: column_names.append(d[0]) file = open("%s.csv" % table, "w") writer = csv.writer(file) writer.writerow(column_names) for row in cur.fetchall(): writer.writerow(row) file.close() Write binary for CSV file.
import pypyodbc import csv conn = pypyodbc.connect("DSN=") cur = conn.cursor() tables = [] cur.execute("select * from sys.tables") for row in cur.fetchall(): tables.append(row[0]) for table in tables: cur.execute("select * from %s" % table) column_names = [] for d in cur.description: column_names.append(d[0]) file = open("%s.csv" % table, "wb") writer = csv.writer(file) writer.writerow(column_names) for row in cur.fetchall(): writer.writerow(row) file.close()
<commit_before>import pypyodbc import csv conn = pypyodbc.connect("DSN=") cur = conn.cursor() tables = [] cur.execute("select * from sys.tables") for row in cur.fetchall(): tables.append(row[0]) for table in tables: cur.execute("select * from %s" % table) column_names = [] for d in cur.description: column_names.append(d[0]) file = open("%s.csv" % table, "w") writer = csv.writer(file) writer.writerow(column_names) for row in cur.fetchall(): writer.writerow(row) file.close() <commit_msg>Write binary for CSV file.<commit_after>
import pypyodbc import csv conn = pypyodbc.connect("DSN=") cur = conn.cursor() tables = [] cur.execute("select * from sys.tables") for row in cur.fetchall(): tables.append(row[0]) for table in tables: cur.execute("select * from %s" % table) column_names = [] for d in cur.description: column_names.append(d[0]) file = open("%s.csv" % table, "wb") writer = csv.writer(file) writer.writerow(column_names) for row in cur.fetchall(): writer.writerow(row) file.close()
import pypyodbc import csv conn = pypyodbc.connect("DSN=") cur = conn.cursor() tables = [] cur.execute("select * from sys.tables") for row in cur.fetchall(): tables.append(row[0]) for table in tables: cur.execute("select * from %s" % table) column_names = [] for d in cur.description: column_names.append(d[0]) file = open("%s.csv" % table, "w") writer = csv.writer(file) writer.writerow(column_names) for row in cur.fetchall(): writer.writerow(row) file.close() Write binary for CSV file.import pypyodbc import csv conn = pypyodbc.connect("DSN=") cur = conn.cursor() tables = [] cur.execute("select * from sys.tables") for row in cur.fetchall(): tables.append(row[0]) for table in tables: cur.execute("select * from %s" % table) column_names = [] for d in cur.description: column_names.append(d[0]) file = open("%s.csv" % table, "wb") writer = csv.writer(file) writer.writerow(column_names) for row in cur.fetchall(): writer.writerow(row) file.close()
<commit_before>import pypyodbc import csv conn = pypyodbc.connect("DSN=") cur = conn.cursor() tables = [] cur.execute("select * from sys.tables") for row in cur.fetchall(): tables.append(row[0]) for table in tables: cur.execute("select * from %s" % table) column_names = [] for d in cur.description: column_names.append(d[0]) file = open("%s.csv" % table, "w") writer = csv.writer(file) writer.writerow(column_names) for row in cur.fetchall(): writer.writerow(row) file.close() <commit_msg>Write binary for CSV file.<commit_after>import pypyodbc import csv conn = pypyodbc.connect("DSN=") cur = conn.cursor() tables = [] cur.execute("select * from sys.tables") for row in cur.fetchall(): tables.append(row[0]) for table in tables: cur.execute("select * from %s" % table) column_names = [] for d in cur.description: column_names.append(d[0]) file = open("%s.csv" % table, "wb") writer = csv.writer(file) writer.writerow(column_names) for row in cur.fetchall(): writer.writerow(row) file.close()
ef5a6507c7c409ce3aeca3ac3c61960cbad32ce5
tests/test_memcache.py
tests/test_memcache.py
#!/usr/bin/env python # coding=utf8 from simplekv.memory.memcachestore import MemcacheStore from basic_store import BasicStore, TTLStore import pytest memcache = pytest.importorskip('memcache') class TestMemcacheStore(TTLStore, BasicStore): @pytest.yield_fixture() def store(self): mc = memcache.Client(['localhost:11211']) mc.set('foo', 'bar') if not mc.get('foo') == 'bar': pytest.skip('memcache connection not working') mc.flush_all() yield MemcacheStore(mc) mc.flush_all() # disabled tests (no full API support for memcache) test_has_key = None test_has_key_with_delete = None test_key_iterator = None test_keys = None def test_keys_throws_io_error(self, store): with pytest.raises(IOError): store.keys() with pytest.raises(IOError): store.iter_keys() with pytest.raises(IOError): iter(store) def test_contains_throws_io_error_or_succeeds(self, store): try: 'a' in store except IOError: pass
#!/usr/bin/env python # coding=utf8 from simplekv.memory.memcachestore import MemcacheStore from basic_store import BasicStore, TTLStore import pytest memcache = pytest.importorskip('memcache') class TestMemcacheStore(TTLStore, BasicStore): @pytest.yield_fixture() def store(self): mc = memcache.Client(['localhost:11211']) mc.set('foo', 'bar') if not mc.get('foo') == 'bar': pytest.skip('memcache connection not working') mc.flush_all() yield MemcacheStore(mc) mc.flush_all() # disabled tests (no full API support for memcache) test_has_key = None test_has_key_with_delete = None test_key_iterator = None test_keys = None # memcache is weird test_put_with_ttl_argument = None test_put_set_default = None test_put_file_with_ttl_argument = None test_put_file_set_default = None def test_keys_throws_io_error(self, store): with pytest.raises(IOError): store.keys() with pytest.raises(IOError): store.iter_keys() with pytest.raises(IOError): iter(store) def test_contains_throws_io_error_or_succeeds(self, store): try: 'a' in store except IOError: pass
Disable more tests on memcache.
Disable more tests on memcache.
Python
mit
mbr/simplekv,fmarczin/simplekv,mbr/simplekv,fmarczin/simplekv,karteek/simplekv,karteek/simplekv
#!/usr/bin/env python # coding=utf8 from simplekv.memory.memcachestore import MemcacheStore from basic_store import BasicStore, TTLStore import pytest memcache = pytest.importorskip('memcache') class TestMemcacheStore(TTLStore, BasicStore): @pytest.yield_fixture() def store(self): mc = memcache.Client(['localhost:11211']) mc.set('foo', 'bar') if not mc.get('foo') == 'bar': pytest.skip('memcache connection not working') mc.flush_all() yield MemcacheStore(mc) mc.flush_all() # disabled tests (no full API support for memcache) test_has_key = None test_has_key_with_delete = None test_key_iterator = None test_keys = None def test_keys_throws_io_error(self, store): with pytest.raises(IOError): store.keys() with pytest.raises(IOError): store.iter_keys() with pytest.raises(IOError): iter(store) def test_contains_throws_io_error_or_succeeds(self, store): try: 'a' in store except IOError: pass Disable more tests on memcache.
#!/usr/bin/env python # coding=utf8 from simplekv.memory.memcachestore import MemcacheStore from basic_store import BasicStore, TTLStore import pytest memcache = pytest.importorskip('memcache') class TestMemcacheStore(TTLStore, BasicStore): @pytest.yield_fixture() def store(self): mc = memcache.Client(['localhost:11211']) mc.set('foo', 'bar') if not mc.get('foo') == 'bar': pytest.skip('memcache connection not working') mc.flush_all() yield MemcacheStore(mc) mc.flush_all() # disabled tests (no full API support for memcache) test_has_key = None test_has_key_with_delete = None test_key_iterator = None test_keys = None # memcache is weird test_put_with_ttl_argument = None test_put_set_default = None test_put_file_with_ttl_argument = None test_put_file_set_default = None def test_keys_throws_io_error(self, store): with pytest.raises(IOError): store.keys() with pytest.raises(IOError): store.iter_keys() with pytest.raises(IOError): iter(store) def test_contains_throws_io_error_or_succeeds(self, store): try: 'a' in store except IOError: pass
<commit_before>#!/usr/bin/env python # coding=utf8 from simplekv.memory.memcachestore import MemcacheStore from basic_store import BasicStore, TTLStore import pytest memcache = pytest.importorskip('memcache') class TestMemcacheStore(TTLStore, BasicStore): @pytest.yield_fixture() def store(self): mc = memcache.Client(['localhost:11211']) mc.set('foo', 'bar') if not mc.get('foo') == 'bar': pytest.skip('memcache connection not working') mc.flush_all() yield MemcacheStore(mc) mc.flush_all() # disabled tests (no full API support for memcache) test_has_key = None test_has_key_with_delete = None test_key_iterator = None test_keys = None def test_keys_throws_io_error(self, store): with pytest.raises(IOError): store.keys() with pytest.raises(IOError): store.iter_keys() with pytest.raises(IOError): iter(store) def test_contains_throws_io_error_or_succeeds(self, store): try: 'a' in store except IOError: pass <commit_msg>Disable more tests on memcache.<commit_after>
#!/usr/bin/env python # coding=utf8 from simplekv.memory.memcachestore import MemcacheStore from basic_store import BasicStore, TTLStore import pytest memcache = pytest.importorskip('memcache') class TestMemcacheStore(TTLStore, BasicStore): @pytest.yield_fixture() def store(self): mc = memcache.Client(['localhost:11211']) mc.set('foo', 'bar') if not mc.get('foo') == 'bar': pytest.skip('memcache connection not working') mc.flush_all() yield MemcacheStore(mc) mc.flush_all() # disabled tests (no full API support for memcache) test_has_key = None test_has_key_with_delete = None test_key_iterator = None test_keys = None # memcache is weird test_put_with_ttl_argument = None test_put_set_default = None test_put_file_with_ttl_argument = None test_put_file_set_default = None def test_keys_throws_io_error(self, store): with pytest.raises(IOError): store.keys() with pytest.raises(IOError): store.iter_keys() with pytest.raises(IOError): iter(store) def test_contains_throws_io_error_or_succeeds(self, store): try: 'a' in store except IOError: pass
#!/usr/bin/env python # coding=utf8 from simplekv.memory.memcachestore import MemcacheStore from basic_store import BasicStore, TTLStore import pytest memcache = pytest.importorskip('memcache') class TestMemcacheStore(TTLStore, BasicStore): @pytest.yield_fixture() def store(self): mc = memcache.Client(['localhost:11211']) mc.set('foo', 'bar') if not mc.get('foo') == 'bar': pytest.skip('memcache connection not working') mc.flush_all() yield MemcacheStore(mc) mc.flush_all() # disabled tests (no full API support for memcache) test_has_key = None test_has_key_with_delete = None test_key_iterator = None test_keys = None def test_keys_throws_io_error(self, store): with pytest.raises(IOError): store.keys() with pytest.raises(IOError): store.iter_keys() with pytest.raises(IOError): iter(store) def test_contains_throws_io_error_or_succeeds(self, store): try: 'a' in store except IOError: pass Disable more tests on memcache.#!/usr/bin/env python # coding=utf8 from simplekv.memory.memcachestore import MemcacheStore from basic_store import BasicStore, TTLStore import pytest memcache = pytest.importorskip('memcache') class TestMemcacheStore(TTLStore, BasicStore): @pytest.yield_fixture() def store(self): mc = memcache.Client(['localhost:11211']) mc.set('foo', 'bar') if not mc.get('foo') == 'bar': pytest.skip('memcache connection not working') mc.flush_all() yield MemcacheStore(mc) mc.flush_all() # disabled tests (no full API support for memcache) test_has_key = None test_has_key_with_delete = None test_key_iterator = None test_keys = None # memcache is weird test_put_with_ttl_argument = None test_put_set_default = None test_put_file_with_ttl_argument = None test_put_file_set_default = None def test_keys_throws_io_error(self, store): with pytest.raises(IOError): store.keys() with pytest.raises(IOError): store.iter_keys() with pytest.raises(IOError): iter(store) def test_contains_throws_io_error_or_succeeds(self, store): try: 'a' in store except IOError: pass
<commit_before>#!/usr/bin/env python # coding=utf8 from simplekv.memory.memcachestore import MemcacheStore from basic_store import BasicStore, TTLStore import pytest memcache = pytest.importorskip('memcache') class TestMemcacheStore(TTLStore, BasicStore): @pytest.yield_fixture() def store(self): mc = memcache.Client(['localhost:11211']) mc.set('foo', 'bar') if not mc.get('foo') == 'bar': pytest.skip('memcache connection not working') mc.flush_all() yield MemcacheStore(mc) mc.flush_all() # disabled tests (no full API support for memcache) test_has_key = None test_has_key_with_delete = None test_key_iterator = None test_keys = None def test_keys_throws_io_error(self, store): with pytest.raises(IOError): store.keys() with pytest.raises(IOError): store.iter_keys() with pytest.raises(IOError): iter(store) def test_contains_throws_io_error_or_succeeds(self, store): try: 'a' in store except IOError: pass <commit_msg>Disable more tests on memcache.<commit_after>#!/usr/bin/env python # coding=utf8 from simplekv.memory.memcachestore import MemcacheStore from basic_store import BasicStore, TTLStore import pytest memcache = pytest.importorskip('memcache') class TestMemcacheStore(TTLStore, BasicStore): @pytest.yield_fixture() def store(self): mc = memcache.Client(['localhost:11211']) mc.set('foo', 'bar') if not mc.get('foo') == 'bar': pytest.skip('memcache connection not working') mc.flush_all() yield MemcacheStore(mc) mc.flush_all() # disabled tests (no full API support for memcache) test_has_key = None test_has_key_with_delete = None test_key_iterator = None test_keys = None # memcache is weird test_put_with_ttl_argument = None test_put_set_default = None test_put_file_with_ttl_argument = None test_put_file_set_default = None def test_keys_throws_io_error(self, store): with pytest.raises(IOError): store.keys() with pytest.raises(IOError): store.iter_keys() with pytest.raises(IOError): iter(store) def test_contains_throws_io_error_or_succeeds(self, store): try: 'a' in store except IOError: pass
69fb681cd27b43cc2d5500fcca89df3744b3661c
tests/test_registry.py
tests/test_registry.py
import pytest from web_test_base import * class TestIATIRegistry(WebTestBase): requests_to_load = { 'IATI Registry Homepage - http, no www': { 'url': 'http://iatiregistry.org/' } , 'IATI Registry Homepage - http, with www': { 'url': 'http://www.iatiregistry.org/' } , 'IATI Registry Homepage - https, no www': { 'url': 'https://iatiregistry.org/' } , 'IATI Registry Homepage - https, with www': { 'url': 'https://www.iatiregistry.org/' } } def test_contains_links(self, loaded_request): """ Test that each page contains links to the defined URLs. """ result = utility.get_links_from_page(loaded_request) assert "http://www.aidtransparency.net/" in result assert "http://www.iatistandard.org/" in result
import pytest from web_test_base import * class TestIATIRegistry(WebTestBase): requests_to_load = { 'IATI Registry Homepage - http, no www': { 'url': 'http://iatiregistry.org/' } , 'IATI Registry Homepage - http, with www': { 'url': 'http://www.iatiregistry.org/' } , 'IATI Registry Homepage - https, no www': { 'url': 'https://iatiregistry.org/' } , 'IATI Registry Homepage - https, with www': { 'url': 'https://www.iatiregistry.org/' } , 'IATI Registry Registration Page': { 'url': 'https://iatiregistry.org/user/register' } } def test_contains_links(self, loaded_request): """ Test that each page contains links to the defined URLs. """ result = utility.get_links_from_page(loaded_request) assert "http://www.aidtransparency.net/" in result assert "http://www.iatistandard.org/" in result @pytest.mark.parametrize("target_request", ["IATI Registry Registration Page"]) def test_registration_form_presence(self, target_request): """ Test that there is a valid registration form on the Registry Registration Page. """ req = self.loaded_request_from_test_name(target_request) form_xpath = '//*[@id="user-register-form"]' form_method_xpath = '//*[@id="user-register-form"]/@method' input_xpath = '//*[@id="user-register-form"]/div/div/input' forms = utility.locate_xpath_result(req, form_xpath) form_method = utility.locate_xpath_result(req, form_method_xpath) form_inputs = utility.locate_xpath_result(req, input_xpath) assert len(forms) == 1 assert form_method == ['post'] assert len(form_inputs) == 5
Add test for registry registration form
Add test for registry registration form This adds a test to ensure that the registry registration page has a registration form with the expected method and number of inputs.
Python
mit
IATI/IATI-Website-Tests
import pytest from web_test_base import * class TestIATIRegistry(WebTestBase): requests_to_load = { 'IATI Registry Homepage - http, no www': { 'url': 'http://iatiregistry.org/' } , 'IATI Registry Homepage - http, with www': { 'url': 'http://www.iatiregistry.org/' } , 'IATI Registry Homepage - https, no www': { 'url': 'https://iatiregistry.org/' } , 'IATI Registry Homepage - https, with www': { 'url': 'https://www.iatiregistry.org/' } } def test_contains_links(self, loaded_request): """ Test that each page contains links to the defined URLs. """ result = utility.get_links_from_page(loaded_request) assert "http://www.aidtransparency.net/" in result assert "http://www.iatistandard.org/" in result Add test for registry registration form This adds a test to ensure that the registry registration page has a registration form with the expected method and number of inputs.
import pytest from web_test_base import * class TestIATIRegistry(WebTestBase): requests_to_load = { 'IATI Registry Homepage - http, no www': { 'url': 'http://iatiregistry.org/' } , 'IATI Registry Homepage - http, with www': { 'url': 'http://www.iatiregistry.org/' } , 'IATI Registry Homepage - https, no www': { 'url': 'https://iatiregistry.org/' } , 'IATI Registry Homepage - https, with www': { 'url': 'https://www.iatiregistry.org/' } , 'IATI Registry Registration Page': { 'url': 'https://iatiregistry.org/user/register' } } def test_contains_links(self, loaded_request): """ Test that each page contains links to the defined URLs. """ result = utility.get_links_from_page(loaded_request) assert "http://www.aidtransparency.net/" in result assert "http://www.iatistandard.org/" in result @pytest.mark.parametrize("target_request", ["IATI Registry Registration Page"]) def test_registration_form_presence(self, target_request): """ Test that there is a valid registration form on the Registry Registration Page. """ req = self.loaded_request_from_test_name(target_request) form_xpath = '//*[@id="user-register-form"]' form_method_xpath = '//*[@id="user-register-form"]/@method' input_xpath = '//*[@id="user-register-form"]/div/div/input' forms = utility.locate_xpath_result(req, form_xpath) form_method = utility.locate_xpath_result(req, form_method_xpath) form_inputs = utility.locate_xpath_result(req, input_xpath) assert len(forms) == 1 assert form_method == ['post'] assert len(form_inputs) == 5
<commit_before>import pytest from web_test_base import * class TestIATIRegistry(WebTestBase): requests_to_load = { 'IATI Registry Homepage - http, no www': { 'url': 'http://iatiregistry.org/' } , 'IATI Registry Homepage - http, with www': { 'url': 'http://www.iatiregistry.org/' } , 'IATI Registry Homepage - https, no www': { 'url': 'https://iatiregistry.org/' } , 'IATI Registry Homepage - https, with www': { 'url': 'https://www.iatiregistry.org/' } } def test_contains_links(self, loaded_request): """ Test that each page contains links to the defined URLs. """ result = utility.get_links_from_page(loaded_request) assert "http://www.aidtransparency.net/" in result assert "http://www.iatistandard.org/" in result <commit_msg>Add test for registry registration form This adds a test to ensure that the registry registration page has a registration form with the expected method and number of inputs.<commit_after>
import pytest from web_test_base import * class TestIATIRegistry(WebTestBase): requests_to_load = { 'IATI Registry Homepage - http, no www': { 'url': 'http://iatiregistry.org/' } , 'IATI Registry Homepage - http, with www': { 'url': 'http://www.iatiregistry.org/' } , 'IATI Registry Homepage - https, no www': { 'url': 'https://iatiregistry.org/' } , 'IATI Registry Homepage - https, with www': { 'url': 'https://www.iatiregistry.org/' } , 'IATI Registry Registration Page': { 'url': 'https://iatiregistry.org/user/register' } } def test_contains_links(self, loaded_request): """ Test that each page contains links to the defined URLs. """ result = utility.get_links_from_page(loaded_request) assert "http://www.aidtransparency.net/" in result assert "http://www.iatistandard.org/" in result @pytest.mark.parametrize("target_request", ["IATI Registry Registration Page"]) def test_registration_form_presence(self, target_request): """ Test that there is a valid registration form on the Registry Registration Page. """ req = self.loaded_request_from_test_name(target_request) form_xpath = '//*[@id="user-register-form"]' form_method_xpath = '//*[@id="user-register-form"]/@method' input_xpath = '//*[@id="user-register-form"]/div/div/input' forms = utility.locate_xpath_result(req, form_xpath) form_method = utility.locate_xpath_result(req, form_method_xpath) form_inputs = utility.locate_xpath_result(req, input_xpath) assert len(forms) == 1 assert form_method == ['post'] assert len(form_inputs) == 5
import pytest from web_test_base import * class TestIATIRegistry(WebTestBase): requests_to_load = { 'IATI Registry Homepage - http, no www': { 'url': 'http://iatiregistry.org/' } , 'IATI Registry Homepage - http, with www': { 'url': 'http://www.iatiregistry.org/' } , 'IATI Registry Homepage - https, no www': { 'url': 'https://iatiregistry.org/' } , 'IATI Registry Homepage - https, with www': { 'url': 'https://www.iatiregistry.org/' } } def test_contains_links(self, loaded_request): """ Test that each page contains links to the defined URLs. """ result = utility.get_links_from_page(loaded_request) assert "http://www.aidtransparency.net/" in result assert "http://www.iatistandard.org/" in result Add test for registry registration form This adds a test to ensure that the registry registration page has a registration form with the expected method and number of inputs.import pytest from web_test_base import * class TestIATIRegistry(WebTestBase): requests_to_load = { 'IATI Registry Homepage - http, no www': { 'url': 'http://iatiregistry.org/' } , 'IATI Registry Homepage - http, with www': { 'url': 'http://www.iatiregistry.org/' } , 'IATI Registry Homepage - https, no www': { 'url': 'https://iatiregistry.org/' } , 'IATI Registry Homepage - https, with www': { 'url': 'https://www.iatiregistry.org/' } , 'IATI Registry Registration Page': { 'url': 'https://iatiregistry.org/user/register' } } def test_contains_links(self, loaded_request): """ Test that each page contains links to the defined URLs. """ result = utility.get_links_from_page(loaded_request) assert "http://www.aidtransparency.net/" in result assert "http://www.iatistandard.org/" in result @pytest.mark.parametrize("target_request", ["IATI Registry Registration Page"]) def test_registration_form_presence(self, target_request): """ Test that there is a valid registration form on the Registry Registration Page. """ req = self.loaded_request_from_test_name(target_request) form_xpath = '//*[@id="user-register-form"]' form_method_xpath = '//*[@id="user-register-form"]/@method' input_xpath = '//*[@id="user-register-form"]/div/div/input' forms = utility.locate_xpath_result(req, form_xpath) form_method = utility.locate_xpath_result(req, form_method_xpath) form_inputs = utility.locate_xpath_result(req, input_xpath) assert len(forms) == 1 assert form_method == ['post'] assert len(form_inputs) == 5
<commit_before>import pytest from web_test_base import * class TestIATIRegistry(WebTestBase): requests_to_load = { 'IATI Registry Homepage - http, no www': { 'url': 'http://iatiregistry.org/' } , 'IATI Registry Homepage - http, with www': { 'url': 'http://www.iatiregistry.org/' } , 'IATI Registry Homepage - https, no www': { 'url': 'https://iatiregistry.org/' } , 'IATI Registry Homepage - https, with www': { 'url': 'https://www.iatiregistry.org/' } } def test_contains_links(self, loaded_request): """ Test that each page contains links to the defined URLs. """ result = utility.get_links_from_page(loaded_request) assert "http://www.aidtransparency.net/" in result assert "http://www.iatistandard.org/" in result <commit_msg>Add test for registry registration form This adds a test to ensure that the registry registration page has a registration form with the expected method and number of inputs.<commit_after>import pytest from web_test_base import * class TestIATIRegistry(WebTestBase): requests_to_load = { 'IATI Registry Homepage - http, no www': { 'url': 'http://iatiregistry.org/' } , 'IATI Registry Homepage - http, with www': { 'url': 'http://www.iatiregistry.org/' } , 'IATI Registry Homepage - https, no www': { 'url': 'https://iatiregistry.org/' } , 'IATI Registry Homepage - https, with www': { 'url': 'https://www.iatiregistry.org/' } , 'IATI Registry Registration Page': { 'url': 'https://iatiregistry.org/user/register' } } def test_contains_links(self, loaded_request): """ Test that each page contains links to the defined URLs. """ result = utility.get_links_from_page(loaded_request) assert "http://www.aidtransparency.net/" in result assert "http://www.iatistandard.org/" in result @pytest.mark.parametrize("target_request", ["IATI Registry Registration Page"]) def test_registration_form_presence(self, target_request): """ Test that there is a valid registration form on the Registry Registration Page. """ req = self.loaded_request_from_test_name(target_request) form_xpath = '//*[@id="user-register-form"]' form_method_xpath = '//*[@id="user-register-form"]/@method' input_xpath = '//*[@id="user-register-form"]/div/div/input' forms = utility.locate_xpath_result(req, form_xpath) form_method = utility.locate_xpath_result(req, form_method_xpath) form_inputs = utility.locate_xpath_result(req, input_xpath) assert len(forms) == 1 assert form_method == ['post'] assert len(form_inputs) == 5
c0673083709d08f80672cfa58623a667e0edeffa
reddit_adzerk/adzerkads.py
reddit_adzerk/adzerkads.py
from pylons import c, g from r2.lib.pages import Ads as BaseAds class Ads(BaseAds): def __init__(self): BaseAds.__init__(self) adzerk_test_srs = g.live_config.get("adzerk_test_srs") if adzerk_test_srs and c.site.name in adzerk_test_srs: url_key = "adzerk_https_url" if c.secure else "adzerk_url" self.ad_url = g.config[url_key].format( origin=c.request_origin, ) self.frame_id = "ad_main"
from urllib import quote from pylons import c, g from r2.lib.pages import Ads as BaseAds class Ads(BaseAds): def __init__(self): BaseAds.__init__(self) adzerk_test_srs = g.live_config.get("adzerk_test_srs") if adzerk_test_srs and c.site.name in adzerk_test_srs: url_key = "adzerk_https_url" if c.secure else "adzerk_url" self.ad_url = g.config[url_key].format( subreddit=quote(c.site.name), origin=c.request_origin, ) self.frame_id = "ad_main"
Add subreddit query param to adzerk frame.
Add subreddit query param to adzerk frame. For tracking / targeting.
Python
bsd-3-clause
madbook/reddit-plugin-adzerk,madbook/reddit-plugin-adzerk,madbook/reddit-plugin-adzerk
from pylons import c, g from r2.lib.pages import Ads as BaseAds class Ads(BaseAds): def __init__(self): BaseAds.__init__(self) adzerk_test_srs = g.live_config.get("adzerk_test_srs") if adzerk_test_srs and c.site.name in adzerk_test_srs: url_key = "adzerk_https_url" if c.secure else "adzerk_url" self.ad_url = g.config[url_key].format( origin=c.request_origin, ) self.frame_id = "ad_main" Add subreddit query param to adzerk frame. For tracking / targeting.
from urllib import quote from pylons import c, g from r2.lib.pages import Ads as BaseAds class Ads(BaseAds): def __init__(self): BaseAds.__init__(self) adzerk_test_srs = g.live_config.get("adzerk_test_srs") if adzerk_test_srs and c.site.name in adzerk_test_srs: url_key = "adzerk_https_url" if c.secure else "adzerk_url" self.ad_url = g.config[url_key].format( subreddit=quote(c.site.name), origin=c.request_origin, ) self.frame_id = "ad_main"
<commit_before>from pylons import c, g from r2.lib.pages import Ads as BaseAds class Ads(BaseAds): def __init__(self): BaseAds.__init__(self) adzerk_test_srs = g.live_config.get("adzerk_test_srs") if adzerk_test_srs and c.site.name in adzerk_test_srs: url_key = "adzerk_https_url" if c.secure else "adzerk_url" self.ad_url = g.config[url_key].format( origin=c.request_origin, ) self.frame_id = "ad_main" <commit_msg>Add subreddit query param to adzerk frame. For tracking / targeting.<commit_after>
from urllib import quote from pylons import c, g from r2.lib.pages import Ads as BaseAds class Ads(BaseAds): def __init__(self): BaseAds.__init__(self) adzerk_test_srs = g.live_config.get("adzerk_test_srs") if adzerk_test_srs and c.site.name in adzerk_test_srs: url_key = "adzerk_https_url" if c.secure else "adzerk_url" self.ad_url = g.config[url_key].format( subreddit=quote(c.site.name), origin=c.request_origin, ) self.frame_id = "ad_main"
from pylons import c, g from r2.lib.pages import Ads as BaseAds class Ads(BaseAds): def __init__(self): BaseAds.__init__(self) adzerk_test_srs = g.live_config.get("adzerk_test_srs") if adzerk_test_srs and c.site.name in adzerk_test_srs: url_key = "adzerk_https_url" if c.secure else "adzerk_url" self.ad_url = g.config[url_key].format( origin=c.request_origin, ) self.frame_id = "ad_main" Add subreddit query param to adzerk frame. For tracking / targeting.from urllib import quote from pylons import c, g from r2.lib.pages import Ads as BaseAds class Ads(BaseAds): def __init__(self): BaseAds.__init__(self) adzerk_test_srs = g.live_config.get("adzerk_test_srs") if adzerk_test_srs and c.site.name in adzerk_test_srs: url_key = "adzerk_https_url" if c.secure else "adzerk_url" self.ad_url = g.config[url_key].format( subreddit=quote(c.site.name), origin=c.request_origin, ) self.frame_id = "ad_main"
<commit_before>from pylons import c, g from r2.lib.pages import Ads as BaseAds class Ads(BaseAds): def __init__(self): BaseAds.__init__(self) adzerk_test_srs = g.live_config.get("adzerk_test_srs") if adzerk_test_srs and c.site.name in adzerk_test_srs: url_key = "adzerk_https_url" if c.secure else "adzerk_url" self.ad_url = g.config[url_key].format( origin=c.request_origin, ) self.frame_id = "ad_main" <commit_msg>Add subreddit query param to adzerk frame. For tracking / targeting.<commit_after>from urllib import quote from pylons import c, g from r2.lib.pages import Ads as BaseAds class Ads(BaseAds): def __init__(self): BaseAds.__init__(self) adzerk_test_srs = g.live_config.get("adzerk_test_srs") if adzerk_test_srs and c.site.name in adzerk_test_srs: url_key = "adzerk_https_url" if c.secure else "adzerk_url" self.ad_url = g.config[url_key].format( subreddit=quote(c.site.name), origin=c.request_origin, ) self.frame_id = "ad_main"
7e63e514c041ccc12ff5caa01fb4f6684727788b
src/PerformerIndexEntry.py
src/PerformerIndexEntry.py
from BaseIndexEntry import BaseIndexEntry class PerformerIndexEntry(BaseIndexEntry): def __init__(self, name, titles, number): super(PerformerIndexEntry, self).__init__(name, titles, number) # Set the performer number on each of the titles for title in self._titles: title.performer_number = self._number # To be set later self._albums = [] self._albums_initialised = False self._freeze() def __str__(self): return '{}: {} {}, albums: {} {}, titles: {}'.format( self.__class__.__name__, self._number, self._name, self.number_of_albums, self._albums, self.number_of_titles) def init_albums(self): for title in self._titles: if title.album_number not in self._albums: self._albums.append(title.album_number) self._albums_initialised = True @property def albums(self): if self._albums_initialised: return self._albums else: raise Exception("Albums not initialised.") @property def number_of_albums(self): return len(self._albums)
from BaseIndexEntry import BaseIndexEntry class PerformerIndexEntry(BaseIndexEntry): '''A class to hold index data for performers. Performers have titles and albums. ''' def __init__(self, name, titles, number): super(PerformerIndexEntry, self).__init__(name, titles, number) # Set the performer number on each of the titles for title in self._titles: title.performer_number = self._number # To be set later self._albums = [] self._album_numbers = [] self._albums_initialised = False self._freeze() def __str__(self): return '{}: {} {}, albums: {} {}, titles: {}'.format( self.__class__.__name__, self._number, self._name, self.number_of_albums, self._album_numbers, self.number_of_titles) def init_albums(self, albums): for title in self._titles: if title.album_number not in self._album_numbers: self._album_numbers.append(title.album_number) self._albums.append(albums[title.album_number]) self._albums_initialised = True @property def album_numbers(self): if self._albums_initialised: return self._album_numbers else: raise Exception("Albums not initialised.") @property def number_of_albums(self): if self._albums_initialised: return len(self._album_numbers) else: raise Exception("Albums not initialised.") def album(self, album_number): for a in self._albums: if a.number == album_number: return a return None def number_of_titles_for_album(self, album_number): count = set() for title in self._titles: if title.album_number == album_number: count.add(title.index) return len(count)
Store references to albums, add new methods.
Store references to albums, add new methods.
Python
apache-2.0
chrrrisw/kmel_db,chrrrisw/kmel_db
from BaseIndexEntry import BaseIndexEntry class PerformerIndexEntry(BaseIndexEntry): def __init__(self, name, titles, number): super(PerformerIndexEntry, self).__init__(name, titles, number) # Set the performer number on each of the titles for title in self._titles: title.performer_number = self._number # To be set later self._albums = [] self._albums_initialised = False self._freeze() def __str__(self): return '{}: {} {}, albums: {} {}, titles: {}'.format( self.__class__.__name__, self._number, self._name, self.number_of_albums, self._albums, self.number_of_titles) def init_albums(self): for title in self._titles: if title.album_number not in self._albums: self._albums.append(title.album_number) self._albums_initialised = True @property def albums(self): if self._albums_initialised: return self._albums else: raise Exception("Albums not initialised.") @property def number_of_albums(self): return len(self._albums) Store references to albums, add new methods.
from BaseIndexEntry import BaseIndexEntry class PerformerIndexEntry(BaseIndexEntry): '''A class to hold index data for performers. Performers have titles and albums. ''' def __init__(self, name, titles, number): super(PerformerIndexEntry, self).__init__(name, titles, number) # Set the performer number on each of the titles for title in self._titles: title.performer_number = self._number # To be set later self._albums = [] self._album_numbers = [] self._albums_initialised = False self._freeze() def __str__(self): return '{}: {} {}, albums: {} {}, titles: {}'.format( self.__class__.__name__, self._number, self._name, self.number_of_albums, self._album_numbers, self.number_of_titles) def init_albums(self, albums): for title in self._titles: if title.album_number not in self._album_numbers: self._album_numbers.append(title.album_number) self._albums.append(albums[title.album_number]) self._albums_initialised = True @property def album_numbers(self): if self._albums_initialised: return self._album_numbers else: raise Exception("Albums not initialised.") @property def number_of_albums(self): if self._albums_initialised: return len(self._album_numbers) else: raise Exception("Albums not initialised.") def album(self, album_number): for a in self._albums: if a.number == album_number: return a return None def number_of_titles_for_album(self, album_number): count = set() for title in self._titles: if title.album_number == album_number: count.add(title.index) return len(count)
<commit_before>from BaseIndexEntry import BaseIndexEntry class PerformerIndexEntry(BaseIndexEntry): def __init__(self, name, titles, number): super(PerformerIndexEntry, self).__init__(name, titles, number) # Set the performer number on each of the titles for title in self._titles: title.performer_number = self._number # To be set later self._albums = [] self._albums_initialised = False self._freeze() def __str__(self): return '{}: {} {}, albums: {} {}, titles: {}'.format( self.__class__.__name__, self._number, self._name, self.number_of_albums, self._albums, self.number_of_titles) def init_albums(self): for title in self._titles: if title.album_number not in self._albums: self._albums.append(title.album_number) self._albums_initialised = True @property def albums(self): if self._albums_initialised: return self._albums else: raise Exception("Albums not initialised.") @property def number_of_albums(self): return len(self._albums) <commit_msg>Store references to albums, add new methods.<commit_after>
from BaseIndexEntry import BaseIndexEntry class PerformerIndexEntry(BaseIndexEntry): '''A class to hold index data for performers. Performers have titles and albums. ''' def __init__(self, name, titles, number): super(PerformerIndexEntry, self).__init__(name, titles, number) # Set the performer number on each of the titles for title in self._titles: title.performer_number = self._number # To be set later self._albums = [] self._album_numbers = [] self._albums_initialised = False self._freeze() def __str__(self): return '{}: {} {}, albums: {} {}, titles: {}'.format( self.__class__.__name__, self._number, self._name, self.number_of_albums, self._album_numbers, self.number_of_titles) def init_albums(self, albums): for title in self._titles: if title.album_number not in self._album_numbers: self._album_numbers.append(title.album_number) self._albums.append(albums[title.album_number]) self._albums_initialised = True @property def album_numbers(self): if self._albums_initialised: return self._album_numbers else: raise Exception("Albums not initialised.") @property def number_of_albums(self): if self._albums_initialised: return len(self._album_numbers) else: raise Exception("Albums not initialised.") def album(self, album_number): for a in self._albums: if a.number == album_number: return a return None def number_of_titles_for_album(self, album_number): count = set() for title in self._titles: if title.album_number == album_number: count.add(title.index) return len(count)
from BaseIndexEntry import BaseIndexEntry class PerformerIndexEntry(BaseIndexEntry): def __init__(self, name, titles, number): super(PerformerIndexEntry, self).__init__(name, titles, number) # Set the performer number on each of the titles for title in self._titles: title.performer_number = self._number # To be set later self._albums = [] self._albums_initialised = False self._freeze() def __str__(self): return '{}: {} {}, albums: {} {}, titles: {}'.format( self.__class__.__name__, self._number, self._name, self.number_of_albums, self._albums, self.number_of_titles) def init_albums(self): for title in self._titles: if title.album_number not in self._albums: self._albums.append(title.album_number) self._albums_initialised = True @property def albums(self): if self._albums_initialised: return self._albums else: raise Exception("Albums not initialised.") @property def number_of_albums(self): return len(self._albums) Store references to albums, add new methods.from BaseIndexEntry import BaseIndexEntry class PerformerIndexEntry(BaseIndexEntry): '''A class to hold index data for performers. Performers have titles and albums. ''' def __init__(self, name, titles, number): super(PerformerIndexEntry, self).__init__(name, titles, number) # Set the performer number on each of the titles for title in self._titles: title.performer_number = self._number # To be set later self._albums = [] self._album_numbers = [] self._albums_initialised = False self._freeze() def __str__(self): return '{}: {} {}, albums: {} {}, titles: {}'.format( self.__class__.__name__, self._number, self._name, self.number_of_albums, self._album_numbers, self.number_of_titles) def init_albums(self, albums): for title in self._titles: if title.album_number not in self._album_numbers: self._album_numbers.append(title.album_number) self._albums.append(albums[title.album_number]) self._albums_initialised = True @property def album_numbers(self): if self._albums_initialised: return self._album_numbers else: raise Exception("Albums not initialised.") @property def number_of_albums(self): if self._albums_initialised: return len(self._album_numbers) else: raise Exception("Albums not initialised.") def album(self, album_number): for a in self._albums: if a.number == album_number: return a return None def number_of_titles_for_album(self, album_number): count = set() for title in self._titles: if title.album_number == album_number: count.add(title.index) return len(count)
<commit_before>from BaseIndexEntry import BaseIndexEntry class PerformerIndexEntry(BaseIndexEntry): def __init__(self, name, titles, number): super(PerformerIndexEntry, self).__init__(name, titles, number) # Set the performer number on each of the titles for title in self._titles: title.performer_number = self._number # To be set later self._albums = [] self._albums_initialised = False self._freeze() def __str__(self): return '{}: {} {}, albums: {} {}, titles: {}'.format( self.__class__.__name__, self._number, self._name, self.number_of_albums, self._albums, self.number_of_titles) def init_albums(self): for title in self._titles: if title.album_number not in self._albums: self._albums.append(title.album_number) self._albums_initialised = True @property def albums(self): if self._albums_initialised: return self._albums else: raise Exception("Albums not initialised.") @property def number_of_albums(self): return len(self._albums) <commit_msg>Store references to albums, add new methods.<commit_after>from BaseIndexEntry import BaseIndexEntry class PerformerIndexEntry(BaseIndexEntry): '''A class to hold index data for performers. Performers have titles and albums. ''' def __init__(self, name, titles, number): super(PerformerIndexEntry, self).__init__(name, titles, number) # Set the performer number on each of the titles for title in self._titles: title.performer_number = self._number # To be set later self._albums = [] self._album_numbers = [] self._albums_initialised = False self._freeze() def __str__(self): return '{}: {} {}, albums: {} {}, titles: {}'.format( self.__class__.__name__, self._number, self._name, self.number_of_albums, self._album_numbers, self.number_of_titles) def init_albums(self, albums): for title in self._titles: if title.album_number not in self._album_numbers: self._album_numbers.append(title.album_number) self._albums.append(albums[title.album_number]) self._albums_initialised = True @property def album_numbers(self): if self._albums_initialised: return self._album_numbers else: raise Exception("Albums not initialised.") @property def number_of_albums(self): if self._albums_initialised: return len(self._album_numbers) else: raise Exception("Albums not initialised.") def album(self, album_number): for a in self._albums: if a.number == album_number: return a return None def number_of_titles_for_album(self, album_number): count = set() for title in self._titles: if title.album_number == album_number: count.add(title.index) return len(count)
605013815867798a30261e57066163581575832f
tinycart/middleware.py
tinycart/middleware.py
from django.utils.functional import SimpleLazyObject from tinycart.models import Cart class CartMiddleware(object): def process_request(self, request): request.cart = SimpleLazyObject( lambda: Cart.objects.get_for_request(request) ) class HTTPMethodOverrideMiddleware(object): allowed_methods = ('PUT', 'DELETE') webform_content_types = ('application/x-www-form-urlencoded', 'multipart/form-data') def is_webform(self, request): return request.META.get('CONTENT_TYPE') in self.webform_content_types def process_request(self, request): if request.method != 'POST': return method = request.META.get('HTTP_X_HTTP_METHOD_OVERRIDE') if method is None and self.is_webform(request): method = request.POST.get('_method') if method is None or method.upper() not in self.allowed_methods: return request.method = method.upper()
from django.utils.functional import SimpleLazyObject from tinycart.models import Cart class CartMiddleware(object): def process_request(self, request): request.cart = SimpleLazyObject( lambda: Cart.objects.get_for_request(request) ) class HTTPMethodOverrideMiddleware(object): allowed_methods = ('PUT', 'DELETE') webform_content_types = ('application/x-www-form-urlencoded', 'multipart/form-data') def is_webform(self, request): content_type = request.META.get('CONTENT_TYPE') if not content_type: return False return content_type.split(';')[0] in self.webform_content_types def process_request(self, request): if request.method != 'POST': return method = request.META.get('HTTP_X_HTTP_METHOD_OVERRIDE') if method is None and self.is_webform(request): method = request.POST.get('_method') if method is None or method.upper() not in self.allowed_methods: return request.method = method.upper()
Handle encoding in Content-Type header correctly in HTTPMethodOverrideMiddleware
Handle encoding in Content-Type header correctly in HTTPMethodOverrideMiddleware
Python
bsd-3-clause
vinay13/django-tinycart,trilan/django-tinycart,vinay13/django-tinycart
from django.utils.functional import SimpleLazyObject from tinycart.models import Cart class CartMiddleware(object): def process_request(self, request): request.cart = SimpleLazyObject( lambda: Cart.objects.get_for_request(request) ) class HTTPMethodOverrideMiddleware(object): allowed_methods = ('PUT', 'DELETE') webform_content_types = ('application/x-www-form-urlencoded', 'multipart/form-data') def is_webform(self, request): return request.META.get('CONTENT_TYPE') in self.webform_content_types def process_request(self, request): if request.method != 'POST': return method = request.META.get('HTTP_X_HTTP_METHOD_OVERRIDE') if method is None and self.is_webform(request): method = request.POST.get('_method') if method is None or method.upper() not in self.allowed_methods: return request.method = method.upper() Handle encoding in Content-Type header correctly in HTTPMethodOverrideMiddleware
from django.utils.functional import SimpleLazyObject from tinycart.models import Cart class CartMiddleware(object): def process_request(self, request): request.cart = SimpleLazyObject( lambda: Cart.objects.get_for_request(request) ) class HTTPMethodOverrideMiddleware(object): allowed_methods = ('PUT', 'DELETE') webform_content_types = ('application/x-www-form-urlencoded', 'multipart/form-data') def is_webform(self, request): content_type = request.META.get('CONTENT_TYPE') if not content_type: return False return content_type.split(';')[0] in self.webform_content_types def process_request(self, request): if request.method != 'POST': return method = request.META.get('HTTP_X_HTTP_METHOD_OVERRIDE') if method is None and self.is_webform(request): method = request.POST.get('_method') if method is None or method.upper() not in self.allowed_methods: return request.method = method.upper()
<commit_before>from django.utils.functional import SimpleLazyObject from tinycart.models import Cart class CartMiddleware(object): def process_request(self, request): request.cart = SimpleLazyObject( lambda: Cart.objects.get_for_request(request) ) class HTTPMethodOverrideMiddleware(object): allowed_methods = ('PUT', 'DELETE') webform_content_types = ('application/x-www-form-urlencoded', 'multipart/form-data') def is_webform(self, request): return request.META.get('CONTENT_TYPE') in self.webform_content_types def process_request(self, request): if request.method != 'POST': return method = request.META.get('HTTP_X_HTTP_METHOD_OVERRIDE') if method is None and self.is_webform(request): method = request.POST.get('_method') if method is None or method.upper() not in self.allowed_methods: return request.method = method.upper() <commit_msg>Handle encoding in Content-Type header correctly in HTTPMethodOverrideMiddleware<commit_after>
from django.utils.functional import SimpleLazyObject from tinycart.models import Cart class CartMiddleware(object): def process_request(self, request): request.cart = SimpleLazyObject( lambda: Cart.objects.get_for_request(request) ) class HTTPMethodOverrideMiddleware(object): allowed_methods = ('PUT', 'DELETE') webform_content_types = ('application/x-www-form-urlencoded', 'multipart/form-data') def is_webform(self, request): content_type = request.META.get('CONTENT_TYPE') if not content_type: return False return content_type.split(';')[0] in self.webform_content_types def process_request(self, request): if request.method != 'POST': return method = request.META.get('HTTP_X_HTTP_METHOD_OVERRIDE') if method is None and self.is_webform(request): method = request.POST.get('_method') if method is None or method.upper() not in self.allowed_methods: return request.method = method.upper()
from django.utils.functional import SimpleLazyObject from tinycart.models import Cart class CartMiddleware(object): def process_request(self, request): request.cart = SimpleLazyObject( lambda: Cart.objects.get_for_request(request) ) class HTTPMethodOverrideMiddleware(object): allowed_methods = ('PUT', 'DELETE') webform_content_types = ('application/x-www-form-urlencoded', 'multipart/form-data') def is_webform(self, request): return request.META.get('CONTENT_TYPE') in self.webform_content_types def process_request(self, request): if request.method != 'POST': return method = request.META.get('HTTP_X_HTTP_METHOD_OVERRIDE') if method is None and self.is_webform(request): method = request.POST.get('_method') if method is None or method.upper() not in self.allowed_methods: return request.method = method.upper() Handle encoding in Content-Type header correctly in HTTPMethodOverrideMiddlewarefrom django.utils.functional import SimpleLazyObject from tinycart.models import Cart class CartMiddleware(object): def process_request(self, request): request.cart = SimpleLazyObject( lambda: Cart.objects.get_for_request(request) ) class HTTPMethodOverrideMiddleware(object): allowed_methods = ('PUT', 'DELETE') webform_content_types = ('application/x-www-form-urlencoded', 'multipart/form-data') def is_webform(self, request): content_type = request.META.get('CONTENT_TYPE') if not content_type: return False return content_type.split(';')[0] in self.webform_content_types def process_request(self, request): if request.method != 'POST': return method = request.META.get('HTTP_X_HTTP_METHOD_OVERRIDE') if method is None and self.is_webform(request): method = request.POST.get('_method') if method is None or method.upper() not in self.allowed_methods: return request.method = method.upper()
<commit_before>from django.utils.functional import SimpleLazyObject from tinycart.models import Cart class CartMiddleware(object): def process_request(self, request): request.cart = SimpleLazyObject( lambda: Cart.objects.get_for_request(request) ) class HTTPMethodOverrideMiddleware(object): allowed_methods = ('PUT', 'DELETE') webform_content_types = ('application/x-www-form-urlencoded', 'multipart/form-data') def is_webform(self, request): return request.META.get('CONTENT_TYPE') in self.webform_content_types def process_request(self, request): if request.method != 'POST': return method = request.META.get('HTTP_X_HTTP_METHOD_OVERRIDE') if method is None and self.is_webform(request): method = request.POST.get('_method') if method is None or method.upper() not in self.allowed_methods: return request.method = method.upper() <commit_msg>Handle encoding in Content-Type header correctly in HTTPMethodOverrideMiddleware<commit_after>from django.utils.functional import SimpleLazyObject from tinycart.models import Cart class CartMiddleware(object): def process_request(self, request): request.cart = SimpleLazyObject( lambda: Cart.objects.get_for_request(request) ) class HTTPMethodOverrideMiddleware(object): allowed_methods = ('PUT', 'DELETE') webform_content_types = ('application/x-www-form-urlencoded', 'multipart/form-data') def is_webform(self, request): content_type = request.META.get('CONTENT_TYPE') if not content_type: return False return content_type.split(';')[0] in self.webform_content_types def process_request(self, request): if request.method != 'POST': return method = request.META.get('HTTP_X_HTTP_METHOD_OVERRIDE') if method is None and self.is_webform(request): method = request.POST.get('_method') if method is None or method.upper() not in self.allowed_methods: return request.method = method.upper()
44fd433eec5126bdeac28df2827b452cd2e6bb1a
pavement.py
pavement.py
from paver.easy import sh, task config = """# replace pass with values you would like to overwrite from DefaultConfig in # default_config.py. Values you do not explicitly overwrite will be inherited # from DefaultConfig. At the very least, you must set secret_key and # tmdb_api_key. from default_config import DefaultConfig class Config(DefaultConfig): pass """ @task def setup(): """Writes a default config to config.py""" print('Writing default config.') f = open('config.py', 'w') f.write(config) f.close() @task def lint(): """Checks code quality using flake8""" sh("flake8 --exit-zero .") # TODO: make this cleaner
import os.path from paver.easy import sh, task config = """# replace pass with values you would like to overwrite from DefaultConfig in # default_config.py. Values you do not explicitly overwrite will be inherited # from DefaultConfig. At the very least, you must set secret_key and # tmdb_api_key. from default_config import DefaultConfig class Config(DefaultConfig): pass """ @task def setup(): """Writes a default config to config.py""" if not os.path.isfile('config.py'): print('Writing default config.') f = open('config.py', 'w') f.write(config) f.close() else: print('Config file already exists, will not overwrite.') @task def lint(): """Checks code quality using flake8""" sh("flake8 --exit-zero .")
Check for existing config before writing default
Check for existing config before writing default
Python
mit
simon-andrews/movieman2,simon-andrews/movieman2
from paver.easy import sh, task config = """# replace pass with values you would like to overwrite from DefaultConfig in # default_config.py. Values you do not explicitly overwrite will be inherited # from DefaultConfig. At the very least, you must set secret_key and # tmdb_api_key. from default_config import DefaultConfig class Config(DefaultConfig): pass """ @task def setup(): """Writes a default config to config.py""" print('Writing default config.') f = open('config.py', 'w') f.write(config) f.close() @task def lint(): """Checks code quality using flake8""" sh("flake8 --exit-zero .") # TODO: make this cleaner Check for existing config before writing default
import os.path from paver.easy import sh, task config = """# replace pass with values you would like to overwrite from DefaultConfig in # default_config.py. Values you do not explicitly overwrite will be inherited # from DefaultConfig. At the very least, you must set secret_key and # tmdb_api_key. from default_config import DefaultConfig class Config(DefaultConfig): pass """ @task def setup(): """Writes a default config to config.py""" if not os.path.isfile('config.py'): print('Writing default config.') f = open('config.py', 'w') f.write(config) f.close() else: print('Config file already exists, will not overwrite.') @task def lint(): """Checks code quality using flake8""" sh("flake8 --exit-zero .")
<commit_before>from paver.easy import sh, task config = """# replace pass with values you would like to overwrite from DefaultConfig in # default_config.py. Values you do not explicitly overwrite will be inherited # from DefaultConfig. At the very least, you must set secret_key and # tmdb_api_key. from default_config import DefaultConfig class Config(DefaultConfig): pass """ @task def setup(): """Writes a default config to config.py""" print('Writing default config.') f = open('config.py', 'w') f.write(config) f.close() @task def lint(): """Checks code quality using flake8""" sh("flake8 --exit-zero .") # TODO: make this cleaner <commit_msg>Check for existing config before writing default<commit_after>
import os.path from paver.easy import sh, task config = """# replace pass with values you would like to overwrite from DefaultConfig in # default_config.py. Values you do not explicitly overwrite will be inherited # from DefaultConfig. At the very least, you must set secret_key and # tmdb_api_key. from default_config import DefaultConfig class Config(DefaultConfig): pass """ @task def setup(): """Writes a default config to config.py""" if not os.path.isfile('config.py'): print('Writing default config.') f = open('config.py', 'w') f.write(config) f.close() else: print('Config file already exists, will not overwrite.') @task def lint(): """Checks code quality using flake8""" sh("flake8 --exit-zero .")
from paver.easy import sh, task config = """# replace pass with values you would like to overwrite from DefaultConfig in # default_config.py. Values you do not explicitly overwrite will be inherited # from DefaultConfig. At the very least, you must set secret_key and # tmdb_api_key. from default_config import DefaultConfig class Config(DefaultConfig): pass """ @task def setup(): """Writes a default config to config.py""" print('Writing default config.') f = open('config.py', 'w') f.write(config) f.close() @task def lint(): """Checks code quality using flake8""" sh("flake8 --exit-zero .") # TODO: make this cleaner Check for existing config before writing defaultimport os.path from paver.easy import sh, task config = """# replace pass with values you would like to overwrite from DefaultConfig in # default_config.py. Values you do not explicitly overwrite will be inherited # from DefaultConfig. At the very least, you must set secret_key and # tmdb_api_key. from default_config import DefaultConfig class Config(DefaultConfig): pass """ @task def setup(): """Writes a default config to config.py""" if not os.path.isfile('config.py'): print('Writing default config.') f = open('config.py', 'w') f.write(config) f.close() else: print('Config file already exists, will not overwrite.') @task def lint(): """Checks code quality using flake8""" sh("flake8 --exit-zero .")
<commit_before>from paver.easy import sh, task config = """# replace pass with values you would like to overwrite from DefaultConfig in # default_config.py. Values you do not explicitly overwrite will be inherited # from DefaultConfig. At the very least, you must set secret_key and # tmdb_api_key. from default_config import DefaultConfig class Config(DefaultConfig): pass """ @task def setup(): """Writes a default config to config.py""" print('Writing default config.') f = open('config.py', 'w') f.write(config) f.close() @task def lint(): """Checks code quality using flake8""" sh("flake8 --exit-zero .") # TODO: make this cleaner <commit_msg>Check for existing config before writing default<commit_after>import os.path from paver.easy import sh, task config = """# replace pass with values you would like to overwrite from DefaultConfig in # default_config.py. Values you do not explicitly overwrite will be inherited # from DefaultConfig. At the very least, you must set secret_key and # tmdb_api_key. from default_config import DefaultConfig class Config(DefaultConfig): pass """ @task def setup(): """Writes a default config to config.py""" if not os.path.isfile('config.py'): print('Writing default config.') f = open('config.py', 'w') f.write(config) f.close() else: print('Config file already exists, will not overwrite.') @task def lint(): """Checks code quality using flake8""" sh("flake8 --exit-zero .")
bd43c574411d3cc1fa730b792d7648f3dfc799b5
bibpy/entry/base.py
bibpy/entry/base.py
# -*- coding: utf-8 -*- """Base class for all types of entries.""" class BaseEntry(object): """Base class for all types of entries.""" def format(self, **options): raise NotImplementedError() @property def entry_type(self): raise NotImplementedError() @property def entry_key(self): raise NotImplementedError() @property def fields(self): raise NotImplementedError() def aliases(self, format): raise NotImplementedError() def valid(self, format): raise NotImplementedError() def keys(self): raise NotImplementedError() def values(self): raise NotImplementedError() def __eq__(self, other): raise NotImplementedError() def __ne__(self, other): return not self == other def __contains__(self, item): raise NotImplementedError() def __getitem__(self, field): """Return the value for the given field.""" raise NotImplementedError() def __iter__(self): for field in self.fields: yield (field, self[field]) def __len__(self): raise NotImplementedError() def __str__(self): return self.format() def __repr__(self): raise NotImplementedError()
# -*- coding: utf-8 -*- """Base class for all types of entries.""" class BaseEntry(object): """Base class for all types of entries.""" def format(self, **options): raise NotImplementedError() @property def entry_type(self): raise NotImplementedError() @property def entry_key(self): raise NotImplementedError() @property def fields(self): raise NotImplementedError() def aliases(self, format): raise NotImplementedError() def valid(self, format): raise NotImplementedError() def keys(self): raise NotImplementedError() def values(self): raise NotImplementedError() def __eq__(self, other): raise NotImplementedError() def __ne__(self, other): return not self == other def __contains__(self, item): raise NotImplementedError() def __getitem__(self, field): """Return the value for the given field.""" raise NotImplementedError() def __iter__(self): for field in self.fields: yield (field, self[field]) def __len__(self): raise NotImplementedError() def __str__(self): return self.format() def __unicode__(self): return unicode(str(self)) def __repr__(self): raise NotImplementedError()
Implement __unicode__ for entry objects
Implement __unicode__ for entry objects
Python
mit
MisanthropicBit/bibpy,MisanthropicBit/bibpy
# -*- coding: utf-8 -*- """Base class for all types of entries.""" class BaseEntry(object): """Base class for all types of entries.""" def format(self, **options): raise NotImplementedError() @property def entry_type(self): raise NotImplementedError() @property def entry_key(self): raise NotImplementedError() @property def fields(self): raise NotImplementedError() def aliases(self, format): raise NotImplementedError() def valid(self, format): raise NotImplementedError() def keys(self): raise NotImplementedError() def values(self): raise NotImplementedError() def __eq__(self, other): raise NotImplementedError() def __ne__(self, other): return not self == other def __contains__(self, item): raise NotImplementedError() def __getitem__(self, field): """Return the value for the given field.""" raise NotImplementedError() def __iter__(self): for field in self.fields: yield (field, self[field]) def __len__(self): raise NotImplementedError() def __str__(self): return self.format() def __repr__(self): raise NotImplementedError() Implement __unicode__ for entry objects
# -*- coding: utf-8 -*- """Base class for all types of entries.""" class BaseEntry(object): """Base class for all types of entries.""" def format(self, **options): raise NotImplementedError() @property def entry_type(self): raise NotImplementedError() @property def entry_key(self): raise NotImplementedError() @property def fields(self): raise NotImplementedError() def aliases(self, format): raise NotImplementedError() def valid(self, format): raise NotImplementedError() def keys(self): raise NotImplementedError() def values(self): raise NotImplementedError() def __eq__(self, other): raise NotImplementedError() def __ne__(self, other): return not self == other def __contains__(self, item): raise NotImplementedError() def __getitem__(self, field): """Return the value for the given field.""" raise NotImplementedError() def __iter__(self): for field in self.fields: yield (field, self[field]) def __len__(self): raise NotImplementedError() def __str__(self): return self.format() def __unicode__(self): return unicode(str(self)) def __repr__(self): raise NotImplementedError()
<commit_before># -*- coding: utf-8 -*- """Base class for all types of entries.""" class BaseEntry(object): """Base class for all types of entries.""" def format(self, **options): raise NotImplementedError() @property def entry_type(self): raise NotImplementedError() @property def entry_key(self): raise NotImplementedError() @property def fields(self): raise NotImplementedError() def aliases(self, format): raise NotImplementedError() def valid(self, format): raise NotImplementedError() def keys(self): raise NotImplementedError() def values(self): raise NotImplementedError() def __eq__(self, other): raise NotImplementedError() def __ne__(self, other): return not self == other def __contains__(self, item): raise NotImplementedError() def __getitem__(self, field): """Return the value for the given field.""" raise NotImplementedError() def __iter__(self): for field in self.fields: yield (field, self[field]) def __len__(self): raise NotImplementedError() def __str__(self): return self.format() def __repr__(self): raise NotImplementedError() <commit_msg>Implement __unicode__ for entry objects<commit_after>
# -*- coding: utf-8 -*- """Base class for all types of entries.""" class BaseEntry(object): """Base class for all types of entries.""" def format(self, **options): raise NotImplementedError() @property def entry_type(self): raise NotImplementedError() @property def entry_key(self): raise NotImplementedError() @property def fields(self): raise NotImplementedError() def aliases(self, format): raise NotImplementedError() def valid(self, format): raise NotImplementedError() def keys(self): raise NotImplementedError() def values(self): raise NotImplementedError() def __eq__(self, other): raise NotImplementedError() def __ne__(self, other): return not self == other def __contains__(self, item): raise NotImplementedError() def __getitem__(self, field): """Return the value for the given field.""" raise NotImplementedError() def __iter__(self): for field in self.fields: yield (field, self[field]) def __len__(self): raise NotImplementedError() def __str__(self): return self.format() def __unicode__(self): return unicode(str(self)) def __repr__(self): raise NotImplementedError()
# -*- coding: utf-8 -*- """Base class for all types of entries.""" class BaseEntry(object): """Base class for all types of entries.""" def format(self, **options): raise NotImplementedError() @property def entry_type(self): raise NotImplementedError() @property def entry_key(self): raise NotImplementedError() @property def fields(self): raise NotImplementedError() def aliases(self, format): raise NotImplementedError() def valid(self, format): raise NotImplementedError() def keys(self): raise NotImplementedError() def values(self): raise NotImplementedError() def __eq__(self, other): raise NotImplementedError() def __ne__(self, other): return not self == other def __contains__(self, item): raise NotImplementedError() def __getitem__(self, field): """Return the value for the given field.""" raise NotImplementedError() def __iter__(self): for field in self.fields: yield (field, self[field]) def __len__(self): raise NotImplementedError() def __str__(self): return self.format() def __repr__(self): raise NotImplementedError() Implement __unicode__ for entry objects# -*- coding: utf-8 -*- """Base class for all types of entries.""" class BaseEntry(object): """Base class for all types of entries.""" def format(self, **options): raise NotImplementedError() @property def entry_type(self): raise NotImplementedError() @property def entry_key(self): raise NotImplementedError() @property def fields(self): raise NotImplementedError() def aliases(self, format): raise NotImplementedError() def valid(self, format): raise NotImplementedError() def keys(self): raise NotImplementedError() def values(self): raise NotImplementedError() def __eq__(self, other): raise NotImplementedError() def __ne__(self, other): return not self == other def __contains__(self, item): raise NotImplementedError() def __getitem__(self, field): """Return the value for the given field.""" raise NotImplementedError() def __iter__(self): for field in self.fields: yield (field, self[field]) def __len__(self): raise NotImplementedError() def __str__(self): return self.format() def __unicode__(self): return unicode(str(self)) def __repr__(self): raise NotImplementedError()
<commit_before># -*- coding: utf-8 -*- """Base class for all types of entries.""" class BaseEntry(object): """Base class for all types of entries.""" def format(self, **options): raise NotImplementedError() @property def entry_type(self): raise NotImplementedError() @property def entry_key(self): raise NotImplementedError() @property def fields(self): raise NotImplementedError() def aliases(self, format): raise NotImplementedError() def valid(self, format): raise NotImplementedError() def keys(self): raise NotImplementedError() def values(self): raise NotImplementedError() def __eq__(self, other): raise NotImplementedError() def __ne__(self, other): return not self == other def __contains__(self, item): raise NotImplementedError() def __getitem__(self, field): """Return the value for the given field.""" raise NotImplementedError() def __iter__(self): for field in self.fields: yield (field, self[field]) def __len__(self): raise NotImplementedError() def __str__(self): return self.format() def __repr__(self): raise NotImplementedError() <commit_msg>Implement __unicode__ for entry objects<commit_after># -*- coding: utf-8 -*- """Base class for all types of entries.""" class BaseEntry(object): """Base class for all types of entries.""" def format(self, **options): raise NotImplementedError() @property def entry_type(self): raise NotImplementedError() @property def entry_key(self): raise NotImplementedError() @property def fields(self): raise NotImplementedError() def aliases(self, format): raise NotImplementedError() def valid(self, format): raise NotImplementedError() def keys(self): raise NotImplementedError() def values(self): raise NotImplementedError() def __eq__(self, other): raise NotImplementedError() def __ne__(self, other): return not self == other def __contains__(self, item): raise NotImplementedError() def __getitem__(self, field): """Return the value for the given field.""" raise NotImplementedError() def __iter__(self): for field in self.fields: yield (field, self[field]) def __len__(self): raise NotImplementedError() def __str__(self): return self.format() def __unicode__(self): return unicode(str(self)) def __repr__(self): raise NotImplementedError()
12791da5f9e4a19e670dcf8459572517d0f467cd
comics/urls.py
comics/urls.py
from __future__ import absolute_import from django.conf import settings from django.conf.urls import include, patterns from django.contrib import admin from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.views.generic.base import TemplateView admin.autodiscover() urlpatterns = patterns('', # Robots not welcome (r'^robots\.txt$', TemplateView.as_view( template_name='robots.txt', content_type='text/plain')), # User accounts management (r'^account/', include('comics.accounts.urls')), # API (r'^api/', include('comics.api.urls')), # Help, about and feedback (r'^help/', include('comics.help.urls')), # Comic crawler status (r'^status/', include('comics.status.urls')), # Django admin (r'^admin/doc/', include('django.contrib.admindocs.urls')), (r'^admin/', include(admin.site.urls)), # Comics browsing. Must be last one included. (r'^', include('comics.browser.urls')), ) # Let Django host media if doing local development on runserver if not settings.MEDIA_URL.startswith('http'): urlpatterns += patterns('', (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), ) urlpatterns += staticfiles_urlpatterns()
from __future__ import absolute_import from django.conf import settings from django.conf.urls import include, patterns from django.contrib import admin from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.views.generic.base import TemplateView admin.autodiscover() urlpatterns = patterns( '', # Robots not welcome (r'^robots\.txt$', TemplateView.as_view( template_name='robots.txt', content_type='text/plain')), # User accounts management (r'^account/', include('comics.accounts.urls')), # API (r'^api/', include('comics.api.urls')), # Help, about and feedback (r'^help/', include('comics.help.urls')), # Comic crawler status (r'^status/', include('comics.status.urls')), # Django admin (r'^admin/doc/', include('django.contrib.admindocs.urls')), (r'^admin/', include(admin.site.urls)), # Comics browsing. Must be last one included. (r'^', include('comics.browser.urls')), ) # Let Django host media if doing local development on runserver if not settings.MEDIA_URL.startswith('http'): urlpatterns += patterns( '', (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), ) urlpatterns += staticfiles_urlpatterns()
Fix all warnings in top-level urlconf
flake8: Fix all warnings in top-level urlconf
Python
agpl-3.0
jodal/comics,datagutten/comics,jodal/comics,datagutten/comics,jodal/comics,jodal/comics,datagutten/comics,datagutten/comics
from __future__ import absolute_import from django.conf import settings from django.conf.urls import include, patterns from django.contrib import admin from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.views.generic.base import TemplateView admin.autodiscover() urlpatterns = patterns('', # Robots not welcome (r'^robots\.txt$', TemplateView.as_view( template_name='robots.txt', content_type='text/plain')), # User accounts management (r'^account/', include('comics.accounts.urls')), # API (r'^api/', include('comics.api.urls')), # Help, about and feedback (r'^help/', include('comics.help.urls')), # Comic crawler status (r'^status/', include('comics.status.urls')), # Django admin (r'^admin/doc/', include('django.contrib.admindocs.urls')), (r'^admin/', include(admin.site.urls)), # Comics browsing. Must be last one included. (r'^', include('comics.browser.urls')), ) # Let Django host media if doing local development on runserver if not settings.MEDIA_URL.startswith('http'): urlpatterns += patterns('', (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), ) urlpatterns += staticfiles_urlpatterns() flake8: Fix all warnings in top-level urlconf
from __future__ import absolute_import from django.conf import settings from django.conf.urls import include, patterns from django.contrib import admin from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.views.generic.base import TemplateView admin.autodiscover() urlpatterns = patterns( '', # Robots not welcome (r'^robots\.txt$', TemplateView.as_view( template_name='robots.txt', content_type='text/plain')), # User accounts management (r'^account/', include('comics.accounts.urls')), # API (r'^api/', include('comics.api.urls')), # Help, about and feedback (r'^help/', include('comics.help.urls')), # Comic crawler status (r'^status/', include('comics.status.urls')), # Django admin (r'^admin/doc/', include('django.contrib.admindocs.urls')), (r'^admin/', include(admin.site.urls)), # Comics browsing. Must be last one included. (r'^', include('comics.browser.urls')), ) # Let Django host media if doing local development on runserver if not settings.MEDIA_URL.startswith('http'): urlpatterns += patterns( '', (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), ) urlpatterns += staticfiles_urlpatterns()
<commit_before>from __future__ import absolute_import from django.conf import settings from django.conf.urls import include, patterns from django.contrib import admin from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.views.generic.base import TemplateView admin.autodiscover() urlpatterns = patterns('', # Robots not welcome (r'^robots\.txt$', TemplateView.as_view( template_name='robots.txt', content_type='text/plain')), # User accounts management (r'^account/', include('comics.accounts.urls')), # API (r'^api/', include('comics.api.urls')), # Help, about and feedback (r'^help/', include('comics.help.urls')), # Comic crawler status (r'^status/', include('comics.status.urls')), # Django admin (r'^admin/doc/', include('django.contrib.admindocs.urls')), (r'^admin/', include(admin.site.urls)), # Comics browsing. Must be last one included. (r'^', include('comics.browser.urls')), ) # Let Django host media if doing local development on runserver if not settings.MEDIA_URL.startswith('http'): urlpatterns += patterns('', (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), ) urlpatterns += staticfiles_urlpatterns() <commit_msg>flake8: Fix all warnings in top-level urlconf<commit_after>
from __future__ import absolute_import from django.conf import settings from django.conf.urls import include, patterns from django.contrib import admin from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.views.generic.base import TemplateView admin.autodiscover() urlpatterns = patterns( '', # Robots not welcome (r'^robots\.txt$', TemplateView.as_view( template_name='robots.txt', content_type='text/plain')), # User accounts management (r'^account/', include('comics.accounts.urls')), # API (r'^api/', include('comics.api.urls')), # Help, about and feedback (r'^help/', include('comics.help.urls')), # Comic crawler status (r'^status/', include('comics.status.urls')), # Django admin (r'^admin/doc/', include('django.contrib.admindocs.urls')), (r'^admin/', include(admin.site.urls)), # Comics browsing. Must be last one included. (r'^', include('comics.browser.urls')), ) # Let Django host media if doing local development on runserver if not settings.MEDIA_URL.startswith('http'): urlpatterns += patterns( '', (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), ) urlpatterns += staticfiles_urlpatterns()
from __future__ import absolute_import from django.conf import settings from django.conf.urls import include, patterns from django.contrib import admin from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.views.generic.base import TemplateView admin.autodiscover() urlpatterns = patterns('', # Robots not welcome (r'^robots\.txt$', TemplateView.as_view( template_name='robots.txt', content_type='text/plain')), # User accounts management (r'^account/', include('comics.accounts.urls')), # API (r'^api/', include('comics.api.urls')), # Help, about and feedback (r'^help/', include('comics.help.urls')), # Comic crawler status (r'^status/', include('comics.status.urls')), # Django admin (r'^admin/doc/', include('django.contrib.admindocs.urls')), (r'^admin/', include(admin.site.urls)), # Comics browsing. Must be last one included. (r'^', include('comics.browser.urls')), ) # Let Django host media if doing local development on runserver if not settings.MEDIA_URL.startswith('http'): urlpatterns += patterns('', (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), ) urlpatterns += staticfiles_urlpatterns() flake8: Fix all warnings in top-level urlconffrom __future__ import absolute_import from django.conf import settings from django.conf.urls import include, patterns from django.contrib import admin from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.views.generic.base import TemplateView admin.autodiscover() urlpatterns = patterns( '', # Robots not welcome (r'^robots\.txt$', TemplateView.as_view( template_name='robots.txt', content_type='text/plain')), # User accounts management (r'^account/', include('comics.accounts.urls')), # API (r'^api/', include('comics.api.urls')), # Help, about and feedback (r'^help/', include('comics.help.urls')), # Comic crawler status (r'^status/', include('comics.status.urls')), # Django admin (r'^admin/doc/', include('django.contrib.admindocs.urls')), (r'^admin/', include(admin.site.urls)), # Comics browsing. Must be last one included. (r'^', include('comics.browser.urls')), ) # Let Django host media if doing local development on runserver if not settings.MEDIA_URL.startswith('http'): urlpatterns += patterns( '', (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), ) urlpatterns += staticfiles_urlpatterns()
<commit_before>from __future__ import absolute_import from django.conf import settings from django.conf.urls import include, patterns from django.contrib import admin from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.views.generic.base import TemplateView admin.autodiscover() urlpatterns = patterns('', # Robots not welcome (r'^robots\.txt$', TemplateView.as_view( template_name='robots.txt', content_type='text/plain')), # User accounts management (r'^account/', include('comics.accounts.urls')), # API (r'^api/', include('comics.api.urls')), # Help, about and feedback (r'^help/', include('comics.help.urls')), # Comic crawler status (r'^status/', include('comics.status.urls')), # Django admin (r'^admin/doc/', include('django.contrib.admindocs.urls')), (r'^admin/', include(admin.site.urls)), # Comics browsing. Must be last one included. (r'^', include('comics.browser.urls')), ) # Let Django host media if doing local development on runserver if not settings.MEDIA_URL.startswith('http'): urlpatterns += patterns('', (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), ) urlpatterns += staticfiles_urlpatterns() <commit_msg>flake8: Fix all warnings in top-level urlconf<commit_after>from __future__ import absolute_import from django.conf import settings from django.conf.urls import include, patterns from django.contrib import admin from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.views.generic.base import TemplateView admin.autodiscover() urlpatterns = patterns( '', # Robots not welcome (r'^robots\.txt$', TemplateView.as_view( template_name='robots.txt', content_type='text/plain')), # User accounts management (r'^account/', include('comics.accounts.urls')), # API (r'^api/', include('comics.api.urls')), # Help, about and feedback (r'^help/', include('comics.help.urls')), # Comic crawler status (r'^status/', include('comics.status.urls')), # Django admin (r'^admin/doc/', include('django.contrib.admindocs.urls')), (r'^admin/', include(admin.site.urls)), # Comics browsing. Must be last one included. (r'^', include('comics.browser.urls')), ) # Let Django host media if doing local development on runserver if not settings.MEDIA_URL.startswith('http'): urlpatterns += patterns( '', (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), ) urlpatterns += staticfiles_urlpatterns()
5bffcac159bc28adaf03b05ca75cd7387aad3240
linked-list/linked-list.py
linked-list/linked-list.py
# LINKED LIST # define constructor class Node(object): def __init__(self, data): self.data = data self.next = None
# LINKED LIST # define constructor class Node(object): def __init__(self, data): self.data = data self.next = None class LinkedList(object): def __init__(self, head=None): self.head = head
Set up linked list class
Set up linked list class
Python
mit
derekmpham/interview-prep,derekmpham/interview-prep
# LINKED LIST # define constructor class Node(object): def __init__(self, data): self.data = data self.next = None Set up linked list class
# LINKED LIST # define constructor class Node(object): def __init__(self, data): self.data = data self.next = None class LinkedList(object): def __init__(self, head=None): self.head = head
<commit_before># LINKED LIST # define constructor class Node(object): def __init__(self, data): self.data = data self.next = None <commit_msg>Set up linked list class<commit_after>
# LINKED LIST # define constructor class Node(object): def __init__(self, data): self.data = data self.next = None class LinkedList(object): def __init__(self, head=None): self.head = head
# LINKED LIST # define constructor class Node(object): def __init__(self, data): self.data = data self.next = None Set up linked list class# LINKED LIST # define constructor class Node(object): def __init__(self, data): self.data = data self.next = None class LinkedList(object): def __init__(self, head=None): self.head = head
<commit_before># LINKED LIST # define constructor class Node(object): def __init__(self, data): self.data = data self.next = None <commit_msg>Set up linked list class<commit_after># LINKED LIST # define constructor class Node(object): def __init__(self, data): self.data = data self.next = None class LinkedList(object): def __init__(self, head=None): self.head = head
7e7281bf4b5b6e1bc0284e5d8915a3f740a231dd
setup.py
setup.py
#!/usr/bin/env python import octo from distutils.core import setup if __name__ == "__main__": with open('README.rst') as file: long_description = file.read() setup(name='Octo', version=octo.__version__, description=octo.__doc__, long_description=long_description, author=octo.__author__, author_email=octo.__email__, url=octo.__url__, classifiers=[ "Environment :: Plugins", "Topic :: Software Development :: Libraries :: Application Frameworks", "Development Status :: 4 - Beta", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 3", "Topic :: Software Development", "Topic :: Utilities", ], license="License :: OSI Approved :: BSD License", packages=['octo'], scripts=['octo.py'], )
#!/usr/bin/env python import octo from distutils.core import setup if __name__ == "__main__": with open('README.rst') as file: long_description = file.read() setup(name='Octo', version=octo.__version__, description=octo.__doc__, long_description=long_description, author=octo.__author__, author_email=octo.__email__, url=octo.__url__, classifiers=[ "Environment :: Plugins", "Topic :: Software Development :: Libraries :: Application Frameworks", "Development Status :: 4 - Beta", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Topic :: Software Development", "Topic :: Utilities", ], license="License :: OSI Approved :: BSD License", packages=['octo'], scripts=['octo.py'], )
Add "Programming Language :: Python :: 2.7" PyPi trove classifier
Add "Programming Language :: Python :: 2.7" PyPi trove classifier
Python
bsd-2-clause
zoni/octo
#!/usr/bin/env python import octo from distutils.core import setup if __name__ == "__main__": with open('README.rst') as file: long_description = file.read() setup(name='Octo', version=octo.__version__, description=octo.__doc__, long_description=long_description, author=octo.__author__, author_email=octo.__email__, url=octo.__url__, classifiers=[ "Environment :: Plugins", "Topic :: Software Development :: Libraries :: Application Frameworks", "Development Status :: 4 - Beta", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 3", "Topic :: Software Development", "Topic :: Utilities", ], license="License :: OSI Approved :: BSD License", packages=['octo'], scripts=['octo.py'], )Add "Programming Language :: Python :: 2.7" PyPi trove classifier
#!/usr/bin/env python import octo from distutils.core import setup if __name__ == "__main__": with open('README.rst') as file: long_description = file.read() setup(name='Octo', version=octo.__version__, description=octo.__doc__, long_description=long_description, author=octo.__author__, author_email=octo.__email__, url=octo.__url__, classifiers=[ "Environment :: Plugins", "Topic :: Software Development :: Libraries :: Application Frameworks", "Development Status :: 4 - Beta", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Topic :: Software Development", "Topic :: Utilities", ], license="License :: OSI Approved :: BSD License", packages=['octo'], scripts=['octo.py'], )
<commit_before>#!/usr/bin/env python import octo from distutils.core import setup if __name__ == "__main__": with open('README.rst') as file: long_description = file.read() setup(name='Octo', version=octo.__version__, description=octo.__doc__, long_description=long_description, author=octo.__author__, author_email=octo.__email__, url=octo.__url__, classifiers=[ "Environment :: Plugins", "Topic :: Software Development :: Libraries :: Application Frameworks", "Development Status :: 4 - Beta", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 3", "Topic :: Software Development", "Topic :: Utilities", ], license="License :: OSI Approved :: BSD License", packages=['octo'], scripts=['octo.py'], )<commit_msg>Add "Programming Language :: Python :: 2.7" PyPi trove classifier<commit_after>
#!/usr/bin/env python import octo from distutils.core import setup if __name__ == "__main__": with open('README.rst') as file: long_description = file.read() setup(name='Octo', version=octo.__version__, description=octo.__doc__, long_description=long_description, author=octo.__author__, author_email=octo.__email__, url=octo.__url__, classifiers=[ "Environment :: Plugins", "Topic :: Software Development :: Libraries :: Application Frameworks", "Development Status :: 4 - Beta", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Topic :: Software Development", "Topic :: Utilities", ], license="License :: OSI Approved :: BSD License", packages=['octo'], scripts=['octo.py'], )
#!/usr/bin/env python import octo from distutils.core import setup if __name__ == "__main__": with open('README.rst') as file: long_description = file.read() setup(name='Octo', version=octo.__version__, description=octo.__doc__, long_description=long_description, author=octo.__author__, author_email=octo.__email__, url=octo.__url__, classifiers=[ "Environment :: Plugins", "Topic :: Software Development :: Libraries :: Application Frameworks", "Development Status :: 4 - Beta", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 3", "Topic :: Software Development", "Topic :: Utilities", ], license="License :: OSI Approved :: BSD License", packages=['octo'], scripts=['octo.py'], )Add "Programming Language :: Python :: 2.7" PyPi trove classifier#!/usr/bin/env python import octo from distutils.core import setup if __name__ == "__main__": with open('README.rst') as file: long_description = file.read() setup(name='Octo', version=octo.__version__, description=octo.__doc__, long_description=long_description, author=octo.__author__, author_email=octo.__email__, url=octo.__url__, classifiers=[ "Environment :: Plugins", "Topic :: Software Development :: Libraries :: Application Frameworks", "Development Status :: 4 - Beta", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Topic :: Software Development", "Topic :: Utilities", ], license="License :: OSI Approved :: BSD License", packages=['octo'], scripts=['octo.py'], )
<commit_before>#!/usr/bin/env python import octo from distutils.core import setup if __name__ == "__main__": with open('README.rst') as file: long_description = file.read() setup(name='Octo', version=octo.__version__, description=octo.__doc__, long_description=long_description, author=octo.__author__, author_email=octo.__email__, url=octo.__url__, classifiers=[ "Environment :: Plugins", "Topic :: Software Development :: Libraries :: Application Frameworks", "Development Status :: 4 - Beta", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 3", "Topic :: Software Development", "Topic :: Utilities", ], license="License :: OSI Approved :: BSD License", packages=['octo'], scripts=['octo.py'], )<commit_msg>Add "Programming Language :: Python :: 2.7" PyPi trove classifier<commit_after>#!/usr/bin/env python import octo from distutils.core import setup if __name__ == "__main__": with open('README.rst') as file: long_description = file.read() setup(name='Octo', version=octo.__version__, description=octo.__doc__, long_description=long_description, author=octo.__author__, author_email=octo.__email__, url=octo.__url__, classifiers=[ "Environment :: Plugins", "Topic :: Software Development :: Libraries :: Application Frameworks", "Development Status :: 4 - Beta", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Topic :: Software Development", "Topic :: Utilities", ], license="License :: OSI Approved :: BSD License", packages=['octo'], scripts=['octo.py'], )
926479dcaf2c1c4d2b1827b4b6d61bb8289cd7ac
setup.py
setup.py
from distutils.core import setup with open('README.md') as description: long_description = description.read() setup( name='rmr_django', version='0.0.1', author='Rinat Khabibiev', author_email='rh@redmadrobot.com', packages=[ 'rmr', 'rmr/django', 'rmr/django/middleware', 'rmr/django/middleware/request', 'rmr/models', 'rmr/models/fields', 'rmr/views', ], url='https://github.com/RedMadRobot/rmr_django', license='MIT', description='rmr_django', long_description=long_description, classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 3.4', ], install_requires=list(iter(open('requirements.txt', 'r').readline, '')), )
from distutils.core import setup with open('README.md') as description: long_description = description.read() setup( name='rmr_django', version='0.0.1', author='Rinat Khabibiev', author_email='rh@redmadrobot.com', packages=[ 'rmr', 'rmr/django', 'rmr/django/middleware', 'rmr/django/middleware/request', 'rmr/models', 'rmr/models/fields', 'rmr/views', ], url='https://github.com/RedMadRobot/rmr_django', license='MIT', description='rmr_django', long_description=long_description, classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 3.4', ], install_requires=iter(open('requirements.txt', 'r').readline, ''), )
Revert "install_requires is a list now, not iterator"
Revert "install_requires is a list now, not iterator" This reverts commit d36bcafb69a67d623c9e28f7dad5113783246419.
Python
mit
RedMadRobot/rmr_django
from distutils.core import setup with open('README.md') as description: long_description = description.read() setup( name='rmr_django', version='0.0.1', author='Rinat Khabibiev', author_email='rh@redmadrobot.com', packages=[ 'rmr', 'rmr/django', 'rmr/django/middleware', 'rmr/django/middleware/request', 'rmr/models', 'rmr/models/fields', 'rmr/views', ], url='https://github.com/RedMadRobot/rmr_django', license='MIT', description='rmr_django', long_description=long_description, classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 3.4', ], install_requires=list(iter(open('requirements.txt', 'r').readline, '')), ) Revert "install_requires is a list now, not iterator" This reverts commit d36bcafb69a67d623c9e28f7dad5113783246419.
from distutils.core import setup with open('README.md') as description: long_description = description.read() setup( name='rmr_django', version='0.0.1', author='Rinat Khabibiev', author_email='rh@redmadrobot.com', packages=[ 'rmr', 'rmr/django', 'rmr/django/middleware', 'rmr/django/middleware/request', 'rmr/models', 'rmr/models/fields', 'rmr/views', ], url='https://github.com/RedMadRobot/rmr_django', license='MIT', description='rmr_django', long_description=long_description, classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 3.4', ], install_requires=iter(open('requirements.txt', 'r').readline, ''), )
<commit_before>from distutils.core import setup with open('README.md') as description: long_description = description.read() setup( name='rmr_django', version='0.0.1', author='Rinat Khabibiev', author_email='rh@redmadrobot.com', packages=[ 'rmr', 'rmr/django', 'rmr/django/middleware', 'rmr/django/middleware/request', 'rmr/models', 'rmr/models/fields', 'rmr/views', ], url='https://github.com/RedMadRobot/rmr_django', license='MIT', description='rmr_django', long_description=long_description, classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 3.4', ], install_requires=list(iter(open('requirements.txt', 'r').readline, '')), ) <commit_msg>Revert "install_requires is a list now, not iterator" This reverts commit d36bcafb69a67d623c9e28f7dad5113783246419.<commit_after>
from distutils.core import setup with open('README.md') as description: long_description = description.read() setup( name='rmr_django', version='0.0.1', author='Rinat Khabibiev', author_email='rh@redmadrobot.com', packages=[ 'rmr', 'rmr/django', 'rmr/django/middleware', 'rmr/django/middleware/request', 'rmr/models', 'rmr/models/fields', 'rmr/views', ], url='https://github.com/RedMadRobot/rmr_django', license='MIT', description='rmr_django', long_description=long_description, classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 3.4', ], install_requires=iter(open('requirements.txt', 'r').readline, ''), )
from distutils.core import setup with open('README.md') as description: long_description = description.read() setup( name='rmr_django', version='0.0.1', author='Rinat Khabibiev', author_email='rh@redmadrobot.com', packages=[ 'rmr', 'rmr/django', 'rmr/django/middleware', 'rmr/django/middleware/request', 'rmr/models', 'rmr/models/fields', 'rmr/views', ], url='https://github.com/RedMadRobot/rmr_django', license='MIT', description='rmr_django', long_description=long_description, classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 3.4', ], install_requires=list(iter(open('requirements.txt', 'r').readline, '')), ) Revert "install_requires is a list now, not iterator" This reverts commit d36bcafb69a67d623c9e28f7dad5113783246419.from distutils.core import setup with open('README.md') as description: long_description = description.read() setup( name='rmr_django', version='0.0.1', author='Rinat Khabibiev', author_email='rh@redmadrobot.com', packages=[ 'rmr', 'rmr/django', 'rmr/django/middleware', 'rmr/django/middleware/request', 'rmr/models', 'rmr/models/fields', 'rmr/views', ], url='https://github.com/RedMadRobot/rmr_django', license='MIT', description='rmr_django', long_description=long_description, classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 3.4', ], install_requires=iter(open('requirements.txt', 'r').readline, ''), )
<commit_before>from distutils.core import setup with open('README.md') as description: long_description = description.read() setup( name='rmr_django', version='0.0.1', author='Rinat Khabibiev', author_email='rh@redmadrobot.com', packages=[ 'rmr', 'rmr/django', 'rmr/django/middleware', 'rmr/django/middleware/request', 'rmr/models', 'rmr/models/fields', 'rmr/views', ], url='https://github.com/RedMadRobot/rmr_django', license='MIT', description='rmr_django', long_description=long_description, classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 3.4', ], install_requires=list(iter(open('requirements.txt', 'r').readline, '')), ) <commit_msg>Revert "install_requires is a list now, not iterator" This reverts commit d36bcafb69a67d623c9e28f7dad5113783246419.<commit_after>from distutils.core import setup with open('README.md') as description: long_description = description.read() setup( name='rmr_django', version='0.0.1', author='Rinat Khabibiev', author_email='rh@redmadrobot.com', packages=[ 'rmr', 'rmr/django', 'rmr/django/middleware', 'rmr/django/middleware/request', 'rmr/models', 'rmr/models/fields', 'rmr/views', ], url='https://github.com/RedMadRobot/rmr_django', license='MIT', description='rmr_django', long_description=long_description, classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 3.4', ], install_requires=iter(open('requirements.txt', 'r').readline, ''), )
5d15610105c6c5f56b31ae5ba581245cc54ad256
setup.py
setup.py
import codecs from os import path from textwrap import dedent from setuptools import setup here = path.abspath(path.dirname(__file__)) with codecs.open(path.join(here, "README.rst"), encoding='utf-8') as f: long_description = f.read() setup( name='python-jsonstore', use_scm_version=True, description="", long_description=long_description, long_description_content_type='text/markdown', author="Oliver Bristow", author_email='github+pypi@oliverbristow.co.uk', license='MIT', classifiers=dedent(""" Development Status :: 5 - Production/Stable Intended Audience :: Developers License :: OSI Approved :: MIT License Operating System :: OS Independent Programming Language :: Python :: 2 Programming Language :: Python :: 2.7 Programming Language :: Python :: 3 Programming Language :: Python :: 3.3 Programming Language :: Python :: 3.4 Programming Language :: Python :: 3.5 Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Programming Language :: Python :: Implementation :: CPython Programming Language :: Python :: Implementation :: PyPy Topic :: Database Topic :: Software Development """).strip().split('\n'), keywords='json key value store', url='https://github.com/Code0x58/python-jsonstore/', py_modules=dedent(""" jsonstore """).strip().split('\n'), setup_requires=["setuptools_scm", "wheel"], )
import codecs from os import path from textwrap import dedent from setuptools import setup here = path.abspath(path.dirname(__file__)) with codecs.open(path.join(here, "README.rst"), encoding='utf-8') as f: long_description = f.read() setup( name='python-jsonstore', use_scm_version=True, description="", long_description=long_description, long_description_content_type='text/x-rst', author="Oliver Bristow", author_email='github+pypi@oliverbristow.co.uk', license='MIT', classifiers=dedent(""" Development Status :: 5 - Production/Stable Intended Audience :: Developers License :: OSI Approved :: MIT License Operating System :: OS Independent Programming Language :: Python :: 2 Programming Language :: Python :: 2.7 Programming Language :: Python :: 3 Programming Language :: Python :: 3.3 Programming Language :: Python :: 3.4 Programming Language :: Python :: 3.5 Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Programming Language :: Python :: Implementation :: CPython Programming Language :: Python :: Implementation :: PyPy Topic :: Database Topic :: Software Development """).strip().split('\n'), keywords='json key value store', url='https://github.com/Code0x58/python-jsonstore/', py_modules=dedent(""" jsonstore """).strip().split('\n'), setup_requires=["setuptools_scm", "wheel"], )
Fix long description content type
Fix long description content type
Python
mit
Code0x58/python-jsonstore
import codecs from os import path from textwrap import dedent from setuptools import setup here = path.abspath(path.dirname(__file__)) with codecs.open(path.join(here, "README.rst"), encoding='utf-8') as f: long_description = f.read() setup( name='python-jsonstore', use_scm_version=True, description="", long_description=long_description, long_description_content_type='text/markdown', author="Oliver Bristow", author_email='github+pypi@oliverbristow.co.uk', license='MIT', classifiers=dedent(""" Development Status :: 5 - Production/Stable Intended Audience :: Developers License :: OSI Approved :: MIT License Operating System :: OS Independent Programming Language :: Python :: 2 Programming Language :: Python :: 2.7 Programming Language :: Python :: 3 Programming Language :: Python :: 3.3 Programming Language :: Python :: 3.4 Programming Language :: Python :: 3.5 Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Programming Language :: Python :: Implementation :: CPython Programming Language :: Python :: Implementation :: PyPy Topic :: Database Topic :: Software Development """).strip().split('\n'), keywords='json key value store', url='https://github.com/Code0x58/python-jsonstore/', py_modules=dedent(""" jsonstore """).strip().split('\n'), setup_requires=["setuptools_scm", "wheel"], ) Fix long description content type
import codecs from os import path from textwrap import dedent from setuptools import setup here = path.abspath(path.dirname(__file__)) with codecs.open(path.join(here, "README.rst"), encoding='utf-8') as f: long_description = f.read() setup( name='python-jsonstore', use_scm_version=True, description="", long_description=long_description, long_description_content_type='text/x-rst', author="Oliver Bristow", author_email='github+pypi@oliverbristow.co.uk', license='MIT', classifiers=dedent(""" Development Status :: 5 - Production/Stable Intended Audience :: Developers License :: OSI Approved :: MIT License Operating System :: OS Independent Programming Language :: Python :: 2 Programming Language :: Python :: 2.7 Programming Language :: Python :: 3 Programming Language :: Python :: 3.3 Programming Language :: Python :: 3.4 Programming Language :: Python :: 3.5 Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Programming Language :: Python :: Implementation :: CPython Programming Language :: Python :: Implementation :: PyPy Topic :: Database Topic :: Software Development """).strip().split('\n'), keywords='json key value store', url='https://github.com/Code0x58/python-jsonstore/', py_modules=dedent(""" jsonstore """).strip().split('\n'), setup_requires=["setuptools_scm", "wheel"], )
<commit_before>import codecs from os import path from textwrap import dedent from setuptools import setup here = path.abspath(path.dirname(__file__)) with codecs.open(path.join(here, "README.rst"), encoding='utf-8') as f: long_description = f.read() setup( name='python-jsonstore', use_scm_version=True, description="", long_description=long_description, long_description_content_type='text/markdown', author="Oliver Bristow", author_email='github+pypi@oliverbristow.co.uk', license='MIT', classifiers=dedent(""" Development Status :: 5 - Production/Stable Intended Audience :: Developers License :: OSI Approved :: MIT License Operating System :: OS Independent Programming Language :: Python :: 2 Programming Language :: Python :: 2.7 Programming Language :: Python :: 3 Programming Language :: Python :: 3.3 Programming Language :: Python :: 3.4 Programming Language :: Python :: 3.5 Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Programming Language :: Python :: Implementation :: CPython Programming Language :: Python :: Implementation :: PyPy Topic :: Database Topic :: Software Development """).strip().split('\n'), keywords='json key value store', url='https://github.com/Code0x58/python-jsonstore/', py_modules=dedent(""" jsonstore """).strip().split('\n'), setup_requires=["setuptools_scm", "wheel"], ) <commit_msg>Fix long description content type<commit_after>
import codecs from os import path from textwrap import dedent from setuptools import setup here = path.abspath(path.dirname(__file__)) with codecs.open(path.join(here, "README.rst"), encoding='utf-8') as f: long_description = f.read() setup( name='python-jsonstore', use_scm_version=True, description="", long_description=long_description, long_description_content_type='text/x-rst', author="Oliver Bristow", author_email='github+pypi@oliverbristow.co.uk', license='MIT', classifiers=dedent(""" Development Status :: 5 - Production/Stable Intended Audience :: Developers License :: OSI Approved :: MIT License Operating System :: OS Independent Programming Language :: Python :: 2 Programming Language :: Python :: 2.7 Programming Language :: Python :: 3 Programming Language :: Python :: 3.3 Programming Language :: Python :: 3.4 Programming Language :: Python :: 3.5 Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Programming Language :: Python :: Implementation :: CPython Programming Language :: Python :: Implementation :: PyPy Topic :: Database Topic :: Software Development """).strip().split('\n'), keywords='json key value store', url='https://github.com/Code0x58/python-jsonstore/', py_modules=dedent(""" jsonstore """).strip().split('\n'), setup_requires=["setuptools_scm", "wheel"], )
import codecs from os import path from textwrap import dedent from setuptools import setup here = path.abspath(path.dirname(__file__)) with codecs.open(path.join(here, "README.rst"), encoding='utf-8') as f: long_description = f.read() setup( name='python-jsonstore', use_scm_version=True, description="", long_description=long_description, long_description_content_type='text/markdown', author="Oliver Bristow", author_email='github+pypi@oliverbristow.co.uk', license='MIT', classifiers=dedent(""" Development Status :: 5 - Production/Stable Intended Audience :: Developers License :: OSI Approved :: MIT License Operating System :: OS Independent Programming Language :: Python :: 2 Programming Language :: Python :: 2.7 Programming Language :: Python :: 3 Programming Language :: Python :: 3.3 Programming Language :: Python :: 3.4 Programming Language :: Python :: 3.5 Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Programming Language :: Python :: Implementation :: CPython Programming Language :: Python :: Implementation :: PyPy Topic :: Database Topic :: Software Development """).strip().split('\n'), keywords='json key value store', url='https://github.com/Code0x58/python-jsonstore/', py_modules=dedent(""" jsonstore """).strip().split('\n'), setup_requires=["setuptools_scm", "wheel"], ) Fix long description content typeimport codecs from os import path from textwrap import dedent from setuptools import setup here = path.abspath(path.dirname(__file__)) with codecs.open(path.join(here, "README.rst"), encoding='utf-8') as f: long_description = f.read() setup( name='python-jsonstore', use_scm_version=True, description="", long_description=long_description, long_description_content_type='text/x-rst', author="Oliver Bristow", author_email='github+pypi@oliverbristow.co.uk', license='MIT', classifiers=dedent(""" Development Status :: 5 - Production/Stable Intended Audience :: Developers License :: OSI Approved :: MIT License Operating System :: OS Independent Programming Language :: Python :: 2 Programming Language :: Python :: 2.7 Programming Language :: Python :: 3 Programming Language :: Python :: 3.3 Programming Language :: Python :: 3.4 Programming Language :: Python :: 3.5 Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Programming Language :: Python :: Implementation :: CPython Programming Language :: Python :: Implementation :: PyPy Topic :: Database Topic :: Software Development """).strip().split('\n'), keywords='json key value store', url='https://github.com/Code0x58/python-jsonstore/', py_modules=dedent(""" jsonstore """).strip().split('\n'), setup_requires=["setuptools_scm", "wheel"], )
<commit_before>import codecs from os import path from textwrap import dedent from setuptools import setup here = path.abspath(path.dirname(__file__)) with codecs.open(path.join(here, "README.rst"), encoding='utf-8') as f: long_description = f.read() setup( name='python-jsonstore', use_scm_version=True, description="", long_description=long_description, long_description_content_type='text/markdown', author="Oliver Bristow", author_email='github+pypi@oliverbristow.co.uk', license='MIT', classifiers=dedent(""" Development Status :: 5 - Production/Stable Intended Audience :: Developers License :: OSI Approved :: MIT License Operating System :: OS Independent Programming Language :: Python :: 2 Programming Language :: Python :: 2.7 Programming Language :: Python :: 3 Programming Language :: Python :: 3.3 Programming Language :: Python :: 3.4 Programming Language :: Python :: 3.5 Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Programming Language :: Python :: Implementation :: CPython Programming Language :: Python :: Implementation :: PyPy Topic :: Database Topic :: Software Development """).strip().split('\n'), keywords='json key value store', url='https://github.com/Code0x58/python-jsonstore/', py_modules=dedent(""" jsonstore """).strip().split('\n'), setup_requires=["setuptools_scm", "wheel"], ) <commit_msg>Fix long description content type<commit_after>import codecs from os import path from textwrap import dedent from setuptools import setup here = path.abspath(path.dirname(__file__)) with codecs.open(path.join(here, "README.rst"), encoding='utf-8') as f: long_description = f.read() setup( name='python-jsonstore', use_scm_version=True, description="", long_description=long_description, long_description_content_type='text/x-rst', author="Oliver Bristow", author_email='github+pypi@oliverbristow.co.uk', license='MIT', classifiers=dedent(""" Development Status :: 5 - Production/Stable Intended Audience :: Developers License :: OSI Approved :: MIT License Operating System :: OS Independent Programming Language :: Python :: 2 Programming Language :: Python :: 2.7 Programming Language :: Python :: 3 Programming Language :: Python :: 3.3 Programming Language :: Python :: 3.4 Programming Language :: Python :: 3.5 Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Programming Language :: Python :: Implementation :: CPython Programming Language :: Python :: Implementation :: PyPy Topic :: Database Topic :: Software Development """).strip().split('\n'), keywords='json key value store', url='https://github.com/Code0x58/python-jsonstore/', py_modules=dedent(""" jsonstore """).strip().split('\n'), setup_requires=["setuptools_scm", "wheel"], )
910da5e31c04cf8e3063297317f1b9ced0a79be1
setup.py
setup.py
""" pip-tools keeps your pinned dependencies fresh. """ import sys from setuptools import setup setup( name='pip-tools', version='0.2', url='https://github.com/nvie/pip-tools/', license='BSD', author='Vincent Driessen', author_email='vincent@3rdcloud.com', description=__doc__, #packages=[], scripts=['bin/pip-review', 'bin/pip-dump'], #include_package_data=True, zip_safe=False, platforms='any', install_requires=['argparse==1.2.1'], # needed for python 2.6 classifiers=[ # As from http://pypi.python.org/pypi?%3Aaction=list_classifiers #'Development Status :: 1 - Planning', #'Development Status :: 2 - Pre-Alpha', #'Development Status :: 3 - Alpha', 'Development Status :: 4 - Beta', #'Development Status :: 5 - Production/Stable', #'Development Status :: 6 - Mature', #'Development Status :: 7 - Inactive', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Topic :: System :: Systems Administration', ] )
""" pip-tools keeps your pinned dependencies fresh. """ import sys from setuptools import setup def get_dependencies(): deps = [] if sys.version_info < (2, 7): deps += ['argparse'] return deps setup( name='pip-tools', version='0.2', url='https://github.com/nvie/pip-tools/', license='BSD', author='Vincent Driessen', author_email='vincent@3rdcloud.com', description=__doc__, #packages=[], scripts=['bin/pip-review', 'bin/pip-dump'], #include_package_data=True, zip_safe=False, platforms='any', install_requires=get_dependencies(), classifiers=[ # As from http://pypi.python.org/pypi?%3Aaction=list_classifiers #'Development Status :: 1 - Planning', #'Development Status :: 2 - Pre-Alpha', #'Development Status :: 3 - Alpha', 'Development Status :: 4 - Beta', #'Development Status :: 5 - Production/Stable', #'Development Status :: 6 - Mature', #'Development Status :: 7 - Inactive', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Topic :: System :: Systems Administration', ] )
Make argparse an optional dependency (and avoid pinning in a library).
Make argparse an optional dependency (and avoid pinning in a library).
Python
bsd-2-clause
suutari-ai/prequ,suutari/prequ,suutari/prequ
""" pip-tools keeps your pinned dependencies fresh. """ import sys from setuptools import setup setup( name='pip-tools', version='0.2', url='https://github.com/nvie/pip-tools/', license='BSD', author='Vincent Driessen', author_email='vincent@3rdcloud.com', description=__doc__, #packages=[], scripts=['bin/pip-review', 'bin/pip-dump'], #include_package_data=True, zip_safe=False, platforms='any', install_requires=['argparse==1.2.1'], # needed for python 2.6 classifiers=[ # As from http://pypi.python.org/pypi?%3Aaction=list_classifiers #'Development Status :: 1 - Planning', #'Development Status :: 2 - Pre-Alpha', #'Development Status :: 3 - Alpha', 'Development Status :: 4 - Beta', #'Development Status :: 5 - Production/Stable', #'Development Status :: 6 - Mature', #'Development Status :: 7 - Inactive', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Topic :: System :: Systems Administration', ] ) Make argparse an optional dependency (and avoid pinning in a library).
""" pip-tools keeps your pinned dependencies fresh. """ import sys from setuptools import setup def get_dependencies(): deps = [] if sys.version_info < (2, 7): deps += ['argparse'] return deps setup( name='pip-tools', version='0.2', url='https://github.com/nvie/pip-tools/', license='BSD', author='Vincent Driessen', author_email='vincent@3rdcloud.com', description=__doc__, #packages=[], scripts=['bin/pip-review', 'bin/pip-dump'], #include_package_data=True, zip_safe=False, platforms='any', install_requires=get_dependencies(), classifiers=[ # As from http://pypi.python.org/pypi?%3Aaction=list_classifiers #'Development Status :: 1 - Planning', #'Development Status :: 2 - Pre-Alpha', #'Development Status :: 3 - Alpha', 'Development Status :: 4 - Beta', #'Development Status :: 5 - Production/Stable', #'Development Status :: 6 - Mature', #'Development Status :: 7 - Inactive', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Topic :: System :: Systems Administration', ] )
<commit_before>""" pip-tools keeps your pinned dependencies fresh. """ import sys from setuptools import setup setup( name='pip-tools', version='0.2', url='https://github.com/nvie/pip-tools/', license='BSD', author='Vincent Driessen', author_email='vincent@3rdcloud.com', description=__doc__, #packages=[], scripts=['bin/pip-review', 'bin/pip-dump'], #include_package_data=True, zip_safe=False, platforms='any', install_requires=['argparse==1.2.1'], # needed for python 2.6 classifiers=[ # As from http://pypi.python.org/pypi?%3Aaction=list_classifiers #'Development Status :: 1 - Planning', #'Development Status :: 2 - Pre-Alpha', #'Development Status :: 3 - Alpha', 'Development Status :: 4 - Beta', #'Development Status :: 5 - Production/Stable', #'Development Status :: 6 - Mature', #'Development Status :: 7 - Inactive', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Topic :: System :: Systems Administration', ] ) <commit_msg>Make argparse an optional dependency (and avoid pinning in a library).<commit_after>
""" pip-tools keeps your pinned dependencies fresh. """ import sys from setuptools import setup def get_dependencies(): deps = [] if sys.version_info < (2, 7): deps += ['argparse'] return deps setup( name='pip-tools', version='0.2', url='https://github.com/nvie/pip-tools/', license='BSD', author='Vincent Driessen', author_email='vincent@3rdcloud.com', description=__doc__, #packages=[], scripts=['bin/pip-review', 'bin/pip-dump'], #include_package_data=True, zip_safe=False, platforms='any', install_requires=get_dependencies(), classifiers=[ # As from http://pypi.python.org/pypi?%3Aaction=list_classifiers #'Development Status :: 1 - Planning', #'Development Status :: 2 - Pre-Alpha', #'Development Status :: 3 - Alpha', 'Development Status :: 4 - Beta', #'Development Status :: 5 - Production/Stable', #'Development Status :: 6 - Mature', #'Development Status :: 7 - Inactive', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Topic :: System :: Systems Administration', ] )
""" pip-tools keeps your pinned dependencies fresh. """ import sys from setuptools import setup setup( name='pip-tools', version='0.2', url='https://github.com/nvie/pip-tools/', license='BSD', author='Vincent Driessen', author_email='vincent@3rdcloud.com', description=__doc__, #packages=[], scripts=['bin/pip-review', 'bin/pip-dump'], #include_package_data=True, zip_safe=False, platforms='any', install_requires=['argparse==1.2.1'], # needed for python 2.6 classifiers=[ # As from http://pypi.python.org/pypi?%3Aaction=list_classifiers #'Development Status :: 1 - Planning', #'Development Status :: 2 - Pre-Alpha', #'Development Status :: 3 - Alpha', 'Development Status :: 4 - Beta', #'Development Status :: 5 - Production/Stable', #'Development Status :: 6 - Mature', #'Development Status :: 7 - Inactive', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Topic :: System :: Systems Administration', ] ) Make argparse an optional dependency (and avoid pinning in a library).""" pip-tools keeps your pinned dependencies fresh. """ import sys from setuptools import setup def get_dependencies(): deps = [] if sys.version_info < (2, 7): deps += ['argparse'] return deps setup( name='pip-tools', version='0.2', url='https://github.com/nvie/pip-tools/', license='BSD', author='Vincent Driessen', author_email='vincent@3rdcloud.com', description=__doc__, #packages=[], scripts=['bin/pip-review', 'bin/pip-dump'], #include_package_data=True, zip_safe=False, platforms='any', install_requires=get_dependencies(), classifiers=[ # As from http://pypi.python.org/pypi?%3Aaction=list_classifiers #'Development Status :: 1 - Planning', #'Development Status :: 2 - Pre-Alpha', #'Development Status :: 3 - Alpha', 'Development Status :: 4 - Beta', #'Development Status :: 5 - Production/Stable', #'Development Status :: 6 - Mature', #'Development Status :: 7 - Inactive', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Topic :: System :: Systems Administration', ] )
<commit_before>""" pip-tools keeps your pinned dependencies fresh. """ import sys from setuptools import setup setup( name='pip-tools', version='0.2', url='https://github.com/nvie/pip-tools/', license='BSD', author='Vincent Driessen', author_email='vincent@3rdcloud.com', description=__doc__, #packages=[], scripts=['bin/pip-review', 'bin/pip-dump'], #include_package_data=True, zip_safe=False, platforms='any', install_requires=['argparse==1.2.1'], # needed for python 2.6 classifiers=[ # As from http://pypi.python.org/pypi?%3Aaction=list_classifiers #'Development Status :: 1 - Planning', #'Development Status :: 2 - Pre-Alpha', #'Development Status :: 3 - Alpha', 'Development Status :: 4 - Beta', #'Development Status :: 5 - Production/Stable', #'Development Status :: 6 - Mature', #'Development Status :: 7 - Inactive', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Topic :: System :: Systems Administration', ] ) <commit_msg>Make argparse an optional dependency (and avoid pinning in a library).<commit_after>""" pip-tools keeps your pinned dependencies fresh. """ import sys from setuptools import setup def get_dependencies(): deps = [] if sys.version_info < (2, 7): deps += ['argparse'] return deps setup( name='pip-tools', version='0.2', url='https://github.com/nvie/pip-tools/', license='BSD', author='Vincent Driessen', author_email='vincent@3rdcloud.com', description=__doc__, #packages=[], scripts=['bin/pip-review', 'bin/pip-dump'], #include_package_data=True, zip_safe=False, platforms='any', install_requires=get_dependencies(), classifiers=[ # As from http://pypi.python.org/pypi?%3Aaction=list_classifiers #'Development Status :: 1 - Planning', #'Development Status :: 2 - Pre-Alpha', #'Development Status :: 3 - Alpha', 'Development Status :: 4 - Beta', #'Development Status :: 5 - Production/Stable', #'Development Status :: 6 - Mature', #'Development Status :: 7 - Inactive', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Topic :: System :: Systems Administration', ] )
705ddfba46334f5bc00387281bd9360ca49afa04
setup.py
setup.py
# coding=utf-8 import sys cmdclass = {} try: from setuptools import setup except ImportError: from distutils.core import setup else: from setuptools.command.test import test as TestCommand class PyTest(TestCommand): 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 here, cause outside the eggs aren't loaded import pytest errno = pytest.main(self.pytest_args) sys.exit(errno) cmdclass['test'] = PyTest setup( name='openprovider.py', version='0.11.3', author='Antagonist B.V.', author_email='info@antagonist.nl', packages=['openprovider', 'openprovider.modules', 'openprovider.data'], url='https://github.com/AntagonistHQ/openprovider.py', license='LICENSE.rst', description='An unofficial library for the OpenProvider API', long_description=open('README.rst').read(), install_requires=[ "requests >= 2.3.0, <= 2.5.1", "lxml >= 3.3.5", ], tests_require=[ "betamax>=0.7.0", "Faker", "pytest", ], cmdclass=cmdclass, )
# coding=utf-8 import sys cmdclass = {} try: from setuptools import setup except ImportError: from distutils.core import setup else: from setuptools.command.test import test as TestCommand class PyTest(TestCommand): 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 here, cause outside the eggs aren't loaded import pytest errno = pytest.main(self.pytest_args) sys.exit(errno) cmdclass['test'] = PyTest setup( name='openprovider.py', version='0.11.3', author='Antagonist B.V.', author_email='info@antagonist.nl', packages=['openprovider', 'openprovider.modules', 'openprovider.data'], url='https://github.com/AntagonistHQ/openprovider.py', license='LICENSE.rst', description='An unofficial library for the OpenProvider API', long_description=open('README.rst').read(), install_requires=[ "requests >= 2.3.0", "lxml >= 3.3.5", ], tests_require=[ "betamax>=0.7.0", "Faker", "pytest", ], cmdclass=cmdclass, )
Remove requests dependency upper version constraint
Remove requests dependency upper version constraint Removes the undocumented and outdated upper version constraint for the requests dependency.
Python
mit
AntagonistHQ/openprovider.py
# coding=utf-8 import sys cmdclass = {} try: from setuptools import setup except ImportError: from distutils.core import setup else: from setuptools.command.test import test as TestCommand class PyTest(TestCommand): 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 here, cause outside the eggs aren't loaded import pytest errno = pytest.main(self.pytest_args) sys.exit(errno) cmdclass['test'] = PyTest setup( name='openprovider.py', version='0.11.3', author='Antagonist B.V.', author_email='info@antagonist.nl', packages=['openprovider', 'openprovider.modules', 'openprovider.data'], url='https://github.com/AntagonistHQ/openprovider.py', license='LICENSE.rst', description='An unofficial library for the OpenProvider API', long_description=open('README.rst').read(), install_requires=[ "requests >= 2.3.0, <= 2.5.1", "lxml >= 3.3.5", ], tests_require=[ "betamax>=0.7.0", "Faker", "pytest", ], cmdclass=cmdclass, ) Remove requests dependency upper version constraint Removes the undocumented and outdated upper version constraint for the requests dependency.
# coding=utf-8 import sys cmdclass = {} try: from setuptools import setup except ImportError: from distutils.core import setup else: from setuptools.command.test import test as TestCommand class PyTest(TestCommand): 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 here, cause outside the eggs aren't loaded import pytest errno = pytest.main(self.pytest_args) sys.exit(errno) cmdclass['test'] = PyTest setup( name='openprovider.py', version='0.11.3', author='Antagonist B.V.', author_email='info@antagonist.nl', packages=['openprovider', 'openprovider.modules', 'openprovider.data'], url='https://github.com/AntagonistHQ/openprovider.py', license='LICENSE.rst', description='An unofficial library for the OpenProvider API', long_description=open('README.rst').read(), install_requires=[ "requests >= 2.3.0", "lxml >= 3.3.5", ], tests_require=[ "betamax>=0.7.0", "Faker", "pytest", ], cmdclass=cmdclass, )
<commit_before># coding=utf-8 import sys cmdclass = {} try: from setuptools import setup except ImportError: from distutils.core import setup else: from setuptools.command.test import test as TestCommand class PyTest(TestCommand): 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 here, cause outside the eggs aren't loaded import pytest errno = pytest.main(self.pytest_args) sys.exit(errno) cmdclass['test'] = PyTest setup( name='openprovider.py', version='0.11.3', author='Antagonist B.V.', author_email='info@antagonist.nl', packages=['openprovider', 'openprovider.modules', 'openprovider.data'], url='https://github.com/AntagonistHQ/openprovider.py', license='LICENSE.rst', description='An unofficial library for the OpenProvider API', long_description=open('README.rst').read(), install_requires=[ "requests >= 2.3.0, <= 2.5.1", "lxml >= 3.3.5", ], tests_require=[ "betamax>=0.7.0", "Faker", "pytest", ], cmdclass=cmdclass, ) <commit_msg>Remove requests dependency upper version constraint Removes the undocumented and outdated upper version constraint for the requests dependency.<commit_after>
# coding=utf-8 import sys cmdclass = {} try: from setuptools import setup except ImportError: from distutils.core import setup else: from setuptools.command.test import test as TestCommand class PyTest(TestCommand): 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 here, cause outside the eggs aren't loaded import pytest errno = pytest.main(self.pytest_args) sys.exit(errno) cmdclass['test'] = PyTest setup( name='openprovider.py', version='0.11.3', author='Antagonist B.V.', author_email='info@antagonist.nl', packages=['openprovider', 'openprovider.modules', 'openprovider.data'], url='https://github.com/AntagonistHQ/openprovider.py', license='LICENSE.rst', description='An unofficial library for the OpenProvider API', long_description=open('README.rst').read(), install_requires=[ "requests >= 2.3.0", "lxml >= 3.3.5", ], tests_require=[ "betamax>=0.7.0", "Faker", "pytest", ], cmdclass=cmdclass, )
# coding=utf-8 import sys cmdclass = {} try: from setuptools import setup except ImportError: from distutils.core import setup else: from setuptools.command.test import test as TestCommand class PyTest(TestCommand): 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 here, cause outside the eggs aren't loaded import pytest errno = pytest.main(self.pytest_args) sys.exit(errno) cmdclass['test'] = PyTest setup( name='openprovider.py', version='0.11.3', author='Antagonist B.V.', author_email='info@antagonist.nl', packages=['openprovider', 'openprovider.modules', 'openprovider.data'], url='https://github.com/AntagonistHQ/openprovider.py', license='LICENSE.rst', description='An unofficial library for the OpenProvider API', long_description=open('README.rst').read(), install_requires=[ "requests >= 2.3.0, <= 2.5.1", "lxml >= 3.3.5", ], tests_require=[ "betamax>=0.7.0", "Faker", "pytest", ], cmdclass=cmdclass, ) Remove requests dependency upper version constraint Removes the undocumented and outdated upper version constraint for the requests dependency.# coding=utf-8 import sys cmdclass = {} try: from setuptools import setup except ImportError: from distutils.core import setup else: from setuptools.command.test import test as TestCommand class PyTest(TestCommand): 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 here, cause outside the eggs aren't loaded import pytest errno = pytest.main(self.pytest_args) sys.exit(errno) cmdclass['test'] = PyTest setup( name='openprovider.py', version='0.11.3', author='Antagonist B.V.', author_email='info@antagonist.nl', packages=['openprovider', 'openprovider.modules', 'openprovider.data'], url='https://github.com/AntagonistHQ/openprovider.py', license='LICENSE.rst', description='An unofficial library for the OpenProvider API', long_description=open('README.rst').read(), install_requires=[ "requests >= 2.3.0", "lxml >= 3.3.5", ], tests_require=[ "betamax>=0.7.0", "Faker", "pytest", ], cmdclass=cmdclass, )
<commit_before># coding=utf-8 import sys cmdclass = {} try: from setuptools import setup except ImportError: from distutils.core import setup else: from setuptools.command.test import test as TestCommand class PyTest(TestCommand): 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 here, cause outside the eggs aren't loaded import pytest errno = pytest.main(self.pytest_args) sys.exit(errno) cmdclass['test'] = PyTest setup( name='openprovider.py', version='0.11.3', author='Antagonist B.V.', author_email='info@antagonist.nl', packages=['openprovider', 'openprovider.modules', 'openprovider.data'], url='https://github.com/AntagonistHQ/openprovider.py', license='LICENSE.rst', description='An unofficial library for the OpenProvider API', long_description=open('README.rst').read(), install_requires=[ "requests >= 2.3.0, <= 2.5.1", "lxml >= 3.3.5", ], tests_require=[ "betamax>=0.7.0", "Faker", "pytest", ], cmdclass=cmdclass, ) <commit_msg>Remove requests dependency upper version constraint Removes the undocumented and outdated upper version constraint for the requests dependency.<commit_after># coding=utf-8 import sys cmdclass = {} try: from setuptools import setup except ImportError: from distutils.core import setup else: from setuptools.command.test import test as TestCommand class PyTest(TestCommand): 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 here, cause outside the eggs aren't loaded import pytest errno = pytest.main(self.pytest_args) sys.exit(errno) cmdclass['test'] = PyTest setup( name='openprovider.py', version='0.11.3', author='Antagonist B.V.', author_email='info@antagonist.nl', packages=['openprovider', 'openprovider.modules', 'openprovider.data'], url='https://github.com/AntagonistHQ/openprovider.py', license='LICENSE.rst', description='An unofficial library for the OpenProvider API', long_description=open('README.rst').read(), install_requires=[ "requests >= 2.3.0", "lxml >= 3.3.5", ], tests_require=[ "betamax>=0.7.0", "Faker", "pytest", ], cmdclass=cmdclass, )
e2e2a0ac1d36c304f6dffc7c15d37ff17225a23e
setup.py
setup.py
#!/usr/bin/python from distutils.core import setup from glob import glob # Scripts whose names end in a-z or 1-9 (avoids emacs backup files) scripts = glob('scripts/*[a-z,1-9]') setup(name='vasputil', version='5.7', description='VASP utilities', author='Janne Blomqvist', author_email='Janne.Blomqvist@aalto.fi', url='http://github.com/jabl/vasputil', packages=['vasputil', 'vasputil.tests'], scripts = scripts)
#!/usr/bin/python from distutils.core import setup from glob import glob # Scripts whose names end in a-z or 1-9 (avoids emacs backup files) scripts = glob('scripts/*[a-z,1-9]') setup(name='vasputil', version='master', description='VASP utilities', author='Janne Blomqvist', author_email='Janne.Blomqvist@aalto.fi', url='http://github.com/jabl/vasputil', packages=['vasputil', 'vasputil.tests'], scripts = scripts)
Change version to master branch
Change version to master branch
Python
lgpl-2.1
jabl/vasputil,oren88/vasputil,oren88/vasputil,jabl/vasputil
#!/usr/bin/python from distutils.core import setup from glob import glob # Scripts whose names end in a-z or 1-9 (avoids emacs backup files) scripts = glob('scripts/*[a-z,1-9]') setup(name='vasputil', version='5.7', description='VASP utilities', author='Janne Blomqvist', author_email='Janne.Blomqvist@aalto.fi', url='http://github.com/jabl/vasputil', packages=['vasputil', 'vasputil.tests'], scripts = scripts) Change version to master branch
#!/usr/bin/python from distutils.core import setup from glob import glob # Scripts whose names end in a-z or 1-9 (avoids emacs backup files) scripts = glob('scripts/*[a-z,1-9]') setup(name='vasputil', version='master', description='VASP utilities', author='Janne Blomqvist', author_email='Janne.Blomqvist@aalto.fi', url='http://github.com/jabl/vasputil', packages=['vasputil', 'vasputil.tests'], scripts = scripts)
<commit_before>#!/usr/bin/python from distutils.core import setup from glob import glob # Scripts whose names end in a-z or 1-9 (avoids emacs backup files) scripts = glob('scripts/*[a-z,1-9]') setup(name='vasputil', version='5.7', description='VASP utilities', author='Janne Blomqvist', author_email='Janne.Blomqvist@aalto.fi', url='http://github.com/jabl/vasputil', packages=['vasputil', 'vasputil.tests'], scripts = scripts) <commit_msg>Change version to master branch<commit_after>
#!/usr/bin/python from distutils.core import setup from glob import glob # Scripts whose names end in a-z or 1-9 (avoids emacs backup files) scripts = glob('scripts/*[a-z,1-9]') setup(name='vasputil', version='master', description='VASP utilities', author='Janne Blomqvist', author_email='Janne.Blomqvist@aalto.fi', url='http://github.com/jabl/vasputil', packages=['vasputil', 'vasputil.tests'], scripts = scripts)
#!/usr/bin/python from distutils.core import setup from glob import glob # Scripts whose names end in a-z or 1-9 (avoids emacs backup files) scripts = glob('scripts/*[a-z,1-9]') setup(name='vasputil', version='5.7', description='VASP utilities', author='Janne Blomqvist', author_email='Janne.Blomqvist@aalto.fi', url='http://github.com/jabl/vasputil', packages=['vasputil', 'vasputil.tests'], scripts = scripts) Change version to master branch#!/usr/bin/python from distutils.core import setup from glob import glob # Scripts whose names end in a-z or 1-9 (avoids emacs backup files) scripts = glob('scripts/*[a-z,1-9]') setup(name='vasputil', version='master', description='VASP utilities', author='Janne Blomqvist', author_email='Janne.Blomqvist@aalto.fi', url='http://github.com/jabl/vasputil', packages=['vasputil', 'vasputil.tests'], scripts = scripts)
<commit_before>#!/usr/bin/python from distutils.core import setup from glob import glob # Scripts whose names end in a-z or 1-9 (avoids emacs backup files) scripts = glob('scripts/*[a-z,1-9]') setup(name='vasputil', version='5.7', description='VASP utilities', author='Janne Blomqvist', author_email='Janne.Blomqvist@aalto.fi', url='http://github.com/jabl/vasputil', packages=['vasputil', 'vasputil.tests'], scripts = scripts) <commit_msg>Change version to master branch<commit_after>#!/usr/bin/python from distutils.core import setup from glob import glob # Scripts whose names end in a-z or 1-9 (avoids emacs backup files) scripts = glob('scripts/*[a-z,1-9]') setup(name='vasputil', version='master', description='VASP utilities', author='Janne Blomqvist', author_email='Janne.Blomqvist@aalto.fi', url='http://github.com/jabl/vasputil', packages=['vasputil', 'vasputil.tests'], scripts = scripts)
b3802d06436943c4146735c412efcf9e0f19af03
setup.py
setup.py
# coding=utf-8 from setuptools import setup, find_packages setup( name="django-celery-transactions", version="0.1.2", description="Django transaction support for Celery tasks.", long_description="See https://github.com/chrisdoble/django-celery-transactions", author="Chris Doble", author_email="chris@chrisdoble.com", url="https://github.com/chrisdoble/django-celery-transactions", license="Simplified BSD", packages=["djcelery_transactions"], install_requires=[ "celery>=2.4.2", "Django>=1.3", ], classifiers=[ "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Database", ], )
# coding=utf-8 from setuptools import setup, find_packages setup( name="django-celery-transactions", version="0.1.3", description="Django transaction support for Celery tasks.", long_description="See https://github.com/chrisdoble/django-celery-transactions", author="Chris Doble", author_email="chris@chrisdoble.com", url="https://github.com/chrisdoble/django-celery-transactions", license="Simplified BSD", packages=["djcelery_transactions"], install_requires=[ "celery>=2.2.7", "Django>=1.2.4", ], classifiers=[ "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Database", ], )
Reduce version requirements, bump to v0.1.3.
Reduce version requirements, bump to v0.1.3.
Python
bsd-2-clause
stored/django-celery-transactions,bradleyayers/django-celery-transactions,roverdotcom/django-celery-transactions,fellowshipofone/django-celery-transactions
# coding=utf-8 from setuptools import setup, find_packages setup( name="django-celery-transactions", version="0.1.2", description="Django transaction support for Celery tasks.", long_description="See https://github.com/chrisdoble/django-celery-transactions", author="Chris Doble", author_email="chris@chrisdoble.com", url="https://github.com/chrisdoble/django-celery-transactions", license="Simplified BSD", packages=["djcelery_transactions"], install_requires=[ "celery>=2.4.2", "Django>=1.3", ], classifiers=[ "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Database", ], ) Reduce version requirements, bump to v0.1.3.
# coding=utf-8 from setuptools import setup, find_packages setup( name="django-celery-transactions", version="0.1.3", description="Django transaction support for Celery tasks.", long_description="See https://github.com/chrisdoble/django-celery-transactions", author="Chris Doble", author_email="chris@chrisdoble.com", url="https://github.com/chrisdoble/django-celery-transactions", license="Simplified BSD", packages=["djcelery_transactions"], install_requires=[ "celery>=2.2.7", "Django>=1.2.4", ], classifiers=[ "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Database", ], )
<commit_before># coding=utf-8 from setuptools import setup, find_packages setup( name="django-celery-transactions", version="0.1.2", description="Django transaction support for Celery tasks.", long_description="See https://github.com/chrisdoble/django-celery-transactions", author="Chris Doble", author_email="chris@chrisdoble.com", url="https://github.com/chrisdoble/django-celery-transactions", license="Simplified BSD", packages=["djcelery_transactions"], install_requires=[ "celery>=2.4.2", "Django>=1.3", ], classifiers=[ "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Database", ], ) <commit_msg>Reduce version requirements, bump to v0.1.3.<commit_after>
# coding=utf-8 from setuptools import setup, find_packages setup( name="django-celery-transactions", version="0.1.3", description="Django transaction support for Celery tasks.", long_description="See https://github.com/chrisdoble/django-celery-transactions", author="Chris Doble", author_email="chris@chrisdoble.com", url="https://github.com/chrisdoble/django-celery-transactions", license="Simplified BSD", packages=["djcelery_transactions"], install_requires=[ "celery>=2.2.7", "Django>=1.2.4", ], classifiers=[ "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Database", ], )
# coding=utf-8 from setuptools import setup, find_packages setup( name="django-celery-transactions", version="0.1.2", description="Django transaction support for Celery tasks.", long_description="See https://github.com/chrisdoble/django-celery-transactions", author="Chris Doble", author_email="chris@chrisdoble.com", url="https://github.com/chrisdoble/django-celery-transactions", license="Simplified BSD", packages=["djcelery_transactions"], install_requires=[ "celery>=2.4.2", "Django>=1.3", ], classifiers=[ "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Database", ], ) Reduce version requirements, bump to v0.1.3.# coding=utf-8 from setuptools import setup, find_packages setup( name="django-celery-transactions", version="0.1.3", description="Django transaction support for Celery tasks.", long_description="See https://github.com/chrisdoble/django-celery-transactions", author="Chris Doble", author_email="chris@chrisdoble.com", url="https://github.com/chrisdoble/django-celery-transactions", license="Simplified BSD", packages=["djcelery_transactions"], install_requires=[ "celery>=2.2.7", "Django>=1.2.4", ], classifiers=[ "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Database", ], )
<commit_before># coding=utf-8 from setuptools import setup, find_packages setup( name="django-celery-transactions", version="0.1.2", description="Django transaction support for Celery tasks.", long_description="See https://github.com/chrisdoble/django-celery-transactions", author="Chris Doble", author_email="chris@chrisdoble.com", url="https://github.com/chrisdoble/django-celery-transactions", license="Simplified BSD", packages=["djcelery_transactions"], install_requires=[ "celery>=2.4.2", "Django>=1.3", ], classifiers=[ "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Database", ], ) <commit_msg>Reduce version requirements, bump to v0.1.3.<commit_after># coding=utf-8 from setuptools import setup, find_packages setup( name="django-celery-transactions", version="0.1.3", description="Django transaction support for Celery tasks.", long_description="See https://github.com/chrisdoble/django-celery-transactions", author="Chris Doble", author_email="chris@chrisdoble.com", url="https://github.com/chrisdoble/django-celery-transactions", license="Simplified BSD", packages=["djcelery_transactions"], install_requires=[ "celery>=2.2.7", "Django>=1.2.4", ], classifiers=[ "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Database", ], )
11d9294323bb975549608a1889e0f6616c54431d
setup.py
setup.py
import re from setuptools import setup with open('nexmo/__init__.py', 'r') as fd: version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) setup(name='nexmo', version=version, description='Nexmo Client Library for Python', long_description='This is the Python client library for Nexmo\'s API. To use it you\'ll need a Nexmo account. Sign up `for free at nexmo.com <http://nexmo.com?src=python-client-library>`_.', url='http://github.com/Nexmo/nexmo-python', author='Tim Craft', author_email='mail@timcraft.com', license='MIT', packages=['nexmo'], platforms=['any'], install_requires=['requests', 'PyJWT', 'cryptography'], classifiers=[ 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', ])
import re from setuptools import setup with open('nexmo/__init__.py', 'r') as fd: version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) setup(name='nexmo', version=version, description='Nexmo Client Library for Python', long_description='This is the Python client library for Nexmo\'s API. To use it you\'ll need a Nexmo account. Sign up `for free at nexmo.com <http://nexmo.com?src=python-client-library>`_.', url='http://github.com/Nexmo/nexmo-python', author='Tim Craft', author_email='mail@timcraft.com', license='MIT', packages=['nexmo'], platforms=['any'], install_requires=['requests', 'PyJWT', 'cryptography'], classifiers=[ 'Programming Language :: Python', 'Programming Language :: Python :: 2', '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', ])
Add Python 3.6 as a supported version.
Add Python 3.6 as a supported version.
Python
mit
Nexmo/nexmo-python
import re from setuptools import setup with open('nexmo/__init__.py', 'r') as fd: version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) setup(name='nexmo', version=version, description='Nexmo Client Library for Python', long_description='This is the Python client library for Nexmo\'s API. To use it you\'ll need a Nexmo account. Sign up `for free at nexmo.com <http://nexmo.com?src=python-client-library>`_.', url='http://github.com/Nexmo/nexmo-python', author='Tim Craft', author_email='mail@timcraft.com', license='MIT', packages=['nexmo'], platforms=['any'], install_requires=['requests', 'PyJWT', 'cryptography'], classifiers=[ 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', ]) Add Python 3.6 as a supported version.
import re from setuptools import setup with open('nexmo/__init__.py', 'r') as fd: version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) setup(name='nexmo', version=version, description='Nexmo Client Library for Python', long_description='This is the Python client library for Nexmo\'s API. To use it you\'ll need a Nexmo account. Sign up `for free at nexmo.com <http://nexmo.com?src=python-client-library>`_.', url='http://github.com/Nexmo/nexmo-python', author='Tim Craft', author_email='mail@timcraft.com', license='MIT', packages=['nexmo'], platforms=['any'], install_requires=['requests', 'PyJWT', 'cryptography'], classifiers=[ 'Programming Language :: Python', 'Programming Language :: Python :: 2', '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', ])
<commit_before>import re from setuptools import setup with open('nexmo/__init__.py', 'r') as fd: version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) setup(name='nexmo', version=version, description='Nexmo Client Library for Python', long_description='This is the Python client library for Nexmo\'s API. To use it you\'ll need a Nexmo account. Sign up `for free at nexmo.com <http://nexmo.com?src=python-client-library>`_.', url='http://github.com/Nexmo/nexmo-python', author='Tim Craft', author_email='mail@timcraft.com', license='MIT', packages=['nexmo'], platforms=['any'], install_requires=['requests', 'PyJWT', 'cryptography'], classifiers=[ 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', ]) <commit_msg>Add Python 3.6 as a supported version.<commit_after>
import re from setuptools import setup with open('nexmo/__init__.py', 'r') as fd: version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) setup(name='nexmo', version=version, description='Nexmo Client Library for Python', long_description='This is the Python client library for Nexmo\'s API. To use it you\'ll need a Nexmo account. Sign up `for free at nexmo.com <http://nexmo.com?src=python-client-library>`_.', url='http://github.com/Nexmo/nexmo-python', author='Tim Craft', author_email='mail@timcraft.com', license='MIT', packages=['nexmo'], platforms=['any'], install_requires=['requests', 'PyJWT', 'cryptography'], classifiers=[ 'Programming Language :: Python', 'Programming Language :: Python :: 2', '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', ])
import re from setuptools import setup with open('nexmo/__init__.py', 'r') as fd: version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) setup(name='nexmo', version=version, description='Nexmo Client Library for Python', long_description='This is the Python client library for Nexmo\'s API. To use it you\'ll need a Nexmo account. Sign up `for free at nexmo.com <http://nexmo.com?src=python-client-library>`_.', url='http://github.com/Nexmo/nexmo-python', author='Tim Craft', author_email='mail@timcraft.com', license='MIT', packages=['nexmo'], platforms=['any'], install_requires=['requests', 'PyJWT', 'cryptography'], classifiers=[ 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', ]) Add Python 3.6 as a supported version.import re from setuptools import setup with open('nexmo/__init__.py', 'r') as fd: version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) setup(name='nexmo', version=version, description='Nexmo Client Library for Python', long_description='This is the Python client library for Nexmo\'s API. To use it you\'ll need a Nexmo account. Sign up `for free at nexmo.com <http://nexmo.com?src=python-client-library>`_.', url='http://github.com/Nexmo/nexmo-python', author='Tim Craft', author_email='mail@timcraft.com', license='MIT', packages=['nexmo'], platforms=['any'], install_requires=['requests', 'PyJWT', 'cryptography'], classifiers=[ 'Programming Language :: Python', 'Programming Language :: Python :: 2', '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', ])
<commit_before>import re from setuptools import setup with open('nexmo/__init__.py', 'r') as fd: version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) setup(name='nexmo', version=version, description='Nexmo Client Library for Python', long_description='This is the Python client library for Nexmo\'s API. To use it you\'ll need a Nexmo account. Sign up `for free at nexmo.com <http://nexmo.com?src=python-client-library>`_.', url='http://github.com/Nexmo/nexmo-python', author='Tim Craft', author_email='mail@timcraft.com', license='MIT', packages=['nexmo'], platforms=['any'], install_requires=['requests', 'PyJWT', 'cryptography'], classifiers=[ 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', ]) <commit_msg>Add Python 3.6 as a supported version.<commit_after>import re from setuptools import setup with open('nexmo/__init__.py', 'r') as fd: version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) setup(name='nexmo', version=version, description='Nexmo Client Library for Python', long_description='This is the Python client library for Nexmo\'s API. To use it you\'ll need a Nexmo account. Sign up `for free at nexmo.com <http://nexmo.com?src=python-client-library>`_.', url='http://github.com/Nexmo/nexmo-python', author='Tim Craft', author_email='mail@timcraft.com', license='MIT', packages=['nexmo'], platforms=['any'], install_requires=['requests', 'PyJWT', 'cryptography'], classifiers=[ 'Programming Language :: Python', 'Programming Language :: Python :: 2', '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', ])
177c4d85c6110890ef1c6085bbe0fb6ae8b332a7
setup.py
setup.py
#!/usr/bin/env python from os import path from setuptools import setup, find_packages def read(name): return open(path.join(path.dirname(__file__), name)).read() setup( name='django-basic-stats', description=("django-basic-stats is a simple traffic statistics application. " "It show latest referrer, google queried terms or overall hits count. " "It also provides optional logging and statistics for mobile devices."), long_description=read("README.rst"), version='0.1', maintainer="Piotr Malinski", maintainer_email="riklaunim@gmail.com", install_requires=( 'django', ), packages=find_packages(), )
#!/usr/bin/env python from os import path from setuptools import setup, find_packages def read(name): return open(path.join(path.dirname(__file__), name)).read() setup( name='django-basic-stats', description=("django-basic-stats is a simple traffic statistics application. " "It show latest referrer, google queried terms or overall hits count. " "It also provides optional logging and statistics for mobile devices."), long_description=read("README.rst"), version='0.1', maintainer="Piotr Malinski", maintainer_email="riklaunim@gmail.com", include_package_data=True, install_requires=( 'django', ), packages=find_packages(), )
Install templates with the egg.
Install templates with the egg.
Python
mit
riklaunim/django-basic-stats,riklaunim/django-basic-stats
#!/usr/bin/env python from os import path from setuptools import setup, find_packages def read(name): return open(path.join(path.dirname(__file__), name)).read() setup( name='django-basic-stats', description=("django-basic-stats is a simple traffic statistics application. " "It show latest referrer, google queried terms or overall hits count. " "It also provides optional logging and statistics for mobile devices."), long_description=read("README.rst"), version='0.1', maintainer="Piotr Malinski", maintainer_email="riklaunim@gmail.com", install_requires=( 'django', ), packages=find_packages(), ) Install templates with the egg.
#!/usr/bin/env python from os import path from setuptools import setup, find_packages def read(name): return open(path.join(path.dirname(__file__), name)).read() setup( name='django-basic-stats', description=("django-basic-stats is a simple traffic statistics application. " "It show latest referrer, google queried terms or overall hits count. " "It also provides optional logging and statistics for mobile devices."), long_description=read("README.rst"), version='0.1', maintainer="Piotr Malinski", maintainer_email="riklaunim@gmail.com", include_package_data=True, install_requires=( 'django', ), packages=find_packages(), )
<commit_before>#!/usr/bin/env python from os import path from setuptools import setup, find_packages def read(name): return open(path.join(path.dirname(__file__), name)).read() setup( name='django-basic-stats', description=("django-basic-stats is a simple traffic statistics application. " "It show latest referrer, google queried terms or overall hits count. " "It also provides optional logging and statistics for mobile devices."), long_description=read("README.rst"), version='0.1', maintainer="Piotr Malinski", maintainer_email="riklaunim@gmail.com", install_requires=( 'django', ), packages=find_packages(), ) <commit_msg>Install templates with the egg.<commit_after>
#!/usr/bin/env python from os import path from setuptools import setup, find_packages def read(name): return open(path.join(path.dirname(__file__), name)).read() setup( name='django-basic-stats', description=("django-basic-stats is a simple traffic statistics application. " "It show latest referrer, google queried terms or overall hits count. " "It also provides optional logging and statistics for mobile devices."), long_description=read("README.rst"), version='0.1', maintainer="Piotr Malinski", maintainer_email="riklaunim@gmail.com", include_package_data=True, install_requires=( 'django', ), packages=find_packages(), )
#!/usr/bin/env python from os import path from setuptools import setup, find_packages def read(name): return open(path.join(path.dirname(__file__), name)).read() setup( name='django-basic-stats', description=("django-basic-stats is a simple traffic statistics application. " "It show latest referrer, google queried terms or overall hits count. " "It also provides optional logging and statistics for mobile devices."), long_description=read("README.rst"), version='0.1', maintainer="Piotr Malinski", maintainer_email="riklaunim@gmail.com", install_requires=( 'django', ), packages=find_packages(), ) Install templates with the egg.#!/usr/bin/env python from os import path from setuptools import setup, find_packages def read(name): return open(path.join(path.dirname(__file__), name)).read() setup( name='django-basic-stats', description=("django-basic-stats is a simple traffic statistics application. " "It show latest referrer, google queried terms or overall hits count. " "It also provides optional logging and statistics for mobile devices."), long_description=read("README.rst"), version='0.1', maintainer="Piotr Malinski", maintainer_email="riklaunim@gmail.com", include_package_data=True, install_requires=( 'django', ), packages=find_packages(), )
<commit_before>#!/usr/bin/env python from os import path from setuptools import setup, find_packages def read(name): return open(path.join(path.dirname(__file__), name)).read() setup( name='django-basic-stats', description=("django-basic-stats is a simple traffic statistics application. " "It show latest referrer, google queried terms or overall hits count. " "It also provides optional logging and statistics for mobile devices."), long_description=read("README.rst"), version='0.1', maintainer="Piotr Malinski", maintainer_email="riklaunim@gmail.com", install_requires=( 'django', ), packages=find_packages(), ) <commit_msg>Install templates with the egg.<commit_after>#!/usr/bin/env python from os import path from setuptools import setup, find_packages def read(name): return open(path.join(path.dirname(__file__), name)).read() setup( name='django-basic-stats', description=("django-basic-stats is a simple traffic statistics application. " "It show latest referrer, google queried terms or overall hits count. " "It also provides optional logging and statistics for mobile devices."), long_description=read("README.rst"), version='0.1', maintainer="Piotr Malinski", maintainer_email="riklaunim@gmail.com", include_package_data=True, install_requires=( 'django', ), packages=find_packages(), )
bd5c1416f356382e5e5b991c29fd0876c845e206
setup.py
setup.py
from setuptools import setup with open('README.rst') as f: long_desc = f.read() setup( name='ttrss-python', version='0.4', description='A client library for the Tiny Tiny RSS web API', long_description=long_desc, url='https://github.com/Vassius/ttrss-python', author='Markus Wiik', author_email='vassius@gmail.com', packages=['ttrss'], package_data={'': ['README.rst']}, include_package_data=True, install_requires=['requests>=1.1.0'], provides=['ttrss'], classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2.7', 'Topic :: Internet :: WWW/HTTP', ], )
from setuptools import setup with open('README.rst') as f: long_desc = f.read() setup( name='ttrss-python', version='0.5', description='A client library for the Tiny Tiny RSS web API', long_description=long_desc, url='https://github.com/Vassius/ttrss-python', author='Markus Wiik', author_email='vassius@gmail.com', packages=['ttrss'], package_data={'': ['README.rst']}, include_package_data=True, install_requires=['requests>=1.1.0'], provides=['ttrss'], classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2.7', 'Topic :: Internet :: WWW/HTTP', ], )
Bump version number to 0.5
Bump version number to 0.5
Python
mit
Vassius/ttrss-python
from setuptools import setup with open('README.rst') as f: long_desc = f.read() setup( name='ttrss-python', version='0.4', description='A client library for the Tiny Tiny RSS web API', long_description=long_desc, url='https://github.com/Vassius/ttrss-python', author='Markus Wiik', author_email='vassius@gmail.com', packages=['ttrss'], package_data={'': ['README.rst']}, include_package_data=True, install_requires=['requests>=1.1.0'], provides=['ttrss'], classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2.7', 'Topic :: Internet :: WWW/HTTP', ], ) Bump version number to 0.5
from setuptools import setup with open('README.rst') as f: long_desc = f.read() setup( name='ttrss-python', version='0.5', description='A client library for the Tiny Tiny RSS web API', long_description=long_desc, url='https://github.com/Vassius/ttrss-python', author='Markus Wiik', author_email='vassius@gmail.com', packages=['ttrss'], package_data={'': ['README.rst']}, include_package_data=True, install_requires=['requests>=1.1.0'], provides=['ttrss'], classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2.7', 'Topic :: Internet :: WWW/HTTP', ], )
<commit_before>from setuptools import setup with open('README.rst') as f: long_desc = f.read() setup( name='ttrss-python', version='0.4', description='A client library for the Tiny Tiny RSS web API', long_description=long_desc, url='https://github.com/Vassius/ttrss-python', author='Markus Wiik', author_email='vassius@gmail.com', packages=['ttrss'], package_data={'': ['README.rst']}, include_package_data=True, install_requires=['requests>=1.1.0'], provides=['ttrss'], classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2.7', 'Topic :: Internet :: WWW/HTTP', ], ) <commit_msg>Bump version number to 0.5<commit_after>
from setuptools import setup with open('README.rst') as f: long_desc = f.read() setup( name='ttrss-python', version='0.5', description='A client library for the Tiny Tiny RSS web API', long_description=long_desc, url='https://github.com/Vassius/ttrss-python', author='Markus Wiik', author_email='vassius@gmail.com', packages=['ttrss'], package_data={'': ['README.rst']}, include_package_data=True, install_requires=['requests>=1.1.0'], provides=['ttrss'], classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2.7', 'Topic :: Internet :: WWW/HTTP', ], )
from setuptools import setup with open('README.rst') as f: long_desc = f.read() setup( name='ttrss-python', version='0.4', description='A client library for the Tiny Tiny RSS web API', long_description=long_desc, url='https://github.com/Vassius/ttrss-python', author='Markus Wiik', author_email='vassius@gmail.com', packages=['ttrss'], package_data={'': ['README.rst']}, include_package_data=True, install_requires=['requests>=1.1.0'], provides=['ttrss'], classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2.7', 'Topic :: Internet :: WWW/HTTP', ], ) Bump version number to 0.5from setuptools import setup with open('README.rst') as f: long_desc = f.read() setup( name='ttrss-python', version='0.5', description='A client library for the Tiny Tiny RSS web API', long_description=long_desc, url='https://github.com/Vassius/ttrss-python', author='Markus Wiik', author_email='vassius@gmail.com', packages=['ttrss'], package_data={'': ['README.rst']}, include_package_data=True, install_requires=['requests>=1.1.0'], provides=['ttrss'], classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2.7', 'Topic :: Internet :: WWW/HTTP', ], )
<commit_before>from setuptools import setup with open('README.rst') as f: long_desc = f.read() setup( name='ttrss-python', version='0.4', description='A client library for the Tiny Tiny RSS web API', long_description=long_desc, url='https://github.com/Vassius/ttrss-python', author='Markus Wiik', author_email='vassius@gmail.com', packages=['ttrss'], package_data={'': ['README.rst']}, include_package_data=True, install_requires=['requests>=1.1.0'], provides=['ttrss'], classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2.7', 'Topic :: Internet :: WWW/HTTP', ], ) <commit_msg>Bump version number to 0.5<commit_after>from setuptools import setup with open('README.rst') as f: long_desc = f.read() setup( name='ttrss-python', version='0.5', description='A client library for the Tiny Tiny RSS web API', long_description=long_desc, url='https://github.com/Vassius/ttrss-python', author='Markus Wiik', author_email='vassius@gmail.com', packages=['ttrss'], package_data={'': ['README.rst']}, include_package_data=True, install_requires=['requests>=1.1.0'], provides=['ttrss'], classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2.7', 'Topic :: Internet :: WWW/HTTP', ], )
b9dd839b2b5287ba31416ef4e3746dc46bd812c2
setup.py
setup.py
# -*- coding: utf-8 -*- import os from setuptools import setup def read(fname): try: return open(os.path.join(os.path.dirname(__file__), fname)).read() except Exception: return "" setup( name="todoist-python", version="8.1.2", packages=["todoist", "todoist.managers"], author="Doist Team", author_email="info@todoist.com", license="BSD", description="todoist-python - The official Todoist Python API library", long_description=read("README.md"), install_requires=[ "requests", "typing;python_version<'3.5'", ], # see here for complete list of classifiers # http://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=( "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python", ), )
# -*- coding: utf-8 -*- import os from setuptools import setup def read(fname): try: return open(os.path.join(os.path.dirname(__file__), fname)).read() except Exception: return "" setup( name="todoist-python", version="8.1.3", packages=["todoist", "todoist.managers"], author="Doist Team", author_email="integrations@todoist.com", license="BSD", description="todoist-python - The official Todoist Python API library", long_description=read("README.md"), install_requires=[ "requests", "typing;python_version<'3.5'", ], # see here for complete list of classifiers # http://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=( "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python", ), )
Update the author name and bump version
Update the author name and bump version This new version should fix the problem of installing `typing`.
Python
mit
Doist/todoist-python
# -*- coding: utf-8 -*- import os from setuptools import setup def read(fname): try: return open(os.path.join(os.path.dirname(__file__), fname)).read() except Exception: return "" setup( name="todoist-python", version="8.1.2", packages=["todoist", "todoist.managers"], author="Doist Team", author_email="info@todoist.com", license="BSD", description="todoist-python - The official Todoist Python API library", long_description=read("README.md"), install_requires=[ "requests", "typing;python_version<'3.5'", ], # see here for complete list of classifiers # http://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=( "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python", ), ) Update the author name and bump version This new version should fix the problem of installing `typing`.
# -*- coding: utf-8 -*- import os from setuptools import setup def read(fname): try: return open(os.path.join(os.path.dirname(__file__), fname)).read() except Exception: return "" setup( name="todoist-python", version="8.1.3", packages=["todoist", "todoist.managers"], author="Doist Team", author_email="integrations@todoist.com", license="BSD", description="todoist-python - The official Todoist Python API library", long_description=read("README.md"), install_requires=[ "requests", "typing;python_version<'3.5'", ], # see here for complete list of classifiers # http://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=( "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python", ), )
<commit_before># -*- coding: utf-8 -*- import os from setuptools import setup def read(fname): try: return open(os.path.join(os.path.dirname(__file__), fname)).read() except Exception: return "" setup( name="todoist-python", version="8.1.2", packages=["todoist", "todoist.managers"], author="Doist Team", author_email="info@todoist.com", license="BSD", description="todoist-python - The official Todoist Python API library", long_description=read("README.md"), install_requires=[ "requests", "typing;python_version<'3.5'", ], # see here for complete list of classifiers # http://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=( "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python", ), ) <commit_msg>Update the author name and bump version This new version should fix the problem of installing `typing`.<commit_after>
# -*- coding: utf-8 -*- import os from setuptools import setup def read(fname): try: return open(os.path.join(os.path.dirname(__file__), fname)).read() except Exception: return "" setup( name="todoist-python", version="8.1.3", packages=["todoist", "todoist.managers"], author="Doist Team", author_email="integrations@todoist.com", license="BSD", description="todoist-python - The official Todoist Python API library", long_description=read("README.md"), install_requires=[ "requests", "typing;python_version<'3.5'", ], # see here for complete list of classifiers # http://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=( "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python", ), )
# -*- coding: utf-8 -*- import os from setuptools import setup def read(fname): try: return open(os.path.join(os.path.dirname(__file__), fname)).read() except Exception: return "" setup( name="todoist-python", version="8.1.2", packages=["todoist", "todoist.managers"], author="Doist Team", author_email="info@todoist.com", license="BSD", description="todoist-python - The official Todoist Python API library", long_description=read("README.md"), install_requires=[ "requests", "typing;python_version<'3.5'", ], # see here for complete list of classifiers # http://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=( "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python", ), ) Update the author name and bump version This new version should fix the problem of installing `typing`.# -*- coding: utf-8 -*- import os from setuptools import setup def read(fname): try: return open(os.path.join(os.path.dirname(__file__), fname)).read() except Exception: return "" setup( name="todoist-python", version="8.1.3", packages=["todoist", "todoist.managers"], author="Doist Team", author_email="integrations@todoist.com", license="BSD", description="todoist-python - The official Todoist Python API library", long_description=read("README.md"), install_requires=[ "requests", "typing;python_version<'3.5'", ], # see here for complete list of classifiers # http://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=( "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python", ), )
<commit_before># -*- coding: utf-8 -*- import os from setuptools import setup def read(fname): try: return open(os.path.join(os.path.dirname(__file__), fname)).read() except Exception: return "" setup( name="todoist-python", version="8.1.2", packages=["todoist", "todoist.managers"], author="Doist Team", author_email="info@todoist.com", license="BSD", description="todoist-python - The official Todoist Python API library", long_description=read("README.md"), install_requires=[ "requests", "typing;python_version<'3.5'", ], # see here for complete list of classifiers # http://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=( "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python", ), ) <commit_msg>Update the author name and bump version This new version should fix the problem of installing `typing`.<commit_after># -*- coding: utf-8 -*- import os from setuptools import setup def read(fname): try: return open(os.path.join(os.path.dirname(__file__), fname)).read() except Exception: return "" setup( name="todoist-python", version="8.1.3", packages=["todoist", "todoist.managers"], author="Doist Team", author_email="integrations@todoist.com", license="BSD", description="todoist-python - The official Todoist Python API library", long_description=read("README.md"), install_requires=[ "requests", "typing;python_version<'3.5'", ], # see here for complete list of classifiers # http://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=( "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python", ), )
63c8f5f56c9fc14258be62be41a42525cd616a81
setup.py
setup.py
from distutils.core import setup setup( name='docker-pipeline', version='1.0.0', packages=[''], url='https://github.com/Duke-GCB/docker-pipeline', license='MIT', author='dcl9', author_email='dan.leehr@duke.edu', description='Run docker containers in sequence, for reproducible computational analysis pipelines ' )
from distutils.core import setup setup( name='docker-pipeline', version='1.0.0', packages=[''], package_data={'': ['docker-pipeline-wrapper.sh']}, include_package_data=True, url='https://github.com/Duke-GCB/docker-pipeline', license='MIT', author='dcl9', author_email='dan.leehr@duke.edu', description='Run docker containers in sequence, for reproducible computational analysis pipelines ' )
Include wrapper script in dist
Include wrapper script in dist
Python
mit
Duke-GCB/docker-pipeline,Duke-GCB/docker-pipeline
from distutils.core import setup setup( name='docker-pipeline', version='1.0.0', packages=[''], url='https://github.com/Duke-GCB/docker-pipeline', license='MIT', author='dcl9', author_email='dan.leehr@duke.edu', description='Run docker containers in sequence, for reproducible computational analysis pipelines ' ) Include wrapper script in dist
from distutils.core import setup setup( name='docker-pipeline', version='1.0.0', packages=[''], package_data={'': ['docker-pipeline-wrapper.sh']}, include_package_data=True, url='https://github.com/Duke-GCB/docker-pipeline', license='MIT', author='dcl9', author_email='dan.leehr@duke.edu', description='Run docker containers in sequence, for reproducible computational analysis pipelines ' )
<commit_before>from distutils.core import setup setup( name='docker-pipeline', version='1.0.0', packages=[''], url='https://github.com/Duke-GCB/docker-pipeline', license='MIT', author='dcl9', author_email='dan.leehr@duke.edu', description='Run docker containers in sequence, for reproducible computational analysis pipelines ' ) <commit_msg>Include wrapper script in dist<commit_after>
from distutils.core import setup setup( name='docker-pipeline', version='1.0.0', packages=[''], package_data={'': ['docker-pipeline-wrapper.sh']}, include_package_data=True, url='https://github.com/Duke-GCB/docker-pipeline', license='MIT', author='dcl9', author_email='dan.leehr@duke.edu', description='Run docker containers in sequence, for reproducible computational analysis pipelines ' )
from distutils.core import setup setup( name='docker-pipeline', version='1.0.0', packages=[''], url='https://github.com/Duke-GCB/docker-pipeline', license='MIT', author='dcl9', author_email='dan.leehr@duke.edu', description='Run docker containers in sequence, for reproducible computational analysis pipelines ' ) Include wrapper script in distfrom distutils.core import setup setup( name='docker-pipeline', version='1.0.0', packages=[''], package_data={'': ['docker-pipeline-wrapper.sh']}, include_package_data=True, url='https://github.com/Duke-GCB/docker-pipeline', license='MIT', author='dcl9', author_email='dan.leehr@duke.edu', description='Run docker containers in sequence, for reproducible computational analysis pipelines ' )
<commit_before>from distutils.core import setup setup( name='docker-pipeline', version='1.0.0', packages=[''], url='https://github.com/Duke-GCB/docker-pipeline', license='MIT', author='dcl9', author_email='dan.leehr@duke.edu', description='Run docker containers in sequence, for reproducible computational analysis pipelines ' ) <commit_msg>Include wrapper script in dist<commit_after>from distutils.core import setup setup( name='docker-pipeline', version='1.0.0', packages=[''], package_data={'': ['docker-pipeline-wrapper.sh']}, include_package_data=True, url='https://github.com/Duke-GCB/docker-pipeline', license='MIT', author='dcl9', author_email='dan.leehr@duke.edu', description='Run docker containers in sequence, for reproducible computational analysis pipelines ' )
4e4ea022b75a9c0208a2ae9560ffb7fc5d306381
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup, find_packages from distutils.core import Extension VERSION = '1.0.5' LONG_DESCRIPTION = """ A numerical geometric algebra module for python. BSD License. """ setup(name='clifford', version=VERSION, license='bsd', description='Numerical Geometric Algebra Module', long_description=LONG_DESCRIPTION, author='Robert Kern', author_email='alexarsenovic@gmail.com', url='http://clifford.readthedocs.io', packages=find_packages(), install_requires = [ 'numpy', 'scipy', 'numba==0.45.1', 'future', 'h5py' ], package_dir={'clifford':'clifford'}, )
#!/usr/bin/env python from setuptools import setup, find_packages from distutils.core import Extension VERSION = '1.0.5' LONG_DESCRIPTION = """ A numerical geometric algebra module for python. BSD License. """ setup( name='clifford', version=VERSION, license='bsd', description='Numerical Geometric Algebra Module', long_description=LONG_DESCRIPTION, author='Robert Kern', author_email='alexarsenovic@gmail.com', url='http://clifford.readthedocs.io', packages=find_packages(), install_requires=[ 'numpy', 'scipy', 'numba==0.45.1', 'future', 'h5py' ], package_dir={'clifford':'clifford'}, classifiers=[ 'Intended Audience :: Science/Research', 'Topic :: Scientific/Engineering :: Mathematics', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', ], python_requires='>=3.5', )
Add PyPI classifiers and python_requires
Add PyPI classifiers and python_requires
Python
bsd-3-clause
arsenovic/clifford,arsenovic/clifford
#!/usr/bin/env python from setuptools import setup, find_packages from distutils.core import Extension VERSION = '1.0.5' LONG_DESCRIPTION = """ A numerical geometric algebra module for python. BSD License. """ setup(name='clifford', version=VERSION, license='bsd', description='Numerical Geometric Algebra Module', long_description=LONG_DESCRIPTION, author='Robert Kern', author_email='alexarsenovic@gmail.com', url='http://clifford.readthedocs.io', packages=find_packages(), install_requires = [ 'numpy', 'scipy', 'numba==0.45.1', 'future', 'h5py' ], package_dir={'clifford':'clifford'}, ) Add PyPI classifiers and python_requires
#!/usr/bin/env python from setuptools import setup, find_packages from distutils.core import Extension VERSION = '1.0.5' LONG_DESCRIPTION = """ A numerical geometric algebra module for python. BSD License. """ setup( name='clifford', version=VERSION, license='bsd', description='Numerical Geometric Algebra Module', long_description=LONG_DESCRIPTION, author='Robert Kern', author_email='alexarsenovic@gmail.com', url='http://clifford.readthedocs.io', packages=find_packages(), install_requires=[ 'numpy', 'scipy', 'numba==0.45.1', 'future', 'h5py' ], package_dir={'clifford':'clifford'}, classifiers=[ 'Intended Audience :: Science/Research', 'Topic :: Scientific/Engineering :: Mathematics', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', ], python_requires='>=3.5', )
<commit_before>#!/usr/bin/env python from setuptools import setup, find_packages from distutils.core import Extension VERSION = '1.0.5' LONG_DESCRIPTION = """ A numerical geometric algebra module for python. BSD License. """ setup(name='clifford', version=VERSION, license='bsd', description='Numerical Geometric Algebra Module', long_description=LONG_DESCRIPTION, author='Robert Kern', author_email='alexarsenovic@gmail.com', url='http://clifford.readthedocs.io', packages=find_packages(), install_requires = [ 'numpy', 'scipy', 'numba==0.45.1', 'future', 'h5py' ], package_dir={'clifford':'clifford'}, ) <commit_msg>Add PyPI classifiers and python_requires<commit_after>
#!/usr/bin/env python from setuptools import setup, find_packages from distutils.core import Extension VERSION = '1.0.5' LONG_DESCRIPTION = """ A numerical geometric algebra module for python. BSD License. """ setup( name='clifford', version=VERSION, license='bsd', description='Numerical Geometric Algebra Module', long_description=LONG_DESCRIPTION, author='Robert Kern', author_email='alexarsenovic@gmail.com', url='http://clifford.readthedocs.io', packages=find_packages(), install_requires=[ 'numpy', 'scipy', 'numba==0.45.1', 'future', 'h5py' ], package_dir={'clifford':'clifford'}, classifiers=[ 'Intended Audience :: Science/Research', 'Topic :: Scientific/Engineering :: Mathematics', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', ], python_requires='>=3.5', )
#!/usr/bin/env python from setuptools import setup, find_packages from distutils.core import Extension VERSION = '1.0.5' LONG_DESCRIPTION = """ A numerical geometric algebra module for python. BSD License. """ setup(name='clifford', version=VERSION, license='bsd', description='Numerical Geometric Algebra Module', long_description=LONG_DESCRIPTION, author='Robert Kern', author_email='alexarsenovic@gmail.com', url='http://clifford.readthedocs.io', packages=find_packages(), install_requires = [ 'numpy', 'scipy', 'numba==0.45.1', 'future', 'h5py' ], package_dir={'clifford':'clifford'}, ) Add PyPI classifiers and python_requires#!/usr/bin/env python from setuptools import setup, find_packages from distutils.core import Extension VERSION = '1.0.5' LONG_DESCRIPTION = """ A numerical geometric algebra module for python. BSD License. """ setup( name='clifford', version=VERSION, license='bsd', description='Numerical Geometric Algebra Module', long_description=LONG_DESCRIPTION, author='Robert Kern', author_email='alexarsenovic@gmail.com', url='http://clifford.readthedocs.io', packages=find_packages(), install_requires=[ 'numpy', 'scipy', 'numba==0.45.1', 'future', 'h5py' ], package_dir={'clifford':'clifford'}, classifiers=[ 'Intended Audience :: Science/Research', 'Topic :: Scientific/Engineering :: Mathematics', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', ], python_requires='>=3.5', )
<commit_before>#!/usr/bin/env python from setuptools import setup, find_packages from distutils.core import Extension VERSION = '1.0.5' LONG_DESCRIPTION = """ A numerical geometric algebra module for python. BSD License. """ setup(name='clifford', version=VERSION, license='bsd', description='Numerical Geometric Algebra Module', long_description=LONG_DESCRIPTION, author='Robert Kern', author_email='alexarsenovic@gmail.com', url='http://clifford.readthedocs.io', packages=find_packages(), install_requires = [ 'numpy', 'scipy', 'numba==0.45.1', 'future', 'h5py' ], package_dir={'clifford':'clifford'}, ) <commit_msg>Add PyPI classifiers and python_requires<commit_after>#!/usr/bin/env python from setuptools import setup, find_packages from distutils.core import Extension VERSION = '1.0.5' LONG_DESCRIPTION = """ A numerical geometric algebra module for python. BSD License. """ setup( name='clifford', version=VERSION, license='bsd', description='Numerical Geometric Algebra Module', long_description=LONG_DESCRIPTION, author='Robert Kern', author_email='alexarsenovic@gmail.com', url='http://clifford.readthedocs.io', packages=find_packages(), install_requires=[ 'numpy', 'scipy', 'numba==0.45.1', 'future', 'h5py' ], package_dir={'clifford':'clifford'}, classifiers=[ 'Intended Audience :: Science/Research', 'Topic :: Scientific/Engineering :: Mathematics', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', ], python_requires='>=3.5', )
46546e0e58868ca24329073e12c744a4802b2bd5
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup import os # Utility function to read README file def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name='iss', version='2.7.1', description="Ideally Single Source app for MemberSuite data.", author='AASHE', author_email='it@aashe.org', url='https://github.com/aashe/iss', long_description=read("README.md"), packages=[ 'iss', ], include_package_data=True, classifiers=[ 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Framework :: Django', ], install_requires=[ "beatbox==32.1", "membersuite_api_client==0.4.4", "pycountry", "pyYAML==3.12", ] )
#!/usr/bin/env python from setuptools import setup import os # Utility function to read README file def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name='iss', version='2.7.1', description="Ideally Single Source app for MemberSuite data.", author='AASHE', author_email='it@aashe.org', url='https://github.com/aashe/iss', long_description=read("README.md"), packages=[ 'iss', ], include_package_data=True, classifiers=[ 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Framework :: Django', ], install_requires=[ "beatbox==32.1", "membersuite_api_client==0.4.6", "pycountry", "pyYAML==3.12", ] )
Upgrade to v0.4.6 of membersuire_api_client
Upgrade to v0.4.6 of membersuire_api_client
Python
mit
AASHE/iss
#!/usr/bin/env python from setuptools import setup import os # Utility function to read README file def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name='iss', version='2.7.1', description="Ideally Single Source app for MemberSuite data.", author='AASHE', author_email='it@aashe.org', url='https://github.com/aashe/iss', long_description=read("README.md"), packages=[ 'iss', ], include_package_data=True, classifiers=[ 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Framework :: Django', ], install_requires=[ "beatbox==32.1", "membersuite_api_client==0.4.4", "pycountry", "pyYAML==3.12", ] ) Upgrade to v0.4.6 of membersuire_api_client
#!/usr/bin/env python from setuptools import setup import os # Utility function to read README file def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name='iss', version='2.7.1', description="Ideally Single Source app for MemberSuite data.", author='AASHE', author_email='it@aashe.org', url='https://github.com/aashe/iss', long_description=read("README.md"), packages=[ 'iss', ], include_package_data=True, classifiers=[ 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Framework :: Django', ], install_requires=[ "beatbox==32.1", "membersuite_api_client==0.4.6", "pycountry", "pyYAML==3.12", ] )
<commit_before>#!/usr/bin/env python from setuptools import setup import os # Utility function to read README file def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name='iss', version='2.7.1', description="Ideally Single Source app for MemberSuite data.", author='AASHE', author_email='it@aashe.org', url='https://github.com/aashe/iss', long_description=read("README.md"), packages=[ 'iss', ], include_package_data=True, classifiers=[ 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Framework :: Django', ], install_requires=[ "beatbox==32.1", "membersuite_api_client==0.4.4", "pycountry", "pyYAML==3.12", ] ) <commit_msg>Upgrade to v0.4.6 of membersuire_api_client<commit_after>
#!/usr/bin/env python from setuptools import setup import os # Utility function to read README file def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name='iss', version='2.7.1', description="Ideally Single Source app for MemberSuite data.", author='AASHE', author_email='it@aashe.org', url='https://github.com/aashe/iss', long_description=read("README.md"), packages=[ 'iss', ], include_package_data=True, classifiers=[ 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Framework :: Django', ], install_requires=[ "beatbox==32.1", "membersuite_api_client==0.4.6", "pycountry", "pyYAML==3.12", ] )
#!/usr/bin/env python from setuptools import setup import os # Utility function to read README file def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name='iss', version='2.7.1', description="Ideally Single Source app for MemberSuite data.", author='AASHE', author_email='it@aashe.org', url='https://github.com/aashe/iss', long_description=read("README.md"), packages=[ 'iss', ], include_package_data=True, classifiers=[ 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Framework :: Django', ], install_requires=[ "beatbox==32.1", "membersuite_api_client==0.4.4", "pycountry", "pyYAML==3.12", ] ) Upgrade to v0.4.6 of membersuire_api_client#!/usr/bin/env python from setuptools import setup import os # Utility function to read README file def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name='iss', version='2.7.1', description="Ideally Single Source app for MemberSuite data.", author='AASHE', author_email='it@aashe.org', url='https://github.com/aashe/iss', long_description=read("README.md"), packages=[ 'iss', ], include_package_data=True, classifiers=[ 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Framework :: Django', ], install_requires=[ "beatbox==32.1", "membersuite_api_client==0.4.6", "pycountry", "pyYAML==3.12", ] )
<commit_before>#!/usr/bin/env python from setuptools import setup import os # Utility function to read README file def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name='iss', version='2.7.1', description="Ideally Single Source app for MemberSuite data.", author='AASHE', author_email='it@aashe.org', url='https://github.com/aashe/iss', long_description=read("README.md"), packages=[ 'iss', ], include_package_data=True, classifiers=[ 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Framework :: Django', ], install_requires=[ "beatbox==32.1", "membersuite_api_client==0.4.4", "pycountry", "pyYAML==3.12", ] ) <commit_msg>Upgrade to v0.4.6 of membersuire_api_client<commit_after>#!/usr/bin/env python from setuptools import setup import os # Utility function to read README file def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name='iss', version='2.7.1', description="Ideally Single Source app for MemberSuite data.", author='AASHE', author_email='it@aashe.org', url='https://github.com/aashe/iss', long_description=read("README.md"), packages=[ 'iss', ], include_package_data=True, classifiers=[ 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Framework :: Django', ], install_requires=[ "beatbox==32.1", "membersuite_api_client==0.4.6", "pycountry", "pyYAML==3.12", ] )
1b805f4b288c8336512c8b195de645e50e04a414
setup.py
setup.py
#!/usr/bin/env python # coding=utf8 import os from setuptools import setup, find_packages def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup(name='legitfs', version='0.4.dev1', description=('A read-only FUSE-based filesystem allowing you to browse ' 'git repositories'), long_description=read('README.rst'), keywords='git,fuse,filesystem,fs,read-only,readonly,legit,legitfs', author='Marc Brinkmann', author_email='git@marcbrinkmann.de', url='http://github.com/mbr/legitfs', license='MIT', packages=find_packages(exclude=['tests']), install_requires=['dulwich', 'fusepy', 'click', 'logbook'], entry_points={ 'console_scripts': [ 'legitfs = legitfs.cli:main', ] })
#!/usr/bin/env python # coding=utf8 import os from setuptools import setup, find_packages def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup(name='legitfs', version='0.4.0.0dev', description=('A read-only FUSE-based filesystem allowing you to browse ' 'git repositories'), long_description=read('README.rst'), keywords='git,fuse,filesystem,fs,read-only,readonly,legit,legitfs', author='Marc Brinkmann', author_email='git@marcbrinkmann.de', url='http://github.com/mbr/legitfs', license='MIT', packages=find_packages(exclude=['tests']), install_requires=['dulwich', 'fusepy', 'click', 'logbook'], entry_points={ 'console_scripts': [ 'legitfs = legitfs.cli:main', ] })
Switch version to semantic versioning.
Switch version to semantic versioning.
Python
mit
mbr/legitfs
#!/usr/bin/env python # coding=utf8 import os from setuptools import setup, find_packages def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup(name='legitfs', version='0.4.dev1', description=('A read-only FUSE-based filesystem allowing you to browse ' 'git repositories'), long_description=read('README.rst'), keywords='git,fuse,filesystem,fs,read-only,readonly,legit,legitfs', author='Marc Brinkmann', author_email='git@marcbrinkmann.de', url='http://github.com/mbr/legitfs', license='MIT', packages=find_packages(exclude=['tests']), install_requires=['dulwich', 'fusepy', 'click', 'logbook'], entry_points={ 'console_scripts': [ 'legitfs = legitfs.cli:main', ] }) Switch version to semantic versioning.
#!/usr/bin/env python # coding=utf8 import os from setuptools import setup, find_packages def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup(name='legitfs', version='0.4.0.0dev', description=('A read-only FUSE-based filesystem allowing you to browse ' 'git repositories'), long_description=read('README.rst'), keywords='git,fuse,filesystem,fs,read-only,readonly,legit,legitfs', author='Marc Brinkmann', author_email='git@marcbrinkmann.de', url='http://github.com/mbr/legitfs', license='MIT', packages=find_packages(exclude=['tests']), install_requires=['dulwich', 'fusepy', 'click', 'logbook'], entry_points={ 'console_scripts': [ 'legitfs = legitfs.cli:main', ] })
<commit_before>#!/usr/bin/env python # coding=utf8 import os from setuptools import setup, find_packages def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup(name='legitfs', version='0.4.dev1', description=('A read-only FUSE-based filesystem allowing you to browse ' 'git repositories'), long_description=read('README.rst'), keywords='git,fuse,filesystem,fs,read-only,readonly,legit,legitfs', author='Marc Brinkmann', author_email='git@marcbrinkmann.de', url='http://github.com/mbr/legitfs', license='MIT', packages=find_packages(exclude=['tests']), install_requires=['dulwich', 'fusepy', 'click', 'logbook'], entry_points={ 'console_scripts': [ 'legitfs = legitfs.cli:main', ] }) <commit_msg>Switch version to semantic versioning.<commit_after>
#!/usr/bin/env python # coding=utf8 import os from setuptools import setup, find_packages def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup(name='legitfs', version='0.4.0.0dev', description=('A read-only FUSE-based filesystem allowing you to browse ' 'git repositories'), long_description=read('README.rst'), keywords='git,fuse,filesystem,fs,read-only,readonly,legit,legitfs', author='Marc Brinkmann', author_email='git@marcbrinkmann.de', url='http://github.com/mbr/legitfs', license='MIT', packages=find_packages(exclude=['tests']), install_requires=['dulwich', 'fusepy', 'click', 'logbook'], entry_points={ 'console_scripts': [ 'legitfs = legitfs.cli:main', ] })
#!/usr/bin/env python # coding=utf8 import os from setuptools import setup, find_packages def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup(name='legitfs', version='0.4.dev1', description=('A read-only FUSE-based filesystem allowing you to browse ' 'git repositories'), long_description=read('README.rst'), keywords='git,fuse,filesystem,fs,read-only,readonly,legit,legitfs', author='Marc Brinkmann', author_email='git@marcbrinkmann.de', url='http://github.com/mbr/legitfs', license='MIT', packages=find_packages(exclude=['tests']), install_requires=['dulwich', 'fusepy', 'click', 'logbook'], entry_points={ 'console_scripts': [ 'legitfs = legitfs.cli:main', ] }) Switch version to semantic versioning.#!/usr/bin/env python # coding=utf8 import os from setuptools import setup, find_packages def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup(name='legitfs', version='0.4.0.0dev', description=('A read-only FUSE-based filesystem allowing you to browse ' 'git repositories'), long_description=read('README.rst'), keywords='git,fuse,filesystem,fs,read-only,readonly,legit,legitfs', author='Marc Brinkmann', author_email='git@marcbrinkmann.de', url='http://github.com/mbr/legitfs', license='MIT', packages=find_packages(exclude=['tests']), install_requires=['dulwich', 'fusepy', 'click', 'logbook'], entry_points={ 'console_scripts': [ 'legitfs = legitfs.cli:main', ] })
<commit_before>#!/usr/bin/env python # coding=utf8 import os from setuptools import setup, find_packages def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup(name='legitfs', version='0.4.dev1', description=('A read-only FUSE-based filesystem allowing you to browse ' 'git repositories'), long_description=read('README.rst'), keywords='git,fuse,filesystem,fs,read-only,readonly,legit,legitfs', author='Marc Brinkmann', author_email='git@marcbrinkmann.de', url='http://github.com/mbr/legitfs', license='MIT', packages=find_packages(exclude=['tests']), install_requires=['dulwich', 'fusepy', 'click', 'logbook'], entry_points={ 'console_scripts': [ 'legitfs = legitfs.cli:main', ] }) <commit_msg>Switch version to semantic versioning.<commit_after>#!/usr/bin/env python # coding=utf8 import os from setuptools import setup, find_packages def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup(name='legitfs', version='0.4.0.0dev', description=('A read-only FUSE-based filesystem allowing you to browse ' 'git repositories'), long_description=read('README.rst'), keywords='git,fuse,filesystem,fs,read-only,readonly,legit,legitfs', author='Marc Brinkmann', author_email='git@marcbrinkmann.de', url='http://github.com/mbr/legitfs', license='MIT', packages=find_packages(exclude=['tests']), install_requires=['dulwich', 'fusepy', 'click', 'logbook'], entry_points={ 'console_scripts': [ 'legitfs = legitfs.cli:main', ] })
df038a485a2aaf80bcfbd872e94ffb87bcb5b33c
testinfra/__init__.py
testinfra/__init__.py
# coding: utf-8 # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from __future__ import unicode_literals from testinfra.host import get_host from testinfra.host import get_hosts __all__ = ['get_host', 'get_hosts']
# coding: utf-8 # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from __future__ import unicode_literals import sys from testinfra.host import get_host from testinfra.host import get_hosts __all__ = ['get_host', 'get_hosts'] if sys.version_info[0] == 2: import warnings class TestinfraDeprecationWarning(Warning): pass warnings.simplefilter("default", TestinfraDeprecationWarning) warnings.warn( 'DEPRECATION: testinfra python2 support is unmaintained, please ' 'upgrade to python3', category=TestinfraDeprecationWarning, stacklevel=1)
Add warning about unmaintained python2
Add warning about unmaintained python2
Python
apache-2.0
philpep/testinfra
# coding: utf-8 # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from __future__ import unicode_literals from testinfra.host import get_host from testinfra.host import get_hosts __all__ = ['get_host', 'get_hosts'] Add warning about unmaintained python2
# coding: utf-8 # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from __future__ import unicode_literals import sys from testinfra.host import get_host from testinfra.host import get_hosts __all__ = ['get_host', 'get_hosts'] if sys.version_info[0] == 2: import warnings class TestinfraDeprecationWarning(Warning): pass warnings.simplefilter("default", TestinfraDeprecationWarning) warnings.warn( 'DEPRECATION: testinfra python2 support is unmaintained, please ' 'upgrade to python3', category=TestinfraDeprecationWarning, stacklevel=1)
<commit_before># coding: utf-8 # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from __future__ import unicode_literals from testinfra.host import get_host from testinfra.host import get_hosts __all__ = ['get_host', 'get_hosts'] <commit_msg>Add warning about unmaintained python2<commit_after>
# coding: utf-8 # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from __future__ import unicode_literals import sys from testinfra.host import get_host from testinfra.host import get_hosts __all__ = ['get_host', 'get_hosts'] if sys.version_info[0] == 2: import warnings class TestinfraDeprecationWarning(Warning): pass warnings.simplefilter("default", TestinfraDeprecationWarning) warnings.warn( 'DEPRECATION: testinfra python2 support is unmaintained, please ' 'upgrade to python3', category=TestinfraDeprecationWarning, stacklevel=1)
# coding: utf-8 # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from __future__ import unicode_literals from testinfra.host import get_host from testinfra.host import get_hosts __all__ = ['get_host', 'get_hosts'] Add warning about unmaintained python2# coding: utf-8 # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from __future__ import unicode_literals import sys from testinfra.host import get_host from testinfra.host import get_hosts __all__ = ['get_host', 'get_hosts'] if sys.version_info[0] == 2: import warnings class TestinfraDeprecationWarning(Warning): pass warnings.simplefilter("default", TestinfraDeprecationWarning) warnings.warn( 'DEPRECATION: testinfra python2 support is unmaintained, please ' 'upgrade to python3', category=TestinfraDeprecationWarning, stacklevel=1)
<commit_before># coding: utf-8 # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from __future__ import unicode_literals from testinfra.host import get_host from testinfra.host import get_hosts __all__ = ['get_host', 'get_hosts'] <commit_msg>Add warning about unmaintained python2<commit_after># coding: utf-8 # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from __future__ import unicode_literals import sys from testinfra.host import get_host from testinfra.host import get_hosts __all__ = ['get_host', 'get_hosts'] if sys.version_info[0] == 2: import warnings class TestinfraDeprecationWarning(Warning): pass warnings.simplefilter("default", TestinfraDeprecationWarning) warnings.warn( 'DEPRECATION: testinfra python2 support is unmaintained, please ' 'upgrade to python3', category=TestinfraDeprecationWarning, stacklevel=1)
3d5d46c5b50829f8494af0be84e87867aeaff7eb
setup.py
setup.py
# -*- coding: utf-8 -*- import os from setuptools import setup def read(fname): try: return open(os.path.join(os.path.dirname(__file__), fname)).read() except: return '' setup( name='todoist-python', version='0.2.22', packages=['todoist', 'todoist.managers'], author='Doist Team', author_email='info@todoist.com', license='BSD', description='todoist-python - The official Todoist Python API library', long_description = read('README.md'), install_requires=[ 'requests', ], # see here for complete list of classifiers # http://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=( 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python', ), )
# -*- coding: utf-8 -*- import os from setuptools import setup def read(fname): try: return open(os.path.join(os.path.dirname(__file__), fname)).read() except: return '' setup( name='todoist-python', version='0.2.23', packages=['todoist', 'todoist.managers'], author='Doist Team', author_email='info@todoist.com', license='BSD', description='todoist-python - The official Todoist Python API library', long_description = read('README.md'), install_requires=[ 'requests', ], # see here for complete list of classifiers # http://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=( 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python', ), )
Update the PyPI version to 0.2.23.
Update the PyPI version to 0.2.23.
Python
mit
Doist/todoist-python
# -*- coding: utf-8 -*- import os from setuptools import setup def read(fname): try: return open(os.path.join(os.path.dirname(__file__), fname)).read() except: return '' setup( name='todoist-python', version='0.2.22', packages=['todoist', 'todoist.managers'], author='Doist Team', author_email='info@todoist.com', license='BSD', description='todoist-python - The official Todoist Python API library', long_description = read('README.md'), install_requires=[ 'requests', ], # see here for complete list of classifiers # http://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=( 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python', ), ) Update the PyPI version to 0.2.23.
# -*- coding: utf-8 -*- import os from setuptools import setup def read(fname): try: return open(os.path.join(os.path.dirname(__file__), fname)).read() except: return '' setup( name='todoist-python', version='0.2.23', packages=['todoist', 'todoist.managers'], author='Doist Team', author_email='info@todoist.com', license='BSD', description='todoist-python - The official Todoist Python API library', long_description = read('README.md'), install_requires=[ 'requests', ], # see here for complete list of classifiers # http://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=( 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python', ), )
<commit_before># -*- coding: utf-8 -*- import os from setuptools import setup def read(fname): try: return open(os.path.join(os.path.dirname(__file__), fname)).read() except: return '' setup( name='todoist-python', version='0.2.22', packages=['todoist', 'todoist.managers'], author='Doist Team', author_email='info@todoist.com', license='BSD', description='todoist-python - The official Todoist Python API library', long_description = read('README.md'), install_requires=[ 'requests', ], # see here for complete list of classifiers # http://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=( 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python', ), ) <commit_msg>Update the PyPI version to 0.2.23.<commit_after>
# -*- coding: utf-8 -*- import os from setuptools import setup def read(fname): try: return open(os.path.join(os.path.dirname(__file__), fname)).read() except: return '' setup( name='todoist-python', version='0.2.23', packages=['todoist', 'todoist.managers'], author='Doist Team', author_email='info@todoist.com', license='BSD', description='todoist-python - The official Todoist Python API library', long_description = read('README.md'), install_requires=[ 'requests', ], # see here for complete list of classifiers # http://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=( 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python', ), )
# -*- coding: utf-8 -*- import os from setuptools import setup def read(fname): try: return open(os.path.join(os.path.dirname(__file__), fname)).read() except: return '' setup( name='todoist-python', version='0.2.22', packages=['todoist', 'todoist.managers'], author='Doist Team', author_email='info@todoist.com', license='BSD', description='todoist-python - The official Todoist Python API library', long_description = read('README.md'), install_requires=[ 'requests', ], # see here for complete list of classifiers # http://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=( 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python', ), ) Update the PyPI version to 0.2.23.# -*- coding: utf-8 -*- import os from setuptools import setup def read(fname): try: return open(os.path.join(os.path.dirname(__file__), fname)).read() except: return '' setup( name='todoist-python', version='0.2.23', packages=['todoist', 'todoist.managers'], author='Doist Team', author_email='info@todoist.com', license='BSD', description='todoist-python - The official Todoist Python API library', long_description = read('README.md'), install_requires=[ 'requests', ], # see here for complete list of classifiers # http://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=( 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python', ), )
<commit_before># -*- coding: utf-8 -*- import os from setuptools import setup def read(fname): try: return open(os.path.join(os.path.dirname(__file__), fname)).read() except: return '' setup( name='todoist-python', version='0.2.22', packages=['todoist', 'todoist.managers'], author='Doist Team', author_email='info@todoist.com', license='BSD', description='todoist-python - The official Todoist Python API library', long_description = read('README.md'), install_requires=[ 'requests', ], # see here for complete list of classifiers # http://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=( 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python', ), ) <commit_msg>Update the PyPI version to 0.2.23.<commit_after># -*- coding: utf-8 -*- import os from setuptools import setup def read(fname): try: return open(os.path.join(os.path.dirname(__file__), fname)).read() except: return '' setup( name='todoist-python', version='0.2.23', packages=['todoist', 'todoist.managers'], author='Doist Team', author_email='info@todoist.com', license='BSD', description='todoist-python - The official Todoist Python API library', long_description = read('README.md'), install_requires=[ 'requests', ], # see here for complete list of classifiers # http://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=( 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python', ), )
945c731fbd956d21c810d46778b67f7c8382458f
setup.py
setup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup setup( name='Redis-Sentinel-Url', py_modules=['redis_sentinel_url'], version='1.0.0', install_requires=['redis>=2.10.3'], tests_require=['mock', 'nose'], test_suite='nose.collector', description='A factory for redis connection that supports using Redis Sentinel', url='https://github.com/exponea/redis-sentinel-url', author='Martin Sucha', author_email='martin.sucha@exponea.com', license='Apache 2.0', classifiers=[ 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Operating System :: OS Independent', 'License :: OSI Approved :: Apache Software License', 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'Topic :: Software Development :: Libraries :: Python Modules' ] )
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup setup( name='Redis-Sentinel-Url', py_modules=['redis_sentinel_url'], version='1.0.0', install_requires=['redis>=2.10.3'], tests_require=['mock', 'nose'], test_suite='nose.collector', description='A factory for redis connection that supports using Redis Sentinel', url='https://github.com/exponea/redis-sentinel-url', author='Martin Sucha', author_email='martin.sucha@exponea.com', license='Apache 2.0', classifiers=[ 'Programming Language :: Python', 'Programming Language :: Python :: 2', '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', 'Operating System :: OS Independent', 'License :: OSI Approved :: Apache Software License', 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'Topic :: Software Development :: Libraries :: Python Modules' ] )
Add Python 3.6 to classifiers
Add Python 3.6 to classifiers
Python
apache-2.0
exponea/redis-sentinel-url
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup setup( name='Redis-Sentinel-Url', py_modules=['redis_sentinel_url'], version='1.0.0', install_requires=['redis>=2.10.3'], tests_require=['mock', 'nose'], test_suite='nose.collector', description='A factory for redis connection that supports using Redis Sentinel', url='https://github.com/exponea/redis-sentinel-url', author='Martin Sucha', author_email='martin.sucha@exponea.com', license='Apache 2.0', classifiers=[ 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Operating System :: OS Independent', 'License :: OSI Approved :: Apache Software License', 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'Topic :: Software Development :: Libraries :: Python Modules' ] ) Add Python 3.6 to classifiers
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup setup( name='Redis-Sentinel-Url', py_modules=['redis_sentinel_url'], version='1.0.0', install_requires=['redis>=2.10.3'], tests_require=['mock', 'nose'], test_suite='nose.collector', description='A factory for redis connection that supports using Redis Sentinel', url='https://github.com/exponea/redis-sentinel-url', author='Martin Sucha', author_email='martin.sucha@exponea.com', license='Apache 2.0', classifiers=[ 'Programming Language :: Python', 'Programming Language :: Python :: 2', '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', 'Operating System :: OS Independent', 'License :: OSI Approved :: Apache Software License', 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'Topic :: Software Development :: Libraries :: Python Modules' ] )
<commit_before>#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup setup( name='Redis-Sentinel-Url', py_modules=['redis_sentinel_url'], version='1.0.0', install_requires=['redis>=2.10.3'], tests_require=['mock', 'nose'], test_suite='nose.collector', description='A factory for redis connection that supports using Redis Sentinel', url='https://github.com/exponea/redis-sentinel-url', author='Martin Sucha', author_email='martin.sucha@exponea.com', license='Apache 2.0', classifiers=[ 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Operating System :: OS Independent', 'License :: OSI Approved :: Apache Software License', 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'Topic :: Software Development :: Libraries :: Python Modules' ] ) <commit_msg>Add Python 3.6 to classifiers<commit_after>
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup setup( name='Redis-Sentinel-Url', py_modules=['redis_sentinel_url'], version='1.0.0', install_requires=['redis>=2.10.3'], tests_require=['mock', 'nose'], test_suite='nose.collector', description='A factory for redis connection that supports using Redis Sentinel', url='https://github.com/exponea/redis-sentinel-url', author='Martin Sucha', author_email='martin.sucha@exponea.com', license='Apache 2.0', classifiers=[ 'Programming Language :: Python', 'Programming Language :: Python :: 2', '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', 'Operating System :: OS Independent', 'License :: OSI Approved :: Apache Software License', 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'Topic :: Software Development :: Libraries :: Python Modules' ] )
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup setup( name='Redis-Sentinel-Url', py_modules=['redis_sentinel_url'], version='1.0.0', install_requires=['redis>=2.10.3'], tests_require=['mock', 'nose'], test_suite='nose.collector', description='A factory for redis connection that supports using Redis Sentinel', url='https://github.com/exponea/redis-sentinel-url', author='Martin Sucha', author_email='martin.sucha@exponea.com', license='Apache 2.0', classifiers=[ 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Operating System :: OS Independent', 'License :: OSI Approved :: Apache Software License', 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'Topic :: Software Development :: Libraries :: Python Modules' ] ) Add Python 3.6 to classifiers#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup setup( name='Redis-Sentinel-Url', py_modules=['redis_sentinel_url'], version='1.0.0', install_requires=['redis>=2.10.3'], tests_require=['mock', 'nose'], test_suite='nose.collector', description='A factory for redis connection that supports using Redis Sentinel', url='https://github.com/exponea/redis-sentinel-url', author='Martin Sucha', author_email='martin.sucha@exponea.com', license='Apache 2.0', classifiers=[ 'Programming Language :: Python', 'Programming Language :: Python :: 2', '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', 'Operating System :: OS Independent', 'License :: OSI Approved :: Apache Software License', 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'Topic :: Software Development :: Libraries :: Python Modules' ] )
<commit_before>#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup setup( name='Redis-Sentinel-Url', py_modules=['redis_sentinel_url'], version='1.0.0', install_requires=['redis>=2.10.3'], tests_require=['mock', 'nose'], test_suite='nose.collector', description='A factory for redis connection that supports using Redis Sentinel', url='https://github.com/exponea/redis-sentinel-url', author='Martin Sucha', author_email='martin.sucha@exponea.com', license='Apache 2.0', classifiers=[ 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Operating System :: OS Independent', 'License :: OSI Approved :: Apache Software License', 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'Topic :: Software Development :: Libraries :: Python Modules' ] ) <commit_msg>Add Python 3.6 to classifiers<commit_after>#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup setup( name='Redis-Sentinel-Url', py_modules=['redis_sentinel_url'], version='1.0.0', install_requires=['redis>=2.10.3'], tests_require=['mock', 'nose'], test_suite='nose.collector', description='A factory for redis connection that supports using Redis Sentinel', url='https://github.com/exponea/redis-sentinel-url', author='Martin Sucha', author_email='martin.sucha@exponea.com', license='Apache 2.0', classifiers=[ 'Programming Language :: Python', 'Programming Language :: Python :: 2', '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', 'Operating System :: OS Independent', 'License :: OSI Approved :: Apache Software License', 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'Topic :: Software Development :: Libraries :: Python Modules' ] )
0c0c11da08a05ee0b1de4cfc74003f31358a294b
setup.py
setup.py
from setuptools import setup setup( name='firetv', version='1.0.6', description='Communicate with an Amazon Fire TV device via ADB over a network.', url='https://github.com/happyleavesaoc/python-firetv/', license='MIT', author='happyleaves', author_email='happyleaves.tfr@gmail.com', packages=['firetv'], install_requires=['pycryptodome', 'rsa', 'adb>1.3.0'], extras_require={ 'firetv-server': ['Flask>=0.10.1', 'PyYAML>=3.12'] }, entry_points={ 'console_scripts': [ 'firetv-server = firetv.__main__:main' ] }, classifiers=[ 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3' ] )
from setuptools import setup setup( name='firetv', version='1.0.6', description='Communicate with an Amazon Fire TV device via ADB over a network.', url='https://github.com/happyleavesaoc/python-firetv/', license='MIT', author='happyleaves', author_email='happyleaves.tfr@gmail.com', packages=['firetv'], install_requires=['pycryptodome', 'rsa', 'adb-homeassistant'], extras_require={ 'firetv-server': ['Flask>=0.10.1', 'PyYAML>=3.12'] }, entry_points={ 'console_scripts': [ 'firetv-server = firetv.__main__:main' ] }, classifiers=[ 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3' ] )
Change requirement from 'adb>1.3.0' to 'adb-homeassistant'
Change requirement from 'adb>1.3.0' to 'adb-homeassistant'
Python
mit
happyleavesaoc/python-firetv
from setuptools import setup setup( name='firetv', version='1.0.6', description='Communicate with an Amazon Fire TV device via ADB over a network.', url='https://github.com/happyleavesaoc/python-firetv/', license='MIT', author='happyleaves', author_email='happyleaves.tfr@gmail.com', packages=['firetv'], install_requires=['pycryptodome', 'rsa', 'adb>1.3.0'], extras_require={ 'firetv-server': ['Flask>=0.10.1', 'PyYAML>=3.12'] }, entry_points={ 'console_scripts': [ 'firetv-server = firetv.__main__:main' ] }, classifiers=[ 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3' ] ) Change requirement from 'adb>1.3.0' to 'adb-homeassistant'
from setuptools import setup setup( name='firetv', version='1.0.6', description='Communicate with an Amazon Fire TV device via ADB over a network.', url='https://github.com/happyleavesaoc/python-firetv/', license='MIT', author='happyleaves', author_email='happyleaves.tfr@gmail.com', packages=['firetv'], install_requires=['pycryptodome', 'rsa', 'adb-homeassistant'], extras_require={ 'firetv-server': ['Flask>=0.10.1', 'PyYAML>=3.12'] }, entry_points={ 'console_scripts': [ 'firetv-server = firetv.__main__:main' ] }, classifiers=[ 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3' ] )
<commit_before>from setuptools import setup setup( name='firetv', version='1.0.6', description='Communicate with an Amazon Fire TV device via ADB over a network.', url='https://github.com/happyleavesaoc/python-firetv/', license='MIT', author='happyleaves', author_email='happyleaves.tfr@gmail.com', packages=['firetv'], install_requires=['pycryptodome', 'rsa', 'adb>1.3.0'], extras_require={ 'firetv-server': ['Flask>=0.10.1', 'PyYAML>=3.12'] }, entry_points={ 'console_scripts': [ 'firetv-server = firetv.__main__:main' ] }, classifiers=[ 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3' ] ) <commit_msg>Change requirement from 'adb>1.3.0' to 'adb-homeassistant'<commit_after>
from setuptools import setup setup( name='firetv', version='1.0.6', description='Communicate with an Amazon Fire TV device via ADB over a network.', url='https://github.com/happyleavesaoc/python-firetv/', license='MIT', author='happyleaves', author_email='happyleaves.tfr@gmail.com', packages=['firetv'], install_requires=['pycryptodome', 'rsa', 'adb-homeassistant'], extras_require={ 'firetv-server': ['Flask>=0.10.1', 'PyYAML>=3.12'] }, entry_points={ 'console_scripts': [ 'firetv-server = firetv.__main__:main' ] }, classifiers=[ 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3' ] )
from setuptools import setup setup( name='firetv', version='1.0.6', description='Communicate with an Amazon Fire TV device via ADB over a network.', url='https://github.com/happyleavesaoc/python-firetv/', license='MIT', author='happyleaves', author_email='happyleaves.tfr@gmail.com', packages=['firetv'], install_requires=['pycryptodome', 'rsa', 'adb>1.3.0'], extras_require={ 'firetv-server': ['Flask>=0.10.1', 'PyYAML>=3.12'] }, entry_points={ 'console_scripts': [ 'firetv-server = firetv.__main__:main' ] }, classifiers=[ 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3' ] ) Change requirement from 'adb>1.3.0' to 'adb-homeassistant'from setuptools import setup setup( name='firetv', version='1.0.6', description='Communicate with an Amazon Fire TV device via ADB over a network.', url='https://github.com/happyleavesaoc/python-firetv/', license='MIT', author='happyleaves', author_email='happyleaves.tfr@gmail.com', packages=['firetv'], install_requires=['pycryptodome', 'rsa', 'adb-homeassistant'], extras_require={ 'firetv-server': ['Flask>=0.10.1', 'PyYAML>=3.12'] }, entry_points={ 'console_scripts': [ 'firetv-server = firetv.__main__:main' ] }, classifiers=[ 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3' ] )
<commit_before>from setuptools import setup setup( name='firetv', version='1.0.6', description='Communicate with an Amazon Fire TV device via ADB over a network.', url='https://github.com/happyleavesaoc/python-firetv/', license='MIT', author='happyleaves', author_email='happyleaves.tfr@gmail.com', packages=['firetv'], install_requires=['pycryptodome', 'rsa', 'adb>1.3.0'], extras_require={ 'firetv-server': ['Flask>=0.10.1', 'PyYAML>=3.12'] }, entry_points={ 'console_scripts': [ 'firetv-server = firetv.__main__:main' ] }, classifiers=[ 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3' ] ) <commit_msg>Change requirement from 'adb>1.3.0' to 'adb-homeassistant'<commit_after>from setuptools import setup setup( name='firetv', version='1.0.6', description='Communicate with an Amazon Fire TV device via ADB over a network.', url='https://github.com/happyleavesaoc/python-firetv/', license='MIT', author='happyleaves', author_email='happyleaves.tfr@gmail.com', packages=['firetv'], install_requires=['pycryptodome', 'rsa', 'adb-homeassistant'], extras_require={ 'firetv-server': ['Flask>=0.10.1', 'PyYAML>=3.12'] }, entry_points={ 'console_scripts': [ 'firetv-server = firetv.__main__:main' ] }, classifiers=[ 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3' ] )
779bc379a3c4d9b0a40c5ad7aa042cdb422efdd5
package_name/__meta__.py
package_name/__meta__.py
name = 'package-name' path = name.lower().replace("-", "_").replace(" ", "_") version = '0.0.0' author = 'Author Name' author_email = '' description = '' url = '' # project homepage license = 'MIT' # See https://choosealicense.com
name = 'package-name' # See https://www.python.org/dev/peps/pep-0008/ path = name.lower().replace("-", "_").replace(" ", "_") version = '0.1.0' # See https://www.python.org/dev/peps/pep-0440/ and https://semver.org/ author = 'Author Name' author_email = '' description = '' # One-liner url = '' # your project homepage license = 'MIT' # See https://choosealicense.com
Add descriptions/links for meta fields
DOC: Add descriptions/links for meta fields
Python
mit
scottclowe/python-ci,scottclowe/python-continuous-integration,scottclowe/python-ci,scottclowe/python-continuous-integration
name = 'package-name' path = name.lower().replace("-", "_").replace(" ", "_") version = '0.0.0' author = 'Author Name' author_email = '' description = '' url = '' # project homepage license = 'MIT' # See https://choosealicense.com DOC: Add descriptions/links for meta fields
name = 'package-name' # See https://www.python.org/dev/peps/pep-0008/ path = name.lower().replace("-", "_").replace(" ", "_") version = '0.1.0' # See https://www.python.org/dev/peps/pep-0440/ and https://semver.org/ author = 'Author Name' author_email = '' description = '' # One-liner url = '' # your project homepage license = 'MIT' # See https://choosealicense.com
<commit_before>name = 'package-name' path = name.lower().replace("-", "_").replace(" ", "_") version = '0.0.0' author = 'Author Name' author_email = '' description = '' url = '' # project homepage license = 'MIT' # See https://choosealicense.com <commit_msg>DOC: Add descriptions/links for meta fields<commit_after>
name = 'package-name' # See https://www.python.org/dev/peps/pep-0008/ path = name.lower().replace("-", "_").replace(" ", "_") version = '0.1.0' # See https://www.python.org/dev/peps/pep-0440/ and https://semver.org/ author = 'Author Name' author_email = '' description = '' # One-liner url = '' # your project homepage license = 'MIT' # See https://choosealicense.com
name = 'package-name' path = name.lower().replace("-", "_").replace(" ", "_") version = '0.0.0' author = 'Author Name' author_email = '' description = '' url = '' # project homepage license = 'MIT' # See https://choosealicense.com DOC: Add descriptions/links for meta fieldsname = 'package-name' # See https://www.python.org/dev/peps/pep-0008/ path = name.lower().replace("-", "_").replace(" ", "_") version = '0.1.0' # See https://www.python.org/dev/peps/pep-0440/ and https://semver.org/ author = 'Author Name' author_email = '' description = '' # One-liner url = '' # your project homepage license = 'MIT' # See https://choosealicense.com
<commit_before>name = 'package-name' path = name.lower().replace("-", "_").replace(" ", "_") version = '0.0.0' author = 'Author Name' author_email = '' description = '' url = '' # project homepage license = 'MIT' # See https://choosealicense.com <commit_msg>DOC: Add descriptions/links for meta fields<commit_after>name = 'package-name' # See https://www.python.org/dev/peps/pep-0008/ path = name.lower().replace("-", "_").replace(" ", "_") version = '0.1.0' # See https://www.python.org/dev/peps/pep-0440/ and https://semver.org/ author = 'Author Name' author_email = '' description = '' # One-liner url = '' # your project homepage license = 'MIT' # See https://choosealicense.com
94208e6fa4a611d32a00dc6b353fbe17ba3b3978
setup.py
setup.py
from setuptools import setup, find_packages import sys if sys.hexversion < 0x02070000: sys.exit("Python 2.7 or newer is required to use this package.") setup( name="legato", version="1.0", author="S[&]T", author_email="info@stcorp.nl", url="http://stcorp.nl/", description="Task trigger daemon", license="BSD", packages=find_packages(), entry_points={ "console_scripts": [ "legato = legato.daemon:main", ], }, install_requires=[ "watchdog", "schedule" ], py_modules=["legato"] )
from setuptools import setup, find_packages import sys if sys.hexversion < 0x02070000: sys.exit("Python 2.7 or newer is required to use this package.") setup( name="legato", version="1.0", author="S[&]T", author_email="info@stcorp.nl", url="http://stcorp.nl/", description="Task trigger daemon", license="BSD", packages=find_packages(), entry_points={ "console_scripts": [ "legato = legato.daemon:main", ], }, install_requires=[ "watchdog", "schedule" ] )
Remove warning: file legato.py (for module legato) not found during installation
Remove warning: file legato.py (for module legato) not found during installation
Python
bsd-3-clause
stcorp/legato
from setuptools import setup, find_packages import sys if sys.hexversion < 0x02070000: sys.exit("Python 2.7 or newer is required to use this package.") setup( name="legato", version="1.0", author="S[&]T", author_email="info@stcorp.nl", url="http://stcorp.nl/", description="Task trigger daemon", license="BSD", packages=find_packages(), entry_points={ "console_scripts": [ "legato = legato.daemon:main", ], }, install_requires=[ "watchdog", "schedule" ], py_modules=["legato"] ) Remove warning: file legato.py (for module legato) not found during installation
from setuptools import setup, find_packages import sys if sys.hexversion < 0x02070000: sys.exit("Python 2.7 or newer is required to use this package.") setup( name="legato", version="1.0", author="S[&]T", author_email="info@stcorp.nl", url="http://stcorp.nl/", description="Task trigger daemon", license="BSD", packages=find_packages(), entry_points={ "console_scripts": [ "legato = legato.daemon:main", ], }, install_requires=[ "watchdog", "schedule" ] )
<commit_before>from setuptools import setup, find_packages import sys if sys.hexversion < 0x02070000: sys.exit("Python 2.7 or newer is required to use this package.") setup( name="legato", version="1.0", author="S[&]T", author_email="info@stcorp.nl", url="http://stcorp.nl/", description="Task trigger daemon", license="BSD", packages=find_packages(), entry_points={ "console_scripts": [ "legato = legato.daemon:main", ], }, install_requires=[ "watchdog", "schedule" ], py_modules=["legato"] ) <commit_msg>Remove warning: file legato.py (for module legato) not found during installation<commit_after>
from setuptools import setup, find_packages import sys if sys.hexversion < 0x02070000: sys.exit("Python 2.7 or newer is required to use this package.") setup( name="legato", version="1.0", author="S[&]T", author_email="info@stcorp.nl", url="http://stcorp.nl/", description="Task trigger daemon", license="BSD", packages=find_packages(), entry_points={ "console_scripts": [ "legato = legato.daemon:main", ], }, install_requires=[ "watchdog", "schedule" ] )
from setuptools import setup, find_packages import sys if sys.hexversion < 0x02070000: sys.exit("Python 2.7 or newer is required to use this package.") setup( name="legato", version="1.0", author="S[&]T", author_email="info@stcorp.nl", url="http://stcorp.nl/", description="Task trigger daemon", license="BSD", packages=find_packages(), entry_points={ "console_scripts": [ "legato = legato.daemon:main", ], }, install_requires=[ "watchdog", "schedule" ], py_modules=["legato"] ) Remove warning: file legato.py (for module legato) not found during installationfrom setuptools import setup, find_packages import sys if sys.hexversion < 0x02070000: sys.exit("Python 2.7 or newer is required to use this package.") setup( name="legato", version="1.0", author="S[&]T", author_email="info@stcorp.nl", url="http://stcorp.nl/", description="Task trigger daemon", license="BSD", packages=find_packages(), entry_points={ "console_scripts": [ "legato = legato.daemon:main", ], }, install_requires=[ "watchdog", "schedule" ] )
<commit_before>from setuptools import setup, find_packages import sys if sys.hexversion < 0x02070000: sys.exit("Python 2.7 or newer is required to use this package.") setup( name="legato", version="1.0", author="S[&]T", author_email="info@stcorp.nl", url="http://stcorp.nl/", description="Task trigger daemon", license="BSD", packages=find_packages(), entry_points={ "console_scripts": [ "legato = legato.daemon:main", ], }, install_requires=[ "watchdog", "schedule" ], py_modules=["legato"] ) <commit_msg>Remove warning: file legato.py (for module legato) not found during installation<commit_after>from setuptools import setup, find_packages import sys if sys.hexversion < 0x02070000: sys.exit("Python 2.7 or newer is required to use this package.") setup( name="legato", version="1.0", author="S[&]T", author_email="info@stcorp.nl", url="http://stcorp.nl/", description="Task trigger daemon", license="BSD", packages=find_packages(), entry_points={ "console_scripts": [ "legato = legato.daemon:main", ], }, install_requires=[ "watchdog", "schedule" ] )
8bb1172a67ad978e11f5b3f24828b130ff61def7
setup.py
setup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import find_packages, setup with open("README.md") as readme_file: readme = readme_file.read() requirements = ["Pillow>=5.3.0", "numpy>=1.15.4", "Click>=7.0"] setup( author="Ryan Gibson", author_email="ryanalexandergibson@gmail.com", name="stego_lsb", version="1.3.1", description="stego lsb", keywords="stego lsb", license="MIT", long_description=readme, long_description_content_type="text/markdown", url="https://github.com/ragibson/Steganography", install_requires=requirements, entry_points=""" [console_scripts] stegolsb=stego_lsb.cli:main """, include_package_data=True, packages=find_packages(include=["stego_lsb"]), zip_safe=False, python_requires=">=3.6", classifiers=[ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3 :: Only", ], )
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import find_packages, setup with open("README.md") as readme_file: readme = readme_file.read() requirements = ["Pillow>=5.3.0", "numpy>=1.15.4", "Click>=7.0"] setup( author="Ryan Gibson", author_email="ryanalexandergibson@gmail.com", name="stego_lsb", version="1.3.1", description="stego lsb", keywords="stego lsb", license="MIT", long_description=readme, long_description_content_type="text/markdown", url="https://github.com/ragibson/Steganography", install_requires=requirements, entry_points=""" [console_scripts] stegolsb=stego_lsb.cli:main """, include_package_data=True, packages=find_packages(include=["stego_lsb"]), zip_safe=False, python_requires=">=3.7", classifiers=[ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3 :: Only", ], )
Remove support for end-of-life Python 3.6 in next release
Remove support for end-of-life Python 3.6 in next release Checked again just now and we are still waiting on Python 3.10 stability
Python
mit
ragibson/Steganography
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import find_packages, setup with open("README.md") as readme_file: readme = readme_file.read() requirements = ["Pillow>=5.3.0", "numpy>=1.15.4", "Click>=7.0"] setup( author="Ryan Gibson", author_email="ryanalexandergibson@gmail.com", name="stego_lsb", version="1.3.1", description="stego lsb", keywords="stego lsb", license="MIT", long_description=readme, long_description_content_type="text/markdown", url="https://github.com/ragibson/Steganography", install_requires=requirements, entry_points=""" [console_scripts] stegolsb=stego_lsb.cli:main """, include_package_data=True, packages=find_packages(include=["stego_lsb"]), zip_safe=False, python_requires=">=3.6", classifiers=[ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3 :: Only", ], ) Remove support for end-of-life Python 3.6 in next release Checked again just now and we are still waiting on Python 3.10 stability
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import find_packages, setup with open("README.md") as readme_file: readme = readme_file.read() requirements = ["Pillow>=5.3.0", "numpy>=1.15.4", "Click>=7.0"] setup( author="Ryan Gibson", author_email="ryanalexandergibson@gmail.com", name="stego_lsb", version="1.3.1", description="stego lsb", keywords="stego lsb", license="MIT", long_description=readme, long_description_content_type="text/markdown", url="https://github.com/ragibson/Steganography", install_requires=requirements, entry_points=""" [console_scripts] stegolsb=stego_lsb.cli:main """, include_package_data=True, packages=find_packages(include=["stego_lsb"]), zip_safe=False, python_requires=">=3.7", classifiers=[ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3 :: Only", ], )
<commit_before>#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import find_packages, setup with open("README.md") as readme_file: readme = readme_file.read() requirements = ["Pillow>=5.3.0", "numpy>=1.15.4", "Click>=7.0"] setup( author="Ryan Gibson", author_email="ryanalexandergibson@gmail.com", name="stego_lsb", version="1.3.1", description="stego lsb", keywords="stego lsb", license="MIT", long_description=readme, long_description_content_type="text/markdown", url="https://github.com/ragibson/Steganography", install_requires=requirements, entry_points=""" [console_scripts] stegolsb=stego_lsb.cli:main """, include_package_data=True, packages=find_packages(include=["stego_lsb"]), zip_safe=False, python_requires=">=3.6", classifiers=[ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3 :: Only", ], ) <commit_msg>Remove support for end-of-life Python 3.6 in next release Checked again just now and we are still waiting on Python 3.10 stability<commit_after>
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import find_packages, setup with open("README.md") as readme_file: readme = readme_file.read() requirements = ["Pillow>=5.3.0", "numpy>=1.15.4", "Click>=7.0"] setup( author="Ryan Gibson", author_email="ryanalexandergibson@gmail.com", name="stego_lsb", version="1.3.1", description="stego lsb", keywords="stego lsb", license="MIT", long_description=readme, long_description_content_type="text/markdown", url="https://github.com/ragibson/Steganography", install_requires=requirements, entry_points=""" [console_scripts] stegolsb=stego_lsb.cli:main """, include_package_data=True, packages=find_packages(include=["stego_lsb"]), zip_safe=False, python_requires=">=3.7", classifiers=[ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3 :: Only", ], )
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import find_packages, setup with open("README.md") as readme_file: readme = readme_file.read() requirements = ["Pillow>=5.3.0", "numpy>=1.15.4", "Click>=7.0"] setup( author="Ryan Gibson", author_email="ryanalexandergibson@gmail.com", name="stego_lsb", version="1.3.1", description="stego lsb", keywords="stego lsb", license="MIT", long_description=readme, long_description_content_type="text/markdown", url="https://github.com/ragibson/Steganography", install_requires=requirements, entry_points=""" [console_scripts] stegolsb=stego_lsb.cli:main """, include_package_data=True, packages=find_packages(include=["stego_lsb"]), zip_safe=False, python_requires=">=3.6", classifiers=[ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3 :: Only", ], ) Remove support for end-of-life Python 3.6 in next release Checked again just now and we are still waiting on Python 3.10 stability#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import find_packages, setup with open("README.md") as readme_file: readme = readme_file.read() requirements = ["Pillow>=5.3.0", "numpy>=1.15.4", "Click>=7.0"] setup( author="Ryan Gibson", author_email="ryanalexandergibson@gmail.com", name="stego_lsb", version="1.3.1", description="stego lsb", keywords="stego lsb", license="MIT", long_description=readme, long_description_content_type="text/markdown", url="https://github.com/ragibson/Steganography", install_requires=requirements, entry_points=""" [console_scripts] stegolsb=stego_lsb.cli:main """, include_package_data=True, packages=find_packages(include=["stego_lsb"]), zip_safe=False, python_requires=">=3.7", classifiers=[ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3 :: Only", ], )
<commit_before>#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import find_packages, setup with open("README.md") as readme_file: readme = readme_file.read() requirements = ["Pillow>=5.3.0", "numpy>=1.15.4", "Click>=7.0"] setup( author="Ryan Gibson", author_email="ryanalexandergibson@gmail.com", name="stego_lsb", version="1.3.1", description="stego lsb", keywords="stego lsb", license="MIT", long_description=readme, long_description_content_type="text/markdown", url="https://github.com/ragibson/Steganography", install_requires=requirements, entry_points=""" [console_scripts] stegolsb=stego_lsb.cli:main """, include_package_data=True, packages=find_packages(include=["stego_lsb"]), zip_safe=False, python_requires=">=3.6", classifiers=[ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3 :: Only", ], ) <commit_msg>Remove support for end-of-life Python 3.6 in next release Checked again just now and we are still waiting on Python 3.10 stability<commit_after>#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import find_packages, setup with open("README.md") as readme_file: readme = readme_file.read() requirements = ["Pillow>=5.3.0", "numpy>=1.15.4", "Click>=7.0"] setup( author="Ryan Gibson", author_email="ryanalexandergibson@gmail.com", name="stego_lsb", version="1.3.1", description="stego lsb", keywords="stego lsb", license="MIT", long_description=readme, long_description_content_type="text/markdown", url="https://github.com/ragibson/Steganography", install_requires=requirements, entry_points=""" [console_scripts] stegolsb=stego_lsb.cli:main """, include_package_data=True, packages=find_packages(include=["stego_lsb"]), zip_safe=False, python_requires=">=3.7", classifiers=[ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3 :: Only", ], )
1a0e78756843819a1634c80da8d2cdb8ed4a7bc5
setup.py
setup.py
#!/usr/bin/env python from distutils.core import setup from clusterjob import __version__ setup(name='clusterjob', version=__version__, description='Manage traditional HPC cluster workflows in Python', author='Michael Goerz', author_email='goerz@stanford.edu', url='https://github.com/goerz/clusterjob', license='GPL', extras_require={'dev': ['pytest', 'pytest-capturelog', 'sphinx', 'sphinx-autobuild', 'sphinx_rtd_theme', 'coverage', 'pytest-cov']}, packages=['clusterjob', 'clusterjob.backends'], scripts=[], classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Console', 'Environment :: Web Environment', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Topic :: Scientific/Engineering', 'Topic :: System :: Clustering', 'Topic :: Utilities', 'Operating System :: POSIX', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4' ] )
#!/usr/bin/env python from distutils.core import setup from clusterjob import __version__ try: # In Python >3.3, 'mock' is part of the standard library import unittest.mock mock_package = [] except ImportError: # In other versions, it has be to be installed as an exernal package mock_package = ['mock', ] setup(name='clusterjob', version=__version__, description='Manage traditional HPC cluster workflows in Python', author='Michael Goerz', author_email='goerz@stanford.edu', url='https://github.com/goerz/clusterjob', license='GPL', extras_require={'dev': ['pytest', 'pytest-capturelog', 'sphinx', 'sphinx-autobuild', 'sphinx_rtd_theme', 'coverage', 'pytest-cov'] + mock_package}, packages=['clusterjob', 'clusterjob.backends'], scripts=[], classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Console', 'Environment :: Web Environment', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Topic :: Scientific/Engineering', 'Topic :: System :: Clustering', 'Topic :: Utilities', 'Operating System :: POSIX', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4' ] )
Install mock package when not in stdlib
Install mock package when not in stdlib
Python
mit
goerz/clusterjob,goerz/clusterjob
#!/usr/bin/env python from distutils.core import setup from clusterjob import __version__ setup(name='clusterjob', version=__version__, description='Manage traditional HPC cluster workflows in Python', author='Michael Goerz', author_email='goerz@stanford.edu', url='https://github.com/goerz/clusterjob', license='GPL', extras_require={'dev': ['pytest', 'pytest-capturelog', 'sphinx', 'sphinx-autobuild', 'sphinx_rtd_theme', 'coverage', 'pytest-cov']}, packages=['clusterjob', 'clusterjob.backends'], scripts=[], classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Console', 'Environment :: Web Environment', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Topic :: Scientific/Engineering', 'Topic :: System :: Clustering', 'Topic :: Utilities', 'Operating System :: POSIX', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4' ] ) Install mock package when not in stdlib
#!/usr/bin/env python from distutils.core import setup from clusterjob import __version__ try: # In Python >3.3, 'mock' is part of the standard library import unittest.mock mock_package = [] except ImportError: # In other versions, it has be to be installed as an exernal package mock_package = ['mock', ] setup(name='clusterjob', version=__version__, description='Manage traditional HPC cluster workflows in Python', author='Michael Goerz', author_email='goerz@stanford.edu', url='https://github.com/goerz/clusterjob', license='GPL', extras_require={'dev': ['pytest', 'pytest-capturelog', 'sphinx', 'sphinx-autobuild', 'sphinx_rtd_theme', 'coverage', 'pytest-cov'] + mock_package}, packages=['clusterjob', 'clusterjob.backends'], scripts=[], classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Console', 'Environment :: Web Environment', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Topic :: Scientific/Engineering', 'Topic :: System :: Clustering', 'Topic :: Utilities', 'Operating System :: POSIX', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4' ] )
<commit_before>#!/usr/bin/env python from distutils.core import setup from clusterjob import __version__ setup(name='clusterjob', version=__version__, description='Manage traditional HPC cluster workflows in Python', author='Michael Goerz', author_email='goerz@stanford.edu', url='https://github.com/goerz/clusterjob', license='GPL', extras_require={'dev': ['pytest', 'pytest-capturelog', 'sphinx', 'sphinx-autobuild', 'sphinx_rtd_theme', 'coverage', 'pytest-cov']}, packages=['clusterjob', 'clusterjob.backends'], scripts=[], classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Console', 'Environment :: Web Environment', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Topic :: Scientific/Engineering', 'Topic :: System :: Clustering', 'Topic :: Utilities', 'Operating System :: POSIX', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4' ] ) <commit_msg>Install mock package when not in stdlib<commit_after>
#!/usr/bin/env python from distutils.core import setup from clusterjob import __version__ try: # In Python >3.3, 'mock' is part of the standard library import unittest.mock mock_package = [] except ImportError: # In other versions, it has be to be installed as an exernal package mock_package = ['mock', ] setup(name='clusterjob', version=__version__, description='Manage traditional HPC cluster workflows in Python', author='Michael Goerz', author_email='goerz@stanford.edu', url='https://github.com/goerz/clusterjob', license='GPL', extras_require={'dev': ['pytest', 'pytest-capturelog', 'sphinx', 'sphinx-autobuild', 'sphinx_rtd_theme', 'coverage', 'pytest-cov'] + mock_package}, packages=['clusterjob', 'clusterjob.backends'], scripts=[], classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Console', 'Environment :: Web Environment', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Topic :: Scientific/Engineering', 'Topic :: System :: Clustering', 'Topic :: Utilities', 'Operating System :: POSIX', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4' ] )
#!/usr/bin/env python from distutils.core import setup from clusterjob import __version__ setup(name='clusterjob', version=__version__, description='Manage traditional HPC cluster workflows in Python', author='Michael Goerz', author_email='goerz@stanford.edu', url='https://github.com/goerz/clusterjob', license='GPL', extras_require={'dev': ['pytest', 'pytest-capturelog', 'sphinx', 'sphinx-autobuild', 'sphinx_rtd_theme', 'coverage', 'pytest-cov']}, packages=['clusterjob', 'clusterjob.backends'], scripts=[], classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Console', 'Environment :: Web Environment', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Topic :: Scientific/Engineering', 'Topic :: System :: Clustering', 'Topic :: Utilities', 'Operating System :: POSIX', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4' ] ) Install mock package when not in stdlib#!/usr/bin/env python from distutils.core import setup from clusterjob import __version__ try: # In Python >3.3, 'mock' is part of the standard library import unittest.mock mock_package = [] except ImportError: # In other versions, it has be to be installed as an exernal package mock_package = ['mock', ] setup(name='clusterjob', version=__version__, description='Manage traditional HPC cluster workflows in Python', author='Michael Goerz', author_email='goerz@stanford.edu', url='https://github.com/goerz/clusterjob', license='GPL', extras_require={'dev': ['pytest', 'pytest-capturelog', 'sphinx', 'sphinx-autobuild', 'sphinx_rtd_theme', 'coverage', 'pytest-cov'] + mock_package}, packages=['clusterjob', 'clusterjob.backends'], scripts=[], classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Console', 'Environment :: Web Environment', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Topic :: Scientific/Engineering', 'Topic :: System :: Clustering', 'Topic :: Utilities', 'Operating System :: POSIX', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4' ] )
<commit_before>#!/usr/bin/env python from distutils.core import setup from clusterjob import __version__ setup(name='clusterjob', version=__version__, description='Manage traditional HPC cluster workflows in Python', author='Michael Goerz', author_email='goerz@stanford.edu', url='https://github.com/goerz/clusterjob', license='GPL', extras_require={'dev': ['pytest', 'pytest-capturelog', 'sphinx', 'sphinx-autobuild', 'sphinx_rtd_theme', 'coverage', 'pytest-cov']}, packages=['clusterjob', 'clusterjob.backends'], scripts=[], classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Console', 'Environment :: Web Environment', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Topic :: Scientific/Engineering', 'Topic :: System :: Clustering', 'Topic :: Utilities', 'Operating System :: POSIX', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4' ] ) <commit_msg>Install mock package when not in stdlib<commit_after>#!/usr/bin/env python from distutils.core import setup from clusterjob import __version__ try: # In Python >3.3, 'mock' is part of the standard library import unittest.mock mock_package = [] except ImportError: # In other versions, it has be to be installed as an exernal package mock_package = ['mock', ] setup(name='clusterjob', version=__version__, description='Manage traditional HPC cluster workflows in Python', author='Michael Goerz', author_email='goerz@stanford.edu', url='https://github.com/goerz/clusterjob', license='GPL', extras_require={'dev': ['pytest', 'pytest-capturelog', 'sphinx', 'sphinx-autobuild', 'sphinx_rtd_theme', 'coverage', 'pytest-cov'] + mock_package}, packages=['clusterjob', 'clusterjob.backends'], scripts=[], classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Console', 'Environment :: Web Environment', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Topic :: Scientific/Engineering', 'Topic :: System :: Clustering', 'Topic :: Utilities', 'Operating System :: POSIX', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4' ] )
7aa7adff5e5be48bde6ded05c4599fa0c9eb39bf
setup.py
setup.py
#!/usr/bin/env python2.6 import os import setuptools def find_files(path): return [os.path.join(path, f) for f in os.listdir(path)] setuptools.setup( name='workspace-tools', version='0.7.3', author='Max Zheng', author_email='maxzheng.os @t gmail.com', home_page='https://github.com/maxzheng/workspace-tools', summary='Tools to simplify working with multiple product repositories with SCM / development tools abstraction.', description=open('README.rst').read(), entry_points={ 'console_scripts': [ 'wst = workspace.controller:main', ], }, install_requires=open('requirements.txt').read(), license='MIT', package_dir={'': 'src'}, packages=setuptools.find_packages('src'), include_package_data=True, setup_requires=['setuptools-git'], classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'Topic :: Software Development :: Development Tools', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', ], keywords='git svn scm development tools', )
#!/usr/bin/env python2.6 import os import setuptools def find_files(path): return [os.path.join(path, f) for f in os.listdir(path)] setuptools.setup( name='workspace-tools', version='0.7.3', author='Max Zheng', author_email='maxzheng.os @t gmail.com', summary='Tools to simplify working with multiple product repositories with SCM / development tools abstraction.', url='https://github.com/maxzheng/workspace-tools', description=open('README.rst').read(), entry_points={ 'console_scripts': [ 'wst = workspace.controller:main', ], }, install_requires=open('requirements.txt').read(), license='MIT', package_dir={'': 'src'}, packages=setuptools.find_packages('src'), include_package_data=True, setup_requires=['setuptools-git'], classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'Topic :: Software Development :: Development Tools', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', ], keywords='git svn scm development tools', )
Use url instead of home_page
Use url instead of home_page
Python
mit
maxzheng/workspace-tools
#!/usr/bin/env python2.6 import os import setuptools def find_files(path): return [os.path.join(path, f) for f in os.listdir(path)] setuptools.setup( name='workspace-tools', version='0.7.3', author='Max Zheng', author_email='maxzheng.os @t gmail.com', home_page='https://github.com/maxzheng/workspace-tools', summary='Tools to simplify working with multiple product repositories with SCM / development tools abstraction.', description=open('README.rst').read(), entry_points={ 'console_scripts': [ 'wst = workspace.controller:main', ], }, install_requires=open('requirements.txt').read(), license='MIT', package_dir={'': 'src'}, packages=setuptools.find_packages('src'), include_package_data=True, setup_requires=['setuptools-git'], classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'Topic :: Software Development :: Development Tools', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', ], keywords='git svn scm development tools', ) Use url instead of home_page
#!/usr/bin/env python2.6 import os import setuptools def find_files(path): return [os.path.join(path, f) for f in os.listdir(path)] setuptools.setup( name='workspace-tools', version='0.7.3', author='Max Zheng', author_email='maxzheng.os @t gmail.com', summary='Tools to simplify working with multiple product repositories with SCM / development tools abstraction.', url='https://github.com/maxzheng/workspace-tools', description=open('README.rst').read(), entry_points={ 'console_scripts': [ 'wst = workspace.controller:main', ], }, install_requires=open('requirements.txt').read(), license='MIT', package_dir={'': 'src'}, packages=setuptools.find_packages('src'), include_package_data=True, setup_requires=['setuptools-git'], classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'Topic :: Software Development :: Development Tools', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', ], keywords='git svn scm development tools', )
<commit_before>#!/usr/bin/env python2.6 import os import setuptools def find_files(path): return [os.path.join(path, f) for f in os.listdir(path)] setuptools.setup( name='workspace-tools', version='0.7.3', author='Max Zheng', author_email='maxzheng.os @t gmail.com', home_page='https://github.com/maxzheng/workspace-tools', summary='Tools to simplify working with multiple product repositories with SCM / development tools abstraction.', description=open('README.rst').read(), entry_points={ 'console_scripts': [ 'wst = workspace.controller:main', ], }, install_requires=open('requirements.txt').read(), license='MIT', package_dir={'': 'src'}, packages=setuptools.find_packages('src'), include_package_data=True, setup_requires=['setuptools-git'], classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'Topic :: Software Development :: Development Tools', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', ], keywords='git svn scm development tools', ) <commit_msg>Use url instead of home_page<commit_after>
#!/usr/bin/env python2.6 import os import setuptools def find_files(path): return [os.path.join(path, f) for f in os.listdir(path)] setuptools.setup( name='workspace-tools', version='0.7.3', author='Max Zheng', author_email='maxzheng.os @t gmail.com', summary='Tools to simplify working with multiple product repositories with SCM / development tools abstraction.', url='https://github.com/maxzheng/workspace-tools', description=open('README.rst').read(), entry_points={ 'console_scripts': [ 'wst = workspace.controller:main', ], }, install_requires=open('requirements.txt').read(), license='MIT', package_dir={'': 'src'}, packages=setuptools.find_packages('src'), include_package_data=True, setup_requires=['setuptools-git'], classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'Topic :: Software Development :: Development Tools', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', ], keywords='git svn scm development tools', )
#!/usr/bin/env python2.6 import os import setuptools def find_files(path): return [os.path.join(path, f) for f in os.listdir(path)] setuptools.setup( name='workspace-tools', version='0.7.3', author='Max Zheng', author_email='maxzheng.os @t gmail.com', home_page='https://github.com/maxzheng/workspace-tools', summary='Tools to simplify working with multiple product repositories with SCM / development tools abstraction.', description=open('README.rst').read(), entry_points={ 'console_scripts': [ 'wst = workspace.controller:main', ], }, install_requires=open('requirements.txt').read(), license='MIT', package_dir={'': 'src'}, packages=setuptools.find_packages('src'), include_package_data=True, setup_requires=['setuptools-git'], classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'Topic :: Software Development :: Development Tools', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', ], keywords='git svn scm development tools', ) Use url instead of home_page#!/usr/bin/env python2.6 import os import setuptools def find_files(path): return [os.path.join(path, f) for f in os.listdir(path)] setuptools.setup( name='workspace-tools', version='0.7.3', author='Max Zheng', author_email='maxzheng.os @t gmail.com', summary='Tools to simplify working with multiple product repositories with SCM / development tools abstraction.', url='https://github.com/maxzheng/workspace-tools', description=open('README.rst').read(), entry_points={ 'console_scripts': [ 'wst = workspace.controller:main', ], }, install_requires=open('requirements.txt').read(), license='MIT', package_dir={'': 'src'}, packages=setuptools.find_packages('src'), include_package_data=True, setup_requires=['setuptools-git'], classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'Topic :: Software Development :: Development Tools', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', ], keywords='git svn scm development tools', )
<commit_before>#!/usr/bin/env python2.6 import os import setuptools def find_files(path): return [os.path.join(path, f) for f in os.listdir(path)] setuptools.setup( name='workspace-tools', version='0.7.3', author='Max Zheng', author_email='maxzheng.os @t gmail.com', home_page='https://github.com/maxzheng/workspace-tools', summary='Tools to simplify working with multiple product repositories with SCM / development tools abstraction.', description=open('README.rst').read(), entry_points={ 'console_scripts': [ 'wst = workspace.controller:main', ], }, install_requires=open('requirements.txt').read(), license='MIT', package_dir={'': 'src'}, packages=setuptools.find_packages('src'), include_package_data=True, setup_requires=['setuptools-git'], classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'Topic :: Software Development :: Development Tools', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', ], keywords='git svn scm development tools', ) <commit_msg>Use url instead of home_page<commit_after>#!/usr/bin/env python2.6 import os import setuptools def find_files(path): return [os.path.join(path, f) for f in os.listdir(path)] setuptools.setup( name='workspace-tools', version='0.7.3', author='Max Zheng', author_email='maxzheng.os @t gmail.com', summary='Tools to simplify working with multiple product repositories with SCM / development tools abstraction.', url='https://github.com/maxzheng/workspace-tools', description=open('README.rst').read(), entry_points={ 'console_scripts': [ 'wst = workspace.controller:main', ], }, install_requires=open('requirements.txt').read(), license='MIT', package_dir={'': 'src'}, packages=setuptools.find_packages('src'), include_package_data=True, setup_requires=['setuptools-git'], classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'Topic :: Software Development :: Development Tools', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', ], keywords='git svn scm development tools', )
6e4561533bd2ab435e12edb45501bf0e155fa193
setup.py
setup.py
from setuptools import setup, find_packages setup( name='django-simple-history', version='1.1.3.post1', description='Store model history and view/revert changes from admin site.', author='Corey Bertram', author_email='corey@qr7.com', mantainer='Trey Hunner', url='https://github.com/treyhunner/django-simple-history', packages=find_packages(), classifiers=[ "Development Status :: 5 - Production/Stable", "Framework :: Django", "Environment :: Web Environment", "Intended Audience :: Developers", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "License :: OSI Approved :: BSD License", ], tests_require=["Django>=1.3", "webtest", "django-webtest"], test_suite='runtests.main', )
from setuptools import setup, find_packages long_description = open('README.rst').read() + open('CHANGES.rst').read() setup( name='django-simple-history', version='1.1.3.post1', description='Store model history and view/revert changes from admin site.', long_description=long_description, author='Corey Bertram', author_email='corey@qr7.com', mantainer='Trey Hunner', url='https://github.com/treyhunner/django-simple-history', packages=find_packages(), classifiers=[ "Development Status :: 5 - Production/Stable", "Framework :: Django", "Environment :: Web Environment", "Intended Audience :: Developers", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "License :: OSI Approved :: BSD License", ], tests_require=["Django>=1.3", "webtest", "django-webtest"], test_suite='runtests.main', )
Use README.rst and CHANGES.rst for description
Use README.rst and CHANGES.rst for description
Python
bsd-3-clause
pombredanne/django-simple-history,emergence/django-simple-history,emergence/django-simple-history,treyhunner/django-simple-history,luzfcb/django-simple-history,pombredanne/django-simple-history,luzfcb/django-simple-history,treyhunner/django-simple-history
from setuptools import setup, find_packages setup( name='django-simple-history', version='1.1.3.post1', description='Store model history and view/revert changes from admin site.', author='Corey Bertram', author_email='corey@qr7.com', mantainer='Trey Hunner', url='https://github.com/treyhunner/django-simple-history', packages=find_packages(), classifiers=[ "Development Status :: 5 - Production/Stable", "Framework :: Django", "Environment :: Web Environment", "Intended Audience :: Developers", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "License :: OSI Approved :: BSD License", ], tests_require=["Django>=1.3", "webtest", "django-webtest"], test_suite='runtests.main', ) Use README.rst and CHANGES.rst for description
from setuptools import setup, find_packages long_description = open('README.rst').read() + open('CHANGES.rst').read() setup( name='django-simple-history', version='1.1.3.post1', description='Store model history and view/revert changes from admin site.', long_description=long_description, author='Corey Bertram', author_email='corey@qr7.com', mantainer='Trey Hunner', url='https://github.com/treyhunner/django-simple-history', packages=find_packages(), classifiers=[ "Development Status :: 5 - Production/Stable", "Framework :: Django", "Environment :: Web Environment", "Intended Audience :: Developers", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "License :: OSI Approved :: BSD License", ], tests_require=["Django>=1.3", "webtest", "django-webtest"], test_suite='runtests.main', )
<commit_before>from setuptools import setup, find_packages setup( name='django-simple-history', version='1.1.3.post1', description='Store model history and view/revert changes from admin site.', author='Corey Bertram', author_email='corey@qr7.com', mantainer='Trey Hunner', url='https://github.com/treyhunner/django-simple-history', packages=find_packages(), classifiers=[ "Development Status :: 5 - Production/Stable", "Framework :: Django", "Environment :: Web Environment", "Intended Audience :: Developers", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "License :: OSI Approved :: BSD License", ], tests_require=["Django>=1.3", "webtest", "django-webtest"], test_suite='runtests.main', ) <commit_msg>Use README.rst and CHANGES.rst for description<commit_after>
from setuptools import setup, find_packages long_description = open('README.rst').read() + open('CHANGES.rst').read() setup( name='django-simple-history', version='1.1.3.post1', description='Store model history and view/revert changes from admin site.', long_description=long_description, author='Corey Bertram', author_email='corey@qr7.com', mantainer='Trey Hunner', url='https://github.com/treyhunner/django-simple-history', packages=find_packages(), classifiers=[ "Development Status :: 5 - Production/Stable", "Framework :: Django", "Environment :: Web Environment", "Intended Audience :: Developers", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "License :: OSI Approved :: BSD License", ], tests_require=["Django>=1.3", "webtest", "django-webtest"], test_suite='runtests.main', )
from setuptools import setup, find_packages setup( name='django-simple-history', version='1.1.3.post1', description='Store model history and view/revert changes from admin site.', author='Corey Bertram', author_email='corey@qr7.com', mantainer='Trey Hunner', url='https://github.com/treyhunner/django-simple-history', packages=find_packages(), classifiers=[ "Development Status :: 5 - Production/Stable", "Framework :: Django", "Environment :: Web Environment", "Intended Audience :: Developers", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "License :: OSI Approved :: BSD License", ], tests_require=["Django>=1.3", "webtest", "django-webtest"], test_suite='runtests.main', ) Use README.rst and CHANGES.rst for descriptionfrom setuptools import setup, find_packages long_description = open('README.rst').read() + open('CHANGES.rst').read() setup( name='django-simple-history', version='1.1.3.post1', description='Store model history and view/revert changes from admin site.', long_description=long_description, author='Corey Bertram', author_email='corey@qr7.com', mantainer='Trey Hunner', url='https://github.com/treyhunner/django-simple-history', packages=find_packages(), classifiers=[ "Development Status :: 5 - Production/Stable", "Framework :: Django", "Environment :: Web Environment", "Intended Audience :: Developers", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "License :: OSI Approved :: BSD License", ], tests_require=["Django>=1.3", "webtest", "django-webtest"], test_suite='runtests.main', )
<commit_before>from setuptools import setup, find_packages setup( name='django-simple-history', version='1.1.3.post1', description='Store model history and view/revert changes from admin site.', author='Corey Bertram', author_email='corey@qr7.com', mantainer='Trey Hunner', url='https://github.com/treyhunner/django-simple-history', packages=find_packages(), classifiers=[ "Development Status :: 5 - Production/Stable", "Framework :: Django", "Environment :: Web Environment", "Intended Audience :: Developers", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "License :: OSI Approved :: BSD License", ], tests_require=["Django>=1.3", "webtest", "django-webtest"], test_suite='runtests.main', ) <commit_msg>Use README.rst and CHANGES.rst for description<commit_after>from setuptools import setup, find_packages long_description = open('README.rst').read() + open('CHANGES.rst').read() setup( name='django-simple-history', version='1.1.3.post1', description='Store model history and view/revert changes from admin site.', long_description=long_description, author='Corey Bertram', author_email='corey@qr7.com', mantainer='Trey Hunner', url='https://github.com/treyhunner/django-simple-history', packages=find_packages(), classifiers=[ "Development Status :: 5 - Production/Stable", "Framework :: Django", "Environment :: Web Environment", "Intended Audience :: Developers", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "License :: OSI Approved :: BSD License", ], tests_require=["Django>=1.3", "webtest", "django-webtest"], test_suite='runtests.main', )
12efe7dcc3734ca300c841d3c9e95010da6e39b9
setup.py
setup.py
#!/usr/bin/env python # coding=utf-8 import os from setuptools import setup, find_packages from eodatasets import __version__ as version # Append TeamCity build number if it gives us one. if 'BUILD_NUMBER' in os.environ and version.endswith('b'): version += '' + os.environ['BUILD_NUMBER'] setup( name="eodatasets", description="Packaging, metadata and provenance for GA EO datasets", version=version, packages=find_packages(exclude=('tests', 'tests.*')), install_requires=[ 'click', 'python-dateutil', 'gdal', 'numpy', 'pathlib', 'pyyaml', ], entry_points=''' [console_scripts] eod-package=eodatasets.scripts.genpackage:cli eod-generate-metadata=eodatasets.scripts.genmetadata:cli eod-generate-browse=eodatasets.scripts.genbrowse:cli ''', )
#!/usr/bin/env python # coding=utf-8 import os from setuptools import setup, find_packages from eodatasets import __version__ as version # Append TeamCity build number if it gives us one. if 'BUILD_NUMBER' in os.environ and version.endswith('b'): version += '' + os.environ['BUILD_NUMBER'] setup( name="eodatasets", description="Packaging, metadata and provenance for GA EO datasets", version=version, packages=find_packages(exclude=('tests', 'tests.*')), package_data={ '': ['*.json'], }, install_requires=[ 'click', 'python-dateutil', 'gdal', 'numpy', 'pathlib', 'pyyaml', ], entry_points=''' [console_scripts] eod-package=eodatasets.scripts.genpackage:cli eod-generate-metadata=eodatasets.scripts.genmetadata:cli eod-generate-browse=eodatasets.scripts.genbrowse:cli ''', )
Include metadata tables in package.
Include metadata tables in package.
Python
apache-2.0
jeremyh/eo-datasets,GeoscienceAustralia/eo-datasets,GeoscienceAustralia/eo-datasets,jeremyh/eo-datasets
#!/usr/bin/env python # coding=utf-8 import os from setuptools import setup, find_packages from eodatasets import __version__ as version # Append TeamCity build number if it gives us one. if 'BUILD_NUMBER' in os.environ and version.endswith('b'): version += '' + os.environ['BUILD_NUMBER'] setup( name="eodatasets", description="Packaging, metadata and provenance for GA EO datasets", version=version, packages=find_packages(exclude=('tests', 'tests.*')), install_requires=[ 'click', 'python-dateutil', 'gdal', 'numpy', 'pathlib', 'pyyaml', ], entry_points=''' [console_scripts] eod-package=eodatasets.scripts.genpackage:cli eod-generate-metadata=eodatasets.scripts.genmetadata:cli eod-generate-browse=eodatasets.scripts.genbrowse:cli ''', ) Include metadata tables in package.
#!/usr/bin/env python # coding=utf-8 import os from setuptools import setup, find_packages from eodatasets import __version__ as version # Append TeamCity build number if it gives us one. if 'BUILD_NUMBER' in os.environ and version.endswith('b'): version += '' + os.environ['BUILD_NUMBER'] setup( name="eodatasets", description="Packaging, metadata and provenance for GA EO datasets", version=version, packages=find_packages(exclude=('tests', 'tests.*')), package_data={ '': ['*.json'], }, install_requires=[ 'click', 'python-dateutil', 'gdal', 'numpy', 'pathlib', 'pyyaml', ], entry_points=''' [console_scripts] eod-package=eodatasets.scripts.genpackage:cli eod-generate-metadata=eodatasets.scripts.genmetadata:cli eod-generate-browse=eodatasets.scripts.genbrowse:cli ''', )
<commit_before>#!/usr/bin/env python # coding=utf-8 import os from setuptools import setup, find_packages from eodatasets import __version__ as version # Append TeamCity build number if it gives us one. if 'BUILD_NUMBER' in os.environ and version.endswith('b'): version += '' + os.environ['BUILD_NUMBER'] setup( name="eodatasets", description="Packaging, metadata and provenance for GA EO datasets", version=version, packages=find_packages(exclude=('tests', 'tests.*')), install_requires=[ 'click', 'python-dateutil', 'gdal', 'numpy', 'pathlib', 'pyyaml', ], entry_points=''' [console_scripts] eod-package=eodatasets.scripts.genpackage:cli eod-generate-metadata=eodatasets.scripts.genmetadata:cli eod-generate-browse=eodatasets.scripts.genbrowse:cli ''', ) <commit_msg>Include metadata tables in package.<commit_after>
#!/usr/bin/env python # coding=utf-8 import os from setuptools import setup, find_packages from eodatasets import __version__ as version # Append TeamCity build number if it gives us one. if 'BUILD_NUMBER' in os.environ and version.endswith('b'): version += '' + os.environ['BUILD_NUMBER'] setup( name="eodatasets", description="Packaging, metadata and provenance for GA EO datasets", version=version, packages=find_packages(exclude=('tests', 'tests.*')), package_data={ '': ['*.json'], }, install_requires=[ 'click', 'python-dateutil', 'gdal', 'numpy', 'pathlib', 'pyyaml', ], entry_points=''' [console_scripts] eod-package=eodatasets.scripts.genpackage:cli eod-generate-metadata=eodatasets.scripts.genmetadata:cli eod-generate-browse=eodatasets.scripts.genbrowse:cli ''', )
#!/usr/bin/env python # coding=utf-8 import os from setuptools import setup, find_packages from eodatasets import __version__ as version # Append TeamCity build number if it gives us one. if 'BUILD_NUMBER' in os.environ and version.endswith('b'): version += '' + os.environ['BUILD_NUMBER'] setup( name="eodatasets", description="Packaging, metadata and provenance for GA EO datasets", version=version, packages=find_packages(exclude=('tests', 'tests.*')), install_requires=[ 'click', 'python-dateutil', 'gdal', 'numpy', 'pathlib', 'pyyaml', ], entry_points=''' [console_scripts] eod-package=eodatasets.scripts.genpackage:cli eod-generate-metadata=eodatasets.scripts.genmetadata:cli eod-generate-browse=eodatasets.scripts.genbrowse:cli ''', ) Include metadata tables in package.#!/usr/bin/env python # coding=utf-8 import os from setuptools import setup, find_packages from eodatasets import __version__ as version # Append TeamCity build number if it gives us one. if 'BUILD_NUMBER' in os.environ and version.endswith('b'): version += '' + os.environ['BUILD_NUMBER'] setup( name="eodatasets", description="Packaging, metadata and provenance for GA EO datasets", version=version, packages=find_packages(exclude=('tests', 'tests.*')), package_data={ '': ['*.json'], }, install_requires=[ 'click', 'python-dateutil', 'gdal', 'numpy', 'pathlib', 'pyyaml', ], entry_points=''' [console_scripts] eod-package=eodatasets.scripts.genpackage:cli eod-generate-metadata=eodatasets.scripts.genmetadata:cli eod-generate-browse=eodatasets.scripts.genbrowse:cli ''', )
<commit_before>#!/usr/bin/env python # coding=utf-8 import os from setuptools import setup, find_packages from eodatasets import __version__ as version # Append TeamCity build number if it gives us one. if 'BUILD_NUMBER' in os.environ and version.endswith('b'): version += '' + os.environ['BUILD_NUMBER'] setup( name="eodatasets", description="Packaging, metadata and provenance for GA EO datasets", version=version, packages=find_packages(exclude=('tests', 'tests.*')), install_requires=[ 'click', 'python-dateutil', 'gdal', 'numpy', 'pathlib', 'pyyaml', ], entry_points=''' [console_scripts] eod-package=eodatasets.scripts.genpackage:cli eod-generate-metadata=eodatasets.scripts.genmetadata:cli eod-generate-browse=eodatasets.scripts.genbrowse:cli ''', ) <commit_msg>Include metadata tables in package.<commit_after>#!/usr/bin/env python # coding=utf-8 import os from setuptools import setup, find_packages from eodatasets import __version__ as version # Append TeamCity build number if it gives us one. if 'BUILD_NUMBER' in os.environ and version.endswith('b'): version += '' + os.environ['BUILD_NUMBER'] setup( name="eodatasets", description="Packaging, metadata and provenance for GA EO datasets", version=version, packages=find_packages(exclude=('tests', 'tests.*')), package_data={ '': ['*.json'], }, install_requires=[ 'click', 'python-dateutil', 'gdal', 'numpy', 'pathlib', 'pyyaml', ], entry_points=''' [console_scripts] eod-package=eodatasets.scripts.genpackage:cli eod-generate-metadata=eodatasets.scripts.genmetadata:cli eod-generate-browse=eodatasets.scripts.genbrowse:cli ''', )