commit stringlengths 40 40 | old_file stringlengths 4 150 | new_file stringlengths 4 150 | old_contents stringlengths 0 3.26k | new_contents stringlengths 1 4.43k | subject stringlengths 15 501 | message stringlengths 15 4.06k | lang stringclasses 4
values | license stringclasses 13
values | repos stringlengths 5 91.5k | diff stringlengths 0 4.35k |
|---|---|---|---|---|---|---|---|---|---|---|
1a594aec0b5af4c815c90d9a19abdf941fb5f5e4 | cogs/command_log.py | cogs/command_log.py | import logging
class CommandLog:
"""A simple cog to log commands executed."""
def __init__(self):
self.log = logging.getLogger('liara.command_log')
async def on_command(self, ctx):
kwargs = ', '.join(['{}={}'.format(k, repr(v)) for k, v in ctx.kwargs.items()])
args = 'with argumen... | import logging
class CommandLog:
"""A simple cog to log commands executed."""
def __init__(self):
self.log = logging.getLogger('liara.command_log')
async def on_command(self, ctx):
kwargs = ', '.join(['{}={}'.format(k, repr(v)) for k, v in ctx.kwargs.items()])
args = 'with argumen... | Add the shard ID to the command log | Add the shard ID to the command log
| Python | mit | Thessia/Liara | ---
+++
@@ -9,8 +9,11 @@
async def on_command(self, ctx):
kwargs = ', '.join(['{}={}'.format(k, repr(v)) for k, v in ctx.kwargs.items()])
args = 'with arguments {} '.format(kwargs) if kwargs else ''
- self.log.info('{0.author} ({0.author.id}) executed command "{0.command}" {1}in {0.guild... |
cdcc2dd6342b47e1387beca54677ff7114fc48ec | cms/tests/test_externals.py | cms/tests/test_externals.py | from django.test import TestCase
from ..externals import External
try:
from contextlib import GeneratorContextManager
except ImportError:
from contextlib import _GeneratorContextManager as GeneratorContextManager
from types import FunctionType
class TestExternals(TestCase):
def test_load(self):
... | from django.test import TestCase
from ..externals import External
try:
from contextlib import GeneratorContextManager
except ImportError:
from contextlib import _GeneratorContextManager as GeneratorContextManager
from types import FunctionType
class TestExternals(TestCase):
def test_load(self):
... | Improve test coverage of externals. | Improve test coverage of externals.
| Python | bsd-3-clause | dan-gamble/cms,jamesfoley/cms,dan-gamble/cms,lewiscollard/cms,jamesfoley/cms,dan-gamble/cms,jamesfoley/cms,danielsamuels/cms,danielsamuels/cms,lewiscollard/cms,lewiscollard/cms,danielsamuels/cms,jamesfoley/cms | ---
+++
@@ -34,3 +34,6 @@
self.assertIs(type(external.context_manager('')), FunctionType)
self.assertIsInstance(external.context_manager('')(), GeneratorContextManager)
self.assertTrue(external.context_manager('', fallback=True))
+
+ with external.context_manager('')():
+ ... |
67eeb5c7638b15a7f01f60260408fd3aefad549a | meinberlin/apps/offlineevents/templatetags/offlineevent_tags.py | meinberlin/apps/offlineevents/templatetags/offlineevent_tags.py | from functools import cmp_to_key
from django import template
from adhocracy4.modules.models import Module
from adhocracy4.phases.models import Phase
from meinberlin.apps.offlineevents.models import OfflineEvent
register = template.Library()
@register.assignment_tag
def offlineevents_and_modules_sorted(project):
... | from functools import cmp_to_key
from django import template
from adhocracy4.modules.models import Module
from adhocracy4.phases.models import Phase
from meinberlin.apps.offlineevents.models import OfflineEvent
register = template.Library()
@register.assignment_tag
def offlineevents_and_modules_sorted(project):
... | Make comparison of dates more explicit | Make comparison of dates more explicit
| Python | agpl-3.0 | liqd/a4-meinberlin,liqd/a4-meinberlin,liqd/a4-meinberlin,liqd/a4-meinberlin | ---
+++
@@ -18,15 +18,20 @@
def _cmp(x, y):
- x = x.first_phase_start_date if isinstance(x, Module) else x.date
- if x is None:
+ x_date = x.first_phase_start_date if isinstance(x, Module) else x.date
+ if x_date is None:
return 1
- y = y.first_phase_start_date if isinstance(y, Module) ... |
dc04ba245522fe5b9376aa30621bffd8c02b600a | huxley/__init__.py | huxley/__init__.py | # Copyright (c) 2013 Facebook
#
# 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,... | # Copyright (c) 2013 Facebook
#
# 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,... | Fix __version__ missing for setuptools | Fix __version__ missing for setuptools
| Python | apache-2.0 | ijl/gossamer,ijl/gossamer | ---
+++
@@ -17,5 +17,6 @@
"""
from huxley.integration import HuxleyTestCase, unittest_main
+from huxley.version import __version__
__all__ = ['HuxleyTestCase', 'unittest_main', ] |
336d778a49e0e09996ea647b8a1c3c9e414dd313 | jenkins/test/validators/common.py | jenkins/test/validators/common.py | ''' Provide common utils to validators '''
import subprocess
import sys
# Run cli command. By default, exit when an error occurs
def run_cli_cmd(cmd, exit_on_fail=True):
'''Run a command and return its output'''
print "Running system command: " + cmd
proc = subprocess.Popen(cmd, bufsize=-1, stderr=subproce... | ''' Provide common utils to validators '''
import subprocess
import sys
# Run cli command. By default, exit when an error occurs
def run_cli_cmd(cmd, exit_on_fail=True):
'''Run a command and return its output'''
print "Running system command: " + " ".join(cmd)
proc = subprocess.Popen(cmd, bufsize=-1, stder... | Fix logging for system commands in CI | Fix logging for system commands in CI
| Python | apache-2.0 | tiwillia/openshift-tools,joelsmith/openshift-tools,tiwillia/openshift-tools,openshift/openshift-tools,joelddiaz/openshift-tools,joelddiaz/openshift-tools,twiest/openshift-tools,joelsmith/openshift-tools,blrm/openshift-tools,ivanhorvath/openshift-tools,rhdedgar/openshift-tools,rhdedgar/openshift-tools,drewandersonnz/ope... | ---
+++
@@ -5,7 +5,7 @@
# Run cli command. By default, exit when an error occurs
def run_cli_cmd(cmd, exit_on_fail=True):
'''Run a command and return its output'''
- print "Running system command: " + cmd
+ print "Running system command: " + " ".join(cmd)
proc = subprocess.Popen(cmd, bufsize=-1, std... |
111019266e15f59a358c0842815cd7368d89982f | rbm2m/views/public.py | rbm2m/views/public.py | # -*- coding: utf-8 -*-
import logging
from flask import Blueprint, render_template, request, send_from_directory, current_app
from ..webapp import db
from ..action import export_manager, genre_manager, exporter
bp = Blueprint('public', __name__)
logger = logging.getLogger(__name__)
@bp.route('/yml')
def yml():
... | # -*- coding: utf-8 -*-
import logging
from flask import Blueprint, render_template, request, send_from_directory, current_app
from ..webapp import db
from ..action import export_manager, genre_manager, exporter
bp = Blueprint('public', __name__)
logger = logging.getLogger(__name__)
@bp.route('/yml')
def yml():
... | Use HTTP_X_REAL_IP to determine client ip address | Use HTTP_X_REAL_IP to determine client ip address
| Python | apache-2.0 | notapresent/rbm2m,notapresent/rbm2m | ---
+++
@@ -17,7 +17,7 @@
YML export endpoint
"""
exp = exporter.YMLExporter(db.session)
- exp.log_export(request.remote_addr, request.user_agent)
+ exp.log_export(client_ip(), request.user_agent)
ctx = {
'generation_date': exp.generation_date(),
@@ -46,3 +46,13 @@
@bp.route(... |
30c97e8a377b40f42855d38167768f9eb8e374fc | base/views.py | base/views.py | from .utils import SESSION_KEY_CURRENT_OS
from .forms import OSForm
class CurrentOSMixin(object):
allowed_oses = OSForm.OS_CHOICES
def get_context_data(self, **kwargs):
"""Inject current active OS key and the choice form into context.
"""
# Zip the 2-tuple into a [keys, values] gener... | from .utils import SESSION_KEY_CURRENT_OS
from .forms import OSForm
class CurrentOSMixin(object):
allowed_oses = OSForm.OS_CHOICES
def get_context_data(self, **kwargs):
"""Inject current active OS key and the choice form into context.
"""
# Zip the 2-tuple into a [keys, values] gener... | Use form variable instead hard-coding | Use form variable instead hard-coding
| Python | mit | djangogirlstaipei/djangogirlstaipei,djangogirlstaipei/djangogirlstaipei,djangogirlstaipei/djangogirlstaipei | ---
+++
@@ -15,7 +15,7 @@
os = self.request.session.get(SESSION_KEY_CURRENT_OS)
if os not in allowed_os_keys:
- os = 'windows'
+ os = OSForm.OS_CHOICES[0][0]
os_form = OSForm(initial={'os': os})
kwargs.update({'current_os': os, 'os_form': os_form})
... |
621432d1bafe54220ad22afc285aae1c71de0875 | custom/icds_reports/tasks.py | custom/icds_reports/tasks.py | import os
from celery.schedules import crontab
from celery.task import periodic_task
from django.conf import settings
from django.db import connections
@periodic_task(run_every=crontab(minute=0, hour=0), acks_late=True)
def move_ucr_data_into_aggregation_tables():
if hasattr(settings, "ICDS_UCR_DATABASE_ALIAS"... | import logging
import os
from celery.schedules import crontab
from celery.task import periodic_task
from django.conf import settings
from django.db import connections
celery_task_logger = logging.getLogger('celery.task')
@periodic_task(run_every=crontab(minute=0, hour=0), acks_late=True)
def move_ucr_data_into_agg... | Add logging to icds reports task | Add logging to icds reports task
| Python | bsd-3-clause | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | ---
+++
@@ -1,3 +1,4 @@
+import logging
import os
from celery.schedules import crontab
@@ -5,6 +6,8 @@
from django.conf import settings
from django.db import connections
+
+celery_task_logger = logging.getLogger('celery.task')
@periodic_task(run_every=crontab(minute=0, hour=0), acks_late=True)
@@ -14,12 ... |
352ab7fa385835bd68b42eb60a5b149bcfb28865 | pyblogit/posts.py | pyblogit/posts.py | """
pyblogit.posts
~~~~~~~~~~~~~~
This module contains the data model to represent blog posts and methods
to manipulate it.
"""
class post(object):
def __init__(self, post_id, title, url, author, content, images, labels,
status):
self._post_id = post_id
self._title = title
sel... | """
pyblogit.posts
~~~~~~~~~~~~~~
This module contains the data model to represent blog posts and methods
to manipulate it.
"""
class post(object):
"""The post data model"""
def __init__(self, post_id, title, url, author, content, images, labels,
status):
self._post_id = post_id
s... | Add docstring to Post class | Add docstring to Post class
| Python | mit | jamalmoir/pyblogit | ---
+++
@@ -7,6 +7,7 @@
"""
class post(object):
+ """The post data model"""
def __init__(self, post_id, title, url, author, content, images, labels,
status): |
7d0300b8571fc0732818e194644a6a669c69ffeb | src/Spill/runtests.py | src/Spill/runtests.py | import subprocess
import unittest
import glob
def runTestcase(self, input_file, result_file):
spillProg = subprocess.Popen(['./spill', input_file],stdout=subprocess.PIPE)
idProg = subprocess.Popen(['./id', result_file],stdout=subprocess.PIPE)
with open(result_file) as results:
self.assertEqual(spil... | import subprocess
import unittest
import glob
def runTestcase(self, input_file, result_file):
spillProg = subprocess.Popen(['runghc', '-i../../src', 'Main.hs', input_file],stdout=subprocess.PIPE)
idProg = subprocess.Popen(['runghc', '-i../../src', 'Id.hs', result_file],stdout=subprocess.PIPE)
with open(res... | Use runghc instead of executables | Use runghc instead of executables
| Python | bsd-3-clause | mhuesch/scheme_compiler,mhuesch/scheme_compiler | ---
+++
@@ -3,8 +3,8 @@
import glob
def runTestcase(self, input_file, result_file):
- spillProg = subprocess.Popen(['./spill', input_file],stdout=subprocess.PIPE)
- idProg = subprocess.Popen(['./id', result_file],stdout=subprocess.PIPE)
+ spillProg = subprocess.Popen(['runghc', '-i../../src', 'Main.hs', ... |
c47df6cf4533676c33ca3466cb269657df3e228f | intexration/__main__.py | intexration/__main__.py | import argparse
import logging.config
import os
from intexration import settings
from intexration.server import Server
# Logger
logging.config.fileConfig(settings.LOGGING_FILE)
def main():
parser = argparse.ArgumentParser()
parser.add_argument('-host', help='Change the hostname')
parser.add_argument('-po... | import argparse
import logging.config
from intexration import settings
from intexration.server import Server
# Logger
logging.config.fileConfig(settings.LOGGING_FILE)
def main():
parser = argparse.ArgumentParser()
parser.add_argument('-host', help='Change the hostname')
parser.add_argument('-port', help=... | Set config contained a bug after refactoring | Set config contained a bug after refactoring
| Python | apache-2.0 | JDevlieghere/InTeXration,JDevlieghere/InTeXration | ---
+++
@@ -1,6 +1,5 @@
import argparse
import logging.config
-import os
from intexration import settings
from intexration.server import Server
@@ -15,10 +14,10 @@
args = parser.parse_args()
if args.host is not None:
- settings.set_config('host', args.host)
+ settings.set_config('SERVE... |
0d8282f31b74b6546f07fa37e88b59ed12e945c8 | scripts/test_import_optional.py | scripts/test_import_optional.py | #!/usr/bin/env python3
import os
import subprocess
import sys
neonc = sys.argv[1]
executor = sys.argv[2:]
out = subprocess.check_output([neonc, "t/import-optional-missing.neon"], env={"NEONPATH": "t/compile-time-only"}, stderr=subprocess.STDOUT, universal_newlines=True)
sys.stdout.write(out)
if "not found" in out:
... | #!/usr/bin/env python3
import os
import subprocess
import sys
neonc = sys.argv[1]
executor = sys.argv[2:]
out = subprocess.check_output([neonc, "-o", "tmp/import-optional-missing.neonx", "t/import-optional-missing.neon"], env={"NEONPATH": "t/compile-time-only"}, stderr=subprocess.STDOUT, universal_newlines=True)
sys... | Fix up import optional test to use temporary compiled file | Fix up import optional test to use temporary compiled file
| Python | mit | ghewgill/neon-lang,ghewgill/neon-lang,ghewgill/neon-lang,ghewgill/neon-lang,ghewgill/neon-lang,ghewgill/neon-lang,ghewgill/neon-lang,ghewgill/neon-lang,ghewgill/neon-lang,ghewgill/neon-lang | ---
+++
@@ -7,9 +7,9 @@
neonc = sys.argv[1]
executor = sys.argv[2:]
-out = subprocess.check_output([neonc, "t/import-optional-missing.neon"], env={"NEONPATH": "t/compile-time-only"}, stderr=subprocess.STDOUT, universal_newlines=True)
+out = subprocess.check_output([neonc, "-o", "tmp/import-optional-missing.neonx"... |
e83ba5e0eef34e7e5acaad95a490d2e078325842 | pip_accel/logger.py | pip_accel/logger.py | # Logging for the pip accelerator.
#
# Author: Peter Odding <peter.odding@paylogic.eu>
# Last Change: July 21, 2013
# URL: https://github.com/paylogic/pip-accel
"""
Logging for the pip accelerator.
"""
# Standard library modules.
import logging
import os
import sys
# External dependency.
import coloredlogs
coloredlo... | # Logging for the pip accelerator.
#
# Author: Peter Odding <peter.odding@paylogic.eu>
# Last Change: July 21, 2013
# URL: https://github.com/paylogic/pip-accel
"""
Logging for the pip accelerator.
"""
# Standard library modules.
import logging
import os
import sys
# External dependency.
import coloredlogs
coloredlo... | Set logging level to INFO (changed to DEBUG in 47c50c0) | Set logging level to INFO (changed to DEBUG in 47c50c0)
IMHO, it's a UX issue. | Python | mit | paylogic/pip-accel,theyoprst/pip-accel,pombredanne/pip-accel,matysek/pip-accel,matysek/pip-accel,theyoprst/pip-accel,paylogic/pip-accel,pombredanne/pip-accel | ---
+++
@@ -19,7 +19,7 @@
# Initialize the logging subsystem.
logger = logging.getLogger('pip-accel')
-logger.setLevel(logging.DEBUG)
+logger.setLevel(logging.INFO)
# Check if the operator requested verbose output.
if '-v' in sys.argv or 'PIP_ACCEL_VERBOSE' in os.environ: |
c9587decdb67474959e1957378f6a4987e4c320a | apps/welcome/urls.py | apps/welcome/urls.py | from django.conf.urls.defaults import *
# Smrtr
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^1$', 'welcome.views.profile', name='welcome-1' ),
url(r'^2$', 'network.views.search', {'next': 'home'}, name='welcome-2'... | from django.conf.urls.defaults import *
from django.core.urlresolvers import reverse
# Smrtr
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^1$', 'welcome.views.profile', name='welcome-1' ),
url(r'^2$', 'network.view... | Add select modules to the welcome steps. Redirect fixes to skip | Add select modules to the welcome steps. Redirect fixes to skip
| Python | bsd-3-clause | mfitzp/smrtr,mfitzp/smrtr | ---
+++
@@ -1,4 +1,5 @@
from django.conf.urls.defaults import *
+from django.core.urlresolvers import reverse
# Smrtr
# Uncomment the next two lines to enable the admin:
@@ -9,7 +10,7 @@
urlpatterns = patterns('',
url(r'^1$', 'welcome.views.profile', name='welcome-1' ),
- url(r'^2$', 'network.views.se... |
513d8e83dc7aea052682df2bc93cd146b6799406 | client/examples/cycle-cards.py | client/examples/cycle-cards.py | #!/bin/python
import removinator
import subprocess
# This example cycles through each card slot in the Removinator. Any
# slots that have a card present will then have the certificates on the
# card printed out using the pkcs15-tool utility, which is provided by
# the OpenSC project.
#
# Examples of parsing the Remo... | #!/usr/bin/env python
import removinator
import subprocess
# This example cycles through each card slot in the Removinator. Any
# slots that have a card present will then have the certificates on the
# card printed out using the pkcs15-tool utility, which is provided by
# the OpenSC project.
#
# Examples of parsing ... | Use python from env in example script | Use python from env in example script
This makes the cycle-cards example script use python from the env
instead of harcoding the location. This allows a virtualenv to be
easily used.
| Python | apache-2.0 | nkinder/smart-card-removinator | ---
+++
@@ -1,4 +1,4 @@
-#!/bin/python
+#!/usr/bin/env python
import removinator
import subprocess |
725bfcc3484826083c3e6cdca71b4af41b37a9c9 | runtests.py | runtests.py | #!/usr/bin/env python
import sys
from django.conf import settings
from django.core.management import execute_from_command_line
if not settings.configured:
settings.configure(
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
},
INST... | #!/usr/bin/env python
import sys
from django.conf import settings
from django.core.management import execute_from_command_line
if not settings.configured:
settings.configure(
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
},
INST... | Make sure tests are found in Django 1.6 | Make sure tests are found in Django 1.6
| Python | apache-2.0 | jpotterm/django-fluent-contents,ixc/django-fluent-contents,edoburu/django-fluent-contents,jpotterm/django-fluent-contents,ixc/django-fluent-contents,django-fluent/django-fluent-contents,jpotterm/django-fluent-contents,ixc/django-fluent-contents,django-fluent/django-fluent-contents,django-fluent/django-fluent-contents,e... | ---
+++
@@ -20,8 +20,9 @@
'fluent_contents.tests.testapp',
),
ROOT_URLCONF = 'fluent_contents.tests.testapp.urls',
+ TEST_RUNNER='django.test.simple.DjangoTestSuiteRunner', # for Django 1.6, see https://docs.djangoproject.com/en/dev/releases/1.6/#new-test-runner
+ SITE_I... |
8fcf73183f895b6dc1dc7ebff847cbb2465c2b93 | main.py | main.py | #!/usr/bin/env python3
| #!/usr/bin/env python3
import argparse
import discord
import asyncio
class commands():
async def test(client, message, args):
await client.send_message(message.channel, "Tested!")
async def testedit(client, message, args):
sleep_time = 5
if len(args) > 0:
try: sleep_time = int(args[0])
except: pass
m... | Add chat command framework and basic test commands. | Add chat command framework and basic test commands.
| Python | agpl-3.0 | TransportLayer/TransportLayerBot-Discord | ---
+++
@@ -1,2 +1,53 @@
#!/usr/bin/env python3
+import argparse
+import discord
+import asyncio
+
+class commands():
+ async def test(client, message, args):
+ await client.send_message(message.channel, "Tested!")
+
+ async def testedit(client, message, args):
+ sleep_time = 5
+ if len(args) > 0:
+ try: slee... |
34211cad2b2601027af46bee63129fc39890f8d4 | main.py | main.py | # -*- coding: utf-8 -*-
"""
url-shortener
==============
An application for generating and storing shorter aliases for
requested URLs. Uses `spam-lists`__ to prevent generating a short URL
for an address recognized as spam, or to warn a user a pre-existing
short alias has a target that has been later recognized as spa... | # -*- coding: utf-8 -*-
"""
url-shortener
==============
An application for generating and storing shorter aliases for
requested URLs. Uses `spam-lists`__ to prevent generating a short URL
for an address recognized as spam, or to warn a user a pre-existing
short alias has a target that has been later recognized as spa... | Replace a redundant reference to app.config | Replace a redundant reference to app.config
| Python | mit | piotr-rusin/url-shortener,piotr-rusin/url-shortener | ---
+++
@@ -25,7 +25,7 @@
if not app.debug and log_file is not None:
import logging
from logging.handlers import TimedRotatingFileHandler
- file_handler = TimedRotatingFileHandler(app.config['LOG_FILE'], when='d')
+ file_handler = TimedRotatingFileHandler(log_file, when='d')
file_handler.setLeve... |
c7b57235b669c3fac99bc1380d667fdd71e8ca3c | main.py | main.py | import slackclient
import time
import os
slackClient = slackclient.SlackClient(os.environ["SLACK_TOKEN"])
slackClient.rtm_connect()
while True:
print(slackClient.rtm_read())
time.sleep(5)
| import slackclient
import time
import os
slackClient = slackclient.SlackClient(os.environ["SLACK_TOKEN"])
slackClient.rtm_connect()
slackClient.api_call("channels.join", name="#electrical")
while True:
for message in slackClient.rtm_read():
print(message)
if message["type"] == "team_join":
... | Add welcome message pinging using real time api | Add welcome message pinging using real time api
| Python | mit | ollien/Slack-Welcome-Bot | ---
+++
@@ -4,7 +4,14 @@
slackClient = slackclient.SlackClient(os.environ["SLACK_TOKEN"])
slackClient.rtm_connect()
-
+slackClient.api_call("channels.join", name="#electrical")
while True:
- print(slackClient.rtm_read())
+ for message in slackClient.rtm_read():
+ print(message)
+ if message["... |
f56582dfcd8519a81c40d0df17df54f91f33f665 | main.py | main.py | # Copyright (c) 2013 Tom McLoughlin
import socket
# Configuration
myNick = "Bot"
myIdent = "Bot"
myReal = "Bot"
myIRC = "irc.example.org"
myPort = "6667"
myChan = "#example" # only supports a single channel
# Do not edit below this line
socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
socket.connect(my... | # Copyright (c) 2013 Tom McLoughlin
import socket
# Configuration
myNick = "Bot"
myIdent = "Bot"
myReal = "Bot"
myIRC = "irc.example.org"
myPort = "6667"
myChan = "#example" # only supports a single channel
# Do not edit below this line
socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
socket.connect(my... | Fix typo on line 15 | Fix typo on line 15 | Python | mit | TommehM/pybot | ---
+++
@@ -11,8 +11,8 @@
# Do not edit below this line
socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
socket.connect(myIRC,myPort)
-socket.send( 'NICK ',myNick
-)socket.send( 'USER ',myIdent, myIdent, myIdent' :',myReal'\r\n' )
+socket.send( 'NICK ',myNick )
+socket.send( 'USER ',myIdent, myIdent, my... |
39650fe82bea3fc2bc036b8292f6f0b783b2b4d6 | ecmd-core/pyapi/init/__init__.py | ecmd-core/pyapi/init/__init__.py | # import the right SWIG module depending on Python version
from sys import version_info
from sys import path as sys_path
from os import path as os_path
if version_info[0] >= 3:
sys_path.insert(0, os_path.join(os_path.dirname(__file__), "python3"))
from .python3 import *
else:
sys_path.insert(0, os_path.join... | # import the right SWIG module depending on Python version
from sys import version_info
from sys import path as sys_path
from os import path as os_path
if version_info[0] >= 3:
sys_path.append(os_path.join(os_path.dirname(__file__), "python3"))
from .python3 import *
else:
sys_path.append(os_path.join(os_pa... | Append version specific path to os.path rather than prepend | pyapi: Append version specific path to os.path rather than prepend
Other code might depend on os.path[0] being the path of the executed
script, and there is no need for our new path to be at the front.
| Python | apache-2.0 | open-power/eCMD,open-power/eCMD,open-power/eCMD,open-power/eCMD,open-power/eCMD | ---
+++
@@ -3,9 +3,9 @@
from sys import path as sys_path
from os import path as os_path
if version_info[0] >= 3:
- sys_path.insert(0, os_path.join(os_path.dirname(__file__), "python3"))
+ sys_path.append(os_path.join(os_path.dirname(__file__), "python3"))
from .python3 import *
else:
- sys_path.inse... |
52abe8ef49f77ce859cba0a9042ea5761fcbcd90 | fusionpy/__init__.py | fusionpy/__init__.py | #!/usr/bin/python
from __future__ import print_function
__all__ = ['Fusion', 'FusionCollection', 'FusionError', 'FusionRequester', 'HttpFusionRequester']
class FusionError(IOError):
def __init__(self, response, request_body=None, message=None, url=None):
if message is None:
message = ""
... | #!/usr/bin/python
from __future__ import print_function
__all__ = ['Fusion', 'FusionCollection', 'FusionError', 'FusionRequester', 'HttpFusionRequester']
class FusionError(IOError):
def __init__(self, response, request_body=None, message=None, url=None):
"""
:param response: The HTTP response, hav... | Deal with strings in the first param to the FusionError constructor | Deal with strings in the first param to the FusionError constructor
| Python | mit | ke4roh/fusionpy | ---
+++
@@ -3,18 +3,28 @@
__all__ = ['Fusion', 'FusionCollection', 'FusionError', 'FusionRequester', 'HttpFusionRequester']
-
class FusionError(IOError):
def __init__(self, response, request_body=None, message=None, url=None):
+ """
+ :param response: The HTTP response, having attributes .bod... |
709c45c39007692eecfcaa814ebb711b388670b1 | functional_tests.py | functional_tests.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Here are all the functional tests for the ludobox-ui application.
Those test are based on real life data provided by DCALK team members.
The objective of those test is to check that valid, real life input should
produce valid, real life output. We are not testing for ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Here are all the functional tests for the ludobox-ui application.
Those test are based on real life data provided by DCALK team members.
The objective of those test is to check that valid, real life input should
produce valid, real life output. We are not testing for ... | Add real life test to functional tests... problem the actual code is at the moent not able to run on custom locations. | Add real life test to functional tests... problem the actual code is at the moent not able to run on custom locations.
| Python | agpl-3.0 | ludobox/ludobox,ludobox/ludobox-ui,ludobox/ludobox,ludobox/ludobox,ludobox/ludobox,ludobox/ludobox-ui,ludobox/ludobox-ui | ---
+++
@@ -14,9 +14,16 @@
from __future__ import unicode_literals
from __future__ import division
from __future__ import print_function
+from __future__ import absolute_import
-def test_dummy1():
- assert True
+# ludocore
+from ludocore import generate_all
+from ludocore import clean
-def test_dummy2():
- ... |
3b66c6d8e2945d783904ba0f220772861e8e20ef | linguine/ops/StanfordCoreNLP.py | linguine/ops/StanfordCoreNLP.py | #!/usr/bin/env python
import os
"""
Performs some core NLP operations as a proof of concept for the library.
"""
from stanford_corenlp_pywrapper import CoreNLP
class StanfordCoreNLP:
proc = None
"""
When the JSON segments return from the CoreNLP library, they
separate the data acquired from eac... | #!/usr/bin/env python
import os
"""
Performs some core NLP operations as a proof of concept for the library.
"""
from stanford_corenlp_pywrapper import CoreNLP
class StanfordCoreNLP:
proc = None
"""
When the JSON segments return from the CoreNLP library, they
separate the data acquired from eac... | Allow relative paths for corenlp deps | Allow relative paths for corenlp deps
| Python | mit | rigatoni/linguine-python,Pastafarians/linguine-python | ---
+++
@@ -39,10 +39,9 @@
def __init__(self, analysisType):
self.analysisType = analysisType
- coreNLPPath = os.path.join(os.path.dirname(__file__), '../../lib/stanfordCoreNLP.jar')
- coreNLPModelsPath = os.path.join(os.path.dirname(__file__), '../../lib/stanfordCoreNLPModels.jar')
... |
2add786f3173754f95900e0027cd78934a454bcf | salt/modules/mysql.py | salt/modules/mysql.py | '''
Module to provide MySQL compatibility to salt.
In order to connect to MySQL, certain configuration is required
in /etc/salt/minion on the relevant minions. Some sample configs
might look like:
mysql.host: 'localhost'
mysql.port: 3306
mysql.user: 'root'
mysql.pass: ''
mysql.db: 'mysql'
'''
import MySQLdb
__opts... | '''
Module to provide MySQL compatibility to salt.
In order to connect to MySQL, certain configuration is required
in /etc/salt/minion on the relevant minions. Some sample configs
might look like:
mysql.host: 'localhost'
mysql.port: 3306
mysql.user: 'root'
mysql.pass: ''
mysql.db: 'mysql'
'''
import MySQLdb
__opts... | Change _connect to connect, so that it can be used from within other modules | Change _connect to connect, so that it can be used from within other modules
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | ---
+++
@@ -16,7 +16,7 @@
__opts__ = {}
-def _connect():
+def connect():
'''
wrap authentication credentials here
'''
@@ -47,7 +47,7 @@
salt '*' mysql.status
'''
ret = {}
- db = _connect()
+ db = connect()
cur = db.cursor()
cur.execute('SHOW STATUS')
for i in xr... |
9ddc347b8f44f2c4ac4b74725cfa258abaeb1398 | blackjack.py | blackjack.py | import random
class Blackjack:
def __init__(self):
self.deck = range(1, 53)
self.shuffle()
self.deal()
def shuffle(self):
random.shuffle(self.deck)
def deal(self):
self.player = [None, None]
self.dealer = [None, None]
for i in xrange(4):
... | import random
class Blackjack:
def __init__(self):
self.deck = range(1, 53)
self.shuffle()
self.deal()
def shuffle(self):
random.shuffle(self.deck)
def deal(self):
self.player = [None, None]
self.dealer = [None, None]
for i in xrange(4):
... | Make it so we don't rely on weird rounding in python to assign card to the correct index | Make it so we don't rely on weird rounding in python to assign card to the correct index
| Python | mit | JustinTulloss/blackjack | ---
+++
@@ -17,7 +17,7 @@
if i % 2:
self.player[i/2] = self.deck.pop()
else:
- self.dealer[i/2] = self.deck.pop()
+ self.dealer[(i-1)/2] = self.deck.pop()
if __name__ == "__main__":
""" |
56df83132b6885f8ef753fee42a39daff72f2f12 | celery_app.py | celery_app.py | from flask import g
from app import app, app_mongo
from celery import Celery
celery = Celery(app.import_name, broker=app.config['CELERY_BROKER_URL'], backend=app.config["CELERY_RESULT_BACKEND"])
celery.conf.update(app.config)
task_base = celery.Task
class ContextTask(task_base):
abstract = True
def __call_... | from flask import g
from app import app, app_mongo
from celery import Celery
celery = Celery(app.import_name, broker=app.config['CELERY_BROKER_URL'], backend=app.config["CELERY_RESULT_BACKEND"])
celery.conf.update(app.config)
task_base = celery.Task
class ContextTask(task_base):
abstract = True
def __call_... | Add json to accepted celery content | Add json to accepted celery content
celery.conf.CELERY_ACCEPT_CONTENT accepts only json
| Python | mit | tritanium-industries/TITDev,macalik/TITDev,tritanium-industries/TITDev,macalik/TITDev,tritanium-industries/TITDev,macalik/TITDev | ---
+++
@@ -21,5 +21,6 @@
celery.Task = ContextTask
# Security Concerns (http://docs.celeryproject.org/en/latest/faq.html#is-celery-dependent-on-pickle)
+celery.conf.CELERY_ACCEPT_CONTENT = ["json", "application/json"]
celery.conf.CELERY_TASK_SERIALIZER = "json"
celery.conf.CELERY_RESULT_SERIALIZER = "json" |
c09e01d6d7b98d2f2b0a99fea20988d422c1a1bd | test_collision/test_worlds.py | test_collision/test_worlds.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_collision.test_worlds
"""
from __future__ import unicode_literals, print_function, absolute_import
import unittest
import bullet
class DiscreteDynamicsWorldTestCase(unittest.TestCase):
def setUp(self):
pass
def test_ctor(self):
pass
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_collision.test_worlds
"""
from __future__ import unicode_literals, print_function, absolute_import
import unittest
import bullet
class DiscreteDynamicsWorldTestCase(unittest.TestCase):
def setUp(self):
self.solver = bullet.btSequentialImpulseConstra... | Add tests for implemented methods | Add tests for implemented methods
| Python | mit | Klumhru/boost-python-bullet,Klumhru/boost-python-bullet,Klumhru/boost-python-bullet | ---
+++
@@ -12,10 +12,45 @@
class DiscreteDynamicsWorldTestCase(unittest.TestCase):
def setUp(self):
- pass
+ self.solver = bullet.btSequentialImpulseConstraintSolver()
+ self.cinfo = bullet.btDefaultCollisionConstructionInfo()
+ self.collision_config = \
+ bullet.btDefa... |
d82e1ab6b94df47b9b9693cf09162f1f579e9eee | django_countries/widgets.py | django_countries/widgets.py | from django.conf import settings
from django.forms import widgets
from django.utils.safestring import mark_safe
COUNTRY_CHANGE_HANDLER = """
this.nextSibling.src = this.nextSibling.src.replace(/[a-z_]{2}(\.[a-zA-Z]*)$/, (this.value.toLowerCase() || '__') + '$1');
"""
FLAG_IMAGE = """<img style="margin: 6px 4px; posit... | from django.conf import settings
from django.forms import widgets
from django.utils.safestring import mark_safe
COUNTRY_CHANGE_HANDLER = """
this.nextSibling.src = %s.replace('{code}', this.value.toLowerCase() || '__').replace('{code_upper}', this.value.toUpperCase() || '__');
"""
FLAG_IMAGE = """<img style="margin: ... | Use the original COUNTRIES_FLAG_URL string for the JS replace. | Use the original COUNTRIES_FLAG_URL string for the JS replace.
| Python | mit | velfimov/django-countries,pimlie/django-countries,schinckel/django-countries,fladi/django-countries,SmileyChris/django-countries,jrfernandes/django-countries,rahimnathwani/django-countries | ---
+++
@@ -3,7 +3,7 @@
from django.utils.safestring import mark_safe
COUNTRY_CHANGE_HANDLER = """
-this.nextSibling.src = this.nextSibling.src.replace(/[a-z_]{2}(\.[a-zA-Z]*)$/, (this.value.toLowerCase() || '__') + '$1');
+this.nextSibling.src = %s.replace('{code}', this.value.toLowerCase() || '__').replace('{co... |
9d961fb5f50882de687278996365233dc0794123 | scripts/get_images.py | scripts/get_images.py | #!/usr/bin/env python3
import requests
from bs4 import BeautifulSoup
from urllib.parse import urlparse
import urllib.request
import os
def save_file(url, filename):
if (os.path.exists(filename)):
print(filename + ' already exists locally')
pass
urllib.request.urlretrieve(url, filename)
def g... | #!/usr/bin/env python3
import requests
from bs4 import BeautifulSoup
from urllib.parse import urlparse
import urllib.request
import os
def save_file(url, filename):
if (os.path.exists(filename)):
print(filename + ' already exists locally')
pass
urllib.request.urlretrieve(url, filename)
def g... | Fix image download path, thanks @cmrn | Fix image download path, thanks @cmrn
| Python | mit | makehackvoid/govhack2014,makehackvoid/govhack2014 | ---
+++
@@ -21,7 +21,8 @@
url = 'http://www.data.act.gov.au/resource/j746-krni.json'
data = requests.get(url).json()
-filedir = os.path.abspath(os.path.join(os.path.dirname(__file__), '../data/images'))
+filedir = os.path.abspath(os.path.join(os.path.dirname(__file__),
+ '../... |
6461a380e6def18ce359139b416e2e1b93e60d57 | searchapi/__init__.py | searchapi/__init__.py | import os, logging
from flask import Flask
from raven.contrib.flask import Sentry
app = Flask(__name__)
app.config.from_object(os.environ.get('SETTINGS'))
app.logger.info("\nConfiguration\n%s\n" % app.config)
# Sentry exception reporting
if 'SENTRY_DSN' in os.environ:
sentry = Sentry(app, dsn=os.environ['SENTRY... | import os, logging
from flask import Flask
from raven.contrib.flask import Sentry
app = Flask(__name__)
app.config.from_object(os.environ.get('SETTINGS'))
app.logger.debug("\nConfiguration\n%s\n" % app.config)
# Sentry exception reporting
if 'SENTRY_DSN' in os.environ:
sentry = Sentry(app, dsn=os.environ['SENTR... | Set config logging in init to debug | Set config logging in init to debug
| Python | mit | LandRegistry/search-api-alpha,LandRegistry/search-api-alpha | ---
+++
@@ -6,7 +6,7 @@
app.config.from_object(os.environ.get('SETTINGS'))
-app.logger.info("\nConfiguration\n%s\n" % app.config)
+app.logger.debug("\nConfiguration\n%s\n" % app.config)
# Sentry exception reporting
if 'SENTRY_DSN' in os.environ: |
94d6ac50b4ce48aec51d5f32989d8d4aea938868 | {{cookiecutter.repo_name}}/setup.py | {{cookiecutter.repo_name}}/setup.py | import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name = "{{cookiecutter.repo_name}}",
version = "{{cookiecutter.version}}",
author = "{{cookiecutter.full_name}}",
author_email = "{{cookiecutter.email}}"... | import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name = "{{cookiecutter.repo_name}}",
version = "{{cookiecutter.version}}",
author = "{{cookiecutter.full_name}}",
author_email = "{{cookiecutter.email}}"... | Set up console script for main | Set up console script for main
| Python | mit | hackebrot/cookiedozer,hackebrot/cookiedozer | ---
+++
@@ -23,6 +23,11 @@
package_data={
'{{cookiecutter.repo_name}}': ['*.kv*']
},
+ entry_points={
+ 'console_scripts': [
+ '{{cookiecutter.repo_name}}={{cookiecutter.repo_name}}.main:main'
+ ]
+ },
classifiers=[
'Development Status :: 2 - Pre-Alpha',... |
165e05e9641841b696ea99484e02bfd5aa0d02c1 | controllers/base_controller.py | controllers/base_controller.py | from flask import g
from flask.views import View
class BaseController(View):
"""Base Controller
The base controller of this module, it shows how to make
'class based controller' with 'Flask Pluggable view'.
You can make controller inherited from BaseController
not from Flask.View
class E... | from flask import g
from flask.views import View
class BaseController(View):
"""Base Controller
The base controller of this module, it shows how to make
'class based controller' with 'Flask Pluggable view'.
You can make controller inherited from BaseController
not from Flask.View
class E... | Move admin flag as separate method | Move admin flag as separate method
| Python | mit | openedoo/module_employee,openedoo/module_employee,openedoo/module_employee | ---
+++
@@ -18,6 +18,16 @@
methods = []
decorators = []
+ def show_admin_nav(self):
+ """Show admin navigation flag
+
+ This is just a boolean flag to help admin menu in top navigation bar
+ should show or not.
+
+ TODO: Make better implementation that show/hide admin menu
+... |
0b64ca640cff92a4e01d68b91a6f3147cc22ebd4 | myuw_mobile/logger/logresp.py | myuw_mobile/logger/logresp.py | from myuw_mobile.dao.gws import Member
from myuw_mobile.logger.logback import log_time
def log_response_time(logger, message, timer):
log_time(logger, message, timer)
def log_success_response(logger, timer):
log_time(logger,
get_identity() + 'fulfilled',
timer)
def log_data_not_... | from myuw_mobile.dao.gws import Member
from myuw_mobile.dao.sws import Schedule
from myuw_mobile.logger.logback import log_time
def log_response_time(logger, message, timer):
log_time(logger, message, timer)
def log_success_response(logger, timer):
log_time(logger,
get_identity() + 'fulfilled',... | Switch to use Schedule for identifying campus. | Switch to use Schedule for identifying campus.
| Python | apache-2.0 | fanglinfang/myuw,uw-it-aca/myuw,uw-it-aca/myuw,uw-it-aca/myuw,uw-it-aca/myuw,fanglinfang/myuw,fanglinfang/myuw | ---
+++
@@ -1,4 +1,5 @@
from myuw_mobile.dao.gws import Member
+from myuw_mobile.dao.sws import Schedule
from myuw_mobile.logger.logback import log_time
def log_response_time(logger, message, timer):
@@ -26,6 +27,7 @@
"""
res = "("
member = Member()
+ campuses = Schedule().get_cur_quarter_campu... |
5178318df905ed1a68d312adb3936e8748789b2b | tests/test_views.py | tests/test_views.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_django-watchman
------------
Tests for `django-watchman` views module.
"""
import json
import unittest
from mock import patch
from watchman import views
class TestWatchman(unittest.TestCase):
def setUp(self):
pass
@patch('watchman.views.che... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_django-watchman
------------
Tests for `django-watchman` views module.
"""
import json
import unittest
from mock import patch
from watchman import views
class TestWatchman(unittest.TestCase):
def setUp(self):
pass
@patch('watchman.views.che... | Test exception handling in `check_database` | Test exception handling in `check_database`
| Python | bsd-3-clause | JBKahn/django-watchman,mwarkentin/django-watchman,mwarkentin/django-watchman,ulope/django-watchman,gerlachry/django-watchman,blag/django-watchman,JBKahn/django-watchman,blag/django-watchman,gerlachry/django-watchman,ulope/django-watchman | ---
+++
@@ -35,5 +35,10 @@
content = json.loads(response.content)
self.assertItemsEqual(expected_checks, content.keys())
+ def test_check_database_handles_exception(self):
+ response = views.check_database('foo')
+ self.assertFalse(response['foo']['ok'])
+ self.assertEqual(... |
3f317fd63bb5b0b762661c112a8d27075b705d92 | openpassword/keychain_item.py | openpassword/keychain_item.py | from Crypto.Cipher import AES
from base64 import b64decode
import json
from openpassword.pkcs_utils import strip_byte_padding
from openpassword.openssl_utils import derive_openssl_key
class KeychainItem:
def __init__(self, item):
self.encrypted = b64decode(item["encrypted"])
def decrypt(self, decrypt... | from Crypto.Cipher import AES
from base64 import b64decode
import json
from openpassword.pkcs_utils import strip_byte_padding
from openpassword.openssl_utils import derive_openssl_key
class KeychainItem:
def __init__(self, item):
self.encrypted = b64decode(item["encrypted"])
def decrypt(self, decrypt... | Make KeychainItem _decode method static | Make KeychainItem _decode method static
| Python | mit | openpassword/blimey,openpassword/blimey | ---
+++
@@ -20,7 +20,8 @@
def _derive_decryption_key(self, decryption_key):
return derive_openssl_key(decryption_key, self.encrypted[8:16])
- def _decrypt(self, data, key_iv):
+ @staticmethod
+ def _decrypt(data, key_iv):
key = key_iv[0:16]
iv = key_iv[16:]
cipher =... |
34423fd3b4b8b4a6e257388740002343e34806ff | Scripts/Build.py | Scripts/Build.py |
import os
import json
# Get project settings
projectData = open("project.json")
projectConfig = json.load(projectData)
buildVersion = projectConfig["version"]
buildCultures = projectConfig["cultures"]
buildConfiguration = projectConfig["configuration"]
projectData.close()
# Get system settings
systemData = open("sys... |
import os
import json
# Get project settings
projectData = open("project.json")
projectConfig = json.load(projectData)
buildVersion = projectConfig["version"]
buildCultures = projectConfig["cultures"]
buildConfiguration = projectConfig["configuration"]
projectData.close()
# Get system settings
systemData = open("sys... | Remove clean command from build system | Remove clean command from build system
| Python | bsd-3-clause | arbonagw/HeliumRain,arbonagw/HeliumRain,arbonagw/HeliumRain,arbonagw/HeliumRain,arbonagw/HeliumRain | ---
+++
@@ -27,7 +27,7 @@
commandLine = buildTool
commandLine += " BuildCookRun -project=" + inputProject + " -nocompile -nocompileeditor -installed -nop4 -clientconfig=" + buildConfiguration
commandLine += " -cook -allmaps -stage -archive -archivedirectory=" + outputDir
-commandLine += " -package -ue4exe=UE4Edito... |
182a9498fd2ef5a6cc973ea42fc99b47505ae4f4 | app/submitter/convert_payload_0_0_2.py | app/submitter/convert_payload_0_0_2.py | def convert_answers_to_payload_0_0_2(answer_store, schema, routing_path):
"""
Convert answers into the data format below
'data': [
{
'value': 'Joe Bloggs',
'block_id': 'household-composition',
'answer_id': 'household-full-name',
'group_id': 'multiple-q... | def convert_answers_to_payload_0_0_2(answer_store, schema, routing_path):
"""
Convert answers into the data format below
'data': [
{
'value': 'Joe Bloggs',
'answer_id': 'household-full-name',
'group_instance': 0,
'answer_instance': 0
},
... | Remove group_id & block_id from payload docstring | Remove group_id & block_id from payload docstring
| Python | mit | ONSdigital/eq-survey-runner,ONSdigital/eq-survey-runner,ONSdigital/eq-survey-runner,ONSdigital/eq-survey-runner | ---
+++
@@ -4,25 +4,19 @@
'data': [
{
'value': 'Joe Bloggs',
- 'block_id': 'household-composition',
'answer_id': 'household-full-name',
- 'group_id': 'multiple-questions-group',
'group_instance': 0,
'answer_instance': 0
}... |
7447de560c064d251ec58ca35814f476005335ae | budgetsupervisor/transactions/forms.py | budgetsupervisor/transactions/forms.py | from django import forms
from django.conf import settings
from django.utils.dateparse import parse_datetime
import os
from .saltedge import SaltEdge
from .models import Transaction, Category
from decimal import Decimal
class ImportTransactionsForm(forms.Form):
def import_transactions(self):
app = SaltEdge... | from django import forms
from django.conf import settings
from django.utils.dateparse import parse_datetime
import os
from .saltedge import SaltEdge
from .models import Transaction, Category
from decimal import Decimal
class ImportTransactionsForm(forms.Form):
def import_transactions(self):
app = SaltEdge... | Reduce number of database queries | Reduce number of database queries
| Python | mit | ltowarek/budget-supervisor | ---
+++
@@ -14,12 +14,14 @@
response = app.get(url)
data = response.json()
+ uncategorized = Category.objects.get(name="Uncategorized")
+
for imported_transaction in data['data']:
imported_id = int(imported_transaction['id'])
escaped_category = imported_... |
d58576bc658f1433351c0cf9ac0225537e17f472 | cobe/brain.py | cobe/brain.py | # Copyright (C) 2012 Peter Teichman
import itertools
import logging
from cobe.analysis import (
AccentNormalizer, StemNormalizer, TokenNormalizer, WhitespaceAnalyzer)
from cobe.kvstore import SqliteStore
from cobe.model import Model
from cobe.search import RandomWalkSearcher
log = logging.getLogger(__name__)
c... | # Copyright (C) 2012 Peter Teichman
import itertools
import logging
from cobe.analysis import (
AccentNormalizer, StemNormalizer, WhitespaceAnalyzer)
from cobe.kvstore import SqliteStore
from cobe.model import Model
from cobe.search import RandomWalkSearcher
log = logging.getLogger(__name__)
class StandardAnal... | Remove unused import of TokenNormalizer | Remove unused import of TokenNormalizer
Fixes the build
| Python | mit | wodim/cobe-ng,LeMagnesium/cobe,pteichman/cobe,tiagochiavericosta/cobe,meska/cobe,pteichman/cobe,LeMagnesium/cobe,wodim/cobe-ng,tiagochiavericosta/cobe,DarkMio/cobe,meska/cobe,DarkMio/cobe | ---
+++
@@ -4,7 +4,7 @@
import logging
from cobe.analysis import (
- AccentNormalizer, StemNormalizer, TokenNormalizer, WhitespaceAnalyzer)
+ AccentNormalizer, StemNormalizer, WhitespaceAnalyzer)
from cobe.kvstore import SqliteStore
from cobe.model import Model
from cobe.search import RandomWalkSearcher |
49bc3e16e260765b76cb1015aa655cc7f57055d2 | benchmarks.py | benchmarks.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Standalone benchmark runner
"""
import cProfile
import pstats
import profile
import numpy as np
print("Running Rust, Python, and C++ benchmarks. 100 points, 50 runs.\n")
# calibrate
pr = profile.Profile()
calibration = np.mean([pr.calibrate(10000) for x in xrange(5)]... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Standalone benchmark runner
"""
import cProfile
import pstats
import profile
import numpy as np
print("Running Rust, Python, and C++ benchmarks. 100 points, 50 runs.\n")
# calibrate
print("Calibrating system")
pr = profile.Profile()
calibration = np.mean([pr.calibrat... | Fix up disgraceful benchmark code | Fix up disgraceful benchmark code
| Python | mit | urschrei/pypolyline,urschrei/pypolyline,urschrei/pypolyline | ---
+++
@@ -12,23 +12,23 @@
print("Running Rust, Python, and C++ benchmarks. 100 points, 50 runs.\n")
# calibrate
+print("Calibrating system")
pr = profile.Profile()
calibration = np.mean([pr.calibrate(10000) for x in xrange(5)])
# add the bias
profile.Profile.bias = calibration
+print("Calibration complete, ... |
d4b962c599a751db46e4dec2ead9828a3529c453 | getTwitter.py | getTwitter.py | import urllib2
from BeautifulSoup import *
print 'Welcome to the Get Twitter tool. This tool will allow you to download a page from Twitter to be used to extract the data'
userResponse = raw_input("Please enter the full URL from the Tweet page")
response = urllib2.urlopen(userResponse)
html = response.read()
soup = ... | import time
import urllib2
from BeautifulSoup import *
# from bs4 import *
print 'Welcome to the Get Twitter tool. This tool will allow you to download a page from Twitter to be used to extract the data.'
print "Current date & time {}".format(time.strftime("%c"))
userResponse = raw_input("Please enter the full URL f... | Call html page the date and time of get request | Call html page the date and time of get request
The html file that is outputted how has the current date and time as its name | Python | artistic-2.0 | christaylortf/FinalYearProject | ---
+++
@@ -1,12 +1,16 @@
+import time
import urllib2
from BeautifulSoup import *
+# from bs4 import *
-print 'Welcome to the Get Twitter tool. This tool will allow you to download a page from Twitter to be used to extract the data'
-userResponse = raw_input("Please enter the full URL from the Tweet page")
+pri... |
dcddc500ec8ae45c1a33a43e1727cc38c7b7e001 | blox/utils.py | blox/utils.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import ast
import sys
import struct
try:
import ujson as json
except ImportError:
import json
PY3 = sys.version_info[0] == 3
if PY3:
string_types = str,
else:
string_types = basestring,
def flatten_dtype(dtype):
dtype = str(dtype)... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import ast
import sys
import struct
import functools
try:
import ujson as json
json_dumps = json.dumps
except ImportError:
import json
json_dumps = functools.partial(json.dumps, separators=',:')
PY3 = sys.version_info[0] == 3
if PY3:
... | Write compact json when using built-in json.dumps | Write compact json when using built-in json.dumps
| Python | mit | aldanor/blox | ---
+++
@@ -5,11 +5,14 @@
import ast
import sys
import struct
+import functools
try:
import ujson as json
+ json_dumps = json.dumps
except ImportError:
import json
+ json_dumps = functools.partial(json.dumps, separators=',:')
PY3 = sys.version_info[0] == 3
@@ -38,7 +41,7 @@
def write_... |
bc012979f86b9ccd0842ef721b86a7e72811942c | brink/urls.py | brink/urls.py | def GET(route, handler):
return ("GET", route, handler)
def POST(route, handler):
return ("POST", route, handler)
def PUT(route, handler):
return ("PUT", route, handler)
def PATCH(route, handler):
return ("PATCH", route, handler)
def DELETE(route, handler):
return ("DELETE", route, handler)
... | def get(route, handler):
return ("GET", route, handler)
def post(route, handler):
return ("POST", route, handler)
def put(route, handler):
return ("PUT", route, handler)
def patch(route, handler):
return ("PATCH", route, handler)
def delete(route, handler):
return ("DELETE", route, handler)
... | Change HTTP verb function names to lower case | Change HTTP verb function names to lower case
| Python | bsd-3-clause | brinkframework/brink | ---
+++
@@ -1,22 +1,30 @@
-def GET(route, handler):
+def get(route, handler):
return ("GET", route, handler)
-def POST(route, handler):
+def post(route, handler):
return ("POST", route, handler)
-def PUT(route, handler):
+def put(route, handler):
return ("PUT", route, handler)
-def PATCH(ro... |
f41b06ca9a61b75bdb6cef0a0c534755ca80a513 | tests/unit/test_pathologic_models.py | tests/unit/test_pathologic_models.py | # -*- coding: utf-8 -*-
#######################################################################
# Name: test_pathologic_models
# Purpose: Test for grammar models that could lead to infinite loops are
# handled properly.
# Author: Igor R. Dejanović <igor DOT dejanovic AT gmail DOT com>
# Copyright: (c) 2014 Igor R. De... | # -*- coding: utf-8 -*-
#######################################################################
# Name: test_pathologic_models
# Purpose: Test for grammar models that could lead to infinite loops are
# handled properly.
# Author: Igor R. Dejanović <igor DOT dejanovic AT gmail DOT com>
# Copyright: (c) 2014 Igor R. De... | Fix in test for pathologic grammars. | Fix in test for pathologic grammars.
| Python | mit | leiyangyou/Arpeggio,leiyangyou/Arpeggio | ---
+++
@@ -10,7 +10,7 @@
from __future__ import unicode_literals
import pytest
-from arpeggio import ZeroOrMore, Optional, ParserPython, NoMatch
+from arpeggio import ZeroOrMore, Optional, ParserPython, NoMatch, EOF
def test_optional_inside_zeroormore():
@@ -18,9 +18,9 @@
Test optional match inside a z... |
1f65142b754478570a3733f4c0abbf3ef24d9c7e | photutils/utils/_optional_deps.py | photutils/utils/_optional_deps.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Checks for optional dependencies using lazy import from
`PEP 562 <https://www.python.org/dev/peps/pep-0562/>`_.
"""
import importlib
# This list is a duplicate of the dependencies in setup.cfg "all".
optional_deps = ['scipy', 'matplotlib', 'scikit-imag... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Checks for optional dependencies using lazy import from
`PEP 562 <https://www.python.org/dev/peps/pep-0562/>`_.
"""
import importlib
# This list is a duplicate of the dependencies in setup.cfg "all".
# Note that in some cases the package names are diff... | Fix for package name differences | Fix for package name differences
| Python | bsd-3-clause | larrybradley/photutils,astropy/photutils | ---
+++
@@ -5,8 +5,9 @@
import importlib
# This list is a duplicate of the dependencies in setup.cfg "all".
-optional_deps = ['scipy', 'matplotlib', 'scikit-image', 'scikit-learn',
- 'gwcs']
+# Note that in some cases the package names are different from the
+# pip-install name (e.g.k scikit-image... |
120520e44d7dfcf3079bfdc9a118d28b5620cb14 | polymorphic/formsets/utils.py | polymorphic/formsets/utils.py | """
Internal utils
"""
def add_media(dest, media):
"""
Optimized version of django.forms.Media.__add__() that doesn't create new objects.
"""
dest.add_css(media._css)
dest.add_js(media._js)
| """
Internal utils
"""
import django
def add_media(dest, media):
"""
Optimized version of django.forms.Media.__add__() that doesn't create new objects.
Only required for Django < 2.0
"""
if django.VERSION >= (2, 0):
dest += media
else:
dest.add_css(media._css)
dest.add... | Fix `add_media` util for Django 2.0 | Fix `add_media` util for Django 2.0
Neither `add_css` nor `add_js` exist in Django 2.0 because the method
for adding `Media` classes together has changed.
Ref: https://github.com/django/django/commit/c19b56f633e172b3c02094cbe12d28865ee57772
| Python | bsd-3-clause | chrisglass/django_polymorphic,chrisglass/django_polymorphic | ---
+++
@@ -1,11 +1,17 @@
"""
Internal utils
"""
+import django
def add_media(dest, media):
"""
Optimized version of django.forms.Media.__add__() that doesn't create new objects.
+
+ Only required for Django < 2.0
"""
- dest.add_css(media._css)
- dest.add_js(media._js)
+ if django.V... |
0dbab7d21f6faf2091590c138e64d5f00f094eb5 | name/urls.py | name/urls.py | from django.conf.urls import url
from django.contrib import admin
from . import views, feeds
from .api import views as api
admin.autodiscover()
app_name = 'name'
urlpatterns = [
url(r'^$', views.landing, name='landing'),
url(r'about/$', views.about, name='about'),
url(r'export/$', views.export, name='ex... | from django.conf.urls import url
from django.contrib import admin
from . import views, feeds
from .api import views as api
admin.autodiscover()
app_name = 'name'
urlpatterns = [
url(r'^$', views.landing, name='landing'),
url(r'about/$', views.about, name='about'),
url(r'export/$', views.export, name='ex... | Remove trailing slashes from JSON endpoints. | Remove trailing slashes from JSON endpoints.
| Python | bsd-3-clause | unt-libraries/django-name,unt-libraries/django-name,unt-libraries/django-name | ---
+++
@@ -14,12 +14,12 @@
url(r'export/$', views.export, name='export'),
url(r'feed/$', feeds.NameAtomFeed(), name='feed'),
url(r'label/(?P<name_value>.*)$', views.label, name='label'),
- url(r'locations.json/$', api.locations_json, name='locations-json'),
+ url(r'locations.json$', api.location... |
2ee763ae1e4564a57692cb7161f99daab4ae77b7 | cookiecutter/main.py | cookiecutter/main.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
cookiecutter.main
-----------------
Main entry point for the `cookiecutter` command.
The code in this module is also a good example of how to use Cookiecutter as a
library rather than a script.
"""
import argparse
import os
from .find import find_template
from .gen... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
cookiecutter.main
-----------------
Main entry point for the `cookiecutter` command.
The code in this module is also a good example of how to use Cookiecutter as a
library rather than a script.
"""
import argparse
import os
from .cleanup import remove_repo
from .fi... | Clean up after cloned repo if needed. (partial checkin) | Clean up after cloned repo if needed. (partial checkin)
| Python | bsd-3-clause | atlassian/cookiecutter,dajose/cookiecutter,luzfcb/cookiecutter,foodszhang/cookiecutter,Springerle/cookiecutter,willingc/cookiecutter,utek/cookiecutter,takeflight/cookiecutter,takeflight/cookiecutter,willingc/cookiecutter,stevepiercy/cookiecutter,vincentbernat/cookiecutter,cguardia/cookiecutter,0k/cookiecutter,nhomar/co... | ---
+++
@@ -14,6 +14,7 @@
import argparse
import os
+from .cleanup import remove_repo
from .find import find_template
from .generate import generate_context, generate_files
from .vcs import git_clone
@@ -34,6 +35,7 @@
# If it's a git repo, clone and prompt
if args.input_dir.endswith('.git'):
+ ... |
5dcd5da3674294388c068a55942e8974eb7aa75a | bh_sshRcmd.py | bh_sshRcmd.py | #!/usr/bin/env python
#SSH with Paramiko pg 27
import threading, paramiko, subprocess
def usage(): #Provide description of program
print "Black Hat Python SSH with Paramiko pg 27"
print ""
print "Enter Syntax or information for how program works"
print ""
sys.exit(0)
def main()
if not len(s... | #!/usr/bin/env python
#SSH with Paramiko pg 27
import threading, paramiko, subprocess
def usage(): #Provide description of program
print "Black Hat Python SSH with Paramiko pg 27"
print ""
print "Enter Syntax or information for how program works"
print ""
sys.exit(0)
def main()
if not len(... | FIX FUNCTIONS. CHANGE USAGE FUNCTION TO BANNER. ADD ACTUAL USAGE FILE. FIX 'main' FUNCTION | TODO: FIX FUNCTIONS. CHANGE USAGE FUNCTION TO BANNER. ADD ACTUAL USAGE FILE. FIX 'main' FUNCTION
| Python | mit | n1cfury/BlackHatPython | ---
+++
@@ -1,6 +1,7 @@
#!/usr/bin/env python
#SSH with Paramiko pg 27
+
import threading, paramiko, subprocess
@@ -15,6 +16,7 @@
def main()
if not len(sys.argv[1:]):
usage()
+
def ssh_command(ip, user, passwd, command):
client = paramiko.SSHClient() |
cb0b742ad05adceb6b58a71ca5d1e33985145a54 | servicerating/urls.py | servicerating/urls.py | from django.conf.urls import patterns, url, include
from servicerating import api
from tastypie.api import Api
# Setting the API base name and registering the API resources using
# Tastypies API function
api_resources = Api(api_name='v1/servicerating')
api_resources.register(api.ContactResource())
api_resources.regis... | from django.conf.urls import patterns, url, include
from servicerating import api
from tastypie.api import Api
# Setting the API base name and registering the API resources using
# Tastypies API function
api_resources = Api(api_name='v1/servicerating')
api_resources.register(api.ContactResource())
api_resources.regis... | Add missing end of file line break | Add missing end of file line break
| Python | bsd-3-clause | praekelt/ndoh-control,praekelt/ndoh-control,praekelt/ndoh-control,praekelt/ndoh-control | |
8be5a5bcbd228599ce7a4f226638feb3dc3318a8 | python/examples/encode_message.py | python/examples/encode_message.py | #!/usr/bin/env python3
import os
import sys
# Add the Python root directory (fusion-engine-client/python/) to the import search path to enable FusionEngine imports
# if this application is being run directly out of the repository and is not installed as a pip package.
root_dir = os.path.normpath(os.path.join(os.path.... | #!/usr/bin/env python3
import os
import sys
# Add the Python root directory (fusion-engine-client/python/) to the import search path to enable FusionEngine imports
# if this application is being run directly out of the repository and is not installed as a pip package.
root_dir = os.path.normpath(os.path.join(os.path.... | Print the message in the encode example. | Print the message in the encode example.
| Python | mit | PointOneNav/fusion-engine-client,PointOneNav/fusion-engine-client,PointOneNav/fusion-engine-client | ---
+++
@@ -26,8 +26,10 @@
protocol=ProtocolType.FUSION_ENGINE,
message_id=MessageType.POSE,
rate=MessageRate.ON_CHANGE)
+ print(message)
encoder = FusionEngineEncoder()
encoded_data = encoder.encode_message(messa... |
14ebd4a0e570102e97fb65bbb0813d85e763c743 | plyer/facades/notification.py | plyer/facades/notification.py | '''
Notification
===========
The :class:`Notification` provides access to public methods to create
notifications.
Simple Examples
---------------
To send notification::
>>> from plyer import notification
>>> title = 'plyer'
>>> message = 'This is an example.'
>>> notification.notify(title=title, mes... | '''
Notification
===========
The :class:`Notification` provides access to public methods to create
notifications.
Simple Examples
---------------
To send notification::
>>> from plyer import notification
>>> title = 'plyer'
>>> message = 'This is an example.'
>>> notification.notify(title=title, mes... | Add note about Windows icon format | Add note about Windows icon format
| Python | mit | KeyWeeUsr/plyer,kivy/plyer,KeyWeeUsr/plyer,KeyWeeUsr/plyer,kivy/plyer,kivy/plyer | ---
+++
@@ -41,6 +41,10 @@
:type app_icon: str
:type timeout: int
:type ticker: str
+
+ .. note::
+ When called on Windows, ``app_icon`` has to be a path to
+ a file in .ICO format.
'''
self._notify(title=title, message=message, app_icon=app_ic... |
d53b05f648053d46c6b4b7353d9acb96d6c18179 | inventory/models.py | inventory/models.py | import uuid
from django.db import models
from django.contrib.auth.models import User
from django.utils.translation import ugettext as _
from symposion.conference.models import Conference
from root.models import Base
class Tshirt(Base):
""" Model to store the different types of tshirt. """
gender = models.C... | import uuid
from django.db import models
from django.contrib.auth.models import User
from django.utils.translation import ugettext as _
from symposion.conference.models import Conference
from root.models import Base
class Tshirt(Base):
""" Model to store the different types of tshirt. """
gender = models.C... | Move size from UserTshirt to Tshirt | inventory: Move size from UserTshirt to Tshirt
| Python | mit | PyConPune/pune.pycon.org,PyConPune/pune.pycon.org,PyConPune/pune.pycon.org | ---
+++
@@ -12,6 +12,7 @@
""" Model to store the different types of tshirt. """
gender = models.CharField(_("gender"), max_length=255)
+ size = models.CharField(_("size"), max_length=5)
limit = models.PositiveIntegerField(_("limit"), default=0)
price = models.PositiveIntegerField(_("price"), ... |
3a42b33124d6036dacee85867e484cb25d32a903 | IPython/terminal/pt_inputhooks/qt.py | IPython/terminal/pt_inputhooks/qt.py | import sys
from IPython.external.qt_for_kernel import QtCore, QtGui
def inputhook(context):
app = QtCore.QCoreApplication.instance()
if not app:
return
event_loop = QtCore.QEventLoop(app)
if sys.platform == 'win32':
# The QSocketNotifier method doesn't appear to work on Windows.
... | import sys
from IPython.external.qt_for_kernel import QtCore, QtGui
# If we create a QApplication, keep a reference to it so that it doesn't get
# garbage collected.
_appref = None
def inputhook(context):
global _appref
app = QtCore.QCoreApplication.instance()
if not app:
_appref = app = QtGui.QAp... | Create a QApplication for inputhook if one doesn't already exist | Create a QApplication for inputhook if one doesn't already exist
Closes gh-9784
| Python | bsd-3-clause | ipython/ipython,ipython/ipython | ---
+++
@@ -1,10 +1,15 @@
import sys
from IPython.external.qt_for_kernel import QtCore, QtGui
+# If we create a QApplication, keep a reference to it so that it doesn't get
+# garbage collected.
+_appref = None
+
def inputhook(context):
+ global _appref
app = QtCore.QCoreApplication.instance()
if not... |
d95dd9d3acbd56fd91b67cdfcc1fa9d1758770eb | lino_noi/lib/tickets/__init__.py | lino_noi/lib/tickets/__init__.py | # -*- coding: UTF-8 -*-
# Copyright 2016 Luc Saffre
# License: BSD (see file COPYING for details)
"""Fixtures specific for the Team variant of Lino Noi.
.. autosummary::
:toctree:
models
"""
from lino_xl.lib.tickets import *
class Plugin(Plugin):
"""Adds the :mod:`lino_xl.lib.votes` plugin.
"""
... | # -*- coding: UTF-8 -*-
# Copyright 2016 Luc Saffre
# License: BSD (see file COPYING for details)
"""Fixtures specific for the Team variant of Lino Noi.
.. autosummary::
:toctree:
models
"""
from lino_xl.lib.tickets import *
class Plugin(Plugin):
"""Adds the :mod:`lino_xl.lib.votes` plugin.
"""
... | Move asigned menu and dashboard items to noi/tickets | Move asigned menu and dashboard items to noi/tickets
| Python | bsd-2-clause | khchine5/noi,lsaffre/noi,lsaffre/noi,khchine5/noi,lsaffre/noi,lino-framework/noi,lino-framework/noi | ---
+++
@@ -26,3 +26,15 @@
# 'lino_xl.lib.votes',
'lino_noi.lib.noi']
+ def setup_main_menu(self, site, profile, m):
+ p = self.get_menu_group()
+ m = m.add_menu(p.app_label, p.verbose_name)
+ m.add_action('tickets.MyTicketsToWork')
+
+
+ def get_dashboard_items(self, us... |
2848badf17fd77138ee9e0b3999805e7e60d24c0 | tests/builtins/test_dict.py | tests/builtins/test_dict.py | from .. utils import TranspileTestCase, BuiltinFunctionTestCase
class DictTests(TranspileTestCase):
pass
class BuiltinDictFunctionTests(BuiltinFunctionTestCase, TranspileTestCase):
functions = ["dict"]
not_implemented = [
'test_bytearray',
'test_frozenset',
'test_list',
... | from .. utils import TranspileTestCase, BuiltinFunctionTestCase
class DictTests(TranspileTestCase):
pass
class BuiltinDictFunctionTests(BuiltinFunctionTestCase, TranspileTestCase):
functions = ["dict"]
not_implemented = [
'test_bytearray',
'test_list',
'test_str',
]
| Fix “Unexpected success” by removing ‘test_frozenset’ from BuiltinDictFunctionTests.not_implementeed | Fix “Unexpected success” by removing ‘test_frozenset’ from BuiltinDictFunctionTests.not_implementeed
| Python | bsd-3-clause | cflee/voc,freakboy3742/voc,freakboy3742/voc,cflee/voc | ---
+++
@@ -10,7 +10,6 @@
not_implemented = [
'test_bytearray',
- 'test_frozenset',
'test_list',
'test_str',
] |
535dbef3caf4130cc8543be4aa54c8ce820a5b56 | tests/builtins/test_list.py | tests/builtins/test_list.py | from .. utils import TranspileTestCase, BuiltinFunctionTestCase
class ListTests(TranspileTestCase):
pass
class BuiltinListFunctionTests(BuiltinFunctionTestCase, TranspileTestCase):
functions = ["list"]
not_implemented = [
'test_bool',
'test_bytearray',
'test_bytes',
'tes... | from .. utils import TranspileTestCase, BuiltinFunctionTestCase
class ListTests(TranspileTestCase):
pass
class BuiltinListFunctionTests(BuiltinFunctionTestCase, TranspileTestCase):
functions = ["list"]
not_implemented = [
'test_bytearray',
'test_bytes',
'test_class',
'te... | Mark some builtin list() tests as passing | Mark some builtin list() tests as passing
- This is due to the earlier fixed TypeError message.
| Python | bsd-3-clause | cflee/voc,glasnt/voc,pombredanne/voc,gEt-rIgHt-jR/voc,ASP1234/voc,Felix5721/voc,freakboy3742/voc,pombredanne/voc,Felix5721/voc,freakboy3742/voc,gEt-rIgHt-jR/voc,glasnt/voc,cflee/voc,ASP1234/voc | ---
+++
@@ -9,14 +9,11 @@
functions = ["list"]
not_implemented = [
- 'test_bool',
'test_bytearray',
'test_bytes',
'test_class',
'test_complex',
'test_dict',
- 'test_float',
'test_frozenset',
- 'test_int',
'test_str',
... |
2d25e6e70df357d19d9e873d94ac57d25bd7e6aa | local.py | local.py | import gntp
import Growl
class GNTPRegister(gntp.GNTPRegister):
def send(self):
print 'Sending Registration'
growl = Growl.GrowlNotifier(
applicationName = self.headers['Application-Name'],
notifications = self.notifications,
defaultNotifications = self.defaultNotifications,
)
growl.register()
... | import gntp
import Growl
class GNTPRegister(gntp.GNTPRegister):
def send(self):
print 'Sending Local Registration'
growl = Growl.GrowlNotifier(
applicationName = self.headers['Application-Name'],
notifications = self.notifications,
defaultNotifications = self.defaultNotifications,
)
growl.registe... | Disable icon temporarily and adjust the debug print statements | Disable icon temporarily and adjust the debug print statements
| Python | mit | kfdm/gntp-regrowl | ---
+++
@@ -3,7 +3,7 @@
class GNTPRegister(gntp.GNTPRegister):
def send(self):
- print 'Sending Registration'
+ print 'Sending Local Registration'
growl = Growl.GrowlNotifier(
applicationName = self.headers['Application-Name'],
notifications = self.notifications,
@@ -13,7 +13,7 @@
class GNT... |
12e6ba386a733bd38105aacfa2d0304ac94ade67 | tests/qtgui/qwidget_test.py | tests/qtgui/qwidget_test.py |
import unittest
from PySide.QtGui import QWidget
from helper import UsesQApplication
class QWidgetVisible(UsesQApplication):
def testBasic(self):
# Also related to bug #244, on existence of setVisible'''
widget = QWidget()
self.assert_(not widget.isVisible())
widget.setVisible(Tr... |
import unittest
from PySide.QtGui import QWidget, QMainWindow
from helper import UsesQApplication
class QWidgetInherit(QMainWindow):
def __init__(self):
QWidget.__init__(self)
class QWidgetTest(UsesQApplication):
def testInheritance(self):
newobj = QWidgetInherit()
widget = QWidget(... | Test a specific situation that causes python segfault. | Test a specific situation that causes python segfault.
Reviewer: Marcelo Lira <6be3b93b2f09145ada72571578cc4097e4ba9a9e@openbossa.org>
Renato Araújo <renato.filho@openbossa.org>
| Python | lgpl-2.1 | M4rtinK/pyside-bb10,enthought/pyside,enthought/pyside,RobinD42/pyside,qtproject/pyside-pyside,enthought/pyside,M4rtinK/pyside-android,IronManMark20/pyside2,IronManMark20/pyside2,gbaty/pyside2,enthought/pyside,pankajp/pyside,IronManMark20/pyside2,RobinD42/pyside,PySide/PySide,gbaty/pyside2,BadSingleton/pyside2,M4rtinK/p... | ---
+++
@@ -1,8 +1,20 @@
import unittest
-from PySide.QtGui import QWidget
+from PySide.QtGui import QWidget, QMainWindow
from helper import UsesQApplication
+
+class QWidgetInherit(QMainWindow):
+ def __init__(self):
+ QWidget.__init__(self)
+
+class QWidgetTest(UsesQApplication):
+
+ def testInhe... |
a780d95b76404e46f5060d830fb95b0179716569 | ports/esp32/modules/inisetup.py | ports/esp32/modules/inisetup.py | import uos
from flashbdev import bdev
def check_bootsec():
buf = bytearray(bdev.ioctl(5, 0)) # 5 is SEC_SIZE
bdev.readblocks(0, buf)
empty = True
for b in buf:
if b != 0xFF:
empty = False
break
if empty:
return True
fs_corrupted()
def fs_corrupted():
... | import uos
from flashbdev import bdev
def check_bootsec():
buf = bytearray(bdev.ioctl(5, 0)) # 5 is SEC_SIZE
bdev.readblocks(0, buf)
empty = True
for b in buf:
if b != 0xFF:
empty = False
break
if empty:
return True
fs_corrupted()
def fs_corrupted():
... | Change from FAT to littlefs v2 as default filesystem. | esp32: Change from FAT to littlefs v2 as default filesystem.
This commit changes the default filesystem type for esp32 to littlefs v2.
This port already enables both VfsFat and VfsLfs2, so either can be used
for the filesystem, and existing systems that use FAT will still work.
| Python | mit | pfalcon/micropython,pfalcon/micropython,pfalcon/micropython,pfalcon/micropython,pfalcon/micropython | ---
+++
@@ -33,8 +33,8 @@
def setup():
check_bootsec()
print("Performing initial setup")
- uos.VfsFat.mkfs(bdev)
- vfs = uos.VfsFat(bdev)
+ uos.VfsLfs2.mkfs(bdev)
+ vfs = uos.VfsLfs2(bdev)
uos.mount(vfs, "/")
with open("boot.py", "w") as f:
f.write( |
2ea8fa8d0f00e8b9b52e6af9fdfeb1db7dcd0787 | coveragespace/__init__.py | coveragespace/__init__.py | """Package for coverage.space-cli."""
import sys
__project__ = 'coverage.space'
__version__ = '0.6.1'
API = 'http://api.coverage.space'
VERSION = "{0} v{1}".format(__project__, __version__)
| """Package for coverage.space-cli."""
import sys
__project__ = 'coverage.space'
__version__ = '0.6.1'
API = 'https://api.coverage.space'
VERSION = "{0} v{1}".format(__project__, __version__)
| Use SSL for API calls | Use SSL for API calls
| Python | mit | jacebrowning/coverage-space-cli | ---
+++
@@ -5,6 +5,6 @@
__project__ = 'coverage.space'
__version__ = '0.6.1'
-API = 'http://api.coverage.space'
+API = 'https://api.coverage.space'
VERSION = "{0} v{1}".format(__project__, __version__) |
a0342631d6888f4748af9011839020ee0843a721 | crypto_enigma/_version.py | crypto_enigma/_version.py | #!/usr/bin/env python
# encoding: utf8
from __future__ import (absolute_import, print_function, division, unicode_literals)
# See - http://www.python.org/dev/peps/pep-0440/
# See - http://semver.org
__author__ = 'Roy Levien'
__copyright__ = '(c) 2014-2015 Roy Levien'
__release__ = '0.2.1' # N(.N)*
__pre_release__ =... | #!/usr/bin/env python
# encoding: utf8
from __future__ import (absolute_import, print_function, division, unicode_literals)
# See - http://www.python.org/dev/peps/pep-0440/
# See - http://semver.org
__author__ = 'Roy Levien'
__copyright__ = '(c) 2014-2015 Roy Levien'
__release__ = '0.2.1' # N(.N)*
__pre_release__ =... | Update test version after test release | Update test version after test release
| Python | bsd-3-clause | orome/crypto-enigma-py | ---
+++
@@ -10,7 +10,7 @@
__copyright__ = '(c) 2014-2015 Roy Levien'
__release__ = '0.2.1' # N(.N)*
__pre_release__ = 'b3' # aN | bN | cN |
-__suffix__ = '.dev1' # .devN | | .postN
+__suffix__ = '.dev2' # .devN | | .postN
__version__ = __release__ + __pre_release__ + __suffix__
|
639eb2da0e239d362b3416e9137b9dcee8da1c87 | setup.py | setup.py | # -*- coding: utf8 -*-
import os
from setuptools import setup, find_packages
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'
def _read_long_description():
try:
import pypandoc
return pypandoc.convert('README.md', 'rst')
except ImportError:
return None
setup(
name="django... | # -*- coding: utf8 -*-
import os
from setuptools import setup, find_packages
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'
def _read_long_description():
try:
import pypandoc
return pypandoc.convert('README.md', 'rst', format='markdown')
except Exception:
return None
setup(... | Fix long-description reader, make it fail silently | Fix long-description reader, make it fail silently
| Python | mit | frecar/django-basis | ---
+++
@@ -8,8 +8,8 @@
def _read_long_description():
try:
import pypandoc
- return pypandoc.convert('README.md', 'rst')
- except ImportError:
+ return pypandoc.convert('README.md', 'rst', format='markdown')
+ except Exception:
return None
|
381a266830bbc92bdf6cacb9e4a1ff7044c07c19 | setup.py | setup.py | from distutils.core import setup
setup(
name='rest-server',
version='0.1.0',
url="http://github.io/boundary/rest-server",
author='David Gwartney',
author_email='david_gwartney@bmc.com',
packages=['restserver', ],
entry_points={
'console_scripts': [
'rest-server = restser... | from distutils.core import setup
setup(
name='rest-server',
version='0.2.2',
url="http://github.io/boundary/rest-server",
author='David Gwartney',
author_email='david_gwartney@bmc.com',
packages=['restserver', ],
entry_points={
'console_scripts': [
'rest-server = restser... | Increment version ; certs to package | Increment version ; certs to package
| Python | apache-2.0 | boundary/rest-server | ---
+++
@@ -2,7 +2,7 @@
setup(
name='rest-server',
- version='0.1.0',
+ version='0.2.2',
url="http://github.io/boundary/rest-server",
author='David Gwartney',
author_email='david_gwartney@bmc.com',
@@ -12,7 +12,7 @@
'rest-server = restserver.app:main',
]
},
- ... |
ce8f864d3254acc19595e35dcb0b1e75efeb6b34 | setup.py | setup.py | import os, sys
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
from distutils.core import setup
import wtforms
setup(
name='WTForms',
version=wtforms.__version__,
url='http://wtforms.simplecodes.com/',
license='BSD',
author='Thomas Johansson, James Crasta',
author_email='wtforms... | import os, sys
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
from distutils.core import setup
import wtforms
setup(
name='WTForms',
version=wtforms.__version__,
url='http://wtforms.simplecodes.com/',
license='BSD',
author='Thomas Johansson, James Crasta',
author_email='wtforms... | Make sure ext.csrf is installed with WTForms | Make sure ext.csrf is installed with WTForms
| Python | bsd-3-clause | Khan/wtforms | ---
+++
@@ -28,6 +28,7 @@
'wtforms.widgets',
'wtforms.ext',
'wtforms.ext.appengine',
+ 'wtforms.ext.csrf',
'wtforms.ext.dateutil',
'wtforms.ext.django',
'wtforms.ext.django.templatetags', |
cc997a7fd67306891fa5a0a73700712505286be1 | setup.py | setup.py | try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
setup(
name='kai',
version='0.1',
description='',
author='Ben Bangert',
author_email='ben@groovie.org',
install_r... | try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
setup(
name='kai',
version='0.1',
description='',
author='Ben Bangert',
author_email='ben@groovie.org',
install_r... | Update to latest Pylons ver | Update to latest Pylons ver
| Python | bsd-3-clause | Pylons/kai,Pylons/kai | ---
+++
@@ -12,7 +12,7 @@
author='Ben Bangert',
author_email='ben@groovie.org',
install_requires=[
- "Pylons>=0.9.7rc4", "CouchDB>=0.4", "python-openid>=2.2.1",
+ "Pylons>=0.9.7", "CouchDB>=0.4", "python-openid>=2.2.1",
"pytz>=2008i", "Babel>=0.9.4", "tw.forms==0.9.3", "docutils>... |
4182b5edbc635842429e77cf8bb1b565f2ca6e31 | setup.py | setup.py | # -*- coding: utf-8 -*-
#!/usr/bin/env python
try:
from setuptools import setup, find_packages, Command
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages, Command
description = 'Generate version strings based on semantic versioning ru... | # -*- coding: utf-8 -*-
#!/usr/bin/env python
try:
from setuptools import setup, find_packages, Command
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages, Command
description = 'Generate version strings based on semantic versioning ru... | Bump version: 1.0.0 -> 1.1.0 | Bump version: 1.0.0 -> 1.1.0
| Python | mit | vortec/versionbump | ---
+++
@@ -13,7 +13,7 @@
long_description = str(open('README.rst', 'rb').read())
setup(name='versionbump',
- version='1.0.0',
+ version='1.1.0',
license='MIT',
author='Fabian Kochem',
url='https://github.com/vortec/versionbump', |
702f331cc70ee989d7542c81d85fc3dccbf550a0 | setup.py | setup.py | #!/usr/bin/env python3
# WARNING! WIP, doesn't work correctly.
# Still needs to understand the assets folder and make an executable out of __main__
from setuptools import setup, find_packages
# We want to restrict newer versions while we deal with upstream breaking changes.
discordpy_version = '==0.11.0'
# TODO rea... | #!/usr/bin/env python3
# WARNING! WIP, doesn't work correctly.
# Still needs to understand the assets folder and make an executable out of __main__
from setuptools import setup, find_packages
# TODO read README(.rst? .md looks bad on pypi) for long_description.
# Could use pandoc, but the end user shouldn't nee... | Remove outdated discord.py version requirement | Remove outdated discord.py version requirement
We'll come to incompatible versions when we get there. So far I've just
been updating discord.py without issue.
| Python | mit | TAOTheCrab/CrabBot | ---
+++
@@ -4,9 +4,6 @@
# Still needs to understand the assets folder and make an executable out of __main__
from setuptools import setup, find_packages
-
-# We want to restrict newer versions while we deal with upstream breaking changes.
-discordpy_version = '==0.11.0'
# TODO read README(.rst? .md looks bad o... |
fa55a1a93dd53023159c4a21963361d9678e52cf | setup.py | setup.py | from distutils.core import setup
setup(
name='pyenvsettings',
version='1.0.0',
author='Hugo Osvaldo Barrera',
author_email='hugo@barrera.io',
packages=['envsettings'],
package_data={'': ['logging.json']},
url='https://github.com/hobarrera/envsettings',
license='ISC',
description="R... | from distutils.core import setup
setup(
name='pyenvsettings',
version='1.0.0',
author='Hugo Osvaldo Barrera',
author_email='hugo@barrera.io',
packages=['envsettings'],
url='https://github.com/hobarrera/envsettings',
license='ISC',
description="Read settings from environment variables."... | Remove reference to inexistent file. | Remove reference to inexistent file.
| Python | isc | hobarrera/envsettings,hobarrera/envsettings | ---
+++
@@ -7,7 +7,6 @@
author='Hugo Osvaldo Barrera',
author_email='hugo@barrera.io',
packages=['envsettings'],
- package_data={'': ['logging.json']},
url='https://github.com/hobarrera/envsettings',
license='ISC',
description="Read settings from environment variables." |
255d561a68712ed1f40f673cbb1c428815a5febd | __init__.py | __init__.py | """distutils
The main package for the Python Module Distribution Utilities. Normally
used from a setup script as
from distutils.core import setup
setup (...)
"""
# This module should be kept compatible with Python 1.5.2.
__revision__ = "$Id$"
__version__ = "1.0.4"
| """distutils
The main package for the Python Module Distribution Utilities. Normally
used from a setup script as
from distutils.core import setup
setup (...)
"""
# This module should be kept compatible with Python 1.5.2.
__revision__ = "$Id$"
__version__ = "2.4.0"
| Make the distutils version number the same as the python version. It must be literally contained here, because it is still possible to install this distutils in older Python versions. | Make the distutils version number the same as the python version. It
must be literally contained here, because it is still possible to
install this distutils in older Python versions.
| Python | mit | pypa/setuptools,pypa/setuptools,pypa/setuptools | ---
+++
@@ -12,4 +12,4 @@
__revision__ = "$Id$"
-__version__ = "1.0.4"
+__version__ = "2.4.0" |
e1ad029fc8d9f34fc5fbbd5d2a12b9f6bd198bff | setup.py | setup.py | #!/usr/bin/env python2
from distutils.core import setup
setup(name='visram',
version='0.1.0',
description='Graphical RAM/CPU Visualizer',
license='MIT',
author='Matthew Pfeiffer',
author_email='spferical@gmail.com',
url='http://github.com/Spferical/visram',
packages=['visram'... | #!/usr/bin/env python2
from distutils.core import setup
setup(name='visram',
version='0.1.0',
description='Graphical RAM/CPU Visualizer',
license='MIT',
author='Matthew Pfeiffer',
author_email='spferical@gmail.com',
url='http://github.com/Spferical/visram',
packages=['visram'... | Change development status to Alpha | Change development status to Alpha
It better reflects the project's immature state.
| Python | mit | Spferical/visram | ---
+++
@@ -13,7 +13,7 @@
scripts=['bin/visram'],
platforms=['any'],
classifiers=[
- 'Development Status :: 4 - Beta',
+ 'Development Status :: 3 - Alpha',
'Environment :: X11 Applications',
'Environment :: MacOS X :: Cocoa',
'Environment :: Win3... |
b890061942473f5ada953a7c33847937abdc36b0 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name="UtilityBelt",
version="0.1",
description="Utilities to make you a CND Batman",
url="https://github.com/sroberts/utilitybelt",
license="MIT",
packages=find_packages(),
install_requires=['requests', 'GeoIP']
)
| from setuptools import setup, find_packages
setup(
name="UtilityBelt",
version="0.1",
description="Utilities to make you a CND Batman",
url="https://github.com/sroberts/utilitybelt",
license="MIT",
packages=find_packages(),
package_data={'utilitybelt': ['data/GeoLiteCity.dat']},
instal... | Add Geolite data to package | Add Geolite data to package
| Python | mit | yolothreat/utilitybelt,yolothreat/utilitybelt | ---
+++
@@ -1,4 +1,5 @@
from setuptools import setup, find_packages
+
setup(
name="UtilityBelt",
@@ -7,5 +8,6 @@
url="https://github.com/sroberts/utilitybelt",
license="MIT",
packages=find_packages(),
+ package_data={'utilitybelt': ['data/GeoLiteCity.dat']},
install_requires=['requests... |
6c1c38a9c293527bfb4bb5689675f0ef6b385f75 | setup.py | setup.py | from setuptools import setup, find_packages
import sys, os
version = '0.1'
setup(name='kotti_contactform',
version=version,
description="Simple contact form for Kotti sites",
long_description="""\
This is an extension to Kotti that allows to add simple contact forms to your website.""",
classi... | from setuptools import setup, find_packages
import sys, os
version = '0.1'
setup(name='kotti_contactform',
version=version,
description="Simple contact form for Kotti sites",
long_description="""\
This is an extension to Kotti that allows to add simple contact forms to your website.""",
classi... | Add translation files to package data | Add translation files to package data
| Python | bsd-2-clause | Kotti/kotti_contactform | ---
+++
@@ -23,7 +23,9 @@
url='http://pypi.python.org/pypi/kotti_contactform',
license='BSD License',
packages=['kotti_contactform'],
- package_data={'kotti_contactform': ['templates/*.pt']},
+ package_data={'kotti_contactform': ['templates/*.pt',
+ ... |
1b992df4b7e8a36a5836b05217861cb1a7c62f8b | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(name='dltk',
version='0.1',
description='Deep Learning Toolkit for Medical Image Analysis',
author='DLTK Contributors',
url='https://dltk.github.io',
packages=find_packages(exclude=['_docs', 'contrib', 'data', 'examp... | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(name='dltk',
version='0.1',
description='Deep Learning Toolkit for Medical Image Analysis',
author='DLTK Contributors',
url='https://dltk.github.io',
packages=find_packages(exclude=['_docs', 'contrib', 'data', 'examp... | Add optional dependencies for the docs | Add optional dependencies for the docs
| Python | apache-2.0 | DLTK/DLTK | ---
+++
@@ -20,5 +20,6 @@
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4'],
install_requires=['numpy>=1.12.1', 'scipy>=0.19.0', 'pandas>=0.19.0', 'matplotlib>=1.5.3',
- 'scikit-image>=0.13.0', 'tensorflow-gpu>=1.1.0... |
e3c8e72341fea566113e510b058141c9ff75c0ea | setup.py | setup.py | try:
from setuptools import setup
except ImportError:
from distutils.core import setup
config = {
'description': 'A LMTP server class',
'long_description': 'A LMTP counterpart to smtpd in the Python standard library',
'author': 'Matt Molyneaux',
'url': 'https://github.com/moggers87/lmtpd',
... | try:
from setuptools import setup
except ImportError:
from distutils.core import setup
config = {
'description': 'A LMTP server class',
'long_description': 'A LMTP counterpart to smtpd in the Python standard library',
'author': 'Matt Molyneaux',
'url': 'https://github.com/moggers87/lmtpd',
... | Mark package as a stable | Mark package as a stable
| Python | mit | moggers87/lmtpd | ---
+++
@@ -18,7 +18,7 @@
'classifiers': [
'License :: OSI Approved :: MIT License',
'License :: OSI Approved :: Python Software Foundation License',
- 'Development Status :: 4 - Beta',
+ 'Development Status :: 5 - Production/Stable',
'Programming Language :: Python :: 3'... |
c1423ff0782c08886b2ab46355ad6d94fc54ba19 | setup.py | setup.py | # Copyright (c) 2015 Nicolas JOUANIN
#
# See the file license.txt for copying permission.
from setuptools import setup, find_packages
from hbmqtt.version import get_version
setup(
name="hbmqtt",
version=get_version(),
description="HBMQTT - HomeBrew MQTT\nclient/brocker using Python 3.4 asyncio library",
... | # Copyright (c) 2015 Nicolas JOUANIN
#
# See the file license.txt for copying permission.
from setuptools import setup, find_packages
from hbmqtt.version import get_version
setup(
name="hbmqtt",
version=get_version(),
description="HBMQTT - HomeBrew MQTT\nclient/brocker using Python 3.4 asyncio library",
... | Add missing requirements for websockets HBMQTT-25 | Add missing requirements for websockets
HBMQTT-25
| Python | mit | beerfactory/hbmqtt | ---
+++
@@ -14,7 +14,10 @@
url="https://github.com/beerfactory/hbmqtt",
license='MIT',
packages=find_packages(exclude=['tests']),
- install_requires=['transitions', 'blinker'],
+ install_requires=[
+ 'transitions==0.2.5',
+ 'blinker',
+ 'websockets'],
classifiers=[
... |
469546a923aa4eceda787d468a6f4312594d45d0 | setup.py | setup.py | ###############################################################################
# Copyright 2015-2019 University of Florida. All rights reserved.
# This file is part of UF CTS-IT's NACCulator project.
# Use of this source code is governed by the license found in the LICENSE file.
#######################################... | ###############################################################################
# Copyright 2015-2019 University of Florida. All rights reserved.
# This file is part of UF CTS-IT's NACCulator project.
# Use of this source code is governed by the license found in the LICENSE file.
#######################################... | Use python3 version of cappy | Use python3 version of cappy
| Python | bsd-2-clause | ctsit/nacculator,ctsit/nacculator,ctsit/nacculator | ---
+++
@@ -31,6 +31,6 @@
},
install_requires=[
- "cappy @ git+https://github.com/ctsit/cappy.git@1.2.1"
+ "cappy @ git+https://github.com/ctsit/cappy.git@2.0.0"
]
) |
f51589192d428b82acbebece6be73799e04a3f44 | setup.py | setup.py | from distutils.core import setup
setup(
name='pystash',
version='0.0.14',
author='Alexander Davydov',
author_email='nyddle@gmail.com',
packages=[ 'pystash' ],
scripts=[ 'bin/stash' ],
url='http://pypi.python.org/pypi/pystash/',
license='LICENSE.txt',
description='Save your code snip... | try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name='pystash',
version='0.0.14',
author='Alexander Davydov',
author_email='nyddle@gmail.com',
packages=[ 'pystash' ],
scripts=[ 'bin/stash' ],
url='http://pypi.python.org/pypi/pystash/',
... | Fix for 'Unknown distribution option: install_requires' warning during install | Fix for 'Unknown distribution option: install_requires' warning during install
| Python | mit | nyddle/pystash | ---
+++
@@ -1,5 +1,8 @@
-from distutils.core import setup
-
+try:
+ from setuptools import setup
+except ImportError:
+ from distutils.core import setup
+
setup(
name='pystash',
version='0.0.14', |
5a5a83abb5265dd0abc3c6306f65930c4ce012f2 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name="globus-cli",
version="0.1.0",
packages=find_packages(),
install_requires=['globus-sdk-python'],
# for now, install directly from GitHub
# TODO: once this is on pypi, install from there
dependency_links=[
('https://github.com/g... | from setuptools import setup, find_packages
setup(
name="globus-cli",
version="0.1.0",
packages=find_packages(),
install_requires=['globus-sdk'],
# for now, install directly from GitHub
# TODO: once this is on pypi, install from there
dependency_links=[
('https://github.com/globuson... | Fix globus-sdk python package name | Fix globus-sdk python package name
To match recent change in SDK repo
| Python | apache-2.0 | globus/globus-cli,globus/globus-cli | ---
+++
@@ -4,12 +4,12 @@
name="globus-cli",
version="0.1.0",
packages=find_packages(),
- install_requires=['globus-sdk-python'],
+ install_requires=['globus-sdk'],
# for now, install directly from GitHub
# TODO: once this is on pypi, install from there
dependency_links=[
... |
226f2a5674c9d1d16801cfe7b8c5ac636e849b4a | setup.py | setup.py | from setuptools import setup
version = "0.5.1"
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name="arxiv",
version=version,
packages=["arxiv"],
# dependencies
install_requires=[
'feedparser',
'requests',
'pytest-runner',
],
tests_requi... | from setuptools import setup
version = "0.5.1"
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name="arxiv",
version=version,
packages=["arxiv"],
# dependencies
install_requires=[
'feedparser',
'requests',
],
tests_require=[
"pytest",
"... | Remove pytest-runner from install requirements, add numpy as test requirement | Remove pytest-runner from install requirements, add numpy as test requirement
| Python | mit | lukasschwab/arxiv.py | ---
+++
@@ -14,10 +14,10 @@
install_requires=[
'feedparser',
'requests',
- 'pytest-runner',
],
tests_require=[
"pytest",
+ "numpy",
],
# metadata for upload to PyPI
author="Lukas Schwab", |
fe2ce1c782730690f92651439abe33b6252821b8 | setup.py | setup.py | from setuptools import setup
REQUIRES = [
'markdown',
'mdx_outline',
]
SOURCES = []
with open('README.rst', 'r') as f:
long_description = f.read()
setup(
name="mdx_attr_cols",
version="0.1.1",
url='http://github.com/CTPUG/mdx_attr_cols',
license='MIT',
description="A bootstrap 3 row ... | from setuptools import setup
REQUIRES = [
'markdown',
'mdx_outline',
]
SOURCES = []
with open('README.rst', 'r') as f:
long_description = f.read()
setup(
name="mdx-attr-cols",
version="0.1.1",
url='http://github.com/CTPUG/mdx_attr_cols',
license='MIT',
description="A bootstrap 3 row ... | Rename package to use dashes. | Rename package to use dashes.
| Python | isc | CTPUG/mdx_attr_cols | ---
+++
@@ -11,7 +11,7 @@
long_description = f.read()
setup(
- name="mdx_attr_cols",
+ name="mdx-attr-cols",
version="0.1.1",
url='http://github.com/CTPUG/mdx_attr_cols',
license='MIT', |
f964c435efce30a3ca3cb10185666e8e8af7a0db | setup.py | setup.py | from setuptools import setup, find_packages
with open('README.rst') as fd:
long_description = fd.read()
setup(name='Flask-ESClient',
version='0.1.1',
description='Flask extension for ESClient (elasticsearch client)',
long_description=long_description,
author='Baiju Muthukadan',
author_email='b... | from setuptools import setup, find_packages
with open('README.rst') as fd:
long_description = fd.read()
setup(name='Flask-ESClient',
version='0.1.1',
description='Flask extension for ESClient (elasticsearch client)',
long_description=long_description,
author='Baiju Muthukadan',
author_email='b... | Correct trove classifier for license | Correct trove classifier for license
| Python | bsd-2-clause | baijum/flask-esclient | ---
+++
@@ -24,7 +24,7 @@
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Intended Audience :: Developers',
- 'License :: OSI Approved :: BSD 2-Clause License',
+ 'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
... |
3c9a062ebb7745fbdefcf836165ef5cd85825417 | setup.py | setup.py | from setuptools import setup, Extension
import numpy as np
import os
extension_name = '_pyaccess'
extension_version = '.1'
include_dirs = [
'ann_1.1.2/include',
'sparsehash-2.0.2/src',
np.get_include(),
'.'
]
library_dirs = [
'ann_1.1.2/lib',
'contraction_hierarchies'
]
packages = ['pyaccess']... | from setuptools import setup, Extension
import numpy as np
import os
extension_name = '_pyaccess'
extension_version = '.1'
include_dirs = [
'ann_1.1.2/include',
'sparsehash-2.0.2/src',
np.get_include(),
'.'
]
library_dirs = [
'ann_1.1.2/lib',
'contraction_hierarchies'
]
packages = ['pyaccess']... | Use pyaccess as the package name. | Use pyaccess as the package name.
| Python | agpl-3.0 | UDST/pandana,SANDAG/pandana,UDST/pandana,rafapereirabr/pandana,SANDAG/pandana,UDST/pandana,waddell/pandana,waddell/pandana,waddell/pandana,synthicity/pandana,rafapereirabr/pandana,osPlanning/pandana,waddell/pandana,osPlanning/pandana,osPlanning/pandana,osPlanning/pandana,rafapereirabr/pandana,synthicity/pandana,rafaper... | ---
+++
@@ -34,14 +34,13 @@
'-fpic',
'-g',
'-Wno-deprecated',
- # '-ferror-limit=1'
]
py_modules=['pyaccess/pyaccess', 'pyaccess/urbanaccess']
setup(
packages=packages,
py_modules=py_modules,
- name=extension_name,
+ name='pyaccess',
version=extension_version,
ext_modu... |
1e47c53e6c96007fe41834e9b0ba2602a6f0e860 | setup.py | setup.py | # -*-coding:utf-8-*-
from setuptools import setup
setup(
name='rocketchat_API',
version='0.6.5',
packages=['rocketchat_API', 'rocketchat_API.APIExceptions'],
url='https://github.com/jadolg/rocketchat_API',
license='MIT',
author='Jorge Alberto Díaz Orozco',
author_email='diazorozcoj@gmail.c... | # -*-coding:utf-8-*-
from setuptools import setup
setup(
name='rocketchat_API',
version='0.6.6',
packages=['rocketchat_API', 'rocketchat_API.APIExceptions'],
url='https://github.com/jadolg/rocketchat_API',
license='MIT',
author='Jorge Alberto Díaz Orozco',
author_email='diazorozcoj@gmail.c... | Add for merge with groups.listAll | Add for merge with groups.listAll
| Python | mit | jadolg/rocketchat_API | ---
+++
@@ -4,7 +4,7 @@
setup(
name='rocketchat_API',
- version='0.6.5',
+ version='0.6.6',
packages=['rocketchat_API', 'rocketchat_API.APIExceptions'],
url='https://github.com/jadolg/rocketchat_API',
license='MIT', |
e04417d0811fba4e36ca16e3c731f35033be09f9 | setup.py | setup.py | from setuptools import setup, find_packages
VERSION = '0.1.0dev'
setup(
name='Brewmeister',
version=VERSION,
long_description=open('README.rst').read(),
packages=find_packages(),
include_package_data=True,
zip_safe=False,
scripts=['bin/brewmeister'],
install_requires=[
'Babel>=... | import os
import glob
from setuptools import setup, find_packages
VERSION = '0.1.0dev'
def mo_files():
linguas = glob.glob('brew/translations/*/LC_MESSAGES/messages.mo')
lpaths = [os.path.dirname(d) for d in linguas]
return zip(lpaths, [[l] for l in linguas])
# Data files to be installed after build t... | Install .mo catalogs if available | Install .mo catalogs if available
| Python | mit | brewpeople/brewmeister,brewpeople/brewmeister,brewpeople/brewmeister | ---
+++
@@ -1,6 +1,20 @@
+import os
+import glob
from setuptools import setup, find_packages
+
VERSION = '0.1.0dev'
+
+
+def mo_files():
+ linguas = glob.glob('brew/translations/*/LC_MESSAGES/messages.mo')
+ lpaths = [os.path.dirname(d) for d in linguas]
+ return zip(lpaths, [[l] for l in linguas])
+
+
+... |
24a6ff064036248043ff609ec7ba1925832219c4 | setup.py | setup.py | from setuptools import setup
from downstream_node import __version__
setup(
name='downstream-node',
version=__version__,
packages=['downstream_node'],
url='',
license='',
author='Storj Labs',
author_email='info@storj.io',
description='',
install_requires=[
'flask',
... | import sys
from setuptools import setup
from downstream_node import __version__
# Reqirements for all versions of Python
install_requires = [
'flask',
'pymysql',
'flask-sqlalchemy',
'heartbeat==0.1.2',
]
# Requirements for Python 2
if sys.version_info < (3,):
extras = [
'mysql-python',
... | Add proper dependency links and install_requires lines for Py3 and Py2 support | Add proper dependency links and install_requires lines for Py3 and Py2 support
| Python | mit | Storj/downstream-node,Storj/downstream-node | ---
+++
@@ -1,6 +1,22 @@
+import sys
from setuptools import setup
from downstream_node import __version__
+
+# Reqirements for all versions of Python
+install_requires = [
+ 'flask',
+ 'pymysql',
+ 'flask-sqlalchemy',
+ 'heartbeat==0.1.2',
+]
+
+# Requirements for Python 2
+if sys.version_info < (3,):... |
3a9d53fd1ad0687a5ed3564c44a7624488a83d4b | setup.py | setup.py | from distutils.core import setup
setup(
name = 'PyFVCOM',
packages = ['PyFVCOM'],
version = '1.2',
description = ("PyFVCOM is a collection of various tools and utilities which can be used to extract, analyse and plot input and output files from FVCOM."),
author = 'Pierre Cazenave',
author_email... | from distutils.core import setup
setup(
name = 'PyFVCOM',
packages = ['PyFVCOM'],
version = '1.2.1',
description = ("PyFVCOM is a collection of various tools and utilities which can be used to extract, analyse and plot input and output files from FVCOM."),
author = 'Pierre Cazenave',
author_ema... | Update the release following the fixes to the links. | Update the release following the fixes to the links.
| Python | mit | pwcazenave/PyFVCOM | ---
+++
@@ -3,12 +3,12 @@
setup(
name = 'PyFVCOM',
packages = ['PyFVCOM'],
- version = '1.2',
+ version = '1.2.1',
description = ("PyFVCOM is a collection of various tools and utilities which can be used to extract, analyse and plot input and output files from FVCOM."),
author = 'Pierre Caz... |
4cf871af11eb08b3b5b8671c4b5042c6f9f2f344 | tests/test__pycompat.py | tests/test__pycompat.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
| #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import dask_distance._pycompat
def test_irange():
r = dask_distance._pycompat.irange(5)
assert not isinstance(r, list)
assert list(r) == [0, 1, 2, 3, 4]
| Add a basic test for irange | Add a basic test for irange
Make sure `irange` is there, it doesn't return a list, and it acts like
`range` on some test arguments.
| Python | bsd-3-clause | jakirkham/dask-distance | ---
+++
@@ -1,2 +1,15 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
+
+
+from __future__ import absolute_import
+
+import dask_distance._pycompat
+
+
+def test_irange():
+ r = dask_distance._pycompat.irange(5)
+
+ assert not isinstance(r, list)
+
+ assert list(r) == [0, 1, 2, 3, 4] |
5cf5f6c16f8430cf1939b3775982b9dabbdc4123 | setup.py | setup.py | from setuptools import setup
def readme():
with open('README.md') as readme_file:
return readme_file.read()
setup(
name='comment_parser',
version='1.2.3',
description='Parse comments from various source files.',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Prog... | from setuptools import setup
def readme():
with open('README.md') as readme_file:
return readme_file.read()
setup(
name='comment_parser',
version='1.2.3',
description='Parse comments from various source files.',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Prog... | Update python-magic dependency to 0.4.24. | comment_parser: Update python-magic dependency to 0.4.24.
| Python | mit | jeanralphaviles/comment_parser | ---
+++
@@ -23,7 +23,7 @@
long_description=readme(),
long_description_content_type='text/markdown',
packages=['comment_parser', 'comment_parser.parsers'],
- install_requires=['python-magic==0.4.18'],
+ install_requires=['python-magic==0.4.24'],
test_suite='nose.collector',
tests_require... |
87b9e240f3065fcd1c057ccf8698c2e824d113a9 | ixprofile_client/tests/__init__.py | ixprofile_client/tests/__init__.py | """
Unit tests
"""
import django
from django.conf import settings
# Configure Django as required by some of the Gherkin steps
settings.configure(
CACHES={'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
}},
PROFILE_SERVER='dummy_server',
PROFILE_SERVER_KEY='mock_app',
... | """
Unit tests
"""
import django
from django.conf import settings
# Configure Django as required by some of the Gherkin steps
settings.configure(
CACHES={'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
}},
INSTALLED_APPS=(
'django.contrib.auth',
'django.co... | Fix tests under Django 1.9 | Fix tests under Django 1.9
| Python | mit | infoxchange/ixprofile-client,infoxchange/ixprofile-client | ---
+++
@@ -11,6 +11,11 @@
CACHES={'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
}},
+ INSTALLED_APPS=(
+ 'django.contrib.auth',
+ 'django.contrib.contenttypes',
+ 'social.apps.django_app.default',
+ ),
PROFILE_SERVER='dummy_server',
P... |
6ab01b1e26184bf296cf58939db5299f07cd68f5 | malcolm/modules/pmac/parts/__init__.py | malcolm/modules/pmac/parts/__init__.py | from .compoundmotorsinkportspart import CompoundMotorSinkPortsPart, \
APartName, ARbv, AGroup
from .cssourceportspart import CSSourcePortsPart, APartName, ARbv, AGroup
from .cspart import CSPart, AMri
from .pmacchildpart import PmacChildPart, AMri, APartName
from .pmacstatuspart import PmacStatusPart
from .pmactraj... | from .compoundmotorsinkportspart import CompoundMotorSinkPortsPart, \
APartName, ARbv, AGroup
from .cssourceportspart import CSSourcePortsPart, APartName, ARbv, AGroup
from .cspart import CSPart, AMri
from .pmacchildpart import PmacChildPart, AMri, APartName
from .pmacstatuspart import PmacStatusPart
from .pmactraj... | Add beamselectorpart to the PMAC module | Add beamselectorpart to the PMAC module
| Python | apache-2.0 | dls-controls/pymalcolm,dls-controls/pymalcolm,dls-controls/pymalcolm | ---
+++
@@ -7,6 +7,7 @@
from .pmactrajectorypart import PmacTrajectoryPart, AMri, APartName
from .rawmotorsinkportspart import RawMotorSinkPortsPart, AGroup
from .motorpremovepart import MotorPreMovePart, APartName, AMri
+from .beamselectorpart import BeamSelectorPart
# Expose a nice namespace
from malcolm.cor... |
400978cac957684f1f5d1a19a585cc8ea7b4e616 | setup.py | setup.py | from setuptools import setup, find_packages
version = '0.0.1'
setup(name='scoville',
version=version,
description="A tool for measureing tile latency.",
long_description=open('README.md').read(),
classifiers=[
# strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
... | from setuptools import setup, find_packages
version = '0.1.0'
setup(name='scoville',
version=version,
description="A tool for measureing tile latency.",
long_description=open('README.md').read(),
classifiers=[
# strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
... | Bump version for more usefulness. | Bump version for more usefulness.
| Python | mit | tilezen/scoville,tilezen/scoville,tilezen/scoville | ---
+++
@@ -1,6 +1,6 @@
from setuptools import setup, find_packages
-version = '0.0.1'
+version = '0.1.0'
setup(name='scoville',
version=version, |
cbb0bd366f829b2c917456256d178b54a2c9a735 | setup.py | setup.py | #!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
from distribute_setup import use_setuptools
use_setuptools()
from setuptools import setup
setup(
setup_requires=['d2to1>=0.2.5', 'stsci.distutils>=0.3dev'],
d2to1=True,
use_2to3=True,
zip_safe=False
)
| #!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
from distribute_setup import use_setuptools
use_setuptools()
from setuptools import setup
setup(
setup_requires=['d2to1>=0.2.5', 'stsci.distutils>=0.3dev'],
dependency_links=['http://stsdas.stsci.edu/download/packages'... | Add dependency_links pointing to internal package index | Add dependency_links pointing to internal package index
git-svn-id: ae5d535d8549566df64d2c38e8f7097ffa427e83@13931 fe389314-cf27-0410-b35b-8c050e845b92
| Python | bsd-3-clause | jhunkeler/acstools | ---
+++
@@ -9,6 +9,7 @@
setup(
setup_requires=['d2to1>=0.2.5', 'stsci.distutils>=0.3dev'],
+ dependency_links=['http://stsdas.stsci.edu/download/packages'],
d2to1=True,
use_2to3=True,
zip_safe=False |
28b280bb04f806f614f6f2cd25ce779b551fef9e | setup.py | setup.py | #!/usr/bin/env python
#
# Setup script for Django Evolution
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
from setuptools.command.test import test
from django_evolution import get_package_version, VERSION
def run_tests(*args):
import os
os.system('tests/ru... | #!/usr/bin/env python
#
# Setup script for Django Evolution
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
from setuptools.command.test import test
from django_evolution import get_package_version, VERSION
def run_tests(*args):
import os
os.system('tests/ru... | Allow Django Evolution to install along with Django >= 1.7. | Allow Django Evolution to install along with Django >= 1.7.
As we're working toward some degree of compatibility with newer versions
of Django, we need to ease up on the version restriction. Now's a good
time to do so. Django Evolution no longer has an upper bounds on the
version range.
| Python | bsd-3-clause | beanbaginc/django-evolution | ---
+++
@@ -38,7 +38,7 @@
download_url=download_url,
packages=find_packages(exclude=['tests']),
install_requires=[
- 'Django>=1.4.10,<1.7.0',
+ 'Django>=1.4.10',
],
include_package_data=True,
classifiers=[ |
147197f5640f9c008b73832f6b15316e1966da1c | BlockServer/epics/archiver_wrapper.py | BlockServer/epics/archiver_wrapper.py | #This file is part of the ISIS IBEX application.
#Copyright (C) 2012-2016 Science & Technology Facilities Council.
#All rights reserved.
#
#This program is distributed in the hope that it will be useful.
#This program and the accompanying materials are made available under the
#terms of the Eclipse Public License v1.0 ... | #This file is part of the ISIS IBEX application.
#Copyright (C) 2012-2016 Science & Technology Facilities Council.
#All rights reserved.
#
#This program is distributed in the hope that it will be useful.
#This program and the accompanying materials are made available under the
#terms of the Eclipse Public License v1.0 ... | Read returned page, just to make sure | Read returned page, just to make sure
| Python | bsd-3-clause | ISISComputingGroup/EPICS-inst_servers,ISISComputingGroup/EPICS-inst_servers | ---
+++
@@ -23,4 +23,5 @@
proxy_handler = urllib2.ProxyHandler({})
opener = urllib2.build_opener(proxy_handler)
urllib2.install_opener(opener)
- urllib2.urlopen("http://localhost:4813/restart")
+ res = urllib2.urlopen("http://localhost:4813/restart")
+ d = res.read() |
14fdcdd5193816cc171120ba31112411aa0fd43d | rackattack/physical/coldreclaim.py | rackattack/physical/coldreclaim.py | import time
import logging
import multiprocessing.pool
from rackattack.physical.ipmi import IPMI
class ColdReclaim:
_CONCURRENCY = 8
_pool = None
def __init__(self, hostname, username, password, hardReset):
self._hostname = hostname
self._username = username
self._password = pas... | import time
import logging
import multiprocessing.pool
from rackattack.physical.ipmi import IPMI
class ColdReclaim:
_CONCURRENCY = 8
_pool = None
def __init__(self, hostname, username, password, hardReset):
self._hostname = hostname
self._username = username
self._password = pas... | Stop using soft ipmi resets until figuring out why it does not work in a lot of cases | Stop using soft ipmi resets until figuring out why it does not work in a lot of cases
| Python | apache-2.0 | eliran-stratoscale/rackattack-physical,eliran-stratoscale/rackattack-physical,Stratoscale/rackattack-physical,Stratoscale/rackattack-physical | ---
+++
@@ -22,10 +22,11 @@
def _run(self):
ipmi = IPMI(self._hostname, self._username, self._password)
try:
- if self._hardReset == "True":
- ipmi.powerCycle()
- else:
- ipmi.softReset()
+ ipmi.powerCycle()
+# if self._h... |
44351d1e48159825226478df13c648aaa83018db | reportlab/test/test_tools_pythonpoint.py | reportlab/test/test_tools_pythonpoint.py | """Tests for the PythonPoint tool.
"""
import os, sys, string
from reportlab.test import unittest
from reportlab.test.utils import makeSuiteForClasses, outputfile
import reportlab
class PythonPointTestCase(unittest.TestCase):
"Some very crude tests on PythonPoint."
def test0(self):
"Test if pythonp... | """Tests for the PythonPoint tool.
"""
import os, sys, string
from reportlab.test import unittest
from reportlab.test.utils import makeSuiteForClasses, outputfile
import reportlab
class PythonPointTestCase(unittest.TestCase):
"Some very crude tests on PythonPoint."
def test0(self):
"Test if pythonp... | Fix buglet in compact testing | Fix buglet in compact testing
| Python | bsd-3-clause | kanarelo/reportlab,kanarelo/reportlab,Distrotech/reportlab,Distrotech/reportlab,kanarelo/reportlab,Distrotech/reportlab,Distrotech/reportlab,Distrotech/reportlab,kanarelo/reportlab,kanarelo/reportlab | ---
+++
@@ -21,12 +21,11 @@
ppDir = dirname(pythonpoint.__file__)
xml = join(ppDir, 'demos', 'pythonpoint.xml')
datafilename = 'pythonpoint.pdf'
- outdir = outputfile('')
+ outDir = outputfile('')
if isCompactDistro():
cwd = None
xml = open_f... |
77c97ea46280b395d0c2c1c02941f5eb6d88fde6 | rest_framework_json_api/mixins.py | rest_framework_json_api/mixins.py | """
Class Mixins.
"""
class MultipleIDMixin(object):
"""
Override get_queryset for multiple id support
"""
def get_queryset(self):
"""
Override :meth:``get_queryset``
"""
ids = dict(self.request.QUERY_PARAMS).get('ids[]')
if ids:
self.queryset = self.... | """
Class Mixins.
"""
class MultipleIDMixin(object):
"""
Override get_queryset for multiple id support
"""
def get_queryset(self):
"""
Override :meth:``get_queryset``
"""
ids = dict(getattr(self.request, 'query_params', self.request.QUERY_PARAMS)).get('ids[]')
if... | Fix for deprecation of `request.QUERY_PARAMS` in DRF 3.2` | Fix for deprecation of `request.QUERY_PARAMS` in DRF 3.2`
| Python | bsd-2-clause | Instawork/django-rest-framework-json-api,aquavitae/django-rest-framework-json-api,lukaslundgren/django-rest-framework-json-api,django-json-api/django-rest-framework-json-api,leo-naeka/rest_framework_ember,kaldras/django-rest-framework-json-api,schtibe/django-rest-framework-json-api,hnakamur/django-rest-framework-json-a... | ---
+++
@@ -10,7 +10,7 @@
"""
Override :meth:``get_queryset``
"""
- ids = dict(self.request.QUERY_PARAMS).get('ids[]')
+ ids = dict(getattr(self.request, 'query_params', self.request.QUERY_PARAMS)).get('ids[]')
if ids:
self.queryset = self.queryset.filter... |
cd3c1f1fbacd4d1a113249af0faf298d5afa540f | wikifork-convert.py | wikifork-convert.py | #!/usr/bin/env python3
from geojson import Feature, Point, FeatureCollection, dumps
wikitext = open('wiki-fork', 'r')
output = open('output.geojson', 'w')
geo_output = []
for line in wikitext:
split = line.split('"')
coord = split[0].strip(' ')
coord = coord.split(',')
name = split[1].strip()
... | #!/usr/bin/env python3
import urllib.request
from geojson import Feature, Point, FeatureCollection, dumps
wiki = urllib.request.urlopen("https://wiki.archlinux.org/index.php/ArchMap/List")
wiki_source = wiki.read()
wikitext_start = wiki_source.find(b'<pre>', wiki_source.find(b'<pre>') + 1) + 5
wikitext_end = wiki_s... | Switch to parsing the wiki - UNTESTED | Switch to parsing the wiki - UNTESTED
| Python | unlicense | guyfawcus/ArchMap,maelstrom59/ArchMap,guyfawcus/ArchMap,guyfawcus/ArchMap,maelstrom59/ArchMap | ---
+++
@@ -1,8 +1,16 @@
#!/usr/bin/env python3
+import urllib.request
from geojson import Feature, Point, FeatureCollection, dumps
-wikitext = open('wiki-fork', 'r')
+wiki = urllib.request.urlopen("https://wiki.archlinux.org/index.php/ArchMap/List")
+
+wiki_source = wiki.read()
+
+wikitext_start = wiki_source.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.