diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/android/src/com/google/zxing/client/android/ViewfinderView.java b/android/src/com/google/zxing/client/android/ViewfinderView.java
index <HASH>..<HASH> 100755
--- a/android/src/com/google/zxing/client/android/ViewfinderView.java
+++ b/android/src/com/google/zxing/client/android/ViewfinderView.java
@@ -155,7 +155,11 @@ public final class ViewfinderView extends View {
}
public void drawViewfinder() {
- resultBitmap = null;
+ Bitmap resultBitmap = this.resultBitmap;
+ this.resultBitmap = null;
+ if (resultBitmap != null) {
+ resultBitmap.recycle();
+ }
invalidate();
}
|
Fixed potential bug in not recycling bitmaps that I spied from BS+
git-svn-id: <URL>
|
diff --git a/foreverizer/foreverizer_windows.go b/foreverizer/foreverizer_windows.go
index <HASH>..<HASH> 100644
--- a/foreverizer/foreverizer_windows.go
+++ b/foreverizer/foreverizer_windows.go
@@ -8,13 +8,14 @@ import (
)
func userLoginInstall(opts Options) error {
+ ignitionPath := opts.IgnitionPath
key, err := registry.OpenKey(registry.CURRENT_USER, `Software\Microsoft\Windows\CurrentVersion\Run`, registry.WRITE)
if err != nil {
return err
}
- ignitionPath := fmt.Sprintf("\"%s\"", opts.IgnitionPath)
+ quotedIgnitionPath := fmt.Sprintf("\"%s\"", ignitionPath)
debug("writing registry key...")
- key.SetStringValue(opts.ServiceName, ignitionPath)
+ key.SetStringValue(opts.ServiceName, quotedIgnitionPath)
key.Close()
cmd := exec.Command(ignitionPath)
diff --git a/version.go b/version.go
index <HASH>..<HASH> 100644
--- a/version.go
+++ b/version.go
@@ -1,4 +1,4 @@
package main
// VERSION is the current application Version
-var VERSION = "15.0.3"
+var VERSION = "15.0.4"
|
<I> start unquoted path
|
diff --git a/spec/amount_spec.rb b/spec/amount_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/amount_spec.rb
+++ b/spec/amount_spec.rb
@@ -20,11 +20,11 @@ describe VirtualMerchant::Amount, "#amount" do
end
it "initializes with recurring data" do
- amount = VirtualMerchant::Amount.new(total: 10.99, next_payment_date: '10/30/13',
+ amount = VirtualMerchant::Amount.new(total: 10.99, next_payment_date: '10/30/2013',
billing_cycle: 'MONTHLY')
amount.total.should eq("10.99")
amount.tax.should eq("0.00")
- amount.next_payment_date.should eq("10/30/13")
+ amount.next_payment_date.should eq("10/30/2013")
amount.billing_cycle.should eq("MONTHLY")
amount.end_of_month.should eq("Y")
end
|
Changed date format in test to reflect correct format for billing_cycle
|
diff --git a/lib/diarize/speaker.rb b/lib/diarize/speaker.rb
index <HASH>..<HASH> 100644
--- a/lib/diarize/speaker.rb
+++ b/lib/diarize/speaker.rb
@@ -59,9 +59,17 @@ module Diarize
fr.lium.spkDiarization.libModel.Distance.GDMAP(speaker1.model, speaker2.model)
end
+ def self.match_sets(speakers1, speakers2)
+ matches = []
+ speakers1.each do |s1|
+ speakers2.each do |s2|
+ matches << [ s1, s2 ] if s1.same_speaker_as(s2)
+ end
+ end
+ matches
+ end
+
def self.match(speakers)
- speakers.each { |s| s.normalize! }
- speakers = speakers.select { |s| s.mean_log_likelihood > @@log_likelihood_threshold }
speakers.combination(2).select { |s1, s2| s1.same_speaker_as(s2) }
end
@@ -86,6 +94,7 @@ module Diarize
def same_speaker_as(other)
# Detection score defined in Ben2005
+ return unless [ self.mean_log_likelihood, other.mean_log_likelihood ].min > @@log_likelihood_threshold
self.normalize!
other.normalize!
detection_score = 1.0 - Speaker.divergence(other, self)
|
Adding match_set method to the Speaker class
|
diff --git a/lib/queue_classic/worker.rb b/lib/queue_classic/worker.rb
index <HASH>..<HASH> 100644
--- a/lib/queue_classic/worker.rb
+++ b/lib/queue_classic/worker.rb
@@ -31,9 +31,9 @@ module QC
# Define setup_child to hook into the forking process.
# Using setup_child is good for re-establishing database connections.
def fork_and_work
- @cpid = fork {setup_child; work}
- log(:at => :fork, :pid => @cpid)
- Process.wait(@cpid)
+ cpid = fork {setup_child; work}
+ log(:at => :fork, :pid => cpid)
+ Process.wait(cpid)
end
# This method will lock a job & process the job.
|
does not need to be ivar
|
diff --git a/simple_rest/response.py b/simple_rest/response.py
index <HASH>..<HASH> 100644
--- a/simple_rest/response.py
+++ b/simple_rest/response.py
@@ -65,7 +65,7 @@ class RESTfulResponse(object):
results = view_func(request, *args, **kwargs)
except HttpError, e:
results = (
- hasattr(e, 'message') and {'error': e.message} or None,
+ e.message and {'error': e.message} or None,
e.status
)
|
Fixed a small bug with HttpError objects and content negotiation
If the user was using content negotiation and threw an HttpError and
did not provide a message, None would be returned to the client rather
than just an empty message body. This commit fixes that issue.
|
diff --git a/src/Translation/TranslationFile.php b/src/Translation/TranslationFile.php
index <HASH>..<HASH> 100644
--- a/src/Translation/TranslationFile.php
+++ b/src/Translation/TranslationFile.php
@@ -512,6 +512,11 @@ class TranslationFile
} else {
if (isset($ctype[$getkey]) && $ctype[$getkey] !== '') {
$hinting[$key] = $ctype[$getkey];
+ } else {
+ $fallback = $this->app['translator']->trans($key, array(), 'contenttypes');
+ if ($fallback !== $key) {
+ $hinting[$key] = $fallback;
+ }
}
$newTranslations[$key] = '';
}
|
Use fallback language when no entry is found in contenttypes.yml
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -15,6 +15,7 @@ setup(name='grs',
author_email='toomore0929@gmail.com',
url='https://github.com/toomore/grs',
packages=['grs'],
+ package_data={'grs': ['*.csv']},
include_package_data=True,
license='MIT',
keywords="Taiwan Stock Exchange taipei twse otc gretai " + \
|
Add `package_data` include csv.
|
diff --git a/ibis/sql/postgres/tests/test_client.py b/ibis/sql/postgres/tests/test_client.py
index <HASH>..<HASH> 100644
--- a/ibis/sql/postgres/tests/test_client.py
+++ b/ibis/sql/postgres/tests/test_client.py
@@ -15,6 +15,7 @@
import os
import pandas as pd
+import pytest
from .common import PostgreSQLTests
from ibis.compat import unittest
@@ -85,11 +86,12 @@ class TestPostgreSQLClient(PostgreSQLTests, unittest.TestCase):
assert POSTGRES_TEST_DB in self.con.list_databases()
+@pytest.mark.postgresql
def test_metadata_is_per_table():
con = ibis.postgres.connect(host='localhost', database=POSTGRES_TEST_DB)
assert len(con.meta.tables) == 0
# assert that we reflect only when a table is requested
- t = con.table('functional_alltypes')
+ t = con.table('functional_alltypes') # noqa
assert 'functional_alltypes' in con.meta.tables
assert len(con.meta.tables) == 1
|
BUG: fix failing test when psycopg2 not installed
|
diff --git a/src/engine/blocks.js b/src/engine/blocks.js
index <HASH>..<HASH> 100644
--- a/src/engine/blocks.js
+++ b/src/engine/blocks.js
@@ -375,18 +375,14 @@ class Blocks {
const change = e.newContents_;
if (change.hasOwnProperty('minimized')) {
comment.minimized = change.minimized;
- break;
- } else if (change.hasOwnProperty('width') && change.hasOwnProperty('height')){
+ }
+ if (change.hasOwnProperty('width') && change.hasOwnProperty('height')){
comment.width = change.width;
comment.height = change.height;
- break;
- } else if (change.hasOwnProperty('text')) {
+ }
+ if (change.hasOwnProperty('text')) {
comment.text = change.text;
- break;
}
- log.warn(`Unrecognized comment change: ${
- JSON.stringify(change)} for comment with id: ${e.commentId}.`);
- return;
}
break;
case 'comment_move':
|
Let comment change event handler multitask.
|
diff --git a/utils/gh2k.py b/utils/gh2k.py
index <HASH>..<HASH> 100755
--- a/utils/gh2k.py
+++ b/utils/gh2k.py
@@ -265,15 +265,16 @@ if __name__ == '__main__':
git_index = "github_git"
issues_index = "github_issues"
- logging.info("Creating new GitHub dashboard with %i repositores from %s" %
- (args.nrepos, args.org))
# The owner could be a org or an user.
(owner_url, owner) = get_owner_repos_url(args.org, args.token)
+ logging.info("Creating new GitHub dashboard with %i repositores from %s" %
+ (args.nrepos, owner)
+
# Generate redirect web page first so dashboard can be used
# with partial data during data retrieval
- create_redirect_web_page(args.web_dir, args.org, args.kibana_url)
+ create_redirect_web_page(args.web_dir, owner, args.kibana_url)
repos = get_repositores(owner_url, args.token, args.nrepos)
first_repo = True
|
[gh2k.py] Fix in redirect web pages for new owner logic.
|
diff --git a/api/gw/gw.go b/api/gw/gw.go
index <HASH>..<HASH> 100644
--- a/api/gw/gw.go
+++ b/api/gw/gw.go
@@ -71,6 +71,7 @@ type GatewayStatsPacket struct {
Altitude float64 `json:"altitude"`
RXPacketsReceived int `json:"rxPacketsReceived"`
RXPacketsReceivedOK int `json:"rxPacketsReceivedOK"`
+ TXPacketsReceived int `json:"txPacketsReceived"`
TXPacketsEmitted int `json:"txPacketsEmitted"`
CustomData map[string]interface{} `json:"customData"` // custom fields defined by alternative packet_forwarder versions (e.g. TTN sends platform, contactEmail, and description)
}
|
Add TXPacketsReceived field to GatewayStatsPacket.
|
diff --git a/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php b/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php
index <HASH>..<HASH> 100644
--- a/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php
+++ b/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php
@@ -122,7 +122,7 @@ class SimpleObjectHydrator extends AbstractHydrator
}
// Check if value is null before conversion (because some types convert null to something else)
- $valueIsNull = $value === null;
+ $valueIsNull = null === $value;
// Convert field to a valid PHP value
if (isset($cacheKeyInfo['type'])) {
|
Use yoda condition in the null check
|
diff --git a/tools/debugging/matrix/generate_messages.py b/tools/debugging/matrix/generate_messages.py
index <HASH>..<HASH> 100755
--- a/tools/debugging/matrix/generate_messages.py
+++ b/tools/debugging/matrix/generate_messages.py
@@ -106,6 +106,8 @@ def logtime(msg: str, *args: Any, **kwargs: Any) -> Iterator[Dict[str, Any]]:
start = time.monotonic()
details: Dict[str, Any] = {}
+ log.info("Started: " + msg, *args, **kwargs, **details)
+
yield details
elapsed = time.monotonic() - start
|
Added started to logging
This is useful to count the number of concurrent requests that are
pending.
|
diff --git a/lib/reducers/create-user-reducer.js b/lib/reducers/create-user-reducer.js
index <HASH>..<HASH> 100644
--- a/lib/reducers/create-user-reducer.js
+++ b/lib/reducers/create-user-reducer.js
@@ -2,7 +2,12 @@ import update from 'immutability-helper'
// TODO: port user-specific code from the otp reducer.
function createUserReducer () {
- const initialState = {}
+ const initialState = {
+ accessToken: null,
+ loggedInUser: null,
+ loggedInUserMonitoredTrips: null,
+ pathBeforeSignIn: null
+ }
return (state = initialState, action) => {
switch (action.type) {
|
refactor(createUserReducer): Add initial user redux state.
|
diff --git a/cmd/juju/cloud/add_test.go b/cmd/juju/cloud/add_test.go
index <HASH>..<HASH> 100644
--- a/cmd/juju/cloud/add_test.go
+++ b/cmd/juju/cloud/add_test.go
@@ -312,6 +312,7 @@ func (*addSuite) TestInteractive(c *gc.C) {
c.Assert(out.String(), gc.Equals, ""+
"Cloud Types\n"+
+ " lxd\n"+
" maas\n"+
" manual\n"+
" openstack\n"+
|
Fix the failing test
Potentially this should be behind a feature flag
|
diff --git a/backend/servers/express-webrouter/app/src/render.js b/backend/servers/express-webrouter/app/src/render.js
index <HASH>..<HASH> 100644
--- a/backend/servers/express-webrouter/app/src/render.js
+++ b/backend/servers/express-webrouter/app/src/render.js
@@ -9,7 +9,7 @@ const packageConfig = JSON.parse(
fs.readFileSync(path.join(__dirname, '../../package.json'))
.toString('utf-8')
)
-const { SITE_NAME } = process.env
+const { TRACKING_ID, SITE_NAME } = process.env
let TELEPORT_WELCOME = {}
const teleportDir = path.join(__dirname, '../../config/teleport_welcome.json')
if (fs.existsSync(teleportDir)) {
@@ -48,7 +48,8 @@ export function useRender(app, config = {}) {
app.set('context', Object.assign(app.get('context') || {}, {
SITE_NAME,
TELEPORT_WELCOME,
- TELEPORT_WELCOME_STRING
+ TELEPORT_WELCOME_STRING,
+ TRACKING_ID
}, extraContext))
// render
res.render(indexFileDir, app.get('context'))
|
removed TELEPORT_WELCOM_STRING in render
|
diff --git a/p2p/muxer/mplex/multiplex.go b/p2p/muxer/mplex/multiplex.go
index <HASH>..<HASH> 100644
--- a/p2p/muxer/mplex/multiplex.go
+++ b/p2p/muxer/mplex/multiplex.go
@@ -3,8 +3,8 @@ package peerstream_multiplex
import (
"net"
- smux "github.com/libp2p/go-stream-muxer" // Conn is a connection to a remote peer.
- mp "github.com/whyrusleeping/go-multiplex" // Conn is a connection to a remote peer.
+ mp "github.com/libp2p/go-mplex" // Conn is a connection to a remote peer.
+ smux "github.com/libp2p/go-stream-muxer" // Conn is a connection to a remote peer.
)
type conn struct {
|
switch to the correct mplex package
|
diff --git a/chef/lib/chef/provider/template.rb b/chef/lib/chef/provider/template.rb
index <HASH>..<HASH> 100644
--- a/chef/lib/chef/provider/template.rb
+++ b/chef/lib/chef/provider/template.rb
@@ -19,6 +19,7 @@
require 'chef/provider/file'
require 'chef/mixin/template'
require 'chef/mixin/checksum'
+require 'chef/mixin/find_preferred_file'
require 'chef/rest'
require 'chef/file_cache'
require 'uri'
@@ -30,6 +31,7 @@ class Chef
include Chef::Mixin::Checksum
include Chef::Mixin::Template
+ include Chef::Mixin::FindPreferredFile
def action_create
Chef::Log.debug(@node.run_state.inspect)
|
Adding missing Chef::Mixin::FindPreferredFile
|
diff --git a/lib/qiita/client/users.rb b/lib/qiita/client/users.rb
index <HASH>..<HASH> 100644
--- a/lib/qiita/client/users.rb
+++ b/lib/qiita/client/users.rb
@@ -10,6 +10,10 @@ module Qiita
path = url_name ? "/users/#{url_name}/stocks" : '/stocks'
get path, params
end
+
+ def user(url_name)
+ get "/users/#{url_name}"
+ end
end
end
end
|
Impl the method to get user data
|
diff --git a/src/Google/Service/Bigquery.php b/src/Google/Service/Bigquery.php
index <HASH>..<HASH> 100644
--- a/src/Google/Service/Bigquery.php
+++ b/src/Google/Service/Bigquery.php
@@ -2876,6 +2876,7 @@ class Google_Service_Bigquery_Table extends Google_Model
public $id;
public $kind;
public $lastModifiedTime;
+ public $location;
public $numBytes;
public $numRows;
protected $schemaType = 'Google_Service_Bigquery_TableSchema';
@@ -2952,6 +2953,14 @@ class Google_Service_Bigquery_Table extends Google_Model
{
return $this->lastModifiedTime;
}
+ public function setLocation($location)
+ {
+ $this->location = $location;
+ }
+ public function getLocation()
+ {
+ return $this->location;
+ }
public function setNumBytes($numBytes)
{
$this->numBytes = $numBytes;
|
Updated Bigquery.php
This change has been generated by a script that has detected changes in the
discovery doc of the API.
Check <URL>
|
diff --git a/bin/extract_gene_seq.py b/bin/extract_gene_seq.py
index <HASH>..<HASH> 100755
--- a/bin/extract_gene_seq.py
+++ b/bin/extract_gene_seq.py
@@ -29,8 +29,7 @@ def start_logging(log_file='', log_level='INFO'):
if not log_file:
# create log directory if it doesn't exist
- file_dir = os.path.dirname(os.path.realpath(__file__))
- log_dir = os.path.join(file_dir, '../log/')
+ log_dir = os.path.abspath('log/')
if not os.path.isdir(log_dir):
os.mkdir(log_dir)
diff --git a/bin/permutation_test.py b/bin/permutation_test.py
index <HASH>..<HASH> 100755
--- a/bin/permutation_test.py
+++ b/bin/permutation_test.py
@@ -38,8 +38,7 @@ def start_logging(log_file='', log_level='INFO'):
"""
if not log_file:
# create log directory if it doesn't exist
- file_dir = os.path.dirname(os.path.realpath(__file__))
- log_dir = os.path.join(file_dir, '../log/')
+ log_dir = os.path.abspath('log/')
if not os.path.isdir(log_dir):
os.mkdir(log_dir)
|
Create automatic log file relative to the directory where users run a script rather than where the script is actually located. This prevents scripts in the installed python bin directory from having log output where the user can't find it.
|
diff --git a/websocket_server/websocket_server.py b/websocket_server/websocket_server.py
index <HASH>..<HASH> 100644
--- a/websocket_server/websocket_server.py
+++ b/websocket_server/websocket_server.py
@@ -157,8 +157,10 @@ class WebSocketHandler(StreamRequestHandler):
return bytes
def read_next_message(self):
-
- b1, b2 = self.read_bytes(2)
+ try:
+ b1, b2 = self.read_bytes(2)
+ except ValueError as e:
+ b1, b2 = 0, 0
fin = b1 & FIN
opcode = b1 & OPCODE
|
fixed force close error
When a client force close(such as CTRL+C), websocket server will show error because can't get next message.
|
diff --git a/lib/sambal/client.rb b/lib/sambal/client.rb
index <HASH>..<HASH> 100644
--- a/lib/sambal/client.rb
+++ b/lib/sambal/client.rb
@@ -31,7 +31,9 @@ module Sambal
options = parsed_options(user_options)
@timeout = options[:timeout].to_i
- option_flags = "-W \"#{options[:domain]}\" -U \"#{options[:user]}\" -I #{options[:ip_address]} -p #{options[:port]} -s /dev/null"
+ option_flags = "-W \"#{options[:domain]}\" -U \"#{options[:user]}\""
+ option_flags = "#{option_flags} -I #{options[:ip_address]}" if options[:ip_address]
+ option_flags = "#{option_flags} -p #{options[:port]} -s /dev/null"
password = options[:password] ? "'#{options[:password]}'" : "--no-pass"
command = "COLUMNS=#{options[:columns]} smbclient \"//#{options[:host]}/#{options[:share]}\" #{password}"
|
Fix the client options to work with the ip address thing.
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,9 @@ from distutils.core import setup
setup(
name = 'kem',
- packages = ['kem'],
+ packages=['kem'],
+ package_dir={'kem':'kem'},
+ package_data={'kem':['management/commands/*']},
version = '1.0',
description = 'A django App for kem',
author = ['davidtnfsh', 'theshaneyu'],
|
[Bug fix] add commands folder into package_dir
|
diff --git a/lxd/operations/response.go b/lxd/operations/response.go
index <HASH>..<HASH> 100644
--- a/lxd/operations/response.go
+++ b/lxd/operations/response.go
@@ -96,9 +96,16 @@ func (r *forwardedOperationResponse) Render(w http.ResponseWriter) error {
}
w.Header().Set("Location", url)
- w.WriteHeader(202)
- return util.WriteJSON(w, body, debug)
+ code := 202
+ w.WriteHeader(code)
+
+ var debugLogger logger.Logger
+ if debug {
+ debugLogger = logging.AddContext(logger.Log, log.Ctx{"http_code": code})
+ }
+
+ return util.WriteJSON(w, body, debugLogger)
}
func (r *forwardedOperationResponse) String() string {
|
lxd/operations/response: Adds util.WriteJSON support to forwardedOperationResponse
|
diff --git a/python/bigdl/dllib/nn/layer.py b/python/bigdl/dllib/nn/layer.py
index <HASH>..<HASH> 100644
--- a/python/bigdl/dllib/nn/layer.py
+++ b/python/bigdl/dllib/nn/layer.py
@@ -1648,6 +1648,27 @@ class CosineDistance(Layer):
bigdl_type="float"):
super(CosineDistance, self).__init__(None, bigdl_type)
+class Input(Node):
+
+ '''
+ Input layer do nothing to the input tensors, just passing them through. It is used as input to
+ the Graph container (add a link) when the first layer of the graph container accepts multiple
+ tensors as inputs.
+
+ Each input node of the graph container should accept one tensor as input. If you want a module
+ accepting multiple tensors as input, you should add some Input module before it and connect
+ the outputs of the Input nodes to it.
+
+ Please note that the return is not a layer but a Node containing input layer.
+
+ >>> input = Input()
+ creating: createInput
+ '''
+
+ def __init__(self,
+ bigdl_type="float"):
+ super(Input, self).__init__(None, bigdl_type)
+
class DotProduct(Layer):
|
Graph doc (#<I>)
* Add Input docs
* fix bugs
* meet code review
|
diff --git a/tests/functional-sdk/conftest.py b/tests/functional-sdk/conftest.py
index <HASH>..<HASH> 100644
--- a/tests/functional-sdk/conftest.py
+++ b/tests/functional-sdk/conftest.py
@@ -8,12 +8,12 @@ from lago_fixtures import ( # noqa: F401
_local_config = {
'check_patch': {
- 'images': ['el7.5-base']
+ 'images': ['el7.6-base-2']
},
'check_merged':
{
'images': [
- 'el7.5-base',
+ 'el7.6-base-2',
'el6-base',
'fc28-base',
'fc29-base',
|
func-tests: Update Centos image to <I>
|
diff --git a/src/sos/step_executor.py b/src/sos/step_executor.py
index <HASH>..<HASH> 100755
--- a/src/sos/step_executor.py
+++ b/src/sos/step_executor.py
@@ -1136,6 +1136,8 @@ class Base_Step_Executor:
self.shared_vars[env.sos_dict['_index']].update(matched["vars"])
# complete case: local skip without task
env.controller_push_socket.send_pyobj(['progress', 'substep_ignored', env.sos_dict['step_id']])
+ # do not execute the rest of the statement
+ break
else:
sig.lock()
try:
|
Fix execution of statements after successful signature validation in one case. #<I>
|
diff --git a/executor/explain_test.go b/executor/explain_test.go
index <HASH>..<HASH> 100644
--- a/executor/explain_test.go
+++ b/executor/explain_test.go
@@ -20,6 +20,7 @@ import (
"strings"
"testing"
+ "github.com/pingcap/tidb/config"
"github.com/pingcap/tidb/parser/auth"
plannercore "github.com/pingcap/tidb/planner/core"
"github.com/pingcap/tidb/session"
@@ -296,6 +297,10 @@ func checkActRows(t *testing.T, tk *testkit.TestKit, sql string, expected []stri
}
func TestCheckActRowsWithUnistore(t *testing.T) {
+ defer config.RestoreFunc()()
+ config.UpdateGlobal(func(conf *config.Config) {
+ conf.EnableCollectExecutionInfo = true
+ })
store, clean := testkit.CreateMockStore(t)
defer clean()
// testSuite1 use default mockstore which is unistore
|
executor: fix unstable TestCheckActRowsWithUnistore (#<I>)
close pingcap/tidb#<I>
|
diff --git a/spec/views/hyrax/base/_form_share.erb_spec.rb b/spec/views/hyrax/base/_form_share.erb_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/views/hyrax/base/_form_share.erb_spec.rb
+++ b/spec/views/hyrax/base/_form_share.erb_spec.rb
@@ -1,6 +1,7 @@
# frozen_string_literal: true
RSpec.describe 'hyrax/base/_form_share.html.erb', type: :view do
- let(:ability) { double }
+ let(:ability) { instance_double(Ability, admin?: false, user_groups: [], current_user: user) }
+ let(:user) { stub_model(User) }
let(:work) { GenericWork.new }
let(:form) do
Hyrax::GenericWorkForm.new(work, ability, controller)
@@ -24,10 +25,8 @@ RSpec.describe 'hyrax/base/_form_share.html.erb', type: :view do
end
before do
- user = stub_model(User)
allow(view).to receive(:current_ability).and_return(ability)
allow(view).to receive(:current_user).and_return(user)
- allow(ability).to receive(:admin?).and_return(false)
allow(view).to receive(:action_name).and_return('new')
end
|
Fixing spec to account for upstream changes
The previous commit (fde<I>eeb<I>cb8ed<I>ed<I>f<I>c5da3f<I>ef) was
worked on over a year ago, and recently re-opened and rebased against
the main branch.
In that time, aspects of the implementation have changed.
|
diff --git a/src/drawer.js b/src/drawer.js
index <HASH>..<HASH> 100644
--- a/src/drawer.js
+++ b/src/drawer.js
@@ -228,8 +228,7 @@ $.Drawer.prototype = {
}
if( this.viewer ){
this.viewer.raiseEvent( 'clear-overlay', {
- viewer: this.viewer,
- element: element
+ viewer: this.viewer
});
}
return this;
@@ -583,8 +582,8 @@ function updateLevel( drawer, haveDrawn, level, levelOpacity, levelVisibility, v
level: level,
opacity: levelOpacity,
visibility: levelVisibility,
- topleft: viewportTopLeft,
- bottomright: viewportBottomRight,
+ topleft: viewportTL,
+ bottomright: viewportBR,
currenttime: currentTime,
best: best
});
|
Fixed broken viewer.raiseEvent calls in drawer.js
|
diff --git a/holoviews/operation/element.py b/holoviews/operation/element.py
index <HASH>..<HASH> 100644
--- a/holoviews/operation/element.py
+++ b/holoviews/operation/element.py
@@ -316,8 +316,12 @@ class gradient(ElementOperation):
dx = np.diff(data, 1, axis=1)[0:r-1, 0:c-1]
dy = np.diff(data, 1, axis=0)[0:r-1, 0:c-1]
+ if matrix_dim.cyclic and (None in matrix_dim.range):
+ raise Exception("Cyclic range must be specified to compute "
+ "the gradient of cyclic quantities")
cyclic_range = None if not matrix_dim.cyclic else np.diff(matrix_dim.range)
if cyclic_range is not None: # Wrap into the specified range
+ raise NotImplementedError("Cyclic ranges are not supported currently")
# shift values such that wrapping works ok
dx += matrix_dim.range[0]
dy += matrix_dim.range[0]
|
More checks on cyclic ranges, but still not supported in gradient
|
diff --git a/ee/src/main/java/org/jboss/as/ee/structure/EJBClientDescriptor10Parser.java b/ee/src/main/java/org/jboss/as/ee/structure/EJBClientDescriptor10Parser.java
index <HASH>..<HASH> 100644
--- a/ee/src/main/java/org/jboss/as/ee/structure/EJBClientDescriptor10Parser.java
+++ b/ee/src/main/java/org/jboss/as/ee/structure/EJBClientDescriptor10Parser.java
@@ -246,6 +246,11 @@ class EJBClientDescriptor10Parser implements XMLElementReader<EJBClientDescripto
if (!required.isEmpty()) {
missingAttributes(reader.getLocation(), required);
}
+ // This element is just composed of attributes which we already processed, so no more content
+ // is expected
+ if (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
+ unexpectedContent(reader);
+ }
}
private static void unexpectedEndOfDocument(final Location location) throws XMLStreamException {
|
fix parse fail when jboss-ejb-client.xml has multiple
remote-ejb-receiver element
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -47,7 +47,7 @@ setup(
'requests'
],
extras_require={
- 'test': ['tox', 'pytest', 'flake8', 'responses', 'mock'],
+ 'test': ['tox', 'pytest', 'flake8', 'responses'],
'doc': ['Sphinx==1.4.6', 'sphinx-rtd-theme==0.1.9', 'sphinxcontrib-napoleon==0.5.3'],
}
)
diff --git a/test/client_test.py b/test/client_test.py
index <HASH>..<HASH> 100644
--- a/test/client_test.py
+++ b/test/client_test.py
@@ -1,7 +1,6 @@
import pytest
import responses
import json
-from mock import MagicMock
from matrix_client.client import MatrixClient, Room, User
from matrix_client.api import MATRIX_V2_API_PATH
|
Remove unneeded test dependency on mock package
|
diff --git a/lib/qyu/store/base.rb b/lib/qyu/store/base.rb
index <HASH>..<HASH> 100644
--- a/lib/qyu/store/base.rb
+++ b/lib/qyu/store/base.rb
@@ -94,6 +94,10 @@ module Qyu
fail Qyu::Errors::NotImplementedError
end
+ def task_status_counts(_job_id)
+ fail Qyu::Errors::NotImplementedError
+ end
+
def select_tasks_by_job_id
fail Qyu::Errors::NotImplementedError
end
|
Add task_status_counts to store interface
|
diff --git a/src/plugins/Transloadit/index.js b/src/plugins/Transloadit/index.js
index <HASH>..<HASH> 100644
--- a/src/plugins/Transloadit/index.js
+++ b/src/plugins/Transloadit/index.js
@@ -282,6 +282,10 @@ module.exports = class Transloadit extends Plugin {
// A file ID that is part of this assembly...
const fileID = fileIDs[0]
+ if (!fileID) {
+ return Promise.resolve()
+ }
+
// If we don't have to wait for encoding metadata or results, we can close
// the socket immediately and finish the upload.
if (!this.shouldWait()) {
diff --git a/test/unit/Transloadit.spec.js b/test/unit/Transloadit.spec.js
index <HASH>..<HASH> 100644
--- a/test/unit/Transloadit.spec.js
+++ b/test/unit/Transloadit.spec.js
@@ -149,3 +149,19 @@ test('Transloadit: Should merge files with same parameters into one assembly', (
})
}, t.fail)
})
+
+test('Does not create an assembly if no files are being uploaded', (t) => {
+ t.plan(0)
+
+ const uppy = new Core()
+ uppy.use(Transloadit, {
+ getAssemblyOptions () {
+ t.fail('should not create assembly')
+ }
+ })
+ uppy.run()
+
+ uppy.upload().then(() => {
+ t.end()
+ }).catch(t.fail)
+})
|
transloadit: Fix crash when no files are being uploaded
|
diff --git a/faker/providers/misc/__init__.py b/faker/providers/misc/__init__.py
index <HASH>..<HASH> 100644
--- a/faker/providers/misc/__init__.py
+++ b/faker/providers/misc/__init__.py
@@ -4,6 +4,7 @@ from __future__ import unicode_literals
import hashlib
import random
import string
+import uuid
from faker.providers.date_time import Provider as DatetimeProvider
@@ -70,6 +71,13 @@ class Provider(BaseProvider):
return cls.random_element(cls.language_codes)
@classmethod
+ def uuid4(cls):
+ """
+ Generates a random UUID4 string.
+ """
+ return str(uuid.uuid4())
+
+ @classmethod
def password(cls, length=10, special_chars=True, digits=True, upper_case=True, lower_case=True):
"""
Generates a random password.
|
Adds uuid support
|
diff --git a/src/_parsers.py b/src/_parsers.py
index <HASH>..<HASH> 100644
--- a/src/_parsers.py
+++ b/src/_parsers.py
@@ -376,7 +376,8 @@ def _is_allowed(input):
'--export',
'--export-secret-keys',
'--export-secret-subkeys',
- '--fingerprint',])
+ '--fingerprint',
+ ])
## check that allowed is a subset of possible
try:
|
Minor and unnecessary obsessive compulsive code formatting change.
|
diff --git a/framework/core/js/lib/components/badge.js b/framework/core/js/lib/components/badge.js
index <HASH>..<HASH> 100644
--- a/framework/core/js/lib/components/badge.js
+++ b/framework/core/js/lib/components/badge.js
@@ -6,10 +6,12 @@ export default class Badge extends Component {
var iconName = this.props.icon;
var label = this.props.title = this.props.label;
delete this.props.icon, this.props.label;
- this.props.config = function(element) {
+ this.props.config = function(element, isInitialized) {
+ if (isInitialized) return;
$(element).tooltip();
};
this.props.className = 'badge '+(this.props.className || '');
+ this.props.key = this.props.className;
return m('span', this.props, [
icon(iconName+' icon-glyph'),
|
Prevent incorrect badge redraw diffing
|
diff --git a/actionpack/test/controller/force_ssl_test.rb b/actionpack/test/controller/force_ssl_test.rb
index <HASH>..<HASH> 100644
--- a/actionpack/test/controller/force_ssl_test.rb
+++ b/actionpack/test/controller/force_ssl_test.rb
@@ -229,14 +229,12 @@ class ForceSSLFlashTest < ActionController::TestCase
assert_response 302
assert_equal "http://test.host/force_ssl_flash/cheeseburger", redirect_to_url
- # FIXME: AC::TestCase#build_request_uri doesn't build a new uri if PATH_INFO exists
@request.env.delete("PATH_INFO")
get :cheeseburger
assert_response 301
assert_equal "https://test.host/force_ssl_flash/cheeseburger", redirect_to_url
- # FIXME: AC::TestCase#build_request_uri doesn't build a new uri if PATH_INFO exists
@request.env.delete("PATH_INFO")
get :use_flash
|
Remove unneeded FIXME note
This is the intended behavior. You should not do more than one request
in a controller test.
|
diff --git a/spec/lib/compiler_spec.rb b/spec/lib/compiler_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/lib/compiler_spec.rb
+++ b/spec/lib/compiler_spec.rb
@@ -44,7 +44,7 @@ describe Opal::Compiler do
end
it 'adds method missing stubs with operators' do
- expect_compiled("class Foo; end; Foo.new > 5").to include("Opal.add_stubs(['$new', '$>'])")
+ expect_compiled("class Foo; end; Foo.new > 5").to include("Opal.add_stubs(['$>', '$new'])")
end
it "should compile constant lookups" do
|
Reverse test order since impl was done in different order than original PR
|
diff --git a/panels/_version.py b/panels/_version.py
index <HASH>..<HASH> 100644
--- a/panels/_version.py
+++ b/panels/_version.py
@@ -1,2 +1,2 @@
# Versions compliant with PEP 440 https://www.python.org/dev/peps/pep-0440
-__version__ = "0.0.37"
+__version__ = "0.0.38"
|
Update version number to <I>
|
diff --git a/src/Entity/Status/StatusAwareEntityInterface.php b/src/Entity/Status/StatusAwareEntityInterface.php
index <HASH>..<HASH> 100644
--- a/src/Entity/Status/StatusAwareEntityInterface.php
+++ b/src/Entity/Status/StatusAwareEntityInterface.php
@@ -6,7 +6,7 @@
* @license MIT
* @copyright 2013 - 2017 Cross Solution <http://cross-solution.de>
*/
-
+
/** */
namespace Core\Entity\Status;
@@ -19,13 +19,6 @@ namespace Core\Entity\Status;
interface StatusAwareEntityInterface
{
/**
- * FQCN of the concrete status entity for this entity.
- *
- * @var string
- */
- const STATUS_ENTITY_CLASS = StatusInterface::class;
-
- /**
* Set the state of this entity.
*
* * If a string is passed, {@łink STATUS_ENTITY_CLASS} is used
|
fix(Core): StatusAwareEntityInterface must not define constant.
in PHP constants defined in interfaces cannot be overridden by implementing classes.
This behaviour is essential to the function of the StatusAwareEntityTrait however.
|
diff --git a/plugin/Storagebox/AccessMethods/Methods/SFTP/SFTPConnection.php b/plugin/Storagebox/AccessMethods/Methods/SFTP/SFTPConnection.php
index <HASH>..<HASH> 100644
--- a/plugin/Storagebox/AccessMethods/Methods/SFTP/SFTPConnection.php
+++ b/plugin/Storagebox/AccessMethods/Methods/SFTP/SFTPConnection.php
@@ -71,10 +71,10 @@ class SFTPConnection {
public function receiveFile($remote_file)
{
$sftp = $this->sftp;
- $stream = @fopen("ssh2.sftp://$sftp$remote_file", 'r');
+ $stream = @fopen("ssh2.sftp://".intval($sftp)."$remote_file", 'r');
if (! $stream)
throw new Exception("Could not open file: $remote_file");
- $contents = fread($stream, filesize("ssh2.sftp://$sftp$remote_file"));
+ $contents = fread($stream, filesize("ssh2.sftp://".intval($sftp)."$remote_file"));
@fclose($stream);
return $contents;
}
|
added intval to sftpconnection
|
diff --git a/src/Lavary/Menu/Builder.php b/src/Lavary/Menu/Builder.php
index <HASH>..<HASH> 100644
--- a/src/Lavary/Menu/Builder.php
+++ b/src/Lavary/Menu/Builder.php
@@ -466,7 +466,7 @@ class Builder
public function sortBy($sort_by, $sort_type = 'asc')
{
if (is_callable($sort_by)) {
- $rslt = call_user_func($sort_by, $this->items->to[]);
+ $rslt = call_user_func($sort_by, $this->items->toArray());
if (!is_array($rslt)) {
$rslt = array($rslt);
|
Fix bug introduced by docblock cleanup
Docblock cleanup c9be1d2e<I>cde4c<I>c<I>d<I> introduced a bug when converting `toArray()` to `to[]`
|
diff --git a/redis/client.py b/redis/client.py
index <HASH>..<HASH> 100755
--- a/redis/client.py
+++ b/redis/client.py
@@ -2892,9 +2892,18 @@ class Redis:
the existing score will be incremented by. When using this mode the
return value of ZADD will be the new score of the element.
+ ``LT`` Only update existing elements if the new score is less than
+ the current score. This flag doesn't prevent adding new elements.
+
+ ``GT`` Only update existing elements if the new score is greater than
+ the current score. This flag doesn't prevent adding new elements.
+
The return value of ZADD varies based on the mode specified. With no
options, ZADD returns the number of new elements added to the sorted
set.
+
+ ``NX``, ``LT``, and ``GT`` are mutually exclusive options.
+ See: https://redis.io/commands/ZADD
"""
if not mapping:
raise DataError("ZADD requires at least one element/score pair")
@@ -2904,7 +2913,9 @@ class Redis:
raise DataError("ZADD option 'incr' only works when passing a "
"single element/score pair")
if nx is True and (gt is not None or lt is not None):
- raise DataError("Only one of 'nx', 'lt', or 'gr' may be defined.")
+ raise DataError("Only one of 'nx', 'lt', or 'gt' may be defined.")
+ if gt is not None and lt is not None:
+ raise DataError("Only one of 'gt' or 'lt' can be set.")
pieces = []
options = {}
|
exclusive gt and lt in zadd (#<I>)
* exclusive gt and lt in zadd
* docs update
|
diff --git a/consume.js b/consume.js
index <HASH>..<HASH> 100644
--- a/consume.js
+++ b/consume.js
@@ -1,9 +1,10 @@
module.exports = consume;
-// conusme( (Error) => void, (T) => void ) => Callback<T>
+// conusme( (Error) => Any, (T) => Any ) => (Error, T) => Any
function consume(onError, onData) {
return function(err, val) {
- if (err) return onError(err)
- else return onData(val)
+ return err
+ ? onError(err)
+ : onData(val)
}
}
|
Stylechange, makes it more clear that returned function
always returns something.
|
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
@@ -2463,6 +2463,8 @@ def check_nonligated_sequences_kerning_info(ttFont, ligatures, has_kerning_info)
for pairpos in table.SubTable:
for i, glyph in enumerate(pairpos.Coverage.glyphs):
if glyph in ligatures.keys():
+ if not hasattr(pairpos, 'PairSet'):
+ continue
for pairvalue in pairpos.PairSet[i].PairValueRecord:
if pairvalue.SecondGlyph in ligatures[glyph]:
del remaining[glyph]
|
[check-googlefonts] don't ERROR when 'PairPos' attribute is not present.
|
diff --git a/src/basis.js b/src/basis.js
index <HASH>..<HASH> 100644
--- a/src/basis.js
+++ b/src/basis.js
@@ -2522,7 +2522,10 @@
// if resource exists and resolved -> apply patch
var resource = getResource.get(filename);
if (resource && resource.isResolved())
+ {
+ /** @cut */ consoleMethods.info('Apply patch for ' + resource.url);
patchFn(resource.get(), resource.url);
+ }
}
|
core: fix basis.patch to notify when patch apply to resolved resource
|
diff --git a/test/test_hexahedron.py b/test/test_hexahedron.py
index <HASH>..<HASH> 100644
--- a/test/test_hexahedron.py
+++ b/test/test_hexahedron.py
@@ -56,7 +56,7 @@ def test_normality(n=4):
def test_write():
orthopy.hexahedron.write(
- "hexa.vtu", lambda X: orthopy.hexahedron.tree(X.T, 5)[5][5]
+ "hexa.vtk", lambda X: orthopy.hexahedron.tree(X.T, 5)[5][5]
)
return
diff --git a/test/test_sphere_sph.py b/test/test_sphere_sph.py
index <HASH>..<HASH> 100644
--- a/test/test_sphere_sph.py
+++ b/test/test_sphere_sph.py
@@ -163,7 +163,7 @@ def test_write():
out = abs(out)
return out
- orthopy.sphere.write("sph.vtu", sph22)
+ orthopy.sphere.write("sph.vtk", sph22)
return
|
test: vtu -> vtk
|
diff --git a/lib/classes/module/console/checkExtension.class.php b/lib/classes/module/console/checkExtension.class.php
index <HASH>..<HASH> 100644
--- a/lib/classes/module/console/checkExtension.class.php
+++ b/lib/classes/module/console/checkExtension.class.php
@@ -44,7 +44,7 @@ class module_console_checkExtension extends Command
if (!extension_loaded('phrasea2'))
printf("Missing Extension php-phrasea");
- $appbox = \appbox::get_instance();
+ $appbox = \appbox::get_instance(\bootstrap::getCore());
$registry = $appbox->get_registry();
$usr_id = $input->getOption('usr_id');
diff --git a/lib/classes/module/console/systemExport.class.php b/lib/classes/module/console/systemExport.class.php
index <HASH>..<HASH> 100644
--- a/lib/classes/module/console/systemExport.class.php
+++ b/lib/classes/module/console/systemExport.class.php
@@ -139,7 +139,7 @@ class module_console_systemExport extends Command
$output->writeln("Export datas from selected base_ids");
}
- $appbox = \appbox::get_instance();
+ $appbox = \appbox::get_instance(\bootstrap::getCore());
$total = $errors = 0;
|
Fix tasks for <I>+
|
diff --git a/core/dbt/context/parser.py b/core/dbt/context/parser.py
index <HASH>..<HASH> 100644
--- a/core/dbt/context/parser.py
+++ b/core/dbt/context/parser.py
@@ -111,14 +111,13 @@ class SourceResolver(dbt.context.common.BaseResolver):
def __call__(self, *args):
# When you call source(), this is what happens at parse time
if len(args) == 2:
- source_name = args[0]
- table_name = args[1]
+ self.model.sources.append(list(args))
+
else:
dbt.exceptions.raise_compiler_error(
- "Source requires exactly two arguments",
+ "source() takes at exactly two arguments ({} given)".format(len(args)),
self.model)
- self.model.sources.append([source_name, table_name])
return self.Relation.create_from(self.config, self.model)
|
refactor to make more similar to RefResolver
|
diff --git a/packer/rpc/muxconn.go b/packer/rpc/muxconn.go
index <HASH>..<HASH> 100644
--- a/packer/rpc/muxconn.go
+++ b/packer/rpc/muxconn.go
@@ -300,10 +300,14 @@ func (m *MuxConn) loop() {
case streamStateFinWait2:
stream.remoteClose()
- // Remove this stream from being active so that it
- // can be re-used
m.mu.Lock()
delete(m.streams, stream.id)
+
+ // Make sure we attempt to use the next biggest stream ID
+ if stream.id >= m.curId {
+ m.curId = stream.id + 1
+ }
+
m.mu.Unlock()
default:
log.Printf("[ERR] Fin received for stream %d in state: %d", id, stream.state)
|
packer/rpc: make sure curID in MuxConn is highest [GH-<I>]
|
diff --git a/slave/signal_recovery/sr7230.py b/slave/signal_recovery/sr7230.py
index <HASH>..<HASH> 100644
--- a/slave/signal_recovery/sr7230.py
+++ b/slave/signal_recovery/sr7230.py
@@ -439,6 +439,17 @@ class SR7230(Driver):
'500 fA', '1 pA', '2 pA', '5 pA', '10 pA', '20 pA', '50 pA', '100 pA',
'200 pA', '500 pA', '1 nA', '2 nA', '5 nA', '10 nA'
]
+
+ @property
+ def SENSITIVITY(self):
+ imode = self.current_mode
+ if imode == 'off':
+ return self.SENSITIVITY_VOLTAGE
+ elif imode == 'high bandwidth':
+ return self.SENSITIVITY_CURRENT_HIGHBW
+ else:
+ return self.SENSITIVITY_CURRENT_LOWNOISE
+
AC_GAIN = [
'0 dB', '6 dB', '12 dB', '18 dB', '24 dB', '30 dB', '36 dB', '42 dB',
'48 dB', '54 dB', '60 dB', '66 dB', '72 dB', '78 dB', '84 dB', '90 dB'
|
Added SENSITIVITY property to `SR<I>` driver, returning the appropriate sensitivity ranges.
|
diff --git a/mldb/index.py b/mldb/index.py
index <HASH>..<HASH> 100644
--- a/mldb/index.py
+++ b/mldb/index.py
@@ -4,7 +4,7 @@
# @Email: atremblay@datacratic.com
# @Date: 2015-03-19 10:28:23
# @Last Modified by: Alexis Tremblay
-# @Last Modified time: 2015-04-09 13:31:45
+# @Last Modified time: 2015-04-09 14:44:44
# @File Name: index.py
from mldb.query import Query
@@ -42,5 +42,13 @@ class Index(object):
copy_bf = self._bf.copy()
copy_bf.query.addWHERE("rowName()='{}'".format(val))
return copy_bf
+ elif isinstance(val, list):
+ copy_bf = self._bf.copy()
+ where = []
+ for v in val:
+ where.append("rowName()='{}'".format(v))
+
+ copy_bf.query.addWHERE("({})".format(" OR ".join(where)))
+ return copy_bf
else:
raise NotImplementedError()
|
Supporting list in the ix method
|
diff --git a/Zebra_Image.php b/Zebra_Image.php
index <HASH>..<HASH> 100644
--- a/Zebra_Image.php
+++ b/Zebra_Image.php
@@ -707,16 +707,16 @@ class Zebra_Image {
*
* When set to -1 the script will preserve transparency for transparent GIF
* and PNG images. For non-transparent images the background will be white
- * in this case.
+ * (#FFFFFF) in this case.
*
- * Default is #FFFFFF.
+ * Default is -1
*
* @return boolean Returns TRUE on success or FALSE on error.
*
* If FALSE is returned, check the {@link error} property to see what went
* wrong
*/
- public function resize($width = 0, $height = 0, $method = ZEBRA_IMAGE_CROP_CENTER, $background_color = '#FFFFFF') {
+ public function resize($width = 0, $height = 0, $method = ZEBRA_IMAGE_CROP_CENTER, $background_color = -1) {
// if image resource was successfully created
if ($this->_create_from_source()) {
|
The default value of the "background_color" argument of the "resize" method is now -1
|
diff --git a/examples/basic/buildmesh.py b/examples/basic/buildmesh.py
index <HASH>..<HASH> 100644
--- a/examples/basic/buildmesh.py
+++ b/examples/basic/buildmesh.py
@@ -15,4 +15,4 @@ a.backColor('violet').lineColor('black').lineWidth(1)
print('getCells() format is :', a.getCells())
print('getConnectivity() format is:', a.getConnectivity())
-show(a, Text(__doc__), viewup='z', axes=8)
\ No newline at end of file
+show(a, Text(__doc__), viewup='z', axes=8)
|
Removed trailing spaces in examples/basic/buildmesh.py
|
diff --git a/lib/nydp.rb b/lib/nydp.rb
index <HASH>..<HASH> 100644
--- a/lib/nydp.rb
+++ b/lib/nydp.rb
@@ -19,6 +19,7 @@ module Nydp
ns = { }
setup(ns)
loadall ns, loadfiles
+ loadall ns, testfiles
loadall ns, extra_files if extra_files
ns
end
@@ -47,7 +48,7 @@ module Nydp
verbose = options.include?(:verbose) ? "t" : "nil"
puts "welcome to nydp : running tests"
reader = Nydp::StringReader.new "(run-all-tests #{verbose})"
- Nydp::Runner.new(VM.new, build_nydp(testfiles), reader).run
+ Nydp::Runner.new(VM.new, build_nydp, reader).run
end
end
|
testing: always load testfiles, so examples are available for inspection at all times
|
diff --git a/graphene_django/utils/testing.py b/graphene_django/utils/testing.py
index <HASH>..<HASH> 100644
--- a/graphene_django/utils/testing.py
+++ b/graphene_django/utils/testing.py
@@ -28,7 +28,9 @@ def graphql_query(
variables (dict) - If provided, the "variables" field in GraphQL will be
set to this value.
headers (dict) - If provided, the headers in POST request to GRAPHQL_URL
- will be set to this value.
+ will be set to this value. Keys should be prepended with
+ "HTTP_" (e.g. to specify the "Authorization" HTTP header,
+ use "HTTP_AUTHORIZATION" as the key).
client (django.test.Client) - Test client. Defaults to django.test.Client.
graphql_url (string) - URL to graphql endpoint. Defaults to "/graphql".
@@ -85,7 +87,9 @@ class GraphQLTestCase(TestCase):
variables (dict) - If provided, the "variables" field in GraphQL will be
set to this value.
headers (dict) - If provided, the headers in POST request to GRAPHQL_URL
- will be set to this value.
+ will be set to this value. Keys should be prepended with
+ "HTTP_" (e.g. to specify the "Authorization" HTTP header,
+ use "HTTP_AUTHORIZATION" as the key).
Returns:
Response object from client
|
Doc clarification for headers arg in testing utils (#<I>)
I think it might be helpful to add an explicit hint that HTTP headers should be prepended with `HTTP_` as required by `django.test.Client` (at least it was not super obvious to me when I tried to use it).
|
diff --git a/src/js/components/Select/Select.js b/src/js/components/Select/Select.js
index <HASH>..<HASH> 100644
--- a/src/js/components/Select/Select.js
+++ b/src/js/components/Select/Select.js
@@ -83,7 +83,7 @@ const Select = forwardRef(
const inputRef = useRef();
const formContext = useContext(FormContext);
- const [value] = formContext.useFormContext(name, valueProp);
+ const [value, setValue] = formContext.useFormContext(name, valueProp);
const [open, setOpen] = useState(propOpen);
useEffect(() => {
@@ -106,6 +106,7 @@ const Select = forwardRef(
const onSelectChange = (event, ...args) => {
if (closeOnChange) onRequestClose();
+ setValue(event.value);
if (onChange) onChange({ ...event, target: inputRef.current }, ...args);
};
|
fix: select dropdown entry when the input isnt controlled (#<I>)
In <I>, when using a select without passing value as a prop, selecting
a dropdown entry won't update the Select component to have that entry
selected. This sets the value using `setValue` from the `useFormContext` hook.
|
diff --git a/restcomm/restcomm.telephony/src/main/java/org/restcomm/connect/telephony/Call.java b/restcomm/restcomm.telephony/src/main/java/org/restcomm/connect/telephony/Call.java
index <HASH>..<HASH> 100644
--- a/restcomm/restcomm.telephony/src/main/java/org/restcomm/connect/telephony/Call.java
+++ b/restcomm/restcomm.telephony/src/main/java/org/restcomm/connect/telephony/Call.java
@@ -1263,6 +1263,11 @@ public final class Call extends UntypedActor {
if(logger.isInfoEnabled()) {
logger.info("Completing Call sid: "+id+" from: "+from+" to: "+to+" direction: "+direction+" current external state: "+external);
}
+ if (conferencing) {
+ // Tell conference to remove the call from participants list
+ // before moving to a stopping state
+ conference.tell(new RemoveParticipant(self()), self());
+ }
//In the case of canceled that reach the completed method, don't change the external state
if (!external.equals(CallStateChanged.State.CANCELED)) {
|
notify conference to remove participant when hungup cam from outside
|
diff --git a/django_tenants/log.py b/django_tenants/log.py
index <HASH>..<HASH> 100644
--- a/django_tenants/log.py
+++ b/django_tenants/log.py
@@ -10,5 +10,5 @@ class TenantContextFilter(logging.Filter):
"""
def filter(self, record):
record.schema_name = connection.tenant.schema_name
- record.domain_url = getattr(connection.tenant, 'domain_url', '')
+ record.domain_url = getattr(connection.tenant, 'domain_url', 'none')
return True
|
Update log.py
it would be better for logging output to use a string that indicates blank/not set/ etc than an empty string
|
diff --git a/bsdploy/__init__.py b/bsdploy/__init__.py
index <HASH>..<HASH> 100644
--- a/bsdploy/__init__.py
+++ b/bsdploy/__init__.py
@@ -54,14 +54,19 @@ class PloyConfigureHostCmd(object):
add_help=False,
)
masters = dict((master.id, master) for master in self.aws.get_masters('ezjail_admin'))
- parser.add_argument(
- "master",
- nargs=1,
- metavar="master",
- help="Name of the jailhost from the config.",
- choices=masters)
+ if len(masters) > 1:
+ parser.add_argument(
+ "master",
+ nargs=1,
+ metavar="master",
+ help="Name of the jailhost from the config.",
+ choices=masters)
args = parser.parse_args(argv[:1])
- instance = self.aws.instances[args.master[0]]
+ if len(masters) > 1:
+ master = args.master[0]
+ else:
+ master = masters.keys()[0]
+ instance = self.aws.instances[master]
instance.apply_playbook(path.join(ploy_path, 'roles', 'jailhost.yml'))
|
Don't require name of master if there only is one.
|
diff --git a/modules/backend/classes/Controller.php b/modules/backend/classes/Controller.php
index <HASH>..<HASH> 100644
--- a/modules/backend/classes/Controller.php
+++ b/modules/backend/classes/Controller.php
@@ -555,6 +555,13 @@ class Controller extends Extendable
}
}
+ /*
+ * Generic handler that does nothing
+ */
+ if ($handler == 'onAjax') {
+ return true;
+ }
+
return false;
}
diff --git a/modules/cms/classes/Controller.php b/modules/cms/classes/Controller.php
index <HASH>..<HASH> 100644
--- a/modules/cms/classes/Controller.php
+++ b/modules/cms/classes/Controller.php
@@ -723,6 +723,13 @@ class Controller
}
}
+ /*
+ * Generic handler that does nothing
+ */
+ if ($handler == 'onAjax') {
+ return true;
+ }
+
return false;
}
|
Add generic onAjax handler that does nothing
|
diff --git a/lib/dm-validations/contextual_validators.rb b/lib/dm-validations/contextual_validators.rb
index <HASH>..<HASH> 100644
--- a/lib/dm-validations/contextual_validators.rb
+++ b/lib/dm-validations/contextual_validators.rb
@@ -64,10 +64,16 @@ module DataMapper
# Attribute names given to validation macro, example:
# [:first_name, :last_name] in validates_presence_of :first_name, :last_name
#
- # @param [Hash] opts
+ # @param [Hash] options
# Options supplied to validation macro, example:
# {:context=>:default, :maximum=>50, :allow_nil=>true, :message=>nil}
-
+ #
+ # @option [Symbol] :context
+ # the context in which the new validator should be run
+ # @option [Boolean] :allow_nil
+ # whether or not the new validator should allow nil values
+ # @option [Boolean] :message
+ # the error message the new validator will provide on validation failure
def add(validator_class, *attributes)
options = attributes.last.kind_of?(Hash) ? attributes.pop.dup : {}
normalize_options(options)
|
Clean up and add some more docs for ContextualValidators#add.
|
diff --git a/glance-client/src/main/java/org/openstack/glance/api/DownloadImage.java b/glance-client/src/main/java/org/openstack/glance/api/DownloadImage.java
index <HASH>..<HASH> 100644
--- a/glance-client/src/main/java/org/openstack/glance/api/DownloadImage.java
+++ b/glance-client/src/main/java/org/openstack/glance/api/DownloadImage.java
@@ -22,7 +22,7 @@ public class DownloadImage implements GlanceCommand<ImageDownload> {
@Override
public ImageDownload execute(WebTarget target) {
- Response response = target.path("images").path(id).request(MediaType.APPLICATION_OCTET_STREAM).head();
+ Response response = target.path("images").path(id).request(MediaType.APPLICATION_OCTET_STREAM).get();
Image image = new Image();
image.setUri(response.getHeaderString("x-image-meta-uri"));
image.setName(response.getHeaderString("x-image-meta-name"));
|
[openstack-java-sdk] DownloadImage looks not worked (#<I>)
|
diff --git a/packages/lib/src/utils/errors/DeployError.js b/packages/lib/src/utils/errors/DeployError.js
index <HASH>..<HASH> 100644
--- a/packages/lib/src/utils/errors/DeployError.js
+++ b/packages/lib/src/utils/errors/DeployError.js
@@ -1,17 +1,9 @@
'use strict'
export class DeployError extends Error {
- constructor(message, thepackage, directory) {
+ constructor(message, props) {
super(message)
- this.package = thepackage
- this.directory = directory
- }
-}
-
-export class AppDeployError extends DeployError {
- constructor(message, thepackage, directory, app) {
- super(message, thepackage, directory)
- this.app = app
+ Object.keys(props).forEach(prop => this[prop] = props[prop])
}
}
|
Reimplement DeployError to support generic errors
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -99,7 +99,10 @@ if __name__ == '__main__':
" (like config files) from name-value pairs.",
long_description=get_long_description(),
license='MIT',
- keywords='templating text',
+ keywords=[
+ 'templating',
+ 'text',
+ ],
url='https://github.com/blubberdiblub/eztemplate/',
packages=find_packages(exclude=[
'tests',
|
Split keywords up into a list.
|
diff --git a/pyrogram/methods/users/iter_profile_photos.py b/pyrogram/methods/users/iter_profile_photos.py
index <HASH>..<HASH> 100644
--- a/pyrogram/methods/users/iter_profile_photos.py
+++ b/pyrogram/methods/users/iter_profile_photos.py
@@ -28,7 +28,7 @@ class IterProfilePhotos(Scaffold):
chat_id: Union[int, str],
offset: int = 0,
limit: int = 0,
- ) -> Optional[AsyncGenerator["types.Message", None]]:
+ ) -> Optional[AsyncGenerator["types.Photo", None]]:
"""Iterate through a chat or a user profile photos sequentially.
This convenience method does the same as repeatedly calling :meth:`~pyrogram.Client.get_profile_photos` in a
|
Fix iter_profile_photos wrong hinted return type
|
diff --git a/lib/FsEntry.js b/lib/FsEntry.js
index <HASH>..<HASH> 100644
--- a/lib/FsEntry.js
+++ b/lib/FsEntry.js
@@ -54,11 +54,10 @@ FsEntry.prototype.clone = function () {
};
FsEntry.prototype.getTarget = function (cb) {
- var that = this;
- if (that.type === 'directory') {
- FsEntry.getEntriesInDirectory(that.fsPath, that.path, cb);
+ if (this.type === 'directory') {
+ FsEntry.getEntriesInDirectory(this.fsPath, this.path, cb);
} else {
- fs.readFile(that.fsPath, cb);
+ fs.readFile(this.fsPath, cb);
}
};
|
FsEntry: Removed no longer necessary that=this aliasing.
|
diff --git a/models/PodioItemField.php b/models/PodioItemField.php
index <HASH>..<HASH> 100644
--- a/models/PodioItemField.php
+++ b/models/PodioItemField.php
@@ -398,7 +398,7 @@ class PodioContactItemField extends PodioItemField {
*/
public function contacts() {
return array_map(function($value){
- return new PodioFile($value['value']);
+ return new PodioContact($value['value']);
}, $this->values);
}
@@ -448,7 +448,7 @@ class PodioAssetItemField extends PodioItemField {
*/
public function files() {
return array_map(function($value){
- return new PodioContact($value['value']);
+ return new PodioFile($value['value']);
}, $this->values);
}
}
|
Contacts should return contacts and files should return files. Not the other way around.
|
diff --git a/src/Migration/MigrationManager.php b/src/Migration/MigrationManager.php
index <HASH>..<HASH> 100644
--- a/src/Migration/MigrationManager.php
+++ b/src/Migration/MigrationManager.php
@@ -38,7 +38,7 @@ class MigrationManager
/**
* @var string[]
*/
- private $knownVersions;
+ private $knownVersions = array();
/**
* Creates a new migration manager.
diff --git a/tests/Migration/MigrationManagerTest.php b/tests/Migration/MigrationManagerTest.php
index <HASH>..<HASH> 100644
--- a/tests/Migration/MigrationManagerTest.php
+++ b/tests/Migration/MigrationManagerTest.php
@@ -282,6 +282,13 @@ class MigrationManagerTest extends PHPUnit_Framework_TestCase
$this->assertSame(array('0.8', '0.10', '1.0', '2.0'), $this->manager->getKnownVersions());
}
+ public function testGetKnownVersionsWithoutMigrations()
+ {
+ $this->manager = new MigrationManager(array());
+
+ $this->assertSame(array(), $this->manager->getKnownVersions());
+ }
+
/**
* @param string $sourceVersion
* @param string $targetVersion
|
Fixed bug when no migrations are passed
|
diff --git a/lib/from-new.js b/lib/from-new.js
index <HASH>..<HASH> 100644
--- a/lib/from-new.js
+++ b/lib/from-new.js
@@ -157,7 +157,7 @@ var fs = require('fs')
resolver = unfinishedPaths.first.resolvers.firstThat(function(resolver){ return !resolver.paths })
console.error("?? $["+($.length-1)+"].paths has tested but not-yet-fully-resolved entries")
$.push(resolver)
- console.error("-- pushed the first unhandled resolver ("+resolver.tag+") onto the stack")
+ console.error("-- pushed the first unhandled resolver ("+resolver.resolver.tag+") onto the stack")
return $$($)
} // / if (!unfinishedPaths.empty)
@@ -169,8 +169,9 @@ var fs = require('fs')
var path = untestedPaths.first
console.error("-- testing "+path.path)
- console.error(new(Array)($.length).join(' ')+"("+$[-1].resolver.tag+") "+path.path)
+ console.error("## "+new(Array)($.length).join(' ')+"("+$[-1].resolver.tag+") "+path.path)
return probe(path.path, function(error, extant){
+ console.error("(( probe() called back ))")
if (!error) {
console.error("-- "+path.path+" exists")
console.error("!! calling back")
|
(minor debug) Slight reformatting of debugging output.
|
diff --git a/chef/lib/chef/platform.rb b/chef/lib/chef/platform.rb
index <HASH>..<HASH> 100644
--- a/chef/lib/chef/platform.rb
+++ b/chef/lib/chef/platform.rb
@@ -45,7 +45,6 @@ class Chef
:template => Chef::Provider::Template,
:remote_file => Chef::Provider::RemoteFile,
:remote_directory => Chef::Provider::RemoteDirectory,
- :sysctl => Chef::Provider::Sysctl,
:execute => Chef::Provider::Execute,
:script => Chef::Provider::Script,
:service => Chef::Provider::Service::Init,
|
Removing sysctl from platform.rb
|
diff --git a/modules/custom/social_lazy_loading/src/SocialLazyLoadingTextFormatOverride.php b/modules/custom/social_lazy_loading/src/SocialLazyLoadingTextFormatOverride.php
index <HASH>..<HASH> 100644
--- a/modules/custom/social_lazy_loading/src/SocialLazyLoadingTextFormatOverride.php
+++ b/modules/custom/social_lazy_loading/src/SocialLazyLoadingTextFormatOverride.php
@@ -54,14 +54,6 @@ class SocialLazyLoadingTextFormatOverride implements ConfigFactoryOverrideInterf
}
}
- // Set lazy loading settings.
- if (in_array('lazy.settings', $names, FALSE)) {
- $overrides['lazy.settings']['alter_tag'] = [
- 'img' => 'img',
- 'iframe' => 'iframe',
- ];
- }
-
return $overrides;
}
@@ -85,7 +77,10 @@ class SocialLazyLoadingTextFormatOverride implements ConfigFactoryOverrideInterf
'provider' => 'lazy',
'status' => TRUE,
'weight' => 999,
- 'settings' => [],
+ 'settings' => [
+ 'image' => TRUE,
+ 'iframe' => TRUE,
+ ],
];
}
}
|
Issue #<I> by alex.ksis: Update config override to be compatible with lazy <I>.
|
diff --git a/lib/dtrace.js b/lib/dtrace.js
index <HASH>..<HASH> 100644
--- a/lib/dtrace.js
+++ b/lib/dtrace.js
@@ -27,6 +27,7 @@ function addProbes(dtrace, name) {
'char *',
'int',
'char *',
+ 'int',
'int');
// id, requestid, statusCode, content-type, content-length,
@@ -38,7 +39,6 @@ function addProbes(dtrace, name) {
'char *',
'int',
'int',
- 'char *',
'char *');
obj.start = function fireProbeStart(req) {
|
Different number of probe arguments defined than fired.
|
diff --git a/mapsforge-map-reader/src/main/java/org/mapsforge/map/reader/MapFile.java b/mapsforge-map-reader/src/main/java/org/mapsforge/map/reader/MapFile.java
index <HASH>..<HASH> 100644
--- a/mapsforge-map-reader/src/main/java/org/mapsforge/map/reader/MapFile.java
+++ b/mapsforge-map-reader/src/main/java/org/mapsforge/map/reader/MapFile.java
@@ -366,10 +366,7 @@ public class MapFile implements MapDataStore {
@Override
public boolean supportsTile(Tile tile) {
- if (getMapFileInfo().supportsZoomLevel(tile.zoomLevel)) {
- return tile.getBoundingBox().intersects(getMapFileInfo().boundingBox);
- }
- return false;
+ return tile.getBoundingBox().intersects(getMapFileInfo().boundingBox);
}
private void decodeWayNodesDoubleDelta(LatLong[] waySegment, double tileLatitude, double tileLongitude) {
|
Removed zoom-level check from map data read operation, partially resolves #<I>
(cherry picked from commit <I>df<I>f<I>bb<I>a<I>c<I>add<I>bd<I>)
|
diff --git a/definition/entity/container.js b/definition/entity/container.js
index <HASH>..<HASH> 100644
--- a/definition/entity/container.js
+++ b/definition/entity/container.js
@@ -12,11 +12,6 @@ var checkIsObject = require('../../util/object/check');
const SEPARATOR = ".";
/**
- * Definition of the search informations.
- * @type {object}
- */
-var searchDefinition = require('../../store/search/definition');
-/**
* Container for the application entities.
* @type {object}
*/
@@ -68,7 +63,6 @@ function getFieldConfiguration(fieldPath, customFieldConf){
return _getNode(fieldPath, customFieldConf).toJS();
}
-setEntityConfiguration(searchDefinition);
module.exports = {
getEntityConfiguration: getEntityConfiguration,
|
[definition] Remove search definition from entity definition.
|
diff --git a/ford/sourceform.py b/ford/sourceform.py
index <HASH>..<HASH> 100644
--- a/ford/sourceform.py
+++ b/ford/sourceform.py
@@ -2175,7 +2175,7 @@ class FortranVariable(FortranBase):
self.optional = optional
self.kind = kind
self.strlen = strlen
- self.proto = proto
+ self.proto = copy.copy(proto)
self.doc = doc
self.permission = permission
self.points = points
diff --git a/test/test_project.py b/test/test_project.py
index <HASH>..<HASH> 100644
--- a/test/test_project.py
+++ b/test/test_project.py
@@ -538,6 +538,23 @@ def test_display_private_derived_types(copy_fortran_file):
assert type_names == {"no_attrs", "public_attr", "private_attr"}
+def test_interface_type_name(copy_fortran_file):
+ """Check for shared prototype list"""
+ data = """\
+ module foo
+ type name_t
+ end type name_t
+
+ type(name_t) :: var, var2
+ end module foo
+ """
+
+ settings = copy_fortran_file(data)
+ project = create_project(settings)
+ proto_names = [var.proto[0].name for var in project.modules[0].variables]
+ assert proto_names == ["name_t", "name_t"]
+
+
def test_display_internal_procedures(copy_fortran_file):
"""_very_ basic test of 'proc_internals' setting"""
|
Fix variables declared on same line sharing prototype
Introduced in <I> because `FortranVariable` creation used to create
new `list(proto)` for each variable on a line
|
diff --git a/lib/RestClient.js b/lib/RestClient.js
index <HASH>..<HASH> 100644
--- a/lib/RestClient.js
+++ b/lib/RestClient.js
@@ -179,8 +179,13 @@ RestClient.prototype.request = function (options, callback) {
}
processKeys(data);
- //hang response off the JSON-serialized data
- data.nodeClientResponse = response;
+ //hang response off the JSON-serialized data, as unenumerable to allow for stringify.
+ Object.defineProperty(data, 'nodeClientResponse', {
+ value: response,
+ configurable: true,
+ writeable: true,
+ enumerable: false
+ });
// Resolve promise
if (error) {
|
Make nodeClientResponse unenumerable to allow for stringification of the data object.
|
diff --git a/html/components/toggle.js b/html/components/toggle.js
index <HASH>..<HASH> 100644
--- a/html/components/toggle.js
+++ b/html/components/toggle.js
@@ -110,6 +110,13 @@ const bindToggleUIEvents = (element) => {
// Add click event listener to trigger for each toggle collection we find
toggleTrigger.addEventListener('click', (e) => {
e.preventDefault();
+
+ // If we are in the middle of handling the previous toggle event,
+ // then we should ignore this event
+ if (e.currentTarget.style.pointerEvents === 'none') {
+ return;
+ }
+
// Disable clicks till animation runs
e.currentTarget.style.pointerEvents = 'none';
handleToggleClick(
|
#<I> - bug - Fix HTML toggle to look at other triggers for click events, not just click
|
diff --git a/asq/test/test_join.py b/asq/test/test_join.py
index <HASH>..<HASH> 100644
--- a/asq/test/test_join.py
+++ b/asq/test/test_join.py
@@ -61,4 +61,10 @@ class TestJoin(unittest.TestCase):
e = [(2, 2), (3, 3), (4, 4)]
self.assertEqual(d, e)
-
+ def test_join_closed(self):
+ a = [1, 2, 3, 4, 5]
+ b = [4, 5, 6, 7, 8]
+ c = Queryable(a)
+ c.close()
+ self.assertRaises(ValueError, lambda: c.join(b))
+
|
Improved test coverage for join().
|
diff --git a/src/manipulation.js b/src/manipulation.js
index <HASH>..<HASH> 100644
--- a/src/manipulation.js
+++ b/src/manipulation.js
@@ -283,7 +283,18 @@ function cloneCopyEvent(orig, ret) {
return;
}
- jQuery.data( this, jQuery.data( orig[i++] ) );
+ var oldData = jQuery.data( orig[i++] ), curData = jQuery.data( this, oldData ), events = oldData.events;
+
+ if ( events ) {
+ delete curData.handle;
+ curData.events = {};
+
+ for ( var type in events ) {
+ for ( var handler in events[ type ] ) {
+ jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data );
+ }
+ }
+ }
});
}
|
Explicitly re-bind the events on clone. Copying over the data isn't enough. Fixes #<I>.
|
diff --git a/zipline/finance/slippage.py b/zipline/finance/slippage.py
index <HASH>..<HASH> 100644
--- a/zipline/finance/slippage.py
+++ b/zipline/finance/slippage.py
@@ -141,15 +141,14 @@ def create_transaction(event, order, price, amount):
if amount_magnitude < 1:
raise Exception("Transaction magnitude must be at least 1.")
- txn = {
- 'sid': event.sid,
- 'amount': int(amount),
- 'dt': event.dt,
- 'price': price,
- 'order_id': order.id
- }
-
- transaction = Transaction(**txn)
+ transaction = Transaction(
+ sid=event.sid,
+ amount=int(amount),
+ dt=event.dt,
+ price=price,
+ order_id=order.id
+ )
+
return transaction
|
STY: Use named args for Transaction object creation.
Instead of creating and passing a dict of the object values,
use named args directly.
|
diff --git a/test/more_paranoid_test.rb b/test/more_paranoid_test.rb
index <HASH>..<HASH> 100644
--- a/test/more_paranoid_test.rb
+++ b/test/more_paranoid_test.rb
@@ -2,6 +2,20 @@ require 'test_helper'
class MoreParanoidTest < ParanoidBaseTest
+ test "bidirectional has_many :through association clear is paranoid" do
+ left = ParanoidManyManyParentLeft.create
+ right = ParanoidManyManyParentRight.create
+ left.paranoid_many_many_parent_rights << right
+
+ child = left.paranoid_many_many_children.first
+ assert_equal left, child.paranoid_many_many_parent_left, "Child's left parent is incorrect"
+ assert_equal right, child.paranoid_many_many_parent_right, "Child's right parent is incorrect"
+
+ left.paranoid_many_many_parent_rights.clear
+
+ assert_paranoid_deletion(child)
+ end
+
test "bidirectional has_many :through association delete is paranoid" do
left = ParanoidManyManyParentLeft.create
right = ParanoidManyManyParentRight.create
|
bidirectional many:many clear is paranoid
|
diff --git a/bin/ugrid.js b/bin/ugrid.js
index <HASH>..<HASH> 100755
--- a/bin/ugrid.js
+++ b/bin/ugrid.js
@@ -177,6 +177,7 @@ function handleClose(sock) {
pubmon({event: 'disconnect', uuid: cli.uuid});
cli.sock = null;
}
+ releaseWorkers(cli.uuid);
if (sock.index) delete crossbar[sock.index];
for (var i in cli.topics) { // remove owned topics
delete topicIndex[topics[i].name];
@@ -227,6 +228,14 @@ function register(from, msg, sock)
msg.data = {uuid: uuid, token: 0, id: sock.index};
}
+function releaseWorkers(master) {
+ for (var i in clients) {
+ var d = clients[i].data;
+ if (d && d.jobId == master)
+ d.jobId = "";
+ }
+}
+
function devices(query) {
var result = [];
for (var i in clients) {
|
ugrid.js releases workers at master disconnect
Former-commit-id: d<I>d<I>cb8affe<I>bd<I>cdac<I>fd7a<I>
|
diff --git a/src/Users/ValueObjects/Email.php b/src/Users/ValueObjects/Email.php
index <HASH>..<HASH> 100644
--- a/src/Users/ValueObjects/Email.php
+++ b/src/Users/ValueObjects/Email.php
@@ -29,4 +29,15 @@ class Email
{
return $this->address;
}
+
+ /**
+ * The __toString method allows a class to decide how it will react when it is converted to a string.
+ *
+ * @return string
+ * @link http://php.net/manual/en/language.oop5.magic.php#language.oop5.magic.tostring
+ */
+ function __toString()
+ {
+ return $this->getAddress();
+ }
}
diff --git a/src/Users/ValueObjects/Password.php b/src/Users/ValueObjects/Password.php
index <HASH>..<HASH> 100644
--- a/src/Users/ValueObjects/Password.php
+++ b/src/Users/ValueObjects/Password.php
@@ -34,4 +34,15 @@ class Password
{
return password_verify($password, $this->hash);
}
+
+ /**
+ * The __toString method allows a class to decide how it will react when it is converted to a string.
+ *
+ * @return string
+ * @link http://php.net/manual/en/language.oop5.magic.php#language.oop5.magic.tostring
+ */
+ function __toString()
+ {
+ return '******';
+ }
}
|
Default toString in Email and Password
|
diff --git a/oleutil/connection_windows.go b/oleutil/connection_windows.go
index <HASH>..<HASH> 100644
--- a/oleutil/connection_windows.go
+++ b/oleutil/connection_windows.go
@@ -49,6 +49,7 @@ func ConnectObject(disp *ole.IDispatch, iid *ole.GUID, idisp interface{}) (cooki
point.Release()
return
}
+ return
}
container.Release()
|
Add a missing return to the ConnectObject function
Without the return added by this commit the ConnectObject will return
E_INVALIDARG even if everything went fine.
|
diff --git a/proxy.go b/proxy.go
index <HASH>..<HASH> 100644
--- a/proxy.go
+++ b/proxy.go
@@ -166,7 +166,8 @@ func (p *Proxy) proxy(local net.Conn, address string) {
var remote net.Conn
- glog.V(0).Info("Abount to dial: %s", remoteAddr)
+ glog.Infof("Dialing hostAgent:%v to proxy %v<->%v",
+ remoteAddr, local.LocalAddr(), address)
if p.useTLS && (p.tcpMuxPort > 0) { // Only do TLS if connecting to a TCPMux
config := tls.Config{InsecureSkipVerify: true}
remote, err = tls.Dial("tcp4", remoteAddr, &config)
@@ -182,6 +183,8 @@ func (p *Proxy) proxy(local net.Conn, address string) {
io.WriteString(remote, fmt.Sprintf("Zen-Service: %s/%d\n\n", p.name, remotePort))
}
+ glog.Infof("Using hostAgent:%v to proxy %v<->%v<->%v<->%v",
+ remote.RemoteAddr(), local.LocalAddr(), local.RemoteAddr(), remote.LocalAddr(), address)
go io.Copy(local, remote)
go io.Copy(remote, local)
}
|
added logging for proxy connect and reconnect
|
diff --git a/tests/phpunit/BoltListener.php b/tests/phpunit/BoltListener.php
index <HASH>..<HASH> 100644
--- a/tests/phpunit/BoltListener.php
+++ b/tests/phpunit/BoltListener.php
@@ -325,13 +325,15 @@ class BoltListener implements \PHPUnit_Framework_TestListener
unlink($file);
}
+ // Sort the array by value, in reverse order
arsort($this->tracker);
+
foreach ($this->tracker as $test => $time) {
- $time = substr($time, 0, 6);
+ $time = number_format($time, 6);
file_put_contents($file, "$time\t\t$test\n", FILE_APPEND);
}
- }
- echo "\n\033[32mTest timings written out to: " . TEST_ROOT . "/app/cache/phpunit-test-timer.txt\033[0m\n\n";
+ echo "\n\033[32mTest timings written out to: " . $file . "\033[0m\n\n";
+ }
}
}
|
[Tests] Output timings correctly for exponential numbers
|
diff --git a/github_release.py b/github_release.py
index <HASH>..<HASH> 100755
--- a/github_release.py
+++ b/github_release.py
@@ -641,7 +641,7 @@ def gh_asset_upload(repo_name, tag_name, pattern, dry_run=False, verbose=False):
filenames = []
for package in pattern:
filenames.extend(glob.glob(package))
- set(filenames)
+ filenames = set(filenames)
elif pattern:
filenames = glob.glob(pattern)
else:
diff --git a/tests/test_integration_asset.py b/tests/test_integration_asset.py
index <HASH>..<HASH> 100644
--- a/tests/test_integration_asset.py
+++ b/tests/test_integration_asset.py
@@ -42,7 +42,8 @@ def test_upload(tmpdir):
]))
with push_dir(tmpdir):
- ghr.gh_asset_upload(REPO_NAME, tag_name, "dist/asset_*")
+ ghr.gh_asset_upload(
+ REPO_NAME, tag_name, ["dist/asset_*", "dist/asset_1"])
assert (check_releases([
{"tag_name": tag_name,
|
gh_asset_upload: filter duplicated filename when list of pattern is provided
|
diff --git a/ecore.py b/ecore.py
index <HASH>..<HASH> 100644
--- a/ecore.py
+++ b/ecore.py
@@ -1,8 +1,17 @@
+"""Support for generation for models based on pyecore."""
+
+
class ModelTypeMixin:
- """Implements the model filter by returning all elements of a certain element type."""
+ """
+ Implements the model filter by returning all elements of a certain element type.
+
+ Use this mixin to add the model type iteration faility to another generator task class.
+
+ Attributes:
+ element_type: Ecore type to be searched in model and to be iterated over.
+ """
element_type = None
def filtered_elements(self, model):
- # TODO: yield from model.elements.where(isinstance(e, self.element_type))
- yield from ()
+ return (e for e in model.eAllContents() if isinstance(e, self.element_type))
diff --git a/generator.py b/generator.py
index <HASH>..<HASH> 100644
--- a/generator.py
+++ b/generator.py
@@ -1,3 +1,4 @@
+"""Small framework for multifile generation on top of another template code generator."""
import logging
import os
diff --git a/jinja.py b/jinja.py
index <HASH>..<HASH> 100644
--- a/jinja.py
+++ b/jinja.py
@@ -1,3 +1,4 @@
+"""Jinja2 support for multifile generation."""
import jinja2
from pygen.generator import TemplateGenerator, TemplateFileTask
|
implemented and tested ecore model type filter mixin
|
diff --git a/eZ/Publish/Core/Persistence/Legacy/Content/Search/Gateway/CriteriaConverter.php b/eZ/Publish/Core/Persistence/Legacy/Content/Search/Gateway/CriteriaConverter.php
index <HASH>..<HASH> 100644
--- a/eZ/Publish/Core/Persistence/Legacy/Content/Search/Gateway/CriteriaConverter.php
+++ b/eZ/Publish/Core/Persistence/Legacy/Content/Search/Gateway/CriteriaConverter.php
@@ -10,8 +10,8 @@
namespace eZ\Publish\Core\Persistence\Legacy\Content\Search\Gateway;
use eZ\Publish\API\Repository\Values\Content\Query\Criterion;
+use eZ\Publish\API\Repository\Exceptions\NotImplementedException;
use ezcQuerySelect;
-use RuntimeException;
/**
* Content locator gateway implementation using the zeta database component.
@@ -57,6 +57,6 @@ class CriteriaConverter
}
}
- throw new RuntimeException( 'No conversion for criterion ' . get_class( $criterion ) . ' found.' );
+ throw new NotImplementedException( "No visitor available for: " . get_class( $criterion ) . ' with operator ' . $criterion->operator );
}
}
|
Throw not implemented exception for unknown criteria in legacy search
|
diff --git a/lib/allscripts_unity_client/client.rb b/lib/allscripts_unity_client/client.rb
index <HASH>..<HASH> 100644
--- a/lib/allscripts_unity_client/client.rb
+++ b/lib/allscripts_unity_client/client.rb
@@ -198,7 +198,19 @@ module AllscriptsUnityClient
patientid: patientid,
parameter1: transaction_id
}
- magic(magic_parameters)
+ result = magic(magic_parameters)
+
+ if transaction_id == 0 || transaction_id == '0'
+ # When transaction_id is 0 all medications should be
+ # returned and the result should always be an array.
+ if !result.is_a?(Array) && !result.empty?
+ result = [ result ]
+ elsif result.empty?
+ result = []
+ end
+ end
+
+ result
end
def get_medication_info(userid, ddid, patientid = nil)
diff --git a/lib/allscripts_unity_client/version.rb b/lib/allscripts_unity_client/version.rb
index <HASH>..<HASH> 100644
--- a/lib/allscripts_unity_client/version.rb
+++ b/lib/allscripts_unity_client/version.rb
@@ -1,3 +1,3 @@
module AllscriptsUnityClient
- VERSION = '2.1.5'
+ VERSION = '2.1.6'
end
|
Added support for GetMedicationByTransId 0.
|
diff --git a/tests/unit/test_example.py b/tests/unit/test_example.py
index <HASH>..<HASH> 100644
--- a/tests/unit/test_example.py
+++ b/tests/unit/test_example.py
@@ -46,4 +46,4 @@ def test_example(get_data_file, test_output_dir):
type(profile.get_description()) == dict
and len(profile.get_description().items()) == 7
), "Unexpected result"
- assert "<span class=badge>10</span>" in profile.to_html()
+ assert "<span class=badge>12</span>" in profile.to_html()
|
Update test: More types of warning are shown
|
diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php
index <HASH>..<HASH> 100755
--- a/cake/libs/view/helpers/form.php
+++ b/cake/libs/view/helpers/form.php
@@ -213,7 +213,7 @@ class FormHelper extends AppHelper {
}
}
- $object =& $this->_introspectModel($model);
+ $object = $this->_introspectModel($model);
$this->setEntity($model . '.', true);
$modelEntity = $this->model();
|
Fixing 'Only variables should be assigned by reference' errors in php4 in form helper. Fixes #<I>
|
diff --git a/app/traits/taggable.rb b/app/traits/taggable.rb
index <HASH>..<HASH> 100644
--- a/app/traits/taggable.rb
+++ b/app/traits/taggable.rb
@@ -102,13 +102,13 @@ module Taggable
super
end
- def save
+ def save(options={})
reconcile_tag_ids
- super
+ super(options)
end
- def save!
+ def save!(options={})
reconcile_tag_ids
- super
+ super(options)
end
end
\ No newline at end of file
|
Allow save to take hash of options
This makes it compatible with the new auditable work.
|
diff --git a/lib/core/plugin/cloud_action.rb b/lib/core/plugin/cloud_action.rb
index <HASH>..<HASH> 100644
--- a/lib/core/plugin/cloud_action.rb
+++ b/lib/core/plugin/cloud_action.rb
@@ -42,8 +42,8 @@ class CloudAction < CORL.plugin_class(:nucleon, :action)
def configure
super do
- node_config
yield if block_given?
+ node_config
end
end
|
Node action configurations should come after all child action provider configurations.
|
diff --git a/src/Graviton/RestBundle/Restriction/Handler/Whoami.php b/src/Graviton/RestBundle/Restriction/Handler/Whoami.php
index <HASH>..<HASH> 100644
--- a/src/Graviton/RestBundle/Restriction/Handler/Whoami.php
+++ b/src/Graviton/RestBundle/Restriction/Handler/Whoami.php
@@ -5,6 +5,7 @@
namespace Graviton\RestBundle\Restriction\Handler;
use Doctrine\ODM\MongoDB\DocumentRepository;
+use Graviton\SecurityBundle\Entities\SecurityUser;
use Graviton\SecurityBundle\Service\SecurityUtils;
/**
@@ -50,7 +51,13 @@ class Whoami implements HandlerInterface
*/
public function getValue(DocumentRepository $repository, $fieldPath)
{
- var_dump($this->securityUtils->getSecurityUser());
- return 'anonymous';
+ $user = 'anonymous';
+
+ $securityUser = $this->securityUtils->getSecurityUser();
+ if ($securityUser instanceof SecurityUser) {
+ $user = trim(strtolower($securityUser->getUsername()));
+ }
+
+ return $user;
}
}
|
finalize the whoami restriction handler
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.