Search is not available for this dataset
id stringlengths 1 8 | text stringlengths 72 9.81M | addition_count int64 0 10k | commit_subject stringlengths 0 3.7k | deletion_count int64 0 8.43k | file_extension stringlengths 0 32 | lang stringlengths 1 94 | license stringclasses 10
values | repo_name stringlengths 9 59 |
|---|---|---|---|---|---|---|---|---|
1000 | <NME> NativeMethods.cs
<BEF> using System;
using System.Runtime.InteropServices;
[module: DefaultCharSet(CharSet.Unicode)]
namespace HidLibrary
{
internal static class NativeMethods
{
internal const int FILE_FLAG_OVERLAPPED = 0x40000000;
internal const short FILE_SHARE_READ = 0x1;
int... | 1 | HWND is HANDLE which maps to C#'s IntPtr https://docs.microsoft.com/en-us/windows/win32/winprog/windows-data-types#hwnd | 1 | .cs | cs | mit | mikeobrien/HidLibrary |
1001 | <NME> NativeMethods.cs
<BEF> using System;
using System.Runtime.InteropServices;
[module: DefaultCharSet(CharSet.Unicode)]
namespace HidLibrary
{
internal static class NativeMethods
{
internal const int FILE_FLAG_OVERLAPPED = 0x40000000;
internal const short FILE_SHARE_READ = 0x1;
int... | 1 | HWND is HANDLE which maps to C#'s IntPtr https://docs.microsoft.com/en-us/windows/win32/winprog/windows-data-types#hwnd | 1 | .cs | cs | mit | mikeobrien/HidLibrary |
1002 | <NME> Main.Designer.cs
<BEF> namespace TestHarness
{
partial class Main
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </... | 16 | Fix merge conflicts | 16 | .cs | Designer | mit | mikeobrien/HidLibrary |
1003 | <NME> Main.Designer.cs
<BEF> namespace TestHarness
{
partial class Main
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </... | 16 | Fix merge conflicts | 16 | .cs | Designer | mit | mikeobrien/HidLibrary |
1004 | <NME> IHidDevice.cs
<BEF> using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HidLibrary
{
public delegate void InsertedEventHandler();
public delegate void RemovedEventHandler();
public enum DeviceMode
{
NonOverlapped ... | 0 | Clean using statements | 3 | .cs | cs | mit | mikeobrien/HidLibrary |
1005 | <NME> IHidDevice.cs
<BEF> using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HidLibrary
{
public delegate void InsertedEventHandler();
public delegate void RemovedEventHandler();
public enum DeviceMode
{
NonOverlapped ... | 0 | Clean using statements | 3 | .cs | cs | mit | mikeobrien/HidLibrary |
1006 | <NME> HidLibrary.csproj
<BEF> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net20;net35;net40;net45;netstandard2</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Version>3.2.49</Version>
<Company>Ultraviolet Catastrophe</Company>
<Copyright>Copyright © 2011-... | 4 | Fix https://docs.microsoft.com/en-us/nuget/reference/errors-and-warnings/nu5048 | 3 | .csproj | csproj | mit | mikeobrien/HidLibrary |
1007 | <NME> HidLibrary.csproj
<BEF> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net20;net35;net40;net45;netstandard2</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Version>3.2.49</Version>
<Company>Ultraviolet Catastrophe</Company>
<Copyright>Copyright © 2011-... | 4 | Fix https://docs.microsoft.com/en-us/nuget/reference/errors-and-warnings/nu5048 | 3 | .csproj | csproj | mit | mikeobrien/HidLibrary |
1008 | <NME> TestHarness.csproj
<BEF> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)'... | 19 | Fix for OverflowException on x64 | 1 | .csproj | csproj | mit | mikeobrien/HidLibrary |
1009 | <NME> TestHarness.csproj
<BEF> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)'... | 19 | Fix for OverflowException on x64 | 1 | .csproj | csproj | mit | mikeobrien/HidLibrary |
1010 | <NME> NativeMethods.cs
<BEF> using System;
using System.Runtime.InteropServices;
[module: DefaultCharSet(CharSet.Unicode)]
namespace HidLibrary
{
internal static class NativeMethods
{
internal const int FILE_FLAG_OVERLAPPED = 0x40000000;
internal const short FILE_SHARE_READ = 0x1;
int... | 5 | CharSet.Auto is only useful on Windows 98 and ME | 5 | .cs | cs | mit | mikeobrien/HidLibrary |
1011 | <NME> NativeMethods.cs
<BEF> using System;
using System.Runtime.InteropServices;
[module: DefaultCharSet(CharSet.Unicode)]
namespace HidLibrary
{
internal static class NativeMethods
{
internal const int FILE_FLAG_OVERLAPPED = 0x40000000;
internal const short FILE_SHARE_READ = 0x1;
int... | 5 | CharSet.Auto is only useful on Windows 98 and ME | 5 | .cs | cs | mit | mikeobrien/HidLibrary |
1012 | <NME> NativeMethods.cs
<BEF> using System;
using System.Runtime.InteropServices;
[module: DefaultCharSet(CharSet.Unicode)]
namespace HidLibrary
{
internal static class NativeMethods
{
internal const int FILE_FLAG_OVERLAPPED = 0x40000000;
internal const short FILE_SHARE_READ = 0x1;
int... | 3 | Fix Native Methods to Utilize Byte Array | 3 | .cs | cs | mit | mikeobrien/HidLibrary |
1013 | <NME> NativeMethods.cs
<BEF> using System;
using System.Runtime.InteropServices;
[module: DefaultCharSet(CharSet.Unicode)]
namespace HidLibrary
{
internal static class NativeMethods
{
internal const int FILE_FLAG_OVERLAPPED = 0x40000000;
internal const short FILE_SHARE_READ = 0x1;
int... | 3 | Fix Native Methods to Utilize Byte Array | 3 | .cs | cs | mit | mikeobrien/HidLibrary |
1014 | <NME> HidLibrary.csproj
<BEF> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net20;net35;net40;net45;netstandard2</TargetFrameworks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<PackageId>hidlibrary</PackageId>
<PackageVersion>3.2.49</PackageVersion>
<Title>Hi... | 4 | Use project properties instead of AssemblyInfo.cs | 3 | .csproj | csproj | mit | mikeobrien/HidLibrary |
1015 | <NME> HidLibrary.csproj
<BEF> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net20;net35;net40;net45;netstandard2</TargetFrameworks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<PackageId>hidlibrary</PackageId>
<PackageVersion>3.2.49</PackageVersion>
<Title>Hi... | 4 | Use project properties instead of AssemblyInfo.cs | 3 | .csproj | csproj | mit | mikeobrien/HidLibrary |
1016 | <NME> NativeMethods.cs
<BEF> using System;
using System.Runtime.InteropServices;
[module: DefaultCharSet(CharSet.Unicode)]
namespace HidLibrary
{
internal static class NativeMethods
{
internal const int FILE_FLAG_OVERLAPPED = 0x40000000;
internal const short FILE_SHARE_READ = 0x1;
int... | 2 | Use overload instead of suffixing the p/invoke method name and overriding EntryPoint | 2 | .cs | cs | mit | mikeobrien/HidLibrary |
1017 | <NME> NativeMethods.cs
<BEF> using System;
using System.Runtime.InteropServices;
[module: DefaultCharSet(CharSet.Unicode)]
namespace HidLibrary
{
internal static class NativeMethods
{
internal const int FILE_FLAG_OVERLAPPED = 0x40000000;
internal const short FILE_SHARE_READ = 0x1;
int... | 2 | Use overload instead of suffixing the p/invoke method name and overriding EntryPoint | 2 | .cs | cs | mit | mikeobrien/HidLibrary |
1018 | <NME> README.md
<BEF> <h3>NOTE: Support is VERY limited for this library. It is almost impossible to troubleshoot issues with so many devices and configurations. The community may be able to offer some assistance <i>but you will largely be on your own</i>. If you submit an issue, please include a relevant code snippet ... | 2 | Fixed links to Jan Axelson's page | 2 | .md | md | mit | mikeobrien/HidLibrary |
1019 | <NME> README.md
<BEF> <h3>NOTE: Support is VERY limited for this library. It is almost impossible to troubleshoot issues with so many devices and configurations. The community may be able to offer some assistance <i>but you will largely be on your own</i>. If you submit an issue, please include a relevant code snippet ... | 2 | Fixed links to Jan Axelson's page | 2 | .md | md | mit | mikeobrien/HidLibrary |
1020 | <NME> TestSecurityContext.java
<BEF> package com.github.structlog4j.samples;
import com.github.structlog4j.IToLog;
import lombok.Value;
import java.security.Principal;
/**
* A Sample of an object that implements the IToLog
*/
@Value
public class TestSecurityContext implements IToLog {
private String userName;... | 1 | 0.3.0: added JSON formatter | 3 | .java | java | mit | jacek99/structlog4j |
1021 | <NME> HidLibrary.nuspec
<BEF> <?xml version="1.0" encoding="UTF-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>hidlibrary</id>
<version>$version$</version>
<title>Hid Library</title>
<authors>Mike O'Brien</authors>
<description>This libr... | 5 | Merge pull request #115 from w-michal/nuget_update | 0 | .nuspec | nuspec | mit | mikeobrien/HidLibrary |
1022 | <NME> HidLibrary.nuspec
<BEF> <?xml version="1.0" encoding="UTF-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>hidlibrary</id>
<version>$version$</version>
<title>Hid Library</title>
<authors>Mike O'Brien</authors>
<description>This libr... | 5 | Merge pull request #115 from w-michal/nuget_update | 0 | .nuspec | nuspec | mit | mikeobrien/HidLibrary |
1023 | <NME> HidDevice.cs
<BEF> using System;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
namespace HidLibrary
{
public class HidDevice : IHidDevice
{
public event InsertedEventHandler Inserted;
public event RemovedEventHandler Removed;
private... | 1 | Merge pull request #20 from juliansiebert/master | 0 | .cs | cs | mit | mikeobrien/HidLibrary |
1024 | <NME> HidDevice.cs
<BEF> using System;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
namespace HidLibrary
{
public class HidDevice : IHidDevice
{
public event InsertedEventHandler Inserted;
public event RemovedEventHandler Removed;
private... | 1 | Merge pull request #20 from juliansiebert/master | 0 | .cs | cs | mit | mikeobrien/HidLibrary |
1025 | <NME> HidDevice.cs
<BEF> using System;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
namespace HidLibrary
{
public class HidDevice : IHidDevice
{
public event InsertedEventHandler Inserted;
public event RemovedEventHandler Removed;
private... | 36 | Added support for writing Hid feature data. | 1 | .cs | cs | mit | mikeobrien/HidLibrary |
1026 | <NME> HidDevice.cs
<BEF> using System;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
namespace HidLibrary
{
public class HidDevice : IHidDevice
{
public event InsertedEventHandler Inserted;
public event RemovedEventHandler Removed;
private... | 36 | Added support for writing Hid feature data. | 1 | .cs | cs | mit | mikeobrien/HidLibrary |
1027 | <NME> HidDevices.cs
<BEF> using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
namespace HidLibrary
{
public class HidDevices
{
private static Guid _hidClassGuid = Guid.Empty;
public static bool IsConnected(string d... | 5 | Added the ability to enumerate using a specific usage page | 0 | .cs | cs | mit | mikeobrien/HidLibrary |
1028 | <NME> HidDevices.cs
<BEF> using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
namespace HidLibrary
{
public class HidDevices
{
private static Guid _hidClassGuid = Guid.Empty;
public static bool IsConnected(string d... | 5 | Added the ability to enumerate using a specific usage page | 0 | .cs | cs | mit | mikeobrien/HidLibrary |
1029 | <NME> IHidDevice.cs
<BEF> using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace HidLibrary
{
public enum DeviceMode
{
NonOverlapped = 0,
Overlapped = 1
}
[Flags]
public enum ShareMode
{
Exclusive = 0,
ShareRead = Native... | 17 | Add async methods to IHidDevice interface | 0 | .cs | cs | mit | mikeobrien/HidLibrary |
1030 | <NME> IHidDevice.cs
<BEF> using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace HidLibrary
{
public enum DeviceMode
{
NonOverlapped = 0,
Overlapped = 1
}
[Flags]
public enum ShareMode
{
Exclusive = 0,
ShareRead = Native... | 17 | Add async methods to IHidDevice interface | 0 | .cs | cs | mit | mikeobrien/HidLibrary |
1031 | <NME> app.config
<BEF> ADDFILE
<MSG> Conversion to C# and added x64 support.
<DFF> @@ -0,0 +1,3 @@
+<?xml version="1.0"?>
+<configuration>
+<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
| 3 | Conversion to C# and added x64 support. | 0 | .config | config | mit | mikeobrien/HidLibrary |
1032 | <NME> app.config
<BEF> ADDFILE
<MSG> Conversion to C# and added x64 support.
<DFF> @@ -0,0 +1,3 @@
+<?xml version="1.0"?>
+<configuration>
+<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
| 3 | Conversion to C# and added x64 support. | 0 | .config | config | mit | mikeobrien/HidLibrary |
1033 | <NME> NativeMethods.cs
<BEF> using System;
using System.Runtime.InteropServices;
namespace HidLibrary
{
{
internal static class NativeMethods
{
internal const int FILE_FLAG_OVERLAPPED = 0x40000000;
internal const short FILE_SHARE_READ = 0x1;
internal const short FILE_SHARE_WRITE =... | 10 | Added getters for Product, Manufacturer, and Serial Number strings | 0 | .cs | cs | mit | mikeobrien/HidLibrary |
1034 | <NME> NativeMethods.cs
<BEF> using System;
using System.Runtime.InteropServices;
namespace HidLibrary
{
{
internal static class NativeMethods
{
internal const int FILE_FLAG_OVERLAPPED = 0x40000000;
internal const short FILE_SHARE_READ = 0x1;
internal const short FILE_SHARE_WRITE =... | 10 | Added getters for Product, Manufacturer, and Serial Number strings | 0 | .cs | cs | mit | mikeobrien/HidLibrary |
1035 | <NME> NativeMethods.cs
<BEF> using System;
using System.Runtime.InteropServices;
[module: DefaultCharSet(CharSet.Unicode)]
namespace HidLibrary
{
internal static class NativeMethods
{
internal const int FILE_FLAG_OVERLAPPED = 0x40000000;
internal const short FILE_SHARE_READ = 0x1;
int... | 7 | Changed function signatures to make them easier to use from C# (without type casting) | 7 | .cs | cs | mit | mikeobrien/HidLibrary |
1036 | <NME> NativeMethods.cs
<BEF> using System;
using System.Runtime.InteropServices;
[module: DefaultCharSet(CharSet.Unicode)]
namespace HidLibrary
{
internal static class NativeMethods
{
internal const int FILE_FLAG_OVERLAPPED = 0x40000000;
internal const short FILE_SHARE_READ = 0x1;
int... | 7 | Changed function signatures to make them easier to use from C# (without type casting) | 7 | .cs | cs | mit | mikeobrien/HidLibrary |
1037 | <NME> HidDevice.cs
<BEF> using System;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
namespace HidLibrary
{
public class HidDevice : IHidDevice
{
public event InsertedEventHandler Inserted;
public event RemovedEventHandler Removed;
private... | 4 | Fixed an pre vista compatibility issue. | 1 | .cs | cs | mit | mikeobrien/HidLibrary |
1038 | <NME> HidDevice.cs
<BEF> using System;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
namespace HidLibrary
{
public class HidDevice : IHidDevice
{
public event InsertedEventHandler Inserted;
public event RemovedEventHandler Removed;
private... | 4 | Fixed an pre vista compatibility issue. | 1 | .cs | cs | mit | mikeobrien/HidLibrary |
1039 | <NME> utils.py
<BEF> """
Utility functions for access to OS level info and URI parsing
"""
import collections
import os
import pwd
try:
from urllib import parse as _urlparse
except ImportError:
try:
from urllib import parse as _urlparse
except ImportError:
import urlparse as _urlparse
try:
from urllib.... | 12 | Merge pull request #14 from fbergr/pwd | 2 | .py | py | bsd-3-clause | gmr/queries |
1040 | <NME> utils.py
<BEF> """
Utility functions for access to OS level info and URI parsing
"""
import collections
import os
import pwd
try:
from urllib import parse as _urlparse
except ImportError:
try:
from urllib import parse as _urlparse
except ImportError:
import urlparse as _urlparse
try:
from urllib.... | 12 | Merge pull request #14 from fbergr/pwd | 2 | .py | py | bsd-3-clause | gmr/queries |
1041 | <NME> utils_tests.py
<BEF> """
Tests for functionality in the utils module
"""
import platform
import unittest
import mock
import queries
from queries import utils
class GetCurrentUserTests(unittest.TestCase):
@mock.patch('pwd.getpwuid')
def test_get_current_user(self, getpwuid):
"""get_current_us... | 1 | Constants and imports cleanup | 1 | .py | py | bsd-3-clause | gmr/queries |
1042 | <NME> utils_tests.py
<BEF> """
Tests for functionality in the utils module
"""
import platform
import unittest
import mock
import queries
from queries import utils
class GetCurrentUserTests(unittest.TestCase):
@mock.patch('pwd.getpwuid')
def test_get_current_user(self, getpwuid):
"""get_current_us... | 1 | Constants and imports cleanup | 1 | .py | py | bsd-3-clause | gmr/queries |
1043 | <NME> setup.py
<BEF> import os
import platform
import setuptools
# PYPY vs cpython
if platform.python_implementation() == 'PyPy':
install_requires = ['psycopg2cffi>=2.7.2,<3']
else:
install_requires = ['psycopg2>=2.5.1,<3']
# Install tornado if generating docs on readthedocs
if os.environ.get('READTHEDOCS', ... | 1 | Remove the fd from the IOLoop on OSError | 1 | .py | py | bsd-3-clause | gmr/queries |
1044 | <NME> setup.py
<BEF> import os
import platform
import setuptools
# PYPY vs cpython
if platform.python_implementation() == 'PyPy':
install_requires = ['psycopg2cffi>=2.7.2,<3']
else:
install_requires = ['psycopg2>=2.5.1,<3']
# Install tornado if generating docs on readthedocs
if os.environ.get('READTHEDOCS', ... | 1 | Remove the fd from the IOLoop on OSError | 1 | .py | py | bsd-3-clause | gmr/queries |
1045 | <NME> testing.txt
<BEF> coverage
flake8
mock
nose
codecov
tornado
<MSG> Incr counters in TornadoSession
<DFF> @@ -2,5 +2,4 @@ coverage
flake8
mock
nose
-codecov
tornado
| 0 | Incr counters in TornadoSession | 1 | .txt | txt | bsd-3-clause | gmr/queries |
1046 | <NME> testing.txt
<BEF> coverage
flake8
mock
nose
codecov
tornado
<MSG> Incr counters in TornadoSession
<DFF> @@ -2,5 +2,4 @@ coverage
flake8
mock
nose
-codecov
tornado
| 0 | Incr counters in TornadoSession | 1 | .txt | txt | bsd-3-clause | gmr/queries |
1047 | <NME> README.rst
<BEF> Queries
=======
PostgreSQL database access simplified.
Queries is an opinionated wrapper of the psycopg2_ library for interfacing with
PostgreSQL. Key features include:
- Simplified API
- Support of Python 2.6+ and 3.2+
- Asynchronous support for Tornado_
- Connection information provided by UR... | 15 | Update intro | 7 | .rst | rst | bsd-3-clause | gmr/queries |
1048 | <NME> README.rst
<BEF> Queries
=======
PostgreSQL database access simplified.
Queries is an opinionated wrapper of the psycopg2_ library for interfacing with
PostgreSQL. Key features include:
- Simplified API
- Support of Python 2.6+ and 3.2+
- Asynchronous support for Tornado_
- Connection information provided by UR... | 15 | Update intro | 7 | .rst | rst | bsd-3-clause | gmr/queries |
1049 | <NME> README.rst
<BEF> Queries: PostgreSQL Simplified
==============================
*Queries* is a BSD licensed opinionated wrapper of the psycopg2_ library for
interacting with PostgreSQL.
The popular psycopg2_ package is a full-featured python client. Unfortunately
as a developer, you're often repeating the same st... | 1 | Update the supported Python versions | 1 | .rst | rst | bsd-3-clause | gmr/queries |
1050 | <NME> README.rst
<BEF> Queries: PostgreSQL Simplified
==============================
*Queries* is a BSD licensed opinionated wrapper of the psycopg2_ library for
interacting with PostgreSQL.
The popular psycopg2_ package is a full-featured python client. Unfortunately
as a developer, you're often repeating the same st... | 1 | Update the supported Python versions | 1 | .rst | rst | bsd-3-clause | gmr/queries |
1051 | <NME> pool.rst
<BEF> ADDFILE
<MSG> Documentation updates
<DFF> @@ -0,0 +1,25 @@
+Connection Pooling
+==================
+The :py:class:`PoolManager <queries.pool.PoolManager>` class provides top-level
+access to the queries pooling mechanism, managing pools of connections by DSN in
+instances of the :py:class:`Pool <q... | 25 | Documentation updates | 0 | .rst | rst | bsd-3-clause | gmr/queries |
1052 | <NME> pool.rst
<BEF> ADDFILE
<MSG> Documentation updates
<DFF> @@ -0,0 +1,25 @@
+Connection Pooling
+==================
+The :py:class:`PoolManager <queries.pool.PoolManager>` class provides top-level
+access to the queries pooling mechanism, managing pools of connections by DSN in
+instances of the :py:class:`Pool <q... | 25 | Documentation updates | 0 | .rst | rst | bsd-3-clause | gmr/queries |
1053 | <NME> setup.py
<BEF> import os
import platform
import setuptools
# PYPY vs cpython
if platform.python_implementation() == 'PyPy':
install_requires = ['psycopg2cffi>=2.7.2,<2.9']
else:
install_requires = ['psycopg2>=2.5.1,<2.9']
# Install tornado if generating docs on readthedocs
if os.environ.get('READTHEDOC... | 2 | Merge pull request #43 from dave-shawley/bump-psycopg2 | 2 | .py | py | bsd-3-clause | gmr/queries |
1054 | <NME> setup.py
<BEF> import os
import platform
import setuptools
# PYPY vs cpython
if platform.python_implementation() == 'PyPy':
install_requires = ['psycopg2cffi>=2.7.2,<2.9']
else:
install_requires = ['psycopg2>=2.5.1,<2.9']
# Install tornado if generating docs on readthedocs
if os.environ.get('READTHEDOC... | 2 | Merge pull request #43 from dave-shawley/bump-psycopg2 | 2 | .py | py | bsd-3-clause | gmr/queries |
1055 | <NME> tornado_multiple.rst
<BEF> Concurrent Queries in Tornado
=============================
The following example issues multiple concurrent queries in a single asynchronous
request and will wait until all queries are complete before progressing:
.. code:: python
from tornado import gen, ioloop, web
import q... | 0 | Update the examples | 7 | .rst | rst | bsd-3-clause | gmr/queries |
1056 | <NME> tornado_multiple.rst
<BEF> Concurrent Queries in Tornado
=============================
The following example issues multiple concurrent queries in a single asynchronous
request and will wait until all queries are complete before progressing:
.. code:: python
from tornado import gen, ioloop, web
import q... | 0 | Update the examples | 7 | .rst | rst | bsd-3-clause | gmr/queries |
1057 | <NME> tornado_session_tests.py
<BEF> """
Tests for functionality in the tornado_session module
"""
import unittest
import mock
# Out of order import to ensure psycopg2cffi is registered
from queries import pool, tornado_session
from psycopg2 import extras
from tornado import concurrent, gen, ioloop, testing
class... | 0 | Test does not need to be async | 1 | .py | py | bsd-3-clause | gmr/queries |
1058 | <NME> tornado_session_tests.py
<BEF> """
Tests for functionality in the tornado_session module
"""
import unittest
import mock
# Out of order import to ensure psycopg2cffi is registered
from queries import pool, tornado_session
from psycopg2 import extras
from tornado import concurrent, gen, ioloop, testing
class... | 0 | Test does not need to be async | 1 | .py | py | bsd-3-clause | gmr/queries |
1059 | <NME> setup.py
<BEF> import os
import os
import platform
# Make the install_requires
target = platform.python_implementation()
if target == 'PyPy':
install_requires = ['psycopg2ct']
else:
install_requires = ['psycopg2>=2.5.1']
# Install tornado if generating docs on readthedocs
if os.environ.get('READTHEDOCS'... | 7 | Move to psycopg2cffi for PyPy | 7 | .py | py | bsd-3-clause | gmr/queries |
1060 | <NME> setup.py
<BEF> import os
import os
import platform
# Make the install_requires
target = platform.python_implementation()
if target == 'PyPy':
install_requires = ['psycopg2ct']
else:
install_requires = ['psycopg2>=2.5.1']
# Install tornado if generating docs on readthedocs
if os.environ.get('READTHEDOCS'... | 7 | Move to psycopg2cffi for PyPy | 7 | .py | py | bsd-3-clause | gmr/queries |
1061 | <NME> session.py
<BEF> """The Session class allows for a unified (and simplified) view of
interfacing with a PostgreSQL database server.
Connection details are passed in as a PostgreSQL URI and connections are pooled
by default, allowing for reuse of connections across modules in the Python
runtime without having to p... | 22 | Metric Reporting | 2 | .py | py | bsd-3-clause | gmr/queries |
1062 | <NME> session.py
<BEF> """The Session class allows for a unified (and simplified) view of
interfacing with a PostgreSQL database server.
Connection details are passed in as a PostgreSQL URI and connections are pooled
by default, allowing for reuse of connections across modules in the Python
runtime without having to p... | 22 | Metric Reporting | 2 | .py | py | bsd-3-clause | gmr/queries |
1063 | <NME> setup.cfg
<BEF> [flake8]
application-import-names=queries
exclude=build,env
import-order-style=google
[nosetests]
cover-html = 1
cover-html-dir = build/coverage
cover-package = queries
logging-level = DEBUG
verbosity = 2
with-coverage = 1
with-coverage = 1
detailed-errors = 1
<MSG> Update test configuration
<... | 3 | Update test configuration | 0 | .cfg | cfg | bsd-3-clause | gmr/queries |
1064 | <NME> setup.cfg
<BEF> [flake8]
application-import-names=queries
exclude=build,env
import-order-style=google
[nosetests]
cover-html = 1
cover-html-dir = build/coverage
cover-package = queries
logging-level = DEBUG
verbosity = 2
with-coverage = 1
with-coverage = 1
detailed-errors = 1
<MSG> Update test configuration
<... | 3 | Update test configuration | 0 | .cfg | cfg | bsd-3-clause | gmr/queries |
1065 | <NME> integration_tests.py
<BEF> import datetime
import os
import unittest
import unittest
import queries
from tornado import gen
from tornado import testing
@property
def pg_uri(self):
return queries.uri(os.getenv('PGHOST', 'localhost'),
int(os.getenv('PGPORT', '5432... | 0 | Remove unused import | 1 | .py | py | bsd-3-clause | gmr/queries |
1066 | <NME> integration_tests.py
<BEF> import datetime
import os
import unittest
import unittest
import queries
from tornado import gen
from tornado import testing
@property
def pg_uri(self):
return queries.uri(os.getenv('PGHOST', 'localhost'),
int(os.getenv('PGPORT', '5432... | 0 | Remove unused import | 1 | .py | py | bsd-3-clause | gmr/queries |
1067 | <NME> session.py
<BEF> """The Session class allows for a unified (and simplified) view of
interfacing with a PostgreSQL database server.
Connection details are passed in as a PostgreSQL URI and connections are pooled
by default, allowing for reuse of connections across modules in the Python
runtime without having to p... | 6 | Typos and consistency | 6 | .py | py | bsd-3-clause | gmr/queries |
1068 | <NME> session.py
<BEF> """The Session class allows for a unified (and simplified) view of
interfacing with a PostgreSQL database server.
Connection details are passed in as a PostgreSQL URI and connections are pooled
by default, allowing for reuse of connections across modules in the Python
runtime without having to p... | 6 | Typos and consistency | 6 | .py | py | bsd-3-clause | gmr/queries |
1069 | <NME> results_tests.py
<BEF> """
Tests for functionality in the results module
"""
import logging
import unittest
import mock
import psycopg2
from queries import results
LOGGER = logging.getLogger(__name__)
class ResultsTestCase(unittest.TestCase):
def setUp(self):
self.cursor = mock.MagicMock()
... | 4 | Remove the NotImplemented test | 5 | .py | py | bsd-3-clause | gmr/queries |
1070 | <NME> results_tests.py
<BEF> """
Tests for functionality in the results module
"""
import logging
import unittest
import mock
import psycopg2
from queries import results
LOGGER = logging.getLogger(__name__)
class ResultsTestCase(unittest.TestCase):
def setUp(self):
self.cursor = mock.MagicMock()
... | 4 | Remove the NotImplemented test | 5 | .py | py | bsd-3-clause | gmr/queries |
1071 | <NME> __init__.py
<BEF> """
Queries: PostgreSQL database access simplified
Queries is an opinionated wrapper for interfacing with PostgreSQL that offers
caching of connections and support for PyPy via psycopg2ct.
The core `queries.Queries` class will automatically register support for UUIDs,
Unicode and Unicode array... | 1 | Fix a bug in queries.uri() and add test coverage | 1 | .py | py | bsd-3-clause | gmr/queries |
1072 | <NME> __init__.py
<BEF> """
Queries: PostgreSQL database access simplified
Queries is an opinionated wrapper for interfacing with PostgreSQL that offers
caching of connections and support for PyPy via psycopg2ct.
The core `queries.Queries` class will automatically register support for UUIDs,
Unicode and Unicode array... | 1 | Fix a bug in queries.uri() and add test coverage | 1 | .py | py | bsd-3-clause | gmr/queries |
1073 | <NME> session.py
<BEF> """The Session class allows for a unified (and simplified) view of
interfacing with a PostgreSQL database server.
Connection details are passed in as a PostgreSQL URI and connections are pooled
by default, allowing for reuse of connections across modules in the Python
runtime without having to p... | 9 | Use the singleton poolmanager instance, handle exceptions in cleanup | 3 | .py | py | bsd-3-clause | gmr/queries |
1074 | <NME> session.py
<BEF> """The Session class allows for a unified (and simplified) view of
interfacing with a PostgreSQL database server.
Connection details are passed in as a PostgreSQL URI and connections are pooled
by default, allowing for reuse of connections across modules in the Python
runtime without having to p... | 9 | Use the singleton poolmanager instance, handle exceptions in cleanup | 3 | .py | py | bsd-3-clause | gmr/queries |
1075 | <NME> .travis.yml
<BEF> language: python
python:
- 2.6
- 2.7
- pypy
- 3.2
- 3.3
- 3.4
addons:
postgresql: '9.3'
install:
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install unittest2; fi
- if [[ $TRAVIS_PYTHON_VERSION != 'pypy' ]]; then pip install -r requirements.pip;
fi
- if [[ $TRAVIS_PYTHON_VERSION == ... | 14 | Move to codecov and add pip caching | 12 | .yml | travis | bsd-3-clause | gmr/queries |
1076 | <NME> .travis.yml
<BEF> language: python
python:
- 2.6
- 2.7
- pypy
- 3.2
- 3.3
- 3.4
addons:
postgresql: '9.3'
install:
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install unittest2; fi
- if [[ $TRAVIS_PYTHON_VERSION != 'pypy' ]]; then pip install -r requirements.pip;
fi
- if [[ $TRAVIS_PYTHON_VERSION == ... | 14 | Move to codecov and add pip caching | 12 | .yml | travis | bsd-3-clause | gmr/queries |
1077 | <NME> test-requirements.txt
<BEF> ADDFILE
<MSG> Clean up testing related things
<DFF> @@ -0,0 +1,4 @@
+coverage
+mock
+nose
+codecov
| 4 | Clean up testing related things | 0 | .txt | txt | bsd-3-clause | gmr/queries |
1078 | <NME> test-requirements.txt
<BEF> ADDFILE
<MSG> Clean up testing related things
<DFF> @@ -0,0 +1,4 @@
+coverage
+mock
+nose
+codecov
| 4 | Clean up testing related things | 0 | .txt | txt | bsd-3-clause | gmr/queries |
1079 | <NME> tornado_basic.rst
<BEF> Basic Tornado Usage
===================
The following example implements a very basic RESTful API. The following DDL will
create the table used by the API:
.. code:: sql
CREATE TABLE widgets (sku varchar(10) NOT NULL PRIMARY KEY,
name text NOT NULL,
... | 99 | Update the Basic Tornado example | 23 | .rst | rst | bsd-3-clause | gmr/queries |
1080 | <NME> tornado_basic.rst
<BEF> Basic Tornado Usage
===================
The following example implements a very basic RESTful API. The following DDL will
create the table used by the API:
.. code:: sql
CREATE TABLE widgets (sku varchar(10) NOT NULL PRIMARY KEY,
name text NOT NULL,
... | 99 | Update the Basic Tornado example | 23 | .rst | rst | bsd-3-clause | gmr/queries |
1081 | <NME> .travis.yml
<BEF> sudo: false
language: python
python:
- 2.7
- 3.4
- 3.5
- 3.6
- pypy
- pypy3
env:
global:
- PATH=$HOME/.local/bin:$PATH
- AWS_DEFAULT_REGION=us-east-1
- secure: "inURdx4ldkJqQXL1TyvKImC3EnL5TixC1DlNMBYi5ttygwAk+mSSSw8Yc7klB6D1m6q79xUlHRk06vbz23CsXTM4AClC5Emrk6XN2GlUKl5WI+z+A2skI... | 27 | Update to reflect findings for stages in travis | 25 | .yml | travis | bsd-3-clause | gmr/queries |
1082 | <NME> .travis.yml
<BEF> sudo: false
language: python
python:
- 2.7
- 3.4
- 3.5
- 3.6
- pypy
- pypy3
env:
global:
- PATH=$HOME/.local/bin:$PATH
- AWS_DEFAULT_REGION=us-east-1
- secure: "inURdx4ldkJqQXL1TyvKImC3EnL5TixC1DlNMBYi5ttygwAk+mSSSw8Yc7klB6D1m6q79xUlHRk06vbz23CsXTM4AClC5Emrk6XN2GlUKl5WI+z+A2skI... | 27 | Update to reflect findings for stages in travis | 25 | .yml | travis | bsd-3-clause | gmr/queries |
1083 | <NME> LICENSE
<BEF> Copyright (c) 2014 - 2016 Gavin M. Roy
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of condi... | 1 | Bump license year | 1 | LICENSE | bsd-3-clause | gmr/queries | |
1084 | <NME> LICENSE
<BEF> Copyright (c) 2014 - 2016 Gavin M. Roy
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of condi... | 1 | Bump license year | 1 | LICENSE | bsd-3-clause | gmr/queries | |
1085 | <NME> utils.py
<BEF> """
Utility functions for access to OS level info and URI parsing
"""
import collections
import os
import pwd
try:
from urllib import parse as _urlparse
except ImportError:
try:
from urllib import parse as _urlparse
except ImportError:
import urlparse as _urlparse
try:
from urllib.... | 12 | Add alternative for pwd module | 2 | .py | py | bsd-3-clause | gmr/queries |
1086 | <NME> utils.py
<BEF> """
Utility functions for access to OS level info and URI parsing
"""
import collections
import os
import pwd
try:
from urllib import parse as _urlparse
except ImportError:
try:
from urllib import parse as _urlparse
except ImportError:
import urlparse as _urlparse
try:
from urllib.... | 12 | Add alternative for pwd module | 2 | .py | py | bsd-3-clause | gmr/queries |
1087 | <NME> utils_tests.py
<BEF> """
Tests for functionality in the utils module
"""
import mock
import unittest
from queries import utils
class GetCurrentUserTests(unittest.TestCase):
@mock.patch('pwd.getpwuid')
def test_get_current_user(self, getpwuid):
"""get_current_user returns value from pwd.getpw... | 27 | Change how psycopg2cffi is registered | 2 | .py | py | bsd-3-clause | gmr/queries |
1088 | <NME> utils_tests.py
<BEF> """
Tests for functionality in the utils module
"""
import mock
import unittest
from queries import utils
class GetCurrentUserTests(unittest.TestCase):
@mock.patch('pwd.getpwuid')
def test_get_current_user(self, getpwuid):
"""get_current_user returns value from pwd.getpw... | 27 | Change how psycopg2cffi is registered | 2 | .py | py | bsd-3-clause | gmr/queries |
1089 | <NME> setup.py
<BEF> import os
import platform
import setuptools
# PYPY vs cpython
if platform.python_implementation() == 'PyPy':
install_requires = ['psycopg2cffi>=2.7.2,<3']
else:
install_requires = ['psycopg2>=2.5.1,<3']
# Install tornado if generating docs on readthedocs
if os.environ.get('READTHEDOCS', ... | 1 | A better way to make sure the future doesnt already have an exception | 1 | .py | py | bsd-3-clause | gmr/queries |
1090 | <NME> setup.py
<BEF> import os
import platform
import setuptools
# PYPY vs cpython
if platform.python_implementation() == 'PyPy':
install_requires = ['psycopg2cffi>=2.7.2,<3']
else:
install_requires = ['psycopg2>=2.5.1,<3']
# Install tornado if generating docs on readthedocs
if os.environ.get('READTHEDOCS', ... | 1 | A better way to make sure the future doesnt already have an exception | 1 | .py | py | bsd-3-clause | gmr/queries |
1091 | <NME> setup.py
<BEF> import os
import platform
import setuptools
# PYPY vs cpython
if platform.python_implementation() == 'PyPy':
install_requires = ['psycopg2cffi>=2.7.2,<3']
else:
install_requires = ['psycopg2>=2.5.1,<3']
# Install tornado if generating docs on readthedocs
if os.environ.get('READTHEDOCS', ... | 1 | Dont double-raise exceptions, handle exceptions in the same place | 1 | .py | py | bsd-3-clause | gmr/queries |
1092 | <NME> setup.py
<BEF> import os
import platform
import setuptools
# PYPY vs cpython
if platform.python_implementation() == 'PyPy':
install_requires = ['psycopg2cffi>=2.7.2,<3']
else:
install_requires = ['psycopg2>=2.5.1,<3']
# Install tornado if generating docs on readthedocs
if os.environ.get('READTHEDOCS', ... | 1 | Dont double-raise exceptions, handle exceptions in the same place | 1 | .py | py | bsd-3-clause | gmr/queries |
1093 | <NME> README.rst
<BEF> Queries: PostgreSQL Simplified
==============================
*Queries* is a BSD licensed opinionated wrapper of the psycopg2_ library for
interacting with PostgreSQL.
The popular psycopg2_ package is a full-featured python client. Unfortunately
as a developer, you're often repeating the same st... | 2 | Fix the repo for coverage info | 2 | .rst | rst | bsd-3-clause | gmr/queries |
1094 | <NME> README.rst
<BEF> Queries: PostgreSQL Simplified
==============================
*Queries* is a BSD licensed opinionated wrapper of the psycopg2_ library for
interacting with PostgreSQL.
The popular psycopg2_ package is a full-featured python client. Unfortunately
as a developer, you're often repeating the same st... | 2 | Fix the repo for coverage info | 2 | .rst | rst | bsd-3-clause | gmr/queries |
1095 | <NME> history.rst
<BEF> Version History
===============
- 1.10.4 2018-01-10
- Implement ``Results.__bool__`` to be explicit about Python 3 support.
- Catch any exception raised when using TornadoSession and invoking the execute function in psycopg2 for exceptions raised prior to sending the query to Postgres.
T... | 85 | Update changelog | 41 | .rst | rst | bsd-3-clause | gmr/queries |
1096 | <NME> history.rst
<BEF> Version History
===============
- 1.10.4 2018-01-10
- Implement ``Results.__bool__`` to be explicit about Python 3 support.
- Catch any exception raised when using TornadoSession and invoking the execute function in psycopg2 for exceptions raised prior to sending the query to Postgres.
T... | 85 | Update changelog | 41 | .rst | rst | bsd-3-clause | gmr/queries |
1097 | <NME> results.py
<BEF> """
query or callproc Results
"""
import logging
import psycopg2
LOGGER = logging.getLogger(__name__)
class Results(object):
"""The :py:class:`Results` class contains the results returned from
:py:meth:`Session.query <queries.Session.query>` and
:py:meth:`Session.callproc <queries... | 3 | Merge pull request #27 from dave-shawley/python3-bool | 0 | .py | py | bsd-3-clause | gmr/queries |
1098 | <NME> results.py
<BEF> """
query or callproc Results
"""
import logging
import psycopg2
LOGGER = logging.getLogger(__name__)
class Results(object):
"""The :py:class:`Results` class contains the results returned from
:py:meth:`Session.query <queries.Session.query>` and
:py:meth:`Session.callproc <queries... | 3 | Merge pull request #27 from dave-shawley/python3-bool | 0 | .py | py | bsd-3-clause | gmr/queries |
1099 | <NME> tornado_session.py
<BEF> """
Tornado Session Adapter
Use Queries asynchronously within the Tornado framework.
Example Use:
.. code:: python
class NameListHandler(web.RequestHandler):
def initialize(self):
self.session = queries.TornadoSession(pool_max_size=60)
@gen.coroutine
... | 6 | Be more explicit in exception catching | 5 | .py | py | bsd-3-clause | gmr/queries |