diff stringlengths 65 26.7k | message stringlengths 7 9.92k |
|---|---|
diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -1,10 +1,10 @@
+S3 = require('AWS').S3;
+
Upload = (awsBucketName, options) {
- this.aws = null; // initial aws connection
-
- this.awsBucketName = awsBucketName;
-
- // Set default options
- this.path = options.path || '/images';
+ this.s3 = new S3({ params: { Bucket: awsBucketName } });
+
+ // Set options
+ this.path = options.path || '/';
this.url = options.url || null;
this.sizes = options.sizes || [780, 320];
this.keepOriginal = options.keepOriginal || true; // @TODO this won't work | Init S3 bucket on new class instance |
diff --git a/src/utils/source.js b/src/utils/source.js
index <HASH>..<HASH> 100644
--- a/src/utils/source.js
+++ b/src/utils/source.js
@@ -280,6 +280,23 @@ function getMode(source: Source, sourceMetaData: SourceMetaDataType) {
return "jsx";
}
+ const languageMimeMap = [
+ { ext: ".c", mode: "text/x-csrc" },
+ { ext: ".kt", mode: "text/x-kotlin" },
+ { ext: ".cpp", mode: "text/x-c++src" },
+ { ext: ".m", mode: "text/x-objectivec" },
+ { ext: ".rs", mode: "text/x-rustsrc" }
+ ];
+
+ // check for C and other non JS languages
+ if (url) {
+ const result = languageMimeMap.find(({ ext }) => url.endsWith(ext));
+
+ if (result !== undefined) {
+ return result.mode;
+ }
+ }
+
// if the url ends with .marko we set the name to Javascript so
// syntax highlighting works for marko too
if (url && url.match(/\.marko$/i)) { | Add non-js languages (#<I>) |
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -40,6 +40,7 @@ module.exports = function(app, dcPath) {
'-f',
dcFile,
'run',
+ '--service-ports',
app,
cmd
].join(' '); | [#1] add service ports option to the command |
diff --git a/loadCSS.js b/loadCSS.js
index <HASH>..<HASH> 100644
--- a/loadCSS.js
+++ b/loadCSS.js
@@ -31,21 +31,17 @@ function loadCSS( href, before, media, callback ){
// This function sets the link's media back to `all` so that the stylesheet applies once it loads
// It is designed to poll until document.styleSheets includes the new sheet.
ss.onloadcssdefined = function( cb ){
- var defined;
var i = sheets.length;
while( i-- ){
if( sheets[ i ].href && sheets[ i ].href === ss.href ){
- defined = true;
- break;
+ cb();
+ return;
}
}
- if( defined ){
- cb();
- } else {
- setTimeout(function() {
- ss.onloadcssdefined( cb );
- });
- }
+ // Try again later
+ setTimeout(function() {
+ ss.onloadcssdefined( cb );
+ });
};
ss.onloadcssdefined(function() {
ss.media = media || "all"; | optimise: Simplify by returning early from the loop |
diff --git a/app/templates/_keystone.js b/app/templates/_keystone.js
index <HASH>..<HASH> 100644
--- a/app/templates/_keystone.js
+++ b/app/templates/_keystone.js
@@ -14,7 +14,6 @@ var Twig = require('twig');<% } %>
// and documentation.
<% } %>
keystone.init({
-
'name': '<%= projectName %>',
'brand': '<%= projectName %>',
<% if (preprocessor === 'sass') { %>
@@ -39,8 +38,8 @@ keystone.init({
extname: '.hbs',
}).engine,
<% } else if (viewEngine == 'twig') { %>
- 'twig options':{ method: 'fs' },
- 'custom engine':Twig.render,
+ 'twig options': { method: 'fs' },
+ 'custom engine': Twig.render,
<% } %><% if (includeEmail) { %>
'emails': 'templates/emails',
<% } %>
@@ -48,7 +47,6 @@ keystone.init({
'session': true,
'auth': true,
'user model': '<%= userModel %>',
-
});
<% if (includeGuideComments) { %>
// Load your project's Models | Fixing lint errors in generated code |
diff --git a/src/Extend/Item.php b/src/Extend/Item.php
index <HASH>..<HASH> 100644
--- a/src/Extend/Item.php
+++ b/src/Extend/Item.php
@@ -35,7 +35,7 @@ class Item extends CommonItem implements ItemInterface
*/
public function getProductRecord()
{
- return $this->getParameter('product_code');
+ return $this->getParameter('productCode');
}
/**
@@ -43,6 +43,6 @@ class Item extends CommonItem implements ItemInterface
*/
public function setProductCode($value)
{
- return $this->setParameter('product_code', $value);
+ return $this->setParameter('productCode', $value);
}
} | Issue #<I> - refactored to camel case for product code |
diff --git a/tests/unit/framework/db/ActiveRecordTest.php b/tests/unit/framework/db/ActiveRecordTest.php
index <HASH>..<HASH> 100644
--- a/tests/unit/framework/db/ActiveRecordTest.php
+++ b/tests/unit/framework/db/ActiveRecordTest.php
@@ -426,7 +426,16 @@ class ActiveRecordTest extends DatabaseTestCase
$this->assertEquals(1, $customers[1]->id);
$this->assertTrue($customers[0]->isRelationPopulated('orders'));
$this->assertTrue($customers[1]->isRelationPopulated('orders'));
+ }
+ /**
+ * This query will do the same join twice, ensure duplicated JOIN gets removed
+ * https://github.com/yiisoft/yii2/pull/2650
+ */
+ public function testJoinWithVia()
+ {
+ Order::getDb()->getQueryBuilder()->separator = "\n";
+ Order::find()->joinWith('itemsInOrder1')->joinWith('items')->all();
}
public function testInverseOf() | removed duplicated joins when using joinWith and via relations
fixes #<I> |
diff --git a/eZ/Publish/Core/REST/Server/Controller/Content.php b/eZ/Publish/Core/REST/Server/Controller/Content.php
index <HASH>..<HASH> 100644
--- a/eZ/Publish/Core/REST/Server/Controller/Content.php
+++ b/eZ/Publish/Core/REST/Server/Controller/Content.php
@@ -67,7 +67,13 @@ class Content extends RestController
public function loadContent( $contentId )
{
$contentInfo = $this->repository->getContentService()->loadContentInfo( $contentId );
- $mainLocation = $this->repository->getLocationService()->loadLocation( $contentInfo->mainLocationId );
+
+ $mainLocation = null;
+ if ( !empty( $contentInfo->mainLocationId ) )
+ {
+ $mainLocation = $this->repository->getLocationService()->loadLocation( $contentInfo->mainLocationId );
+ }
+
$contentType = $this->repository->getContentTypeService()->loadContentType( $contentInfo->contentTypeId );
$contentVersion = null; | Fix for EZP-<I>: REST API: GET Content request fails when the content has not been published. |
diff --git a/mtools/mlaunch/mlaunch.py b/mtools/mlaunch/mlaunch.py
index <HASH>..<HASH> 100755
--- a/mtools/mlaunch/mlaunch.py
+++ b/mtools/mlaunch/mlaunch.py
@@ -994,7 +994,7 @@ class MLaunchTool(BaseCmdLineTool):
self.wait_for(ports)
- def _initiate_replset(self, port, name):
+ def _initiate_replset(self, port, name, maxwait=30):
# initiate replica set
if not self.args['replicaset']:
return
@@ -1003,7 +1003,15 @@ class MLaunchTool(BaseCmdLineTool):
try:
rs_status = con['admin'].command({'replSetGetStatus': 1})
except OperationFailure, e:
- con['admin'].command({'replSetInitiate':self.config_docs[name]})
+ # not initiated yet
+ for i in range(maxwait):
+ try:
+ con['admin'].command({'replSetInitiate':self.config_docs[name]})
+ break
+ except OperationFailure, e:
+ print e.message, " - will retry"
+ time.sleep(1)
+
if self.args['verbose']:
print "initializing replica set '%s' with configuration: %s" % (name, self.config_docs[name])
print "replica set '%s' initialized." % name | introduced <I>sec delay in last commit. now correctly breaks if replset is configured. |
diff --git a/pkg/policy/api/fqdn.go b/pkg/policy/api/fqdn.go
index <HASH>..<HASH> 100644
--- a/pkg/policy/api/fqdn.go
+++ b/pkg/policy/api/fqdn.go
@@ -54,6 +54,10 @@ type FQDNSelector struct {
MatchPattern string `json:"matchPattern,omitempty"`
}
+func (s *FQDNSelector) String() string {
+ return fmt.Sprintf("MatchName: %s, MatchPattern %s", s.MatchName, s.MatchPattern)
+}
+
// sanitize for FQDNSelector is a little wonky. While we do more processing
// when using MatchName the basic requirement is that is a valid regexp. We
// test that it can compile here. | policy API: add String() function for FQDNSelector
Similar to the EndpointSelector, this allows for storing the string
representation of an FQDNSelector as a map key in the SelectorCache. |
diff --git a/mime.js b/mime.js
index <HASH>..<HASH> 100644
--- a/mime.js
+++ b/mime.js
@@ -118,12 +118,14 @@ MIME.prototype = {
* @return {String}
*/
encodeBase64: function( input, charset ) {
- if( Buffer.isBuffer( input ) ) {
- return input.toString( 'base64' )
- } else {
+ if( charset ) {
return new MIME.Iconv( charset, 'UTF8//TRANSLIT//IGNORE' )
.convert( input )
.toString( 'base64' )
+ } else {
+ return Buffer.isBuffer( input )
+ ? input.toString( 'base64' )
+ : new Buffer( input ).toString( 'base64' )
}
},
@@ -136,7 +138,7 @@ MIME.prototype = {
*/
decodeBase64: function( input, charset ) {
if( charset ) {
- return new Iconv( 'UTF8', charset + '//TRANSLIT//IGNORE' )
+ return new MIME.Iconv( 'UTF8', charset + '//TRANSLIT//IGNORE' )
.convert( new Buffer( input, 'base64' ) )
} else {
return new Buffer( input, 'base64' ) | Updated mime.js: Added iconv to base<I> en/decoding |
diff --git a/src/Symfony/Component/Security/Http/LoginLink/ExpiredLoginLinkStorage.php b/src/Symfony/Component/Security/Http/LoginLink/ExpiredLoginLinkStorage.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Component/Security/Http/LoginLink/ExpiredLoginLinkStorage.php
+++ b/src/Symfony/Component/Security/Http/LoginLink/ExpiredLoginLinkStorage.php
@@ -14,6 +14,8 @@ namespace Symfony\Component\Security\Http\LoginLink;
use Psr\Cache\CacheItemPoolInterface;
/**
+ * @experimental in 5.2
+ *
* @final
*/
class ExpiredLoginLinkStorage | [Security] Mark ExpiredLoginLinkStorage as experimental |
diff --git a/tests/test_vincent.py b/tests/test_vincent.py
index <HASH>..<HASH> 100644
--- a/tests/test_vincent.py
+++ b/tests/test_vincent.py
@@ -206,12 +206,13 @@ class TestVincent(object):
for cls in test_classes:
vis1 = cls()
vis2 = cls()
- vis3 = cls()
assert_vega_equal(vis1, vis2)
- assert_vega_equal(vis2, vis3)
vis1 += ([0, 1], 'scales', 0, 'range')
vis3 = vis2 + ([0, 1], 'scales', 0, 'range')
assert_vega_equal(vis1, vis3)
+ vis1 -= ('domain', 'scales', 0)
+ vis4 = vis3 - ('domain', 'scales', 0)
+ assert_vega_equal(vis1, vis4)
def test_datetimeandserial(self):
'''Test pandas serialization and datetime parsing'''
diff --git a/vincent/vincent.py b/vincent/vincent.py
index <HASH>..<HASH> 100644
--- a/vincent/vincent.py
+++ b/vincent/vincent.py
@@ -87,7 +87,7 @@ class Vega(object):
def __sub__(self, tuple):
'''Allow for updating of Vega with sub operator'''
vis = deepcopy(self)
- vis.update_component('add', *tuple)
+ vis.update_component('remove', *tuple)
return vis
def __isub__(self, tuple): | BUG: __sub__ added instead of removed - fixes <I> |
diff --git a/chef/spec/unit/provider/user/pw_spec.rb b/chef/spec/unit/provider/user/pw_spec.rb
index <HASH>..<HASH> 100644
--- a/chef/spec/unit/provider/user/pw_spec.rb
+++ b/chef/spec/unit/provider/user/pw_spec.rb
@@ -217,6 +217,9 @@ describe Chef::Provider::User::Pw do
end
describe "when loading the current state" do
+ before do
+ @provider.new_resource = Chef::Resource::User.new("adam")
+ end
it "should raise an error if the required binary /usr/sbin/pw doesn't exist" do
File.should_receive(:exists?).with("/usr/sbin/pw").and_return(false) | avoid libshadow check in User::Pw tests
This fixes the case where there's a user named "adam" with "x" for the
password field on the box running the tests |
diff --git a/framework/filter.js b/framework/filter.js
index <HASH>..<HASH> 100644
--- a/framework/filter.js
+++ b/framework/filter.js
@@ -210,12 +210,16 @@ module.exports = Base.extend({
this.partitions.forEach(function (partition) {
if ((partition.selected.length === 2) && (partition.isDatetime || partition.isContinuous)) {
+ if (partition.groupFixedS || partition.groupFixedSC) {
+ // scale down binsize
+ var newSize = partition.selected[1] - partition.selected[0];
+ var oldSize = partition.maxval - partition.minval;
+ partition.groupingParam = partition.groupingParam * newSize / oldSize;
+ }
// zoom to selected range, if possible
partition.set({
minval: partition.selected[0],
- maxval: partition.selected[1],
- groupingParam: 20,
- groupingContinuous: 'fixedn'
+ maxval: partition.selected[1]
}, { silent: true });
partition.setGroups();
} else if (partition.selected.length > 0 && (partition.isCategorial)) { | Keep binning settings as consistent as possible on zooming in
closes #<I> |
diff --git a/src/Session.php b/src/Session.php
index <HASH>..<HASH> 100644
--- a/src/Session.php
+++ b/src/Session.php
@@ -57,7 +57,7 @@ class Session extends Token {
Toolkit::trace("SessionId from cookie: $sessionId");
}
- $session = parent::getInstance($args, $conf, $confHash);
+ $session = parent::getInstance([$sessionId], $conf, $confHash);
if (!$sessionId) {
$action->setCookie(
static::$_conf['cookie']['name'], | Session should pass sessionId not args to parent |
diff --git a/salt/utils/yamldumper.py b/salt/utils/yamldumper.py
index <HASH>..<HASH> 100644
--- a/salt/utils/yamldumper.py
+++ b/salt/utils/yamldumper.py
@@ -9,7 +9,7 @@ from __future__ import absolute_import
try:
from yaml import CDumper as Dumper
except ImportError:
- from yaml import CDumper as Dumper
+ from yaml import Dumper
from salt.utils.odict import OrderedDict | Update yamldumper.py
fixed wrong import |
diff --git a/pysc2/env/sc2_env.py b/pysc2/env/sc2_env.py
index <HASH>..<HASH> 100644
--- a/pysc2/env/sc2_env.py
+++ b/pysc2/env/sc2_env.py
@@ -537,8 +537,10 @@ class SC2Env(environment.Base):
return replay_path
def close(self):
- self._metrics.close()
logging.info("Environment Close")
+ if hasattr(self, "_metrics") and self._metrics:
+ self._metrics.close()
+ self._metrics = None
if hasattr(self, "_renderer_human") and self._renderer_human:
self._renderer_human.close()
self._renderer_human = None | Shut down cleanly even if the environment didn't finish the constructor.
PiperOrigin-RevId: <I> |
diff --git a/bigtext.js b/bigtext.js
index <HASH>..<HASH> 100644
--- a/bigtext.js
+++ b/bigtext.js
@@ -51,6 +51,8 @@
if($.fn.smartresize) {
// https://github.com/lrbabe/jquery-smartresize/
eventName = 'smartresize.' + eventName;
+ } else if(_.debounce) {
+ resizeFunction = _.debounce(resizeFunction, 200)
}
$(window).unbind(eventName).bind(eventName, resizeFunction);
} | Add underscore resize debouncer |
diff --git a/Config/Database.cfg.php b/Config/Database.cfg.php
index <HASH>..<HASH> 100644
--- a/Config/Database.cfg.php
+++ b/Config/Database.cfg.php
@@ -14,7 +14,7 @@ class Database_Config_Framework {
: "Gt_" . APPNAME;
$this->_user = isset($this->_user)
? $this->_user
- : "Gt_" . APPNAME . "_User";
+ : "Gt_" . APPNAME;
$this->_pass = isset($this->_pass)
? $this->_pass
: "Gt_" . APPNAME . "_Pass"; | Changed database username convention to drop the _User. Increased APPNAME to <I> char limit. |
diff --git a/lib/valid_email2/address.rb b/lib/valid_email2/address.rb
index <HASH>..<HASH> 100644
--- a/lib/valid_email2/address.rb
+++ b/lib/valid_email2/address.rb
@@ -21,10 +21,8 @@ module ValidEmail2
return false if @parse_error
if address.domain && address.address == @raw_address
- tree = address.send(:tree)
-
# Valid address needs to have a dot in the domain
- tree.domain.dot_atom_text.elements.size > 1
+ !!address.domain.match(/\./)
else
false
end | Count the dots in the domain without using the tree method
Instead of using the private method #tree on the address to count the
dots in the domain we simply match if there are any at all.
This allows us to be compatible with the latest mail gem version which
has deprecated the #tree. |
diff --git a/agent/utils/mongo_fix/mongo_fix.go b/agent/utils/mongo_fix/mongo_fix.go
index <HASH>..<HASH> 100644
--- a/agent/utils/mongo_fix/mongo_fix.go
+++ b/agent/utils/mongo_fix/mongo_fix.go
@@ -18,7 +18,6 @@ package mongo_fix
import (
"net/url"
- "github.com/pkg/errors"
"go.mongodb.org/mongo-driver/mongo/options"
)
@@ -30,7 +29,8 @@ func ClientOptionsForDSN(dsn string) (*options.ClientOptions, error) {
// if username or password is set, need to replace it with correctly parsed credentials.
parsedDsn, err := url.Parse(dsn)
if err != nil {
- return nil, errors.Wrap(err, "cannot parse DSN")
+ // for non-URI, do nothing (PMM-10265)
+ return clientOptions, nil
}
username := parsedDsn.User.Username()
password, _ := parsedDsn.User.Password() | fallback to original DSN if it is non-URI (#<I>) |
diff --git a/lib/agent.js b/lib/agent.js
index <HASH>..<HASH> 100644
--- a/lib/agent.js
+++ b/lib/agent.js
@@ -61,6 +61,8 @@ module.exports = {
request: dispatchFromAgent('request'),
stream: dispatchFromAgent('stream'),
pipeline: dispatchFromAgent('pipeline'),
+ connect: dispatchFromAgent('connect'),
+ upgrade: dispatchFromAgent('upgrade'),
setGlobalAgent,
Agent
} | feat: add connect and upgrade to global methods |
diff --git a/Services/Twilio/Rest/IncomingPhoneNumber.php b/Services/Twilio/Rest/IncomingPhoneNumber.php
index <HASH>..<HASH> 100644
--- a/Services/Twilio/Rest/IncomingPhoneNumber.php
+++ b/Services/Twilio/Rest/IncomingPhoneNumber.php
@@ -81,6 +81,10 @@
*
* The HTTP method Twilio will use when requesting the above URL. Either GET or POST.
*
+ * .. php:attr:: beta
+ *
+ * Whether this number is new to Twilio's inventory.
+ *
* .. php:attr:: uri
*
* The URI for this resource, relative to https://api.twilio.com. | Add beta property to IPN docs |
diff --git a/code/model/EventRegistration.php b/code/model/EventRegistration.php
index <HASH>..<HASH> 100644
--- a/code/model/EventRegistration.php
+++ b/code/model/EventRegistration.php
@@ -245,7 +245,7 @@ class EventRegistration extends DataObject {
}
public function isSubmitted() {
- return ($this->Status != "Unsubmitted");
+ return $this->Status && ($this->Status != "Unsubmitted");
}
public function canPay() { | FIX: isSubmitted check on EventRegistration should also check if the Status value is set |
diff --git a/filesystems/common.py b/filesystems/common.py
index <HASH>..<HASH> 100644
--- a/filesystems/common.py
+++ b/filesystems/common.py
@@ -54,7 +54,7 @@ def create(
_state=attr.ib(default=attr.Factory(state), repr=False),
create=create_file,
- open=lambda fs, path, mode="rb": open_file(
+ open=lambda fs, path, mode="r": open_file(
fs=fs, path=path, mode=mode,
),
remove_file=remove_file, | Default open to mode "r" not "rb" |
diff --git a/lib/options.js b/lib/options.js
index <HASH>..<HASH> 100644
--- a/lib/options.js
+++ b/lib/options.js
@@ -33,21 +33,14 @@ module.exports.parse = function (argv) {
// Deprecated in 0.0.10
'flow-parser'
],
- string: ['print-width', 'tab-width', 'parser', 'trailing-comma'],
+ string: ['parser', 'trailing-comma'],
default: {
semi: true,
color: true,
'bracket-spacing': true,
parser: 'babylon'
},
- alias: { help: 'h', version: 'v', 'list-different': 'l' },
- unknown: function (param) {
- if (param.startsWith('-')) {
- console.warn('Ignored unknown option: ' + param + '\n');
- return false;
- }
- return true;
- }
+ alias: { help: 'h', version: 'v', 'list-different': 'l' }
});
return camelcaseKeys(parsed);
}; | Relax option parsing a bit
Prettier does some extra validation and conversion, but let's just be
lazy, skip the validation, and let minimist do the conversion. |
diff --git a/ModelDescriber/Annotations/SymfonyConstraintAnnotationReader.php b/ModelDescriber/Annotations/SymfonyConstraintAnnotationReader.php
index <HASH>..<HASH> 100644
--- a/ModelDescriber/Annotations/SymfonyConstraintAnnotationReader.php
+++ b/ModelDescriber/Annotations/SymfonyConstraintAnnotationReader.php
@@ -88,6 +88,11 @@ class SymfonyConstraintAnnotationReader
$property->maximum = (int) $annotation->value;
} elseif ($annotation instanceof Assert\LessThanOrEqual) {
$property->maximum = (int) $annotation->value;
+ } elseif ($annotation instanceof Assert\GreaterThan) {
+ $property->exclusiveMinimum = true;
+ $property->minimum = (int) $annotation->value;
+ } elseif ($annotation instanceof Assert\GreaterThanOrEqual) {
+ $property->minimum = (int) $annotation->value;
}
}
} | feature: Add new validation from constraints.
- Add minimum for GreaterThanOrEqual
- add minimum and exclusiveMinimum LessThanOrEqual annotation |
diff --git a/pkg/cmd/server/kubernetes/node_config.go b/pkg/cmd/server/kubernetes/node_config.go
index <HASH>..<HASH> 100644
--- a/pkg/cmd/server/kubernetes/node_config.go
+++ b/pkg/cmd/server/kubernetes/node_config.go
@@ -176,12 +176,17 @@ func BuildKubernetesNodeConfig(options configapi.NodeConfig) (*NodeConfig, error
// docker-in-docker (dind) deployments are used for testing
// networking plugins. Running openshift under dind won't work
// with the real oom adjuster due to the state of the cgroups path
- // in a dind container that uses systemd for init.
+ // in a dind container that uses systemd for init. Similarly,
+ // cgroup manipulation of the nested docker daemon doesn't work
+ // properly under centos/rhel and should be disabled by setting
+ // the name of the container to an empty string.
//
- // TODO(marun) Make dind cgroups compatible with openshift
+ // This workaround should become unnecessary once user namespaces
if value := cmdutil.Env("OPENSHIFT_DIND", ""); value == "true" {
glog.Warningf("Using FakeOOMAdjuster for docker-in-docker compatibility")
cfg.OOMAdjuster = oom.NewFakeOOMAdjuster()
+ glog.Warningf("Disabling cgroup manipulation of nested docker daemon for docker-in-docker compatibility")
+ cfg.DockerDaemonContainer = ""
}
// Setup auth | Fix dind compatibility with centos/rhel
Kubelet's cgroup manipulation of the dind daemon is not compatible with
centos/rhel. This change disables the offending cgroup manipulation
when the kubelet is running with dind. |
diff --git a/lib/db/services.php b/lib/db/services.php
index <HASH>..<HASH> 100644
--- a/lib/db/services.php
+++ b/lib/db/services.php
@@ -126,7 +126,7 @@ $functions = array(
'classpath' => 'user/externallib.php',
'description' => 'Get users by id.',
'type' => 'read',
- 'capabilities'=> 'moodle/user:viewdetails',
+ 'capabilities'=> 'moodle/user:viewalldetails',
),
'moodle_user_delete_users' => array( | MDL-<I> fix capability name typo in the description of the web service function moodle_user_get_users_by_id |
diff --git a/tests/isArguments.unit.test.js b/tests/isArguments.unit.test.js
index <HASH>..<HASH> 100644
--- a/tests/isArguments.unit.test.js
+++ b/tests/isArguments.unit.test.js
@@ -30,16 +30,11 @@ test(txt + 'return false if given anything else', function (t) {
t.equal( isArguments( new Date() ), false );
t.equal( isArguments( new Error() ), false );
+ t.equal( isArguments( new TypeError() ), false );
t.equal( isArguments( function () {} ), false );
t.equal( isArguments( new Function() ), false );
- t.equal( isArguments( Infinity ), false );
-
- t.equal( isArguments( NaN ), false );
-
- t.equal( isArguments( null ), false );
-
t.equal( isArguments( 1234 ), false );
t.equal( isArguments( new Number() ), false );
@@ -52,6 +47,9 @@ test(txt + 'return false if given anything else', function (t) {
t.equal( isArguments( 'string' ), false );
t.equal( isArguments( new String() ), false );
+ t.equal( isArguments( Infinity ), false );
+ t.equal( isArguments( NaN ), false );
+ t.equal( isArguments( null ), false );
t.equal( isArguments( void 0 ), false );
t.end();
});
\ No newline at end of file | Modified unit test for backwards.isArguments |
diff --git a/src/main/java/graphql/relay/Relay.java b/src/main/java/graphql/relay/Relay.java
index <HASH>..<HASH> 100644
--- a/src/main/java/graphql/relay/Relay.java
+++ b/src/main/java/graphql/relay/Relay.java
@@ -212,6 +212,9 @@ public class Relay {
public ResolvedGlobalId fromGlobalId(String globalId) {
String[] split = Base64.fromBase64(globalId).split(":", 2);
+ if (split.length != 2) {
+ throw new IllegalArgumentException(String.format("expecting a valid global id, got %s", globalId));
+ }
return new ResolvedGlobalId(split[0], split[1]);
}
} | illegal global id should yield illegal argument exception |
diff --git a/Tone/core/Emitter.js b/Tone/core/Emitter.js
index <HASH>..<HASH> 100644
--- a/Tone/core/Emitter.js
+++ b/Tone/core/Emitter.js
@@ -114,7 +114,7 @@ define(["Tone/core/Tone"], function (Tone) {
* @returns {Tone.Emitter}
*/
Tone.Emitter.mixin = function(object){
- var functions = ["on", "off", "emit"];
+ var functions = ["on", "once", "off", "emit"];
object._events = {};
for (var i = 0; i < functions.length; i++){
var func = functions[i]; | adding 'once' to mixin methods |
diff --git a/src/helpers/reverse-publication-test.js b/src/helpers/reverse-publication-test.js
index <HASH>..<HASH> 100644
--- a/src/helpers/reverse-publication-test.js
+++ b/src/helpers/reverse-publication-test.js
@@ -12,14 +12,6 @@ describe('reversePublication', function () {
expect(actual).to.equal('/content/1.md')
})
- it('applies the given path mapping', function () {
- const publications = [
- { localPath: '/content/', publicPath: '/', publicExtension: '' }
- ]
- const actual = reversePublication('/1.md', publications)
- expect(actual).to.equal('/content/1.md')
- })
-
it('adds leading slashes to the link', function () {
const publications = [
{ localPath: '/content/', publicPath: '/', publicExtension: '' } | Remove redundant test (#<I>) |
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -122,8 +122,11 @@ function sanitizeHtml(html, options) {
result += ' ' + a;
if (value.length) {
// Values are ALREADY escaped, calling escapeHtml here
- // results in double escapes
- result += '="' + value + '"';
+ // results in double escapes.
+ // However, a bug in the HTML parser allows you to use malformed
+ // markup to slip unescaped quotes through, so we strip them explicitly.
+ // @see https://github.com/punkave/sanitize-html/issues/19
+ result += '="' + value.replace(/"/g, '"') + '"';
}
}
}); | Strip any unescaped double-quotes from output |
diff --git a/src/main/java/org/jboss/pressgang/ccms/filter/builder/TopicFilterQueryBuilder.java b/src/main/java/org/jboss/pressgang/ccms/filter/builder/TopicFilterQueryBuilder.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/jboss/pressgang/ccms/filter/builder/TopicFilterQueryBuilder.java
+++ b/src/main/java/org/jboss/pressgang/ccms/filter/builder/TopicFilterQueryBuilder.java
@@ -224,7 +224,7 @@ public class TopicFilterQueryBuilder extends BaseTopicFilterQueryBuilder<Topic>
}
}
- if (matches / Constants.NUM_MIN_HASHES >= fixedThreshold) {
+ if ((float)matches / Constants.NUM_MIN_HASHES >= fixedThreshold) {
matchingTopics.add(topic.getId());
}
} | Added the ability to search for an equal min hash |
diff --git a/test/test.py b/test/test.py
index <HASH>..<HASH> 100755
--- a/test/test.py
+++ b/test/test.py
@@ -175,6 +175,7 @@ class TestTropoPython(unittest.TestCase):
url = "/receive_recording.py"
choices_obj = Choices("", terminator="#").json
tropo.record(say="Tell us about yourself", url=url,
+ promptLogSecurity="suppree",
choices=choices_obj)
rendered = tropo.RenderJson()
pretty_rendered = tropo.RenderJson(pretty=True)
@@ -183,7 +184,7 @@ class TestTropoPython(unittest.TestCase):
# print "test_record: %s" % tropo.RenderJson()
rendered_obj = jsonlib.loads(rendered)
- wanted_json = ' {"tropo": [{"record": {"url": "/receive_recording.py", "say": {"value": "Tell us about yourself"}, "choices": {"terminator": "#", "value": ""}}}]}'
+ wanted_json = ' {"tropo": [{"record": {"url": "/receive_recording.py", "promptLogSecurity": "suppree", "say": {"value": "Tell us about yourself"}, "choices": {"terminator": "#", "value": ""}}}]}'
wanted_obj = jsonlib.loads(wanted_json)
self.assertEqual(rendered_obj, wanted_obj) | Add unittest for improvement/TROPO-<I>-record |
diff --git a/fundamentals/mysql/convert_dictionary_to_mysql_table.py b/fundamentals/mysql/convert_dictionary_to_mysql_table.py
index <HASH>..<HASH> 100644
--- a/fundamentals/mysql/convert_dictionary_to_mysql_table.py
+++ b/fundamentals/mysql/convert_dictionary_to_mysql_table.py
@@ -461,7 +461,7 @@ def convert_dictionary_to_mysql_table(
dup = """%(dup)s `%(k)s`=%(v)s AND """ % locals()
dup = dup[:-5] + ", dateLastModified, NOW())"
else:
- dup = dup[:-1] + ")"
+ dup = dup[:-1]
# log.debug(myValues+" ------ POSTSTRIP")
addValue = insertVerb + """ INTO `""" + dbTableName + \ | testing moving updates to insert into list of dictionaries into database |
diff --git a/will/settings.py b/will/settings.py
index <HASH>..<HASH> 100644
--- a/will/settings.py
+++ b/will/settings.py
@@ -28,6 +28,10 @@ def import_settings(quiet=True):
if "PLUGINS" in settings:
settings["PLUGINS"] = settings["PLUGINS"].split(";")
+ if 'PLUGIN_BLACKLIST' in settings:
+ settings["PLUGIN_BLACKLIST"] = (settings["PLUGIN_BLACKLIST"].split(";")
+ if settings["PLUGIN_BLACKLIST"] else [])
+
# If HIPCHAT_SERVER is set, we need to change the USERNAME slightly
# for XMPP to work.
if "HIPCHAT_SERVER" in settings: | Allow setting of plugin list from WILL_PLUGIN_BLACKLIST environment variable |
diff --git a/test/level2/html.js b/test/level2/html.js
index <HASH>..<HASH> 100644
--- a/test/level2/html.js
+++ b/test/level2/html.js
@@ -2637,6 +2637,11 @@ exports.tests = {
vcookie = doc.cookie;
test.equal(vcookie, "key3=value3; key4=value4", "cookieLink");
+ var ret = doc.cookie = null;
+ test.equal(ret, null, "cookieLink");
+ test.equal(doc.cookie, vcookie, "cookieLink");
+
+
test.done();
}, | Test that doc.cookie = null returns null and has no effect |
diff --git a/driver/src/main/org/mongodb/impl/MongoCollectionImpl.java b/driver/src/main/org/mongodb/impl/MongoCollectionImpl.java
index <HASH>..<HASH> 100644
--- a/driver/src/main/org/mongodb/impl/MongoCollectionImpl.java
+++ b/driver/src/main/org/mongodb/impl/MongoCollectionImpl.java
@@ -116,10 +116,10 @@ class MongoCollectionImpl<T> extends MongoCollectionBaseImpl<T> implements Mongo
public UpdateResult save(final MongoSave<T> save) {
Object id = serializer.getId(save.getDocument());
if (id == null) {
- return insert(new MongoInsert<T>(save.getDocument()));
+ return insert(new MongoInsert<T>(save.getDocument()).writeConcern(save.getWriteConcern()));
}
else {
- return replace(new MongoReplace<T>(new QueryFilterDocument("_id", id), save.getDocument()).isUpsert(true));
+ return replace(new MongoReplace<T>(new QueryFilterDocument("_id", id), save.getDocument()).isUpsert(true).writeConcern(save.getWriteConcern()));
}
} | Propagating writeConcern in save |
diff --git a/lib/quickbooks/service/base_service.rb b/lib/quickbooks/service/base_service.rb
index <HASH>..<HASH> 100644
--- a/lib/quickbooks/service/base_service.rb
+++ b/lib/quickbooks/service/base_service.rb
@@ -242,12 +242,23 @@ module Quickbooks
unless headers.has_key?('Content-Type')
headers.merge!({'Content-Type' => HTTP_CONTENT_TYPE})
end
- # log "------ New Request ------"
- # log "METHOD = #{method}"
- # log "RESOURCE = #{url}"
- # log "BODY(#{body.class}) = #{body == nil ? "<NIL>" : body.inspect}"
- # log "HEADERS = #{headers.inspect}"
- response = @oauth.request(method, url, body, headers)
+ unless headers.has_key?('Accept')
+ headers.merge!({'Accept' => HTTP_ACCEPT})
+ end
+
+ log "METHOD = #{method}"
+ log "RESOURCE = #{url}"
+ log "BODY(#{body.class}) = #{body == nil ? "<NIL>" : body.inspect}"
+ log "HEADERS = #{headers.inspect}"
+
+ response = case method
+ when :get
+ @oauth.get(url, headers)
+ when :post
+ @oauth.post(url, body, headers)
+ else
+ raise "Dont know how to perform that HTTP operation"
+ end
check_response(response)
end | be smarter about calling the correct HTTP verb |
diff --git a/lib/active_admin/view_helpers/filter_form_helper.rb b/lib/active_admin/view_helpers/filter_form_helper.rb
index <HASH>..<HASH> 100644
--- a/lib/active_admin/view_helpers/filter_form_helper.rb
+++ b/lib/active_admin/view_helpers/filter_form_helper.rb
@@ -155,7 +155,7 @@ module ActiveAdmin
end
if reflection = reflection_for(method)
- return :select if reflection.macro == :belongs_to && reflection.collection?
+ return :select if reflection.macro == :belongs_to && !reflection.options[:polymorphic]
end
end | Fix for specs. Filter forms shouldn't display polymorphic belongs_to |
diff --git a/lib/collection/url.js b/lib/collection/url.js
index <HASH>..<HASH> 100644
--- a/lib/collection/url.js
+++ b/lib/collection/url.js
@@ -91,8 +91,7 @@ _.extend(Url.prototype, /** @lends Url.prototype */ {
/**
* @type {PropertyList<QueryParam>}
*/
- query: query ?
- new PropertyList(QueryParam, this, query) : new PropertyList(QueryParam, this, []),
+ query: new PropertyList(QueryParam, this, query || []),
/**
* @type {VariableList}
*/
@@ -207,8 +206,7 @@ _.extend(Url.prototype, /** @lends Url.prototype */ {
*/
getQueryString: function (options) {
if (this.query.count()) {
- return PropertyList.isPropertyList(this.query) ?
- QueryParam.unparse(this.query.all(), options) : this.query.toString();
+ return QueryParam.unparse(this.query.all(), options);
}
return '';
}, | Fixed dead code and throwback logic in URL constructor and query param getter. |
diff --git a/path.py b/path.py
index <HASH>..<HASH> 100644
--- a/path.py
+++ b/path.py
@@ -1665,6 +1665,10 @@ class TempDir(Path):
self.rmtree()
+# For backwards compatibility.
+tempdir = TempDir
+
+
def _multi_permission_mask(mode):
"""
Support multiple, comma-separated Unix chmod symbolic modes. | Add tempdir name for backwards compatibility.
tempdir is just an alias to TempDir. |
diff --git a/lib/db.js b/lib/db.js
index <HASH>..<HASH> 100644
--- a/lib/db.js
+++ b/lib/db.js
@@ -44,7 +44,7 @@ exports.db_setup = function(app, db, next) {
if (typeof values != 'function')
_sql = app.db.format(sql, values);
console.log('SQL query:', _sql);
- return _query(sql, values, callback);
+ return _query.call(this, sql, values, callback);
};
}
next(); | small fix to mysql interface |
diff --git a/src/main/java/com/github/alexcojocaru/mojo/elasticsearch/ElasticSearchNode.java b/src/main/java/com/github/alexcojocaru/mojo/elasticsearch/ElasticSearchNode.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/github/alexcojocaru/mojo/elasticsearch/ElasticSearchNode.java
+++ b/src/main/java/com/github/alexcojocaru/mojo/elasticsearch/ElasticSearchNode.java
@@ -39,6 +39,7 @@ public class ElasticSearchNode
.put("network.host", "127.0.0.1")
.put("discovery.zen.ping.timeout", "3ms")
.put("discovery.zen.ping.multicast.enabled", false)
+ .put("http.cors.enabled", true)
.put(settings)
.build(); | enable HTTP CORS on the local node, to allow web plugins to talk to it
see <URL> |
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -35,7 +35,7 @@ setup(
'test': [
'nose',
'flake8',
- 'openfisca-country-template == 1.2.2',
+ 'openfisca-country-template >= 1.2.3rc0, <= 1.2.3',
'openfisca-extension-template == 1.1.0',
],
}, | Update requirement for openfisca-country-template |
diff --git a/lib/raven/processor/sanitizedata.rb b/lib/raven/processor/sanitizedata.rb
index <HASH>..<HASH> 100644
--- a/lib/raven/processor/sanitizedata.rb
+++ b/lib/raven/processor/sanitizedata.rb
@@ -37,7 +37,7 @@ module Raven
end
def fields_re
- @fields_re ||= /(#{(DEFAULT_FIELDS + @sanitize_fields).join("|")})/i
+ @fields_re ||= /(#{(DEFAULT_FIELDS | @sanitize_fields).join("|")})/i
end
end
end
diff --git a/spec/raven/configuration_spec.rb b/spec/raven/configuration_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/raven/configuration_spec.rb
+++ b/spec/raven/configuration_spec.rb
@@ -130,4 +130,16 @@ describe Raven::Configuration do
end
end
+ context 'configuration for sanitize fields' do
+ it 'should union default sanitize fields with user-defined sanitize fields' do
+ fields = Raven::Processor::SanitizeData::DEFAULT_FIELDS | %w(test monkeybutt)
+
+ subject.sanitize_fields = fields
+ client = Raven::Client.new(subject)
+ processor = Raven::Processor::SanitizeData.new(client)
+
+ expect(processor.send(:fields_re)).to eq(/(#{fields.join('|')})/i)
+ end
+ end
+
end | union instead of concatenation, because duplicate fields |
diff --git a/Lib/fontbakery/specifications/googlefonts.py b/Lib/fontbakery/specifications/googlefonts.py
index <HASH>..<HASH> 100644
--- a/Lib/fontbakery/specifications/googlefonts.py
+++ b/Lib/fontbakery/specifications/googlefonts.py
@@ -2,8 +2,7 @@
from __future__ import absolute_import, print_function, unicode_literals
from fontbakery.testrunner import (
- DEBUG
- , INFO
+ INFO
, WARN
, ERROR
, SKIP
@@ -13,17 +12,16 @@ from fontbakery.testrunner import (
, Spec
)
import os
-from fontbakery.utils import assertExists
from fontbakery.callable import condition, test
from fontbakery.constants import(
# TODO: priority levels are not yet part of the new runner/reporters.
# How did we ever use this information?
# Check priority levels:
- TRIVIAL
- , LOW
- , NORMAL
+ CRITICAL
, IMPORTANT
- , CRITICAL
+# , NORMAL
+# , LOW
+# , TRIVIAL
, NAMEID_DESCRIPTION
, NAMEID_LICENSE_DESCRIPTION | remove a few unused imports
(issue #<I>) |
diff --git a/src/createReduxForm.js b/src/createReduxForm.js
index <HASH>..<HASH> 100755
--- a/src/createReduxForm.js
+++ b/src/createReduxForm.js
@@ -526,6 +526,18 @@ const createReduxForm = (structure: Structure<*, *>) => {
)
}
+ componentDidMount() {
+ if (!isHotReloading()) {
+ this.initIfNeeded()
+ this.validateIfNeeded()
+ this.warnIfNeeded()
+ }
+ invariant(
+ this.props.shouldValidate,
+ 'shouldValidate() is deprecated and will be removed in v8.0.0. Use shouldWarn() or shouldError() instead.'
+ )
+ }
+
componentWillUnmount() {
const { destroyOnUnmount, destroy } = this.props
if (destroyOnUnmount && !isHotReloading()) { | initialize in componentDidMount as well (#<I>)
React <I> ensures a certain order of lifcecycles when replacing a
component which causes redux-form to destroy the form, breaking
it. This change, when used with `enableReinitialize`, causes the
form to reinitialize correctly, preserving the form. |
diff --git a/api/client.go b/api/client.go
index <HASH>..<HASH> 100644
--- a/api/client.go
+++ b/api/client.go
@@ -108,6 +108,7 @@ func (c *Client) isOkStatus(code int) bool {
411: false,
413: false,
415: false,
+ 423: false,
500: false,
503: false,
}
@@ -257,7 +258,7 @@ func (c *retryableHTTPClient) Do(req *request) (*http.Response, error) {
}
res, err := c.Client.Do(req.Request)
- if res != nil && res.StatusCode != 503 {
+ if res != nil && res.StatusCode != 503 && res.StatusCode != 423 {
return res, err
}
if res != nil && res.Body != nil { | Handling <I>-locked response |
diff --git a/hearthstone/entities.py b/hearthstone/entities.py
index <HASH>..<HASH> 100644
--- a/hearthstone/entities.py
+++ b/hearthstone/entities.py
@@ -75,6 +75,8 @@ class Game(Entity):
self.initial_entities.append(entity)
def find_entity_by_id(self, id):
+ # int() for LazyPlayer mainly...
+ id = int(id)
for entity in self.entities:
if entity.id == id:
return entity | entities: Always int-ify the argument to Game.find_entity_by_id() |
diff --git a/test/src/net/lshift/javax/xml/DocumentHelperTest.java b/test/src/net/lshift/javax/xml/DocumentHelperTest.java
index <HASH>..<HASH> 100644
--- a/test/src/net/lshift/javax/xml/DocumentHelperTest.java
+++ b/test/src/net/lshift/javax/xml/DocumentHelperTest.java
@@ -13,7 +13,7 @@ public class DocumentHelperTest extends TestCase {
public static void testXmlCopy()
throws ParserConfigurationException, TransformerException
{
- String expected = "notthesame";
+ String expected = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?><foo/>";
Element root = DocumentHelper.newDocumentRoot("foo");
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DocumentHelper.xmlCopy(root.getOwnerDocument(), baos); | bug <I>: test now works. However, it's not entirely reliable - correct code could fail this test. |
diff --git a/app/jobs/cangaroo/job.rb b/app/jobs/cangaroo/job.rb
index <HASH>..<HASH> 100644
--- a/app/jobs/cangaroo/job.rb
+++ b/app/jobs/cangaroo/job.rb
@@ -7,6 +7,7 @@ module Cangaroo
class_configuration :connection
class_configuration :path, ''
class_configuration :parameters, {}
+ class_configuration :process_response, true
def perform(*)
restart_flow(connection_request)
@@ -31,6 +32,10 @@ module Cangaroo
# if no json was returned, the response should be discarded
return if response.blank?
+ unless self.process_response
+ return
+ end
+
PerformFlow.call(
source_connection: destination_connection,
json_body: response.to_json, | Adding option to stop reprocessing of jobs |
diff --git a/packages/vx-shape/src/util/stackOrder.js b/packages/vx-shape/src/util/stackOrder.js
index <HASH>..<HASH> 100644
--- a/packages/vx-shape/src/util/stackOrder.js
+++ b/packages/vx-shape/src/util/stackOrder.js
@@ -8,7 +8,7 @@ import {
export const STACK_ORDERS = {
ascending: stackOrderAscending,
- descrending: stackOrderDescending,
+ descending: stackOrderDescending,
insideout: stackOrderInsideOut,
none: stackOrderNone,
reverse: stackOrderReverse, | Typo in stack order enum
descrending => descending |
diff --git a/src/Illuminate/Foundation/Channels/SmsChannel.php b/src/Illuminate/Foundation/Channels/SmsChannel.php
index <HASH>..<HASH> 100644
--- a/src/Illuminate/Foundation/Channels/SmsChannel.php
+++ b/src/Illuminate/Foundation/Channels/SmsChannel.php
@@ -18,7 +18,7 @@ class SmsChannel
public function send($notifiable, Notification $notification)
{
$message = collect($notification->toSms($notifiable));
- $sms = new EasySms(config('app.easysms'));
+ $sms = new EasySms(config('easysms'));
if (! ($message->has('content') && $message->has('template') && $message->has('data') && $message->has('phone'))) {
throw new GeneralException('短信消息实体必须带有 `content`, `template`, `data`, `phone` 字段。');
} | change sms configs. |
diff --git a/etcdctl/ctlv3/ctl.go b/etcdctl/ctlv3/ctl.go
index <HASH>..<HASH> 100644
--- a/etcdctl/ctlv3/ctl.go
+++ b/etcdctl/ctlv3/ctl.go
@@ -43,7 +43,7 @@ var (
)
func init() {
- rootCmd.PersistentFlags().StringSliceVar(&globalFlags.Endpoints, "endpoints", []string{"127.0.0.1:2379", "127.0.0.1:22379", "127.0.0.1:32379"}, "gRPC endpoints")
+ rootCmd.PersistentFlags().StringSliceVar(&globalFlags.Endpoints, "endpoints", []string{"127.0.0.1:2379"}, "gRPC endpoints")
rootCmd.PersistentFlags().StringVarP(&globalFlags.OutputFormat, "write-out", "w", "simple", "set the output format (simple, json, etc..)")
rootCmd.PersistentFlags().BoolVar(&globalFlags.IsHex, "hex", false, "print byte strings as hex encoded strings") | etcdctl: only takes <I>:<I> as default endpoint |
diff --git a/plugins/CoreVisualizations/Visualizations/Cloud.php b/plugins/CoreVisualizations/Visualizations/Cloud.php
index <HASH>..<HASH> 100644
--- a/plugins/CoreVisualizations/Visualizations/Cloud.php
+++ b/plugins/CoreVisualizations/Visualizations/Cloud.php
@@ -49,7 +49,7 @@ class Cloud extends Visualization
protected $wordsArray = array();
public $truncatingLimit = 50;
- public function afterAllFilteresAreApplied(DataTableInterface $dataTable, Config $properties, Request $request)
+ public function afterAllFilteresAreApplied(DataTable $dataTable, Config $properties, Request $request)
{
if ($dataTable->getRowsCount() == 0) {
return; | cloud works only with DataTable not with a map |
diff --git a/aeron-archive/src/test/java/io/aeron/archive/ArchiveTest.java b/aeron-archive/src/test/java/io/aeron/archive/ArchiveTest.java
index <HASH>..<HASH> 100644
--- a/aeron-archive/src/test/java/io/aeron/archive/ArchiveTest.java
+++ b/aeron-archive/src/test/java/io/aeron/archive/ArchiveTest.java
@@ -73,25 +73,26 @@ public class ArchiveTest
final AeronArchive archive = AeronArchive.connect(ctx);
archiveClientQueue.add(archive);
- archive.getRecordingPosition(0L);
+ final long position = archive.getRecordingPosition(0L);
latch.countDown();
+
+ assertEquals(AeronArchive.NULL_POSITION, position);
});
}
latch.await(driver.archive().context().connectTimeoutNs() * 2, TimeUnit.NANOSECONDS);
- assertThat(latch.getCount(), is(0L));
- }
- finally
- {
- executor.shutdownNow();
-
AeronArchive archiveClient;
while (null != (archiveClient = archiveClientQueue.poll()))
{
archiveClient.close();
}
+ assertThat(latch.getCount(), is(0L));
+ }
+ finally
+ {
+ executor.shutdownNow();
archiveCtx.deleteArchiveDirectory();
driverCtx.deleteAeronDirectory();
} | [Java] Test should shutdown client before driver to avoid stale data. |
diff --git a/examples/server/server.py b/examples/server/server.py
index <HASH>..<HASH> 100644
--- a/examples/server/server.py
+++ b/examples/server/server.py
@@ -11,14 +11,13 @@ from aiortc import RTCPeerConnection, RTCSessionDescription
from aiortc.mediastreams import (AudioFrame, AudioStreamTrack, VideoFrame,
VideoStreamTrack)
-PTIME = 0.02
ROOT = os.path.dirname(__file__)
-async def pause(last):
+async def pause(last, ptime):
if last:
now = time.time()
- await asyncio.sleep(last + PTIME - now)
+ await asyncio.sleep(last + ptime - now)
return time.time()
@@ -28,7 +27,7 @@ class AudioFileTrack(AudioStreamTrack):
self.reader = wave.Wave_read(path)
async def recv(self):
- self.last = await pause(self.last)
+ self.last = await pause(self.last, 0.02)
return AudioFrame(
channels=self.reader.getnchannels(),
data=self.reader.readframes(160),
@@ -47,7 +46,7 @@ class VideoDummyTrack(VideoStreamTrack):
self.last = None
async def recv(self):
- self.last = await pause(self.last)
+ self.last = await pause(self.last, 0.04)
self.counter += 1
if (self.counter % 100) < 50:
return self.frame_green | [examples] reduce video frame rate |
diff --git a/lib/offsite_payments/integrations/quickpay.rb b/lib/offsite_payments/integrations/quickpay.rb
index <HASH>..<HASH> 100644
--- a/lib/offsite_payments/integrations/quickpay.rb
+++ b/lib/offsite_payments/integrations/quickpay.rb
@@ -5,7 +5,7 @@ module OffsitePayments #:nodoc:
self.service_url = 'https://secure.quickpay.dk/form/'
def self.notification(post, options = {})
- Notification.new(post)
+ Notification.new(post, options)
end
def self.return(post, options = {})
@@ -196,8 +196,6 @@ module OffsitePayments #:nodoc:
Digest::MD5.hexdigest(generate_md5string)
end
- # Quickpay doesn't do acknowledgements of callback notifications
- # Instead it uses and MD5 hash of all parameters
def acknowledge(authcode = nil)
generate_md5check == params['md5check']
end | Must check params with MD5secret from options. |
diff --git a/cake/libs/view/media.php b/cake/libs/view/media.php
index <HASH>..<HASH> 100644
--- a/cake/libs/view/media.php
+++ b/cake/libs/view/media.php
@@ -208,7 +208,11 @@ class MediaView extends View {
$this->_output();
$this->_clearBuffer();
- while (!feof($handle) && $this->_isActive()) {
+ while (!feof($handle)) {
+ if (!$this->_isActive()) {
+ fclose($handle);
+ return false;
+ }
set_time_limit(0);
$buffer = fread($handle, $chunkSize);
echo $buffer;
@@ -253,7 +257,7 @@ class MediaView extends View {
}
/**
- * Returns true if connectios is still active
+ * Returns true if connection is still active
* @return boolean
* @access protected
*/
diff --git a/cake/tests/cases/libs/view/media.test.php b/cake/tests/cases/libs/view/media.test.php
index <HASH>..<HASH> 100644
--- a/cake/tests/cases/libs/view/media.test.php
+++ b/cake/tests/cases/libs/view/media.test.php
@@ -73,7 +73,7 @@ class TestMediaView extends MediaView {
var $headers = array();
/**
- * active property to mock the status of a remote conenction
+ * active property to mock the status of a remote connection
*
* @var boolean true
* @access public | If connection is aborted, now MediaView returns false after stopping the transfer |
diff --git a/src/HttpRouter.php b/src/HttpRouter.php
index <HASH>..<HASH> 100644
--- a/src/HttpRouter.php
+++ b/src/HttpRouter.php
@@ -73,4 +73,4 @@ class HttpRouter implements HttpRouterInterface
array("X-Reason" => "no module for path"), $request->closeConnection());
}
}
-}
\ No newline at end of file
+}
diff --git a/src/HttpRouterInterface.php b/src/HttpRouterInterface.php
index <HASH>..<HASH> 100644
--- a/src/HttpRouterInterface.php
+++ b/src/HttpRouterInterface.php
@@ -32,4 +32,4 @@ interface HttpRouterInterface
* @throws HttpException
*/
public function handleClientRequest(StreamServerNodeInterface $client);
-}
\ No newline at end of file
+} | Added \n to the last line of every file (to conform with POSIX: <URL>) |
diff --git a/internal/core/command/device.go b/internal/core/command/device.go
index <HASH>..<HASH> 100644
--- a/internal/core/command/device.go
+++ b/internal/core/command/device.go
@@ -45,7 +45,7 @@ func commandByDeviceID(did string, cid string, b string, p bool) (string, int) {
}
}
- if p && (d.AdminState == models.Locked) {
+ if d.AdminState == models.Locked {
LoggingClient.Error(d.Name + " is in admin locked state")
return "", http.StatusLocked | #<I> Return HTTP <I> LOCKED when issuing a GET command to a locked device |
diff --git a/src/Process.php b/src/Process.php
index <HASH>..<HASH> 100644
--- a/src/Process.php
+++ b/src/Process.php
@@ -45,8 +45,7 @@ class Process extends EventEmitter
* @param string $cwd Current working directory or null to inherit
* @param array $env Environment variables or null to inherit
* @param array $options Options for proc_open()
- * @throws LogicException On windows
- * @throws RuntimeException When proc_open() is not installed
+ * @throws LogicException On windows or when proc_open() is not installed
*/
public function __construct($cmd, $cwd = null, array $env = null, array $options = array())
{
@@ -55,7 +54,7 @@ class Process extends EventEmitter
}
if (!function_exists('proc_open')) {
- throw new \RuntimeException('The Process class relies on proc_open(), which is not available on your PHP installation.');
+ throw new \LogicException('The Process class relies on proc_open(), which is not available on your PHP installation.');
}
$this->cmd = $cmd; | Throw LogicException when proc_open() is not installed |
diff --git a/lib/dalli/client.rb b/lib/dalli/client.rb
index <HASH>..<HASH> 100644
--- a/lib/dalli/client.rb
+++ b/lib/dalli/client.rb
@@ -108,7 +108,6 @@ module Dalli
# - false if the value was changed by someone else.
# - true if the value was successfully updated.
def cas(key, ttl=nil, options=nil)
- ttl = ttl_or_default(ttl)
(value, cas) = perform(:cas, key)
value = (!value || value == 'Not found') ? nil : value
if value
diff --git a/lib/dalli/server.rb b/lib/dalli/server.rb
index <HASH>..<HASH> 100644
--- a/lib/dalli/server.rb
+++ b/lib/dalli/server.rb
@@ -486,7 +486,7 @@ module Dalli
def sanitize_ttl(ttl)
ttl_as_i = ttl.to_i
return ttl_as_i if ttl_as_i <= MAX_ACCEPTABLE_EXPIRATION_INTERVAL
- Dalli.logger.debug "Expiration interval (ttl_as_i) too long for Memcached, converting to an expiration timestamp"
+ Dalli.logger.debug "Expiration interval (#{ttl_as_i}) too long for Memcached, converting to an expiration timestamp"
Time.now.to_i + ttl_as_i
end | Fix a couple of minor errors in my last PR |
diff --git a/escpos/impl/epson.py b/escpos/impl/epson.py
index <HASH>..<HASH> 100644
--- a/escpos/impl/epson.py
+++ b/escpos/impl/epson.py
@@ -185,7 +185,7 @@ class GenericESCPOS(object):
for char in bytearray(unicode_text, 'cp1251'):
printer.device.write(chr(char))
"""
- if 0 <= code_page <= 255:
+ if not 0 <= code_page <= 255:
raise ValueError('Number between 0 and 255 expected.')
self.device.write('\x1B\x74' + chr(code_page)) | Impl: Epson: Fixed bad logic when testing code page validity. |
diff --git a/AegeanTools/BANE.py b/AegeanTools/BANE.py
index <HASH>..<HASH> 100755
--- a/AegeanTools/BANE.py
+++ b/AegeanTools/BANE.py
@@ -370,14 +370,14 @@ def filter_image(im_name, out_base, step_size=None, box_size=None, twopass=False
Parameters
----------
- im_name : str or HDUList
- Image to filter. Either a string filename or an astropy.io.fits.HDUList.
+ im_name : str
+ Image to filter.
out_base : str
The output filename base. Will be modified to make _bkg and _rms files.
step_size : (int,int)
Tuple of the x,y step size in pixels
box_size : (int,int)
- The size of the box in piexls
+ The size of the box in pixels
twopass : bool
Perform a second pass calculation to ensure that the noise is not contaminated by the background.
Default = False | update docstring to be correct
resolves #<I> |
diff --git a/scriptblock.js b/scriptblock.js
index <HASH>..<HASH> 100644
--- a/scriptblock.js
+++ b/scriptblock.js
@@ -33,6 +33,22 @@ ScriptblockPlugin.prototype.disable = function() {
};
ScriptblockPlugin.prototype.interact = function(target) {
- console.log(target);
- // TODO: prompt for script, set at x,y,z
+ var x = target.voxel[0];
+ var y = target.voxel[1];
+ var z = target.voxel[2];
+
+ var bd = this.blockdata.get(x, y, z);
+ if (!bd) {
+ bd = {script: 'alert("Hello, voxel world!")'};
+ }
+
+ // interact (right-click) with top to set script, other sides to run
+ // TODO: run script when block takes damage instead (left-click)
+ if (target.side === 'top') {
+ bd.script = prompt("Script for block at ("+[x,y,z].join(",")+"): ", bd.script);
+
+ this.blockdata.set(x, y, z, bd);
+ } else {
+ eval(bd.script);
+ }
}; | Set script in blockdata when interact with top, run when interact on other sides |
diff --git a/source/application/models/oxorder.php b/source/application/models/oxorder.php
index <HASH>..<HASH> 100644
--- a/source/application/models/oxorder.php
+++ b/source/application/models/oxorder.php
@@ -350,13 +350,13 @@ class oxOrder extends oxBase
/**
* Order article list setter
*
- * @param object $aOrderArticleList order article list
+ * @param oxOrderArticleList $oOrderArticleList
*
* @return null
*/
- public function setOrderArticleList( $aOrderArticleList )
+ public function setOrderArticleList( $oOrderArticleList )
{
- $this->_oArticles = $aOrderArticleList;
+ $this->_oArticles = $oOrderArticleList;
}
/** | Changed comment and variable name in setOrderArticleList() (cherry picked from commit <I>b8ff) (cherry picked from commit <I>a<I>c6) |
diff --git a/pydoop/hdfs/core/bridged/hadoop.py b/pydoop/hdfs/core/bridged/hadoop.py
index <HASH>..<HASH> 100644
--- a/pydoop/hdfs/core/bridged/hadoop.py
+++ b/pydoop/hdfs/core/bridged/hadoop.py
@@ -246,7 +246,7 @@ class CoreHdfsFs(CoreFsApi):
else:
boolean_overwrite = True
if not blocksize:
- blocksize = self._fs.getDefaultBlockSize(jpath)
+ blocksize = self.get_default_block_size()
stream = self._fs.create(
jpath, boolean_overwrite, buff_size, replication, blocksize
) | defaultBlockSize in hadoop.open_file(..) is now obtained using hadoop.get_default_block_size() method |
diff --git a/backbone-firebase.js b/backbone-firebase.js
index <HASH>..<HASH> 100644
--- a/backbone-firebase.js
+++ b/backbone-firebase.js
@@ -210,6 +210,9 @@ Backbone.Firebase.Collection = Backbone.Collection.extend({
add: function(models, options) {
var parsed = this._parseModels(models);
+ options = options ? _.clone(options) : {};
+ options.success = _.isFunction(options.success) ? options.success : function() {};
+
for (var i = 0; i < parsed.length; i++) {
var model = parsed[i];
this.firebase.ref().child(model.id).set(model, _.bind(options.success, model));
@@ -218,6 +221,9 @@ Backbone.Firebase.Collection = Backbone.Collection.extend({
remove: function(models, options) {
var parsed = this._parseModels(models);
+ options = options ? _.clone(options) : {};
+ options.success = _.isFunction(options.success) ? options.success : function() {};
+
for (var i = 0; i < parsed.length; i++) {
var model = parsed[i];
this.firebase.ref().child(model.id).set(null, _.bind(options.success, model)); | check for the existence of options and options.success |
diff --git a/src/edu/jhu/hltcoe/model/dmv/DmvDepTreeGenerator.java b/src/edu/jhu/hltcoe/model/dmv/DmvDepTreeGenerator.java
index <HASH>..<HASH> 100644
--- a/src/edu/jhu/hltcoe/model/dmv/DmvDepTreeGenerator.java
+++ b/src/edu/jhu/hltcoe/model/dmv/DmvDepTreeGenerator.java
@@ -34,7 +34,9 @@ public class DmvDepTreeGenerator {
}
private void recursivelyGenerate(ProjDepTreeNode parent) {
- sampleChildren(parent, "l");
+ if (!parent.isWall()) {
+ sampleChildren(parent, "l");
+ }
sampleChildren(parent, "r");
// Recurse on each child | Bug fix: generating to left of wall
git-svn-id: svn+ssh://external.hltcoe.jhu.edu/home/hltcoe/mgormley/public/repos/dep_parse_filtered/trunk@<I> <I>f-cb4b-<I>-8b<I>-c<I>bcb<I> |
diff --git a/src/RuleCollection.php b/src/RuleCollection.php
index <HASH>..<HASH> 100644
--- a/src/RuleCollection.php
+++ b/src/RuleCollection.php
@@ -118,21 +118,26 @@ class RuleCollection
public function __construct(RuleLocator $rule_locator)
{
$this->rule_locator = $rule_locator;
+ $this->init();
}
- public function __invoke(&$data)
+ public function __invoke(&$subject)
{
- if ($this->values($data)) {
+ if ($this->values($subject)) {
return true;
}
- $message = 'array';
- $e = new Exception\FilterFailed($message);
+ $e = new Exception\FilterFailed(get_class($this));
$e->setFilterMessages($this->getMessages());
- $e->setFilterSubject($data);
+ $e->setFilterSubject($subject);
throw $e;
}
+ protected function init()
+ {
+ // by default do nothing
+ }
+
/**
*
* Sets a single rule, encapsulated by a closure, for the rule. | add init() method for self-initialization if needed |
diff --git a/pyroma/projectdata.py b/pyroma/projectdata.py
index <HASH>..<HASH> 100644
--- a/pyroma/projectdata.py
+++ b/pyroma/projectdata.py
@@ -2,6 +2,7 @@
import os
import re
import sys
+import logging
from collections import defaultdict
IMPORTS = re.compile('^import (.*)$|^from (.*?) import .*$', re.MULTILINE)
@@ -118,8 +119,9 @@ def get_data(path):
metadata = sm.get_data()
del sys.modules['setup']
- except ImportError:
+ except ImportError as e:
# Either there is no setup py, or it's broken.
+ logging.exception(e)
metadata = {}
# No data found | Print the exception when it can't find setup.py. |
diff --git a/lib/premailer-rails3/hook.rb b/lib/premailer-rails3/hook.rb
index <HASH>..<HASH> 100644
--- a/lib/premailer-rails3/hook.rb
+++ b/lib/premailer-rails3/hook.rb
@@ -6,6 +6,7 @@ module PremailerRails
html_part = message.body
)
premailer = Premailer.new(html_part.body.to_s)
+ plain_text = message.text_part.try(:body).try(:to_s)
# reset the body and add two new bodies with appropriate types
message.body = nil
@@ -15,8 +16,9 @@ module PremailerRails
body premailer.to_inline_css
end
+ plain_text = premailer.to_plain_text if plain_text.blank?
message.text_part do
- body premailer.to_plain_text
+ body plain_text
end
end
end | Do not override already rendered plain-text mail |
diff --git a/cake/tests/cases/libs/model/model_delete.test.php b/cake/tests/cases/libs/model/model_delete.test.php
index <HASH>..<HASH> 100644
--- a/cake/tests/cases/libs/model/model_delete.test.php
+++ b/cake/tests/cases/libs/model/model_delete.test.php
@@ -44,7 +44,7 @@ class ModelDeleteTest extends BaseModelTest {
array(
'id' => 3,
'syfile_id' => 3,
- 'published' => 0,
+ 'published' => false,
'name' => 'Item 3',
'ItemsPortfolio' => array(
'id' => 3,
@@ -54,7 +54,7 @@ class ModelDeleteTest extends BaseModelTest {
array(
'id' => 4,
'syfile_id' => 4,
- 'published' => 0,
+ 'published' => false,
'name' => 'Item 4',
'ItemsPortfolio' => array(
'id' => 4,
@@ -64,7 +64,7 @@ class ModelDeleteTest extends BaseModelTest {
array(
'id' => 5,
'syfile_id' => 5,
- 'published' => 0,
+ 'published' => false,
'name' => 'Item 5',
'ItemsPortfolio' => array(
'id' => 5, | Fixing failing test caused by boolean type changes. |
diff --git a/add-commands.js b/add-commands.js
index <HASH>..<HASH> 100644
--- a/add-commands.js
+++ b/add-commands.js
@@ -1,4 +1,4 @@
// this file is here so it's easy to register the commands
-// `import 'cypress-testing-library/add-commands'`
+// `import '@testing-library/cypress/add-commands'`
// eslint-disable-next-line
require('./dist/add-commands') | chore: update comment in add-commands (#<I>) |
diff --git a/test/transports.browser.js b/test/transports.browser.js
index <HASH>..<HASH> 100644
--- a/test/transports.browser.js
+++ b/test/transports.browser.js
@@ -168,7 +168,9 @@ describe('transports', () => {
})
})
- it('many writes', (done) => {
+ it('many writes', function (done) {
+ this.timeout(10000)
+
nodeA.dialProtocol(peerB, '/echo/1.0.0', (err, conn) => {
expect(err).to.not.exist() | test: increase timeout for many writes |
diff --git a/app/assets/javascripts/meurio_ui.js b/app/assets/javascripts/meurio_ui.js
index <HASH>..<HASH> 100644
--- a/app/assets/javascripts/meurio_ui.js
+++ b/app/assets/javascripts/meurio_ui.js
@@ -3,5 +3,10 @@ $(function(){
$('.meurio_header .meurio_apps').hover(function(e){ $('.other_apps').toggle(); e.stopPropagation(); return false; });
$('.meurio_header .icon-triangle-down').click(function(e){ $('.current_user_links').toggle(); e.stopPropagation(); return false; });
$(document).click(function(){ $('.current_user_links').hide(); });
- $("a.icon-warning").trigger("click");
+
+ // My Cities warning
+ if(localStorage.getItem("myCitiesWarning") == undefined){
+ $("a.icon-warning").trigger("click");
+ localStorage.setItem("myCitiesWarning", true);
+ }
}); | [#<I>] add local storage support for MC warning |
diff --git a/src/Message/Helper/GenericHelper.php b/src/Message/Helper/GenericHelper.php
index <HASH>..<HASH> 100644
--- a/src/Message/Helper/GenericHelper.php
+++ b/src/Message/Helper/GenericHelper.php
@@ -64,7 +64,7 @@ class GenericHelper extends AbstractHelper
*/
public function removeContentHeadersAndContent(ParentHeaderPart $part)
{
- foreach (static::$contentHeaders as $header) {
+ foreach (self::$contentHeaders as $header) {
$part->removeHeader($header);
}
$part->detachContentStream();
@@ -88,7 +88,7 @@ class GenericHelper extends AbstractHelper
} else {
$this->copyHeader($from, $to, 'Content-Transfer-Encoding');
}
- $rem = array_diff(static::$contentHeaders, [ 'Content-Type', 'Content-Transfer-Encoding']);
+ $rem = array_diff(self::$contentHeaders, [ 'Content-Type', 'Content-Transfer-Encoding']);
foreach ($rem as $header) {
$this->copyHeader($from, $to, $header);
} | Use self:: instead of static:: for private member |
diff --git a/scss/tests/test_files.py b/scss/tests/test_files.py
index <HASH>..<HASH> 100644
--- a/scss/tests/test_files.py
+++ b/scss/tests/test_files.py
@@ -42,7 +42,7 @@ def test_pair_programmatic(scss_file_pair):
scss.config.STATIC_ROOT = os.path.join(directory, 'static')
try:
- compiler = scss.Scss(scss_opts=dict(style='expanded'), search_paths=[include_dir])
+ compiler = scss.Scss(scss_opts=dict(style='expanded'), search_paths=[include_dir, directory])
actual = compiler.compile(source)
except Exception:
if pytest_trigger is pytest.xfail: | Include the test directory in search path (to easily test bootstrap and others) |
diff --git a/pandas/tests/test_timeseries.py b/pandas/tests/test_timeseries.py
index <HASH>..<HASH> 100644
--- a/pandas/tests/test_timeseries.py
+++ b/pandas/tests/test_timeseries.py
@@ -619,6 +619,17 @@ class TestLegacySupport(unittest.TestCase):
for val in rng:
self.assert_(val.time() == the_time)
+ def test_shift_multiple_of_same_base(self):
+ # GH #1063
+ ts = Series(np.random.randn(5),
+ index=date_range('1/1/2000', periods=5, freq='H'))
+
+ result = ts.shift(1, freq='4H')
+
+ exp_index = ts.index + datetools.Hour(4)
+
+ self.assert_(result.index.equals(exp_index))
+
class TestDateRangeCompat(unittest.TestCase):
def setUp(self): | TST: failing unit test for #<I> |
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -3,7 +3,7 @@ from distutils.core import setup
setup(
name='hapipy',
- version='2.1.5',
+ version='2.1.6',
description="A python wrapper around HubSpot's APIs",
long_description = open('README.md').read(),
author='Adrian Mott',
@@ -15,6 +15,7 @@ setup(
install_requires=[
'nose==1.1.2',
'unittest2==0.5.1',
- 'simplejson==2.2.1'
+ 'simplejson==2.2.1',
+ 'pycurl==7.19.0'
],
) | Adding pycurl to setup.py. |
diff --git a/tests/phpunit/unit/Controller/Backend/RecordsTest.php b/tests/phpunit/unit/Controller/Backend/RecordsTest.php
index <HASH>..<HASH> 100644
--- a/tests/phpunit/unit/Controller/Backend/RecordsTest.php
+++ b/tests/phpunit/unit/Controller/Backend/RecordsTest.php
@@ -198,9 +198,10 @@ class RecordsTest extends ControllerUnitTest
));
$response = $this->controller()->overview($this->getRequest(), 'pages');
$context = $response->getContext();
+
$this->assertArrayHasKey('filter', $context['context']);
$this->assertEquals('Lorem', $context['context']['filter'][0]);
- $this->assertEquals('main', $context['context']['filter'][1]);
+ $this->assertEquals('main', $context['context']['filter']['chapters']);
}
public function testRelated() | [Tests] Handle change in array layout |
diff --git a/quark/compiler.py b/quark/compiler.py
index <HASH>..<HASH> 100644
--- a/quark/compiler.py
+++ b/quark/compiler.py
@@ -723,7 +723,7 @@ class Reflector:
return fields
def meths(self, cls, cid, use_bindings):
- if cls.package is None or cls.package.name.text in ("reflect", "concurrent", "behaviors", "builtin"): # XXX: is this still correct
+ if cls.package is None or cls.package.name.text in ("reflect", ):
return []
methods = []
bindings = base_bindings(cls)
@@ -859,7 +859,7 @@ class Reflector:
self.clazz(cls, clsid, qual, self.qparams(texp),
nparams, texp))
if not ucls: continue
- if ucls.package and ucls.package.name.text in ("reflect", "concurrent", "behaviors", "builtin"):
+ if ucls.package and ucls.package.name.text in ("reflect", ):
continue
if ucls not in self.metadata:
self.metadata[ucls] = OrderedDict() | Generate reflection metadata for all builtin.q except reflection |
diff --git a/redis/redis_test.go b/redis/redis_test.go
index <HASH>..<HASH> 100644
--- a/redis/redis_test.go
+++ b/redis/redis_test.go
@@ -35,7 +35,8 @@ func TestAdd(t *testing.T) {
func TestThreadSafeAdd(t *testing.T) {
// Redis Add is not thread safe. If you run this, the test should fail because it never received
- // ErrorFull.
+ // ErrorFull. It's not thread safe because we don't atomically check the state of the bucket and
+ // increment.
t.Skip()
flushDb()
leakybucket.ThreadSafeAddTest(getLocalStorage())(t) | redis: explain why not thread safe |
diff --git a/scraper/gen_code_gov_json.py b/scraper/gen_code_gov_json.py
index <HASH>..<HASH> 100755
--- a/scraper/gen_code_gov_json.py
+++ b/scraper/gen_code_gov_json.py
@@ -78,6 +78,8 @@ if __name__ == '__main__':
parser.add_argument('--github-orgs', type=str, nargs='+', help='GitHub Organizations')
parser.add_argument('--github-repos', type=str, nargs='+', help='GitHub Repositories')
+ parser.add_argument('--to-csv', action='store_true', help='Toggle output to CSV')
+
args = parser.parse_args()
agency = args.agency
@@ -103,6 +105,11 @@ if __name__ == '__main__':
with open('code.json', 'w') as fp:
fp.write(str_org_projects)
+ if args.to_csv:
+ with open('code.csv', 'w') as fp:
+ for project in code_json['projects']:
+ fp.write(to_doe_csv(project) + '\n')
+
logger.info('Agency: %s', agency)
logger.info('Organization: %s', organization)
logger.info('Number of Projects: %s', len(code_json['projects'])) | Added flag for processing projects into a CSV file |
diff --git a/pulsar/managers/util/drmaa/__init__.py b/pulsar/managers/util/drmaa/__init__.py
index <HASH>..<HASH> 100644
--- a/pulsar/managers/util/drmaa/__init__.py
+++ b/pulsar/managers/util/drmaa/__init__.py
@@ -1,10 +1,14 @@
try:
from drmaa import Session, JobControlAction
+except OSError as e:
+ LOAD_ERROR_MESSAGE = "OSError - problem loading shared library [%s]." % e
+ Session = None
except ImportError as e:
+ LOAD_ERROR_MESSAGE = "ImportError - problem importing library (`pip install drmaa` may fix this) [%s]." % e
# Will not be able to use DRMAA
Session = None
-NO_DRMAA_MESSAGE = "Attempt to use DRMAA, but DRMAA Python library cannot be loaded."
+NO_DRMAA_MESSAGE = "Attempt to use DRMAA, but DRMAA Python library cannot be loaded. "
class DrmaaSessionFactory(object):
@@ -16,8 +20,8 @@ class DrmaaSessionFactory(object):
def get(self, **kwds):
session_constructor = self.session_constructor
- if not session_constructor:
- raise Exception(NO_DRMAA_MESSAGE)
+ if session_constructor is None:
+ raise Exception(NO_DRMAA_MESSAGE + LOAD_ERROR_MESSAGE)
return DrmaaSession(session_constructor(), **kwds) | Improve error message when drmaa cannot be loaded. |
diff --git a/ospd/ospd.py b/ospd/ospd.py
index <HASH>..<HASH> 100644
--- a/ospd/ospd.py
+++ b/ospd/ospd.py
@@ -1187,7 +1187,7 @@ class OSPDaemon:
logger.info("Received Ctrl-C shutting-down ...")
def check_pending_scans(self):
- for scan_id in list(self.scan_collection.ids_iterator()):
+ for scan_id in self.scan_collection.ids_iterator():
if self.get_scan_status(scan_id) == ScanStatus.PENDING:
scan_target = self.scan_collection.scans_table[scan_id].get(
'target' | Don't cast the iterator to list |
diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -9,8 +9,8 @@ exclude_patterns = ['_build']
project = u'Flask-Nav'
copyright = u'2015, Marc Brinkmann'
author = u'Marc Brinkmann'
-version = '0.4'
-release = '0.4.dev1'
+version = '0.5'
+release = '0.5.dev1'
pygments_style = 'sphinx'
html_theme = 'alabaster'
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -12,7 +12,7 @@ def read(fname):
setup(
name='flask-nav',
- version='0.4.dev1',
+ version='0.5.dev1',
description='Easily create navigation for Flask applications.',
long_description=read('README.rst'),
author='Marc Brinkmann', | Start developing version <I>.dev1 (after release of <I>) |
diff --git a/DBUtils/Tests/TestPooledDB.py b/DBUtils/Tests/TestPooledDB.py
index <HASH>..<HASH> 100644
--- a/DBUtils/Tests/TestPooledDB.py
+++ b/DBUtils/Tests/TestPooledDB.py
@@ -19,8 +19,8 @@ import unittest
sys.path.insert(1, '../..')
# The TestSteadyDB module serves as a mock object for the DB-API 2 module:
from DBUtils.Tests import TestSteadyDB as dbapi
-from DBUtils.PooledDB import (PooledDB, SharedDBConnection,
- InvalidConnection, TooManyConnections)
+from DBUtils.PooledDB import PooledDB, SharedDBConnection, \
+ InvalidConnection, TooManyConnections
class TestPooledDB(unittest.TestCase): | Allow running test with Python <I>
We will require modern Python in version <I> only. |
diff --git a/.travis.yml b/.travis.yml
index <HASH>..<HASH> 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,7 +8,6 @@ language:
python:
- "2.7"
- "3.4"
- - "3.5"
- "3.6"
before_install:
diff --git a/tests/test_library.py b/tests/test_library.py
index <HASH>..<HASH> 100644
--- a/tests/test_library.py
+++ b/tests/test_library.py
@@ -188,7 +188,7 @@ def test_library_and_section_search_for_movie(plex):
# This started failing on more recent Plex Server builds
@pytest.mark.xfail
def test_search_with_apostrophe(plex):
- show_title = "Marvel's Daredevil"
+ show_title = 'Marvel\'s Daredevil'
result_root = plex.search(show_title)
result_shows = plex.library.section('TV Shows').search(show_title)
assert result_root
diff --git a/tests/test_video.py b/tests/test_video.py
index <HASH>..<HASH> 100644
--- a/tests/test_video.py
+++ b/tests/test_video.py
@@ -346,6 +346,8 @@ def test_video_Show_thumbUrl(show):
assert '/thumb/' in show.thumbUrl
+# Test seems to fail intermittently
+@pytest.mark.xfail
def test_video_Show_analyze(show):
show = show.analyze() | Tweak two tests; Remove Python <I> testing since we cover both before and after already |
diff --git a/test/basic_tests.go b/test/basic_tests.go
index <HASH>..<HASH> 100644
--- a/test/basic_tests.go
+++ b/test/basic_tests.go
@@ -126,13 +126,18 @@ func SubtestNotFounds(t *testing.T, ds dstore.Datastore) {
switch err {
case dstore.ErrNotFound:
case nil:
- t.Fatal("expected error getting size after delete")
+ t.Fatal("expected error getting size of not found key")
default:
- t.Fatal("wrong error getting size after delete: ", err)
+ t.Fatal("wrong error getting size of not found key", err)
}
if size != -1 {
t.Fatal("expected missing size to be -1")
}
+
+ err = ds.Delete(badk)
+ if err != nil {
+ t.Fatal("error calling delete on not found key: ", err)
+ }
}
func SubtestLimit(t *testing.T, ds dstore.Datastore) { | Ensure that deletion of a non-existent key does not produce an error. |
diff --git a/lib/engineyard/model/instance.rb b/lib/engineyard/model/instance.rb
index <HASH>..<HASH> 100644
--- a/lib/engineyard/model/instance.rb
+++ b/lib/engineyard/model/instance.rb
@@ -119,7 +119,7 @@ module EY
framework_arg = ['--framework-env', environment.framework_env]
- verbose_arg = verbose ? ['--verbose'] : []
+ verbose_arg = (verbose || ENV['DEBUG']) ? ['--verbose'] : []
cmd = Escape.shell_command(start + deploy_args + framework_arg + instance_args + verbose_arg)
puts cmd if verbose | Pass --verbose to eysd whenever DEBUG is set.
[#<I> state:merged] |
diff --git a/impala/util.py b/impala/util.py
index <HASH>..<HASH> 100644
--- a/impala/util.py
+++ b/impala/util.py
@@ -17,14 +17,11 @@ from __future__ import absolute_import
import string
import random
-try:
- import pandas as pd
-
- def as_pandas(cursor):
- names = [metadata[0] for metadata in cursor.description]
- return pd.DataFrame.from_records(cursor.fetchall(), columns=names)
-except ImportError:
- print "Failed to import pandas"
+
+def as_pandas(cursor):
+ from pandas import DataFrame
+ names = [metadata[0] for metadata in cursor.description]
+ return DataFrame.from_records(cursor.fetchall(), columns=names)
def _random_id(prefix='', length=8): | [IMPYLA-<I>] Move pandas import into as_pandas
In lieu of setting up logging, this should eliminate the annoying message about not being able to import pandas.
Fixes #<I>. |
diff --git a/visa.py b/visa.py
index <HASH>..<HASH> 100644
--- a/visa.py
+++ b/visa.py
@@ -13,7 +13,7 @@
from __future__ import division, unicode_literals, print_function, absolute_import
-from pyvisa import logger, __version__, log_to_screen
+from pyvisa import logger, __version__, log_to_screen, constants
from pyvisa.highlevel import ResourceManager
from pyvisa.errors import (Error, VisaIOError, VisaIOWarning, VisaTypeError,
UnknownHandler, OSNotSupported, InvalidBinaryFormat, | Added constants to visa.py |
diff --git a/setuptools/tests/contexts.py b/setuptools/tests/contexts.py
index <HASH>..<HASH> 100644
--- a/setuptools/tests/contexts.py
+++ b/setuptools/tests/contexts.py
@@ -83,3 +83,11 @@ def save_user_site_setting():
yield saved
finally:
site.ENABLE_USER_SITE = saved
+
+
+@contextlib.contextmanager
+def suppress_exceptions(*excs):
+ try:
+ yield
+ except excs:
+ pass
diff --git a/setuptools/tests/test_test.py b/setuptools/tests/test_test.py
index <HASH>..<HASH> 100644
--- a/setuptools/tests/test_test.py
+++ b/setuptools/tests/test_test.py
@@ -91,9 +91,6 @@ class TestTestTest:
cmd.install_dir = site.USER_SITE
cmd.user = 1
with contexts.quiet():
- try:
+ # The test runner calls sys.exit
+ with contexts.suppress_exceptions(SystemExit):
cmd.run()
- except SystemExit:
- # The test runner calls sys.exit; suppress the exception
- pass
- | Suppress exceptions in a context for clarity, brevity, and reuse. |
diff --git a/configStore.js b/configStore.js
index <HASH>..<HASH> 100644
--- a/configStore.js
+++ b/configStore.js
@@ -113,6 +113,7 @@
}
function parse (config) {
+ config = config || {};
var parsed = {};
Object.keys(config).forEach(function (key) {
@@ -152,4 +153,4 @@
}
}
-})();
\ No newline at end of file
+})(); | Make sure Object.keys arg is an object |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.