diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/src/components/autocomplete/AutoComplete.js b/src/components/autocomplete/AutoComplete.js
index <HASH>..<HASH> 100644
--- a/src/components/autocomplete/AutoComplete.js
+++ b/src/components/autocomplete/AutoComplete.js
@@ -223,7 +223,7 @@ export class AutoComplete extends Component {
formatValue(value) {
if (value) {
- if (this.props.selectedItemTemplate) {
+ if (this.props.selectedItemTemplate && (this.props.multiple ? this.isSelected(value) : this.findOptionIndex(value) > -1)) {
const resolvedFieldData = this.props.selectedItemTemplate(value);
return resolvedFieldData ? resolvedFieldData : value;
}
@@ -472,9 +472,9 @@ export class AutoComplete extends Component {
findOptionIndex(option) {
let index = -1;
- if (this.suggestions) {
- for (let i = 0; i < this.suggestions.length; i++) {
- if (ObjectUtils.equals(option, this.suggestions[i])) {
+ if (this.props.suggestions) {
+ for (let i = 0; i < this.props.suggestions.length; i++) {
+ if (ObjectUtils.equals(option, this.props.suggestions[i])) {
index = i;
break;
}
|
Fixed #<I> - AutoComplete: selectedItemTemplate gets called for query
|
diff --git a/pysswords/__main__.py b/pysswords/__main__.py
index <HASH>..<HASH> 100644
--- a/pysswords/__main__.py
+++ b/pysswords/__main__.py
@@ -1,4 +1,4 @@
-from __future__ import print_function
+from __future__ import print_function, unicode_literals
import argparse
from getpass import getpass
|
Add unicode literals from future to support python2
|
diff --git a/lib/jquery.go.js b/lib/jquery.go.js
index <HASH>..<HASH> 100644
--- a/lib/jquery.go.js
+++ b/lib/jquery.go.js
@@ -311,7 +311,7 @@ var jQuery = _.extend(function(selector, context) {
*/
config: {
addJQuery: true,
- jQuery: '//code.jquery.com/jquery-1.11.1.min.js',
+ jQuery: 'https://code.jquery.com/jquery-1.11.1.min.js',
site: '',
width: 1920,
height: 1080,
|
use https for the jQuery path
|
diff --git a/cmd/juju/subnet/remove.go b/cmd/juju/subnet/remove.go
index <HASH>..<HASH> 100644
--- a/cmd/juju/subnet/remove.go
+++ b/cmd/juju/subnet/remove.go
@@ -19,14 +19,20 @@ type RemoveCommand struct {
}
const removeCommandDoc = `
-Removes an existing and unused subnet from Juju. It does not delete
-the subnet from the cloud substrate (i.e. it is not the opposite of
-"juju subnet create").
+Marks an existing and unused subnet for removal. Depending on what features
+the cloud infrastructure supports, this command will either delete the
+subnet using the cloud API (if supported, e.g. in Amazon VPC) or just
+remove the subnet entity from Juju's database (with non-SDN substrates,
+e.g. MAAS). In other words "remove" acts like the opposite of "create"
+(if supported) or "add" (if "create" is not supported).
If any machines are still using the subnet, it cannot be removed and
an error is returned instead. If the subnet is not in use, it will be
marked for removal, but it will not be removed from the Juju database
until all related entites are cleaned up (e.g. allocated addresses).
+Just before ultimately removing the subnet from the Juju database, and
+if the infrastructure supports it, the subnet will be also deleted from
+the underlying substrate.
`
// Info is defined on the cmd.Command interface.
|
Updated "subnet remove" doc
|
diff --git a/scss/__init__.py b/scss/__init__.py
index <HASH>..<HASH> 100644
--- a/scss/__init__.py
+++ b/scss/__init__.py
@@ -1033,10 +1033,10 @@ class Scss(object):
log.warn(dequote(to_str(name)))
elif code == '@print':
name = self.calculate(name, rule[CONTEXT], rule[OPTIONS], rule)
- log.info(dequote(to_str(name)))
+ print >>sys.stderr, dequote(to_str(name))
elif code == '@raw':
name = self.calculate(name, rule[CONTEXT], rule[OPTIONS], rule)
- log.info(repr(name))
+ print >>sys.stderr, repr(name)
elif code == '@dump_context':
log.info(repr(rule[CONTEXT]))
elif code == '@dump_options':
|
@print and @raw output to the standard error
|
diff --git a/lib/sabisu_rails.rb b/lib/sabisu_rails.rb
index <HASH>..<HASH> 100644
--- a/lib/sabisu_rails.rb
+++ b/lib/sabisu_rails.rb
@@ -50,6 +50,10 @@ module SabisuRails
mattr_accessor :app_name
@@app_name = 'Sabisu'
+ # Sets the default format for requests to the api, :json, :xml
+ mattr_accessor :api_format
+ @@api_format = :json
+
mattr_accessor :default_resource
@@configured = false
diff --git a/lib/sabisu_rails/request.rb b/lib/sabisu_rails/request.rb
index <HASH>..<HASH> 100644
--- a/lib/sabisu_rails/request.rb
+++ b/lib/sabisu_rails/request.rb
@@ -4,6 +4,9 @@ module SabisuRails
base_uri SabisuRails.base_api_uri
headers SabisuRails.api_headers
+ headers "Accept" => "application/#{SabisuRails.api_format}"
+ headers "Content-Type" => "application/#{SabisuRails.api_format}"
+ format SabisuRails.api_format
def initialize(explorer, body_params, params)
@explorer = explorer
|
Sets the default format for the api to be json, solves #<I>
|
diff --git a/src/requirementslib/models/requirements.py b/src/requirementslib/models/requirements.py
index <HASH>..<HASH> 100644
--- a/src/requirementslib/models/requirements.py
+++ b/src/requirementslib/models/requirements.py
@@ -920,10 +920,18 @@ class Requirement(object):
:return: A set of requirement strings of the dependencies of this requirement.
:rtype: set(str)
"""
-
- if not sources:
- sources = [{'url': 'https://pypi.org/simple', 'name': 'pypi', 'verify_ssl': True},]
- return get_dependencies(self.ireq, sources=sources)
+ if self.is_named:
+ if not sources:
+ sources = [{
+ 'name': 'pypi',
+ 'url': 'https://pypi.org/simple',
+ 'verify_ssl': True,
+ }]
+ return get_dependencies(self.ireq, sources=sources)
+ else:
+ # FIXME: how should this work? Run setup.py egg_info and dig things
+ # from dist-info?
+ return []
def get_abstract_dependencies(self, sources=None):
"""Retrieve the abstract dependencies of this requirement.
|
get_dependencies only works for named ireq
So we need to do something else if this is a URL-based, or local requirement.
|
diff --git a/multiloader.go b/multiloader.go
index <HASH>..<HASH> 100644
--- a/multiloader.go
+++ b/multiloader.go
@@ -18,3 +18,10 @@ func (m multiLoader) Load(s interface{}) error {
return nil
}
+
+// MustLoad loads the source into the struct, it panics if gets any error
+func (m multiLoader) MustLoad(s interface{}) {
+ if err := m.Load(s); err != nil {
+ panic(err)
+ }
+}
|
Multiconfig: added MustLoad method
|
diff --git a/faststat/faststat.py b/faststat/faststat.py
index <HASH>..<HASH> 100644
--- a/faststat/faststat.py
+++ b/faststat/faststat.py
@@ -138,7 +138,7 @@ try:
# keep buckets for intervals in size from 100ns to ~14 hours
TIME_BUCKETS = sum(
- [(1*10**-x, 2*10**-x, 5*10**-x) for x in (7, 6, 5, 4, 3, 2, 1, 0, -1, -2, -3, -4)], ())
+ [(1*10**x, 2*10**x, 5*10**x) for x in range(2, 13)], ())
class _BaseStats(object):
'base class to avoid repeating code'
|
corrected scale on time buckets to nanoseconds
|
diff --git a/lib/cargo_streamer.rb b/lib/cargo_streamer.rb
index <HASH>..<HASH> 100644
--- a/lib/cargo_streamer.rb
+++ b/lib/cargo_streamer.rb
@@ -1,6 +1,5 @@
require 'zlib'
require 'digest/md5'
-require 'set'
require 'exceptions'
@@ -104,27 +103,24 @@ module OfflineMirror
private
- def encodable?(value, known_ids = Set.new, depth = 0)
+ def encodable?(value, depth = 0)
# Not using is_a? because any derivative-ness would be sliced off by JSONification
# Depth check is because we require that the top type be an Array or Hash
return true if depth > 0 && ENCODABLE_TYPES.include?(value.class)
if value.class == Array || value.class == Hash
- return false if known_ids.include?(value.object_id) # Protect against recursive loops
return false if depth > 4 # Protect against excessively deep structures
- known_ids.add value.object_id
if value.class == Array
value.each do |val|
- return false unless encodable?(val, known_ids, depth + 1)
+ return false unless encodable?(val, depth + 1)
end
else
value.each do |key, val|
return false unless key.class == String # JSON only supports string keys
- return false unless encodable?(val, known_ids, depth + 1)
+ return false unless encodable?(val, depth + 1)
end
end
- known_ids.delete value.object_id
return true
end
|
Removed the explicit circular loop detection code in cargo streamer; the depth maximum takes care of that anyways
|
diff --git a/src/bsh/XThis.java b/src/bsh/XThis.java
index <HASH>..<HASH> 100644
--- a/src/bsh/XThis.java
+++ b/src/bsh/XThis.java
@@ -69,6 +69,10 @@ public class XThis extends This
return "'this' reference (XThis) to Bsh object: " + namespace;
}
+ private Object readResolve() throws ObjectStreamException {
+ throw new NotSerializableException("Deserializing XThis not supported");
+ }
+
/**
Get dynamic proxy for interface, caching those it creates.
*/
|
Prevent deserialization of XThis
|
diff --git a/router.go b/router.go
index <HASH>..<HASH> 100644
--- a/router.go
+++ b/router.go
@@ -277,7 +277,7 @@ func (da *doubleArray) findBase(siblings []sibling, start int, usedBase map[int]
if len(da.bc) <= next {
da.extendBaseCheckArray()
}
- if len(da.bc) <= next || !da.bc[next].IsEmpty() {
+ if !da.bc[next].IsEmpty() {
break
}
}
|
Remove unneeded condition for `if'
|
diff --git a/src/vimpdb/proxy.py b/src/vimpdb/proxy.py
index <HASH>..<HASH> 100755
--- a/src/vimpdb/proxy.py
+++ b/src/vimpdb/proxy.py
@@ -17,10 +17,10 @@ def getPackagePath(instance):
class ProxyToVim(object):
def __init__(self):
- self.setupRemote()
self.comm_init()
def comm_init(self):
+ self.setupRemote()
self._send(':call PDB_comm_init()<CR>')
def setupRemote(self):
|
setupRemote before call to PDB functions in Vim
|
diff --git a/mambustruct.py b/mambustruct.py
index <HASH>..<HASH> 100644
--- a/mambustruct.py
+++ b/mambustruct.py
@@ -636,16 +636,14 @@ class MambuStruct(object):
Returns the number of requests done to Mambu.
"""
try:
- try:
- customFieldValue = [l['value'] for l in self[self.customFieldName] if l['customFieldID'] == customfield][0]
- except IndexError as ierr:
- err = MambuError("The object does not have a custom field to set")
- raise err
-
+ customFieldValue = [l['value'] for l in self[self.customFieldName] if l['customFieldID'] == customfield][0]
datatype = [l['customField']['dataType'] for l in self[self.customFieldName] if l['customFieldID'] == customfield][0]
except IndexError as ierr:
err = MambuError("The object %s has not the custom field '%s'" % (self['id'], customfield))
raise err
+ except AttributeError:
+ err = MambuError("The object does not have a custom field to set")
+ raise err
if datatype == "USER_LINK":
from mambuuser import MambuUser
|
The anidated 'try' was changed by exception 'AttributeError' in mambustruct
|
diff --git a/rakelib/yard_builder.rb b/rakelib/yard_builder.rb
index <HASH>..<HASH> 100644
--- a/rakelib/yard_builder.rb
+++ b/rakelib/yard_builder.rb
@@ -237,10 +237,10 @@ class YardBuilder
Dir.chdir(gh_pages_repo_dir + "docs" + gem) do
Dir.glob(File.join("**","*.html")).each do |file_path|
file_contents = File.read file_path
- file_contents.gsub! "dynamic print site_values.console_name %",
- "Google Cloud Platform Console"
file_contents.gsub! "{% dynamic print site_values.console_name %}",
"Google Cloud Platform Console"
+ file_contents.gsub! "dynamic print site_values.console_name %",
+ "Google Cloud Platform Console"
File.write file_path, file_contents
end
end
|
Fix order of Trace docs fixes
These search and replace calls are here to remove the protobuf templating
directives that were missed before these protos were published.
Unfortunately, these directives look like valid YARD templating when
generating the HTML output, and look like valid Liquid templating for
the source code view.
GitHub Pages cannot load the site with these left alone, so we must
fix them.
|
diff --git a/stun/packet.go b/stun/packet.go
index <HASH>..<HASH> 100644
--- a/stun/packet.go
+++ b/stun/packet.go
@@ -17,6 +17,7 @@
package stun
import (
+ "bytes"
"crypto/rand"
"encoding/binary"
"encoding/hex"
@@ -159,18 +160,24 @@ func (v *packet) send(conn net.PacketConn, addr net.Addr) (net.Addr, *packet, er
if timeout < 1600 {
timeout *= 2
}
- packetBytes := make([]byte, 1024)
- length, raddr, err := conn.ReadFrom(packetBytes)
- if err == nil {
+ for {
+ packetBytes := make([]byte, 1024)
+ length, raddr, err := conn.ReadFrom(packetBytes)
+ if err != nil {
+ if err.(net.Error).Timeout() {
+ break
+ }
+ return nil, nil, err
+ }
pkt, err := newPacketFromBytes(packetBytes[0:length])
+ if !bytes.Equal(v.id, pkt.id) {
+ continue
+ }
if debug {
fmt.Print(hex.Dump(pkt.bytes()))
}
return raddr, pkt, err
}
- if !err.(net.Error).Timeout() {
- return nil, nil, err
- }
}
return nil, nil, nil
}
|
check trans id in send and resp
|
diff --git a/classes/Boom/Group/Group.php b/classes/Boom/Group/Group.php
index <HASH>..<HASH> 100644
--- a/classes/Boom/Group/Group.php
+++ b/classes/Boom/Group/Group.php
@@ -69,6 +69,13 @@ class Group
return $this;
}
+ public function delete()
+ {
+ $this->model->delete();
+
+ return $this;
+ }
+
public function getId()
{
return $this->model->id;
|
Added method Group\Group->delete()
|
diff --git a/multiqc/utils/util_functions.py b/multiqc/utils/util_functions.py
index <HASH>..<HASH> 100644
--- a/multiqc/utils/util_functions.py
+++ b/multiqc/utils/util_functions.py
@@ -85,7 +85,12 @@ def write_data_file(data, fn, sort_cols=False, data_format=None):
if not data: # no items left for regular export
return
- elif len(data) == 1 and type(data) is not dict and type(data) is not OrderedDict:
+ elif (
+ data_format not in ["json", "yaml"]
+ and len(data) == 1
+ and type(data) is not dict
+ and type(data) is not OrderedDict
+ ):
config.logger.debug(
"Metrics of " + fn + "can't be saved as tab-separated output. Choose JSON or YAML output instead."
)
|
Need to check data format in the condition, too
|
diff --git a/ldapcherry/ppolicy/simple.py b/ldapcherry/ppolicy/simple.py
index <HASH>..<HASH> 100644
--- a/ldapcherry/ppolicy/simple.py
+++ b/ldapcherry/ppolicy/simple.py
@@ -19,14 +19,14 @@ class PPolicy(ldapcherry.ppolicy.PPolicy):
def check(self, password):
if len(password) < self.min_length:
- return {'match': False, 'reason': 'password too short'}
+ return {'match': False, 'reason': 'Password too short'}
if len(re.findall(r'[A-Z]', password)) < self.min_upper:
return {
'match': False,
- 'reason': 'not enough upper case characters'
+ 'reason': 'Not enough upper case characters'
}
if len(re.findall(r'[0-9]', password)) < self.min_digit:
- return {'match': False, 'reason': 'not enough digits'}
+ return {'match': False, 'reason': 'Not enough digits'}
return {'match': True, 'reason': 'password ok'}
def info(self):
|
very small improvements on ppolicy.simple
|
diff --git a/tests/unit/Codeception/Lib/Driver/MysqlTest.php b/tests/unit/Codeception/Lib/Driver/MysqlTest.php
index <HASH>..<HASH> 100644
--- a/tests/unit/Codeception/Lib/Driver/MysqlTest.php
+++ b/tests/unit/Codeception/Lib/Driver/MysqlTest.php
@@ -49,7 +49,7 @@ class MysqlTest extends \PHPUnit_Framework_TestCase
public function testCleanupDatabase()
{
- $this->assertNotEmpty(1, count(self::$mysql->getDbh()->query("SHOW TABLES")->fetchAll()));
+ $this->assertNotEmpty(self::$mysql->getDbh()->query("SHOW TABLES")->fetchAll());
self::$mysql->cleanup();
$this->assertEmpty(self::$mysql->getDbh()->query("SHOW TABLES")->fetchAll());
}
|
Fixed assertion in testCleanupDatabase
|
diff --git a/tests/Symfony/Tests/Component/Process/ProcessTest.php b/tests/Symfony/Tests/Component/Process/ProcessTest.php
index <HASH>..<HASH> 100644
--- a/tests/Symfony/Tests/Component/Process/ProcessTest.php
+++ b/tests/Symfony/Tests/Component/Process/ProcessTest.php
@@ -55,8 +55,8 @@ class ProcessTest extends \PHPUnit_Framework_TestCase
*/
public function testProcessPipes($expected, $code)
{
- if (strpos(PHP_OS, "WIN") === 0 ) {
- $this->markTestSkipped('Test hangs on Windows & PHP due to https://bugs.php.net/bug.php?id=60120');
+ if (strpos(PHP_OS, "WIN") === 0 && version_compare(phpversion(), "5.3.9", "<")) {
+ $this->markTestSkipped('Test hangs on Windows & PHP due to https://bugs.php.net/bug.php?id=60120 fixed in http://svn.php.net/viewvc?view=revision&revision=318366');
}
$p = new Process(sprintf('php -r %s', escapeshellarg($code)));
|
Update tests/Symfony/Tests/Component/Process/ProcessTest.php
|
diff --git a/lib/hash/hash_path_proc.rb b/lib/hash/hash_path_proc.rb
index <HASH>..<HASH> 100644
--- a/lib/hash/hash_path_proc.rb
+++ b/lib/hash/hash_path_proc.rb
@@ -1,9 +1,11 @@
require 'time'
class Hash
- def hash_path_proc action, paths, *args, **params
+ def path_proc action, paths, *args, **params
BBLib.hash_path_proc self, action, paths, *args, **params
end
+
+ alias_method :hash_path_proc, :path_proc
end
class Array
@@ -55,8 +57,6 @@ module BBLib
delete: { aliases: [:del]},
remove: { aliases: [:rem]},
custom: {aliases: [:send]},
- # TODO
- # titlecase: { aliases: [:title_case]},
encapsulate: {aliases: []},
uncapsulate: {aliases: []},
extract_integers: {aliases: [:extract_ints]},
@@ -67,7 +67,6 @@ module BBLib
avg_number: {aliases: [:avg, :average, :average_number]},
sum_number: {aliases: [:sum]},
strip: {aliases: [:trim]},
- # rename: { aliases: [:rename_key]},
concat: { aliases: [:join, :concat_with]},
reverse_concat: { aliases: [:reverse_join, :reverse_concat_with]}
}
|
Changed name of method to path_proc and added alias.
|
diff --git a/sovrin_client/test/agent/faber.py b/sovrin_client/test/agent/faber.py
index <HASH>..<HASH> 100644
--- a/sovrin_client/test/agent/faber.py
+++ b/sovrin_client/test/agent/faber.py
@@ -1,18 +1,13 @@
from plenum.common.log import getlogger
from anoncreds.protocol.types import AttribType, AttribDef, SchemaKey
-from sovrin_client.agent.agent import createAgent
from sovrin_client.client.client import Client
from sovrin_client.client.wallet.wallet import Wallet
from sovrin_client.test.agent.base_agent import BaseAgent
from sovrin_client.test.agent.helper import buildFaberWallet
from sovrin_client.test.agent.test_walleted_agent import TestWalletedAgent
from sovrin_client.test.helper import TestClient
-from sovrin_client.agent.exception import NonceNotFound
-from plenum.common.constants import NAME, VERSION
-from sovrin_client.agent.agent import createAgent, runAgent
-from sovrin_client.test.conftest import primes
-from anoncreds.protocol.types import ID
+from sovrin_client.agent.agent import createAgent
logger = getlogger()
|
removed unwanted imports causing unnecessary dependencing to run agents
|
diff --git a/programs/polemap_magic.py b/programs/polemap_magic.py
index <HASH>..<HASH> 100755
--- a/programs/polemap_magic.py
+++ b/programs/polemap_magic.py
@@ -220,6 +220,8 @@ def main():
files = {}
for key in list(FIG.keys()):
+ if len(locations) > 50:
+ locations = locations[:50]
if pmagplotlib.isServer: # use server plot naming convention
files[key] = 'LO:_' + locations + '_POLE_map.' + fmt
else: # use more readable naming convention
|
prevent heinously long names in polemap_magic
|
diff --git a/packages/ra-ui-materialui/src/button/BulkDeleteWithConfirmButton.js b/packages/ra-ui-materialui/src/button/BulkDeleteWithConfirmButton.js
index <HASH>..<HASH> 100644
--- a/packages/ra-ui-materialui/src/button/BulkDeleteWithConfirmButton.js
+++ b/packages/ra-ui-materialui/src/button/BulkDeleteWithConfirmButton.js
@@ -4,6 +4,7 @@ import { connect } from 'react-redux';
import compose from 'recompose/compose';
import ActionDelete from '@material-ui/icons/Delete';
import { withStyles, createStyles } from '@material-ui/core/styles';
+import { fade } from '@material-ui/core/styles/colorManipulator';
import inflection from 'inflection';
import { crudDeleteMany } from 'ra-core';
|
Fic missing fade in BulkDeleteWithConfirmButton
|
diff --git a/lib/adapter/http.js b/lib/adapter/http.js
index <HASH>..<HASH> 100644
--- a/lib/adapter/http.js
+++ b/lib/adapter/http.js
@@ -50,6 +50,14 @@ function createRequestResponseHandler(params) {
return;
}
var connection = connectionPool.get();
+ if (!connection) {
+ // When the cluster members are changing, we cannot get
+ // actual connection for a member, so retry later.
+ setTimeout(function() {
+ processRequest();
+ }, CONNECTION_RETRY_INTERVAL);
+ return;
+ }
var wrappedConnection = new wrapper.DroongaProtocolConnectionWrapper(connection, callback, options);
if (definition.onRequest) {
try {
|
Don't create new connection while updating
|
diff --git a/librosa/onset.py b/librosa/onset.py
index <HASH>..<HASH> 100644
--- a/librosa/onset.py
+++ b/librosa/onset.py
@@ -421,7 +421,8 @@ def onset_strength_multi(y=None, sr=22050, S=None, lag=1, max_size=3,
axis=0)
# compensate for lag
- onset_env = np.pad(onset_env, (lag, 0), mode='constant')
+ onset_env = util.pad_center(onset_env, len(onset_env) + lag, mode='constant')
+ # onset_env = np.pad(onset_env, (lag, 0), mode='constant')
# Counter-act framing effects. Shift the onsets by n_fft / hop_length
if centering:
|
trying center-padding with lag
|
diff --git a/src/main/com/mongodb/ReplicaSetStatus.java b/src/main/com/mongodb/ReplicaSetStatus.java
index <HASH>..<HASH> 100644
--- a/src/main/com/mongodb/ReplicaSetStatus.java
+++ b/src/main/com/mongodb/ReplicaSetStatus.java
@@ -63,6 +63,12 @@ public class ReplicaSetStatus {
sb.append("{replSetName: ").append(_setName.get());
sb.append(", nextResolveTime: ").append(new Date(_updater.getNextResolveTime()).toString());
sb.append(", members: ").append(_replicaSetHolder);
+ sb.append(", updaterIntervalMS: ").append(updaterIntervalMS);
+ sb.append(", updaterIntervalNoMasterMS: ").append(updaterIntervalNoMasterMS);
+ sb.append(", slaveAcceptableLatencyMS: ").append(slaveAcceptableLatencyMS);
+ sb.append(", inetAddrCacheMS: ").append(inetAddrCacheMS);
+ sb.append(", latencySmoothFactor: ").append(latencySmoothFactor);
+ sb.append("}");
return sb.toString();
}
|
Added static field value to ReplicaSetStatus.toString()
|
diff --git a/lib/Less/Node/Rule.php b/lib/Less/Node/Rule.php
index <HASH>..<HASH> 100755
--- a/lib/Less/Node/Rule.php
+++ b/lib/Less/Node/Rule.php
@@ -9,6 +9,7 @@ class Rule
public $important;
public $index;
public $inline;
+ public $variable;
public function __construct($name, $value, $important = null, $index = null, $inline = false)
{
diff --git a/lib/Less/Node/Ruleset.php b/lib/Less/Node/Ruleset.php
index <HASH>..<HASH> 100755
--- a/lib/Less/Node/Ruleset.php
+++ b/lib/Less/Node/Ruleset.php
@@ -68,6 +68,20 @@ class Ruleset
$rule = $ruleset->rules[$i];
if( $rule instanceof \Less\Node\Mixin\Call ){
$rules = $rule->compile($env);
+
+ $temp = array();
+ foreach($rules as $r){
+ if( ($r instanceof \Less\Node\Rule) && $r->variable ){
+ // do not pollute the scope if the variable is
+ // already there. consider returning false here
+ // but we need a way to "return" variable from mixins
+ if( !$ruleset->variable($r->name) ){
+ $temp[] = $r;
+ }
+ }
+ }
+ $rules = $temp;
+
array_splice($ruleset->rules, $i, 1, $rules);
$i += count($rules)-1;
$ruleset->resetCache();
|
do not pollute the parent scope after mixin call if variable is defined
|
diff --git a/livelossplot/core.py b/livelossplot/core.py
index <HASH>..<HASH> 100644
--- a/livelossplot/core.py
+++ b/livelossplot/core.py
@@ -67,7 +67,7 @@ def draw_plot(logs, metrics, figsize=None, max_epoch=None,
plt.tight_layout()
if fig_path is not None:
- plt.savefig(fig_path)
+ plt.savefig(fig_path.format(i=len(logs)))
plt.show()
def print_extrema(logs,
|
saved figure names can be paremetrized
|
diff --git a/java/client/test/org/openqa/selenium/testing/drivers/SauceBackedDriverSupplier.java b/java/client/test/org/openqa/selenium/testing/drivers/SauceBackedDriverSupplier.java
index <HASH>..<HASH> 100644
--- a/java/client/test/org/openqa/selenium/testing/drivers/SauceBackedDriverSupplier.java
+++ b/java/client/test/org/openqa/selenium/testing/drivers/SauceBackedDriverSupplier.java
@@ -50,6 +50,11 @@ public class SauceBackedDriverSupplier implements Supplier<WebDriver> {
} catch (UnreachableBrowserException ex) {
System.out.println("Session is not started " + ex.getMessage());
lastException = ex;
+ // wait a bit before the next attempt
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ }
}
}
|
Adding a sleep between attempts to set connection to sauce
|
diff --git a/src/math/matrix2.js b/src/math/matrix2.js
index <HASH>..<HASH> 100644
--- a/src/math/matrix2.js
+++ b/src/math/matrix2.js
@@ -93,7 +93,7 @@
* @return {me.Matrix2d} Reference to this object for method chaining
*/
copy : function (b) {
- this.val.setTransform(b.val);
+ this.val.set(b.val);
return this;
},
|
fix a regression in the copy function (this calls set on the Array object and not me.Matrix2D)
|
diff --git a/gwtbootstrap3/src/main/java/org/gwtbootstrap3/client/ui/Modal.java b/gwtbootstrap3/src/main/java/org/gwtbootstrap3/client/ui/Modal.java
index <HASH>..<HASH> 100644
--- a/gwtbootstrap3/src/main/java/org/gwtbootstrap3/client/ui/Modal.java
+++ b/gwtbootstrap3/src/main/java/org/gwtbootstrap3/client/ui/Modal.java
@@ -103,7 +103,7 @@ public class Modal extends Div implements IsClosable {
public Modal() {
setStyleName(Styles.MODAL);
-
+
// We make this the default behavior in order to avoid issues like
// https://github.com/gwtbootstrap3/gwtbootstrap3/issues/394
setRemoveOnHide(true);
@@ -130,6 +130,12 @@ public class Modal extends Div implements IsClosable {
}
@Override
+ protected void onUnload() {
+ super.onUnload();
+ unbindAllHandlers(getElement());
+ }
+
+ @Override
public void add(final Widget w) {
// User can supply own ModalHeader
if (w instanceof ModalHeader) {
@@ -182,7 +188,7 @@ public class Modal extends Div implements IsClosable {
removeOnHideHandlerReg = addHiddenHandler(new ModalHiddenHandler() {
@Override
public void onHidden(final ModalHiddenEvent evt) {
- unbindAllHandlers(getElement());
+ // Do logical detach
removeFromParent();
}
});
|
ref #<I>: Moved unbindAllHandlers call into onunload method.
|
diff --git a/tangelo/tangelo/__init__.py b/tangelo/tangelo/__init__.py
index <HASH>..<HASH> 100644
--- a/tangelo/tangelo/__init__.py
+++ b/tangelo/tangelo/__init__.py
@@ -60,7 +60,7 @@ def log_warning(section, message=None):
def log_info(section, message=None):
- log(section, message, color="\033[1;35m")
+ log(section, message, color="\033[35m")
def request_path():
|
Using non-bolded magenta for info statements
|
diff --git a/pyemma/util/annotators.py b/pyemma/util/annotators.py
index <HASH>..<HASH> 100644
--- a/pyemma/util/annotators.py
+++ b/pyemma/util/annotators.py
@@ -204,6 +204,7 @@ def deprecated(*optional_message):
# skip callee frames if they are other decorators or this file(func)
if 'decorator' in filename or __file__ in filename:
continue
+ else: break
lineno = frame[2]
user_msg = 'Call to deprecated function "%s". Called from %s line %i. %s' \
|
[annotators/deprecated] only skip decorators and self.__file__
|
diff --git a/lib/module.js b/lib/module.js
index <HASH>..<HASH> 100644
--- a/lib/module.js
+++ b/lib/module.js
@@ -321,7 +321,7 @@
// Helpers
Module.prototype.log = function() {
- if(this.snoozeConfig.silent === false) {
+ if(this.snoozeConfig.silent !== true) {
var log = Function.prototype.bind.call(console.log, console);
if(this.logging === true) {
log.apply(console, arguments);
@@ -333,7 +333,7 @@
Module.prototype.warn = function() {
arguments[0] = (arguments[0]+'').red;
- if(this.snoozeConfig.silent === false || this.snoozeConfig.silent === 'log') {
+ if(this.snoozeConfig.silent !== true) {
var log = Function.prototype.bind.call(console.log, console);
if(this.logging === true) {
log.apply(console, arguments);
|
logs if silent is undefined
|
diff --git a/core/src/main/java/net/kuujo/copycat/protocol/SyncRequest.java b/core/src/main/java/net/kuujo/copycat/protocol/SyncRequest.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/net/kuujo/copycat/protocol/SyncRequest.java
+++ b/core/src/main/java/net/kuujo/copycat/protocol/SyncRequest.java
@@ -166,7 +166,7 @@ public class SyncRequest extends AbstractRequest {
* @return The sync request builder.
*/
public Builder withLeader(String leader) {
- request.leader = Assert.isNotNull(leader, "leader");
+ request.leader = leader;
return this;
}
|
Allow null leaders in SyncRequest.
|
diff --git a/delphi/utils.py b/delphi/utils.py
index <HASH>..<HASH> 100644
--- a/delphi/utils.py
+++ b/delphi/utils.py
@@ -2,7 +2,7 @@
from indra.statements import Influence
from indra.sources import eidos
-from itertools import repeat, accumulate, islice, chain, starmap
+from itertools import repeat, accumulate, islice, chain, starmap, zip_longest
from functools import reduce
from tqdm import tqdm
from future.utils import lmap
@@ -289,3 +289,18 @@ def get_indra_statements_from_directory(directory: str) -> Iterable[Influence]:
)
)
+
+def grouper(iterable, n, fillvalue=None):
+ "Collect data into fixed-length chunks or blocks"
+ # grouper('ABCDEFG', 3, 'x') --> ABC DEF Gxx"
+ args = [iter(iterable)] * n
+ return zip_longest(*args, fillvalue=fillvalue)
+
+def _insert_line_breaks(label: str, max_str_length=20) -> str:
+ words = label.split()
+ if len(label) > max_str_length:
+ n_groups = len(label)//max_str_length
+ n = len(words)// n_groups
+ return '\n'.join([' '.join(word_group) for word_group in grouper(words, n, '')])
+ else:
+ return label
|
added grouper and line break utils
|
diff --git a/src/Http/Request/Params.php b/src/Http/Request/Params.php
index <HASH>..<HASH> 100644
--- a/src/Http/Request/Params.php
+++ b/src/Http/Request/Params.php
@@ -71,7 +71,7 @@ trait Params
'files' => []
];
- if (in_array(self::$__method, ['PUT', 'PATCH', 'DELETE'])) {
+ if (in_array(self::$__method, ['PUT', 'PATCH'])) {
$rawInput = file_get_contents('php://input');
|
Removing DELETE from method check
|
diff --git a/tests/test_hgvs_validator.py b/tests/test_hgvs_validator.py
index <HASH>..<HASH> 100644
--- a/tests/test_hgvs_validator.py
+++ b/tests/test_hgvs_validator.py
@@ -73,7 +73,7 @@ class Test_HGVSIntrinsicValidator(unittest.TestCase):
self.assertTrue(self.validate_int.validate(self.hp.parse_hgvs_variant('AC_01234.5:c.76_78delACT')))
self.assertTrue(self.validate_int.validate(self.hp.parse_hgvs_variant('AC_01234.5:c.123+54_123+55delTA')))
self.assertTrue(self.validate_int.validate(self.hp.parse_hgvs_variant('AC_01234.5:c.76_78del')))
- self.validate_int.validate(self.hp.parse_hgvs_variant('NM_000030.2:c.679_680+2delAAGT'))
+ self.assertTrue(self.validate_int.validate(self.hp.parse_hgvs_variant('NM_000030.2:c.679_680+2delAAGT')))
with self.assertRaises(HGVSValidationError):
self.validate_int.validate(self.hp.parse_hgvs_variant('AC_01234.5:c.76_78delACTACAT'))
|
Add the forgetten assertion in the test for validating del length
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
|
Restore deleted python env path at the top of the setup script
|
diff --git a/progression/progress.py b/progression/progress.py
index <HASH>..<HASH> 100644
--- a/progression/progress.py
+++ b/progression/progress.py
@@ -265,6 +265,7 @@ class Loop(object):
try:
b = self.conn_recv.recv()
print(b, end='')
+ print(len(b), [ord(bi) for bi in b])
except EOFError:
break
|
try to pipe loop output further, to implement ipython widgets progress
|
diff --git a/lxd/images.go b/lxd/images.go
index <HASH>..<HASH> 100644
--- a/lxd/images.go
+++ b/lxd/images.go
@@ -2305,7 +2305,7 @@ func imageValidSecret(d *Daemon, projectName string, fingerprint string, secret
// Token is single-use, so cancel it now.
err = operationCancel(d, projectName, op)
if err != nil {
- return nil, errors.Wrapf(err, "Failed to cancel operation")
+ return nil, errors.Wrapf(err, "Failed to cancel operation %q", op.ID)
}
return op, nil
|
lxd/images: Include operation ID in error in imageValidSecret
|
diff --git a/lib/aasm/core/state.rb b/lib/aasm/core/state.rb
index <HASH>..<HASH> 100644
--- a/lib/aasm/core/state.rb
+++ b/lib/aasm/core/state.rb
@@ -54,8 +54,10 @@ module AASM::Core
end
def display_name
- @display_name ||= begin
- if Module.const_defined?(:I18n)
+ @display_name = begin
+ if @fixed_display_name
+ @fixed_display_name
+ elsif Module.const_defined?(:I18n)
localized_name
else
name.to_s.gsub(/_/, ' ').capitalize
@@ -75,8 +77,8 @@ module AASM::Core
private
def update(options = {})
- if options.key?(:display) then
- @display_name = options.delete(:display)
+ if options.key?(:display)
+ @fixed_display_name = options.delete(:display)
end
@options = options
self
|
Fixes #<I>
Remove memoization to avoid stale localized state name
|
diff --git a/lib/dimples/writeable.rb b/lib/dimples/writeable.rb
index <HASH>..<HASH> 100644
--- a/lib/dimples/writeable.rb
+++ b/lib/dimples/writeable.rb
@@ -11,7 +11,7 @@ module Dimples
file.write(output)
end
rescue SystemCallError => e
- raise Errors::PublishingError.new(path, e.message)
+ raise Errors::PublishingError.new("Failed to write #{path}")
end
end
end
|
Switched to the simplified PublishingError class.
|
diff --git a/UIUtils/conform/index.js b/UIUtils/conform/index.js
index <HASH>..<HASH> 100644
--- a/UIUtils/conform/index.js
+++ b/UIUtils/conform/index.js
@@ -1,5 +1,6 @@
import React from 'react';
import {findDOMNode} from 'react-dom';
+import {get} from 'lodash';
/**
* A testing module to verify that arbitrary React-supported attributes are passed
@@ -35,9 +36,9 @@ export default function verifyConformance(render, Constructor, baseProps, key) {
);
if (key) {
- return element[key] instanceof HTMLElement
- ? element[key]
- : findDOMNode(element[key]);
+ return get(element, key) instanceof HTMLElement
+ ? get(element, key)
+ : findDOMNode(get(element, key));
}
return findDOMNode(element);
|
Make UIUtils/conform use lodash.get() under the hood
|
diff --git a/src/Runtime/ClientRuntimeContext.php b/src/Runtime/ClientRuntimeContext.php
index <HASH>..<HASH> 100644
--- a/src/Runtime/ClientRuntimeContext.php
+++ b/src/Runtime/ClientRuntimeContext.php
@@ -196,6 +196,17 @@ class ClientRuntimeContext
}
/**
+ * Removes the pending request.
+ */
+ public function removePendingRequest()
+ {
+ if (!isset($this->pendingRequest)) {
+ return;
+ }
+ unset($this->pendingRequest);
+ }
+
+ /**
* @return Version
*/
public function getServerLibraryVersion(){
|
Add method to remove the pending request of the client
|
diff --git a/release/ml_user_tests/tune_rllib/run_connect_tests.py b/release/ml_user_tests/tune_rllib/run_connect_tests.py
index <HASH>..<HASH> 100644
--- a/release/ml_user_tests/tune_rllib/run_connect_tests.py
+++ b/release/ml_user_tests/tune_rllib/run_connect_tests.py
@@ -19,7 +19,8 @@ if __name__ == "__main__":
ray.init(address="auto")
start_time = time.time()
- exp_analysis = run()
+ results = run()
+ exp_analysis = results._experiment_analysis
end_time = time.time()
result = {
diff --git a/rllib/examples/tune/framework.py b/rllib/examples/tune/framework.py
index <HASH>..<HASH> 100644
--- a/rllib/examples/tune/framework.py
+++ b/rllib/examples/tune/framework.py
@@ -38,7 +38,7 @@ def run(smoke_test=False):
# Run the experiment.
# TODO(jungong) : maybe add checkpointing.
- tune.Tuner(
+ return tune.Tuner(
"APPO",
param_space=config,
run_config=air.RunConfig(
|
[rllib/release] Fix rllib connect test with Tuner() API (#<I>)
Currently failing because the Tune framework example does not return fitting results.
|
diff --git a/static/term.js b/static/term.js
index <HASH>..<HASH> 100644
--- a/static/term.js
+++ b/static/term.js
@@ -1184,7 +1184,8 @@ Terminal.prototype.write = function(data) {
case 1:
case 2:
if (this.params[1]) {
- this.handleTitle(this.params[1]);
+ this.title = this.params[1];
+ this.handleTitle(this.title);
}
break;
case 3:
|
have term.js set title.
|
diff --git a/test/test_shebang.rb b/test/test_shebang.rb
index <HASH>..<HASH> 100644
--- a/test/test_shebang.rb
+++ b/test/test_shebang.rb
@@ -38,6 +38,7 @@ class TestShebang < Minitest::Test
assert_interpreter "perl", "#! perl"
assert_interpreter "ruby", "#!/bin/sh\n\n\nexec ruby $0 $@"
- end
+ assert_interpreter "sh", "#! /usr/bin/env A=003 B=149 C=150 D=xzd E=base64 F=tar G=gz H=head I=tail sh"
+ end
end
|
Adding explicit test for new shebang parsing
|
diff --git a/tests/test_command_line.py b/tests/test_command_line.py
index <HASH>..<HASH> 100644
--- a/tests/test_command_line.py
+++ b/tests/test_command_line.py
@@ -225,7 +225,7 @@ class TestDebugCommand(object):
deployment.assert_called_once()
-@pytest.mark.usefixtures("bartlett_dir")
+@pytest.mark.usefixtures("bartlett_dir", "reset_sys_modules")
@pytest.mark.slow
class TestSandboxAndDeploy(object):
@pytest.fixture
|
Also reset sysmodules for sandbox deployment ftests
|
diff --git a/lib/passenger/utils.rb b/lib/passenger/utils.rb
index <HASH>..<HASH> 100644
--- a/lib/passenger/utils.rb
+++ b/lib/passenger/utils.rb
@@ -359,7 +359,7 @@ protected
"app_spawner_timeout" => -1
}
options = defaults.merge(options)
- options["lower_privilege"] = options["lower_privilege"] == "true"
+ options["lower_privilege"] = options["lower_privilege"].to_s == "true"
options["framework_spawner_timeout"] = options["framework_spawner_timeout"].to_i
options["app_spawner_timeout"] = options["app_spawner_timeout"].to_i
return options
|
Fix a security typo which causes all apps to be spawned as root.
|
diff --git a/src/sap.ui.core/src/sap/ui/model/TreeBindingCompatibilityAdapter.js b/src/sap.ui.core/src/sap/ui/model/TreeBindingCompatibilityAdapter.js
index <HASH>..<HASH> 100644
--- a/src/sap.ui.core/src/sap/ui/model/TreeBindingCompatibilityAdapter.js
+++ b/src/sap.ui.core/src/sap/ui/model/TreeBindingCompatibilityAdapter.js
@@ -228,7 +228,7 @@ sap.ui.define(["sap/ui/thirdparty/jquery"],
that.clearSelection();
var _aSelectedContexts = this._aSelectedContexts;
jQuery.each(this.aContexts, function(iIndex, oContext) {
- if (((_aSelectedContexts ? this.aContexts.indexOf(oContext) : -1)) >= 0) {
+ if (((_aSelectedContexts ? _aSelectedContexts.indexOf(oContext) : -1)) >= 0) {
that.addSelectionInterval(iIndex, iIndex);
}
});
|
[FIX] TreeBindingCompatibilityAdapter: Safe Array indexOf
The indexOf call for restoring the selction was previously done
on the wrong array, which was not defined in this function's scope.
Change-Id: I4c<I>a7d5e<I>ed<I>adce5bb8e7f<I>e<I>
BCP: <I>
|
diff --git a/public/app/plugins/datasource/opentsdb/datasource.js b/public/app/plugins/datasource/opentsdb/datasource.js
index <HASH>..<HASH> 100644
--- a/public/app/plugins/datasource/opentsdb/datasource.js
+++ b/public/app/plugins/datasource/opentsdb/datasource.js
@@ -97,7 +97,9 @@ function (angular, _, kbn) {
result = result.data.results;
var tagvs = [];
_.each(result, function(r) {
- tagvs.push(r.tags[key]);
+ if (tagvs.indexOf(r.tags[key]) === -1) {
+ tagvs.push(r.tags[key]);
+ }
});
return tagvs;
});
|
deduplicate tag value suggestions for OpenTSDB
|
diff --git a/src/private/utils.js b/src/private/utils.js
index <HASH>..<HASH> 100644
--- a/src/private/utils.js
+++ b/src/private/utils.js
@@ -5,8 +5,8 @@ export function isDescriptor(desc) {
const keys = ['value', 'get', 'set'];
- for (const key of keys) {
- if (desc.hasOwnProperty(key)) {
+ for (let i = 0, l = keys.length; i < l; i++) {
+ if (desc.hasOwnProperty(keys[i])) {
return true;
}
}
@@ -23,3 +23,20 @@ export function decorate(handleDescriptor, entryArgs) {
};
}
}
+
+class Meta {
+ debounceTimeoutIds = {};
+}
+
+const { defineProperty } = Object;
+
+export function metaFor(obj) {
+ if (obj.hasOwnProperty('__core_decorators__') === false) {
+ defineProperty(obj, '__core_decorators__', {
+ // Defaults: NOT enumerable, configurable, or writable
+ value: new Meta()
+ });
+ }
+
+ return obj.__core_decorators__;
+}
|
Don't use , fixes #<I>. Also includes new Meta/metaFor for per-instance state
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -3,7 +3,7 @@ from setuptools import find_packages, setup
setup(
name='liveboxplaytv',
- version='1.5.1',
+ version='1.5.2',
license='GPL3',
description='Python bindings for the Orange Livebox Play TV appliance',
long_description=open('README.rst').read(),
@@ -11,7 +11,7 @@ setup(
author_email='philipp@schmitt.co',
url='https://github.com/pschmitt/python-liveboxplaytv',
packages=find_packages(),
- install_requires=['fuzzywuzzy', 'python-Levenshtein', 'pyteleloisirs',
+ install_requires=['fuzzywuzzy', 'python-Levenshtein', 'pyteleloisirs>=1.4',
'requests', 'wikipedia'],
entry_points={
'console_scripts': ['liveboxplaytv=liveboxplaytv.cli:main']
|
Require an up to date version of pyteleloisirs
|
diff --git a/trunk/JLanguageTool/src/test/org/languagetool/LanguageTest.java b/trunk/JLanguageTool/src/test/org/languagetool/LanguageTest.java
index <HASH>..<HASH> 100644
--- a/trunk/JLanguageTool/src/test/org/languagetool/LanguageTest.java
+++ b/trunk/JLanguageTool/src/test/org/languagetool/LanguageTest.java
@@ -77,6 +77,12 @@ public class LanguageTest {
assertFalse(Language.getLanguageForShortName("de-CH").hasVariant());
assertFalse(Language.getLanguageForShortName("ast").hasVariant());
assertFalse(Language.getLanguageForShortName("pl").hasVariant());
+
+ for (Language language : Language.LANGUAGES) {
+ if (language.hasVariant()) {
+ assertNotNull("Language " + language + " needs a default variant", language.getDefaultVariant());
+ }
+ }
}
@Test
|
new test that asserts a default variant for languages with variants
|
diff --git a/pmag_basic_dialogs.py b/pmag_basic_dialogs.py
index <HASH>..<HASH> 100755
--- a/pmag_basic_dialogs.py
+++ b/pmag_basic_dialogs.py
@@ -2717,7 +2717,14 @@ class check(wx.Frame):
except:
pass
# only use sites that are associated with actual samples/specimens
- ages_data_dict = {k: v for k, v in self.ErMagic.data_er_ages.items() if k in self.sites}
+
+
+ #ages_data_dict = {k: v for k, v in self.ErMagic.data_er_ages.items() if k in self.sites} # fails in Python 2.6
+ ages_data_dict = {}
+ for k, v in self.ErMagic.data_er_ages.items():
+ if k in self.sites:
+ ages_data_dict[k] = v
+
self.age_grid = self.make_simple_table(col_labels, ages_data_dict, "age")
#
# make it impossible to edit the 1st and 3rd columns
|
pmag_basic_dialogs: fix backwards compatibility problem from using dictionary comprehension
|
diff --git a/auto_ml/_version.py b/auto_ml/_version.py
index <HASH>..<HASH> 100644
--- a/auto_ml/_version.py
+++ b/auto_ml/_version.py
@@ -1 +1 @@
-__version__ = "2.9.9"
+__version__ = "2.9.10"
|
<I> for training_features, and more flexibility in column_descriptions
|
diff --git a/server/types/types.go b/server/types/types.go
index <HASH>..<HASH> 100644
--- a/server/types/types.go
+++ b/server/types/types.go
@@ -45,7 +45,7 @@ func NewErrorV1(code, f string, a ...interface{}) *ErrorV1 {
// This shall only used for debugging purpose.
func (e *ErrorV1) Error() string {
- return fmt.Sprintf("Code: %s, Message: %s", e.Code, e.Message)
+ return fmt.Sprintf("%s: %s", e.Code, e.Message)
}
// WithError updates e to include a detailed error.
|
server: Tweak server error string format
This just tweaks the error string format introduced in #<I> to be
consistent with other error strings in OPA (e.g., topdown, ast, etc.)
|
diff --git a/src/heartbeat.js b/src/heartbeat.js
index <HASH>..<HASH> 100644
--- a/src/heartbeat.js
+++ b/src/heartbeat.js
@@ -32,6 +32,19 @@ function cpuUsage() {
};
}
+function getIPAddresses() {
+ const nets = os.networkInterfaces();
+ const addresses = []
+ for (const name in nets) {
+ for (const net of nets[name]) {
+ if (net.family === 'IPv4' && !net.internal) {
+ addresses.push(net.address);
+ }
+ }
+ }
+ return addresses;
+}
+
function getHeartBeatIndexName(queueName, consumerId) {
const ns = redisKeys.getNamespace();
return `${ns}|${queueName}|${consumerId}`;
@@ -59,6 +72,8 @@ function heartBeat(dispatcher) {
function beat() {
if (state === states.UP) {
const usage = {
+ ipAddress: getIPAddresses(),
+ hostname: os.hostname(),
pid: process.pid,
ram: {
usage: process.memoryUsage(),
|
Include hostname and IP address in consumer stats
|
diff --git a/src/org/zaproxy/zap/extension/forceduser/ExtensionForcedUser.java b/src/org/zaproxy/zap/extension/forceduser/ExtensionForcedUser.java
index <HASH>..<HASH> 100644
--- a/src/org/zaproxy/zap/extension/forceduser/ExtensionForcedUser.java
+++ b/src/org/zaproxy/zap/extension/forceduser/ExtensionForcedUser.java
@@ -354,10 +354,8 @@ public class ExtensionForcedUser extends ExtensionAdaptor implements ContextPane
// Note: Do not persist whether the 'Forced User Mode' is enabled as there's no need
// for this and the mode can be easily enabled/disabled directly
} else {
- // If we don't have a forced user, set an 'empty' list to force deletion of any
- // previous values
- session.setContextData(context.getIndex(), RecordContext.TYPE_FORCED_USER_ID,
- Collections.<String> emptyList());
+ // If we don't have a forced user, force deletion of any previous values
+ session.clearContextDataForType(context.getIndex(), RecordContext.TYPE_FORCED_USER_ID);
}
} catch (Exception e) {
log.error("Unable to persist forced user.", e);
|
Proper deletion of existing context data for ForcedUserExtension.
|
diff --git a/app/models/effective/resources/relation.rb b/app/models/effective/resources/relation.rb
index <HASH>..<HASH> 100644
--- a/app/models/effective/resources/relation.rb
+++ b/app/models/effective/resources/relation.rb
@@ -209,15 +209,23 @@ module Effective
fuzzy = true unless fuzzy == false
- conditions = (
- if fuzzy
- columns.map { |name| "#{sql_column(name)} #{ilike} :fuzzy" }
- else
- columns.map { |name| "#{sql_column(name)} = :value" }
- end
- ).join(' OR ')
+ # Retval
+ searched = relation
+ terms = value.split(' ') - [nil, '']
+
+ terms.each do |term|
+ conditions = (
+ if fuzzy
+ columns.map { |name| "#{sql_column(name)} #{ilike} :fuzzy" }
+ else
+ columns.map { |name| "#{sql_column(name)} = :term" }
+ end
+ ).join(' OR ')
+
+ searched = searched.where(conditions, fuzzy: "%#{term}%", term: term)
+ end
- relation.where(conditions, fuzzy: "%#{value}%", value: value)
+ searched
end
private
|
Search by all terms in search_any
|
diff --git a/src/shapes/poly.js b/src/shapes/poly.js
index <HASH>..<HASH> 100644
--- a/src/shapes/poly.js
+++ b/src/shapes/poly.js
@@ -111,7 +111,7 @@
// Calculate the edges/normals
for (i = 0; i < len; i++) {
var p1 = points[i];
- var p2 = i < len - 1 ? points[i + 1] : points[0];
+ var p2 = points[(i + 1) % len];
var e = new me.Vector2d().copy(p2).sub(p1);
var n = new me.Vector2d().copy(e).perp().normalize();
edges.push(e);
|
Small optimization in me.PolyShape.recalc()
|
diff --git a/wsdef/src/main/java/com/google/gson/webservice/definition/rest/RestRequest.java b/wsdef/src/main/java/com/google/gson/webservice/definition/rest/RestRequest.java
index <HASH>..<HASH> 100644
--- a/wsdef/src/main/java/com/google/gson/webservice/definition/rest/RestRequest.java
+++ b/wsdef/src/main/java/com/google/gson/webservice/definition/rest/RestRequest.java
@@ -19,6 +19,7 @@ import com.google.gson.webservice.definition.ContentBodySpec;
import com.google.gson.webservice.definition.HeaderMap;
import com.google.gson.webservice.definition.HttpMethod;
import com.google.gson.webservice.definition.RequestBody;
+import com.google.gson.webservice.definition.TypedKey;
/**
* The data associated with a Web service request. This includes HTTP request header parameters
@@ -63,7 +64,11 @@ public final class RestRequest<R> {
public String getContentType() {
return ContentBodySpec.JSON_CONTENT_TYPE;
}
-
+
+ public <T> T getHeader(TypedKey<T> key) {
+ return headers.get(key);
+ }
+
@SuppressWarnings("unchecked")
public <T> T getHeader(String headerName) {
return (T) headers.get(headerName);
|
Added a getHeader method with a TypedKey in RestRequest.
|
diff --git a/xchange-openexchangerates/src/main/java/com/xeiam/xchange/oer/service/polling/OERPollingMarketDataService.java b/xchange-openexchangerates/src/main/java/com/xeiam/xchange/oer/service/polling/OERPollingMarketDataService.java
index <HASH>..<HASH> 100644
--- a/xchange-openexchangerates/src/main/java/com/xeiam/xchange/oer/service/polling/OERPollingMarketDataService.java
+++ b/xchange-openexchangerates/src/main/java/com/xeiam/xchange/oer/service/polling/OERPollingMarketDataService.java
@@ -99,6 +99,9 @@ public class OERPollingMarketDataService extends BasePollingExchangeService impl
// Request data
cachedOERTickers = openExchangeRates.getTickers(exchangeSpecification.getApiKey());
+ if (cachedOERTickers == null) {
+ throw new ExchangeException("Null response returned from Open Exchange Rates!");
+ }
}
Rates rates = cachedOERTickers.getRates();
|
issue # <I>, added null check and throw ExchangeException
|
diff --git a/TYPO3.TYPO3CR/Classes/TYPO3/TYPO3CR/Domain/Model/Workspace.php b/TYPO3.TYPO3CR/Classes/TYPO3/TYPO3CR/Domain/Model/Workspace.php
index <HASH>..<HASH> 100644
--- a/TYPO3.TYPO3CR/Classes/TYPO3/TYPO3CR/Domain/Model/Workspace.php
+++ b/TYPO3.TYPO3CR/Classes/TYPO3/TYPO3CR/Domain/Model/Workspace.php
@@ -276,7 +276,7 @@ class Workspace
*/
public function isInternalWorkspace()
{
- return $this->owner === null;
+ return $this->baseWorkspace !== null && $this->owner === null;
}
/**
|
Add additional check to isInternalWorkspace()
|
diff --git a/EventListener/StopwatchListener.php b/EventListener/StopwatchListener.php
index <HASH>..<HASH> 100644
--- a/EventListener/StopwatchListener.php
+++ b/EventListener/StopwatchListener.php
@@ -72,6 +72,8 @@ class StopwatchListener implements EventSubscriberInterface
*/
private function setHeader(Response $response, $stage, $duration)
{
+ // disallow non-alphanumeric characters in the header
+ $stage = preg_replace('/[^\d\w]/', '', $stage);
$headerName = 'X-API-RESPONSE-'.strtoupper($stage);
$response->headers->set($headerName, $duration);
}
|
Disallow non-alphanumeric characters in the header when adding stopwatch data
|
diff --git a/Form/Type/BaseType.php b/Form/Type/BaseType.php
index <HASH>..<HASH> 100644
--- a/Form/Type/BaseType.php
+++ b/Form/Type/BaseType.php
@@ -65,7 +65,7 @@ class BaseType extends AbstractType
continue;
}
- $fieldOptions = $attr['options'];
+ $fieldOptions = $this->resolveFieldOptionValues($attr['options']);
if (!array_key_exists('label', $fieldOptions)) {
$fieldOptions['label'] = $translationPrefix.$field;
@@ -94,4 +94,29 @@ class BaseType extends AbstractType
{
return $this->meta->getFormTypeName();
}
+
+ /**
+ * @param array $options Field options
+ *
+ * @return array
+ */
+ private function resolveFieldOptionValues(array $options)
+ {
+ foreach ($options as &$value) {
+ if (!is_array($value)) {
+ continue;
+ }
+ if (is_callable($value)) {
+ $value = $value();
+
+ continue;
+ }
+
+ $value = $this->resolveFieldOptionValues($value);
+ }
+
+ unset($value);
+
+ return $options;
+ }
}
|
Base form field option now can be callable.
|
diff --git a/ayrton/tests/test_remote.py b/ayrton/tests/test_remote.py
index <HASH>..<HASH> 100644
--- a/ayrton/tests/test_remote.py
+++ b/ayrton/tests/test_remote.py
@@ -89,7 +89,7 @@ class DebugRemoteTests (RemoteTests):
server= socket (AF_INET, SOCK_STREAM)
server.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)
- server.settimeout (3)
+ server.settimeout (1)
server.bind (('127.0.0.1', 2233))
server.listen ()
|
[*] timeout down to 1s, so we can fail <I>% faster!
|
diff --git a/identify/extensions.py b/identify/extensions.py
index <HASH>..<HASH> 100644
--- a/identify/extensions.py
+++ b/identify/extensions.py
@@ -45,6 +45,7 @@ EXTENSIONS = {
'eyaml': {'text', 'yaml'},
'feature': {'text', 'gherkin'},
'fish': {'text', 'fish'},
+ 'gd': {'text', 'gdscript'},
'gemspec': {'text', 'ruby'},
'gif': {'binary', 'image', 'gif'},
'go': {'text', 'go'},
|
Add gd extension for GDScript from Godot
|
diff --git a/src/Viewable.php b/src/Viewable.php
index <HASH>..<HASH> 100644
--- a/src/Viewable.php
+++ b/src/Viewable.php
@@ -90,16 +90,6 @@ trait Viewable
}
/**
- * Get the total number of views.
- *
- * @return void
- */
- public function removeViews()
- {
- app(ViewableService::class)->removeModelViews($this);
- }
-
- /**
* Retrieve records sorted by views.
*
* @param \Illuminate\Database\Eloquent\Builder $query
|
refactor: remove removeViews method from Viewable trait
|
diff --git a/amino/data/list.py b/amino/data/list.py
index <HASH>..<HASH> 100644
--- a/amino/data/list.py
+++ b/amino/data/list.py
@@ -121,9 +121,11 @@ class List(Generic[A], typing.List[A], Implicits, implicits=True, metaclass=List
return maybe.Empty() if self.empty else maybe.Just(self[1:])
@property
- def detach_head(self) -> 'maybe.Maybe[Tuple[A, List[A]]]':
+ def uncons(self) -> 'maybe.Maybe[Tuple[A, List[A]]]':
return self.head.product(self.tail)
+ detach_head = uncons
+
@property
def detach_last(self) -> 'maybe.Maybe[Tuple[A, List[A]]]':
return self.last.product(self.init)
|
alias `List.detach_head` to `uncons`
|
diff --git a/collector/interrupts_common.go b/collector/interrupts_common.go
index <HASH>..<HASH> 100644
--- a/collector/interrupts_common.go
+++ b/collector/interrupts_common.go
@@ -13,6 +13,7 @@
// +build !nointerrupts
// +build !darwin
+// +build !freebsd
package collector
|
Fix compilation on FreeBSD. Refs #<I>
There is no interrupts_freebsd.go implementation yet.
|
diff --git a/modules/backend/lang/ro/lang.php b/modules/backend/lang/ro/lang.php
index <HASH>..<HASH> 100644
--- a/modules/backend/lang/ro/lang.php
+++ b/modules/backend/lang/ro/lang.php
@@ -191,6 +191,7 @@ return [
'code_folding' => 'Code folding',
'word_wrap' => 'Word wrap',
'highlight_active_line' => 'Evidentiere linie activa',
+ 'auto_closing' => 'Inchide automat tag-uri si caractere speciale',
'show_invisibles' => 'Arata caractere invizibile',
'show_gutter' => 'Afiseaza panou',
'theme' => 'Schema culori',
|
Auto closing option translation in Romanian
Translation for pull request #<I>
|
diff --git a/common/src/main/java/tachyon/util/io/BufferUtils.java b/common/src/main/java/tachyon/util/io/BufferUtils.java
index <HASH>..<HASH> 100644
--- a/common/src/main/java/tachyon/util/io/BufferUtils.java
+++ b/common/src/main/java/tachyon/util/io/BufferUtils.java
@@ -15,6 +15,10 @@
package tachyon.util.io;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import tachyon.Constants;
+
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.reflect.Method;
@@ -26,6 +30,7 @@ import java.util.List;
* Utilities related to buffers, not only ByteBuffer.
*/
public class BufferUtils {
+ private static final Logger LOG = LoggerFactory.getLogger(Constants.LOGGER_TYPE);
/**
* Force to unmap direct buffer if the buffer is no longer used. It is unsafe operation and
* currently a walk-around to avoid huge memory occupation caused by memory map.
@@ -45,6 +50,7 @@ public class BufferUtils {
cleaner.getClass().getMethod("clean").invoke(cleaner);
}
} catch (Exception e) {
+ LOG.warn("Fail to unmap direct buffer due to ", e);
buffer = null;
}
}
|
add log warning for non-oracle jvms that don't have a direct byte buffer cleaner implementation.
|
diff --git a/python/ray/tune/checkpoint_manager.py b/python/ray/tune/checkpoint_manager.py
index <HASH>..<HASH> 100644
--- a/python/ray/tune/checkpoint_manager.py
+++ b/python/ray/tune/checkpoint_manager.py
@@ -188,8 +188,10 @@ class CheckpointManager:
except KeyError:
logger.error(
"Result dict has no key: {}. "
- "checkpoint_score_attr must be set to a key in the "
- "result dict.".format(self._checkpoint_score_attr)
+ "checkpoint_score_attr must be set to a key of the "
+ "result dict. Valid keys are {}".format(
+ self._checkpoint_score_attr, list(checkpoint.result.keys())
+ )
)
return
diff --git a/python/ray/tune/trial.py b/python/ray/tune/trial.py
index <HASH>..<HASH> 100644
--- a/python/ray/tune/trial.py
+++ b/python/ray/tune/trial.py
@@ -618,9 +618,8 @@ class Trial:
for criteria, stop_value in self.stopping_criterion.items():
if criteria not in result:
raise TuneError(
- "Stopping criteria {} not provided in result {}.".format(
- criteria, result
- )
+ "Stopping criteria {} not provided in result dict. Keys "
+ "are {}.".format(criteria, list(result.keys()))
)
elif isinstance(criteria, dict):
raise ValueError(
|
[Tune] Logging of bad results dict keys (#<I>)
[User complains](<URL>) about logging on failure of locating `checkpoint_score_attr ` in results dict not being informative.
I propose that we log the actual results dict keys and extended stopping criteria, which imho should not log the whole result dict as this might contain tensors.
Maybe there are other similar cases in tune library, in which I don't know my way around that good.
|
diff --git a/src/ResizableDraggableDialog/index.js b/src/ResizableDraggableDialog/index.js
index <HASH>..<HASH> 100644
--- a/src/ResizableDraggableDialog/index.js
+++ b/src/ResizableDraggableDialog/index.js
@@ -27,6 +27,7 @@ export default function ResizableDraggableDialog({
topLeft: true,
topRight: true
}}
+ bounds={"body"}
default={{
x: Math.max((windowWidth - defaultDialogWidth) / 2, 0),
y: Math.max((windowHeight - defaultDialogHeight) / 2, 0),
|
fixing bounds of ResizableDraggableDialog
|
diff --git a/Kwc/Basic/ImageEnlarge/EnlargeTag/Trl/Component.php b/Kwc/Basic/ImageEnlarge/EnlargeTag/Trl/Component.php
index <HASH>..<HASH> 100644
--- a/Kwc/Basic/ImageEnlarge/EnlargeTag/Trl/Component.php
+++ b/Kwc/Basic/ImageEnlarge/EnlargeTag/Trl/Component.php
@@ -97,7 +97,7 @@ class Kwc_Basic_ImageEnlarge_EnlargeTag_Trl_Component extends Kwc_Chained_Trl_Co
return null;
}
- private function _getImageEnlargeComponent()
+ protected function _getImageEnlargeComponent()
{
$d = $this->getData();
while (!is_instance_of($d->componentClass, 'Kwc_Basic_ImageEnlarge_Trl_Component')) {
|
Change getImageEnlargeComponent function to protected
this is needed to override this function to provide a different
image
|
diff --git a/myfitnesspal/meal.py b/myfitnesspal/meal.py
index <HASH>..<HASH> 100644
--- a/myfitnesspal/meal.py
+++ b/myfitnesspal/meal.py
@@ -28,8 +28,9 @@ class Meal(MFPBase):
for entry in self.entries:
for k, v in entry.nutrition_information.items():
if k not in nutrition:
- nutrition[k] = 0
- nutrition[k] += v
+ nutrition[k] = v
+ else:
+ nutrition[k] += v
return nutrition
|
Fixing nutrition totals per-day.
|
diff --git a/lib/fileSystem.js b/lib/fileSystem.js
index <HASH>..<HASH> 100755
--- a/lib/fileSystem.js
+++ b/lib/fileSystem.js
@@ -343,13 +343,9 @@ module.exports.copy = function(sourcePath, destinationSourcePath, callback) {
* @param {Function} callback The function to call when done
* - **Error** The error if an error occurred, null otherwise
* - **String** The file content or null if an error occurred
- * @throws {Error} An error if callback is not speficied
+ * @throws {TypeError} An error if callback is not speficied
*/
module.exports.getJSONFileContent = function(filePath, callback) {
- callback = callback || function(error) {
- throw error || new Error('Missing getJSONFileContent callback');
- };
-
if (!filePath)
return callback(new TypeError('Invalid file path, expected a string'));
@@ -383,7 +379,6 @@ module.exports.getJSONFileContent = function(filePath, callback) {
callback(new Error('Missing file ' + filePath));
});
-
};
/**
|
Remove default callback on fileSystem.getJSONFileConent method
A default callback implementation was handling errors and throwing an exception according to the error given to the callback function. It may be confusing to throw different exceptions, it now let NodeJS throw a TypeError in case the callback is not defined.
|
diff --git a/src/test/java/me/lemire/integercompression/BasicTest.java b/src/test/java/me/lemire/integercompression/BasicTest.java
index <HASH>..<HASH> 100644
--- a/src/test/java/me/lemire/integercompression/BasicTest.java
+++ b/src/test/java/me/lemire/integercompression/BasicTest.java
@@ -27,6 +27,7 @@ public class BasicTest {
new IntegratedVariableByte()),
new JustCopy(),
new VariableByte(),
+ new GroupSimple9(),
new IntegratedVariableByte(),
new Composition(new BinaryPacking(), new VariableByte()),
new Composition(new NewPFD(), new VariableByte()),
|
Adding GroupSimple9 to tests.
|
diff --git a/Kwc/Form/Decorator/Label.php b/Kwc/Form/Decorator/Label.php
index <HASH>..<HASH> 100644
--- a/Kwc/Form/Decorator/Label.php
+++ b/Kwc/Form/Decorator/Label.php
@@ -64,8 +64,10 @@ class Kwc_Form_Decorator_Label extends Kwc_Form_Decorator_Abstract
}
if ($item['item']->getFieldLabel()) {
$preHtml .= $item['item']->getLabelSeparator();
+ } else {
+ $preHtml .= ' ';
}
- $preHtml .= ' </label>';
+ $preHtml .= '</label>';
}
$postHtml = '';
if ($item['item'] && $item['item']->getComment()) {
|
form label decorator: insert nbsp; only when there is no label
|
diff --git a/lib/OpenLayers/Format/KML.js b/lib/OpenLayers/Format/KML.js
index <HASH>..<HASH> 100644
--- a/lib/OpenLayers/Format/KML.js
+++ b/lib/OpenLayers/Format/KML.js
@@ -214,7 +214,8 @@ OpenLayers.Format.KML = OpenLayers.Class(OpenLayers.Format.XML, {
"coordinates");
var line = null;
if(nodeList.length > 0) {
- var coordString = nodeList[0].firstChild.nodeValue;
+ var coordString = this.concatChildValues(nodeList[0]);
+
coordString = coordString.replace(this.regExes.trimSpace,
"");
coordString = coordString.replace(this.regExes.trimComma,
|
Apply a fix to KML format to support > 4k characters in a linestring.
(Closes #<I>)
git-svn-id: <URL>
|
diff --git a/src/Omnipay/Alipay/Message/ExpressCompletePurchaseRequest.php b/src/Omnipay/Alipay/Message/ExpressCompletePurchaseRequest.php
index <HASH>..<HASH> 100644
--- a/src/Omnipay/Alipay/Message/ExpressCompletePurchaseRequest.php
+++ b/src/Omnipay/Alipay/Message/ExpressCompletePurchaseRequest.php
@@ -47,8 +47,8 @@ class ExpressCompletePurchaseRequest extends AbstractRequest
unset($params['sign']);
unset($params['sign_type']);
unset($params['notify_id']);
- ksort($data);
- reset($data);
+ ksort($params);
+ reset($params);
return $params;
}
|
rename data to params
|
diff --git a/lib/src/main/java/com/github/kevinsawicki/http/HttpRequest.java b/lib/src/main/java/com/github/kevinsawicki/http/HttpRequest.java
index <HASH>..<HASH> 100644
--- a/lib/src/main/java/com/github/kevinsawicki/http/HttpRequest.java
+++ b/lib/src/main/java/com/github/kevinsawicki/http/HttpRequest.java
@@ -470,7 +470,6 @@ public class HttpRequest {
*/
public static class HttpRequestException extends RuntimeException {
- /** serialVersionUID */
private static final long serialVersionUID = -1170466989781746231L;
/**
|
Remove comment on private serialization constant
This comment previously just repeated the variable name
|
diff --git a/src/Opulence/Sessions/Handlers/FileSessionHandler.php b/src/Opulence/Sessions/Handlers/FileSessionHandler.php
index <HASH>..<HASH> 100644
--- a/src/Opulence/Sessions/Handlers/FileSessionHandler.php
+++ b/src/Opulence/Sessions/Handlers/FileSessionHandler.php
@@ -51,10 +51,10 @@ class FileSessionHandler extends SessionHandler
{
$sessionFiles = glob($this->path . "/*");
+ $limit = time() - $maxLifetime;
foreach ($sessionFiles as $sessionFile) {
- $lastModified = DateTime::createFromFormat("U", filemtime($sessionFile));
-
- if (new DateTime("$maxLifetime seconds ago") > $lastModified) {
+ $lastModified = filemtime($sessionFile);
+ if ($lastModified < $limit) {
@unlink($sessionFile);
}
}
|
Optimize session GC
Constructing two datetime objects for a couple ten thousand session
files is extremely expensive, to the point where it dominates
execution time.
Use a simple unix timestamp comparison instead.
|
diff --git a/tasks/bump.js b/tasks/bump.js
index <HASH>..<HASH> 100644
--- a/tasks/bump.js
+++ b/tasks/bump.js
@@ -1,11 +1,3 @@
-/*
- * grunt-contrib-bump
- * http://gruntjs.com/
- *
- * Copyright (c) 2013 "Cowboy" Ben Alman, contributors
- * Licensed under the MIT license.
- */
-
'use strict';
var semver = require('semver');
@@ -47,7 +39,7 @@ module.exports = function(grunt) {
tagName: 'v{%= version %}',
tagMessage: 'Version {%= version %}',
tagPrerelease: false,
- updateDate: true,
+ updateDate: true
});
// Normalize filepaths to array.
var filepaths = Array.isArray(options.filepaths) ? options.filepaths : [options.filepaths];
@@ -130,7 +122,7 @@ module.exports = function(grunt) {
function processTemplate(message, data) {
return grunt.template.process(message, {
delimiters: 'bump',
- data: data,
+ data: data
});
}
|
chore: Remove old boilerplate headers
New headers coming soon!
|
diff --git a/lib/util/index.js b/lib/util/index.js
index <HASH>..<HASH> 100644
--- a/lib/util/index.js
+++ b/lib/util/index.js
@@ -538,8 +538,8 @@ var interfaceData = [hostname, os.platform(), os.release(),
})();
var clientId = crypto.createHmac('sha256', 'x-whistle-client-id')
- .update(interfaceData.join('\r\n')).digest('hex')
- + Math.floor(Math.random() * 1000000).toString(16);
+ .update(interfaceData.join('\r\n')).digest('hex');
+
exports.setClientId = function(headers, enable) {
if (enable && (enable.clientId || enable.clientID || enable.clientid)) {
headers['x-whistle-client-id'] = clientId;
|
refactor: generate client id by os.networkInterfaces()
|
diff --git a/txmongo/collection.py b/txmongo/collection.py
index <HASH>..<HASH> 100644
--- a/txmongo/collection.py
+++ b/txmongo/collection.py
@@ -158,6 +158,14 @@ class Collection(object):
defer.returnValue([d.decode(as_class=as_class) for d in documents])
def find_with_cursor(self, spec=None, skip=0, limit=0, fields=None, filter=None, **kwargs):
+ ''' find method that uses the cursor to only return a block of
+ results at a time.
+ Arguments are the same as with find()
+ returns deferred that results in a tuple: (docs, deferred) where
+ docs are the current page of results and deferred results in the next
+ tuple. When the cursor is exhausted, it will return the tuple
+ ([], None)
+ '''
if spec is None:
spec = SON()
|
Added docstring to the find_with_cursor method
|
diff --git a/lib/neo4j/extensions/rest/rest_mixin.rb b/lib/neo4j/extensions/rest/rest_mixin.rb
index <HASH>..<HASH> 100644
--- a/lib/neo4j/extensions/rest/rest_mixin.rb
+++ b/lib/neo4j/extensions/rest/rest_mixin.rb
@@ -49,7 +49,8 @@ module Neo4j
# Explicitly index the classname of a node (required for <code>GET /nodes/MyClass</code>
# Lucene search to work).
self.class.indexer.on_property_changed(self, 'classname') # TODO reuse the event_handler instead !
- Neo4j.event_handler.property_changed(self, 'classname', '', self.class.to_s)
+ # This caused the replication_spec.rb to fail
+ # Neo4j.event_handler.property_changed(self, 'classname', '', self.class.to_s)
end
# Called by the REST API if this node is accessed directly by ID. Any query parameters
|
Merged with ept/neo4j/master branch
Should not send out events on classname changed.
This caused the replication_spec.rb to fail
|
diff --git a/state/migration_import.go b/state/migration_import.go
index <HASH>..<HASH> 100644
--- a/state/migration_import.go
+++ b/state/migration_import.go
@@ -568,19 +568,16 @@ func (i *importer) machinePortsOp(m description.Machine) txn.Op {
func (i *importer) machineInstanceOp(mdoc *machineDoc, inst description.CloudInstance) txn.Op {
doc := &instanceData{
- DocID: mdoc.DocID,
- MachineId: mdoc.Id,
- InstanceId: instance.Id(inst.InstanceId()),
- ModelUUID: mdoc.ModelUUID,
+ DocID: mdoc.DocID,
+ MachineId: mdoc.Id,
+ InstanceId: instance.Id(inst.InstanceId()),
+ DisplayName: inst.DisplayName(),
+ ModelUUID: mdoc.ModelUUID,
}
if arch := inst.Architecture(); arch != "" {
doc.Arch = &arch
}
- if displayName := inst.DisplayName(); displayName != "" {
- doc.DisplayName = displayName
- }
-
if mem := inst.Memory(); mem != 0 {
doc.Mem = &mem
}
|
Optimize code a bit
DisplayName field is not a pointer, nor omitempty, so no need to check
creating extra variables
|
diff --git a/db/seeds.rb b/db/seeds.rb
index <HASH>..<HASH> 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -42,14 +42,14 @@ throw "Are you sure you cleared candlepin! unable to create first org!" if first
#create a provider
if Provider.count == 0
porkchop = Provider.create!({
- :name => 'porkchop',
+ :name => 'Custom Provider 1',
:organization => first_org,
:repository_url => 'http://download.fedoraproject.org/pub/fedora/linux/releases/',
:provider_type => Provider::CUSTOM
})
Provider.create!({
- :name => 'redhat',
+ :name => 'Red Hat',
:organization => first_org,
:repository_url => 'https://somehost.example.com/content/',
:provider_type => Provider::REDHAT
|
renaming the 2 providers to something more useful
no reason to call the custom provider 'porkchop' anymore. has no
meaning to our users.
|
diff --git a/tests/TestCase/View/Helper/FormHelperTest.php b/tests/TestCase/View/Helper/FormHelperTest.php
index <HASH>..<HASH> 100755
--- a/tests/TestCase/View/Helper/FormHelperTest.php
+++ b/tests/TestCase/View/Helper/FormHelperTest.php
@@ -4098,7 +4098,7 @@ class FormHelperTest extends TestCase {
array('select' => array('name' => 'Contact[date][hour]')),
$hoursRegex,
array('option' => array('value' => date('H', $now), 'selected' => 'selected')),
- date('H', $now),
+ date('G', $now),
'/option',
'*/select',
|
Hours should not include leading 0s.
|
diff --git a/test.py b/test.py
index <HASH>..<HASH> 100644
--- a/test.py
+++ b/test.py
@@ -44,7 +44,7 @@ def setup():
if PROJECT_NAME in projlist:
logger.warn('The test database existed already. We have to clean it up.')
- PROJECT.delete()
+ ROOT_CLIENT.delete(USERNAME + '/projects', project=PROJECT_NAME)
# create the project
logger.info("Creating project: "+PROJECT_NAME)
@@ -123,7 +123,7 @@ def teardown():
Pack everything up, we're done.
"""
if ROOT_CLIENT is not None:
- ROOT_CLIENT.delete(USERNAME + '/projects/' + PROJECT_NAME)
+ ROOT_CLIENT.delete(USERNAME + '/projects', project=PROJECT_NAME)
PROJECT = ROOT_CLIENT.change_path(USERNAME + '/projects/' + PROJECT_NAME)
try:
got = PROJECT.get()
|
use the new delete endpoint in client testing
|
diff --git a/psphere/managedobjects.py b/psphere/managedobjects.py
index <HASH>..<HASH> 100644
--- a/psphere/managedobjects.py
+++ b/psphere/managedobjects.py
@@ -362,7 +362,8 @@ class ManagedEntity(ExtensibleManagedObject):
:returns: A list of ManagedEntity's matching the filter or None
:rtype: list
"""
- return server.find_entity_views(view_type=cls.__name__, filter=filter)
+ # TODO: Implement filter for this find method
+ return server.find_entity_views(view_type=cls.__name__)
@classmethod
def find_one(cls, server, filter=None):
|
Don't pass filter to find_entity_views as it isn't implemented yet.
|
diff --git a/turnstile/control.py b/turnstile/control.py
index <HASH>..<HASH> 100644
--- a/turnstile/control.py
+++ b/turnstile/control.py
@@ -196,7 +196,7 @@ class ControlDaemon(object):
continue
# Execute the desired command
- arglist = args.split(':')
+ arglist = args.split(':') if args else []
try:
func(self, *arglist)
except Exception:
|
Correct a long-standing bug
Commands with no arguments would still receive an empty argument.
Corrected this by setting arglist to [] if args is unset.
|
diff --git a/osx/versions.go b/osx/versions.go
index <HASH>..<HASH> 100644
--- a/osx/versions.go
+++ b/osx/versions.go
@@ -1,6 +1,11 @@
package osx
var versions = map[string]map[string]string{
+ "16.1.0": map[string]string{
+ "name": "Sierra",
+ "version": "10.12.1",
+ },
+
"16.0.0": map[string]string{
"name": "Sierra",
"version": "10.12.0",
|
Add support for Sierra <I>
|
diff --git a/flask_uwsgi_websocket/websocket.py b/flask_uwsgi_websocket/websocket.py
index <HASH>..<HASH> 100644
--- a/flask_uwsgi_websocket/websocket.py
+++ b/flask_uwsgi_websocket/websocket.py
@@ -87,13 +87,12 @@ class WebSocket(object):
uwsgi_args = ' '.join(['--{0} {1}'.format(k,v) for k,v in kwargs.items()])
args = 'uwsgi --http {0}:{1} --http-websockets {2} --wsgi {3}'.format(host, port, uwsgi_args, app)
- print(args)
-
# set enviromental variable to trigger adding debug middleware
if self.app.debug or debug:
args = 'FLASK_UWSGI_DEBUG=true {0} --python-autoreload 1'.format(args)
# run uwsgi with our args
+ print('Running: {0}'.format(args))
sys.exit(os.system(args))
def init_app(self, app):
|
Move print to include ENV & autoreload
|
diff --git a/test/root-no-tests.js b/test/root-no-tests.js
index <HASH>..<HASH> 100644
--- a/test/root-no-tests.js
+++ b/test/root-no-tests.js
@@ -1,6 +1,6 @@
// verify that just loading tap doesn't cause it to
// print out some TAP stuff, unless an actual thing happens.
-var t = require('tap')
+var t = require('../')
var spawn = require('child_process').spawn
switch (process.argv[2]) {
|
test: don't require('tap'), require('../')
For CI
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.